]> code.delx.au - gnu-emacs-elpa/blob - packages/ada-ref-man/aarm2012.info
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / ada-ref-man / aarm2012.info
1 This is aarm2012.info, produced by texi2any version 5.2 from
2 aarm2012.texinfo.
3
4 INFO-DIR-SECTION GNU Ada tools
5 START-INFO-DIR-ENTRY
6 * Ada Reference Manual: (arm2012).
7 * Annotated ARM: (arm2012).
8 END-INFO-DIR-ENTRY
9
10 \1f
11 File: aarm2012.info, Node: Top, Next: Front Matter, Up: (dir)
12
13 Annotated Ada Reference Manual
14 ******************************
15
16 Ada Reference Manual, ISO/IEC 8652:2012(E)
17
18 Annotated Ada Reference Manual
19
20 ISO/IEC 8652:2012(E)
21
22 Language and Standard Libraries
23
24 * Menu:
25
26 * Front Matter:: Copyright, Foreword, etc.
27 * 1 :: General
28 * 2 :: Lexical Elements
29 * 3 :: Declarations and Types
30 * 4 :: Names and Expressions
31 * 5 :: Statements
32 * 6 :: Subprograms
33 * 7 :: Packages
34 * 8 :: Visibility Rules
35 * 9 :: Tasks and Synchronization
36 * 10 :: Program Structure and Compilation Issues
37 * 11 :: Exceptions
38 * 12 :: Generic Units
39 * 13 :: Representation Issues
40 * Annex A :: Predefined Language Environment
41 * Annex B :: Interface to Other Languages
42 * Annex C :: Systems Programming
43 * Annex D :: Real-Time Systems
44 * Annex E :: Distributed Systems
45 * Annex F :: Information Systems
46 * Annex G :: Numerics
47 * Annex H :: High Integrity Systems
48 * Annex J :: Obsolescent Features
49 * Annex K :: Language-Defined Aspects and Attributes
50 * Annex L :: Language-Defined Pragmas
51 * Annex M :: Summary of Documentation Requirements
52 * Annex N :: Glossary
53 * Annex P :: Syntax Summary
54 * Annex Q :: Language-Defined Entities
55 * Index :: Index
56
57 \1f
58 File: aarm2012.info, Node: Front Matter, Next: 1, Prev: Top, Up: Top
59
60 Front Matter
61 ************
62
63 Copyright © 1992, 1993, 1994, 1995 Intermetrics, Inc.
64
65 Copyright © 2000 The MITRE Corporation, Inc.
66
67 Copyright © 2004, 2005, 2006 AXE Consultants
68
69 Copyright © 2004, 2005, 2006 Ada-Europe
70
71 Copyright © 2008, 2009, 2010, 2011, 2012 AXE Consultants
72
73
74
75
76
77
78
79 Ada Reference Manual - Language and Standard Libraries
80
81 Copyright © 1992, 1993, 1994, 1995, Intermetrics, Inc.
82
83 This copyright is assigned to the U.S. Government. All rights reserved.
84
85 This document may be copied, in whole or in part, in any form or by any
86 means, as is or with alterations, provided that (1) alterations are
87 clearly marked as alterations and (2) this copyright notice is included
88 unmodified in any copy. Compiled copies of standard library units and
89 examples need not contain this copyright notice so long as the notice is
90 included in all copies of source code and documentation.
91
92 -------
93
94 Technical Corrigendum 1
95
96 Copyright © 2000, The MITRE Corporation. All Rights Reserved.
97
98 This document may be copied, in whole or in part, in any form or by any
99 means, as is, or with alterations, provided that (1) alterations are
100 clearly marked as alterations and (2) this copyright notice is included
101 unmodified in any copy. Any other use or distribution of this document
102 is prohibited without the prior express permission of MITRE.
103
104 You use this document on the condition that you indemnify and hold
105 harmless MITRE, its Board of Trustees, officers, agents, and employees,
106 from any and all liability or damages to yourself or your hardware or
107 software, or third parties, including attorneys' fees, court costs, and
108 other related costs and expenses, arising out of your use of this
109 document irrespective of the cause of said liability.
110
111 MITRE MAKES THIS DOCUMENT AVAILABLE ON AN "AS IS" BASIS AND MAKES NO
112 WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, CAPABILITY, EFFICIENCY
113 MERCHANTABILITY, OR FUNCTIONING OF THIS DOCUMENT. IN NO EVENT WILL MITRE
114 BE LIABLE FOR ANY GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL,
115 EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF MITRE HAS BEEN ADVISED OF THE
116 POSSIBILITY OF SUCH DAMAGES.
117
118
119
120 Amendment 1
121
122 Copyright © 2004, 2005, 2006, 2007, AXE Consultants. All Rights
123 Reserved.
124
125 This document may be copied, in whole or in part, in any form or by any
126 means, as is, or with alterations, provided that (1) alterations are
127 clearly marked as alterations and (2) this copyright notice is included
128 unmodified in any copy. Any other use or distribution of this document
129 is prohibited without the prior express permission of AXE.
130
131 You use this document on the condition that you indemnify and hold
132 harmless AXE, its board, officers, agents, and employees, from any and
133 all liability or damages to yourself or your hardware or software, or
134 third parties, including attorneys' fees, court costs, and other related
135 costs and expenses, arising out of your use of this document
136 irrespective of the cause of said liability.
137
138 AXE MAKES THIS DOCUMENT AVAILABLE ON AN "AS IS" BASIS AND MAKES NO
139 WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, CAPABILITY, EFFICIENCY
140 MERCHANTABILITY, OR FUNCTIONING OF THIS DOCUMENT. IN NO EVENT WILL AXE
141 BE LIABLE FOR ANY GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL,
142 EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF AXE HAS BEEN ADVISED OF THE
143 POSSIBILITY OF SUCH DAMAGES.
144
145 Third Edition
146
147 Copyright © 2008, 2009, 2010, 2011, 2012 AXE Consultants. All Rights
148 Reserved.
149
150 This document may be copied, in whole or in part, in any form or by any
151 means, as is, or with alterations, provided that (1) alterations are
152 clearly marked as alterations and (2) this copyright notice is included
153 unmodified in any copy. Any other use or distribution of this document
154 is prohibited without the prior express permission of AXE.
155
156 You use this document on the condition that you indemnify and hold
157 harmless AXE, its board, officers, agents, and employees, from any and
158 all liability or damages to yourself or your hardware or software, or
159 third parties, including attorneys' fees, court costs, and other related
160 costs and expenses, arising out of your use of this document
161 irrespective of the cause of said liability.
162
163 AXE MAKES THIS DOCUMENT AVAILABLE ON AN "AS IS" BASIS AND MAKES NO
164 WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, CAPABILITY, EFFICIENCY
165 MERCHANTABILITY, OR FUNCTIONING OF THIS DOCUMENT. IN NO EVENT WILL AXE
166 BE LIABLE FOR ANY GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL,
167 EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF AXE HAS BEEN ADVISED OF THE
168 POSSIBILITY OF SUCH DAMAGES.
169
170
171
172 Ada 2005 Consolidated Standard
173
174 Copyright © 2004, 2005, 2006, Ada-Europe.
175
176 This document may be copied, in whole or in part, in any form or by any
177 means, as is, or with alterations, provided that (1) alterations are
178 clearly marked as alterations and (2) this copyright notice is included
179 unmodified in any copy. Any other use or distribution of this document
180 is prohibited without the prior express permission of Ada-Europe.
181
182 You use this document on the condition that you indemnify and hold
183 harmless Ada-Europe and its Board from any and all liability or damages
184 to yourself or your hardware or software, or third parties, including
185 attorneys' fees, court costs, and other related costs and expenses,
186 arising out of your use of this document irrespective of the cause of
187 said liability.
188
189 ADA-EUROPE MAKES THIS DOCUMENT AVAILABLE ON AN "AS IS" BASIS AND MAKES
190 NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, CAPABILITY,
191 EFFICIENCY MERCHANTABILITY, OR FUNCTIONING OF THIS DOCUMENT. IN NO EVENT
192 WILL ADA-EUROPE BE LIABLE FOR ANY GENERAL, CONSEQUENTIAL, INDIRECT,
193 INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF ADA-EUROPE HAS BEEN
194 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
195
196 * Menu:
197
198 * 0.1 :: Foreword to this version of the Ada Reference Manual
199 * 0.2 :: Foreword
200 * 0.3 :: Introduction
201 * 0.99 :: International Standard
202
203 \1f
204 File: aarm2012.info, Node: 0.1, Next: 0.2, Up: Front Matter
205
206 0.1 Foreword
207 ============
208
209 1/3
210 ISO (the International Organization for Standardization) and IEC (the
211 International Electrotechnical Commission) form the specialized system
212 for worldwide standardization. National bodies that are members of ISO
213 or IEC participate in the development of International Standards through
214 technical committees established by the respective organization to deal
215 with particular fields of technical activity. ISO and IEC technical
216 committees collaborate in fields of mutual interest. Other
217 international organizations, governmental and non-governmental, in
218 liaison with ISO and IEC, also take part in the work. In the field of
219 information technology, ISO and IEC have established a joint technical
220 committee, ISO/IEC JTC 1.
221
222 1.1/3
223 International Standards are drafted in accordance with the rules given
224 in the ISO/IEC Directives, Part 2.
225
226 2/3
227 The main task of the joint technical committee is to prepare
228 International Standards. Draft International Standards adopted by the
229 joint technical committee are circulated to national bodies for voting.
230 Publication as an International Standard requires approval by at least
231 75 % of the national bodies casting a vote.
232
233 2.1/3
234 Attention is drawn to the possibility that some of the elements of this
235 document may be the subject of patent rights. ISO and IEC shall not be
236 held responsible for identifying any or all such patent rights.
237
238 3/3
239 International Standard ISO/IEC 8652 was prepared by Joint Technical
240 Committee ISO/IEC JTC 1, Information Technology Subcommittee SC22,
241 Programming languages, their environments and system software
242 interfaces.
243
244 4/3
245 {AI05-0299-1AI05-0299-1} This third edition cancels and replaces the
246 second edition (ISO/IEC 8652:1995), which has been technically revised.
247 It also incorporates the Technical Corrigendum ISO/IEC
248 8652:1995:COR.1:2001 and Amendment ISO/IEC 8652:1995:AMD 1:2007.
249
250 5.a/3
251 Discussion: This document is the Annotated Ada Reference
252 Manual (AARM). It contains the entire text of the Ada 2012
253 standard (ISO/IEC 8652:201x), plus various annotations. It is
254 intended primarily for compiler writers, validation test
255 writers, and other language lawyers. The annotations include
256 detailed rationale for individual rules and explanations of
257 some of the more arcane interactions among the rules.
258
259 \1f
260 File: aarm2012.info, Node: 0.2, Next: 0.99, Prev: 0.1, Up: Front Matter
261
262 0.2 Introduction
263 ================
264
265 1
266 This is the Annotated Ada Reference Manual.
267
268 2
269 Other available Ada documents include:
270
271 3/3
272 * {AI95-00387-01AI95-00387-01} {AI05-0245-1AI05-0245-1} Ada 2012
273 Rationale. This gives an introduction to the changes and new
274 features in Ada 2012, and explains the rationale behind them.
275 Programmers should read this rationale before reading this Standard
276 in depth. Rationales for Ada 83, Ada 95, and Ada 2005 are also
277 available.
278
279 3.a/3
280 Discussion: {AI05-0245-1AI05-0245-1} As of this writing
281 (December 2012), only five chapters of the Ada 2012 Rationale
282 have been published. Additional chapters are in development
283 and should be published during 2013.
284
285 4/1
286 * This paragraph was deleted.
287
288 5/3
289 * The Ada Reference Manual (RM). This is the International Standard
290 -- ISO/IEC 8652:201x.
291
292 Design Goals
293
294 6/3
295 {AI95-00387-01AI95-00387-01} Ada was originally designed with three
296 overriding concerns: program reliability and maintenance, programming as
297 a human activity, and efficiency. The 1995 revision to the language was
298 designed to provide greater flexibility and extensibility, additional
299 control over storage management and synchronization, and standardized
300 packages oriented toward supporting important application areas, while
301 at the same time retaining the original emphasis on reliability,
302 maintainability, and efficiency. This third edition provides further
303 flexibility and adds more standardized packages within the framework
304 provided by the 1995 revision.
305
306 7
307 The need for languages that promote reliability and simplify maintenance
308 is well established. Hence emphasis was placed on program readability
309 over ease of writing. For example, the rules of the language require
310 that program variables be explicitly declared and that their type be
311 specified. Since the type of a variable is invariant, compilers can
312 ensure that operations on variables are compatible with the properties
313 intended for objects of the type. Furthermore, error-prone notations
314 have been avoided, and the syntax of the language avoids the use of
315 encoded forms in favor of more English-like constructs. Finally, the
316 language offers support for separate compilation of program units in a
317 way that facilitates program development and maintenance, and which
318 provides the same degree of checking between units as within a unit.
319
320 8
321 Concern for the human programmer was also stressed during the design.
322 Above all, an attempt was made to keep to a relatively small number of
323 underlying concepts integrated in a consistent and systematic way while
324 continuing to avoid the pitfalls of excessive involution. The design
325 especially aims to provide language constructs that correspond
326 intuitively to the normal expectations of users.
327
328 9
329 Like many other human activities, the development of programs is
330 becoming ever more decentralized and distributed. Consequently, the
331 ability to assemble a program from independently produced software
332 components continues to be a central idea in the design. The concepts
333 of packages, of private types, and of generic units are directly related
334 to this idea, which has ramifications in many other aspects of the
335 language. An allied concern is the maintenance of programs to match
336 changing requirements; type extension and the hierarchical library
337 enable a program to be modified while minimizing disturbance to existing
338 tested and trusted components.
339
340 10
341 No language can avoid the problem of efficiency. Languages that require
342 over-elaborate compilers, or that lead to the inefficient use of storage
343 or execution time, force these inefficiencies on all machines and on all
344 programs. Every construct of the language was examined in the light of
345 present implementation techniques. Any proposed construct whose
346 implementation was unclear or that required excessive machine resources
347 was rejected.
348
349 Language Summary
350
351 11
352 An Ada program is composed of one or more program units. Program units
353 may be subprograms (which define executable algorithms), packages (which
354 define collections of entities), task units (which define concurrent
355 computations), protected units (which define operations for the
356 coordinated sharing of data between tasks), or generic units (which
357 define parameterized forms of packages and subprograms). Each program
358 unit normally consists of two parts: a specification, containing the
359 information that must be visible to other units, and a body, containing
360 the implementation details, which need not be visible to other units.
361 Most program units can be compiled separately.
362
363 12
364 This distinction of the specification and body, and the ability to
365 compile units separately, allows a program to be designed, written, and
366 tested as a set of largely independent software components.
367
368 13
369 An Ada program will normally make use of a library of program units of
370 general utility. The language provides means whereby individual
371 organizations can construct their own libraries. All libraries are
372 structured in a hierarchical manner; this enables the logical
373 decomposition of a subsystem into individual components. The text of a
374 separately compiled program unit must name the library units it
375 requires.
376
377 14
378 Program Units
379
380 15
381 A subprogram is the basic unit for expressing an algorithm. There are
382 two kinds of subprograms: procedures and functions. A procedure is the
383 means of invoking a series of actions. For example, it may read data,
384 update variables, or produce some output. It may have parameters, to
385 provide a controlled means of passing information between the procedure
386 and the point of call. A function is the means of invoking the
387 computation of a value. It is similar to a procedure, but in addition
388 will return a result.
389
390 16
391 A package is the basic unit for defining a collection of logically
392 related entities. For example, a package can be used to define a set of
393 type declarations and associated operations. Portions of a package can
394 be hidden from the user, thus allowing access only to the logical
395 properties expressed by the package specification.
396
397 17
398 Subprogram and package units may be compiled separately and arranged in
399 hierarchies of parent and child units giving fine control over
400 visibility of the logical properties and their detailed implementation.
401
402 18
403 A task unit is the basic unit for defining a task whose sequence of
404 actions may be executed concurrently with those of other tasks. Such
405 tasks may be implemented on multicomputers, multiprocessors, or with
406 interleaved execution on a single processor. A task unit may define
407 either a single executing task or a task type permitting the creation of
408 any number of similar tasks.
409
410 19/2
411 {AI95-00114-01AI95-00114-01} A protected unit is the basic unit for
412 defining protected operations for the coordinated use of data shared
413 between tasks. Simple mutual exclusion is provided automatically, and
414 more elaborate sharing protocols can be defined. A protected operation
415 can either be a subprogram or an entry. A protected entry specifies a
416 Boolean expression (an entry barrier) that must be True before the body
417 of the entry is executed. A protected unit may define a single
418 protected object or a protected type permitting the creation of several
419 similar objects.
420
421 20
422 Declarations and Statements
423
424 21
425 The body of a program unit generally contains two parts: a declarative
426 part, which defines the logical entities to be used in the program unit,
427 and a sequence of statements, which defines the execution of the program
428 unit.
429
430 22
431 The declarative part associates names with declared entities. For
432 example, a name may denote a type, a constant, a variable, or an
433 exception. A declarative part also introduces the names and parameters
434 of other nested subprograms, packages, task units, protected units, and
435 generic units to be used in the program unit.
436
437 23
438 The sequence of statements describes a sequence of actions that are to
439 be performed. The statements are executed in succession (unless a
440 transfer of control causes execution to continue from another place).
441
442 24
443 An assignment statement changes the value of a variable. A procedure
444 call invokes execution of a procedure after associating any actual
445 parameters provided at the call with the corresponding formal
446 parameters.
447
448 25
449 Case statements and if statements allow the selection of an enclosed
450 sequence of statements based on the value of an expression or on the
451 value of a condition.
452
453 26
454 The loop statement provides the basic iterative mechanism in the
455 language. A loop statement specifies that a sequence of statements is
456 to be executed repeatedly as directed by an iteration scheme, or until
457 an exit statement is encountered.
458
459 27
460 A block statement comprises a sequence of statements preceded by the
461 declaration of local entities used by the statements.
462
463 28
464 Certain statements are associated with concurrent execution. A delay
465 statement delays the execution of a task for a specified duration or
466 until a specified time. An entry call statement is written as a
467 procedure call statement; it requests an operation on a task or on a
468 protected object, blocking the caller until the operation can be
469 performed. A called task may accept an entry call by executing a
470 corresponding accept statement, which specifies the actions then to be
471 performed as part of the rendezvous with the calling task. An entry
472 call on a protected object is processed when the corresponding entry
473 barrier evaluates to true, whereupon the body of the entry is executed.
474 The requeue statement permits the provision of a service as a number of
475 related activities with preference control. One form of the select
476 statement allows a selective wait for one of several alternative
477 rendezvous. Other forms of the select statement allow conditional or
478 timed entry calls and the asynchronous transfer of control in response
479 to some triggering event.
480
481 29
482 Execution of a program unit may encounter error situations in which
483 normal program execution cannot continue. For example, an arithmetic
484 computation may exceed the maximum allowed value of a number, or an
485 attempt may be made to access an array component by using an incorrect
486 index value. To deal with such error situations, the statements of a
487 program unit can be textually followed by exception handlers that
488 specify the actions to be taken when the error situation arises.
489 Exceptions can be raised explicitly by a raise statement.
490
491 30
492 Data Types
493
494 31
495 Every object in the language has a type, which characterizes a set of
496 values and a set of applicable operations. The main classes of types
497 are elementary types (comprising enumeration, numeric, and access types)
498 and composite types (including array and record types).
499
500 32/2
501 {AI95-00285-01AI95-00285-01} {AI95-00387-01AI95-00387-01} An enumeration
502 type defines an ordered set of distinct enumeration literals, for
503 example a list of states or an alphabet of characters. The enumeration
504 types Boolean, Character, Wide_Character, and Wide_Wide_Character are
505 predefined.
506
507 33
508 Numeric types provide a means of performing exact or approximate
509 numerical computations. Exact computations use integer types, which
510 denote sets of consecutive integers. Approximate computations use
511 either fixed point types, with absolute bounds on the error, or floating
512 point types, with relative bounds on the error. The numeric types
513 Integer, Float, and Duration are predefined.
514
515 34/2
516 {AI95-00285-01AI95-00285-01} {AI95-00387-01AI95-00387-01} Composite
517 types allow definitions of structured objects with related components.
518 The composite types in the language include arrays and records. An
519 array is an object with indexed components of the same type. A record
520 is an object with named components of possibly different types. Task
521 and protected types are also forms of composite types. The array types
522 String, Wide_String, and Wide_Wide_String are predefined.
523
524 35
525 Record, task, and protected types may have special components called
526 discriminants which parameterize the type. Variant record structures
527 that depend on the values of discriminants can be defined within a
528 record type.
529
530 36
531 Access types allow the construction of linked data structures. A value
532 of an access type represents a reference to an object declared as
533 aliased or to an object created by the evaluation of an allocator.
534 Several variables of an access type may designate the same object, and
535 components of one object may designate the same or other objects. Both
536 the elements in such linked data structures and their relation to other
537 elements can be altered during program execution. Access types also
538 permit references to subprograms to be stored, passed as parameters, and
539 ultimately dereferenced as part of an indirect call.
540
541 37
542 Private types permit restricted views of a type. A private type can be
543 defined in a package so that only the logically necessary properties are
544 made visible to the users of the type. The full structural details that
545 are externally irrelevant are then only available within the package and
546 any child units.
547
548 38
549 From any type a new type may be defined by derivation. A type, together
550 with its derivatives (both direct and indirect) form a derivation class.
551 Class-wide operations may be defined that accept as a parameter an
552 operand of any type in a derivation class. For record and private
553 types, the derivatives may be extensions of the parent type. Types that
554 support these object-oriented capabilities of class-wide operations and
555 type extension must be tagged, so that the specific type of an operand
556 within a derivation class can be identified at run time. When an
557 operation of a tagged type is applied to an operand whose specific type
558 is not known until run time, implicit dispatching is performed based on
559 the tag of the operand.
560
561 38.1/2
562 {AI95-00387-01AI95-00387-01} Interface types provide abstract models
563 from which other interfaces and types may be composed and derived. This
564 provides a reliable form of multiple inheritance. Interface types may
565 also be implemented by task types and protected types thereby enabling
566 concurrent programming and inheritance to be merged.
567
568 39
569 The concept of a type is further refined by the concept of a subtype,
570 whereby a user can constrain the set of allowed values of a type.
571 Subtypes can be used to define subranges of scalar types, arrays with a
572 limited set of index values, and records and private types with
573 particular discriminant values.
574
575 40
576 Other Facilities
577
578 41/2
579 {AI95-00387-01AI95-00387-01} Aspect clauses can be used to specify the
580 mapping between types and features of an underlying machine. For
581 example, the user can specify that objects of a given type must be
582 represented with a given number of bits, or that the components of a
583 record are to be represented using a given storage layout. Other
584 features allow the controlled use of low level, nonportable, or
585 implementation-dependent aspects, including the direct insertion of
586 machine code.
587
588 42/2
589 {AI95-00387-01AI95-00387-01} The predefined environment of the language
590 provides for input-output and other capabilities by means of standard
591 library packages. Input-output is supported for values of user-defined
592 as well as of predefined types. Standard means of representing values
593 in display form are also provided.
594
595 42.1/2
596 {AI95-00387-01AI95-00387-01} The predefined standard library packages
597 provide facilities such as string manipulation, containers of various
598 kinds (vectors, lists, maps, etc.), mathematical functions, random
599 number generation, and access to the execution environment.
600
601 42.2/2
602 {AI95-00387-01AI95-00387-01} The specialized annexes define further
603 predefined library packages and facilities with emphasis on areas such
604 as real-time scheduling, interrupt handling, distributed systems,
605 numerical computation, and high-integrity systems.
606
607 43
608 Finally, the language provides a powerful means of parameterization of
609 program units, called generic program units. The generic parameters can
610 be types and subprograms (as well as objects and packages) and so allow
611 general algorithms and data structures to be defined that are applicable
612 to all types of a given class.
613
614 Language Changes
615
616 Paragraphs 44 through 57 have been removed as they described differences
617 from the first edition of Ada (Ada 83).
618
619 57.1/3
620 {AI95-00387-01AI95-00387-01} This International Standard replaces the
621 second edition of 1995. It modifies the previous edition by making
622 changes and additions that improve the capability of the language and
623 the reliability of programs written in the language. This edition
624 incorporates the changes from Amendment 1 (ISO/IEC 8652:1995:AMD
625 1:2007), which were designed to improve the portability of programs,
626 interfacing to other languages, and both the object-oriented and
627 real-time capabilities.
628
629 57.2/3
630 {AI95-00387-01AI95-00387-01} {AI05-0299-1AI05-0299-1} Significant
631 changes originating in Amendment 1 are incorporated:
632
633 57.3/3
634 * Support for program text is extended to cover the entire ISO/IEC
635 10646:2003 repertoire. Execution support now includes the 32-bit
636 character set. See subclauses *note 2.1::, *note 3.5.2::, *note
637 3.6.3::, *note A.1::, *note A.3::, and *note A.4::.
638
639 57.4/3
640 * The object-oriented model has been improved by the addition of an
641 interface facility which provides multiple inheritance and
642 additional flexibility for type extensions. See subclauses *note
643 3.4::, *note 3.9::, and *note 7.3::. An alternative notation for
644 calling operations more akin to that used in other languages has
645 also been added. See subclause *note 4.1.3::.
646
647 57.5/3
648 * Access types have been further extended to unify properties such as
649 the ability to access constants and to exclude null values. See
650 clause *note 3.10::. Anonymous access types are now permitted more
651 freely and anonymous access-to-subprogram types are introduced.
652 See subclauses *note 3.3::, *note 3.6::, *note 3.10::, and *note
653 8.5.1::.
654
655 57.6/3
656 * The control of structure and visibility has been enhanced to permit
657 mutually dependent references between units and finer control over
658 access from the private part of a package. See subclauses *note
659 3.10.1:: and *note 10.1.2::. In addition, limited types have been
660 made more useful by the provision of aggregates, constants, and
661 constructor functions. See subclauses *note 4.3::, *note 6.5::,
662 and *note 7.5::.
663
664 57.7/3
665 * The predefined environment has been extended to include additional
666 time and calendar operations, improved string handling, a
667 comprehensive container library, file and directory management, and
668 access to environment variables. See subclauses *note 9.6.1::,
669 *note A.4::, *note A.16::, *note A.17::, and *note A.18::.
670
671 57.8/3
672 * Two of the Specialized Needs Annexes have been considerably
673 enhanced:
674
675 57.9/2
676 * The Real-Time Systems Annex now includes the Ravenscar
677 profile for high-integrity systems, further dispatching
678 policies such as Round Robin and Earliest Deadline First,
679 support for timing events, and support for control of CPU
680 time utilization. See subclauses *note D.2::, *note
681 D.13::, *note D.14::, and *note D.15::.
682
683 57.10/3
684 * The Numerics Annex now includes support for real and
685 complex vectors and matrices as previously defined in
686 ISO/IEC 13813:1997 plus further basic operations for
687 linear algebra. See subclause *note G.3::.
688
689 57.11/3
690 * The overall reliability of the language has been enhanced by a
691 number of improvements. These include new syntax which detects
692 accidental overloading, as well as pragmas for making assertions
693 and giving better control over the suppression of checks. See
694 subclauses *note 6.1::, *note 11.4.2::, and *note 11.5::.
695
696 57.12/3
697 {AI05-0245-1AI05-0245-1} In addition, this third edition makes
698 enhancements to address two important issues, namely, the particular
699 problems of multiprocessor architectures, and the need to further
700 increase the capabilities regarding assertions for correctness. It also
701 makes additional changes and additions that improve the capability of
702 the language and the reliability of programs written in the language.
703
704 57.13/3
705 {AI05-0245-1AI05-0245-1} {AI05-0299-1AI05-0299-1} The following
706 significant changes with respect to the 1995 edition as amended by
707 Amendment 1 are incorporated:
708
709 57.14/3
710 * New syntax (the aspect specification) is introduced to enable
711 properties to be specified for various entities in a more
712 structured manner than through pragmas. See subclause *note
713 13.1.1::.
714
715 57.15/3
716 * The concept of assertions introduced in the 2005 edition is
717 extended with the ability to specify preconditions and
718 postconditions for subprograms, and invariants for private types.
719 The concept of constraints in defining subtypes is supplemented
720 with subtype predicates that enable subsets to be specified other
721 than as simple ranges. These properties are all indicated using
722 aspect specifications. See subclauses *note 3.2.4::, *note
723 6.1.1::, and *note 7.3.2::.
724
725 57.16/3
726 * New forms of expressions are introduced. These are if expressions,
727 case expressions, quantified expressions, and expression functions.
728 As well as being useful for programming in general by avoiding the
729 introduction of unnecessary assignments, they are especially
730 valuable in conditions and invariants since they avoid the need to
731 introduce auxiliary functions. See subclauses *note 4.5.7::, *note
732 4.5.8::, and *note 6.8::. Membership tests are also made more
733 flexible. See subclauses *note 4.4:: and *note 4.5.2::.
734
735 57.17/3
736 * A number of changes are made to subprogram parameters. Functions
737 may now have parameters of all modes. In order to mitigate
738 consequent (and indeed existing) problems of inadvertent order
739 dependence, rules are introduced to reduce aliasing. A parameter
740 may now be explicitly marked as aliased and the type of a parameter
741 may be incomplete in certain circumstances. See subclauses *note
742 3.10.1::, *note 6.1::, and *note 6.4.1::.
743
744 57.18/3
745 * The use of access types is now more flexible. The rules for
746 accessibility and certain conversions are improved. See subclauses
747 *note 3.10.2::, *note 4.5.2::, *note 4.6::, and *note 8.6::.
748 Furthermore, better control of storage pools is provided. See
749 subclause *note 13.11.4::.
750
751 57.19/3
752 * The Real-Time Systems Annex now includes facilities for defining
753 domains of processors and assigning tasks to them. Improvements
754 are made to scheduling and budgeting facilities. See subclauses
755 *note D.10.1::, *note D.14::, and *note D.16::.
756
757 57.20/3
758 * A number of important improvements are made to the standard
759 library. These include packages for conversions between strings
760 and UTF encodings, and classification functions for wide and wide
761 wide characters. Internationalization is catered for by a package
762 giving locale information. See subclauses *note A.3::, *note
763 A.4.11::, and *note A.19::. The container library is extended to
764 include bounded forms of the existing containers and new containers
765 for indefinite objects, multiway trees, and queues. See subclause
766 *note A.18::.
767
768 57.21/3
769 * Finally, certain features are added primarily to ease the use of
770 containers, such as the ability to iterate over all elements in a
771 container without having to encode the iteration. These can also
772 be used for iteration over arrays, and within quantified
773 expressions. See subclauses *note 4.1.5::, *note 4.1.6::, *note
774 5.5.1::, and *note 5.5.2::.
775
776 Instructions for Comment Submission
777
778 58/1
779 Informal comments on this International Standard may be sent via e-mail
780 to ada-comment@ada-auth.org. If appropriate, the Project Editor will
781 initiate the defect correction procedure.
782
783 59
784 Comments should use the following format:
785
786 60/3
787 !topic Title summarizing comment
788 !reference Ada 2012 RMss.ss(pp)
789 !from Author Name yy-mm-dd
790 !keywords keywords related to topic
791 !discussion
792
793 text of discussion
794
795 61/3
796 where ss.ss is the clause or subclause number, pp is the paragraph
797 number where applicable, and yy-mm-dd is the date the comment was sent.
798 The date is optional, as is the !keywords line.
799
800 62/1
801 Please use a descriptive "Subject" in your e-mail message, and limit
802 each message to a single comment.
803
804 63
805 When correcting typographical errors or making minor wording
806 suggestions, please put the correction directly as the topic of the
807 comment; use square brackets [ ] to indicate text to be omitted and
808 curly braces { } to indicate text to be added, and provide enough
809 context to make the nature of the suggestion self-evident or put
810 additional information in the body of the comment, for example:
811
812 64
813 !topic [c]{C}haracter
814 !topic it[']s meaning is not defined
815
816 65
817 Formal requests for interpretations and for reporting defects in this
818 International Standard may be made in accordance with the ISO/IEC JTC 1
819 Directives and the ISO/IEC JTC 1/SC 22 policy for interpretations.
820 National Bodies may submit a Defect Report to ISO/IEC JTC 1/SC 22 for
821 resolution under the JTC 1 procedures. A response will be provided and,
822 if appropriate, a Technical Corrigendum will be issued in accordance
823 with the procedures.
824
825 Acknowledgements for the Ada 83 edition
826
827 65.1/3
828 Ada is the result of a collective effort to design a common language for
829 programming large scale and real-time systems.
830
831 65.2/3
832 The common high order language program began in 1974. The requirements
833 of the United States Department of Defense were formalized in a series
834 of documents which were extensively reviewed by the Services, industrial
835 organizations, universities, and foreign military departments. The Ada
836 language was designed in accordance with the final (1978) form of these
837 requirements, embodied in the Steelman specification.
838
839 65.3/3
840 The Ada design team was led by Jean D. Ichbiah and has included Bernd
841 Krieg-Brueckner, Brian A. Wichmann, Henry F. Ledgard, Jean-Claude
842 Heliard, Jean-Loup Gailly, Jean-Raymond Abrial, John G.P. Barnes, Mike
843 Woodger, Olivier Roubine, Paul N. Hilfinger, and Robert Firth.
844
845 65.4/3
846 At various stages of the project, several people closely associated with
847 the design team made major contributions. They include J.B. Goodenough,
848 R.F. Brender, M.W. Davis, G. Ferran, K. Lester, L. MacLaren, E. Morel,
849 I.R. Nassi, I.C. Pyle, S.A. Schuman, and S.C. Vestal.
850
851 65.5/3
852 Two parallel efforts that were started in the second phase of this
853 design had a deep influence on the language. One was the development of
854 a formal definition using denotational semantics, with the participation
855 of V. Donzeau-Gouge, G. Kahn, and B. Lang. The other was the design of
856 a test translator with the participation of K. Ripken, P. Boullier, P.
857 Cadiou, J. Holden, J.F. Hueras, R.G. Lange, and D.T. Cornhill. The
858 entire effort benefitted from the dedicated assistance of Lyn Churchill
859 and Marion Myers, and the effective technical support of B. Gravem, W.L.
860 Heimerdinger, and P. Cleve. H.G. Schmitz served as program manager.
861
862 65.6/3
863 Over the five years spent on this project, several intense week-long
864 design reviews were conducted, with the participation of P. Belmont, B.
865 Brosgol, P. Cohen, R. Dewar, A. Evans, G. Fisher, H. Harte, A.L. Hisgen,
866 P. Knueven, M. Kronental, N. Lomuto, E. Ploedereder, G. Seegmueller, V.
867 Stenning, D. Taffs, and also F. Belz, R. Converse, K. Correll, A.N.
868 Habermann, J. Sammet, S. Squires, J. Teller, P. Wegner, and P.R.
869 Wetherall.
870
871 65.7/3
872 Several persons had a constructive influence with their comments,
873 criticisms and suggestions. They include P. Brinch Hansen, G. Goos,
874 C.A.R. Hoare, Mark Rain, W.A. Wulf, and also E. Boebert, P. Bonnard, H.
875 Clausen, M. Cox, G. Dismukes, R. Eachus, T. Froggatt, H. Ganzinger, C.
876 Hewitt, S. Kamin, R. Kotler, O. Lecarme, J.A.N. Lee, J.L. Mansion, F.
877 Minel, T. Phinney, J. Roehrich, V. Schneider, A. Singer, D. Slosberg,
878 I.C. Wand, the reviewers of Ada-Europe, AdaTech, Afcet, those of the
879 LMSC review team, and those of the Ada Tokyo Study Group.
880
881 65.8/3
882 These reviews and comments, the numerous evaluation reports received at
883 the end of the first and second phase, the nine hundred language issue
884 reports and test and evaluation reports received from fifteen different
885 countries during the third phase of the project, the thousands of
886 comments received during the ANSI Canvass, and the on-going work of the
887 IFIP Working Group 2.4 on system implementation languages and that of
888 the Purdue Europe LTPL-E committee, all had a substantial influence on
889 the final definition of Ada.
890
891 65.9/3
892 The Military Departments and Agencies have provided a broad base of
893 support including funding, extensive reviews, and countless individual
894 contributions by the members of the High Order Language Working Group
895 and other interested personnel. In particular, William A. Whitaker
896 provided leadership for the program during the formative stages. David
897 A. Fisher was responsible for the successful development and refinement
898 of the language requirement documents that led to the Steelman
899 specification.
900
901 65.10/3
902 The Ada 83 language definition was developed by Cii Honeywell Bull and
903 later Alsys, and by Honeywell Systems and Research Center, under
904 contract to the United States Department of Defense. William E. Carlson
905 and later Larry E. Druffel served as the technical representatives of
906 the United States Government and effectively coordinated the efforts of
907 all participants in the Ada program.
908
909 Acknowledgements for the Ada 95 edition
910
911 66
912 This International Standard was prepared by the Ada 9X Mapping/Revision
913 Team based at Intermetrics, Inc., which has included: W. Carlson,
914 Program Manager; T. Taft, Technical Director; J. Barnes (consultant); B.
915 Brosgol (consultant); R. Duff (Oak Tree Software); M. Edwards; C.
916 Garrity; R. Hilliard; O. Pazy (consultant); D. Rosenfeld; L. Shafer; W.
917 White; M. Woodger.
918
919 67
920 The following consultants to the Ada 9X Project contributed to the
921 Specialized Needs Annexes: T. Baker (Real-Time/Systems Programming --
922 SEI, FSU); K. Dritz (Numerics -- Argonne National Laboratory); A.
923 Gargaro (Distributed Systems -- Computer Sciences); J. Goodenough
924 (Real-Time/Systems Programming -- SEI); J. McHugh (Secure Systems --
925 consultant); B. Wichmann (Safety-Critical Systems -- NPL: UK).
926
927 68
928 This work was regularly reviewed by the Ada 9X Distinguished Reviewers
929 and the members of the Ada 9X Rapporteur Group (XRG): E. Ploedereder,
930 Chairman of DRs and XRG (University of Stuttgart: Germany); B. Bardin
931 (Hughes); J. Barnes (consultant: UK); B. Brett (DEC); B. Brosgol
932 (consultant); R. Brukardt (RR Software); N. Cohen (IBM); R. Dewar (NYU);
933 G. Dismukes (TeleSoft); A. Evans (consultant); A. Gargaro (Computer
934 Sciences); M. Gerhardt (ESL); J. Goodenough (SEI); S. Heilbrunner
935 (University of Salzburg: Austria); P. Hilfinger (UC/Berkeley); B.
936 Källberg (CelsiusTech: Sweden); M. Kamrad II (Unisys); J. van Katwijk
937 (Delft University of Technology: The Netherlands); V. Kaufman (Russia);
938 P. Kruchten (Rational); R. Landwehr (CCI: Germany); C. Lester
939 (Portsmouth Polytechnic: UK); L. Månsson (TELIA Research: Sweden); S.
940 Michell (Multiprocessor Toolsmiths: Canada); M. Mills (US Air Force); D.
941 Pogge (US Navy); K. Power (Boeing); O. Roubine (Verdix: France); A.
942 Strohmeier (Swiss Fed Inst of Technology: Switzerland); W. Taylor
943 (consultant: UK); J. Tokar (Tartan); E. Vasilescu (Grumman); J. Vladik
944 (Prospeks s.r.o.: Czech Republic); S. Van Vlierberghe (OFFIS: Belgium).
945
946 69
947 Other valuable feedback influencing the revision process was provided by
948 the Ada 9X Language Precision Team (Odyssey Research Associates), the
949 Ada 9X User/Implementer Teams (AETECH, Tartan, TeleSoft), the Ada 9X
950 Implementation Analysis Team (New York University) and the Ada
951 community-at-large.
952
953 70
954 Special thanks go to R. Mathis, Convenor of ISO/IEC JTC 1/SC 22 Working
955 Group 9.
956
957 71
958 The Ada 9X Project was sponsored by the Ada Joint Program Office.
959 Christine M. Anderson at the Air Force Phillips Laboratory (Kirtland
960 AFB, NM) was the project manager.
961
962 Acknowledgements for the Corrigendum version
963
964 71.1/3
965 The editor [R. Brukardt (USA)] would like to thank the many people whose
966 hard work and assistance has made this update possible.
967
968 71.2/1
969 Thanks go out to all of the members of the ISO/IEC JTC 1/SC 22/WG 9 Ada
970 Rapporteur Group, whose work on creating and editing the wording
971 corrections was critical to the entire process. Especially valuable
972 contributions came from the chairman of the ARG, E. Ploedereder
973 (Germany), who kept the process moving; J. Barnes (UK) and K. Ishihata
974 (Japan), whose extremely detailed reviews kept the editor on his toes;
975 G. Dismukes (USA), M. Kamrad (USA), P. Leroy (France), S. Michell
976 (Canada), T. Taft (USA), J. Tokar (USA), and other members too numerous
977 to mention.
978
979 71.3/1
980 Special thanks go to R. Duff (USA) for his explanations of the previous
981 system of formatting of these documents during the tedious conversion to
982 more modern formats. Special thanks also go to the convenor of ISO/IEC
983 JTC 1/SC 22/WG 9, J. Moore (USA), without whose help and support the
984 Corrigendum and this consolidated reference manual would not have been
985 possible.
986
987 Acknowledgements for the Amendment 1 version
988
989 71.4/3
990 The editor [R. Brukardt (USA)] would like to thank the many people whose
991 hard work and assistance has made this update possible.
992
993 71.5/2
994 Thanks go out to all of the members of the ISO/IEC JTC 1/SC 22/WG 9 Ada
995 Rapporteur Group, whose work on creating and editing the wording
996 corrections was critical to the entire process. Especially valuable
997 contributions came from the chairman of the ARG, P. Leroy (France), who
998 kept the process on schedule; J. Barnes (UK) whose careful reviews found
999 many typographical errors; T. Taft (USA), who always seemed to have a
1000 suggestion when we were stuck, and who also was usually able to provide
1001 the valuable service of explaining why things were as they are; S. Baird
1002 (USA), who found many obscure problems with the proposals; and A. Burns
1003 (UK), who pushed many of the real-time proposals to completion. Other
1004 ARG members who contributed were: R. Dewar (USA), G. Dismukes (USA), R.
1005 Duff (USA), K. Ishihata (Japan), S. Michell (Canada), E. Ploedereder
1006 (Germany), J.P. Rosen (France), E. Schonberg (USA), J. Tokar (USA), and
1007 T. Vardanega (Italy).
1008
1009 71.6/2
1010 Special thanks go to Ada-Europe and the Ada Resource Association,
1011 without whose help and support the Amendment and this consolidated
1012 reference manual would not have been possible. M. Heaney (USA) requires
1013 special thanks for his tireless work on the containers packages.
1014 Finally, special thanks go to the convenor of ISO/IEC JTC 1/SC 22/WG 9,
1015 J. Moore (USA), who guided the document through the standardization
1016 process.
1017
1018 Acknowledgements for the Ada 2012 edition
1019
1020 71.7/3
1021 The editor [R. Brukardt (USA)] would like to thank the many people whose
1022 hard work and assistance has made this revision possible.
1023
1024 71.8/3
1025 Thanks go out to all of the members of the ISO/IEC JTC 1/SC 22/WG 9 Ada
1026 Rapporteur Group, whose work on creating and editing the wording changes
1027 was critical to the entire process. Especially valuable contributions
1028 came from the chairman of the ARG, E. Schonberg (USA), who guided the
1029 work; T. Taft (USA), whose insights broke many logjams, both in design
1030 and wording; J. Barnes (UK) whose careful reviews uncovered many
1031 editorial errors; S. Baird (USA), who repeatedly found obscure
1032 interactions with the proposals that the rest of us missed. Other ARG
1033 members who substantially contributed were: A. Burns (UK), J. Cousins
1034 (UK), R. Dewar (USA), G. Dismukes (USA), R. Duff (USA), P. Leroy
1035 (France), B. Moore (Canada), E. Ploedereder (Germany), J.P. Rosen
1036 (France), B. Thomas (USA), and T. Vardanega (Italy).
1037
1038 71.9/3
1039 Special thanks go to Ada-Europe and the Ada Resource Association,
1040 without whose help and support this third edition of the Ada Standard
1041 would not have been possible. A special mention has to go to A.
1042 Beneschan (USA) for his efforts in eliminating sloppiness in our
1043 wording. M. Heaney (USA) also deserves a mention for his efforts to
1044 improve the containers packages. Finally, special thanks go to the
1045 convenor of ISO/IEC JTC 1/SC 22/WG 9, J. Tokar (USA), who guided the
1046 document through the standardization process.
1047
1048 Changes
1049
1050 72
1051 The International Standard is the same as this version of the Reference
1052 Manual, except:
1053
1054 73
1055 * This list of Changes is not included in the International Standard.
1056
1057 74
1058 * The "Acknowledgements" page is not included in the International
1059 Standard.
1060
1061 75
1062 * The text in the running headers and footers on each page is
1063 slightly different in the International Standard.
1064
1065 76
1066 * The title page(s) are different in the International Standard.
1067
1068 77
1069 * This document is formatted for 8.5-by-11-inch paper, whereas the
1070 International Standard is formatted for A4 paper (210-by-297mm);
1071 thus, the page breaks are in different places.
1072
1073 77.1/3
1074 * This paragraph was deleted.
1075
1076 77.2/3
1077 * {AI05-0299-1AI05-0299-1} The "Using this version of the Ada
1078 Reference Manual" subclause is not included in the International
1079 Standard.
1080
1081 77.3/3
1082 * Paragraph numbers are not included in the International Standard.
1083
1084 Using this version of the Ada Reference Manual
1085
1086 77.4/3
1087 This document has been revised with the corrections specified in
1088 Technical Corrigendum 1 (ISO/IEC 8652:1995/COR.1:2001) and Amendment 1
1089 (ISO/IEC 8652/AMD 1:2007), along with changes specifically for this
1090 third edition. In addition, more annotations have been added and a
1091 variety of editorial errors have been corrected.
1092
1093 77.5/3
1094 Changes to the original 8652:1995 can be identified by the version
1095 number following the paragraph number. Paragraphs with a version number
1096 of /1 were changed by Technical Corrigendum 1 or were editorial
1097 corrections at that time, while paragraphs with a version number of /2
1098 were changed by Amendment 1 or were more recent editorial corrections,
1099 and paragraphs with a version number of /3 were changed by the third
1100 (2012) edition of the Standard or were still more recent editorial
1101 corrections. Paragraphs not so marked are unchanged by the third
1102 edition, Amendment 1, Technical Corrigendum 1, or editorial corrections.
1103 Paragraph numbers of unchanged paragraphs are the same as in the 1995
1104 edition of the Ada Reference Manual. Inserted text is indicated by
1105 underlining, and deleted text is indicated by strikethroughs. Some
1106 versions also use color to indicate the version of the change.Where
1107 paragraphs are inserted, the paragraph numbers are of the form pp.nn,
1108 where pp is the number of the preceding paragraph, and nn is an
1109 insertion number. For instance, the first paragraph inserted after
1110 paragraph 8 is numbered 8.1, the second paragraph inserted is numbered
1111 8.2, and so on. Deleted paragraphs are indicated by the text This
1112 paragraph was deleted. Deleted paragraphs include empty paragraphs that
1113 were numbered in the 1995 edition of the Ada Reference Manual. Similar
1114 markings and numbering are used for changes to annotations.
1115
1116 77.a/3
1117 To be honest: The paragraph number is considered part of the
1118 paragraph; when a paragraph is moved to a different paragraph
1119 number, it is marked as changed even if the contents have not
1120 changed.
1121
1122 \1f
1123 File: aarm2012.info, Node: 0.99, Prev: 0.2, Up: Front Matter
1124
1125 0.99
1126 ====
1127
1128 ========== INTERNATIONAL STANDARD ISO/IEC 8652:2012(E)
1129
1130 ==========
1131
1132 Information technology -- Programming
1133 Languages -- Ada
1134
1135
1136
1137 \1f
1138 File: aarm2012.info, Node: 1, Next: 2, Prev: Front Matter, Up: Top
1139
1140 1 General
1141 *********
1142
1143 2.a/3
1144 Discussion: This Annotated Ada Reference Manual (AARM)
1145 contains the entire text of the third edition of the Ada
1146 Reference Manual (the Ada 2012 RM), plus certain annotations.
1147 The annotations give a more in-depth analysis of the language.
1148 They describe the reason for each nonobvious rule, and point
1149 out interesting ramifications of the rules and interactions
1150 among the rules (interesting to language lawyers, that is).
1151 Differences between Ada 83, Ada 95, Ada 2005, and Ada 2012 are
1152 listed. (The text you are reading now is an annotation.)
1153
1154 2.b/3
1155 The AARM stresses detailed correctness and uniformity over
1156 readability and understandability. We're not trying to make
1157 the language "appear" simple here; on the contrary, we're
1158 trying to expose hidden complexities, so we can more easily
1159 detect language bugs. The Ada 2012 RM, on the other hand, is
1160 intended to be a more readable document for programmers.
1161
1162 2.c
1163 The annotations in the AARM are as follows:
1164
1165 2.d/3
1166 * Text that is logically redundant is shown [in square
1167 brackets, like this]. Technically, such text could be
1168 written as a Note in the Ada 2012 RM (and the Ada 95 and
1169 2005 RMs before it), since it is really a theorem that
1170 can be proven from the nonredundant rules of the
1171 language. We use the square brackets instead when it
1172 seems to make the Ada 2012 RM more readable.
1173
1174 2.e
1175 * The rules of the language (and some AARM-only text) are
1176 categorized, and placed under certain sub-headings that
1177 indicate the category. For example, the distinction
1178 between Name Resolution Rules and Legality Rules is
1179 particularly important, as explained in *note 8.6::.
1180
1181 2.f
1182 * Text under the following sub-headings appears in both
1183 documents:
1184
1185 2.g
1186 * The unlabeled text at the beginning of each
1187 clause or subclause,
1188
1189 2.h
1190 * Syntax,
1191
1192 2.i
1193 * Name Resolution Rules,
1194
1195 2.j
1196 * Legality Rules,
1197
1198 2.k
1199 * Static Semantics,
1200
1201 2.l
1202 * Post-Compilation Rules,
1203
1204 2.m
1205 * Dynamic Semantics,
1206
1207 2.n
1208 * Bounded (Run-Time) Errors,
1209
1210 2.o
1211 * Erroneous Execution,
1212
1213 2.p
1214 * Implementation Requirements,
1215
1216 2.q
1217 * Documentation Requirements,
1218
1219 2.r
1220 * Metrics,
1221
1222 2.s
1223 * Implementation Permissions,
1224
1225 2.t
1226 * Implementation Advice,
1227
1228 2.u
1229 * NOTES,
1230
1231 2.v
1232 * Examples.
1233
1234 2.w/3
1235 * Text under the following sub-headings does not appear in
1236 the Ada 2012 RM:
1237
1238 2.x
1239 * Language Design Principles,
1240
1241 2.y
1242 * Inconsistencies With Ada 83,
1243
1244 2.z
1245 * Incompatibilities With Ada 83,
1246
1247 2.aa
1248 * Extensions to Ada 83,
1249
1250 2.bb/2
1251 * Wording Changes from Ada 83,
1252
1253 2.bb.1/2
1254 * Inconsistencies With Ada 95,
1255
1256 2.bb.2/2
1257 * Incompatibilities With Ada 95,
1258
1259 2.bb.3/2
1260 * Extensions to Ada 95,
1261
1262 2.bb.4/3
1263 * Wording Changes from Ada 95,
1264
1265 2.bb.5/3
1266 * Inconsistencies With Ada 2005,
1267
1268 2.bb.6/3
1269 * Incompatibilities With Ada 2005,
1270
1271 2.bb.7/3
1272 * Extensions to Ada 2005,
1273
1274 2.bb.8/3
1275 * Wording Changes from Ada 2005.
1276
1277 2.cc
1278 * The AARM also includes the following kinds of
1279 annotations. These do not necessarily annotate the
1280 immediately preceding rule, although they often do.
1281
1282 2.dd
1283 Reason: An explanation of why a certain rule is necessary, or
1284 why it is worded in a certain way.
1285
1286 2.ee
1287 Ramification: An obscure ramification of the rules that is of
1288 interest only to language lawyers. (If a ramification of the
1289 rules is of interest to programmers, then it appears under
1290 NOTES.)
1291
1292 2.ff
1293 Proof: An informal proof explaining how a given Note or
1294 [marked-as-redundant] piece of text follows from the other
1295 rules of the language.
1296
1297 2.gg
1298 Implementation Note: A hint about how to implement a feature,
1299 or a particular potential pitfall that an implementer needs to
1300 be aware of.
1301
1302 2.hh
1303 Change: Change annotations are not used in this version.
1304 Changes from previous versions have been removed. Changes in
1305 this version are marked with versioned paragraph numbers, as
1306 explained in the "Corrigendum Changes" clause of the
1307 "Introduction".
1308
1309 2.ii
1310 Discussion: Other annotations not covered by the above.
1311
1312 2.jj
1313 To be honest: A rule that is considered logically necessary to
1314 the definition of the language, but which is so obscure or
1315 pedantic that only a language lawyer would care. These are
1316 the only annotations that could be considered part of the
1317 language definition.
1318
1319 2.kk
1320 Glossary entry: The text of a Glossary entry -- this text will
1321 also appear in *note Annex N::, "*note Annex N:: Glossary".
1322
1323 2.ll/3
1324 Discussion: In general, the Ada 2012 RM text appears in the
1325 normal font, whereas AARM-only text appears in a smaller font.
1326 Notes also appear in the smaller font, as recommended by
1327 ISO/IEC style guidelines. Ada examples are also usually
1328 printed in a smaller font.
1329
1330 2.mm
1331 If you have trouble finding things, be sure to use the index.
1332 Each defined term appears there, and also in italics, like
1333 this. Syntactic categories defined in BNF are also indexed.
1334
1335 2.nn
1336 A definition marked "[distributed]" is the main definition for
1337 a term whose complete definition is given in pieces
1338 distributed throughout the document. The pieces are marked
1339 "[partial]" or with a phrase explaining what cases the partial
1340 definition applies to.
1341
1342 * Menu:
1343
1344 * 1.1 :: Scope
1345 * 1.2 :: Normative References
1346 * 1.3 :: Terms and Definitions
1347
1348 \1f
1349 File: aarm2012.info, Node: 1.1, Next: 1.2, Up: 1
1350
1351 1.1 Scope
1352 =========
1353
1354 1/3
1355 {AI05-0299-1AI05-0299-1} This International Standard specifies the form
1356 and meaning of programs written in Ada. Its purpose is to promote the
1357 portability of Ada programs to a variety of computing systems.
1358
1359 2/3
1360 {AI05-0299-1AI05-0299-1} Ada is a programming language designed to
1361 support the construction of long-lived, highly reliable software
1362 systems. The language includes facilities to define packages of related
1363 types, objects, and operations. The packages may be parameterized and
1364 the types may be extended to support the construction of libraries of
1365 reusable, adaptable software components. The operations may be
1366 implemented as subprograms using conventional sequential control
1367 structures, or as entries that include synchronization of concurrent
1368 threads of control as part of their invocation. Ada supports
1369 object-oriented programming by providing classes and interfaces,
1370 inheritance, polymorphism of variables and methods, and generic units.
1371 The language treats modularity in the physical sense as well, with a
1372 facility to support separate compilation.
1373
1374 3/3
1375 {AI05-0269-1AI05-0269-1} {AI05-0299-1AI05-0299-1} The language provides
1376 rich support for real-time, concurrent programming, and includes
1377 facilities for multicore and multiprocessor programming. Errors can be
1378 signaled as exceptions and handled explicitly. The language also covers
1379 systems programming; this requires precise control over the
1380 representation of data and access to system-dependent properties.
1381 Finally, a predefined environment of standard packages is provided,
1382 including facilities for, among others, input-output, string
1383 manipulation, numeric elementary functions, and random number
1384 generation, and definition and use of containers.
1385
1386 * Menu:
1387
1388 * 1.1.1 :: Extent
1389 * 1.1.2 :: Structure
1390 * 1.1.3 :: Conformity of an Implementation with the Standard
1391 * 1.1.4 :: Method of Description and Syntax Notation
1392 * 1.1.5 :: Classification of Errors
1393
1394 \1f
1395 File: aarm2012.info, Node: 1.1.1, Next: 1.1.2, Up: 1.1
1396
1397 1.1.1 Extent
1398 ------------
1399
1400 1
1401 This International Standard specifies:
1402
1403 2
1404 * The form of a program written in Ada;
1405
1406 3
1407 * The effect of translating and executing such a program;
1408
1409 4
1410 * The manner in which program units may be combined to form Ada
1411 programs;
1412
1413 5
1414 * The language-defined library units that a conforming implementation
1415 is required to supply;
1416
1417 6
1418 * The permissible variations within the standard, and the manner in
1419 which they are to be documented;
1420
1421 7
1422 * Those violations of the standard that a conforming implementation
1423 is required to detect, and the effect of attempting to translate or
1424 execute a program containing such violations;
1425
1426 8
1427 * Those violations of the standard that a conforming implementation
1428 is not required to detect.
1429
1430 9
1431 This International Standard does not specify:
1432
1433 10
1434 * The means whereby a program written in Ada is transformed into
1435 object code executable by a processor;
1436
1437 11
1438 * The means whereby translation or execution of programs is invoked
1439 and the executing units are controlled;
1440
1441 12
1442 * The size or speed of the object code, or the relative execution
1443 speed of different language constructs;
1444
1445 13
1446 * The form or contents of any listings produced by implementations;
1447 in particular, the form or contents of error or warning messages;
1448
1449 14
1450 * The effect of unspecified execution.
1451
1452 15
1453 * The size of a program or program unit that will exceed the capacity
1454 of a particular conforming implementation.
1455
1456 \1f
1457 File: aarm2012.info, Node: 1.1.2, Next: 1.1.3, Prev: 1.1.1, Up: 1.1
1458
1459 1.1.2 Structure
1460 ---------------
1461
1462 1/3
1463 {AI05-0299-1AI05-0299-1} This International Standard contains thirteen
1464 clauses, fifteen annexes, and an index.
1465
1466 1.a/3
1467 Discussion: {AI05-0299-1AI05-0299-1} What Ada 83 called a
1468 "chapter" and Ada 95 (and Ada 2005) called a "section" is
1469 called a "clause" in this Standard. Similarly, what Ada 83
1470 called a "section" and Ada 95 (and Ada 2005) called a "clause"
1471 is called a "subclause" in this Standard. Confused yet? This
1472 terminology is out of our hands; it is (and was) forced by
1473 ever-changing ISO rules for drafting Standards.
1474
1475 2
1476 The core of the Ada language consists of:
1477
1478 3/3
1479 * {AI05-0299-1AI05-0299-1} Clauses 1 through 13
1480
1481 4
1482 * *note Annex A::, "*note Annex A:: Predefined Language Environment"
1483
1484 5
1485 * *note Annex B::, "*note Annex B:: Interface to Other Languages"
1486
1487 6
1488 * *note Annex J::, "*note Annex J:: Obsolescent Features"
1489
1490 7
1491 The following Specialized Needs Annexes define features that are needed
1492 by certain application areas:
1493
1494 8
1495 * *note Annex C::, "*note Annex C:: Systems Programming"
1496
1497 9
1498 * *note Annex D::, "*note Annex D:: Real-Time Systems"
1499
1500 10
1501 * *note Annex E::, "*note Annex E:: Distributed Systems"
1502
1503 11
1504 * *note Annex F::, "*note Annex F:: Information Systems"
1505
1506 12
1507 * *note Annex G::, "*note Annex G:: Numerics"
1508
1509 13
1510 * *note Annex H::, "*note Annex H:: High Integrity Systems"
1511
1512 14
1513 The core language and the Specialized Needs Annexes are normative,
1514 except that the material in each of the items listed below is
1515 informative:
1516
1517 15
1518 * Text under a NOTES or Examples heading.
1519
1520 16/3
1521 * {AI05-0299-1AI05-0299-1} Each subclause whose title starts with the
1522 word "Example" or "Examples".
1523
1524 17
1525 All implementations shall conform to the core language. In addition, an
1526 implementation may conform separately to one or more Specialized Needs
1527 Annexes.
1528
1529 18
1530 The following Annexes are informative:
1531
1532 19
1533 * *note Annex K::, "*note Annex K:: Language-Defined Aspects and
1534 Attributes"
1535
1536 20
1537 * *note Annex L::, "*note Annex L:: Language-Defined Pragmas"
1538
1539 21/3
1540 * {AI05-0004-1AI05-0004-1} *note Annex M::, "*note Annex M:: Summary
1541 of Documentation Requirements"
1542
1543 22
1544 * *note Annex N::, "*note Annex N:: Glossary"
1545
1546 23
1547 * *note Annex P::, "*note Annex P:: Syntax Summary"
1548
1549 23.1/3
1550 * {AI05-0262-1AI05-0262-1} *note Annex Q::, "*note Annex Q::
1551 Language-Defined Entities"
1552
1553 23.a
1554 Discussion: The idea of the Specialized Needs Annexes is that
1555 implementations can choose to target certain application
1556 areas. For example, an implementation specifically targeted
1557 to embedded machines might support the application-specific
1558 features for Real-time Systems, but not the
1559 application-specific features for Information Systems.
1560
1561 23.b
1562 The Specialized Needs Annexes extend the core language only in
1563 ways that users, implementations, and standards bodies are
1564 allowed to extend the language; for example, via additional
1565 library units, attributes, representation items (see *note
1566 13.1::), pragmas, and constraints on semantic details that are
1567 left unspecified by the core language. Many implementations
1568 already provide much of the functionality defined by
1569 Specialized Needs Annexes; our goal is to increase uniformity
1570 among implementations by defining standard ways of providing
1571 the functionality.
1572
1573 23.c/2
1574 {AI95-00114-01AI95-00114-01} We recommend that the
1575 certification procedures allow implementations to certify the
1576 core language, plus any set of the Specialized Needs Annexes.
1577 We recommend that implementations not be allowed to certify a
1578 portion of one of the Specialized Needs Annexes, although
1579 implementations can, of course, provide uncertified support
1580 for such portions. We have designed the Specialized Needs
1581 Annexes assuming that this recommendation is followed. Thus,
1582 our decisions about what to include and what not to include in
1583 those annexes are based on the assumption that each annex is
1584 certified in an "all-or-nothing" manner.
1585
1586 23.d
1587 An implementation may, of course, support extensions that are
1588 different from (but possibly related to) those defined by one
1589 of the Specialized Needs Annexes. We recommend that, where
1590 appropriate, implementations do this by adding library units
1591 that are children of existing language-defined library
1592 packages.
1593
1594 23.e
1595 An implementation should not provide extensions that conflict
1596 with those defined in the Specialized Needs Annexes, in the
1597 following sense: Suppose an implementation supports a certain
1598 error-free program that uses only functionality defined in the
1599 core and in the Specialized Needs Annexes. The implementation
1600 should ensure that that program will still be error free in
1601 some possible full implementation of all of the Specialized
1602 Needs Annexes, and that the semantics of the program will not
1603 change. For example, an implementation should not provide a
1604 package with the same name as one defined in one of the
1605 Specialized Needs Annexes, but that behaves differently, even
1606 if that implementation does not claim conformance to that
1607 Annex.
1608
1609 23.f
1610 Note that the Specialized Needs Annexes do not conflict with
1611 each other; it is the intent that a single implementation can
1612 conform to all of them.
1613
1614 24/3
1615 {AI05-0299-1AI05-0299-1} Each section is divided into subclauses that
1616 have a common structure. Each clause and subclause first introduces its
1617 subject. After the introductory text, text is labeled with the
1618 following headings:
1619
1620 _Language Design Principles_
1621
1622 24.a
1623 These are not rules of the language, but guiding principles or
1624 goals used in defining the rules of the language. In some
1625 cases, the goal is only partially met; such cases are
1626 explained.
1627
1628 24.b/3
1629 {AI05-0005-1AI05-0005-1} This is not part of the definition of
1630 the language, and does not appear in the Ada 2012 RM.
1631
1632 _Syntax_
1633
1634 25
1635 Syntax rules (indented).
1636
1637 _Name Resolution Rules_
1638
1639 26/3
1640 {AI05-0299-1AI05-0299-1} Compile-time rules that are used in name
1641 resolution, including overload resolution.
1642
1643 26.a
1644 Discussion: These rules are observed at compile time. (We say
1645 "observed" rather than "checked," because these rules are not
1646 individually checked. They are really just part of the
1647 Legality Rules in Clause *note 8:: that require exactly one
1648 interpretation of each constituent of a complete context.)
1649 The only rules used in overload resolution are the Syntax
1650 Rules and the Name Resolution Rules.
1651
1652 26.b
1653 When dealing with nonoverloadable declarations it sometimes
1654 makes no semantic difference whether a given rule is a Name
1655 Resolution Rule or a Legality Rule, and it is sometimes
1656 difficult to decide which it should be. We generally make a
1657 given rule a Name Resolution Rule only if it has to be. For
1658 example, "The name, if any, in a raise_statement shall be the
1659 name of an exception." is under "Legality Rules."
1660
1661 _Legality Rules_
1662
1663 27
1664 Rules that are enforced at compile time. A construct is legal if it
1665 obeys all of the Legality Rules.
1666
1667 27.a
1668 Discussion: These rules are not used in overload resolution.
1669
1670 27.b
1671 Note that run-time errors are always attached to exceptions;
1672 for example, it is not "illegal" to divide by zero, it just
1673 raises an exception.
1674
1675 _Static Semantics_
1676
1677 28
1678 A definition of the compile-time effect of each construct.
1679
1680 28.a
1681 Discussion: The most important compile-time effects represent
1682 the effects on the symbol table associated with declarations
1683 (implicit or explicit). In addition, we use this heading as a
1684 bit of a grab bag for equivalences, package specifications,
1685 etc. For example, this is where we put statements like
1686 so-and-so is equivalent to such-and-such. (We ought to try to
1687 really mean it when we say such things!) Similarly,
1688 statements about magically-generated implicit declarations go
1689 here. These rules are generally written as statements of fact
1690 about the semantics, rather than as a
1691 you-shall-do-such-and-such sort of thing.
1692
1693 _Post-Compilation Rules_
1694
1695 29
1696 Rules that are enforced before running a partition. A partition is
1697 legal if its compilation units are legal and it obeys all of the
1698 Post-Compilation Rules.
1699
1700 29.a
1701 Discussion: It is not specified exactly when these rules are
1702 checked, so long as they are checked for any given partition
1703 before that partition starts running. An implementation may
1704 choose to check some such rules at compile time, and reject
1705 compilation_units accordingly. Alternatively, an
1706 implementation may check such rules when the partition is
1707 created (usually known as "link time"), or when the partition
1708 is mapped to a particular piece of hardware (but before the
1709 partition starts running).
1710
1711 _Dynamic Semantics_
1712
1713 30
1714 A definition of the run-time effect of each construct.
1715
1716 30.a
1717 Discussion: This heading describes what happens at run time.
1718 Run-time checks, which raise exceptions upon failure, are
1719 described here. Each item that involves a run-time check is
1720 marked with the name of the check -- these are the same check
1721 names that are used in a pragma Suppress. Principle: Every
1722 check should have a name, usable in a pragma Suppress.
1723
1724 _Bounded (Run-Time) Errors_
1725
1726 31
1727 Situations that result in bounded (run-time) errors (see *note 1.1.5::).
1728
1729 31.a
1730 Discussion: The "bounds" of each such error are described here
1731 -- that is, we characterize the set of all possible behaviors
1732 that can result from a bounded error occurring at run time.
1733
1734 _Erroneous Execution_
1735
1736 32
1737 Situations that result in erroneous execution (see *note 1.1.5::).
1738
1739 _Implementation Requirements_
1740
1741 33
1742 Additional requirements for conforming implementations.
1743
1744 33.a
1745 Discussion: ...as opposed to rules imposed on the programmer.
1746 An example might be, "The smallest representable duration,
1747 Duration'Small, shall not be greater than twenty
1748 milliseconds."
1749
1750 33.b
1751 It's really just an issue of how the rule is worded. We could
1752 write the same rule as "The smallest representable duration is
1753 an implementation-defined value less than or equal to 20
1754 milliseconds" and then it would be under "Static Semantics."
1755
1756 _Documentation Requirements_
1757
1758 34
1759 Documentation requirements for conforming implementations.
1760
1761 34.a
1762 Discussion: These requirements are beyond those that are
1763 implicitly specified by the phrase "implementation defined".
1764 The latter require documentation as well, but we don't repeat
1765 these cases under this heading. Usually this heading is used
1766 for when the description of the documentation requirement is
1767 longer and does not correspond directly to one, narrow
1768 normative sentence.
1769
1770 _Metrics_
1771
1772 35
1773 Metrics that are specified for the time/space properties of the
1774 execution of certain language constructs.
1775
1776 _Implementation Permissions_
1777
1778 36
1779 Additional permissions given to the implementer.
1780
1781 36.a
1782 Discussion: For example, "The implementation is allowed to
1783 impose further restrictions on the record aggregates allowed
1784 in code statements." When there are restrictions on the
1785 permission, those restrictions are given here also. For
1786 example, "An implementation is allowed to restrict the kinds
1787 of subprograms that are allowed to be main subprograms.
1788 However, it shall support at least parameterless procedures."
1789 -- we don't split this up between here and "Implementation
1790 Requirements."
1791
1792 _Implementation Advice_
1793
1794 37
1795 Optional advice given to the implementer. The word "should" is used to
1796 indicate that the advice is a recommendation, not a requirement. It is
1797 implementation defined whether or not a given recommendation is obeyed.
1798
1799 37.a/2
1800 Implementation defined: Whether or not each recommendation
1801 given in Implementation Advice is followed -- see *note M.3::,
1802 "*note M.3:: Implementation Advice" for a listing.
1803
1804 37.b/1
1805 Discussion: The advice generally shows the intended
1806 implementation, but the implementer is free to ignore it. The
1807 implementer is the sole arbiter of whether or not the advice
1808 has been obeyed, if not, whether the reason is a good one, and
1809 whether the required documentation is sufficient. It would be
1810 wrong for the ACATS to enforce any of this advice.
1811
1812 37.c
1813 For example, "Whenever possible, the implementation should
1814 choose a value no greater than fifty microseconds for the
1815 smallest representable duration, Duration'Small."
1816
1817 37.d
1818 We use this heading, for example, when the rule is so low
1819 level or implementation-oriented as to be untestable. We also
1820 use this heading when we wish to encourage implementations to
1821 behave in a certain way in most cases, but we do not wish to
1822 burden implementations by requiring the behavior.
1823
1824 NOTES
1825
1826 38
1827 1 Notes emphasize consequences of the rules described in the
1828 (sub)clause or elsewhere. This material is informative.
1829
1830 _Examples_
1831
1832 39
1833 Examples illustrate the possible forms of the constructs described.
1834 This material is informative.
1835
1836 39.a
1837 Discussion:
1838
1839 The next three headings list all language changes between Ada
1840 83 and Ada 95. Language changes are any change that changes
1841 the set of text strings that are legal Ada programs, or
1842 changes the meaning of any legal program. Wording changes,
1843 such as changes in terminology, are not language changes.
1844 Each language change falls into one of the following three
1845 categories:
1846
1847 _Inconsistencies With Ada 83_
1848
1849 39.b
1850 This heading lists all of the upward inconsistencies between
1851 Ada 83 and Ada 95. Upward inconsistencies are situations in
1852 which a legal Ada 83 program is a legal Ada 95 program with
1853 different semantics. This type of upward incompatibility is
1854 the worst type for users, so we only tolerate it in rare
1855 situations.
1856
1857 39.c
1858 (Note that the semantics of a program is not the same thing as
1859 the behavior of the program. Because of Ada's indeterminacy,
1860 the "semantics" of a given feature describes a set of
1861 behaviors that can be exhibited by that feature. The set can
1862 contain more than one allowed behavior. Thus, when we ask
1863 whether the semantics changes, we are asking whether the set
1864 of behaviors changes.)
1865
1866 39.d/3
1867 This is not part of the definition of the language, and does
1868 not appear in the Ada 95, Ada 2005, or Ada 2012 RM.
1869
1870 _Incompatibilities With Ada 83_
1871
1872 39.e
1873 This heading lists all of the upward incompatibilities between
1874 Ada 83 and Ada 95, except for the ones listed under
1875 "Inconsistencies With Ada 83" above. These are the situations
1876 in which a legal Ada 83 program is illegal in Ada 95. We do
1877 not generally consider a change that turns erroneous execution
1878 into an exception, or into an illegality, to be upwardly
1879 incompatible.
1880
1881 39.f/3
1882 This is not part of the definition of the language, and does
1883 not appear in the Ada 95, Ada 2005, or Ada 2012 RM.
1884
1885 _Extensions to Ada 83_
1886
1887 39.g
1888 This heading is used to list all upward compatible language
1889 changes; that is, language extensions. These are the
1890 situations in which a legal Ada 95 program is not a legal Ada
1891 83 program. The vast majority of language changes fall into
1892 this category.
1893
1894 39.h/3
1895 This is not part of the definition of the language, and does
1896 not appear in the Ada 95, Ada 2005, or Ada 2012 RM.
1897
1898 39.i
1899
1900
1901 As explained above, the next heading does not represent any
1902 language change:
1903
1904 _Wording Changes from Ada 83_
1905
1906 39.j/2
1907 This heading lists some of the nonsemantic changes between the
1908 Ada 83 RM and the Ada 95 RM. It is incomplete; we have not
1909 attempted to list all wording changes, but only the
1910 "interesting" ones.
1911
1912 39.k/3
1913 This is not part of the definition of the language, and does
1914 not appear in the Ada 95, Ada 2005, or Ada 2012 RM.
1915
1916 39.l/2
1917 Discussion:
1918
1919 The next three headings list all language changes between Ada
1920 95 and Ada 2005 (the language defined by the Ada 95 standard
1921 plus Technical Corrigendum 1 plus Amendment 1). Each language
1922 change falls into one of the following three categories:
1923
1924 _Inconsistencies With Ada 95_
1925
1926 39.m/2
1927 This heading lists all of the upward inconsistencies between
1928 Ada 95 and Ada 2005. Upward inconsistencies are situations in
1929 which a legal Ada 95 program is a legal Ada 2005 program with
1930 different semantics.
1931
1932 39.n/3
1933 {AI05-0005-1AI05-0005-1} Inconsistencies marked with
1934 Corrigendum: are corrections to the original Ada 95 definition
1935 introduced by Corrigendum 1. Inconsistencies marked with
1936 Amendment Correction: are corrections to the original Ada 95
1937 definition added by Amendment 1. Formally, these are
1938 inconsistencies caused by Ada Issues classified as Binding
1939 Interpretations; implementations of Ada 95 are supposed to
1940 follow these corrections, not the original flawed language
1941 definition. Thus, these strictly speaking are not
1942 inconsistencies between Ada 95 and Ada 2005. Practically,
1943 however, they very well may be, as early Ada 95
1944 implementations might not follow the recommendation.
1945 Inconsistencies so marked are not portable between Ada 95
1946 implementations, while usually Ada 2005 will have more clearly
1947 defined behavior. Therefore, we document these for
1948 completeness.
1949
1950 39.o/3
1951 This is not part of the definition of the language, and does
1952 not appear in the Ada 2005 or Ada 2012 RM.
1953
1954 _Incompatibilities With Ada 95_
1955
1956 39.p/2
1957 This heading lists all of the upward incompatibilities between
1958 Ada 95 and Ada 2005, except for the ones listed under
1959 "Inconsistencies With Ada 95" above. These are the situations
1960 in which a legal Ada 95 program is illegal in Ada 2005.
1961
1962 39.q/3
1963 {AI05-0005-1AI05-0005-1} As with inconsistencies,
1964 incompatibilities marked with Corrigendum: are corrections to
1965 the original Ada 95 definition introduced by Corrigendum 1.
1966 Incompatibilities marked with Amendment Correction: are
1967 corrections to the original Ada 95 definition added by
1968 Amendment 1. Formally, these are incompatibilities caused by
1969 Ada Issues classified as Binding Interpretations;
1970 implementations of Ada 95 are supposed to follow these
1971 corrections, not the original flawed language definition.
1972 Thus, these strictly speaking are not incompatibilities
1973 between Ada 95 and Ada 2005. Practically, however, they very
1974 well may be, as early Ada 95 implementations might not follow
1975 the recommendation. Therefore, some Ada 95 implementations
1976 may be able to compile the examples, while others might not.
1977 In contrast, Ada 2005 compilers will have consistent behavior.
1978 Therefore, we document these for completeness.
1979
1980 39.r/3
1981 This is not part of the definition of the language, and does
1982 not appear in the Ada 2005 or Ada 2012 RM.
1983
1984 _Extensions to Ada 95_
1985
1986 39.s/2
1987 This heading is used to list all upward compatible language
1988 changes; that is, language extensions. These are the
1989 situations in which a legal Ada 2005 program is not a legal
1990 Ada 95 program. The vast majority of language changes fall
1991 into this category.
1992
1993 39.t/3
1994 {AI05-0005-1AI05-0005-1} As with incompatibilities, extensions
1995 marked with Corrigendum: are corrections to the original Ada
1996 95 definition introduced by Corrigendum 1. Extensions marked
1997 with Amendment Correction: are corrections to the original Ada
1998 95 definition added by Amendment 1. Formally, these are
1999 extensions allowed by Ada Issues classified as Binding
2000 Interpretations. As corrections, implementations of Ada 95
2001 are allowed to implement these extensions. Thus, these
2002 strictly speaking are not extensions of Ada 95; they're part
2003 of Ada 95. Practically, however, they very well may be
2004 extensions, as early Ada 95 implementations might not
2005 implement the extension. Therefore, some Ada 95
2006 implementations may be able to compile the examples, while
2007 others might not. In contrast, Ada 2005 compilers will always
2008 support the extensions. Therefore, we document these for
2009 completeness.
2010
2011 39.u/3
2012 This is not part of the definition of the language, and does
2013 not appear in the Ada 2005 or Ada 2012 RM.
2014
2015 39.v/2
2016
2017
2018 As explained above, the next heading does not represent any
2019 language change:
2020
2021 _Wording Changes from Ada 95_
2022
2023 39.w/2
2024 This heading lists some of the nonsemantic changes between the
2025 Ada 95 RM and the Ada 2005 RM. This heading lists only
2026 "interesting" changes (for instance, editorial corrections are
2027 not listed). Changes which come from Technical Corrigendum 1
2028 are marked Corrigendum; unmarked changes come from Amendment
2029 1.
2030
2031 39.x/3
2032 This is not part of the definition of the language, and does
2033 not appear in the Ada 2005 or Ada 2012 RM.
2034
2035 39.y/3
2036 Discussion:
2037
2038 The next three headings list all language changes between Ada
2039 2005 (the language defined by the Ada 95 standard plus
2040 Technical Corrigendum 1 plus Amendment 1) and Ada 2012 (the
2041 language defined by the third edition of the Standard). Each
2042 language change falls into one of the following three
2043 categories:
2044
2045 _Inconsistencies With Ada 2005_
2046
2047 39.z/3
2048 This heading lists all of the upward inconsistencies between
2049 Ada 2005 and Ada 2012. Upward inconsistencies are situations
2050 in which a legal Ada 2005 program is a legal Ada 2012 program
2051 with different semantics.
2052
2053 39.aa/3
2054 Inconsistencies marked with Correction: are corrections to the
2055 original Ada 2005 definition added by the third edition of the
2056 Standard. Formally, these are inconsistencies caused by Ada
2057 Issues classified as Binding Interpretations; implementations
2058 of Ada 2005 are supposed to follow these corrections, not the
2059 original flawed language definition. Thus, these strictly
2060 speaking are not inconsistencies between Ada 2005 and Ada
2061 2012. Practically, however, they very well may be, as early
2062 Ada 2005 implementations might not follow the recommendation.
2063 Inconsistencies so marked are not portable between Ada 2005
2064 implementations, while usually Ada 2012 will have more clearly
2065 defined behavior. Therefore, we document these for
2066 completeness.
2067
2068 39.bb/3
2069 This is not part of the definition of the language, and does
2070 not appear in the Ada 2012 RM.
2071
2072 _Incompatibilities With Ada 2005_
2073
2074 39.cc/3
2075 This heading lists all of the upward incompatibilities between
2076 Ada 2005 and Ada 2012, except for the ones listed under
2077 "Inconsistencies With Ada 2005" above. These are the
2078 situations in which a legal Ada 2005 program is illegal in Ada
2079 2012.
2080
2081 39.dd/3
2082 As with inconsistencies, incompatibilities marked with
2083 Correction: are corrections to the original Ada 2005
2084 definition added by the third edition. Formally, these are
2085 incompatibilities caused by Ada Issues classified as Binding
2086 Interpretations; implementations of Ada 2005 are supposed to
2087 follow these corrections, not the original flawed language
2088 definition. Thus, these strictly speaking are not
2089 incompatibilities between Ada 2005 and Ada 2012. Practically,
2090 however, they very well may be, as early Ada 2005
2091 implementations might not follow the recommendation.
2092 Therefore, some Ada 2005 implementations may be able to
2093 compile the examples, while others might not. In contrast,
2094 Ada 2012 compilers will have consistent behavior. Therefore,
2095 we document these for completeness.
2096
2097 39.ee/3
2098 This is not part of the definition of the language, and does
2099 not appear in the Ada 2012 RM.
2100
2101 _Extensions to Ada 2005_
2102
2103 39.ff/3
2104 This heading is used to list all upward compatible language
2105 changes; that is, language extensions. These are the
2106 situations in which a legal Ada 2012 program is not a legal
2107 Ada 2005 program. The vast majority of language changes fall
2108 into this category.
2109
2110 39.gg/3
2111 As with incompatibilities, extensions marked with Correction:
2112 are corrections to the original Ada 2005 definition added by
2113 the third edition. Formally, these are extensions allowed by
2114 Ada Issues classified as Binding Interpretations. As
2115 corrections, implementations of Ada 2005 (and sometimes Ada
2116 95) are allowed to implement these extensions. Thus, these
2117 strictly speaking are not extensions of Ada 2005; they're part
2118 of Ada 2005. Practically, however, they very well may be
2119 extensions, as early Ada 2005 implementations might not
2120 implement the extension. Therefore, some Ada 2005
2121 implementations may be able to compile the examples, while
2122 others might not. In contrast, Ada 2012 compilers will always
2123 support the extensions. Therefore, we document these for
2124 completeness.
2125
2126 39.hh/3
2127 This is not part of the definition of the language, and does
2128 not appear in the Ada 2012 RM.
2129
2130 39.ii/3
2131
2132
2133 As explained above, the next heading does not represent any
2134 language change:
2135
2136 _Wording Changes from Ada 2005_
2137
2138 39.jj/3
2139 This heading lists some of the nonsemantic changes between the
2140 Ada 2005 RM and the Ada 2012 RM. This heading lists only
2141 "interesting" changes (for instance, editorial corrections are
2142 not listed). Items marked Correction: come from Ada Issues
2143 classified as Binding Interpretations and strictly speaking
2144 belong to Ada 2005; other items only belong to Ada 2012.
2145
2146 39.kk/3
2147 This is not part of the definition of the language, and does
2148 not appear in the Ada 2012 RM.
2149
2150 \1f
2151 File: aarm2012.info, Node: 1.1.3, Next: 1.1.4, Prev: 1.1.2, Up: 1.1
2152
2153 1.1.3 Conformity of an Implementation with the Standard
2154 -------------------------------------------------------
2155
2156 _Implementation Requirements_
2157
2158 1
2159 A conforming implementation shall:
2160
2161 1.a
2162 Discussion: The implementation is the software and hardware
2163 that implements the language. This includes compiler, linker,
2164 operating system, hardware, etc.
2165
2166 1.b
2167 We first define what it means to "conform" in general --
2168 basically, the implementation has to properly implement the
2169 normative rules given throughout the standard. Then we define
2170 what it means to conform to a Specialized Needs Annex -- the
2171 implementation must support the core features plus the
2172 features of that Annex. Finally, we define what it means to
2173 "conform to the Standard" -- this requires support for the
2174 core language, and allows partial (but not conflicting)
2175 support for the Specialized Needs Annexes.
2176
2177 2
2178 * Translate and correctly execute legal programs written in Ada,
2179 provided that they are not so large as to exceed the capacity of
2180 the implementation;
2181
2182 3
2183 * Identify all programs or program units that are so large as to
2184 exceed the capacity of the implementation (or raise an appropriate
2185 exception at run time);
2186
2187 3.a
2188 Implementation defined: Capacity limitations of the
2189 implementation.
2190
2191 4
2192 * Identify all programs or program units that contain errors whose
2193 detection is required by this International Standard;
2194
2195 4.a
2196 Discussion: Note that we no longer use the term "rejection" of
2197 programs or program units. We require that programs or
2198 program units with errors or that exceed some capacity limit
2199 be "identified". The way in which errors or capacity problems
2200 are reported is not specified.
2201
2202 4.b
2203 An implementation is allowed to use standard error-recovery
2204 techniques. We do not disallow such techniques from being
2205 used across compilation_unit or compilation boundaries.
2206
2207 4.c
2208 See also the Implementation Requirements of *note 10.2::,
2209 which disallow the execution of illegal partitions.
2210
2211 5
2212 * Supply all language-defined library units required by this
2213 International Standard;
2214
2215 5.a
2216 Implementation Note: An implementation cannot add to or modify
2217 the visible part of a language-defined library unit, except
2218 where such permission is explicitly granted, unless such
2219 modifications are semantically neutral with respect to the
2220 client compilation units of the library unit. An
2221 implementation defines the contents of the private part and
2222 body of language-defined library units.
2223
2224 5.b
2225 An implementation can add with_clauses and use_clauses, since
2226 these modifications are semantically neutral to clients. (The
2227 implementation might need with_clauses in order to implement
2228 the private part, for example.) Similarly, an implementation
2229 can add a private part even in cases where a private part is
2230 not shown in the standard. Explicit declarations can be
2231 provided implicitly or by renaming, provided the changes are
2232 semantically neutral.
2233
2234 5.c
2235 Wherever in the standard the text of a language-defined
2236 library unit contains an italicized phrase starting with
2237 "implementation-defined", the implementation's version will
2238 replace that phrase with some implementation-defined text that
2239 is syntactically legal at that place, and follows any other
2240 applicable rules.
2241
2242 5.d
2243 Note that modifications are permitted, even if there are other
2244 tools in the environment that can detect the changes (such as
2245 a program library browser), so long as the modifications make
2246 no difference with respect to the static or dynamic semantics
2247 of the resulting programs, as defined by the standard.
2248
2249 6
2250 * Contain no variations except those explicitly permitted by this
2251 International Standard, or those that are impossible or impractical
2252 to avoid given the implementation's execution environment;
2253
2254 6.a
2255 Implementation defined: Variations from the standard that are
2256 impractical to avoid given the implementation's execution
2257 environment.
2258
2259 6.b
2260 Reason: The "impossible or impractical" wording comes from
2261 AI-325. It takes some judgement and common sense to interpret
2262 this. Restricting compilation units to less than 4 lines is
2263 probably unreasonable, whereas restricting them to less than 4
2264 billion lines is probably reasonable (at least given today's
2265 technology). We do not know exactly where to draw the line,
2266 so we have to make the rule vague.
2267
2268 7
2269 * Specify all such variations in the manner prescribed by this
2270 International Standard.
2271
2272 8
2273 The external effect of the execution of an Ada program is defined in
2274 terms of its interactions with its external environment. The following
2275 are defined as external interactions:
2276
2277 9
2278 * Any interaction with an external file (see *note A.7::);
2279
2280 10
2281 * The execution of certain code_statements (see *note 13.8::); which
2282 code_statements cause external interactions is implementation
2283 defined.
2284
2285 10.a
2286 Implementation defined: Which code_statements cause external
2287 interactions.
2288
2289 11
2290 * Any call on an imported subprogram (see *note Annex B::), including
2291 any parameters passed to it;
2292
2293 12
2294 * Any result returned or exception propagated from a main subprogram
2295 (see *note 10.2::) or an exported subprogram (see *note Annex B::)
2296 to an external caller;
2297
2298 12.a
2299 Discussion: By "result returned" we mean to include function
2300 results and values returned in [in] out parameters.
2301
2302 12.a.1/1
2303 {8652/00948652/0094} {AI95-00119-01AI95-00119-01} The lack of
2304 a result from a program that does not terminate is also
2305 included here.
2306
2307 13
2308 * [Any read or update of an atomic or volatile object (see *note
2309 C.6::);]
2310
2311 14
2312 * The values of imported and exported objects (see *note Annex B::)
2313 at the time of any other interaction with the external environment.
2314
2315 14.a/3
2316 To be honest: {AI05-0229-1AI05-0229-1} Also other uses of
2317 imported and exported entities, as defined by the
2318 implementation, if the implementation supports such importing
2319 or exporting.
2320
2321 15
2322 A conforming implementation of this International Standard shall produce
2323 for the execution of a given Ada program a set of interactions with the
2324 external environment whose order and timing are consistent with the
2325 definitions and requirements of this International Standard for the
2326 semantics of the given program.
2327
2328 15.a
2329 Ramification: There is no need to produce any of the "internal
2330 effects" defined for the semantics of the program -- all of
2331 these can be optimized away -- so long as an appropriate
2332 sequence of external interactions is produced.
2333
2334 15.b
2335 Discussion: See also *note 11.6:: which specifies various
2336 liberties associated with optimizations in the presence of
2337 language-defined checks, that could change the external
2338 effects that might be produced. These alternative external
2339 effects are still consistent with the standard, since *note
2340 11.6:: is part of the standard.
2341
2342 15.c
2343 Note also that we only require "an appropriate sequence of
2344 external interactions" rather than "the same sequence..." An
2345 optimizer may cause a different sequence of external
2346 interactions to be produced than would be produced without the
2347 optimizer, so long as the new sequence still satisfies the
2348 requirements of the standard. For example, optimization might
2349 affect the relative rate of progress of two concurrent tasks,
2350 thereby altering the order in which two external interactions
2351 occur.
2352
2353 15.d/2
2354 Note that the Ada 83 RM explicitly mentions the case of an
2355 "exact effect" of a program, but since so few programs have
2356 their effects defined that exactly, we don't even mention this
2357 "special" case. In particular, almost any program that uses
2358 floating point or tasking has to have some level of
2359 inexactness in the specification of its effects. And if one
2360 includes aspects of the timing of the external interactions in
2361 the external effect of the program (as is appropriate for a
2362 real-time language), no "exact effect" can be specified. For
2363 example, if two external interactions initiated by a single
2364 task are separated by a "delay 1.0;" then the language rules
2365 imply that the two external interactions have to be separated
2366 in time by at least one second, as defined by the clock
2367 associated with the delay_relative_statement. This in turn
2368 implies that the time at which an external interaction occurs
2369 is part of the characterization of the external interaction,
2370 at least in some cases, again making the specification of the
2371 required "exact effect" impractical.
2372
2373 16
2374 An implementation that conforms to this Standard shall support each
2375 capability required by the core language as specified. In addition, an
2376 implementation that conforms to this Standard may conform to one or more
2377 Specialized Needs Annexes (or to none). Conformance to a Specialized
2378 Needs Annex means that each capability required by the Annex is provided
2379 as specified.
2380
2381 16.a
2382 Discussion: The last sentence defines what it means to say
2383 that an implementation conforms to a Specialized Needs Annex,
2384 namely, only by supporting all capabilities required by the
2385 Annex.
2386
2387 17/3
2388 {AI05-0229-1AI05-0229-1} An implementation conforming to this
2389 International Standard may provide additional aspects, attributes,
2390 library units, and pragmas. However, it shall not provide any aspect,
2391 attribute, library unit, or pragma having the same name as an aspect,
2392 attribute, library unit, or pragma (respectively) specified in a
2393 Specialized Needs Annex unless the provided construct is either as
2394 specified in the Specialized Needs Annex or is more limited in
2395 capability than that required by the Annex. A program that attempts to
2396 use an unsupported capability of an Annex shall either be identified by
2397 the implementation before run time or shall raise an exception at run
2398 time.
2399
2400 17.a
2401 Discussion: The last sentence of the preceding paragraph
2402 defines what an implementation is allowed to do when it does
2403 not "conform" to a Specialized Needs Annex. In particular,
2404 the sentence forbids implementations from providing a
2405 construct with the same name as a corresponding construct in a
2406 Specialized Needs Annex but with a different syntax (e.g., an
2407 extended syntax) or quite different semantics. The phrase
2408 concerning "more limited in capability" is intended to give
2409 permission to provide a partial implementation, such as not
2410 implementing a subprogram in a package or having a restriction
2411 not permitted by an implementation that conforms to the Annex.
2412 For example, a partial implementation of the package
2413 Ada.Decimal might have Decimal.Max_Decimal_Digits as 15
2414 (rather than the required 18). This allows a partial
2415 implementation to grow to a fully conforming implementation.
2416
2417 17.b
2418 A restricted implementation might be restricted by not
2419 providing some subprograms specified in one of the packages
2420 defined by an Annex. In this case, a program that tries to
2421 use the missing subprogram will usually fail to compile.
2422 Alternatively, the implementation might declare the subprogram
2423 as abstract, so it cannot be called. Alternatively, a
2424 subprogram body might be implemented just to raise
2425 Program_Error. The advantage of this approach is that a
2426 program to be run under a fully conforming Annex
2427 implementation can be checked syntactically and semantically
2428 under an implementation that only partially supports the
2429 Annex. Finally, an implementation might provide a package
2430 declaration without the corresponding body, so that programs
2431 can be compiled, but partitions cannot be built and executed.
2432
2433 17.c
2434 To ensure against wrong answers being delivered by a partial
2435 implementation, implementers are required to raise an
2436 exception when a program attempts to use an unsupported
2437 capability and this can be detected only at run time. For
2438 example, a partial implementation of Ada.Decimal might require
2439 the length of the Currency string to be 1, and hence, an
2440 exception would be raised if a subprogram were called in the
2441 package Edited_Output with a length greater than 1.
2442
2443 _Documentation Requirements_
2444
2445 18
2446 Certain aspects of the semantics are defined to be either implementation
2447 defined or unspecified. In such cases, the set of possible effects is
2448 specified, and the implementation may choose any effect in the set.
2449 Implementations shall document their behavior in implementation-defined
2450 situations, but documentation is not required for unspecified
2451 situations. The implementation-defined characteristics are summarized
2452 in *note M.2::.
2453
2454 18.a
2455 Discussion: We used to use the term "implementation dependent"
2456 instead of "unspecified". However, that sounded too much like
2457 "implementation defined". Furthermore, the term "unspecified"
2458 is used in the ANSI C and POSIX standards for this purpose, so
2459 that is another advantage. We also use "not specified" and
2460 "not specified by the language" as synonyms for "unspecified."
2461 The documentation requirement is the only difference between
2462 implementation defined and unspecified.
2463
2464 18.b
2465 Note that the "set of possible effects" can be "all imaginable
2466 effects", as is the case with erroneous execution.
2467
2468 19
2469 The implementation may choose to document implementation-defined
2470 behavior either by documenting what happens in general, or by providing
2471 some mechanism for the user to determine what happens in a particular
2472 case.
2473
2474 19.a
2475 Discussion: For example, if the standard says that library
2476 unit elaboration order is implementation defined, the
2477 implementation might describe (in its user's manual) the
2478 algorithm it uses to determine the elaboration order. On the
2479 other hand, the implementation might provide a command that
2480 produces a description of the elaboration order for a
2481 partition upon request from the user. It is also acceptable
2482 to provide cross references to existing documentation (for
2483 example, a hardware manual), where appropriate.
2484
2485 19.b
2486 Note that dependence of a program on implementation-defined or
2487 unspecified functionality is not defined to be an error; it
2488 might cause the program to be less portable, however.
2489
2490 19.c/2
2491 Documentation Requirement: The behavior of implementations in
2492 implementation-defined situations shall be documented -- see
2493 *note M.2::, "*note M.2:: Implementation-Defined
2494 Characteristics" for a listing.
2495
2496 _Implementation Advice_
2497
2498 20
2499 If an implementation detects the use of an unsupported Specialized Needs
2500 Annex feature at run time, it should raise Program_Error if feasible.
2501
2502 20.a.1/2
2503 Implementation Advice: Program_Error should be raised when an
2504 unsupported Specialized Needs Annex feature is used at run
2505 time.
2506
2507 20.a
2508 Reason: The reason we don't require Program_Error is that
2509 there are situations where other exceptions might make sense.
2510 For example, if the Real Time Systems Annex requires that the
2511 range of System.Priority include at least 30 values, an
2512 implementation could conform to the Standard (but not to the
2513 Annex) if it supported only 12 values. Since the rules of the
2514 language require Constraint_Error to be raised for
2515 out-of-range values, we cannot require Program_Error to be
2516 raised instead.
2517
2518 21
2519 If an implementation wishes to provide implementation-defined extensions
2520 to the functionality of a language-defined library unit, it should
2521 normally do so by adding children to the library unit.
2522
2523 21.a.1/2
2524 Implementation Advice: Implementation-defined extensions to
2525 the functionality of a language-defined library unit should be
2526 provided by adding children to the library unit.
2527
2528 21.a
2529 Implementation Note: If an implementation has support code
2530 ("run-time system code") that is needed for the execution of
2531 user-defined code, it can put that support code in child
2532 packages of System. Otherwise, it has to use some trick to
2533 avoid polluting the user's namespace. It is important that
2534 such tricks not be available to user-defined code (not in the
2535 standard mode, at least) -- that would defeat the purpose.
2536
2537 NOTES
2538
2539 22
2540 2 The above requirements imply that an implementation conforming
2541 to this Standard may support some of the capabilities required by a
2542 Specialized Needs Annex without supporting all required
2543 capabilities.
2544
2545 22.a
2546 Discussion: A conforming implementation can partially support
2547 a Specialized Needs Annex. Such an implementation does not
2548 conform to the Annex, but it does conform to the Standard.
2549
2550 \1f
2551 File: aarm2012.info, Node: 1.1.4, Next: 1.1.5, Prev: 1.1.3, Up: 1.1
2552
2553 1.1.4 Method of Description and Syntax Notation
2554 -----------------------------------------------
2555
2556 1
2557 The form of an Ada program is described by means of a context-free
2558 syntax together with context-dependent requirements expressed by
2559 narrative rules.
2560
2561 2
2562 The meaning of Ada programs is described by means of narrative rules
2563 defining both the effects of each construct and the composition rules
2564 for constructs.
2565
2566 3
2567 The context-free syntax of the language is described using a simple
2568 variant of Backus-Naur Form. In particular:
2569
2570 4
2571 * Lower case words in a sans-serif font, some containing embedded
2572 underlines, are used to denote syntactic categories, for example:
2573
2574 5
2575 case_statement
2576
2577 6
2578 * Boldface words are used to denote reserved words, for example:
2579
2580 7
2581 array
2582
2583 8
2584 * Square brackets enclose optional items. Thus the two following
2585 rules are equivalent.
2586
2587 9/2
2588 {AI95-00433-01AI95-00433-01}
2589 simple_return_statement ::= return [expression];
2590 simple_return_statement ::= return; | return expression;
2591
2592 10
2593 * Curly brackets enclose a repeated item. The item may appear zero
2594 or more times; the repetitions occur from left to right as with an
2595 equivalent left-recursive rule. Thus the two following rules are
2596 equivalent.
2597
2598 11
2599 term ::= factor {multiplying_operator factor}
2600 term ::= factor | term multiplying_operator factor
2601
2602 12
2603 * A vertical line separates alternative items unless it occurs
2604 immediately after an opening curly bracket, in which case it stands
2605 for itself:
2606
2607 13
2608 constraint ::= scalar_constraint | composite_constraint
2609 discrete_choice_list ::= discrete_choice {| discrete_choice}
2610
2611 14
2612 * If the name of any syntactic category starts with an italicized
2613 part, it is equivalent to the category name without the italicized
2614 part. The italicized part is intended to convey some semantic
2615 information. For example subtype_name and task_name are both
2616 equivalent to name alone.
2617
2618 14.a
2619 Discussion: The grammar given in this International Standard
2620 is not LR(1). In fact, it is ambiguous; the ambiguities are
2621 resolved by the overload resolution rules (see *note 8.6::).
2622
2623 14.b
2624 We often use "if" to mean "if and only if" in definitions.
2625 For example, if we define "photogenic" by saying, "A type is
2626 photogenic if it has the following properties...," we mean
2627 that a type is photogenic if and only if it has those
2628 properties. It is usually clear from the context, and adding
2629 the "and only if" seems too cumbersome.
2630
2631 14.c
2632 When we say, for example, "a declarative_item of a
2633 declarative_part", we are talking about a declarative_item
2634 immediately within that declarative_part. When we say "a
2635 declarative_item in, or within, a declarative_part", we are
2636 talking about a declarative_item anywhere in the
2637 declarative_part, possibly deeply nested within other
2638 declarative_parts. (This notation doesn't work very well for
2639 names, since the name "of" something also has another
2640 meaning.)
2641
2642 14.d
2643 When we refer to the name of a language-defined entity (for
2644 example, Duration), we mean the language-defined entity even
2645 in programs where the declaration of the language-defined
2646 entity is hidden by another declaration. For example, when we
2647 say that the expected type for the expression of a
2648 delay_relative_statement is Duration, we mean the
2649 language-defined type Duration that is declared in Standard,
2650 not some type Duration the user might have declared.
2651
2652 14.1/3
2653 {AI95-00285-01AI95-00285-01} {AI05-0004-1AI05-0004-1}
2654 {AI05-0262-1AI05-0262-1} The delimiters, compound delimiters, reserved
2655 words, and numeric_literals are exclusively made of the characters whose
2656 code point is between 16#20# and 16#7E#, inclusively. The special
2657 characters for which names are defined in this International Standard
2658 (see *note 2.1::) belong to the same range. [For example, the character
2659 E in the definition of exponent is the character whose name is "LATIN
2660 CAPITAL LETTER E", not "GREEK CAPITAL LETTER EPSILON".]
2661
2662 14.e/2
2663 Discussion: This just means that programs can be written in
2664 plain ASCII characters; no characters outside of the 7-bit
2665 range are required.
2666
2667 14.2/3
2668 {AI95-00395-01AI95-00395-01} {AI05-0227-1AI05-0227-1}
2669 {AI05-0299-1AI05-0299-1} When this International Standard mentions the
2670 conversion of some character or sequence of characters to upper case, it
2671 means the character or sequence of characters obtained by using simple
2672 upper case mapping, as defined by documents referenced in the note in
2673 Clause 1 of ISO/IEC 10646:2011.
2674
2675 14.e.1/3
2676 This paragraph was deleted.
2677
2678 15
2679 A syntactic category is a nonterminal in the grammar defined in BNF
2680 under "Syntax." Names of syntactic categories are set in a different
2681 font, like_this.
2682
2683 16
2684 A construct is a piece of text (explicit or implicit) that is an
2685 instance of a syntactic category defined under "Syntax".
2686
2687 16.a
2688 Ramification: For example, an expression is a construct. A
2689 declaration is a construct, whereas the thing declared by a
2690 declaration is an "entity."
2691
2692 16.b
2693 Discussion: "Explicit" and "implicit" don't mean exactly what
2694 you might think they mean: The text of an instance of a
2695 generic is considered explicit, even though it does not appear
2696 explicitly (in the nontechnical sense) in the program text,
2697 and even though its meaning is not defined entirely in terms
2698 of that text.
2699
2700 17
2701 A constituent of a construct is the construct itself, or any construct
2702 appearing within it.
2703
2704 18
2705 Whenever the run-time semantics defines certain actions to happen in an
2706 arbitrary order, this means that the implementation shall arrange for
2707 these actions to occur in a way that is equivalent to some sequential
2708 order, following the rules that result from that sequential order. When
2709 evaluations are defined to happen in an arbitrary order, with conversion
2710 of the results to some subtypes, or with some run-time checks, the
2711 evaluations, conversions, and checks may be arbitrarily interspersed, so
2712 long as each expression is evaluated before converting or checking its
2713 value. [Note that the effect of a program can depend on the order
2714 chosen by the implementation. This can happen, for example, if two
2715 actual parameters of a given call have side effects.]
2716
2717 18.a
2718 Discussion: Programs will be more portable if their external
2719 effect does not depend on the particular order chosen by an
2720 implementation.
2721
2722 18.b
2723 Ramification: Additional reordering permissions are given in
2724 *note 11.6::, "*note 11.6:: Exceptions and Optimization".
2725
2726 18.c
2727 There is no requirement that the implementation always choose
2728 the same order in a given kind of situation. In fact, the
2729 implementation is allowed to choose a different order for two
2730 different executions of the same construct. However, we
2731 expect most implementations will behave in a relatively
2732 predictable manner in most situations.
2733
2734 18.d
2735 Reason: The "sequential order" wording is intended to allow
2736 the programmer to rely on "benign" side effects. For example,
2737 if F is a function that returns a unique integer by
2738 incrementing some global and returning the result, a call such
2739 as P(F, F) is OK if the programmer cares only that the two
2740 results of F are unique; the two calls of F cannot be executed
2741 in parallel, unless the compiler can prove that parallel
2742 execution is equivalent to some sequential order.
2743
2744 NOTES
2745
2746 19
2747 3 The syntax rules describing structured constructs are presented
2748 in a form that corresponds to the recommended paragraphing. For
2749 example, an if_statement is defined as:
2750
2751 20
2752 if_statement ::=
2753 if condition then
2754 sequence_of_statements
2755 {elsif condition then
2756 sequence_of_statements}
2757 [else
2758 sequence_of_statements]
2759 end if;
2760
2761 21
2762 4 The line breaks and indentation in the syntax rules indicate the
2763 recommended line breaks and indentation in the corresponding
2764 constructs. The preferred places for other line breaks are after
2765 semicolons.
2766
2767 _Wording Changes from Ada 95_
2768
2769 21.a/2
2770 {AI95-00285-01AI95-00285-01} We now explicitly say that the
2771 lexical elements of the language (with a few exceptions) are
2772 made up of characters in the lower half of the Latin-1
2773 character set. This is needed to avoid confusion given the
2774 new capability to use most ISO 10646 characters in identifiers
2775 and strings.
2776
2777 21.b/2
2778 {AI95-00395-01AI95-00395-01} We now explicitly define what the
2779 Standard means by upper case, as there are many possibilities
2780 for ISO 10646 characters.
2781
2782 21.c/2
2783 {AI95-00433-01AI95-00433-01} The example for square brackets
2784 has been changed as there is no longer a return_statement
2785 syntax rule.
2786
2787 _Wording Changes from Ada 2005_
2788
2789 21.d/3
2790 {AI05-0227-1AI05-0227-1} Correction: Upper case is defined by
2791 "simple upper case mapping", because "full case folding" is a
2792 mapping (mostly) to lower case.
2793
2794 \1f
2795 File: aarm2012.info, Node: 1.1.5, Prev: 1.1.4, Up: 1.1
2796
2797 1.1.5 Classification of Errors
2798 ------------------------------
2799
2800 _Implementation Requirements_
2801
2802 1
2803 The language definition classifies errors into several different
2804 categories:
2805
2806 2
2807 * Errors that are required to be detected prior to run time by every
2808 Ada implementation;
2809
2810 3
2811 These errors correspond to any violation of a rule given in this
2812 International Standard, other than those listed below. In
2813 particular, violation of any rule that uses the terms shall,
2814 allowed, permitted, legal, or illegal belongs to this category.
2815 Any program that contains such an error is not a legal Ada program;
2816 on the other hand, the fact that a program is legal does not mean,
2817 per se, that the program is free from other forms of error.
2818
2819 4
2820 The rules are further classified as either compile time rules, or
2821 post compilation rules, depending on whether a violation has to be
2822 detected at the time a compilation unit is submitted to the
2823 compiler, or may be postponed until the time a compilation unit is
2824 incorporated into a partition of a program.
2825
2826 4.a
2827 Ramification: See, for example, *note 10.1.3::, "*note
2828 10.1.3:: Subunits of Compilation Units", for some errors that
2829 are detected only after compilation. Implementations are
2830 allowed, but not required, to detect post compilation rules at
2831 compile time when possible.
2832
2833 5
2834 * Errors that are required to be detected at run time by the
2835 execution of an Ada program;
2836
2837 6
2838 The corresponding error situations are associated with the names of
2839 the predefined exceptions. Every Ada compiler is required to
2840 generate code that raises the corresponding exception if such an
2841 error situation arises during program execution. [If such an error
2842 situation is certain to arise in every execution of a construct,
2843 then an implementation is allowed (although not required) to report
2844 this fact at compilation time.]
2845
2846 7
2847 * Bounded errors;
2848
2849 8
2850 The language rules define certain kinds of errors that need not be
2851 detected either prior to or during run time, but if not detected,
2852 the range of possible effects shall be bounded. The errors of this
2853 category are called bounded errors. The possible effects of a
2854 given bounded error are specified for each such error, but in any
2855 case one possible effect of a bounded error is the raising of the
2856 exception Program_Error.
2857
2858 9
2859 * Erroneous execution.
2860
2861 10
2862 In addition to bounded errors, the language rules define certain
2863 kinds of errors as leading to erroneous execution. Like bounded
2864 errors, the implementation need not detect such errors either prior
2865 to or during run time. Unlike bounded errors, there is no
2866 language-specified bound on the possible effect of erroneous
2867 execution; the effect is in general not predictable.
2868
2869 10.a
2870 Ramification: Executions are erroneous, not programs or parts
2871 of programs. Once something erroneous happens, the execution
2872 of the entire program is erroneous from that point on, and
2873 potentially before given possible reorderings permitted by
2874 *note 11.6:: and elsewhere. We cannot limit it to just one
2875 partition, since partitions are not required to live in
2876 separate address spaces. (But implementations are encouraged
2877 to limit it as much as possible.)
2878
2879 10.b
2880 Suppose a program contains a pair of things that will be
2881 executed "in an arbitrary order." It is possible that one
2882 order will result in something sensible, whereas the other
2883 order will result in erroneous execution. If the
2884 implementation happens to choose the first order, then the
2885 execution is not erroneous. This may seem odd, but it is not
2886 harmful.
2887
2888 10.c
2889 Saying that something is erroneous is semantically equivalent
2890 to saying that the behavior is unspecified. However,
2891 "erroneous" has a slightly more disapproving flavor.
2892
2893 _Implementation Permissions_
2894
2895 11
2896 [ An implementation may provide nonstandard modes of operation.
2897 Typically these modes would be selected by a pragma or by a command line
2898 switch when the compiler is invoked. When operating in a nonstandard
2899 mode, the implementation may reject compilation_units that do not
2900 conform to additional requirements associated with the mode, such as an
2901 excessive number of warnings or violation of coding style guidelines.
2902 Similarly, in a nonstandard mode, the implementation may apply special
2903 optimizations or alternative algorithms that are only meaningful for
2904 programs that satisfy certain criteria specified by the implementation.
2905 In any case, an implementation shall support a standard mode that
2906 conforms to the requirements of this International Standard; in
2907 particular, in the standard mode, all legal compilation_units shall be
2908 accepted.]
2909
2910 11.a
2911 Discussion: These permissions are designed to authorize
2912 explicitly the support for alternative modes. Of course,
2913 nothing we say can prevent them anyway, but this (redundant)
2914 paragraph is designed to indicate that such alternative modes
2915 are in some sense "approved" and even encouraged where they
2916 serve the specialized needs of a given user community, so long
2917 as the standard mode, designed to foster maximum portability,
2918 is always available.
2919
2920 _Implementation Advice_
2921
2922 12
2923 If an implementation detects a bounded error or erroneous execution, it
2924 should raise Program_Error.
2925
2926 12.a.1/2
2927 Implementation Advice: If a bounded error or erroneous
2928 execution is detected, Program_Error should be raised.
2929
2930 _Wording Changes from Ada 83_
2931
2932 12.a
2933 Some situations that are erroneous in Ada 83 are no longer
2934 errors at all. For example, depending on the parameter
2935 passing mechanism when unspecified is possibly nonportable,
2936 but not erroneous.
2937
2938 12.b
2939 Other situations that are erroneous in Ada 83 are changed to
2940 be bounded errors. In particular, evaluating an uninitialized
2941 scalar variable is a bounded error. The possible results are
2942 to raise Program_Error (as always), or to produce a
2943 machine-representable value (which might not be in the subtype
2944 of the variable). Violating a Range_Check or Overflow_Check
2945 raises Constraint_Error, even if the value came from an
2946 uninitialized variable. This means that optimizers can no
2947 longer "assume" that all variables are initialized within
2948 their subtype's range. Violating a check that is suppressed
2949 remains erroneous.
2950
2951 12.c
2952 The "incorrect order dependences" category of errors is
2953 removed. All such situations are simply considered potential
2954 nonportabilities. This category was removed due to the
2955 difficulty of defining what it means for two executions to
2956 have a "different effect." For example, if a function with a
2957 side effect is called twice in a single expression, it is not
2958 in principle possible for the compiler to decide whether the
2959 correctness of the resulting program depends on the order of
2960 execution of the two function calls. A compile time warning
2961 might be appropriate, but raising of Program_Error at run time
2962 would not be.
2963
2964 \1f
2965 File: aarm2012.info, Node: 1.2, Next: 1.3, Prev: 1.1, Up: 1
2966
2967 1.2 Normative References
2968 ========================
2969
2970 1/3
2971 {AI05-0299-1AI05-0299-1} The following documents, in whole or in part,
2972 are normatively referenced in this document and are indispensable for
2973 its application. For dated references, only the edition cited applies.
2974 For undated references, the latest edition of the referenced document
2975 (including any amendments) applies.
2976
2977 1.1/3
2978 {AI05-0127-2AI05-0127-2} {AI05-0299-1AI05-0299-1} ISO 639-3:2007, Codes
2979 for the representation of names of languages -- Part 3: Alpha-3 code for
2980 comprehensive coverage of languages.
2981
2982 2
2983 ISO/IEC 646:1991, Information technology -- ISO 7-bit coded character
2984 set for information interchange.
2985
2986 3/2
2987 {AI95-00415-01AI95-00415-01} ISO/IEC 1539-1:2004, Information technology
2988 -- Programming languages -- Fortran -- Part 1: Base language.
2989
2990 4/2
2991 {AI95-00415-01AI95-00415-01} ISO/IEC 1989:2002, Information technology
2992 -- Programming languages -- COBOL.
2993
2994 4.1/3
2995 {AI05-0127-2AI05-0127-2} {AI05-0299-1AI05-0299-1} ISO/IEC 3166-1:2006,
2996 Codes for the representation of names of countries and their
2997 subdivisions -- Part 1: Country Codes.
2998
2999 5
3000 ISO/IEC 6429:1992, Information technology -- Control functions for coded
3001 graphic character sets.
3002
3003 5.1/2
3004 {AI95-00351-01AI95-00351-01} ISO 8601:2004, Data elements and
3005 interchange formats -- Information interchange -- Representation of
3006 dates and times.
3007
3008 6/3
3009 {AI05-0299-1AI05-0299-1} ISO/IEC 8859-1:1998, Information technology --
3010 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet
3011 No. 1.
3012
3013 7/3
3014 {AI95-00415-01AI95-00415-01} {AI05-0266-1AI05-0266-1} ISO/IEC 9899:2011,
3015 Information technology -- Programming languages -- C.
3016
3017 8/3
3018 {8652/00018652/0001} {AI95-00124-01AI95-00124-01}
3019 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1} ISO/IEC
3020 10646:2011, Information technology -- Universal Multiple-Octet Coded
3021 Character Set (UCS).
3022
3023 8.a.1/2
3024 This paragraph was deleted.{8652/00018652/0001}
3025 {AI95-00124-01AI95-00124-01} {AI95-00285-01AI95-00285-01}
3026
3027 9/3
3028 {AI95-00376-01AI95-00376-01} {AI05-0266-1AI05-0266-1} ISO/IEC
3029 14882:2011, Information technology -- Programming languages -- C++.
3030
3031 10/2
3032 {AI95-00285-01AI95-00285-01} ISO/IEC TR 19769:2004, Information
3033 technology -- Programming languages, their environments and system
3034 software interfaces -- Extensions for the programming language C to
3035 support new character data types.
3036
3037 10.a
3038 Discussion: POSIX, Portable Operating System Interface (POSIX)
3039 -- Part 1: System Application Program Interface (API) [C
3040 Language], The Institute of Electrical and Electronics
3041 Engineers, 1990.
3042
3043 _Wording Changes from Ada 95_
3044
3045 10.b/2
3046 {AI95-00285-01AI95-00285-01} {AI95-00376-01AI95-00376-01}
3047 {AI95-00415-01AI95-00415-01} Updated references to the most
3048 recent versions of these standards. Added C++ and time
3049 standards. Added C character set technical report.
3050
3051 _Wording Changes from Ada 2005_
3052
3053 10.c/3
3054 {AI05-0127-2AI05-0127-2} Added language and country code
3055 standards for locale support.
3056
3057 10.d/3
3058 {AI05-0266-1AI05-0266-1} Updated references to the most recent
3059 versions of these standards.
3060
3061 \1f
3062 File: aarm2012.info, Node: 1.3, Prev: 1.2, Up: 1
3063
3064 1.3 Terms and Definitions
3065 =========================
3066
3067 1/2
3068 {AI95-00415-01AI95-00415-01} Terms are defined throughout this
3069 International Standard, indicated by italic type. Terms explicitly
3070 defined in this International Standard are not to be presumed to refer
3071 implicitly to similar terms defined elsewhere. Mathematical terms not
3072 defined in this International Standard are to be interpreted according
3073 to the CRC Concise Encyclopedia of Mathematics, Second Edition. Other
3074 terms not defined in this International Standard are to be interpreted
3075 according to the Webster's Third New International Dictionary of the
3076 English Language. Informal descriptions of some terms are also given in
3077 *note Annex N::, "*note Annex N:: Glossary".
3078
3079 1.a
3080 Discussion: The index contains an entry for every defined
3081 term.
3082
3083 1.a.1/2
3084 {AI95-00415-01AI95-00415-01} The contents of the CRC Concise
3085 Encyclopedia of Mathematics, Second Edition can be accessed on
3086 http://www.mathworld.com (http://www.mathworld.com). The ISBN
3087 number of the book is ISBN 1584883472.
3088
3089 1.b
3090 Glossary entry: Each term defined in *note Annex N:: is marked
3091 like this.
3092
3093 1.c/3
3094 Discussion: Here are some AARM-only definitions: The Ada
3095 Rapporteur Group (ARG) interprets the Ada Reference Manual.
3096 An Ada Issue (AI) is a numbered ruling from the ARG. Ada
3097 Issues created for Ada 83 are denoted as "AI83", while Ada
3098 Issues created for Ada 95 are denoted as "AI95" in this
3099 document. Similarly, Ada Issues created for Ada 2005 are
3100 denoted as "AI05" The Ada Commentary Integration Document
3101 (ACID) is an edition of the Ada 83 RM in which clearly marked
3102 insertions and deletions indicate the effect of integrating
3103 the approved AIs. The Uniformity Rapporteur Group (URG)
3104 issued recommendations intended to increase uniformity across
3105 Ada implementations. The functions of the URG have been
3106 assumed by the ARG. A Uniformity Issue (UI) was a numbered
3107 recommendation from the URG. A Defect Report and Response is
3108 an official query to WG9 about an error in the standard.
3109 Defect Reports are processed by the ARG, and are referenced
3110 here by their ISO numbers: 8652/nnnn. Most changes to the Ada
3111 95 standard include reference(s) to the Defect Report(s) that
3112 prompted the change. The Ada Conformity Assessment Test Suite
3113 (ACATS) is a set of tests intended to check the conformity of
3114 Ada implementations to this standard. This set of tests was
3115 previously known as the Ada Compiler Validation Capability
3116 (ACVC).
3117
3118 \1f
3119 File: aarm2012.info, Node: 2, Next: 3, Prev: 1, Up: Top
3120
3121 2 Lexical Elements
3122 ******************
3123
3124 1/3
3125 {AI05-0299-1AI05-0299-1} [The text of a program consists of the texts of
3126 one or more compilations. The text of a compilation is a sequence of
3127 lexical elements, each composed of characters; the rules of composition
3128 are given in this clause. Pragmas, which provide certain information
3129 for the compiler, are also described in this clause.]
3130
3131 * Menu:
3132
3133 * 2.1 :: Character Set
3134 * 2.2 :: Lexical Elements, Separators, and Delimiters
3135 * 2.3 :: Identifiers
3136 * 2.4 :: Numeric Literals
3137 * 2.5 :: Character Literals
3138 * 2.6 :: String Literals
3139 * 2.7 :: Comments
3140 * 2.8 :: Pragmas
3141 * 2.9 :: Reserved Words
3142
3143 \1f
3144 File: aarm2012.info, Node: 2.1, Next: 2.2, Up: 2
3145
3146 2.1 Character Set
3147 =================
3148
3149 1/3
3150 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3151 {AI05-0266-1AI05-0266-1} The character repertoire for the text of an Ada
3152 program consists of the entire coding space described by the ISO/IEC
3153 10646:2011 Universal Multiple-Octet Coded Character Set. This coding
3154 space is organized in planes, each plane comprising 65536 characters.
3155
3156 1.a/2
3157 This paragraph was deleted.{AI95-00285-01AI95-00285-01}
3158
3159 1.b/2
3160 This paragraph was deleted.{AI95-00285-01AI95-00285-01}
3161
3162 1.c/3
3163 Discussion: {AI95-00285-01AI95-00285-01}
3164 {AI05-0266-1AI05-0266-1} It is our intent to follow the
3165 terminology of ISO/IEC 10646:2011 where appropriate, and to
3166 remain compatible with the character classifications defined
3167 in *note A.3::, "*note A.3:: Character Handling".
3168
3169 _Syntax_
3170
3171 Paragraphs 2 and 3 were deleted.
3172
3173 3.1/3
3174 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3175 {AI05-0266-1AI05-0266-1} A character is defined by this
3176 International Standard for each cell in the coding space described
3177 by ISO/IEC 10646:2011, regardless of whether or not ISO/IEC
3178 10646:2011 allocates a character to that cell.
3179
3180 _Static Semantics_
3181
3182 4/3
3183 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3184 {AI05-0079-1AI05-0079-1} {AI05-0262-1AI05-0262-1}
3185 {AI05-0266-1AI05-0266-1} The coded representation for characters is
3186 implementation defined [(it need not be a representation defined within
3187 ISO/IEC 10646:2011)]. A character whose relative code point in its
3188 plane is 16#FFFE# or 16#FFFF# is not allowed anywhere in the text of a
3189 program. The only characters allowed outside of comments are those in
3190 categories other_format, format_effector, and graphic_character.
3191
3192 4.a
3193 Implementation defined: The coded representation for the text
3194 of an Ada program.
3195
3196 4.b/2
3197 Ramification: {AI95-00285-01AI95-00285-01} Note that this rule
3198 doesn't really have much force, since the implementation can
3199 represent characters in the source in any way it sees fit.
3200 For example, an implementation could simply define that what
3201 seems to be an other_private_use character is actually a
3202 representation of the space character.
3203
3204 4.1/3
3205 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1}
3206 {AI05-0299-1AI05-0299-1} The semantics of an Ada program whose text is
3207 not in Normalization Form KC (as defined by Clause 21 of ISO/IEC
3208 10646:2011) is implementation defined.
3209
3210 4.c/2
3211 Implementation defined: The semantics of an Ada program whose
3212 text is not in Normalization Form KC.
3213
3214 5/3
3215 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1}
3216 {AI05-0299-1AI05-0299-1} The description of the language definition in
3217 this International Standard uses the character properties General
3218 Category, Simple Uppercase Mapping, Uppercase Mapping, and Special Case
3219 Condition of the documents referenced by the note in Clause 1 of ISO/IEC
3220 10646:2011. The actual set of graphic symbols used by an implementation
3221 for the visual representation of the text of an Ada program is not
3222 specified.
3223
3224 6/3
3225 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1} Characters are
3226 categorized as follows:
3227
3228 6.a/3
3229 Discussion: {AI05-0005-1AI05-0005-1} {AI05-0262-1AI05-0262-1}
3230 {AI05-0266-1AI05-0266-1} Our character classification
3231 considers that the cells not allocated in ISO/IEC 10646:2011
3232 are graphic characters, except for those whose relative code
3233 point in their plane is 16#FFFE# or 16#FFFF#. This seems to
3234 provide the best compatibility with future versions of ISO/IEC
3235 10646, as future characters can already be used in Ada
3236 character and string literals.
3237
3238 7/2
3239
3240 This paragraph was deleted.{AI95-00285-01AI95-00285-01}
3241
3242 8/2
3243 {AI95-00285-01AI95-00285-01} letter_uppercase
3244 Any character whose General Category is defined to be
3245 "Letter, Uppercase".
3246
3247 9/2
3248 {AI95-00285-01AI95-00285-01} letter_lowercase
3249 Any character whose General Category is defined to be
3250 "Letter, Lowercase".
3251
3252 9.a/1
3253 This paragraph was deleted.{8652/00018652/0001}
3254 {AI95-00124-01AI95-00124-01}
3255
3256 9.1/2
3257 {AI95-00285-01AI95-00285-01} letter_titlecase
3258 Any character whose General Category is defined to be
3259 "Letter, Titlecase".
3260
3261 9.2/2
3262 {AI95-00285-01AI95-00285-01} letter_modifier
3263 Any character whose General Category is defined to be
3264 "Letter, Modifier".
3265
3266 9.3/2
3267 {AI95-00285-01AI95-00285-01} letter_other
3268 Any character whose General Category is defined to be
3269 "Letter, Other".
3270
3271 9.4/2
3272 {AI95-00285-01AI95-00285-01} mark_non_spacing
3273 Any character whose General Category is defined to be
3274 "Mark, Non-Spacing".
3275
3276 9.5/2
3277 {AI95-00285-01AI95-00285-01} mark_spacing_combining
3278 Any character whose General Category is defined to be
3279 "Mark, Spacing Combining".
3280
3281 10/2
3282 {AI95-00285-01AI95-00285-01} number_decimal
3283 Any character whose General Category is defined to be
3284 "Number, Decimal".
3285
3286 10.1/2
3287 {AI95-00285-01AI95-00285-01} number_letter
3288 Any character whose General Category is defined to be
3289 "Number, Letter".
3290
3291 10.2/2
3292 {AI95-00285-01AI95-00285-01} punctuation_connector
3293 Any character whose General Category is defined to be
3294 "Punctuation, Connector".
3295
3296 10.3/2
3297 {AI95-00285-01AI95-00285-01} other_format
3298 Any character whose General Category is defined to be
3299 "Other, Format".
3300
3301 11/2
3302 {AI95-00285-01AI95-00285-01} separator_space
3303 Any character whose General Category is defined to be
3304 "Separator, Space".
3305
3306 12/2
3307 {AI95-00285-01AI95-00285-01} separator_line
3308 Any character whose General Category is defined to be
3309 "Separator, Line".
3310
3311 12.1/2
3312 {AI95-00285-01AI95-00285-01} separator_paragraph
3313 Any character whose General Category is defined to be
3314 "Separator, Paragraph".
3315
3316 13/3
3317 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} format_effector
3318 The characters whose code points are 16#09# (CHARACTER
3319 TABULATION), 16#0A# (LINE FEED), 16#0B# (LINE
3320 TABULATION), 16#0C# (FORM FEED), 16#0D# (CARRIAGE
3321 RETURN), 16#85# (NEXT LINE), and the characters in
3322 categories separator_line and separator_paragraph.
3323
3324 13.a/2
3325 Discussion: ISO/IEC 10646:2003 does not define the names of
3326 control characters, but rather refers to the names defined by
3327 ISO/IEC 6429:1992. These are the names that we use here.
3328
3329 13.1/2
3330 {AI95-00285-01AI95-00285-01} other_control
3331 Any character whose General Category is defined to be
3332 "Other, Control", and which is not defined to be a
3333 format_effector.
3334
3335 13.2/2
3336 {AI95-00285-01AI95-00285-01} other_private_use
3337 Any character whose General Category is defined to be
3338 "Other, Private Use".
3339
3340 13.3/2
3341 {AI95-00285-01AI95-00285-01} other_surrogate
3342 Any character whose General Category is defined to be
3343 "Other, Surrogate".
3344
3345 14/3
3346 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3347 {AI05-0262-1AI05-0262-1} graphic_character
3348 Any character that is not in the categories
3349 other_control, other_private_use, other_surrogate,
3350 format_effector, and whose relative code point in its
3351 plane is neither 16#FFFE# nor 16#FFFF#.
3352
3353 14.a/2
3354 This paragraph was deleted.
3355
3356 14.b/2
3357 Discussion: {AI95-00285-01AI95-00285-01} We considered basing
3358 the definition of lexical elements on Annex A of ISO/IEC TR
3359 10176 (4th edition), which lists the characters which should
3360 be supported in identifiers for all programming languages, but
3361 we finally decided against this option. Note that it is not
3362 our intent to diverge from ISO/IEC TR 10176, except to the
3363 extent that ISO/IEC TR 10176 itself diverges from ISO/IEC
3364 10646:2003 (which is the case at the time of this writing
3365 [January 2005]).
3366
3367 14.c/2
3368 More precisely, we intend to align strictly with ISO/IEC
3369 10646:2003. It must be noted that ISO/IEC TR 10176 is a
3370 Technical Report while ISO/IEC 10646:2003 is a Standard. If
3371 one has to make a choice, one should conform with the Standard
3372 rather than with the Technical Report. And, it turns out that
3373 one must make a choice because there are important differences
3374 between the two:
3375
3376 14.d/2
3377 * ISO/IEC TR 10176 is still based on ISO/IEC 10646:2000
3378 while ISO/IEC 10646:2003 has already been published for a
3379 year. We cannot afford to delay the adoption of our
3380 amendment until ISO/IEC TR 10176 has been revised.
3381
3382 14.e/2
3383 * There are considerable differences between the two
3384 editions of ISO/IEC 10646, notably in supporting
3385 characters beyond the BMP (this might be significant for
3386 some languages, e.g. Korean).
3387
3388 14.f/2
3389 * ISO/IEC TR 10176 does not define case conversion tables,
3390 which are essential for a case-insensitive language like
3391 Ada. To get case conversion tables, we would have to
3392 reference either ISO/IEC 10646:2003 or Unicode, or we
3393 would have to invent our own.
3394
3395 14.g/2
3396 For the purpose of defining the lexical elements of the
3397 language, we need character properties like categorization, as
3398 well as case conversion tables. These are mentioned in
3399 ISO/IEC 10646:2003 as useful for implementations, with a
3400 reference to Unicode. Machine-readable tables are available
3401 on the web at URLs:
3402
3403 14.h/2
3404 http://www.unicode.org/Public/4.0-Update/UnicodeData-4.0.0.txt (http://www.unicode.org/Public/4.0-Update/UnicodeData-4.0.0.txt)
3405 http://www.unicode.org/Public/4.0-Update/CaseFolding-4.0.0.txt (http://www.unicode.org/Public/4.0-Update/CaseFolding-4.0.0.txt)
3406
3407 14.i/2
3408 with an explanatory document found at URL:
3409
3410 14.j/2
3411 http://www.unicode.org/Public/4.0-Update/UCD-4.0.0.html (http://www.unicode.org/Public/4.0-Update/UCD-4.0.0.html)
3412
3413 14.k/2
3414 The actual text of the standard only makes specific references
3415 to the corresponding clauses of ISO/IEC 10646:2003, not to
3416 Unicode.
3417
3418 15/3
3419 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1} The following
3420 names are used when referring to certain characters (the first name is
3421 that given in ISO/IEC 10646:2011):
3422
3423 15.a/3
3424 Discussion: {AI95-00285-01AI95-00285-01}
3425 {AI05-0266-1AI05-0266-1} This table serves to show the
3426 correspondence between ISO/IEC 10646:2011 names and the
3427 graphic symbols (glyphs) used in this International Standard.
3428 These are the characters that play a special role in the
3429 syntax of Ada.
3430
3431 graphic symbol name graphic symbol name
3432 " quotation mark : colon
3433 # number sign ; semicolon
3434 & ampersand < less-than sign
3435 ' apostrophe, tick = equals sign
3436 ( left parenthesis > greater-than sign
3437 ) right parenthesis _ low line, underline
3438 * asterisk, multiply | vertical line
3439 + plus sign / solidus, divide
3440 , comma ! exclamation point
3441 - hyphen-minus, minus % percent sign
3442 . full stop, dot, point
3443
3444 _Implementation Requirements_
3445
3446 16/3
3447 {AI05-0286-1AI05-0286-1} An Ada implementation shall accept Ada source
3448 code in UTF-8 encoding, with or without a BOM (see *note A.4.11::),
3449 where every character is represented by its code point. The character
3450 pair CARRIAGE RETURN/LINE FEED (code points 16#0D# 16#0A#) signifies a
3451 single end of line (see *note 2.2::); every other occurrence of a
3452 format_effector other than the character whose code point position is
3453 16#09# (CHARACTER TABULATION) also signifies a single end of line.
3454
3455 16.a/3
3456 Reason: {AI05-0079-1AI05-0079-1} {AI05-0286-1AI05-0286-1} This
3457 is simply requiring that an Ada implementation be able to
3458 directly process the ACATS, which is provided in the described
3459 format. Note that files that only contain characters with
3460 code points in the first 128 (which is the majority of the
3461 ACATS) are represented in the same way in both UTF-8 and in
3462 "plain" string format. The ACATS includes a BOM in files that
3463 have any characters with code points greater than 127. Note
3464 that the BOM contains characters not legal in Ada source code,
3465 so an implementation can use that to automatically distinguish
3466 between files formatted as plain Latin-1 strings and UTF-8
3467 with BOM.
3468
3469 16.b/3
3470 We allow line endings to be both represented as the pair CR LF
3471 (as in Windows and the ACATS), and as single format_effector
3472 characters (usually LF, as in Linux), in order that files
3473 created by standard tools on most operating systems will meet
3474 the standard format. We specify how many line endings each
3475 represent so that compilers use the same line numbering for
3476 standard source files.
3477
3478 16.c/3
3479 This requirement increases portability by having a format that
3480 is accepted by all Ada compilers. Note that implementations
3481 can support other source representations, including structured
3482 representations like a parse tree.
3483
3484 _Implementation Permissions_
3485
3486 17/3
3487 {AI95-00285-01AI95-00285-01} {AI05-0266-1AI05-0266-1} The categories
3488 defined above, as well as case mapping and folding, may be based on an
3489 implementation-defined version of ISO/IEC 10646 (2003 edition or later).
3490
3491 17.b/3
3492 Ramification: The exact categories, case mapping, and case
3493 folding chosen affects identifiers, the result of
3494 '[[Wide_]Wide_]Image, and packages Wide_Characters.Handling
3495 and Wide_Wide_Characters.Handling.
3496
3497 17.c/3
3498 Discussion: This permission allows implementations to upgrade
3499 to using a newer character set standard whenever that makes
3500 sense, rather than having to wait for the next Ada Standard.
3501 But the character set standard used cannot be older than
3502 ISO/IEC 10646:2003 (which is essentially similar to Unicode
3503 4.0).
3504
3505 NOTES
3506
3507 18/2
3508 1 {AI95-00285-01AI95-00285-01} The characters in categories
3509 other_control, other_private_use, and other_surrogate are only
3510 allowed in comments.
3511
3512 19.a/3
3513 This paragraph was deleted.{AI05-0286-1AI05-0286-1}
3514
3515 _Extensions to Ada 83_
3516
3517 19.b
3518 Ada 95 allows 8-bit and 16-bit characters, as well as
3519 implementation-specified character sets.
3520
3521 _Wording Changes from Ada 83_
3522
3523 19.c/3
3524 {AI95-00285-01AI95-00285-01} {AI05-0299-1AI05-0299-1} The
3525 syntax rules in this subclause are modified to remove the
3526 emphasis on basic characters vs. others. (In this day and
3527 age, there is no need to point out that you can write programs
3528 without using (for example) lower case letters.) In
3529 particular, character (representing all characters usable
3530 outside comments) is added, and basic_graphic_character,
3531 other_special_character, and basic_character are removed.
3532 Special_character is expanded to include Ada 83's
3533 other_special_character, as well as new 8-bit characters not
3534 present in Ada 83. Ada 2005 removes special_character
3535 altogether; we want to stick to ISO/IEC 10646:2003 character
3536 classifications. Note that the term "basic letter" is used in
3537 *note A.3::, "*note A.3:: Character Handling" to refer to
3538 letters without diacritical marks.
3539
3540 19.d/2
3541 {AI95-00285-01AI95-00285-01} Character names now come from
3542 ISO/IEC 10646:2003.
3543
3544 19.e/2
3545 This paragraph was deleted.{AI95-00285-01AI95-00285-01}
3546
3547 _Extensions to Ada 95_
3548
3549 19.f/2
3550 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3551 Program text can use most characters defined by
3552 ISO-10646:2003. This subclause has been rewritten to use the
3553 categories defined in that Standard. This should ease
3554 programming in languages other than English.
3555
3556 _Inconsistencies With Ada 2005_
3557
3558 19.g/3
3559 {AI05-0299-1AI05-0299-1} {AI05-0266-1AI05-0266-1} An
3560 implementation is allowed (but not required) to use a newer
3561 character set standard to determine the categories, case
3562 mapping, and case folding. Doing so will change the results
3563 of attributes '[[Wide_]Wide_]Image and the packages
3564 [Wide_]Wide_Characters.Handling in the case of a few rarely
3565 used characters. (This also could make some identifiers
3566 illegal, for characters that are no longer classified as
3567 letters.) This is unlikely to be a problem in practice.
3568 Moreover, truly portable Ada 2012 programs should avoid using
3569 in these contexts any characters that would have different
3570 classifications in any character set standards issued since
3571 10646:2003 (since the compiler can use any such standard as
3572 the basis for its classifications).
3573
3574 _Wording Changes from Ada 2005_
3575
3576 19.h/3
3577 {AI05-0079-1AI05-0079-1} Correction: Clarified that only
3578 characters in the categories defined here are allowed in the
3579 source of an Ada program. This was clear in Ada 95, but
3580 Amendment 1 dropped the wording instead of correcting it.
3581
3582 19.i/3
3583 {AI05-0286-1AI05-0286-1} A standard source representation is
3584 defined that all compilers are expected to process. Since
3585 this is the same format as the ACATS, it seems unlikely that
3586 there are any implementations that don't meet this
3587 requirement. Moreover, other representations are still
3588 permitted, and the "impossible or impractical" loophole (see
3589 *note 1.1.3::) can be invoked for any implementations that
3590 cannot directly process the ACATS.
3591
3592 \1f
3593 File: aarm2012.info, Node: 2.2, Next: 2.3, Prev: 2.1, Up: 2
3594
3595 2.2 Lexical Elements, Separators, and Delimiters
3596 ================================================
3597
3598 _Static Semantics_
3599
3600 1
3601 The text of a program consists of the texts of one or more compilations.
3602 The text of each compilation is a sequence of separate lexical elements.
3603 Each lexical element is formed from a sequence of characters, and is
3604 either a delimiter, an identifier, a reserved word, a numeric_literal, a
3605 character_literal, a string_literal, or a comment. The meaning of a
3606 program depends only on the particular sequences of lexical elements
3607 that form its compilations, excluding comments.
3608
3609 2/3
3610 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} The text of a
3611 compilation is divided into lines. In general, the representation for
3612 an end of line is implementation defined. However, a sequence of one or
3613 more format_effectors other than the character whose code point is
3614 16#09# (CHARACTER TABULATION) signifies at least one end of line.
3615
3616 2.a
3617 Implementation defined: The representation for an end of line.
3618
3619 3/2
3620 {AI95-00285-01AI95-00285-01} [In some cases an explicit separator is
3621 required to separate adjacent lexical elements.] A separator is any of
3622 a separator_space, a format_effector, or the end of a line, as follows:
3623
3624 4/2
3625 * {AI95-00285-01AI95-00285-01} A separator_space is a separator
3626 except within a comment, a string_literal, or a character_literal.
3627
3628 5/3
3629 * {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} The character
3630 whose code point is 16#09# (CHARACTER TABULATION) is a separator
3631 except within a comment.
3632
3633 6
3634 * The end of a line is always a separator.
3635
3636 7
3637 One or more separators are allowed between any two adjacent lexical
3638 elements, before the first of each compilation, or after the last. At
3639 least one separator is required between an identifier, a reserved word,
3640 or a numeric_literal and an adjacent identifier, reserved word, or
3641 numeric_literal.
3642
3643 7.1/3
3644 {AI05-0079-1AI05-0079-1} One or more other_format characters are allowed
3645 anywhere that a separator is[; any such characters have no effect on the
3646 meaning of an Ada program].
3647
3648 8/2
3649 {AI95-00285-01AI95-00285-01} A delimiter is either one of the following
3650 characters:
3651
3652 9
3653 & ' ( ) * + , - . / : ; < = > |
3654
3655 10
3656 or one of the following compound delimiters each composed of two
3657 adjacent special characters
3658
3659 11
3660 => .. ** := /= >= <= << >> <>
3661
3662 12
3663 Each of the special characters listed for single character delimiters is
3664 a single delimiter except if this character is used as a character of a
3665 compound delimiter, or as a character of a comment, string_literal,
3666 character_literal, or numeric_literal.
3667
3668 13
3669 The following names are used when referring to compound delimiters:
3670
3671 delimiter name=> arrow
3672 .. double dot
3673 ** double star, exponentiate
3674 := assignment (pronounced: "becomes")
3675 /= inequality (pronounced: "not equal")
3676 >= greater than or equal
3677 <= less than or equal
3678 << left label bracket
3679 >> right label bracket
3680 <> box
3681 _Implementation Requirements_
3682
3683 14
3684 An implementation shall support lines of at least 200 characters in
3685 length, not counting any characters used to signify the end of a line.
3686 An implementation shall support lexical elements of at least 200
3687 characters in length. The maximum supported line length and lexical
3688 element length are implementation defined.
3689
3690 14.a
3691 Implementation defined: Maximum supported line length and
3692 lexical element length.
3693
3694 14.b
3695 Discussion: From URG recommendation.
3696
3697 _Wording Changes from Ada 95_
3698
3699 14.c/3
3700 {AI95-00285-01AI95-00285-01} {AI05-0299-1AI05-0299-1} The
3701 wording was updated to use the new character categories
3702 defined in the preceding subclause.
3703
3704 _Extensions to Ada 2005_
3705
3706 14.d/3
3707 {AI05-0079-1AI05-0079-1} Correction: Clarified that
3708 other_format characters are allowed anywhere that separators
3709 are allowed. This was intended in Ada 2005, but didn't
3710 actually make it into the wording.
3711
3712 \1f
3713 File: aarm2012.info, Node: 2.3, Next: 2.4, Prev: 2.2, Up: 2
3714
3715 2.3 Identifiers
3716 ===============
3717
3718 1
3719 Identifiers are used as names.
3720
3721 _Syntax_
3722
3723 2/2
3724 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3725 identifier ::=
3726 identifier_start {identifier_start | identifier_extend}
3727
3728 3/2
3729 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3730 identifier_start ::=
3731 letter_uppercase
3732 | letter_lowercase
3733 | letter_titlecase
3734 | letter_modifier
3735 | letter_other
3736 | number_letter
3737
3738 3.1/3
3739 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
3740 {AI05-0091-1AI05-0091-1} identifier_extend ::=
3741 mark_non_spacing
3742 | mark_spacing_combining
3743 | number_decimal
3744 | punctuation_connector
3745
3746 4/3
3747 {AI95-00395-01AI95-00395-01} {AI05-0091-1AI05-0091-1} An identifier
3748 shall not contain two consecutive characters in category
3749 punctuation_connector, or end with a character in that category.
3750
3751 4.a/3
3752 Reason: This rule was stated in the syntax in Ada 95, but that
3753 has gotten too complex in Ada 2005.
3754
3755 _Static Semantics_
3756
3757 5/3
3758 {AI95-00285-01AI95-00285-01} {AI05-0091-1AI05-0091-1}
3759 {AI05-0227-1AI05-0227-1} {AI05-0266-1AI05-0266-1}
3760 {AI05-0299-1AI05-0299-1} Two identifiers are considered the same if they
3761 consist of the same sequence of characters after applying
3762 locale-independent simple case folding, as defined by documents
3763 referenced in the note in Clause 1 of ISO/IEC 10646:2011.
3764
3765 5.a/3
3766 Discussion: {AI05-0227-1AI05-0227-1} Simple case folding is a
3767 mapping to lower case, so this is matching the defining (lower
3768 case) version of a reserved word. We could have mentioned
3769 case folding of the reserved words, but as that is an identity
3770 function, it would have no effect.
3771
3772 5.a.1/3
3773 {AI05-0227-1AI05-0227-1} The "documents referenced" means
3774 Unicode. Note that simple case folding is supposed to be
3775 compatible between Unicode versions, so the Unicode version
3776 used doesn't matter.
3777
3778 5.3/3
3779 {AI95-00395-01AI95-00395-01} {AI05-0091-1AI05-0091-1}
3780 {AI05-0227-1AI05-0227-1} After applying simple case folding, an
3781 identifier shall not be identical to a reserved word.
3782
3783 5.b/3
3784 Implementation Note: We match the reserved words after
3785 applying case folding so that the rules for identifiers and
3786 reserved words are the same. Since a compiler usually will
3787 lexically process identifiers and reserved words the same way
3788 (often with the same code), this will prevent a lot of
3789 headaches.
3790
3791 5.c/3
3792 Ramification: {AI05-0227-1AI05-0227-1} The rules for reserved
3793 words differ in one way: they define case conversion on
3794 letters rather than sequences. This means that it is possible
3795 that there exist some unusual sequences that are neither
3796 identifiers nor reserved words. We are not aware of any such
3797 sequences so long as we use simple case folding (as opposed to
3798 full case folding), but we have defined the rules in case any
3799 are introduced in future character set standards. This
3800 originally was a problem when converting to upper case: "if"
3801 and "acceß" have upper case conversions of "IF" and "ACCESS"
3802 respectively. We would not want these to be treated as
3803 reserved words. But neither of these cases exist when using
3804 simple case folding.
3805
3806 _Implementation Permissions_
3807
3808 6
3809 In a nonstandard mode, an implementation may support other upper/lower
3810 case equivalence rules for identifiers[, to accommodate local
3811 conventions].
3812
3813 6.a/3
3814 Discussion: {AI95-00285-01AI95-00285-01}
3815 {AI05-0227-1AI05-0227-1} For instance, in most languages, the
3816 simple case folded equivalent of LATIN CAPITAL LETTER I (an
3817 upper case letter without a dot above) is LATIN SMALL LETTER I
3818 (a lower case letter with a dot above). In Turkish, though,
3819 LATIN CAPITAL LETTER I and LATIN CAPITAL LETTER I WITH DOT
3820 ABOVE are two distinct letters, so the case folded equivalent
3821 of LATIN CAPITAL LETTER I is LATIN SMALL LETTER DOTLESS I, and
3822 the case folded equivalent of LATIN CAPITAL LETTER I WITH DOT
3823 ABOVE is LATIN SMALL LETTER I. Take for instance the following
3824 identifier (which is the name of a city on the Tigris river in
3825 Eastern Anatolia):
3826
3827 6.b/3
3828 DIYARBAKIR -- The first i is dotted, the second isn't.
3829
3830 6.c/3
3831 A Turkish reader would expect that the above identifier is
3832 equivalent to:
3833
3834 6.d/3
3835 diyarbakir
3836
3837 6.d.1/3
3838 However, locale-independent simple case folding (and thus Ada)
3839 maps this to:
3840
3841 6.d.2/3
3842 dIyarbakir
3843
3844 6.e/3
3845 which is different from any of the following identifiers:
3846
3847 6.f/2
3848 diyarbakir
3849 diyarbakir
3850 diyarbakir
3851 diyarbakir
3852
3853 6.f.1/3
3854 including the "correct" matching identifier for Turkish.
3855 Upper case conversion (used in '[Wide_]Wide_Image) introduces
3856 additional problems.
3857
3858 6.g/3
3859 An implementation targeting the Turkish market is allowed (in
3860 fact, expected) to provide a nonstandard mode where case
3861 folding is appropriate for Turkish.
3862
3863 6.j/2
3864 Lithuanian and Azeri are two other languages that present
3865 similar idiosyncrasies.
3866
3867 NOTES
3868
3869 6.1/2
3870 2 {AI95-00285-01AI95-00285-01} Identifiers differing only in the
3871 use of corresponding upper and lower case letters are considered
3872 the same.
3873
3874 _Examples_
3875
3876 7
3877 Examples of identifiers:
3878
3879 8/2
3880 {AI95-00433-01AI95-00433-01} Count X Get_Symbol Ethelyn Marion
3881 Snobol_4 X1 Page_Count Store_Next_Item
3882 [Unicode 928][Unicode 955][Unicode 940][Unicode 964][Unicode 969][Unicode 957] -- Plato
3883 [Unicode 1063][Unicode 1072][Unicode 1081][Unicode 1082][Unicode 1086][Unicode 1074][Unicode 1089][Unicode 1082][Unicode 1080][Unicode 1081] -- Tchaikovsky
3884 [Unicode 952] [Unicode 966] -- Angles
3885
3886 _Wording Changes from Ada 83_
3887
3888 8.a
3889 We no longer include reserved words as identifiers. This is
3890 not a language change. In Ada 83, identifier included
3891 reserved words. However, this complicated several other rules
3892 (for example, regarding implementation-defined attributes and
3893 pragmas, etc.). We now explicitly allow certain reserved
3894 words for attribute designators, to make up for the loss.
3895
3896 8.b
3897 Ramification: Because syntax rules are relevant to overload
3898 resolution, it means that if it looks like a reserved word, it
3899 is not an identifier. As a side effect, implementations
3900 cannot use reserved words as implementation-defined attributes
3901 or pragma names.
3902
3903 _Extensions to Ada 95_
3904
3905 8.c/2
3906 {AI95-00285-01AI95-00285-01} An identifier can use any letter
3907 defined by ISO-10646:2003, along with several other
3908 categories. This should ease programming in languages other
3909 than English.
3910
3911 _Incompatibilities With Ada 2005_
3912
3913 8.d/3
3914 {AI05-0091-1AI05-0091-1} Correction: other_format characters
3915 were removed from identifiers as the Unicode recommendations
3916 have changed. This change can only affect programs written
3917 for the original Ada 2005, so there should be few such
3918 programs.
3919
3920 8.e/3
3921 {AI05-0227-1AI05-0227-1} Correction: We now specify simple
3922 case folding rather than full case folding. That potentially
3923 could change identifier equivalence, although it is more
3924 likely that identifiers that are considered the same in
3925 original Ada 2005 will now be considered different. This
3926 change was made because the original Ada 2005 definition was
3927 incompatible (and even inconsistent in unusual cases) with the
3928 Ada 95 identifier equivalence rules. As such, the Ada 2005
3929 rules were rarely fully implemented, and in any case, only Ada
3930 2005 identifiers containing wide characters could be affected.
3931
3932 \1f
3933 File: aarm2012.info, Node: 2.4, Next: 2.5, Prev: 2.3, Up: 2
3934
3935 2.4 Numeric Literals
3936 ====================
3937
3938 1
3939 There are two kinds of numeric_literals, real literals and integer
3940 literals. A real literal is a numeric_literal that includes a point; an
3941 integer literal is a numeric_literal without a point.
3942
3943 _Syntax_
3944
3945 2
3946 numeric_literal ::= decimal_literal | based_literal
3947
3948 NOTES
3949
3950 3
3951 3 The type of an integer literal is universal_integer. The type
3952 of a real literal is universal_real.
3953
3954 * Menu:
3955
3956 * 2.4.1 :: Decimal Literals
3957 * 2.4.2 :: Based Literals
3958
3959 \1f
3960 File: aarm2012.info, Node: 2.4.1, Next: 2.4.2, Up: 2.4
3961
3962 2.4.1 Decimal Literals
3963 ----------------------
3964
3965 1
3966 A decimal_literal is a numeric_literal in the conventional decimal
3967 notation (that is, the base is ten).
3968
3969 _Syntax_
3970
3971 2
3972 decimal_literal ::= numeral [.numeral] [exponent]
3973
3974 3
3975 numeral ::= digit {[underline] digit}
3976
3977 4
3978 exponent ::= E [+] numeral | E - numeral
3979
3980 4.1/2
3981 {AI95-00285-01AI95-00285-01} digit ::=
3982 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
3983
3984 5
3985 An exponent for an integer literal shall not have a minus sign.
3986
3987 5.a
3988 Ramification: Although this rule is in this subclause, it
3989 applies also to the next subclause.
3990
3991 _Static Semantics_
3992
3993 6
3994 An underline character in a numeric_literal does not affect its meaning.
3995 The letter E of an exponent can be written either in lower case or in
3996 upper case, with the same meaning.
3997
3998 6.a
3999 Ramification: Although these rules are in this subclause, they
4000 apply also to the next subclause.
4001
4002 7
4003 An exponent indicates the power of ten by which the value of the
4004 decimal_literal without the exponent is to be multiplied to obtain the
4005 value of the decimal_literal with the exponent.
4006
4007 _Examples_
4008
4009 8
4010 Examples of decimal literals:
4011
4012 9
4013 12 0 1E6 123_456 -- integer literals
4014
4015 12.0 0.0 0.456 3.14159_26 -- real literals
4016
4017 _Wording Changes from Ada 83_
4018
4019 9.a
4020 We have changed the syntactic category name integer to be
4021 numeral. We got this idea from ACID. It avoids the confusion
4022 between this and integers. (Other places don't offer similar
4023 confusions. For example, a string_literal is different from a
4024 string.)
4025
4026 \1f
4027 File: aarm2012.info, Node: 2.4.2, Prev: 2.4.1, Up: 2.4
4028
4029 2.4.2 Based Literals
4030 --------------------
4031
4032 1
4033 [ A based_literal is a numeric_literal expressed in a form that
4034 specifies the base explicitly.]
4035
4036 _Syntax_
4037
4038 2
4039 based_literal ::=
4040 base # based_numeral [.based_numeral] # [exponent]
4041
4042 3
4043 base ::= numeral
4044
4045 4
4046 based_numeral ::=
4047 extended_digit {[underline] extended_digit}
4048
4049 5
4050 extended_digit ::= digit | A | B | C | D | E | F
4051
4052 _Legality Rules_
4053
4054 6
4055 The base (the numeric value of the decimal numeral preceding the first
4056 #) shall be at least two and at most sixteen. The extended_digits A
4057 through F represent the digits ten through fifteen, respectively. The
4058 value of each extended_digit of a based_literal shall be less than the
4059 base.
4060
4061 _Static Semantics_
4062
4063 7
4064 The conventional meaning of based notation is assumed. An exponent
4065 indicates the power of the base by which the value of the based_literal
4066 without the exponent is to be multiplied to obtain the value of the
4067 based_literal with the exponent. The base and the exponent, if any, are
4068 in decimal notation.
4069
4070 8
4071 The extended_digits A through F can be written either in lower case or
4072 in upper case, with the same meaning.
4073
4074 _Examples_
4075
4076 9
4077 Examples of based literals:
4078
4079 10
4080 2#1111_1111# 16#FF# 016#0ff# -- integer literals of value 255
4081 16#E#E1 2#1110_0000# -- integer literals of value 224
4082 16#F.FF#E+2 2#1.1111_1111_1110#E11 -- real literals of value 4095.0
4083
4084 _Wording Changes from Ada 83_
4085
4086 10.a
4087 The rule about which letters are allowed is now encoded in
4088 BNF, as suggested by Mike Woodger. This is clearly more
4089 readable.
4090
4091 \1f
4092 File: aarm2012.info, Node: 2.5, Next: 2.6, Prev: 2.4, Up: 2
4093
4094 2.5 Character Literals
4095 ======================
4096
4097 1
4098 [A character_literal is formed by enclosing a graphic character between
4099 two apostrophe characters.]
4100
4101 _Syntax_
4102
4103 2
4104 character_literal ::= 'graphic_character'
4105
4106 NOTES
4107
4108 3
4109 4 A character_literal is an enumeration literal of a character
4110 type. See *note 3.5.2::.
4111
4112 _Examples_
4113
4114 4
4115 Examples of character literals:
4116
4117 5/2
4118 {AI95-00433-01AI95-00433-01} 'A' '*' ''' ' '
4119 'L' '[Unicode 1051]' '[Unicode 923]' -- Various els.
4120 '[Unicode 8734]' '[Unicode 1488]' -- Big numbers - infinity and aleph.
4121
4122 _Wording Changes from Ada 83_
4123
4124 5.a/3
4125 {AI05-0299-1AI05-0299-1} The definitions of the values of
4126 literals are in Clauses 3 and 4, rather than here, since it
4127 requires knowledge of types.
4128
4129 \1f
4130 File: aarm2012.info, Node: 2.6, Next: 2.7, Prev: 2.5, Up: 2
4131
4132 2.6 String Literals
4133 ===================
4134
4135 1
4136 [A string_literal is formed by a sequence of graphic characters
4137 (possibly none) enclosed between two quotation marks used as string
4138 brackets. They are used to represent operator_symbols (see *note
4139 6.1::), values of a string type (see *note 4.2::), and array
4140 subaggregates (see *note 4.3.3::). ]
4141
4142 _Syntax_
4143
4144 2
4145 string_literal ::= "{string_element}"
4146
4147 3
4148 string_element ::= "" | non_quotation_mark_graphic_character
4149
4150 4
4151 A string_element is either a pair of quotation marks (""), or a
4152 single graphic_character other than a quotation mark.
4153
4154 _Static Semantics_
4155
4156 5
4157 The sequence of characters of a string_literal is formed from the
4158 sequence of string_elements between the bracketing quotation marks, in
4159 the given order, with a string_element that is "" becoming a single
4160 quotation mark in the sequence of characters, and any other
4161 string_element being reproduced in the sequence.
4162
4163 6
4164 A null string literal is a string_literal with no string_elements
4165 between the quotation marks.
4166
4167 NOTES
4168
4169 7
4170 5 An end of line cannot appear in a string_literal.
4171
4172 7.1/2
4173 6 {AI95-00285-01AI95-00285-01} No transformation is performed on
4174 the sequence of characters of a string_literal.
4175
4176 _Examples_
4177
4178 8
4179 Examples of string literals:
4180
4181 9/2
4182 {AI95-00433-01AI95-00433-01} "Message of the day:"
4183
4184 "" -- a null string literal
4185 " " "A" """" -- three string literals of length 1
4186
4187 "Characters such as $, %, and } are allowed in string literals"
4188 "Archimedes said ""[Unicode 917][Unicode 973][Unicode 961][Unicode 951][Unicode 954][Unicode 945]"""
4189 "Volume of cylinder (PIr²h) = "
4190
4191 _Wording Changes from Ada 83_
4192
4193 9.a
4194 The wording has been changed to be strictly lexical. No
4195 mention is made of string or character values, since
4196 string_literals are also used to represent operator_symbols,
4197 which don't have a defined value.
4198
4199 9.b
4200 The syntax is described differently.
4201
4202 _Wording Changes from Ada 95_
4203
4204 9.c/2
4205 {AI95-00285-01AI95-00285-01} We explicitly say that the
4206 characters of a string_literal should be used as is. In
4207 particular, no normalization or folding should be performed on
4208 a string_literal.
4209
4210 \1f
4211 File: aarm2012.info, Node: 2.7, Next: 2.8, Prev: 2.6, Up: 2
4212
4213 2.7 Comments
4214 ============
4215
4216 1
4217 A comment starts with two adjacent hyphens and extends up to the end of
4218 the line.
4219
4220 _Syntax_
4221
4222 2
4223 comment ::= --{non_end_of_line_character}
4224
4225 3
4226 A comment may appear on any line of a program.
4227
4228 _Static Semantics_
4229
4230 4
4231 The presence or absence of comments has no influence on whether a
4232 program is legal or illegal. Furthermore, comments do not influence the
4233 meaning of a program; their sole purpose is the enlightenment of the
4234 human reader.
4235
4236 _Examples_
4237
4238 5
4239 Examples of comments:
4240
4241 6
4242 -- the last sentence above echoes the Algol 68 report
4243
4244 end; -- processing of Line is complete
4245
4246 -- a long comment may be split onto
4247 -- two or more consecutive lines
4248
4249 ---------------- the first two hyphens start the comment
4250
4251 \1f
4252 File: aarm2012.info, Node: 2.8, Next: 2.9, Prev: 2.7, Up: 2
4253
4254 2.8 Pragmas
4255 ===========
4256
4257 1
4258 A pragma is a compiler directive. There are language-defined pragmas
4259 that give instructions for optimization, listing control, etc. An
4260 implementation may support additional (implementation-defined) pragmas.
4261
4262 _Language Design Principles_
4263
4264 1.a/3
4265 {AI05-0100-1AI05-0100-1} {AI05-0163-1AI05-0163-1} In general,
4266 if all pragmas are treated as unrecognized pragmas, the
4267 program should remain both syntactically and semantically
4268 legal. There are a few exceptions to this general principle
4269 (for example, pragma Import can eliminate the need for a
4270 completion), but the principle remains, and is strictly true
4271 at the syntactic level. Certainly any implementation-defined
4272 pragmas should obey this principle both syntactically and
4273 semantically, so that if the pragmas are not recognized by
4274 some other implementation, the program will remain legal.
4275
4276 _Syntax_
4277
4278 2
4279 pragma ::=
4280 pragma identifier [(pragma_argument_association {,
4281 pragma_argument_association})];
4282
4283 3/3
4284 {AI05-0290-1AI05-0290-1} pragma_argument_association ::=
4285 [pragma_argument_identifier =>] name
4286 | [pragma_argument_identifier =>] expression
4287 | pragma_argument_aspect_mark => name
4288 | pragma_argument_aspect_mark => expression
4289
4290 4/3
4291 {AI05-0290-1AI05-0290-1} In a pragma, any
4292 pragma_argument_associations without a pragma_argument_identifier
4293 or pragma_argument_aspect_mark shall precede any associations with
4294 a pragma_argument_identifier or pragma_argument_aspect_mark.
4295
4296 5
4297 Pragmas are only allowed at the following places in a program:
4298
4299 6
4300 * After a semicolon delimiter, but not within a formal_part or
4301 discriminant_part.
4302
4303 7/3
4304 * {AI05-0100-1AI05-0100-1} {AI05-0163-1AI05-0163-1} At any place
4305 where the syntax rules allow a construct defined by a
4306 syntactic category whose name ends with "declaration", "item",
4307 "statement", "clause", or "alternative", or one of the
4308 syntactic categories variant or exception_handler; but not in
4309 place of such a construct if the construct is required, or is
4310 part of a list that is required to have at least one such
4311 construct.
4312
4313 7.1/3
4314 * {AI05-0163-1AI05-0163-1} In place of a statement in a
4315 sequence_of_statements.
4316
4317 7.2/3
4318 * {AI05-0100-1AI05-0100-1} At any place where a compilation_unit
4319 is allowed.
4320
4321 8
4322 Additional syntax rules and placement restrictions exist for
4323 specific pragmas.
4324
4325 8.a
4326 Discussion: The above rule is written in text, rather than in
4327 BNF; the syntactic category pragma is not used in any BNF
4328 syntax rule.
4329
4330 8.b
4331 Ramification: A pragma is allowed where a
4332 generic_formal_parameter_declaration is allowed.
4333
4334 9
4335 The name of a pragma is the identifier following the reserved word
4336 pragma. The name or expression of a pragma_argument_association is a
4337 pragma argument.
4338
4339 9.a/2
4340 To be honest: {AI95-00284-02AI95-00284-02} For compatibility
4341 with Ada 83, the name of a pragma may also be "interface",
4342 which is not an identifier (because it is a reserved word).
4343 See *note J.12::.
4344
4345 10/3
4346 {AI05-0272-1AI05-0272-1} An identifier specific to a pragma is an
4347 identifier or reserved word that is used in a pragma argument with
4348 special meaning for that pragma.
4349
4350 10.a
4351 To be honest: Whenever the syntax rules for a given pragma
4352 allow "identifier" as an argument of the pragma, that
4353 identifier is an identifier specific to that pragma.
4354
4355 10.b/3
4356 {AI05-0272-1AI05-0272-1} In a few cases, a reserved word is
4357 allowed as "an identifier specific to a pragma". Even in
4358 these cases, the syntax still is written as identifier (the
4359 reserved word(s) are not shown). For example, the restriction
4360 No_Use_Of_Attribute (see *note 13.12.1::) allows the reserved
4361 words which can be attribute designators, but the syntax for a
4362 restriction does not include these reserved words.
4363
4364 _Static Semantics_
4365
4366 11
4367 If an implementation does not recognize the name of a pragma, then it
4368 has no effect on the semantics of the program. Inside such a pragma,
4369 the only rules that apply are the Syntax Rules.
4370
4371 11.a
4372 To be honest: This rule takes precedence over any other rules
4373 that imply otherwise.
4374
4375 11.b
4376 Ramification: Note well: this rule applies only to pragmas
4377 whose name is not recognized. If anything else is wrong with
4378 a pragma (at compile time), the pragma is illegal. This is
4379 true whether the pragma is language defined or implementation
4380 defined.
4381
4382 11.c
4383 For example, an expression in an unrecognized pragma does not
4384 cause freezing, even though the rules in *note 13.14::, "*note
4385 13.14:: Freezing Rules" say it does; the above rule overrules
4386 those other rules. On the other hand, an expression in a
4387 recognized pragma causes freezing, even if this makes
4388 something illegal.
4389
4390 11.d
4391 For another example, an expression that would be ambiguous is
4392 not illegal if it is inside an unrecognized pragma.
4393
4394 11.e
4395 Note, however, that implementations have to recognize pragma
4396 Inline(Foo) and freeze things accordingly, even if they choose
4397 to never do inlining.
4398
4399 11.f
4400 Obviously, the contradiction needs to be resolved one way or
4401 the other. The reasons for resolving it this way are: The
4402 implementation is simple -- the compiler can just ignore the
4403 pragma altogether. The interpretation of constructs appearing
4404 inside implementation-defined pragmas is implementation
4405 defined. For example: "pragma Mumble(X);". If the current
4406 implementation has never heard of Mumble, then it doesn't know
4407 whether X is a name, an expression, or an identifier specific
4408 to the pragma Mumble.
4409
4410 11.g
4411 To be honest: The syntax of individual pragmas overrides the
4412 general syntax for pragma.
4413
4414 11.h
4415 Ramification: Thus, an identifier specific to a pragma is not
4416 a name, syntactically; if it were, the visibility rules would
4417 be invoked, which is not what we want.
4418
4419 11.i/3
4420 {AI05-0229-1AI05-0229-1} This also implies that named
4421 associations do not allow one to give the arguments in an
4422 arbitrary order -- the order given in the syntax rule for each
4423 individual pragma must be obeyed. However, it is generally
4424 possible to leave out earlier arguments when later ones are
4425 given; for example, this is allowed by the syntax rule for
4426 pragma Import (see *note J.15.5::, "*note J.15.5:: Interfacing
4427 Pragmas"). As for subprogram calls, positional notation
4428 precedes named notation.
4429
4430 11.j
4431 Note that Ada 83 had no pragmas for which the order of named
4432 associations mattered, since there was never more than one
4433 argument that allowed named associations.
4434
4435 11.k
4436 To be honest: The interpretation of the arguments of
4437 implementation-defined pragmas is implementation defined.
4438 However, the syntax rules have to be obeyed.
4439
4440 _Dynamic Semantics_
4441
4442 12
4443 Any pragma that appears at the place of an executable construct is
4444 executed. Unless otherwise specified for a particular pragma, this
4445 execution consists of the evaluation of each evaluable pragma argument
4446 in an arbitrary order.
4447
4448 12.a
4449 Ramification: For a pragma that appears at the place of an
4450 elaborable construct, execution is elaboration.
4451
4452 12.b
4453 An identifier specific to a pragma is neither a name nor an
4454 expression -- such identifiers are not evaluated (unless an
4455 implementation defines them to be evaluated in the case of an
4456 implementation-defined pragma).
4457
4458 12.c
4459 The "unless otherwise specified" part allows us (and
4460 implementations) to make exceptions, so a pragma can contain
4461 an expression that is not evaluated. Note that pragmas in
4462 type_definitions may contain expressions that depend on
4463 discriminants.
4464
4465 12.d
4466 When we wish to define a pragma with some run-time effect, we
4467 usually make sure that it appears in an executable context;
4468 otherwise, special rules are needed to define the run-time
4469 effect and when it happens.
4470
4471 _Implementation Requirements_
4472
4473 13
4474 The implementation shall give a warning message for an unrecognized
4475 pragma name.
4476
4477 13.a
4478 Ramification: An implementation is also allowed to have modes
4479 in which a warning message is suppressed, or in which the
4480 presence of an unrecognized pragma is a compile-time error.
4481
4482 _Implementation Permissions_
4483
4484 14
4485 An implementation may provide implementation-defined pragmas; the name
4486 of an implementation-defined pragma shall differ from those of the
4487 language-defined pragmas.
4488
4489 14.a
4490 Implementation defined: Implementation-defined pragmas.
4491
4492 14.b
4493 Ramification: The semantics of implementation-defined pragmas,
4494 and any associated rules (such as restrictions on their
4495 placement or arguments), are, of course, implementation
4496 defined. Implementation-defined pragmas may have run-time
4497 effects.
4498
4499 15
4500 An implementation may ignore an unrecognized pragma even if it violates
4501 some of the Syntax Rules, if detecting the syntax error is too complex.
4502
4503 15.a
4504 Reason: Many compilers use extra post-parsing checks to
4505 enforce the syntax rules, since the Ada syntax rules are not
4506 LR(k) (for any k). (The grammar is ambiguous, in fact.) This
4507 paragraph allows them to ignore an unrecognized pragma,
4508 without having to perform such post-parsing checks.
4509
4510 _Implementation Advice_
4511
4512 16/3
4513 {AI05-0163-1AI05-0163-1} Normally, implementation-defined pragmas should
4514 have no semantic effect for error-free programs; that is, if the
4515 implementation-defined pragmas in a working program are replaced with
4516 unrecognized pragmas, the program should still be legal, and should
4517 still have the same semantics.
4518
4519 16.a.1/2
4520 Implementation Advice: Implementation-defined pragmas should
4521 have no semantic effect for error-free programs.
4522
4523 16.a
4524 Ramification: Note that "semantics" is not the same as
4525 "effect;" as explained in *note 1.1.3::, the semantics defines
4526 a set of possible effects.
4527
4528 16.b
4529 Note that adding a pragma to a program might cause an error
4530 (either at compile time or at run time). On the other hand,
4531 if the language-specified semantics for a feature are in part
4532 implementation defined, it makes sense to support pragmas that
4533 control the feature, and that have real semantics; thus, this
4534 paragraph is merely a recommendation.
4535
4536 17
4537 Normally, an implementation should not define pragmas that can make an
4538 illegal program legal, except as follows:
4539
4540 18/3
4541 * {AI05-0229-1AI05-0229-1} A pragma used to complete a declaration;
4542
4543 18.a/3
4544 Discussion: {AI05-0229-1AI05-0229-1} There are no
4545 language-defined pragmas which can be completions; pragma
4546 Import was defined this way in Ada 95 and Ada 2005, but in Ada
4547 2012 pragma Import just sets aspect Import which disallows
4548 having any completion.
4549
4550 19
4551 * A pragma used to configure the environment by adding, removing, or
4552 replacing library_items.
4553
4554 19.a.1/2
4555 Implementation Advice: Implementation-defined pragmas should
4556 not make an illegal program legal, unless they complete a
4557 declaration or configure the library_items in an environment.
4558
4559 19.a
4560 Ramification: For example, it is OK to support Interface,
4561 System_Name, Storage_Unit, and Memory_Size pragmas for upward
4562 compatibility reasons, even though all of these pragmas can
4563 make an illegal program legal. (The latter three can affect
4564 legality in a rather subtle way: They affect the value of
4565 named numbers in System, and can therefore affect the legality
4566 in cases where static expressions are required.)
4567
4568 19.b
4569 On the other hand, adding implementation-defined pragmas to a
4570 legal program can make it illegal. For example, a common kind
4571 of implementation-defined pragma is one that promises some
4572 property that allows more efficient code to be generated. If
4573 the promise is a lie, it is best if the user gets an error
4574 message.
4575
4576 _Incompatibilities With Ada 83_
4577
4578 19.c
4579 In Ada 83, "bad" pragmas are ignored. In Ada 95, they are
4580 illegal, except in the case where the name of the pragma
4581 itself is not recognized by the implementation.
4582
4583 _Extensions to Ada 83_
4584
4585 19.d
4586 Implementation-defined pragmas may affect the legality of a
4587 program.
4588
4589 _Wording Changes from Ada 83_
4590
4591 19.e
4592 Implementation-defined pragmas may affect the run-time
4593 semantics of the program. This was always true in Ada 83
4594 (since it was not explicitly forbidden by RM83), but it was
4595 not clear, because there was no definition of "executing" or
4596 "elaborating" a pragma.
4597
4598 _Extensions to Ada 2005_
4599
4600 19.f/3
4601 {AI05-0163-1AI05-0163-1} Correction: Allow pragmas in place of
4602 a statement, even if there are no other statements in a
4603 sequence_of_statements.
4604
4605 19.g/3
4606 {AI05-0272-1AI05-0272-1} Identifiers specific to a pragma can
4607 be reserved words.
4608
4609 19.h/3
4610 {AI05-0290-1AI05-0290-1} Pragma arguments can be identified
4611 with aspect_marks; this allows identifier'Class in this
4612 context. As usual, this is only allowed if specifically
4613 allowed by a particular pragma.
4614
4615 _Wording Changes from Ada 2005_
4616
4617 19.i/3
4618 {AI05-0100-1AI05-0100-1} Correction: Clarified where pragmas
4619 are (and are not) allowed.
4620
4621 _Syntax_
4622
4623 20
4624 The forms of List, Page, and Optimize pragmas are as follows:
4625
4626 21
4627 pragma List(identifier);
4628
4629 22
4630 pragma Page;
4631
4632 23
4633 pragma Optimize(identifier);
4634
4635 24
4636 [Other pragmas are defined throughout this International Standard,
4637 and are summarized in *note Annex L::.]
4638
4639 24.a
4640 Ramification: The language-defined pragmas are supported by
4641 every implementation, although "supporting" some of them (for
4642 example, Inline) requires nothing more than checking the
4643 arguments, since they act only as advice to the
4644 implementation.
4645
4646 _Static Semantics_
4647
4648 25
4649 A pragma List takes one of the identifiers On or Off as the single
4650 argument. This pragma is allowed anywhere a pragma is allowed. It
4651 specifies that listing of the compilation is to be continued or
4652 suspended until a List pragma with the opposite argument is given within
4653 the same compilation. The pragma itself is always listed if the
4654 compiler is producing a listing.
4655
4656 26
4657 A pragma Page is allowed anywhere a pragma is allowed. It specifies
4658 that the program text which follows the pragma should start on a new
4659 page (if the compiler is currently producing a listing).
4660
4661 27
4662 A pragma Optimize takes one of the identifiers Time, Space, or Off as
4663 the single argument. This pragma is allowed anywhere a pragma is
4664 allowed, and it applies until the end of the immediately enclosing
4665 declarative region, or for a pragma at the place of a compilation_unit,
4666 to the end of the compilation. It gives advice to the implementation as
4667 to whether time or space is the primary optimization criterion, or that
4668 optional optimizations should be turned off. [It is implementation
4669 defined how this advice is followed.]
4670
4671 27.a
4672 Implementation defined: Effect of pragma Optimize.
4673
4674 27.b
4675 Discussion: For example, a compiler might use Time vs. Space
4676 to control whether generic instantiations are implemented with
4677 a macro-expansion model, versus a shared-generic-body model.
4678
4679 27.c
4680 We don't define what constitutes an "optimization" -- in fact,
4681 it cannot be formally defined in the context of Ada. One
4682 compiler might call something an optional optimization,
4683 whereas another compiler might consider that same thing to be
4684 a normal part of code generation. Thus, the programmer cannot
4685 rely on this pragma having any particular portable effect on
4686 the generated code. Some compilers might even ignore the
4687 pragma altogether.
4688
4689 _Examples_
4690
4691 28
4692 Examples of pragmas:
4693
4694 29/3
4695 {AI95-00433-01AI95-00433-01} {AI05-0229-1AI05-0229-1} pragma List(Off); -- turn off listing generation
4696 pragma Optimize(Off); -- turn off optional optimizations
4697 pragma Pure(Rational_Numbers); -- set categorization for package
4698 pragma Assert(Exists(File_Name),
4699 Message => "Nonexistent file"); -- assert file exists
4700
4701 _Extensions to Ada 83_
4702
4703 29.a
4704 The Optimize pragma now allows the identifier Off to request
4705 that normal optimization be turned off.
4706
4707 29.b
4708 An Optimize pragma may appear anywhere pragmas are allowed.
4709
4710 _Wording Changes from Ada 83_
4711
4712 29.c
4713 We now describe the pragmas Page, List, and Optimize here, to
4714 act as examples, and to remove the normative material from
4715 *note Annex L::, "*note Annex L:: Language-Defined Pragmas",
4716 so it can be entirely an informative annex.
4717
4718 _Wording Changes from Ada 95_
4719
4720 29.d/2
4721 {AI95-00433-01AI95-00433-01} Updated the example of named
4722 pragma parameters, because the second parameter of pragma
4723 Suppress is obsolescent.
4724
4725 _Wording Changes from Ada 2005_
4726
4727 29.e/3
4728 {AI05-0229-1AI05-0229-1} Updated the example of pragmas,
4729 because both pragmas Inline and Import are obsolescent.
4730
4731 \1f
4732 File: aarm2012.info, Node: 2.9, Prev: 2.8, Up: 2
4733
4734 2.9 Reserved Words
4735 ==================
4736
4737 _Syntax_
4738
4739 1/1
4740 This paragraph was deleted.
4741
4742 2/3
4743 {AI95-00284-02AI95-00284-02} {AI95-00395-01AI95-00395-01}
4744 {AI05-0091-1AI05-0091-1} The following are the reserved words.
4745 Within a program, some or all of the letters of a reserved word may
4746 be in upper case.
4747
4748 2.a
4749 Discussion: Reserved words have special meaning in the syntax.
4750 In addition, certain reserved words are used as attribute
4751 names.
4752
4753 2.b
4754 The syntactic category identifier no longer allows reserved
4755 words. We have added the few reserved words that are legal
4756 explicitly to the syntax for attribute_reference. Allowing
4757 identifier to include reserved words has been a source of
4758 confusion for some users, and differs from the way they are
4759 treated in the C and Pascal language definitions.
4760
4761 abort else new return
4762 abs elsif not reverse
4763 abstract end null
4764 accept entry select
4765 access exception of separate
4766 aliased exit or some
4767 all others subtype
4768 and for out synchronized
4769 array function overriding
4770 at tagged
4771 generic package task
4772 begin goto pragma terminate
4773 body private then
4774 if procedure type
4775 case in protected
4776 constant interface until
4777 is raise use
4778 declare range
4779 delay limited record when
4780 delta loop rem while
4781 digits renames with
4782 do mod requeue
4783 xor
4784
4785 NOTES
4786
4787 3
4788 7 The reserved words appear in lower case boldface in this
4789 International Standard, except when used in the designator of an
4790 attribute (see *note 4.1.4::). Lower case boldface is also used
4791 for a reserved word in a string_literal used as an operator_symbol.
4792 This is merely a convention -- programs may be written in whatever
4793 typeface is desired and available.
4794
4795 _Incompatibilities With Ada 83_
4796
4797 3.a
4798 The following words are not reserved in Ada 83, but are
4799 reserved in Ada 95: abstract, aliased, protected, requeue,
4800 tagged, until.
4801
4802 _Wording Changes from Ada 83_
4803
4804 3.b/3
4805 {AI05-0299-1AI05-0299-1} The subclause entitled "Allowed
4806 Replacements of Characters" has been moved to *note Annex J::,
4807 "*note Annex J:: Obsolescent Features".
4808
4809 _Incompatibilities With Ada 95_
4810
4811 3.c/2
4812 {AI95-00284-02AI95-00284-02} The following words are not
4813 reserved in Ada 95, but are reserved in Ada 2005: interface,
4814 overriding, synchronized. A special allowance is made for
4815 pragma Interface (see *note J.12::). Uses of these words as
4816 identifiers will need to be changed, but we do not expect them
4817 to be common.
4818
4819 _Wording Changes from Ada 95_
4820
4821 3.d/2
4822 {AI95-00395-01AI95-00395-01} The definition of upper case
4823 equivalence has been modified to allow identifiers using all
4824 of the characters of ISO 10646. This change has no effect on
4825 the character sequences that are reserved words, but does make
4826 some unusual sequences of characters illegal.
4827
4828 _Incompatibilities With Ada 2005_
4829
4830 3.e/3
4831 {AI05-0091-1AI05-0091-1} Correction: Removed other_format
4832 characters from reserved words in order to be compatible with
4833 the latest Unicode recommendations. This change can only
4834 affect programs written for original Ada 2005, and there is
4835 little reason to put other_format characters into reserved
4836 words in the first place, so there should be very few such
4837 programs.
4838
4839 3.f/3
4840 {AI05-0176-1AI05-0176-1} The following word is not reserved in
4841 Ada 2005, but is reserved in Ada 2012: some. Uses of this
4842 word as an identifier will need to be changed, but we do not
4843 expect them to be common.
4844
4845 \1f
4846 File: aarm2012.info, Node: 3, Next: 4, Prev: 2, Up: Top
4847
4848 3 Declarations and Types
4849 ************************
4850
4851 1/3
4852 {AI05-0299-1AI05-0299-1} This clause describes the types in the language
4853 and the rules for declaring constants, variables, and named numbers.
4854
4855 * Menu:
4856
4857 * 3.1 :: Declarations
4858 * 3.2 :: Types and Subtypes
4859 * 3.3 :: Objects and Named Numbers
4860 * 3.4 :: Derived Types and Classes
4861 * 3.5 :: Scalar Types
4862 * 3.6 :: Array Types
4863 * 3.7 :: Discriminants
4864 * 3.8 :: Record Types
4865 * 3.9 :: Tagged Types and Type Extensions
4866 * 3.10 :: Access Types
4867 * 3.11 :: Declarative Parts
4868
4869 \1f
4870 File: aarm2012.info, Node: 3.1, Next: 3.2, Up: 3
4871
4872 3.1 Declarations
4873 ================
4874
4875 1
4876 The language defines several kinds of named entities that are declared
4877 by declarations. The entity's name is defined by the declaration,
4878 usually by a defining_identifier (*note 3.1: S0022.), but sometimes by a
4879 defining_character_literal (*note 3.5.1: S0040.) or
4880 defining_operator_symbol (*note 6.1: S0171.).
4881
4882 2
4883 There are several forms of declaration. A basic_declaration is a form
4884 of declaration defined as follows.
4885
4886 _Syntax_
4887
4888 3/3
4889 {AI95-00348-01AI95-00348-01} {AI05-0177-1AI05-0177-1}
4890 basic_declaration ::=
4891 type_declaration | subtype_declaration
4892 | object_declaration | number_declaration
4893 | subprogram_declaration | abstract_subprogram_declaration
4894 | null_procedure_declaration | expression_function_declaration
4895 | package_declaration | renaming_declaration
4896 | exception_declaration | generic_declaration
4897 | generic_instantiation
4898
4899 4
4900 defining_identifier ::= identifier
4901
4902 _Static Semantics_
4903
4904 5
4905 A declaration is a language construct that associates a name with (a
4906 view of) an entity. A declaration may appear explicitly in the program
4907 text (an explicit declaration), or may be supposed to occur at a given
4908 place in the text as a consequence of the semantics of another construct
4909 (an implicit declaration).
4910
4911 5.a
4912 Discussion: An implicit declaration generally declares a
4913 predefined or inherited operation associated with the
4914 definition of a type. This term is used primarily when
4915 allowing explicit declarations to override implicit
4916 declarations, as part of a type declaration.
4917
4918 6/3
4919 {AI95-00318-02AI95-00318-02} {AI05-0255-1AI05-0255-1}
4920 {AI05-0277-1AI05-0277-1} Each of the following is defined to be a
4921 declaration: any basic_declaration (*note 3.1: S0021.); an
4922 enumeration_literal_specification (*note 3.5.1: S0039.); a
4923 discriminant_specification (*note 3.7: S0062.); a component_declaration
4924 (*note 3.8: S0070.); a loop_parameter_specification (*note 5.5: S0158.);
4925 an iterator_specification (*note 5.5.2: S0159.); a
4926 parameter_specification (*note 6.1: S0175.); a subprogram_body (*note
4927 6.3: S0177.); an extended_return_object_declaration (*note 6.5: S0185.);
4928 an entry_declaration (*note 9.5.2: S0218.); an entry_index_specification
4929 (*note 9.5.2: S0224.); a choice_parameter_specification (*note 11.2:
4930 S0267.); a generic_formal_parameter_declaration (*note 12.1: S0274.).
4931
4932 6.a
4933 Discussion: This list (when basic_declaration is expanded out)
4934 contains all syntactic categories that end in "_declaration"
4935 or "_specification", except for program unit _specifications.
4936 Moreover, it contains subprogram_body. A subprogram_body is a
4937 declaration, whether or not it completes a previous
4938 declaration. This is a bit strange, subprogram_body is not
4939 part of the syntax of basic_declaration or
4940 library_unit_declaration. A renaming-as-body is considered a
4941 declaration. An accept_statement is not considered a
4942 declaration. Completions are sometimes declarations, and
4943 sometimes not.
4944
4945 7
4946 All declarations contain a definition for a view of an entity. A view
4947 consists of an identification of the entity (the entity of the view),
4948 plus view-specific characteristics that affect the use of the entity
4949 through that view (such as mode of access to an object, formal parameter
4950 names and defaults for a subprogram, or visibility to components of a
4951 type). In most cases, a declaration also contains the definition for
4952 the entity itself (a renaming_declaration is an example of a declaration
4953 that does not define a new entity, but instead defines a view of an
4954 existing entity (see *note 8.5::)).
4955
4956 7.a/2
4957 Glossary entry: A view of an entity reveals some or all of the
4958 properties of the entity. A single entity may have multiple
4959 views.
4960
4961 7.b
4962 Discussion: Most declarations define a view (of some entity)
4963 whose view-specific characteristics are unchanging for the
4964 life of the view. However, subtypes are somewhat unusual in
4965 that they inherit characteristics from whatever view of their
4966 type is currently visible. Hence, a subtype is not a view of
4967 a type; it is more of an indirect reference. By contrast, a
4968 private type provides a single, unchanging (partial) view of
4969 its full type.
4970
4971 7.1/3
4972 {AI05-0080-1AI05-0080-1} When it is clear from context, the term object
4973 is used in place of view of an object. Similarly, the terms type and
4974 subtype are used in place of view of a type and view of a subtype,
4975 respectively.
4976
4977 7.c/3
4978 Discussion: Rules interpreted at compile time generally refer
4979 to views of entities, rather than the entities themselves.
4980 This is necessary to preserve privacy; characteristics that
4981 are not visible should not be used in compile-time rules.
4982 Thus, Static Semantics and Legality Rules generally implicitly
4983 have "view of". Legality Rules that need to look into the
4984 private part are the exception to this interpretation.
4985
4986 7.d/3
4987 On the other hand, run-time rules can work either way, so
4988 "view of" should not be assumed in Dynamic Semantics rules.
4989
4990 8
4991 For each declaration, the language rules define a certain region of text
4992 called the scope of the declaration (see *note 8.2::). Most
4993 declarations associate an identifier with a declared entity. Within its
4994 scope, and only there, there are places where it is possible to use the
4995 identifier to refer to the declaration, the view it defines, and the
4996 associated entity; these places are defined by the visibility rules (see
4997 *note 8.3::). At such places the identifier is said to be a name of the
4998 entity (the direct_name or selector_name); the name is said to denote
4999 the declaration, the view, and the associated entity (see *note 8.6::).
5000 The declaration is said to declare the name, the view, and in most
5001 cases, the entity itself.
5002
5003 9
5004 As an alternative to an identifier, an enumeration literal can be
5005 declared with a character_literal as its name (see *note 3.5.1::), and a
5006 function can be declared with an operator_symbol as its name (see *note
5007 6.1::).
5008
5009 10
5010 The syntax rules use the terms defining_identifier,
5011 defining_character_literal (*note 3.5.1: S0040.), and
5012 defining_operator_symbol (*note 6.1: S0171.) for the defining occurrence
5013 of a name; these are collectively called defining names. The terms
5014 direct_name and selector_name are used for usage occurrences of
5015 identifiers, character_literals, and operator_symbols. These are
5016 collectively called usage names.
5017
5018 10.a
5019 To be honest: The terms identifier, character_literal, and
5020 operator_symbol are used directly in contexts where the normal
5021 visibility rules do not apply (such as the identifier that
5022 appears after the end of a task_body). Analogous conventions
5023 apply to the use of designator, which is the collective term
5024 for identifier and operator_symbol.
5025
5026 _Dynamic Semantics_
5027
5028 11
5029 The process by which a construct achieves its run-time effect is called
5030 execution. This process is also called elaboration for declarations and
5031 evaluation for expressions. One of the terms execution, elaboration, or
5032 evaluation is defined by this International Standard for each construct
5033 that has a run-time effect.
5034
5035 11.a
5036 Glossary entry: The process by which a construct achieves its
5037 run-time effect is called execution. Execution of a
5038 declaration is also called elaboration. Execution of an
5039 expression is also called evaluation.
5040
5041 11.b
5042 To be honest: The term elaboration is also used for the
5043 execution of certain constructs that are not declarations, and
5044 the term evaluation is used for the execution of certain
5045 constructs that are not expressions. For example,
5046 subtype_indications are elaborated, and ranges are evaluated.
5047
5048 11.c
5049 For bodies, execution and elaboration are both explicitly
5050 defined. When we refer specifically to the execution of a
5051 body, we mean the explicit definition of execution for that
5052 kind of body, not its elaboration.
5053
5054 11.d
5055 Discussion: Technically, "the execution of a declaration" and
5056 "the elaboration of a declaration" are synonymous. We use the
5057 term "elaboration" of a construct when we know the construct
5058 is elaborable. When we are talking about more arbitrary
5059 constructs, we use the term "execution". For example, we use
5060 the term "erroneous execution", to refer to any erroneous
5061 execution, including erroneous elaboration or evaluation.
5062
5063 11.e
5064 When we explicitly define evaluation or elaboration for a
5065 construct, we are implicitly defining execution of that
5066 construct.
5067
5068 11.f
5069 We also use the term "execution" for things like statements,
5070 which are executable, but neither elaborable nor evaluable.
5071 We considered using the term "execution" only for
5072 nonelaborable, nonevaluable constructs, and defining the term
5073 "action" to mean what we have defined "execution" to mean. We
5074 rejected this idea because we thought three terms that mean
5075 the same thing was enough -- four would be overkill. Thus,
5076 the term "action" is used only informally in the standard
5077 (except where it is defined as part of a larger term, such as
5078 "protected action").
5079
5080 11.f.1/2
5081 Glossary entry: The process by which a declaration achieves
5082 its run-time effect is called elaboration. Elaboration is one
5083 of the forms of execution.
5084
5085 11.f.2/2
5086 Glossary entry: The process by which an expression achieves
5087 its run-time effect is called evaluation. Evaluation is one
5088 of the forms of execution.
5089
5090 11.g
5091 To be honest: A construct is elaborable if elaboration is
5092 defined for it. A construct is evaluable if evaluation is
5093 defined for it. A construct is executable if execution is
5094 defined for it.
5095
5096 11.h
5097 Discussion: Don't confuse "elaborable" with "preelaborable"
5098 (defined in *note 10.2.1::).
5099
5100 11.i/2
5101 {AI95-00114-01AI95-00114-01} Evaluation of an evaluable
5102 construct produces a result that is either a value, a
5103 denotation, or a range. The following are evaluable:
5104 expression; name prefix; range; entry_index_specification; and
5105 possibly discrete_range. The last one is curious -- RM83 uses
5106 the term "evaluation of a discrete_range," but never defines
5107 it. One might presume that the evaluation of a discrete_range
5108 consists of the evaluation of the range or the
5109 subtype_indication, depending on what it is. But
5110 subtype_indications are not evaluated; they are elaborated.
5111
5112 11.j
5113 Intuitively, an executable construct is one that has a defined
5114 run-time effect (which may be null). Since execution includes
5115 elaboration and evaluation as special cases, all elaborable
5116 and all evaluable constructs are also executable. Hence, most
5117 constructs in Ada are executable. An important exception is
5118 that the constructs inside a generic unit are not executable
5119 directly, but rather are used as a template for (generally)
5120 executable constructs in instances of the generic.
5121
5122 NOTES
5123
5124 12
5125 1 At compile time, the declaration of an entity declares the
5126 entity. At run time, the elaboration of the declaration creates
5127 the entity.
5128
5129 12.a
5130 Ramification: Syntactic categories for declarations are named
5131 either entity_declaration (if they include a trailing
5132 semicolon) or entity_specification (if not).
5133
5134 12.b
5135 The various kinds of named entities that can be declared are
5136 as follows: an object (including components and parameters), a
5137 named number, a type (the name always refers to its first
5138 subtype), a subtype, a subprogram (including enumeration
5139 literals and operators), a single entry, an entry family, a
5140 package, a protected or task unit (which corresponds to either
5141 a type or a single object), an exception, a generic unit, a
5142 label, and the name of a statement.
5143
5144 12.c
5145 Identifiers are also associated with names of pragmas,
5146 arguments to pragmas, and with attributes, but these are not
5147 user-definable.
5148
5149 _Wording Changes from Ada 83_
5150
5151 12.d
5152 The syntax rule for defining_identifier is new. It is used
5153 for the defining occurrence of an identifier. Usage
5154 occurrences use the direct_name or selector_name syntactic
5155 categories. Each occurrence of an identifier (or
5156 simple_name), character_literal, or operator_symbol in the Ada
5157 83 syntax rules is handled as follows in Ada 95:
5158
5159 12.e
5160 * It becomes a defining_identifier,
5161 defining_character_literal, or defining_operator_symbol
5162 (or some syntactic category composed of these), to
5163 indicate a defining occurrence;
5164
5165 12.f/3
5166 * {AI05-0299-1AI05-0299-1} It becomes a direct_name, in
5167 usage occurrences where the usage is required (in Clause
5168 *note 8::) to be directly visible;
5169
5170 12.g/3
5171 * {AI05-0299-1AI05-0299-1} It becomes a selector_name, in
5172 usage occurrences where the usage is required (in Clause
5173 *note 8::) to be visible but not necessarily directly
5174 visible;
5175
5176 12.h
5177 * It remains an identifier, character_literal, or
5178 operator_symbol, in cases where the visibility rules do
5179 not apply (such as the designator that appears after the
5180 end of a subprogram_body).
5181
5182 12.i
5183 For declarations that come in "two parts" (program unit
5184 declaration plus body, private or incomplete type plus full
5185 type, deferred constant plus full constant), we consider both
5186 to be defining occurrences. Thus, for example, the syntax for
5187 package_body uses defining_identifier after the reserved word
5188 body, as opposed to direct_name.
5189
5190 12.j
5191 The defining occurrence of a statement name is in its implicit
5192 declaration, not where it appears in the program text.
5193 Considering the statement name itself to be the defining
5194 occurrence would complicate the visibility rules.
5195
5196 12.k
5197 The phrase "visible by selection" is not used in Ada 95. It
5198 is subsumed by simply "visible" and the Name Resolution Rules
5199 for selector_names.
5200
5201 12.l/3
5202 {AI05-0299-1AI05-0299-1} (Note that in Ada 95, a declaration
5203 is visible at all places where one could have used a
5204 selector_name, not just at places where a selector_name was
5205 actually used. Thus, the places where a declaration is
5206 directly visible are a subset of the places where it is
5207 visible. See Clause *note 8:: for details.)
5208
5209 12.m
5210 We use the term "declaration" to cover _specifications that
5211 declare (views of) objects, such as parameter_specifications.
5212 In Ada 83, these are referred to as a "form of declaration,"
5213 but it is not entirely clear that they are considered simply
5214 "declarations."
5215
5216 12.n/3
5217 {AI05-0299-1AI05-0299-1} RM83 contains an incomplete
5218 definition of "elaborated" in this subclause: it defines
5219 "elaborated" for declarations, declarative_parts,
5220 declarative_items and compilation_units, but "elaboration" is
5221 defined elsewhere for various other constructs. To make
5222 matters worse, Ada 95 has a different set of elaborable
5223 constructs. Instead of correcting the list, it is more
5224 maintainable to refer to the term "elaborable," which is
5225 defined in a distributed manner.
5226
5227 12.o
5228 RM83 uses the term "has no other effect" to describe an
5229 elaboration that doesn't do anything except change the state
5230 from not-yet-elaborated to elaborated. This was a confusing
5231 wording, because the answer to "other than what?" was to be
5232 found many pages away. In Ada 95, we change this wording to
5233 "has no effect" (for things that truly do nothing at run
5234 time), and "has no effect other than to establish that
5235 so-and-so can happen without failing the Elaboration_Check"
5236 (for things where it matters).
5237
5238 12.p
5239 We make it clearer that the term "execution" covers
5240 elaboration and evaluation as special cases. This was implied
5241 in RM83. For example, "erroneous execution" can include any
5242 execution, and RM83-9.4(3) has, "The task designated by any
5243 other task object depends on the master whose execution
5244 creates the task object;" the elaboration of the master's
5245 declarative_part is doing the task creation.
5246
5247 _Wording Changes from Ada 95_
5248
5249 12.q/2
5250 {AI95-00318-02AI95-00318-02} Added extended_return_statement
5251 to the list of declarations.
5252
5253 12.r/2
5254 {AI95-00348-01AI95-00348-01} Added null procedures (see *note
5255 6.7::) to the syntax.
5256
5257 _Wording Changes from Ada 2005_
5258
5259 12.s/3
5260 {AI05-0177-1AI05-0177-1} Added expression functions (see *note
5261 6.8::) to the syntax.
5262
5263 \1f
5264 File: aarm2012.info, Node: 3.2, Next: 3.3, Prev: 3.1, Up: 3
5265
5266 3.2 Types and Subtypes
5267 ======================
5268
5269 _Static Semantics_
5270
5271 1
5272 A type is characterized by a set of values, and a set of primitive
5273 operations which implement the fundamental aspects of its semantics. An
5274 object of a given type is a run-time entity that contains (has) a value
5275 of the type.
5276
5277 1.a/2
5278 Glossary entry: Each object has a type. A type has an
5279 associated set of values, and a set of primitive operations
5280 which implement the fundamental aspects of its semantics.
5281 Types are grouped into categories. Most language-defined
5282 categories of types are also classes of types.
5283
5284 1.b/3
5285 Glossary entry: A subtype is a type together with optional
5286 constraints, null exclusions, and predicates, which constrain
5287 the values of the subtype to satisfy certain conditions. The
5288 values of a subtype are a subset of the values of its type.
5289
5290 2/2
5291 {AI95-00442-01AI95-00442-01} Types are grouped into categories of types.
5292 There exist several language-defined categories of types (see NOTES
5293 below), reflecting the similarity of their values and primitive
5294 operations. [Most categories of types form classes of types.]
5295 Elementary types are those whose values are logically indivisible;
5296 composite types are those whose values are composed of component values.
5297
5298 2.a/2
5299 Proof: {AI95-00442-01AI95-00442-01} The formal definition of
5300 category and class is found in *note 3.4::.
5301
5302 2.b/2
5303 Glossary entry: A class is a set of types that is closed under
5304 derivation, which means that if a given type is in the class,
5305 then all types derived from that type are also in the class.
5306 The set of types of a class share common properties, such as
5307 their primitive operations.
5308
5309 2.b.1/2
5310 Glossary entry: A category of types is a set of types with one
5311 or more common properties, such as primitive operations. A
5312 category of types that is closed under derivation is also
5313 known as a class.
5314
5315 2.c
5316 Glossary entry: An elementary type does not have components.
5317
5318 2.d/2
5319 Glossary entry: A composite type may have components.
5320
5321 2.e
5322 Glossary entry: A scalar type is either a discrete type or a
5323 real type.
5324
5325 2.f
5326 Glossary entry: An access type has values that designate
5327 aliased objects. Access types correspond to "pointer types"
5328 or "reference types" in some other languages.
5329
5330 2.g
5331 Glossary entry: A discrete type is either an integer type or
5332 an enumeration type. Discrete types may be used, for example,
5333 in case_statements and as array indices.
5334
5335 2.h
5336 Glossary entry: A real type has values that are approximations
5337 of the real numbers. Floating point and fixed point types are
5338 real types.
5339
5340 2.i
5341 Glossary entry: Integer types comprise the signed integer
5342 types and the modular types. A signed integer type has a base
5343 range that includes both positive and negative numbers, and
5344 has operations that may raise an exception when the result is
5345 outside the base range. A modular type has a base range whose
5346 lower bound is zero, and has operations with "wraparound"
5347 semantics. Modular types subsume what are called "unsigned
5348 types" in some other languages.
5349
5350 2.j
5351 Glossary entry: An enumeration type is defined by an
5352 enumeration of its values, which may be named by identifiers
5353 or character literals.
5354
5355 2.k
5356 Glossary entry: A character type is an enumeration type whose
5357 values include characters.
5358
5359 2.l
5360 Glossary entry: A record type is a composite type consisting
5361 of zero or more named components, possibly of different types.
5362
5363 2.m
5364 Glossary entry: A record extension is a type that extends
5365 another type by adding additional components.
5366
5367 2.n
5368 Glossary entry: An array type is a composite type whose
5369 components are all of the same type. Components are selected
5370 by indexing.
5371
5372 2.o/2
5373 Glossary entry: A task type is a composite type used to
5374 represent active entities which execute concurrently and which
5375 can communicate via queued task entries. The top-level task
5376 of a partition is called the environment task.
5377
5378 2.p/2
5379 Glossary entry: A protected type is a composite type whose
5380 components are accessible only through one of its protected
5381 operations which synchronize concurrent access by multiple
5382 tasks.
5383
5384 2.q/2
5385 Glossary entry: A private type gives a view of a type that
5386 reveals only some of its properties. The remaining properties
5387 are provided by the full view given elsewhere. Private types
5388 can be used for defining abstractions that hide unnecessary
5389 details from their clients.
5390
5391 2.r/2
5392 Glossary entry: A private extension is a type that extends
5393 another type, with the additional properties hidden from its
5394 clients.
5395
5396 2.s/2
5397 Glossary entry: An incomplete type gives a view of a type that
5398 reveals only some of its properties. The remaining properties
5399 are provided by the full view given elsewhere. Incomplete
5400 types can be used for defining recursive data structures.
5401
5402 3
5403 The elementary types are the scalar types (discrete and real) and the
5404 access types (whose values provide access to objects or subprograms).
5405 Discrete types are either integer types or are defined by enumeration of
5406 their values (enumeration types). Real types are either floating point
5407 types or fixed point types.
5408
5409 4/2
5410 {AI95-00251-01AI95-00251-01} {AI95-00326-01AI95-00326-01} The composite
5411 types are the record types, record extensions, array types, interface
5412 types, task types, and protected types.
5413
5414 4.a/2
5415 This paragraph was deleted.{AI95-00442-01AI95-00442-01}
5416
5417 4.1/2
5418 {AI95-00326-01AI95-00326-01} There can be multiple views of a type with
5419 varying sets of operations. [An incomplete type represents an
5420 incomplete view (see *note 3.10.1::) of a type with a very restricted
5421 usage, providing support for recursive data structures. A private type
5422 or private extension represents a partial view (see *note 7.3::) of a
5423 type, providing support for data abstraction. The full view (see *note
5424 3.2.1::) of a type represents its complete definition.] An incomplete
5425 or partial view is considered a composite type[, even if the full view
5426 is not].
5427
5428 4.b/3
5429 Proof: {AI05-0299-1AI05-0299-1} The real definitions of the
5430 views are in the referenced subclauses.
5431
5432 5/2
5433 {AI95-00326-01AI95-00326-01} Certain composite types (and views thereof)
5434 have special components called discriminants whose values affect the
5435 presence, constraints, or initialization of other components.
5436 Discriminants can be thought of as parameters of the type.
5437
5438 6/2
5439 {AI95-00366-01AI95-00366-01} The term subcomponent is used in this
5440 International Standard in place of the term component to indicate either
5441 a component, or a component of another subcomponent. Where other
5442 subcomponents are excluded, the term component is used instead.
5443 Similarly, a part of an object or value is used to mean the whole object
5444 or value, or any set of its subcomponents. The terms component,
5445 subcomponent, and part are also applied to a type meaning the component,
5446 subcomponent, or part of objects and values of the type.
5447
5448 6.a
5449 Discussion: The definition of "part" here is designed to
5450 simplify rules elsewhere. By design, the intuitive meaning of
5451 "part" will convey the correct result to the casual reader,
5452 while this formalistic definition will answer the concern of
5453 the compiler-writer.
5454
5455 6.b
5456 We use the term "part" when talking about the parent part,
5457 ancestor part, or extension part of a type extension. In
5458 contexts such as these, the part might represent an empty set
5459 of subcomponents (e.g. in a null record extension, or a
5460 nonnull extension of a null record). We also use "part" when
5461 specifying rules such as those that apply to an object with a
5462 "controlled part" meaning that it applies if the object as a
5463 whole is controlled, or any subcomponent is.
5464
5465 7/2
5466 {AI95-00231-01AI95-00231-01} The set of possible values for an object of
5467 a given type can be subjected to a condition that is called a constraint
5468 (the case of a null constraint that specifies no restriction is also
5469 included)[; the rules for which values satisfy a given kind of
5470 constraint are given in *note 3.5:: for range_constraints, *note 3.6.1::
5471 for index_constraints, and *note 3.7.1:: for discriminant_constraints].
5472 The set of possible values for an object of an access type can also be
5473 subjected to a condition that excludes the null value (see *note
5474 3.10::).
5475
5476 8/2
5477 {AI95-00231-01AI95-00231-01} {AI95-00415-01AI95-00415-01} A subtype of a
5478 given type is a combination of the type, a constraint on values of the
5479 type, and certain attributes specific to the subtype. The given type is
5480 called the type of the subtype. Similarly, the associated constraint is
5481 called the constraint of the subtype. The set of values of a subtype
5482 consists of the values of its type that satisfy its constraint and any
5483 exclusion of the null value. Such values belong to the subtype.
5484
5485 8.a
5486 Discussion: We make a strong distinction between a type and
5487 its subtypes. In particular, a type is not a subtype of
5488 itself. There is no constraint associated with a type (not
5489 even a null one), and type-related attributes are distinct
5490 from subtype-specific attributes.
5491
5492 8.b
5493 Discussion: We no longer use the term "base type." All types
5494 were "base types" anyway in Ada 83, so the term was redundant,
5495 and occasionally confusing. In the RM95 we say simply "the
5496 type of the subtype" instead of "the base type of the
5497 subtype."
5498
5499 8.c
5500 Ramification: The value subset for a subtype might be empty,
5501 and need not be a proper subset.
5502
5503 8.d/2
5504 To be honest: {AI95-00442-01AI95-00442-01} Any name of a
5505 category of types (such as "discrete", "real", or "limited")
5506 is also used to qualify its subtypes, as well as its objects,
5507 values, declarations, and definitions, such as an "integer
5508 type declaration" or an "integer value." In addition, if a
5509 term such as "parent subtype" or "index subtype" is defined,
5510 then the corresponding term for the type of the subtype is
5511 "parent type" or "index type."
5512
5513 8.e
5514 Discussion: We use these corresponding terms without
5515 explicitly defining them, when the meaning is obvious.
5516
5517 9
5518 A subtype is called an unconstrained subtype if its type has unknown
5519 discriminants, or if its type allows range, index, or discriminant
5520 constraints, but the subtype does not impose such a constraint;
5521 otherwise, the subtype is called a constrained subtype (since it has no
5522 unconstrained characteristics).
5523
5524 9.a
5525 Discussion: In an earlier version of Ada 9X, "constrained"
5526 meant "has a nonnull constraint." However, we changed to this
5527 definition since we kept having to special case composite
5528 non-array/nondiscriminated types. It also corresponds better
5529 to the (now obsolescent) attribute 'Constrained.
5530
5531 9.b
5532 For scalar types, "constrained" means "has a nonnull
5533 constraint". For composite types, in implementation terms,
5534 "constrained" means that the size of all objects of the
5535 subtype is the same, assuming a typical implementation model.
5536
5537 9.c
5538 Class-wide subtypes are always unconstrained.
5539
5540 NOTES
5541
5542 10/2
5543 2 {AI95-00442-01AI95-00442-01} Any set of types can be called a
5544 "category" of types, and any set of types that is closed under
5545 derivation (see *note 3.4::) can be called a "class" of types.
5546 However, only certain categories and classes are used in the
5547 description of the rules of the language -- generally those that
5548 have their own particular set of primitive operations (see *note
5549 3.2.3::), or that correspond to a set of types that are matched by
5550 a given kind of generic formal type (see *note 12.5::). The
5551 following are examples of "interesting" language-defined classes:
5552 elementary, scalar, discrete, enumeration, character, boolean,
5553 integer, signed integer, modular, real, floating point, fixed
5554 point, ordinary fixed point, decimal fixed point, numeric, access,
5555 access-to-object, access-to-subprogram, composite, array, string,
5556 (untagged) record, tagged, task, protected, nonlimited. Special
5557 syntax is provided to define types in each of these classes. In
5558 addition to these classes, the following are examples of
5559 "interesting" language-defined categories: abstract, incomplete,
5560 interface, limited, private, record.
5561
5562 10.a
5563 Discussion: A value is a run-time entity with a given type
5564 which can be assigned to an object of an appropriate subtype
5565 of the type. An operation is a program entity that operates
5566 on zero or more operands to produce an effect, or yield a
5567 result, or both.
5568
5569 10.b/2
5570 Ramification: {AI95-00442-01AI95-00442-01} Note that a type's
5571 category (and class) depends on the place of the reference --
5572 a private type is composite outside and possibly elementary
5573 inside. It's really the view that is elementary or composite.
5574 Note that although private types are composite, there are some
5575 properties that depend on the corresponding full view -- for
5576 example, parameter passing modes, and the constraint checks
5577 that apply in various places.
5578
5579 10.c/2
5580 {AI95-00345-01AI95-00345-01} {AI95-00442-01AI95-00442-01}
5581 Every property of types forms a category, but not every
5582 property of types represents a class. For example, the set of
5583 all abstract types does not form a class, because this set is
5584 not closed under derivation. Similarly, the set of all
5585 interface types does not form a class.
5586
5587 10.d/2
5588 {AI95-00442-01AI95-00442-01} The set of limited types does not
5589 form a class (since nonlimited types can inherit from limited
5590 interfaces), but the set of nonlimited types does. The set of
5591 tagged record types and the set of tagged private types do not
5592 form a class (because each of them can be extended to create a
5593 type of the other category); that implies that the set of
5594 record types and the set of private types also do not form a
5595 class (even though untagged record types and untagged private
5596 types do form a class). In all of these cases, we can talk
5597 about the category of the type; for instance, we can talk
5598 about the "category of limited types"..
5599
5600 10.e/2
5601 {AI95-00442-01AI95-00442-01} Normatively, the language-defined
5602 classes are those that are defined to be inherited on
5603 derivation by *note 3.4::; other properties either aren't
5604 interesting or form categories, not classes.
5605
5606 11/2
5607 {AI95-00442-01AI95-00442-01} These language-defined categories are
5608 organized like this:
5609
5610 12/2
5611 {AI95-00345-01AI95-00345-01} all types
5612 elementary
5613 scalar
5614 discrete
5615 enumeration
5616 character
5617 boolean
5618 other enumeration
5619 integer
5620 signed integer
5621 modular integer
5622 real
5623 floating point
5624 fixed point
5625 ordinary fixed point
5626 decimal fixed point
5627 access
5628 access-to-object
5629 access-to-subprogram
5630 composite
5631 untagged
5632 array
5633 string
5634 other array
5635 record
5636 task
5637 protected
5638 tagged (including interfaces)
5639 nonlimited tagged record
5640 limited tagged
5641 limited tagged record
5642 synchronized tagged
5643 tagged task
5644 tagged protected
5645
5646 13/2
5647 {AI95-00345-01AI95-00345-01} {AI95-00442-01AI95-00442-01} There are
5648 other categories, such as "numeric" and "discriminated", which
5649 represent other categorization dimensions, but do not fit into the
5650 above strictly hierarchical picture.
5651
5652 13.a.1/2
5653 Discussion: {AI95-00345-01AI95-00345-01}
5654 {AI95-00442-01AI95-00442-01} Note that this is also true for
5655 some categories mentioned in the chart. The category "task"
5656 includes both untagged tasks and tagged tasks. Similarly for
5657 "protected", "limited", and "nonlimited" (note that limited
5658 and nonlimited are not shown for untagged composite types).
5659
5660 _Wording Changes from Ada 83_
5661
5662 13.a/3
5663 {AI05-0299-1AI05-0299-1} This subclause now precedes the
5664 subclauses on objects and named numbers, to cut down on the
5665 number of forward references.
5666
5667 13.b
5668 We have dropped the term "base type" in favor of simply "type"
5669 (all types in Ada 83 were "base types" so it wasn't clear when
5670 it was appropriate/necessary to say "base type"). Given a
5671 subtype S of a type T, we call T the "type of the subtype S."
5672
5673 _Wording Changes from Ada 95_
5674
5675 13.c/2
5676 {AI95-00231-01AI95-00231-01} Added a mention of null
5677 exclusions when we're talking about constraints (these are not
5678 constraints, but they are similar).
5679
5680 13.d/2
5681 {AI95-00251-01AI95-00251-01} Defined an interface type to be a
5682 composite type.
5683
5684 13.e/2
5685 {AI95-00326-01AI95-00326-01} Revised the wording so that it is
5686 clear that an incomplete view is similar to a partial view in
5687 terms of the language.
5688
5689 13.f/2
5690 {AI95-00366-01AI95-00366-01} Added a definition of component
5691 of a type, subcomponent of a type, and part of a type. These
5692 are commonly used in the standard, but they were not
5693 previously defined.
5694
5695 13.g/3
5696 {AI95-00442-01AI95-00442-01} {AI05-0299-1AI05-0299-1} Reworded
5697 most of this subclause to use category rather than class,
5698 since so many interesting properties are not, strictly
5699 speaking, classes. Moreover, there was no normative
5700 description of exactly which properties formed classes, and
5701 which did not. The real definition of class, along with a
5702 list of properties, is now in *note 3.4::.
5703
5704 * Menu:
5705
5706 * 3.2.1 :: Type Declarations
5707 * 3.2.2 :: Subtype Declarations
5708 * 3.2.3 :: Classification of Operations
5709 * 3.2.4 :: Subtype Predicates
5710
5711 \1f
5712 File: aarm2012.info, Node: 3.2.1, Next: 3.2.2, Up: 3.2
5713
5714 3.2.1 Type Declarations
5715 -----------------------
5716
5717 1
5718 A type_declaration declares a type and its first subtype.
5719
5720 _Syntax_
5721
5722 2
5723 type_declaration ::= full_type_declaration
5724 | incomplete_type_declaration
5725 | private_type_declaration
5726 | private_extension_declaration
5727
5728 3/3
5729 {AI05-0183-1AI05-0183-1} full_type_declaration ::=
5730 type defining_identifier [known_discriminant_part] is
5731 type_definition
5732 [aspect_specification];
5733 | task_type_declaration
5734 | protected_type_declaration
5735
5736 4/2
5737 {AI95-00251-01AI95-00251-01} type_definition ::=
5738 enumeration_type_definition | integer_type_definition
5739 | real_type_definition | array_type_definition
5740 | record_type_definition | access_type_definition
5741 | derived_type_definition | interface_type_definition
5742
5743 _Legality Rules_
5744
5745 5
5746 A given type shall not have a subcomponent whose type is the given type
5747 itself.
5748
5749 _Static Semantics_
5750
5751 6
5752 The defining_identifier (*note 3.1: S0022.) of a type_declaration (*note
5753 3.2.1: S0023.) denotes the first subtype of the type. The
5754 known_discriminant_part (*note 3.7: S0061.), if any, defines the
5755 discriminants of the type (see *note 3.7::, "*note 3.7::
5756 Discriminants"). The remainder of the type_declaration (*note 3.2.1:
5757 S0023.) defines the remaining characteristics of (the view of) the type.
5758
5759 7/2
5760 {AI95-00230-01AI95-00230-01} A type defined by a type_declaration (*note
5761 3.2.1: S0023.) is a named type; such a type has one or more nameable
5762 subtypes. Certain other forms of declaration also include type
5763 definitions as part of the declaration for an object. The type defined
5764 by such a declaration is anonymous -- it has no nameable subtypes. For
5765 explanatory purposes, this International Standard sometimes refers to an
5766 anonymous type by a pseudo-name, written in italics, and uses such
5767 pseudo-names at places where the syntax normally requires an identifier.
5768 For a named type whose first subtype is T, this International Standard
5769 sometimes refers to the type of T as simply "the type T".
5770
5771 7.a/2
5772 Ramification: {AI95-00230-01AI95-00230-01} The only
5773 user-defined types that can be anonymous in the above sense
5774 are array, access, task, and protected types. An anonymous
5775 array, task, or protected type can be defined as part of an
5776 object_declaration. An anonymous access type can be defined
5777 as part of numerous other constructs.
5778
5779 8/2
5780 {AI95-00230-01AI95-00230-01} {AI95-00326-01AI95-00326-01} A named type
5781 that is declared by a full_type_declaration (*note 3.2.1: S0024.), or an
5782 anonymous type that is defined by an access_definition or as part of
5783 declaring an object of the type, is called a full type. The declaration
5784 of a full type also declares the full view of the type. The
5785 type_definition (*note 3.2.1: S0025.), task_definition (*note 9.1:
5786 S0207.), protected_definition (*note 9.4: S0212.), or access_definition
5787 (*note 3.10: S0084.) that defines a full type is called a full type
5788 definition. [Types declared by other forms of type_declaration (*note
5789 3.2.1: S0023.) are not separate types; they are partial or incomplete
5790 views of some full type.]
5791
5792 8.a
5793 To be honest: Class-wide, universal, and root numeric types
5794 are full types.
5795
5796 8.b/2
5797 Reason: {AI95-00230-01AI95-00230-01} We need to mention
5798 access_definition separately, as it may occur in renames,
5799 which do not declare objects.
5800
5801 9
5802 The definition of a type implicitly declares certain predefined
5803 operators that operate on the type, according to what classes the type
5804 belongs, as specified in *note 4.5::, "*note 4.5:: Operators and
5805 Expression Evaluation".
5806
5807 9.a
5808 Discussion: We no longer talk about the implicit declaration
5809 of basic operations. These are treated like an if_statement
5810 -- they don't need to be declared, but are still applicable to
5811 only certain classes of types.
5812
5813 10
5814 The predefined types [(for example the types Boolean, Wide_Character,
5815 Integer, root_integer, and universal_integer)] are the types that are
5816 defined in [a predefined library package called] Standard[; this package
5817 also includes the [(implicit)] declarations of their predefined
5818 operators]. [The package Standard is described in *note A.1::.]
5819
5820 10.a
5821 Ramification: We use the term "predefined" to refer to
5822 entities declared in the visible part of Standard, to
5823 implicitly declared operators of a type whose semantics are
5824 defined by the language, to Standard itself, and to the
5825 "predefined environment". We do not use this term to refer to
5826 library packages other than Standard. For example Text_IO is
5827 a language-defined package, not a predefined package, and
5828 Text_IO.Put_Line is not a predefined operation.
5829
5830 _Dynamic Semantics_
5831
5832 11
5833 The elaboration of a full_type_declaration consists of the elaboration
5834 of the full type definition. Each elaboration of a full type definition
5835 creates a distinct type and its first subtype.
5836
5837 11.a
5838 Reason: The creation is associated with the type definition,
5839 rather than the type declaration, because there are types that
5840 are created by full type definitions that are not immediately
5841 contained within a type declaration (e.g. an array object
5842 declaration, a singleton task declaration, etc.).
5843
5844 11.b
5845 Ramification: Any implicit declarations that occur immediately
5846 following the full type definition are elaborated where they
5847 (implicitly) occur.
5848
5849 _Examples_
5850
5851 12
5852 Examples of type definitions:
5853
5854 13
5855 (White, Red, Yellow, Green, Blue, Brown, Black)
5856 range 1 .. 72
5857 array(1 .. 10) of Integer
5858
5859 14
5860 Examples of type declarations:
5861
5862 15
5863 type Color is (White, Red, Yellow, Green, Blue, Brown, Black);
5864 type Column is range 1 .. 72;
5865 type Table is array(1 .. 10) of Integer;
5866
5867 NOTES
5868
5869 16
5870 3 Each of the above examples declares a named type. The
5871 identifier given denotes the first subtype of the type. Other
5872 named subtypes of the type can be declared with
5873 subtype_declarations (see *note 3.2.2::). Although names do not
5874 directly denote types, a phrase like "the type Column" is sometimes
5875 used in this International Standard to refer to the type of Column,
5876 where Column denotes the first subtype of the type. For an example
5877 of the definition of an anonymous type, see the declaration of the
5878 array Color_Table in *note 3.3.1::; its type is anonymous -- it has
5879 no nameable subtypes.
5880
5881 _Wording Changes from Ada 83_
5882
5883 16.a
5884 The syntactic category full_type_declaration now includes task
5885 and protected type declarations.
5886
5887 16.b/3
5888 {AI05-0299-1AI05-0299-1} We have generalized the concept of
5889 first-named subtype (now called simply "first subtype") to
5890 cover all kinds of types, for uniformity of description
5891 elsewhere. RM83 defined first-named subtype in Section 13.
5892 We define first subtype here, because it is now a more
5893 fundamental concept. We renamed the term, because in Ada 95
5894 some first subtypes have no name.
5895
5896 16.c/2
5897 {AI95-00230-01AI95-00230-01} We no longer elaborate
5898 discriminant_parts, because there is nothing to do, and it was
5899 complex to say that you only wanted to elaborate it once for a
5900 private or incomplete type. This is also consistent with the
5901 fact that subprogram specifications are not elaborated
5902 (neither in Ada 83 nor in Ada 95). Note, however, that an
5903 access_definition appearing in a discriminant_part is
5904 elaborated at the full_type_declaration (for a nonlimited
5905 type) or when an object with such a discriminant is created
5906 (for a limited type).
5907
5908 _Wording Changes from Ada 95_
5909
5910 16.d/2
5911 {AI95-00230-01AI95-00230-01} Added wording so that anonymous
5912 access types are always full types, even if they appear in
5913 renames.
5914
5915 16.e/2
5916 {AI95-00251-01AI95-00251-01} Added interface types (see *note
5917 3.9.4::) to the syntax.
5918
5919 16.f/2
5920 {AI95-00326-01AI95-00326-01} Added a definition of full view,
5921 so that all types have a well-defined full view.
5922
5923 _Extensions to Ada 2005_
5924
5925 16.g/3
5926 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
5927 be used in a full_type_declaration. This is described in
5928 *note 13.1.1::.
5929
5930 \1f
5931 File: aarm2012.info, Node: 3.2.2, Next: 3.2.3, Prev: 3.2.1, Up: 3.2
5932
5933 3.2.2 Subtype Declarations
5934 --------------------------
5935
5936 1
5937 A subtype_declaration declares a subtype of some previously declared
5938 type, as defined by a subtype_indication.
5939
5940 _Syntax_
5941
5942 2/3
5943 {AI05-0183-1AI05-0183-1} subtype_declaration ::=
5944 subtype defining_identifier is subtype_indication
5945 [aspect_specification];
5946
5947 3/2
5948 {AI95-00231-01AI95-00231-01} subtype_indication ::= [
5949 null_exclusion] subtype_mark [constraint]
5950
5951 4
5952 subtype_mark ::= subtype_name
5953
5954 4.a
5955 Ramification: Note that name includes attribute_reference;
5956 thus, S'Base can be used as a subtype_mark.
5957
5958 4.b
5959 Reason: We considered changing subtype_mark to subtype_name.
5960 However, existing users are used to the word "mark," so we're
5961 keeping it.
5962
5963 5
5964 constraint ::= scalar_constraint | composite_constraint
5965
5966 6
5967 scalar_constraint ::=
5968 range_constraint | digits_constraint | delta_constraint
5969
5970 7
5971 composite_constraint ::=
5972 index_constraint | discriminant_constraint
5973
5974 _Name Resolution Rules_
5975
5976 8
5977 A subtype_mark shall resolve to denote a subtype. The type determined
5978 by a subtype_mark is the type of the subtype denoted by the
5979 subtype_mark.
5980
5981 8.a/3
5982 Ramification: {AI05-0005-1AI05-0005-1} Types are never
5983 directly named; all subtype_marks denote subtypes -- possibly
5984 an unconstrained (base) subtype, but never the type. When we
5985 use the term anonymous type we really mean a type with no
5986 nameable subtypes.
5987
5988 _Dynamic Semantics_
5989
5990 9
5991 The elaboration of a subtype_declaration consists of the elaboration of
5992 the subtype_indication. The elaboration of a subtype_indication creates
5993 a new subtype. If the subtype_indication does not include a constraint,
5994 the new subtype has the same (possibly null) constraint as that denoted
5995 by the subtype_mark. The elaboration of a subtype_indication that
5996 includes a constraint proceeds as follows:
5997
5998 10
5999 * The constraint is first elaborated.
6000
6001 11
6002 * A check is then made that the constraint is compatible with the
6003 subtype denoted by the subtype_mark.
6004
6005 11.a
6006 Ramification: The checks associated with constraint
6007 compatibility are all Range_Checks. Discriminant_Checks and
6008 Index_Checks are associated only with checks that a value
6009 satisfies a constraint.
6010
6011 12
6012 The condition imposed by a constraint is the condition obtained after
6013 elaboration of the constraint. The rules defining compatibility are
6014 given for each form of constraint in the appropriate subclause. These
6015 rules are such that if a constraint is compatible with a subtype, then
6016 the condition imposed by the constraint cannot contradict any condition
6017 already imposed by the subtype on its values. The exception
6018 Constraint_Error is raised if any check of compatibility fails.
6019
6020 12.a
6021 To be honest: The condition imposed by a constraint is named
6022 after it -- a range_constraint imposes a range constraint,
6023 etc.
6024
6025 12.b
6026 Ramification: A range_constraint causes freezing of its type.
6027 Other constraints do not.
6028
6029 NOTES
6030
6031 13
6032 4 A scalar_constraint may be applied to a subtype of an
6033 appropriate scalar type (see *note 3.5::, *note 3.5.9::, and *note
6034 J.3::), even if the subtype is already constrained. On the other
6035 hand, a composite_constraint may be applied to a composite subtype
6036 (or an access-to-composite subtype) only if the composite subtype
6037 is unconstrained (see *note 3.6.1:: and *note 3.7.1::).
6038
6039 _Examples_
6040
6041 14
6042 Examples of subtype declarations:
6043
6044 15/2
6045 {AI95-00433-01AI95-00433-01} subtype Rainbow is Color range Red .. Blue; -- see *note 3.2.1::
6046 subtype Red_Blue is Rainbow;
6047 subtype Int is Integer;
6048 subtype Small_Int is Integer range -10 .. 10;
6049 subtype Up_To_K is Column range 1 .. K; -- see *note 3.2.1::
6050 subtype Square is Matrix(1 .. 10, 1 .. 10); -- see *note 3.6::
6051 subtype Male is Person(Sex => M); -- see *note 3.10.1::
6052 subtype Binop_Ref is not null Binop_Ptr; -- see *note 3.10::
6053
6054 _Incompatibilities With Ada 83_
6055
6056 15.a
6057 In Ada 95, all range_constraints cause freezing of their type.
6058 Hence, a type-related representation item for a scalar type
6059 has to precede any range_constraints whose type is the scalar
6060 type.
6061
6062 _Wording Changes from Ada 83_
6063
6064 15.b
6065 Subtype_marks allow only subtype names now, since types are
6066 never directly named. There is no need for RM83-3.3.2(3),
6067 which says a subtype_mark can denote both the type and the
6068 subtype; in Ada 95, you denote an unconstrained (base) subtype
6069 if you want, but never the type.
6070
6071 15.c
6072 The syntactic category type_mark is now called subtype_mark,
6073 since it always denotes a subtype.
6074
6075 _Extensions to Ada 95_
6076
6077 15.d/2
6078 {AI95-00231-01AI95-00231-01} An optional null_exclusion can be
6079 used in a subtype_indication. This is described in *note
6080 3.10::.
6081
6082 _Extensions to Ada 2005_
6083
6084 15.e/3
6085 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
6086 be used in a subtype_declaration. This is described in *note
6087 13.1.1::.
6088
6089 \1f
6090 File: aarm2012.info, Node: 3.2.3, Next: 3.2.4, Prev: 3.2.2, Up: 3.2
6091
6092 3.2.3 Classification of Operations
6093 ----------------------------------
6094
6095 _Static Semantics_
6096
6097 1/2
6098 {AI95-00416-01AI95-00416-01} An operation operates on a type T if it
6099 yields a value of type T, if it has an operand whose expected type (see
6100 *note 8.6::) is T, or if it has an access parameter or access result
6101 type (see *note 6.1::) designating T. A predefined operator, or other
6102 language-defined operation such as assignment or a membership test, that
6103 operates on a type, is called a predefined operation of the type. The
6104 primitive operations of a type are the predefined operations of the
6105 type, plus any user-defined primitive subprograms.
6106
6107 1.a
6108 Glossary entry: The primitive operations of a type are the
6109 operations (such as subprograms) declared together with the
6110 type declaration. They are inherited by other types in the
6111 same class of types. For a tagged type, the primitive
6112 subprograms are dispatching subprograms, providing run-time
6113 polymorphism. A dispatching subprogram may be called with
6114 statically tagged operands, in which case the subprogram body
6115 invoked is determined at compile time. Alternatively, a
6116 dispatching subprogram may be called using a dispatching call,
6117 in which case the subprogram body invoked is determined at run
6118 time.
6119
6120 1.b
6121 To be honest: Protected subprograms are not considered to be
6122 "primitive subprograms," even though they are subprograms, and
6123 they are inherited by derived types.
6124
6125 1.c
6126 Discussion: We use the term "primitive subprogram" in most of
6127 the rest of the manual. The term "primitive operation" is
6128 used mostly in conceptual discussions.
6129
6130 2
6131 The primitive subprograms of a specific type are defined as follows:
6132
6133 3
6134 * The predefined operators of the type (see *note 4.5::);
6135
6136 4
6137 * For a derived type, the inherited (see *note 3.4::) user-defined
6138 subprograms;
6139
6140 5
6141 * For an enumeration type, the enumeration literals (which are
6142 considered parameterless functions -- see *note 3.5.1::);
6143
6144 6
6145 * For a specific type declared immediately within a
6146 package_specification, any subprograms (in addition to the
6147 enumeration literals) that are explicitly declared immediately
6148 within the same package_specification and that operate on the type;
6149
6150 6.1/3
6151 * {AI05-0128-1AI05-0128-1} For a specific type with an explicitly
6152 declared primitive "=" operator whose result type is Boolean, the
6153 corresponding "/=" operator (see *note 6.6::);
6154
6155 7/2
6156 * {AI95-00200-01AI95-00200-01} For a nonformal type, any subprograms
6157 not covered above [that are explicitly declared immediately within
6158 the same declarative region as the type] and that override (see
6159 *note 8.3::) other implicitly declared primitive subprograms of the
6160 type.
6161
6162 7.a
6163 Discussion: In Ada 83, only subprograms declared in the
6164 visible part were "primitive" (i.e. derivable). In Ada 95,
6165 mostly because of child library units, we include all
6166 operations declared in the private part as well, and all
6167 operations that override implicit declarations.
6168
6169 7.b
6170 Ramification: It is possible for a subprogram to be primitive
6171 for more than one type, though it is illegal for a subprogram
6172 to be primitive for more than one tagged type. See *note
6173 3.9::.
6174
6175 7.c
6176 Discussion: The order of the implicit declarations when there
6177 are both predefined operators and inherited subprograms is
6178 described in *note 3.4::, "*note 3.4:: Derived Types and
6179 Classes".
6180
6181 7.d/2
6182 Ramification: {AI95-00200-01AI95-00200-01} Subprograms
6183 declared in a generic package specification are never
6184 primitive for a formal type, even if they happen to override
6185 an operation of the formal type. This includes formal
6186 subprograms, which are never primitive operations (that's true
6187 even for an abstract formal subprogram).
6188
6189 8
6190 A primitive subprogram whose designator is an operator_symbol is called
6191 a primitive operator.
6192
6193 _Incompatibilities With Ada 83_
6194
6195 8.a
6196 The attribute S'Base is no longer defined for nonscalar
6197 subtypes. Since this was only permitted as the prefix of
6198 another attribute, and there are no interesting nonscalar
6199 attributes defined for an unconstrained composite or access
6200 subtype, this should not affect any existing programs.
6201
6202 _Extensions to Ada 83_
6203
6204 8.b
6205 The primitive subprograms (derivable subprograms) include
6206 subprograms declared in the private part of a package
6207 specification as well, and those that override implicitly
6208 declared subprograms, even if declared in a body.
6209
6210 _Wording Changes from Ada 83_
6211
6212 8.c
6213 We have dropped the confusing term operation of a type in
6214 favor of the more useful primitive operation of a type and the
6215 phrase operates on a type.
6216
6217 8.d
6218 The description of S'Base has been moved to *note 3.5::,
6219 "*note 3.5:: Scalar Types" because it is now defined only for
6220 scalar types.
6221
6222 _Wording Changes from Ada 95_
6223
6224 8.e/2
6225 {AI95-00200-01AI95-00200-01} Clarified that a formal
6226 subprogram that happens to override a primitive operation of a
6227 formal type is not a primitive operation (and thus not a
6228 dispatching operation) of the formal type.
6229
6230 8.f/2
6231 {AI95-00416-01AI95-00416-01} Added wording to include access
6232 result types in the kinds of operations that operate on a type
6233 T.
6234
6235 _Wording Changes from Ada 2005_
6236
6237 8.g/3
6238 {AI05-0128-1AI05-0128-1} Correction: The implicitly declared
6239 "/=" for a primitive "=" operator is also primitive; this
6240 makes it eligible to be made visible by a use type clause.
6241
6242 \1f
6243 File: aarm2012.info, Node: 3.2.4, Prev: 3.2.3, Up: 3.2
6244
6245 3.2.4 Subtype Predicates
6246 ------------------------
6247
6248 1/3
6249 {AI05-0153-3AI05-0153-3} {AI05-0269-1AI05-0269-1}
6250 {AI05-0299-1AI05-0299-1} The language-defined predicate aspects
6251 Static_Predicate and Dynamic_Predicate may be used to define properties
6252 of subtypes. A predicate specification is an aspect_specification for
6253 one of the two predicate aspects. General rules for aspects and
6254 aspect_specifications are found in Clause *note 13:: (*note 13.1:: and
6255 *note 13.1.1:: respectively).
6256
6257 1.a/3
6258 Aspect Description for Static_Predicate: Condition that must
6259 hold true for objects of a given subtype; the subtype may be
6260 static.
6261
6262 1.b/3
6263 Aspect Description for Dynamic_Predicate: Condition that must
6264 hold true for objects of a given subtype; the subtype is not
6265 static.
6266
6267 _Name Resolution Rules_
6268
6269 2/3
6270 {AI05-0153-3AI05-0153-3} The expected type for a predicate aspect
6271 expression is any boolean type.
6272
6273 _Static Semantics_
6274
6275 3/3
6276 {AI05-0153-3AI05-0153-3} A predicate specification may be given on a
6277 type_declaration or a subtype_declaration, and applies to the declared
6278 subtype. In addition, predicate specifications apply to certain other
6279 subtypes:
6280
6281 4/3
6282 * For a (first) subtype defined by a derived type declaration, the
6283 predicates of the parent subtype and the progenitor subtypes apply.
6284
6285 5/3
6286 * For a subtype created by a subtype_indication, the predicate of the
6287 subtype denoted by the subtype_mark applies.
6288
6289 6/3
6290 {AI05-0153-3AI05-0153-3} The predicate of a subtype consists of all
6291 predicate specifications that apply, and-ed together; if no predicate
6292 specifications apply, the predicate is True [(in particular, the
6293 predicate of a base subtype is True)].
6294
6295 7/3
6296 {AI05-0290-1AI05-0290-1} Predicate checks are defined to be enabled or
6297 disabled for a given subtype as follows:
6298
6299 8/3
6300 * If a subtype is declared by a type_declaration or
6301 subtype_declaration that includes a predicate specification, then:
6302
6303 9/3
6304 * if performing checks is required by the Static_Predicate
6305 assertion policy (see *note 11.4.2::) and the declaration
6306 includes a Static_Predicate specification, then predicate
6307 checks are enabled for the subtype;
6308
6309 10/3
6310 * if performing checks is required by the Dynamic_Predicate
6311 assertion policy (see *note 11.4.2::) and the declaration
6312 includes a Dynamic_Predicate specification, then predicate
6313 checks are enabled for the subtype;
6314
6315 11/3
6316 * otherwise, predicate checks are disabled for the subtype[,
6317 regardless of whether predicate checking is enabled for any
6318 other subtypes mentioned in the declaration];
6319
6320 12/3
6321 * If a subtype is defined by a derived type declaration that does not
6322 include a predicate specification, then predicate checks are
6323 enabled for the subtype if and only if predicate checks are enabled
6324 for at least one of the parent subtype and the progenitor subtypes;
6325
6326 13/3
6327 * If a subtype is created by a subtype_indication other than in one
6328 of the previous cases, then predicate checks are enabled for the
6329 subtype if and only if predicate checks are enabled for the subtype
6330 denoted by the subtype_mark;
6331
6332 14/3
6333 * Otherwise, predicate checks are disabled for the given subtype.
6334
6335 14.a/3
6336 Discussion: In this case, no predicate specifications can
6337 apply to the subtype and so it doesn't typically matter
6338 whether predicate checks are enabled. This rule does make a
6339 difference, however, when determining whether predicate checks
6340 are enabled for another type when this type is one of multiple
6341 progenitors. See the "derived type declaration" wording
6342 above.
6343
6344 14.b/3
6345 Even when predicate checks are disabled, a predicate cam
6346 affect various Legality Rules, the results of membership
6347 tests, the items in a for loop, and the result of the Valid
6348 attribute.
6349
6350 _Legality Rules_
6351
6352 15/3
6353 {AI05-0153-3AI05-0153-3} {AI05-0269-1AI05-0269-1} The expression of a
6354 Static_Predicate specification shall be predicate-static; that is, one
6355 of the following:
6356
6357 16/3
6358 * a static expression;
6359
6360 17/3
6361 * a membership test whose simple_expression is the current instance,
6362 and whose membership_choice_list meets the requirements for a
6363 static membership test (see *note 4.9::);
6364
6365 18/3
6366 * a case_expression whose selecting_expression is the current
6367 instance, and whose dependent_expressions are static expressions;
6368
6369 19/3
6370 * a call to a predefined equality or ordering operator, where one
6371 operand is the current instance, and the other is a static
6372 expression;
6373
6374 20/3
6375 * {AI05-0262-1AI05-0262-1} a call to a predefined boolean logical
6376 operator, where each operand is predicate-static;
6377
6378 21/3
6379 * {AI05-0269-1AI05-0269-1} a short-circuit control form where both
6380 operands are predicate-static; or
6381
6382 22/3
6383 * a parenthesized predicate-static expression.
6384
6385 23/3
6386 {AI05-0262-1AI05-0262-1} A predicate shall not be specified for an
6387 incomplete subtype.
6388
6389 23.a/3
6390 Reason: The expression of such a predicate could not depend on
6391 the properties of the value of the type (since it doesn't have
6392 any), so it is useless and we don't want to require the added
6393 complexity needed to support it.
6394
6395 24/3
6396 {AI05-0287-1AI05-0287-1} If a predicate applies to a subtype, then that
6397 predicate shall not mention any other subtype to which the same
6398 predicate applies.
6399
6400 24.a/3
6401 Reason: This is intended to prevent recursive predicates,
6402 which cause definitional problems for static predicates.
6403 Inside of the predicate, the subtype name refers to the
6404 current instance of the subtype, which is an object, so a
6405 direct use of the subtype name cannot be recursive. But other
6406 subtypes naming the same type might:
6407
6408 24.b/3
6409 type Really_Ugly is private;
6410 private
6411 subtype Ugly is Really_Ugly;
6412 type Really_Ugly is new Integer
6413 with Static_Predicate => Really_Ugly not in Ugly; -- Illegal!
6414
6415 25/3
6416 {AI05-0153-3AI05-0153-3} An index subtype, discrete_range of an
6417 index_constraint or slice, or a discrete_subtype_definition of a
6418 constrained_array_definition, entry_declaration, or
6419 entry_index_specification shall not denote a subtype to which predicate
6420 specifications apply.
6421
6422 26/3
6423 {AI05-0153-3AI05-0153-3} The prefix of an attribute_reference whose
6424 attribute_designator is First, Last, or Range shall not denote a scalar
6425 subtype to which predicate specifications apply.
6426
6427 26.a/3
6428 Reason: {AI05-0297-1AI05-0297-1} This is to prevent confusion
6429 about whether the First value is the lowest value of the
6430 subtype (which does not depend on the predicate) or the lowest
6431 value of the subtype which meets the predicate. (For a
6432 dynamic predicate, determining this latter value is expensive
6433 as it would usually require a loop.) For a static subtype
6434 that has a static predicate, the First_Valid and Last_Valid
6435 attributes (see *note 3.5.5::) can be used instead.
6436
6437 27/3
6438 {AI05-0153-3AI05-0153-3} {AI05-0262-1AI05-0262-1}
6439 {AI05-0287-1AI05-0287-1} The discrete_subtype_definition of a
6440 loop_parameter_specification shall not denote a nonstatic subtype to
6441 which predicate specifications apply or any subtype to which
6442 Dynamic_Predicate specifications apply.
6443
6444 28/3
6445 {AI05-0153-3AI05-0153-3} {AI05-0262-1AI05-0262-1} The discrete_choice of
6446 a named_array_aggregate shall not denote a nonstatic subtype to which
6447 predicate specifications apply.
6448
6449 28.a/3
6450 Reason: {AI05-0262-1AI05-0262-1} This rule prevents
6451 noncontiguous dynamically bounded array aggregates, which
6452 could be expensive to check for. (Array aggregates have rules
6453 to prevent problems with static subtypes.) We define this
6454 rule here so that the runtime generic body check applies.
6455
6456 29/3
6457 {AI05-0262-1AI05-0262-1} In addition to the places where Legality Rules
6458 normally apply (see *note 12.3::), these rules apply also in the private
6459 part of an instance of a generic unit.
6460
6461 _Dynamic Semantics_
6462
6463 30/3
6464 {AI05-0153-3AI05-0153-3} {AI05-0290-1AI05-0290-1} If predicate checks
6465 are enabled for a given subtype, then:
6466
6467 31/3
6468 [On every subtype conversion, the predicate of the target
6469 subtype is evaluated, and a check is performed that the
6470 predicate is True. This includes all parameter passing,
6471 except for certain parameters passed by reference, which are
6472 covered by the following rule: ] After normal completion and
6473 leaving of a subprogram, for each in out or out parameter that
6474 is passed by reference, the predicate of the subtype of the
6475 actual is evaluated, and a check is performed that the
6476 predicate is True. For an object created by an
6477 object_declaration with no explicit initialization expression,
6478 or by an uninitialized allocator, if any subcomponents have
6479 default_expressions, the predicate of the nominal subtype of
6480 the created object is evaluated, and a check is performed that
6481 the predicate is True. Assertions.Assertion_Error is raised
6482 if any of these checks fail.
6483
6484 31.a/3
6485 Ramification: Predicates are not evaluated at the point of the
6486 (sub)type declaration.
6487
6488 31.b/3
6489 Implementation Note: Static_Predicate checks can be removed
6490 even in the presence of potentially invalid values, just as
6491 constraint checks can be removed.
6492
6493 32/3
6494 {AI05-0262-1AI05-0262-1} A value satisfies a predicate if the predicate
6495 is True for that value.
6496
6497 33/3
6498 {AI05-0153-3AI05-0153-3} {AI05-0276-1AI05-0276-1} If any of the above
6499 Legality Rules is violated in an instance of a generic unit,
6500 Program_Error is raised at the point of the violation.
6501
6502 33.a/3
6503 Discussion: This is the usual way around the contract model;
6504 this applies even in instance bodies. Note that errors in
6505 instance specifications will be detected at compile-time by
6506 the "re-check" of the specification, only errors in the body
6507 should raise Program_Error.
6508
6509 NOTES
6510
6511 34/3
6512 5 {AI05-0153-3AI05-0153-3} A predicate specification does not
6513 cause a subtype to be considered constrained.
6514
6515 35/3
6516 6 {AI05-0153-3AI05-0153-3} A Static_Predicate, like a constraint,
6517 always remains True for all objects of the subtype, except in the
6518 case of uninitialized variables and other invalid values. A
6519 Dynamic_Predicate, on the other hand, is checked as specified
6520 above, but can become False at other times. For example, the
6521 predicate of a record subtype is not checked when a subcomponent is
6522 modified.
6523
6524 _Extensions to Ada 2005_
6525
6526 35.a/3
6527 {AI05-0153-3AI05-0153-3} {AI05-0262-1AI05-0262-1}
6528 {AI05-0276-1AI05-0276-1} {AI05-0290-1AI05-0290-1} Predicate
6529 aspects are new in Ada 2012.
6530
6531 \1f
6532 File: aarm2012.info, Node: 3.3, Next: 3.4, Prev: 3.2, Up: 3
6533
6534 3.3 Objects and Named Numbers
6535 =============================
6536
6537 1
6538 [Objects are created at run time and contain a value of a given type.
6539 An object can be created and initialized as part of elaborating a
6540 declaration, evaluating an allocator, aggregate, or function_call, or
6541 passing a parameter by copy. Prior to reclaiming the storage for an
6542 object, it is finalized if necessary (see *note 7.6.1::).]
6543
6544 _Static Semantics_
6545
6546 2
6547 All of the following are objects:
6548
6549 2.a
6550 Glossary entry: An object is either a constant or a variable.
6551 An object contains a value. An object is created by an
6552 object_declaration or by an allocator. A formal parameter is
6553 (a view of) an object. A subcomponent of an object is an
6554 object.
6555
6556 3
6557 * the entity declared by an object_declaration;
6558
6559 4
6560 * a formal parameter of a subprogram, entry, or generic subprogram;
6561
6562 5
6563 * a generic formal object;
6564
6565 6
6566 * a loop parameter;
6567
6568 7
6569 * a choice parameter of an exception_handler;
6570
6571 8
6572 * an entry index of an entry_body;
6573
6574 9
6575 * the result of dereferencing an access-to-object value (see *note
6576 4.1::);
6577
6578 10/3
6579 * {AI95-00416-01AI95-00416-01} {AI05-0015-1AI05-0015-1} the return
6580 object of a function;
6581
6582 11
6583 * the result of evaluating an aggregate;
6584
6585 11.1/3
6586 * {AI05-0003-1AI05-0003-1} a qualified_expression whose operand
6587 denotes an object;
6588
6589 12
6590 * a component, slice, or view conversion of another object.
6591
6592 13/3
6593 {AI05-0054-2AI05-0054-2} An object is either a constant object or a
6594 variable object. Similarly, a view of an object is either a constant or
6595 a variable. All views of a constant elementary object are constant.
6596 All views of a constant composite object are constant, except for parts
6597 that are of controlled or immutably limited types; variable views of
6598 those parts and their subcomponents may exist. In this sense, objects
6599 of controlled and immutably limited types are inherently mutable. A
6600 constant view of an object cannot be used to modify its value. The
6601 terms constant and variable by themselves refer to constant and variable
6602 views of objects.
6603
6604 14
6605 The value of an object is read when the value of any part of the object
6606 is evaluated, or when the value of an enclosing object is evaluated.
6607 The value of a variable is updated when an assignment is performed to
6608 any part of the variable, or when an assignment is performed to an
6609 enclosing object.
6610
6611 14.a
6612 Ramification: Reading and updating are intended to include
6613 read/write references of any kind, even if they are not
6614 associated with the evaluation of a particular construct.
6615 Consider, for example, the expression "X.all(F)", where X is
6616 an access-to-array object, and F is a function. The
6617 implementation is allowed to first evaluate "X.all" and then
6618 F. Finally, a read is performed to get the value of the F'th
6619 component of the array. Note that the array is not
6620 necessarily read as part of the evaluation of "X.all". This
6621 is important, because if F were to free X using
6622 Unchecked_Deallocation, we want the execution of the final
6623 read to be erroneous.
6624
6625 15
6626 Whether a view of an object is constant or variable is determined by the
6627 definition of the view. The following (and no others) represent
6628 constants:
6629
6630 16
6631 * an object declared by an object_declaration with the reserved word
6632 constant;
6633
6634 16.a/2
6635 To be honest: {AI95-00385-01AI95-00385-01} We mean the word
6636 constant as defined by the grammar for object_declaration, not
6637 some random word constant. Thus,
6638
6639 16.b/2
6640 X : access constant T;
6641
6642 16.c/2
6643 is not a constant.
6644
6645 17
6646 * a formal parameter or generic formal object of mode in;
6647
6648 18
6649 * a discriminant;
6650
6651 18.1/3
6652 * {AI05-0262-1AI05-0262-1} a loop parameter unless specified to be a
6653 variable for a generalized loop (see *note 5.5.2::);
6654
6655 19/3
6656 * {AI05-0262-1AI05-0262-1} a choice parameter or entry index;
6657
6658 20
6659 * the dereference of an access-to-constant value;
6660
6661 20.1/3
6662 * {AI05-0015-1AI05-0015-1} the return object declared by an
6663 extended_return_statement with the reserved word constant;
6664
6665 21/3
6666 * {AI05-0015-1AI05-0015-1} the object denoted by a function_call or
6667 an aggregate;
6668
6669 21.1/3
6670 * {AI05-0003-1AI05-0003-1} the result of evaluating a
6671 qualified_expression;
6672
6673 21.2/3
6674 * {AI05-0120-1AI05-0120-1} within the body of a protected function
6675 (or a function declared immediately within a protected_body), the
6676 current instance of the enclosing protected unit;
6677
6678 22
6679 * a selected_component, indexed_component, slice, or view conversion
6680 of a constant.
6681
6682 23/3
6683 {AI05-0264-1AI05-0264-1} At the place where a view of an object is
6684 defined, a nominal subtype is associated with the view. The object's
6685 actual subtype (that is, its subtype) can be more restrictive than the
6686 nominal subtype of the view; it always is if the nominal subtype is an
6687 indefinite subtype. A subtype is an indefinite subtype if it is an
6688 unconstrained array subtype, or if it has unknown discriminants or
6689 unconstrained discriminants without defaults (see *note 3.7::);
6690 otherwise, the subtype is a definite subtype [(all elementary subtypes
6691 are definite subtypes)]. [A class-wide subtype is defined to have
6692 unknown discriminants, and is therefore an indefinite subtype. An
6693 indefinite subtype does not by itself provide enough information to
6694 create an object; an additional constraint or explicit initialization
6695 expression is necessary (see *note 3.3.1::). A component cannot have an
6696 indefinite nominal subtype.]
6697
6698 23.1/3
6699 {AI05-0008-1AI05-0008-1} A view of a composite object is known to be
6700 constrained if:
6701
6702 23.2/3
6703 * its nominal subtype is constrained, and is not an untagged partial
6704 view; or
6705
6706 23.3/3
6707 * its nominal subtype is indefinite; or
6708
6709 23.4/3
6710 * {AI05-0008-1AI05-0008-1} {AI05-0093-1AI05-0093-1} its type is
6711 immutably limited (see *note 7.5::); or
6712
6713 23.5/3
6714 * it is part of a stand-alone constant (including a generic formal
6715 object of mode in); or
6716
6717 23.6/3
6718 * it is part of a formal parameter of mode in; or
6719
6720 23.7/3
6721 * it is part of the object denoted by a function_call or aggregate;
6722 or
6723
6724 23.8/3
6725 * it is part of a constant return object of an
6726 extended_return_statement; or
6727
6728 23.9/3
6729 * {AI05-0008-1AI05-0008-1} {AI05-0041-1AI05-0041-1} it is a
6730 dereference of a pool-specific access type, and there is no
6731 ancestor of its type that has a constrained partial view.
6732
6733 23.a/3
6734 Discussion: We do not include dereferences of general access
6735 types because they might denote stand-alone aliased
6736 unconstrained variables. That's true even for
6737 access-to-constant types (the denoted object does not have to
6738 be a constant).
6739
6740 23.b/3
6741 {AI05-0005-1AI05-0005-1} {AI05-0008-1AI05-0008-1} There are
6742 other cases that could have been included in this definition
6743 (view conversions, the current instance of a type, objects of
6744 a formal discriminated private type), but these are not
6745 relevant to the places this term is used, so they were not
6746 included. If this term is used in additional places, the
6747 definition should be checked to see if any of these additional
6748 cases are relevant and appropriate wording added if necessary.
6749
6750 23.10/3
6751 {AI05-0008-1AI05-0008-1} {AI05-0041-1AI05-0041-1} For the purposes of
6752 determining within a generic body whether an object is known to be
6753 constrained:
6754
6755 23.11/3
6756 * if a subtype is a descendant of an untagged generic formal private
6757 or derived type, and the subtype is not an unconstrained array
6758 subtype, it is not considered indefinite and is considered to have
6759 a constrained partial view;
6760
6761 23.12/3
6762 * if a subtype is a descendant of a formal access type, it is not
6763 considered pool-specific.
6764
6765 24
6766 A named number provides a name for a numeric value known at compile
6767 time. It is declared by a number_declaration.
6768
6769 NOTES
6770
6771 25
6772 7 A constant cannot be the target of an assignment operation, nor
6773 be passed as an in out or out parameter, between its initialization
6774 and finalization, if any.
6775
6776 25.1/3
6777 8 {AI05-0054-2AI05-0054-2} The value of a constant object cannot
6778 be changed after its initialization, except in some cases where the
6779 object has a controlled or immutably limited part (see *note 7.5::,
6780 *note 7.6::, and *note 13.9.1::).
6781
6782 26/3
6783 9 {AI05-0264-1AI05-0264-1} The nominal and actual subtypes of an
6784 elementary object are always the same. For a discriminated or
6785 array object, if the nominal subtype is constrained, then so is the
6786 actual subtype.
6787
6788 _Extensions to Ada 83_
6789
6790 26.a
6791 There are additional kinds of objects (choice parameters and
6792 entry indices of entry bodies).
6793
6794 26.b
6795 The result of a function and of evaluating an aggregate are
6796 considered (constant) objects. This is necessary to explain
6797 the action of finalization on such things. Because a
6798 function_call is also syntactically a name (see *note 4.1::),
6799 the result of a function_call can be renamed, thereby allowing
6800 repeated use of the result without calling the function again.
6801
6802 _Wording Changes from Ada 83_
6803
6804 26.c/3
6805 {AI05-0299-1AI05-0299-1} This subclause now follows the
6806 subclauses on types and subtypes, to cut down on the number of
6807 forward references.
6808
6809 26.d
6810 The term nominal subtype is new. It is used to distinguish
6811 what is known at compile time about an object's constraint,
6812 versus what its "true" run-time constraint is.
6813
6814 26.e
6815 The terms definite and indefinite (which apply to subtypes)
6816 are new. They are used to aid in the description of generic
6817 formal type matching, and to specify when an explicit initial
6818 value is required in an object_declaration.
6819
6820 26.f
6821 We have moved the syntax for object_declaration and
6822 number_declaration down into their respective subclauses, to
6823 keep the syntax close to the description of the associated
6824 semantics.
6825
6826 26.g
6827 We talk about variables and constants here, since the
6828 discussion is not specific to object_declarations, and it
6829 seems better to have the list of the kinds of constants
6830 juxtaposed with the kinds of objects.
6831
6832 26.h
6833 We no longer talk about indirect updating due to parameter
6834 passing. Parameter passing is handled in 6.2 and 6.4.1 in a
6835 way that there is no need to mention it here in the definition
6836 of read and update. Reading and updating now includes the
6837 case of evaluating or assigning to an enclosing object.
6838
6839 _Wording Changes from Ada 95_
6840
6841 26.i/2
6842 {AI95-00416-01AI95-00416-01} Clarified that the return object
6843 is the object created by a function call.
6844
6845 _Extensions to Ada 2005_
6846
6847 26.j/3
6848 {AI05-0015-1AI05-0015-1} Added wording to allow return objects
6849 to be declared as constants, and corrected the definition of
6850 return objects as objects.
6851
6852 _Wording Changes from Ada 2005_
6853
6854 26.k/3
6855 {AI05-0008-1AI05-0008-1} {AI05-0041-1AI05-0041-1}
6856 {AI05-0093-1AI05-0093-1} Correction: Added a definition of
6857 known to be constrained, for use in other rules.
6858
6859 26.l/3
6860 {AI05-0054-2AI05-0054-2} Correction: We now recognize the fact
6861 that not all declared constant objects are immutable; for
6862 those that a variable view can be constructed, they can be
6863 changed via that view.
6864
6865 26.m/3
6866 {AI05-0120-1AI05-0120-1} Correction: Added the current
6867 instance of a protected object to the list of constant views;
6868 since the list claims to include all possibilities, it had
6869 better include that one.
6870
6871 26.n/3
6872 {AI05-0003-1AI05-0003-1} The result of a qualified_expression
6873 is defined to be a constant view and is defined to be an
6874 object if the operand of the qualified_expression is an
6875 object. These definitions, combined with some grammar
6876 changes, allow qualified_expressions to be used in more
6877 places. See *note 4.1:: for details.
6878
6879 * Menu:
6880
6881 * 3.3.1 :: Object Declarations
6882 * 3.3.2 :: Number Declarations
6883
6884 \1f
6885 File: aarm2012.info, Node: 3.3.1, Next: 3.3.2, Up: 3.3
6886
6887 3.3.1 Object Declarations
6888 -------------------------
6889
6890 1/3
6891 {AI05-0262-1AI05-0262-1} An object_declaration declares a stand-alone
6892 object with a given nominal subtype and, optionally, an explicit initial
6893 value given by an initialization expression. For an array, access,
6894 task, or protected object, the object_declaration may include the
6895 definition of the (anonymous) type of the object.
6896
6897 _Syntax_
6898
6899 2/3
6900 {AI95-00385-01AI95-00385-01} {AI95-00406-01AI95-00406-01}
6901 {AI05-0183-1AI05-0183-1} object_declaration ::=
6902 defining_identifier_list : [aliased] [constant]
6903 subtype_indication [:= expression]
6904 [aspect_specification];
6905 | defining_identifier_list : [aliased] [constant]
6906 access_definition [:= expression]
6907 [aspect_specification];
6908 | defining_identifier_list : [aliased] [constant]
6909 array_type_definition [:= expression]
6910 [aspect_specification];
6911 | single_task_declaration
6912 | single_protected_declaration
6913
6914 3
6915 defining_identifier_list ::=
6916 defining_identifier {, defining_identifier}
6917
6918 _Name Resolution Rules_
6919
6920 4
6921 For an object_declaration with an expression following the compound
6922 delimiter :=, the type expected for the expression is that of the
6923 object. This expression is called the initialization expression.
6924
6925 _Legality Rules_
6926
6927 5/2
6928 {AI95-00287-01AI95-00287-01} An object_declaration without the reserved
6929 word constant declares a variable object. If it has a
6930 subtype_indication or an array_type_definition that defines an
6931 indefinite subtype, then there shall be an initialization expression.
6932
6933 _Static Semantics_
6934
6935 6/3
6936 {AI05-0264-1AI05-0264-1} {AI05-0299-1AI05-0299-1} An object_declaration
6937 with the reserved word constant declares a constant object. If it has
6938 an initialization expression, then it is called a full constant
6939 declaration. Otherwise, it is called a deferred constant declaration.
6940 The rules for deferred constant declarations are given in subclause
6941 *note 7.4::. The rules for full constant declarations are given in this
6942 subclause.
6943
6944 7
6945 Any declaration that includes a defining_identifier_list with more than
6946 one defining_identifier is equivalent to a series of declarations each
6947 containing one defining_identifier from the list, with the rest of the
6948 text of the declaration copied for each declaration in the series, in
6949 the same order as the list. The remainder of this International
6950 Standard relies on this equivalence; explanations are given for
6951 declarations with a single defining_identifier.
6952
6953 8/2
6954 {AI95-00385-01AI95-00385-01} The subtype_indication, access_definition,
6955 or full type definition of an object_declaration defines the nominal
6956 subtype of the object. The object_declaration declares an object of the
6957 type of the nominal subtype.
6958
6959 8.a/2
6960 Discussion: {AI95-00385-01AI95-00385-01} The phrase "full type
6961 definition" here includes the case of an anonymous array,
6962 access, task, or protected type.
6963
6964 8.1/2
6965 {AI95-00373-01AI95-00373-01} A component of an object is said to require
6966 late initialization if it has an access discriminant value constrained
6967 by a per-object expression, or if it has an initialization expression
6968 that includes a name denoting the current instance of the type or
6969 denoting an access discriminant.
6970
6971 8.b/2
6972 Reason: Such components can depend on the values of other
6973 components of the object. We want to initialize them as late
6974 and as reproducibly as possible.
6975
6976 _Dynamic Semantics_
6977
6978 9/2
6979 {AI95-00363-01AI95-00363-01} If a composite object declared by an
6980 object_declaration has an unconstrained nominal subtype, then if this
6981 subtype is indefinite or the object is constant the actual subtype of
6982 this object is constrained. The constraint is determined by the bounds
6983 or discriminants (if any) of its initial value; the object is said to be
6984 constrained by its initial value. When not constrained by its initial
6985 value, the actual and nominal subtypes of the object are the same. If
6986 its actual subtype is constrained, the object is called a constrained
6987 object.
6988
6989 10
6990 For an object_declaration without an initialization expression, any
6991 initial values for the object or its subcomponents are determined by the
6992 implicit initial values defined for its nominal subtype, as follows:
6993
6994 11
6995 * The implicit initial value for an access subtype is the null value
6996 of the access type.
6997
6998 11.1/3
6999 * {AI05-0228-1AI05-0228-1} The implicit initial value for a scalar
7000 subtype that has the Default_Value aspect specified is the value of
7001 that aspect converted to the nominal subtype (which might raise
7002 Constraint_Error -- see *note 4.6::, "*note 4.6:: Type
7003 Conversions");
7004
7005 11.a.1/3
7006 Ramification: This is a Dynamic Semantics rule, so the
7007 visibility of the aspect_specification is not relevant -- if
7008 the full type for a private type has the Default_Value aspect
7009 specified, partial views of the type also have this implicit
7010 initial value.
7011
7012 12
7013 * The implicit initial (and only) value for each discriminant of a
7014 constrained discriminated subtype is defined by the subtype.
7015
7016 13/3
7017 * {AI05-0228-1AI05-0228-1} For a (definite) composite subtype, the
7018 implicit initial value of each component with a default_expression
7019 is obtained by evaluation of this expression and conversion to the
7020 component's nominal subtype (which might raise Constraint_Error),
7021 unless the component is a discriminant of a constrained subtype
7022 (the previous case), or is in an excluded variant (see *note
7023 3.8.1::). For each component that does not have a
7024 default_expression, if the composite subtype has the
7025 Default_Component_Value aspect specified, the implicit initial
7026 value is the value of that aspect converted to the component's
7027 nominal subtype; otherwise, any implicit initial values are those
7028 determined by the component's nominal subtype.
7029
7030 14
7031 * For a protected or task subtype, there is an implicit component (an
7032 entry queue) corresponding to each entry, with its implicit initial
7033 value being an empty queue.
7034
7035 14.a
7036 Implementation Note: The implementation may add implicit
7037 components for its own use, which might have implicit initial
7038 values. For a task subtype, such components might represent
7039 the state of the associated thread of control. For a type
7040 with dynamic-sized components, such implicit components might
7041 be used to hold the offset to some explicit component.
7042
7043 15
7044 The elaboration of an object_declaration proceeds in the following
7045 sequence of steps:
7046
7047 16/2
7048 1. {AI95-00385-01AI95-00385-01} The subtype_indication (*note
7049 3.2.2: S0027.), access_definition (*note 3.10: S0084.),
7050 array_type_definition (*note 3.6: S0051.), single_task_declaration
7051 (*note 9.1: S0206.), or single_protected_declaration (*note 9.4:
7052 S0211.) is first elaborated. This creates the nominal subtype (and
7053 the anonymous type in the last four cases).
7054
7055 17
7056 2. If the object_declaration includes an initialization
7057 expression, the (explicit) initial value is obtained by evaluating
7058 the expression and converting it to the nominal subtype (which
7059 might raise Constraint_Error -- see *note 4.6::).
7060
7061 18/2
7062 3. {8652/00028652/0002} {AI95-00171-01AI95-00171-01}
7063 {AI95-00373-01AI95-00373-01} The object is created, and, if there
7064 is not an initialization expression, the object is initialized by
7065 default. When an object is initialized by default, any per-object
7066 constraints (see *note 3.8::) are elaborated and any implicit
7067 initial values for the object or for its subcomponents are obtained
7068 as determined by the nominal subtype. Any initial values (whether
7069 explicit or implicit) are assigned to the object or to the
7070 corresponding subcomponents. As described in *note 5.2:: and *note
7071 7.6::, Initialize and Adjust procedures can be called.
7072
7073 18.a
7074 Discussion: For a per-object constraint that contains some
7075 per-object expressions and some non-per-object expressions,
7076 the values used for the constraint consist of the values of
7077 the non-per-object expressions evaluated at the point of the
7078 type_declaration, and the values of the per-object expressions
7079 evaluated at the point of the creation of the object.
7080
7081 18.b
7082 The elaboration of per-object constraints was presumably
7083 performed as part of the dependent compatibility check in Ada
7084 83. If the object is of a limited type with an access
7085 discriminant, the access_definition is elaborated at this time
7086 (see *note 3.7::).
7087
7088 18.c
7089 Reason: The reason we say that evaluating an explicit
7090 initialization expression happens before creating the object
7091 is that in some cases it is impossible to know the size of the
7092 object being created until its initial value is known, as in
7093 "X: String := Func_Call(...);". The implementation can create
7094 the object early in the common case where the size can be
7095 known early, since this optimization is semantically neutral.
7096
7097 19/2
7098 This paragraph was deleted.{AI95-00373-01AI95-00373-01}
7099
7100 19.a
7101 Ramification: Since the initial values have already been
7102 converted to the appropriate nominal subtype, the only
7103 Constraint_Errors that might occur as part of these
7104 assignments are for values outside their base range that are
7105 used to initialize unconstrained numeric subcomponents. See
7106 *note 3.5::.
7107
7108 20/2
7109 {AI95-00373-01AI95-00373-01} For the third step above, evaluations and
7110 assignments are performed in an arbitrary order subject to the following
7111 restrictions:
7112
7113 20.1/2
7114 * {AI95-00373-01AI95-00373-01} Assignment to any part of the object
7115 is preceded by the evaluation of the value that is to be assigned.
7116
7117 20.a.1/2
7118 Reason: Duh. But we ought to say it. Note that, like any
7119 rule in the International Standard, it doesn't prevent an
7120 "as-if" optimization; as long as the semantics as observed
7121 from the program are correct, the compiler can generate any
7122 code it wants.
7123
7124 20.2/2
7125 * {AI95-00373-01AI95-00373-01} The evaluation of a default_expression
7126 that includes the name of a discriminant is preceded by the
7127 assignment to that discriminant.
7128
7129 20.a.2/2
7130 Reason: Duh again. But we have to say this, too. It's odd
7131 that Ada 95 only required the default expressions to be
7132 evaluated before the discriminant is used; it says nothing
7133 about discriminant values that come from subtype_indications.
7134
7135 20.3/2
7136 * {AI95-00373-01AI95-00373-01} The evaluation of the
7137 default_expression for any component that depends on a discriminant
7138 is preceded by the assignment to that discriminant.
7139
7140 20.a
7141 Reason: For example:
7142
7143 20.b
7144 type R(D : Integer := F) is
7145 record
7146 S : String(1..D) := (others => G);
7147 end record;
7148
7149 20.c
7150 X : R;
7151
7152 20.d
7153 For the elaboration of the declaration of X, it is important
7154 that F be evaluated before the aggregate.
7155
7156 20.4/3
7157 * {AI95-00373-01AI95-00373-01} {AI05-0092-1AI05-0092-1} The
7158 assignments to any components, including implicit components, not
7159 requiring late initialization precede the initial value evaluations
7160 for any components requiring late initialization; if two components
7161 both require late initialization, then assignments to parts of the
7162 component occurring earlier in the order of the component
7163 declarations precede the initial value evaluations of the component
7164 occurring later.
7165
7166 20.e/2
7167 Reason: Components that require late initialization can refer
7168 to the entire object during their initialization. We want
7169 them to be initialized as late as possible to reduce the
7170 chance that their initialization depends on uninitialized
7171 components. For instance:
7172
7173 20.f/2
7174 type T (D : Natural) is
7175 limited record
7176 C1 : T1 (T'Access);
7177 C2 : Natural := F (D);
7178 C3 : String (1 .. D) := (others => ' ');
7179 end record;
7180
7181 20.g/2
7182 Component C1 requires late initialization. The initialization
7183 could depend on the values of any component of T, including D,
7184 C2, or C3. Therefore, we want to it to be initialized last.
7185 Note that C2 and C3 do not require late initialization; they
7186 only have to be initialized after D.
7187
7188 20.h/2
7189 It is possible for there to be more than one component that
7190 requires late initialization. In this case, the language
7191 can't prevent problems, because all of the components can't be
7192 the last one initialized. In this case, we specify the order
7193 of initialization for components requiring late
7194 initialization; by doing so, programmers can arrange their
7195 code to avoid accessing uninitialized components, and such
7196 arrangements are portable. Note that if the program accesses
7197 an uninitialized component, *note 13.9.1:: defines the
7198 execution to be erroneous.
7199
7200 21/3
7201 {AI05-0228-1AI05-0228-1} [There is no implicit initial value defined for
7202 a scalar subtype unless the Default_Value aspect has been specified for
7203 the type.] In the absence of an explicit initialization or the
7204 specification of the Default_Value aspect, a newly created scalar object
7205 might have a value that does not belong to its subtype (see *note
7206 13.9.1:: and *note H.1::).
7207
7208 21.a
7209 To be honest: It could even be represented by a bit pattern
7210 that doesn't actually represent any value of the type at all,
7211 such as an invalid internal code for an enumeration type, or a
7212 NaN for a floating point type. It is a generally a bounded
7213 error to reference scalar objects with such "invalid
7214 representations", as explained in *note 13.9.1::, "*note
7215 13.9.1:: Data Validity".
7216
7217 21.b
7218 Ramification: There is no requirement that two objects of the
7219 same scalar subtype have the same implicit initial "value" (or
7220 representation). It might even be the case that two
7221 elaborations of the same object_declaration produce two
7222 different initial values. However, any particular
7223 uninitialized object is default-initialized to a single value
7224 (or invalid representation). Thus, multiple reads of such an
7225 uninitialized object will produce the same value each time (if
7226 the implementation chooses not to detect the error).
7227
7228 NOTES
7229
7230 22
7231 10 Implicit initial values are not defined for an indefinite
7232 subtype, because if an object's nominal subtype is indefinite, an
7233 explicit initial value is required.
7234
7235 23/3
7236 11 {AI05-0092-1AI05-0092-1} {AI05-0255-1AI05-0255-1} As indicated
7237 above, a stand-alone object is an object declared by an
7238 object_declaration. Similar definitions apply to "stand-alone
7239 constant" and "stand-alone variable." A subcomponent of an object
7240 is not a stand-alone object, nor is an object that is created by an
7241 allocator. An object declared by a loop_parameter_specification,
7242 iterator_specification, parameter_specification,
7243 entry_index_specification, choice_parameter_specification,
7244 extended_return_statement, or a formal_object_declaration of mode
7245 in out is not considered a stand-alone object.
7246
7247 24
7248 12 The type of a stand-alone object cannot be abstract (see *note
7249 3.9.3::).
7250
7251 _Examples_
7252
7253 25
7254 Example of a multiple object declaration:
7255
7256 26
7257 -- the multiple object declaration
7258
7259 27/2
7260 {AI95-00433-01AI95-00433-01} John, Paul : not null Person_Name := new Person(Sex => M); -- see *note 3.10.1::
7261
7262 28
7263 -- is equivalent to the two single object declarations in the order given
7264
7265 29/2
7266 {AI95-00433-01AI95-00433-01} John : not null Person_Name := new Person(Sex => M);
7267 Paul : not null Person_Name := new Person(Sex => M);
7268
7269 30
7270 Examples of variable declarations:
7271
7272 31/2
7273 {AI95-00433-01AI95-00433-01} Count, Sum : Integer;
7274 Size : Integer range 0 .. 10_000 := 0;
7275 Sorted : Boolean := False;
7276 Color_Table : array(1 .. Max) of Color;
7277 Option : Bit_Vector(1 .. 10) := (others => True);
7278 Hello : aliased String := "Hi, world.";
7279 [Unicode 952], [Unicode 966] : Float range -PI .. +PI;
7280
7281 32
7282 Examples of constant declarations:
7283
7284 33/2
7285 {AI95-00433-01AI95-00433-01} Limit : constant Integer := 10_000;
7286 Low_Limit : constant Integer := Limit/10;
7287 Tolerance : constant Real := Dispersion(1.15);
7288 Hello_Msg : constant access String := Hello'Access; -- see *note 3.10.2::
7289
7290 _Extensions to Ada 83_
7291
7292 33.a
7293 The syntax rule for object_declaration is modified to allow
7294 the aliased reserved word.
7295
7296 33.b
7297 A variable declared by an object_declaration can be
7298 constrained by its initial value; that is, a variable of a
7299 nominally unconstrained array subtype, or discriminated type
7300 without defaults, can be declared so long as it has an
7301 explicit initial value. In Ada 83, this was permitted for
7302 constants, and for variables created by allocators, but not
7303 for variables declared by object_declarations. This is
7304 particularly important for tagged class-wide types, since
7305 there is no way to constrain them explicitly, and so an
7306 initial value is the only way to provide a constraint. It is
7307 also important for generic formal private types with unknown
7308 discriminants.
7309
7310 33.c
7311 We now allow an unconstrained_array_definition in an
7312 object_declaration. This allows an object of an anonymous
7313 array type to have its bounds determined by its initial value.
7314 This is for uniformity: If one can write "X: constant
7315 array(Integer range 1..10) of Integer := ...;" then it makes
7316 sense to also allow "X: constant array(Integer range <>) of
7317 Integer := ...;". (Note that if anonymous array types are
7318 ever sensible, a common situation is for a table implemented
7319 as an array. Tables are often constant, and for constants,
7320 there's usually no point in forcing the user to count the
7321 number of elements in the value.)
7322
7323 _Wording Changes from Ada 83_
7324
7325 33.d
7326 We have moved the syntax for object_declarations into this
7327 subclause.
7328
7329 33.e
7330 Deferred constants no longer have a separate syntax rule, but
7331 rather are incorporated in object_declaration as constants
7332 declared without an initialization expression.
7333
7334 _Inconsistencies With Ada 95_
7335
7336 33.f/2
7337 {AI95-00363-01AI95-00363-01} Unconstrained aliased objects of
7338 types with discriminants with defaults are no longer
7339 constrained by their initial values. This means that a
7340 program that raised Constraint_Error from an attempt to change
7341 the discriminants will no longer do so. The change only
7342 affects programs that depended on the raising of
7343 Constraint_Error in this case, so the inconsistency is
7344 unlikely to occur outside of the ACATS. This change may
7345 however cause compilers to implement these objects
7346 differently, possibly taking additional memory or time. This
7347 is unlikely to be worse than the differences caused by any
7348 major compiler upgrade.
7349
7350 _Extensions to Ada 95_
7351
7352 33.g/2
7353 {AI95-00287-01AI95-00287-01} A constant may have a limited
7354 type; the initialization expression has to be built-in-place
7355 (see *note 7.5::).
7356
7357 33.h/2
7358 {AI95-00385-01AI95-00385-01} {AI95-00406-01AI95-00406-01} A
7359 stand-alone object may have an anonymous access type.
7360
7361 _Wording Changes from Ada 95_
7362
7363 33.i/2
7364 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
7365 Corrected wording to say that per-object constraints are
7366 elaborated (not evaluated).
7367
7368 33.j/2
7369 {AI95-00373-01AI95-00373-01} The rules for evaluating default
7370 initialization have been tightened. In particular, components
7371 whose default initialization can refer to the rest of the
7372 object are required to be initialized last.
7373
7374 33.k/2
7375 {AI95-00433-01AI95-00433-01} Added examples of various new
7376 constructs.
7377
7378 _Extensions to Ada 2005_
7379
7380 33.l/3
7381 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
7382 be used in an object_declaration. This is described in *note
7383 13.1.1::.
7384
7385 _Wording Changes from Ada 2005_
7386
7387 33.m/3
7388 {AI05-0228-1AI05-0228-1} Implicit initial values can now be
7389 given for scalar types and for scalar array components, using
7390 the Default_Value (see *note 3.5::) and
7391 Default_Component_Value (see *note 3.6::) aspects; the
7392 extension is documented there.
7393
7394 \1f
7395 File: aarm2012.info, Node: 3.3.2, Prev: 3.3.1, Up: 3.3
7396
7397 3.3.2 Number Declarations
7398 -------------------------
7399
7400 1
7401 A number_declaration declares a named number.
7402
7403 1.a/3
7404 Discussion: {AI05-0299-1AI05-0299-1} If a value or other
7405 property of a construct is required to be static that means it
7406 is required to be determined prior to execution. A static
7407 expression is an expression whose value is computed at compile
7408 time and is usable in contexts where the actual value might
7409 affect the legality of the construct. This is fully defined
7410 in subclause *note 4.9::.
7411
7412 _Syntax_
7413
7414 2
7415 number_declaration ::=
7416 defining_identifier_list : constant := static_expression;
7417
7418 _Name Resolution Rules_
7419
7420 3
7421 The static_expression given for a number_declaration is expected to be
7422 of any numeric type.
7423
7424 _Legality Rules_
7425
7426 4/3
7427 {AI05-0299-1AI05-0299-1} The static_expression given for a number
7428 declaration shall be a static expression, as defined by subclause *note
7429 4.9::.
7430
7431 _Static Semantics_
7432
7433 5
7434 The named number denotes a value of type universal_integer if the type
7435 of the static_expression is an integer type. The named number denotes a
7436 value of type universal_real if the type of the static_expression is a
7437 real type.
7438
7439 6
7440 The value denoted by the named number is the value of the
7441 static_expression, converted to the corresponding universal type.
7442
7443 _Dynamic Semantics_
7444
7445 7
7446 The elaboration of a number_declaration has no effect.
7447
7448 7.a
7449 Proof: Since the static_expression was evaluated at compile
7450 time.
7451
7452 _Examples_
7453
7454 8
7455 Examples of number declarations:
7456
7457 9
7458 Two_Pi : constant := 2.0*Ada.Numerics.Pi; -- a real number (see *note A.5::)
7459
7460 10/2
7461 {AI95-00433-01AI95-00433-01} Max : constant := 500; -- an integer number
7462 Max_Line_Size : constant := Max/6; -- the integer 83
7463 Power_16 : constant := 2**16; -- the integer 65_536
7464 One, Un, Eins : constant := 1; -- three different names for 1
7465
7466 _Extensions to Ada 83_
7467
7468 10.a
7469 We now allow a static expression of any numeric type to
7470 initialize a named number. For integer types, it was possible
7471 in Ada 83 to use 'Pos to define a named number, but there was
7472 no way to use a static expression of some nonuniversal real
7473 type to define a named number. This change is upward
7474 compatible because of the preference rule for the operators of
7475 the root numeric types.
7476
7477 _Wording Changes from Ada 83_
7478
7479 10.b
7480 We have moved the syntax rule into this subclause.
7481
7482 10.c
7483 AI83-00263 describes the elaboration of a number declaration
7484 in words similar to that of an object_declaration. However,
7485 since there is no expression to be evaluated and no object to
7486 be created, it seems simpler to say that the elaboration has
7487 no effect.
7488
7489 \1f
7490 File: aarm2012.info, Node: 3.4, Next: 3.5, Prev: 3.3, Up: 3
7491
7492 3.4 Derived Types and Classes
7493 =============================
7494
7495 1/2
7496 {AI95-00401-01AI95-00401-01} {AI95-00419-01AI95-00419-01} A
7497 derived_type_definition defines a derived type (and its first subtype)
7498 whose characteristics are derived from those of a parent type, and
7499 possibly from progenitor types.
7500
7501 1.a/2
7502 Glossary entry: A derived type is a type defined in terms of
7503 one or more other types given in a derived type definition.
7504 The first of those types is the parent type of the derived
7505 type and any others are progenitor types. Each class
7506 containing the parent type or a progenitor type also contains
7507 the derived type. The derived type inherits properties such
7508 as components and primitive operations from the parent and
7509 progenitors. A type together with the types derived from it
7510 (directly or indirectly) form a derivation class.
7511
7512 1.1/2
7513 {AI95-00442-01AI95-00442-01} A class of types is a set of types that is
7514 closed under derivation; that is, if the parent or a progenitor type of
7515 a derived type belongs to a class, then so does the derived type. By
7516 saying that a particular group of types forms a class, we are saying
7517 that all derivatives of a type in the set inherit the characteristics
7518 that define that set. The more general term category of types is used
7519 for a set of types whose defining characteristics are not necessarily
7520 inherited by derivatives; for example, limited, abstract, and interface
7521 are all categories of types, but not classes of types.
7522
7523 1.b/2
7524 Ramification: A class of types is also a category of types.
7525
7526 _Syntax_
7527
7528 2/2
7529 {AI95-00251-01AI95-00251-01} {AI95-00419-01AI95-00419-01}
7530 derived_type_definition ::=
7531 [abstract] [limited] new parent_subtype_indication [[and
7532 interface_list] record_extension_part]
7533
7534 _Legality Rules_
7535
7536 3/2
7537 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01}
7538 {AI95-00419-01AI95-00419-01} The parent_subtype_indication defines the
7539 parent subtype; its type is the parent type. The interface_list defines
7540 the progenitor types (see *note 3.9.4::). A derived type has one parent
7541 type and zero or more progenitor types.
7542
7543 3.a/2
7544 Glossary entry: The parent of a derived type is the first type
7545 given in the definition of the derived type. The parent can
7546 be almost any kind of type, including an interface type.
7547
7548 4
7549 A type shall be completely defined (see *note 3.11.1::) prior to being
7550 specified as the parent type in a derived_type_definition -- [the
7551 full_type_declarations for the parent type and any of its subcomponents
7552 have to precede the derived_type_definition.]
7553
7554 4.a
7555 Discussion: This restriction does not apply to the ancestor
7556 type of a private extension -- see *note 7.3::; such a type
7557 need not be completely defined prior to the
7558 private_extension_declaration. However, the restriction does
7559 apply to record extensions, so the ancestor type will have to
7560 be completely defined prior to the full_type_declaration
7561 corresponding to the private_extension_declaration.
7562
7563 4.b
7564 Reason: We originally hoped we could relax this restriction.
7565 However, we found it too complex to specify the rules for a
7566 type derived from an incompletely defined limited type that
7567 subsequently became nonlimited.
7568
7569 5/2
7570 {AI95-00401-01AI95-00401-01} If there is a record_extension_part, the
7571 derived type is called a record extension of the parent type. A
7572 record_extension_part shall be provided if and only if the parent type
7573 is a tagged type. [An interface_list shall be provided only if the
7574 parent type is a tagged type.]
7575
7576 5.a.1/2
7577 Proof: {AI95-00401-01AI95-00401-01} The syntax only allows an
7578 interface_list to appear with a record_extension_part, and a
7579 record_extension_part can only be provided if the parent type
7580 is a tagged type. We give the last sentence anyway for
7581 completeness.
7582
7583 5.a
7584 Implementation Note: We allow a record extension to inherit
7585 discriminants; an early version of Ada 9X did not. If the
7586 parent subtype is unconstrained, it can be implemented as
7587 though its discriminants were repeated in a new
7588 known_discriminant_part and then used to constrain the old
7589 ones one-for-one. However, in an extension aggregate, the
7590 discriminants in this case do not appear in the component
7591 association list.
7592
7593 5.b/2
7594 Ramification: {AI95-00114-01AI95-00114-01} This rule needs to
7595 be rechecked in the visible part of an instance of a generic
7596 unit because of the "only if" part of the rule. For example:
7597
7598 5.c/2
7599 generic
7600 type T is private;
7601 package P is
7602 type Der is new T;
7603 end P;
7604
7605 5.d/2
7606 package I is new P (Some_Tagged_Type); -- illegal
7607
7608 5.e/2
7609 {AI95-00114-01AI95-00114-01} The instantiation is illegal
7610 because a tagged type is being extended in the visible part
7611 without a record_extension_part. Note that this is legal in
7612 the private part or body of an instance, both to avoid a
7613 contract model violation, and because no code that can see
7614 that the type is actually tagged can also see the derived type
7615 declaration.
7616
7617 5.f/2
7618 No recheck is needed for derived types with a
7619 record_extension_part, as that has to be derived from
7620 something that is known to be tagged (otherwise the template
7621 is illegal).
7622
7623 5.1/3
7624 {AI95-00419-01AI95-00419-01} {AI05-0096-1AI05-0096-1} If the reserved
7625 word limited appears in a derived_type_definition, the parent type shall
7626 be a limited type. If the parent type is a tagged formal type, then in
7627 addition to the places where Legality Rules normally apply (see *note
7628 12.3::), this rule applies also in the private part of an instance of a
7629 generic unit.
7630
7631 5.g/2
7632 Reason: We allow limited because we don't inherit limitedness
7633 from interfaces, so we must have a way to derive a limited
7634 type from interfaces. The word limited has to be legal when
7635 the parent could be an interface, and that includes generic
7636 formal abstract types. Since we have to allow it in this
7637 case, we might as well allow it everywhere as documentation,
7638 to make it explicit that the type is limited.
7639
7640 5.h/2
7641 However, we do not want to allow limited when the parent is
7642 nonlimited: limitedness cannot change in a derivation tree.
7643
7644 5.i/3
7645 If the parent type is an untagged limited formal type with an
7646 actual type that is nonlimited, we allow derivation as a
7647 limited type in the private part or body as no place could
7648 have visibility on the resulting type where it was known to be
7649 nonlimited (outside of the instance). (See the previous
7650 paragraph's annotations for an explanation of this.) However,
7651 if the parent type is a tagged limited formal type with an
7652 actual type that is nonlimited, it would be possible to pass a
7653 value of the limited type extension to a class-wide type of
7654 the parent, which would be nonlimited. That's too weird to
7655 allow (even though all of the extension components would have
7656 to be nonlimited because the rules of *note 3.9.1:: are
7657 rechecked), so we have a special rule to prevent that in the
7658 private part (type extension from a formal type is illegal in
7659 a generic package body).
7660
7661 _Static Semantics_
7662
7663 6
7664 The first subtype of the derived type is unconstrained if a
7665 known_discriminant_part is provided in the declaration of the derived
7666 type, or if the parent subtype is unconstrained. Otherwise, the
7667 constraint of the first subtype corresponds to that of the parent
7668 subtype in the following sense: it is the same as that of the parent
7669 subtype except that for a range constraint (implicit or explicit), the
7670 value of each bound of its range is replaced by the corresponding value
7671 of the derived type.
7672
7673 6.a
7674 Discussion: A digits_constraint in a subtype_indication for a
7675 decimal fixed point subtype always imposes a range constraint,
7676 implicitly if there is no explicit one given. See *note
7677 3.5.9::, "*note 3.5.9:: Fixed Point Types".
7678
7679 6.1/2
7680 {AI95-00231-01AI95-00231-01} The first subtype of the derived type
7681 excludes null (see *note 3.10::) if and only if the parent subtype
7682 excludes null.
7683
7684 7/3
7685 {AI05-0110-1AI05-0110-1} The characteristics and implicitly declared
7686 primitive subprograms of the derived type are defined as follows:
7687
7688 7.a/3
7689 Ramification: {AI05-0110-1AI05-0110-1} The characteristics of
7690 a type do not include its primitive subprograms (primitive
7691 subprograms include predefined operators). The rules
7692 governing availability/visibility and inheritance of
7693 characteristics are separate from those for primitive
7694 subprograms.
7695
7696 8/2
7697 * {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01}
7698 {AI95-00442-01AI95-00442-01} [If the parent type or a progenitor
7699 type belongs to a class of types, then the derived type also
7700 belongs to that class.] The following sets of types, as well as
7701 any higher-level sets composed from them, are classes in this
7702 sense[, and hence the characteristics defining these classes are
7703 inherited by derived types from their parent or progenitor types]:
7704 signed integer, modular integer, ordinary fixed, decimal fixed,
7705 floating point, enumeration, boolean, character,
7706 access-to-constant, general access-to-variable, pool-specific
7707 access-to-variable, access-to-subprogram, array, string, non-array
7708 composite, nonlimited, untagged record, tagged, task, protected,
7709 and synchronized tagged.
7710
7711 8.a
7712 Discussion: This is inherent in our notion of a "class" of
7713 types. It is not mentioned in the initial definition of
7714 "class" since at that point type derivation has not been
7715 defined. In any case, this rule ensures that every class of
7716 types is closed under derivation.
7717
7718 9
7719 * If the parent type is an elementary type or an array type, then the
7720 set of possible values of the derived type is a copy of the set of
7721 possible values of the parent type. For a scalar type, the base
7722 range of the derived type is the same as that of the parent type.
7723
7724 9.a
7725 Discussion: The base range of a type defined by an
7726 integer_type_definition or a real_type_definition is
7727 determined by the _definition, and is not necessarily the same
7728 as that of the corresponding root numeric type from which the
7729 newly defined type is implicitly derived. Treating numerics
7730 types as implicitly derived from one of the two root numeric
7731 types is simply to link them into a type hierarchy; such an
7732 implicit derivation does not follow all the rules given here
7733 for an explicit derived_type_definition.
7734
7735 10
7736 * If the parent type is a composite type other than an array type,
7737 then the components, protected subprograms, and entries that are
7738 declared for the derived type are as follows:
7739
7740 11
7741 * The discriminants specified by a new
7742 known_discriminant_part, if there is one; otherwise, each
7743 discriminant of the parent type (implicitly declared in
7744 the same order with the same specifications) -- in the
7745 latter case, the discriminants are said to be inherited,
7746 or if unknown in the parent, are also unknown in the
7747 derived type;
7748
7749 12
7750 * Each nondiscriminant component, entry, and protected
7751 subprogram of the parent type, implicitly declared in the
7752 same order with the same declarations; these components,
7753 entries, and protected subprograms are said to be
7754 inherited;
7755
7756 12.a
7757 Ramification: The profiles of entries and protected
7758 subprograms do not change upon type derivation, although the
7759 type of the "implicit" parameter identified by the prefix of
7760 the name in a call does.
7761
7762 12.b
7763 To be honest: Any name in the parent type_declaration that
7764 denotes the current instance of the type is replaced with a
7765 name denoting the current instance of the derived type,
7766 converted to the parent type.
7767
7768 13
7769 * Each component declared in a record_extension_part, if
7770 any.
7771
7772 14
7773 Declarations of components, protected subprograms, and entries,
7774 whether implicit or explicit, occur immediately within the
7775 declarative region of the type, in the order indicated above,
7776 following the parent subtype_indication.
7777
7778 14.a
7779 Discussion: The order of declarations within the region
7780 matters for record_aggregates and extension_aggregates.
7781
7782 14.b
7783 Ramification: In most cases, these things are implicitly
7784 declared immediately following the parent subtype_indication.
7785 However, *note 7.3.1::, "*note 7.3.1:: Private Operations"
7786 defines some cases in which they are implicitly declared
7787 later, and some cases in which the are not declared at all.
7788
7789 14.c
7790 Discussion: The place of the implicit declarations of
7791 inherited components matters for visibility -- they are not
7792 visible in the known_discriminant_part nor in the parent
7793 subtype_indication, but are usually visible within the
7794 record_extension_part, if any (although there are restrictions
7795 on their use). Note that a discriminant specified in a new
7796 known_discriminant_part is not considered "inherited" even if
7797 it has the same name and subtype as a discriminant of the
7798 parent type.
7799
7800 15/2
7801 * This paragraph was deleted.{AI95-00419-01AI95-00419-01}
7802
7803 16
7804 * [For each predefined operator of the parent type, there is a
7805 corresponding predefined operator of the derived type.]
7806
7807 16.a
7808 Proof: This is a ramification of the fact that each class that
7809 includes the parent type also includes the derived type, and
7810 the fact that the set of predefined operators that is defined
7811 for a type, as described in *note 4.5::, is determined by the
7812 classes to which it belongs.
7813
7814 16.b
7815 Reason: Predefined operators are handled separately because
7816 they follow a slightly different rule than user-defined
7817 primitive subprograms. In particular the systematic
7818 replacement described below does not apply fully to the
7819 relational operators for Boolean and the exponentiation
7820 operator for Integer. The relational operators for a type
7821 derived from Boolean still return Standard.Boolean. The
7822 exponentiation operator for a type derived from Integer still
7823 expects Standard.Integer for the right operand. In addition,
7824 predefined operators "reemerge" when a type is the actual type
7825 corresponding to a generic formal type, so they need to be
7826 well defined even if hidden by user-defined primitive
7827 subprograms.
7828
7829 17/2
7830 * {AI95-00401-01AI95-00401-01} For each user-defined primitive
7831 subprogram (other than a user-defined equality operator -- see
7832 below) of the parent type or of a progenitor type that already
7833 exists at the place of the derived_type_definition, there exists a
7834 corresponding inherited primitive subprogram of the derived type
7835 with the same defining name. Primitive user-defined equality
7836 operators of the parent type and any progenitor types are also
7837 inherited by the derived type, except when the derived type is a
7838 nonlimited record extension, and the inherited operator would have
7839 a profile that is type conformant with the profile of the
7840 corresponding predefined equality operator; in this case, the
7841 user-defined equality operator is not inherited, but is rather
7842 incorporated into the implementation of the predefined equality
7843 operator of the record extension (see *note 4.5.2::).
7844
7845 17.a
7846 Ramification: We say "...already exists..." rather than "is
7847 visible" or "has been declared" because there are certain
7848 operations that are declared later, but still exist at the
7849 place of the derived_type_definition, and there are operations
7850 that are never declared, but still exist. These cases are
7851 explained in *note 7.3.1::.
7852
7853 17.b
7854 Note that nonprivate extensions can appear only after the last
7855 primitive subprogram of the parent -- the freezing rules
7856 ensure this.
7857
7858 17.c
7859 Reason: A special case is made for the equality operators on
7860 nonlimited record extensions because their predefined equality
7861 operators are already defined in terms of the primitive
7862 equality operator of their parent type (and of the tagged
7863 components of the extension part). Inheriting the parent's
7864 equality operator as is would be undesirable, because it would
7865 ignore any components of the extension part. On the other
7866 hand, if the parent type is limited, then any user-defined
7867 equality operator is inherited as is, since there is no
7868 predefined equality operator to take its place.
7869
7870 17.d/2
7871 Ramification: {AI95-00114-01AI95-00114-01} Because
7872 user-defined equality operators are not inherited by
7873 nonlimited record extensions, the formal parameter names of =
7874 and /= revert to Left and Right, even if different formal
7875 parameter names were used in the user-defined equality
7876 operators of the parent type.
7877
7878 17.e/2
7879 Discussion: {AI95-00401-01AI95-00401-01} This rule only
7880 describes what operations are inherited; the rules that
7881 describe what happens when there are conflicting inherited
7882 subprograms are found in *note 8.3::.
7883
7884 18/3
7885 {AI95-00401-01AI95-00401-01} {AI05-0164-1AI05-0164-1}
7886 {AI05-0240-1AI05-0240-1} The profile of an inherited subprogram
7887 (including an inherited enumeration literal) is obtained from the
7888 profile of the corresponding (user-defined) primitive subprogram of
7889 the parent or progenitor type, after systematic replacement of each
7890 subtype of its profile (see *note 6.1::) that is of the parent or
7891 progenitor type, other than those subtypes found in the designated
7892 profile of an access_definition, with a corresponding subtype of
7893 the derived type. For a given subtype of the parent or progenitor
7894 type, the corresponding subtype of the derived type is defined as
7895 follows:
7896
7897 19
7898 * If the declaration of the derived type has neither a
7899 known_discriminant_part nor a record_extension_part, then
7900 the corresponding subtype has a constraint that
7901 corresponds (as defined above for the first subtype of
7902 the derived type) to that of the given subtype.
7903
7904 20
7905 * If the derived type is a record extension, then the
7906 corresponding subtype is the first subtype of the derived
7907 type.
7908
7909 21
7910 * If the derived type has a new known_discriminant_part but
7911 is not a record extension, then the corresponding subtype
7912 is constrained to those values that when converted to the
7913 parent type belong to the given subtype (see *note
7914 4.6::).
7915
7916 21.a
7917 Reason: An inherited subprogram of an untagged type has an
7918 Intrinsic calling convention, which precludes the use of the
7919 Access attribute. We preclude 'Access because correctly
7920 performing all required constraint checks on an indirect call
7921 to such an inherited subprogram was felt to impose an
7922 undesirable implementation burden.
7923
7924 21.b/3
7925 {AI05-0164-1AI05-0164-1} Note that the exception to
7926 substitution of the parent or progenitor type applies only in
7927 the profiles of anonymous access-to-subprogram types. The
7928 exception is necessary to avoid calling an
7929 access-to-subprogram with types and/or constraints different
7930 than expected by the actual routine.
7931
7932 22/2
7933 {AI95-00401-01AI95-00401-01} The same formal parameters have
7934 default_expressions in the profile of the inherited subprogram.
7935 [Any type mismatch due to the systematic replacement of the parent
7936 or progenitor type by the derived type is handled as part of the
7937 normal type conversion associated with parameter passing -- see
7938 *note 6.4.1::.]
7939
7940 22.a/2
7941 Reason: {AI95-00401-01AI95-00401-01} We don't introduce the
7942 type conversion explicitly here since conversions to record
7943 extensions or on access parameters are not generally legal.
7944 Furthermore, any type conversion would just be "undone" since
7945 the subprogram of the parent or progenitor is ultimately being
7946 called anyway. (Null procedures can be inherited from a
7947 progenitor without being overridden, so it is possible to call
7948 subprograms of an interface.)
7949
7950 23/2
7951 {AI95-00401-01AI95-00401-01} If a primitive subprogram of the parent or
7952 progenitor type is visible at the place of the derived_type_definition,
7953 then the corresponding inherited subprogram is implicitly declared
7954 immediately after the derived_type_definition. Otherwise, the inherited
7955 subprogram is implicitly declared later or not at all, as explained in
7956 *note 7.3.1::.
7957
7958 24
7959 A derived type can also be defined by a private_extension_declaration
7960 (*note 7.3: S0194.) (see *note 7.3::) or a
7961 formal_derived_type_definition (*note 12.5.1: S0285.) (see *note
7962 12.5.1::). Such a derived type is a partial view of the corresponding
7963 full or actual type.
7964
7965 25
7966 All numeric types are derived types, in that they are implicitly derived
7967 from a corresponding root numeric type (see *note 3.5.4:: and *note
7968 3.5.6::).
7969
7970 _Dynamic Semantics_
7971
7972 26
7973 The elaboration of a derived_type_definition creates the derived type
7974 and its first subtype, and consists of the elaboration of the
7975 subtype_indication (*note 3.2.2: S0027.) and the record_extension_part
7976 (*note 3.9.1: S0075.), if any. If the subtype_indication (*note 3.2.2:
7977 S0027.) depends on a discriminant, then only those expressions that do
7978 not depend on a discriminant are evaluated.
7979
7980 26.a/2
7981 Discussion: {AI95-00251-01AI95-00251-01} We don't mention the
7982 interface_list, because it does not need elaboration (see
7983 *note 3.9.4::). This is consistent with the handling of
7984 discriminant_parts, which aren't elaborated either.
7985
7986 27/2
7987 {AI95-00391-01AI95-00391-01} {AI95-00401-01AI95-00401-01} For the
7988 execution of a call on an inherited subprogram, a call on the
7989 corresponding primitive subprogram of the parent or progenitor type is
7990 performed; the normal conversion of each actual parameter to the subtype
7991 of the corresponding formal parameter (see *note 6.4.1::) performs any
7992 necessary type conversion as well. If the result type of the inherited
7993 subprogram is the derived type, the result of calling the subprogram of
7994 the parent or progenitor is converted to the derived type, or in the
7995 case of a null extension, extended to the derived type using the
7996 equivalent of an extension_aggregate with the original result as the
7997 ancestor_part and null record as the record_component_association_list.
7998
7999 27.a/2
8000 Discussion: {AI95-00391-01AI95-00391-01} If an inherited
8001 function returns the derived type, and the type is a nonnull
8002 record extension, then the inherited function shall be
8003 overridden, unless the type is abstract (in which case the
8004 function is abstract, and (unless overridden) cannot be called
8005 except via a dispatching call). See *note 3.9.3::.
8006
8007 NOTES
8008
8009 28
8010 13 Classes are closed under derivation -- any class that contains
8011 a type also contains its derivatives. Operations available for a
8012 given class of types are available for the derived types in that
8013 class.
8014
8015 29
8016 14 Evaluating an inherited enumeration literal is equivalent to
8017 evaluating the corresponding enumeration literal of the parent
8018 type, and then converting the result to the derived type. This
8019 follows from their equivalence to parameterless functions.
8020
8021 30
8022 15 A generic subprogram is not a subprogram, and hence cannot be a
8023 primitive subprogram and cannot be inherited by a derived type. On
8024 the other hand, an instance of a generic subprogram can be a
8025 primitive subprogram, and hence can be inherited.
8026
8027 31
8028 16 If the parent type is an access type, then the parent and the
8029 derived type share the same storage pool; there is a null access
8030 value for the derived type and it is the implicit initial value for
8031 the type. See *note 3.10::.
8032
8033 32
8034 17 If the parent type is a boolean type, the predefined relational
8035 operators of the derived type deliver a result of the predefined
8036 type Boolean (see *note 4.5.2::). If the parent type is an integer
8037 type, the right operand of the predefined exponentiation operator
8038 is of the predefined type Integer (see *note 4.5.6::).
8039
8040 33
8041 18 Any discriminants of the parent type are either all inherited,
8042 or completely replaced with a new set of discriminants.
8043
8044 34
8045 19 For an inherited subprogram, the subtype of a formal parameter
8046 of the derived type need not have any value in common with the
8047 first subtype of the derived type.
8048
8049 34.a
8050 Proof: This happens when the parent subtype is constrained to
8051 a range that does not overlap with the range of a subtype of
8052 the parent type that appears in the profile of some primitive
8053 subprogram of the parent type. For example:
8054
8055 34.b
8056 type T1 is range 1..100;
8057 subtype S1 is T1 range 1..10;
8058 procedure P(X : in S1); -- P is a primitive subprogram
8059 type T2 is new T1 range 11..20;
8060 -- implicitly declared:
8061 -- procedure P(X : in T2'Base range 1..10);
8062 -- X cannot be in T2'First .. T2'Last
8063
8064 35
8065 20 If the reserved word abstract is given in the declaration of a
8066 type, the type is abstract (see *note 3.9.3::).
8067
8068 35.1/2
8069 21 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01} An
8070 interface type that has a progenitor type "is derived from" that
8071 type. A derived_type_definition, however, never defines an
8072 interface type.
8073
8074 35.2/2
8075 22 {AI95-00345-01AI95-00345-01} It is illegal for the parent type
8076 of a derived_type_definition to be a synchronized tagged type.
8077
8078 35.a/3
8079 Proof: {AI05-0299-1AI05-0299-1} *note 3.9.1:: prohibits record
8080 extensions whose parent type is a synchronized tagged type,
8081 and this subclause requires tagged types to have a record
8082 extension. Thus there are no legal derivations. Note that a
8083 synchronized interface can be used as a progenitor in an
8084 interface_type_definition as well as in task and protected
8085 types, but we do not allow concrete extensions of any
8086 synchronized tagged type.
8087
8088 _Examples_
8089
8090 36
8091 Examples of derived type declarations:
8092
8093 37
8094 type Local_Coordinate is new Coordinate; -- two different types
8095 type Midweek is new Day range Tue .. Thu; -- see *note 3.5.1::
8096 type Counter is new Positive; -- same range as Positive
8097
8098 38
8099 type Special_Key is new Key_Manager.Key; -- see *note 7.3.1::
8100 -- the inherited subprograms have the following specifications:
8101 -- procedure Get_Key(K : out Special_Key);
8102 -- function "<"(X,Y : Special_Key) return Boolean;
8103
8104 _Inconsistencies With Ada 83_
8105
8106 38.a
8107 When deriving from a (nonprivate, nonderived) type in the same
8108 visible part in which it is defined, if a predefined operator
8109 had been overridden prior to the derivation, the derived type
8110 will inherit the user-defined operator rather than the
8111 predefined operator. The work-around (if the new behavior is
8112 not the desired behavior) is to move the definition of the
8113 derived type prior to the overriding of any predefined
8114 operators.
8115
8116 _Incompatibilities With Ada 83_
8117
8118 38.b
8119 When deriving from a (nonprivate, nonderived) type in the same
8120 visible part in which it is defined, a primitive subprogram of
8121 the parent type declared before the derived type will be
8122 inherited by the derived type. This can cause upward
8123 incompatibilities in cases like this:
8124
8125 38.c
8126 package P is
8127 type T is (A, B, C, D);
8128 function F( X : T := A ) return Integer;
8129 type NT is new T;
8130 -- inherits F as
8131 -- function F( X : NT := A ) return Integer;
8132 -- in Ada 95 only
8133 ...
8134 end P;
8135 ...
8136 use P; -- Only one declaration of F from P is use-visible in
8137 -- Ada 83; two declarations of F are use-visible in
8138 -- Ada 95.
8139 begin
8140 ...
8141 if F > 1 then ... -- legal in Ada 83, ambiguous in Ada 95
8142
8143 _Extensions to Ada 83_
8144
8145 38.d
8146 The syntax for a derived_type_definition is amended to include
8147 an optional record_extension_part (see *note 3.9.1::).
8148
8149 38.e
8150 A derived type may override the discriminants of the parent by
8151 giving a new discriminant_part.
8152
8153 38.f
8154 The parent type in a derived_type_definition may be a derived
8155 type defined in the same visible part.
8156
8157 38.g
8158 When deriving from a type in the same visible part in which it
8159 is defined, the primitive subprograms declared prior to the
8160 derivation are inherited as primitive subprograms of the
8161 derived type. See *note 3.2.3::.
8162
8163 _Wording Changes from Ada 83_
8164
8165 38.h
8166 We now talk about the classes to which a type belongs, rather
8167 than a single class.
8168
8169 _Extensions to Ada 95_
8170
8171 38.i/2
8172 {AI05-0190-1AI05-0190-1} {AI95-00251-01AI95-00251-01}
8173 {AI95-00401-01AI95-00401-01} A derived type may inherit from
8174 multiple (interface) progenitors, as well as the parent type
8175 -- see *note 3.9.4::, "*note 3.9.4:: Interface Types".
8176
8177 38.j/2
8178 {AI95-00419-01AI95-00419-01} A derived type may specify that
8179 it is a limited type. This is required for interface
8180 ancestors (from which limitedness is not inherited), but it is
8181 generally useful as documentation of limitedness.
8182
8183 _Wording Changes from Ada 95_
8184
8185 38.k/2
8186 {AI95-00391-01AI95-00391-01} Defined the result of functions
8187 for null extensions (which we no longer require to be
8188 overridden - see *note 3.9.3::).
8189
8190 38.l/2
8191 {AI95-00442-01AI95-00442-01} Defined the term "category of
8192 types" and used it in wording elsewhere; also specified the
8193 language-defined categories that form classes of types (this
8194 was never normatively specified in Ada 95).
8195
8196 _Incompatibilities With Ada 2005_
8197
8198 38.m/3
8199 {AI05-0096-1AI05-0096-1} Correction: Added a (re)check that
8200 limited type extensions never are derived from nonlimited
8201 types in generic private parts. This is disallowed as it
8202 would make it possible to pass a limited object to a
8203 nonlimited class-wide type, which could then be copied. This
8204 is only possible using Ada 2005 syntax, so examples in
8205 existing programs should be rare.
8206
8207 _Wording Changes from Ada 2005_
8208
8209 38.n/3
8210 {AI05-0110-1AI05-0110-1} Correction: Added wording to clarify
8211 that the characteristics of derived types are formally defined
8212 here. (This is the only place in the Standard that actually
8213 spells out what sorts of things are actually characteristics,
8214 which is rather important.)
8215
8216 38.o/3
8217 {AI05-0164-1AI05-0164-1} Correction: Added wording to ensure
8218 that anonymous access-to-subprogram types don't get modified
8219 on derivation.
8220
8221 * Menu:
8222
8223 * 3.4.1 :: Derivation Classes
8224
8225 \1f
8226 File: aarm2012.info, Node: 3.4.1, Up: 3.4
8227
8228 3.4.1 Derivation Classes
8229 ------------------------
8230
8231 1
8232 In addition to the various language-defined classes of types, types can
8233 be grouped into derivation classes.
8234
8235 _Static Semantics_
8236
8237 2/2
8238 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01} A derived type
8239 is derived from its parent type directly; it is derived indirectly from
8240 any type from which its parent type is derived. A derived type,
8241 interface type, type extension, task type, protected type, or formal
8242 derived type is also derived from every ancestor of each of its
8243 progenitor types, if any. The derivation class of types for a type T
8244 (also called the class rooted at T) is the set consisting of T (the root
8245 type of the class) and all types derived from T (directly or indirectly)
8246 plus any associated universal or class-wide types (defined below).
8247
8248 2.a
8249 Discussion: Note that the definition of "derived from" is a
8250 recursive definition. We don't define a root type for all
8251 interesting language-defined classes, though presumably we
8252 could.
8253
8254 2.b
8255 To be honest: By the class-wide type "associated" with a type
8256 T, we mean the type T'Class. Similarly, the universal type
8257 associated with root_integer, root_real, and root_fixed are
8258 universal_integer, universal_real, and universal_fixed,
8259 respectively.
8260
8261 3/2
8262 {AI95-00230-01AI95-00230-01} Every type is either a specific type, a
8263 class-wide type, or a universal type. A specific type is one defined by
8264 a type_declaration, a formal_type_declaration, or a full type definition
8265 embedded in another construct. Class-wide and universal types are
8266 implicitly defined, to act as representatives for an entire class of
8267 types, as follows:
8268
8269 3.a
8270 To be honest: The root types root_integer, root_real, and
8271 root_fixed are also specific types. They are declared in the
8272 specification of package Standard.
8273
8274 4
8275 Class-wide types
8276 Class-wide types are defined for [(and belong to)] each
8277 derivation class rooted at a tagged type (see *note
8278 3.9::). Given a subtype S of a tagged type T, S'Class is
8279 the subtype_mark for a corresponding subtype of the
8280 tagged class-wide type T'Class. Such types are called
8281 "class-wide" because when a formal parameter is defined
8282 to be of a class-wide type T'Class, an actual parameter
8283 of any type in the derivation class rooted at T is
8284 acceptable (see *note 8.6::).
8285
8286 5
8287 The set of values for a class-wide type T'Class is the
8288 discriminated union of the set of values of each specific
8289 type in the derivation class rooted at T (the tag acts as
8290 the implicit discriminant -- see *note 3.9::).
8291 Class-wide types have no primitive subprograms of their
8292 own. However, as explained in *note 3.9.2::, operands of
8293 a class-wide type T'Class can be used as part of a
8294 dispatching call on a primitive subprogram of the type T.
8295 The only components [(including discriminants)] of
8296 T'Class that are visible are those of T. If S is a first
8297 subtype, then S'Class is a first subtype.
8298
8299 5.a
8300 Reason: We want S'Class to be a first subtype when S is, so
8301 that an attribute_definition_clause (*note 13.3: S0309.) like
8302 "for S'Class'Output use ...;" will be legal.
8303
8304 6/2
8305 {AI95-00230-01AI95-00230-01} Universal types
8306 Universal types are defined for [(and belong to)] the
8307 integer, real, fixed point, and access classes, and are
8308 referred to in this standard as respectively,
8309 universal_integer, universal_real, universal_fixed, and
8310 universal_access. These are analogous to class-wide
8311 types for these language-defined elementary classes. As
8312 with class-wide types, if a formal parameter is of a
8313 universal type, then an actual parameter of any type in
8314 the corresponding class is acceptable. In addition, a
8315 value of a universal type (including an integer or real
8316 numeric_literal, or the literal null) is "universal" in
8317 that it is acceptable where some particular type in the
8318 class is expected (see *note 8.6::).
8319
8320 7
8321 The set of values of a universal type is the
8322 undiscriminated union of the set of values possible for
8323 any definable type in the associated class. Like
8324 class-wide types, universal types have no primitive
8325 subprograms of their own. However, their "universality"
8326 allows them to be used as operands with the primitive
8327 subprograms of any type in the corresponding class.
8328
8329 7.a
8330 Discussion: A class-wide type is only class-wide in one
8331 direction, from specific to class-wide, whereas a universal
8332 type is class-wide (universal) in both directions, from
8333 specific to universal and back.
8334
8335 7.b/2
8336 {AI95-00230-01AI95-00230-01} We considered defining class-wide
8337 or perhaps universal types for all derivation classes, not
8338 just tagged classes and these four elementary classes.
8339 However, this was felt to overly weaken the strong-typing
8340 model in some situations. Tagged types preserve strong type
8341 distinctions thanks to the run-time tag. Class-wide or
8342 universal types for untagged types would weaken the
8343 compile-time type distinctions without providing a
8344 compensating run-time-checkable distinction.
8345
8346 7.c
8347 We considered defining standard names for the universal
8348 numeric types so they could be used in formal parameter
8349 specifications. However, this was felt to impose an undue
8350 implementation burden for some implementations.
8351
8352 7.d
8353 To be honest: Formally, the set of values of a universal type
8354 is actually a copy of the undiscriminated union of the values
8355 of the types in its class. This is because we want each value
8356 to have exactly one type, with explicit or implicit conversion
8357 needed to go between types. An alternative, consistent model
8358 would be to associate a class, rather than a particular type,
8359 with a value, even though any given expression would have a
8360 particular type. In that case, implicit type conversions
8361 would not generally need to change the value, although an
8362 associated subtype conversion might need to.
8363
8364 8
8365 The integer and real numeric classes each have a specific root type in
8366 addition to their universal type, named respectively root_integer and
8367 root_real.
8368
8369 9
8370 A class-wide or universal type is said to cover all of the types in its
8371 class. A specific type covers only itself.
8372
8373 10/2
8374 {AI95-00230-01AI95-00230-01} {AI95-00251-01AI95-00251-01} A specific
8375 type T2 is defined to be a descendant of a type T1 if T2 is the same as
8376 T1, or if T2 is derived (directly or indirectly) from T1. A class-wide
8377 type T2'Class is defined to be a descendant of type T1 if T2 is a
8378 descendant of T1. Similarly, the numeric universal types are defined to
8379 be descendants of the root types of their classes. If a type T2 is a
8380 descendant of a type T1, then T1 is called an ancestor of T2. An
8381 ultimate ancestor of a type is an ancestor of that type that is not
8382 itself a descendant of any other type. Every untagged type has a unique
8383 ultimate ancestor.
8384
8385 10.a
8386 Ramification: A specific type is a descendant of itself.
8387 Class-wide types are considered descendants of the
8388 corresponding specific type, and do not have any descendants
8389 of their own.
8390
8391 10.b
8392 A specific type is an ancestor of itself. The root of a
8393 derivation class is an ancestor of all types in the class,
8394 including any class-wide types in the class.
8395
8396 10.c
8397 Discussion: The terms root, parent, ancestor, and ultimate
8398 ancestor are all related. For example:
8399
8400 10.d/2
8401 * {AI95-00251-01AI95-00251-01} Each type has at most one
8402 parent, and one or more ancestor types; each untagged
8403 type has exactly one ultimate ancestor. In Ada 83, the
8404 term "parent type" was sometimes used more generally to
8405 include any ancestor type (e.g. RM83-9.4(14)). In Ada
8406 95, we restrict parent to mean the immediate ancestor.
8407
8408 10.e
8409 * A class of types has at most one root type; a derivation
8410 class has exactly one root type.
8411
8412 10.f
8413 * The root of a class is an ancestor of all of the types in
8414 the class (including itself).
8415
8416 10.g
8417 * The type root_integer is the root of the integer class,
8418 and is the ultimate ancestor of all integer types. A
8419 similar statement applies to root_real.
8420
8421 10.h/2
8422 Glossary entry: An ancestor of a type is the type itself or,
8423 in the case of a type derived from other types, its parent
8424 type or one of its progenitor types or one of their ancestors.
8425 Note that ancestor and descendant are inverse relationships.
8426
8427 10.i/2
8428 Glossary entry: A type is a descendant of itself, its parent
8429 and progenitor types, and their ancestors. Note that
8430 descendant and ancestor are inverse relationships.
8431
8432 11
8433 An inherited component [(including an inherited discriminant)] of a
8434 derived type is inherited from a given ancestor of the type if the
8435 corresponding component was inherited by each derived type in the chain
8436 of derivations going back to the given ancestor.
8437
8438 NOTES
8439
8440 12
8441 23 Because operands of a universal type are acceptable to the
8442 predefined operators of any type in their class, ambiguity can
8443 result. For universal_integer and universal_real, this potential
8444 ambiguity is resolved by giving a preference (see *note 8.6::) to
8445 the predefined operators of the corresponding root types
8446 (root_integer and root_real, respectively). Hence, in an
8447 apparently ambiguous expression like
8448
8449 13
8450 1 + 4 < 7
8451
8452 14
8453 where each of the literals is of type universal_integer, the
8454 predefined operators of root_integer will be preferred over those
8455 of other specific integer types, thereby resolving the ambiguity.
8456
8457 14.a
8458 Ramification: Except for this preference, a root numeric type
8459 is essentially like any other specific type in the associated
8460 numeric class. In particular, the result of a predefined
8461 operator of a root numeric type is not "universal" (implicitly
8462 convertible) even if both operands were.
8463
8464 _Wording Changes from Ada 95_
8465
8466 14.b/2
8467 {AI95-00230-01AI95-00230-01} Updated the wording to define the
8468 universal_access type. This was defined to make null for
8469 anonymous access types sensible.
8470
8471 14.c/2
8472 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01} The
8473 definitions of ancestors and descendants were updated to allow
8474 multiple ancestors (necessary to support interfaces).
8475
8476 \1f
8477 File: aarm2012.info, Node: 3.5, Next: 3.6, Prev: 3.4, Up: 3
8478
8479 3.5 Scalar Types
8480 ================
8481
8482 1
8483 Scalar types comprise enumeration types, integer types, and real types.
8484 Enumeration types and integer types are called discrete types; each
8485 value of a discrete type has a position number which is an integer
8486 value. Integer types and real types are called numeric types. [All
8487 scalar types are ordered, that is, all relational operators are
8488 predefined for their values.]
8489
8490 _Syntax_
8491
8492 2
8493 range_constraint ::= range range
8494
8495 3
8496 range ::= range_attribute_reference
8497 | simple_expression .. simple_expression
8498
8499 3.a
8500 Discussion: These need to be simple_expressions rather than
8501 more general expressions because ranges appear in membership
8502 tests and other contexts where expression .. expression would
8503 be ambiguous.
8504
8505 4
8506 A range has a lower bound and an upper bound and specifies a subset of
8507 the values of some scalar type (the type of the range). A range with
8508 lower bound L and upper bound R is described by "L .. R". If R is less
8509 than L, then the range is a null range, and specifies an empty set of
8510 values. Otherwise, the range specifies the values of the type from the
8511 lower bound to the upper bound, inclusive. A value belongs to a range
8512 if it is of the type of the range, and is in the subset of values
8513 specified by the range. A value satisfies a range constraint if it
8514 belongs to the associated range. One range is included in another if
8515 all values that belong to the first range also belong to the second.
8516
8517 _Name Resolution Rules_
8518
8519 5
8520 For a subtype_indication containing a range_constraint, either directly
8521 or as part of some other scalar_constraint, the type of the range shall
8522 resolve to that of the type determined by the subtype_mark of the
8523 subtype_indication. For a range of a given type, the simple_expressions
8524 of the range (likewise, the simple_expressions of the equivalent range
8525 for a range_attribute_reference) are expected to be of the type of the
8526 range.
8527
8528 5.a
8529 Discussion: In Ada 95, constraints only appear within
8530 subtype_indications; things that look like constraints that
8531 appear in type declarations are called something else like
8532 real_range_specifications.
8533
8534 5.b/3
8535 {AI05-0299-1AI05-0299-1} We say "the expected type is ..." or
8536 "the type is expected to be ..." depending on which reads
8537 better. They are fundamentally equivalent, and both feed into
8538 the type resolution rules of subclause *note 8.6::.
8539
8540 5.c
8541 In some cases, it doesn't work to use expected types. For
8542 example, in the above rule, we say that the "type of the range
8543 shall resolve to ..." rather than "the expected type for the
8544 range is ...". We then use "expected type" for the bounds.
8545 If we used "expected" at both points, there would be an
8546 ambiguity, since one could apply the rules of *note 8.6::
8547 either on determining the type of the range, or on determining
8548 the types of the individual bounds. It is clearly important
8549 to allow one bound to be of a universal type, and the other of
8550 a specific type, so we need to use "expected type" for the
8551 bounds. Hence, we used "shall resolve to" for the type of the
8552 range as a whole. There are other situations where "expected
8553 type" is not quite right, and we use "shall resolve to"
8554 instead.
8555
8556 _Static Semantics_
8557
8558 6
8559 The base range of a scalar type is the range of finite values of the
8560 type that can be represented in every unconstrained object of the type;
8561 it is also the range supported at a minimum for intermediate values
8562 during the evaluation of expressions involving predefined operators of
8563 the type.
8564
8565 6.a
8566 Implementation Note: Note that in some machine architectures
8567 intermediates in an expression (particularly if static), and
8568 register-resident variables might accommodate a wider range.
8569 The base range does not include the values of this wider range
8570 that are not assignable without overflow to memory-resident
8571 objects.
8572
8573 6.b
8574 Ramification: The base range of an enumeration type is the
8575 range of values of the enumeration type.
8576
8577 6.c
8578 Reason: If the representation supports infinities, the base
8579 range is nevertheless restricted to include only the
8580 representable finite values, so that 'Base'First and
8581 'Base'Last are always guaranteed to be finite.
8582
8583 6.d
8584 To be honest: By a "value that can be assigned without
8585 overflow" we don't mean to restrict ourselves to values that
8586 can be represented exactly. Values between machine
8587 representable values can be assigned, but on subsequent
8588 reading, a slightly different value might be retrieved, as
8589 (partially) determined by the number of digits of precision of
8590 the type.
8591
8592 7
8593 [A constrained scalar subtype is one to which a range constraint
8594 applies.] The range of a constrained scalar subtype is the range
8595 associated with the range constraint of the subtype. The range of an
8596 unconstrained scalar subtype is the base range of its type.
8597
8598 _Dynamic Semantics_
8599
8600 8
8601 A range is compatible with a scalar subtype if and only if it is either
8602 a null range or each bound of the range belongs to the range of the
8603 subtype. A range_constraint is compatible with a scalar subtype if and
8604 only if its range is compatible with the subtype.
8605
8606 8.a
8607 Ramification: Only range_constraints (explicit or implicit)
8608 impose conditions on the values of a scalar subtype. The
8609 other scalar_constraints, digits_constraints and
8610 delta_constraints impose conditions on the subtype denoted by
8611 the subtype_mark in a subtype_indication, but don't impose a
8612 condition on the values of the subtype being defined.
8613 Therefore, a scalar subtype is not called constrained if all
8614 that applies to it is a digits_constraint. Decimal subtypes
8615 are subtle, because a digits_constraint without a
8616 range_constraint nevertheless includes an implicit
8617 range_constraint.
8618
8619 9
8620 The elaboration of a range_constraint consists of the evaluation of the
8621 range. The evaluation of a range determines a lower bound and an upper
8622 bound. If simple_expressions are given to specify bounds, the
8623 evaluation of the range evaluates these simple_expressions in an
8624 arbitrary order, and converts them to the type of the range. If a
8625 range_attribute_reference is given, the evaluation of the range consists
8626 of the evaluation of the range_attribute_reference.
8627
8628 10
8629 Attributes
8630
8631 11
8632 For every scalar subtype S, the following attributes are defined:
8633
8634 12
8635 S'First
8636 S'First denotes the lower bound of the range of S. The
8637 value of this attribute is of the type of S.
8638
8639 12.a
8640 Ramification: Evaluating S'First never raises
8641 Constraint_Error.
8642
8643 13
8644 S'Last
8645 S'Last denotes the upper bound of the range of S. The
8646 value of this attribute is of the type of S.
8647
8648 13.a
8649 Ramification: Evaluating S'Last never raises Constraint_Error.
8650
8651 14
8652 S'Range
8653 S'Range is equivalent to the range S'First .. S'Last.
8654
8655 15
8656 S'Base
8657 S'Base denotes an unconstrained subtype of the type of S.
8658 This unconstrained subtype is called the base subtype of
8659 the type.
8660
8661 16
8662 S'Min
8663 S'Min denotes a function with the following
8664 specification:
8665
8666 17
8667 function S'Min(Left, Right : S'Base)
8668 return S'Base
8669
8670 18
8671 The function returns the lesser of the values of the two
8672 parameters.
8673
8674 18.a
8675 Discussion: The formal parameter names are italicized because
8676 they cannot be used in calls -- see *note 6.4::. Such a
8677 specification cannot be written by the user because an
8678 attribute_reference is not permitted as the designator of a
8679 user-defined function, nor can its formal parameters be
8680 anonymous.
8681
8682 19
8683 S'Max
8684 S'Max denotes a function with the following
8685 specification:
8686
8687 20
8688 function S'Max(Left, Right : S'Base)
8689 return S'Base
8690
8691 21
8692 The function returns the greater of the values of the two
8693 parameters.
8694
8695 22
8696 S'Succ
8697 S'Succ denotes a function with the following
8698 specification:
8699
8700 23
8701 function S'Succ(Arg : S'Base)
8702 return S'Base
8703
8704 24
8705 For an enumeration type, the function returns the value
8706 whose position number is one more than that of the value
8707 of Arg; Constraint_Error is raised if there is no such
8708 value of the type. For an integer type, the function
8709 returns the result of adding one to the value of Arg.
8710 For a fixed point type, the function returns the result
8711 of adding small to the value of Arg. For a floating
8712 point type, the function returns the machine number (as
8713 defined in *note 3.5.7::) immediately above the value of
8714 Arg; Constraint_Error is raised if there is no such
8715 machine number.
8716
8717 24.a
8718 Ramification: S'Succ for a modular integer subtype wraps
8719 around if the value of Arg is S'Base'Last. S'Succ for a
8720 signed integer subtype might raise Constraint_Error if the
8721 value of Arg is S'Base'Last, or it might return the
8722 out-of-base-range value S'Base'Last+1, as is permitted for all
8723 predefined numeric operations.
8724
8725 25
8726 S'Pred
8727 S'Pred denotes a function with the following
8728 specification:
8729
8730 26
8731 function S'Pred(Arg : S'Base)
8732 return S'Base
8733
8734 27
8735 For an enumeration type, the function returns the value
8736 whose position number is one less than that of the value
8737 of Arg; Constraint_Error is raised if there is no such
8738 value of the type. For an integer type, the function
8739 returns the result of subtracting one from the value of
8740 Arg. For a fixed point type, the function returns the
8741 result of subtracting small from the value of Arg. For a
8742 floating point type, the function returns the machine
8743 number (as defined in *note 3.5.7::) immediately below
8744 the value of Arg; Constraint_Error is raised if there is
8745 no such machine number.
8746
8747 27.a
8748 Ramification: S'Pred for a modular integer subtype wraps
8749 around if the value of Arg is S'Base'First. S'Pred for a
8750 signed integer subtype might raise Constraint_Error if the
8751 value of Arg is S'Base'First, or it might return the
8752 out-of-base-range value S'Base'First-1, as is permitted for
8753 all predefined numeric operations.
8754
8755 27.1/2
8756 S'Wide_Wide_Image
8757 {AI95-00285-01AI95-00285-01} S'Wide_Wide_Image denotes a
8758 function with the following specification:
8759
8760 27.2/2
8761 function S'Wide_Wide_Image(Arg : S'Base)
8762 return Wide_Wide_String
8763
8764 27.3/2
8765 The function returns an image of the value of Arg, that
8766 is, a sequence of characters representing the value in
8767 display form. The lower bound of the result is one.
8768
8769 27.4/2
8770 The image of an integer value is the corresponding
8771 decimal literal, without underlines, leading zeros,
8772 exponent, or trailing spaces, but with a single leading
8773 character that is either a minus sign or a space.
8774
8775 27.b/2
8776 Implementation Note: If the machine supports negative zeros
8777 for signed integer types, it is not specified whether " 0" or
8778 "-0" should be returned for negative zero. We don't have
8779 enough experience with such machines to know what is
8780 appropriate, and what other languages do. In any case, the
8781 implementation should be consistent.
8782
8783 27.5/2
8784 The image of an enumeration value is either the
8785 corresponding identifier in upper case or the
8786 corresponding character literal (including the two
8787 apostrophes); neither leading nor trailing spaces are
8788 included. For a nongraphic character (a value of a
8789 character type that has no enumeration literal associated
8790 with it), the result is a corresponding language-defined
8791 name in upper case (for example, the image of the
8792 nongraphic character identified as nul is "NUL" -- the
8793 quotes are not part of the image).
8794
8795 27.c/2
8796 Implementation Note: For an enumeration type T that has
8797 "holes" (caused by an enumeration_representation_clause (*note
8798 13.4: S0310.)), T'Wide_Image should raise Program_Error if the
8799 value is one of the holes (which is a bounded error anyway,
8800 since holes can be generated only via uninitialized variables
8801 and similar things).
8802
8803 27.6/2
8804 The image of a floating point value is a decimal real
8805 literal best approximating the value (rounded away from
8806 zero if halfway between) with a single leading character
8807 that is either a minus sign or a space, a single digit
8808 (that is nonzero unless the value is zero), a decimal
8809 point, S'Digits-1 (see *note 3.5.8::) digits after the
8810 decimal point (but one if S'Digits is one), an upper case
8811 E, the sign of the exponent (either + or -), and two or
8812 more digits (with leading zeros if necessary)
8813 representing the exponent. If S'Signed_Zeros is True,
8814 then the leading character is a minus sign for a
8815 negatively signed zero.
8816
8817 27.d/2
8818 To be honest: Leading zeros are present in the exponent only
8819 if necessary to make the exponent at least two digits.
8820
8821 27.e/2
8822 Reason: This image is intended to conform to that produced by
8823 Text_IO.Float_IO.Put in its default format.
8824
8825 27.f/2
8826 Implementation Note: The rounding direction is specified here
8827 to ensure portability of output results.
8828
8829 27.7/2
8830 The image of a fixed point value is a decimal real
8831 literal best approximating the value (rounded away from
8832 zero if halfway between) with a single leading character
8833 that is either a minus sign or a space, one or more
8834 digits before the decimal point (with no redundant
8835 leading zeros), a decimal point, and S'Aft (see *note
8836 3.5.10::) digits after the decimal point.
8837
8838 27.g/2
8839 Reason: This image is intended to conform to that produced by
8840 Text_IO.Fixed_IO.Put.
8841
8842 27.h/2
8843 Implementation Note: The rounding direction is specified here
8844 to ensure portability of output results.
8845
8846 27.i/2
8847 Implementation Note: For a machine that supports negative
8848 zeros, it is not specified whether " 0.000" or "-0.000" is
8849 returned. See corresponding comment above about integer types
8850 with signed zeros.
8851
8852 28
8853 S'Wide_Image
8854 S'Wide_Image denotes a function with the following
8855 specification:
8856
8857 29
8858 function S'Wide_Image(Arg : S'Base)
8859 return Wide_String
8860
8861 30/3
8862 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1}
8863 {AI05-0264-1AI05-0264-1} The function returns an image of
8864 the value of Arg as a Wide_String. The lower bound of
8865 the result is one. The image has the same sequence of
8866 graphic characters as defined for S'Wide_Wide_Image if
8867 all the graphic characters are defined in Wide_Character;
8868 otherwise, the sequence of characters is implementation
8869 defined (but no shorter than that of S'Wide_Wide_Image
8870 for the same value of Arg).
8871
8872 30.a/2
8873 Implementation defined: The sequence of characters of the
8874 value returned by S'Wide_Image when some of the graphic
8875 characters of S'Wide_Wide_Image are not defined in
8876 Wide_Character.
8877
8878 Paragraphs 31 through 34 were moved to Wide_Wide_Image.
8879
8880 35
8881 S'Image
8882 S'Image denotes a function with the following
8883 specification:
8884
8885 36
8886 function S'Image(Arg : S'Base)
8887 return String
8888
8889 37/3
8890 {AI95-00285-01AI95-00285-01} {AI05-0264-1AI05-0264-1} The
8891 function returns an image of the value of Arg as a
8892 String. The lower bound of the result is one. The image
8893 has the same sequence of graphic characters as that
8894 defined for S'Wide_Wide_Image if all the graphic
8895 characters are defined in Character; otherwise, the
8896 sequence of characters is implementation defined (but no
8897 shorter than that of S'Wide_Wide_Image for the same value
8898 of Arg).
8899
8900 37.a/2
8901 Implementation defined: The sequence of characters of the
8902 value returned by S'Image when some of the graphic characters
8903 of S'Wide_Wide_Image are not defined in Character.
8904
8905 37.1/2
8906 S'Wide_Wide_Width
8907 {AI95-00285-01AI95-00285-01} S'Wide_Wide_Width denotes
8908 the maximum length of a Wide_Wide_String returned by
8909 S'Wide_Wide_Image over all values of the subtype S. It
8910 denotes zero for a subtype that has a null range. Its
8911 type is universal_integer.
8912
8913 38
8914 S'Wide_Width
8915 S'Wide_Width denotes the maximum length of a Wide_String
8916 returned by S'Wide_Image over all values of the subtype
8917 S. It denotes zero for a subtype that has a null range.
8918 Its type is universal_integer.
8919
8920 39
8921 S'Width
8922 S'Width denotes the maximum length of a String returned
8923 by S'Image over all values of the subtype S. It denotes
8924 zero for a subtype that has a null range. Its type is
8925 universal_integer.
8926
8927 39.1/2
8928 S'Wide_Wide_Value
8929 {AI95-00285-01AI95-00285-01} S'Wide_Wide_Value denotes a
8930 function with the following specification:
8931
8932 39.2/2
8933 function S'Wide_Wide_Value(Arg : Wide_Wide_String)
8934 return S'Base
8935
8936 39.3/2
8937 This function returns a value given an image of the value
8938 as a Wide_Wide_String, ignoring any leading or trailing
8939 spaces.
8940
8941 39.4/3
8942 {AI05-0264-1AI05-0264-1} For the evaluation of a call on
8943 S'Wide_Wide_Value for an enumeration subtype S, if the
8944 sequence of characters of the parameter (ignoring leading
8945 and trailing spaces) has the syntax of an enumeration
8946 literal and if it corresponds to a literal of the type of
8947 S (or corresponds to the result of S'Wide_Wide_Image for
8948 a nongraphic character of the type), the result is the
8949 corresponding enumeration value; otherwise,
8950 Constraint_Error is raised.
8951
8952 39.a.1/2
8953 Discussion: It's not crystal clear that Range_Check is
8954 appropriate here, but it doesn't seem worthwhile to invent a
8955 whole new check name just for this weird case, so we decided
8956 to lump it in with Range_Check.
8957
8958 39.a.2/2
8959 To be honest: {8652/00968652/0096}
8960 {AI95-00053-01AI95-00053-01} A sequence of characters
8961 corresponds to the result of S'Wide_Wide_Image if it is the
8962 same ignoring case. Thus, the case of an image of a
8963 nongraphic character does not matter. For example,
8964 Character'Wide_Wide_Value("nul") does not raise
8965 Constraint_Error, even though Character'Wide_Wide_Image
8966 returns "NUL" for the nul character.
8967
8968 39.5/3
8969 {AI05-0264-1AI05-0264-1} For the evaluation of a call on
8970 S'Wide_Wide_Value for an integer subtype S, if the
8971 sequence of characters of the parameter (ignoring leading
8972 and trailing spaces) has the syntax of an integer
8973 literal, with an optional leading sign character (plus or
8974 minus for a signed type; only plus for a modular type),
8975 and the corresponding numeric value belongs to the base
8976 range of the type of S, then that value is the result;
8977 otherwise, Constraint_Error is raised.
8978
8979 39.a.3/2
8980 Discussion: We considered allowing 'Value to return a
8981 representable but out-of-range value without a
8982 Constraint_Error. However, we currently require (see *note
8983 4.9::) in an assignment_statement like "X :=
8984 <numeric_literal>;" that the value of the numeric-literal be
8985 in X's base range (at compile time), so it seems unfriendly
8986 and confusing to have a different range allowed for 'Value.
8987 Furthermore, for modular types, without the requirement for
8988 being in the base range, 'Value would have to handle
8989 arbitrarily long literals (since overflow never occurs for
8990 modular types).
8991
8992 39.6/2
8993 For the evaluation of a call on S'Wide_Wide_Value for a
8994 real subtype S, if the sequence of characters of the
8995 parameter (ignoring leading and trailing spaces) has the
8996 syntax of one of the following:
8997
8998 39.7/2
8999 * numeric_literal
9000
9001 39.8/2
9002 * numeral.[exponent]
9003
9004 39.9/2
9005 * .numeral[exponent]
9006
9007 39.10/2
9008 * base#based_numeral.#[exponent]
9009
9010 39.11/2
9011 * base#.based_numeral#[exponent]
9012
9013 39.12/3
9014 {AI05-0264-1AI05-0264-1} with an optional leading sign
9015 character (plus or minus), and if the corresponding
9016 numeric value belongs to the base range of the type of S,
9017 then that value is the result; otherwise,
9018 Constraint_Error is raised. The sign of a zero value is
9019 preserved (positive if none has been specified) if
9020 S'Signed_Zeros is True.
9021
9022 40
9023 S'Wide_Value
9024 S'Wide_Value denotes a function with the following
9025 specification:
9026
9027 41
9028 function S'Wide_Value(Arg : Wide_String)
9029 return S'Base
9030
9031 42
9032 This function returns a value given an image of the value
9033 as a Wide_String, ignoring any leading or trailing
9034 spaces.
9035
9036 43/3
9037 {AI95-00285-01AI95-00285-01} {AI05-0264-1AI05-0264-1} For
9038 the evaluation of a call on S'Wide_Value for an
9039 enumeration subtype S, if the sequence of characters of
9040 the parameter (ignoring leading and trailing spaces) has
9041 the syntax of an enumeration literal and if it
9042 corresponds to a literal of the type of S (or corresponds
9043 to the result of S'Wide_Image for a value of the type),
9044 the result is the corresponding enumeration value;
9045 otherwise, Constraint_Error is raised. For a numeric
9046 subtype S, the evaluation of a call on S'Wide_Value with
9047 Arg of type Wide_String is equivalent to a call on
9048 S'Wide_Wide_Value for a corresponding Arg of type
9049 Wide_Wide_String.
9050
9051 43.a/2
9052 This paragraph was deleted.
9053
9054 43.a.1/2
9055 This paragraph was deleted.{8652/00968652/0096}
9056 {AI95-00053-01AI95-00053-01}
9057
9058 43.b/2
9059 Reason: S'Wide_Value is subtly different from
9060 S'Wide_Wide_Value for enumeration subtypes since S'Wide_Image
9061 might produce a different sequence of characters than
9062 S'Wide_Wide_Image if the enumeration literal uses characters
9063 outside of the predefined type Wide_Character. That is why we
9064 don't just define S'Wide_Value in terms of S'Wide_Wide_Value
9065 for enumeration subtypes. S'Wide_Value and S'Wide_Wide_Value
9066 for numeric subtypes yield the same result given the same
9067 sequence of characters.
9068
9069 Paragraphs 44 through 51 were moved to Wide_Wide_Value.
9070
9071 52
9072 S'Value
9073 S'Value denotes a function with the following
9074 specification:
9075
9076 53
9077 function S'Value(Arg : String)
9078 return S'Base
9079
9080 54
9081 This function returns a value given an image of the value
9082 as a String, ignoring any leading or trailing spaces.
9083
9084 55/3
9085 {AI95-00285-01AI95-00285-01} {AI05-0264-1AI05-0264-1} For
9086 the evaluation of a call on S'Value for an enumeration
9087 subtype S, if the sequence of characters of the parameter
9088 (ignoring leading and trailing spaces) has the syntax of
9089 an enumeration literal and if it corresponds to a literal
9090 of the type of S (or corresponds to the result of S'Image
9091 for a value of the type), the result is the corresponding
9092 enumeration value; otherwise, Constraint_Error is raised.
9093 For a numeric subtype S, the evaluation of a call on
9094 S'Value with Arg of type String is equivalent to a call
9095 on S'Wide_Wide_Value for a corresponding Arg of type
9096 Wide_Wide_String.
9097
9098 55.a/2
9099 Reason: {AI95-00285-01AI95-00285-01} S'Value is subtly
9100 different from S'Wide_Wide_Value for enumeration subtypes; see
9101 the discussion under S'Wide_Value.
9102
9103 _Implementation Permissions_
9104
9105 56/2
9106 {AI95-00285-01AI95-00285-01} An implementation may extend the
9107 Wide_Wide_Value, [Wide_Value, Value, Wide_Wide_Image, Wide_Image, and
9108 Image] attributes of a floating point type to support special values
9109 such as infinities and NaNs.
9110
9111 56.a/2
9112 Proof: {AI95-00285-01AI95-00285-01} The permission is really
9113 only necessary for Wide_Wide_Value, because Value and
9114 Wide_Value are defined in terms of Wide_Wide_Value, and
9115 because the behavior of Wide_Wide_Image, Wide_Image, and Image
9116 is already unspecified for things like infinities and NaNs.
9117
9118 56.b
9119 Reason: This is to allow implementations to define full
9120 support for IEEE arithmetic. See also the similar permission
9121 for Get in *note A.10.9::.
9122
9123 56.1/3
9124 {AI05-0182-1AI05-0182-1} {AI05-0262-1AI05-0262-1}
9125 {AI05-0269-1AI05-0269-1} An implementation may extend the
9126 Wide_Wide_Value, Wide_Value, and Value attributes of a character type to
9127 accept strings of the form "Hex_hhhhhhhh" (ignoring case) for any
9128 character (not just the ones for which Wide_Wide_Image would produce
9129 that form -- see *note 3.5.2::), as well as three-character strings of
9130 the form "'X'", where X is any character, including nongraphic
9131 characters.
9132
9133 _Static Semantics_
9134
9135 56.2/3
9136 {AI05-0228-1AI05-0228-1} For a scalar type, the following
9137 language-defined representation aspect may be specified with an
9138 aspect_specification (see *note 13.1.1::):
9139
9140 56.3/3
9141 Default_Value
9142 This aspect shall be specified by a static expression,
9143 and that expression shall be explicit, even if the aspect
9144 has a boolean type. Default_Value shall be specified
9145 only on a full_type_declaration.
9146
9147 56.c/3
9148 Reason: The part about requiring an explicit expression is to
9149 disallow omitting the value for this aspect, which would
9150 otherwise be allowed by the rules of *note 13.1.1::.
9151
9152 56.d/3
9153 This is a representation aspect in order to disallow
9154 specifying it on a derived type that has inherited primitive
9155 subprograms; that is necessary as the sizes of out parameters
9156 could be different whether or not a Default_Value is specified
9157 (see *note 6.4.1::).
9158
9159 56.e/3
9160 Aspect Description for Default_Value: Default value for a
9161 scalar subtype.
9162
9163 56.4/3
9164 {AI05-0228-1AI05-0228-1} If a derived type with no primitive subprograms
9165 inherits a boolean Default_Value aspect, the aspect may be specified to
9166 have any value for the derived type.
9167
9168 56.f/3
9169 Reason: This overrides the *note 13.1.1:: rule that says that
9170 a boolean aspect with a value True cannot be changed.
9171
9172 _Name Resolution Rules_
9173
9174 56.5/3
9175 {AI05-0228-1AI05-0228-1} The expected type for the expression specified
9176 for the Default_Value aspect is the type defined by the
9177 full_type_declaration on which it appears.
9178
9179 NOTES
9180
9181 57
9182 24 The evaluation of S'First or S'Last never raises an exception.
9183 If a scalar subtype S has a nonnull range, S'First and S'Last
9184 belong to this range. These values can, for example, always be
9185 assigned to a variable of subtype S.
9186
9187 57.a
9188 Discussion: This paragraph addresses an issue that came up
9189 with Ada 83, where for fixed point types, the end points of
9190 the range specified in the type definition were not
9191 necessarily within the base range of the type. However, it
9192 was later clarified (and we reconfirm it in *note 3.5.9::,
9193 "*note 3.5.9:: Fixed Point Types") that the First and Last
9194 attributes reflect the true bounds chosen for the type, not
9195 the bounds specified in the type definition (which might be
9196 outside the ultimately chosen base range).
9197
9198 58
9199 25 For a subtype of a scalar type, the result delivered by the
9200 attributes Succ, Pred, and Value might not belong to the subtype;
9201 similarly, the actual parameters of the attributes Succ, Pred, and
9202 Image need not belong to the subtype.
9203
9204 59
9205 26 For any value V (including any nongraphic character) of an
9206 enumeration subtype S, S'Value(S'Image(V)) equals V, as do
9207 S'Wide_Value(S'Wide_Image(V)) and
9208 S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions
9209 ever raise Constraint_Error.
9210
9211 _Examples_
9212
9213 60
9214 Examples of ranges:
9215
9216 61
9217 -10 .. 10
9218 X .. X + 1
9219 0.0 .. 2.0*Pi
9220 Red .. Green -- see *note 3.5.1::
9221 1 .. 0 -- a null range
9222 Table'Range -- a range attribute reference (see *note 3.6::)
9223
9224 62
9225 Examples of range constraints:
9226
9227 63
9228 range -999.0 .. +999.0
9229 range S'First+1 .. S'Last-1
9230
9231 _Incompatibilities With Ada 83_
9232
9233 63.a/1
9234 S'Base is no longer defined for nonscalar types. One
9235 conceivable existing use of S'Base for nonscalar types is
9236 S'Base'Size where S is a generic formal private type.
9237 However, that is not generally useful because the actual
9238 subtype corresponding to S might be a constrained array or
9239 discriminated type, which would mean that S'Base'Size might
9240 very well overflow (for example, S'Base'Size where S is a
9241 constrained subtype of String will generally be 8 *
9242 (Integer'Last + 1)). For derived discriminated types that are
9243 packed, S'Base'Size might not even be well defined if the
9244 first subtype is constrained, thereby allowing some amount of
9245 normally required "dope" to have been squeezed out in the
9246 packing. Hence our conclusion is that S'Base'Size is not
9247 generally useful in a generic, and does not justify keeping
9248 the attribute Base for nonscalar types just so it can be used
9249 as a prefix.
9250
9251 _Extensions to Ada 83_
9252
9253 63.b
9254 The attribute S'Base for a scalar subtype is now permitted
9255 anywhere a subtype_mark is permitted. S'Base'First ..
9256 S'Base'Last is the base range of the type. Using an
9257 attribute_definition_clause (*note 13.3: S0309.), one cannot
9258 specify any subtype-specific attributes for the subtype
9259 denoted by S'Base (the base subtype).
9260
9261 63.c
9262 The attribute S'Range is now allowed for scalar subtypes.
9263
9264 63.d
9265 The attributes S'Min and S'Max are now defined, and made
9266 available for all scalar types.
9267
9268 63.e
9269 The attributes S'Succ, S'Pred, S'Image, S'Value, and S'Width
9270 are now defined for real types as well as discrete types.
9271
9272 63.f
9273 Wide_String versions of S'Image and S'Value are defined.
9274 These are called S'Wide_Image and S'Wide_Value to avoid
9275 introducing ambiguities involving uses of these attributes
9276 with string literals.
9277
9278 _Wording Changes from Ada 83_
9279
9280 63.g
9281 We now use the syntactic category range_attribute_reference
9282 since it is now syntactically distinguished from other
9283 attribute references.
9284
9285 63.h
9286 The definition of S'Base has been moved here from 3.3.3 since
9287 it now applies only to scalar types.
9288
9289 63.i
9290 More explicit rules are provided for nongraphic characters.
9291
9292 _Extensions to Ada 95_
9293
9294 63.j/2
9295 {AI95-00285-01AI95-00285-01} The attributes Wide_Wide_Image,
9296 Wide_Wide_Value, and Wide_Wide_Width are new. Note that
9297 Wide_Image and Wide_Value are now defined in terms of
9298 Wide_Wide_Image and Wide_Wide_Value, but the image of types
9299 other than characters have not changed.
9300
9301 _Wording Changes from Ada 95_
9302
9303 63.k/2
9304 {AI95-00285-01AI95-00285-01} The Wide_Image and Wide_Value
9305 attributes are now defined in terms of Wide_Wide_Image and
9306 Wide_Wide_Value, but the images of numeric types have not
9307 changed.
9308
9309 _Inconsistencies With Ada 2005_
9310
9311 63.l/3
9312 {AI05-0181-1AI05-0181-1} Correction: Soft hyphen (code point
9313 173) is nongraphic in ISO/IEC 10646:2011 (and also in the 2003
9314 version of that standard). Thus, we have given it the
9315 language-defined name soft_hyphen. This changes the result of
9316 Character'Image (and all of the related types and Image
9317 attributes) for this character, and changes the behavior of
9318 Character'Value (and all of the related types and Value
9319 attributes) for this character, and (in unusual
9320 circumstances), changes the result for Character'Width (and
9321 all of the related types and Width attributes). The vast
9322 majority of programs won't see any difference, as they are
9323 already prepared to handle nongraphic characters.
9324
9325 63.m/3
9326 {AI05-0182-1AI05-0182-1} Correction: Added an Implementation
9327 Permissions to let Wide_Wide_Value, Wide_Value, and Value
9328 accept strings in the form of literals containing nongraphic
9329 characters and "Hex_hhhhhhhh" for Latin-1 and graphic
9330 characters. These were required to raise Constraint_Error in
9331 Ada 2005. Since these attributes aren't very useful,
9332 implementations were inconsistent as to whether these were
9333 accepted, and since code that would care why the attribute
9334 failed seems unlikely, this should not be a problem in
9335 practice.
9336
9337 _Extensions to Ada 2005_
9338
9339 63.n/3
9340 {AI05-0228-1AI05-0228-1} The new aspect Default_Value allows
9341 defining implicit initial values (see *note 3.3.1::) for
9342 scalar types.
9343
9344 * Menu:
9345
9346 * 3.5.1 :: Enumeration Types
9347 * 3.5.2 :: Character Types
9348 * 3.5.3 :: Boolean Types
9349 * 3.5.4 :: Integer Types
9350 * 3.5.5 :: Operations of Discrete Types
9351 * 3.5.6 :: Real Types
9352 * 3.5.7 :: Floating Point Types
9353 * 3.5.8 :: Operations of Floating Point Types
9354 * 3.5.9 :: Fixed Point Types
9355 * 3.5.10 :: Operations of Fixed Point Types
9356
9357 \1f
9358 File: aarm2012.info, Node: 3.5.1, Next: 3.5.2, Up: 3.5
9359
9360 3.5.1 Enumeration Types
9361 -----------------------
9362
9363 1
9364 [ An enumeration_type_definition defines an enumeration type.]
9365
9366 _Syntax_
9367
9368 2
9369 enumeration_type_definition ::=
9370 (enumeration_literal_specification {,
9371 enumeration_literal_specification})
9372
9373 3
9374 enumeration_literal_specification ::= defining_identifier |
9375 defining_character_literal
9376
9377 4
9378 defining_character_literal ::= character_literal
9379
9380 _Legality Rules_
9381
9382 5/3
9383 {AI05-0227-1AI05-0227-1} {AI05-0299-1AI05-0299-1} The
9384 defining_identifiers in upper case [and the defining_character_literals]
9385 listed in an enumeration_type_definition shall be distinct.
9386
9387 5.a/3
9388 Proof: {AI05-0227-1AI05-0227-1} For character literals, this
9389 is a ramification of the normal disallowance of homographs
9390 explicitly declared immediately in the same declarative
9391 region.
9392
9393 5.b/3
9394 Reason: {AI05-0227-1AI05-0227-1} To ease implementation of the
9395 attribute Wide_Wide_Value, we require that all enumeration
9396 literals have distinct images.
9397
9398 _Static Semantics_
9399
9400 6/3
9401 {AI05-0006-1AI05-0006-1} Each enumeration_literal_specification is the
9402 explicit declaration of the corresponding enumeration literal: it
9403 declares a parameterless function, whose defining name is the
9404 defining_identifier (*note 3.1: S0022.) or defining_character_literal
9405 (*note 3.5.1: S0040.), and whose result subtype is the base subtype of
9406 the enumeration type.
9407
9408 6.a
9409 Reason: This rule defines the profile of the enumeration
9410 literal, which is used in the various types of conformance.
9411
9412 6.b
9413 Ramification: The parameterless function associated with an
9414 enumeration literal is fully defined by the
9415 enumeration_type_definition; a body is not permitted for it,
9416 and it never fails the Elaboration_Check when called.
9417
9418 6.c/3
9419 Discussion: {AI05-0006-1AI05-0006-1} The result subtype is
9420 primarily a concern when an enumeration literal is used as the
9421 expression of a case statement, due to the full coverage
9422 requirement based on the nominal subtype.
9423
9424 7
9425 Each enumeration literal corresponds to a distinct value of the
9426 enumeration type, and to a distinct position number. The position
9427 number of the value of the first listed enumeration literal is zero; the
9428 position number of the value of each subsequent enumeration literal is
9429 one more than that of its predecessor in the list.
9430
9431 8
9432 [The predefined order relations between values of the enumeration type
9433 follow the order of corresponding position numbers.]
9434
9435 9
9436 [ If the same defining_identifier or defining_character_literal is
9437 specified in more than one enumeration_type_definition (*note 3.5.1:
9438 S0038.), the corresponding enumeration literals are said to be
9439 overloaded. At any place where an overloaded enumeration literal occurs
9440 in the text of a program, the type of the enumeration literal has to be
9441 determinable from the context (see *note 8.6::).]
9442
9443 _Dynamic Semantics_
9444
9445 10
9446 The elaboration of an enumeration_type_definition creates the
9447 enumeration type and its first subtype, which is constrained to the base
9448 range of the type.
9449
9450 10.a
9451 Ramification: The first subtype of a discrete type is always
9452 constrained, except in the case of a derived type whose parent
9453 subtype is Whatever'Base.
9454
9455 11
9456 When called, the parameterless function associated with an enumeration
9457 literal returns the corresponding value of the enumeration type.
9458
9459 NOTES
9460
9461 12
9462 27 If an enumeration literal occurs in a context that does not
9463 otherwise suffice to determine the type of the literal, then
9464 qualification by the name of the enumeration type is one way to
9465 resolve the ambiguity (see *note 4.7::).
9466
9467 _Examples_
9468
9469 13
9470 Examples of enumeration types and subtypes:
9471
9472 14
9473 type Day is (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
9474 type Suit is (Clubs, Diamonds, Hearts, Spades);
9475 type Gender is (M, F);
9476 type Level is (Low, Medium, Urgent);
9477 type Color is (White, Red, Yellow, Green, Blue, Brown, Black);
9478 type Light is (Red, Amber, Green); -- Red and Green are overloaded
9479
9480 15
9481 type Hexa is ('A', 'B', 'C', 'D', 'E', 'F');
9482 type Mixed is ('A', 'B', '*', B, None, '?', '%');
9483
9484 16
9485 subtype Weekday is Day range Mon .. Fri;
9486 subtype Major is Suit range Hearts .. Spades;
9487 subtype Rainbow is Color range Red .. Blue; -- the Color Red, not the Light
9488
9489 _Wording Changes from Ada 83_
9490
9491 16.a
9492 The syntax rule for defining_character_literal is new. It is
9493 used for the defining occurrence of a character_literal,
9494 analogously to defining_identifier. Usage occurrences use the
9495 name or selector_name syntactic categories.
9496
9497 16.b
9498 We emphasize the fact that an enumeration literal denotes a
9499 function, which is called to produce a value.
9500
9501 _Incompatibilities With Ada 2005_
9502
9503 16.c/3
9504 {AI05-0227-1AI05-0227-1} Correction: Required that all
9505 enumeration literals in a type have distinct images; this
9506 might not be the case since upper case conversion can map
9507 distinct characters to the same upper case character. This
9508 can only happen for identifiers using Unicode characters first
9509 allowed by Ada 2005; moreover, the original definition of Ada
9510 2005 was confused and appeared to require inconsistent results
9511 from the Image attribute, so implementations that allowed
9512 problematic cases are rare; the problematic cases are very
9513 rare; so it is expected that this change would only affect
9514 test programs.
9515
9516 _Wording Changes from Ada 2005_
9517
9518 16.d/3
9519 {AI05-0006-1AI05-0006-1} Correction: Defined the result
9520 subtype of an enumeration literal to close a minor language
9521 hole.
9522
9523 \1f
9524 File: aarm2012.info, Node: 3.5.2, Next: 3.5.3, Prev: 3.5.1, Up: 3.5
9525
9526 3.5.2 Character Types
9527 ---------------------
9528
9529 _Static Semantics_
9530
9531 1
9532 An enumeration type is said to be a character type if at least one of
9533 its enumeration literals is a character_literal.
9534
9535 2/3
9536 {AI95-00285-01AI95-00285-01} {AI05-0181-1AI05-0181-1}
9537 {AI05-0262-1AI05-0262-1} {AI05-0266-1AI05-0266-1} The predefined type
9538 Character is a character type whose values correspond to the 256 code
9539 points of Row 00 (also known as Latin-1) of the ISO/IEC 10646:2011 Basic
9540 Multilingual Plane (BMP). Each of the graphic characters of Row 00 of
9541 the BMP has a corresponding character_literal in Character. Each of the
9542 nongraphic characters of Row 00 has a corresponding language-defined
9543 name, which is not usable as an enumeration literal, but which is usable
9544 with the attributes Image, Wide_Image, Wide_Wide_Image, Value,
9545 Wide_Value, and Wide_Wide_Value; these names are given in the definition
9546 of type Character in *note A.1::, "*note A.1:: The Package Standard",
9547 but are set in italics.
9548
9549 2.a/3
9550 Discussion: {AI05-0262-1AI05-0262-1} Code point is defined in
9551 ISO/IEC 10646:2011.
9552
9553 3/3
9554 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} The predefined
9555 type Wide_Character is a character type whose values correspond to the
9556 65536 code points of the ISO/IEC 10646:2011 Basic Multilingual Plane
9557 (BMP). Each of the graphic characters of the BMP has a corresponding
9558 character_literal in Wide_Character. The first 256 values of
9559 Wide_Character have the same character_literal or language-defined name
9560 as defined for Character. Each of the graphic_characters has a
9561 corresponding character_literal.
9562
9563 4/3
9564 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} The predefined
9565 type Wide_Wide_Character is a character type whose values correspond to
9566 the 2147483648 code points of the ISO/IEC 10646:2011 character set.
9567 Each of the graphic_characters has a corresponding character_literal in
9568 Wide_Wide_Character. The first 65536 values of Wide_Wide_Character have
9569 the same character_literal or language-defined name as defined for
9570 Wide_Character.
9571
9572 5/3
9573 {AI95-00285-01AI95-00285-01} {AI05-0262-1AI05-0262-1} The characters
9574 whose code point is larger than 16#FF# and which are not
9575 graphic_characters have language-defined names which are formed by
9576 appending to the string "Hex_" the representation of their code point in
9577 hexadecimal as eight extended digits. As with other language-defined
9578 names, these names are usable only with the attributes (Wide_)Wide_Image
9579 and (Wide_)Wide_Value; they are not usable as enumeration literals.
9580
9581 5.a/2
9582 Reason: {AI95-00285-01AI95-00285-01} The language-defined
9583 names are not usable as enumeration literals to avoid
9584 "polluting" the name space. Since Wide_Character and
9585 Wide_Wide_Character are defined in Standard, if the
9586 language-defined names were usable as enumeration literals,
9587 they would hide other nonoverloadable declarations with the
9588 same names in use-d packages.]}
9589
9590 Paragraphs 6 and 7 were deleted.
9591
9592 NOTES
9593
9594 8
9595 28 The language-defined library package Characters.Latin_1 (see
9596 *note A.3.3::) includes the declaration of constants denoting
9597 control characters, lower case characters, and special characters
9598 of the predefined type Character.
9599
9600 8.a
9601 To be honest: The package ASCII does the same, but only for
9602 the first 128 characters of Character. Hence, it is an
9603 obsolescent package, and we no longer mention it here.
9604
9605 9/3
9606 29 {AI05-0299-1AI05-0299-1} A conventional character set such as
9607 EBCDIC can be declared as a character type; the internal codes of
9608 the characters can be specified by an
9609 enumeration_representation_clause as explained in subclause *note
9610 13.4::.
9611
9612 _Examples_
9613
9614 10
9615 Example of a character type:
9616
9617 11
9618 type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
9619
9620 _Inconsistencies With Ada 83_
9621
9622 11.a
9623 The declaration of Wide_Character in package Standard hides
9624 use-visible declarations with the same defining identifier.
9625 In the unlikely event that an Ada 83 program had depended on
9626 such a use-visible declaration, and the program remains legal
9627 after the substitution of Standard.Wide_Character, the meaning
9628 of the program will be different.
9629
9630 _Incompatibilities With Ada 83_
9631
9632 11.b
9633 The presence of Wide_Character in package Standard means that
9634 an expression such as
9635
9636 11.c
9637 'a' = 'b'
9638
9639 11.d
9640 is ambiguous in Ada 95, whereas in Ada 83 both literals could
9641 be resolved to be of type Character.
9642
9643 11.e
9644 The change in visibility rules (see *note 4.2::) for character
9645 literals means that additional qualification might be
9646 necessary to resolve expressions involving overloaded
9647 subprograms and character literals.
9648
9649 _Extensions to Ada 83_
9650
9651 11.f
9652 The type Character has been extended to have 256 positions,
9653 and the type Wide_Character has been added. Note that this
9654 change was already approved by the ARG for Ada 83 conforming
9655 compilers.
9656
9657 11.g
9658 The rules for referencing character literals are changed (see
9659 *note 4.2::), so that the declaration of the character type
9660 need not be directly visible to use its literals, similar to
9661 null and string literals. Context is used to resolve their
9662 type.
9663
9664 _Inconsistencies With Ada 95_
9665
9666 11.h/2
9667 {AI95-00285-01AI95-00285-01} Ada 95 defined most characters in
9668 Wide_Character to be graphic characters, while Ada 2005 uses
9669 the categorizations from ISO-10646:2003. It also provides
9670 language-defined names for all nongraphic characters. That
9671 means that in Ada 2005, Wide_Character'Wide_Value will raise
9672 Constraint_Error for a string representing a character_literal
9673 of a nongraphic character, while Ada 95 would have accepted
9674 it. Similarly, the result of Wide_Character'Wide_Image will
9675 change for such nongraphic characters.
9676
9677 11.i/3
9678 {AI95-00395-01AI95-00395-01} {AI05-0005-1AI05-0005-1}
9679 {AI05-0262-1AI05-0262-1} The language-defined names FFFE and
9680 FFFF were replaced by a consistent set of language-defined
9681 names for all nongraphic characters with code points greater
9682 than 16#FF#. That means that in Ada 2005,
9683 Wide_Character'Wide_Value("FFFE") will raise Constraint_Error
9684 while Ada 95 would have accepted it. Similarly, the result of
9685 Wide_Character'Wide_Image will change for the position numbers
9686 16#FFFE# and 16#FFFF#. It is very unlikely that this will
9687 matter in practice, as these names do not represent usable
9688 characters.
9689
9690 11.j/2
9691 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
9692 Because of the previously mentioned changes to the
9693 Wide_Character'Wide_Image of various character values, the
9694 value of attribute Wide_Width will change for some subtypes of
9695 Wide_Character. However, the new language-defined names were
9696 chosen so that the value of Wide_Character'Wide_Width itself
9697 does not change.
9698
9699 11.k/2
9700 {AI95-00285-01AI95-00285-01} The declaration of
9701 Wide_Wide_Character in package Standard hides use-visible
9702 declarations with the same defining identifier. In the (very)
9703 unlikely event that an Ada 95 program had depended on such a
9704 use-visible declaration, and the program remains legal after
9705 the substitution of Standard.Wide_Wide_Character, the meaning
9706 of the program will be different.
9707
9708 _Extensions to Ada 95_
9709
9710 11.l/2
9711 {AI95-00285-01AI95-00285-01} The type Wide_Wide_Character is
9712 new.
9713
9714 _Wording Changes from Ada 95_
9715
9716 11.m/2
9717 {AI95-00285-01AI95-00285-01} Characters are now defined in
9718 terms of the entire ISO/IEC 10646:2003 character set.
9719
9720 11.n/3
9721 {AI95-00285-01AI95-00285-01} {AI05-0248-1AI05-0248-1} We
9722 dropped the Implementation Advice for nonstandard
9723 interpretation of character sets; an implementation can do
9724 what it wants in a nonstandard mode, so there isn't much point
9725 to any advice.
9726
9727 _Wording Changes from Ada 2005_
9728
9729 11.o/3
9730 {AI05-0181-1AI05-0181-1} Correction: Removed the position
9731 numbers of nongraphic characters from the text, as it is wrong
9732 and thus misleading.
9733
9734 11.p/3
9735 {AI05-0262-1AI05-0262-1} Changed "code position" to "code
9736 point" consistently throughout the standard, as ISO/IEC
9737 10646:2011 prefers "code point" and we are referring to the
9738 definition in that Standard. This change also reduces
9739 confusion between "code point" and "position number"; while
9740 these have the same values for the predefined character types,
9741 there is no required relationship for other character types.
9742
9743 \1f
9744 File: aarm2012.info, Node: 3.5.3, Next: 3.5.4, Prev: 3.5.2, Up: 3.5
9745
9746 3.5.3 Boolean Types
9747 -------------------
9748
9749 _Static Semantics_
9750
9751 1
9752 There is a predefined enumeration type named Boolean, [declared in the
9753 visible part of package Standard]. It has the two enumeration literals
9754 False and True ordered with the relation False < True. Any descendant
9755 of the predefined type Boolean is called a boolean type.
9756
9757 1.a
9758 Implementation Note: An implementation is not required to
9759 support enumeration representation clauses on boolean types
9760 that impose an unacceptable implementation burden. See *note
9761 13.4::, "*note 13.4:: Enumeration Representation Clauses".
9762 However, it is generally straightforward to support
9763 representations where False is zero and True is 2**n - 1 for
9764 some n.
9765
9766 \1f
9767 File: aarm2012.info, Node: 3.5.4, Next: 3.5.5, Prev: 3.5.3, Up: 3.5
9768
9769 3.5.4 Integer Types
9770 -------------------
9771
9772 1
9773 An integer_type_definition defines an integer type; it defines either a
9774 signed integer type, or a modular integer type. The base range of a
9775 signed integer type includes at least the values of the specified range.
9776 A modular type is an integer type with all arithmetic modulo a specified
9777 positive modulus; such a type corresponds to an unsigned type with
9778 wrap-around semantics.
9779
9780 _Syntax_
9781
9782 2
9783 integer_type_definition ::= signed_integer_type_definition |
9784 modular_type_definition
9785
9786 3
9787 signed_integer_type_definition ::= range static_
9788 simple_expression .. static_simple_expression
9789
9790 3.a
9791 Discussion: We don't call this a range_constraint, because it
9792 is rather different -- not only is it required to be static,
9793 but the associated overload resolution rules are different
9794 than for normal range constraints. A similar comment applies
9795 to real_range_specification. This used to be
9796 integer_range_specification but when we added support for
9797 modular types, it seemed overkill to have three levels of
9798 syntax rules, and just calling these
9799 signed_integer_range_specification and
9800 modular_range_specification loses the fact that they are
9801 defining different classes of types, which is important for
9802 the generic type matching rules.
9803
9804 4
9805 modular_type_definition ::= mod static_expression
9806
9807 _Name Resolution Rules_
9808
9809 5
9810 Each simple_expression in a signed_integer_type_definition is expected
9811 to be of any integer type; they need not be of the same type. The
9812 expression in a modular_type_definition is likewise expected to be of
9813 any integer type.
9814
9815 _Legality Rules_
9816
9817 6
9818 The simple_expressions of a signed_integer_type_definition shall be
9819 static, and their values shall be in the range System.Min_Int ..
9820 System.Max_Int.
9821
9822 7
9823 The expression of a modular_type_definition shall be static, and its
9824 value (the modulus) shall be positive, and shall be no greater than
9825 System.Max_Binary_Modulus if a power of 2, or no greater than
9826 System.Max_Nonbinary_Modulus if not.
9827
9828 7.a
9829 Reason: For a 2's-complement machine, supporting nonbinary
9830 moduli greater than System.Max_Int can be quite difficult,
9831 whereas essentially any binary moduli are straightforward to
9832 support, up to 2*System.Max_Int+2, so this justifies having
9833 two separate limits.
9834
9835 _Static Semantics_
9836
9837 8
9838 The set of values for a signed integer type is the (infinite) set of
9839 mathematical integers[, though only values of the base range of the type
9840 are fully supported for run-time operations]. The set of values for a
9841 modular integer type are the values from 0 to one less than the modulus,
9842 inclusive.
9843
9844 9
9845 A signed_integer_type_definition defines an integer type whose base
9846 range includes at least the values of the simple_expressions and is
9847 symmetric about zero, excepting possibly an extra negative value. A
9848 signed_integer_type_definition also defines a constrained first subtype
9849 of the type, with a range whose bounds are given by the values of the
9850 simple_expressions, converted to the type being defined.
9851
9852 9.a/2
9853 Implementation Note: {AI95-00114-01AI95-00114-01} The base
9854 range of a signed integer type might be much larger than is
9855 necessary to satisfy the above requirements.
9856
9857 9.a.1/1
9858 To be honest: The conversion mentioned above is not an
9859 implicit subtype conversion (which is something that happens
9860 at overload resolution, see *note 4.6::), although it happens
9861 implicitly. Therefore, the freezing rules are not invoked on
9862 the type (which is important so that representation items can
9863 be given for the type).
9864
9865 10
9866 A modular_type_definition defines a modular type whose base range is
9867 from zero to one less than the given modulus. A modular_type_definition
9868 also defines a constrained first subtype of the type with a range that
9869 is the same as the base range of the type.
9870
9871 11
9872 There is a predefined signed integer subtype named Integer[, declared in
9873 the visible part of package Standard]. It is constrained to the base
9874 range of its type.
9875
9876 11.a
9877 Reason: Integer is a constrained subtype, rather than an
9878 unconstrained subtype. This means that on assignment to an
9879 object of subtype Integer, a range check is required. On the
9880 other hand, an object of subtype Integer'Base is
9881 unconstrained, and no range check (only overflow check) is
9882 required on assignment. For example, if the object is held in
9883 an extended-length register, its value might be outside of
9884 Integer'First .. Integer'Last. All parameter and result
9885 subtypes of the predefined integer operators are of such
9886 unconstrained subtypes, allowing extended-length registers to
9887 be used as operands or for the result. In an earlier version
9888 of Ada 95, Integer was unconstrained. However, the fact that
9889 certain Constraint_Errors might be omitted or appear elsewhere
9890 was felt to be an undesirable upward inconsistency in this
9891 case. Note that for Float, the opposite conclusion was
9892 reached, partly because of the high cost of performing range
9893 checks when not actually necessary. Objects of subtype Float
9894 are unconstrained, and no range checks, only overflow checks,
9895 are performed for them.
9896
9897 12
9898 Integer has two predefined subtypes, [declared in the visible part of
9899 package Standard:]
9900
9901 13
9902 subtype Natural is Integer range 0 .. Integer'Last;
9903 subtype Positive is Integer range 1 .. Integer'Last;
9904
9905 14
9906 A type defined by an integer_type_definition is implicitly derived from
9907 root_integer, an anonymous predefined (specific) integer type, whose
9908 base range is System.Min_Int .. System.Max_Int. However, the base
9909 range of the new type is not inherited from root_integer, but is instead
9910 determined by the range or modulus specified by the
9911 integer_type_definition. [Integer literals are all of the type
9912 universal_integer, the universal type (see *note 3.4.1::) for the class
9913 rooted at root_integer, allowing their use with the operations of any
9914 integer type.]
9915
9916 14.a
9917 Discussion: This implicit derivation is not considered exactly
9918 equivalent to explicit derivation via a
9919 derived_type_definition. In particular, integer types defined
9920 via a derived_type_definition inherit their base range from
9921 their parent type. A type defined by an
9922 integer_type_definition does not necessarily inherit its base
9923 range from root_integer. It is not specified whether the
9924 implicit derivation from root_integer is direct or indirect,
9925 not that it really matters. All we want is for all integer
9926 types to be descendants of root_integer.
9927
9928 14.a.1/1
9929 {8652/00998652/0099} {AI95-00152-01AI95-00152-01} Note that
9930 this derivation does not imply any inheritance of subprograms.
9931 Subprograms are inherited only for types derived by a
9932 derived_type_definition (*note 3.4: S0035.) (see *note 3.4::),
9933 or a private_extension_declaration (*note 7.3: S0194.) (see
9934 *note 7.3::, *note 7.3.1::, and *note 12.5.1::).
9935
9936 14.b
9937 Implementation Note: It is the intent that even nonstandard
9938 integer types (see below) will be descendants of root_integer,
9939 even though they might have a base range that exceeds that of
9940 root_integer. This causes no problem for static calculations,
9941 which are performed without range restrictions (see *note
9942 4.9::). However for run-time calculations, it is possible
9943 that Constraint_Error might be raised when using an operator
9944 of root_integer on the result of 'Val applied to a value of a
9945 nonstandard integer type.
9946
9947 15
9948 The position number of an integer value is equal to the value.
9949
9950 16/2
9951 {AI95-00340-01AI95-00340-01} For every modular subtype S, the following
9952 attributes are defined:
9953
9954 16.1/2
9955 S'Mod
9956 {AI95-00340-01AI95-00340-01} S'Mod denotes a function
9957 with the following specification:
9958
9959 16.2/2
9960 function S'Mod (Arg : universal_integer)
9961 return S'Base
9962
9963 16.3/2
9964 This function returns Arg mod S'Modulus, as a value of
9965 the type of S.
9966
9967 17
9968 S'Modulus
9969 S'Modulus yields the modulus of the type of S, as a value
9970 of the type universal_integer.
9971
9972 _Dynamic Semantics_
9973
9974 18
9975 The elaboration of an integer_type_definition creates the integer type
9976 and its first subtype.
9977
9978 19
9979 For a modular type, if the result of the execution of a predefined
9980 operator (see *note 4.5::) is outside the base range of the type, the
9981 result is reduced modulo the modulus of the type to a value that is
9982 within the base range of the type.
9983
9984 20
9985 For a signed integer type, the exception Constraint_Error is raised by
9986 the execution of an operation that cannot deliver the correct result
9987 because it is outside the base range of the type. [ For any integer
9988 type, Constraint_Error is raised by the operators "/", "rem", and "mod"
9989 if the right operand is zero.]
9990
9991 _Implementation Requirements_
9992
9993 21
9994 In an implementation, the range of Integer shall include the range
9995 -2**15+1 .. +2**15-1.
9996
9997 22
9998 If Long_Integer is predefined for an implementation, then its range
9999 shall include the range -2**31+1 .. +2**31-1.
10000
10001 23
10002 System.Max_Binary_Modulus shall be at least 2**16.
10003
10004 _Implementation Permissions_
10005
10006 24
10007 For the execution of a predefined operation of a signed integer type,
10008 the implementation need not raise Constraint_Error if the result is
10009 outside the base range of the type, so long as the correct result is
10010 produced.
10011
10012 24.a
10013 Discussion: Constraint_Error is never raised for operations on
10014 modular types, except for divide-by-zero (and
10015 rem/mod-by-zero).
10016
10017 25
10018 An implementation may provide additional predefined signed integer
10019 types[, declared in the visible part of Standard], whose first subtypes
10020 have names of the form Short_Integer, Long_Integer, Short_Short_Integer,
10021 Long_Long_Integer, etc. Different predefined integer types are allowed
10022 to have the same base range. However, the range of Integer should be no
10023 wider than that of Long_Integer. Similarly, the range of Short_Integer
10024 (if provided) should be no wider than Integer. Corresponding
10025 recommendations apply to any other predefined integer types. There need
10026 not be a named integer type corresponding to each distinct base range
10027 supported by an implementation. The range of each first subtype should
10028 be the base range of its type.
10029
10030 25.a
10031 Implementation defined: The predefined integer types declared
10032 in Standard.
10033
10034 26
10035 An implementation may provide nonstandard integer types, descendants of
10036 root_integer that are declared outside of the specification of package
10037 Standard, which need not have all the standard characteristics of a type
10038 defined by an integer_type_definition. For example, a nonstandard
10039 integer type might have an asymmetric base range or it might not be
10040 allowed as an array or loop index (a very long integer). Any type
10041 descended from a nonstandard integer type is also nonstandard. An
10042 implementation may place arbitrary restrictions on the use of such
10043 types; it is implementation defined whether operators that are
10044 predefined for "any integer type" are defined for a particular
10045 nonstandard integer type. [In any case, such types are not permitted as
10046 explicit_generic_actual_parameters for formal scalar types -- see *note
10047 12.5.2::.]
10048
10049 26.a
10050 Implementation defined: Any nonstandard integer types and the
10051 operators defined for them.
10052
10053 27
10054 For a one's complement machine, the high bound of the base range of a
10055 modular type whose modulus is one less than a power of 2 may be equal to
10056 the modulus, rather than one less than the modulus. It is
10057 implementation defined for which powers of 2, if any, this permission is
10058 exercised.
10059
10060 27.1/1
10061 {8652/00038652/0003} {AI95-00095-01AI95-00095-01} For a one's complement
10062 machine, implementations may support nonbinary modulus values greater
10063 than System.Max_Nonbinary_Modulus. It is implementation defined which
10064 specific values greater than System.Max_Nonbinary_Modulus, if any, are
10065 supported.
10066
10067 27.a.1/1
10068 Reason: On a one's complement machine, the natural full word
10069 type would have a modulus of 2**Word_Size-1. However, we
10070 would want to allow the all-ones bit pattern (which represents
10071 negative zero as a number) in logical operations. These
10072 permissions are intended to allow that and the natural modulus
10073 value without burdening implementations with supporting
10074 expensive modulus values.
10075
10076 _Implementation Advice_
10077
10078 28
10079 An implementation should support Long_Integer in addition to Integer if
10080 the target machine supports 32-bit (or longer) arithmetic. No other
10081 named integer subtypes are recommended for package Standard. Instead,
10082 appropriate named integer subtypes should be provided in the library
10083 package Interfaces (see *note B.2::).
10084
10085 28.a.1/2
10086 Implementation Advice: Long_Integer should be declared in
10087 Standard if the target supports 32-bit arithmetic. No other
10088 named integer subtypes should be declared in Standard.
10089
10090 28.a
10091 Implementation Note: To promote portability, implementations
10092 should explicitly declare the integer (sub)types Integer and
10093 Long_Integer in Standard, and leave other predefined integer
10094 types anonymous. For implementations that already support
10095 Byte_Integer, etc., upward compatibility argues for keeping
10096 such declarations in Standard during the transition period,
10097 but perhaps generating a warning on use. A separate package
10098 Interfaces in the predefined environment is available for
10099 pre-declaring types such as Integer_8, Integer_16, etc. See
10100 *note B.2::. In any case, if the user declares a subtype
10101 (first or not) whose range fits in, for example, a byte, the
10102 implementation can store variables of the subtype in a single
10103 byte, even if the base range of the type is wider.
10104
10105 29
10106 An implementation for a two's complement machine should support modular
10107 types with a binary modulus up to System.Max_Int*2+2. An implementation
10108 should support a nonbinary modulus up to Integer'Last.
10109
10110 29.a.1/2
10111 Implementation Advice: For a two's complement target, modular
10112 types with a binary modulus up to System.Max_Int*2+2 should be
10113 supported. A nonbinary modulus up to Integer'Last should be
10114 supported.
10115
10116 29.a
10117 Reason: Modular types provide bit-wise "and", "or", "xor", and
10118 "not" operations. It is important for systems programming
10119 that these be available for all integer types of the target
10120 hardware.
10121
10122 29.b
10123 Ramification: Note that on a one's complement machine, the
10124 largest supported modular type would normally have a nonbinary
10125 modulus. On a two's complement machine, the largest supported
10126 modular type would normally have a binary modulus.
10127
10128 29.c
10129 Implementation Note: Supporting a nonbinary modulus greater
10130 than Integer'Last can impose an undesirable implementation
10131 burden on some machines.
10132
10133 NOTES
10134
10135 30
10136 30 Integer literals are of the anonymous predefined integer type
10137 universal_integer. Other integer types have no literals. However,
10138 the overload resolution rules (see *note 8.6::, "*note 8.6:: The
10139 Context of Overload Resolution") allow expressions of the type
10140 universal_integer whenever an integer type is expected.
10141
10142 31
10143 31 The same arithmetic operators are predefined for all signed
10144 integer types defined by a signed_integer_type_definition (see
10145 *note 4.5::, "*note 4.5:: Operators and Expression Evaluation").
10146 For modular types, these same operators are predefined, plus
10147 bit-wise logical operators (and, or, xor, and not). In addition,
10148 for the unsigned types declared in the language-defined package
10149 Interfaces (see *note B.2::), functions are defined that provide
10150 bit-wise shifting and rotating.
10151
10152 32
10153 32 Modular types match a generic_formal_parameter_declaration of
10154 the form "type T is mod <>;"; signed integer types match "type T is
10155 range <>;" (see *note 12.5.2::).
10156
10157 _Examples_
10158
10159 33
10160 Examples of integer types and subtypes:
10161
10162 34
10163 type Page_Num is range 1 .. 2_000;
10164 type Line_Size is range 1 .. Max_Line_Size;
10165
10166 35
10167 subtype Small_Int is Integer range -10 .. 10;
10168 subtype Column_Ptr is Line_Size range 1 .. 10;
10169 subtype Buffer_Size is Integer range 0 .. Max;
10170
10171 36
10172 type Byte is mod 256; -- an unsigned byte
10173 type Hash_Index is mod 97; -- modulus is prime
10174
10175 _Extensions to Ada 83_
10176
10177 36.a
10178 An implementation is allowed to support any number of distinct
10179 base ranges for integer types, even if fewer integer types are
10180 explicitly declared in Standard.
10181
10182 36.b
10183 Modular (unsigned, wrap-around) types are new.
10184
10185 _Wording Changes from Ada 83_
10186
10187 36.c
10188 Ada 83's integer types are now called "signed" integer types,
10189 to contrast them with "modular" integer types.
10190
10191 36.d
10192 Standard.Integer, Standard.Long_Integer, etc., denote
10193 constrained subtypes of predefined integer types, consistent
10194 with the Ada 95 model that only subtypes have names.
10195
10196 36.e
10197 We now impose minimum requirements on the base range of
10198 Integer and Long_Integer.
10199
10200 36.f
10201 We no longer explain integer type definition in terms of an
10202 equivalence to a normal type derivation, except to say that
10203 all integer types are by definition implicitly derived from
10204 root_integer. This is for various reasons.
10205
10206 36.g
10207 First of all, the equivalence with a type derivation and a
10208 subtype declaration was not perfect, and was the source of
10209 various AIs (for example, is the conversion of the bounds
10210 static? Is a numeric type a derived type with respect to
10211 other rules of the language?)
10212
10213 36.h
10214 Secondly, we don't want to require that every integer size
10215 supported shall have a corresponding named type in Standard.
10216 Adding named types to Standard creates nonportabilities.
10217
10218 36.i
10219 Thirdly, we don't want the set of types that match a formal
10220 derived type "type T is new Integer;" to depend on the
10221 particular underlying integer representation chosen to
10222 implement a given user-defined integer type. Hence, we would
10223 have needed anonymous integer types as parent types for the
10224 implicit derivation anyway. We have simply chosen to identify
10225 only one anonymous integer type -- root_integer, and stated
10226 that every integer type is derived from it.
10227
10228 36.j
10229 Finally, the "fiction" that there were distinct preexisting
10230 predefined types for every supported representation breaks
10231 down for fixed point with arbitrary smalls, and was never
10232 exploited for enumeration types, array types, etc. Hence,
10233 there seems little benefit to pushing an explicit equivalence
10234 between integer type definition and normal type derivation.
10235
10236 _Extensions to Ada 95_
10237
10238 36.k/2
10239 {AI95-00340-01AI95-00340-01} The Mod attribute is new. It
10240 eases mixing of signed and unsigned values in an expression,
10241 which can be difficult as there may be no type which can
10242 contain all of the values of both of the types involved.
10243
10244 _Wording Changes from Ada 95_
10245
10246 36.l/2
10247 {8652/00038652/0003} {AI95-00095-01AI95-00095-01} Corrigendum:
10248 Added additional permissions for modular types on one's
10249 complement machines.
10250
10251 \1f
10252 File: aarm2012.info, Node: 3.5.5, Next: 3.5.6, Prev: 3.5.4, Up: 3.5
10253
10254 3.5.5 Operations of Discrete Types
10255 ----------------------------------
10256
10257 _Static Semantics_
10258
10259 1
10260 For every discrete subtype S, the following attributes are defined:
10261
10262 2
10263 S'Pos
10264 S'Pos denotes a function with the following
10265 specification:
10266
10267 3
10268 function S'Pos(Arg : S'Base)
10269 return universal_integer
10270
10271 4
10272 This function returns the position number of the value of
10273 Arg, as a value of type universal_integer.
10274
10275 5
10276 S'Val
10277 S'Val denotes a function with the following
10278 specification:
10279
10280 6
10281 function S'Val(Arg : universal_integer)
10282 return S'Base
10283
10284 7
10285 This function returns a value of the type of S whose
10286 position number equals the value of Arg. For the
10287 evaluation of a call on S'Val, if there is no value in
10288 the base range of its type with the given position
10289 number, Constraint_Error is raised.
10290
10291 7.a
10292 Ramification: By the overload resolution rules, a formal
10293 parameter of type universal_integer allows an actual parameter
10294 of any integer type.
10295
10296 7.b
10297 Reason: We considered allowing S'Val for a signed integer
10298 subtype S to return an out-of-range value, but since checks
10299 were required for enumeration and modular types anyway, the
10300 allowance didn't seem worth the complexity of the rule.
10301
10302 7.1/3
10303 {AI05-0297-1AI05-0297-1} For every static discrete subtype S for which
10304 there exists at least one value belonging to S that satisfies any
10305 predicate of S, the following attributes are defined:
10306
10307 7.2/3
10308 S'First_Valid
10309 {AI05-0297-1AI05-0297-1} S'First_Valid denotes the
10310 smallest value that belongs to S and satisfies the
10311 predicate of S. The value of this attribute is of the
10312 type of S.
10313
10314 7.3/3
10315 S'Last_Valid
10316 {AI05-0297-1AI05-0297-1} S'Last_Valid denotes the largest
10317 value that belongs to S and satisfies the predicate of S.
10318 The value of this attribute is of the type of S.
10319
10320 7.4/3
10321 {AI05-0297-1AI05-0297-1} [First_Valid and Last_Valid
10322 attribute_references are always static expressions. Any explicit
10323 predicate of S can only have been specified by a Static_Predicate
10324 aspect.]
10325
10326 7.c/3
10327 Proof: An attribute_reference is static if the prefix is a
10328 static subtype (see *note 4.9::), (true by definition) and any
10329 arguments are static (there are none). Similarly, a dynamic
10330 predicate always makes a subtype nonstatic. QED.
10331
10332 7.d/3
10333 Reason: We require there to be at least one value so that
10334 these are always values of the subtype. (This sidesteps the
10335 question of what to return for a subtype with no values.)
10336
10337 7.e/3
10338 Discussion: These attributes are intended primarily for use in
10339 the case where the Static_Predicate aspect of S has been
10340 specified; First and Last are equivalent if these are allowed
10341 and there is no predicate.
10342
10343 _Implementation Advice_
10344
10345 8
10346 For the evaluation of a call on S'Pos for an enumeration subtype, if the
10347 value of the operand does not correspond to the internal code for any
10348 enumeration literal of its type [(perhaps due to an uninitialized
10349 variable)], then the implementation should raise Program_Error. This is
10350 particularly important for enumeration types with noncontiguous internal
10351 codes specified by an enumeration_representation_clause (*note 13.4:
10352 S0310.).
10353
10354 8.a.1/2
10355 Implementation Advice: Program_Error should be raised for the
10356 evaluation of S'Pos for an enumeration type, if the value of
10357 the operand does not correspond to the internal code for any
10358 enumeration literal of the type.
10359
10360 8.a
10361 Reason: We say Program_Error here, rather than
10362 Constraint_Error, because the main reason for such values is
10363 uninitialized variables, and the normal way to indicate such a
10364 use (if detected) is to raise Program_Error. (Other reasons
10365 would involve the misuse of low-level features such as
10366 Unchecked_Conversion.)
10367
10368 NOTES
10369
10370 9
10371 33 Indexing and loop iteration use values of discrete types.
10372
10373 10/3
10374 34 {AI05-0299-1AI05-0299-1} The predefined operations of a
10375 discrete type include the assignment operation, qualification, the
10376 membership tests, and the relational operators; for a boolean type
10377 they include the short-circuit control forms and the logical
10378 operators; for an integer type they include type conversion to and
10379 from other numeric types, as well as the binary and unary adding
10380 operators - and +, the multiplying operators, the unary operator
10381 abs, and the exponentiation operator. The assignment operation is
10382 described in *note 5.2::. The other predefined operations are
10383 described in Clause *note 4::.
10384
10385 11
10386 35 As for all types, objects of a discrete type have Size and
10387 Address attributes (see *note 13.3::).
10388
10389 12
10390 36 For a subtype of a discrete type, the result delivered by the
10391 attribute Val might not belong to the subtype; similarly, the
10392 actual parameter of the attribute Pos need not belong to the
10393 subtype. The following relations are satisfied (in the absence of
10394 an exception) by these attributes:
10395
10396 13
10397 S'Val(S'Pos(X)) = X
10398 S'Pos(S'Val(N)) = N
10399
10400 _Examples_
10401
10402 14
10403 Examples of attributes of discrete subtypes:
10404
10405 15
10406 -- For the types and subtypes declared in subclause *note 3.5.1:: the following hold:
10407
10408 16
10409 -- Color'First = White, Color'Last = Black
10410 -- Rainbow'First = Red, Rainbow'Last = Blue
10411
10412 17
10413 -- Color'Succ(Blue) = Rainbow'Succ(Blue) = Brown
10414 -- Color'Pos(Blue) = Rainbow'Pos(Blue) = 4
10415 -- Color'Val(0) = Rainbow'Val(0) = White
10416
10417 _Extensions to Ada 83_
10418
10419 17.a
10420 The attributes S'Succ, S'Pred, S'Width, S'Image, and S'Value
10421 have been generalized to apply to real types as well (see
10422 *note 3.5::, "*note 3.5:: Scalar Types").
10423
10424 _Extensions to Ada 2005_
10425
10426 17.b/3
10427 {AI05-0297-1AI05-0297-1} The attributes S'First_Valid and
10428 S'Last_Valid are new.
10429
10430 \1f
10431 File: aarm2012.info, Node: 3.5.6, Next: 3.5.7, Prev: 3.5.5, Up: 3.5
10432
10433 3.5.6 Real Types
10434 ----------------
10435
10436 1
10437 Real types provide approximations to the real numbers, with relative
10438 bounds on errors for floating point types, and with absolute bounds for
10439 fixed point types.
10440
10441 _Syntax_
10442
10443 2
10444 real_type_definition ::=
10445 floating_point_definition | fixed_point_definition
10446
10447 _Static Semantics_
10448
10449 3
10450 A type defined by a real_type_definition is implicitly derived from
10451 root_real, an anonymous predefined (specific) real type. [Hence, all
10452 real types, whether floating point or fixed point, are in the derivation
10453 class rooted at root_real.]
10454
10455 3.a
10456 Ramification: It is not specified whether the derivation from
10457 root_real is direct or indirect, not that it really matters.
10458 All we want is for all real types to be descendants of
10459 root_real.
10460
10461 3.a.1/1
10462 {8652/00998652/0099} {AI95-00152-01AI95-00152-01} Note that
10463 this derivation does not imply any inheritance of subprograms.
10464 Subprograms are inherited only for types derived by a
10465 derived_type_definition (*note 3.4: S0035.) (see *note 3.4::),
10466 or a private_extension_declaration (*note 7.3: S0194.) (see
10467 *note 7.3::, *note 7.3.1::, and *note 12.5.1::).
10468
10469 4
10470 [ Real literals are all of the type universal_real, the universal type
10471 (see *note 3.4.1::) for the class rooted at root_real, allowing their
10472 use with the operations of any real type. Certain multiplying operators
10473 have a result type of universal_fixed (see *note 4.5.5::), the universal
10474 type for the class of fixed point types, allowing the result of the
10475 multiplication or division to be used where any specific fixed point
10476 type is expected.]
10477
10478 _Dynamic Semantics_
10479
10480 5
10481 The elaboration of a real_type_definition consists of the elaboration of
10482 the floating_point_definition or the fixed_point_definition.
10483
10484 _Implementation Requirements_
10485
10486 6
10487 An implementation shall perform the run-time evaluation of a use of a
10488 predefined operator of root_real with an accuracy at least as great as
10489 that of any floating point type definable by a
10490 floating_point_definition.
10491
10492 6.a
10493 Ramification: Static calculations using the operators of
10494 root_real are exact, as for all static calculations. See
10495 *note 4.9::.
10496
10497 6.b
10498 Implementation Note: The Digits attribute of the type used to
10499 represent root_real at run time is at least as great as that
10500 of any other floating point type defined by a
10501 floating_point_definition, and its safe range includes that of
10502 any such floating point type with the same Digits attribute.
10503 On some machines, there might be real types with less accuracy
10504 but a wider range, and hence run-time calculations with
10505 root_real might not be able to accommodate all values that can
10506 be represented at run time in such floating point or fixed
10507 point types.
10508
10509 _Implementation Permissions_
10510
10511 7/2
10512 {AI95-00114-01AI95-00114-01} [For the execution of a predefined
10513 operation of a real type, the implementation need not raise
10514 Constraint_Error if the result is outside the base range of the type, so
10515 long as the correct result is produced, or the Machine_Overflows
10516 attribute of the type is False (see *note G.2::).]
10517
10518 8
10519 An implementation may provide nonstandard real types, descendants of
10520 root_real that are declared outside of the specification of package
10521 Standard, which need not have all the standard characteristics of a type
10522 defined by a real_type_definition. For example, a nonstandard real type
10523 might have an asymmetric or unsigned base range, or its predefined
10524 operations might wrap around or "saturate" rather than overflow (modular
10525 or saturating arithmetic), or it might not conform to the accuracy model
10526 (see *note G.2::). Any type descended from a nonstandard real type is
10527 also nonstandard. An implementation may place arbitrary restrictions on
10528 the use of such types; it is implementation defined whether operators
10529 that are predefined for "any real type" are defined for a particular
10530 nonstandard real type. [In any case, such types are not permitted as
10531 explicit_generic_actual_parameters for formal scalar types -- see *note
10532 12.5.2::.]
10533
10534 8.a
10535 Implementation defined: Any nonstandard real types and the
10536 operators defined for them.
10537
10538 NOTES
10539
10540 9
10541 37 As stated, real literals are of the anonymous predefined real
10542 type universal_real. Other real types have no literals. However,
10543 the overload resolution rules (see *note 8.6::) allow expressions
10544 of the type universal_real whenever a real type is expected.
10545
10546 _Wording Changes from Ada 83_
10547
10548 9.a
10549 The syntax rule for real_type_definition is modified to use
10550 the new syntactic categories floating_point_definition and
10551 fixed_point_definition, instead of floating_point_constraint
10552 and fixed_point_constraint, because the semantics of a type
10553 definition are significantly different than the semantics of a
10554 constraint.
10555
10556 9.b
10557 All discussion of model numbers, safe ranges, and machine
10558 numbers is moved to *note 3.5.7::, *note 3.5.8::, and *note
10559 G.2::. Values of a fixed point type are now described as
10560 being multiples of the small of the fixed point type, and we
10561 have no need for model numbers, safe ranges, etc. for fixed
10562 point types.
10563
10564 \1f
10565 File: aarm2012.info, Node: 3.5.7, Next: 3.5.8, Prev: 3.5.6, Up: 3.5
10566
10567 3.5.7 Floating Point Types
10568 --------------------------
10569
10570 1
10571 For floating point types, the error bound is specified as a relative
10572 precision by giving the required minimum number of significant decimal
10573 digits.
10574
10575 _Syntax_
10576
10577 2
10578 floating_point_definition ::=
10579 digits static_expression [real_range_specification]
10580
10581 3
10582 real_range_specification ::=
10583 range static_simple_expression .. static_simple_expression
10584
10585 _Name Resolution Rules_
10586
10587 4
10588 The requested decimal precision, which is the minimum number of
10589 significant decimal digits required for the floating point type, is
10590 specified by the value of the expression given after the reserved word
10591 digits. This expression is expected to be of any integer type.
10592
10593 5
10594 Each simple_expression of a real_range_specification is expected to be
10595 of any real type[; the types need not be the same].
10596
10597 _Legality Rules_
10598
10599 6
10600 The requested decimal precision shall be specified by a static
10601 expression whose value is positive and no greater than
10602 System.Max_Base_Digits. Each simple_expression of a
10603 real_range_specification shall also be static. If the
10604 real_range_specification is omitted, the requested decimal precision
10605 shall be no greater than System.Max_Digits.
10606
10607 6.a
10608 Reason: We have added Max_Base_Digits to package System. It
10609 corresponds to the requested decimal precision of root_real.
10610 System.Max_Digits corresponds to the maximum value for Digits
10611 that may be specified in the absence of a
10612 real_range_specification, for upward compatibility. These
10613 might not be the same if root_real has a base range that does
10614 not include ± 10.0**(4*Max_Base_Digits).
10615
10616 7
10617 A floating_point_definition is illegal if the implementation does not
10618 support a floating point type that satisfies the requested decimal
10619 precision and range.
10620
10621 7.a
10622 Implementation defined: What combinations of requested decimal
10623 precision and range are supported for floating point types.
10624
10625 _Static Semantics_
10626
10627 8
10628 The set of values for a floating point type is the (infinite) set of
10629 rational numbers. The machine numbers of a floating point type are the
10630 values of the type that can be represented exactly in every
10631 unconstrained variable of the type. The base range (see *note 3.5::) of
10632 a floating point type is symmetric around zero, except that it can
10633 include some extra negative values in some implementations.
10634
10635 8.a
10636 Implementation Note: For example, if a 2's complement
10637 representation is used for the mantissa rather than a
10638 sign-mantissa or 1's complement representation, then there is
10639 usually one extra negative machine number.
10640
10641 8.b
10642 To be honest: If the Signed_Zeros attribute is True, then
10643 minus zero could in a sense be considered a value of the type.
10644 However, for most purposes, minus zero behaves the same as
10645 plus zero.
10646
10647 9
10648 The base decimal precision of a floating point type is the number of
10649 decimal digits of precision representable in objects of the type. The
10650 safe range of a floating point type is that part of its base range for
10651 which the accuracy corresponding to the base decimal precision is
10652 preserved by all predefined operations.
10653
10654 9.a
10655 Implementation Note: In most cases, the safe range and base
10656 range are the same. However, for some hardware, values near
10657 the boundaries of the base range might result in excessive
10658 inaccuracies or spurious overflows when used with certain
10659 predefined operations. For such hardware, the safe range
10660 would omit such values.
10661
10662 10
10663 A floating_point_definition defines a floating point type whose base
10664 decimal precision is no less than the requested decimal precision. If a
10665 real_range_specification is given, the safe range of the floating point
10666 type (and hence, also its base range) includes at least the values of
10667 the simple expressions given in the real_range_specification. If a
10668 real_range_specification is not given, the safe (and base) range of the
10669 type includes at least the values of the range -10.0**(4*D) ..
10670 +10.0**(4*D) where D is the requested decimal precision. [The safe
10671 range might include other values as well. The attributes Safe_First and
10672 Safe_Last give the actual bounds of the safe range.]
10673
10674 11
10675 A floating_point_definition also defines a first subtype of the type.
10676 If a real_range_specification is given, then the subtype is constrained
10677 to a range whose bounds are given by a conversion of the values of the
10678 simple_expressions of the real_range_specification to the type being
10679 defined. Otherwise, the subtype is unconstrained.
10680
10681 11.a.1/1
10682 To be honest: The conversion mentioned above is not an
10683 implicit subtype conversion (which is something that happens
10684 at overload resolution, see *note 4.6::), although it happens
10685 implicitly. Therefore, the freezing rules are not invoked on
10686 the type (which is important so that representation items can
10687 be given for the type).
10688
10689 12
10690 There is a predefined, unconstrained, floating point subtype named
10691 Float[, declared in the visible part of package Standard].
10692
10693 _Dynamic Semantics_
10694
10695 13
10696 [The elaboration of a floating_point_definition creates the floating
10697 point type and its first subtype.]
10698
10699 _Implementation Requirements_
10700
10701 14
10702 In an implementation that supports floating point types with 6 or more
10703 digits of precision, the requested decimal precision for Float shall be
10704 at least 6.
10705
10706 15
10707 If Long_Float is predefined for an implementation, then its requested
10708 decimal precision shall be at least 11.
10709
10710 _Implementation Permissions_
10711
10712 16
10713 An implementation is allowed to provide additional predefined floating
10714 point types[, declared in the visible part of Standard], whose
10715 (unconstrained) first subtypes have names of the form Short_Float,
10716 Long_Float, Short_Short_Float, Long_Long_Float, etc. Different
10717 predefined floating point types are allowed to have the same base
10718 decimal precision. However, the precision of Float should be no greater
10719 than that of Long_Float. Similarly, the precision of Short_Float (if
10720 provided) should be no greater than Float. Corresponding
10721 recommendations apply to any other predefined floating point types.
10722 There need not be a named floating point type corresponding to each
10723 distinct base decimal precision supported by an implementation.
10724
10725 16.a
10726 Implementation defined: The predefined floating point types
10727 declared in Standard.
10728
10729 _Implementation Advice_
10730
10731 17
10732 An implementation should support Long_Float in addition to Float if the
10733 target machine supports 11 or more digits of precision. No other named
10734 floating point subtypes are recommended for package Standard. Instead,
10735 appropriate named floating point subtypes should be provided in the
10736 library package Interfaces (see *note B.2::).
10737
10738 17.a.1/2
10739 Implementation Advice: Long_Float should be declared in
10740 Standard if the target supports 11 or more digits of
10741 precision. No other named float subtypes should be declared
10742 in Standard.
10743
10744 17.a
10745 Implementation Note: To promote portability, implementations
10746 should explicitly declare the floating point (sub)types Float
10747 and Long_Float in Standard, and leave other predefined float
10748 types anonymous. For implementations that already support
10749 Short_Float, etc., upward compatibility argues for keeping
10750 such declarations in Standard during the transition period,
10751 but perhaps generating a warning on use. A separate package
10752 Interfaces in the predefined environment is available for
10753 pre-declaring types such as Float_32, IEEE_Float_64, etc. See
10754 *note B.2::.
10755
10756 NOTES
10757
10758 18
10759 38 If a floating point subtype is unconstrained, then assignments
10760 to variables of the subtype involve only Overflow_Checks, never
10761 Range_Checks.
10762
10763 _Examples_
10764
10765 19
10766 Examples of floating point types and subtypes:
10767
10768 20
10769 type Coefficient is digits 10 range -1.0 .. 1.0;
10770
10771 21
10772 type Real is digits 8;
10773 type Mass is digits 7 range 0.0 .. 1.0E35;
10774
10775 22
10776 subtype Probability is Real range 0.0 .. 1.0; -- a subtype with a smaller range
10777
10778 _Inconsistencies With Ada 83_
10779
10780 22.a
10781 No Range_Checks, only Overflow_Checks, are performed on
10782 variables (or parameters) of an unconstrained floating point
10783 subtype. This is upward compatible for programs that do not
10784 raise Constraint_Error. For those that do raise
10785 Constraint_Error, it is possible that the exception will be
10786 raised at a later point, or not at all, if extended range
10787 floating point registers are used to hold the value of the
10788 variable (or parameter).
10789
10790 22.b
10791 Reason: This change was felt to be justified by the
10792 possibility of improved performance on machines with
10793 extended-range floating point registers. An implementation
10794 need not take advantage of this relaxation in the range
10795 checking; it can hide completely the use of extended range
10796 registers if desired, presumably at some run-time expense.
10797
10798 _Wording Changes from Ada 83_
10799
10800 22.c
10801 The syntax rules for floating_point_constraint and
10802 floating_accuracy_definition are removed. The syntax rules
10803 for floating_point_definition and real_range_specification are
10804 new.
10805
10806 22.d
10807 A syntax rule for digits_constraint is given in *note 3.5.9::,
10808 "*note 3.5.9:: Fixed Point Types". In *note J.3:: we indicate
10809 that a digits_constraint may be applied to a floating point
10810 subtype_mark as well (to be compatible with Ada 83's
10811 floating_point_constraint).
10812
10813 22.e
10814 Discussion of model numbers is postponed to *note 3.5.8:: and
10815 *note G.2::. The concept of safe numbers has been replaced by
10816 the concept of the safe range of values. The bounds of the
10817 safe range are given by T'Safe_First .. T'Safe_Last, rather
10818 than -T'Safe_Large .. T'Safe_Large, since on some machines
10819 the safe range is not perfectly symmetric. The concept of
10820 machine numbers is new, and is relevant to the definition of
10821 Succ and Pred for floating point numbers.
10822
10823 \1f
10824 File: aarm2012.info, Node: 3.5.8, Next: 3.5.9, Prev: 3.5.7, Up: 3.5
10825
10826 3.5.8 Operations of Floating Point Types
10827 ----------------------------------------
10828
10829 _Static Semantics_
10830
10831 1
10832 The following attribute is defined for every floating point subtype S:
10833
10834 2/1
10835 S'Digits
10836 {8652/00048652/0004} {AI95-00203-01AI95-00203-01}
10837 S'Digits denotes the requested decimal precision for the
10838 subtype S. The value of this attribute is of the type
10839 universal_integer. The requested decimal precision of
10840 the base subtype of a floating point type T is defined to
10841 be the largest value of d for which
10842 ceiling(d * log(10) / log(T'Machine_Radix)) + g <=
10843 T'Model_Mantissa
10844 where g is 0 if Machine_Radix is a positive power of 10
10845 and 1 otherwise.
10846
10847 NOTES
10848
10849 3
10850 39 The predefined operations of a floating point type include the
10851 assignment operation, qualification, the membership tests, and
10852 explicit conversion to and from other numeric types. They also
10853 include the relational operators and the following predefined
10854 arithmetic operators: the binary and unary adding operators - and
10855 +, certain multiplying operators, the unary operator abs, and the
10856 exponentiation operator.
10857
10858 4
10859 40 As for all types, objects of a floating point type have Size
10860 and Address attributes (see *note 13.3::). Other attributes of
10861 floating point types are defined in *note A.5.3::.
10862
10863 _Wording Changes from Ada 95_
10864
10865 4.a/2
10866 {8652/00048652/0004} {AI95-00203-01AI95-00203-01} Corrigendum:
10867 Corrected the formula for Digits when the Machine_Radix is 10.
10868
10869 \1f
10870 File: aarm2012.info, Node: 3.5.9, Next: 3.5.10, Prev: 3.5.8, Up: 3.5
10871
10872 3.5.9 Fixed Point Types
10873 -----------------------
10874
10875 1
10876 A fixed point type is either an ordinary fixed point type, or a decimal
10877 fixed point type. The error bound of a fixed point type is specified as
10878 an absolute value, called the delta of the fixed point type.
10879
10880 _Syntax_
10881
10882 2
10883 fixed_point_definition ::= ordinary_fixed_point_definition |
10884 decimal_fixed_point_definition
10885
10886 3
10887 ordinary_fixed_point_definition ::=
10888 delta static_expression real_range_specification
10889
10890 4
10891 decimal_fixed_point_definition ::=
10892 delta static_expression digits static_expression [
10893 real_range_specification]
10894
10895 5
10896 digits_constraint ::=
10897 digits static_expression [range_constraint]
10898
10899 _Name Resolution Rules_
10900
10901 6
10902 For a type defined by a fixed_point_definition, the delta of the type is
10903 specified by the value of the expression given after the reserved word
10904 delta; this expression is expected to be of any real type. For a type
10905 defined by a decimal_fixed_point_definition (a decimal fixed point
10906 type), the number of significant decimal digits for its first subtype
10907 (the digits of the first subtype) is specified by the expression given
10908 after the reserved word digits; this expression is expected to be of any
10909 integer type.
10910
10911 _Legality Rules_
10912
10913 7
10914 In a fixed_point_definition or digits_constraint, the expressions given
10915 after the reserved words delta and digits shall be static; their values
10916 shall be positive.
10917
10918 8/2
10919 {AI95-00100-01AI95-00100-01} The set of values of a fixed point type
10920 comprise the integral multiples of a number called the small of the
10921 type. The machine numbers of a fixed point type are the values of the
10922 type that can be represented exactly in every unconstrained variable of
10923 the type. For a type defined by an ordinary_fixed_point_definition (an
10924 ordinary fixed point type), the small may be specified by an
10925 attribute_definition_clause (*note 13.3: S0309.) (see *note 13.3::); if
10926 so specified, it shall be no greater than the delta of the type. If not
10927 specified, the small of an ordinary fixed point type is an
10928 implementation-defined power of two less than or equal to the delta.
10929
10930 8.a
10931 Implementation defined: The small of an ordinary fixed point
10932 type.
10933
10934 9
10935 For a decimal fixed point type, the small equals the delta; the delta
10936 shall be a power of 10. If a real_range_specification is given, both
10937 bounds of the range shall be in the range -(10**digits-1)*delta ..
10938 +(10**digits-1)*delta.
10939
10940 10
10941 A fixed_point_definition is illegal if the implementation does not
10942 support a fixed point type with the given small and specified range or
10943 digits.
10944
10945 10.a
10946 Implementation defined: What combinations of small, range, and
10947 digits are supported for fixed point types.
10948
10949 11
10950 For a subtype_indication with a digits_constraint, the subtype_mark
10951 shall denote a decimal fixed point subtype.
10952
10953 11.a
10954 To be honest: Or, as an obsolescent feature, a floating point
10955 subtype is permitted -- see *note J.3::.
10956
10957 _Static Semantics_
10958
10959 12
10960 The base range (see *note 3.5::) of a fixed point type is symmetric
10961 around zero, except possibly for an extra negative value in some
10962 implementations.
10963
10964 13
10965 An ordinary_fixed_point_definition defines an ordinary fixed point type
10966 whose base range includes at least all multiples of small that are
10967 between the bounds specified in the real_range_specification. The base
10968 range of the type does not necessarily include the specified bounds
10969 themselves. An ordinary_fixed_point_definition (*note 3.5.9: S0048.)
10970 also defines a constrained first subtype of the type, with each bound of
10971 its range given by the closer to zero of:
10972
10973 14
10974 * the value of the conversion to the fixed point type of the
10975 corresponding expression of the real_range_specification;
10976
10977 14.a.1/1
10978 To be honest: The conversion mentioned above is not an
10979 implicit subtype conversion (which is something that happens
10980 at overload resolution, see *note 4.6::), although it happens
10981 implicitly. Therefore, the freezing rules are not invoked on
10982 the type (which is important so that representation items can
10983 be given for the type).
10984
10985 15
10986 * the corresponding bound of the base range.
10987
10988 16
10989 A decimal_fixed_point_definition defines a decimal fixed point type
10990 whose base range includes at least the range -(10**digits-1)*delta ..
10991 +(10**digits-1)*delta. A decimal_fixed_point_definition also defines a
10992 constrained first subtype of the type. If a real_range_specification is
10993 given, the bounds of the first subtype are given by a conversion of the
10994 values of the expressions of the real_range_specification. Otherwise,
10995 the range of the first subtype is -(10**digits-1)*delta ..
10996 +(10**digits-1)*delta.
10997
10998 16.a.1/1
10999 To be honest: The conversion mentioned above is not an
11000 implicit subtype conversion (which is something that happens
11001 at overload resolution, see *note 4.6::), although it happens
11002 implicitly. Therefore, the freezing rules are not invoked on
11003 the type (which is important so that representation items can
11004 be given for the type).
11005
11006 _Dynamic Semantics_
11007
11008 17
11009 The elaboration of a fixed_point_definition creates the fixed point type
11010 and its first subtype.
11011
11012 18
11013 For a digits_constraint on a decimal fixed point subtype with a given
11014 delta, if it does not have a range_constraint, then it specifies an
11015 implicit range -(10**D-1)*delta .. +(10**D-1)*delta, where D is the
11016 value of the expression. A digits_constraint is compatible with a
11017 decimal fixed point subtype if the value of the expression is no greater
11018 than the digits of the subtype, and if it specifies (explicitly or
11019 implicitly) a range that is compatible with the subtype.
11020
11021 18.a
11022 Discussion: Except for the requirement that the digits
11023 specified be no greater than the digits of the subtype being
11024 constrained, a digits_constraint is essentially equivalent to
11025 a range_constraint.
11026
11027 18.b
11028 Consider the following example:
11029
11030 18.c
11031 type D is delta 0.01 digits 7 range -0.00 .. 9999.99;
11032
11033 18.d/1
11034 The compatibility rule implies that the digits_constraint
11035 "digits 6" specifies an implicit range of "-9999.99 ..
11036 9999.99". Thus, "digits 6" is not compatible with the
11037 constraint of D, but "digits 6 range 0.00 .. 9999.99" is
11038 compatible.
11039
11040 18.e/2
11041 {AI95-00114-01AI95-00114-01} A value of a scalar type belongs
11042 to a constrained subtype of the type if it belongs to the
11043 range of the subtype. Attributes like Digits and Delta have
11044 no effect on this fundamental rule. So the obsolescent forms
11045 of digits_constraints and delta_constraints that are called
11046 "accuracy constraints" in RM83 don't really represent
11047 constraints on the values of the subtype, but rather primarily
11048 affect compatibility of the "constraint" with the subtype
11049 being "constrained." In this sense, they might better be
11050 called "subtype assertions" rather than "constraints."
11051
11052 18.f
11053 Note that the digits_constraint on a decimal fixed point
11054 subtype is a combination of an assertion about the digits of
11055 the subtype being further constrained, and a constraint on the
11056 range of the subtype being defined, either explicit or
11057 implicit.
11058
11059 19
11060 The elaboration of a digits_constraint consists of the elaboration of
11061 the range_constraint, if any. If a range_constraint is given, a check
11062 is made that the bounds of the range are both in the range
11063 -(10**D-1)*delta .. +(10**D-1)*delta, where D is the value of the
11064 (static) expression given after the reserved word digits. If this check
11065 fails, Constraint_Error is raised.
11066
11067 _Implementation Requirements_
11068
11069 20
11070 The implementation shall support at least 24 bits of precision
11071 (including the sign bit) for fixed point types.
11072
11073 20.a
11074 Reason: This is sufficient to represent Standard.Duration with
11075 a small no more than 50 milliseconds.
11076
11077 _Implementation Permissions_
11078
11079 21
11080 Implementations are permitted to support only smalls that are a power of
11081 two. In particular, all decimal fixed point type declarations can be
11082 disallowed. Note however that conformance with the Information Systems
11083 Annex requires support for decimal smalls, and decimal fixed point type
11084 declarations with digits up to at least 18.
11085
11086 21.a
11087 Implementation Note: The accuracy requirements for
11088 multiplication, division, and conversion (see *note G.2.1::,
11089 "*note G.2.1:: Model of Floating Point Arithmetic") are such
11090 that support for arbitrary smalls should be practical without
11091 undue implementation effort. Therefore, implementations
11092 should support fixed point types with arbitrary values for
11093 small (within reason). One reasonable limitation would be to
11094 limit support to fixed point types that can be converted to
11095 the most precise floating point type without loss of precision
11096 (so that Fixed_IO is implementable in terms of Float_IO).
11097
11098 NOTES
11099
11100 22
11101 41 The base range of an ordinary fixed point type need not include
11102 the specified bounds themselves so that the range specification can
11103 be given in a natural way, such as:
11104
11105 23
11106 type Fraction is delta 2.0**(-15) range -1.0 .. 1.0;
11107
11108
11109 24
11110 With 2's complement hardware, such a type could have a signed
11111 16-bit representation, using 1 bit for the sign and 15 bits for
11112 fraction, resulting in a base range of -1.0 .. 1.0-2.0**(-15).
11113
11114 _Examples_
11115
11116 25
11117 Examples of fixed point types and subtypes:
11118
11119 26
11120 type Volt is delta 0.125 range 0.0 .. 255.0;
11121
11122 27
11123 -- A pure fraction which requires all the available
11124 -- space in a word can be declared as the type Fraction:
11125 type Fraction is delta System.Fine_Delta range -1.0 .. 1.0;
11126 -- Fraction'Last = 1.0 - System.Fine_Delta
11127
11128 28
11129 type Money is delta 0.01 digits 15; -- decimal fixed point
11130 subtype Salary is Money digits 10;
11131 -- Money'Last = 10.0**13 - 0.01, Salary'Last = 10.0**8 - 0.01
11132
11133 _Inconsistencies With Ada 83_
11134
11135 28.a
11136 In Ada 95, S'Small always equals S'Base'Small, so if an
11137 implementation chooses a small for a fixed point type smaller
11138 than required by the delta, the value of S'Small in Ada 95
11139 might not be the same as it was in Ada 83.
11140
11141 _Extensions to Ada 83_
11142
11143 28.b/3
11144 {AI05-0005-1AI05-0005-1} Decimal fixed point types are new,
11145 though their capabilities are essentially similar to that
11146 available in Ada 83 with a fixed point type whose small equals
11147 its delta and both are a power of 10. However, in the
11148 Information Systems Annex, additional requirements are placed
11149 on the support of decimal fixed point types (e.g. a minimum
11150 of 18 digits of precision).
11151
11152 _Wording Changes from Ada 83_
11153
11154 28.c
11155 The syntax rules for fixed_point_constraint and
11156 fixed_accuracy_definition are removed. The syntax rule for
11157 fixed_point_definition is new. A syntax rule for
11158 delta_constraint is included in the Obsolescent features (to
11159 be compatible with Ada 83's fixed_point_constraint).
11160
11161 _Wording Changes from Ada 95_
11162
11163 28.d/2
11164 {AI95-00100-01AI95-00100-01} Added wording to define the
11165 machine numbers of fixed point types; this is needed by the
11166 static evaluation rules.
11167
11168 \1f
11169 File: aarm2012.info, Node: 3.5.10, Prev: 3.5.9, Up: 3.5
11170
11171 3.5.10 Operations of Fixed Point Types
11172 --------------------------------------
11173
11174 _Static Semantics_
11175
11176 1
11177 The following attributes are defined for every fixed point subtype S:
11178
11179 2/1
11180 S'Small
11181 {8652/00058652/0005} {AI95-00054-01AI95-00054-01} S'Small
11182 denotes the small of the type of S. The value of this
11183 attribute is of the type universal_real. Small may be
11184 specified for nonderived ordinary fixed point types via
11185 an attribute_definition_clause (*note 13.3: S0309.) (see
11186 *note 13.3::); the expression of such a clause shall be
11187 static.
11188
11189 2.a/3
11190 Aspect Description for Small: Scale factor for a fixed point
11191 type.
11192
11193 3
11194 S'Delta
11195 S'Delta denotes the delta of the fixed point subtype S.
11196 The value of this attribute is of the type
11197 universal_real.
11198
11199 3.a
11200 Reason: The delta is associated with the subtype as opposed to
11201 the type, because of the possibility of an (obsolescent)
11202 delta_constraint.
11203
11204 4
11205 S'Fore
11206 S'Fore yields the minimum number of characters needed
11207 before the decimal point for the decimal representation
11208 of any value of the subtype S, assuming that the
11209 representation does not include an exponent, but includes
11210 a one-character prefix that is either a minus sign or a
11211 space. (This minimum number does not include superfluous
11212 zeros or underlines, and is at least 2.) The value of
11213 this attribute is of the type universal_integer.
11214
11215 5
11216 S'Aft
11217 S'Aft yields the number of decimal digits needed after
11218 the decimal point to accommodate the delta of the subtype
11219 S, unless the delta of the subtype S is greater than 0.1,
11220 in which case the attribute yields the value one.
11221 [(S'Aft is the smallest positive integer N for which
11222 (10**N)*S'Delta is greater than or equal to one.)] The
11223 value of this attribute is of the type universal_integer.
11224
11225 6
11226 The following additional attributes are defined for every decimal fixed
11227 point subtype S:
11228
11229 7
11230 S'Digits
11231 S'Digits denotes the digits of the decimal fixed point
11232 subtype S, which corresponds to the number of decimal
11233 digits that are representable in objects of the subtype.
11234 The value of this attribute is of the type
11235 universal_integer. Its value is determined as follows:
11236
11237 8
11238 * For a first subtype or a subtype defined by a
11239 subtype_indication with a digits_constraint, the
11240 digits is the value of the expression given after
11241 the reserved word digits;
11242
11243 9
11244 * For a subtype defined by a subtype_indication
11245 without a digits_constraint, the digits of the
11246 subtype is the same as that of the subtype denoted
11247 by the subtype_mark in the subtype_indication.
11248
11249 9.a
11250 Implementation Note: Although a decimal subtype can be both
11251 range-constrained and digits-constrained, the digits
11252 constraint is intended to control the Size attribute of the
11253 subtype. For decimal types, Size can be important because
11254 input/output of decimal types is so common.
11255
11256 10
11257 * The digits of a base subtype is the largest integer
11258 D such that the range -(10**D-1)*delta ..
11259 +(10**D-1)*delta is included in the base range of
11260 the type.
11261
11262 11
11263 S'Scale
11264 S'Scale denotes the scale of the subtype S, defined as
11265 the value N such that S'Delta = 10.0**(-N). [The scale
11266 indicates the position of the point relative to the
11267 rightmost significant digits of values of subtype S.] The
11268 value of this attribute is of the type universal_integer.
11269
11270 11.a
11271 Ramification: S'Scale is negative if S'Delta is greater than
11272 one. By contrast, S'Aft is always positive.
11273
11274 12
11275 S'Round
11276 S'Round denotes a function with the following
11277 specification:
11278
11279 13
11280 function S'Round(X : universal_real)
11281 return S'Base
11282
11283 14
11284 The function returns the value obtained by rounding X
11285 (away from 0, if X is midway between two values of the
11286 type of S).
11287
11288 NOTES
11289
11290 15
11291 42 All subtypes of a fixed point type will have the same value for
11292 the Delta attribute, in the absence of delta_constraints (see *note
11293 J.3::).
11294
11295 16
11296 43 S'Scale is not always the same as S'Aft for a decimal subtype;
11297 for example, if S'Delta = 1.0 then S'Aft is 1 while S'Scale is 0.
11298
11299 17
11300 44 The predefined operations of a fixed point type include the
11301 assignment operation, qualification, the membership tests, and
11302 explicit conversion to and from other numeric types. They also
11303 include the relational operators and the following predefined
11304 arithmetic operators: the binary and unary adding operators - and
11305 +, multiplying operators, and the unary operator abs.
11306
11307 18
11308 45 As for all types, objects of a fixed point type have Size and
11309 Address attributes (see *note 13.3::). Other attributes of fixed
11310 point types are defined in *note A.5.4::.
11311
11312 _Wording Changes from Ada 95_
11313
11314 18.a/2
11315 {8652/00058652/0005} {AI95-00054-01AI95-00054-01} Corrigendum:
11316 Clarified that small may be specified only for ordinary fixed
11317 point types.
11318
11319 \1f
11320 File: aarm2012.info, Node: 3.6, Next: 3.7, Prev: 3.5, Up: 3
11321
11322 3.6 Array Types
11323 ===============
11324
11325 1
11326 An array object is a composite object consisting of components which all
11327 have the same subtype. The name for a component of an array uses one or
11328 more index values belonging to specified discrete types. The value of
11329 an array object is a composite value consisting of the values of the
11330 components.
11331
11332 _Syntax_
11333
11334 2
11335 array_type_definition ::=
11336 unconstrained_array_definition | constrained_array_definition
11337
11338 3
11339 unconstrained_array_definition ::=
11340 array(index_subtype_definition {, index_subtype_definition}) of
11341 component_definition
11342
11343 4
11344 index_subtype_definition ::= subtype_mark range <>
11345
11346 5
11347 constrained_array_definition ::=
11348 array (discrete_subtype_definition {,
11349 discrete_subtype_definition}) of component_definition
11350
11351 6
11352 discrete_subtype_definition ::= discrete_subtype_indication | range
11353
11354 7/2
11355 {AI95-00230-01AI95-00230-01} {AI95-00406-01AI95-00406-01}
11356 component_definition ::=
11357 [aliased] subtype_indication
11358 | [aliased] access_definition
11359
11360 _Name Resolution Rules_
11361
11362 8
11363 For a discrete_subtype_definition that is a range, the range shall
11364 resolve to be of some specific discrete type[; which discrete type shall
11365 be determined without using any context other than the bounds of the
11366 range itself (plus the preference for root_integer -- see *note 8.6::).]
11367
11368 _Legality Rules_
11369
11370 9
11371 Each index_subtype_definition or discrete_subtype_definition in an
11372 array_type_definition defines an index subtype; its type (the index
11373 type) shall be discrete.
11374
11375 9.a
11376 Discussion: An index is a discrete quantity used to select
11377 along a given dimension of an array. A component is selected
11378 by specifying corresponding values for each of the indices.
11379
11380 10
11381 The subtype defined by the subtype_indication of a component_definition
11382 (the component subtype) shall be a definite subtype.
11383
11384 10.a
11385 Ramification: This applies to all uses of
11386 component_definition, including in record_type_definitions and
11387 protected_definitions.
11388
11389 11/2
11390 This paragraph was deleted.{AI95-00363-01AI95-00363-01}
11391
11392 _Static Semantics_
11393
11394 12
11395 An array is characterized by the number of indices (the dimensionality
11396 of the array), the type and position of each index, the lower and upper
11397 bounds for each index, and the subtype of the components. The order of
11398 the indices is significant.
11399
11400 13
11401 A one-dimensional array has a distinct component for each possible index
11402 value. A multidimensional array has a distinct component for each
11403 possible sequence of index values that can be formed by selecting one
11404 value for each index position (in the given order). The possible values
11405 for a given index are all the values between the lower and upper bounds,
11406 inclusive; this range of values is called the index range. The bounds
11407 of an array are the bounds of its index ranges. The length of a
11408 dimension of an array is the number of values of the index range of the
11409 dimension (zero for a null range). The length of a one-dimensional
11410 array is the length of its only dimension.
11411
11412 14
11413 An array_type_definition defines an array type and its first subtype.
11414 For each object of this array type, the number of indices, the type and
11415 position of each index, and the subtype of the components are as in the
11416 type definition[; the values of the lower and upper bounds for each
11417 index belong to the corresponding index subtype of its type, except for
11418 null arrays (see *note 3.6.1::)].
11419
11420 15
11421 An unconstrained_array_definition defines an array type with an
11422 unconstrained first subtype. Each index_subtype_definition (*note 3.6:
11423 S0053.) defines the corresponding index subtype to be the subtype
11424 denoted by the subtype_mark (*note 3.2.2: S0028.). [ The compound
11425 delimiter <> (called a box) of an index_subtype_definition stands for an
11426 undefined range (different objects of the type need not have the same
11427 bounds).]
11428
11429 16
11430 A constrained_array_definition defines an array type with a constrained
11431 first subtype. Each discrete_subtype_definition (*note 3.6: S0055.)
11432 defines the corresponding index subtype, as well as the corresponding
11433 index range for the constrained first subtype. The constraint of the
11434 first subtype consists of the bounds of the index ranges.
11435
11436 16.a/3
11437 Discussion: {AI05-0005-1AI05-0005-1} Although there is no
11438 nameable unconstrained array subtype in this case, the
11439 predefined slicing and concatenation operations can operate on
11440 and yield values that do not necessarily belong to the first
11441 array subtype. This is also true for Ada 83.
11442
11443 17
11444 The discrete subtype defined by a discrete_subtype_definition (*note
11445 3.6: S0055.) is either that defined by the subtype_indication (*note
11446 3.2.2: S0027.), or a subtype determined by the range as follows:
11447
11448 18
11449 * If the type of the range resolves to root_integer, then the
11450 discrete_subtype_definition defines a subtype of the predefined
11451 type Integer with bounds given by a conversion to Integer of the
11452 bounds of the range;
11453
11454 18.a
11455 Reason: This ensures that indexing over the discrete subtype
11456 can be performed with regular Integers, rather than only
11457 universal_integers.
11458
11459 18.b
11460 Discussion: We considered doing this by simply creating a
11461 "preference" for Integer when resolving the range. However,
11462 this can introduce Beaujolais effects when the
11463 simple_expressions involve calls on functions visible due to
11464 use clauses.
11465
11466 19
11467 * Otherwise, the discrete_subtype_definition defines a subtype of the
11468 type of the range, with the bounds given by the range.
11469
11470 20
11471 The component_definition of an array_type_definition defines the nominal
11472 subtype of the components. If the reserved word aliased appears in the
11473 component_definition, then each component of the array is aliased (see
11474 *note 3.10::).
11475
11476 _Dynamic Semantics_
11477
11478 21
11479 The elaboration of an array_type_definition creates the array type and
11480 its first subtype, and consists of the elaboration of any
11481 discrete_subtype_definition (*note 3.6: S0055.)s and the
11482 component_definition (*note 3.6: S0056.).
11483
11484 22/2
11485 {8652/00028652/0002} {AI95-00171-01AI95-00171-01}
11486 {AI95-00230-01AI95-00230-01} The elaboration of a
11487 discrete_subtype_definition that does not contain any per-object
11488 expressions creates the discrete subtype, and consists of the
11489 elaboration of the subtype_indication (*note 3.2.2: S0027.) or the
11490 evaluation of the range. The elaboration of a
11491 discrete_subtype_definition that contains one or more per-object
11492 expressions is defined in *note 3.8::. The elaboration of a
11493 component_definition (*note 3.6: S0056.) in an array_type_definition
11494 (*note 3.6: S0051.) consists of the elaboration of the
11495 subtype_indication (*note 3.2.2: S0027.) or access_definition. The
11496 elaboration of any discrete_subtype_definition (*note 3.6: S0055.)s and
11497 the elaboration of the component_definition (*note 3.6: S0056.) are
11498 performed in an arbitrary order.
11499
11500 _Static Semantics_
11501
11502 22.1/3
11503 {AI05-0228-1AI05-0228-1} For an array type with a scalar component type,
11504 the following language-defined representation aspect may be specified
11505 with an aspect_specification (see *note 13.1.1::):
11506
11507 22.2/3
11508 Default_Component_Value
11509 This aspect shall be specified by a static expression,
11510 and that expression shall be explicit, even if the aspect
11511 has a boolean type. Default_Component_Value shall be
11512 specified only on a full_type_declaration.
11513
11514 22.a/3
11515 Reason: The part about requiring an explicit expression is to
11516 disallow omitting the value for this aspect, which would
11517 otherwise be allowed by the rules of *note 13.1.1::.
11518
11519 22.b/3
11520 This is a representation attribute in order to disallow
11521 specifying it on a derived type that has inherited primitive
11522 subprograms; that is necessary as the sizes of out parameters
11523 could be different whether or not a Default_Value is specified
11524 (see *note 6.4.1::).
11525
11526 22.c/3
11527 Aspect Description for Default_Component_Value: Default value
11528 for the components of an array-of-scalar subtype.
11529
11530 22.3/3
11531 {AI05-0228-1AI05-0228-1} If a derived type with no primitive subprograms
11532 inherits a boolean Default_Component_Value aspect, the aspect may be
11533 specified to have any value for the derived type.
11534
11535 22.d/3
11536 Reason: This overrides the *note 13.1.1:: rule that says that
11537 a boolean aspect with a value True cannot be changed.
11538
11539 _Name Resolution Rules_
11540
11541 22.4/3
11542 {AI05-0228-1AI05-0228-1} The expected type for the expression specified
11543 for the Default_Component_Value aspect is the component type of the
11544 array type defined by the full_type_declaration on which it appears.
11545
11546 NOTES
11547
11548 23
11549 46 All components of an array have the same subtype. In
11550 particular, for an array of components that are one-dimensional
11551 arrays, this means that all components have the same bounds and
11552 hence the same length.
11553
11554 24
11555 47 Each elaboration of an array_type_definition creates a distinct
11556 array type. A consequence of this is that each object whose
11557 object_declaration contains an array_type_definition is of its own
11558 unique type.
11559
11560 _Examples_
11561
11562 25
11563 Examples of type declarations with unconstrained array definitions:
11564
11565 26
11566 type Vector is array(Integer range <>) of Real;
11567 type Matrix is array(Integer range <>, Integer range <>) of Real;
11568 type Bit_Vector is array(Integer range <>) of Boolean;
11569 type Roman is array(Positive range <>) of Roman_Digit; -- see *note 3.5.2::
11570
11571 27
11572 Examples of type declarations with constrained array definitions:
11573
11574 28
11575 type Table is array(1 .. 10) of Integer;
11576 type Schedule is array(Day) of Boolean;
11577 type Line is array(1 .. Max_Line_Size) of Character;
11578
11579 29
11580 Examples of object declarations with array type definitions:
11581
11582 30/2
11583 {AI95-00433-01AI95-00433-01} Grid : array(1 .. 80, 1 .. 100) of Boolean;
11584 Mix : array(Color range Red .. Green) of Boolean;
11585 Msg_Table : constant array(Error_Code) of access constant String :=
11586 (Too_Big => new String'("Result too big"), Too_Small => ...);
11587 Page : array(Positive range <>) of Line := -- an array of arrays
11588 (1 | 50 => Line'(1 | Line'Last => '+', others => '-'), -- see *note 4.3.3::
11589 2 .. 49 => Line'(1 | Line'Last => '|', others => ' '));
11590 -- Page is constrained by its initial value to (1..50)
11591
11592 _Extensions to Ada 83_
11593
11594 30.a
11595 The syntax rule for component_definition is modified to allow
11596 the reserved word aliased.
11597
11598 30.b
11599 The syntax rules for unconstrained_array_definition and
11600 constrained_array_definition are modified to use
11601 component_definition (instead of
11602 component_subtype_indication). The effect of this change is
11603 to allow the reserved word aliased before the component
11604 subtype_indication.
11605
11606 30.c
11607 A range in a discrete_subtype_definition may use arbitrary
11608 universal expressions for each bound (e.g. -1 .. 3+5),
11609 rather than strictly "implicitly convertible" operands. The
11610 subtype defined will still be a subtype of Integer.
11611
11612 _Wording Changes from Ada 83_
11613
11614 30.d
11615 We introduce a new syntactic category,
11616 discrete_subtype_definition, as distinct from discrete_range.
11617 These two constructs have the same syntax, but their semantics
11618 are quite different (one defines a subtype, with a preference
11619 for Integer subtypes, while the other just selects a subrange
11620 of an existing subtype). We use this new syntactic category
11621 in for loops and entry families.
11622
11623 30.e
11624 The syntax for index_constraint and discrete_range have been
11625 moved to their own subclause, since they are no longer used
11626 here.
11627
11628 30.f
11629 The syntax rule for component_definition (formerly
11630 component_subtype_definition) is moved here from RM83-3.7.
11631
11632 _Extensions to Ada 95_
11633
11634 30.g/2
11635 {AI95-00230-01AI95-00230-01} {AI95-00406-01AI95-00406-01}
11636 Array components can have an anonymous access type.
11637
11638 30.h/2
11639 {AI95-00363-01AI95-00363-01} The prohibition against
11640 unconstrained discriminated aliased components has been
11641 lifted. It has been replaced by a prohibition against the
11642 actual troublemakers: general access discriminant constraints
11643 (see *note 3.7.1::).
11644
11645 _Wording Changes from Ada 95_
11646
11647 30.i/2
11648 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
11649 Added wording to allow the elaboration of per-object
11650 constraints for constrained arrays.
11651
11652 _Extensions to Ada 2005_
11653
11654 30.j/3
11655 {AI05-0228-1AI05-0228-1} The new aspect
11656 Default_Component_Value allows defining implicit initial
11657 values (see *note 3.3.1::) for arrays of scalar types.
11658
11659 * Menu:
11660
11661 * 3.6.1 :: Index Constraints and Discrete Ranges
11662 * 3.6.2 :: Operations of Array Types
11663 * 3.6.3 :: String Types
11664
11665 \1f
11666 File: aarm2012.info, Node: 3.6.1, Next: 3.6.2, Up: 3.6
11667
11668 3.6.1 Index Constraints and Discrete Ranges
11669 -------------------------------------------
11670
11671 1
11672 An index_constraint determines the range of possible values for every
11673 index of an array subtype, and thereby the corresponding array bounds.
11674
11675 _Syntax_
11676
11677 2
11678 index_constraint ::= (discrete_range {, discrete_range})
11679
11680 3
11681 discrete_range ::= discrete_subtype_indication | range
11682
11683 _Name Resolution Rules_
11684
11685 4
11686 The type of a discrete_range is the type of the subtype defined by the
11687 subtype_indication, or the type of the range. For an index_constraint,
11688 each discrete_range shall resolve to be of the type of the corresponding
11689 index.
11690
11691 4.a
11692 Discussion: In Ada 95, index_constraints only appear in a
11693 subtype_indication; they no longer appear in
11694 constrained_array_definitions.
11695
11696 _Legality Rules_
11697
11698 5
11699 An index_constraint shall appear only in a subtype_indication whose
11700 subtype_mark denotes either an unconstrained array subtype, or an
11701 unconstrained access subtype whose designated subtype is an
11702 unconstrained array subtype; in either case, the index_constraint shall
11703 provide a discrete_range for each index of the array type.
11704
11705 _Static Semantics_
11706
11707 6
11708 A discrete_range defines a range whose bounds are given by the range, or
11709 by the range of the subtype defined by the subtype_indication.
11710
11711 _Dynamic Semantics_
11712
11713 7
11714 An index_constraint is compatible with an unconstrained array subtype if
11715 and only if the index range defined by each discrete_range is compatible
11716 (see *note 3.5::) with the corresponding index subtype. If any of the
11717 discrete_ranges defines a null range, any array thus constrained is a
11718 null array, having no components. An array value satisfies an
11719 index_constraint if at each index position the array value and the
11720 index_constraint have the same index bounds.
11721
11722 7.a
11723 Ramification: There is no need to define compatibility with a
11724 constrained array subtype, because one is not allowed to
11725 constrain it again.
11726
11727 8
11728 The elaboration of an index_constraint consists of the evaluation of the
11729 discrete_range(s), in an arbitrary order. The evaluation of a
11730 discrete_range consists of the elaboration of the subtype_indication or
11731 the evaluation of the range.
11732
11733 NOTES
11734
11735 9
11736 48 The elaboration of a subtype_indication consisting of a
11737 subtype_mark followed by an index_constraint checks the
11738 compatibility of the index_constraint with the subtype_mark (see
11739 *note 3.2.2::).
11740
11741 10
11742 49 Even if an array value does not satisfy the index constraint of
11743 an array subtype, Constraint_Error is not raised on conversion to
11744 the array subtype, so long as the length of each dimension of the
11745 array value and the array subtype match. See *note 4.6::.
11746
11747 _Examples_
11748
11749 11
11750 Examples of array declarations including an index constraint:
11751
11752 12
11753 Board : Matrix(1 .. 8, 1 .. 8); -- see *note 3.6::
11754 Rectangle : Matrix(1 .. 20, 1 .. 30);
11755 Inverse : Matrix(1 .. N, 1 .. N); -- N need not be static
11756
11757 13
11758 Filter : Bit_Vector(0 .. 31);
11759
11760 14
11761 Example of array declaration with a constrained array subtype:
11762
11763 15
11764 My_Schedule : Schedule; -- all arrays of type Schedule have the same bounds
11765
11766 16
11767 Example of record type with a component that is an array:
11768
11769 17
11770 type Var_Line(Length : Natural) is
11771 record
11772 Image : String(1 .. Length);
11773 end record;
11774
11775 18
11776 Null_Line : Var_Line(0); -- Null_Line.Image is a null array
11777
11778 _Extensions to Ada 83_
11779
11780 18.a
11781 We allow the declaration of a variable with a nominally
11782 unconstrained array subtype, so long as it has an
11783 initialization expression to determine its bounds.
11784
11785 _Wording Changes from Ada 83_
11786
11787 18.b
11788 We have moved the syntax for index_constraint and
11789 discrete_range here since they are no longer used in
11790 constrained_array_definitions. We therefore also no longer
11791 have to describe the (special) semantics of index_constraints
11792 and discrete_ranges that appear in
11793 constrained_array_definitions.
11794
11795 18.c
11796 The rules given in RM83-3.6.1(5,7-10), which define the bounds
11797 of an array object, are redundant with rules given elsewhere,
11798 and so are not repeated here. RM83-3.6.1(6), which requires
11799 that the (nominal) subtype of an array variable be
11800 constrained, no longer applies, so long as the variable is
11801 explicitly initialized.
11802
11803 \1f
11804 File: aarm2012.info, Node: 3.6.2, Next: 3.6.3, Prev: 3.6.1, Up: 3.6
11805
11806 3.6.2 Operations of Array Types
11807 -------------------------------
11808
11809 _Legality Rules_
11810
11811 1
11812 [The argument N used in the attribute_designators for the N-th dimension
11813 of an array shall be a static expression of some integer type.] The
11814 value of N shall be positive (nonzero) and no greater than the
11815 dimensionality of the array.
11816
11817 _Static Semantics_
11818
11819 2/1
11820 {8652/00068652/0006} {AI95-00030-01AI95-00030-01} The following
11821 attributes are defined for a prefix A that is of an array type [(after
11822 any implicit dereference)], or denotes a constrained array subtype:
11823
11824 2.a
11825 Ramification: These attributes are not defined if A is a
11826 subtype-mark for an access-to-array subtype. They are defined
11827 (by implicit dereference) for access-to-array values.
11828
11829 3
11830 A'First
11831 A'First denotes the lower bound of the first index range;
11832 its type is the corresponding index type.
11833
11834 4
11835 A'First(N)
11836 A'First(N) denotes the lower bound of the N-th index
11837 range; its type is the corresponding index type.
11838
11839 5
11840 A'Last
11841 A'Last denotes the upper bound of the first index range;
11842 its type is the corresponding index type.
11843
11844 6
11845 A'Last(N)
11846 A'Last(N) denotes the upper bound of the N-th index
11847 range; its type is the corresponding index type.
11848
11849 7
11850 A'Range
11851 A'Range is equivalent to the range A'First .. A'Last,
11852 except that the prefix A is only evaluated once.
11853
11854 8
11855 A'Range(N)
11856 A'Range(N) is equivalent to the range A'First(N) ..
11857 A'Last(N), except that the prefix A is only evaluated
11858 once.
11859
11860 9
11861 A'Length
11862 A'Length denotes the number of values of the first index
11863 range (zero for a null range); its type is
11864 universal_integer.
11865
11866 10
11867 A'Length(N)
11868 A'Length(N) denotes the number of values of the N-th
11869 index range (zero for a null range); its type is
11870 universal_integer.
11871
11872 _Implementation Advice_
11873
11874 11/3
11875 {AI05-0229-1AI05-0229-1} An implementation should normally represent
11876 multidimensional arrays in row-major order, consistent with the notation
11877 used for multidimensional array aggregates (see *note 4.3.3::).
11878 However, if convention Fortran is specified for a multidimensional array
11879 type, then column-major order should be used instead (see *note B.5::,
11880 "*note B.5:: Interfacing with Fortran").
11881
11882 11.a/2
11883 Implementation Advice: Multidimensional arrays should be
11884 represented in row-major order, unless the array has
11885 convention Fortran.
11886
11887 NOTES
11888
11889 12
11890 50 The attribute_references A'First and A'First(1) denote the same
11891 value. A similar relation exists for the attribute_references
11892 A'Last, A'Range, and A'Length. The following relation is satisfied
11893 (except for a null array) by the above attributes if the index type
11894 is an integer type:
11895
11896 13
11897 A'Length(N) = A'Last(N) - A'First(N) + 1
11898
11899 14
11900 51 An array type is limited if its component type is limited (see
11901 *note 7.5::).
11902
11903 15
11904 52 The predefined operations of an array type include the
11905 membership tests, qualification, and explicit conversion. If the
11906 array type is not limited, they also include assignment and the
11907 predefined equality operators. For a one-dimensional array type,
11908 they include the predefined concatenation operators (if nonlimited)
11909 and, if the component type is discrete, the predefined relational
11910 operators; if the component type is boolean, the predefined logical
11911 operators are also included.
11912
11913 16/2
11914 53 {AI95-00287-01AI95-00287-01} A component of an array can be
11915 named with an indexed_component. A value of an array type can be
11916 specified with an array_aggregate. For a one-dimensional array
11917 type, a slice of the array can be named; also, string literals are
11918 defined if the component type is a character type.
11919
11920 _Examples_
11921
11922 17
11923 Examples (using arrays declared in the examples of subclause *note
11924 3.6.1::):
11925
11926 18
11927 -- Filter'First = 0 Filter'Last = 31 Filter'Length = 32
11928 -- Rectangle'Last(1) = 20 Rectangle'Last(2) = 30
11929
11930 \1f
11931 File: aarm2012.info, Node: 3.6.3, Prev: 3.6.2, Up: 3.6
11932
11933 3.6.3 String Types
11934 ------------------
11935
11936 _Static Semantics_
11937
11938 1
11939 A one-dimensional array type whose component type is a character type is
11940 called a string type.
11941
11942 2/2
11943 {AI95-00285-01AI95-00285-01} [There are three predefined string types,
11944 String, Wide_String, and Wide_Wide_String, each indexed by values of the
11945 predefined subtype Positive; these are declared in the visible part of
11946 package Standard:]
11947
11948 3
11949 [subtype Positive is Integer range 1 .. Integer'Last;
11950
11951 4/2
11952 {AI95-00285-01AI95-00285-01} type String is array(Positive range <>) of Character;
11953 type Wide_String is array(Positive range <>) of Wide_Character;
11954 type Wide_Wide_String is array(Positive range <>) of Wide_Wide_Character;
11955 ]
11956
11957 NOTES
11958
11959 5
11960 54 String literals (see *note 2.6:: and *note 4.2::) are defined
11961 for all string types. The concatenation operator & is predefined
11962 for string types, as for all nonlimited one-dimensional array
11963 types. The ordering operators <, <=, >, and >= are predefined for
11964 string types, as for all one-dimensional discrete array types;
11965 these ordering operators correspond to lexicographic order (see
11966 *note 4.5.2::).
11967
11968 _Examples_
11969
11970 6
11971 Examples of string objects:
11972
11973 7
11974 Stars : String(1 .. 120) := (1 .. 120 => '*' );
11975 Question : constant String := "How many characters?";
11976 -- Question'First = 1, Question'Last = 20
11977 -- Question'Length = 20 (the number of characters)
11978
11979 8
11980 Ask_Twice : String := Question & Question; -- constrained to (1..40)
11981 Ninety_Six : constant Roman := "XCVI"; -- see *note 3.5.2:: and *note 3.6::
11982
11983 _Inconsistencies With Ada 83_
11984
11985 8.a
11986 The declaration of Wide_String in Standard hides a use-visible
11987 declaration with the same defining_identifier. In rare cases,
11988 this might result in an inconsistency between Ada 83 and Ada
11989 95.
11990
11991 _Incompatibilities With Ada 83_
11992
11993 8.b
11994 Because both String and Wide_String are always directly
11995 visible, an expression like
11996
11997 8.c
11998 "a" < "bc"
11999
12000 8.d
12001 is now ambiguous, whereas in Ada 83 both string literals could
12002 be resolved to type String.
12003
12004 _Extensions to Ada 83_
12005
12006 8.e
12007 The type Wide_String is new (though it was approved by ARG for
12008 Ada 83 compilers as well).
12009
12010 _Wording Changes from Ada 83_
12011
12012 8.f
12013 We define the term string type as a natural analogy to the
12014 term character type.
12015
12016 _Inconsistencies With Ada 95_
12017
12018 8.g/2
12019 {AI95-00285-01AI95-00285-01} The declaration of
12020 Wide_Wide_String in Standard hides a use-visible declaration
12021 with the same defining_identifier. In the (very) unlikely
12022 event that an Ada 95 program had depended on such a
12023 use-visible declaration, and the program remains legal after
12024 the substitution of Standard.Wide_Wide_String, the meaning of
12025 the program will be different.
12026
12027 _Extensions to Ada 95_
12028
12029 8.h/2
12030 {AI95-00285-01AI95-00285-01} The type Wide_Wide_String is new.
12031
12032 \1f
12033 File: aarm2012.info, Node: 3.7, Next: 3.8, Prev: 3.6, Up: 3
12034
12035 3.7 Discriminants
12036 =================
12037
12038 1/2
12039 {AI95-00251-01AI95-00251-01} {AI95-00326-01AI95-00326-01} [ A composite
12040 type (other than an array or interface type) can have discriminants,
12041 which parameterize the type. A known_discriminant_part specifies the
12042 discriminants of a composite type. A discriminant of an object is a
12043 component of the object, and is either of a discrete type or an access
12044 type. An unknown_discriminant_part in the declaration of a view of a
12045 type specifies that the discriminants of the type are unknown for the
12046 given view; all subtypes of such a view are indefinite subtypes.]
12047
12048 1.a/2
12049 Glossary entry: A discriminant is a parameter for a composite
12050 type. It can control, for example, the bounds of a component
12051 of the type if the component is an array. A discriminant for
12052 a task type can be used to pass data to a task of the type
12053 upon creation.
12054
12055 1.b/2
12056 Discussion: {AI95-00114-01AI95-00114-01} A view of a type, and
12057 all subtypes of the view, have unknown discriminants when the
12058 number or names of the discriminants, if any, are unknown at
12059 the point of the type declaration for the view. A
12060 discriminant_part of (<>) is used to indicate unknown
12061 discriminants.
12062
12063 _Language Design Principles_
12064
12065 1.c/2
12066 {AI95-00402-01AI95-00402-01} When an access discriminant is
12067 initialized at the time of object creation with an allocator
12068 of an anonymous type, the allocated object and the object with
12069 the discriminant are tied together for their lifetime. They
12070 should be allocated out of the same storage pool, and then at
12071 the end of the lifetime of the enclosing object, finalized and
12072 reclaimed together. In this case, the allocated object is
12073 called a coextension (see *note 3.10.2::).
12074
12075 1.d/2
12076 Discussion: The above principle when applied to a nonlimited
12077 type implies that such an object may be copied only to a
12078 shorter-lived object, because attempting to assign it to a
12079 longer-lived object would fail because the access
12080 discriminants would not match. In a copy, the lifetime
12081 connection between the enclosing object and the allocated
12082 object does not exist. The allocated object is tied in the
12083 above sense only to the original object. Other copies have
12084 only secondary references to it.
12085
12086 1.e/2
12087 Note that when an allocator appears as a constraint on an
12088 access discriminant in a subtype_indication that is elaborated
12089 independently from object creation, no such connection exists.
12090 For example, if a named constrained subtype is declared via
12091 "subtype Constr is Rec(Acc_Discrim => new T);" or if such an
12092 allocator appears in the subtype_indication for a component,
12093 the allocator is evaluated when the subtype_indication is
12094 elaborated, and hence its lifetime is typically longer than
12095 the objects or components that will later be subject to the
12096 constraint. In these cases, the allocated object should not
12097 be reclaimed until the subtype_indication goes out of scope.
12098
12099 _Syntax_
12100
12101 2
12102 discriminant_part ::= unknown_discriminant_part |
12103 known_discriminant_part
12104
12105 3
12106 unknown_discriminant_part ::= (<>)
12107
12108 4
12109 known_discriminant_part ::=
12110 (discriminant_specification {; discriminant_specification})
12111
12112 5/2
12113 {AI95-00231-01AI95-00231-01} discriminant_specification ::=
12114 defining_identifier_list : [null_exclusion] subtype_mark [:=
12115 default_expression]
12116 | defining_identifier_list : access_definition [:=
12117 default_expression]
12118
12119 6
12120 default_expression ::= expression
12121
12122 _Name Resolution Rules_
12123
12124 7
12125 The expected type for the default_expression of a
12126 discriminant_specification is that of the corresponding discriminant.
12127
12128 _Legality Rules_
12129
12130 8/2
12131 {8652/00078652/0007} {AI95-00098-01AI95-00098-01}
12132 {AI95-00251-01AI95-00251-01} A discriminant_part is only permitted in a
12133 declaration for a composite type that is not an array or interface type
12134 [(this includes generic formal types)]. A type declared with a
12135 known_discriminant_part is called a discriminated type, as is a type
12136 that inherits (known) discriminants.
12137
12138 8.a
12139 Implementation Note: Discriminants on array types were
12140 considered, but were omitted to ease (existing)
12141 implementations.
12142
12143 8.b
12144 Discussion: Note that the above definition for "discriminated
12145 type" does not include types declared with an
12146 unknown_discriminant_part. This seems consistent with Ada 83,
12147 where such types (in a generic formal part) would not be
12148 considered discriminated types. Furthermore, the full type
12149 for a type with unknown discriminants need not even be
12150 composite, much less have any discriminants.
12151
12152 8.b.1/1
12153 {8652/00078652/0007} {AI95-00098-01AI95-00098-01} On the other
12154 hand, unknown_discriminant_parts cannot be applied to type
12155 declarations that cannot have a known_discriminant_part.
12156 There is no point in having unknown discriminants on a type
12157 that can never have discriminants (for instance, a formal
12158 modular type), even when these are allowed syntactically.
12159
12160 9/2
12161 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01} The subtype of
12162 a discriminant may be defined by an optional null_exclusion and a
12163 subtype_mark, in which case the subtype_mark shall denote a discrete or
12164 access subtype, or it may be defined by an access_definition. A
12165 discriminant that is defined by an access_definition is called an access
12166 discriminant and is of an anonymous access type.
12167
12168 9.a/2
12169 This paragraph was deleted.{AI95-00230-01AI95-00230-01}
12170
12171 9.b
12172 Reason: Note that discriminants of a named access type are not
12173 considered "access discriminants." Similarly, "access
12174 parameter" only refers to a formal parameter defined by an
12175 access_definition.
12176
12177 9.1/3
12178 {AI95-00402-01AI95-00402-01} {AI05-0214-1AI05-0214-1}
12179 Default_expressions shall be provided either for all or for none of the
12180 discriminants of a known_discriminant_part (*note 3.7: S0061.). No
12181 default_expression (*note 3.7: S0063.)s are permitted in a
12182 known_discriminant_part (*note 3.7: S0061.) in a declaration of a
12183 nonlimited tagged type [or a generic formal type].
12184
12185 9.c/2
12186 Reason: The all-or-none rule is related to the rule that a
12187 discriminant constraint shall specify values for all
12188 discriminants. One could imagine a different rule that
12189 allowed a constraint to specify only some of the
12190 discriminants, with the others provided by default. Having
12191 defaults for discriminants has a special significance -- it
12192 allows objects of the type to be unconstrained, with the
12193 discriminants alterable as part of assigning to the object.
12194
12195 9.d/3
12196 {AI05-0214-1AI05-0214-1} Defaults for discriminants of tagged
12197 types are disallowed so that every object of a nonlimited
12198 tagged type is constrained, either by an explicit constraint,
12199 or by its initial discriminant values. This substantially
12200 simplifies the semantic rules and the implementation of
12201 inherited dispatching operations. We don't need this rule for
12202 limited tagged types, as the discriminants of such objects
12203 cannot be changed after the object is created in any case --
12204 no full-object assignment is supported, and that is required
12205 to change discriminant values. For generic formal types, the
12206 restriction simplifies the type matching rules. If one simply
12207 wants a "default" value for the discriminants, a constrained
12208 subtype can be declared for future use.
12209
12210 10/3
12211 {AI95-00230-01AI95-00230-01} {AI95-00402-01AI95-00402-01}
12212 {AI95-00419-01AI95-00419-01} {AI05-0063-1AI05-0063-1} A
12213 discriminant_specification for an access discriminant may have a
12214 default_expression only in the declaration for an immutably limited type
12215 (see *note 7.5::). In addition to the places where Legality Rules
12216 normally apply (see *note 12.3::), this rule applies also in the private
12217 part of an instance of a generic unit.
12218
12219 10.a/3
12220 Discussion: This rule implies that a type can have a default
12221 for an access discriminant if the type is limited, but not if
12222 the only reason it's limited is because of a limited
12223 component. Compare the definition of limited type and
12224 immutably limited type in *note 7.5::.
12225
12226 10.b/3
12227 Ramification: A (nonformal) limited private type can always
12228 have a default for an access discriminant, because having the
12229 default itself makes the type immutably limited. Such a
12230 private type must necessarily have a full type with the same
12231 access discriminant with a default, and thus the full type
12232 will always be immutably limited (if legal).
12233
12234 10.c/2
12235 Reason: {AI95-00230-01AI95-00230-01} We considered the
12236 following rules for access discriminants:
12237
12238 10.d
12239 * If a type has an access discriminant, this automatically
12240 makes it limited, just like having a limited component
12241 automatically makes a type limited. This was rejected
12242 because it decreases program readability, and because it
12243 seemed error prone (two bugs in a previous version of the
12244 RM9X were attributable to this rule).
12245
12246 10.e/2
12247 * A type with an access discriminant shall be limited.
12248 This is equivalent to the rule we actually chose for Ada
12249 95, except that it allows a type to have an access
12250 discriminant if it is limited just because of a limited
12251 component. For example, any record containing a task
12252 would be allowed to have an access discriminant, whereas
12253 the actual rule requires "limited record". This rule was
12254 also rejected due to readability concerns, and because
12255 would interact badly with the rules for limited types
12256 that "become nonlimited".
12257
12258 10.e.1/3
12259 * {AI05-0063-1AI05-0063-1} A type may have an access
12260 discriminant if it is an immutably limited type. This
12261 was the rule chosen for Ada 95.
12262
12263 10.f/2
12264 * Any type may have an access discriminant. For nonlimited
12265 type, there is no special accessibility for access
12266 discriminants; they're the same as any other anonymous
12267 access component. For a limited type, they have the
12268 special accessibility of Ada 95. However, this doesn't
12269 work because a limited partial view can have a nonlimited
12270 full view -- giving the two views different
12271 accessibility.
12272
12273 10.f.1/3
12274 * {AI05-0063-1AI05-0063-1} Any type may have an access
12275 discriminant, as above. However, special accessibility
12276 rules only apply to types that are immutably limited
12277 (task, protected, and explicitly limited records).
12278 However, this breaks privacy; worse, Legality Rules
12279 depend on the definition of accessibility.
12280
12281 10.f.2/3
12282 * {AI05-0063-1AI05-0063-1} Any type may have an access
12283 discriminant, as above. Limited types have special
12284 accessibility, while nonlimited types have normal
12285 accessibility. However, a limited partial view with an
12286 access discriminant can only be completed by an immutably
12287 limited type. That prevents accessibility from changing.
12288 A runtime accessibility check is required on generic
12289 formal types with access discriminants. However,
12290 changing between limited and nonlimited types would have
12291 far-reaching consequences for access discriminants --
12292 which is uncomfortable.
12293
12294 10.g/2
12295 * Any type may have an access discriminant. All types have
12296 special accessibility. This was considered early during
12297 the Ada 9X process, but was dropped for "unpleasant
12298 complexities", which unfortunately aren't recorded. It
12299 does seem that an accessibility check would be needed on
12300 assignment of such a type, to avoid copying an object
12301 with a discriminant pointing to a local object into a
12302 more global object (and thus creating a dangling
12303 pointer).
12304
12305 10.h/2
12306 * Any type may have an access discriminant, but access
12307 discriminants cannot have defaults. All types have
12308 special accessibility. This gets rid of the problems on
12309 assignment (you couldn't change such a discriminant), but
12310 it would be horribly incompatible with Ada 95.
12311
12312 10.h.1/3
12313 * {AI05-0063-1AI05-0063-1} Any type may have an access
12314 discriminant, but access discriminants may have defaults
12315 only if they are of an immutably limited type. This is
12316 the rule chosen for Ada 2005, as it is not incompatible,
12317 and it doesn't require weird accessibility checks.
12318
12319 11/2
12320 This paragraph was deleted.{AI95-00402-01AI95-00402-01}
12321
12322 12
12323 For a type defined by a derived_type_definition, if a
12324 known_discriminant_part is provided in its declaration, then:
12325
12326 13
12327 * The parent subtype shall be constrained;
12328
12329 14
12330 * If the parent type is not a tagged type, then each discriminant of
12331 the derived type shall be used in the constraint defining the
12332 parent subtype;
12333
12334 14.a
12335 Implementation Note: This ensures that the new discriminant
12336 can share storage with an existing discriminant.
12337
12338 15
12339 * If a discriminant is used in the constraint defining the parent
12340 subtype, the subtype of the discriminant shall be statically
12341 compatible (see *note 4.9.1::) with the subtype of the
12342 corresponding parent discriminant.
12343
12344 15.a
12345 Reason: This ensures that on conversion (or extension via an
12346 extension aggregate) to a distantly related type, if the
12347 discriminants satisfy the target type's requirements they
12348 satisfy all the intermediate types' requirements as well.
12349
12350 15.b
12351 Ramification: There is no requirement that the new
12352 discriminant have the same (or any) default_expression as the
12353 parent's discriminant.
12354
12355 16/3
12356 This paragraph was deleted.{AI05-0102-1AI05-0102-1}
12357
12358 16.a/3
12359 This paragraph was deleted.
12360
12361 _Static Semantics_
12362
12363 17
12364 A discriminant_specification declares a discriminant; the subtype_mark
12365 denotes its subtype unless it is an access discriminant, in which case
12366 the discriminant's subtype is the anonymous access-to-variable subtype
12367 defined by the access_definition.
12368
12369 18
12370 [For a type defined by a derived_type_definition, each discriminant of
12371 the parent type is either inherited, constrained to equal some new
12372 discriminant of the derived type, or constrained to the value of an
12373 expression.] When inherited or constrained to equal some new
12374 discriminant, the parent discriminant and the discriminant of the
12375 derived type are said to correspond. Two discriminants also correspond
12376 if there is some common discriminant to which they both correspond. A
12377 discriminant corresponds to itself as well. If a discriminant of a
12378 parent type is constrained to a specific value by a
12379 derived_type_definition, then that discriminant is said to be specified
12380 by that derived_type_definition.
12381
12382 18.a
12383 Ramification: The correspondence relationship is transitive,
12384 symmetric, and reflexive. That is, if A corresponds to B, and
12385 B corresponds to C, then A, B, and C each corresponds to A, B,
12386 and C in all combinations.
12387
12388 19
12389 A constraint that appears within the definition of a discriminated type
12390 depends on a discriminant of the type if it names the discriminant as a
12391 bound or discriminant value. A component_definition depends on a
12392 discriminant if its constraint depends on the discriminant, or on a
12393 discriminant that corresponds to it.
12394
12395 19.a
12396 Ramification: A constraint in a task_body is not considered to
12397 depend on a discriminant of the task type, even if it names
12398 it. It is only the constraints in the type definition itself
12399 that are considered dependents. Similarly for protected
12400 types.
12401
12402 20
12403 A component depends on a discriminant if:
12404
12405 21
12406 * Its component_definition depends on the discriminant; or
12407
12408 21.a
12409 Ramification: A component does not depend on a discriminant
12410 just because its default_expression refers to the
12411 discriminant.
12412
12413 22
12414 * It is declared in a variant_part that is governed by the
12415 discriminant; or
12416
12417 23
12418 * It is a component inherited as part of a derived_type_definition,
12419 and the constraint of the parent_subtype_indication depends on the
12420 discriminant; or
12421
12422 23.a
12423 Reason: When the parent subtype depends on a discriminant, the
12424 parent part of the derived type is treated like a
12425 discriminant-dependent component.
12426
12427 23.b
12428 Ramification: Because of this rule, we don't really need to
12429 worry about "corresponding" discriminants, since all the
12430 inherited components will be discriminant-dependent if there
12431 is a new known_discriminant_part whose discriminants are used
12432 to constrain the old discriminants.
12433
12434 24
12435 * It is a subcomponent of a component that depends on the
12436 discriminant.
12437
12438 24.a
12439 Reason: The concept of discriminant-dependent (sub)components
12440 is primarily used in various rules that disallow renaming or
12441 'Access, or specify that certain discriminant-changing
12442 assignments are erroneous. The goal is to allow
12443 implementations to move around or change the size of
12444 discriminant-dependent subcomponents upon a
12445 discriminant-changing assignment to an enclosing object. The
12446 above definition specifies that all subcomponents of a
12447 discriminant-dependent component or parent part are themselves
12448 discriminant-dependent, even though their presence or size
12449 does not in fact depend on a discriminant. This is because it
12450 is likely that they will move in a discriminant-changing
12451 assignment if they are a component of one of several
12452 discriminant-dependent parts of the same record.
12453
12454 25
12455 Each value of a discriminated type includes a value for each component
12456 of the type that does not depend on a discriminant[; this includes the
12457 discriminants themselves]. The values of discriminants determine which
12458 other component values are present in the value of the discriminated
12459 type.
12460
12461 25.a
12462 To be honest: Which values are present might depend on
12463 discriminants of some ancestor type that are constrained in an
12464 intervening derived_type_definition. That's why we say
12465 "values of discriminants" instead of "values of the
12466 discriminants" -- a subtle point.
12467
12468 26
12469 A type declared with a known_discriminant_part is said to have known
12470 discriminants; its first subtype is unconstrained. A type declared with
12471 an unknown_discriminant_part is said to have unknown discriminants. A
12472 type declared without a discriminant_part has no discriminants, unless
12473 it is a derived type; if derived, such a type has the same sort of
12474 discriminants (known, unknown, or none) as its parent (or ancestor)
12475 type. A tagged class-wide type also has unknown discriminants. [Any
12476 subtype of a type with unknown discriminants is an unconstrained and
12477 indefinite subtype (see *note 3.2:: and *note 3.3::).]
12478
12479 26.a/2
12480 Discussion: {AI95-00114-01AI95-00114-01} An
12481 unknown_discriminant_part "(<>)" is only permitted in the
12482 declaration of a (generic or nongeneric) private type, private
12483 extension, incomplete type, or formal derived type. Hence,
12484 only such types, descendants thereof, and class-wide types can
12485 have unknown discriminants. An unknown_discriminant_part is
12486 used to indicate that the corresponding actual or full type
12487 might have discriminants without defaults, or be an
12488 unconstrained array subtype. Tagged class-wide types are also
12489 considered to have unknown discriminants because discriminants
12490 can be added by type extensions, so the total number of
12491 discriminants of any given value of a tagged class-wide type
12492 is not known at compile time.
12493
12494 26.b/2
12495 {AI95-00287-01AI95-00287-01} A subtype with unknown
12496 discriminants is indefinite, and hence an object of such a
12497 subtype needs explicit initialization. A limited private type
12498 with unknown discriminants is "extremely" limited; objects of
12499 such a type can be initialized only by subprograms (either
12500 procedures with a parameter of the type, or a function
12501 returning the type) declared in the package. Subprograms
12502 declared elsewhere can operate on and even return the type,
12503 but they can only initialize the object by calling
12504 (ultimately) a subprogram in the package declaring the type.
12505 Such a type is useful for keeping complete control over object
12506 creation within the package declaring the type.
12507
12508 26.c
12509 A partial view of a type might have unknown discriminants,
12510 while the full view of the same type might have known,
12511 unknown, or no discriminants.
12512
12513 _Dynamic Semantics_
12514
12515 27/2
12516 {AI95-00230-01AI95-00230-01} {AI95-00416-01AI95-00416-01} For an access
12517 discriminant, its access_definition is elaborated when the value of the
12518 access discriminant is defined: by evaluation of its default_expression,
12519 by elaboration of a discriminant_constraint, or by an assignment that
12520 initializes the enclosing object.
12521
12522 27.a/2
12523 Ramification: {AI95-00231-01AI95-00231-01}
12524 {AI95-00416-01AI95-00416-01} The conversion of the expression
12525 defining the access discriminant to the anonymous access type
12526 raises Program_Error for an object created by an allocator of
12527 an access type T, if the initial value is an access parameter
12528 that designates a view whose accessibility level is deeper
12529 than that of T.
12530
12531 NOTES
12532
12533 28
12534 55 If a discriminated type has default_expressions for its
12535 discriminants, then unconstrained variables of the type are
12536 permitted, and the values of the discriminants can be changed by an
12537 assignment to such a variable. If defaults are not provided for
12538 the discriminants, then all variables of the type are constrained,
12539 either by explicit constraint or by their initial value; the values
12540 of the discriminants of such a variable cannot be changed after
12541 initialization.
12542
12543 28.a
12544 Discussion: This connection between discriminant defaults and
12545 unconstrained variables can be a source of confusion. For Ada
12546 95, we considered various ways to break the connection between
12547 defaults and unconstrainedness, but ultimately gave up for
12548 lack of a sufficiently simple and intuitive alternative.
12549
12550 28.b
12551 An unconstrained discriminated subtype with defaults is called
12552 a mutable subtype, and a variable of such a subtype is called
12553 a mutable variable, because the discriminants of such a
12554 variable can change. There are no mutable arrays (that is,
12555 the bounds of an array object can never change), because there
12556 is no way in the language to define default values for the
12557 bounds. Similarly, there are no mutable class-wide subtypes,
12558 because there is no way to define the default tag, and
12559 defaults for discriminants are not allowed in the tagged case.
12560 Mutable tags would also require a way for the maximum possible
12561 size of such a class-wide subtype to be known. (In some
12562 implementations, all mutable variables are allocated with the
12563 maximum possible size. This approach is appropriate for
12564 real-time applications where implicit use of the heap is
12565 inappropriate.)
12566
12567 29
12568 56 The default_expression for a discriminant of a type is
12569 evaluated when an object of an unconstrained subtype of the type is
12570 created.
12571
12572 30
12573 57 Assignment to a discriminant of an object (after its
12574 initialization) is not allowed, since the name of a discriminant is
12575 a constant; neither assignment_statements nor assignments inherent
12576 in passing as an in out or out parameter are allowed. Note however
12577 that the value of a discriminant can be changed by assigning to the
12578 enclosing object, presuming it is an unconstrained variable.
12579
12580 30.a/2
12581 Discussion: {AI95-00114-01AI95-00114-01} An
12582 unknown_discriminant_part is permitted only in the declaration
12583 of a private type (including generic formal private), private
12584 extension, incomplete type, or generic formal derived type.
12585 These are the things that will have a corresponding completion
12586 or generic actual, which will either define the discriminants,
12587 or say there are none. The (<>) indicates that the
12588 actual/full subtype might be an indefinite subtype. An
12589 unknown_discriminant_part is not permitted in a normal
12590 untagged derived type declaration, because there is no
12591 separate full type declaration for such a type. Note that
12592 (<>) allows unconstrained array bounds; those are somewhat
12593 like undefaulted discriminants.
12594
12595 30.b
12596 For a derived type, either the discriminants are inherited as
12597 is, or completely respecified in a new discriminant_part. In
12598 this latter case, each discriminant of the parent type shall
12599 be constrained, either to a specific value, or to equal one of
12600 the new discriminants. Constraining a parent type's
12601 discriminant to equal one of the new discriminants is like a
12602 renaming of the discriminant, except that the subtype of the
12603 new discriminant can be more restrictive than that of the
12604 parent's one. In any case, the new discriminant can share
12605 storage with the parent's discriminant.
12606
12607 31
12608 58 A discriminant that is of a named access type is not called an
12609 access discriminant; that term is used only for discriminants
12610 defined by an access_definition.
12611
12612 _Examples_
12613
12614 32
12615 Examples of discriminated types:
12616
12617 33
12618 type Buffer(Size : Buffer_Size := 100) is -- see *note 3.5.4::
12619 record
12620 Pos : Buffer_Size := 0;
12621 Value : String(1 .. Size);
12622 end record;
12623
12624 34
12625 type Matrix_Rec(Rows, Columns : Integer) is
12626 record
12627 Mat : Matrix(1 .. Rows, 1 .. Columns); -- see *note 3.6::
12628 end record;
12629
12630 35
12631 type Square(Side : Integer) is new
12632 Matrix_Rec(Rows => Side, Columns => Side);
12633
12634 36
12635 type Double_Square(Number : Integer) is
12636 record
12637 Left : Square(Number);
12638 Right : Square(Number);
12639 end record;
12640
12641 37/3
12642 {AI95-00433-01AI95-00433-01} {AI05-0229-1AI05-0229-1} task type Worker(Prio : System.Priority; Buf : access Buffer)
12643 with Priority => Prio is -- see *note D.1::
12644 -- discriminants used to parameterize the task type (see *note 9.1::)
12645 entry Fill;
12646 entry Drain;
12647 end Worker;
12648
12649 _Extensions to Ada 83_
12650
12651 37.a
12652 The syntax for a discriminant_specification is modified to
12653 allow an access discriminant, with a type specified by an
12654 access_definition (see *note 3.10::).
12655
12656 37.b/2
12657 {AI95-00251-01AI95-00251-01} Discriminants are allowed on all
12658 composite types other than array and interface types.
12659
12660 37.c
12661 Discriminants may be of an access type.
12662
12663 _Wording Changes from Ada 83_
12664
12665 37.d
12666 Discriminant_parts are not elaborated, though an
12667 access_definition is elaborated when the discriminant is
12668 initialized.
12669
12670 _Extensions to Ada 95_
12671
12672 37.e/2
12673 {AI95-00230-01AI95-00230-01} {AI95-00402-01AI95-00402-01}
12674 {AI95-00416-01AI95-00416-01} Access discriminants (anonymous
12675 access types used as a discriminant) can be used on any type
12676 allowing discriminants. Defaults aren't allowed on
12677 discriminants of nonlimited types, however, so that
12678 accessibility problems don't happen on assignment.
12679
12680 37.f/2
12681 {AI95-00231-01AI95-00231-01} null_exclusion can be used in the
12682 declaration of a discriminant.
12683
12684 _Wording Changes from Ada 95_
12685
12686 37.g/2
12687 {8652/00078652/0007} {AI95-00098-01AI95-00098-01} Corrigendum:
12688 The wording was clarified so that types that cannot have
12689 discriminants cannot have an unknown_discriminant_part.
12690
12691 37.h/2
12692 {AI95-00251-01AI95-00251-01} Added wording to prevent
12693 interfaces from having discriminants. We don't want
12694 interfaces to have any components.
12695
12696 37.i/2
12697 {AI95-00254-01AI95-00254-01} Removed wording which implied or
12698 required an access discriminant to have an access-to-object
12699 type (anonymous access types can now be access-to-subprogram
12700 types as well).
12701
12702 37.j/3
12703 {AI95-00326-01AI95-00326-01} {AI05-0299-1AI05-0299-1} Fixed
12704 the wording of the introduction to this subclause to reflect
12705 that both incomplete and partial views can have unknown
12706 discriminants. That was always true, but for some reason this
12707 wording specified partial views.
12708
12709 37.k/2
12710 {AI95-00419-01AI95-00419-01} Changed the wording to use the
12711 new term "explicitly limited record", which makes the intent
12712 much clearer (and eliminates confusion with derived types that
12713 happen to contain the reserved word limited).
12714
12715 _Incompatibilities With Ada 2005_
12716
12717 37.l/3
12718 {AI05-0063-1AI05-0063-1} Correction: Changed the rules for
12719 when access discriminants can have defaults to depend on the
12720 new definition for immutably limited types; this will help
12721 ensure that unusual corner cases are properly handled. Note
12722 that the Ada 2005 rule was unintentionally incompatible with
12723 the Ada 95 rule (as enforced by the ACATS); this change brings
12724 it back into alignment with actual practice. So there should
12725 be no practical incompatibility.
12726
12727 _Extensions to Ada 2005_
12728
12729 37.m/3
12730 {AI05-0214-1AI05-0214-1} A limited tagged type may now have
12731 defaults for its discriminants.
12732
12733 _Wording Changes from Ada 2005_
12734
12735 37.n/3
12736 {AI05-0102-1AI05-0102-1} Correction: Moved implicit conversion
12737 Legality Rule to *note 8.6::.
12738
12739 * Menu:
12740
12741 * 3.7.1 :: Discriminant Constraints
12742 * 3.7.2 :: Operations of Discriminated Types
12743
12744 \1f
12745 File: aarm2012.info, Node: 3.7.1, Next: 3.7.2, Up: 3.7
12746
12747 3.7.1 Discriminant Constraints
12748 ------------------------------
12749
12750 1
12751 A discriminant_constraint specifies the values of the discriminants for
12752 a given discriminated type.
12753
12754 _Language Design Principles_
12755
12756 1.a/3
12757 {AI05-0299-1AI05-0299-1} The rules in this subclause are
12758 intentionally parallel to those given in *note 4.3.1::, "*note
12759 4.3.1:: Record Aggregates".
12760
12761 _Syntax_
12762
12763 2
12764 discriminant_constraint ::=
12765 (discriminant_association {, discriminant_association})
12766
12767 3
12768 discriminant_association ::=
12769 [discriminant_selector_name {| discriminant_selector_name} =>]
12770 expression
12771
12772 4
12773 A discriminant_association is said to be named if it has one or
12774 more discriminant_selector_names; it is otherwise said to be
12775 positional. In a discriminant_constraint, any positional
12776 associations shall precede any named associations.
12777
12778 _Name Resolution Rules_
12779
12780 5
12781 Each selector_name of a named discriminant_association (*note 3.7.1:
12782 S0065.) shall resolve to denote a discriminant of the subtype being
12783 constrained; the discriminants so named are the associated discriminants
12784 of the named association. For a positional association, the associated
12785 discriminant is the one whose discriminant_specification (*note 3.7:
12786 S0062.) occurred in the corresponding position in the
12787 known_discriminant_part (*note 3.7: S0061.) that defined the
12788 discriminants of the subtype being constrained.
12789
12790 6
12791 The expected type for the expression in a discriminant_association is
12792 that of the associated discriminant(s).
12793
12794 _Legality Rules_
12795
12796 7/3
12797 {8652/00088652/0008} {AI95-00168-01AI95-00168-01}
12798 {AI95-00363-01AI95-00363-01} {AI05-0041-1AI05-0041-1} A
12799 discriminant_constraint is only allowed in a subtype_indication whose
12800 subtype_mark denotes either an unconstrained discriminated subtype, or
12801 an unconstrained access subtype whose designated subtype is an
12802 unconstrained discriminated subtype. However, in the case of an access
12803 subtype, a discriminant_constraint (*note 3.7.1: S0064.) is legal only
12804 if any dereference of a value of the access type is known to be
12805 constrained (see *note 3.3::). In addition to the places where Legality
12806 Rules normally apply (see *note 12.3::), these rules apply also in the
12807 private part of an instance of a generic unit.
12808
12809 7.a.1/2
12810 This paragraph was deleted.{8652/00088652/0008}
12811 {AI95-00168-01AI95-00168-01} {AI95-00363-01AI95-00363-01}
12812
12813 7.a/2
12814 Reason: {AI95-00363-01AI95-00363-01} The second rule is
12815 necessary to prevent objects from changing so that they no
12816 longer match their constraint. In Ada 95, we attempted to
12817 prevent this by banning every case where an aliased object
12818 could be unconstrained or be changed by an enclosing
12819 assignment. New ways to cause this problem were being
12820 discovered frequently, meaning that new rules had to be
12821 dreamed up to cover them. Meanwhile, aliased objects and
12822 components were getting more and more limited. In Ada 2005,
12823 we sweep away all of that cruft and replace it by a simple
12824 rule "thou shalt not create an access subtype that can point
12825 to an item whose discriminants can be changed by assignment".
12826
12827 7.b/3
12828 Discussion: {AI05-0041-1AI05-0041-1} The second rule will only
12829 use the indefinite or dereference bullets in the definition of
12830 "known to be constrained". The rule is worded in terms of
12831 "known to be constrained" in order to capture the special
12832 rules that apply in generic bodies (rather than repeating them
12833 and getting them subtly wrong).
12834
12835 8
12836 A named discriminant_association with more than one selector_name is
12837 allowed only if the named discriminants are all of the same type. A
12838 discriminant_constraint shall provide exactly one value for each
12839 discriminant of the subtype being constrained.
12840
12841 9/3
12842 This paragraph was deleted.{AI05-0102-1AI05-0102-1}
12843
12844 9.a/3
12845 Ramification: In addition, *note 8.6:: requires that the
12846 expression associated with an access discriminant is
12847 convertible (see *note 4.6::) to the anonymous access type.
12848 This implies both convertibility of designated types, and
12849 static accessibility. This implies that if an object of type
12850 T with an access discriminant is created by an allocator for
12851 an access type A, then it requires that the type of the
12852 expression associated with the access discriminant have an
12853 accessibility level that is not statically deeper than that of
12854 A. This is to avoid dangling references.
12855
12856 _Dynamic Semantics_
12857
12858 10
12859 A discriminant_constraint is compatible with an unconstrained
12860 discriminated subtype if each discriminant value belongs to the subtype
12861 of the corresponding discriminant.
12862
12863 10.a
12864 Ramification: The "dependent compatibility check" has been
12865 eliminated in Ada 95. Any checking on subcomponents is
12866 performed when (and if) an object is created.
12867
12868 10.b
12869 Discussion: There is no need to define compatibility with a
12870 constrained discriminated subtype, because one is not allowed
12871 to constrain it again.
12872
12873 11
12874 A composite value satisfies a discriminant constraint if and only if
12875 each discriminant of the composite value has the value imposed by the
12876 discriminant constraint.
12877
12878 12
12879 For the elaboration of a discriminant_constraint, the expressions in the
12880 discriminant_associations are evaluated in an arbitrary order and
12881 converted to the type of the associated discriminant (which might raise
12882 Constraint_Error -- see *note 4.6::); the expression of a named
12883 association is evaluated (and converted) once for each associated
12884 discriminant. The result of each evaluation and conversion is the value
12885 imposed by the constraint for the associated discriminant.
12886
12887 12.a
12888 Reason: We convert to the type, not the subtype, so that the
12889 definition of compatibility of discriminant constraints is not
12890 vacuous.
12891
12892 NOTES
12893
12894 13
12895 59 The rules of the language ensure that a discriminant of an
12896 object always has a value, either from explicit or implicit
12897 initialization.
12898
12899 13.a
12900 Discussion: Although it is illegal to constrain a class-wide
12901 tagged subtype, it is possible to have a partially constrained
12902 class-wide subtype: If the subtype S is defined by T(A => B),
12903 then S'Class is partially constrained in the sense that
12904 objects of subtype S'Class have to have discriminants
12905 corresponding to A equal to B, but there can be other
12906 discriminants defined in extensions that are not constrained
12907 to any particular value.
12908
12909 _Examples_
12910
12911 14/3
12912 {AI05-0299-1AI05-0299-1} Examples (using types declared above in
12913 subclause *note 3.7::):
12914
12915 15
12916 Large : Buffer(200); -- constrained, always 200 characters
12917 -- (explicit discriminant value)
12918 Message : Buffer; -- unconstrained, initially 100 characters
12919 -- (default discriminant value)
12920 Basis : Square(5); -- constrained, always 5 by 5
12921 Illegal : Square; -- illegal, a Square has to be constrained
12922
12923 _Inconsistencies With Ada 83_
12924
12925 15.a
12926 Dependent compatibility checks are no longer performed on
12927 subtype declaration. Instead they are deferred until object
12928 creation (see *note 3.3.1::). This is upward compatible for a
12929 program that does not raise Constraint_Error.
12930
12931 _Wording Changes from Ada 83_
12932
12933 15.b
12934 Everything in RM83-3.7.2(7-12), which specifies the initial
12935 values for discriminants, is now redundant with 3.3.1, 6.4.1,
12936 8.5.1, and 12.4. Therefore, we don't repeat it here. Since
12937 the material is largely intuitive, but nevertheless
12938 complicated to state formally, it doesn't seem worth putting
12939 it in a "NOTE."
12940
12941 _Incompatibilities With Ada 95_
12942
12943 15.c/2
12944 {8652/00088652/0008} {AI95-00168-01AI95-00168-01}
12945 {AI95-00363-01AI95-00363-01} The Corrigendum added a
12946 restriction on discriminant_constraints for general access
12947 subtypes. Such constraints are prohibited if the designated
12948 type can be treated as constrained somewhere in the program.
12949 Ada 2005 goes further and prohibits such
12950 discriminant_constraints if the designated type has (or might
12951 have, in the case of a formal type) defaults for its
12952 discriminants. The use of general access subtypes is rare,
12953 and this eliminates a boatload of problems that required many
12954 restrictions on the use of aliased objects and components (now
12955 lifted). Similarly, Ada 2005 prohibits
12956 discriminant_constraints on any access type whose designated
12957 type has a partial view that is constrained. Such a type will
12958 not be constrained in the heap to avoid privacy problems.
12959 Again, the use of such subtypes is rare (they can only happen
12960 within the package and its child units).
12961
12962 _Wording Changes from Ada 2005_
12963
12964 15.d/3
12965 {AI05-0041-1AI05-0041-1} Correction: Revised the rules on
12966 access subtypes having discriminant constraints to depend on
12967 the "known to be constrained" rules. This centralizes the
12968 rules so that future fixes need to be made in only one place,
12969 as well as fixing bugs in obscure cases.
12970
12971 15.e/3
12972 {AI05-0102-1AI05-0102-1} Correction: Moved implicit conversion
12973 Legality Rule to *note 8.6::.
12974
12975 \1f
12976 File: aarm2012.info, Node: 3.7.2, Prev: 3.7.1, Up: 3.7
12977
12978 3.7.2 Operations of Discriminated Types
12979 ---------------------------------------
12980
12981 1
12982 [If a discriminated type has default_expressions for its discriminants,
12983 then unconstrained variables of the type are permitted, and the
12984 discriminants of such a variable can be changed by assignment to the
12985 variable. For a formal parameter of such a type, an attribute is
12986 provided to determine whether the corresponding actual parameter is
12987 constrained or unconstrained.]
12988
12989 _Static Semantics_
12990
12991 2
12992 For a prefix A that is of a discriminated type [(after any implicit
12993 dereference)], the following attribute is defined:
12994
12995 3/3
12996 A'Constrained
12997 {AI05-0214-1AI05-0214-1} Yields the value True if A
12998 denotes a constant, a value, a tagged object, or a
12999 constrained variable, and False otherwise.
13000
13001 3.a/3
13002 Implementation Note: {AI05-0214-1AI05-0214-1} This attribute
13003 is primarily used on parameters, to determine whether the
13004 discriminants can be changed as part of an assignment. The
13005 Constrained attribute is statically True for in parameters.
13006 For in out and out parameters of a discriminated type, the
13007 value of this attribute needs to be passed as an implicit
13008 parameter, in general. However, if the type is tagged or does
13009 not have defaults for its discriminants, the attribute is
13010 statically True, so no implicit parameter is needed.
13011 Parameters of a limited untagged type with defaulted
13012 discriminants need this implicit parameter, unless there are
13013 no nonlimited views, because they might be passed to a
13014 subprogram whose body has visibility on a nonlimited view of
13015 the type, and hence might be able to assign to the object and
13016 change its discriminants.
13017
13018 3.b/3
13019 Reason: {AI05-0214-1AI05-0214-1} All tagged objects are known
13020 to be constrained (as nonlimited tagged types cannot have
13021 discriminant defaults, and limited tagged objects are
13022 immutably limited), and are always considered constrained by
13023 this attribute to avoid distributed overhead for parameters of
13024 limited classwide types, as limited tagged objects may
13025 technically be unconstrained if they use defaulted
13026 discriminants. Such objects still cannot have their
13027 discriminants changed, as assignment is not supported for
13028 them, so there is no use for this attribute that would justify
13029 the overhead of passing it with all classwide parameters.
13030
13031 3.c/3
13032 Discussion: {AI05-0005-1AI05-0005-1} {AI05-0214-1AI05-0214-1}
13033 If the type of A is a type derived from an untagged partial
13034 view of a tagged type such that it is not a tagged type, then
13035 A is not considered a tagged object, and A'Constrained can
13036 return either True or False depending on the nature of the
13037 object.
13038
13039 _Erroneous Execution_
13040
13041 4
13042 The execution of a construct is erroneous if the construct has a
13043 constituent that is a name denoting a subcomponent that depends on
13044 discriminants, and the value of any of these discriminants is changed by
13045 this execution between evaluating the name and the last use (within this
13046 execution) of the subcomponent denoted by the name.
13047
13048 4.a
13049 Ramification: This rule applies to assignment_statements,
13050 calls (except when the discriminant-dependent subcomponent is
13051 an in parameter passed by copy), indexed_components, and
13052 slices. Ada 83 only covered the first two cases. AI83-00585
13053 pointed out the situation with the last two cases. The cases
13054 of object_renaming_declarations and generic formal in out
13055 objects are handled differently, by disallowing the situation
13056 at compile time.
13057
13058 _Extensions to Ada 83_
13059
13060 4.b/1
13061 For consistency with other attributes, we are allowing the
13062 prefix of Constrained to be a value as well as an object of a
13063 discriminated type, and also an implicit dereference. These
13064 extensions are not important capabilities, but there seems no
13065 reason to make this attribute different from other similar
13066 attributes. We are curious what most Ada 83 compilers do with
13067 F(1).X'Constrained.
13068
13069 4.c
13070 We now handle in a general way the cases of erroneousness
13071 identified by AI83-00585, where the prefix of an
13072 indexed_component or slice is discriminant-dependent, and the
13073 evaluation of the index or discrete range changes the value of
13074 a discriminant.
13075
13076 _Wording Changes from Ada 83_
13077
13078 4.d
13079 We have moved all discussion of erroneous use of names that
13080 denote discriminant-dependent subcomponents to this subclause.
13081 In Ada 83, it used to appear separately under
13082 assignment_statements and subprogram calls.
13083
13084 _Wording Changes from Ada 2005_
13085
13086 4.e/3
13087 {AI05-0214-1AI05-0214-1} A'Constrained is now defined to
13088 return True for any A that is a tagged object. This doesn't
13089 change the result for any A allowed by previous versions of
13090 Ada; the change is necessary to avoid unnecessary overhead for
13091 limited tagged parameters.
13092
13093 \1f
13094 File: aarm2012.info, Node: 3.8, Next: 3.9, Prev: 3.7, Up: 3
13095
13096 3.8 Record Types
13097 ================
13098
13099 1
13100 A record object is a composite object consisting of named components.
13101 The value of a record object is a composite value consisting of the
13102 values of the components.
13103
13104 _Syntax_
13105
13106 2
13107 record_type_definition ::= [[abstract] tagged] [limited]
13108 record_definition
13109
13110 3
13111 record_definition ::=
13112 record
13113 component_list
13114 end record
13115 | null record
13116
13117 4
13118 component_list ::=
13119 component_item {component_item}
13120 | {component_item} variant_part
13121 | null;
13122
13123 5/1
13124 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} component_item
13125 ::= component_declaration | aspect_clause
13126
13127 6/3
13128 {AI05-0183-1AI05-0183-1} component_declaration ::=
13129 defining_identifier_list : component_definition [:=
13130 default_expression]
13131 [aspect_specification];
13132
13133 _Name Resolution Rules_
13134
13135 7
13136 The expected type for the default_expression, if any, in a
13137 component_declaration is the type of the component.
13138
13139 _Legality Rules_
13140
13141 8/2
13142 This paragraph was deleted.{AI95-00287-01AI95-00287-01}
13143
13144 9/2
13145 {AI95-00366-01AI95-00366-01} Each component_declaration declares a
13146 component of the record type. Besides components declared by
13147 component_declarations, the components of a record type include any
13148 components declared by discriminant_specifications of the record type
13149 declaration. [The identifiers of all components of a record type shall
13150 be distinct.]
13151
13152 9.a/3
13153 Proof: {AI05-0299-1AI05-0299-1} The identifiers of all
13154 components of a record type have to be distinct because they
13155 are all declared immediately within the same declarative
13156 region. See Clause *note 8::.
13157
13158 10
13159 Within a type_declaration, a name that denotes a component, protected
13160 subprogram, or entry of the type is allowed only in the following cases:
13161
13162 11/3
13163 * {AI05-0004-1AI05-0004-1} {AI05-0295-1AI05-0295-1} A name that
13164 denotes any component, protected subprogram, or entry is allowed
13165 within an aspect_specification, an operational item, or a
13166 representation item that occurs within the declaration of the
13167 composite type.
13168
13169 12/3
13170 * {AI05-0264-1AI05-0264-1} A name that denotes a noninherited
13171 discriminant is allowed within the declaration of the type, but not
13172 within the discriminant_part. If the discriminant is used to
13173 define the constraint of a component, the bounds of an entry
13174 family, or the constraint of the parent subtype in a
13175 derived_type_definition, then its name shall appear alone as a
13176 direct_name (not as part of a larger expression or expanded name).
13177 A discriminant shall not be used to define the constraint of a
13178 scalar component.
13179
13180 12.a
13181 Reason: The penultimate restriction simplifies implementation,
13182 and allows the outer discriminant and the inner discriminant
13183 or bound to possibly share storage.
13184
13185 12.b
13186 Ramification: Other rules prevent such a discriminant from
13187 being an inherited one.
13188
13189 12.c
13190 Reason: The last restriction is inherited from Ada 83. The
13191 restriction is not really necessary from a language design
13192 point of view, but we did not remove it, in order to avoid
13193 unnecessary changes to existing compilers.
13194
13195 12.d
13196 Discussion: Note that a discriminant can be used to define the
13197 constraint for a component that is of an access-to-composite
13198 type.
13199
13200 12.e/2
13201 Reason: {AI95-00373-01AI95-00373-01} The above rules, and a
13202 similar one in *note 6.1:: for formal parameters, are intended
13203 to allow initializations of components or parameters to occur
13204 in a (nearly) arbitrary order -- whatever order is most
13205 efficient (subject to the restrictions of *note 3.3.1::),
13206 since one default_expression cannot depend on the value of
13207 another one. They also prevent circularities.
13208
13209 12.f/3
13210 Ramification: {AI05-0295-1AI05-0295-1} Inherited discriminants
13211 are not allowed to be denoted, except within
13212 aspect_specifications and representation items. However, the
13213 discriminant_selector_name of the parent subtype_indication is
13214 allowed to denote a discriminant of the parent.
13215
13216 13
13217 If the name of the current instance of a type (see *note 8.6::) is used
13218 to define the constraint of a component, then it shall appear as a
13219 direct_name that is the prefix of an attribute_reference whose result is
13220 of an access type, and the attribute_reference shall appear alone.
13221
13222 13.a
13223 Reason: This rule allows T'Access or T'Unchecked_Access, but
13224 disallows, for example, a range constraint (1..T'Size).
13225 Allowing things like (1..T'Size) would mean that a per-object
13226 constraint could affect the size of the object, which would be
13227 bad.
13228
13229 _Static Semantics_
13230
13231 13.1/3
13232 {AI95-00318-02AI95-00318-02} {AI05-0004-1AI05-0004-1} If a
13233 record_type_definition includes the reserved word limited, the type is
13234 called an explicitly limited record type.
13235
13236 14
13237 The component_definition of a component_declaration defines the
13238 (nominal) subtype of the component. If the reserved word aliased
13239 appears in the component_definition, then the component is aliased (see
13240 *note 3.10::).
13241
13242 15
13243 If the component_list of a record type is defined by the reserved word
13244 null and there are no discriminants, then the record type has no
13245 components and all records of the type are null records. A
13246 record_definition of null record is equivalent to record null; end
13247 record.
13248
13249 15.a
13250 Ramification: This short-hand is available both for declaring
13251 a record type and a record extension -- see *note 3.9.1::.
13252
13253 _Dynamic Semantics_
13254
13255 16
13256 The elaboration of a record_type_definition creates the record type and
13257 its first subtype, and consists of the elaboration of the
13258 record_definition. The elaboration of a record_definition consists of
13259 the elaboration of its component_list, if any.
13260
13261 17
13262 The elaboration of a component_list consists of the elaboration of the
13263 component_items and variant_part, if any, in the order in which they
13264 appear. The elaboration of a component_declaration consists of the
13265 elaboration of the component_definition.
13266
13267 17.a
13268 Discussion: If the defining_identifier_list has more than one
13269 defining_identifier, we presume here that the transformation
13270 explained in *note 3.3.1:: has already taken place.
13271 Alternatively, we could say that the component_definition is
13272 elaborated once for each defining_identifier in the list.
13273
13274 18/2
13275 {8652/00028652/0002} {AI95-00171-01AI95-00171-01}
13276 {AI95-00230-01AI95-00230-01} Within the definition of a composite type,
13277 if a component_definition or discrete_subtype_definition (see *note
13278 9.5.2::) includes a name that denotes a discriminant of the type, or
13279 that is an attribute_reference whose prefix denotes the current instance
13280 of the type, the expression containing the name is called a per-object
13281 expression, and the constraint or range being defined is called a
13282 per-object constraint. For the elaboration of a component_definition of
13283 a component_declaration or the discrete_subtype_definition (*note 3.6:
13284 S0055.) of an entry_declaration (*note 9.5.2: S0218.) for an entry
13285 family (see *note 9.5.2::), if the component subtype is defined by an
13286 access_definition or if the constraint or range of the
13287 subtype_indication or discrete_subtype_definition (*note 3.6: S0055.) is
13288 not a per-object constraint, then the access_definition,
13289 subtype_indication, or discrete_subtype_definition (*note 3.6: S0055.)
13290 is elaborated. On the other hand, if the constraint or range is a
13291 per-object constraint, then the elaboration consists of the evaluation
13292 of any included expression that is not part of a per-object expression.
13293 Each such expression is evaluated once unless it is part of a named
13294 association in a discriminant constraint, in which case it is evaluated
13295 once for each associated discriminant.
13296
13297 18.1/1
13298 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} When a per-object
13299 constraint is elaborated [(as part of creating an object)], each
13300 per-object expression of the constraint is evaluated. For other
13301 expressions, the values determined during the elaboration of the
13302 component_definition (*note 3.6: S0056.) or entry_declaration (*note
13303 9.5.2: S0218.) are used. Any checks associated with the enclosing
13304 subtype_indication or discrete_subtype_definition are performed[,
13305 including the subtype compatibility check (see *note 3.2.2::),] and the
13306 associated subtype is created.
13307
13308 18.a
13309 Discussion: The evaluation of other expressions that appear in
13310 component_definitions and discrete_subtype_definitions is
13311 performed when the type definition is elaborated. The
13312 evaluation of expressions that appear as default_expressions
13313 is postponed until an object is created. Expressions in
13314 representation items that appear within a composite type
13315 definition are evaluated according to the rules of the
13316 particular representation item.
13317
13318 NOTES
13319
13320 19
13321 60 A component_declaration with several identifiers is equivalent
13322 to a sequence of single component_declarations, as explained in
13323 *note 3.3.1::.
13324
13325 20
13326 61 The default_expression of a record component is only evaluated
13327 upon the creation of a default-initialized object of the record
13328 type (presuming the object has the component, if it is in a
13329 variant_part -- see *note 3.3.1::).
13330
13331 21
13332 62 The subtype defined by a component_definition (see *note 3.6::)
13333 has to be a definite subtype.
13334
13335 22
13336 63 If a record type does not have a variant_part, then the same
13337 components are present in all values of the type.
13338
13339 23
13340 64 A record type is limited if it has the reserved word limited in
13341 its definition, or if any of its components are limited (see *note
13342 7.5::).
13343
13344 24
13345 65 The predefined operations of a record type include membership
13346 tests, qualification, and explicit conversion. If the record type
13347 is nonlimited, they also include assignment and the predefined
13348 equality operators.
13349
13350 25/2
13351 66 {AI95-00287-01AI95-00287-01} A component of a record can be
13352 named with a selected_component. A value of a record can be
13353 specified with a record_aggregate.
13354
13355 _Examples_
13356
13357 26
13358 Examples of record type declarations:
13359
13360 27
13361 type Date is
13362 record
13363 Day : Integer range 1 .. 31;
13364 Month : Month_Name;
13365 Year : Integer range 0 .. 4000;
13366 end record;
13367
13368 28
13369 type Complex is
13370 record
13371 Re : Real := 0.0;
13372 Im : Real := 0.0;
13373 end record;
13374
13375 29
13376 Examples of record variables:
13377
13378 30
13379 Tomorrow, Yesterday : Date;
13380 A, B, C : Complex;
13381
13382 31
13383 -- both components of A, B, and C are implicitly initialized to zero
13384
13385 _Extensions to Ada 83_
13386
13387 31.a
13388 The syntax rule for component_declaration is modified to use
13389 component_definition (instead of
13390 component_subtype_definition). The effect of this change is
13391 to allow the reserved word aliased before the
13392 component_subtype_definition.
13393
13394 31.b
13395 A short-hand is provided for defining a null record type (and
13396 a null record extension), as these will be more common for
13397 abstract root types (and derived types without additional
13398 components).
13399
13400 31.c
13401 The syntax rule for record_type_definition is modified to
13402 allow the reserved words tagged and limited. Tagging is new.
13403 Limitedness is now orthogonal to privateness. In Ada 83 the
13404 syntax implied that limited private was sort of more private
13405 than private. However, limitedness really has nothing to do
13406 with privateness; limitedness simply indicates the lack of
13407 assignment capabilities, and makes perfect sense for
13408 nonprivate types such as record types.
13409
13410 _Wording Changes from Ada 83_
13411
13412 31.d/1
13413 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} The syntax
13414 rules now allow aspect_clauses to appear in a
13415 record_definition. This is not a language extension, because
13416 Legality Rules prevent all language-defined representation
13417 clauses from appearing there. However, an
13418 implementation-defined attribute_definition_clause could
13419 appear there. The reason for this change is to allow the
13420 rules for aspect_clauses and representation pragmas to be as
13421 similar as possible.
13422
13423 _Extensions to Ada 95_
13424
13425 31.e/2
13426 {AI95-00287-01AI95-00287-01} Record components can have an
13427 anonymous access type.
13428
13429 31.f/2
13430 {AI95-00287-01AI95-00287-01} Limited components can be
13431 initialized, so long as the expression is one that allows
13432 building the object in place (such as an aggregate or
13433 function_call).
13434
13435 _Wording Changes from Ada 95_
13436
13437 31.g/2
13438 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
13439 Improved the description of the elaboration of per-object
13440 constraints.
13441
13442 31.h/2
13443 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
13444 Changed representation clauses to aspect clauses to reflect
13445 that they are used for more than just representation.
13446
13447 31.i/2
13448 {AI95-00318-02AI95-00318-02} Defined explicitly limited record
13449 type to use in other rules.
13450
13451 _Extensions to Ada 2005_
13452
13453 31.j/3
13454 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
13455 be used in a component_declaration. This is described in
13456 *note 13.1.1::.
13457
13458 * Menu:
13459
13460 * 3.8.1 :: Variant Parts and Discrete Choices
13461
13462 \1f
13463 File: aarm2012.info, Node: 3.8.1, Up: 3.8
13464
13465 3.8.1 Variant Parts and Discrete Choices
13466 ----------------------------------------
13467
13468 1
13469 A record type with a variant_part specifies alternative lists of
13470 components. Each variant defines the components for the value or values
13471 of the discriminant covered by its discrete_choice_list.
13472
13473 1.a
13474 Discussion: Discrete_choice_lists and discrete_choices are
13475 said to cover values as defined below; which
13476 discrete_choice_list covers a value determines which of
13477 various alternatives is chosen. These are used in
13478 variant_parts, array_aggregates, and case_statements.
13479
13480 _Language Design Principles_
13481
13482 1.b
13483 The definition of "cover" in this subclause and the rules
13484 about discrete choices are designed so that they are also
13485 appropriate for array aggregates and case statements.
13486
13487 1.c
13488 The rules of this subclause intentionally parallel those for
13489 case statements.
13490
13491 _Syntax_
13492
13493 2
13494 variant_part ::=
13495 case discriminant_direct_name is
13496 variant
13497 {variant}
13498 end case;
13499
13500 3
13501 variant ::=
13502 when discrete_choice_list =>
13503 component_list
13504
13505 4
13506 discrete_choice_list ::= discrete_choice {| discrete_choice}
13507
13508 5/3
13509 {AI05-0153-3AI05-0153-3} {AI05-0158-1AI05-0158-1} discrete_choice
13510 ::= choice_expression | discrete_subtype_indication |
13511 range | others
13512
13513 _Name Resolution Rules_
13514
13515 6
13516 The discriminant_direct_name shall resolve to denote a discriminant
13517 (called the discriminant of the variant_part) specified in the
13518 known_discriminant_part of the full_type_declaration that contains the
13519 variant_part. The expected type for each discrete_choice in a variant
13520 is the type of the discriminant of the variant_part.
13521
13522 6.a
13523 Ramification: A full_type_declaration with a variant_part has
13524 to have a (new) known_discriminant_part; the discriminant of
13525 the variant_part cannot be an inherited discriminant.
13526
13527 _Legality Rules_
13528
13529 7
13530 The discriminant of the variant_part shall be of a discrete type.
13531
13532 7.a
13533 Ramification: It shall not be of an access type, named or
13534 anonymous.
13535
13536 8/3
13537 {AI05-0153-3AI05-0153-3} The choice_expressions, subtype_indications,
13538 and ranges given as discrete_choices in a variant_part shall be static.
13539 The discrete_choice others shall appear alone in a discrete_choice_list,
13540 and such a discrete_choice_list, if it appears, shall be the last one in
13541 the enclosing construct.
13542
13543 9
13544 A discrete_choice is defined to cover a value in the following cases:
13545
13546 10/3
13547 * {AI05-0262-1AI05-0262-1} A discrete_choice that is a
13548 choice_expression covers a value if the value equals the value of
13549 the choice_expression converted to the expected type.
13550
13551 10.1/3
13552 * {AI05-0153-3AI05-0153-3} {AI05-0262-1AI05-0262-1} A discrete_choice
13553 that is a subtype_indication covers all values (possibly none) that
13554 belong to the subtype and that satisfy the static predicate of the
13555 subtype (see *note 3.2.4::).
13556
13557 10.a/3
13558 Ramification: {AI05-0262-1AI05-0262-1} A dynamic predicate is
13559 never allowed in this case (for variants, case_statements, and
13560 case_expressions, a subtype with a dynamic predicate isn't
13561 static and thus isn't allowed in a discrete_choice, and for a
13562 choice in an array_aggregate, a dynamic predicate is
13563 explicitly disallowed -- see *note 3.2.4::).
13564
13565 11/3
13566 * {AI05-0153-3AI05-0153-3} A discrete_choice that is a range covers
13567 all values (possibly none) that belong to the range.
13568
13569 12
13570 * The discrete_choice others covers all values of its expected type
13571 that are not covered by previous discrete_choice_lists of the same
13572 construct.
13573
13574 12.a
13575 Ramification: For case_statements, this includes values
13576 outside the range of the static subtype (if any) to be covered
13577 by the choices. It even includes values outside the base
13578 range of the case expression's type, since values of numeric
13579 types (and undefined values of any scalar type?) can be
13580 outside their base range.
13581
13582 13
13583 A discrete_choice_list covers a value if one of its discrete_choices
13584 covers the value.
13585
13586 14
13587 The possible values of the discriminant of a variant_part shall be
13588 covered as follows:
13589
13590 15/3
13591 * {AI05-0153-3AI05-0153-3} {AI05-0188-1AI05-0188-1}
13592 {AI05-0262-1AI05-0262-1} If the discriminant is of a static
13593 constrained scalar subtype then, except within an instance of a
13594 generic unit, each non-others discrete_choice (*note 3.8.1: S0074.)
13595 shall cover only values in that subtype that satisfy its predicate,
13596 and each value of that subtype that satisfies its predicate shall
13597 be covered by some discrete_choice (*note 3.8.1: S0074.) [(either
13598 explicitly or by others)];
13599
13600 15.a/3
13601 Reason: {AI05-0188-1AI05-0188-1} The exemption for a
13602 discriminated type declared in an instance allows the
13603 following example:
13604
13605 15.b/3
13606 generic
13607 type T is new Integer;
13608 package G is
13609 type Rec (Discrim : T) is record
13610 case Discrim is
13611 when -10 .. -1 =>
13612 Foo : Float;
13613 when others =>
13614 null;
13615 end case;
13616 end record;
13617 end G;
13618
13619 15.c/3
13620 package I is new G (Natural); -- Legal
13621
13622 16/3
13623 * {AI05-0264-1AI05-0264-1} If the type of the discriminant is a
13624 descendant of a generic formal scalar type, then the variant_part
13625 shall have an others discrete_choice;
13626
13627 16.a
13628 Reason: The base range is not known statically in this case.
13629
13630 17
13631 * Otherwise, each value of the base range of the type of the
13632 discriminant shall be covered [(either explicitly or by others)].
13633
13634 18
13635 Two distinct discrete_choices of a variant_part shall not cover the same
13636 value.
13637
13638 _Static Semantics_
13639
13640 19
13641 If the component_list of a variant is specified by null, the variant has
13642 no components.
13643
13644 20
13645 The discriminant of a variant_part is said to govern the variant_part
13646 and its variants. In addition, the discriminant of a derived type
13647 governs a variant_part and its variants if it corresponds (see *note
13648 3.7::) to the discriminant of the variant_part.
13649
13650 _Dynamic Semantics_
13651
13652 21
13653 A record value contains the values of the components of a particular
13654 variant only if the value of the discriminant governing the variant is
13655 covered by the discrete_choice_list of the variant. This rule applies
13656 in turn to any further variant that is, itself, included in the
13657 component_list of the given variant.
13658
13659 21.1/3
13660 {AI05-0290-1AI05-0290-1} When an object of a discriminated type T is
13661 initialized by default, Constraint_Error is raised if no
13662 discrete_choice_list of any variant of a variant_part of T covers the
13663 value of the discriminant that governs the variant_part. When a
13664 variant_part appears in the component_list of another variant V, this
13665 test is only applied if the value of the discriminant governing V is
13666 covered by the discrete_choice_list of V.
13667
13668 21.a/3
13669 Implementation Note: This is not a "check"; it cannot be
13670 suppressed. However, in most cases it is not necessary to
13671 generate any code to raise this exception. A test is needed
13672 (and can fail) in the case where the discriminant subtype has
13673 a Static_Predicate specified, it also has predicate checking
13674 disabled, and the discriminant governs a variant_part which
13675 lacks a when others choice.
13676
13677 21.b/3
13678 The test also could fail for a static discriminant subtype
13679 with range checking suppressed and the discriminant governs a
13680 variant_part which lacks a when others choice. But execution
13681 is erroneous if a range check that would have failed is
13682 suppressed (see *note 11.5::), so an implementation does not
13683 have to generate code to check this case. (An unchecked
13684 failed predicate does not cause erroneous execution, so the
13685 test is required in that case.)
13686
13687 21.c/3
13688 Like the checks associated with a per-object constraint, this
13689 test is not made during the elaboration of a
13690 subtype_indication.
13691
13692 22
13693 The elaboration of a variant_part consists of the elaboration of the
13694 component_list of each variant in the order in which they appear.
13695
13696 _Examples_
13697
13698 23
13699 Example of record type with a variant part:
13700
13701 24
13702 type Device is (Printer, Disk, Drum);
13703 type State is (Open, Closed);
13704
13705 25
13706 type Peripheral(Unit : Device := Disk) is
13707 record
13708 Status : State;
13709 case Unit is
13710 when Printer =>
13711 Line_Count : Integer range 1 .. Page_Size;
13712 when others =>
13713 Cylinder : Cylinder_Index;
13714 Track : Track_Number;
13715 end case;
13716 end record;
13717
13718 26
13719 Examples of record subtypes:
13720
13721 27
13722 subtype Drum_Unit is Peripheral(Drum);
13723 subtype Disk_Unit is Peripheral(Disk);
13724
13725 28
13726 Examples of constrained record variables:
13727
13728 29
13729 Writer : Peripheral(Unit => Printer);
13730 Archive : Disk_Unit;
13731
13732 _Extensions to Ada 83_
13733
13734 29.a
13735 In Ada 83, the discriminant of a variant_part is not allowed
13736 to be of a generic formal type. This restriction is removed
13737 in Ada 95; an others discrete_choice is required in this case.
13738
13739 _Wording Changes from Ada 83_
13740
13741 29.b
13742 The syntactic category choice is removed. The syntax rules
13743 for variant, array_aggregate, and case_statement now use
13744 discrete_choice_list or discrete_choice instead. The syntax
13745 rule for record_aggregate now defines its own syntax for named
13746 associations.
13747
13748 29.c/3
13749 {AI05-0299-1AI05-0299-1} We have added the term Discrete
13750 Choice to the title since this is where they are talked about.
13751 This is analogous to the name of the subclause "Index
13752 Constraints and Discrete Ranges" in the subclause on Array
13753 Types.
13754
13755 29.d
13756 The rule requiring that the discriminant denote a discriminant
13757 of the type being defined seems to have been left implicit in
13758 RM83.
13759
13760 _Incompatibilities With Ada 2005_
13761
13762 29.e/3
13763 {AI05-0158-1AI05-0158-1} Membership tests are no longer
13764 allowed as a discrete_choice, in order that those tests can be
13765 expanded to allow multiple tests in a single expression
13766 without ambiguity. Since a membership test has a boolean
13767 type, they are very unlikely to be used as a discrete_choice.
13768
13769 _Extensions to Ada 2005_
13770
13771 29.f/3
13772 {AI05-0153-3AI05-0153-3} Subtypes with static predicates can
13773 be used in discrete_choices, and the coverage rules are
13774 modified to respect the predicates.
13775
13776 29.g/3
13777 {AI05-0188-1AI05-0188-1} Variants in generic specifications
13778 are no longer rejected if the subtype of the actual type does
13779 not include all of the case choices. This probably isn't
13780 useful, but it is consistent with the treatment of
13781 case_expressions.
13782
13783 _Wording Changes from Ada 2005_
13784
13785 29.h/3
13786 {AI05-0290-1AI05-0290-1} Added a test that some variant covers
13787 the value of a discriminant that governs a variant_part. This
13788 is similar to the test that some case limb covers the value of
13789 the Selecting_expression of a case_statement. This test
13790 cannot change the behavior of any nonerroneous Ada 2005
13791 program, so it is not an inconsistency.
13792
13793 \1f
13794 File: aarm2012.info, Node: 3.9, Next: 3.10, Prev: 3.8, Up: 3
13795
13796 3.9 Tagged Types and Type Extensions
13797 ====================================
13798
13799 1
13800 [ Tagged types and type extensions support object-oriented programming,
13801 based on inheritance with extension and run-time polymorphism via
13802 dispatching operations. ]
13803
13804 _Language Design Principles_
13805
13806 1.a/2
13807 {AI95-00251-01AI95-00251-01} The intended implementation model
13808 is for the static portion of a tag to be represented as a
13809 pointer to a statically allocated and link-time initialized
13810 type descriptor. The type descriptor contains the address of
13811 the code for each primitive operation of the type. It
13812 probably also contains other information, such as might make
13813 membership tests convenient and efficient. Tags for nested
13814 type extensions must also have a dynamic part that identifies
13815 the particular elaboration of the type.
13816
13817 1.b
13818 The primitive operations of a tagged type are known at its
13819 first freezing point; the type descriptor is laid out at that
13820 point. It contains linker symbols for each primitive
13821 operation; the linker fills in the actual addresses.
13822
13823 1.b.1/2
13824 {AI95-00251-01AI95-00251-01} Primitive operations of type
13825 extensions that are declared at a level deeper than the level
13826 of the ultimate ancestor from which they are derived can be
13827 represented by wrappers that use the dynamic part of the tag
13828 to call the actual primitive operation. The dynamic part
13829 would generally be some way to represent the static link or
13830 display necessary for making a nested call. One
13831 implementation strategy would be to store that information in
13832 the extension part of such nested type extensions, and use the
13833 dynamic part of the tag to point at it. (That way, the
13834 "dynamic" part of the tag could be static, at the cost of
13835 indirect access.)
13836
13837 1.b.2/2
13838 {AI95-00251-01AI95-00251-01} If the tagged type is descended
13839 from any interface types, it also will need to include
13840 "subtags" (one for each interface) that describe the mapping
13841 of the primitive operations of the interface to the primitives
13842 of the type. These subtags could directly reference the
13843 primitive operations (for faster performance), or simply
13844 provide the tag "slot" numbers for the primitive operations
13845 (for easier derivation). In either case, the subtags would be
13846 used for calls that dispatch through a class-wide type of the
13847 interface.
13848
13849 1.c
13850 Other implementation models are possible.
13851
13852 1.d
13853 The rules ensure that "dangling dispatching" is impossible;
13854 that is, when a dispatching call is made, there is always a
13855 body to execute. This is different from some other
13856 object-oriented languages, such as Smalltalk, where it is
13857 possible to get a run-time error from a missing method.
13858
13859 1.e/2
13860 {AI95-00251-01AI95-00251-01} Dispatching calls should be
13861 efficient, and should have a bounded worst-case execution
13862 time. This is important in a language intended for real-time
13863 applications. In the intended implementation model, a
13864 dispatching call involves calling indirect through the
13865 appropriate slot in the dispatch table. No complicated
13866 "method lookup" is involved although a call which is
13867 dispatching on an interface may require a lookup of the
13868 appropriate interface subtag.
13869
13870 1.f
13871 The programmer should have the choice at each call site of a
13872 dispatching operation whether to do a dispatching call or a
13873 statically determined call (i.e. whether the body executed
13874 should be determined at run time or at compile time).
13875
13876 1.g
13877 The same body should be executed for a call where the tag is
13878 statically determined to be T'Tag as for a dispatching call
13879 where the tag is found at run time to be T'Tag. This allows
13880 one to test a given tagged type with statically determined
13881 calls, with some confidence that run-time dispatching will
13882 produce the same behavior.
13883
13884 1.h
13885 All views of a type should share the same type descriptor and
13886 the same tag.
13887
13888 1.i
13889 The visibility rules determine what is legal at compile time;
13890 they have nothing to do with what bodies can be executed at
13891 run time. Thus, it is possible to dispatch to a subprogram
13892 whose declaration is not visible at the call site. In fact,
13893 this is one of the primary facts that gives object-oriented
13894 programming its power. The subprogram that ends up being
13895 dispatched to by a given call might even be designed long
13896 after the call site has been coded and compiled.
13897
13898 1.j
13899 Given that Ada has overloading, determining whether a given
13900 subprogram overrides another is based both on the names and
13901 the type profiles of the operations.
13902
13903 1.k/2
13904 {AI95-00401-01AI95-00401-01} When a type extension is
13905 declared, if there is any place within its immediate scope
13906 where a certain subprogram of the parent or progenitor is
13907 visible, then a matching subprogram should override. If there
13908 is no such place, then a matching subprogram should be totally
13909 unrelated, and occupy a different slot in the type descriptor.
13910 This is important to preserve the privacy of private parts;
13911 when an operation declared in a private part is inherited, the
13912 inherited version can be overridden only in that private part,
13913 in the package body, and in any children of the package.
13914
13915 1.l
13916 If an implementation shares code for instances of generic
13917 bodies, it should be allowed to share type descriptors of
13918 tagged types declared in the generic body, so long as they are
13919 not extensions of types declared in the specification of the
13920 generic unit.
13921
13922 _Static Semantics_
13923
13924 2/2
13925 {AI95-00345-01AI95-00345-01} A record type or private type that has the
13926 reserved word tagged in its declaration is called a tagged type. In
13927 addition, an interface type is a tagged type, as is a task or protected
13928 type derived from an interface (see *note 3.9.4::). [When deriving from
13929 a tagged type, as for any derived type, additional primitive subprograms
13930 may be defined, and inherited primitive subprograms may be overridden.]
13931 The derived type is called an extension of its ancestor types, or simply
13932 a type extension.
13933
13934 2.1/2
13935 {AI95-00345-01AI95-00345-01} Every type extension is also a tagged type,
13936 and is a record extension or a private extension of some other tagged
13937 type, or a noninterface synchronized tagged type (see *note 3.9.4::). A
13938 record extension is defined by a derived_type_definition with a
13939 record_extension_part (see *note 3.9.1::)[, which may include the
13940 definition of additional components]. A private extension, which is a
13941 partial view of a record extension or of a synchronized tagged type, can
13942 be declared in the visible part of a package (see *note 7.3::) or in a
13943 generic formal part (see *note 12.5.1::).
13944
13945 2.a
13946 Glossary entry: The objects of a tagged type have a run-time
13947 type tag, which indicates the specific type with which the
13948 object was originally created. An operand of a class-wide
13949 tagged type can be used in a dispatching call; the tag
13950 indicates which subprogram body to invoke. Nondispatching
13951 calls, in which the subprogram body to invoke is determined at
13952 compile time, are also allowed. Tagged types may be extended
13953 with additional components.
13954
13955 2.b/2
13956 Ramification: {AI95-00218-03AI95-00218-03} If a tagged type is
13957 declared other than in a package_specification, it is
13958 impossible to add new primitive subprograms for that type,
13959 although it can inherit primitive subprograms, and those can
13960 be overridden. If the user incorrectly thinks a certain
13961 subprogram is primitive when it is not, and tries to call it
13962 with a dispatching call, an error message will be given at the
13963 call site. Similarly, by using an overriding_indicator (see
13964 *note 6.1::), the user can declare that a subprogram is
13965 intended to be overriding, and get an error message when they
13966 made a mistake. The use of overriding_indicators is highly
13967 recommended in new code that does not need to be compatible
13968 with Ada 95.
13969
13970 3
13971 An object of a tagged type has an associated (run-time) tag that
13972 identifies the specific tagged type used to create the object
13973 originally. [ The tag of an operand of a class-wide tagged type T'Class
13974 controls which subprogram body is to be executed when a primitive
13975 subprogram of type T is applied to the operand (see *note 3.9.2::);
13976 using a tag to control which body to execute is called dispatching.]
13977
13978 4/2
13979 {AI95-00344-01AI95-00344-01} The tag of a specific tagged type
13980 identifies the full_type_declaration of the type, and for a type
13981 extension, is sufficient to uniquely identify the type among all
13982 descendants of the same ancestor. If a declaration for a tagged type
13983 occurs within a generic_package_declaration, then the corresponding type
13984 declarations in distinct instances of the generic package are associated
13985 with distinct tags. For a tagged type that is local to a generic
13986 package body and with all of its ancestors (if any) also local to the
13987 generic body, the language does not specify whether repeated
13988 instantiations of the generic body result in distinct tags.
13989
13990 4.a/2
13991 This paragraph was deleted.{AI95-00344-01AI95-00344-01}
13992
13993 4.a.1/2
13994 Implementation Note: {AI95-00344-01AI95-00344-01} In most
13995 cases, a tag need only identify a particular tagged type
13996 declaration, and can therefore be a simple link-time-known
13997 address. However, for tag checks (see *note 3.9.2::) it is
13998 essential that each descendant (that currently exists) of a
13999 given type have a unique tag. Hence, for types declared in
14000 shared generic bodies where an ancestor comes from outside the
14001 generic, or for types declared at a deeper level than an
14002 ancestor, the tag needs to be augmented with some kind of
14003 dynamic descriptor (which may be a static link, global
14004 display, instance descriptor pointer, or combination). This
14005 implies that type Tag may need to be two words, the second of
14006 which is normally null, but in these identified special cases
14007 needs to include a static link or equivalent. Within an
14008 object of one of these types with a two-word tag, the two
14009 parts of the tag would typically be separated, one part as the
14010 first word of the object, the second placed in the first
14011 extension part that corresponds to a type declared more nested
14012 than its parent or declared in a shared generic body when the
14013 parent is declared outside. Alternatively, by using an extra
14014 level of indirection, the type Tag could remain a single-word.
14015
14016 4.b/2
14017 {AI95-00344-01AI95-00344-01} For types that are not type
14018 extensions (even for ones declared in nested scopes), we do
14019 not require that repeated elaborations of the same
14020 full_type_declaration correspond to distinct tags. This was
14021 done so that Ada 2005 implementations of tagged types could
14022 maintain representation compatibility with Ada 95
14023 implementations. Only type extensions that were not allowed
14024 in Ada 95 require additional information with the tag.
14025
14026 4.c/2
14027 To be honest: {AI95-00344-01AI95-00344-01} The wording "is
14028 sufficient to uniquely identify the type among all descendants
14029 of the same ancestor" only applies to types that currently
14030 exist. It is not necessary to distinguish between descendants
14031 that currently exist, and descendants of the same type that no
14032 longer exist. For instance, the address of the stack frame of
14033 the subprogram that created the tag is sufficient to meet the
14034 requirements of this rule, even though it is possible, after
14035 the subprogram returns, that a later call of the subprogram
14036 could have the same stack frame and thus have an identical
14037 tag.
14038
14039 5
14040 The following language-defined library package exists:
14041
14042 6/2
14043 {AI95-00362-01AI95-00362-01} package Ada.Tags is
14044 pragma Preelaborate(Tags);
14045 type Tag is private;
14046 pragma Preelaborable_Initialization(Tag);
14047
14048 6.1/2
14049 {AI95-00260-02AI95-00260-02} No_Tag : constant Tag;
14050
14051 7/2
14052 {AI95-00400-01AI95-00400-01} function Expanded_Name(T : Tag) return String;
14053 function Wide_Expanded_Name(T : Tag) return Wide_String;
14054 function Wide_Wide_Expanded_Name(T : Tag) return Wide_Wide_String;
14055 function External_Tag(T : Tag) return String;
14056 function Internal_Tag(External : String) return Tag;
14057
14058 7.1/2
14059 {AI95-00344-01AI95-00344-01} function Descendant_Tag(External : String; Ancestor : Tag) return Tag;
14060 function Is_Descendant_At_Same_Level(Descendant, Ancestor : Tag)
14061 return Boolean;
14062
14063 7.2/2
14064 {AI95-00260-02AI95-00260-02} function Parent_Tag (T : Tag) return Tag;
14065
14066 7.3/2
14067 {AI95-00405-01AI95-00405-01} type Tag_Array is array (Positive range <>) of Tag;
14068
14069 7.4/2
14070 {AI95-00405-01AI95-00405-01} function Interface_Ancestor_Tags (T : Tag) return Tag_Array;
14071
14072 7.5/3
14073 {AI05-0173-1AI05-0173-1} function Is_Abstract (T : Tag) return Boolean;
14074
14075 8
14076 Tag_Error : exception;
14077
14078 9
14079 private
14080 ... -- not specified by the language
14081 end Ada.Tags;
14082
14083 9.a
14084 Reason: Tag is a nonlimited, definite subtype, because it
14085 needs the equality operators, so that tag checking makes
14086 sense. Also, equality, assignment, and object declaration are
14087 all useful capabilities for this subtype.
14088
14089 9.b
14090 For an object X and a type T, "X'Tag = T'Tag" is not needed,
14091 because a membership test can be used. However, comparing the
14092 tags of two objects cannot be done via membership. This is
14093 one reason to allow equality for type Tag.
14094
14095 9.1/2
14096 {AI95-00260-02AI95-00260-02} No_Tag is the default initial value of type
14097 Tag.
14098
14099 9.c/2
14100 Reason: {AI95-00260-02AI95-00260-02} This is similar to the
14101 requirement that all access values be initialized to null.
14102
14103 10/2
14104 {AI95-00400-01AI95-00400-01} The function Wide_Wide_Expanded_Name
14105 returns the full expanded name of the first subtype of the specific type
14106 identified by the tag, in upper case, starting with a root library unit.
14107 The result is implementation defined if the type is declared within an
14108 unnamed block_statement.
14109
14110 10.a
14111 To be honest: This name, as well as each prefix of it, does
14112 not denote a renaming_declaration.
14113
14114 10.b/2
14115 Implementation defined: The result of
14116 Tags.Wide_Wide_Expanded_Name for types declared within an
14117 unnamed block_statement.
14118
14119 10.1/2
14120 {AI95-00400-01AI95-00400-01} The function Expanded_Name (respectively,
14121 Wide_Expanded_Name) returns the same sequence of graphic characters as
14122 that defined for Wide_Wide_Expanded_Name, if all the graphic characters
14123 are defined in Character (respectively, Wide_Character); otherwise, the
14124 sequence of characters is implementation defined, but no shorter than
14125 that returned by Wide_Wide_Expanded_Name for the same value of the
14126 argument.
14127
14128 10.c/2
14129 Implementation defined: The sequence of characters of the
14130 value returned by Tags.Expanded_Name (respectively,
14131 Tags.Wide_Expanded_Name) when some of the graphic characters
14132 of Tags.Wide_Wide_Expanded_Name are not defined in Character
14133 (respectively, Wide_Character).
14134
14135 11
14136 The function External_Tag returns a string to be used in an external
14137 representation for the given tag. The call External_Tag(S'Tag) is
14138 equivalent to the attribute_reference S'External_Tag (see *note 13.3::).
14139
14140 11.a
14141 Reason: It might seem redundant to provide both the function
14142 External_Tag and the attribute External_Tag. The function is
14143 needed because the attribute can't be applied to values of
14144 type Tag. The attribute is needed so that it can be specified
14145 via an attribute_definition_clause.
14146
14147 11.1/2
14148 {AI95-00417-01AI95-00417-01} The string returned by the functions
14149 Expanded_Name, Wide_Expanded_Name, Wide_Wide_Expanded_Name, and
14150 External_Tag has lower bound 1.
14151
14152 12/2
14153 {AI95-00279-01AI95-00279-01} The function Internal_Tag returns a tag
14154 that corresponds to the given external tag, or raises Tag_Error if the
14155 given string is not the external tag for any specific type of the
14156 partition. Tag_Error is also raised if the specific type identified is
14157 a library-level type whose tag has not yet been created (see *note
14158 13.14::).
14159
14160 12.a/3
14161 Reason: {AI95-00279-01AI95-00279-01} {AI05-0005-1AI05-0005-1}
14162 The check for uncreated library-level types prevents a
14163 reference to the type before execution reaches the freezing
14164 point of the type. This is important so that T'Class'Input or
14165 an instance of Tags.Generic_Dispatching_Constructor do not try
14166 to create an object of a type that hasn't been frozen (which
14167 might not have yet elaborated its constraints). We don't
14168 require this behavior for non-library-level types as the tag
14169 can be created multiple times and possibly multiple copies can
14170 exist at the same time, making the check complex.
14171
14172 12.1/3
14173 {AI95-00344-01AI95-00344-01} {AI05-0113-1AI05-0113-1} The function
14174 Descendant_Tag returns the (internal) tag for the type that corresponds
14175 to the given external tag and is both a descendant of the type
14176 identified by the Ancestor tag and has the same accessibility level as
14177 the identified ancestor. Tag_Error is raised if External is not the
14178 external tag for such a type. Tag_Error is also raised if the specific
14179 type identified is a library-level type whose tag has not yet been
14180 created, or if the given external tag identifies more than one type that
14181 has the appropriate Ancestor and accessibility level.
14182
14183 12.b/2
14184 Reason: Descendant_Tag is used by T'Class'Input to identify
14185 the type identified by an external tag. Because there can be
14186 multiple elaborations of a given type declaration,
14187 Internal_Tag does not have enough information to choose a
14188 unique such type. Descendant_Tag does not return the tag for
14189 types declared at deeper accessibility levels than the
14190 ancestor because there could be ambiguity in the presence of
14191 recursion or multiple tasks. Descendant_Tag can be used in
14192 constructing a user-defined replacement for T'Class'Input.
14193
14194 12.b.1/3
14195 {AI05-0113-1AI05-0113-1} Rules for specifying external tags
14196 will usually prevent an external tag from identifying more
14197 than one type. However, an external tag can identify multiple
14198 types if a generic body contains a derivation of a tagged type
14199 declared outside of the generic, and there are multiple
14200 instances at the same accessibility level as the type. (The
14201 Standard allows default external tags to not be unique in this
14202 case.)
14203
14204 12.2/2
14205 {AI95-00344-01AI95-00344-01} The function Is_Descendant_At_Same_Level
14206 returns True if the Descendant tag identifies a type that is both a
14207 descendant of the type identified by Ancestor and at the same
14208 accessibility level. If not, it returns False.
14209
14210 12.c/2
14211 Reason: Is_Descendant_At_Same_Level (or something similar to
14212 it) is used by T'Class'Output to determine whether the item
14213 being written is at the same accessibility level as T. It may
14214 be used to determine prior to using T'Class'Output whether
14215 Tag_Error will be raised, and also can be used in constructing
14216 a user-defined replacement for T'Class'Output.
14217
14218 12.3/3
14219 {AI05-0115-1AI05-0115-1} For the purposes of the dynamic semantics of
14220 functions Descendant_Tag and Is_Descendant_At_Same_Level, a tagged type
14221 T2 is a descendant of a type T1 if it is the same as T1, or if its
14222 parent type or one of its progenitor types is a descendant of type T1 by
14223 this rule[, even if at the point of the declaration of T2, one of the
14224 derivations in the chain is not visible].
14225
14226 12.c.1/3
14227 Discussion: In other contexts, "descendant" is dependent on
14228 visibility, and the particular view a derived type has of its
14229 parent type. See *note 7.3.1::.
14230
14231 12.4/3
14232 {AI95-00260-02AI95-00260-02} The function Parent_Tag returns the tag of
14233 the parent type of the type whose tag is T. If the type does not have a
14234 parent type (that is, it was not declared by a
14235 derived_type_declaration), then No_Tag is returned.
14236
14237 12.d/2
14238 Ramification: The parent type is always the parent of the full
14239 type; a private extension appears to define a parent type, but
14240 it does not (only the various forms of derivation do that).
14241 As this is a run-time operation, ignoring privateness is OK.
14242
14243 12.5/3
14244 {AI95-00405-01AI95-00405-01} The function Interface_Ancestor_Tags
14245 returns an array containing the tag of each interface ancestor type of
14246 the type whose tag is T, other than T itself. The lower bound of the
14247 returned array is 1, and the order of the returned tags is unspecified.
14248 Each tag appears in the result exactly once.[ If the type whose tag is T
14249 has no interface ancestors, a null array is returned.]
14250
14251 12.e/2
14252 Ramification: The result of Interface_Ancestor_Tags includes
14253 the tag of the parent type, if the parent is an interface.
14254
14255 12.f/2
14256 Indirect interface ancestors are included in the result of
14257 Interface_Ancestor_Tags. That's because where an interface
14258 appears in the derivation tree has no effect on the semantics
14259 of the type; the only interesting property is whether the type
14260 has an interface as an ancestor.
14261
14262 12.6/3
14263 {AI05-0173-1AI05-0173-1} The function Is_Abstract returns True if the
14264 type whose tag is T is abstract, and False otherwise.
14265
14266 13
14267 For every subtype S of a tagged type T (specific or class-wide), the
14268 following attributes are defined:
14269
14270 14
14271 S'Class
14272 S'Class denotes a subtype of the class-wide type (called
14273 T'Class in this International Standard) for the class
14274 rooted at T (or if S already denotes a class-wide
14275 subtype, then S'Class is the same as S).
14276
14277 15
14278 S'Class is unconstrained. However, if S is constrained,
14279 then the values of S'Class are only those that when
14280 converted to the type T belong to S.
14281
14282 15.a
14283 Ramification: This attribute is defined for both specific and
14284 class-wide subtypes. The definition is such that
14285 S'Class'Class is the same as S'Class.
14286
14287 15.b
14288 Note that if S is constrained, S'Class is only partially
14289 constrained, since there might be additional discriminants
14290 added in descendants of T which are not constrained.
14291
14292 15.c/2
14293 Reason: {AI95-00326-01AI95-00326-01} The Class attribute is
14294 not defined for untagged subtypes (except for incomplete types
14295 and private types whose full view is tagged -- see *note
14296 J.11:: and *note 7.3.1::) so as to preclude implicit
14297 conversion in the absence of run-time type information. If it
14298 were defined for untagged subtypes, it would correspond to the
14299 concept of universal types provided for the predefined numeric
14300 classes.
14301
14302 16
14303 S'Tag
14304 S'Tag denotes the tag of the type T (or if T is
14305 class-wide, the tag of the root type of the corresponding
14306 class). The value of this attribute is of type Tag.
14307
14308 16.a
14309 Reason: S'Class'Tag equals S'Tag, to avoid generic contract
14310 model problems when S'Class is the actual type associated with
14311 a generic formal derived type.
14312
14313 17
14314 Given a prefix X that is of a class-wide tagged type [(after any
14315 implicit dereference)], the following attribute is defined:
14316
14317 18
14318 X'Tag
14319 X'Tag denotes the tag of X. The value of this attribute
14320 is of type Tag.
14321
14322 18.a
14323 Reason: X'Tag is not defined if X is of a specific type. This
14324 is primarily to avoid confusion that might result about
14325 whether the Tag attribute should reflect the tag of the type
14326 of X, or the tag of X. No such confusion is possible if X is
14327 of a class-wide type.
14328
14329 18.1/2
14330 {AI95-00260-02AI95-00260-02} {AI95-00441-01AI95-00441-01} The following
14331 language-defined generic function exists:
14332
14333 18.2/3
14334 {AI05-0229-1AI05-0229-1} generic
14335 type T (<>) is abstract tagged limited private;
14336 type Parameters (<>) is limited private;
14337 with function Constructor (Params : not null access Parameters)
14338 return T is abstract;
14339 function Ada.Tags.Generic_Dispatching_Constructor
14340 (The_Tag : Tag;
14341 Params : not null access Parameters) return T'Class
14342 with Convention => Intrinsic;
14343 pragma Preelaborate(Generic_Dispatching_Constructor);
14344
14345 18.3/2
14346 {AI95-00260-02AI95-00260-02} Tags.Generic_Dispatching_Constructor
14347 provides a mechanism to create an object of an appropriate type from
14348 just a tag value. The function Constructor is expected to create the
14349 object given a reference to an object of type Parameters.
14350
14351 18.b/2
14352 Discussion: This specification is designed to make it easy to
14353 create dispatching constructors for streams; in particular,
14354 this can be used to construct overridings for T'Class'Input.
14355
14356 18.c/2
14357 Note that any tagged type will match T (see *note 12.5.1::).
14358
14359 _Dynamic Semantics_
14360
14361 19
14362 The tag associated with an object of a tagged type is determined as
14363 follows:
14364
14365 20
14366 * The tag of a stand-alone object, a component, or an aggregate of a
14367 specific tagged type T identifies T.
14368
14369 20.a
14370 Discussion: The tag of a formal parameter of type T is not
14371 necessarily the tag of T, if, for example, the actual was a
14372 type conversion.
14373
14374 21
14375 * The tag of an object created by an allocator for an access type
14376 with a specific designated tagged type T, identifies T.
14377
14378 21.a
14379 Discussion: The tag of an object designated by a value of such
14380 an access type might not be T, if, for example, the access
14381 value is the result of a type conversion.
14382
14383 22
14384 * The tag of an object of a class-wide tagged type is that of its
14385 initialization expression.
14386
14387 22.a
14388 Ramification: The tag of an object (even a class-wide one)
14389 cannot be changed after it is initialized, since a
14390 "class-wide" assignment_statement raises Constraint_Error if
14391 the tags don't match, and a "specific" assignment_statement
14392 does not affect the tag.
14393
14394 23
14395 * The tag of the result returned by a function whose result type is a
14396 specific tagged type T identifies T.
14397
14398 23.a/2
14399 Implementation Note: {AI95-00318-02AI95-00318-02} For a
14400 limited tagged type, the return object is "built in place" in
14401 the ultimate result object with the appropriate tag. For a
14402 nonlimited type, a new anonymous object with the appropriate
14403 tag is created as part of the function return. See *note
14404 6.5::, "*note 6.5:: Return Statements".
14405
14406 24/2
14407 * {AI95-00318-02AI95-00318-02} The tag of the result returned by a
14408 function with a class-wide result type is that of the return
14409 object.
14410
14411 25
14412 The tag is preserved by type conversion and by parameter passing. The
14413 tag of a value is the tag of the associated object (see *note 6.2::).
14414
14415 25.1/3
14416 {AI95-00260-02AI95-00260-02} {AI95-00344-01AI95-00344-01}
14417 {AI95-00405-01AI95-00405-01} {AI05-0092-1AI05-0092-1}
14418 {AI05-0262-1AI05-0262-1} Tag_Error is raised by a call of
14419 Descendant_Tag, Expanded_Name, External_Tag, Interface_Ancestor_Tags,
14420 Is_Abstract, Is_Descendant_At_Same_Level, Parent_Tag,
14421 Wide_Expanded_Name, or Wide_Wide_Expanded_Name if any tag passed is
14422 No_Tag.
14423
14424 25.2/2
14425 {AI95-00260-02AI95-00260-02} An instance of
14426 Tags.Generic_Dispatching_Constructor raises Tag_Error if The_Tag does
14427 not represent a concrete descendant of T or if the innermost master (see
14428 *note 7.6.1::) of this descendant is not also a master of the instance.
14429 Otherwise, it dispatches to the primitive function denoted by the formal
14430 Constructor for the type identified by The_Tag, passing Params, and
14431 returns the result. Any exception raised by the function is propagated.
14432
14433 25.a/2
14434 Ramification: The tag check checks both that The_Tag is in
14435 T'Class, and that it is not abstract. These checks are
14436 similar to the ones required by streams for T'Class'Input (see
14437 *note 13.13.2::). In addition, there is a check that the tag
14438 identifies a type declared on the current dynamic call chain,
14439 and not a more nested type or a type declared by another task.
14440 This check is not necessary for streams, because the stream
14441 attributes are declared at the same dynamic level as the type
14442 used.
14443
14444 _Erroneous Execution_
14445
14446 25.3/2
14447 {AI95-00260-02AI95-00260-02} If an internal tag provided to an instance
14448 of Tags.Generic_Dispatching_Constructor or to any subprogram declared in
14449 package Tags identifies either a type that is not library-level and
14450 whose tag has not been created (see *note 13.14::), or a type that does
14451 not exist in the partition at the time of the call, then execution is
14452 erroneous.
14453
14454 25.b/2
14455 Ramification: One reason that a type might not exist in the
14456 partition is that the tag refers to a type whose declaration
14457 was elaborated as part of an execution of a subprogram_body
14458 which has been left (see *note 7.6.1::).
14459
14460 25.c/2
14461 We exclude tags of library-level types from the current
14462 execution of the partition, because misuse of such tags should
14463 always be detected. T'Tag freezes the type (and thus creates
14464 the tag), and Internal_Tag and Descendant_Tag cannot return
14465 the tag of a library-level type that has not been created.
14466 All ancestors of a tagged type must be frozen no later than
14467 the (full) declaration of a type that uses them, so Parent_Tag
14468 and Interface_Ancestor_Tags cannot return a tag that has not
14469 been created. Finally, library-level types never cease to
14470 exist while the partition is executing. Thus, if the tag
14471 comes from a library-level type, there cannot be erroneous
14472 execution (the use of Descendant_Tag rather than Internal_Tag
14473 can help ensure that the tag is of a library-level type).
14474 This is also similar to the rules for T'Class'Input (see *note
14475 13.13.2::).
14476
14477 25.d/2
14478 Discussion: {AI95-00344-01AI95-00344-01} Ada 95 allowed
14479 Tag_Error in this case, or expected the functions to work.
14480 This worked because most implementations used tags constructed
14481 at link-time, and each elaboration of the same
14482 type_declaration produced the same tag. However, Ada 2005
14483 requires at least part of the tags to be dynamically
14484 constructed for a type derived from a type at a shallower
14485 level. For dynamically constructed tags, detecting the error
14486 can be expensive and unreliable. To see this, consider a
14487 program containing two tasks. Task A creates a nested tagged
14488 type, passes the tag to task B (which saves it), and then
14489 terminates. The nested tag (if dynamic) probably will need to
14490 refer in some way to the stack frame for task A. If task B
14491 later tries to use the tag created by task A, the tag's
14492 reference to the stack frame of A probably is a dangling
14493 pointer. Avoiding this would require some sort of protected
14494 tag manager, which would be a bottleneck in a program's
14495 performance. Moreover, we'd still have a race condition; if
14496 task A terminated after the tag check, but before the tag was
14497 used, we'd still have a problem. That means that all of these
14498 operations would have to be serialized. That could be a
14499 significant performance drain, whether or not nested tagged
14500 types are ever used. Therefore, we allow execution to become
14501 erroneous as we do for other dangling pointers. If the
14502 implementation can detect the error, we recommend that
14503 Tag_Error be raised.
14504
14505 _Implementation Permissions_
14506
14507 26/2
14508 {AI95-00260-02AI95-00260-02} {AI95-00279-01AI95-00279-01} The
14509 implementation of Internal_Tag and Descendant_Tag may raise Tag_Error if
14510 no specific type corresponding to the string External passed as a
14511 parameter exists in the partition at the time the function is called, or
14512 if there is no such type whose innermost master is a master of the point
14513 of the function call.
14514
14515 26.a/2
14516 Reason: {AI95-00260-02AI95-00260-02}
14517 {AI95-00279-01AI95-00279-01} {AI95-00344-01AI95-00344-01}
14518 Locking would be required to ensure that the mapping of
14519 strings to tags never returned tags of types which no longer
14520 exist, because types can cease to exist (because they belong
14521 to another task, as described above) during the execution of
14522 these operations. Moreover, even if these functions did use
14523 locking, that would not prevent the type from ceasing to exist
14524 at the instant that the function returned. Thus, we do not
14525 require the overhead of locking; hence the word "may" in this
14526 rule.
14527
14528 _Implementation Advice_
14529
14530 26.1/3
14531 {AI95-00260-02AI95-00260-02} {AI05-0113-1AI05-0113-1} Internal_Tag
14532 should return the tag of a type, if one exists, whose innermost master
14533 is a master of the point of the function call.
14534
14535 26.b/3
14536 Implementation Advice: Tags.Internal_Tag should return the tag
14537 of a type, if one exists, whose innermost master is a master
14538 of the point of the function call..
14539
14540 26.c/2
14541 Reason: {AI95-00260-02AI95-00260-02}
14542 {AI95-00344-01AI95-00344-01} It's not helpful if Internal_Tag
14543 returns the tag of some type in another task when one is
14544 available in the task that made the call. We don't require
14545 this behavior (because it requires the same implementation
14546 techniques we decided not to insist on previously), but
14547 encourage it.
14548
14549 26.d/3
14550 Discussion: {AI05-0113-1AI05-0113-1} There is no Advice for
14551 the result of Internal_Tag if no such type exists. In most
14552 cases, the Implementation Permission can be used to raise
14553 Tag_Error, but some other tag can be returned as well.
14554
14555 NOTES
14556
14557 27
14558 67 A type declared with the reserved word tagged should normally
14559 be declared in a package_specification, so that new primitive
14560 subprograms can be declared for it.
14561
14562 28
14563 68 Once an object has been created, its tag never changes.
14564
14565 29
14566 69 Class-wide types are defined to have unknown discriminants (see
14567 *note 3.7::). This means that objects of a class-wide type have to
14568 be explicitly initialized (whether created by an object_declaration
14569 or an allocator), and that aggregates have to be explicitly
14570 qualified with a specific type when their expected type is
14571 class-wide.
14572
14573 30/2
14574 70 {AI95-00260-02AI95-00260-02} {AI95-00326-01AI95-00326-01} The
14575 capability provided by Tags.Generic_Dispatching_Constructor is
14576 sometimes known as a factory.
14577
14578 _Examples_
14579
14580 31
14581 Examples of tagged record types:
14582
14583 32
14584 type Point is tagged
14585 record
14586 X, Y : Real := 0.0;
14587 end record;
14588
14589 33
14590 type Expression is tagged null record;
14591 -- Components will be added by each extension
14592
14593 _Extensions to Ada 83_
14594
14595 33.a
14596 Tagged types are a new concept.
14597
14598 _Inconsistencies With Ada 95_
14599
14600 33.b/2
14601 {AI95-00279-01AI95-00279-01} Amendment Correction: Added
14602 wording specifying that Internal_Tag must raise Tag_Error if
14603 the tag of a library-level type has not yet been created. Ada
14604 95 gave an Implementation Permission to do this; we require it
14605 to avoid erroneous execution when streaming in an object of a
14606 library-level type that has not yet been elaborated. This is
14607 technically inconsistent; a program that used Internal_Tag
14608 outside of streaming and used a compiler that didn't take
14609 advantage of the Implementation Permission would not have
14610 raised Tag_Error, and may have returned a useful tag. (If the
14611 tag was used in streaming, the program would have been
14612 erroneous.) Since such a program would not have been portable
14613 to a compiler that did take advantage of the Implementation
14614 Permission, this is not a significant inconsistency.
14615
14616 33.c/2
14617 {AI95-00417-01AI95-00417-01} We now define the lower bound of
14618 the string returned from [[Wide_]Wide_]Expanded_Name and
14619 External_Name. This makes working with the returned string
14620 easier, and is consistent with many other string-returning
14621 functions in Ada. This is technically an inconsistency; if a
14622 program depended on some other lower bound for the string
14623 returned from one of these functions, it could fail when
14624 compiled with Ada 2005. Such code is not portable even
14625 between Ada 95 implementations, so it should be very rare.
14626
14627 _Incompatibilities With Ada 95_
14628
14629 33.d/3
14630 {AI95-00260-02AI95-00260-02} {AI95-00344-01AI95-00344-01}
14631 {AI95-00400-01AI95-00400-01} {AI95-00405-01AI95-00405-01}
14632 {AI05-0005-1AI05-0005-1} Constant No_Tag, and functions
14633 Parent_Tag, Interface_Ancestor_Tags, Descendant_Tag,
14634 Is_Descendant_At_Same_Level, Wide_Expanded_Name, and
14635 Wide_Wide_Expanded_Name are added to Ada.Tags. If Ada.Tags is
14636 referenced in a use_clause, and an entity E with the same
14637 defining_identifier as a new entity in Ada.Tags is defined in
14638 a package that is also referenced in a use_clause, the entity
14639 E may no longer be use-visible, resulting in errors. This
14640 should be rare and is easily fixed if it does occur.
14641
14642 _Extensions to Ada 95_
14643
14644 33.e/2
14645 {AI95-00362-01AI95-00362-01} Ada.Tags is now defined to be
14646 preelaborated.
14647
14648 33.f/2
14649 {AI95-00260-02AI95-00260-02} Generic function
14650 Tags.Generic_Dispatching_Constructor is new.
14651
14652 _Wording Changes from Ada 95_
14653
14654 33.g/2
14655 {AI95-00318-02AI95-00318-02} We talk about return objects
14656 rather than return expressions, as functions can return using
14657 an extended_return_statement.
14658
14659 33.h/2
14660 {AI95-00344-01AI95-00344-01} Added wording to define that tags
14661 for all descendants of a tagged type must be distinct. This
14662 is needed to ensure that more nested type extensions will work
14663 properly. The wording does not require implementation changes
14664 for types that were allowed in Ada 95.
14665
14666 _Inconsistencies With Ada 2005_
14667
14668 33.i/3
14669 {AI05-0113-1AI05-0113-1} Correction: Added wording specifying
14670 that Dependent_Tag must raise Tag_Error if there is more than
14671 one type which matches the requirements. If an implementation
14672 had returned a random tag of the matching types, a program may
14673 have worked properly. However, such a program would not be
14674 portable (another implementation may return a different tag)
14675 and the conditions that would cause the problem are unlikely
14676 (most likely, a tagged type extension declared in a generic
14677 body with multiple instances in the same scope).
14678
14679 _Incompatibilities With Ada 2005_
14680
14681 33.j/3
14682 {AI05-0173-1AI05-0173-1} Function Is_Abstract is added to
14683 Ada.Tags. If Ada.Tags is referenced in a use_clause, and an
14684 entity E with the defining_identifier Is_Abstract is defined
14685 in a package that is also referenced in a use_clause, the
14686 entity E may no longer be use-visible, resulting in errors.
14687 This should be rare and is easily fixed if it does occur.
14688
14689 _Wording Changes from Ada 2005_
14690
14691 33.k/3
14692 {AI05-0115-1AI05-0115-1} Correction: We explicitly define the
14693 meaning of "descendant" at runtime, so that it does not depend
14694 on visibility as does the usual meaning.
14695
14696 * Menu:
14697
14698 * 3.9.1 :: Type Extensions
14699 * 3.9.2 :: Dispatching Operations of Tagged Types
14700 * 3.9.3 :: Abstract Types and Subprograms
14701 * 3.9.4 :: Interface Types
14702
14703 \1f
14704 File: aarm2012.info, Node: 3.9.1, Next: 3.9.2, Up: 3.9
14705
14706 3.9.1 Type Extensions
14707 ---------------------
14708
14709 1/2
14710 {AI95-00345-01AI95-00345-01} [ Every type extension is a tagged type,
14711 and is a record extension or a private extension of some other tagged
14712 type, or a noninterface synchronized tagged type.]
14713
14714 _Language Design Principles_
14715
14716 1.a
14717 We want to make sure that we can extend a generic formal
14718 tagged type, without knowing its discriminants.
14719
14720 1.b
14721 We don't want to allow components in an extension aggregate to
14722 depend on discriminants inherited from the parent value, since
14723 such dependence requires staticness in aggregates, at least
14724 for variants.
14725
14726 _Syntax_
14727
14728 2
14729 record_extension_part ::= with record_definition
14730
14731 _Legality Rules_
14732
14733 3/2
14734 {AI95-00344-01AI95-00344-01} {AI95-00345-01AI95-00345-01}
14735 {AI95-00419-01AI95-00419-01} The parent type of a record extension shall
14736 not be a class-wide type nor shall it be a synchronized tagged type (see
14737 *note 3.9.4::). If the parent type or any progenitor is nonlimited,
14738 then each of the components of the record_extension_part shall be
14739 nonlimited. In addition to the places where Legality Rules normally
14740 apply (see *note 12.3::), these rules apply also in the private part of
14741 an instance of a generic unit.
14742
14743 3.a
14744 Reason: If the parent is a limited formal type, then the
14745 actual might be nonlimited.
14746
14747 3.b/2
14748 {AI95-00344-01AI95-00344-01} Ada 95 required the record
14749 extensions to be the same level as the parent type. Now we
14750 use accessibility checks on class-wide allocators and return
14751 statements to prevent objects from living longer than their
14752 type.
14753
14754 3.c/2
14755 {AI95-00345-01AI95-00345-01} Synchronized tagged types cannot
14756 be extended. We have this limitation so that all of the data
14757 of a task or protected type is defined within the type. Data
14758 defined outside of the type wouldn't be subject to the mutual
14759 exclusion properties of a protected type, and couldn't be used
14760 by a task, and thus doesn't seem to be worth the potential
14761 impact on implementations.
14762
14763 4/2
14764 {AI95-00344-01AI95-00344-01} Within the body of a generic unit, or the
14765 body of any of its descendant library units, a tagged type shall not be
14766 declared as a descendant of a formal type declared within the formal
14767 part of the generic unit.
14768
14769 4.a
14770 Reason: This paragraph ensures that a dispatching call will
14771 never attempt to execute an inaccessible subprogram body.
14772
14773 4.a.1/2
14774 {AI95-00344-01AI95-00344-01} The convoluted wording ("formal
14775 type declared within the formal part") is necessary to include
14776 tagged types that are formal parameters of formal packages of
14777 the generic unit, as well as formal tagged and tagged formal
14778 derived types of the generic unit.
14779
14780 4.b/2
14781 {AI95-00344-01AI95-00344-01} This rule is necessary in order
14782 to preserve the contract model.
14783
14784 4.c/2
14785 {AI05-0005-1AI05-0005-1} {AI95-00344-01AI95-00344-01} If an
14786 ancestor is a formal of the generic unit , we have a problem
14787 because it might have an unknown number of subprograms that
14788 require overriding, as in the following example:
14789
14790 4.d/2
14791 package P is
14792 type T is tagged null record;
14793 function F return T; -- Inherited versions will require overriding.
14794 end P;
14795
14796 4.e
14797 generic
14798 type TT is tagged private;
14799 package Gp is
14800 type NT is abstract new TT with null record;
14801 procedure Q(X : in NT) is abstract;
14802 end Gp;
14803
14804 4.f/2
14805 package body Gp is
14806 type NT2 is new NT with null record; -- Illegal!
14807 procedure Q(X : in NT2) is begin null; end Q;
14808 -- Is this legal or not? Can't decide because
14809 -- we don't know whether TT had any functions that require
14810 -- overriding on extension.
14811 end Gp;
14812
14813 4.g
14814 package I is new Gp(TT => P.T);
14815
14816 4.h/2
14817 I.NT is an abstract type with two abstract subprograms: F
14818 (inherited as abstract) and Q (explicitly declared as
14819 abstract). But the generic body doesn't know about F, so we
14820 don't know that it needs to be overridden to make a
14821 nonabstract extension of NT.Hence, we have to disallow this
14822 case.
14823
14824 4.h.1/2
14825 Similarly, since the actual type for a formal tagged limited
14826 private type can be a nonlimited type, we would have a problem
14827 if a type extension of a limited private formal type could be
14828 declared in a generic body. Such an extension could have a
14829 task component, for example, and an object of that type could
14830 be passed to a dispatching operation of a nonlimited ancestor
14831 type. That operation could try to copy the object with the
14832 task component. That would be bad. So we disallow this as
14833 well.
14834
14835 4.i
14836 If TT were declared as abstract, then we could have the same
14837 problem with abstract procedures.
14838
14839 4.j
14840 We considered disallowing all tagged types in a generic body,
14841 for simplicity. We decided not to go that far, in order to
14842 avoid unnecessary restrictions.
14843
14844 4.k
14845 We also considered trying make the accessibility level part of
14846 the contract; i.e. invent some way of saying (in the
14847 generic_declaration) "all instances of this generic unit will
14848 have the same accessibility level as the generic_declaration."
14849 Unfortunately, that doesn't solve the part of the problem
14850 having to do with abstract types.
14851
14852 4.l/2
14853 This paragraph was deleted.
14854
14855 4.m/2
14856 Ramification: {AI95-00344AI95-00344} This rule applies to
14857 types with ancestors (directly or indirectly) of formal
14858 interface types (see *note 12.5.5::), formal tagged private
14859 types (see *note 12.5.1::), and formal derived private types
14860 whose ancestor type is tagged (see *note 12.5.1::).
14861
14862 _Static Semantics_
14863
14864 4.1/2
14865 {AI95-00391-01AI95-00391-01} A record extension is a null extension if
14866 its declaration has no known_discriminant_part and its
14867 record_extension_part includes no component_declarations.
14868
14869 _Dynamic Semantics_
14870
14871 5
14872 The elaboration of a record_extension_part consists of the elaboration
14873 of the record_definition.
14874
14875 NOTES
14876
14877 6
14878 71 The term "type extension" refers to a type as a whole. The
14879 term "extension part" refers to the piece of text that defines the
14880 additional components (if any) the type extension has relative to
14881 its specified ancestor type.
14882
14883 6.a
14884 Discussion: We considered other terminology, such as "extended
14885 type." However, the terms "private extended type" and "record
14886 extended type" did not convey the proper meaning. Hence, we
14887 have chosen to uniformly use the term "extension" as the type
14888 resulting from extending a type, with "private extension"
14889 being one produced by privately extending the type, and
14890 "record extension" being one produced by extending the type
14891 with an additional record-like set of components. Note also
14892 that the term "type extension" refers to the result of
14893 extending a type in the language Oberon as well (though there
14894 the term "extended type" is also used, interchangeably,
14895 perhaps because Oberon doesn't have the concept of a "private
14896 extension").
14897
14898 7/2
14899 72 {AI95-00344-01AI95-00344-01} When an extension is declared
14900 immediately within a body, primitive subprograms are inherited and
14901 are overridable, but new primitive subprograms cannot be added.
14902
14903 8
14904 73 A name that denotes a component (including a discriminant) of
14905 the parent type is not allowed within the record_extension_part.
14906 Similarly, a name that denotes a component defined within the
14907 record_extension_part is not allowed within the
14908 record_extension_part. It is permissible to use a name that
14909 denotes a discriminant of the record extension, providing there is
14910 a new known_discriminant_part in the enclosing type declaration.
14911 (The full rule is given in *note 3.8::.)
14912
14913 8.a
14914 Reason: The restriction against depending on discriminants of
14915 the parent is to simplify the definition of extension
14916 aggregates. The restriction against using parent components
14917 in other ways is methodological; it presumably simplifies
14918 implementation as well.
14919
14920 9
14921 74 Each visible component of a record extension has to have a
14922 unique name, whether the component is (visibly) inherited from the
14923 parent type or declared in the record_extension_part (see *note
14924 8.3::).
14925
14926 _Examples_
14927
14928 10
14929 Examples of record extensions (of types defined above in *note 3.9::):
14930
14931 11
14932 type Painted_Point is new Point with
14933 record
14934 Paint : Color := White;
14935 end record;
14936 -- Components X and Y are inherited
14937
14938 12
14939 Origin : constant Painted_Point := (X | Y => 0.0, Paint => Black);
14940
14941 13
14942 type Literal is new Expression with
14943 record -- a leaf in an Expression tree
14944 Value : Real;
14945 end record;
14946
14947 14
14948 type Expr_Ptr is access all Expression'Class;
14949 -- see *note 3.10::
14950
14951 15
14952 type Binary_Operation is new Expression with
14953 record -- an internal node in an Expression tree
14954 Left, Right : Expr_Ptr;
14955 end record;
14956
14957 16
14958 type Addition is new Binary_Operation with null record;
14959 type Subtraction is new Binary_Operation with null record;
14960 -- No additional components needed for these extensions
14961
14962 17
14963 Tree : Expr_Ptr := -- A tree representation of "5.0 + (13.0-7.0)"
14964 new Addition'(
14965 Left => new Literal'(Value => 5.0),
14966 Right => new Subtraction'(
14967 Left => new Literal'(Value => 13.0),
14968 Right => new Literal'(Value => 7.0)));
14969
14970 _Extensions to Ada 83_
14971
14972 17.a
14973 Type extension is a new concept.
14974
14975 _Extensions to Ada 95_
14976
14977 17.b/2
14978 {AI95-00344-01AI95-00344-01} Type extensions now can be
14979 declared in more nested scopes than their parent types.
14980 Additional accessibility checks on allocators and return
14981 statements prevent objects from outliving their type.
14982
14983 _Wording Changes from Ada 95_
14984
14985 17.c/2
14986 {AI95-00345-01AI95-00345-01} Added wording to prevent
14987 extending synchronized tagged types.
14988
14989 17.d/2
14990 {AI95-00391-01AI95-00391-01} Defined null extension for use
14991 elsewhere.
14992
14993 \1f
14994 File: aarm2012.info, Node: 3.9.2, Next: 3.9.3, Prev: 3.9.1, Up: 3.9
14995
14996 3.9.2 Dispatching Operations of Tagged Types
14997 --------------------------------------------
14998
14999 1/2
15000 {AI95-00260-02AI95-00260-02} {AI95-00335-01AI95-00335-01} The primitive
15001 subprograms of a tagged type, the subprograms declared by
15002 formal_abstract_subprogram_declaration (*note 12.6: S0297.)s, and the
15003 stream attributes of a specific tagged type that are available (see
15004 *note 13.13.2::) at the end of the declaration list where the type is
15005 declared are called dispatching operations. [A dispatching operation
15006 can be called using a statically determined controlling tag, in which
15007 case the body to be executed is determined at compile time.
15008 Alternatively, the controlling tag can be dynamically determined, in
15009 which case the call dispatches to a body that is determined at run
15010 time;] such a call is termed a dispatching call. [As explained below,
15011 the properties of the operands and the context of a particular call on a
15012 dispatching operation determine how the controlling tag is determined,
15013 and hence whether or not the call is a dispatching call. Run-time
15014 polymorphism is achieved when a dispatching operation is called by a
15015 dispatching call.]
15016
15017 1.a.1/2
15018 Reason: {AI95-00335-01AI95-00335-01} For the stream attributes
15019 of a type declared immediately within a package_specification
15020 that has a partial view, the declaration list to consider is
15021 the visible part of the package. Stream attributes that are
15022 not available in the same declaration list are not dispatching
15023 as there is no guarantee that descendants of the type have
15024 available attributes (there is such a guarantee for visibly
15025 available attributes). If we allowed dispatching for any
15026 available attribute, then for attributes defined in the
15027 private part we could end up executing a nonexistent body.
15028
15029 _Language Design Principles_
15030
15031 1.a
15032 The controlling tag determination rules are analogous to the
15033 overload resolution rules, except they deal with run-time type
15034 identification (tags) rather than compile-time type
15035 resolution. As with overload resolution, controlling tag
15036 determination may depend on operands or result context.
15037
15038 _Static Semantics_
15039
15040 2/3
15041 {AI95-00260-02AI95-00260-02} {AI95-00416-01AI95-00416-01}
15042 {AI05-0076-1AI05-0076-1} A call on a dispatching operation is a call
15043 whose name or prefix denotes the declaration of a dispatching operation.
15044 A controlling operand in a call on a dispatching operation of a tagged
15045 type T is one whose corresponding formal parameter is of type T or is of
15046 an anonymous access type with designated type T; the corresponding
15047 formal parameter is called a controlling formal parameter. If the
15048 controlling formal parameter is an access parameter, the controlling
15049 operand is the object designated by the actual parameter, rather than
15050 the actual parameter itself. If the call is to a (primitive) function
15051 with result type T (a function with a controlling result), then the call
15052 has a controlling result -- the context of the call can control the
15053 dispatching. Similarly, if the call is to a function with an access
15054 result type designating T (a function with a controlling access result),
15055 then the call has a controlling access result, and the context can
15056 similarly control dispatching.
15057
15058 2.a
15059 Ramification: This definition implies that a call through the
15060 dereference of an access-to-subprogram value is never
15061 considered a call on a dispatching operation. Note also that
15062 if the prefix denotes a renaming_declaration, the place where
15063 the renaming occurs determines whether it is primitive; the
15064 thing being renamed is irrelevant.
15065
15066 3
15067 A name or expression of a tagged type is either statically tagged,
15068 dynamically tagged, or tag indeterminate, according to whether, when
15069 used as a controlling operand, the tag that controls dispatching is
15070 determined statically by the operand's (specific) type, dynamically by
15071 its tag at run time, or from context. A qualified_expression or
15072 parenthesized expression is statically, dynamically, or indeterminately
15073 tagged according to its operand. For other kinds of names and
15074 expressions, this is determined as follows:
15075
15076 4/2
15077 * {AI95-00416-01AI95-00416-01} The name or expression is statically
15078 tagged if it is of a specific tagged type and, if it is a call with
15079 a controlling result or controlling access result, it has at least
15080 one statically tagged controlling operand;
15081
15082 4.a
15083 Discussion: It is illegal to have both statically tagged and
15084 dynamically tagged controlling operands in the same call --
15085 see below.
15086
15087 5/2
15088 * {AI95-00416-01AI95-00416-01} The name or expression is dynamically
15089 tagged if it is of a class-wide type, or it is a call with a
15090 controlling result or controlling access result and at least one
15091 dynamically tagged controlling operand;
15092
15093 6/2
15094 * {AI95-00416-01AI95-00416-01} The name or expression is tag
15095 indeterminate if it is a call with a controlling result or
15096 controlling access result, all of whose controlling operands (if
15097 any) are tag indeterminate.
15098
15099 7/1
15100 {8652/00108652/0010} {AI95-00127-01AI95-00127-01} [A type_conversion is
15101 statically or dynamically tagged according to whether the type
15102 determined by the subtype_mark is specific or class-wide, respectively.]
15103 For an object that is designated by an expression whose expected type is
15104 an anonymous access-to-specific tagged type, the object is dynamically
15105 tagged if the expression, ignoring enclosing parentheses, is of the form
15106 X'Access, where X is of a class-wide type, or is of the form new
15107 T'(...), where T denotes a class-wide subtype. Otherwise, the object is
15108 statically or dynamically tagged according to whether the designated
15109 type of the type of the expression is specific or class-wide,
15110 respectively.
15111
15112 7.a
15113 Ramification: A type_conversion is never tag indeterminate,
15114 even if its operand is. A designated object is never tag
15115 indeterminate.
15116
15117 7.a.1/1
15118 {8652/00108652/0010} {AI95-00127-01AI95-00127-01} Allocators
15119 and access attributes of class-wide types can be used as the
15120 controlling parameters of dispatching calls.
15121
15122 _Legality Rules_
15123
15124 8
15125 A call on a dispatching operation shall not have both dynamically tagged
15126 and statically tagged controlling operands.
15127
15128 8.a
15129 Reason: This restriction is intended to minimize confusion
15130 between whether the dynamically tagged operands are implicitly
15131 converted to, or tag checked against the specific type of the
15132 statically tagged operand(s).
15133
15134 9/1
15135 {8652/00108652/0010} {AI95-00127-01AI95-00127-01} If the expected type
15136 for an expression or name is some specific tagged type, then the
15137 expression or name shall not be dynamically tagged unless it is a
15138 controlling operand in a call on a dispatching operation. Similarly, if
15139 the expected type for an expression is an anonymous access-to-specific
15140 tagged type, then the object designated by the expression shall not be
15141 dynamically tagged unless it is a controlling operand in a call on a
15142 dispatching operation.
15143
15144 9.a
15145 Reason: This prevents implicit "truncation" of a
15146 dynamically-tagged value to the specific type of the target
15147 object/formal. An explicit conversion is required to request
15148 this truncation.
15149
15150 9.b/2
15151 Ramification: {AI95-00252-01AI95-00252-01} This rule applies
15152 to all expressions or names with a specific expected type, not
15153 just those that are actual parameters to a dispatching call.
15154 This rule does not apply to a membership test whose expression
15155 is class-wide, since any type that covers the tested type is
15156 explicitly allowed. See *note 4.5.2::. This rule also
15157 doesn't apply to a selected_component whose selector_name is a
15158 subprogram, since the rules explicitly say that the prefix may
15159 be class-wide (see *note 4.1.3::).
15160
15161 10/2
15162 {8652/00118652/0011} {AI95-00117-01AI95-00117-01}
15163 {AI95-00430-01AI95-00430-01} In the declaration of a dispatching
15164 operation of a tagged type, everywhere a subtype of the tagged type
15165 appears as a subtype of the profile (see *note 6.1::), it shall
15166 statically match the first subtype of the tagged type. If the
15167 dispatching operation overrides an inherited subprogram, it shall be
15168 subtype conformant with the inherited subprogram. The convention of an
15169 inherited dispatching operation is the convention of the corresponding
15170 primitive operation of the parent or progenitor type. The default
15171 convention of a dispatching operation that overrides an inherited
15172 primitive operation is the convention of the inherited operation; if the
15173 operation overrides multiple inherited operations, then they shall all
15174 have the same convention. An explicitly declared dispatching operation
15175 shall not be of convention Intrinsic.
15176
15177 10.a
15178 Reason: These rules ensure that constraint checks can be
15179 performed by the caller in a dispatching call, and parameter
15180 passing conventions match up properly. A special rule on
15181 aggregates prevents values of a tagged type from being created
15182 that are outside of its first subtype.
15183
15184 11/2
15185 {AI95-00416-01AI95-00416-01} The default_expression for a controlling
15186 formal parameter of a dispatching operation shall be tag indeterminate.
15187
15188 11.a/2
15189 Reason: {AI95-00416-01AI95-00416-01} This rule ensures that
15190 the default_expression always produces the "correct" tag when
15191 called with or without dispatching, or when inherited by a
15192 descendant. If it were statically tagged, the default would
15193 be useless for a dispatching call; if it were dynamically
15194 tagged, the default would be useless for a nondispatching
15195 call.
15196
15197 11.1/2
15198 {AI95-00404-01AI95-00404-01} If a dispatching operation is defined by a
15199 subprogram_renaming_declaration or the instantiation of a generic
15200 subprogram, any access parameter of the renamed subprogram or the
15201 generic subprogram that corresponds to a controlling access parameter of
15202 the dispatching operation, shall have a subtype that excludes null.
15203
15204 12
15205 A given subprogram shall not be a dispatching operation of two or more
15206 distinct tagged types.
15207
15208 12.a
15209 Reason: This restriction minimizes confusion since multiple
15210 dispatching is not provided. The normal solution is to
15211 replace all but one of the tagged types with their class-wide
15212 types.
15213
15214 12.a.1/1
15215 Ramification: {8652/00988652/0098}
15216 {AI95-00183-01AI95-00183-01} This restriction applies even if
15217 the partial view (see *note 7.3::) of one or both of the types
15218 is untagged. This follows from the definition of dispatching
15219 operation: the operation is a dispatching operation anywhere
15220 the full views of the (tagged) types are visible.
15221
15222 13
15223 The explicit declaration of a primitive subprogram of a tagged type
15224 shall occur before the type is frozen (see *note 13.14::). [For
15225 example, new dispatching operations cannot be added after objects or
15226 values of the type exist, nor after deriving a record extension from it,
15227 nor after a body.]
15228
15229 13.a/2
15230 Reason: {AI95-00344-01AI95-00344-01} This rule is needed
15231 because (1) we don't want people dispatching to things that
15232 haven't been declared yet, and (2) we want to allow the static
15233 part of tagged type descriptors to be static (allocated
15234 statically, and initialized to link-time-known symbols).
15235 Suppose T2 inherits primitive P from T1, and then overrides P.
15236 Suppose P is called before the declaration of the overriding
15237 P. What should it dispatch to? If the answer is the new P,
15238 we've violated the first principle above. If the answer is
15239 the old P, we've violated the second principle. (A call to
15240 the new one necessarily raises Program_Error, but that's
15241 beside the point.)
15242
15243 13.b
15244 Note that a call upon a dispatching operation of type T will
15245 freeze T.
15246
15247 13.c
15248 We considered applying this rule to all derived types, for
15249 uniformity. However, that would be upward incompatible, so we
15250 rejected the idea. As in Ada 83, for an untagged type, the
15251 above call upon P will call the old P (which is arguably
15252 confusing).
15253
15254 13.d/2
15255 Implementation Note: {AI95-00326-01AI95-00326-01} Because of
15256 this rule, the type descriptor can be created (presumably
15257 containing linker symbols pointing at the not-yet-compiled
15258 bodies) at the first freezing point of the type. It also
15259 prevents, for a (nonincomplete) tagged type declared in a
15260 package_specification, overriding in the body or by a child
15261 subprogram.
15262
15263 13.e/2
15264 Ramification: {AI95-00251-01AI95-00251-01} A consequence is
15265 that for a tagged type declaration in a declarative_part, only
15266 the last (overriding) primitive subprogram can be declared by
15267 a subprogram_body. (Other overridings must be provided by
15268 subprogram_declarations.)
15269
15270 13.f/3
15271 To be honest: {AI05-0222-1AI05-0222-1} This rule applies only
15272 to "original" declarations and not to the completion of a
15273 primitive subprogram, even though a completion is technically
15274 an explicit declaration, and it may declare a primitive
15275 subprogram.
15276
15277 _Dynamic Semantics_
15278
15279 14
15280 For the execution of a call on a dispatching operation of a type T, the
15281 controlling tag value determines which subprogram body is executed. The
15282 controlling tag value is defined as follows:
15283
15284 15
15285 * If one or more controlling operands are statically tagged, then the
15286 controlling tag value is statically determined to be the tag of T.
15287
15288 16
15289 * If one or more controlling operands are dynamically tagged, then
15290 the controlling tag value is not statically determined, but is
15291 rather determined by the tags of the controlling operands. If
15292 there is more than one dynamically tagged controlling operand, a
15293 check is made that they all have the same tag. If this check
15294 fails, Constraint_Error is raised unless the call is a
15295 function_call whose name denotes the declaration of an equality
15296 operator (predefined or user defined) that returns Boolean, in
15297 which case the result of the call is defined to indicate
15298 inequality, and no subprogram_body is executed. This check is
15299 performed prior to evaluating any tag-indeterminate controlling
15300 operands.
15301
15302 16.a
15303 Reason: Tag mismatch is considered an error (except for "="
15304 and "/=") since the corresponding primitive subprograms in
15305 each specific type expect all controlling operands to be of
15306 the same type. For tag mismatch with an equality operator,
15307 rather than raising an exception, "=" returns False and "/="
15308 returns True. No equality operator is actually invoked, since
15309 there is no common tag value to control the dispatch.
15310 Equality is a special case to be consistent with the existing
15311 Ada 83 principle that equality comparisons, even between
15312 objects with different constraints, never raise
15313 Constraint_Error.
15314
15315 17/2
15316 * {AI95-00196-01AI95-00196-01} If all of the controlling operands (if
15317 any) are tag-indeterminate, then:
15318
15319 18/2
15320 * {AI95-00239-01AI95-00239-01} {AI95-00416-01AI95-00416-01}
15321 If the call has a controlling result or controlling
15322 access result and is itself, or designates, a (possibly
15323 parenthesized or qualified) controlling operand of an
15324 enclosing call on a dispatching operation of a descendant
15325 of type T, then its controlling tag value is determined
15326 by the controlling tag value of this enclosing call;
15327
15328 18.a/2
15329 Discussion: {AI95-00239-01AI95-00239-01} For code that a user
15330 can write explicitly, the only contexts that can control
15331 dispatching of a function with a controlling result of type T
15332 are those that involve controlling operands of the same type
15333 T: if the two types differ there is an illegality and the
15334 dynamic semantics are irrelevant.
15335
15336 18.b/2
15337 In the case of an inherited subprogram however, if a default
15338 expression is a function call, it may be of type T while the
15339 parameter is of a type derived from T. To cover this case, we
15340 talk about "a descendant of T" above. This is safe, because
15341 if the type of the parameter is descended from the type of the
15342 function result, it is guaranteed to inherit or override the
15343 function, and this ensures that there will be an appropriate
15344 body to dispatch to. Note that abstract functions are not an
15345 issue here because the call to the function is a dispatching
15346 call, so it is guaranteed to always land on a concrete body.
15347
15348 18.1/2
15349 * {AI95-00196-01AI95-00196-01} {AI95-00416-01AI95-00416-01}
15350 If the call has a controlling result or controlling
15351 access result and (possibly parenthesized, qualified, or
15352 dereferenced) is the expression of an
15353 assignment_statement whose target is of a class-wide
15354 type, then its controlling tag value is determined by the
15355 target;
15356
15357 19
15358 * Otherwise, the controlling tag value is statically
15359 determined to be the tag of type T.
15360
15361 19.a
15362 Ramification: This includes the cases of a tag-indeterminate
15363 procedure call, and a tag-indeterminate function_call that is
15364 used to initialize a class-wide formal parameter or class-wide
15365 object.
15366
15367 20/3
15368 {AI95-00345-01AI95-00345-01} {AI05-0126-1AI05-0126-1} For the execution
15369 of a call on a dispatching operation, the action performed is determined
15370 by the properties of the corresponding dispatching operation of the
15371 specific type identified by the controlling tag value:
15372
15373 20.1/3
15374 * {AI05-0126-1AI05-0126-1} if the corresponding operation is
15375 explicitly declared for this type, [even if the declaration occurs
15376 in a private part], then the action comprises an invocation of the
15377 explicit body for the operation;
15378
15379 20.2/3
15380 * {AI95-00345-01AI95-00345-01} {AI05-0126-1AI05-0126-1} if the
15381 corresponding operation is implicitly declared for this type and is
15382 implemented by an entry or protected subprogram (see *note 9.1::
15383 and *note 9.4::), then the action comprises a call on this entry or
15384 protected subprogram, with the target object being given by the
15385 first actual parameter of the call, and the actual parameters of
15386 the entry or protected subprogram being given by the remaining
15387 actual parameters of the call, if any;
15388
15389 20.3/3
15390 * {AI05-0197-1AI05-0197-1} if the corresponding operation is a
15391 predefined operator then the action comprises an invocation of that
15392 operator;
15393
15394 20.4/3
15395 * {AI95-00345-01AI95-00345-01} {AI05-0126-1AI05-0126-1}
15396 {AI05-0197-1AI05-0197-1} {AI05-0250-1AI05-0250-1}
15397 {AI05-0254-1AI05-0254-1} otherwise, the action is the same as the
15398 action for the corresponding operation of the parent type or
15399 progenitor type from which the operation was inherited except that
15400 additional invariant checks (see *note 7.3.2::) and class-wide
15401 postcondition checks (see *note 6.1.1::) may apply. If there is
15402 more than one such corresponding operation, the action is that for
15403 the operation that is not a null procedure, if any; otherwise, the
15404 action is that of an arbitrary one of the operations.
15405
15406 20.a/3
15407 This paragraph was deleted.{AI05-0126-1AI05-0126-1}
15408
15409 20.a.1/3
15410 Ramification: {AI05-0005-1AI05-0005-1}
15411 {AI05-0126-1AI05-0126-1} "Corresponding dispatching operation"
15412 refers to the inheritance relationship between subprograms.
15413 Primitive operations are always inherited for a type T, but
15414 they might not be declared if the primitive operation is never
15415 visible within the immediate scope of the type T. If no
15416 corresponding operation is declared, the last bullet is used
15417 and the corresponding operation of the parent type is executed
15418 (an explicit body that happens to have the same name and
15419 profile is not called in that case).
15420
15421 20.a.2/3
15422 {AI05-0005-1AI05-0005-1} {AI05-0126-1AI05-0126-1} We have to
15423 talk about progenitors in the last bullet in case the
15424 corresponding operation is a null procedure inherited from an
15425 interface. In that case, the parent type might not even have
15426 the operation in question.
15427
15428 20.a.3/3
15429 {AI05-0197-1AI05-0197-1} For the last bullet, if there are
15430 multiple corresponding operations for the parent and
15431 progenitors, all but one of them have to be a null procedure.
15432 (If the progenitors declared abstract routines, there would
15433 have to be an explicit overriding of the operation, and then
15434 the first bullet would apply.) We call the nonnull routine if
15435 one exists.
15436
15437 20.a.4/3
15438 {AI05-0126-1AI05-0126-1} Any explicit declaration for an
15439 inherited corresponding operation has to be an overriding
15440 routine. These rules mean that a dispatching call executes
15441 the overriding routine (if any) for the specific type.
15442
15443 20.b/3
15444 Reason: {AI05-0005-1AI05-0005-1} The wording of the above
15445 rules is intended to ensure that the same body is executed for
15446 a given tag, whether that tag is determined statically or
15447 dynamically. For a type declared in a package, it doesn't
15448 matter whether a given subprogram is overridden in the visible
15449 part or the private part, and it doesn't matter whether the
15450 call is inside or outside the package. For example:
15451
15452 20.c
15453 package P1 is
15454 type T1 is tagged null record;
15455 procedure Op_A(Arg : in T1);
15456 procedure Op_B(Arg : in T1);
15457 end P1;
15458
15459 20.d
15460 with P1; use P1;
15461 package P2 is
15462 type T2 is new T1 with null record;
15463 procedure Op_A(Param : in T2);
15464 private
15465 procedure Op_B(Param : in T2);
15466 end P2;
15467
15468 20.e/1
15469 with P1; with P2;
15470 procedure Main is
15471 X : P2.T2;
15472 Y : P1.T1'Class := X;
15473 begin
15474 P2.Op_A(Param => X); -- Nondispatching call to a dispatching operation.
15475 P1.Op_A(Arg => Y); -- Dispatching call.
15476 P2.Op_B(Arg => X); -- Nondispatching call to a dispatching operation.
15477 P1.Op_B(Arg => Y); -- Dispatching call.
15478 end Main;
15479
15480 20.f
15481 The two calls to Op_A both execute the body of Op_A that has
15482 to occur in the body of package P2. Similarly, the two calls
15483 to Op_B both execute the body of Op_B that has to occur in the
15484 body of package P2, even though Op_B is overridden in the
15485 private part of P2. Note, however, that the formal parameter
15486 names are different for P2.Op_A versus P2.Op_B. The overriding
15487 declaration for P2.Op_B is not visible in Main, so the name in
15488 the call actually denotes the implicit declaration of Op_B
15489 inherited from T1.
15490
15491 20.g
15492 If a call occurs in the program text before an overriding,
15493 which can happen only if the call is part of a default
15494 expression, the overriding will still take effect for that
15495 call.
15496
15497 20.h
15498 Implementation Note: Even when a tag is not statically
15499 determined, a compiler might still be able to figure it out
15500 and thereby avoid the overhead of run-time dispatching.
15501
15502 NOTES
15503
15504 21
15505 75 The body to be executed for a call on a dispatching operation
15506 is determined by the tag; it does not matter whether that tag is
15507 determined statically or dynamically, and it does not matter
15508 whether the subprogram's declaration is visible at the place of the
15509 call.
15510
15511 22/2
15512 76 {AI95-00260-02AI95-00260-02} This subclause covers calls on
15513 dispatching subprograms of a tagged type. Rules for tagged type
15514 membership tests are described in *note 4.5.2::. Controlling tag
15515 determination for an assignment_statement is described in *note
15516 5.2::.
15517
15518 23
15519 77 A dispatching call can dispatch to a body whose declaration is
15520 not visible at the place of the call.
15521
15522 24
15523 78 A call through an access-to-subprogram value is never a
15524 dispatching call, even if the access value designates a dispatching
15525 operation. Similarly a call whose prefix denotes a
15526 subprogram_renaming_declaration cannot be a dispatching call unless
15527 the renaming itself is the declaration of a primitive subprogram.
15528
15529 _Extensions to Ada 83_
15530
15531 24.a
15532 The concept of dispatching operations is new.
15533
15534 _Incompatibilities With Ada 95_
15535
15536 24.b/2
15537 {AI95-00404-01AI95-00404-01} If a dispatching operation is
15538 defined by a subprogram_renaming_declaration, and it has a
15539 controlling access parameter, Ada 2005 requires the subtype of
15540 the parameter to exclude null. The same applies to
15541 instantiations. This is required so that all calls to the
15542 subprogram operate the same way (controlling access parameters
15543 have to exclude null so that dispatching calls will work).
15544 Since Ada 95 didn't have the notion of access subtypes that
15545 exclude null, and all access parameters excluded null, it had
15546 no such rules. These rules will require the addition of an
15547 explicit not null on nondispatching operations that are later
15548 renamed to be dispatching, or on a generic that is used to
15549 define a dispatching operation.
15550
15551 _Extensions to Ada 95_
15552
15553 24.c/2
15554 {AI95-00416-01AI95-00416-01} Functions that have an access
15555 result type can be dispatching in the same way as a function
15556 that returns a tagged object directly.
15557
15558 _Wording Changes from Ada 95_
15559
15560 24.d/3
15561 {8652/00108652/0010} {AI95-00127-01AI95-00127-01}
15562 {AI05-0299-1AI05-0299-1} Corrigendum: Allocators and access
15563 attributes of objects of class-wide types can be used as the
15564 controlling parameter in a dispatching calls. This was an
15565 oversight in the definition of Ada 95. (See *note 3.10.2::
15566 and *note 4.8::).
15567
15568 24.e/2
15569 {8652/00118652/0011} {AI95-00117-01AI95-00117-01}
15570 {AI95-00430-01AI95-00430-01} Corrigendum: Corrected the
15571 conventions of dispatching operations. This is extended in
15572 Ada 2005 to cover operations inherited from progenitors, and
15573 to ensure that the conventions of all inherited operations are
15574 the same.
15575
15576 24.f/2
15577 {AI95-00196-01AI95-00196-01} Clarified the wording to ensure
15578 that functions with no controlling operands are
15579 tag-indeterminate, and to describe that the controlling tag
15580 can come from the target of an assignment_statement.
15581
15582 24.g/2
15583 {AI95-00239-01AI95-00239-01} Fixed the wording to cover
15584 default expressions inherited by derived subprograms. A
15585 literal reading of the old wording would have implied that
15586 operations would be called with objects of the wrong type.
15587
15588 24.h/2
15589 {AI95-00260-02AI95-00260-02} An abstract formal subprogram is
15590 a dispatching operation, even though it is not a primitive
15591 operation. See *note 12.6::, "*note 12.6:: Formal
15592 Subprograms".
15593
15594 24.i/2
15595 {AI95-00345-01AI95-00345-01} Dispatching calls include
15596 operations implemented by entries and protected operations, so
15597 we have to update the wording to reflect that.
15598
15599 24.j/2
15600 {AI95-00335-01AI95-00335-01} A stream attribute of a tagged
15601 type is usually a dispatching operation, even though it is not
15602 a primitive operation. If they weren't dispatching,
15603 T'Class'Input and T'Class'Output wouldn't work.
15604
15605 _Wording Changes from Ada 2005_
15606
15607 24.k/3
15608 {AI05-0076-1AI05-0076-1} Correction: Defined "function with a
15609 controlling result", as it is used in *note 3.9.3::.
15610
15611 24.l/3
15612 {AI05-0126-1AI05-0126-1} {AI05-0197-1AI05-0197-1} Correction:
15613 Corrected holes in the definition of dynamic dispatching: the
15614 behavior for operations that are never declared and/or
15615 inherited from a progenitor were not specified.
15616
15617 \1f
15618 File: aarm2012.info, Node: 3.9.3, Next: 3.9.4, Prev: 3.9.2, Up: 3.9
15619
15620 3.9.3 Abstract Types and Subprograms
15621 ------------------------------------
15622
15623 1/2
15624 {AI95-00345-01AI95-00345-01} [ An abstract type is a tagged type
15625 intended for use as an ancestor of other types, but which is not allowed
15626 to have objects of its own. An abstract subprogram is a subprogram that
15627 has no body, but is intended to be overridden at some point when
15628 inherited. Because objects of an abstract type cannot be created, a
15629 dispatching call to an abstract subprogram always dispatches to some
15630 overriding body.]
15631
15632 1.a.1/2
15633 Glossary entry: An abstract type is a tagged type intended for
15634 use as an ancestor of other types, but which is not allowed to
15635 have objects of its own.
15636
15637 _Language Design Principles_
15638
15639 1.a/3
15640 {AI05-0299-1AI05-0299-1} An abstract subprogram has no body,
15641 so the rules in this subclause are designed to ensure (at
15642 compile time) that the body will never be invoked. We do so
15643 primarily by disallowing the creation of values of the
15644 abstract type. Therefore, since type conversion and parameter
15645 passing don't change the tag, we know we will never get a
15646 class-wide value with a tag identifying an abstract type.
15647 This means that we only have to disallow nondispatching calls
15648 on abstract subprograms (dispatching calls will never reach
15649 them).
15650
15651 _Syntax_
15652
15653 1.1/3
15654 {AI95-00218-03AI95-00218-03} {AI95-00348-01AI95-00348-01}
15655 {AI05-0183-1AI05-0183-1} abstract_subprogram_declaration ::=
15656 [overriding_indicator]
15657 subprogram_specification is abstract
15658 [aspect_specification];
15659
15660 _Static Semantics_
15661
15662 1.2/2
15663 {AI95-00345-01AI95-00345-01} Interface types (see *note 3.9.4::) are
15664 abstract types. In addition, a tagged type that has the reserved word
15665 abstract in its declaration is an abstract type. The class-wide type
15666 (see *note 3.4.1::) rooted at an abstract type is not itself an abstract
15667 type.
15668
15669 _Legality Rules_
15670
15671 2/2
15672 {AI95-00345-01AI95-00345-01} Only a tagged type shall have the reserved
15673 word abstract in its declaration.
15674
15675 2.a
15676 Ramification: Untagged types are never abstract, even though
15677 they can have primitive abstract subprograms. Such
15678 subprograms cannot be called, unless they also happen to be
15679 dispatching operations of some tagged type, and then only via
15680 a dispatching call.
15681
15682 2.b
15683 Class-wide types are never abstract. If T is abstract, then
15684 it is illegal to declare a stand-alone object of type T, but
15685 it is OK to declare a stand-alone object of type T'Class; the
15686 latter will get a tag from its initial value, and this tag
15687 will necessarily be different from T'Tag.
15688
15689 3/2
15690 {AI95-00260-02AI95-00260-02} {AI95-00348-01AI95-00348-01} A subprogram
15691 declared by an abstract_subprogram_declaration (*note 3.9.3: S0076.) or
15692 a formal_abstract_subprogram_declaration (*note 12.6: S0297.) (see *note
15693 12.6::) is an abstract subprogram. If it is a primitive subprogram of a
15694 tagged type, then the tagged type shall be abstract.
15695
15696 3.a
15697 Ramification: Note that for a private type, this applies to
15698 both views. The following is illegal:
15699
15700 3.b
15701 package P is
15702 type T is abstract tagged private;
15703 function Foo (X : T) return Boolean is abstract; -- Illegal!
15704 private
15705 type T is tagged null record; -- Illegal!
15706 X : T;
15707 Y : Boolean := Foo (T'Class (X));
15708 end P;
15709
15710 3.c
15711 The full view of T is not abstract, but has an abstract
15712 operation Foo, which is illegal. The two lines marked "--
15713 Illegal!" are illegal when taken together.
15714
15715 3.d/2
15716 Reason: {AI95-00310-01AI95-00310-01} We considered disallowing
15717 untagged types from having abstract primitive subprograms.
15718 However, we rejected that plan, because it introduced some
15719 silly anomalies, and because such subprograms are harmless.
15720 For example:
15721
15722 3.e/1
15723 package P is
15724 type Field_Size is range 0..100;
15725 type T is abstract tagged null record;
15726 procedure Print(X : in T; F : in Field_Size := 0) is abstract;
15727 . . .
15728 package Q is
15729 type My_Field_Size is new Field_Size;
15730 -- implicit declaration of Print(X : T; F : My_Field_Size := 0) is abstract;
15731 end Q;
15732
15733 3.f
15734 It seemed silly to make the derivative of My_Field_Size
15735 illegal, just because there was an implicitly declared
15736 abstract subprogram that was not primitive on some tagged
15737 type. Other rules could be formulated to solve this problem,
15738 but the current ones seem like the simplest.
15739
15740 3.g/2
15741 {AI95-00310-01AI95-00310-01} In Ada 2005, abstract primitive
15742 subprograms of an untagged type may be used to "undefine" an
15743 operation.
15744
15745 3.h/2
15746 Ramification: {AI95-00260-02AI95-00260-02} Note that the
15747 second sentence does not apply to abstract formal subprograms,
15748 as they are never primitive operations of a type.
15749
15750 4/3
15751 {AI95-00251-01AI95-00251-01} {AI95-00334-01AI95-00334-01}
15752 {AI95-00391-01AI95-00391-01} {AI05-0097-1AI05-0097-1}
15753 {AI05-0198-1AI05-0198-1} If a type has an implicitly declared primitive
15754 subprogram that is inherited or is a predefined operator, and the
15755 corresponding primitive subprogram of the parent or ancestor type is
15756 abstract or is a function with a controlling access result, or if a type
15757 other than a nonabstract null extension inherits a function with a
15758 controlling result, then:
15759
15760 4.a/3
15761 Ramification: {AI05-0068-1AI05-0068-1} These rules apply to
15762 each view of the type individually. That is necessary to
15763 preserve privacy. For instance, in the following example:
15764
15765 4.b/3
15766 package P is
15767 type I is interface;
15768 procedure Op (X : I) is abstract;
15769 end P;
15770
15771 4.c/3
15772 with P;
15773 package Q is
15774 type T is abstract new P.I with private;
15775 -- Op inherited here.
15776 private
15777 type T is abstract new P.I with null record;
15778 procedure Op (X : T) is null;
15779 end Q;
15780
15781 4.d/3
15782 with Q;
15783 package R is
15784 type T2 is new Q.T with null record;
15785 -- Illegal. Op inherited here, but requires overriding.
15786 end R;
15787
15788 4.e/3
15789 If this did not depend on the view, this would be legal. But
15790 in that case, the fact that Op is overridden in the private
15791 part would be visible; package R would have to be illegal if
15792 no overriding was in the private part.
15793
15794 4.f/3
15795 Note that this means that whether an inherited subprogram is
15796 abstract or concrete depends on where it inherited. In the
15797 case of Q, Q.Op in the visible part is abstract, while Q.Op in
15798 the private part is concrete. That is, R is illegal since it
15799 is an unrelated unit (and thus it cannot see the private
15800 part), but if R had been a private child of Q, it would have
15801 been legal.
15802
15803 5/2
15804 * {AI95-00251-01AI95-00251-01} {AI95-00334-01AI95-00334-01} If the
15805 type is abstract or untagged, the implicitly declared subprogram is
15806 abstract.
15807
15808 5.a
15809 Ramification: Note that it is possible to override a concrete
15810 subprogram with an abstract one.
15811
15812 6/2
15813 * {AI95-00391-01AI95-00391-01} Otherwise, the subprogram shall be
15814 overridden with a nonabstract subprogram or, in the case of a
15815 private extension inheriting a function with a controlling result,
15816 have a full type that is a null extension[; for a type declared in
15817 the visible part of a package, the overriding may be either in the
15818 visible or the private part]. Such a subprogram is said to require
15819 overriding. However, if the type is a generic formal type, the
15820 subprogram need not be overridden for the formal type itself; [a
15821 nonabstract version will necessarily be provided by the actual
15822 type.]
15823
15824 6.a/2
15825 Reason: {AI95-00228-01AI95-00228-01}
15826 {AI95-00391-01AI95-00391-01} A function that returns the
15827 parent type requires overriding for a type extension (or
15828 becomes abstract for an abstract type) because conversion from
15829 a parent type to a type extension is not defined, and function
15830 return semantics is defined in terms of conversion (other than
15831 for a null extension; see below). (Note that parameters of
15832 mode in out or out do not have this problem, because the tag
15833 of the actual is not changed.)
15834
15835 6.b
15836 Note that the overriding required above can be in the private
15837 part, which allows the following:
15838
15839 6.c
15840 package Pack1 is
15841 type Ancestor is abstract ...;
15842 procedure Do_Something(X : in Ancestor) is abstract;
15843 end Pack1;
15844
15845 6.d
15846 with Pack1; use Pack1;
15847 package Pack2 is
15848 type T1 is new Ancestor with record ...;
15849 -- A concrete type.
15850 procedure Do_Something(X : in T1); -- Have to override.
15851 end Pack2;
15852
15853 6.e
15854 with Pack1; use Pack1;
15855 with Pack2; use Pack2;
15856 package Pack3 is
15857 type T2 is new Ancestor with private;
15858 -- A concrete type.
15859 private
15860 type T2 is new T1 with -- Parent different from ancestor.
15861 record ... end record;
15862 -- Here, we inherit Pack2.Do_Something.
15863 end Pack3;
15864
15865
15866 6.f/2
15867 {AI95-00228-01AI95-00228-01} T2 inherits an abstract
15868 Do_Something, but T2 is not abstract, so Do_Something has to
15869 be overridden. However, it is OK to override it in the
15870 private part. In this case, we override it by inheriting a
15871 concrete version from a different type. Nondispatching calls
15872 to Pack3.Do_Something are allowed both inside and outside
15873 package Pack3, as the client "knows" that the subprogram was
15874 necessarily overridden somewhere.
15875
15876 6.g/2
15877 {AI95-00391-01AI95-00391-01} For a null extension, the result
15878 of a function with a controlling result is defined in terms of
15879 an extension_aggregate with a null record extension part (see
15880 *note 3.4::). This means that these restrictions on functions
15881 with a controlling result do not have to apply to null
15882 extensions.
15883
15884 6.h/2
15885 {AI95-00391-01AI95-00391-01} However, functions with
15886 controlling access results still require overriding. Changing
15887 the tag in place might clobber a preexisting object, and
15888 allocating new memory would possibly change the pool of the
15889 object, leading to storage leaks. Moreover, copying the
15890 object isn't possible for limited types. We don't need to
15891 restrict functions that have an access return type of an
15892 untagged type, as derived types with primitive subprograms
15893 have to have the same representation as their parent type.
15894
15895 7
15896 A call on an abstract subprogram shall be a dispatching call;
15897 [nondispatching calls to an abstract subprogram are not allowed.]
15898
15899 7.a/2
15900 Ramification: {AI95-00310-01AI95-00310-01} If an abstract
15901 subprogram is not a dispatching operation of some tagged type,
15902 then it cannot be called at all. In Ada 2005, such
15903 subprograms are not even considered by name resolution (see
15904 *note 6.4::).
15905
15906 8/3
15907 {AI05-0073-1AI05-0073-1} {AI05-0203-1AI05-0203-1} The type of an
15908 aggregate, or of an object created by an object_declaration or an
15909 allocator, or a generic formal object of mode in, shall not be abstract.
15910 The type of the target of an assignment operation (see *note 5.2::)
15911 shall not be abstract. The type of a component shall not be abstract.
15912 If the result type of a function is abstract, then the function shall be
15913 abstract. If a function has an access result type designating an
15914 abstract type, then the function shall be abstract. The type denoted by
15915 a return_subtype_indication (see *note 6.5::) shall not be abstract. A
15916 generic function shall not have an abstract result type or an access
15917 result type designating an abstract type.
15918
15919 8.a
15920 Reason: This ensures that values of an abstract type cannot be
15921 created, which ensures that a dispatching call to an abstract
15922 subprogram will not try to execute the nonexistent body.
15923
15924 8.b
15925 Generic formal objects of mode in are like constants;
15926 therefore they should be forbidden for abstract types.
15927 Generic formal objects of mode in out are like renamings;
15928 therefore, abstract types are OK for them, though probably not
15929 terribly useful.
15930
15931 8.c/3
15932 {AI05-0073-1AI05-0073-1} Generic functions returning a formal
15933 abstract type are illegal because any instance would have to
15934 be instantiated with a nonabstract type in order to avoid
15935 violating the function rule (generic functions cannot be
15936 declared abstract). But that would be an implied contract; it
15937 would be better for the contract to be explicit by the formal
15938 type not being declared abstract. Moreover, the implied
15939 contract does not add any capability.
15940
15941 9
15942 If a partial view is not abstract, the corresponding full view shall not
15943 be abstract. If a generic formal type is abstract, then for each
15944 primitive subprogram of the formal that is not abstract, the
15945 corresponding primitive subprogram of the actual shall not be abstract.
15946
15947 9.a
15948 Discussion: By contrast, we allow the actual type to be
15949 nonabstract even if the formal type is declared abstract.
15950 Hence, the most general formal tagged type possible is "type
15951 T(<>) is abstract tagged limited private;".
15952
15953 9.b
15954 For an abstract private extension declared in the visible part
15955 of a package, it is only possible for the full type to be
15956 nonabstract if the private extension has no abstract
15957 dispatching operations.
15958
15959 9.c/2
15960 To be honest: {AI95-00294-01AI95-00294-01} In the sentence
15961 about primitive subprograms above, there is some ambiguity as
15962 to what is meant by "corresponding" in the case where an
15963 inherited operation is overridden. This is best explained by
15964 an example, where the implicit declarations are shown as
15965 comments:
15966
15967 9.d/2
15968 package P1 is
15969 type T1 is abstract tagged null record;
15970 procedure P (X : T1); -- (1)
15971 end P1;
15972
15973 9.e/2
15974 package P2 is
15975 type T2 is abstract new P1.T1 with null record;
15976 -- procedure P (X : T2); -- (2)
15977 procedure P (X : T2) is abstract; -- (3)
15978 end P2;
15979
15980 9.f/2
15981 generic
15982 type D is abstract new P1.T1 with private;
15983 -- procedure P (X : D); -- (4)
15984 procedure G (X : D);
15985
15986 9.g/2
15987 procedure I is new G (P2.T2); -- Illegal.
15988
15989 9.h/2
15990 Type T2 inherits a nonabstract procedure P (2) from the
15991 primitive procedure P (1) of T1. P (2) is overridden by the
15992 explicitly declared abstract procedure P (3). Type D inherits
15993 a nonabstract procedure P (4) from P (1). In instantiation I,
15994 the operation corresponding to P (4) is the one which is not
15995 overridden, that is, P (3): the overridden operation P (2)
15996 does not "reemerge". Therefore, the instantiation is illegal.
15997
15998 10/3
15999 {AI05-0073-1AI05-0073-1} For an abstract type declared in a visible
16000 part, an abstract primitive subprogram shall not be declared in the
16001 private part, unless it is overriding an abstract subprogram implicitly
16002 declared in the visible part. For a tagged type declared in a visible
16003 part, a primitive function with a controlling result or a controlling
16004 access result shall not be declared in the private part, unless it is
16005 overriding a function implicitly declared in the visible part.
16006
16007 10.a
16008 Reason: The "visible part" could be that of a package or a
16009 generic package. This rule is needed because a nonabstract
16010 type extension declared outside the package would not know
16011 about any abstract primitive subprograms or primitive
16012 functions with controlling results declared in the private
16013 part, and wouldn't know that they need to be overridden with
16014 nonabstract subprograms. The rule applies to a tagged record
16015 type or record extension declared in a visible part, just as
16016 to a tagged private type or private extension. The rule
16017 applies to explicitly and implicitly declared abstract
16018 subprograms:
16019
16020 10.b
16021 package Pack is
16022 type T is abstract new T1 with private;
16023 private
16024 type T is abstract new T2 with record ... end record;
16025 ...
16026 end Pack;
16027
16028 10.c
16029 The above example would be illegal if T1 has a nonabstract
16030 primitive procedure P, but T2 overrides P with an abstract
16031 one; the private part should override P with a nonabstract
16032 version. On the other hand, if the P were abstract for both
16033 T1 and T2, the example would be legal as is.
16034
16035 11/2
16036 {AI95-00260-02AI95-00260-02} A generic actual subprogram shall not be an
16037 abstract subprogram unless the generic formal subprogram is declared by
16038 a formal_abstract_subprogram_declaration. The prefix of an
16039 attribute_reference for the Access, Unchecked_Access, or Address
16040 attributes shall not denote an abstract subprogram.
16041
16042 11.a
16043 Ramification: An abstract_subprogram_declaration is not
16044 syntactically a subprogram_declaration. Nonetheless, an
16045 abstract subprogram is a subprogram, and an
16046 abstract_subprogram_declaration is a declaration of a
16047 subprogram.
16048
16049 11.b/2
16050 {AI95-00260-02AI95-00260-02} The part about generic actual
16051 subprograms includes those given by default. Of course, an
16052 abstract formal subprogram's actual subprogram can be
16053 abstract.
16054
16055 _Dynamic Semantics_
16056
16057 11.1/2
16058 {AI95-00348-01AI95-00348-01} The elaboration of an
16059 abstract_subprogram_declaration has no effect.
16060
16061 NOTES
16062
16063 12
16064 79 Abstractness is not inherited; to declare an abstract type, the
16065 reserved word abstract has to be used in the declaration of the
16066 type extension.
16067
16068 12.a
16069 Ramification: A derived type can be abstract even if its
16070 parent is not. Similarly, an inherited concrete subprogram
16071 can be overridden with an abstract subprogram.
16072
16073 13
16074 80 A class-wide type is never abstract. Even if a class is rooted
16075 at an abstract type, the class-wide type for the class is not
16076 abstract, and an object of the class-wide type can be created; the
16077 tag of such an object will identify some nonabstract type in the
16078 class.
16079
16080 _Examples_
16081
16082 14
16083 Example of an abstract type representing a set of natural numbers:
16084
16085 15
16086 package Sets is
16087 subtype Element_Type is Natural;
16088 type Set is abstract tagged null record;
16089 function Empty return Set is abstract;
16090 function Union(Left, Right : Set) return Set is abstract;
16091 function Intersection(Left, Right : Set) return Set is abstract;
16092 function Unit_Set(Element : Element_Type) return Set is abstract;
16093 procedure Take(Element : out Element_Type;
16094 From : in out Set) is abstract;
16095 end Sets;
16096
16097 NOTES
16098
16099 16
16100 81 Notes on the example: Given the above abstract type, one could
16101 then derive various (nonabstract) extensions of the type,
16102 representing alternative implementations of a set. One might use a
16103 bit vector, but impose an upper bound on the largest element
16104 representable, while another might use a hash table, trading off
16105 space for flexibility.
16106
16107 16.a
16108 Discussion: One way to export a type from a package with some
16109 components visible and some components private is as follows:
16110
16111 16.b
16112 package P is
16113 type Public_Part is abstract tagged
16114 record
16115 ...
16116 end record;
16117 type T is new Public_Part with private;
16118 ...
16119 private
16120 type T is new Public_Part with
16121 record
16122 ...
16123 end record;
16124 end P;
16125
16126 16.c
16127 The fact that Public_Part is abstract tells clients they have
16128 to create objects of type T instead of Public_Part. Note that
16129 the public part has to come first; it would be illegal to
16130 declare a private type Private_Part, and then a record
16131 extension T of it, unless T were in the private part after the
16132 full declaration of Private_Part, but then clients of the
16133 package would not have visibility to T.
16134
16135 _Extensions to Ada 95_
16136
16137 16.d/2
16138 {AI95-00391-01AI95-00391-01} It is not necessary to override
16139 functions with a controlling result for a null extension.
16140 This makes it easier to derive a tagged type to complete a
16141 private type.
16142
16143 _Wording Changes from Ada 95_
16144
16145 16.e/2
16146 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01}
16147 Updated the wording to reflect the addition of interface types
16148 (see *note 3.9.4::).
16149
16150 16.f/2
16151 {AI95-00260-02AI95-00260-02} Updated the wording to reflect
16152 the addition of abstract formal subprograms (see *note
16153 12.6::).
16154
16155 16.g/2
16156 {AI95-00334-01AI95-00334-01} The wording of
16157 shall-be-overridden was clarified so that it clearly applies
16158 to abstract predefined equality.
16159
16160 16.h/2
16161 {AI95-00348-01AI95-00348-01} Moved the syntax and elaboration
16162 rule for abstract_subprogram_declaration here, so the syntax
16163 and most of the semantics are together (which is consistent
16164 with null procedures).
16165
16166 16.i/2
16167 {AI95-00391-01AI95-00391-01} We define the term require
16168 overriding to make other wording easier to understand.
16169
16170 _Incompatibilities With Ada 2005_
16171
16172 16.j/3
16173 {AI05-0073-1AI05-0073-1} Correction: Added rules to eliminate
16174 holes with controlling access results and generic functions
16175 that return abstract types. While these changes are
16176 technically incompatible, it is unlikely that they could be
16177 used in a program without violating some other rule of the use
16178 of abstract types.
16179
16180 16.k/3
16181 {AI05-0097-1AI05-0097-1} Correction: Corrected a minor glitch
16182 having to do with abstract null extensions. The Ada 2005 rule
16183 allowed such extensions to inherit concrete operations in some
16184 rare cases. It is unlikely that these cases exist in user
16185 code.
16186
16187 _Extensions to Ada 2005_
16188
16189 16.l/3
16190 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
16191 be used in an abstract_subprogram_declaration. This is
16192 described in *note 13.1.1::.
16193
16194 _Wording Changes from Ada 2005_
16195
16196 16.m/3
16197 {AI05-0198-1AI05-0198-1} Correction: Clarified that the
16198 predefined operator corresponding to an inherited abstract
16199 operator is also abstract. The Ada 2005 rules caused the
16200 predefined operator and the inherited operator to override
16201 each other, which is weird. But the effect is the same either
16202 way (the operator is not considered for resolution).
16203
16204 16.n/3
16205 {AI05-0203-1AI05-0203-1} Correction: Added wording to disallow
16206 abstract return objects. These were illegal in Ada 2005 by
16207 other rules; the extension to support class-wide type better
16208 opened a hole which has now been plugged.
16209
16210 \1f
16211 File: aarm2012.info, Node: 3.9.4, Prev: 3.9.3, Up: 3.9
16212
16213 3.9.4 Interface Types
16214 ---------------------
16215
16216 1/2
16217 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01} [An interface
16218 type is an abstract tagged type that provides a restricted form of
16219 multiple inheritance. A tagged type, task type, or protected type may
16220 have one or more interface types as ancestors.]
16221
16222 1.a/2
16223 Glossary entry: An interface type is a form of abstract tagged
16224 type which has no components or concrete operations except
16225 possibly null procedures. Interface types are used for
16226 composing other interfaces and tagged types and thereby
16227 provide multiple inheritance. Only an interface type can be
16228 used as a progenitor of another type.
16229
16230 _Language Design Principles_
16231
16232 1.b/2
16233 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01} The
16234 rules are designed so that an interface can be used as either
16235 a parent type or a progenitor type without changing the
16236 meaning. That's important so that the order that interfaces
16237 are specified in a derived_type_definition is not significant.
16238 In particular, we want:
16239
16240 1.c/2
16241 type Con1 is new Int1 and Int2 with null record;
16242 type Con2 is new Int2 and Int1 with null record;
16243
16244 1.d/2
16245 to mean exactly the same thing.
16246
16247 _Syntax_
16248
16249 2/2
16250 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01}
16251 interface_type_definition ::=
16252 [limited | task | protected | synchronized] interface [and
16253 interface_list]
16254
16255 3/2
16256 {AI95-00251-01AI95-00251-01} {AI95-00419-01AI95-00419-01}
16257 interface_list ::= interface_subtype_mark {and interface_
16258 subtype_mark}
16259
16260 _Static Semantics_
16261
16262 4/2
16263 {AI95-00251-01AI95-00251-01} An interface type (also called an
16264 interface) is a specific abstract tagged type that is defined by an
16265 interface_type_definition.
16266
16267 5/2
16268 {AI95-00345-01AI95-00345-01} An interface with the reserved word
16269 limited, task, protected, or synchronized in its definition is termed,
16270 respectively, a limited interface, a task interface, a protected
16271 interface, or a synchronized interface. In addition, all task and
16272 protected interfaces are synchronized interfaces, and all synchronized
16273 interfaces are limited interfaces.
16274
16275 5.a/2
16276 Glossary entry: A synchronized entity is one that will work
16277 safely with multiple tasks at one time. A synchronized
16278 interface can be an ancestor of a task or a protected type.
16279 Such a task or protected type is called a synchronized tagged
16280 type.
16281
16282 6/2
16283 {AI95-00345-01AI95-00345-01} {AI95-00443-01AI95-00443-01} [A task or
16284 protected type derived from an interface is a tagged type.] Such a
16285 tagged type is called a synchronized tagged type, as are synchronized
16286 interfaces and private extensions whose declaration includes the
16287 reserved word synchronized.
16288
16289 6.a/2
16290 Proof: The full definition of tagged types given in *note
16291 3.9:: includes task and protected types derived from
16292 interfaces.
16293
16294 6.b/2
16295 Ramification: The class-wide type associated with a tagged
16296 task type (including a task interface type) is a task type,
16297 because "task" is one of the language-defined classes of types
16298 (see *note 3.2::). However, the class-wide type associated
16299 with an interface is not an interface type, as "interface" is
16300 not one of the language-defined classes (as it is not closed
16301 under derivation). In this sense, "interface" is similar to
16302 "abstract". The class-wide type associated with an interface
16303 is a concrete (nonabstract) indefinite tagged composite type.
16304
16305 6.c/2
16306 "Private extension" includes generic formal private
16307 extensions, as explained in *note 12.5.1::.
16308
16309 7/2
16310 {AI95-00345-01AI95-00345-01} A task interface is an [abstract] task
16311 type. A protected interface is an [abstract] protected type.
16312
16313 7.a/2
16314 Proof: The "abstract" follows from the definition of an
16315 interface type.
16316
16317 7.b/2
16318 Reason: This ensures that task operations (like abort and the
16319 Terminated attribute) can be applied to a task interface type
16320 and the associated class-wide type. While there are no
16321 protected type operations, we apply the same rule to protected
16322 interfaces for consistency.
16323
16324 8/2
16325 {AI95-00251-01AI95-00251-01} [An interface type has no components.]
16326
16327 8.a/2
16328 Proof: This follows from the syntax and the fact that
16329 discriminants are not allowed for interface types.
16330
16331 9/2
16332 {AI95-00419-01AI95-00419-01} An interface_subtype_mark in an
16333 interface_list names a progenitor subtype; its type is the progenitor
16334 type. An interface type inherits user-defined primitive subprograms
16335 from each progenitor type in the same way that a derived type inherits
16336 user-defined primitive subprograms from its progenitor types (see *note
16337 3.4::).
16338
16339 9.a.1/2
16340 Glossary entry: A progenitor of a derived type is one of the
16341 types given in the definition of the derived type other than
16342 the first. A progenitor is always an interface type.
16343 Interfaces, tasks, and protected types may also have
16344 progenitors.
16345
16346 _Legality Rules_
16347
16348 10/2
16349 {AI95-00251-01AI95-00251-01} All user-defined primitive subprograms of
16350 an interface type shall be abstract subprograms or null procedures.
16351
16352 11/2
16353 {AI95-00251-01AI95-00251-01} The type of a subtype named in an
16354 interface_list shall be an interface type.
16355
16356 12/2
16357 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01} A type derived
16358 from a nonlimited interface shall be nonlimited.
16359
16360 13/2
16361 {AI95-00345-01AI95-00345-01} An interface derived from a task interface
16362 shall include the reserved word task in its definition; any other type
16363 derived from a task interface shall be a private extension or a task
16364 type declared by a task declaration (see *note 9.1::).
16365
16366 14/2
16367 {AI95-00345-01AI95-00345-01} An interface derived from a protected
16368 interface shall include the reserved word protected in its definition;
16369 any other type derived from a protected interface shall be a private
16370 extension or a protected type declared by a protected declaration (see
16371 *note 9.4::).
16372
16373 15/2
16374 {AI95-00345-01AI95-00345-01} An interface derived from a synchronized
16375 interface shall include one of the reserved words task, protected, or
16376 synchronized in its definition; any other type derived from a
16377 synchronized interface shall be a private extension, a task type
16378 declared by a task declaration, or a protected type declared by a
16379 protected declaration.
16380
16381 15.a/2
16382 Reason: We require that an interface descendant of a task,
16383 protected, or synchronized interface repeat the explicit kind
16384 of interface it will be, rather than simply inheriting it, so
16385 that a reader is always aware of whether the interface
16386 provides synchronization and whether it may be implemented
16387 only by a task or protected type. The only place where
16388 inheritance of the kind of interface might be useful would be
16389 in a generic if you didn't know the kind of the actual
16390 interface. However, the value of that is low because you
16391 cannot implement an interface properly if you don't know
16392 whether it is a task, protected, or synchronized interface.
16393 Hence, we require the kind of the actual interface to match
16394 the kind of the formal interface (see *note 12.5.5::).
16395
16396 16/2
16397 {AI95-00345-01AI95-00345-01} No type shall be derived from both a task
16398 interface and a protected interface.
16399
16400 16.a
16401 Reason: This prevents a single private extension from
16402 inheriting from both a task and a protected interface. For a
16403 private type, there can be no legal completion. For a generic
16404 formal derived type, there can be no possible matching type
16405 (so no instantiation could be legal). This rule provides
16406 early detection of the errors.
16407
16408 17/2
16409 {AI95-00251-01AI95-00251-01} In addition to the places where Legality
16410 Rules normally apply (see *note 12.3::), these rules apply also in the
16411 private part of an instance of a generic unit.
16412
16413 17.a/3
16414 Ramification: {AI05-0299-1AI05-0299-1} This paragraph is
16415 intended to apply to all of the Legality Rules in this
16416 subclause. We cannot allow interface types which do not obey
16417 these rules, anywhere. Luckily, deriving from a formal type
16418 (which might be an interface) is not allowed for any tagged
16419 types in a generic body. So checking in the private part of a
16420 generic covers all of the cases.
16421
16422 _Dynamic Semantics_
16423
16424 18/3
16425 {AI95-00251-01AI95-00251-01} {AI05-0070-1AI05-0070-1} The elaboration of
16426 an interface_type_definition creates the interface type and its first
16427 subtype.
16428
16429 18.a/3
16430 Discussion: There is no other effect. An interface_list is
16431 made up of subtype_marks, which do not need to be elaborated,
16432 so the interface_list does not either. This is consistent
16433 with the handling of discriminant_parts.
16434
16435 NOTES
16436
16437 19/2
16438 82 {AI95-00411-01AI95-00411-01} Nonlimited interface types have
16439 predefined nonabstract equality operators. These may be overridden
16440 with user-defined abstract equality operators. Such operators will
16441 then require an explicit overriding for any nonabstract descendant
16442 of the interface.
16443
16444 _Examples_
16445
16446 20/2
16447 {AI95-00433-01AI95-00433-01} Example of a limited interface and a
16448 synchronized interface extending it:
16449
16450 21/2
16451 type Queue is limited interface;
16452 procedure Append(Q : in out Queue; Person : in Person_Name) is abstract;
16453 procedure Remove_First(Q : in out Queue;
16454 Person : out Person_Name) is abstract;
16455 function Cur_Count(Q : in Queue) return Natural is abstract;
16456 function Max_Count(Q : in Queue) return Natural is abstract;
16457 -- See *note 3.10.1:: for Person_Name.
16458
16459 22/3
16460 {AI05-0004-1AI05-0004-1} Queue_Error : exception;
16461 -- Append raises Queue_Error if Cur_Count(Q) = Max_Count(Q)
16462 -- Remove_First raises Queue_Error if Cur_Count(Q) = 0
16463
16464 23/2
16465 type Synchronized_Queue is synchronized interface and Queue; -- see *note 9.11::
16466 procedure Append_Wait(Q : in out Synchronized_Queue;
16467 Person : in Person_Name) is abstract;
16468 procedure Remove_First_Wait(Q : in out Synchronized_Queue;
16469 Person : out Person_Name) is abstract;
16470
16471 24/2
16472 ...
16473
16474 25/2
16475 procedure Transfer(From : in out Queue'Class;
16476 To : in out Queue'Class;
16477 Number : in Natural := 1) is
16478 Person : Person_Name;
16479 begin
16480 for I in 1..Number loop
16481 Remove_First(From, Person);
16482 Append(To, Person);
16483 end loop;
16484 end Transfer;
16485
16486 26/2
16487 This defines a Queue interface defining a queue of people. (A similar
16488 design could be created to define any kind of queue simply by replacing
16489 Person_Name by an appropriate type.) The Queue interface has four
16490 dispatching operations, Append, Remove_First, Cur_Count, and Max_Count.
16491 The body of a class-wide operation, Transfer is also shown. Every
16492 nonabstract extension of Queue must provide implementations for at least
16493 its four dispatching operations, as they are abstract. Any object of a
16494 type derived from Queue may be passed to Transfer as either the From or
16495 the To operand. The two operands need not be of the same type in any
16496 given call.
16497
16498 27/2
16499 The Synchronized_Queue interface inherits the four dispatching
16500 operations from Queue and adds two additional dispatching operations,
16501 which wait if necessary rather than raising the Queue_Error exception.
16502 This synchronized interface may only be implemented by a task or
16503 protected type, and as such ensures safe concurrent access.
16504
16505 28/2
16506 {AI95-00433-01AI95-00433-01} Example use of the interface:
16507
16508 29/3
16509 {AI05-0004-1AI05-0004-1} type Fast_Food_Queue is new Queue with record ...;
16510 procedure Append(Q : in out Fast_Food_Queue; Person : in Person_Name);
16511 procedure Remove_First(Q : in out Fast_Food_Queue; Person : out Person_Name);
16512 function Cur_Count(Q : in Fast_Food_Queue) return Natural;
16513 function Max_Count(Q : in Fast_Food_Queue) return Natural;
16514
16515 30/2
16516 ...
16517
16518 31/2
16519 Cashier, Counter : Fast_Food_Queue;
16520
16521 32/2
16522 ...
16523 -- Add George (see *note 3.10.1::) to the cashier's queue:
16524 Append (Cashier, George);
16525 -- After payment, move George to the sandwich counter queue:
16526 Transfer (Cashier, Counter);
16527 ...
16528
16529 33/2
16530 An interface such as Queue can be used directly as the parent of a new
16531 type (as shown here), or can be used as a progenitor when a type is
16532 derived. In either case, the primitive operations of the interface are
16533 inherited. For Queue, the implementation of the four inherited routines
16534 must be provided. Inside the call of Transfer, calls will dispatch to
16535 the implementations of Append and Remove_First for type Fast_Food_Queue.
16536
16537 34/2
16538 {AI95-00433-01AI95-00433-01} Example of a task interface:
16539
16540 35/2
16541 type Serial_Device is task interface; -- see *note 9.1::
16542 procedure Read (Dev : in Serial_Device; C : out Character) is abstract;
16543 procedure Write(Dev : in Serial_Device; C : in Character) is abstract;
16544
16545 36/2
16546 The Serial_Device interface has two dispatching operations which are
16547 intended to be implemented by task entries (see 9.1).
16548
16549 _Extensions to Ada 95_
16550
16551 36.a/2
16552 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01}
16553 Interface types are new. They provide multiple inheritance of
16554 interfaces, similar to the facility provided in Java and other
16555 recent language designs.
16556
16557 _Wording Changes from Ada 2005_
16558
16559 36.b/3
16560 {AI05-0070-1AI05-0070-1} Correction: Corrected the definition
16561 of elaboration for an interface_type_definition to match that
16562 of other type definitions.
16563
16564 \1f
16565 File: aarm2012.info, Node: 3.10, Next: 3.11, Prev: 3.9, Up: 3
16566
16567 3.10 Access Types
16568 =================
16569
16570 1
16571 A value of an access type (an access value) provides indirect access to
16572 the object or subprogram it designates. Depending on its type, an
16573 access value can designate either subprograms, objects created by
16574 allocators (see *note 4.8::), or more generally aliased objects of an
16575 appropriate type.
16576
16577 1.a
16578 Discussion: A name denotes an entity; an access value
16579 designates an entity. The "dereference" of an access value X,
16580 written "X.all", is a name that denotes the entity designated
16581 by X.
16582
16583 _Language Design Principles_
16584
16585 1.b/3
16586 {AI05-0299-1AI05-0299-1} Access values should always be well
16587 defined (barring uses of certain unchecked features of Clause
16588 *note 13::). In particular, uninitialized access variables
16589 should be prevented by compile-time rules.
16590
16591 _Syntax_
16592
16593 2/2
16594 {AI95-00231-01AI95-00231-01} access_type_definition ::=
16595 [null_exclusion] access_to_object_definition
16596 | [null_exclusion] access_to_subprogram_definition
16597
16598 3
16599 access_to_object_definition ::=
16600 access [general_access_modifier] subtype_indication
16601
16602 4
16603 general_access_modifier ::= all | constant
16604
16605 5
16606 access_to_subprogram_definition ::=
16607 access [protected] procedure parameter_profile
16608 | access [protected] function parameter_and_result_profile
16609
16610 5.1/2
16611 {AI95-00231-01AI95-00231-01} null_exclusion ::= not null
16612
16613 6/2
16614 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01}
16615 {AI95-00404-01AI95-00404-01} access_definition ::=
16616 [null_exclusion] access [constant] subtype_mark
16617 | [null_exclusion] access [protected] procedure parameter_profile
16618 | [null_exclusion] access [protected] function
16619 parameter_and_result_profile
16620
16621 _Static Semantics_
16622
16623 7/1
16624 {8652/00128652/0012} {AI95-00062-01AI95-00062-01} There are two kinds of
16625 access types, access-to-object types, whose values designate objects,
16626 and access-to-subprogram types, whose values designate subprograms.
16627 Associated with an access-to-object type is a storage pool; several
16628 access types may share the same storage pool. All descendants of an
16629 access type share the same storage pool. A storage pool is an area of
16630 storage used to hold dynamically allocated objects (called pool
16631 elements) created by allocators[; storage pools are described further in
16632 *note 13.11::, "*note 13.11:: Storage Management"].
16633
16634 8
16635 Access-to-object types are further subdivided into pool-specific access
16636 types, whose values can designate only the elements of their associated
16637 storage pool, and general access types, whose values can designate the
16638 elements of any storage pool, as well as aliased objects created by
16639 declarations rather than allocators, and aliased subcomponents of other
16640 objects.
16641
16642 8.a
16643 Implementation Note: The value of an access type will
16644 typically be a machine address. However, a value of a
16645 pool-specific access type can be represented as an offset (or
16646 index) relative to its storage pool, since it can point only
16647 to the elements of that pool.
16648
16649 9/3
16650 {AI95-00225-01AI95-00225-01} {AI95-00363-01AI95-00363-01}
16651 {AI05-0053-1AI05-0053-1} {AI05-0142-4AI05-0142-4}
16652 {AI05-0277-1AI05-0277-1} A view of an object is defined to be aliased if
16653 it is defined by an object_declaration (*note 3.3.1: S0032.),
16654 component_definition (*note 3.6: S0056.), parameter_specification (*note
16655 6.1: S0175.), or extended_return_object_declaration with the reserved
16656 word aliased, or by a renaming of an aliased view. In addition, the
16657 dereference of an access-to-object value denotes an aliased view, as
16658 does a view conversion (see *note 4.6::) of an aliased view. The
16659 current instance of an immutably limited type (see *note 7.5::) is
16660 defined to be aliased. Finally, a formal parameter or generic formal
16661 object of a tagged type is defined to be aliased. [Aliased views are
16662 the ones that can be designated by an access value.]
16663
16664 9.a
16665 Glossary entry: An aliased view of an object is one that can
16666 be designated by an access value. Objects allocated by
16667 allocators are aliased. Objects can also be explicitly
16668 declared as aliased with the reserved word aliased. The
16669 Access attribute can be used to create an access value
16670 designating an aliased object.
16671
16672 9.b
16673 Ramification: The current instance of a nonlimited type is not
16674 aliased.
16675
16676 9.c
16677 The object created by an allocator is aliased, but not its
16678 subcomponents, except of course for those that themselves have
16679 aliased in their component_definition.
16680
16681 9.d
16682 The renaming of an aliased object is aliased.
16683
16684 9.e
16685 Slices are never aliased. See *note 4.1.2:: for more
16686 discussion.
16687
16688 9.f/2
16689 Reason: {AI95-00225-01AI95-00225-01} The current instance of a
16690 limited type is defined to be aliased so that an access
16691 discriminant of a component can be initialized with T'Access
16692 inside the definition of T. Note that we don't want this to
16693 apply to a type that could become nonlimited later within its
16694 immediate scope, so we require the full definition to be
16695 limited.
16696
16697 9.g
16698 A formal parameter of a tagged type is defined to be aliased
16699 so that a (tagged) parameter X may be passed to an access
16700 parameter P by using P => X'Access. Access parameters are
16701 most important for tagged types because of
16702 dispatching-on-access-parameters (see *note 3.9.2::). By
16703 restricting this to formal parameters, we minimize problems
16704 associated with allowing components that are not declared
16705 aliased to be pointed-to from within the same record.
16706
16707 9.h
16708 A view conversion of an aliased view is aliased so that the
16709 type of an access parameter can be changed without first
16710 converting to a named access type. For example:
16711
16712 9.i
16713 type T1 is tagged ...;
16714 procedure P(X : access T1);
16715
16716 9.j
16717 type T2 is new T1 with ...;
16718 procedure P(X : access T2) is
16719 begin
16720 P(T1(X.all)'Access); -- hand off to T1's P
16721 . . . -- now do extra T2-specific processing
16722 end P;
16723
16724 9.k/2
16725 This paragraph was deleted.{AI95-00363-01AI95-00363-01}
16726
16727 9.l/2
16728 We considered making more kinds of objects aliased by default.
16729 In particular, any object of a by-reference type will pretty
16730 much have to be allocated at an addressable location, so it
16731 can be passed by reference without using bit-field pointers.
16732 Therefore, one might wish to allow the Access and
16733 Unchecked_Access attributes for such objects. However,
16734 private parts are transparent to the definition of
16735 "by-reference type", so if we made all objects of a
16736 by-reference type aliased, we would be violating the privacy
16737 of private parts. Instead, we would have to define a concept
16738 of "visibly by-reference" and base the rule on that. This
16739 seemed to complicate the rules more than it was worth,
16740 especially since there is no way to declare an untagged
16741 limited private type to be by-reference, since the full type
16742 might by nonlimited.
16743
16744 9.m
16745 Discussion: Note that we do not use the term "aliased" to
16746 refer to formal parameters that are referenced through
16747 multiple access paths (see *note 6.2::).
16748
16749 10
16750 An access_to_object_definition defines an access-to-object type and its
16751 first subtype; the subtype_indication (*note 3.2.2: S0027.) defines the
16752 designated subtype of the access type. If a general_access_modifier
16753 (*note 3.10: S0081.) appears, then the access type is a general access
16754 type. If the modifier is the reserved word constant, then the type is
16755 an access-to-constant type[; a designated object cannot be updated
16756 through a value of such a type]. If the modifier is the reserved word
16757 all, then the type is an access-to-variable type[; a designated object
16758 can be both read and updated through a value of such a type]. If no
16759 general_access_modifier (*note 3.10: S0081.) appears in the
16760 access_to_object_definition (*note 3.10: S0080.), the access type is a
16761 pool-specific access-to-variable type.
16762
16763 10.a
16764 To be honest: The type of the designated subtype is called the
16765 designated type.
16766
16767 10.b
16768 Reason: The modifier all was picked to suggest that values of
16769 a general access type could point into "all" storage pools, as
16770 well as to objects declared aliased, and that "all" access
16771 (both read and update) to the designated object was provided.
16772 We couldn't think of any use for pool-specific
16773 access-to-constant types, so any access type defined with the
16774 modifier constant is considered a general access type, and can
16775 point into any storage pool or at other (appropriate) aliased
16776 objects.
16777
16778 10.c
16779 Implementation Note: The predefined generic
16780 Unchecked_Deallocation can be instantiated for any named
16781 access-to-variable type. There is no (language-defined)
16782 support for deallocating objects designated by a value of an
16783 access-to-constant type. Because of this, an allocator for an
16784 access-to-constant type can allocate out of a storage pool
16785 with no support for deallocation. Frequently, the allocation
16786 can be done at link-time, if the size and initial value are
16787 known then.
16788
16789 10.d
16790 Discussion: For the purpose of generic formal type matching,
16791 the relevant subclasses of access types are
16792 access-to-subprogram types, access-to-constant types, and
16793 (named) access-to-variable types, with its subclass (named)
16794 general access-to-variable types. Pool-specific
16795 access-to-variable types are not a separately matchable
16796 subclass of types, since they don't have any "extra"
16797 operations relative to all (named) access-to-variable types.
16798
16799 11
16800 An access_to_subprogram_definition defines an access-to-subprogram type
16801 and its first subtype; the parameter_profile or
16802 parameter_and_result_profile defines the designated profile of the
16803 access type. There is a calling convention associated with the
16804 designated profile[; only subprograms with this calling convention can
16805 be designated by values of the access type.] By default, the calling
16806 convention is "protected" if the reserved word protected appears, and
16807 "Ada" otherwise. [See *note Annex B:: for how to override this
16808 default.]
16809
16810 11.a
16811 Ramification: The calling convention protected is in italics
16812 to emphasize that it cannot be specified explicitly by the
16813 user. This is a consequence of it being a reserved word.
16814
16815 11.b/2
16816 Implementation Note: {AI95-00254-01AI95-00254-01} For a named
16817 access-to-subprogram type, the representation of an access
16818 value might include implementation-defined information needed
16819 to support up-level references -- for example, a static link.
16820 The accessibility rules (see *note 3.10.2::) ensure that in a
16821 "global-display-based" implementation model (as opposed to a
16822 static-link-based model), a named
16823 access-to-(unprotected)-subprogram value need consist only of
16824 the address of the subprogram. The global display is
16825 guaranteed to be properly set up any time the designated
16826 subprogram is called. Even in a static-link-based model, the
16827 only time a static link is definitely required is for an
16828 access-to-subprogram type declared in a scope nested at least
16829 two levels deep within subprogram or task bodies, since values
16830 of such a type might designate subprograms nested a smaller
16831 number of levels. For the normal case of a named
16832 access-to-subprogram type declared at the outermost (library)
16833 level, a code address by itself should be sufficient to
16834 represent the access value in many implementations.
16835
16836 11.c
16837 For access-to-protected-subprogram, the access values will
16838 necessarily include both an address (or other identification)
16839 of the code of the subprogram, as well as the address of the
16840 associated protected object. This could be thought of as a
16841 static link, but it will be needed even for
16842 global-display-based implementation models. It corresponds to
16843 the value of the "implicit parameter" that is passed into
16844 every call of a protected operation, to identify the current
16845 instance of the protected type on which they are to operate.
16846
16847 11.d
16848 Any Elaboration_Check is performed when a call is made through
16849 an access value, rather than when the access value is first
16850 "created" via a 'Access. For implementation models that
16851 normally put that check at the call-site, an access value will
16852 have to point to a separate entry point that does the check.
16853 Alternatively, the access value could point to a "subprogram
16854 descriptor" that consisted of two words (or perhaps more), the
16855 first being the address of the code, the second being the
16856 elaboration bit. Or perhaps more efficiently, just the
16857 address of the code, but using the trick that the descriptor
16858 is initialized to point to a Raise-Program-Error routine
16859 initially, and then set to point to the "real" code when the
16860 body is elaborated.
16861
16862 11.e
16863 For implementations that share code between generic
16864 instantiations, the extra level of indirection suggested above
16865 to support Elaboration_Checks could also be used to provide a
16866 pointer to the per-instance data area normally required when
16867 calling shared code. The trick would be to put a pointer to
16868 the per-instance data area into the subprogram descriptor, and
16869 then make sure that the address of the subprogram descriptor
16870 is loaded into a "known" register whenever an indirect call is
16871 performed. Once inside the shared code, the address of the
16872 per-instance data area can be retrieved out of the subprogram
16873 descriptor, by indexing off the "known" register.
16874
16875 11.f/2
16876 This paragraph was deleted.{AI95-00344-01AI95-00344-01}
16877
16878 11.g/2
16879 {AI95-00254-01AI95-00254-01} Note that access parameters of an
16880 anonymous access-to-subprogram type are permitted. Such
16881 parameters represent full "downward" closures, meaning that in
16882 an implementation that uses a per-task (global) display, the
16883 display will have to be passed as a hidden parameter, and
16884 reconstructed at the point of call.
16885
16886 12/3
16887 {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01}
16888 {AI95-00254-01AI95-00254-01} {AI05-0264-1AI05-0264-1} An
16889 access_definition defines an anonymous general access type or an
16890 anonymous access-to-subprogram type. For a general access type, the
16891 subtype_mark denotes its designated subtype; if the
16892 general_access_modifier (*note 3.10: S0081.) constant appears, the type
16893 is an access-to-constant type; otherwise, it is an access-to-variable
16894 type. For an access-to-subprogram type, the parameter_profile (*note
16895 6.1: S0172.) or parameter_and_result_profile (*note 6.1: S0173.) denotes
16896 its designated profile.
16897
16898 13/2
16899 {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01} For each
16900 access type, there is a null access value designating no entity at all,
16901 which can be obtained by (implicitly) converting the literal null to the
16902 access type. [The null value of an access type is the default initial
16903 value of the type.] Nonnull values of an access-to-object type are
16904 obtained by evaluating an allocator[, which returns an access value
16905 designating a newly created object (see *note 3.10.2::)], or in the case
16906 of a general access-to-object type, evaluating an attribute_reference
16907 for the Access or Unchecked_Access attribute of an aliased view of an
16908 object. Nonnull values of an access-to-subprogram type are obtained by
16909 evaluating an attribute_reference for the Access attribute of a
16910 nonintrinsic subprogram.
16911
16912 13.a/2
16913 This paragraph was deleted.{AI95-00231-01AI95-00231-01}
16914
16915 13.b/2
16916 This paragraph was deleted.{AI95-00231-01AI95-00231-01}
16917
16918 13.1/2
16919 {AI95-00231-01AI95-00231-01} A null_exclusion in a construct specifies
16920 that the null value does not belong to the access subtype defined by the
16921 construct, that is, the access subtype excludes null. In addition, the
16922 anonymous access subtype defined by the access_definition for a
16923 controlling access parameter (see *note 3.9.2::) excludes null.
16924 Finally, for a subtype_indication without a null_exclusion, the subtype
16925 denoted by the subtype_indication excludes null if and only if the
16926 subtype denoted by the subtype_mark in the subtype_indication excludes
16927 null.
16928
16929 13.c/2
16930 Reason: {AI95-00231-01AI95-00231-01} An access_definition used
16931 in a controlling parameter excludes null because it is
16932 necessary to read the tag to dispatch, and null has no tag.
16933 We would have preferred to require not null to be specified
16934 for such parameters, but that would have been too incompatible
16935 with Ada 95 code to require.
16936
16937 13.d/2
16938 {AI95-00416-01AI95-00416-01} Note that we considered imposing
16939 a similar implicit null exclusion for controlling access
16940 results, but chose not to do that, because there is no Ada 95
16941 compatibility issue, and there is no automatic null check
16942 inherent in the use of a controlling access result. If a null
16943 check is necessary, it is because there is a dereference of
16944 the result, or because the value is passed to a parameter
16945 whose subtype excludes null. If there is no dereference of
16946 the result, a null return value is perfectly acceptable, and
16947 can be a useful indication of a particular status of the call.
16948
16949 14/3
16950 {8652/00138652/0013} {AI95-00012-01AI95-00012-01}
16951 {AI05-0264-1AI05-0264-1} [All subtypes of an access-to-subprogram type
16952 are constrained.] The first subtype of a type defined by an
16953 access_definition or an access_to_object_definition is unconstrained if
16954 the designated subtype is an unconstrained array or discriminated
16955 subtype; otherwise, it is constrained.
16956
16957 14.a
16958 Proof: The Legality Rules on range_constraints (see *note
16959 3.5::) do not permit the subtype_mark of the
16960 subtype_indication to denote an access-to-scalar type, only a
16961 scalar type. The Legality Rules on index_constraints (see
16962 *note 3.6.1::) and discriminant_constraints (see *note
16963 3.7.1::) both permit access-to-composite types in a
16964 subtype_indication with such _constraints. Note that an
16965 access-to-access-to-composite is never permitted in a
16966 subtype_indication with a constraint.
16967
16968 14.b/2
16969 Reason: {AI95-00363-01AI95-00363-01} Only
16970 composite_constraints are permitted for an access type, and
16971 only on access-to-composite types. A constraint on an
16972 access-to-scalar or access-to-access type might be violated
16973 due to assignments via other access paths that were not so
16974 constrained. By contrast, if the designated subtype is an
16975 array or discriminated type without defaults, the constraint
16976 could not be violated by unconstrained assignments, since
16977 array objects are always constrained, and discriminated
16978 objects are also constrained when the type does not have
16979 defaults for its discriminants. Constraints are not allowed
16980 on general access-to-unconstrained discriminated types if the
16981 type has defaults for its discriminants; constraints on
16982 pool-specific access types are usually allowed because
16983 allocated objects are usually constrained by their initial
16984 value.
16985
16986 _Legality Rules_
16987
16988 14.1/2
16989 {AI95-00231-01AI95-00231-01} If a subtype_indication (*note 3.2.2:
16990 S0027.), discriminant_specification (*note 3.7: S0062.),
16991 parameter_specification (*note 6.1: S0175.),
16992 parameter_and_result_profile (*note 6.1: S0173.),
16993 object_renaming_declaration (*note 8.5.1: S0200.), or
16994 formal_object_declaration (*note 12.4: S0279.) has a null_exclusion
16995 (*note 3.10: S0083.), the subtype_mark (*note 3.2.2: S0028.) in that
16996 construct shall denote an access subtype that does not exclude null.
16997
16998 14.c/2
16999 To be honest: {AI95-00231-01AI95-00231-01} This means
17000 "directly allowed in"; we are not talking about a
17001 null_exclusion that occurs in an access_definition in one of
17002 these constructs (for an access_definition, the subtype_mark
17003 in such an access_definition is not restricted).
17004
17005 14.d/2
17006 Reason: {AI95-00231-01AI95-00231-01} This is similar to doubly
17007 constraining a composite subtype, which we also don't allow.
17008
17009 _Dynamic Semantics_
17010
17011 15/2
17012 {AI95-00231-01AI95-00231-01} A composite_constraint is compatible with
17013 an unconstrained access subtype if it is compatible with the designated
17014 subtype. A null_exclusion is compatible with any access subtype that
17015 does not exclude null. An access value satisfies a composite_constraint
17016 of an access subtype if it equals the null value of its type or if it
17017 designates an object whose value satisfies the constraint. An access
17018 value satisfies an exclusion of the null value if it does not equal the
17019 null value of its type.
17020
17021 16
17022 The elaboration of an access_type_definition creates the access type and
17023 its first subtype. For an access-to-object type, this elaboration
17024 includes the elaboration of the subtype_indication, which creates the
17025 designated subtype.
17026
17027 17/2
17028 {AI95-00230-01AI95-00230-01} {AI95-00254-01AI95-00254-01} The
17029 elaboration of an access_definition creates an anonymous access type.
17030
17031 NOTES
17032
17033 18
17034 83 Access values are called "pointers" or "references" in some
17035 other languages.
17036
17037 19
17038 84 Each access-to-object type has an associated storage pool;
17039 several access types can share the same pool. An object can be
17040 created in the storage pool of an access type by an allocator (see
17041 *note 4.8::) for the access type. A storage pool (roughly)
17042 corresponds to what some other languages call a "heap." See *note
17043 13.11:: for a discussion of pools.
17044
17045 20
17046 85 Only index_constraints and discriminant_constraints can be
17047 applied to access types (see *note 3.6.1:: and *note 3.7.1::).
17048
17049 _Examples_
17050
17051 21
17052 Examples of access-to-object types:
17053
17054 22/2
17055 {AI95-00433-01AI95-00433-01} type Peripheral_Ref is not null access Peripheral; -- see *note 3.8.1::
17056 type Binop_Ptr is access all Binary_Operation'Class;
17057 -- general access-to-class-wide, see *note 3.9.1::
17058
17059 23
17060 Example of an access subtype:
17061
17062 24
17063 subtype Drum_Ref is Peripheral_Ref(Drum); -- see *note 3.8.1::
17064
17065 25
17066 Example of an access-to-subprogram type:
17067
17068 26
17069 type Message_Procedure is access procedure (M : in String := "Error!");
17070 procedure Default_Message_Procedure(M : in String);
17071 Give_Message : Message_Procedure := Default_Message_Procedure'Access;
17072 ...
17073 procedure Other_Procedure(M : in String);
17074 ...
17075 Give_Message := Other_Procedure'Access;
17076 ...
17077 Give_Message("File not found."); -- call with parameter (.all is optional)
17078 Give_Message.all; -- call with no parameters
17079
17080 _Extensions to Ada 83_
17081
17082 26.a
17083 The syntax for access_type_definition is changed to support
17084 general access types (including access-to-constants) and
17085 access-to-subprograms. The syntax rules for
17086 general_access_modifier and access_definition are new.
17087
17088 _Wording Changes from Ada 83_
17089
17090 26.b/3
17091 {AI05-0190-1AI05-0190-1} We use the term "storage pool" to
17092 talk about the data area from which allocation takes place.
17093 The term "collection" is only used for finalization.
17094 ("Collection" and "storage pool" are not the same thing
17095 because multiple unrelated access types can share the same
17096 storage pool; see *note 13.11:: for more discussion.)
17097
17098 _Inconsistencies With Ada 95_
17099
17100 26.c/2
17101 {AI95-00231-01AI95-00231-01} Access discriminants and
17102 noncontrolling access parameters no longer exclude null. A
17103 program which passed null to such an access discriminant or
17104 access parameter and expected it to raise Constraint_Error may
17105 fail when compiled with Ada 2005. One hopes that there no
17106 such programs outside of the ACATS. (Of course, a program
17107 which actually wants to pass null will work, which is far more
17108 likely.)
17109
17110 26.d/2
17111 {AI95-00363-01AI95-00363-01} Most unconstrained aliased
17112 objects with defaulted discriminants are no longer constrained
17113 by their initial values. This means that a program that
17114 raised Constraint_Error from an attempt to change the
17115 discriminants will no longer do so. The change only affects
17116 programs that depended on the raising of Constraint_Error in
17117 this case, so the inconsistency is unlikely to occur outside
17118 of the ACATS. This change may however cause compilers to
17119 implement these objects differently, possibly taking
17120 additional memory or time. This is unlikely to be worse than
17121 the differences caused by any major compiler upgrade.
17122
17123 _Incompatibilities With Ada 95_
17124
17125 26.e/2
17126 {AI95-00225-01AI95-00225-01} Amendment Correction: The rule
17127 defining when a current instance of a limited type is
17128 considered to be aliased has been tightened to apply only to
17129 types that cannot become nonlimited. A program that attempts
17130 to take 'Access of the current instance of a limited type that
17131 can become nonlimited will be illegal in Ada 2005. While
17132 original Ada 95 allowed the current instance of any limited
17133 type to be treated as aliased, this was inconsistently
17134 implemented in compilers, and was likely to not work as
17135 expected for types that are ultimately nonlimited.
17136
17137 _Extensions to Ada 95_
17138
17139 26.f/2
17140 {AI95-00231-01AI95-00231-01} The null_exclusion is new. It
17141 can be used in both anonymous and named access type
17142 definitions. It is most useful to declare that parameters
17143 cannot be null, thus eliminating the need for checks on use.
17144
17145 26.g/2
17146 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01}
17147 {AI95-00404-01AI95-00404-01} The kinds of anonymous access
17148 types allowed were increased by adding anonymous
17149 access-to-constant and anonymous access-to-subprogram types.
17150 Anonymous access-to-subprogram types used as parameters allow
17151 passing of subprograms at any level.
17152
17153 _Wording Changes from Ada 95_
17154
17155 26.h/2
17156 {8652/00128652/0012} {AI95-00062-01AI95-00062-01} Corrigendum:
17157 Added accidentally-omitted wording that says that a derived
17158 access type shares its storage pool with its parent type.
17159 This was clearly intended, both because of a note in *note
17160 3.4::, and because anything else would have been incompatible
17161 with Ada 83.
17162
17163 26.i/2
17164 {8652/00138652/0013} {AI95-00012-01AI95-00012-01} Corrigendum:
17165 Fixed typographical errors in the description of when access
17166 types are constrained.
17167
17168 26.j/2
17169 {AI95-00230-01AI95-00230-01} The wording was fixed to allow
17170 allocators and the literal null for anonymous access types.
17171 The former was clearly intended by Ada 95; see the
17172 Implementation Advice in *note 13.11::.
17173
17174 26.k/2
17175 {AI95-00363-01AI95-00363-01} The rules about aliased objects
17176 being constrained by their initial values now apply only to
17177 allocated objects, and thus have been moved to *note 4.8::,
17178 "*note 4.8:: Allocators".
17179
17180 _Wording Changes from Ada 2005_
17181
17182 26.l/3
17183 {AI05-0053-1AI05-0053-1} {AI05-0277-1AI05-0277-1} Correction:
17184 The rule about a current instance being aliased now is worded
17185 in terms of immutably limited types. Wording was also added
17186 to make extended return object declarations that have the
17187 keyword aliased be considered aliased. This latter was a
17188 significant oversight in Ada 2005 -- technically, the keyword
17189 aliased had no effect. But of course implementations followed
17190 the intent, not the letter of the Standard.
17191
17192 26.m/3
17193 {AI05-0142-4AI05-0142-4} Explicitly aliased parameters (see
17194 *note 6.1::) are defined to be aliased.
17195
17196 * Menu:
17197
17198 * 3.10.1 :: Incomplete Type Declarations
17199 * 3.10.2 :: Operations of Access Types
17200
17201 \1f
17202 File: aarm2012.info, Node: 3.10.1, Next: 3.10.2, Up: 3.10
17203
17204 3.10.1 Incomplete Type Declarations
17205 -----------------------------------
17206
17207 1
17208 There are no particular limitations on the designated type of an access
17209 type. In particular, the type of a component of the designated type can
17210 be another access type, or even the same access type. This permits
17211 mutually dependent and recursive access types. An
17212 incomplete_type_declaration can be used to introduce a type to be used
17213 as a designated type, while deferring its full definition to a
17214 subsequent full_type_declaration.
17215
17216 _Syntax_
17217
17218 2/2
17219 {AI95-00326-01AI95-00326-01} incomplete_type_declaration ::= type
17220 defining_identifier [discriminant_part] [is tagged];
17221
17222 _Static Semantics_
17223
17224 2.1/2
17225 {AI95-00326-01AI95-00326-01} An incomplete_type_declaration declares an
17226 incomplete view of a type and its first subtype; the first subtype is
17227 unconstrained if a discriminant_part appears. If the
17228 incomplete_type_declaration (*note 3.10.1: S0085.) includes the reserved
17229 word tagged, it declares a tagged incomplete view. [An incomplete view
17230 of a type is a limited view of the type (see *note 7.5::).]
17231
17232 2.2/2
17233 {AI95-00326-01AI95-00326-01} Given an access type A whose designated
17234 type T is an incomplete view, a dereference of a value of type A also
17235 has this incomplete view except when:
17236
17237 2.a/3
17238 Discussion: {AI05-0208-1AI05-0208-1} Whether the designated
17239 type is an incomplete view (and thus whether this set of rules
17240 applies) is determined by the view of the type at the
17241 declaration of the access type; it does not change during the
17242 life of the type.
17243
17244 2.3/2
17245 * it occurs within the immediate scope of the completion of T, or
17246
17247 2.4/3
17248 * {AI05-0208-1AI05-0208-1} it occurs within the scope of a
17249 nonlimited_with_clause that mentions a library package in whose
17250 visible part the completion of T is declared, or
17251
17252 2.5/3
17253 * {AI05-0208-1AI05-0208-1} it occurs within the scope of the
17254 completion of T and T is an incomplete view declared by an
17255 incomplete_type_declaration.
17256
17257 2.6/3
17258 {AI05-0162-1AI05-0162-1} In these cases, the dereference has the view of
17259 T visible at the point of the dereference.
17260
17261 2.b/2
17262 Discussion: We need the "in whose visible part" rule so that
17263 the second rule doesn't trigger in the body of a package with
17264 a with of a child unit:
17265
17266 2.c/2
17267 package P is
17268 private
17269 type T;
17270 type PtrT is access T;
17271 end P;
17272
17273 2.d/2
17274 private package P.C is
17275 Ptr : PtrT;
17276 end P.C;
17277
17278 2.e/3
17279 {AI05-0005-1AI05-0005-1} with P.C;
17280 package body P is
17281 -- Ptr.all'Size is not legal here, but we are within the scope
17282 -- of a nonlimited_with_clause for P.
17283 type T is ...
17284 -- Ptr.all'Size is legal here.
17285 end P;
17286
17287 2.7/3
17288 {AI95-00412-01AI95-00412-01} {AI05-0162-1AI05-0162-1}
17289 {AI05-0208-1AI05-0208-1} Similarly, if a subtype_mark denotes a
17290 subtype_declaration defining a subtype of an incomplete view T, the
17291 subtype_mark denotes an incomplete view except under the same three
17292 circumstances given above, in which case it denotes the view of T
17293 visible at the point of the subtype_mark.
17294
17295 _Legality Rules_
17296
17297 3/3
17298 {AI05-0162-1AI05-0162-1} An incomplete_type_declaration (*note 3.10.1:
17299 S0085.) requires a completion, which shall be a type_declaration (*note
17300 3.2.1: S0023.) other than an incomplete_type_declaration (*note 3.10.1:
17301 S0085.). [If the incomplete_type_declaration (*note 3.10.1: S0085.)
17302 occurs immediately within either the visible part of a
17303 package_specification (*note 7.1: S0191.) or a declarative_part (*note
17304 3.11: S0086.), then the type_declaration (*note 3.2.1: S0023.) shall
17305 occur later and immediately within this visible part or declarative_part
17306 (*note 3.11: S0086.). If the incomplete_type_declaration (*note 3.10.1:
17307 S0085.) occurs immediately within the private part of a given
17308 package_specification (*note 7.1: S0191.), then the type_declaration
17309 (*note 3.2.1: S0023.) shall occur later and immediately within either
17310 the private part itself, or the declarative_part (*note 3.11: S0086.) of
17311 the corresponding package_body (*note 7.2: S0192.).]
17312
17313 3.a
17314 Proof: This is implied by the next AARM-only rule, plus the
17315 rules in *note 3.11.1::, "*note 3.11.1:: Completions of
17316 Declarations" which require a completion to appear later and
17317 immediately within the same declarative region.
17318
17319 3.b
17320 To be honest: If the incomplete_type_declaration occurs
17321 immediately within the visible part of a
17322 package_specification, then the completing type_declaration
17323 (*note 3.2.1: S0023.) shall occur immediately within this
17324 visible part.
17325
17326 3.c
17327 To be honest: If the implementation supports it, an
17328 incomplete_type_declaration can be imported (using aspect
17329 Import, see *note B.1::), in which case no explicit completion
17330 is allowed.
17331
17332 4/3
17333 {AI95-00326-01AI95-00326-01} {AI05-0162-1AI05-0162-1} If an
17334 incomplete_type_declaration (*note 3.10.1: S0085.) includes the reserved
17335 word tagged, then a type_declaration (*note 3.2.1: S0023.) that
17336 completes it shall declare a tagged type. If an
17337 incomplete_type_declaration (*note 3.10.1: S0085.) has a
17338 known_discriminant_part (*note 3.7: S0061.), then a type_declaration
17339 (*note 3.2.1: S0023.) that completes it shall have a fully conforming
17340 (explicit) known_discriminant_part (*note 3.7: S0061.) (see *note
17341 6.3.1::). [If an incomplete_type_declaration (*note 3.10.1: S0085.) has
17342 no discriminant_part (or an unknown_discriminant_part (*note 3.7:
17343 S0060.)), then a corresponding type_declaration (*note 3.2.1: S0023.) is
17344 nevertheless allowed to have discriminants, either explicitly, or
17345 inherited via derivation.]
17346
17347 5/2
17348 {AI95-00326-01AI95-00326-01} A name that denotes an incomplete view of a
17349 type may be used as follows:
17350
17351 6/3
17352 * {AI05-0098-1AI05-0098-1} as the subtype_mark in the
17353 subtype_indication of an access_to_object_definition (*note 3.10:
17354 S0080.); [the only form of constraint allowed in this
17355 subtype_indication is a discriminant_constraint [(a null_exclusion
17356 is not allowed)];]
17357
17358 6.a
17359 Implementation Note: We now allow discriminant_constraints
17360 even if the full type is deferred to the package body.
17361 However, there is no particular implementation burden because
17362 we have dropped the concept of the dependent compatibility
17363 check. In other words, we have effectively repealed
17364 AI83-00007.
17365
17366 7/2
17367 * {AI95-00326-01AI95-00326-01} {AI95-00412-01AI95-00412-01} as the
17368 subtype_mark in the subtype_indication of a subtype_declaration;
17369 the subtype_indication (*note 3.2.2: S0027.) shall not have a
17370 null_exclusion (*note 3.10: S0083.) or a constraint;
17371
17372 8/3
17373 * {AI95-00326-01AI95-00326-01} {AI05-0151-1AI05-0151-1} as the
17374 subtype_mark in an access_definition for an access-to-object type;
17375
17376 8.a/2
17377 To be honest: This does not mean any random subtype_mark in a
17378 construct that makes up an access_definition, such as a
17379 formal_part, just the one given directly in the syntax of
17380 access_definition.
17381
17382 8.1/3
17383 * {AI05-0151-1AI05-0151-1} as the subtype_mark defining the subtype
17384 of a parameter or result in a profile occurring within a
17385 basic_declaration;
17386
17387 8.b/3
17388 Ramification: But not in the profile for a body or entry.
17389
17390 8.2/3
17391 * {AI05-0213-1AI05-0213-1} as a generic actual parameter whose
17392 corresponding generic formal parameter is a formal incomplete type
17393 (see *note 12.5.1::).
17394
17395 8.3/2
17396 {AI95-00326-01AI95-00326-01} If such a name denotes a tagged incomplete
17397 view, it may also be used:
17398
17399 8.4/3
17400 * {AI95-00326-01AI95-00326-01} {AI05-0151-1AI05-0151-1} as the
17401 subtype_mark defining the subtype of a parameter in the profile for
17402 a subprogram_body, entry_body, or accept_statement;
17403
17404 9/2
17405 * {AI95-00326-01AI95-00326-01} as the prefix of an
17406 attribute_reference whose attribute_designator (*note 4.1.4:
17407 S0101.) is Class; such an attribute_reference (*note 4.1.4: S0100.)
17408 is restricted to the uses allowed here; it denotes a tagged
17409 incomplete view.
17410
17411 9.a/2
17412 This paragraph was deleted.{AI95-00326-01AI95-00326-01}
17413
17414 9.1/3
17415 This paragraph was deleted.{AI95-00326-01AI95-00326-01}
17416 {AI05-0151-1AI05-0151-1}
17417
17418 9.2/3
17419 * This paragraph was deleted.{AI95-00326-01AI95-00326-01}
17420 {AI05-0098-1AI05-0098-1} {AI05-0151-1AI05-0151-1}
17421
17422 9.b/3
17423 This paragraph was deleted.
17424
17425 9.3/2
17426 {AI95-00326-01AI95-00326-01} If any of the above uses occurs as part of
17427 the declaration of a primitive subprogram of the incomplete view, and
17428 the declaration occurs immediately within the private part of a package,
17429 then the completion of the incomplete view shall also occur immediately
17430 within the private part; it shall not be deferred to the package body.
17431
17432 9.c/2
17433 Reason: This fixes a hole in Ada 95 where a dispatching
17434 operation with an access parameter could be declared in a
17435 private part and a dispatching call on it could occur in a
17436 child even though there is no visibility on the full type,
17437 requiring access to the controlling tag without access to the
17438 representation of the type.
17439
17440 9.4/2
17441 {AI95-00326-01AI95-00326-01} No other uses of a name that denotes an
17442 incomplete view of a type are allowed.
17443
17444 10/3
17445 {AI95-00326-01AI95-00326-01} {AI05-0151-1AI05-0151-1} A prefix that
17446 denotes an object shall not be of an incomplete view. An actual
17447 parameter in a call shall not be of an untagged incomplete view. The
17448 result object of a function call shall not be of an incomplete view. A
17449 prefix shall not denote a subprogram having a formal parameter of an
17450 untagged incomplete view, nor a return type that is an incomplete view.
17451
17452 10.a/2
17453 Reason: We used to disallow all dereferences of an incomplete
17454 type. Now we only disallow such dereferences when used as a
17455 prefix. Dereferences used in other contexts do not pose a
17456 problem since normal type matching will preclude their use
17457 except when the full type is "nearby" as context (for example,
17458 as the expected type).
17459
17460 10.b/2
17461 This also disallows prefixes that are directly of an
17462 incomplete view. For instance, a parameter P can be declared
17463 of a tagged incomplete type, but we don't want to allow
17464 P'Size, P'Alignment, or the like, as representation values
17465 aren't known for an incomplete view.
17466
17467 10.c/2
17468 We say "denotes an object" so that prefixes that directly name
17469 an incomplete view are not covered; the previous rules cover
17470 such cases, and we certainly don't want to ban Incomp'Class.
17471
17472 10.d/3
17473 {AI05-0151-1AI05-0151-1} As subprogram profiles now may
17474 include any kind of incomplete type, we also disallow passing
17475 objects of untagged incomplete types in subprogram calls (as
17476 the parameter passing method is not known as it is for tagged
17477 types) and disallow returning any sort of incomplete objects
17478 (since we don't know how big they are).
17479
17480 Paragraph 11 was deleted.
17481
17482 _Dynamic Semantics_
17483
17484 12
17485 The elaboration of an incomplete_type_declaration has no effect.
17486
17487 12.a
17488 Reason: An incomplete type has no real existence, so it
17489 doesn't need to be "created" in the usual sense we do for
17490 other types. It is roughly equivalent to a "forward;"
17491 declaration in Pascal. Private types are different, because
17492 they have a different set of characteristics from their full
17493 type.
17494
17495 NOTES
17496
17497 13
17498 86 Within a declarative_part, an incomplete_type_declaration and a
17499 corresponding full_type_declaration cannot be separated by an
17500 intervening body. This is because a type has to be completely
17501 defined before it is frozen, and a body freezes all types declared
17502 prior to it in the same declarative_part (see *note 13.14::).
17503
17504 13.1/3
17505 87 {AI05-0151-1AI05-0151-1} {AI05-0269-1AI05-0269-1} A name that
17506 denotes an object of an incomplete view is defined to be of a
17507 limited type. Hence, the target of an assignment statement cannot
17508 be of an incomplete view.
17509
17510 _Examples_
17511
17512 14
17513 Example of a recursive type:
17514
17515 15
17516 type Cell; -- incomplete type declaration
17517 type Link is access Cell;
17518
17519 16
17520 type Cell is
17521 record
17522 Value : Integer;
17523 Succ : Link;
17524 Pred : Link;
17525 end record;
17526
17527 17
17528 Head : Link := new Cell'(0, null, null);
17529 Next : Link := Head.Succ;
17530
17531 18
17532 Examples of mutually dependent access types:
17533
17534 19/2
17535 {AI95-00433-01AI95-00433-01} type Person(<>); -- incomplete type declaration
17536 type Car is tagged; -- incomplete type declaration
17537
17538 20/2
17539 {AI95-00433-01AI95-00433-01} type Person_Name is access Person;
17540 type Car_Name is access all Car'Class;
17541
17542 21/2
17543 {AI95-00433-01AI95-00433-01} type Car is tagged
17544 record
17545 Number : Integer;
17546 Owner : Person_Name;
17547 end record;
17548
17549 22
17550 type Person(Sex : Gender) is
17551 record
17552 Name : String(1 .. 20);
17553 Birth : Date;
17554 Age : Integer range 0 .. 130;
17555 Vehicle : Car_Name;
17556 case Sex is
17557 when M => Wife : Person_Name(Sex => F);
17558 when F => Husband : Person_Name(Sex => M);
17559 end case;
17560 end record;
17561
17562 23
17563 My_Car, Your_Car, Next_Car : Car_Name := new Car; -- see *note 4.8::
17564 George : Person_Name := new Person(M);
17565 ...
17566 George.Vehicle := Your_Car;
17567
17568 _Extensions to Ada 83_
17569
17570 23.a
17571 The full_type_declaration that completes an
17572 incomplete_type_declaration may have a known_discriminant_part
17573 even if the incomplete_type_declaration does not.
17574
17575 23.b/1
17576 A discriminant_constraint may be applied to an incomplete
17577 type, even if its completion is deferred to the package body,
17578 because there is no "dependent compatibility check" required
17579 any more. Of course, the constraint can be specified only if
17580 a known_discriminant_part was given in the
17581 incomplete_type_declaration. As mentioned in the previous
17582 paragraph, that is no longer required even when the full type
17583 has discriminants.
17584
17585 _Wording Changes from Ada 83_
17586
17587 23.c
17588 Dereferences producing incomplete types were not explicitly
17589 disallowed in RM83, though AI83-00039 indicated that it was
17590 not strictly necessary since troublesome cases would result in
17591 Constraint_Error at run time, since the access value would
17592 necessarily be null. However, this introduces an undesirable
17593 implementation burden, as illustrated by Example 4 of
17594 AI83-00039:
17595
17596 23.d
17597 package Pack is
17598 type Pri is private;
17599 private
17600 type Sep;
17601 type Pri is access Sep;
17602 X : Pri;
17603 end Pack;
17604
17605 23.e
17606 package body Pack is -- Could be separately compiled!
17607 type Sep is ...;
17608 X := new Sep;
17609 end Pack;
17610
17611 23.f
17612 pragma Elaborate(Pack);
17613 private package Pack.Child is
17614 I : Integer := X.all'Size; -- Legal, by AI-00039.
17615 end Pack.Child;
17616
17617 23.g
17618 Generating code for the above example could be a serious
17619 implementation burden, since it would require all aliased
17620 objects to store size dope, and for that dope to be in the
17621 same format for all kinds of types (or some other equivalently
17622 inefficient implementation). On the contrary, most
17623 implementations allocate dope differently (or not at all) for
17624 different designated subtypes.
17625
17626 _Incompatibilities With Ada 95_
17627
17628 23.h/2
17629 {AI95-00326-01AI95-00326-01} It is now illegal to use an
17630 incomplete view (type) as the parameter or result of an
17631 access-to-subprogram type unless the incomplete view is
17632 completed in the same declaration list as the use. This was
17633 allowed in Ada 95 for incomplete types where the completion
17634 was deferred to the body. By disallowing this rare use of
17635 incomplete views, we can allow the use of incomplete views in
17636 many more places, which is especially valuable for limited
17637 views.
17638
17639 23.i/2
17640 {AI95-00326-01AI95-00326-01} It is now illegal to use an
17641 incomplete view (type) in a primitive subprogram of the type
17642 unless the incomplete view is completed in the package
17643 specification. This was allowed in Ada 95 for incomplete
17644 types where the completion was deferred to the body (the use
17645 would have to be in an access parameter). This
17646 incompatibility was caused by the fix for the hole noted in
17647 Legality Rules above.
17648
17649 _Extensions to Ada 95_
17650
17651 23.j/2
17652 {AI95-00326-01AI95-00326-01} Tagged incomplete types are new.
17653 They are allowed in parameter declarations as well as the
17654 usual places, as tagged types are always by-reference types
17655 (and thus there can be no code generation issue).
17656
17657 23.k/2
17658 {AI95-00412-01AI95-00412-01} A subtype_declaration can be used
17659 to give a new name to an incomplete view of a type. This is
17660 valuable to give shorter names to entities imported with a
17661 limited_with_clause.
17662
17663 _Wording Changes from Ada 95_
17664
17665 23.l/2
17666 {AI95-00326-01AI95-00326-01} The description of incomplete
17667 types as incomplete views is new. Ada 95 defined these as
17668 separate types, but neglected to give any rules for matching
17669 them with other types. Luckily, implementers did the right
17670 thing anyway. This change also makes it easier to describe
17671 the meaning of a limited view.
17672
17673 _Extensions to Ada 2005_
17674
17675 23.m/3
17676 {AI05-0098-1AI05-0098-1} Correction: Fixed the definition so
17677 that an anonymous access-to-subprogram type can use an
17678 incomplete view in the same way that a named
17679 access-to-subprogram type can.
17680
17681 23.n/3
17682 {AI05-0151-1AI05-0151-1} Incomplete types now can be used in
17683 subprogram declarations. The type has to be complete before
17684 any calls or the body is declared. This reduces the places
17685 where access types are required for types imported from
17686 limited views of packages.
17687
17688 23.o/3
17689 {AI05-0162-1AI05-0162-1} Incomplete types now can be completed
17690 by private types and private extensions. Since this can
17691 already happen for limited views, there is no remaining reason
17692 to disallow it for explicitly declared incomplete types.
17693
17694 _Wording Changes from Ada 2005_
17695
17696 23.p/3
17697 {AI05-0208-1AI05-0208-1} Correction: Changed the rules of uses
17698 of dereferences of incomplete views such that it does not
17699 introduce an unintentional incompatibility with Ada 83 and Ada
17700 95.
17701
17702 23.q/3
17703 {AI05-0213-1AI05-0213-1} Incomplete types now can be used as
17704 actuals to formal incomplete types (see *note 12.5.1::).
17705
17706 \1f
17707 File: aarm2012.info, Node: 3.10.2, Prev: 3.10.1, Up: 3.10
17708
17709 3.10.2 Operations of Access Types
17710 ---------------------------------
17711
17712 1/3
17713 {AI05-0299-1AI05-0299-1} [The attribute Access is used to create access
17714 values designating aliased objects and nonintrinsic subprograms. The
17715 "accessibility" rules prevent dangling references (in the absence of
17716 uses of certain unchecked features -- see Clause *note 13::).]
17717
17718 _Language Design Principles_
17719
17720 1.a
17721 It should be possible for an access value to designate an
17722 object declared by an object declaration, or a subcomponent
17723 thereof. In implementation terms, this means pointing at
17724 stack-allocated and statically allocated data structures.
17725 However, dangling references should be prevented, primarily
17726 via compile-time rules, so long as features like
17727 Unchecked_Access and Unchecked_Deallocation are not used.
17728
17729 1.b
17730 In order to create such access values, we require that the
17731 access type be a general access type, that the designated
17732 object be aliased, and that the accessibility rules be obeyed.
17733
17734 _Name Resolution Rules_
17735
17736 2/2
17737 {AI95-00235-01AI95-00235-01} For an attribute_reference with
17738 attribute_designator Access (or Unchecked_Access -- see *note 13.10::),
17739 the expected type shall be a single access type A such that:
17740
17741 2.1/2
17742 * {AI95-00235-01AI95-00235-01} A is an access-to-object type with
17743 designated type D and the type of the prefix is D'Class or is
17744 covered by D, or
17745
17746 2.2/2
17747 * {AI95-00235-01AI95-00235-01} A is an access-to-subprogram type
17748 whose designated profile is type conformant with that of the
17749 prefix.
17750
17751 2.3/2
17752 {AI95-00235-01AI95-00235-01} [The prefix of such an attribute_reference
17753 is never interpreted as an implicit_dereference or a parameterless
17754 function_call (see *note 4.1.4::).] The designated type or profile of
17755 the expected type of the attribute_reference is the expected type or
17756 profile for the prefix.
17757
17758 2.a
17759 Discussion: Saying that the expected type shall be a "single
17760 access type" is our "new" way of saying that the type has to
17761 be determinable from context using only the fact that it is an
17762 access type. See *note 4.2:: and *note 8.6::. Specifying the
17763 expected profile only implies type conformance. The more
17764 stringent subtype conformance is required by a Legality Rule.
17765 This is the only Resolution Rule that applies to the name in a
17766 prefix of an attribute_reference. In all other cases, the
17767 name has to be resolved without using context. See *note
17768 4.1.4::.
17769
17770 2.b/2
17771 {AI95-00235-01AI95-00235-01} Saying "single access type" is a
17772 bit of a fudge. Both the context and the prefix may provide
17773 both multiple types; "single" only means that a single,
17774 specific interpretation must remain after resolution. We say
17775 "single" here to trigger the Legality Rules of *note 8.6::.
17776 The resolution of an access attribute is similar to that of an
17777 assignment_statement. For example:
17778
17779 2.c/2
17780 type Int_Ptr is access all Integer;
17781 type Char_Ptr is access all Character;
17782 type Float_Ptr is access all Float;
17783
17784 2.d/2
17785 function Zap (Val : Int_Ptr) return Float; -- (1)
17786 function Zap (Val : Float_Ptr) return Float; -- (2)
17787 function Zop return Int_Ptr; -- (3)
17788 function Zop return Char_Ptr; -- (4)
17789
17790 2.e/2
17791 Result : Float := Zap (Zop.all'Access); -- Resolves to Zap (1) and Zop (3).
17792
17793 _Static Semantics_
17794
17795 3/2
17796 {AI95-00162-01AI95-00162-01} [The accessibility rules, which prevent
17797 dangling references, are written in terms of accessibility levels, which
17798 reflect the run-time nesting of masters. As explained in *note 7.6.1::,
17799 a master is the execution of a certain construct, such as a
17800 subprogram_body. An accessibility level is deeper than another if it is
17801 more deeply nested at run time. For example, an object declared local
17802 to a called subprogram has a deeper accessibility level than an object
17803 declared local to the calling subprogram. The accessibility rules for
17804 access types require that the accessibility level of an object
17805 designated by an access value be no deeper than that of the access type.
17806 This ensures that the object will live at least as long as the access
17807 type, which in turn ensures that the access value cannot later designate
17808 an object that no longer exists. The Unchecked_Access attribute may be
17809 used to circumvent the accessibility rules.]
17810
17811 3.a/3
17812 Discussion: {AI05-0005-1AI05-0005-1} The Unchecked_Access
17813 attribute acts as if the object was declared at library-level;
17814 this applies even when it is used as the value of anonymous
17815 access type. See *note 13.10::.
17816
17817 3.b/3
17818 Subclause *note 3.10.2::, home of the accessibility rules, is
17819 informally known as the "Heart of Darkness" amongst the
17820 maintainers of Ada. Woe unto all who enter here (well, at
17821 least unto anyone that needs to understand any of these
17822 rules).
17823
17824 4
17825 [A given accessibility level is said to be statically deeper than
17826 another if the given level is known at compile time (as defined below)
17827 to be deeper than the other for all possible executions. In most cases,
17828 accessibility is enforced at compile time by Legality Rules. Run-time
17829 accessibility checks are also used, since the Legality Rules do not
17830 cover certain cases involving access parameters and generic packages.]
17831
17832 5
17833 Each master, and each entity and view created by it, has an
17834 accessibility level:
17835
17836 6
17837 * The accessibility level of a given master is deeper than that of
17838 each dynamically enclosing master, and deeper than that of each
17839 master upon which the task executing the given master directly
17840 depends (see *note 9.3::).
17841
17842 7/3
17843 * {AI95-00162-01AI95-00162-01} {AI95-00416-01AI95-00416-01}
17844 {AI05-0235-1AI05-0235-1} An entity or view defined by a declaration
17845 and created as part of its elaboration has the same accessibility
17846 level as the innermost master of the declaration except in the
17847 cases of renaming and derived access types described below. Other
17848 than for an explicitly aliased parameter, a formal parameter of a
17849 callable entity has the same accessibility level as the master
17850 representing the invocation of the entity.
17851
17852 7.a/2
17853 Reason: {AI95-00416-01AI95-00416-01} This rule defines the
17854 "normal" accessibility of entities. In the absence of special
17855 rules below, we intend for this rule to apply.
17856
17857 7.b/2
17858 Discussion: {AI95-00416-01AI95-00416-01} This rule defines the
17859 accessibility of all named access types, as well as the
17860 accessibility level of all anonymous access types other than
17861 those for access parameters and access discriminants. Special
17862 rules exist for the accessibility level of such anonymous
17863 types. Components, stand-alone objects, and function results
17864 whose (anonymous) type is defined by an access_definition have
17865 accessibility levels corresponding to named access types
17866 defined at the same point.
17867
17868 7.c/2
17869 Ramification: {AI95-00230-01AI95-00230-01} Because
17870 accessibility level is determined by where the
17871 access_definition is elaborated, for a type extension, the
17872 anonymous access types of components (other than access
17873 discriminants) inherited from the parent have the same
17874 accessibility as they did in the parent; those in the
17875 extension part have the accessibility determined by the scope
17876 where the type extension is declared. Similarly, the types of
17877 the nondiscriminant access components of a derived untagged
17878 type have the same accessibility as they did in the parent.
17879
17880 7.d/3
17881 To be honest: {AI05-0235-1AI05-0235-1} We use "invocation of"
17882 in the parameter case as a master is formally an execution of
17883 something. But we mean this to be interpreted statically (for
17884 instance, as the body of the subprogram) for the purposes of
17885 computing "statically deeper than" (see below).
17886
17887 7.e/3
17888 Ramification: {AI05-0235-1AI05-0235-1} Note that accessibility
17889 can differ depending on the view of an object (for both static
17890 and dynamic accessibility). For instance, the accessibility
17891 level of a formal parameter may be different than the
17892 accessibility level of the corresponding actual parameter.
17893 This occurs in other cases as well.
17894
17895 7.f/3
17896 Reason: {AI05-0235-1AI05-0235-1} We define the (dynamic)
17897 accessibility of formal parameters in order that it does not
17898 depend on the parameter passing model (by-reference or
17899 by-copy) as that is implementation defined. Otherwise, there
17900 would be a portability issue.
17901
17902 8
17903 * The accessibility level of a view of an object or subprogram
17904 defined by a renaming_declaration is the same as that of the
17905 renamed view.
17906
17907 9/2
17908 * {AI95-00416-01AI95-00416-01} The accessibility level of a view
17909 conversion, qualified_expression, or parenthesized expression, is
17910 the same as that of the operand.
17911
17912 9.1/3
17913 * {AI05-0188-1AI05-0188-1} The accessibility level of a
17914 conditional_expression is the accessibility level of the evaluated
17915 dependent_expression.
17916
17917 10/3
17918 * {AI95-00318-02AI95-00318-02} {AI95-00416-01AI95-00416-01}
17919 {AI05-0234-1AI05-0234-1} The accessibility level of an aggregate
17920 that is used (in its entirety) to directly initialize part of an
17921 object is that of the object being initialized. In other contexts,
17922 the accessibility level of an aggregate is that of the innermost
17923 master that evaluates the aggregate.
17924
17925 10.1/3
17926 * {AI05-0234-1AI05-0234-1} The accessibility level of the result of a
17927 function call is that of the master of the function call, which is
17928 determined by the point of call as follows:
17929
17930 10.2/3
17931 * If the result is used (in its entirety) to directly
17932 initialize part of an object, the master is that of the
17933 object being initialized. In the case where the
17934 initialized object is a coextension (see below) that
17935 becomes a coextension of another object, the master is
17936 that of the eventual object to which the coextension will
17937 be transferred.
17938
17939 10.a/2
17940 To be honest: {AI95-00416-01AI95-00416-01} The first sentence
17941 is talking about a static use of the entire return object -- a
17942 slice that happens to be the entire return object doesn't
17943 count. On the other hand, this is intended to allow
17944 parentheses and qualified_expressions.
17945
17946 10.b/3
17947 Ramification: {AI95-00416-01AI95-00416-01}
17948 {AI05-0234-1AI05-0234-1} If the function is used as a prefix,
17949 this bullet does not apply. Similarly, an
17950 assignment_statement is not an initialization of an object, so
17951 this bullet does not apply.
17952
17953 10.3/3
17954 * If the result is of an anonymous access type and is the
17955 operand of an explicit conversion, the master is that of
17956 the target type of the conversion;
17957
17958 10.4/3
17959 * If the result is of an anonymous access type and defines
17960 an access discriminant, the master is the same as that
17961 for an object created by an anonymous allocator that
17962 defines an access discriminant (even if the access result
17963 is of an access-to-subprogram type).
17964
17965 10.5/3
17966 * If the call itself defines the result of a function to
17967 which one of the above rules applies, these rules are
17968 applied recursively;
17969
17970 10.6/3
17971 * In other cases, the master of the call is that of the
17972 innermost master that evaluates the function call.
17973
17974 10.c/2
17975 Ramification: {AI95-00318-02AI95-00318-02}
17976 {AI95-00416-01AI95-00416-01} The "innermost master which
17977 evaluated the function call" does not include the function
17978 call itself (which might be a master).
17979
17980 10.d/2
17981 {AI95-00318-02AI95-00318-02} {AI95-00416-01AI95-00416-01} We
17982 really mean the innermost master here, which could be a very
17983 short lifetime. Consider a function call used as a parameter
17984 of a procedure call. In this case the innermost master which
17985 evaluated the function call is the procedure call.
17986
17987 10.d.1/3
17988 Ramification: {AI05-0234-1AI05-0234-1} These rules do not
17989 mention whether the result object is built-in-place (see *note
17990 7.6::). In particular, in the case where building in place is
17991 optional, the choice whether or not to build-in-place has no
17992 effect on masters, lifetimes, or accessibility.
17993
17994 10.d.2/3
17995 Implementation Note: {AI05-0234-1AI05-0234-1} There are
17996 several cases where the implementation may have to pass in the
17997 accessibility level of the result object on a call, to support
17998 later rules where the accessibility level comes from the
17999 master of the call:
18000
18001 10.d.3/3
18002 * when the function result may have a part with access
18003 discriminants;
18004
18005 10.d.4/3
18006 * when the function result type is an anonymous access
18007 type;
18008
18009 10.d.5/3
18010 * when the function result is built-in-place;
18011
18012 10.d.6/3
18013 * when the function has an explicitly aliased parameter.
18014
18015 10.d.7/3
18016 In particular, this implies passing a level parameter when the
18017 result type is class-wide, since descendants may add access
18018 discriminants. For most implementations this will mean that
18019 functions with controlling results will also need a level
18020 parameter.
18021
18022 10.7/3
18023 {AI05-0284-1AI05-0284-1} In the case of a call to a function whose
18024 result type is an anonymous access type, the accessibility level of
18025 the type of the result of the function call is also determined by
18026 the point of call as described above.
18027
18028 10.8/3
18029 * {AI95-00416-01AI95-00416-01} Within a return statement, the
18030 accessibility level of the return object is that of the execution
18031 of the return statement. If the return statement completes
18032 normally by returning from the function, then prior to leaving the
18033 function, the accessibility level of the return object changes to
18034 be a level determined by the point of call, as does the level of
18035 any coextensions (see below) of the return object.
18036
18037 10.e/2
18038 Reason: We define the accessibility level of the return object
18039 during the return statement to be that of the return statement
18040 itself so that the object may be designated by objects local
18041 to the return statement, but not by objects outside the return
18042 statement. In addition, the intent is that the return object
18043 gets finalized if the return statement ends without actually
18044 returning (for example, due to propagating an exception, or a
18045 goto). For a normal return, of course, no finalization is
18046 done before returning.
18047
18048 11
18049 * The accessibility level of a derived access type is the same as
18050 that of its ultimate ancestor.
18051
18052 11.1/2
18053 * {AI95-00230-01AI95-00230-01} The accessibility level of the
18054 anonymous access type defined by an access_definition of an
18055 object_renaming_declaration is the same as that of the renamed
18056 view.
18057
18058 12/2
18059 * {AI95-00230-01AI95-00230-01} {AI95-00416-01AI95-00416-01} The
18060 accessibility level of the anonymous access type of an access
18061 discriminant in the subtype_indication or qualified_expression of
18062 an allocator, or in the expression or return_subtype_indication
18063 (*note 6.5: S0187.) of a return statement is determined as follows:
18064
18065 12.1/2
18066 * If the value of the access discriminant is determined by
18067 a discriminant_association in a subtype_indication, the
18068 accessibility level of the object or subprogram
18069 designated by the associated value (or library level if
18070 the value is null);
18071
18072 12.a/2
18073 Discussion: This deals with the following cases, when they
18074 occur in the context of an allocator or return statement:
18075
18076 12.b/2
18077 * An extension_aggregate where the ancestor_part is a
18078 subtype_mark denoting a constrained subtype;
18079
18080 12.c/2
18081 * An uninitialized allocator where the
18082 subtype_indication defines a constrained subtype;
18083
18084 12.d/2
18085 * A discriminant of an object with a constrained
18086 nominal subtype, including constrained components,
18087 the result of calling a function with a constrained
18088 result subtype, the dereference of an
18089 access-to-constrained subtype, etc.
18090
18091 12.e/3
18092 Ramification: {AI05-0281-1AI05-0281-1} The subtype_indication
18093 mentioned in this bullet is not necessarily the one given in
18094 the allocator or return statement that is determining the
18095 accessibility level; the constrained subtype might have been
18096 defined in an earlier declaration (as a named subtype).
18097
18098 12.f/3
18099 {AI05-0005-1AI05-0005-1} If the value for this rule and the
18100 next one is derived from an Unchecked_Access attribute, the
18101 accessibility is library-level no matter what the
18102 accessibility level of the object is (see *note 13.10::).
18103
18104 12.2/3
18105 * {AI05-0234-1AI05-0234-1} If the value of the access
18106 discriminant is determined by a default_expression in the
18107 declaration of the discriminant, the level of the object
18108 or subprogram designated by the associated value (or
18109 library level if null);
18110
18111 12.f.1/3
18112 Discussion: This covers the case of an unconstrained
18113 subcomponent of a limited type with defaulted access
18114 discriminants.
18115
18116 12.3/3
18117 * {AI05-0004-1AI05-0004-1} If the value of the access
18118 discriminant is determined by a
18119 record_component_association in an aggregate, the
18120 accessibility level of the object or subprogram
18121 designated by the associated value (or library level if
18122 the value is null);
18123
18124 12.g/2
18125 Discussion: In this bullet, the aggregate has to occur in the
18126 context of an allocator or return statement, while the
18127 subtype_indication of the previous bullet can occur anywhere
18128 (it doesn't have to be directly given in the allocator or
18129 return statement).
18130
18131 12.4/3
18132 * In other cases, where the value of the access
18133 discriminant is determined by an object with an
18134 unconstrained nominal subtype, the accessibility level of
18135 the object.
18136
18137 12.h/2
18138 Discussion: {AI95-00416-01AI95-00416-01} In other words, if
18139 you know the value of the discriminant for an allocator or
18140 return statement from a discriminant constraint or an
18141 aggregate component association, then that determines the
18142 accessibility level; if you don't know it, then it is based on
18143 the object itself.
18144
18145 12.5/3
18146 * {AI95-00416-01AI95-00416-01} The accessibility level of the
18147 anonymous access type of an access discriminant in any other
18148 context is that of the enclosing object.
18149
18150 13/3
18151 * {AI95-00162-01AI95-00162-01} {AI95-00254-01AI95-00254-01}
18152 {AI05-0270-1AI05-0270-1} The accessibility level of the anonymous
18153 access type of an access parameter specifying an access-to-object
18154 type is the same as that of the view designated by the actual (or
18155 library-level if the actual is null).
18156
18157 13.a/3
18158 Ramification: {AI05-0005-1AI05-0005-1} If the value of the
18159 actual is derived from an Unchecked_Access attribute, the
18160 accessibility is always library-level (see *note 13.10::).
18161
18162 13.1/2
18163 * {AI95-00254-01AI95-00254-01} The accessibility level of the
18164 anonymous access type of an access parameter specifying an
18165 access-to-subprogram type is deeper than that of any master; all
18166 such anonymous access types have this same level.
18167
18168 13.b/2
18169 Reason: These represent "downward closures" and thus require
18170 passing of static links or global display information (along
18171 with generic sharing information if the implementation does
18172 sharing) along with the address of the subprogram. We must
18173 prevent conversions of these to types with "normal"
18174 accessibility, as those typically don't include the extra
18175 information needed to make a call.
18176
18177 13.2/3
18178 * {AI05-0148-1AI05-0148-1} {AI05-0240-1AI05-0240-1} The accessibility
18179 level of the type of a stand-alone object of an anonymous
18180 access-to-object type is the same as the accessibility level of the
18181 type of the access value most recently assigned to the object[;
18182 accessibility checks ensure that this is never deeper than that of
18183 the declaration of the stand-alone object].
18184
18185 13.3/3
18186 * {AI05-0142-4AI05-0142-4} {AI05-0240-1AI05-0240-1} The accessibility
18187 level of an explicitly aliased (see *note 6.1::) formal parameter
18188 in a function body is determined by the point of call; it is the
18189 same level that the return object ultimately will have.
18190
18191 14/3
18192 * {AI95-00416-01AI95-00416-01} {AI05-0051-1AI05-0051-1}
18193 {AI05-0253-1AI05-0253-1} The accessibility level of an object
18194 created by an allocator is the same as that of the access type,
18195 except for an allocator of an anonymous access type (an anonymous
18196 allocator) in certain contexts, as follows: For an anonymous
18197 allocator that defines the result of a function with an access
18198 result, the accessibility level is determined as though the
18199 allocator were in place of the call of the function; in the special
18200 case of a call that is the operand of a type conversion, the level
18201 is that of the target access type of the conversion. For an
18202 anonymous allocator defining the value of an access parameter, the
18203 accessibility level is that of the innermost master of the call.
18204 For an anonymous allocator whose type is that of a stand-alone
18205 object of an anonymous access-to-object type, the accessibility
18206 level is that of the declaration of the stand-alone object. For
18207 one defining an access discriminant, the accessibility level is
18208 determined as follows:
18209
18210 14.1/3
18211 * {AI95-00416-01AI95-00416-01} {AI05-0024-1AI05-0024-1} for
18212 an allocator used to define the discriminant of an
18213 object, the level of the object;
18214
18215 14.2/3
18216 * {AI95-00416-01AI95-00416-01} {AI05-0024-1AI05-0024-1} for
18217 an allocator used to define the constraint in a
18218 subtype_indication in any other context, the level of the
18219 master that elaborates the subtype_indication.
18220
18221 14.3/3
18222 * This paragraph was deleted.{AI95-00416-01AI95-00416-01}
18223 {AI05-0024-1AI05-0024-1}
18224
18225 14.4/3
18226 {AI95-00416-01AI95-00416-01} {AI05-0024-1AI05-0024-1}
18227 {AI05-0066-1AI05-0066-1} In the first case, the allocated object is
18228 said to be a coextension of the object whose discriminant
18229 designates it, as well as of any object of which the discriminated
18230 object is itself a coextension or subcomponent. If the allocated
18231 object is a coextension of an anonymous object representing the
18232 result of an aggregate or function call that is used (in its
18233 entirety) to directly initialize a part of an object, after the
18234 result is assigned, the coextension becomes a coextension of the
18235 object being initialized and is no longer considered a coextension
18236 of the anonymous object. All coextensions of an object [(which
18237 have not thus been transfered by such an initialization)] are
18238 finalized when the object is finalized (see *note 7.6.1::).
18239
18240 14.a.1/2
18241 Ramification: The rules of access discriminants are such that
18242 when the space for an object with a coextension is reclaimed,
18243 the space for the coextensions can be reclaimed. Hence, there
18244 is implementation advice (see 13.11) that an object and its
18245 coextensions all be allocated from the same storage pool (or
18246 stack frame, in the case of a declared object).
18247
18248 14.5/3
18249 * {AI05-0051-1AI05-0051-1} Within a return statement, the
18250 accessibility level of the anonymous access type of an access
18251 result is that of the master of the call.
18252
18253 15/3
18254 * {AI05-0014-1AI05-0014-1} The accessibility level of a view of an
18255 object or subprogram designated by an access value is the same as
18256 that of the access type.
18257
18258 15.a/3
18259 Discussion: {AI05-0005-1AI05-0005-1} {AI05-0014-1AI05-0014-1}
18260 This rule applies even when no dereference exists, for example
18261 when an access value is passed as an access parameter. This
18262 rule ensures that implementations are not required to include
18263 dynamic accessibility values with all access values.
18264
18265 16
18266 * The accessibility level of a component, protected subprogram, or
18267 entry of (a view of) a composite object is the same as that of (the
18268 view of) the composite object.
18269
18270 16.1/3
18271 {AI95-00416-01AI95-00416-01} {AI05-0262-1AI05-0262-1} In the above
18272 rules, the operand of a view conversion, parenthesized expression or
18273 qualified_expression is considered to be used in a context if the view
18274 conversion, parenthesized expression or qualified_expression itself is
18275 used in that context. Similarly, a dependent_expression of a
18276 conditional_expression is considered to be used in a context if the
18277 conditional_expression itself is used in that context.
18278
18279 17
18280 One accessibility level is defined to be statically deeper than another
18281 in the following cases:
18282
18283 18
18284 * For a master that is statically nested within another master, the
18285 accessibility level of the inner master is statically deeper than
18286 that of the outer master.
18287
18288 18.a
18289 To be honest: Strictly speaking, this should talk about the
18290 constructs (such as subprogram_bodies) being statically nested
18291 within one another; the masters are really the executions of
18292 those constructs.
18293
18294 18.b
18295 To be honest: If a given accessibility level is statically
18296 deeper than another, then each level defined to be the same as
18297 the given level is statically deeper than each level defined
18298 to be the same as the other level.
18299
18300 18.1/2
18301 * {AI95-00254-01AI95-00254-01} The accessibility level of the
18302 anonymous access type of an access parameter specifying an
18303 access-to-subprogram type is statically deeper than that of any
18304 master; all such anonymous access types have this same level.
18305
18306 18.c/2
18307 Ramification: This rule means that it is illegal to convert an
18308 access parameter specifying an access to subprogram to a named
18309 access to subprogram type, but it is allowed to pass such an
18310 access parameter to another access parameter (the implicit
18311 conversion's accessibility will succeed).
18312
18313 19/3
18314 * {AI95-00254-01AI95-00254-01} {AI05-0082-1AI05-0082-1} The
18315 statically deeper relationship does not apply to the accessibility
18316 level of the anonymous type of an access parameter specifying an
18317 access-to-object type nor does it apply to a descendant of a
18318 generic formal type; that is, such an accessibility level is not
18319 considered to be statically deeper, nor statically shallower, than
18320 any other.
18321
18322 19.1/3
18323 * {AI05-0148-1AI05-0148-1} The statically deeper relationship does
18324 not apply to the accessibility level of the type of a stand-alone
18325 object of an anonymous access-to-object type; that is, such an
18326 accessibility level is not considered to be statically deeper, nor
18327 statically shallower, than any other.
18328
18329 19.a/3
18330 Ramification: In these cases, we use dynamic accessibility
18331 checks.
18332
18333 19.2/3
18334 * {AI05-0142-4AI05-0142-4} {AI05-0235-1AI05-0235-1} Inside a return
18335 statement that applies to a function F, when determining whether
18336 the accessibility level of an explicitly aliased parameter of F is
18337 statically deeper than the level of the return object of F, the
18338 level of the return object is considered to be the same as that of
18339 the level of the explicitly aliased parameter; for statically
18340 comparing with the level of other entities, an explicitly aliased
18341 parameter of F is considered to have the accessibility level of the
18342 body of F.
18343
18344 19.3/3
18345 * {AI05-0051-1AI05-0051-1} {AI05-0234-1AI05-0234-1}
18346 {AI05-0235-1AI05-0235-1} For determining whether a level is
18347 statically deeper than the level of the anonymous access type of an
18348 access result of a function, when within a return statement that
18349 applies to the function, the level of the master of the call is
18350 presumed to be the same as that of the level of the master that
18351 elaborated the function body.
18352
18353 19.b/3
18354 To be honest: {AI05-0235-1AI05-0235-1} This rule has no effect
18355 if the previous bullet also applies (that is, the "a level" is
18356 of an explicitly aliased parameter).
18357
18358 20
18359 * [For determining whether one level is statically deeper than
18360 another when within a generic package body, the generic package is
18361 presumed to be instantiated at the same level as where it was
18362 declared; run-time checks are needed in the case of more deeply
18363 nested instantiations.]
18364
18365 20.a/3
18366 Proof: {AI05-0082-1AI05-0082-1} A generic package does not
18367 introduce a new master, so it has the static level of its
18368 declaration; the rest follows from the other "statically
18369 deeper" rules.
18370
18371 21
18372 * For determining whether one level is statically deeper than another
18373 when within the declarative region of a type_declaration, the
18374 current instance of the type is presumed to be an object created at
18375 a deeper level than that of the type.
18376
18377 21.a
18378 Ramification: In other words, the rules are checked at compile
18379 time of the type_declaration, in an assume-the-worst manner.
18380
18381 22
18382 The accessibility level of all library units is called the library
18383 level; a library-level declaration or entity is one whose accessibility
18384 level is the library level.
18385
18386 22.a
18387 Ramification: Library_unit_declarations are library level.
18388 Nested declarations are library level if they are nested only
18389 within packages (possibly more than one), and not within
18390 subprograms, tasks, etc.
18391
18392 22.b/2
18393 To be honest: The definition of the accessibility level of the
18394 anonymous type of an access parameter specifying an
18395 access-to-object type cheats a bit, since it refers to the
18396 view designated by the actual, but access values designate
18397 objects, not views of objects. What we really mean is the
18398 view that "would be" denoted by an expression "X.all", where X
18399 is the actual, even though such an expression is a figment of
18400 our imagination. The definition is intended to be equivalent
18401 to the following more verbose version: The accessibility level
18402 of the anonymous type of an access parameter is as follows:
18403
18404 22.c
18405 * if the actual is an expression of a named access type --
18406 the accessibility level of that type;
18407
18408 22.d
18409 * if the actual is an allocator -- the accessibility level
18410 of the execution of the called subprogram;
18411
18412 22.e/1
18413 * if the actual is a reference to the Access attribute --
18414 the accessibility level of the view denoted by the
18415 prefix;
18416
18417 22.f
18418 * if the actual is a reference to the Unchecked_Access
18419 attribute -- library accessibility level;
18420
18421 22.g
18422 * if the actual is an access parameter -- the accessibility
18423 level of its type.
18424
18425 22.h
18426 Note that the allocator case is explicitly mentioned in the
18427 RM95, because otherwise the definition would be circular: the
18428 level of the anonymous type is that of the view designated by
18429 the actual, which is that of the access type.
18430
18431 22.i
18432 Discussion: A deeper accessibility level implies a shorter
18433 maximum lifetime. Hence, when a rule requires X to have a
18434 level that is "not deeper than" Y's level, this requires that
18435 X has a lifetime at least as long as Y. (We say "maximum
18436 lifetime" here, because the accessibility level really
18437 represents an upper bound on the lifetime; an object created
18438 by an allocator can have its lifetime prematurely ended by an
18439 instance of Unchecked_Deallocation.)
18440
18441 22.j
18442 Package elaborations are not masters, and are therefore
18443 invisible to the accessibility rules: an object declared
18444 immediately within a package has the same accessibility level
18445 as an object declared immediately within the declarative
18446 region containing the package. This is true even in the body
18447 of a package; it jibes with the fact that objects declared in
18448 a package_body live as long as objects declared outside the
18449 package, even though the body objects are not visible outside
18450 the package.
18451
18452 22.k
18453 Note that the level of the view denoted by X.all can be
18454 different from the level of the object denoted by X.all. The
18455 former is determined by the type of X; the latter is
18456 determined either by the type of the allocator, or by the
18457 master in which the object was declared. The former is used
18458 in several Legality Rules and run-time checks; the latter is
18459 used to define when X.all gets finalized. The level of a view
18460 reflects what we can conservatively "know" about the object of
18461 that view; for example, due to type_conversions, an access
18462 value might designate an object that was allocated by an
18463 allocator for a different access type.
18464
18465 22.l
18466 Similarly, the level of the view denoted by X.all.Comp can be
18467 different from the level of the object denoted by X.all.Comp.
18468
18469 22.m
18470 If Y is statically deeper than X, this implies that Y will be
18471 (dynamically) deeper than X in all possible executions.
18472
18473 22.n
18474 Most accessibility checking is done at compile time; the rules
18475 are stated in terms of "statically deeper than". The
18476 exceptions are:
18477
18478 22.o/2
18479 * Checks involving access parameters of an access-to-object
18480 type. The fact that "statically deeper than" is not
18481 defined for the anonymous access type of an access
18482 parameter implies that any rule saying "shall not be
18483 statically deeper than" does not apply to such a type,
18484 nor to anything defined to have "the same" level as such
18485 a type.
18486
18487 22.o.1/3
18488 * {AI05-0082-1AI05-0082-1} Checks involving generic formal
18489 types and their descendants. This is because the actual
18490 type can be more or less deeply nested than the generic
18491 unit. Note that this only applies to the generic unit
18492 itself, and not to the instance. Any static checks
18493 needed in the instance will be performed. Any other
18494 checks (such as those in the generic body) will require a
18495 run-time check of some sort (although implementations
18496 that macro-expand generics can determine the result of
18497 the check when the generic is expanded).
18498
18499 22.p/3
18500 * {AI05-0082-1AI05-0082-1} Checks involving other entities
18501 and views within generic packages. This is because an
18502 instantiation can be at a level that is more deeply
18503 nested than the generic package itself. In
18504 implementations that use a macro-expansion model of
18505 generics, these violations can be detected at
18506 macro-expansion time. For implementations that share
18507 generics, run-time code is needed to detect the error.
18508
18509 22.q/2
18510 * {AI95-00318-02AI95-00318-02} {AI95-00344-01AI95-00344-01}
18511 {AI95-00416-01AI95-00416-01} Checks during function
18512 return and allocators, for nested type extensions and
18513 access discriminants.
18514
18515 22.r/3
18516 {AI05-0005-1AI05-0005-1} Note that run-time checks are not
18517 required for access discriminants (except during function
18518 returns and allocators), because their accessibility is
18519 determined statically by the accessibility level of the
18520 enclosing object.
18521
18522 22.s/2
18523 The accessibility level of the result object of a function
18524 reflects the time when that object will be finalized; we don't
18525 allow pointers to the object to survive beyond that time.
18526
18527 22.t
18528 We sometimes use the terms "accessible" and "inaccessible" to
18529 mean that something has an accessibility level that is not
18530 deeper, or deeper, respectively, than something else.
18531
18532 22.u/2
18533 Implementation Note: {AI95-00318-02AI95-00318-02}
18534 {AI95-00344-01AI95-00344-01} {AI95-00416-01AI95-00416-01} If
18535 an accessibility Legality Rule is satisfied, then the
18536 corresponding run-time check (if any) cannot fail (and a
18537 reasonable implementation will not generate any checking code)
18538 unless one of the cases requiring run-time checks mentioned
18539 previously is involved.
18540
18541 22.v
18542 Accessibility levels are defined in terms of the relations
18543 "the same as" and "deeper than". To make the discussion more
18544 concrete, we can assign actual numbers to each level. Here,
18545 we assume that library-level accessibility is level 0, and
18546 each level defined as "deeper than" is one level deeper.
18547 Thus, a subprogram directly called from the environment task
18548 (such as the main subprogram) would be at level 1, and so on.
18549
18550 22.w/2
18551 Accessibility is not enforced at compile time for access
18552 parameters of an access-to-object type. The "obvious"
18553 implementation of the run-time checks would be inefficient,
18554 and would involve distributed overhead; therefore, an
18555 efficient method is given below. The "obvious" implementation
18556 would be to pass the level of the caller at each subprogram
18557 call, task creation, etc. This level would be incremented by
18558 1 for each dynamically nested master. An Accessibility_Check
18559 would be implemented as a simple comparison -- checking that X
18560 is not deeper than Y would involve checking that X <= Y.
18561
18562 22.x
18563 A more efficient method is based on passing static nesting
18564 levels (within constructs that correspond at run time to
18565 masters -- packages don't count). Whenever an access
18566 parameter is passed, an implicit extra parameter is passed
18567 with it. The extra parameter represents (in an indirect way)
18568 the accessibility level of the anonymous access type, and,
18569 therefore, the level of the view denoted by a dereference of
18570 the access parameter. This is analogous to the implicit
18571 "Constrained" bit associated with certain formal parameters of
18572 an unconstrained but definite composite subtype. In this
18573 method, we avoid distributed overhead: it is not necessary to
18574 pass any extra information to subprograms that have no access
18575 parameters. For anything other than an access parameter and
18576 its anonymous type, the static nesting level is known at
18577 compile time, and is defined analogously to the RM95
18578 definition of accessibility level (e.g. derived access types
18579 get their nesting level from their parent). Checking "not
18580 deeper than" is a "<=" test on the levels.
18581
18582 22.y/2
18583 For each access parameter of an access-to-object type, the
18584 static depth passed depends on the actual, as follows:
18585
18586 22.z
18587 * If the actual is an expression of a named access type,
18588 pass the static nesting level of that type.
18589
18590 22.aa
18591 * If the actual is an allocator, pass the static nesting
18592 level of the caller, plus one.
18593
18594 22.bb/1
18595 * If the actual is a reference to the Access attribute,
18596 pass the level of the view denoted by the prefix.
18597
18598 22.cc
18599 * If the actual is a reference to the Unchecked_Access
18600 attribute, pass 0 (the library accessibility level).
18601
18602 22.dd/2
18603 * If the actual is an access parameter of an
18604 access-to-object type, usually just pass along the level
18605 passed in. However, if the static nesting level of the
18606 formal (access) parameter is greater than the static
18607 nesting level of the actual (access) parameter, the level
18608 to be passed is the minimum of the static nesting level
18609 of the access parameter and the actual level passed in.
18610
18611 22.ee/2
18612 For the Accessibility_Check associated with a type_conversion
18613 of an access parameter of an access-to-object type of a given
18614 subprogram to a named access type, if the target type is
18615 statically nested within the subprogram, do nothing; the check
18616 can't fail in this case. Otherwise, check that the value
18617 passed in is <= the static nesting depth of the target type.
18618 The other Accessibility_Checks are handled in a similar
18619 manner.
18620
18621 22.ff
18622 This method, using statically known values most of the time,
18623 is efficient, and, more importantly, avoids distributed
18624 overhead.
18625
18626 22.ff.1/3
18627 {AI05-0148-1AI05-0148-1} The implementation of accessibility
18628 checks for stand-alone objects of anonymous access-to-object
18629 types can be similar to that for anonymous access-to-object
18630 parameters. A static level suffices; it can be calculated
18631 using rules similar to those previously described for access
18632 parameters.
18633
18634 22.ff.2/3
18635 {AI05-0148-1AI05-0148-1} One important difference between the
18636 stand-alone access variables and access parameters is that one
18637 can assign a local access parameter to a more global
18638 stand-alone access variable. Similarly, one can assign a more
18639 global access parameter to a more local stand-alone access
18640 variable.
18641
18642 22.ff.3/3
18643 {AI05-0148-1AI05-0148-1} For these cases, it is important to
18644 note that the "correct" static accessibility level for an
18645 access parameter assigned to a stand-alone access object is
18646 the minimum of the passed in level and the static
18647 accessibility level of the stand-alone object itself. This is
18648 true since the static accessibility level passed in might be
18649 deeper than that of the stand-alone object, but the dynamic
18650 accessibility of the passed in object clearly must be
18651 shallower than the stand-alone object (whatever is passed in
18652 must live at least as long as the subprogram call). We do not
18653 need to keep a more local static level as accesses to objects
18654 statically deeper than the stand-alone object cannot be stored
18655 into the stand-alone object.
18656
18657 22.gg
18658 Discussion: Examples of accessibility:
18659
18660 22.hh/3
18661 {AI05-0005-1AI05-0005-1} package body Lib_Unit is
18662 type T is tagged ...;
18663 type A0 is access all T;
18664 Global: A0 := ...;
18665 procedure P(X: in out T) is
18666 Y: aliased T;
18667 type A1 is access all T;
18668 Ptr0: A0 := Global; -- OK.
18669 Ptr1: A1 := X'Access; -- OK.
18670 begin
18671 Ptr1 := Y'Access; -- OK;
18672 Ptr0 := A0(Ptr1); -- Illegal type conversion!
18673 Ptr0 := X'Access; -- Illegal reference to Access attribute!
18674 Ptr0 := Y'Access; -- Illegal reference to Access attribute!
18675 Global := Ptr0; -- OK.
18676 end P;
18677 end Lib_Unit;
18678
18679 22.ii/3
18680 {AI05-0005-1AI05-0005-1} The above illegal statements are
18681 illegal because the accessibility levels of X and Y are
18682 statically deeper than the accessibility level of A0. In
18683 every possible execution of any program including this library
18684 unit, if P is called, the accessibility level of X will be
18685 (dynamically) deeper than that of A0. Note that the
18686 accessibility levels of X and Y are the same.
18687
18688 22.jj/2
18689 Here's an example involving access parameters of an
18690 access-to-object type:
18691
18692 22.kk
18693 procedure Main is
18694 type Level_1_Type is access all Integer;
18695
18696 22.ll
18697 procedure P(X: access Integer) is
18698 type Nested_Type is access all Integer;
18699 begin
18700 ... Nested_Type(X) ... -- (1)
18701 ... Level_1_Type(X) ... -- (2)
18702 end P;
18703
18704 22.mm
18705 procedure Q(X: access Integer) is
18706 procedure Nested(X: access Integer) is
18707 begin
18708 P(X);
18709 end Nested;
18710 begin
18711 Nested(X);
18712 end Q;
18713
18714 22.nn
18715 procedure R is
18716 Level_2: aliased Integer;
18717 begin
18718 Q(Level_2'Access); -- (3)
18719 end R;
18720
18721 22.oo
18722 Level_1: aliased Integer;
18723 begin
18724 Q(Level_1'Access); -- (4)
18725 R;
18726 end Main;
18727
18728 22.pp
18729 The run-time Accessibility_Check at (1) can never fail, and no
18730 code should be generated to check it. The check at (2) will
18731 fail when called from (3), but not when called from (4).
18732
18733 22.qq
18734 Within a type_declaration, the rules are checked in an
18735 assume-the-worst manner. For example:
18736
18737 22.rr/3
18738 {AI05-0298-1AI05-0298-1} package P is
18739 type Int_Ptr is access all Integer;
18740 type Rec(D: access Integer) is limited private;
18741 private
18742 type Rec_Ptr is access all Rec;
18743 function F(X: Rec_Ptr) return Boolean;
18744 function G(X: access Rec) return Boolean;
18745 type Rec(D: access Integer) is
18746 limited record
18747 C1: Int_Ptr := Int_Ptr(D); -- Illegal!
18748 C2: Rec_Ptr := Rec'Access; -- Illegal!
18749 C3: Boolean := F(Rec'Access); -- Illegal!
18750 C4: Boolean := G(Rec'Access);
18751 end record;
18752 end P;
18753
18754 22.ss
18755 C1, C2, and C3 are all illegal, because one might declare an
18756 object of type Rec at a more deeply nested place than the
18757 declaration of the type. C4 is legal, but the accessibility
18758 level of the object will be passed to function G, and
18759 constraint checks within G will prevent it from doing any evil
18760 deeds.
18761
18762 22.tt
18763 Note that we cannot defer the checks on C1, C2, and C3 until
18764 compile-time of the object creation, because that would cause
18765 violation of the privacy of private parts. Furthermore, the
18766 problems might occur within a task or protected body, which
18767 the compiler can't see while compiling an object creation.
18768
18769 23
18770 The following attribute is defined for a prefix X that denotes an
18771 aliased view of an object:
18772
18773 24/1
18774 X'Access
18775 {8652/00108652/0010} {AI95-00127-01AI95-00127-01}
18776 X'Access yields an access value that designates the
18777 object denoted by X. The type of X'Access is an
18778 access-to-object type, as determined by the expected
18779 type. The expected type shall be a general access type.
18780 X shall denote an aliased view of an object[, including
18781 possibly the current instance (see *note 8.6::) of a
18782 limited type within its definition, or a formal parameter
18783 or generic formal object of a tagged type]. The view
18784 denoted by the prefix X shall satisfy the following
18785 additional requirements, presuming the expected type for
18786 X'Access is the general access type A with designated
18787 type D:
18788
18789 25
18790 * If A is an access-to-variable type, then the view
18791 shall be a variable; [on the other hand, if A is an
18792 access-to-constant type, the view may be either a
18793 constant or a variable.]
18794
18795 25.a
18796 Discussion: The current instance of a limited type is
18797 considered a variable.
18798
18799 26/3
18800 * {AI95-00363-01AI95-00363-01}
18801 {AI05-0008-1AI05-0008-1} {AI05-0041-1AI05-0041-1}
18802 The view shall not be a subcomponent that depends on
18803 discriminants of an object unless the object is
18804 known to be constrained.
18805
18806 26.a
18807 Discussion: This restriction is intended to be similar to the
18808 restriction on renaming discriminant-dependent subcomponents.
18809
18810 26.b
18811 Reason: This prevents references to subcomponents that might
18812 disappear or move or change constraints after creating the
18813 reference.
18814
18815 26.c
18816 Implementation Note: There was some thought to making this
18817 restriction more stringent, roughly: "X shall not denote a
18818 subcomponent of a variable with discriminant-dependent
18819 subcomponents, if the nominal subtype of the variable is an
18820 unconstrained definite subtype." This was because in some
18821 implementations, it is not just the discriminant-dependent
18822 subcomponents that might move as the result of an assignment
18823 that changed the discriminants of the enclosing object.
18824 However, it was decided not to make this change because a
18825 reasonable implementation strategy was identified to avoid
18826 such problems, as follows:
18827
18828 26.d
18829 * Place non-discriminant-dependent components with any
18830 aliased parts at offsets preceding any
18831 discriminant-dependent components in a discriminated
18832 record type with defaulted discriminants.
18833
18834 26.e
18835 * Preallocate the maximum space for unconstrained
18836 discriminated variables with aliased subcomponents,
18837 rather than allocating the initial size and moving them
18838 to a larger (heap-resident) place if they grow as the
18839 result of an assignment.
18840
18841 26.f
18842 Note that for objects of a by-reference type, it is not an
18843 error for a programmer to take advantage of the fact that such
18844 objects are passed by reference. Therefore, the above
18845 approach is also necessary for discriminated record types with
18846 components of a by-reference type.
18847
18848 26.g
18849 To make the above strategy work, it is important that a
18850 component of a derived type is defined to be
18851 discriminant-dependent if it is inherited and the parent
18852 subtype constraint is defined in terms of a discriminant of
18853 the derived type (see *note 3.7::).
18854
18855 27/2
18856 * {8652/00108652/0010} {AI95-00127-01AI95-00127-01}
18857 {AI95-00363-01AI95-00363-01} If A is a named access
18858 type and D is a tagged type, then the type of the
18859 view shall be covered by D; if A is anonymous and D
18860 is tagged, then the type of the view shall be either
18861 D'Class or a type covered by D; if D is untagged,
18862 then the type of the view shall be D, and either:
18863
18864 27.1/2
18865 * {AI95-00363-01AI95-00363-01} the
18866 designated subtype of A shall statically
18867 match the nominal subtype of the view; or
18868
18869 27.2/3
18870 * {AI95-00363-01AI95-00363-01}
18871 {AI05-0041-1AI05-0041-1} D shall be
18872 discriminated in its full view and
18873 unconstrained in any partial view, and the
18874 designated subtype of A shall be
18875 unconstrained. For the purposes of
18876 determining within a generic body whether
18877 D is unconstrained in any partial view, a
18878 discriminated subtype is considered to
18879 have a constrained partial view if it is a
18880 descendant of an untagged generic formal
18881 private or derived type.
18882
18883 27.a
18884 Implementation Note: This ensures that the dope for an aliased
18885 array object can always be stored contiguous with it, but need
18886 not be if its nominal subtype is constrained.
18887
18888 27.a.1/1
18889 Ramification: {8652/00108652/0010}
18890 {AI95-00127-01AI95-00127-01} An access attribute can be used
18891 as the controlling operand in a dispatching call; see *note
18892 3.9.2::.
18893
18894 27.a.2/2
18895 {AI95-00363-01AI95-00363-01} This does not require that types
18896 have a partial view in order to allow an access attribute of
18897 an unconstrained discriminated object, only that any partial
18898 view that does exist is unconstrained.
18899
18900 28/3
18901 * {AI05-0041-1AI05-0041-1} The accessibility level of
18902 the view shall not be statically deeper than that of
18903 the access type A.
18904
18905 28.a
18906 Ramification: In an instance body, a run-time check applies.
18907
18908 28.b/2
18909 {AI95-00230-01AI95-00230-01} If A is an anonymous
18910 access-to-object type of an access parameter, then the view
18911 can never have a deeper accessibility level than A. The same
18912 is true for an anonymous access-to-object type of an access
18913 discriminant, except when X'Access is used to initialize an
18914 access discriminant of an object created by an allocator. The
18915 latter case is illegal if the accessibility level of X is
18916 statically deeper than that of the access type of the
18917 allocator; a run-time check is needed in the case where the
18918 initial value comes from an access parameter. Other anonymous
18919 access-to-object types have "normal" accessibility checks.
18920
18921 28.1/3
18922 {AI05-0041-1AI05-0041-1} In addition to the places where
18923 Legality Rules normally apply (see *note 12.3::), these
18924 requirements apply also in the private part of an
18925 instance of a generic unit.
18926
18927 29
18928 A check is made that the accessibility level of X is not
18929 deeper than that of the access type A. If this check
18930 fails, Program_Error is raised.
18931
18932 29.a/2
18933 Ramification: The check is needed for access parameters of an
18934 access-to-object type and in instance bodies.
18935
18936 29.a.1/3
18937 {AI05-0024-1AI05-0024-1} Because there are no access
18938 parameters permitted for task entries, the accessibility
18939 levels are always comparable. We would have to switch to the
18940 terminology used in *note 4.8:: and *note 6.5:: based on
18941 inclusion within masters if we relax this restriction. That
18942 might introduce unacceptable distributed overhead.
18943
18944 29.b/3
18945 Implementation Note: {AI05-0148-1AI05-0148-1} This check
18946 requires that some indication of lifetime is passed as an
18947 implicit parameter along with access parameters of an
18948 access-to-object type. A similar indication is required for
18949 stand-alone objects of anonymous access-to-object types.No
18950 such requirement applies to other anonymous access types,
18951 since the checks associated with them are all compile-time
18952 checks.
18953
18954 30
18955 If the nominal subtype of X does not statically match the
18956 designated subtype of A, a view conversion of X to the
18957 designated subtype is evaluated (which might raise
18958 Constraint_Error -- see *note 4.6::) and the value of
18959 X'Access designates that view.
18960
18961 31
18962 The following attribute is defined for a prefix P that denotes a
18963 subprogram:
18964
18965 32/3
18966 P'Access
18967 {AI95-00229-01AI95-00229-01} {AI95-00254-01AI95-00254-01}
18968 {AI05-0239-1AI05-0239-1} P'Access yields an access value
18969 that designates the subprogram denoted by P. The type of
18970 P'Access is an access-to-subprogram type (S), as
18971 determined by the expected type. The accessibility level
18972 of P shall not be statically deeper than that of S. In
18973 addition to the places where Legality Rules normally
18974 apply (see *note 12.3::), this rule applies also in the
18975 private part of an instance of a generic unit. The
18976 profile of P shall be subtype conformant with the
18977 designated profile of S, and shall not be Intrinsic. If
18978 the subprogram denoted by P is declared within a generic
18979 unit, and the expression P'Access occurs within the body
18980 of that generic unit or within the body of a generic unit
18981 declared within the declarative region of the generic
18982 unit, then the ultimate ancestor of S shall be either a
18983 nonformal type declared within the generic unit or an
18984 anonymous access type of an access parameter.
18985
18986 32.a/2
18987 Discussion: {AI95-00229-01AI95-00229-01} The part about
18988 generic bodies is worded in terms of the denoted subprogram,
18989 not the denoted view; this implies that renaming is invisible
18990 to this part of the rule. "Declared within the declarative
18991 region of the generic" is referring to child and nested
18992 generic units.This rule is partly to prevent contract model
18993 problems with respect to the accessibility rules, and partly
18994 to ease shared-generic-body implementations, in which a
18995 subprogram declared in an instance needs to have a different
18996 calling convention from other subprograms with the same
18997 profile.
18998
18999 32.b
19000 Overload resolution ensures only that the profile is type
19001 conformant. This rule specifies that subtype conformance is
19002 required (which also requires matching calling conventions).
19003 P cannot denote an entry because access-to-subprogram types
19004 never have the entry calling convention. P cannot denote an
19005 enumeration literal or an attribute function because these
19006 have intrinsic calling conventions.
19007
19008 _Legality Rules_
19009
19010 32.1/3
19011 {AI05-0188-1AI05-0188-1} An expression is said to have distributed
19012 accessibility if it is
19013
19014 32.2/3
19015 * a conditional_expression (see *note 4.5.7::); or
19016
19017 32.3/3
19018 * a view conversion, qualified_expression, or parenthesized
19019 expression whose operand has distributed accessibility.
19020
19021 32.4/3
19022 {AI05-0188-1AI05-0188-1} The statically deeper relationship does not
19023 apply to the accessibility level of an expression having distributed
19024 accessibility; that is, such an accessibility level is not considered to
19025 be statically deeper, nor statically shallower, than any other.
19026
19027 32.5/3
19028 {AI05-0188-1AI05-0188-1} Any static accessibility requirement that is
19029 imposed on an expression that has distributed accessibility (or on its
19030 type) is instead imposed on the dependent_expressions of the underlying
19031 conditional_expression. This rule is applied recursively if a
19032 dependent_expression also has distributed accessibility.
19033
19034 32.c/3
19035 Discussion: This means that any Legality Rule requiring that
19036 the accessibility level of an expression (or that of the type
19037 of an expression) shall or shall not be statically deeper than
19038 some other level also applies, in the case where the
19039 expression has distributed accessibility, to each
19040 dependent_expression of the underlying conditional_expression.
19041
19042 NOTES
19043
19044 33
19045 88 The Unchecked_Access attribute yields the same result as the
19046 Access attribute for objects, but has fewer restrictions (see *note
19047 13.10::). There are other predefined operations that yield access
19048 values: an allocator can be used to create an object, and return an
19049 access value that designates it (see *note 4.8::); evaluating the
19050 literal null yields a null access value that designates no entity
19051 at all (see *note 4.2::).
19052
19053 34/2
19054 89 {AI95-00230-01AI95-00230-01} The predefined operations of an
19055 access type also include the assignment operation, qualification,
19056 and membership tests. Explicit conversion is allowed between
19057 general access types with matching designated subtypes; explicit
19058 conversion is allowed between access-to-subprogram types with
19059 subtype conformant profiles (see *note 4.6::). Named access types
19060 have predefined equality operators; anonymous access types do not,
19061 but they can use the predefined equality operators for
19062 universal_access (see *note 4.5.2::).
19063
19064 34.a/2
19065 Reason: {AI95-00230-01AI95-00230-01} Anonymous access types
19066 can use the universal access equality operators declared in
19067 Standard, while named access types cannot for compatibility
19068 reasons. By not having equality operators for anonymous
19069 access types, we eliminate the need to specify exactly where
19070 the predefined operators for anonymous access types would be
19071 defined, as well as the need for an implementer to insert an
19072 implicit declaration for "=", etc. at the appropriate place
19073 in their symbol table. Note that ":=", 'Access, and ".all"
19074 are defined.
19075
19076 35
19077 90 The object or subprogram designated by an access value can be
19078 named with a dereference, either an explicit_dereference (*note
19079 4.1: S0094.) or an implicit_dereference. See *note 4.1::.
19080
19081 36
19082 91 A call through the dereference of an access-to-subprogram value
19083 is never a dispatching call.
19084
19085 36.a
19086 Proof: See *note 3.9.2::.
19087
19088 37/2
19089 92 {AI95-00254-01AI95-00254-01} The Access attribute for
19090 subprograms and parameters of an anonymous access-to-subprogram
19091 type may together be used to implement "downward closures" -- that
19092 is, to pass a more-nested subprogram as a parameter to a
19093 less-nested subprogram, as might be appropriate for an iterator
19094 abstraction or numerical integration. Downward closures can also
19095 be implemented using generic formal subprograms (see *note 12.6::).
19096 Note that Unchecked_Access is not allowed for subprograms.
19097
19098 38
19099 93 Note that using an access-to-class-wide tagged type with a
19100 dispatching operation is a potentially more structured alternative
19101 to using an access-to-subprogram type.
19102
19103 39
19104 94 An implementation may consider two access-to-subprogram values
19105 to be unequal, even though they designate the same subprogram.
19106 This might be because one points directly to the subprogram, while
19107 the other points to a special prologue that performs an
19108 Elaboration_Check and then jumps to the subprogram. See *note
19109 4.5.2::.
19110
19111 39.a
19112 Ramification: If equality of access-to-subprogram values is
19113 important to the logic of a program, a reference to the Access
19114 attribute of a subprogram should be evaluated only once and
19115 stored in a global constant for subsequent use and equality
19116 comparison.
19117
19118 _Examples_
19119
19120 40
19121 Example of use of the Access attribute:
19122
19123 41
19124 Martha : Person_Name := new Person(F); -- see *note 3.10.1::
19125 Cars : array (1..2) of aliased Car;
19126 ...
19127 Martha.Vehicle := Cars(1)'Access;
19128 George.Vehicle := Cars(2)'Access;
19129
19130 _Extensions to Ada 83_
19131
19132 41.a
19133 We no longer make things like 'Last and ".component" (basic)
19134 operations of an access type that need to be "declared"
19135 somewhere. Instead, implicit dereference in a prefix takes
19136 care of them all. This means that there should never be a
19137 case when X.all'Last is legal while X'Last is not. See
19138 AI83-00154.
19139
19140 _Incompatibilities With Ada 95_
19141
19142 41.b/2
19143 {AI95-00363-01AI95-00363-01} Aliased variables are not
19144 necessarily constrained in Ada 2005 (see *note 3.6::).
19145 Therefore, a subcomponent of an aliased variable may disappear
19146 or change shape, and taking 'Access of such a subcomponent
19147 thus is illegal, while the same operation would have been
19148 legal in Ada 95. Note that most allocated objects are still
19149 constrained by their initial value (see *note 4.8::), and thus
19150 legality of 'Access didn't change for them. For example:
19151
19152 41.c/2
19153 type T1 (D1 : Boolean := False) is
19154 record
19155 case D1 is
19156 when False =>
19157 C1 : aliased Integer;
19158 when True =>
19159 null;
19160 end case;
19161 end record;
19162 type Acc_Int is access all Integer;
19163
19164 41.d/2
19165 A_T : aliased T1;
19166 Ptr : Acc_Int := A_T.C1'Access; -- Illegal in Ada 2005, legal in Ada 95
19167 A_T := (D1 => True); -- Raised Constraint_Error in Ada 95, but does not
19168 -- in Ada 2005, so Ptr would become invalid when this
19169 -- is assigned (thus Ptr is illegal).
19170
19171 41.e/2
19172 {AI95-00363-01AI95-00363-01} If a discriminated full type has
19173 a partial view (private type) that is constrained, we do not
19174 allow 'Access on objects to create a value of an object of an
19175 access-to-unconstrained type. Ada 95 allowed this attribute
19176 and various access subtypes, requiring that the heap object be
19177 constrained and thus making details of the implementation of
19178 the private type visible to the client of the private type.
19179 See *note 4.8:: for more on this topic.
19180
19181 41.f/2
19182 {AI95-00229-01AI95-00229-01} {AI95-00254-01AI95-00254-01}
19183 Amendment Correction: Taking 'Access of a subprogram declared
19184 in a generic unit in the body of that generic is no longer
19185 allowed. Such references can easily be used to create
19186 dangling pointers, as Legality Rules are not rechecked in
19187 instance bodies. At the same time, the rules were loosened a
19188 bit where that is harmless, and also to allow any routine to
19189 be passed to an access parameter of an access-to-subprogram
19190 type. The now illegal uses of 'Access can almost always be
19191 moved to the private part of the generic unit, where they are
19192 still legal (and rechecked upon instantiation for possibly
19193 dangling pointers).
19194
19195 _Extensions to Ada 95_
19196
19197 41.g/2
19198 {8652/00108652/0010} {AI95-00127-01AI95-00127-01} Corrigendum:
19199 Access attributes of objects of class-wide types can be used
19200 as the controlling parameter in a dispatching calls (see *note
19201 3.9.2::). This was an oversight in Ada 95.
19202
19203 41.h/2
19204 {AI95-00235-01AI95-00235-01} Amendment Correction: The type of
19205 the prefix can now be used in resolving Access attributes.
19206 This allows more uses of the Access attribute to resolve. For
19207 example:
19208
19209 41.i/2
19210 type Int_Ptr is access all Integer;
19211 type Float_Ptr is access all Float;
19212
19213 41.j/2
19214 function Zap (Val : Int_Ptr) return Float;
19215 function Zap (Val : Float_Ptr) return Float;
19216
19217 41.k/2
19218 Value : aliased Integer := 10;
19219
19220 41.l/2
19221 Result1 : Float := Zap (Value'access); -- Ambiguous in Ada 95; resolves in Ada 2005.
19222 Result2 : Float := Zap (Int_Ptr'(Value'access)); -- Resolves in Ada 95 and Ada 2005.
19223
19224 41.m/2
19225 This change is upward compatible; any expression that does not
19226 resolve by the new rules would have failed a Legality Rule.
19227
19228 _Wording Changes from Ada 95_
19229
19230 41.n/2
19231 {AI95-00162-01AI95-00162-01} Adjusted the wording to reflect
19232 the fact that expressions and function calls are masters.
19233
19234 41.o/2
19235 {AI95-00230-01AI95-00230-01} {AI95-00254-01AI95-00254-01}
19236 {AI95-00318-02AI95-00318-02} {AI95-00385-01AI95-00385-01}
19237 {AI95-00416-01AI95-00416-01} Defined the accessibility of the
19238 various new kinds and uses of anonymous access types.
19239
19240 _Incompatibilities With Ada 2005_
19241
19242 41.p/3
19243 {AI05-0008-1AI05-0008-1} Correction: Simplified the
19244 description of when a discriminant-dependent component is
19245 allowed as the prefix of 'Access to when the object is known
19246 to be constrained. This fixes a confusion as to whether a
19247 subcomponent of an object that is not certain to be
19248 constrained can be used as a prefix of 'Access. The fix
19249 introduces an incompatibility, as the rule did not apply in
19250 Ada 95 if the prefix was a constant; but it now applies no
19251 matter what kind of object is involved. The incompatibility
19252 is not too bad, since most kinds of constants are known to be
19253 constrained.
19254
19255 41.q/3
19256 {AI05-0041-1AI05-0041-1} Correction: Corrected the checks for
19257 the constrainedness of the prefix of the Access attribute so
19258 that assume-the-worst is used in generic bodies. This may
19259 make some programs illegal, but those programs were at risk
19260 having objects disappear while valid access values still
19261 pointed at them.
19262
19263 _Extensions to Ada 2005_
19264
19265 41.r/3
19266 {AI05-0082-1AI05-0082-1} Correction: Eliminated the static
19267 accessibility definition for generic formal types, as the
19268 actual can be more or less nested than the generic itself.
19269 This allows programs that were illegal for Ada 95 and for Ada
19270 2005.
19271
19272 41.s/3
19273 {AI05-0148-1AI05-0148-1} {AI05-0253-1AI05-0253-1} Eliminate
19274 the static accessibility definition for stand-alone objects of
19275 anonymous access-to-object types. This allows such objects to
19276 be used as temporaries without causing accessibility problems.
19277
19278 _Wording Changes from Ada 2005_
19279
19280 41.t/3
19281 {AI05-0014-1AI05-0014-1} Correction: Corrected the rules so
19282 that the accessibility of the object designated by an access
19283 object is that of the access type, even when no dereference is
19284 given. The accessibility was not specified in the past. This
19285 correction applies to both Ada 95 and Ada 2005.
19286
19287 41.u/3
19288 {AI05-0024-1AI05-0024-1} Correction: Corrected accessibility
19289 rules for access discriminants so that no cases are omitted.
19290
19291 41.v/3
19292 {AI05-0051-1AI05-0051-1} {AI05-0234-1AI05-0234-1}
19293 {AI05-0235-1AI05-0235-1} {AI05-0284-1AI05-0284-1} Correction:
19294 Corrected accessibility rules for anonymous access return
19295 types and access discriminants in return statements.
19296
19297 41.w/3
19298 {AI05-0066-1AI05-0066-1} Correction: Changed coextension rules
19299 so that coextensions that belong to an anonymous object are
19300 transfered to the ultimate object.
19301
19302 41.x/3
19303 {AI05-0142-4AI05-0142-4} {AI05-0188-1AI05-0188-1}
19304 {AI05-0235-1AI05-0235-1} Defined the accessibility of
19305 explicitly aliased parameters (see *note 6.1::) and
19306 conditional_expressions (see *note 4.5.7::).
19307
19308 41.y/3
19309 {AI05-0234-1AI05-0234-1} Correction: Defined the term "master
19310 of the call" to simplify other wording, especially that for
19311 the accessibility checks associated with return statements and
19312 explicitly aliased parameters.
19313
19314 41.z/3
19315 {AI05-0270-1AI05-0270-1} Correction: Defined the (omitted)
19316 accessibility level of null values when those are passed as
19317 the actual of an access-to-object parameter.
19318
19319 \1f
19320 File: aarm2012.info, Node: 3.11, Prev: 3.10, Up: 3
19321
19322 3.11 Declarative Parts
19323 ======================
19324
19325 1
19326 [A declarative_part contains declarative_items (possibly none).]
19327
19328 _Syntax_
19329
19330 2
19331 declarative_part ::= {declarative_item}
19332
19333 3
19334 declarative_item ::=
19335 basic_declarative_item | body
19336
19337 4/1
19338 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
19339 basic_declarative_item ::=
19340 basic_declaration | aspect_clause | use_clause
19341
19342 5
19343 body ::= proper_body | body_stub
19344
19345 6
19346 proper_body ::=
19347 subprogram_body | package_body | task_body | protected_body
19348
19349 _Static Semantics_
19350
19351 6.1/2
19352 {AI95-00420-01AI95-00420-01} The list of declarative_items of a
19353 declarative_part is called the declaration list of the declarative_part.
19354
19355 _Dynamic Semantics_
19356
19357 7
19358 The elaboration of a declarative_part consists of the elaboration of the
19359 declarative_items, if any, in the order in which they are given in the
19360 declarative_part.
19361
19362 8
19363 An elaborable construct is in the elaborated state after the normal
19364 completion of its elaboration. Prior to that, it is not yet elaborated.
19365
19366 8.a
19367 Ramification: The elaborated state is only important for
19368 bodies; certain uses of a body raise an exception if the body
19369 is not yet elaborated.
19370
19371 8.b
19372 Note that "prior" implies before the start of elaboration, as
19373 well as during elaboration.
19374
19375 8.c
19376 The use of the term "normal completion" implies that if the
19377 elaboration propagates an exception or is aborted, the
19378 declaration is not elaborated. RM83 missed the aborted case.
19379
19380 9
19381 For a construct that attempts to use a body, a check (Elaboration_Check)
19382 is performed, as follows:
19383
19384 10/1
19385 * {8652/00148652/0014} {AI95-00064-01AI95-00064-01} For a call to a
19386 (non-protected) subprogram that has an explicit body, a check is
19387 made that the body is already elaborated. This check and the
19388 evaluations of any actual parameters of the call are done in an
19389 arbitrary order.
19390
19391 10.a
19392 Discussion: AI83-00180 specifies that there is no elaboration
19393 check for a subprogram defined by a pragma Interface (or
19394 equivalently, pragma Import). AI83-00430 specifies that there
19395 is no elaboration check for an enumeration literal.
19396 AI83-00406 specifies that the evaluation of parameters and the
19397 elaboration check occur in an arbitrary order. AI83-00406
19398 applies to generic instantiation as well (see below).
19399
19400 10.a.1/3
19401 {8652/00148652/0014} {AI95-00064-01AI95-00064-01}
19402 {AI05-0177-1AI05-0177-1} A subprogram can be completed by a
19403 renaming-as-body, a null_procedure_declaration, or an
19404 expression_function_declaration, and we need to make an
19405 elaboration check on such a body, so we use "body" rather than
19406 subprogram_body above.
19407
19408 11/3
19409 * {AI05-0229-1AI05-0229-1} For a call to a protected operation of a
19410 protected type (that has a body -- no check is performed if the
19411 protected type is imported -- see *note B.1::), a check is made
19412 that the protected_body is already elaborated. This check and the
19413 evaluations of any actual parameters of the call are done in an
19414 arbitrary order.
19415
19416 11.a
19417 Discussion: A protected type has only one elaboration "bit,"
19418 rather than one for each operation, because one call may
19419 result in evaluating the barriers of other entries, and
19420 because there are no elaborable declarations between the
19421 bodies of the operations. In fact, the elaboration of a
19422 protected_body does not elaborate the enclosed bodies, since
19423 they are not considered independently elaborable.
19424
19425 11.b
19426 Note that there is no elaboration check when calling a task
19427 entry. Task entry calls are permitted even before the
19428 associated task_body has been seen. Such calls are simply
19429 queued until the task is activated and reaches a corresponding
19430 accept_statement. We considered a similar rule for protected
19431 entries -- simply queuing all calls until the protected_body
19432 was seen, but felt it was not worth the possible
19433 implementation overhead, particularly given that there might
19434 be multiple instances of the protected type.
19435
19436 12
19437 * For the activation of a task, a check is made by the activator that
19438 the task_body is already elaborated. If two or more tasks are
19439 being activated together (see *note 9.2::), as the result of the
19440 elaboration of a declarative_part or the initialization for the
19441 object created by an allocator, this check is done for all of them
19442 before activating any of them.
19443
19444 12.a
19445 Reason: As specified by AI83-00149, the check is done by the
19446 activator, rather than by the task itself. If it were done by
19447 the task itself, it would be turned into a Tasking_Error in
19448 the activator, and the other tasks would still be activated.
19449
19450 13
19451 * For the instantiation of a generic unit that has a body, a check is
19452 made that this body is already elaborated. This check and the
19453 evaluation of any explicit_generic_actual_parameters of the
19454 instantiation are done in an arbitrary order.
19455
19456 14
19457 The exception Program_Error is raised if any of these checks fails.
19458
19459 _Extensions to Ada 83_
19460
19461 14.a/2
19462 {AI95-00114-01AI95-00114-01} The syntax for declarative_part
19463 is modified to remove the ordering restrictions of Ada 83;
19464 that is, the distinction between basic_declarative_items and
19465 later_declarative_items within declarative_parts is removed.
19466 This means that things like use_clauses and
19467 object_declarations can be freely intermixed with things like
19468 bodies.
19469
19470 14.b
19471 The syntax rule for proper_body now allows a protected_body,
19472 and the rules for elaboration checks now cover calls on
19473 protected operations.
19474
19475 _Wording Changes from Ada 83_
19476
19477 14.c
19478 The syntax rule for later_declarative_item is removed; the
19479 syntax rule for declarative_item is new.
19480
19481 14.d
19482 RM83 defines "elaborated" and "not yet elaborated" for
19483 declarative_items here, and for other things in *note 3.1::,
19484 "*note 3.1:: Declarations". That's no longer necessary, since
19485 these terms are fully defined in *note 3.1::.
19486
19487 14.e
19488 In RM83, all uses of declarative_part are optional (except for
19489 the one in block_statement with a declare) which is sort of
19490 strange, since a declarative_part can be empty, according to
19491 the syntax. That is, declarative_parts are sort of "doubly
19492 optional". In Ada 95, these declarative_parts are always
19493 required (but can still be empty). To simplify description,
19494 we go further and say (see *note 5.6::, "*note 5.6:: Block
19495 Statements") that a block_statement without an explicit
19496 declarative_part is equivalent to one with an empty one.
19497
19498 _Wording Changes from Ada 95_
19499
19500 14.f/2
19501 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
19502 Changed representation clauses to aspect clauses to reflect
19503 that they are used for more than just representation.
19504
19505 14.g/2
19506 {8652/00148652/0014} {AI95-00064-01AI95-00064-01} Corrigendum:
19507 Clarified that the elaboration check applies to all kinds of
19508 subprogram bodies.
19509
19510 14.h/2
19511 {AI95-00420-01AI95-00420-01} Defined "declaration list" to
19512 avoid confusion for various rules. Other kinds of declaration
19513 list are defined elsewhere.
19514
19515 * Menu:
19516
19517 * 3.11.1 :: Completions of Declarations
19518
19519 \1f
19520 File: aarm2012.info, Node: 3.11.1, Up: 3.11
19521
19522 3.11.1 Completions of Declarations
19523 ----------------------------------
19524
19525 1/3
19526 {8652/00148652/0014} {AI95-00064-01AI95-00064-01}
19527 {AI05-0177-1AI05-0177-1} Declarations sometimes come in two parts. A
19528 declaration that requires a second part is said to require completion.
19529 The second part is called the completion of the declaration (and of the
19530 entity declared), and is either another declaration, a body, or a
19531 pragma. A body is a body, an entry_body, a null_procedure_declaration
19532 or an expression_function_declaration that completes another
19533 declaration, or a renaming-as-body (see *note 8.5.4::).
19534
19535 1.a
19536 Discussion: Throughout the RM95, there are rules about
19537 completions that define the following:
19538
19539 1.b
19540 * Which declarations require a corresponding completion.
19541
19542 1.c
19543 * Which constructs can only serve as the completion of a
19544 declaration.
19545
19546 1.d
19547 * Where the completion of a declaration is allowed to be.
19548
19549 1.e
19550 * What kinds of completions are allowed to correspond to
19551 each kind of declaration that allows one.
19552
19553 1.f
19554 Don't confuse this compile-time concept with the run-time
19555 concept of completion defined in *note 7.6.1::.
19556
19557 1.g
19558 Note that the declaration of a private type (if limited) can
19559 be completed with the declaration of a task type, which is
19560 then completed with a body. Thus, a declaration can actually
19561 come in three parts.
19562
19563 1.h/3
19564 {AI95-00217-06AI95-00217-06} {AI05-0162-1AI05-0162-1} An
19565 incomplete type (whether declared in the limited view of a
19566 package or not) may be completed by a private type
19567 declaration, so we can in fact have four parts.
19568
19569 1.i/3
19570 {AI05-0229-1AI05-0229-1} In Ada 2012, there are no
19571 language-defined pragmas that act as completions. Pragma
19572 Import (which is obsolescent) has the effect of setting aspect
19573 Import to True; such an aspect makes giving a completion
19574 illegal. The wording that allows pragmas as completions was
19575 left as it is harmless and appears in many places in this
19576 Standard.
19577
19578 _Name Resolution Rules_
19579
19580 2
19581 A construct that can be a completion is interpreted as the completion of
19582 a prior declaration only if:
19583
19584 3
19585 * The declaration and the completion occur immediately within the
19586 same declarative region;
19587
19588 4
19589 * The defining name or defining_program_unit_name in the completion
19590 is the same as in the declaration, or in the case of a pragma, the
19591 pragma applies to the declaration;
19592
19593 5
19594 * If the declaration is overloadable, then the completion either has
19595 a type-conformant profile, or is a pragma.
19596
19597 _Legality Rules_
19598
19599 6/3
19600 {AI05-0229-1AI05-0229-1} An implicit declaration shall not have a
19601 completion. For any explicit declaration that is specified to require
19602 completion, there shall be a corresponding explicit completion, unless
19603 the declared entity is imported (see *note B.1::).
19604
19605 6.a.1/2
19606 To be honest: {AI95-00217-06AI95-00217-06} The implicit
19607 declarations occurring in a limited view do have a completion
19608 (the explicit declaration occurring in the full view) but
19609 that's a special case, since the implicit declarations are
19610 actually built from the explicit ones. So they do not require
19611 a completion, they have one by fiat.
19612
19613 6.a/3
19614 Discussion: {AI05-0299-1AI05-0299-1} The implicit declarations
19615 of predefined operators are not allowed to have a completion.
19616 Enumeration literals, although they are subprograms, are not
19617 allowed to have a corresponding subprogram_body. That's
19618 because the completion rules are described in terms of
19619 constructs (subprogram_declarations) and not entities
19620 (subprograms). When a completion is required, it has to be
19621 explicit; the implicit null package_body that Clause *note 7::
19622 talks about cannot serve as the completion of a
19623 package_declaration if a completion is required.
19624
19625 7
19626 At most one completion is allowed for a given declaration. Additional
19627 requirements on completions appear where each kind of completion is
19628 defined.
19629
19630 7.a
19631 Ramification: A subunit is not a completion; the stub is.
19632
19633 7.b
19634 If the completion of a declaration is also a declaration, then
19635 that declaration might have a completion, too. For example, a
19636 limited private type can be completed with a task type, which
19637 can then be completed with a task body. This is not a
19638 violation of the "at most one completion" rule.
19639
19640 8
19641 A type is completely defined at a place that is after its full type
19642 definition (if it has one) and after all of its subcomponent types are
19643 completely defined. A type shall be completely defined before it is
19644 frozen (see *note 13.14:: and *note 7.3::).
19645
19646 8.a
19647 Reason: Index types are always completely defined -- no need
19648 to mention them. There is no way for a completely defined
19649 type to depend on the value of a (still) deferred constant.
19650
19651 NOTES
19652
19653 9/3
19654 95 {AI05-0229-1AI05-0229-1} Completions are in principle allowed
19655 for any kind of explicit declaration. However, for some kinds of
19656 declaration, the only allowed completion is an
19657 implementation-defined pragma, and implementations are not required
19658 to have any such pragmas.
19659
19660 9.a/3
19661 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
19662
19663 10
19664 96 There are rules that prevent premature uses of declarations
19665 that have a corresponding completion. The Elaboration_Checks of
19666 *note 3.11:: prevent such uses at run time for subprograms,
19667 protected operations, tasks, and generic units. The rules of *note
19668 13.14::, "*note 13.14:: Freezing Rules" prevent, at compile time,
19669 premature uses of other entities such as private types and deferred
19670 constants.
19671
19672 _Wording Changes from Ada 83_
19673
19674 10.a
19675 This subclause is new. It is intended to cover all kinds of
19676 completions of declarations, be they a body for a spec, a full
19677 type for an incomplete or private type, a full constant
19678 declaration for a deferred constant declaration, or a pragma
19679 Import for any kind of entity.
19680
19681 _Wording Changes from Ada 95_
19682
19683 10.b/2
19684 {8652/00148652/0014} {AI95-00064-01AI95-00064-01} Corrigendum:
19685 Added a definition of body, which is different than body or
19686 body.
19687
19688 _Wording Changes from Ada 2005_
19689
19690 10.c/3
19691 {AI95-0177-1AI95-0177-1} Added null procedures and expression
19692 functions that are completions to the definition of body.
19693
19694 \1f
19695 File: aarm2012.info, Node: 4, Next: 5, Prev: 3, Up: Top
19696
19697 4 Names and Expressions
19698 ***********************
19699
19700 1/3
19701 {AI05-0299-1AI05-0299-1} [The rules applicable to the different forms of
19702 name and expression, and to their evaluation, are given in this clause.]
19703
19704 * Menu:
19705
19706 * 4.1 :: Names
19707 * 4.2 :: Literals
19708 * 4.3 :: Aggregates
19709 * 4.4 :: Expressions
19710 * 4.5 :: Operators and Expression Evaluation
19711 * 4.6 :: Type Conversions
19712 * 4.7 :: Qualified Expressions
19713 * 4.8 :: Allocators
19714 * 4.9 :: Static Expressions and Static Subtypes
19715
19716 \1f
19717 File: aarm2012.info, Node: 4.1, Next: 4.2, Up: 4
19718
19719 4.1 Names
19720 =========
19721
19722 1
19723 [Names can denote declared entities, whether declared explicitly or
19724 implicitly (see *note 3.1::). Names can also denote objects or
19725 subprograms designated by access values; the results of type_conversions
19726 or function_calls; subcomponents and slices of objects and values;
19727 protected subprograms, single entries, entry families, and entries in
19728 families of entries. Finally, names can denote attributes of any of the
19729 foregoing.]
19730
19731 _Syntax_
19732
19733 2/3
19734 {AI05-0003-1AI05-0003-1} {AI05-0139-2AI05-0139-2} name ::=
19735 direct_name | explicit_dereference
19736 | indexed_component | slice
19737 | selected_component | attribute_reference
19738 | type_conversion | function_call
19739 | character_literal | qualified_expression
19740 | generalized_reference | generalized_indexing
19741
19742 3
19743 direct_name ::= identifier | operator_symbol
19744
19745 3.a/2
19746 Discussion: {AI95-00114-01AI95-00114-01} character_literal is
19747 no longer a direct_name. character_literals are usable even
19748 when the corresponding enumeration type declaration is not
19749 visible. See *note 4.2::.
19750
19751 4
19752 prefix ::= name | implicit_dereference
19753
19754 5
19755 explicit_dereference ::= name.all
19756
19757 6
19758 implicit_dereference ::= name
19759
19760 7/3
19761 {AI05-0004-1AI05-0004-1} [Certain forms of name (indexed_components,
19762 selected_components, slices, and attribute_references) include a prefix
19763 that is either itself a name that denotes some related entity, or an
19764 implicit_dereference of an access value that designates some related
19765 entity.]
19766
19767 _Name Resolution Rules_
19768
19769 8
19770 The name in a dereference (either an implicit_dereference or an
19771 explicit_dereference) is expected to be of any access type.
19772
19773 _Static Semantics_
19774
19775 9/3
19776 {AI05-0008-1AI05-0008-1} If the type of the name in a dereference is
19777 some access-to-object type T, then the dereference denotes a view of an
19778 object, the nominal subtype of the view being the designated subtype of
19779 T. If the designated subtype has unconstrained discriminants, the
19780 (actual) subtype of the view is constrained by the values of the
19781 discriminants of the designated object, except when there is a partial
19782 view of the type of the designated subtype that does not have
19783 discriminants, in which case the dereference is not constrained by its
19784 discriminant values.
19785
19786 9.a
19787 Ramification: If the value of the name is the result of an
19788 access type conversion, the dereference denotes a view created
19789 as part of the conversion. The nominal subtype of the view is
19790 not necessarily the same as that used to create the designated
19791 object. See *note 4.6::.
19792
19793 9.b
19794 To be honest: We sometimes refer to the nominal subtype of a
19795 particular kind of name rather than the nominal subtype of the
19796 view denoted by the name (presuming the name denotes a view of
19797 an object). These two uses of nominal subtype are intended to
19798 mean the same thing.
19799
19800 9.c/3
19801 Reason: {AI05-0008-1AI05-0008-1} The last sentence was not
19802 present in Ada 95; it is necessary in Ada 2005 because general
19803 access types can designate unconstrained objects, which was
19804 not possible in Ada 95. Thus, the rules that had this effect
19805 in Ada 95 (the object being constrained by its initial value)
19806 don't work in Ada 2005 and we have to say this explicitly.
19807
19808 9.d/3
19809 {AI05-0008-1AI05-0008-1} The "except" part of the last
19810 sentence prevents privacy "breaking", so that if a private
19811 type has discriminants only in the full view, they don't
19812 interfere with freely interassigning values between objects of
19813 the type, even when the objects live in the heap.
19814
19815 9.e/3
19816 Implementation Note: {AI05-0008-1AI05-0008-1} Since we don't
19817 depend on whether the designated object is constrained, it is
19818 not necessary to include a constrained bit in every object
19819 that could be designated by a general access type.
19820
19821 10
19822 If the type of the name in a dereference is some access-to-subprogram
19823 type S, then the dereference denotes a view of a subprogram, the profile
19824 of the view being the designated profile of S.
19825
19826 10.a
19827 Ramification: This means that the formal parameter names and
19828 default expressions to be used in a call whose name or prefix
19829 is a dereference are those of the designated profile, which
19830 need not be the same as those of the subprogram designated by
19831 the access value, since 'Access requires only subtype
19832 conformance, not full conformance.
19833
19834 _Dynamic Semantics_
19835
19836 11/2
19837 {AI95-00415-01AI95-00415-01} The evaluation of a name determines the
19838 entity denoted by the name. This evaluation has no other effect for a
19839 name that is a direct_name or a character_literal.
19840
19841 12
19842 [The evaluation of a name that has a prefix includes the evaluation of
19843 the prefix.] The evaluation of a prefix consists of the evaluation of
19844 the name or the implicit_dereference. The prefix denotes the entity
19845 denoted by the name or the implicit_dereference.
19846
19847 13
19848 The evaluation of a dereference consists of the evaluation of the name
19849 and the determination of the object or subprogram that is designated by
19850 the value of the name. A check is made that the value of the name is
19851 not the null access value. Constraint_Error is raised if this check
19852 fails. The dereference denotes the object or subprogram designated by
19853 the value of the name.
19854
19855 _Examples_
19856
19857 14
19858 Examples of direct names:
19859
19860 15
19861 Pi -- the direct name of a number (see *note 3.3.2::)
19862 Limit -- the direct name of a constant (see *note 3.3.1::)
19863 Count -- the direct name of a scalar variable (see *note 3.3.1::)
19864 Board -- the direct name of an array variable (see *note 3.6.1::)
19865 Matrix -- the direct name of a type (see *note 3.6::)
19866 Random -- the direct name of a function (see *note 6.1::)
19867 Error -- the direct name of an exception (see *note 11.1::)
19868
19869 16
19870 Examples of dereferences:
19871
19872 17
19873 Next_Car.all -- explicit dereference denoting the object designated by
19874 -- the access variable Next_Car (see *note 3.10.1::)
19875 Next_Car.Owner -- selected component with implicit dereference;
19876 -- same as Next_Car.all.Owner
19877
19878 _Extensions to Ada 83_
19879
19880 17.a
19881 Type conversions and function calls are now considered names
19882 that denote the result of the operation. In the case of a
19883 type conversion used as an actual parameter or that is of a
19884 tagged type, the type conversion is considered a variable if
19885 the operand is a variable. This simplifies the description of
19886 "parameters of the form of a type conversion" as well as
19887 better supporting an important OOP paradigm that requires the
19888 combination of a conversion from a class-wide type to some
19889 specific type followed immediately by component selection.
19890 Function calls are considered names so that a type conversion
19891 of a function call and the function call itself are treated
19892 equivalently in the grammar. A function call is considered
19893 the name of a constant, and can be used anywhere such a name
19894 is permitted. See *note 6.5::.
19895
19896 17.b/1
19897 Type conversions of a tagged type are permitted anywhere their
19898 operand is permitted. That is, if the operand is a variable,
19899 then the type conversion can appear on the left-hand side of
19900 an assignment_statement. If the operand is an object, then
19901 the type conversion can appear in an object renaming or as a
19902 prefix. See *note 4.6::.
19903
19904 _Wording Changes from Ada 83_
19905
19906 17.c/2
19907 {AI95-00114-01AI95-00114-01} Everything of the general
19908 syntactic form name(...) is now syntactically a name. In any
19909 realistic parser, this would be a necessity since
19910 distinguishing among the various name(...) constructs
19911 inevitably requires name resolution. In cases where the
19912 construct yields a value rather than an object, the name
19913 denotes a value rather than an object. Names already denote
19914 values in Ada 83 with named numbers, components of the result
19915 of a function call, etc. This is partly just a wording
19916 change, and partly an extension of functionality (see
19917 Extensions heading above).
19918
19919 17.d
19920 The syntax rule for direct_name is new. It is used in places
19921 where direct visibility is required. It's kind of like Ada
19922 83's simple_name, but simple_name applied to both direct
19923 visibility and visibility by selection, and furthermore, it
19924 didn't work right for operator_symbols. The syntax rule for
19925 simple_name is removed, since its use is covered by a
19926 combination of direct_name and selector_name. The syntactic
19927 categories direct_name and selector_name are similar; it's
19928 mainly the visibility rules that distinguish the two. The
19929 introduction of direct_name requires the insertion of one new
19930 explicit textual rule: to forbid statement_identifiers from
19931 being operator_symbols. This is the only case where the
19932 explicit rule is needed, because this is the only case where
19933 the declaration of the entity is implicit. For example, there
19934 is no need to syntactically forbid (say) "X: "Rem";", because
19935 it is impossible to declare a type whose name is an
19936 operator_symbol in the first place.
19937
19938 17.e
19939 The syntax rules for explicit_dereference and
19940 implicit_dereference are new; this makes other rules simpler,
19941 since dereferencing an access value has substantially
19942 different semantics from selected_components. We also use
19943 name instead of prefix in the explicit_dereference rule since
19944 that seems clearer. Note that these rules rely on the fact
19945 that function calls are now names, so we don't need to use
19946 prefix to allow functions calls in front of .all.
19947
19948 17.f
19949 Discussion: Actually, it would be reasonable to allow any
19950 primary in front of .all, since only the value is needed, but
19951 that would be a bit radical.
19952
19953 17.g
19954 We no longer use the term appropriate for a type since we now
19955 describe the semantics of a prefix in terms of implicit
19956 dereference.
19957
19958 _Extensions to Ada 2005_
19959
19960 17.h/3
19961 {AI05-0003-1AI05-0003-1} A qualified_expression is now a name
19962 denoting a constant view; this allows them to be used as a
19963 prefix and to be renamed as an object. They are often used to
19964 remove ambiguity from function calls, and there may be no
19965 other way to do that. Interestingly, a type_conversion of a
19966 qualified_expression is already legal in these contexts, so
19967 this change mainly reduces clutter by eliminating an otherwise
19968 unneeded type_conversion from some expressions.
19969
19970 _Wording Changes from Ada 2005_
19971
19972 17.i/3
19973 {AI05-0008-1AI05-0008-1} Correction: Added a missing rule so
19974 that most dereferences are assumed constrained (without
19975 determining whether the designated object is). This is just
19976 confirming the Ada 95 rules; Ada 2005 failed to ensure that
19977 this property was unchanged.
19978
19979 17.j/3
19980 {AI05-0139-2AI05-0139-2} {AI05-0299-1AI05-0299-1} Added
19981 generalized_reference and generalized_indexing as types of
19982 name; these are documented as extensions in the appropriate
19983 subclauses.
19984
19985 * Menu:
19986
19987 * 4.1.1 :: Indexed Components
19988 * 4.1.2 :: Slices
19989 * 4.1.3 :: Selected Components
19990 * 4.1.4 :: Attributes
19991 * 4.1.5 :: User-Defined References
19992 * 4.1.6 :: User-Defined Indexing
19993
19994 \1f
19995 File: aarm2012.info, Node: 4.1.1, Next: 4.1.2, Up: 4.1
19996
19997 4.1.1 Indexed Components
19998 ------------------------
19999
20000 1
20001 [An indexed_component denotes either a component of an array or an entry
20002 in a family of entries. ]
20003
20004 _Syntax_
20005
20006 2
20007 indexed_component ::= prefix(expression {, expression})
20008
20009 _Name Resolution Rules_
20010
20011 3
20012 The prefix of an indexed_component with a given number of expressions
20013 shall resolve to denote an array (after any implicit dereference) with
20014 the corresponding number of index positions, or shall resolve to denote
20015 an entry family of a task or protected object (in which case there shall
20016 be only one expression).
20017
20018 4
20019 The expected type for each expression is the corresponding index type.
20020
20021 _Static Semantics_
20022
20023 5
20024 When the prefix denotes an array, the indexed_component denotes the
20025 component of the array with the specified index value(s). The nominal
20026 subtype of the indexed_component is the component subtype of the array
20027 type.
20028
20029 6
20030 When the prefix denotes an entry family, the indexed_component denotes
20031 the individual entry of the entry family with the specified index value.
20032
20033 _Dynamic Semantics_
20034
20035 7
20036 For the evaluation of an indexed_component, the prefix and the
20037 expressions are evaluated in an arbitrary order. The value of each
20038 expression is converted to the corresponding index type. A check is
20039 made that each index value belongs to the corresponding index range of
20040 the array or entry family denoted by the prefix. Constraint_Error is
20041 raised if this check fails.
20042
20043 _Examples_
20044
20045 8
20046 Examples of indexed components:
20047
20048 9
20049 My_Schedule(Sat) -- a component of a one-dimensional array (see *note 3.6.1::)
20050 Page(10) -- a component of a one-dimensional array (see *note 3.6::)
20051 Board(M, J + 1) -- a component of a two-dimensional array (see *note 3.6.1::)
20052 Page(10)(20) -- a component of a component (see *note 3.6::)
20053 Request(Medium) -- an entry in a family of entries (see *note 9.1::)
20054 Next_Frame(L)(M, N) -- a component of a function call (see *note 6.1::)
20055
20056 NOTES
20057
20058 10
20059 1 Notes on the examples: Distinct notations are used for
20060 components of multidimensional arrays (such as Board) and arrays of
20061 arrays (such as Page). The components of an array of arrays are
20062 arrays and can therefore be indexed. Thus Page(10)(20) denotes the
20063 20th component of Page(10). In the last example Next_Frame(L) is a
20064 function call returning an access value that designates a
20065 two-dimensional array.
20066
20067 \1f
20068 File: aarm2012.info, Node: 4.1.2, Next: 4.1.3, Prev: 4.1.1, Up: 4.1
20069
20070 4.1.2 Slices
20071 ------------
20072
20073 1
20074 [ A slice denotes a one-dimensional array formed by a sequence of
20075 consecutive components of a one-dimensional array. A slice of a
20076 variable is a variable; a slice of a constant is a constant;] a slice of
20077 a value is a value.
20078
20079 _Syntax_
20080
20081 2
20082 slice ::= prefix(discrete_range)
20083
20084 _Name Resolution Rules_
20085
20086 3
20087 The prefix of a slice shall resolve to denote a one-dimensional array
20088 (after any implicit dereference).
20089
20090 4
20091 The expected type for the discrete_range of a slice is the index type of
20092 the array type.
20093
20094 _Static Semantics_
20095
20096 5
20097 A slice denotes a one-dimensional array formed by the sequence of
20098 consecutive components of the array denoted by the prefix, corresponding
20099 to the range of values of the index given by the discrete_range.
20100
20101 6
20102 The type of the slice is that of the prefix. Its bounds are those
20103 defined by the discrete_range.
20104
20105 _Dynamic Semantics_
20106
20107 7
20108 For the evaluation of a slice, the prefix and the discrete_range are
20109 evaluated in an arbitrary order. If the slice is not a null slice (a
20110 slice where the discrete_range is a null range), then a check is made
20111 that the bounds of the discrete_range belong to the index range of the
20112 array denoted by the prefix. Constraint_Error is raised if this check
20113 fails.
20114
20115 NOTES
20116
20117 8
20118 2 A slice is not permitted as the prefix of an Access
20119 attribute_reference, even if the components or the array as a whole
20120 are aliased. See *note 3.10.2::.
20121
20122 8.a
20123 Proof: Slices are not aliased, by *note 3.10::, "*note 3.10::
20124 Access Types".
20125
20126 8.b
20127 Reason: This is to ease implementation of
20128 general-access-to-array. If slices were aliased,
20129 implementations would need to store array dope with the access
20130 values, which is not always desirable given
20131 access-to-incomplete types completed in a package body.
20132
20133 9
20134 3 For a one-dimensional array A, the slice A(N .. N) denotes an
20135 array that has only one component; its type is the type of A. On
20136 the other hand, A(N) denotes a component of the array A and has the
20137 corresponding component type.
20138
20139 _Examples_
20140
20141 10
20142 Examples of slices:
20143
20144 11
20145 Stars(1 .. 15) -- a slice of 15 characters (see *note 3.6.3::)
20146 Page(10 .. 10 + Size) -- a slice of 1 + Size components (see *note 3.6::)
20147 Page(L)(A .. B) -- a slice of the array Page(L) (see *note 3.6::)
20148 Stars(1 .. 0) -- a null slice (see *note 3.6.3::)
20149 My_Schedule(Weekday) -- bounds given by subtype (see *note 3.6.1:: and *note 3.5.1::)
20150 Stars(5 .. 15)(K) -- same as Stars(K) (see *note 3.6.3::)
20151 -- provided that K is in 5 .. 15
20152
20153 \1f
20154 File: aarm2012.info, Node: 4.1.3, Next: 4.1.4, Prev: 4.1.2, Up: 4.1
20155
20156 4.1.3 Selected Components
20157 -------------------------
20158
20159 1
20160 [Selected_components are used to denote components (including
20161 discriminants), entries, entry families, and protected subprograms; they
20162 are also used as expanded names as described below. ]
20163
20164 _Syntax_
20165
20166 2
20167 selected_component ::= prefix . selector_name
20168
20169 3
20170 selector_name ::= identifier | character_literal | operator_symbol
20171
20172 _Name Resolution Rules_
20173
20174 4
20175 A selected_component is called an expanded name if, according to the
20176 visibility rules, at least one possible interpretation of its prefix
20177 denotes a package or an enclosing named construct (directly, not through
20178 a subprogram_renaming_declaration or generic_renaming_declaration).
20179
20180 4.a
20181 Discussion: See AI83-00187.
20182
20183 5
20184 A selected_component that is not an expanded name shall resolve to
20185 denote one of the following:
20186
20187 5.a
20188 Ramification: If the prefix of a selected_component denotes an
20189 enclosing named construct, then the selected_component is
20190 interpreted only as an expanded name, even if the named
20191 construct is a function that could be called without
20192 parameters.
20193
20194 6
20195 * A component [(including a discriminant)]:
20196
20197 7
20198 The prefix shall resolve to denote an object or value of some
20199 non-array composite type (after any implicit dereference). The
20200 selector_name shall resolve to denote a discriminant_specification
20201 of the type, or, unless the type is a protected type, a
20202 component_declaration of the type. The selected_component denotes
20203 the corresponding component of the object or value.
20204
20205 7.a/3
20206 Reason: {AI05-0005-1AI05-0005-1} The components of a protected
20207 object cannot be named except by an expanded name, even from
20208 within the corresponding protected body. The protected body
20209 cannot reference the private components of some arbitrary
20210 object of the protected type; the protected body may reference
20211 components of the current instance only (by an expanded name
20212 or a direct_name).
20213
20214 7.b
20215 Ramification: Only the discriminants and components visible at
20216 the place of the selected_component can be selected, since a
20217 selector_name can only denote declarations that are visible
20218 (see *note 8.3::).
20219
20220 8
20221 * A single entry, an entry family, or a protected subprogram:
20222
20223 9
20224 The prefix shall resolve to denote an object or value of some task
20225 or protected type (after any implicit dereference). The
20226 selector_name shall resolve to denote an entry_declaration or
20227 subprogram_declaration occurring (implicitly or explicitly) within
20228 the visible part of that type. The selected_component denotes the
20229 corresponding entry, entry family, or protected subprogram.
20230
20231 9.a
20232 Reason: This explicitly says "visible part" because even
20233 though the body has visibility on the private part, it cannot
20234 call the private operations of some arbitrary object of the
20235 task or protected type, only those of the current instance
20236 (and expanded name notation has to be used for that).
20237
20238 9.1/2
20239 * {AI95-00252-01AI95-00252-01} {AI95-00407-01AI95-00407-01} A view of
20240 a subprogram whose first formal parameter is of a tagged type or is
20241 an access parameter whose designated type is tagged:
20242
20243 9.2/3
20244 {AI95-00252-01AI95-00252-01} {AI95-00407-01AI95-00407-01}
20245 {AI05-0090-1AI05-0090-1} The prefix (after any implicit
20246 dereference) shall resolve to denote an object or value of a
20247 specific tagged type T or class-wide type T'Class. The
20248 selector_name shall resolve to denote a view of a subprogram
20249 declared immediately within the declarative region in which an
20250 ancestor of the type T is declared. The first formal parameter of
20251 the subprogram shall be of type T, or a class-wide type that covers
20252 T, or an access parameter designating one of these types. The
20253 designator of the subprogram shall not be the same as that of a
20254 component of the tagged type visible at the point of the
20255 selected_component. The subprogram shall not be an implicitly
20256 declared primitive operation of type T that overrides an inherited
20257 subprogram implemented by an entry or protected subprogram visible
20258 at the point of the selected_component. The selected_component
20259 denotes a view of this subprogram that omits the first formal
20260 parameter. This view is called a prefixed view of the subprogram,
20261 and the prefix of the selected_component (after any implicit
20262 dereference) is called the prefix of the prefixed view.
20263
20264 9.b/3
20265 Discussion: {AI05-0090-1AI05-0090-1} The part of the rule that
20266 excludes a primitive overriding subprogram as a selector
20267 applies only to the wrapper subprogram that is implicitly
20268 declared to override a subprogram inherited from a
20269 synchronized interface that is implemented by an operation of
20270 a task or protected type (see *note 9.1:: and *note 9.4::).
20271 We don't want calls that use a prefixed view to be ambiguous
20272 between the wrapper subprogram and the implementing entry or
20273 protected operation. Note that it is illegal to declare an
20274 explicit primitive that has a prefixed view that is
20275 homographic with one of the type's operations, so in normal
20276 cases it isn't possible to have an ambiguity in a prefix call.
20277 However, a class-wide operation of an ancestor type that is
20278 declared in the same declaration list with the ancestor type
20279 is also considered, and that can still make a call ambiguous.
20280
20281 10
20282 An expanded name shall resolve to denote a declaration that occurs
20283 immediately within a named declarative region, as follows:
20284
20285 11
20286 * The prefix shall resolve to denote either a package [(including the
20287 current instance of a generic package, or a rename of a package)],
20288 or an enclosing named construct.
20289
20290 12
20291 * The selector_name shall resolve to denote a declaration that occurs
20292 immediately within the declarative region of the package or
20293 enclosing construct [(the declaration shall be visible at the place
20294 of the expanded name -- see *note 8.3::)]. The expanded name
20295 denotes that declaration.
20296
20297 12.a
20298 Ramification: Hence, a library unit or subunit can use an
20299 expanded name to refer to the declarations within the private
20300 part of its parent unit, as well as to other children that
20301 have been mentioned in with_clauses.
20302
20303 13
20304 * If the prefix does not denote a package, then it shall be a
20305 direct_name or an expanded name, and it shall resolve to denote a
20306 program unit (other than a package), the current instance of a
20307 type, a block_statement, a loop_statement, or an accept_statement
20308 (*note 9.5.2: S0219.) (in the case of an accept_statement (*note
20309 9.5.2: S0219.) or entry_body (*note 9.5.2: S0221.), no family index
20310 is allowed); the expanded name shall occur within the declarative
20311 region of this construct. Further, if this construct is a callable
20312 construct and the prefix denotes more than one such enclosing
20313 callable construct, then the expanded name is ambiguous,
20314 independently of the selector_name.
20315
20316 _Legality Rules_
20317
20318 13.1/2
20319 {AI95-00252-01AI95-00252-01} {AI95-00407-01AI95-00407-01} For a
20320 subprogram whose first parameter is an access parameter, the prefix of
20321 any prefixed view shall denote an aliased view of an object.
20322
20323 13.2/2
20324 {AI95-00407-01AI95-00407-01} For a subprogram whose first parameter is
20325 of mode in out or out, or of an anonymous access-to-variable type, the
20326 prefix of any prefixed view shall denote a variable.
20327
20328 13.a/2
20329 Reason: We want calls through a prefixed view and through a
20330 normal view to have the same legality. Thus, the implicit
20331 'Access in this new notation needs the same legality check
20332 that an explicit 'Access would have. Similarly, we need to
20333 prohibit the object from being constant if the first parameter
20334 of the subprogram is in out, because that is (obviously)
20335 prohibited for passing a normal parameter.
20336
20337 _Dynamic Semantics_
20338
20339 14
20340 The evaluation of a selected_component includes the evaluation of the
20341 prefix.
20342
20343 15
20344 For a selected_component that denotes a component of a variant, a check
20345 is made that the values of the discriminants are such that the value or
20346 object denoted by the prefix has this component. The exception
20347 Constraint_Error is raised if this check fails.
20348
20349 _Examples_
20350
20351 16
20352 Examples of selected components:
20353
20354 17/2
20355 {AI95-00252-01AI95-00252-01} {AI95-00407-01AI95-00407-01} Tomorrow.Month -- a record component (see *note 3.8::)
20356 Next_Car.Owner -- a record component (see *note 3.10.1::)
20357 Next_Car.Owner.Age -- a record component (see *note 3.10.1::)
20358 -- the previous two lines involve implicit dereferences
20359 Writer.Unit -- a record component (a discriminant) (see *note 3.8.1::)
20360 Min_Cell(H).Value -- a record component of the result (see *note 6.1::)
20361 -- of the function call Min_Cell(H)
20362 Cashier.Append -- a prefixed view of a procedure (see *note 3.9.4::)
20363 Control.Seize -- an entry of a protected object (see *note 9.4::)
20364 Pool(K).Write -- an entry of the task Pool(K) (see *note 9.4::)
20365
20366 18
20367 Examples of expanded names:
20368
20369 19
20370 Key_Manager."<" -- an operator of the visible part of a package (see *note 7.3.1::)
20371 Dot_Product.Sum -- a variable declared in a function body (see *note 6.1::)
20372 Buffer.Pool -- a variable declared in a protected unit (see *note 9.11::)
20373 Buffer.Read -- an entry of a protected unit (see *note 9.11::)
20374 Swap.Temp -- a variable declared in a block statement (see *note 5.6::)
20375 Standard.Boolean -- the name of a predefined type (see *note A.1::)
20376
20377 _Extensions to Ada 83_
20378
20379 19.a
20380 We now allow an expanded name to use a prefix that denotes a
20381 rename of a package, even if the selector is for an entity
20382 local to the body or private part of the package, so long as
20383 the entity is visible at the place of the reference. This
20384 eliminates a preexisting anomaly where references in a package
20385 body may refer to declarations of its visible part but not
20386 those of its private part or body when the prefix is a rename
20387 of the package.
20388
20389 _Wording Changes from Ada 83_
20390
20391 19.b
20392 The syntax rule for selector_name is new. It is used in
20393 places where visibility, but not necessarily direct
20394 visibility, is required. See *note 4.1::, "*note 4.1:: Names"
20395 for more information.
20396
20397 19.c
20398 The description of dereferencing an access type has been moved
20399 to *note 4.1::, "*note 4.1:: Names"; name.all is no longer
20400 considered a selected_component.
20401
20402 19.d
20403 The rules have been restated to be consistent with our new
20404 terminology, to accommodate class-wide types, etc.
20405
20406 _Extensions to Ada 95_
20407
20408 19.e/2
20409 {AI95-00252-01AI95-00252-01} The prefixed view notation for
20410 tagged objects is new. This provides a similar notation to
20411 that used in other popular languages, and also reduces the
20412 need for use_clauses. This is sometimes known as
20413 "distinguished receiver notation".
20414
20415 19.f/2
20416 Given the following definitions for a tagged type T:
20417
20418 19.g/2
20419 procedure Do_Something (Obj : in out T; Count : in Natural);
20420 procedure Do_Something_Else (Obj : access T; Flag : in Boolean);
20421 My_Object : aliased T;
20422
20423 19.h/2
20424 the following calls are equivalent:
20425
20426 19.i/2
20427 Do_Something (My_Object, Count => 10);
20428 My_Object.Do_Something (Count => 10);
20429
20430 19.j/2
20431 as are the following calls:
20432
20433 19.k/2
20434 Do_Something_Else (My_Object'Access, Flag => True);
20435 My_Object.Do_Something_Else (Flag => True);
20436
20437 _Wording Changes from Ada 2005_
20438
20439 19.l/3
20440 {AI05-0090-1AI05-0090-1} Correction: Corrected the definition
20441 of a prefixed view to ignore the implicit subprograms declared
20442 for "implemented by" entries and protected subprograms.
20443
20444 \1f
20445 File: aarm2012.info, Node: 4.1.4, Next: 4.1.5, Prev: 4.1.3, Up: 4.1
20446
20447 4.1.4 Attributes
20448 ----------------
20449
20450 1
20451 [An attribute is a characteristic of an entity that can be queried via
20452 an attribute_reference (*note 4.1.4: S0100.) or a
20453 range_attribute_reference (*note 4.1.4: S0102.).]
20454
20455 _Syntax_
20456
20457 2
20458 attribute_reference ::= prefix'attribute_designator
20459
20460 3/2
20461 {AI05-0004-1AI05-0004-1} attribute_designator ::=
20462 identifier[(static_expression)]
20463 | Access | Delta | Digits | Mod
20464
20465 4
20466 range_attribute_reference ::= prefix'range_attribute_designator
20467
20468 5
20469 range_attribute_designator ::= Range[(static_expression)]
20470
20471 _Name Resolution Rules_
20472
20473 6
20474 In an attribute_reference, if the attribute_designator is for an
20475 attribute defined for (at least some) objects of an access type, then
20476 the prefix is never interpreted as an implicit_dereference; otherwise
20477 (and for all range_attribute_references), if the type of the name within
20478 the prefix is of an access type, the prefix is interpreted as an
20479 implicit_dereference. Similarly, if the attribute_designator is for an
20480 attribute defined for (at least some) functions, then the prefix is
20481 never interpreted as a parameterless function_call; otherwise (and for
20482 all range_attribute_references), if the prefix consists of a name that
20483 denotes a function, it is interpreted as a parameterless function_call.
20484
20485 6.a
20486 Discussion: The first part of this rule is essentially a
20487 "preference" against implicit dereference, so that it is
20488 possible to ask for, say, 'Size of an access object, without
20489 automatically getting the size of the object designated by the
20490 access object. This rule applies to 'Access,
20491 'Unchecked_Access, 'Size, and 'Address, and any other
20492 attributes that are defined for at least some access objects.
20493
20494 6.b
20495 The second part of this rule implies that, for a parameterless
20496 function F, F'Address is the address of F, whereas F'Size is
20497 the size of the anonymous constant returned by F.
20498
20499 6.c/1
20500 We normally talk in terms of expected type or profile for name
20501 resolution rules, but we don't do this for attributes because
20502 certain attributes are legal independent of the type or the
20503 profile of the prefix.
20504
20505 6.d/2
20506 {AI95-00114-01AI95-00114-01} Other than the rules given above,
20507 the Name Resolution Rules for the prefix of each attribute are
20508 defined as Name Resolution Rules for that attribute. If no
20509 such rules are defined, then no context at all should be used
20510 when resolving the prefix. In particular, any knowledge about
20511 the kind of entities required must not be used for resolution
20512 unless that is required by Name Resolution Rules. This
20513 matters in obscure cases; for instance, given the following
20514 declarations:
20515
20516 6.e/2
20517 function Get_It return Integer is ... -- (1)
20518 function Get_It return Some_Record_Type is ... -- (2)
20519
20520 6.f/2
20521 the following attribute_reference cannot be resolved and is
20522 illegal:
20523
20524 6.g/2
20525 if Get_It'Valid then
20526
20527 6.h/3
20528 {AI05-0005-1AI05-0005-1} even though the Valid attribute is
20529 only defined for objects of scalar types, and thus cannot be
20530 applied to the result of function (2). That information
20531 cannot be used to resolve the prefix. The same would be true
20532 if (2) had been a procedure; even though the procedure does
20533 not denote an object, the attribute_reference is still
20534 illegal.
20535
20536 7
20537 The expression, if any, in an attribute_designator or
20538 range_attribute_designator is expected to be of any integer type.
20539
20540 _Legality Rules_
20541
20542 8
20543 The expression, if any, in an attribute_designator or
20544 range_attribute_designator shall be static.
20545
20546 _Static Semantics_
20547
20548 9/3
20549 {AI05-0006-1AI05-0006-1} An attribute_reference denotes a value, an
20550 object, a subprogram, or some other kind of program entity. For an
20551 attribute_reference that denotes a value or an object, if its type is
20552 scalar, then its nominal subtype is the base subtype of the type; if its
20553 type is tagged, its nominal subtype is the first subtype of the type;
20554 otherwise, its nominal subtype is a subtype of the type without any
20555 constraint or null_exclusion. Similarly, unless explicitly specified
20556 otherwise, for an attribute_reference that denotes a function, when its
20557 result type is scalar, its result subtype is the base subtype of the
20558 type, when its result type is tagged, the result subtype is the first
20559 subtype of the type, and when the result type is some other type, the
20560 result subtype is a subtype of the type without any constraint or
20561 null_exclusion.
20562
20563 9.a
20564 Ramification: The attributes defined by the language are
20565 summarized in *note K.2::. Implementations can define
20566 additional attributes.
20567
20568 9.b/3
20569 Discussion: {AI05-0006-1AI05-0006-1} The nominal subtype is
20570 primarily a concern when an attribute_reference, or a call on
20571 an attribute_reference, is used as the expression of a case
20572 statement, due to the full coverage requirement based on the
20573 nominal subtype. For nondiscrete cases, we define the nominal
20574 subtype mainly for completeness. Implementations may specify
20575 otherwise for implementation-defined attribute functions.
20576
20577 9.c/3
20578 The rule is written to match the meaning of the italicized T
20579 in the definition of attributes such as Input; see *note
20580 4.5.1::.
20581
20582 9.d/3
20583 To be honest: {AI05-0006-1AI05-0006-1} We don't worry about
20584 the fact that "base subtype" is not explicitly defined for the
20585 universal types. Since it is not possible to constrain a
20586 universal numeric type, all subtypes are unconstrained, and
20587 hence can be considered base subtypes. The wording above
20588 could be altered to bypass this issue, but it doesn't seem
20589 necessary, since universal integer is handled specially in the
20590 rules for case expression full coverage, and we don't allow
20591 user-defined functions for attribute functions whose result
20592 type is universal.
20593
20594 10
20595 [A range_attribute_reference X'Range(N) is equivalent to the range
20596 X'First(N) .. X'Last(N), except that the prefix is only evaluated once.
20597 Similarly, X'Range is equivalent to X'First .. X'Last, except that the
20598 prefix is only evaluated once.]
20599
20600 _Dynamic Semantics_
20601
20602 11
20603 The evaluation of an attribute_reference (or range_attribute_reference)
20604 consists of the evaluation of the prefix.
20605
20606 _Implementation Permissions_
20607
20608 12/1
20609 {8652/00158652/0015} {AI95-00093-01AI95-00093-01} An implementation may
20610 provide implementation-defined attributes; the identifier for an
20611 implementation-defined attribute shall differ from those of the
20612 language-defined attributes unless supplied for compatibility with a
20613 previous edition of this International Standard.
20614
20615 12.a
20616 Implementation defined: Implementation-defined attributes.
20617
20618 12.b
20619 Ramification: They cannot be reserved words because reserved
20620 words are not legal identifiers.
20621
20622 12.c
20623 The semantics of implementation-defined attributes, and any
20624 associated rules, are, of course, implementation defined. For
20625 example, the implementation defines whether a given
20626 implementation-defined attribute can be used in a static
20627 expression.
20628
20629 12.c.1/1
20630 {8652/00158652/0015} {AI95-00093-01AI95-00093-01}
20631 Implementations are allowed to support the Small attribute for
20632 floating types, as this was defined in Ada 83, even though the
20633 name would conflict with a language-defined attribute.
20634
20635 NOTES
20636
20637 13
20638 4 Attributes are defined throughout this International Standard,
20639 and are summarized in *note K.2::.
20640
20641 14/2
20642 5 {AI95-00235AI95-00235} In general, the name in a prefix of an
20643 attribute_reference (or a range_attribute_reference) has to be
20644 resolved without using any context. However, in the case of the
20645 Access attribute, the expected type for the attribute_reference has
20646 to be a single access type, and the resolution of the name can use
20647 the fact that the type of the object or the profile of the callable
20648 entity denoted by the prefix has to match the designated type or be
20649 type conformant with the designated profile of the access type.
20650
20651 14.a/2
20652 Proof: {AI95-00235AI95-00235} In the general case, there is no
20653 "expected type" for the prefix of an attribute_reference. In
20654 the special case of 'Access, there is an "expected type" or
20655 "expected profile" for the prefix.
20656
20657 14.b
20658 Reason: 'Access is a special case, because without it, it
20659 would be very difficult to take 'Access of an overloaded
20660 subprogram.
20661
20662 _Examples_
20663
20664 15
20665 Examples of attributes:
20666
20667 16
20668 Color'First -- minimum value of the enumeration type Color (see *note 3.5.1::)
20669 Rainbow'Base'First -- same as Color'First (see *note 3.5.1::)
20670 Real'Digits -- precision of the type Real (see *note 3.5.7::)
20671 Board'Last(2) -- upper bound of the second dimension of Board (see *note 3.6.1::)
20672 Board'Range(1) -- index range of the first dimension of Board (see *note 3.6.1::)
20673 Pool(K)'Terminated -- True if task Pool(K) is terminated (see *note 9.1::)
20674 Date'Size -- number of bits for records of type Date (see *note 3.8::)
20675 Message'Address -- address of the record variable Message (see *note 3.7.1::)
20676
20677 _Extensions to Ada 83_
20678
20679 16.a
20680 We now uniformly treat X'Range as X'First..X'Last, allowing
20681 its use with scalar subtypes.
20682
20683 16.b
20684 We allow any integer type in the static_expression of an
20685 attribute designator, not just a value of universal_integer.
20686 The preference rules ensure upward compatibility.
20687
20688 _Wording Changes from Ada 83_
20689
20690 16.c
20691 We use the syntactic category attribute_reference rather than
20692 simply "attribute" to avoid confusing the name of something
20693 with the thing itself.
20694
20695 16.d
20696 The syntax rule for attribute_reference now uses identifier
20697 instead of simple_name, because attribute identifiers are not
20698 required to follow the normal visibility rules.
20699
20700 16.e
20701 We now separate attribute_reference from
20702 range_attribute_reference, and enumerate the reserved words
20703 that are legal attribute or range attribute designators. We
20704 do this because identifier no longer includes reserved words.
20705
20706 16.f
20707 The Ada 95 name resolution rules are a bit more explicit than
20708 in Ada 83. The Ada 83 rule said that the "meaning of the
20709 prefix of an attribute must be determinable independently of
20710 the attribute designator and independently of the fact that it
20711 is the prefix of an attribute." That isn't quite right since
20712 the meaning even in Ada 83 embodies whether or not the prefix
20713 is interpreted as a parameterless function call, and in Ada
20714 95, it also embodies whether or not the prefix is interpreted
20715 as an implicit_dereference. So the attribute designator does
20716 make a difference -- just not much.
20717
20718 16.g
20719 Note however that if the attribute designator is Access, it
20720 makes a big difference in the interpretation of the prefix
20721 (see *note 3.10.2::).
20722
20723 _Wording Changes from Ada 95_
20724
20725 16.h/2
20726 {8652/00158652/0015} {AI95-00093-01AI95-00093-01} Corrigendum:
20727 The wording was changed to allow implementations to continue
20728 to implement the Ada 83 Small attribute. This was always
20729 intended to be allowed.
20730
20731 16.i/2
20732 {AI95-00235-01AI95-00235-01} The note about resolving prefixes
20733 of attributes was updated to reflect that the prefix of an
20734 Access attribute now has an expected type (see *note
20735 3.10.2::).
20736
20737 _Wording Changes from Ada 2005_
20738
20739 16.j/3
20740 {AI05-0006-1AI05-0006-1} Correction: Defined the nominal
20741 subtype of an attribute_reference to close a minor language
20742 hole.
20743
20744 \1f
20745 File: aarm2012.info, Node: 4.1.5, Next: 4.1.6, Prev: 4.1.4, Up: 4.1
20746
20747 4.1.5 User-Defined References
20748 -----------------------------
20749
20750 _Static Semantics_
20751
20752 1/3
20753 {AI05-0139-2AI05-0139-2} Given a discriminated type T, the following
20754 type-related operational aspect may be specified:
20755
20756 2/3
20757 Implicit_Dereference
20758 This aspect is specified by a name that denotes an access
20759 discriminant declared for the type T.
20760
20761 2.a/3
20762 Aspect Description for Implicit_Dereference: Mechanism for
20763 user-defined implicit .all.
20764
20765 3/3
20766 {AI05-0139-2AI05-0139-2} A (view of a) type with a specified
20767 Implicit_Dereference aspect is a reference type. A reference object is
20768 an object of a reference type. The discriminant named by the
20769 Implicit_Dereference aspect is the reference discriminant of the
20770 reference type or reference object. [A generalized_reference is a name
20771 that identifies a reference object, and denotes the object or subprogram
20772 designated by the reference discriminant of the reference object.]
20773
20774 3.a.1/3
20775 Glossary entry: A reference type is one that has user-defined
20776 behavior for ".all", defined by the Implicit_Dereference
20777 aspect.
20778
20779 _Syntax_
20780
20781 4/3
20782 {AI05-0139-2AI05-0139-2} generalized_reference ::=
20783 reference_object_name
20784
20785 _Name Resolution Rules_
20786
20787 5/3
20788 {AI05-0139-2AI05-0139-2} {AI05-0269-1AI05-0269-1} The expected type for
20789 the reference_object_name in a generalized_reference is any reference
20790 type.
20791
20792 _Static Semantics_
20793
20794 6/3
20795 {AI05-0139-2AI05-0139-2} A generalized_reference denotes a view
20796 equivalent to that of a dereference of the reference discriminant of the
20797 reference object.
20798
20799 7/3
20800 {AI05-0139-2AI05-0139-2} Given a reference type T, the
20801 Implicit_Dereference aspect is inherited by descendants of type T if not
20802 overridden. If a descendant type constrains the value of the reference
20803 discriminant of T by a new discriminant, that new discriminant is the
20804 reference discriminant of the descendant. [If the descendant type
20805 constrains the value of the reference discriminant of T by an expression
20806 other than the name of a new discriminant, a generalized_reference that
20807 identifies an object of the descendant type denotes the object or
20808 subprogram designated by the value of this constraining expression.]
20809
20810 _Dynamic Semantics_
20811
20812 8/3
20813 {AI05-0139-2AI05-0139-2} The evaluation of a generalized_reference
20814 consists of the evaluation of the reference_object_name and a
20815 determination of the object or subprogram designated by the reference
20816 discriminant of the named reference object. A check is made that the
20817 value of the reference discriminant is not the null access value.
20818 Constraint_Error is raised if this check fails. The
20819 generalized_reference denotes the object or subprogram designated by the
20820 value of the reference discriminant of the named reference object.
20821
20822 _Examples_
20823
20824 9/3
20825 {AI05-0268-1AI05-0268-1} type Barrel is tagged ... -- holds objects of type Element
20826
20827 10/3
20828 {AI05-0139-2AI05-0139-2} {AI05-0299-2AI05-0299-2} type Ref_Element(Data : access Element) is limited private
20829 with Implicit_Dereference => Data;
20830 -- This Ref_Element type is a "reference" type.
20831 -- "Data" is its reference discriminant.
20832
20833 11/3
20834 {AI05-0139-2AI05-0139-2} {AI05-0268-1AI05-0268-1} function Find (B : aliased in out Barrel; Key : String) return Ref_Element;
20835 -- Return a reference to an element of a barrel.
20836
20837 12/3
20838 {AI05-0268-1AI05-0268-1} {AI05-0299-2AI05-0299-2} B: aliased Barrel;
20839
20840 13/3
20841 {AI05-0139-2AI05-0139-2} ...
20842
20843 14/3
20844 {AI05-0139-2AI05-0139-2} {AI05-0268-1AI05-0268-1} Find (B, "grape") := Element'(...); -- Assign through a reference.
20845
20846 15/3
20847 {AI05-0139-2AI05-0139-2} {AI05-0268-1AI05-0268-1} -- This is equivalent to:
20848 Find (B, "grape").Data.all := Element'(...);
20849
20850 _Extensions to Ada 2005_
20851
20852 15.a/3
20853 {AI05-0139-2AI05-0139-2} The aspect Implicit_Dereference and
20854 the generalized_reference are new.
20855
20856 \1f
20857 File: aarm2012.info, Node: 4.1.6, Prev: 4.1.5, Up: 4.1
20858
20859 4.1.6 User-Defined Indexing
20860 ---------------------------
20861
20862 _Static Semantics_
20863
20864 1/3
20865 {AI05-0139-2AI05-0139-2} Given a tagged type T, the following
20866 type-related, operational aspects may be specified:
20867
20868 2/3
20869 Constant_Indexing
20870 This aspect shall be specified by a name that denotes one
20871 or more functions declared immediately within the same
20872 declaration list in which T is declared. All such
20873 functions shall have at least two parameters, the first
20874 of which is of type T or T'Class, or is an
20875 access-to-constant parameter with designated type T or
20876 T'Class.
20877
20878 2.a/3
20879 Aspect Description for Constant_Indexing: Defines function(s)
20880 to implement user-defined indexed_components.
20881
20882 3/3
20883 Variable_Indexing
20884 This aspect shall be specified by a name that denotes one
20885 or more functions declared immediately within the same
20886 declaration list in which T is declared. All such
20887 functions shall have at least two parameters, the first
20888 of which is of type T or T'Class, or is an access
20889 parameter with designated type T or T'Class. All such
20890 functions shall have a return type that is a reference
20891 type (see *note 4.1.5::), whose reference discriminant is
20892 of an access-to-variable type.
20893
20894 3.a/3
20895 Reason: We require these functions to return a reference type
20896 so that the object returned from the function can act like a
20897 variable. We need no similar rule for Constant_Indexing,
20898 since all functions return constant objects.
20899
20900 3.b/3
20901 Aspect Description for Variable_Indexing: Defines function(s)
20902 to implement user-defined indexed_components.
20903
20904 4/3
20905 These aspects are inherited by descendants of T (including the
20906 class-wide type T'Class). [The aspects shall not be overridden, but the
20907 functions they denote may be.]
20908
20909 4.a/3
20910 Ramification: Indexing can be provided for multiple index
20911 types by overloading routines with different parameter
20912 profiles. For instance, the map containers provide indexing
20913 on both cursors and keys by providing pairs of overloaded
20914 routines to the Constant_Indexing and Variable_Indexing
20915 aspects.
20916
20917 5/3
20918 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} An indexable container
20919 type is (a view of) a tagged type with at least one of the aspects
20920 Constant_Indexing or Variable_Indexing specified. An indexable
20921 container object is an object of an indexable container type. [A
20922 generalized_indexing is a name that denotes the result of calling a
20923 function named by a Constant_Indexing or Variable_Indexing aspect.]
20924
20925 5.a.1/3
20926 Glossary entry: An indexable container type is one that has
20927 user-defined behavior for indexing, via the Constant_Indexing
20928 or Variable_Indexing aspects.
20929
20930 _Legality Rules_
20931
20932 6/3
20933 {AI05-0139-2AI05-0139-2} The Constant_Indexing or Variable_Indexing
20934 aspect shall not be specified:
20935
20936 7/3
20937 * on a derived type if the parent type has the corresponding aspect
20938 specified or inherited; or
20939
20940 8/3
20941 * on a full_type_declaration if the type has a tagged partial view.
20942
20943 9/3
20944 In addition to the places where Legality Rules normally apply (see *note
20945 12.3::), these rules apply also in the private part of an instance of a
20946 generic unit.
20947
20948 9.a/3
20949 Ramification: In order to enforce these rules without breaking
20950 privacy, we cannot allow a tagged private type to have hidden
20951 indexing aspects. There is no problem if the private type is
20952 not tagged (as the indexing aspects cannot be specified on
20953 descendants in that case).
20954
20955 9.b/3
20956 We don't need an assume-the-worst rule as deriving from formal
20957 tagged type is not allowed in generic bodies.
20958
20959 _Syntax_
20960
20961 10/3
20962 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1}
20963 generalized_indexing ::= indexable_container_object_prefix
20964 actual_parameter_part
20965
20966 _Name Resolution Rules_
20967
20968 11/3
20969 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} The expected type for
20970 the indexable_container_object_prefix of a generalized_indexing is any
20971 indexable container type.
20972
20973 12/3
20974 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} If the
20975 Constant_Indexing aspect is specified for the type of the
20976 indexable_container_object_prefix of a generalized_indexing, then the
20977 generalized_indexing is interpreted as a constant indexing under the
20978 following circumstances:
20979
20980 13/3
20981 * when the Variable_Indexing aspect is not specified for the type of
20982 the indexable_container_object_prefix;
20983
20984 14/3
20985 * when the indexable_container_object_prefix denotes a constant;
20986
20987 15/3
20988 * when the generalized_indexing is used within a primary where a name
20989 denoting a constant is permitted.
20990
20991 15.a/3
20992 Ramification: This means it is not interpreted as a constant
20993 indexing for the variable_name in the LHS of an assignment
20994 (not inside a primary), nor for the name used for an out or in
20995 out parameter (not allowed to be a constant), nor for the name
20996 in an object renaming (not inside a primary), unless there is
20997 no Variable_Indexing aspect defined.
20998
20999 16/3
21000 Otherwise, the generalized_indexing is interpreted as a variable
21001 indexing.
21002
21003 17/3
21004 When a generalized_indexing is interpreted as a constant (or variable)
21005 indexing, it is equivalent to a call on a prefixed view of one of the
21006 functions named by the Constant_Indexing (or Variable_Indexing) aspect
21007 of the type of the indexable_container_object_prefix with the given
21008 actual_parameter_part, and with the indexable_container_object_prefix as
21009 the prefix of the prefixed view.
21010
21011 17.a/3
21012 Ramification: In other words, the generalized_indexing is
21013 equivalent to:
21014
21015 17.b/3
21016 indexable_container_object_prefix.Indexing actual_parameter_part
21017
21018 17.c/3
21019 where Indexing is the name specified for the Constant_Indexing
21020 or Variable_Indexing aspect.
21021
21022 _Examples_
21023
21024 18/3
21025 {AI05-0268-1AI05-0268-1} {AI05-0292-1AI05-0292-1} type Indexed_Barrel is tagged ...
21026 with Variable_Indexing => Find;
21027 -- Indexed_Barrel is an indexable container type,
21028 -- Find is the generalized indexing operation.
21029
21030 19/3
21031 {AI05-0268-1AI05-0268-1} function Find (B : aliased in out Indexed_Barrel; Key : String) return Ref_Element;
21032 -- Return a reference to an element of a barrel (see *note 4.1.5::).
21033
21034 20/3
21035 {AI05-0268-1AI05-0268-1} IB: aliased Indexed_Barrel;
21036
21037 21/3
21038 {AI05-0268-1AI05-0268-1} -- All of the following calls are then equivalent:
21039 Find (IB,"pear").Data.all := Element'(...); -- Traditional call
21040 IB.Find ("pear").Data.all := Element'(...); -- Call of prefixed view
21041 IB.Find ("pear") := Element'(...); -- Implicit dereference (see *note 4.1.5::)
21042 IB ("pear") := Element'(...); -- Implicit indexing and dereference
21043 IB ("pear").Data.all := Element'(...); -- Implicit indexing only
21044
21045 _Extensions to Ada 2005_
21046
21047 21.a/3
21048 {AI05-0139-2AI05-0139-2} Aspects Constant_Indexing and
21049 Variable_Indexing, and the generalized_indexing syntax are
21050 new.
21051
21052 \1f
21053 File: aarm2012.info, Node: 4.2, Next: 4.3, Prev: 4.1, Up: 4
21054
21055 4.2 Literals
21056 ============
21057
21058 1
21059 [ A literal represents a value literally, that is, by means of notation
21060 suited to its kind.] A literal is either a numeric_literal, a
21061 character_literal, the literal null, or a string_literal.
21062
21063 1.a
21064 Discussion: An enumeration literal that is an identifier
21065 rather than a character_literal is not considered a literal in
21066 the above sense, because it involves no special notation
21067 "suited to its kind." It might more properly be called an
21068 enumeration_identifier, except for historical reasons.
21069
21070 _Name Resolution Rules_
21071
21072 2/2
21073 This paragraph was deleted.{AI95-00230-01AI95-00230-01}
21074
21075 3
21076 For a name that consists of a character_literal, either its expected
21077 type shall be a single character type, in which case it is interpreted
21078 as a parameterless function_call that yields the corresponding value of
21079 the character type, or its expected profile shall correspond to a
21080 parameterless function with a character result type, in which case it is
21081 interpreted as the name of the corresponding parameterless function
21082 declared as part of the character type's definition (see *note 3.5.1::).
21083 In either case, the character_literal denotes the
21084 enumeration_literal_specification.
21085
21086 3.a
21087 Discussion: See *note 4.1.3:: for the resolution rules for a
21088 selector_name that is a character_literal.
21089
21090 4
21091 The expected type for a primary that is a string_literal shall be a
21092 single string type.
21093
21094 _Legality Rules_
21095
21096 5
21097 A character_literal that is a name shall correspond to a
21098 defining_character_literal of the expected type, or of the result type
21099 of the expected profile.
21100
21101 6
21102 For each character of a string_literal with a given expected string
21103 type, there shall be a corresponding defining_character_literal of the
21104 component type of the expected string type.
21105
21106 7/2
21107 This paragraph was deleted.{AI95-00230-01AI95-00230-01}
21108 {AI95-00231-01AI95-00231-01}
21109
21110 _Static Semantics_
21111
21112 8/2
21113 {AI95-00230-01AI95-00230-01} An integer literal is of type
21114 universal_integer. A real literal is of type universal_real. The
21115 literal null is of type universal_access.
21116
21117 _Dynamic Semantics_
21118
21119 9
21120 The evaluation of a numeric literal, or the literal null, yields the
21121 represented value.
21122
21123 10
21124 The evaluation of a string_literal that is a primary yields an array
21125 value containing the value of each character of the sequence of
21126 characters of the string_literal, as defined in *note 2.6::. The bounds
21127 of this array value are determined according to the rules for
21128 positional_array_aggregates (see *note 4.3.3::), except that for a null
21129 string literal, the upper bound is the predecessor of the lower bound.
21130
21131 11
21132 For the evaluation of a string_literal of type T, a check is made that
21133 the value of each character of the string_literal belongs to the
21134 component subtype of T. For the evaluation of a null string literal, a
21135 check is made that its lower bound is greater than the lower bound of
21136 the base range of the index type. The exception Constraint_Error is
21137 raised if either of these checks fails.
21138
21139 11.a
21140 Ramification: The checks on the characters need not involve
21141 more than two checks altogether, since one need only check the
21142 characters of the string with the lowest and highest position
21143 numbers against the range of the component subtype.
21144
21145 NOTES
21146
21147 12
21148 6 Enumeration literals that are identifiers rather than
21149 character_literals follow the normal rules for identifiers when
21150 used in a name (see *note 4.1:: and *note 4.1.3::).
21151 Character_literals used as selector_names follow the normal rules
21152 for expanded names (see *note 4.1.3::).
21153
21154 _Examples_
21155
21156 13
21157 Examples of literals:
21158
21159 14
21160 3.14159_26536 -- a real literal
21161 1_345 -- an integer literal
21162 'A' -- a character literal
21163 "Some Text" -- a string literal
21164
21165 _Incompatibilities With Ada 83_
21166
21167 14.a
21168 Because character_literals are now treated like other
21169 literals, in that they are resolved using context rather than
21170 depending on direct visibility, additional qualification might
21171 be necessary when passing a character_literal to an overloaded
21172 subprogram.
21173
21174 _Extensions to Ada 83_
21175
21176 14.b
21177 Character_literals are now treated analogously to null and
21178 string_literals, in that they are resolved using context,
21179 rather than their content; the declaration of the
21180 corresponding defining_character_literal need not be directly
21181 visible.
21182
21183 _Wording Changes from Ada 83_
21184
21185 14.c
21186 Name Resolution rules for enumeration literals that are not
21187 character_literals are not included anymore, since they are
21188 neither syntactically nor semantically "literals" but are
21189 rather names of parameterless functions.
21190
21191 _Extensions to Ada 95_
21192
21193 14.d/2
21194 {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01} Null
21195 now has type universal_access, which is similar to other
21196 literals. Null can be used with anonymous access types.
21197
21198 \1f
21199 File: aarm2012.info, Node: 4.3, Next: 4.4, Prev: 4.2, Up: 4
21200
21201 4.3 Aggregates
21202 ==============
21203
21204 1
21205 [ An aggregate combines component values into a composite value of an
21206 array type, record type, or record extension.]
21207
21208 _Syntax_
21209
21210 2
21211 aggregate ::= record_aggregate | extension_aggregate |
21212 array_aggregate
21213
21214 _Name Resolution Rules_
21215
21216 3/2
21217 {AI95-00287-01AI95-00287-01} The expected type for an aggregate shall be
21218 a single array type, record type, or record extension.
21219
21220 3.a
21221 Discussion: See *note 8.6::, "*note 8.6:: The Context of
21222 Overload Resolution" for the meaning of "shall be a single ...
21223 type."
21224
21225 3.b/3
21226 Ramification: {AI05-0005-1AI05-0005-1} There are additional
21227 rules for each kind of aggregate. These aggregate rules are
21228 additive; a legal expression needs to satisfy all of the
21229 applicable rules. That means the rule given here must be
21230 satisfied even when it is syntactically possible to tell which
21231 specific kind of aggregate is being used.
21232
21233 _Legality Rules_
21234
21235 4
21236 An aggregate shall not be of a class-wide type.
21237
21238 4.a
21239 Ramification: When the expected type in some context is
21240 class-wide, an aggregate has to be explicitly qualified by the
21241 specific type of value to be created, so that the expected
21242 type for the aggregate itself is specific.
21243
21244 4.b
21245 Discussion: We used to disallow aggregates of a type with
21246 unknown discriminants. However, that was unnecessarily
21247 restrictive in the case of an extension aggregate, and
21248 irrelevant to a record aggregate (since a type that is legal
21249 for a record aggregate could not possibly have unknown
21250 discriminants) and to an array aggregate (the only specific
21251 types that can have unknown discriminants are private types,
21252 private extensions, and types derived from them).
21253
21254 _Dynamic Semantics_
21255
21256 5
21257 For the evaluation of an aggregate, an anonymous object is created and
21258 values for the components or ancestor part are obtained (as described in
21259 the subsequent subclause for each kind of the aggregate) and assigned
21260 into the corresponding components or ancestor part of the anonymous
21261 object. Obtaining the values and the assignments occur in an arbitrary
21262 order. The value of the aggregate is the value of this object.
21263
21264 5.a
21265 Discussion: The ancestor part is the set of components
21266 inherited from the ancestor type. The syntactic category
21267 ancestor_part is the expression or subtype_mark that specifies
21268 how the ancestor part of the anonymous object should be
21269 initialized.
21270
21271 5.b
21272 Ramification: The assignment operations do the necessary value
21273 adjustment, as described in *note 7.6::. Note that the value
21274 as a whole is not adjusted -- just the subcomponents (and
21275 ancestor part, if any). *note 7.6:: also describes when this
21276 anonymous object is finalized.
21277
21278 5.c
21279 If the ancestor_part is a subtype_mark the Initialize
21280 procedure for the ancestor type is applied to the ancestor
21281 part after default-initializing it, unless the procedure is
21282 abstract, as described in *note 7.6::. The Adjust procedure
21283 for the ancestor type is not called in this case, since there
21284 is no assignment to the ancestor part as a whole.
21285
21286 6
21287 If an aggregate is of a tagged type, a check is made that its value
21288 belongs to the first subtype of the type. Constraint_Error is raised if
21289 this check fails.
21290
21291 6.a
21292 Ramification: This check ensures that no values of a tagged
21293 type are ever outside the first subtype, as required for
21294 inherited dispatching operations to work properly (see *note
21295 3.4::). This check will always succeed if the first subtype
21296 is unconstrained. This check is not extended to untagged
21297 types to preserve upward compatibility.
21298
21299 _Extensions to Ada 83_
21300
21301 6.b
21302 We now allow extension_aggregates.
21303
21304 _Wording Changes from Ada 83_
21305
21306 6.c
21307 We have adopted new wording for expressing the rule that the
21308 type of an aggregate shall be determinable from the outside,
21309 though using the fact that it is nonlimited record (extension)
21310 or array.
21311
21312 6.d
21313 An aggregate now creates an anonymous object. This is
21314 necessary so that controlled types will work (see *note
21315 7.6::).
21316
21317 _Incompatibilities With Ada 95_
21318
21319 6.e/2
21320 {AI95-00287-01AI95-00287-01} In Ada 95, a limited type is not
21321 considered when resolving an aggregate. Since Ada 2005 now
21322 allows limited aggregates, we can have incompatibilities. For
21323 example:
21324
21325 6.f/2
21326 type Lim is limited
21327 record
21328 Comp: Integer;
21329 end record;
21330
21331 6.g/2
21332 type Not_Lim is
21333 record
21334 Comp: Integer;
21335 end record;
21336
21337 6.h/2
21338 procedure P(X: Lim);
21339 procedure P(X: Not_Lim);
21340
21341 6.i/2
21342 P((Comp => 123)); -- Illegal in Ada 2005, legal in Ada 95
21343
21344 6.j/2
21345 The call to P is ambiguous in Ada 2005, while it would not be
21346 ambiguous in Ada 95 as the aggregate could not have a limited
21347 type. Qualifying the aggregate will eliminate any ambiguity.
21348 This construction would be rather confusing to a maintenance
21349 programmer, so it should be avoided, and thus we expect it to
21350 be rare.
21351
21352 _Extensions to Ada 95_
21353
21354 6.k/2
21355 {AI95-00287-01AI95-00287-01} Aggregates can be of a limited
21356 type.
21357
21358 * Menu:
21359
21360 * 4.3.1 :: Record Aggregates
21361 * 4.3.2 :: Extension Aggregates
21362 * 4.3.3 :: Array Aggregates
21363
21364 \1f
21365 File: aarm2012.info, Node: 4.3.1, Next: 4.3.2, Up: 4.3
21366
21367 4.3.1 Record Aggregates
21368 -----------------------
21369
21370 1
21371 [In a record_aggregate, a value is specified for each component of the
21372 record or record extension value, using either a named or a positional
21373 association.]
21374
21375 _Syntax_
21376
21377 2
21378 record_aggregate ::= (record_component_association_list)
21379
21380 3
21381 record_component_association_list ::=
21382 record_component_association {, record_component_association}
21383 | null record
21384
21385 4/2
21386 {AI95-00287-01AI95-00287-01} record_component_association ::=
21387 [component_choice_list =>] expression
21388 | component_choice_list => <>
21389
21390 5
21391 component_choice_list ::=
21392 component_selector_name {| component_selector_name}
21393 | others
21394
21395 6
21396 A record_component_association (*note 4.3.1: S0109.) is a named
21397 component association if it has a component_choice_list; otherwise,
21398 it is a positional component association. Any positional component
21399 associations shall precede any named component associations. If
21400 there is a named association with a component_choice_list of
21401 others, it shall come last.
21402
21403 6.a
21404 Discussion: These rules were implied by the BNF in an early
21405 version of the RM9X, but it made the grammar harder to read,
21406 and was inconsistent with how we handle discriminant
21407 constraints. Note that for array aggregates we still express
21408 some of the rules in the grammar, but array aggregates are
21409 significantly different because an array aggregate is either
21410 all positional (with a possible others at the end), or all
21411 named.
21412
21413 7
21414 In the record_component_association_list (*note 4.3.1: S0108.) for
21415 a record_aggregate (*note 4.3.1: S0107.), if there is only one
21416 association, it shall be a named association.
21417
21418 7.a/3
21419 Reason: {AI05-0264-1AI05-0264-1} Otherwise, the construct
21420 would be interpreted as a parenthesized expression. This is
21421 considered a syntax rule, since it is relevant to overload
21422 resolution. We choose not to express it with BNF so we can
21423 share the definition of record_component_association_list in
21424 both record_aggregate and extension_aggregate.
21425
21426 7.b
21427 Ramification: The record_component_association_list of an
21428 extension_aggregate does not have such a restriction.
21429
21430 _Name Resolution Rules_
21431
21432 8/2
21433 {AI95-00287-01AI95-00287-01} The expected type for a record_aggregate
21434 shall be a single record type or record extension.
21435
21436 8.a
21437 Ramification: This rule is used to resolve whether an
21438 aggregate is an array_aggregate or a record_aggregate. The
21439 presence of a with is used to resolve between a
21440 record_aggregate and an extension_aggregate.
21441
21442 9
21443 For the record_component_association_list (*note 4.3.1: S0108.) of a
21444 record_aggregate (*note 4.3.1: S0107.), all components of the composite
21445 value defined by the aggregate are needed[; for the association list of
21446 an extension_aggregate, only those components not determined by the
21447 ancestor expression or subtype are needed (see *note 4.3.2::).] Each
21448 selector_name (*note 4.1.3: S0099.) in a record_component_association
21449 (*note 4.3.1: S0109.) shall denote a needed component [(including
21450 possibly a discriminant)].
21451
21452 9.a
21453 Ramification: For the association list of a record_aggregate,
21454 "needed components" includes every component of the composite
21455 value, but does not include those in unchosen variants (see
21456 AI83-309). If there are variants, then the value specified
21457 for the discriminant that governs them determines which
21458 variant is chosen, and hence which components are needed.
21459
21460 9.b
21461 If an extension defines a new known_discriminant_part, then
21462 all of its discriminants are needed in the component
21463 association list of an extension aggregate for that type, even
21464 if the discriminants have the same names and types as
21465 discriminants of the type of the ancestor expression. This is
21466 necessary to ensure that the positions in the
21467 record_component_association_list (*note 4.3.1: S0108.) are
21468 well defined, and that discriminants that govern variant_parts
21469 can be given by static expressions.
21470
21471 10
21472 The expected type for the expression of a record_component_association
21473 (*note 4.3.1: S0109.) is the type of the associated component(s); the
21474 associated component(s) are as follows:
21475
21476 11
21477 * For a positional association, the component [(including possibly a
21478 discriminant)] in the corresponding relative position (in the
21479 declarative region of the type), counting only the needed
21480 components;
21481
21482 11.a
21483 Ramification: This means that for an association list of an
21484 extension_aggregate, only noninherited components are counted
21485 to determine the position.
21486
21487 11.b/3
21488 {AI05-0005-1AI05-0005-1} For a derived type (including type
21489 extensions), the order of declaration is defined in *note
21490 3.4::, "*note 3.4:: Derived Types and Classes". In
21491 particular, all discriminants come first, regardless of
21492 whether they are defined for the parent type or are newly
21493 added to the derived type.
21494
21495 12
21496 * For a named association with one or more component_selector_names,
21497 the named component(s);
21498
21499 13
21500 * For a named association with the reserved word others, all needed
21501 components that are not associated with some previous association.
21502
21503 _Legality Rules_
21504
21505 14
21506 If the type of a record_aggregate is a record extension, then it shall
21507 be a descendant of a record type, through one or more record extensions
21508 (and no private extensions).
21509
21510 15/3
21511 {AI05-0016-1AI05-0016-1} The reserved words null record may appear only
21512 if there are no components needed in a given
21513 record_component_association_list (*note 4.3.1: S0108.).
21514
21515 15.a
21516 Ramification: For example, "(null record)" is a
21517 record_aggregate for a null record type. Similarly, "(T'(A)
21518 with null record)" is an extension_aggregate for a type
21519 defined as a null record extension of T.
21520
21521 15.b/3
21522 {AI05-0016-1AI05-0016-1} If no components are needed and null
21523 record is not used, the record_component_association (*note
21524 4.3.1: S0109.) must necessarily be others => <>, as that is
21525 the only record_component_association (*note 4.3.1: S0109.)
21526 that does not require an associated component.
21527
21528 16/3
21529 {AI95-00287-01AI95-00287-01} {AI05-0199-1AI05-0199-1} Each
21530 record_component_association other than an others choice with a <> shall
21531 have at least one associated component, and each needed component shall
21532 be associated with exactly one record_component_association (*note
21533 4.3.1: S0109.). If a record_component_association (*note 4.3.1: S0109.)
21534 with an expression has two or more associated components, all of them
21535 shall be of the same type, or all of them shall be of anonymous access
21536 types whose subtypes statically match.
21537
21538 16.a/2
21539 Ramification: {AI95-00287-01AI95-00287-01} These rules apply
21540 to an association with an others choice with an expression.
21541 An others choice with a <> can match zero components or
21542 several components with different types.
21543
21544 16.b/2
21545 Reason: {AI95-00287-01AI95-00287-01} Without these rules,
21546 there would be no way to know what was the expected type for
21547 the expression of the association. Note that some of the
21548 rules do not apply to <> associations, as we do not need to
21549 resolve anything. We allow others => <> to match no
21550 components as this is similar to array aggregates. That means
21551 that (others => <>) always represents a default-initialized
21552 record or array value.
21553
21554 16.c
21555 Discussion: AI83-00244 also requires that the expression shall
21556 be legal for each associated component. This is because even
21557 though two components have the same type, they might have
21558 different subtypes. Therefore, the legality of the
21559 expression, particularly if it is an array aggregate, might
21560 differ depending on the associated component's subtype.
21561 However, we have relaxed the rules on array aggregates
21562 slightly for Ada 95, so the staticness of an applicable index
21563 constraint has no effect on the legality of the array
21564 aggregate to which it applies. See *note 4.3.3::. This was
21565 the only case (that we know of) where a subtype provided by
21566 context affected the legality of an expression.
21567
21568 16.d
21569 Ramification: The rule that requires at least one associated
21570 component for each record_component_association implies that
21571 there can be no extra associations for components that don't
21572 exist in the composite value, or that are already determined
21573 by the ancestor expression or subtype of an
21574 extension_aggregate.
21575
21576 16.e
21577 The second part of the first sentence ensures that no needed
21578 components are left out, nor specified twice.
21579
21580 17/3
21581 {AI05-0220-1AI05-0220-1} The value of a discriminant that governs a
21582 variant_part P shall be given by a static expression, unless P is nested
21583 within a variant V that is not selected by the discriminant value
21584 governing the variant_part enclosing V.
21585
21586 17.a
21587 Ramification: This expression might either be given within the
21588 aggregate itself, or in a constraint on the parent subtype in
21589 a derived_type_definition for some ancestor of the type of the
21590 aggregate.
21591
21592 17.1/2
21593 {AI95-00287-01AI95-00287-01} A record_component_association for a
21594 discriminant without a default_expression shall have an expression
21595 rather than <>.
21596
21597 17.b/2
21598 Reason: A discriminant must always have a defined value, but
21599 <> means uninitialized for a discrete type unless the
21600 component has a default value.
21601
21602 _Dynamic Semantics_
21603
21604 18
21605 The evaluation of a record_aggregate consists of the evaluation of the
21606 record_component_association_list (*note 4.3.1: S0108.).
21607
21608 19
21609 For the evaluation of a record_component_association_list (*note 4.3.1:
21610 S0108.), any per-object constraints (see *note 3.8::) for components
21611 specified in the association list are elaborated and any expressions are
21612 evaluated and converted to the subtype of the associated component. Any
21613 constraint elaborations and expression evaluations (and conversions)
21614 occur in an arbitrary order, except that the expression for a
21615 discriminant is evaluated (and converted) prior to the elaboration of
21616 any per-object constraint that depends on it, which in turn occurs prior
21617 to the evaluation and conversion of the expression for the component
21618 with the per-object constraint.
21619
21620 19.a
21621 Ramification: The conversion in the first rule might raise
21622 Constraint_Error.
21623
21624 19.b
21625 Discussion: This check in the first rule presumably happened
21626 as part of the dependent compatibility check in Ada 83.
21627
21628 19.1/2
21629 {AI95-00287-01AI95-00287-01} For a record_component_association with an
21630 expression, the expression defines the value for the associated
21631 component(s). For a record_component_association with <>, if the
21632 component_declaration has a default_expression, that default_expression
21633 defines the value for the associated component(s); otherwise, the
21634 associated component(s) are initialized by default as for a stand-alone
21635 object of the component subtype (see *note 3.3.1::).
21636
21637 20
21638 The expression of a record_component_association is evaluated (and
21639 converted) once for each associated component.
21640
21641 20.a/3
21642 Ramification: {AI05-0005-1AI05-0005-1} We don't need similar
21643 language for <>, as we're considering the value of <> for each
21644 individual component. Each component has its own default
21645 expression or its own default initialization (they can be
21646 different for each component; the components even could have
21647 different types), and each one has to be evaluated. So there
21648 is no need to repeat that.
21649
21650 NOTES
21651
21652 21
21653 7 For a record_aggregate with positional associations, expressions
21654 specifying discriminant values appear first since the
21655 known_discriminant_part is given first in the declaration of the
21656 type; they have to be in the same order as in the
21657 known_discriminant_part.
21658
21659 _Examples_
21660
21661 22
21662 Example of a record aggregate with positional associations:
21663
21664 23
21665 (4, July, 1776) -- see *note 3.8::
21666
21667 24
21668 Examples of record aggregates with named associations:
21669
21670 25
21671 (Day => 4, Month => July, Year => 1776)
21672 (Month => July, Day => 4, Year => 1776)
21673
21674 26
21675 (Disk, Closed, Track => 5, Cylinder => 12) -- see *note 3.8.1::
21676 (Unit => Disk, Status => Closed, Cylinder => 9, Track => 1)
21677
21678 27/2
21679 {AI95-00287-01AI95-00287-01} Examples of component associations with
21680 several choices:
21681
21682 28
21683 (Value => 0, Succ|Pred => new Cell'(0, null, null)) -- see *note 3.10.1::
21684
21685 29
21686 -- The allocator is evaluated twice: Succ and Pred designate different cells
21687
21688 29.1/2
21689 (Value => 0, Succ|Pred => <>) -- see *note 3.10.1::
21690
21691 29.2/2
21692 -- Succ and Pred will be set to null
21693
21694 30
21695 Examples of record aggregates for tagged types (see *note 3.9:: and
21696 *note 3.9.1::):
21697
21698 31
21699 Expression'(null record)
21700 Literal'(Value => 0.0)
21701 Painted_Point'(0.0, Pi/2.0, Paint => Red)
21702
21703 _Extensions to Ada 83_
21704
21705 31.a
21706 Null record aggregates may now be specified, via "(null
21707 record)". However, this syntax is more useful for null record
21708 extensions in extension aggregates.
21709
21710 _Wording Changes from Ada 83_
21711
21712 31.b
21713 Various AIs have been incorporated (AI83-00189, AI83-00244,
21714 and AI83-00309). In particular, Ada 83 did not explicitly
21715 disallow extra values in a record aggregate. Now we do.
21716
21717 _Extensions to Ada 95_
21718
21719 31.c/2
21720 {AI95-00287-01AI95-00287-01} <> can be used in place of an
21721 expression in a record_aggregate, default initializing the
21722 component.
21723
21724 _Wording Changes from Ada 95_
21725
21726 31.d/2
21727 {AI95-00287-01AI95-00287-01} Limited record_aggregates are
21728 allowed (since all kinds of aggregates can now be limited, see
21729 *note 4.3::).
21730
21731 _Incompatibilities With Ada 2005_
21732
21733 31.e/3
21734 {AI05-0220-1AI05-0220-1} Correction: Corrected wording so that
21735 the rule for discriminants governing variant_parts was not
21736 effectively circular. The change makes a few aggregates where
21737 a nonstatic discriminant governs an empty variant_part
21738 illegal. However, most Ada implementations already enforce
21739 some version of the new rule and already reject these
21740 aggregates. So it is unlikely that any incompatibility will
21741 be noticed in practice.
21742
21743 _Extensions to Ada 2005_
21744
21745 31.f/3
21746 {AI05-0016-1AI05-0016-1} Correction: Fixed the wording so that
21747 others => <> can be used in place of null record. This is
21748 needed to avoid a generic contract issue for generic bodies:
21749 we do not want to have to assume the worst to disallow others
21750 => <> if the record type might be a null record.
21751
21752 31.g/3
21753 {AI05-0199-1AI05-0199-1} Correction: We now allow multiple
21754 components with anonymous access types to be specified with a
21755 single component association. This is to be consistent with
21756 the capabilities of a named access type.
21757
21758 \1f
21759 File: aarm2012.info, Node: 4.3.2, Next: 4.3.3, Prev: 4.3.1, Up: 4.3
21760
21761 4.3.2 Extension Aggregates
21762 --------------------------
21763
21764 1
21765 [An extension_aggregate specifies a value for a type that is a record
21766 extension by specifying a value or subtype for an ancestor of the type,
21767 followed by associations for any components not determined by the
21768 ancestor_part.]
21769
21770 _Language Design Principles_
21771
21772 1.a
21773 The model underlying this syntax is that a record extension
21774 can also be viewed as a regular record type with an ancestor
21775 "prefix." The record_component_association_list (*note 4.3.1:
21776 S0108.) corresponds to exactly what would be needed if there
21777 were no ancestor/prefix type. The ancestor_part determines
21778 the value of the ancestor/prefix.
21779
21780 _Syntax_
21781
21782 2
21783 extension_aggregate ::=
21784 (ancestor_part with record_component_association_list)
21785
21786 3
21787 ancestor_part ::= expression | subtype_mark
21788
21789 _Name Resolution Rules_
21790
21791 4/2
21792 {AI95-00287-01AI95-00287-01} The expected type for an
21793 extension_aggregate shall be a single type that is a record extension.
21794 If the ancestor_part is an expression, it is expected to be of any
21795 tagged type.
21796
21797 4.a
21798 Reason: We could have made the expected type T'Class where T
21799 is the ultimate ancestor of the type of the aggregate, or we
21800 could have made it even more specific than that. However, if
21801 the overload resolution rules get too complicated, the
21802 implementation gets more difficult and it becomes harder to
21803 produce good error messages.
21804
21805 4.b/3
21806 Ramification: {AI05-0005-1AI05-0005-1} This rule is additive
21807 with the rule given in *note 4.3::. That means the *note
21808 4.3:: rule must be satisfied even though it is always
21809 syntactically possible to tell that something is an extension
21810 aggregate rather than another kind of aggregate.
21811 Specifically, that means that an extension aggregate is
21812 ambiguous if the context is overloaded on array and/or
21813 untagged record types, even though those are never legal
21814 contexts for an extension aggregate. Thus, this rule acts
21815 more like a Legality Rules than a Name Resolution Rules.
21816
21817 _Legality Rules_
21818
21819 5/3
21820 {AI95-00306-01AI95-00306-01} {AI05-0115-1AI05-0115-1} If the
21821 ancestor_part is a subtype_mark, it shall denote a specific tagged
21822 subtype. If the ancestor_part is an expression, it shall not be
21823 dynamically tagged. The type of the extension_aggregate shall be a
21824 descendant of the type of the ancestor_part (the ancestor type), through
21825 one or more record extensions (and no private extensions). If the
21826 ancestor_part is a subtype_mark, the view of the ancestor type from
21827 which the type is descended (see *note 7.3.1::) shall not have unknown
21828 discriminants.
21829
21830 5.a/2
21831 Reason: {AI95-00306-01AI95-00306-01} The expression cannot be
21832 dynamically tagged to prevent implicit "truncation" of a
21833 dynamically-tagged value to the specific ancestor type. This
21834 is similar to the rules in *note 3.9.2::.
21835
21836 5.1/3
21837 {AI05-0067-1AI05-0067-1} {AI05-0244-1AI05-0244-1} If the type of the
21838 ancestor_part is limited and at least one component is needed in the
21839 record_component_association_list, then the ancestor_part shall not be:
21840
21841 5.2/3
21842 * a call to a function with an unconstrained result subtype; nor
21843
21844 5.3/3
21845 * a parenthesized or qualified expression whose operand would violate
21846 this rule; nor
21847
21848 5.4/3
21849 * a conditional_expression having at least one dependent_expression
21850 that would violate this rule.
21851
21852 5.b/3
21853 Reason: {AI05-0067-1AI05-0067-1} {AI05-0244-1AI05-0244-1} This
21854 restriction simplifies implementation, because it ensures that
21855 either the caller or the callee knows the size to allocate for
21856 the aggregate. Without this restriction, information from
21857 both caller and callee would have to be combined to determine
21858 the appropriate size.
21859
21860 5.c/3
21861 {AI05-0067-1AI05-0067-1} The (F(...) with null record) case
21862 is exempt from this rule, because such extension aggregates
21863 are created internally for inherited functions returning
21864 null-extension types -- we can't very well make those illegal.
21865 Moreover, we don't need the rule for null extensions, as the
21866 result can simply use the space returned by the function call.
21867
21868 _Static Semantics_
21869
21870 6
21871 For the record_component_association_list (*note 4.3.1: S0108.) of an
21872 extension_aggregate (*note 4.3.2: S0111.), the only components needed
21873 are those of the composite value defined by the aggregate that are not
21874 inherited from the type of the ancestor_part (*note 4.3.2: S0112.), plus
21875 any inherited discriminants if the ancestor_part (*note 4.3.2: S0112.)
21876 is a subtype_mark (*note 3.2.2: S0028.) that denotes an unconstrained
21877 subtype.
21878
21879 _Dynamic Semantics_
21880
21881 7
21882 For the evaluation of an extension_aggregate, the
21883 record_component_association_list (*note 4.3.1: S0108.) is evaluated.
21884 If the ancestor_part is an expression, it is also evaluated; if the
21885 ancestor_part is a subtype_mark, the components of the value of the
21886 aggregate not given by the record_component_association_list (*note
21887 4.3.1: S0108.) are initialized by default as for an object of the
21888 ancestor type. Any implicit initializations or evaluations are
21889 performed in an arbitrary order, except that the expression for a
21890 discriminant is evaluated prior to any other evaluation or
21891 initialization that depends on it.
21892
21893 8/3
21894 {AI05-0282-1AI05-0282-1} If the type of the ancestor_part has
21895 discriminants and the ancestor_part is not a subtype_mark that denotes
21896 an unconstrained subtype, then a check is made that each discriminant
21897 determined by the ancestor_part has the value specified for a
21898 corresponding discriminant, if any, either in the
21899 record_component_association_list (*note 4.3.1: S0108.), or in the
21900 derived_type_definition for some ancestor of the type of the
21901 extension_aggregate. Constraint_Error is raised if this check fails.
21902
21903 8.a
21904 Ramification: Corresponding and specified discriminants are
21905 defined in *note 3.7::. The rules requiring static
21906 compatibility between new discriminants of a derived type and
21907 the parent discriminant(s) they constrain ensure that at most
21908 one check is required per discriminant of the ancestor
21909 expression.
21910
21911 8.b/3
21912 {AI05-0282-1AI05-0282-1} The check needs to be made any time
21913 that the ancestor is constrained; the source of the
21914 discriminants or the constraints is irrelevant.
21915
21916 NOTES
21917
21918 9
21919 8 If all components of the value of the extension_aggregate are
21920 determined by the ancestor_part, then the
21921 record_component_association_list (*note 4.3.1: S0108.) is required
21922 to be simply null record.
21923
21924 10
21925 9 If the ancestor_part is a subtype_mark, then its type can be
21926 abstract. If its type is controlled, then as the last step of
21927 evaluating the aggregate, the Initialize procedure of the ancestor
21928 type is called, unless the Initialize procedure is abstract (see
21929 *note 7.6::).
21930
21931 _Examples_
21932
21933 11
21934 Examples of extension aggregates (for types defined in *note 3.9.1::):
21935
21936 12
21937 Painted_Point'(Point with Red)
21938 (Point'(P) with Paint => Black)
21939
21940 13
21941 (Expression with Left => 1.2, Right => 3.4)
21942 Addition'(Binop with null record)
21943 -- presuming Binop is of type Binary_Operation
21944
21945 _Extensions to Ada 83_
21946
21947 13.a
21948 The extension aggregate syntax is new.
21949
21950 _Incompatibilities With Ada 95_
21951
21952 13.b/2
21953 {AI95-00306-01AI95-00306-01} Amendment Correction: Eliminated
21954 implicit "truncation" of a dynamically tagged value when it is
21955 used as an ancestor expression. If an aggregate includes such
21956 an expression, it is illegal in Ada 2005. Such aggregates are
21957 thought to be rare; the problem can be fixed with a type
21958 conversion to the appropriate specific type if it occurs.
21959
21960 _Wording Changes from Ada 95_
21961
21962 13.c/2
21963 {AI95-00287-01AI95-00287-01} Limited extension_aggregates are
21964 allowed (since all kinds of aggregates can now be limited, see
21965 *note 4.3::).
21966
21967 _Inconsistencies With Ada 2005_
21968
21969 13.d/3
21970 {AI05-0282-1AI05-0282-1} Correction: An extension_aggregate
21971 with an ancestor_part whose discriminants are constrained and
21972 inherited might now raise Constraint_Error if the aggregate's
21973 type is constrained, while it was OK in Ada 2005. In almost
21974 all cases, this will make no difference as the constraint will
21975 be checked by the immediately following use of the aggregate,
21976 but it is possible to compare such an aggregate for equality;
21977 in this case, no exception would be raised by Ada 2005, while
21978 Ada 2012 will raise Constraint_Error. This should be very
21979 rare, and having the possibility means that the representation
21980 of the aggregate type has to be able to support unconstrained
21981 values of the type, even if the first subtype is constrained
21982 and no such objects can be created any other way.
21983
21984 _Incompatibilities With Ada 2005_
21985
21986 13.e/3
21987 {AI05-0067-1AI05-0067-1} Correction: A limited unconstrained
21988 ancestor expression that is a function call is now illegal
21989 unless the extension part is null. Such aggregates were first
21990 introduced in Ada 2005 and are very complex to implement as
21991 they must be built-in-place with an unknown size; as such, it
21992 is unlikely that they are implemented correctly in existing
21993 compilers and thus not often used in existing code.
21994
21995 13.f/3
21996 {AI05-0115-1AI05-0115-1} Correction: An ancestor_part that is
21997 a subtype with unknown discriminants is now explicitly
21998 illegal. Such a subtype should not be used to declare an
21999 object, and the ancestor_part acts like an object. The Ada 95
22000 rules did not disallow such cases, so it is possible that code
22001 exists that uses such an ancestor, but this should be rare.
22002
22003 \1f
22004 File: aarm2012.info, Node: 4.3.3, Prev: 4.3.2, Up: 4.3
22005
22006 4.3.3 Array Aggregates
22007 ----------------------
22008
22009 1
22010 [In an array_aggregate, a value is specified for each component of an
22011 array, either positionally or by its index.] For a
22012 positional_array_aggregate, the components are given in increasing-index
22013 order, with a final others, if any, representing any remaining
22014 components. For a named_array_aggregate, the components are identified
22015 by the values covered by the discrete_choices.
22016
22017 _Language Design Principles_
22018
22019 1.a/1
22020 The rules in this subclause are based on terms and rules for
22021 discrete_choice_lists defined in *note 3.8.1::, "*note 3.8.1::
22022 Variant Parts and Discrete Choices". For example, the
22023 requirements that others come last and stand alone are found
22024 there.
22025
22026 _Syntax_
22027
22028 2
22029 array_aggregate ::=
22030 positional_array_aggregate | named_array_aggregate
22031
22032 3/2
22033 {AI95-00287-01AI95-00287-01} positional_array_aggregate ::=
22034 (expression, expression {, expression})
22035 | (expression {, expression}, others => expression)
22036 | (expression {, expression}, others => <>)
22037
22038 4
22039 named_array_aggregate ::=
22040 (array_component_association {, array_component_association})
22041
22042 5/2
22043 {AI95-00287-01AI95-00287-01} array_component_association ::=
22044 discrete_choice_list => expression
22045 | discrete_choice_list => <>
22046
22047 6
22048 An n-dimensional array_aggregate is one that is written as n levels of
22049 nested array_aggregates (or at the bottom level, equivalent
22050 string_literals). For the multidimensional case (n >= 2) the
22051 array_aggregates (or equivalent string_literals) at the n-1 lower levels
22052 are called subaggregates of the enclosing n-dimensional array_aggregate.
22053 The expressions of the bottom level subaggregates (or of the
22054 array_aggregate itself if one-dimensional) are called the array
22055 component expressions of the enclosing n-dimensional array_aggregate.
22056
22057 6.a
22058 Ramification: Subaggregates do not have a type. They
22059 correspond to part of an array. For example, with a matrix, a
22060 subaggregate would correspond to a single row of the matrix.
22061 The definition of "n-dimensional" array_aggregate applies to
22062 subaggregates as well as aggregates that have a type.
22063
22064 6.b
22065 To be honest: An others choice is the reserved word others as
22066 it appears in a positional_array_aggregate or as the
22067 discrete_choice of the discrete_choice_list in an
22068 array_component_association.
22069
22070 _Name Resolution Rules_
22071
22072 7/2
22073 {AI95-00287-01AI95-00287-01} The expected type for an array_aggregate
22074 (that is not a subaggregate) shall be a single array type. The
22075 component type of this array type is the expected type for each array
22076 component expression of the array_aggregate.
22077
22078 7.a/2
22079 Ramification: {AI95-00287-01AI95-00287-01} We already require
22080 a single array or record type or record extension for an
22081 aggregate. The above rule requiring a single array type (and
22082 similar ones for record and extension aggregates) resolves
22083 which kind of aggregate you have.
22084
22085 8
22086 The expected type for each discrete_choice in any discrete_choice_list
22087 of a named_array_aggregate is the type of the corresponding index; the
22088 corresponding index for an array_aggregate that is not a subaggregate is
22089 the first index of its type; for an (n-m)-dimensional subaggregate
22090 within an array_aggregate of an n-dimensional type, the corresponding
22091 index is the index in position m+1.
22092
22093 _Legality Rules_
22094
22095 9
22096 An array_aggregate of an n-dimensional array type shall be written as an
22097 n-dimensional array_aggregate.
22098
22099 9.a
22100 Ramification: In an m-dimensional array_aggregate [(including
22101 a subaggregate)], where m >= 2, each of the expressions has to
22102 be an (m-1)-dimensional subaggregate.
22103
22104 10
22105 An others choice is allowed for an array_aggregate only if an applicable
22106 index constraint applies to the array_aggregate. [An applicable index
22107 constraint is a constraint provided by certain contexts where an
22108 array_aggregate is permitted that can be used to determine the bounds of
22109 the array value specified by the aggregate.] Each of the following
22110 contexts (and none other) defines an applicable index constraint:
22111
22112 11/2
22113 * {AI95-00318-02AI95-00318-02} For an explicit_actual_parameter, an
22114 explicit_generic_actual_parameter, the expression of a return
22115 statement, the initialization expression in an object_declaration
22116 (*note 3.3.1: S0032.), or a default_expression (*note 3.7: S0063.)
22117 [(for a parameter or a component)], when the nominal subtype of the
22118 corresponding formal parameter, generic formal parameter, function
22119 return object, object, or component is a constrained array subtype,
22120 the applicable index constraint is the constraint of the subtype;
22121
22122 12
22123 * For the expression of an assignment_statement where the name
22124 denotes an array variable, the applicable index constraint is the
22125 constraint of the array variable;
22126
22127 12.a
22128 Reason: This case is broken out because the constraint comes
22129 from the actual subtype of the variable (which is always
22130 constrained) rather than its nominal subtype (which might be
22131 unconstrained).
22132
22133 13
22134 * For the operand of a qualified_expression whose subtype_mark
22135 denotes a constrained array subtype, the applicable index
22136 constraint is the constraint of the subtype;
22137
22138 14
22139 * For a component expression in an aggregate, if the component's
22140 nominal subtype is a constrained array subtype, the applicable
22141 index constraint is the constraint of the subtype;
22142
22143 14.a
22144 Discussion: Here, the array_aggregate with others is being
22145 used within a larger aggregate.
22146
22147 15/3
22148 * {AI05-0147-1AI05-0147-1} For a parenthesized expression, the
22149 applicable index constraint is that, if any, defined for the
22150 expression;
22151
22152 15.a
22153 Discussion: RM83 omitted this case, presumably as an
22154 oversight. We want to minimize situations where an expression
22155 becomes illegal if parenthesized.
22156
22157 15.1/3
22158 * {AI05-0147-1AI05-0147-1} For a conditional_expression, the
22159 applicable index constraint for each dependent_expression is that,
22160 if any, defined for the conditional_expression.
22161
22162 16
22163 The applicable index constraint applies to an array_aggregate that
22164 appears in such a context, as well as to any subaggregates thereof. In
22165 the case of an explicit_actual_parameter (or default_expression) for a
22166 call on a generic formal subprogram, no applicable index constraint is
22167 defined.
22168
22169 16.a
22170 Reason: This avoids generic contract model problems, because
22171 only mode conformance is required when matching actual
22172 subprograms with generic formal subprograms.
22173
22174 17/3
22175 {AI05-0153-3AI05-0153-3} The discrete_choice_list of an
22176 array_component_association is allowed to have a discrete_choice that is
22177 a nonstatic choice_expression or that is a subtype_indication or range
22178 that defines a nonstatic or null range, only if it is the single
22179 discrete_choice of its discrete_choice_list, and there is only one
22180 array_component_association in the array_aggregate.
22181
22182 17.a
22183 Discussion: We now allow a nonstatic others choice even if
22184 there are other array component expressions as well.
22185
22186 18/3
22187 {AI05-0262-1AI05-0262-1} In a named_array_aggregate where all
22188 discrete_choices are static, no two discrete_choices are allowed to
22189 cover the same value (see *note 3.8.1::); if there is no others choice,
22190 the discrete_choices taken together shall exactly cover a contiguous
22191 sequence of values of the corresponding index type.
22192
22193 18.a
22194 Ramification: This implies that each component must be
22195 specified exactly once. See AI83-309.
22196
22197 18.b/3
22198 Reason: {AI05-0262-1AI05-0262-1} This has to apply even if
22199 there is only one static discrete_choice; a single choice has
22200 to represent a contiguous range (a subtype_mark with a static
22201 predicate might represent a discontiguous set of values). If
22202 the (single) choice is a dynamic subtype, we don't need to
22203 make this check as no predicates are allowed (see *note
22204 3.2.4::) and thus the range has to be contiguous.
22205
22206 19
22207 A bottom level subaggregate of a multidimensional array_aggregate of a
22208 given array type is allowed to be a string_literal only if the component
22209 type of the array type is a character type; each character of such a
22210 string_literal shall correspond to a defining_character_literal of the
22211 component type.
22212
22213 _Static Semantics_
22214
22215 20
22216 A subaggregate that is a string_literal is equivalent to one that is a
22217 positional_array_aggregate of the same length, with each expression
22218 being the character_literal for the corresponding character of the
22219 string_literal.
22220
22221 _Dynamic Semantics_
22222
22223 21
22224 The evaluation of an array_aggregate of a given array type proceeds in
22225 two steps:
22226
22227 22
22228 1. Any discrete_choices of this aggregate and of its subaggregates
22229 are evaluated in an arbitrary order, and converted to the
22230 corresponding index type;
22231
22232 23
22233 2. The array component expressions of the aggregate are evaluated
22234 in an arbitrary order and their values are converted to the
22235 component subtype of the array type; an array component expression
22236 is evaluated once for each associated component.
22237
22238 23.a
22239 Ramification: Subaggregates are not separately evaluated. The
22240 conversion of the value of the component expressions to the
22241 component subtype might raise Constraint_Error.
22242
22243 23.b/3
22244 {AI05-0005-1AI05-0005-1} We don't need to say that <> is
22245 evaluated once for each component, as <> means that each
22246 component is initialized by default. That means that the
22247 actions defined for default initialization are applied to each
22248 component individually. Initializing one component by default
22249 and copying that to the others would be an incorrect
22250 implementation in general (although it might be OK if the
22251 default initialization is known to be constant).
22252
22253 23.1/2
22254 {AI95-00287-01AI95-00287-01} Each expression in an
22255 array_component_association defines the value for the associated
22256 component(s). For an array_component_association with <>, the
22257 associated component(s) are initialized by default as for a stand-alone
22258 object of the component subtype (see *note 3.3.1::).
22259
22260 24
22261 The bounds of the index range of an array_aggregate [(including a
22262 subaggregate)] are determined as follows:
22263
22264 25
22265 * For an array_aggregate with an others choice, the bounds are those
22266 of the corresponding index range from the applicable index
22267 constraint;
22268
22269 26
22270 * For a positional_array_aggregate [(or equivalent string_literal)]
22271 without an others choice, the lower bound is that of the
22272 corresponding index range in the applicable index constraint, if
22273 defined, or that of the corresponding index subtype, if not; in
22274 either case, the upper bound is determined from the lower bound and
22275 the number of expressions [(or the length of the string_literal)];
22276
22277 27
22278 * For a named_array_aggregate without an others choice, the bounds
22279 are determined by the smallest and largest index values covered by
22280 any discrete_choice_list.
22281
22282 27.a
22283 Reason: We don't need to say that each index value has to be
22284 covered exactly once, since that is a ramification of the
22285 general rule on aggregates that each component's value has to
22286 be specified exactly once.
22287
22288 28
22289 For an array_aggregate, a check is made that the index range defined by
22290 its bounds is compatible with the corresponding index subtype.
22291
22292 28.a
22293 Discussion: In RM83, this was phrased more explicitly, but
22294 once we define "compatibility" between a range and a subtype,
22295 it seems to make sense to take advantage of that definition.
22296
22297 28.b
22298 Ramification: The definition of compatibility handles the
22299 special case of a null range, which is always compatible with
22300 a subtype. See AI83-00313.
22301
22302 29/3
22303 {AI05-0037-1AI05-0037-1} For an array_aggregate with an others choice, a
22304 check is made that no expression or <> is specified for an index value
22305 outside the bounds determined by the applicable index constraint.
22306
22307 29.a
22308 Discussion: RM83 omitted this case, apparently through an
22309 oversight. AI83-00309 defines this as a dynamic check, even
22310 though other Ada 83 rules ensured that this check could be
22311 performed statically. We now allow an others choice to be
22312 dynamic, even if it is not the only choice, so this check now
22313 needs to be dynamic, in some cases. Also, within a generic
22314 unit, this would be a nonstatic check in some cases.
22315
22316 30
22317 For a multidimensional array_aggregate, a check is made that all
22318 subaggregates that correspond to the same index have the same bounds.
22319
22320 30.a
22321 Ramification: No array bounds "sliding" is performed on
22322 subaggregates.
22323
22324 30.b
22325 Reason: If sliding were performed, it would not be obvious
22326 which subaggregate would determine the bounds of the
22327 corresponding index.
22328
22329 31
22330 The exception Constraint_Error is raised if any of the above checks
22331 fail.
22332
22333 NOTES
22334
22335 32/3
22336 10 {AI05-0004-1AI05-0004-1} In an array_aggregate, positional
22337 notation may only be used with two or more expressions; a single
22338 expression in parentheses is interpreted as a parenthesized
22339 expression. A named_array_aggregate, such as (1 => X), may be used
22340 to specify an array with a single component.
22341
22342 _Examples_
22343
22344 33
22345 Examples of array aggregates with positional associations:
22346
22347 34
22348 (7, 9, 5, 1, 3, 2, 4, 8, 6, 0)
22349 Table'(5, 8, 4, 1, others => 0) -- see *note 3.6::
22350
22351 35
22352 Examples of array aggregates with named associations:
22353
22354 36
22355 (1 .. 5 => (1 .. 8 => 0.0)) -- two-dimensional
22356 (1 .. N => new Cell) -- N new cells, in particular for N = 0
22357
22358 37
22359 Table'(2 | 4 | 10 => 1, others => 0)
22360 Schedule'(Mon .. Fri => True, others => False) -- see *note 3.6::
22361 Schedule'(Wed | Sun => False, others => True)
22362 Vector'(1 => 2.5) -- single-component vector
22363
22364 38
22365 Examples of two-dimensional array aggregates:
22366
22367 39
22368 -- Three aggregates for the same value of subtype Matrix(1..2,1..3) (see *note 3.6::):
22369
22370 40
22371 ((1.1, 1.2, 1.3), (2.1, 2.2, 2.3))
22372 (1 => (1.1, 1.2, 1.3), 2 => (2.1, 2.2, 2.3))
22373 (1 => (1 => 1.1, 2 => 1.2, 3 => 1.3), 2 => (1 => 2.1, 2 => 2.2, 3 => 2.3))
22374
22375 41
22376 Examples of aggregates as initial values:
22377
22378 42
22379 A : Table := (7, 9, 5, 1, 3, 2, 4, 8, 6, 0); -- A(1)=7, A(10)=0
22380 B : Table := (2 | 4 | 10 => 1, others => 0); -- B(1)=0, B(10)=1
22381 C : constant Matrix := (1 .. 5 => (1 .. 8 => 0.0)); -- C'Last(1)=5, C'Last(2)=8
22382
22383 43
22384 D : Bit_Vector(M .. N) := (M .. N => True); -- see *note 3.6::
22385 E : Bit_Vector(M .. N) := (others => True);
22386 F : String(1 .. 1) := (1 => 'F'); -- a one component aggregate: same as "F"
22387
22388 44/2
22389 {AI95-00433-01AI95-00433-01} Example of an array aggregate with
22390 defaulted others choice and with an applicable index constraint provided
22391 by an enclosing record aggregate:
22392
22393 45/2
22394 Buffer'(Size => 50, Pos => 1, Value => String'('x', others => <>)) -- see *note 3.7::
22395
22396 _Incompatibilities With Ada 83_
22397
22398 45.a.1/1
22399 In Ada 95, no applicable index constraint is defined for a
22400 parameter in a call to a generic formal subprogram; thus, some
22401 aggregates that are legal in Ada 83 are illegal in Ada 95.
22402 For example:
22403
22404 45.a.2/1
22405 subtype S3 is String (1 .. 3);
22406 ...
22407 generic
22408 with function F (The_S3 : in S3) return Integer;
22409 package Gp is
22410 I : constant Integer := F ((1 => '!', others => '?'));
22411 -- The aggregate is legal in Ada 83, illegal in Ada 95.
22412 end Gp;
22413
22414 45.a.3/1
22415 This change eliminates generic contract model problems.
22416
22417 _Extensions to Ada 83_
22418
22419 45.a
22420 We now allow "named with others" aggregates in all contexts
22421 where there is an applicable index constraint, effectively
22422 eliminating what was RM83-4.3.2(6). Sliding never occurs on
22423 an aggregate with others, because its bounds come from the
22424 applicable index constraint, and therefore already match the
22425 bounds of the target.
22426
22427 45.b
22428 The legality of an others choice is no longer affected by the
22429 staticness of the applicable index constraint. This
22430 substantially simplifies several rules, while being slightly
22431 more flexible for the user. It obviates the rulings of
22432 AI83-00244 and AI83-00310, while taking advantage of the
22433 dynamic nature of the "extra values" check required by
22434 AI83-00309.
22435
22436 45.c
22437 Named array aggregates are permitted even if the index type is
22438 descended from a formal scalar type. See *note 4.9:: and
22439 AI83-00190.
22440
22441 _Wording Changes from Ada 83_
22442
22443 45.d
22444 We now separate named and positional array aggregate syntax,
22445 since, unlike other aggregates, named and positional
22446 associations cannot be mixed in array aggregates (except that
22447 an others choice is allowed in a positional array aggregate).
22448
22449 45.e
22450 We have also reorganized the presentation to handle
22451 multidimensional and one-dimensional aggregates more
22452 uniformly, and to incorporate the rulings of AI83-00019,
22453 AI83-00309, etc.
22454
22455 _Extensions to Ada 95_
22456
22457 45.f/2
22458 {AI95-00287-01AI95-00287-01} <> can be used in place of an
22459 expression in an array_aggregate, default-initializing the
22460 component.
22461
22462 _Wording Changes from Ada 95_
22463
22464 45.g/2
22465 {AI95-00287-01AI95-00287-01} Limited array_aggregates are
22466 allowed (since all kinds of aggregates can now be limited, see
22467 *note 4.3::).
22468
22469 45.h/2
22470 {AI95-00318-02AI95-00318-02} Fixed aggregates to use the
22471 subtype of the return object of a function, rather than the
22472 result subtype, because they can be different for an
22473 extended_return_statement, and we want to use the subtype
22474 that's explicitly in the code at the point of the expression.
22475
22476 _Inconsistencies With Ada 2005_
22477
22478 45.i/3
22479 {AI05-0037-1AI05-0037-1} Correction: Fixed so the check for
22480 components outside of the array applies to both expressions
22481 and <>s. As <> was a new feature in Ada 2005, there should be
22482 little existing code that depends on a <> component that is
22483 specified outside of the array (and that is nonsense anyway,
22484 that a compiler is likely to detect even without an explicit
22485 language rule disallowing it).
22486
22487 _Wording Changes from Ada 2005_
22488
22489 45.j/3
22490 {AI05-0147-1AI05-0147-1} Added a definition of the applicable
22491 index constraint for conditional_expressions (which are new).
22492
22493 \1f
22494 File: aarm2012.info, Node: 4.4, Next: 4.5, Prev: 4.3, Up: 4
22495
22496 4.4 Expressions
22497 ===============
22498
22499 1/3
22500 {AI05-0147-1AI05-0147-1} {AI05-0158-1AI05-0158-1}
22501 {AI05-0176-1AI05-0176-1} An expression is a formula that defines the
22502 computation or retrieval of a value. In this International Standard,
22503 the term "expression" refers to a construct of the syntactic category
22504 expression or of any of the following categories: choice_expression,
22505 choice_relation, relation, simple_expression, term, factor, primary,
22506 conditional_expression, quantified_expression.
22507
22508 _Syntax_
22509
22510 2
22511 expression ::=
22512 relation {and relation} | relation {and then relation}
22513 | relation {or relation} | relation {or else relation}
22514 | relation {xor relation}
22515
22516 2.1/3
22517 {AI05-0158-1AI05-0158-1} choice_expression ::=
22518 choice_relation {and choice_relation}
22519 | choice_relation {or choice_relation}
22520 | choice_relation {xor choice_relation}
22521 | choice_relation {and then choice_relation}
22522 | choice_relation {or else choice_relation}
22523
22524 2.2/3
22525 {AI05-0158-1AI05-0158-1} choice_relation ::=
22526 simple_expression [relational_operator simple_expression]
22527
22528 3/3
22529 {AI05-0158-1AI05-0158-1} relation ::=
22530 simple_expression [relational_operator simple_expression]
22531 | simple_expression [not] in membership_choice_list
22532
22533 3.1/3
22534 {AI05-0158-1AI05-0158-1} membership_choice_list ::=
22535 membership_choice {| membership_choice}
22536
22537 3.2/3
22538 {AI05-0158-1AI05-0158-1} membership_choice ::= choice_expression |
22539 range | subtype_mark
22540
22541 4
22542 simple_expression ::= [unary_adding_operator] term {
22543 binary_adding_operator term}
22544
22545 5
22546 term ::= factor {multiplying_operator factor}
22547
22548 6
22549 factor ::= primary [** primary] | abs primary | not primary
22550
22551 7/3
22552 {AI05-0003-1AI05-0003-1} {AI05-0147-1AI05-0147-1}
22553 {AI05-0176-1AI05-0176-1} primary ::=
22554 numeric_literal | null | string_literal | aggregate
22555 | name | allocator | (expression)
22556 | (conditional_expression) | (quantified_expression)
22557
22558 _Name Resolution Rules_
22559
22560 8
22561 A name used as a primary shall resolve to denote an object or a value.
22562
22563 8.a
22564 Discussion: This replaces RM83-4.4(3). We don't need to
22565 mention named numbers explicitly, because the name of a named
22566 number denotes a value. We don't need to mention attributes
22567 explicitly, because attributes now denote (rather than yield)
22568 values in general. Also, the new wording allows attributes
22569 that denote objects, which should always have been allowed (in
22570 case the implementation chose to have such a thing).
22571
22572 8.b
22573 Reason: It might seem odd that this is an overload resolution
22574 rule, but it is relevant during overload resolution. For
22575 example, it helps ensure that a primary that consists of only
22576 the identifier of a parameterless function is interpreted as a
22577 function_call rather than directly as a direct_name.
22578
22579 _Static Semantics_
22580
22581 9
22582 Each expression has a type; it specifies the computation or retrieval of
22583 a value of that type.
22584
22585 _Dynamic Semantics_
22586
22587 10
22588 The value of a primary that is a name denoting an object is the value of
22589 the object.
22590
22591 _Implementation Permissions_
22592
22593 11
22594 For the evaluation of a primary that is a name denoting an object of an
22595 unconstrained numeric subtype, if the value of the object is outside the
22596 base range of its type, the implementation may either raise
22597 Constraint_Error or return the value of the object.
22598
22599 11.a/3
22600 Ramification: {AI05-0299-1AI05-0299-1} This means that if
22601 extra-range intermediates are used to hold the value of an
22602 object of an unconstrained numeric subtype, a Constraint_Error
22603 can be raised on a read of the object, rather than only on an
22604 assignment to it. Similarly, it means that computing the
22605 value of an object of such a subtype can be deferred until the
22606 first read of the object (presuming no side effects other than
22607 failing an Overflow_Check are possible). This permission is
22608 over and above that provided by subclause *note 11.6::, since
22609 this allows the Constraint_Error to move to a different
22610 handler.
22611
22612 11.b
22613 Reason: This permission is intended to allow extra-range
22614 registers to be used efficiently to hold parameters and local
22615 variables, even if they might need to be transferred into
22616 smaller registers for performing certain predefined
22617 operations.
22618
22619 11.c
22620 Discussion: There is no need to mention other kinds of
22621 primarys, since any Constraint_Error to be raised can be
22622 "charged" to the evaluation of the particular kind of primary.
22623
22624 _Examples_
22625
22626 12
22627 Examples of primaries:
22628
22629 13
22630 4.0 -- real literal
22631 Pi -- named number
22632 (1 .. 10 => 0) -- array aggregate
22633 Sum -- variable
22634 Integer'Last -- attribute
22635 Sine(X) -- function call
22636 Color'(Blue) -- qualified expression
22637 Real(M*N) -- conversion
22638 (Line_Count + 10) -- parenthesized expression
22639
22640 14
22641 Examples of expressions:
22642
22643 15/2
22644 {AI95-00433-01AI95-00433-01} Volume -- primary
22645 not Destroyed -- factor
22646 2*Line_Count -- term
22647 -4.0 -- simple expression
22648 -4.0 + A -- simple expression
22649 B**2 - 4.0*A*C -- simple expression
22650 R*Sin([Unicode 952])*Cos([Unicode 966]) -- simple expression
22651 Password(1 .. 3) = "Bwv" -- relation
22652 Count in Small_Int -- relation
22653 Count not in Small_Int -- relation
22654 Index = 0 or Item_Hit -- expression
22655 (Cold and Sunny) or Warm -- expression (parentheses are required)
22656 A**(B**C) -- expression (parentheses are required)
22657
22658 _Extensions to Ada 83_
22659
22660 15.a
22661 In Ada 83, out parameters and their nondiscriminant
22662 subcomponents are not allowed as primaries. These
22663 restrictions are eliminated in Ada 95.
22664
22665 15.b
22666 In various contexts throughout the language where Ada 83
22667 syntax rules had simple_expression, the corresponding Ada 95
22668 syntax rule has expression instead. This reflects the
22669 inclusion of modular integer types, which makes the logical
22670 operators "and", "or", and "xor" more useful in expressions of
22671 an integer type. Requiring parentheses to use these operators
22672 in such contexts seemed unnecessary and potentially confusing.
22673 Note that the bounds of a range still have to be specified by
22674 simple_expressions, since otherwise expressions involving
22675 membership tests might be ambiguous. Essentially, the
22676 operation ".." is of higher precedence than the logical
22677 operators, and hence uses of logical operators still have to
22678 be parenthesized when used in a bound of a range.
22679
22680 _Wording Changes from Ada 2005_
22681
22682 15.c/3
22683 {AI05-0003-1AI05-0003-1} Moved qualified_expression from
22684 primary to name (see *note 4.1::). This allows the use of
22685 qualified_expressions in more places.
22686
22687 15.d/3
22688 {AI05-0147-1AI05-0147-1} {AI05-0176-1AI05-0176-1} Added
22689 conditional_expression and quantified_expression to primary.
22690
22691 15.e/3
22692 {AI05-0158-1AI05-0158-1} Expanded membership test syntax (see
22693 *note 4.5.2::).
22694
22695 \1f
22696 File: aarm2012.info, Node: 4.5, Next: 4.6, Prev: 4.4, Up: 4
22697
22698 4.5 Operators and Expression Evaluation
22699 =======================================
22700
22701 1
22702 [ The language defines the following six categories of operators (given
22703 in order of increasing precedence). The corresponding operator_symbols,
22704 and only those, can be used as designators in declarations of functions
22705 for user-defined operators. See *note 6.6::, "*note 6.6:: Overloading
22706 of Operators".]
22707
22708 _Syntax_
22709
22710 2
22711 logical_operator ::= and | or | xor
22712
22713 3
22714 relational_operator ::= = | /= | < | <= | > | >=
22715
22716 4
22717 binary_adding_operator ::= + | - | &
22718
22719 5
22720 unary_adding_operator ::= + | -
22721
22722 6
22723 multiplying_operator ::= * | / | mod | rem
22724
22725 7
22726 highest_precedence_operator ::= ** | abs | not
22727
22728 7.a
22729 Discussion: Some of the above syntactic categories are not
22730 used in other syntax rules. They are just used for
22731 classification. The others are used for both classification
22732 and parsing.
22733
22734 _Static Semantics_
22735
22736 8
22737 For a sequence of operators of the same precedence level, the operators
22738 are associated with their operands in textual order from left to right.
22739 Parentheses can be used to impose specific associations.
22740
22741 8.a
22742 Discussion: The left-associativity is not directly inherent in
22743 the grammar of *note 4.4::, though in *note 1.1.4:: the
22744 definition of the metasymbols {} implies left associativity.
22745 So this could be seen as redundant, depending on how literally
22746 one interprets the definition of the {} metasymbols.
22747
22748 8.b
22749 See the Implementation Permissions below regarding flexibility
22750 in reassociating operators of the same precedence.
22751
22752 9
22753 For each form of type definition, certain of the above operators are
22754 predefined; that is, they are implicitly declared immediately after the
22755 type definition. For each such implicit operator declaration, the
22756 parameters are called Left and Right for binary operators; the single
22757 parameter is called Right for unary operators. [An expression of the
22758 form X op Y, where op is a binary operator, is equivalent to a
22759 function_call of the form "op"(X, Y). An expression of the form op Y,
22760 where op is a unary operator, is equivalent to a function_call of the
22761 form "op"(Y). The predefined operators and their effects are described
22762 in subclauses *note 4.5.1:: through *note 4.5.6::.]
22763
22764 _Dynamic Semantics_
22765
22766 10
22767 [ The predefined operations on integer types either yield the
22768 mathematically correct result or raise the exception Constraint_Error.
22769 For implementations that support the Numerics Annex, the predefined
22770 operations on real types yield results whose accuracy is defined in
22771 *note Annex G::, or raise the exception Constraint_Error. ]
22772
22773 10.a
22774 To be honest: Predefined operations on real types can
22775 "silently" give wrong results when the Machine_Overflows
22776 attribute is false, and the computation overflows.
22777
22778 _Implementation Requirements_
22779
22780 11
22781 The implementation of a predefined operator that delivers a result of an
22782 integer or fixed point type may raise Constraint_Error only if the
22783 result is outside the base range of the result type.
22784
22785 12
22786 The implementation of a predefined operator that delivers a result of a
22787 floating point type may raise Constraint_Error only if the result is
22788 outside the safe range of the result type.
22789
22790 12.a
22791 To be honest: An exception is made for exponentiation by a
22792 negative exponent in *note 4.5.6::.
22793
22794 _Implementation Permissions_
22795
22796 13
22797 For a sequence of predefined operators of the same precedence level (and
22798 in the absence of parentheses imposing a specific association), an
22799 implementation may impose any association of the operators with operands
22800 so long as the result produced is an allowed result for the
22801 left-to-right association, but ignoring the potential for failure of
22802 language-defined checks in either the left-to-right or chosen order of
22803 association.
22804
22805 13.a
22806 Discussion: Note that the permission to reassociate the
22807 operands in any way subject to producing a result allowed for
22808 the left-to-right association is not much help for most
22809 floating point operators, since reassociation may introduce
22810 significantly different round-off errors, delivering a result
22811 that is outside the model interval for the left-to-right
22812 association. Similar problems arise for division with integer
22813 or fixed point operands.
22814
22815 13.b
22816 Note that this permission does not apply to user-defined
22817 operators.
22818
22819 NOTES
22820
22821 14
22822 11 The two operands of an expression of the form X op Y, where op
22823 is a binary operator, are evaluated in an arbitrary order, as for
22824 any function_call (see *note 6.4::).
22825
22826 _Examples_
22827
22828 15
22829 Examples of precedence:
22830
22831 16
22832 not Sunny or Warm -- same as (not Sunny) or Warm
22833 X > 4.0 and Y > 0.0 -- same as (X > 4.0) and (Y > 0.0)
22834
22835 17
22836 -4.0*A**2 -- same as -(4.0 * (A**2))
22837 abs(1 + A) + B -- same as (abs (1 + A)) + B
22838 Y**(-3) -- parentheses are necessary
22839 A / B * C -- same as (A/B)*C
22840 A + (B + C) -- evaluate B + C before adding it to A
22841
22842 _Wording Changes from Ada 83_
22843
22844 17.a
22845 We don't give a detailed definition of precedence, since it is
22846 all implicit in the syntax rules anyway.
22847
22848 17.b
22849 The permission to reassociate is moved here from RM83-11.6(5),
22850 so it is closer to the rules defining operator association.
22851
22852 * Menu:
22853
22854 * 4.5.1 :: Logical Operators and Short-circuit Control Forms
22855 * 4.5.2 :: Relational Operators and Membership Tests
22856 * 4.5.3 :: Binary Adding Operators
22857 * 4.5.4 :: Unary Adding Operators
22858 * 4.5.5 :: Multiplying Operators
22859 * 4.5.6 :: Highest Precedence Operators
22860 * 4.5.7 :: Conditional Expressions
22861 * 4.5.8 :: Quantified Expressions
22862
22863 \1f
22864 File: aarm2012.info, Node: 4.5.1, Next: 4.5.2, Up: 4.5
22865
22866 4.5.1 Logical Operators and Short-circuit Control Forms
22867 -------------------------------------------------------
22868
22869 _Name Resolution Rules_
22870
22871 1
22872 An expression consisting of two relations connected by and then or or
22873 else (a short-circuit control form) shall resolve to be of some boolean
22874 type; the expected type for both relations is that same boolean type.
22875
22876 1.a
22877 Reason: This rule is written this way so that overload
22878 resolution treats the two operands symmetrically; the
22879 resolution of overloading present in either one can benefit
22880 from the resolution of the other. Furthermore, the type
22881 expected by context can help.
22882
22883 _Static Semantics_
22884
22885 2
22886 The following logical operators are predefined for every boolean type T,
22887 for every modular type T, and for every one-dimensional array type T
22888 whose component type is a boolean type:
22889
22890 3
22891 function "and"(Left, Right : T) return T
22892 function "or" (Left, Right : T) return T
22893 function "xor"(Left, Right : T) return T
22894
22895 3.a/2
22896 This paragraph was deleted.{AI95-00145-01AI95-00145-01}
22897
22898 3.b/2
22899 Ramification: {AI95-00145-01AI95-00145-01} For these
22900 operators, we are talking about the type without any
22901 (interesting) subtype, and not some subtype with a constraint
22902 or exclusion. Since it's possible that there is no name for
22903 the "uninteresting" subtype, we denote the type with an
22904 italicized T. This applies to the italicized T in many other
22905 predefined operators and attributes as well.
22906
22907 3.c/2
22908 {AI95-00145-01AI95-00145-01} In many cases, there is a subtype
22909 with the correct properties available. The italicized T
22910 means:
22911
22912 3.d/2
22913 * T'Base, for scalars;
22914
22915 3.e/2
22916 * the first subtype of T, for tagged types;
22917
22918 3.f/2
22919 * a subtype of the type T without any constraint or null
22920 exclusion, in other cases.
22921
22922 3.g/2
22923 Note that "without a constraint" is not the same as
22924 unconstrained. For instance, a record type with no
22925 discriminant part is considered constrained; no subtype of it
22926 has a constraint, but the subtype is still constrained.
22927
22928 3.h/2
22929 Thus, the last case often is the same as the first subtype of
22930 T, but that isn't the case for constrained array types (where
22931 the correct subtype is unconstrained) and for access types
22932 with a null_exclusion (where the correct subtype does not
22933 exclude null).
22934
22935 3.i/2
22936 This italicized T is used for defining operators and
22937 attributes of the language. The meaning is intended to be as
22938 described here.
22939
22940 4
22941 For boolean types, the predefined logical operators and, or, and xor
22942 perform the conventional operations of conjunction, inclusive
22943 disjunction, and exclusive disjunction, respectively.
22944
22945 5
22946 For modular types, the predefined logical operators are defined on a
22947 bit-by-bit basis, using the binary representation of the value of the
22948 operands to yield a binary representation for the result, where zero
22949 represents False and one represents True. If this result is outside the
22950 base range of the type, a final subtraction by the modulus is performed
22951 to bring the result into the base range of the type.
22952
22953 6
22954 The logical operators on arrays are performed on a
22955 component-by-component basis on matching components (as for equality --
22956 see *note 4.5.2::), using the predefined logical operator for the
22957 component type. The bounds of the resulting array are those of the left
22958 operand.
22959
22960 _Dynamic Semantics_
22961
22962 7
22963 The short-circuit control forms and then and or else deliver the same
22964 result as the corresponding predefined and and or operators for boolean
22965 types, except that the left operand is always evaluated first, and the
22966 right operand is not evaluated if the value of the left operand
22967 determines the result.
22968
22969 8
22970 For the logical operators on arrays, a check is made that for each
22971 component of the left operand there is a matching component of the right
22972 operand, and vice versa. Also, a check is made that each component of
22973 the result belongs to the component subtype. The exception
22974 Constraint_Error is raised if either of the above checks fails.
22975
22976 8.a
22977 Discussion: The check against the component subtype is per
22978 AI83-00535.
22979
22980 NOTES
22981
22982 9
22983 12 The conventional meaning of the logical operators is given by
22984 the following truth table:
22985
22986 10
22987 A B (A and B) (A or B) (A xor B)
22988
22989 True True True True False
22990 True False False True True
22991 False True False True True
22992 False False False False False
22993
22994 _Examples_
22995
22996 11
22997 Examples of logical operators:
22998
22999 12
23000 Sunny or Warm
23001 Filter(1 .. 10) and Filter(15 .. 24) -- see *note 3.6.1::
23002
23003 13
23004 Examples of short-circuit control forms:
23005
23006 14
23007 Next_Car.Owner /= null and then Next_Car.Owner.Age > 25 -- see *note 3.10.1::
23008 N = 0 or else A(N) = Hit_Value
23009
23010 \1f
23011 File: aarm2012.info, Node: 4.5.2, Next: 4.5.3, Prev: 4.5.1, Up: 4.5
23012
23013 4.5.2 Relational Operators and Membership Tests
23014 -----------------------------------------------
23015
23016 1
23017 [ The equality operators = (equals) and /= (not equals) are predefined
23018 for nonlimited types. The other relational_operators are the ordering
23019 operators < (less than), <= (less than or equal), > (greater than), and
23020 >= (greater than or equal). The ordering operators are predefined for
23021 scalar types, and for discrete array types, that is, one-dimensional
23022 array types whose components are of a discrete type.
23023
23024 1.a
23025 Ramification: The equality operators are not defined for every
23026 nonlimited type -- see below for the exact rule.
23027
23028 2/3
23029 {AI05-0262-1AI05-0262-1} {AI05-0269-1AI05-0269-1} A membership test,
23030 using in or not in, determines whether or not a value belongs to any
23031 given subtype or range, is equal to any given value, has a tag that
23032 identifies a type that is covered by a given type, or is convertible to
23033 and has an accessibility level appropriate for a given access type.
23034 Membership tests are allowed for all types.]
23035
23036 _Name Resolution Rules_
23037
23038 3/3
23039 {AI95-00251-01AI95-00251-01} {AI05-0158-1AI05-0158-1} The tested type of
23040 a membership test is determined by the membership_choices of the
23041 membership_choice_list. Either all membership_choices of the
23042 membership_choice_list shall resolve to the same type, which is the
23043 tested type; or each membership_choice shall be of an elementary type,
23044 and the tested type shall be covered by each of these elementary types.
23045
23046 3.1/3
23047 {AI05-0158-1AI05-0158-1} If the tested type is tagged, then the
23048 simple_expression shall resolve to be of a type that is convertible (see
23049 *note 4.6::) to the tested type; if untagged, the expected type for the
23050 simple_expression is the tested type. The expected type of a
23051 choice_expression in a membership_choice, and of a simple_expression of
23052 a range in a membership_choice, is the tested type of the membership
23053 operation.
23054
23055 3.a/2
23056 Reason: {AI95-00230-01AI95-00230-01} The part of the rule for
23057 untagged types is stated in a way that ensures that operands
23058 like a string literal are still legal as operands of a
23059 membership test.
23060
23061 3.b/2
23062 {AI95-00251-01AI95-00251-01} The significance of "is
23063 convertible to" is that we allow the simple_expression to be
23064 of any class-wide type that could be converted to the tested
23065 type, not just the one rooted at the tested type. This
23066 includes any class-wide type that covers the tested type,
23067 along with class-wide interfaces in some cases.
23068
23069 3.c/3
23070 {AI05-0158-1AI05-0158-1} The special rule for determining the
23071 tested type for elementary types is to allow numeric literals
23072 in membership_choice_lists. Without the rule, A in B | 1
23073 would be illegal as B and 1 would have different types (the
23074 literal having type universal integer).
23075
23076 _Legality Rules_
23077
23078 4
23079 For a membership test, if the simple_expression is of a tagged
23080 class-wide type, then the tested type shall be (visibly) tagged.
23081
23082 4.a
23083 Ramification: Untagged types covered by the tagged class-wide
23084 type are not permitted. Such types can exist if they are
23085 descendants of a private type whose full type is tagged. This
23086 rule is intended to avoid confusion since such derivatives
23087 don't have their "own" tag, and hence are indistinguishable
23088 from one another at run time once converted to a covering
23089 class-wide type.
23090
23091 4.1/3
23092 {AI05-0158-1AI05-0158-1} If a membership test includes one or more
23093 choice_expressions and the tested type of the membership test is
23094 limited, then the tested type of the membership test shall have a
23095 visible primitive equality operator.
23096
23097 4.b/3
23098 Reason: {AI05-0158-1AI05-0158-1} A visible equality operator
23099 is required in order to avoid breaking privacy; that is, we
23100 don't want to depend on a hidden equality operator.
23101
23102 _Static Semantics_
23103
23104 5
23105 The result type of a membership test is the predefined type Boolean.
23106
23107 6
23108 The equality operators are predefined for every specific type T that is
23109 not limited, and not an anonymous access type, with the following
23110 specifications:
23111
23112 7
23113 function "=" (Left, Right : T) return Boolean
23114 function "/="(Left, Right : T) return Boolean
23115
23116 7.1/2
23117 {AI95-00230-01AI95-00230-01} The following additional equality operators
23118 for the universal_access type are declared in package Standard for use
23119 with anonymous access types:
23120
23121 7.2/2
23122 function "=" (Left, Right : universal_access) return Boolean
23123 function "/="(Left, Right : universal_access) return Boolean
23124
23125 8
23126 The ordering operators are predefined for every specific scalar type T,
23127 and for every discrete array type T, with the following specifications:
23128
23129 9
23130 function "<" (Left, Right : T) return Boolean
23131 function "<="(Left, Right : T) return Boolean
23132 function ">" (Left, Right : T) return Boolean
23133 function ">="(Left, Right : T) return Boolean
23134
23135 _Name Resolution Rules_
23136
23137 9.1/2
23138 {AI95-00230-01AI95-00230-01} {AI95-00420-01AI95-00420-01} At least one
23139 of the operands of an equality operator for universal_access shall be of
23140 a specific anonymous access type. Unless the predefined equality
23141 operator is identified using an expanded name with prefix denoting the
23142 package Standard, neither operand shall be of an access-to-object type
23143 whose designated type is D or D'Class, where D has a user-defined
23144 primitive equality operator such that:
23145
23146 9.2/2
23147 * its result type is Boolean;
23148
23149 9.3/3
23150 * {AI05-0020-1AI05-0020-1} it is declared immediately within the same
23151 declaration list as D or any partial or incomplete view of D; and
23152
23153 9.4/2
23154 * at least one of its operands is an access parameter with designated
23155 type D.
23156
23157 9.a/2
23158 Reason: The first sentence prevents compatibility problems by
23159 ensuring that these operators are not used for named access
23160 types. Also, universal access types do not count for the
23161 purposes of this rule. Otherwise, equality expressions like
23162 (X = null) would be ambiguous for normal access types.
23163
23164 9.b/2
23165 The rest of the rule makes it possible to call (including a
23166 dispatching call) user-defined "=" operators for anonymous
23167 access-to-object types (they'd be hidden otherwise), and to
23168 write user-defined "=" operations for anonymous access types
23169 (by making it possible to see the universal operator using the
23170 Standard prefix).
23171
23172 9.c/2
23173 Ramification: We don't need a similar rule for anonymous
23174 access-to-subprogram types because they can't be primitive for
23175 any type. Note that any nonprimitive user-defined equality
23176 operators still are hidden by the universal operators; they'll
23177 have to be called with a package prefix, but they are likely
23178 to be very uncommon.
23179
23180 _Legality Rules_
23181
23182 9.5/2
23183 {AI95-00230-01AI95-00230-01} At least one of the operands of the
23184 equality operators for universal_access shall be of type
23185 universal_access, or both shall be of access-to-object types, or both
23186 shall be of access-to-subprogram types. Further:
23187
23188 9.6/2
23189 * When both are of access-to-object types, the designated types shall
23190 be the same or one shall cover the other, and if the designated
23191 types are elementary or array types, then the designated subtypes
23192 shall statically match;
23193
23194 9.7/2
23195 * When both are of access-to-subprogram types, the designated
23196 profiles shall be subtype conformant.
23197
23198 9.d/2
23199 Reason: We don't want to allow completely arbitrary
23200 comparisons, as we don't want to insist that all access types
23201 are represented in ways that are convertible to one another.
23202 For instance, a compiler could use completely separate address
23203 spaces or incompatible representations. Instead, we allow
23204 compares if there exists an access parameter to which both
23205 operands could be converted. Since the user could write such
23206 an subprogram, and any reasonable meaning for "=" would allow
23207 using it in such a subprogram, this doesn't impose any further
23208 restrictions on Ada implementations.
23209
23210 9.8/3
23211 {AI05-0123-1AI05-0123-1} If the profile of an explicitly declared
23212 primitive equality operator of an untagged record type is type
23213 conformant with that of the corresponding predefined equality operator,
23214 the declaration shall occur before the type is frozen. In addition, if
23215 the untagged record type has a nonlimited partial view, then the
23216 declaration shall occur in the visible part of the enclosing package.
23217 In addition to the places where Legality Rules normally apply (see *note
23218 12.3::), this rule applies also in the private part of an instance of a
23219 generic unit.
23220
23221 _Dynamic Semantics_
23222
23223 10
23224 For discrete types, the predefined relational operators are defined in
23225 terms of corresponding mathematical operations on the position numbers
23226 of the values of the operands.
23227
23228 11
23229 For real types, the predefined relational operators are defined in terms
23230 of the corresponding mathematical operations on the values of the
23231 operands, subject to the accuracy of the type.
23232
23233 11.a
23234 Ramification: For floating point types, the results of
23235 comparing nearly equal values depends on the accuracy of the
23236 implementation (see *note G.2.1::, "*note G.2.1:: Model of
23237 Floating Point Arithmetic" for implementations that support
23238 the Numerics Annex).
23239
23240 11.b
23241 Implementation Note: On a machine with signed zeros, if the
23242 generated code generates both plus zero and minus zero, plus
23243 and minus zero must be equal by the predefined equality
23244 operators.
23245
23246 12
23247 Two access-to-object values are equal if they designate the same object,
23248 or if both are equal to the null value of the access type.
23249
23250 13
23251 Two access-to-subprogram values are equal if they are the result of the
23252 same evaluation of an Access attribute_reference, or if both are equal
23253 to the null value of the access type. Two access-to-subprogram values
23254 are unequal if they designate different subprograms. [It is unspecified
23255 whether two access values that designate the same subprogram but are the
23256 result of distinct evaluations of Access attribute_references are equal
23257 or unequal.]
23258
23259 13.a
23260 Reason: This allows each Access attribute_reference for a
23261 subprogram to designate a distinct "wrapper" subprogram if
23262 necessary to support an indirect call.
23263
23264 14/3
23265 {AI05-0123-1AI05-0123-1} For a type extension, predefined equality is
23266 defined in terms of the primitive [(possibly user-defined)] equals
23267 operator for the parent type and for any components that have a record
23268 type in the extension part, and predefined equality for any other
23269 components not inherited from the parent type.
23270
23271 14.a
23272 Ramification: Two values of a type extension are not equal if
23273 there is a variant_part in the extension part and the two
23274 values have different variants present. This is a
23275 ramification of the requirement that a discriminant governing
23276 such a variant_part has to be a "new" discriminant, and so has
23277 to be equal in the two values for the values to be equal.
23278 Note that variant_parts in the parent part need not match if
23279 the primitive equals operator for the parent type considers
23280 them equal.
23281
23282 14.b/2
23283 {AI95-00349-01AI95-00349-01} The full type extension's
23284 operation is used for a private extension. This follows as
23285 only full types have parent types; the type specified in a
23286 private extension is an ancestor, but not necessarily the
23287 parent type. For instance, in:
23288
23289 14.c/2
23290 with Pak1;
23291 package Pak2 is
23292 type Typ3 is new Pak1.Typ1 with private;
23293 private
23294 type Typ3 is new Pak1.Typ2 with null record;
23295 end Pak2;
23296
23297
23298 14.d/2
23299 the parent type is Pak1.Typ2, not Pak1.Typ1, and the equality
23300 operator of Pak1.Typ2 is used to create predefined equality
23301 for Typ3.
23302
23303 14.1/3
23304 {AI05-0123-1AI05-0123-1} For a derived type whose parent is an untagged
23305 record type, predefined equality is defined in terms of the primitive
23306 (possibly user-defined) equals operator of the parent type.
23307
23308 14.e/3
23309 Reason: This prevents predefined equality from reemerging in
23310 generic units for untagged record types. For other uses the
23311 primitive equality is inherited and the inherited routine is
23312 primitive.
23313
23314 15/3
23315 {AI05-0123-1AI05-0123-1} For a private type, if its full type is a
23316 record type, predefined equality is defined in terms of the primitive
23317 equals operator of the full type; otherwise, predefined equality for the
23318 private type is that of its full type.
23319
23320 16
23321 For other composite types, the predefined equality operators [(and
23322 certain other predefined operations on composite types -- see *note
23323 4.5.1:: and *note 4.6::)] are defined in terms of the corresponding
23324 operation on matching components, defined as follows:
23325
23326 17
23327 * For two composite objects or values of the same non-array type,
23328 matching components are those that correspond to the same
23329 component_declaration or discriminant_specification;
23330
23331 18
23332 * For two one-dimensional arrays of the same type, matching
23333 components are those (if any) whose index values match in the
23334 following sense: the lower bounds of the index ranges are defined
23335 to match, and the successors of matching indices are defined to
23336 match;
23337
23338 19
23339 * For two multidimensional arrays of the same type, matching
23340 components are those whose index values match in successive index
23341 positions.
23342
23343 20
23344 The analogous definitions apply if the types of the two objects or
23345 values are convertible, rather than being the same.
23346
23347 20.a
23348 Discussion: Ada 83 seems to omit this part of the definition,
23349 though it is used in array type conversions. See *note 4.6::.
23350
23351 21
23352 Given the above definition of matching components, the result of the
23353 predefined equals operator for composite types (other than for those
23354 composite types covered earlier) is defined as follows:
23355
23356 22
23357 * If there are no components, the result is defined to be True;
23358
23359 23
23360 * If there are unmatched components, the result is defined to be
23361 False;
23362
23363 24/3
23364 * {AI05-0123-1AI05-0123-1} Otherwise, the result is defined in terms
23365 of the primitive equals operator for any matching components that
23366 are records, and the predefined equals for any other matching
23367 components.
23368
23369 24.a/3
23370 Reason: {AI05-0123-1AI05-0123-1} This asymmetry between
23371 components with and without a record type is necessary to
23372 preserve most upward compatibility and corresponds with the
23373 corresponding situation with generics, where the predefined
23374 operations "reemerge" in a generic for non-record types, but
23375 do not for record types. Also, only tagged types support
23376 user-defined assignment (see *note 7.6::), so only tagged
23377 types can fully handle levels of indirection in the
23378 implementation of the type. For untagged types, one reason
23379 for a user-defined equals operator might be to allow values
23380 with different bounds or discriminants to compare equal in
23381 certain cases. When such values are matching components, the
23382 bounds or discriminants will necessarily match anyway if the
23383 discriminants of the enclosing values match.
23384
23385 24.b
23386 Ramification: Two null arrays of the same type are always
23387 equal; two null records of the same type are always equal.
23388
23389 24.c/3
23390 {AI05-0123-1AI05-0123-1} Note that if a composite object has a
23391 component of a floating point type, and the floating point
23392 type has both a plus and minus zero, which are considered
23393 equal by the predefined equality, then a block compare cannot
23394 be used for the predefined composite equality. Of course,
23395 with user-defined equals operators for components that are
23396 records, a block compare breaks down anyway, so this is not
23397 the only special case that requires component-by-component
23398 comparisons. On a one's complement machine, a similar
23399 situation might occur for integer types, since one's
23400 complement machines typically have both a plus and minus
23401 (integer) zero.
23402
23403 24.d/2
23404 To be honest: {AI95-00230-01AI95-00230-01} For a component
23405 with an anonymous access type, "predefined equality" is that
23406 defined for the universal_access type (anonymous access types
23407 have no equality operators of their own).
23408
23409 24.e/3
23410 {AI05-0123-1AI05-0123-1} For a component with a record type T,
23411 "the primitive equals operator" is the one with two parameters
23412 of T which returns Boolean. We're not talking about some
23413 random other primitive function named "=".
23414
23415 24.1/3
23416 {AI05-0123-1AI05-0123-1} If the primitive equals operator for an
23417 untagged record type is abstract, then Program_Error is raised at the
23418 point of any (implicit) call to that abstract subprogram.
23419
23420 24.f/3
23421 Reason: An explicit call to an abstract subprogram is illegal.
23422 This rule is needed in order to define the effect of an
23423 implicit call such as a call that is part of the predefined
23424 equality operation for an enclosing composite type that has a
23425 component of an untagged record type that has an abstract
23426 primitive equals operator. For tagged types, an abstract
23427 primitive equals operator is only allowed for an abstract
23428 type, and abstract types cannot be components, so this case
23429 does not occur.
23430
23431 24.2/1
23432 {8652/00168652/0016} {AI95-00123-01AI95-00123-01} For any composite
23433 type, the order in which "=" is called for components is unspecified.
23434 Furthermore, if the result can be determined before calling "=" on some
23435 components, it is unspecified whether "=" is called on those components.
23436
23437 25
23438 The predefined "/=" operator gives the complementary result to the
23439 predefined "=" operator.
23440
23441 25.a
23442 Ramification: Furthermore, if the user defines an "=" operator
23443 that returns Boolean, then a "/=" operator is implicitly
23444 declared in terms of the user-defined "=" operator so as to
23445 give the complementary result. See *note 6.6::.
23446
23447 26/3
23448 {AI05-0264-1AI05-0264-1} For a discrete array type, the predefined
23449 ordering operators correspond to lexicographic order using the
23450 predefined order relation of the component type: A null array is
23451 lexicographically less than any array having at least one component. In
23452 the case of nonnull arrays, the left operand is lexicographically less
23453 than the right operand if the first component of the left operand is
23454 less than that of the right; otherwise, the left operand is
23455 lexicographically less than the right operand only if their first
23456 components are equal and the tail of the left operand is
23457 lexicographically less than that of the right (the tail consists of the
23458 remaining components beyond the first and can be null).
23459
23460 26.1/3
23461 {AI05-0269-1AI05-0269-1} An individual membership test is the membership
23462 test of a single membership_choice.
23463
23464 27/3
23465 {AI05-0158-1AI05-0158-1} For the evaluation of a membership test using
23466 in whose membership_choice_list has a single membership_choice, the
23467 simple_expression and the membership_choice are evaluated in an
23468 arbitrary order; the result is the result of the individual membership
23469 test for the membership_choice.
23470
23471 27.1/3
23472 {AI05-0158-1AI05-0158-1} For the evaluation of a membership test using
23473 in whose membership_choice_list has more than one membership_choice, the
23474 simple_expression of the membership test is evaluated first and the
23475 result of the operation is equivalent to that of a sequence consisting
23476 of an individual membership test on each membership_choice combined with
23477 the short-circuit control form or else.
23478
23479 27.a.1/3
23480 Ramification: {AI05-0158-1AI05-0158-1} This equivalence
23481 includes the evaluation of the membership_choices; evaluation
23482 stops as soon as an individual choice evaluates to True.
23483
23484 28/3
23485 {AI05-0158-1AI05-0158-1} {AI05-0269-1AI05-0269-1} An individual
23486 membership test yields the result True if:
23487
23488 28.1/3
23489 * {AI05-0158-1AI05-0158-1} {AI05-0264-1AI05-0264-1} The
23490 membership_choice is a choice_expression, and the simple_expression
23491 is equal to the value of the membership_choice. If the tested type
23492 is a record type or a limited type, the test uses the primitive
23493 equality for the type; otherwise, the test uses predefined
23494 equality.
23495
23496 28.2/3
23497 * {AI05-0153-3AI05-0153-3} {AI05-0158-1AI05-0158-1} The
23498 membership_choice is a range and the value of the simple_expression
23499 belongs to the given range.
23500
23501 29/3
23502 * {AI05-0153-3AI05-0153-3} {AI05-0158-1AI05-0158-1} The
23503 membership_choice is a subtype_mark, the tested type is scalar, the
23504 value of the simple_expression belongs to the range of the named
23505 subtype, and the predicate of the named subtype evaluates to True.
23506
23507 29.a/3
23508 Ramification: {AI05-0153-3AI05-0153-3} The scalar membership
23509 test only does a range check and a predicate check. It does
23510 not perform any other check, such as whether a value falls in
23511 a "hole" of a "holey" enumeration type. The Pos attribute
23512 function can be used for that purpose.
23513
23514 29.b
23515 Even though Standard.Float is an unconstrained subtype, the
23516 test "X in Float" will still return False (presuming the
23517 evaluation of X does not raise Constraint_Error) when X is
23518 outside Float'Range.
23519
23520 30/3
23521 * {AI95-00231-01AI95-00231-01} {AI05-0153-3AI05-0153-3}
23522 {AI05-0158-1AI05-0158-1} The membership_choice is a subtype_mark,
23523 the tested type is not scalar, the value of the simple_expression
23524 satisfies any constraints of the named subtype, the predicate of
23525 the named subtype evaluates to True, and:
23526
23527 30.1/2
23528 * {AI95-00231-01AI95-00231-01} if the type of the
23529 simple_expression is class-wide, the value has a tag that
23530 identifies a type covered by the tested type;
23531
23532 30.a
23533 Ramification: Note that the tag is not checked if the
23534 simple_expression is of a specific type.
23535
23536 30.2/3
23537 * {AI95-00231-01AI95-00231-01} {AI05-0149-1AI05-0149-1} if
23538 the tested type is an access type and the named subtype
23539 excludes null, the value of the simple_expression is not
23540 null;
23541
23542 30.3/3
23543 * {AI05-0149-1AI05-0149-1} if the tested type is a general
23544 access-to-object type, the type of the simple_expression
23545 is convertible to the tested type and its accessibility
23546 level is no deeper than that of the tested type; further,
23547 if the designated type of the tested type is tagged and
23548 the simple_expression is nonnull, the tag of the object
23549 designated by the value of the simple_expression is
23550 covered by the designated type of the tested type.
23551
23552 31/3
23553 {AI05-0264-1AI05-0264-1} Otherwise, the test yields the result False.
23554
23555 32
23556 A membership test using not in gives the complementary result to the
23557 corresponding membership test using in.
23558
23559 32.a/3
23560 To be honest: {AI05-0158-1AI05-0158-1} X not in A | B | C is
23561 intended to be exactly equivalent to not (X in A | B | C),
23562 including the order of evaluation of the simple_expression and
23563 membership_choices.
23564
23565 _Implementation Requirements_
23566
23567 32.1/1
23568 {8652/00168652/0016} {AI95-00123-01AI95-00123-01} For all nonlimited
23569 types declared in language-defined packages, the "=" and "/=" operators
23570 of the type shall behave as if they were the predefined equality
23571 operators for the purposes of the equality of composite types and
23572 generic formal types.
23573
23574 32.a.1/3
23575 Ramification: {AI95-00123-01AI95-00123-01}
23576 {AI05-0123-1AI05-0123-1} If any language-defined types are
23577 implemented with a user-defined "=" operator, then either the
23578 full type must be a record type, or the compiler must use
23579 "magic" to implement equality for this type. A normal
23580 user-defined "=" operator for a non-record type does not meet
23581 this requirement.
23582
23583 NOTES
23584
23585 33/2
23586 This paragraph was deleted.{AI95-00230-01AI95-00230-01}
23587
23588 34
23589 13 If a composite type has components that depend on
23590 discriminants, two values of this type have matching components if
23591 and only if their discriminants are equal. Two nonnull arrays have
23592 matching components if and only if the length of each dimension is
23593 the same for both.
23594
23595 _Examples_
23596
23597 35
23598 Examples of expressions involving relational operators and membership
23599 tests:
23600
23601 36
23602 X /= Y
23603
23604 37
23605 "" < "A" and "A" < "Aa" -- True
23606 "Aa" < "B" and "A" < "A " -- True
23607
23608 38/3
23609 {AI05-0264-1AI05-0264-1} My_Car = null -- True if My_Car has been set to null (see *note 3.10.1::)
23610 My_Car = Your_Car -- True if we both share the same car
23611 My_Car.all = Your_Car.all -- True if the two cars are identical
23612
23613 39/3
23614 {AI05-0158-1AI05-0158-1} N not in 1 .. 10 -- range membership test
23615 Today in Mon .. Fri -- range membership test
23616 Today in Weekday -- subtype membership test (see *note 3.5.1::)
23617 Card in Clubs | Spades -- list membership test (see *note 3.5.1::)
23618 Archive in Disk_Unit -- subtype membership test (see *note 3.8.1::)
23619 Tree.all in Addition'Class -- class membership test (see *note 3.9.1::)
23620
23621 _Extensions to Ada 83_
23622
23623 39.a
23624 Membership tests can be used to test the tag of a class-wide
23625 value.
23626
23627 39.b
23628 Predefined equality for a composite type is defined in terms
23629 of the primitive equals operator for tagged components or the
23630 parent part.
23631
23632 _Wording Changes from Ada 83_
23633
23634 39.c
23635 The term "membership test" refers to the relation "X in S"
23636 rather to simply the reserved word in or not in.
23637
23638 39.d
23639 We use the term "equality operator" to refer to both the =
23640 (equals) and /= (not equals) operators. Ada 83 referred to =
23641 as the equality operator, and /= as the inequality operator.
23642 The new wording is more consistent with the ISO 10646 name for
23643 "=" (equals sign) and provides a category similar to "ordering
23644 operator" to refer to both = and /=.
23645
23646 39.e
23647 We have changed the term "catenate" to "concatenate".
23648
23649 _Extensions to Ada 95_
23650
23651 39.f/2
23652 {AI95-00230-01AI95-00230-01} {AI95-00420-01AI95-00420-01} The
23653 universal_access equality operators are new. They provide
23654 equality operations (most importantly, testing against null)
23655 for anonymous access types.
23656
23657 _Wording Changes from Ada 95_
23658
23659 39.g/2
23660 {8652/00168652/0016} {AI95-00123-01AI95-00123-01} Corrigendum:
23661 Wording was added to clarify that the order of calls (and
23662 whether the calls are made at all) on "=" for components is
23663 unspecified. Also clarified that "=" must compose properly
23664 for language-defined types.
23665
23666 39.h/2
23667 {AI95-00251-01AI95-00251-01} Memberships were adjusted to
23668 allow interfaces which don't cover the tested type, in order
23669 to be consistent with type conversions.
23670
23671 _Inconsistencies With Ada 2005_
23672
23673 39.i/3
23674 {AI05-0123-1AI05-0123-1} User-defined untagged record equality
23675 is now defined to compose and be used in generics. Any code
23676 which assumes that the predefined equality reemerges in
23677 generics and in predefined equals for composite types could
23678 fail. However, it is much more likely that this change will
23679 fix bugs, as the behavior that would be expected (the
23680 user-defined "=" is used) will be true in more cases.
23681
23682 39.j/3
23683 {AI05-0123-1AI05-0123-1} If a composite type contains a
23684 component of an untagged record type with an abstract equality
23685 operation, calling "=" on the composite type will raise
23686 Program_Error, while in the past a result will be returned
23687 using the predefined equality. This is quite possible in ASIS
23688 programs; it will detect a bug in such programs but of course
23689 the programs will need to be fixed before they will work.
23690
23691 _Incompatibilities With Ada 2005_
23692
23693 39.k/3
23694 {AI05-0123-1AI05-0123-1} Late and hidden overriding of
23695 equality for untagged record types is now prohibited. This is
23696 necessary to make composition of equality predictable. It
23697 should always be possible to move the overriding to an earlier
23698 spot where it will be legal.
23699
23700 _Extensions to Ada 2005_
23701
23702 39.l/3
23703 {AI05-0149-1AI05-0149-1} Membership tests for valid
23704 accessibility levels and tag coverage by the designated type
23705 for general access types are new.
23706
23707 39.m/3
23708 {AI05-0153-3AI05-0153-3} Membership tests now include a
23709 predicate check.
23710
23711 39.n/3
23712 {AI05-0158-1AI05-0158-1} Membership tests now allow multiple
23713 choices.
23714
23715 _Wording Changes from Ada 2005_
23716
23717 39.o/3
23718 {AI05-0020-1AI05-0020-1} Correction: Wording was added to
23719 clarify that universal_access "=" does not apply if an
23720 appropriate operator is declared for a partial or incomplete
23721 view of the designated type. Otherwise, adding a partial or
23722 incomplete view could make some "=" operators ambiguous.
23723
23724 \1f
23725 File: aarm2012.info, Node: 4.5.3, Next: 4.5.4, Prev: 4.5.2, Up: 4.5
23726
23727 4.5.3 Binary Adding Operators
23728 -----------------------------
23729
23730 _Static Semantics_
23731
23732 1
23733 The binary adding operators + (addition) and - (subtraction) are
23734 predefined for every specific numeric type T with their conventional
23735 meaning. They have the following specifications:
23736
23737 2
23738 function "+"(Left, Right : T) return T
23739 function "-"(Left, Right : T) return T
23740
23741 3
23742 The concatenation operators & are predefined for every nonlimited,
23743 one-dimensional array type T with component type C. They have the
23744 following specifications:
23745
23746 4
23747 function "&"(Left : T; Right : T) return T
23748 function "&"(Left : T; Right : C) return T
23749 function "&"(Left : C; Right : T) return T
23750 function "&"(Left : C; Right : C) return T
23751
23752 _Dynamic Semantics_
23753
23754 5
23755 For the evaluation of a concatenation with result type T, if both
23756 operands are of type T, the result of the concatenation is a
23757 one-dimensional array whose length is the sum of the lengths of its
23758 operands, and whose components comprise the components of the left
23759 operand followed by the components of the right operand. If the left
23760 operand is a null array, the result of the concatenation is the right
23761 operand. Otherwise, the lower bound of the result is determined as
23762 follows:
23763
23764 6
23765 * If the ultimate ancestor of the array type was defined by a
23766 constrained_array_definition, then the lower bound of the result is
23767 that of the index subtype;
23768
23769 6.a
23770 Reason: This rule avoids Constraint_Error when using
23771 concatenation on an array type whose first subtype is
23772 constrained.
23773
23774 7
23775 * If the ultimate ancestor of the array type was defined by an
23776 unconstrained_array_definition, then the lower bound of the result
23777 is that of the left operand.
23778
23779 8
23780 [The upper bound is determined by the lower bound and the length.] A
23781 check is made that the upper bound of the result of the concatenation
23782 belongs to the range of the index subtype, unless the result is a null
23783 array. Constraint_Error is raised if this check fails.
23784
23785 9
23786 If either operand is of the component type C, the result of the
23787 concatenation is given by the above rules, using in place of such an
23788 operand an array having this operand as its only component (converted to
23789 the component subtype) and having the lower bound of the index subtype
23790 of the array type as its lower bound.
23791
23792 9.a
23793 Ramification: The conversion might raise Constraint_Error.
23794 The conversion provides "sliding" for the component in the
23795 case of an array-of-arrays, consistent with the normal Ada 95
23796 rules that allow sliding during parameter passing.
23797
23798 10
23799 The result of a concatenation is defined in terms of an assignment to an
23800 anonymous object, as for any function call (see *note 6.5::).
23801
23802 10.a
23803 Ramification: This implies that value adjustment is performed
23804 as appropriate -- see *note 7.6::. We don't bother saying
23805 this for other predefined operators, even though they are all
23806 function calls, because this is the only one where it matters.
23807 It is the only one that can return a value having controlled
23808 parts.
23809
23810 NOTES
23811
23812 11
23813 14 As for all predefined operators on modular types, the binary
23814 adding operators + and - on modular types include a final reduction
23815 modulo the modulus if the result is outside the base range of the
23816 type.
23817
23818 11.a
23819 Implementation Note: A full "modulus" operation need not be
23820 performed after addition or subtraction of modular types. For
23821 binary moduli, a simple mask is sufficient. For nonbinary
23822 moduli, a check after addition to see if the value is greater
23823 than the high bound of the base range can be followed by a
23824 conditional subtraction of the modulus. Conversely, a check
23825 after subtraction to see if a "borrow" was performed can be
23826 followed by a conditional addition of the modulus.
23827
23828 _Examples_
23829
23830 12
23831 Examples of expressions involving binary adding operators:
23832
23833 13
23834 Z + 0.1 -- Z has to be of a real type
23835
23836 14
23837 "A" & "BCD" -- concatenation of two string literals
23838 'A' & "BCD" -- concatenation of a character literal and a string literal
23839 'A' & 'A' -- concatenation of two character literals
23840
23841 _Inconsistencies With Ada 83_
23842
23843 14.a
23844 The lower bound of the result of concatenation, for a type
23845 whose first subtype is constrained, is now that of the index
23846 subtype. This is inconsistent with Ada 83, but generally only
23847 for Ada 83 programs that raise Constraint_Error. For example,
23848 the concatenation operator in
23849
23850 14.b
23851 X : array(1..10) of Integer;
23852 begin
23853 X := X(6..10) & X(1..5);
23854
23855 14.c
23856 would raise Constraint_Error in Ada 83 (because the bounds of
23857 the result of the concatenation would be 6..15, which is
23858 outside of 1..10), but would succeed and swap the halves of X
23859 (as expected) in Ada 95.
23860
23861 _Extensions to Ada 83_
23862
23863 14.d
23864 Concatenation is now useful for array types whose first
23865 subtype is constrained. When the result type of a
23866 concatenation is such an array type, Constraint_Error is
23867 avoided by effectively first sliding the left operand (if
23868 nonnull) so that its lower bound is that of the index subtype.
23869
23870 \1f
23871 File: aarm2012.info, Node: 4.5.4, Next: 4.5.5, Prev: 4.5.3, Up: 4.5
23872
23873 4.5.4 Unary Adding Operators
23874 ----------------------------
23875
23876 _Static Semantics_
23877
23878 1
23879 The unary adding operators + (identity) and - (negation) are predefined
23880 for every specific numeric type T with their conventional meaning. They
23881 have the following specifications:
23882
23883 2
23884 function "+"(Right : T) return T
23885 function "-"(Right : T) return T
23886
23887 NOTES
23888
23889 3
23890 15 For modular integer types, the unary adding operator -, when
23891 given a nonzero operand, returns the result of subtracting the
23892 value of the operand from the modulus; for a zero operand, the
23893 result is zero.
23894
23895 \1f
23896 File: aarm2012.info, Node: 4.5.5, Next: 4.5.6, Prev: 4.5.4, Up: 4.5
23897
23898 4.5.5 Multiplying Operators
23899 ---------------------------
23900
23901 _Static Semantics_
23902
23903 1
23904 The multiplying operators * (multiplication), / (division), mod
23905 (modulus), and rem (remainder) are predefined for every specific integer
23906 type T:
23907
23908 2
23909 function "*" (Left, Right : T) return T
23910 function "/" (Left, Right : T) return T
23911 function "mod"(Left, Right : T) return T
23912 function "rem"(Left, Right : T) return T
23913
23914 3
23915 Signed integer multiplication has its conventional meaning.
23916
23917 4
23918 Signed integer division and remainder are defined by the relation:
23919
23920 5
23921 A = (A/B)*B + (A rem B)
23922
23923 6
23924 where (A rem B) has the sign of A and an absolute value less than the
23925 absolute value of B. Signed integer division satisfies the identity:
23926
23927 7
23928 (-A)/B = -(A/B) = A/(-B)
23929
23930 8/3
23931 {AI05-0260-1AI05-0260-1} The signed integer modulus operator is defined
23932 such that the result of A mod B is either zero, or has the sign of B and
23933 an absolute value less than the absolute value of B; in addition, for
23934 some signed integer value N, this result satisfies the relation:
23935
23936 9
23937 A = B*N + (A mod B)
23938
23939 10
23940 The multiplying operators on modular types are defined in terms of the
23941 corresponding signed integer operators[, followed by a reduction modulo
23942 the modulus if the result is outside the base range of the type] [(which
23943 is only possible for the "*" operator)].
23944
23945 10.a
23946 Ramification: The above identity satisfied by signed integer
23947 division is not satisfied by modular division because of the
23948 difference in effect of negation.
23949
23950 11
23951 Multiplication and division operators are predefined for every specific
23952 floating point type T:
23953
23954 12
23955 function "*"(Left, Right : T) return T
23956 function "/"(Left, Right : T) return T
23957
23958 13
23959 The following multiplication and division operators, with an operand of
23960 the predefined type Integer, are predefined for every specific fixed
23961 point type T:
23962
23963 14
23964 function "*"(Left : T; Right : Integer) return T
23965 function "*"(Left : Integer; Right : T) return T
23966 function "/"(Left : T; Right : Integer) return T
23967
23968 15
23969 [All of the above multiplying operators are usable with an operand of an
23970 appropriate universal numeric type.] The following additional
23971 multiplying operators for root_real are predefined[, and are usable when
23972 both operands are of an appropriate universal or root numeric type, and
23973 the result is allowed to be of type root_real, as in a
23974 number_declaration]:
23975
23976 15.a
23977 Ramification: These operators are analogous to the multiplying
23978 operators involving fixed or floating point types where
23979 root_real substitutes for the fixed or floating point type,
23980 and root_integer substitutes for Integer. Only values of the
23981 corresponding universal numeric types are implicitly
23982 convertible to these root numeric types, so these operators
23983 are really restricted to use with operands of a universal
23984 type, or the specified root numeric types.
23985
23986 16
23987 function "*"(Left, Right : root_real) return root_real
23988 function "/"(Left, Right : root_real) return root_real
23989
23990 17
23991 function "*"(Left : root_real; Right : root_integer) return root_real
23992 function "*"(Left : root_integer; Right : root_real) return root_real
23993 function "/"(Left : root_real; Right : root_integer) return root_real
23994
23995 18
23996 Multiplication and division between any two fixed point types are
23997 provided by the following two predefined operators:
23998
23999 18.a
24000 Ramification: Universal_fixed is the universal type for the
24001 class of fixed point types, meaning that these operators take
24002 operands of any fixed point types (not necessarily the same)
24003 and return a result that is implicitly (or explicitly)
24004 convertible to any fixed point type.
24005
24006 19
24007 function "*"(Left, Right : universal_fixed) return universal_fixed
24008 function "/"(Left, Right : universal_fixed) return universal_fixed
24009
24010 _Name Resolution Rules_
24011
24012 19.1/2
24013 {AI95-00364-01AI95-00364-01} {AI95-00420-01AI95-00420-01} The above two
24014 fixed-fixed multiplying operators shall not be used in a context where
24015 the expected type for the result is itself universal_fixed [-- the
24016 context has to identify some other numeric type to which the result is
24017 to be converted, either explicitly or implicitly]. Unless the
24018 predefined universal operator is identified using an expanded name with
24019 prefix denoting the package Standard, an explicit conversion is required
24020 on the result when using the above fixed-fixed multiplication operator
24021 if either operand is of a type having a user-defined primitive
24022 multiplication operator such that:
24023
24024 19.2/3
24025 * {AI05-0020-1AI05-0020-1} {AI05-0209-1AI05-0209-1} it is declared
24026 immediately within the same declaration list as the type or any
24027 partial or incomplete view thereof; and
24028
24029 19.3/2
24030 * both of its formal parameters are of a fixed-point type.
24031
24032 19.4/2
24033 {AI95-00364-01AI95-00364-01} {AI95-00420-01AI95-00420-01} A
24034 corresponding requirement applies to the universal fixed-fixed division
24035 operator.
24036
24037 19.a/2
24038 Discussion: The small of universal_fixed is infinitesimal; no
24039 loss of precision is permitted. However, fixed-fixed division
24040 is impractical to implement when an exact result is required,
24041 and multiplication will sometimes result in unanticipated
24042 overflows in such circumstances, so we require an explicit
24043 conversion to be inserted in expressions like A * B * C if A,
24044 B, and C are each of some fixed point type.
24045
24046 19.b/2
24047 On the other hand, X := A * B; is permitted by this rule, even
24048 if X, A, and B are all of different fixed point types, since
24049 the expected type for the result of the multiplication is the
24050 type of X, which is necessarily not universal_fixed.
24051
24052 19.c/2
24053 {AI95-00364-01AI95-00364-01} {AI95-00420-01AI95-00420-01} We
24054 have made these into Name Resolution rules to ensure that
24055 user-defined primitive fixed-fixed operators are not made
24056 unusable due to the presence of these universal fixed-fixed
24057 operators. But we do allow these operators to be used if
24058 prefixed by package Standard, so that they can be used in the
24059 definitions of user-defined operators.
24060
24061 Paragraph 20 was deleted.
24062
24063 _Dynamic Semantics_
24064
24065 21
24066 The multiplication and division operators for real types have their
24067 conventional meaning. [For floating point types, the accuracy of the
24068 result is determined by the precision of the result type. For decimal
24069 fixed point types, the result is truncated toward zero if the
24070 mathematical result is between two multiples of the small of the
24071 specific result type (possibly determined by context); for ordinary
24072 fixed point types, if the mathematical result is between two multiples
24073 of the small, it is unspecified which of the two is the result. ]
24074
24075 22
24076 The exception Constraint_Error is raised by integer division, rem, and
24077 mod if the right operand is zero. [Similarly, for a real type T with
24078 T'Machine_Overflows True, division by zero raises Constraint_Error.]
24079
24080 NOTES
24081
24082 23
24083 16 For positive A and B, A/B is the quotient and A rem B is the
24084 remainder when A is divided by B. The following relations are
24085 satisfied by the rem operator:
24086
24087 24
24088 A rem (-B) = A rem B
24089 (-A) rem B = -(A rem B)
24090
24091 25
24092 17 For any signed integer K, the following identity holds:
24093
24094 26
24095 A mod B = (A + K*B) mod B
24096
24097 27
24098 The relations between signed integer division, remainder, and
24099 modulus are illustrated by the following table:
24100
24101 28
24102 A B A/B A rem B A mod B A B A/B A rem B A mod B
24103
24104 29
24105 10 5 2 0 0 -10 5 -2 0 0
24106 11 5 2 1 1 -11 5 -2 -1 4
24107 12 5 2 2 2 -12 5 -2 -2 3
24108 13 5 2 3 3 -13 5 -2 -3 2
24109 14 5 2 4 4 -14 5 -2 -4 1
24110
24111 30
24112 A B A/B A rem B A mod B A B A/B A rem B A mod B
24113
24114 10 -5 -2 0 0 -10 -5 2 0 0
24115 11 -5 -2 1 -4 -11 -5 2 -1 -1
24116 12 -5 -2 2 -3 -12 -5 2 -2 -2
24117 13 -5 -2 3 -2 -13 -5 2 -3 -3
24118 14 -5 -2 4 -1 -14 -5 2 -4 -4
24119
24120 _Examples_
24121
24122 31
24123 Examples of expressions involving multiplying operators:
24124
24125 32
24126 I : Integer := 1;
24127 J : Integer := 2;
24128 K : Integer := 3;
24129
24130 33
24131 X : Real := 1.0; -- see *note 3.5.7::
24132 Y : Real := 2.0;
24133
24134 34
24135 F : Fraction := 0.25; -- see *note 3.5.9::
24136 G : Fraction := 0.5;
24137
24138 35
24139 Expression Value Result Type
24140
24141 I*J 2 same as I and J, that is, Integer
24142 K/J 1 same as K and J, that is, Integer
24143 K mod J 1 same as K and J, that is, Integer
24144
24145 X/Y 0.5 same as X and Y, that is, Real
24146 F/2 0.125 same as F, that is, Fraction
24147
24148 3*F 0.75 same as F, that is, Fraction
24149 0.75*G 0.375 universal_fixed, implicitly convertible
24150 to any fixed point type
24151 Fraction(F*G) 0.125 Fraction, as stated by the conversion
24152 Real(J)*Y 4.0 Real, the type of both operands after
24153 conversion of J
24154
24155 _Incompatibilities With Ada 83_
24156
24157 35.a.1/2
24158 {AI95-00364-01AI95-00364-01} {AI95-00420-01AI95-00420-01} The
24159 universal fixed-fixed multiplying operators are now directly
24160 available (see below). Any attempt to use user-defined
24161 fixed-fixed multiplying operators will be ambiguous with the
24162 universal ones. The only way to use the user-defined
24163 operators is to fully qualify them in a prefix call. This
24164 problem was not documented during the design of Ada 95, and
24165 has been mitigated by Ada 2005.
24166
24167 _Extensions to Ada 83_
24168
24169 35.a
24170 Explicit conversion of the result of multiplying or dividing
24171 two fixed point numbers is no longer required, provided the
24172 context uniquely determines some specific fixed point result
24173 type. This is to improve support for decimal fixed point,
24174 where requiring explicit conversion on every fixed-fixed
24175 multiply or divide was felt to be inappropriate.
24176
24177 35.b
24178 The type universal_fixed is covered by universal_real, so real
24179 literals and fixed point operands may be multiplied or divided
24180 directly, without any explicit conversions required.
24181
24182 _Wording Changes from Ada 83_
24183
24184 35.c
24185 We have used the normal syntax for function definition rather
24186 than a tabular format.
24187
24188 _Incompatibilities With Ada 95_
24189
24190 35.d/2
24191 {AI95-00364-01AI95-00364-01} We have changed the resolution
24192 rules for the universal fixed-fixed multiplying operators to
24193 remove the incompatibility with Ada 83 discussed above. The
24194 solution is to hide the universal operators in some
24195 circumstances. As a result, some legal Ada 95 programs will
24196 require the insertion of an explicit conversion around a
24197 fixed-fixed multiply operator. This change is likely to catch
24198 as many bugs as it causes, since it is unlikely that the user
24199 wanted to use predefined operators when they had defined
24200 user-defined versions.
24201
24202 _Wording Changes from Ada 2005_
24203
24204 35.e/3
24205 {AI05-0020-1AI05-0020-1} {AI05-0209-1AI05-0209-1} Correction:
24206 Wording was added to clarify that universal_fixed "*" and "/"
24207 does not apply if an appropriate operator is declared for a
24208 partial (or incomplete) view of the designated type.
24209 Otherwise, adding a partial (or incomplete) view could make
24210 some "*" and "/" operators ambiguous.
24211
24212 35.f/3
24213 {AI05-0260-1AI05-0260-1} Correction: The wording for the mod
24214 operator was corrected so that a result of 0 does not have to
24215 have "the sign of B" (which is impossible if B is negative).
24216
24217 \1f
24218 File: aarm2012.info, Node: 4.5.6, Next: 4.5.7, Prev: 4.5.5, Up: 4.5
24219
24220 4.5.6 Highest Precedence Operators
24221 ----------------------------------
24222
24223 _Static Semantics_
24224
24225 1
24226 The highest precedence unary operator abs (absolute value) is predefined
24227 for every specific numeric type T, with the following specification:
24228
24229 2
24230 function "abs"(Right : T) return T
24231
24232 3
24233 The highest precedence unary operator not (logical negation) is
24234 predefined for every boolean type T, every modular type T, and for every
24235 one-dimensional array type T whose components are of a boolean type,
24236 with the following specification:
24237
24238 4
24239 function "not"(Right : T) return T
24240
24241 5
24242 The result of the operator not for a modular type is defined as the
24243 difference between the high bound of the base range of the type and the
24244 value of the operand. [For a binary modulus, this corresponds to a
24245 bit-wise complement of the binary representation of the value of the
24246 operand.]
24247
24248 6
24249 The operator not that applies to a one-dimensional array of boolean
24250 components yields a one-dimensional boolean array with the same bounds;
24251 each component of the result is obtained by logical negation of the
24252 corresponding component of the operand (that is, the component that has
24253 the same index value). A check is made that each component of the
24254 result belongs to the component subtype; the exception Constraint_Error
24255 is raised if this check fails.
24256
24257 6.a
24258 Discussion: The check against the component subtype is per
24259 AI83-00535.
24260
24261 7
24262 The highest precedence exponentiation operator ** is predefined for
24263 every specific integer type T with the following specification:
24264
24265 8
24266 function "**"(Left : T; Right : Natural) return T
24267
24268 9
24269 Exponentiation is also predefined for every specific floating point type
24270 as well as root_real, with the following specification (where T is
24271 root_real or the floating point type):
24272
24273 10
24274 function "**"(Left : T; Right : Integer'Base) return T
24275
24276 11/3
24277 {AI05-0088-1AI05-0088-1} The right operand of an exponentiation is the
24278 exponent. The value of X**N with the value of the exponent N positive
24279 is the same as the value of X*X*...X (with N-1 multiplications) except
24280 that the multiplications are associated in an arbitrary order. With N
24281 equal to zero, the result is one. With the value of N negative [(only
24282 defined for a floating point operand)], the result is the reciprocal of
24283 the result using the absolute value of N as the exponent.
24284
24285 11.a
24286 Ramification: The language does not specify the order of
24287 association of the multiplications inherent in an
24288 exponentiation. For a floating point type, the accuracy of
24289 the result might depend on the particular association order
24290 chosen.
24291
24292 _Implementation Permissions_
24293
24294 12
24295 The implementation of exponentiation for the case of a negative exponent
24296 is allowed to raise Constraint_Error if the intermediate result of the
24297 repeated multiplications is outside the safe range of the type, even
24298 though the final result (after taking the reciprocal) would not be.
24299 (The best machine approximation to the final result in this case would
24300 generally be 0.0.)
24301
24302 NOTES
24303
24304 13
24305 18 As implied by the specification given above for exponentiation
24306 of an integer type, a check is made that the exponent is not
24307 negative. Constraint_Error is raised if this check fails.
24308
24309 _Inconsistencies With Ada 83_
24310
24311 13.a.1/1
24312 {8652/01008652/0100} {AI95-00018-01AI95-00018-01} The
24313 definition of "**" allows arbitrary association of the
24314 multiplications which make up the result. Ada 83 required
24315 left-to-right associations (confirmed by AI83-00137). Thus it
24316 is possible that "**" would provide a slightly different (and
24317 more potentially accurate) answer in Ada 95 than in the same
24318 Ada 83 program.
24319
24320 _Wording Changes from Ada 83_
24321
24322 13.a
24323 We now show the specification for "**" for integer types with
24324 a parameter subtype of Natural rather than Integer for the
24325 exponent. This reflects the fact that Constraint_Error is
24326 raised if a negative value is provided for the exponent.
24327
24328 _Wording Changes from Ada 2005_
24329
24330 13.b/3
24331 {AI05-0088-1AI05-0088-1} Correction: The equivalence
24332 definition for "**" was corrected so that it does not imply
24333 that the operands are evaluated multiple times.
24334
24335 \1f
24336 File: aarm2012.info, Node: 4.5.7, Next: 4.5.8, Prev: 4.5.6, Up: 4.5
24337
24338 4.5.7 Conditional Expressions
24339 -----------------------------
24340
24341 1/3
24342 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1}
24343 {AI05-0262-1AI05-0262-1} A conditional_expression selects for evaluation
24344 at most one of the enclosed dependent_expressions, depending on a
24345 decision among the alternatives. One kind of conditional_expression is
24346 the if_expression, which selects for evaluation a dependent_expression
24347 depending on the value of one or more corresponding conditions. The
24348 other kind of conditional_expression is the case_expression, which
24349 selects for evaluation one of a number of alternative
24350 dependent_expressions; the chosen alternative is determined by the value
24351 of a selecting_expression.
24352
24353 _Language Design Principles_
24354
24355 1.a/3
24356 {AI05-0188-1AI05-0188-1} As previously noted, there are two
24357 kinds of conditional_expression, if_expressions and
24358 case_expressions. Whenever possible, we have written the
24359 rules in terms of conditional_expressions to avoid
24360 duplication.
24361
24362 1.b/3
24363 {AI05-0147-1AI05-0147-1} The rules for conditional_expressions
24364 have been designed as much as possible to work similarly to a
24365 parenthesized expression. The intent is that as much as
24366 possible, wherever a parenthesized expression would be
24367 allowed, a conditional_expression would be allowed, and it
24368 should work the same way.
24369
24370 _Syntax_
24371
24372 2/3
24373 {AI05-0188-1AI05-0188-1} conditional_expression ::= if_expression |
24374 case_expression
24375
24376 3/3
24377 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} if_expression ::=
24378
24379 if condition then dependent_expression
24380 {elsif condition then dependent_expression}
24381 [else dependent_expression]
24382
24383 4/3
24384 {AI05-0147-1AI05-0147-1} condition ::= boolean_expression
24385
24386 5/3
24387 {AI05-0188-1AI05-0188-1} case_expression ::=
24388 case selecting_expression is
24389 case_expression_alternative {,
24390 case_expression_alternative}
24391
24392 6/3
24393 {AI05-0188-1AI05-0188-1} case_expression_alternative ::=
24394 when discrete_choice_list =>
24395 dependent_expression
24396
24397 7/3
24398 {AI05-0147-1AI05-0147-1} Wherever the Syntax Rules allow an
24399 expression, a conditional_expression may be used in place of the
24400 expression, so long as it is immediately surrounded by parentheses.
24401
24402 7.a/3
24403 Discussion: {AI05-0147-1AI05-0147-1} The syntactic category
24404 conditional_expression appears only as a primary that is
24405 parenthesized. The above rule allows it to additionally be
24406 used in other contexts where it would be directly surrounded
24407 by parentheses.
24408
24409 7.b/3
24410 The grammar makes the following directly legal:
24411
24412 7.c/3
24413 A := (if X then Y else Z); -- parentheses required
24414 A := B + (if X then Y else Z) + C; -- parentheses required
24415
24416 7.d/3
24417 The following procedure calls are syntactically legal; the
24418 first uses the above rule to eliminate the redundant
24419 parentheses found in the second:
24420
24421 7.e/3
24422 P(if X then Y else Z);
24423 P((if X then Y else Z)); -- redundant parentheses
24424
24425 7.f/3
24426 P((if X then Y else Z), Some_Other_Param);
24427 P(Some_Other_Param, (if X then Y else Z));
24428 P(Formal => (if X then Y else Z));
24429
24430 7.g/3
24431 whereas the following are illegal:
24432
24433 7.h/3
24434 P(if X then Y else Z, Some_Other_Param);
24435 P(Some_Other_Param, if X then Y else Z);
24436 P(Formal => if X then Y else Z);
24437
24438 7.i/3
24439 because in these latter cases, the conditional_expression is
24440 not immediately surrounded by parentheses (which means on both
24441 sides!).
24442
24443 7.j/3
24444 The English-language rule applies in all places that could
24445 surround an expression with parentheses, including pragma
24446 arguments, type conversion and qualified expression operands,
24447 and array index expressions.
24448
24449 7.k/3
24450 This English-language rule could have been implemented instead
24451 by adding a nonterminal expression_within_parentheses, which
24452 would consist of expressions and conditional_expressions.
24453 Then, that could be used in all of the syntax which could
24454 consist of parens directly around an expression. We did not
24455 do that because of the large amount of change required. A
24456 complete grammar is given in AI05-0147-1AI05-0147-1.
24457
24458 7.l/3
24459 Implementation Note: {AI05-0147-1AI05-0147-1} Implementers are
24460 cautioned to consider error detection when implementing the
24461 syntax for conditional_expressions. An if_expression and an
24462 if_statement are very similar syntactically, (as are a
24463 case_expression and a case_statement) and simple mistakes can
24464 appear to change one into the other, potentially causing
24465 errors to be moved far away from their actual location. The
24466 absence of end if to terminate an if_expression (and end case
24467 for a case_expression) also may make error handling harder.
24468
24469 _Name Resolution Rules_
24470
24471 8/3
24472 {AI05-0147-1AI05-0147-1} If a conditional_expression is expected to be
24473 of a type T, then each dependent_expression of the
24474 conditional_expression is expected to be of type T. Similarly, if a
24475 conditional_expression is expected to be of some class of types, then
24476 each dependent_expression of the conditional_expression is subject to
24477 the same expectation. If a conditional_expression shall resolve to be
24478 of a type T, then each dependent_expression shall resolve to be of type
24479 T.
24480
24481 9/3
24482 {AI05-0147-1AI05-0147-1} The possible types of a conditional_expression
24483 are further determined as follows:
24484
24485 10/3
24486 * If the conditional_expression is the operand of a type conversion,
24487 the type of the conditional_expression is the target type of the
24488 conversion; otherwise,
24489
24490 10.a/3
24491 Reason: This rule distributes an enclosing type conversion to
24492 the dependent_expressions. This means that
24493
24494 10.b/3
24495 T(if C then A else B)
24496
24497 10.c/3
24498 has the same semantics as
24499
24500 10.d/3
24501 (if C then T(A) else T(B))
24502
24503 11/3
24504 * If all of the dependent_expressions are of the same type, the type
24505 of the conditional_expression is that type; otherwise,
24506
24507 12/3
24508 * If a dependent_expression is of an elementary type, the type of the
24509 conditional_expression shall be covered by that type; otherwise,
24510
24511 12.a/3
24512 Reason: This rule supports the use of numeric literals and
24513 universal expressions within a conditional_expression.
24514
24515 13/3
24516 * If the conditional_expression is expected to be of type T or shall
24517 resolve to type T, then the conditional_expression is of type T.
24518
24519 13.a/3
24520 Ramification: If the type of the conditional_expression cannot
24521 be determined by one of these rules, then Name Resolution has
24522 failed for that expression, even if the dependent_expressions
24523 would resolve individually.
24524
24525 14/3
24526 {AI05-0147-1AI05-0147-1} A condition is expected to be of any boolean
24527 type.
24528
24529 15/3
24530 {AI05-0188-1AI05-0188-1} The expected type for the selecting_expression
24531 and the discrete_choices are as for case statements (see *note 5.4::).
24532
24533 _Legality Rules_
24534
24535 16/3
24536 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} All of the
24537 dependent_expressions shall be convertible (see *note 4.6::) to the type
24538 of the conditional_expression.
24539
24540 17/3
24541 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1}
24542 {AI05-0269-1AI05-0269-1} If the expected type of a
24543 conditional_expression is a specific tagged type, all of the
24544 dependent_expressions of the conditional_expression shall be dynamically
24545 tagged, or none shall be dynamically tagged. In this case, the
24546 conditional_expression is dynamically tagged if all of the
24547 dependent_expressions are dynamically tagged, is tag-indeterminate if
24548 all of the dependent_expressions are tag-indeterminate, and is
24549 statically tagged otherwise.
24550
24551 18/3
24552 {AI05-0147-1AI05-0147-1} {AI05-0262-1AI05-0262-1} If there is no else
24553 dependent_expression, the if_expression shall be of a boolean type.
24554
24555 19/3
24556 {AI05-0188-1AI05-0188-1} {AI05-0269-1AI05-0269-1} All Legality Rules
24557 that apply to the discrete_choices of a case_statement (see *note 5.4::)
24558 also apply to the discrete_choices of a case_expression except within an
24559 instance of a generic unit.
24560
24561 19.a/3
24562 Reason: The exemption for a case expression that occurs in an
24563 instance allows the following example:
24564
24565 19.b/3
24566 generic
24567 with function Int_Func return Integer;
24568 package G is
24569 X : Float := (case Int_Func is
24570 when Integer'First .. -1 => -1.0,
24571 when 0 => 0.0,
24572 when Positive => 1.0);
24573 end G;
24574
24575 19.c/3
24576 function Nat_Func return Natural is (123);
24577
24578 19.d/3
24579 package I is new G (Int_Func => Nat_Func); -- Legal
24580
24581 19.e/3
24582 Note that the Legality Rules still apply in the generic unit
24583 itself; they are just not enforced in an instance of the unit.
24584
24585 _Dynamic Semantics_
24586
24587 20/3
24588 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} For the evaluation of
24589 an if_expression, the condition specified after if, and any conditions
24590 specified after elsif, are evaluated in succession (treating a final
24591 else as elsif True then), until one evaluates to True or all conditions
24592 are evaluated and yield False. If a condition evaluates to True, the
24593 associated dependent_expression is evaluated, converted to the type of
24594 the if_expression, and the resulting value is the value of the
24595 if_expression. Otherwise (when there is no else clause), the value of
24596 the if_expression is True.
24597
24598 20.a/3
24599 Ramification: Else is required unless the if_expression has a
24600 boolean type, so the last sentence can only apply to
24601 if_expressions with a boolean type.
24602
24603 21/3
24604 {AI05-0188-1AI05-0188-1} For the evaluation of a case_expression, the
24605 selecting_expression is first evaluated. If the value of the
24606 selecting_expression is covered by the discrete_choice_list of some
24607 case_expression_alternative, then the dependent_expression of the
24608 case_expression_alternative is evaluated, converted to the type of the
24609 case_expression, and the resulting value is the value of the
24610 case_expression. Otherwise (the value is not covered by any
24611 discrete_choice_list, perhaps due to being outside the base range),
24612 Constraint_Error is raised.
24613
24614 _Extensions to Ada 2005_
24615
24616 21.a/3
24617 {AI05-0147-1AI05-0147-1} If expressions and case expressions
24618 are new.
24619
24620 \1f
24621 File: aarm2012.info, Node: 4.5.8, Prev: 4.5.7, Up: 4.5
24622
24623 4.5.8 Quantified Expressions
24624 ----------------------------
24625
24626 _Syntax_
24627
24628 1/3
24629 {AI05-0176-1AI05-0176-1} quantified_expression ::= for quantifier
24630 loop_parameter_specification => predicate
24631 | for quantifier iterator_specification => predicate
24632
24633 2/3
24634 quantifier ::= all | some
24635
24636 3/3
24637 predicate ::= boolean_expression
24638
24639 4/3
24640 {AI05-0176-1AI05-0176-1} Wherever the Syntax Rules allow an
24641 expression, a quantified_expression may be used in place of the
24642 expression, so long as it is immediately surrounded by parentheses.
24643
24644 4.a/3
24645 Discussion: The syntactic category quantified_expression
24646 appears only as a primary that is parenthesized. The above
24647 rule allows it to additionally be used in other contexts where
24648 it would be directly surrounded by parentheses. This is the
24649 same rule that is used for conditional_expressions; see *note
24650 4.5.7:: for a detailed discussion of the meaning and effects
24651 of this rule.
24652
24653 _Name Resolution Rules_
24654
24655 5/3
24656 {AI05-0176-1AI05-0176-1} The expected type of a quantified_expression is
24657 any Boolean type. The predicate in a quantified_expression is expected
24658 to be of the same type.
24659
24660 _Dynamic Semantics_
24661
24662 6/3
24663 {AI05-0176-1AI05-0176-1} For the evaluation of a quantified_expression,
24664 the loop_parameter_specification or iterator_specification is first
24665 elaborated. The evaluation of a quantified_expression then evaluates
24666 the predicate for each value of the loop parameter. These values are
24667 examined in the order specified by the loop_parameter_specification (see
24668 *note 5.5::) or iterator_specification (see *note 5.5.2::).
24669
24670 7/3
24671 {AI05-0176-1AI05-0176-1} The value of the quantified_expression is
24672 determined as follows:
24673
24674 8/3
24675 * If the quantifier is all, the expression is True if the evaluation
24676 of the predicate yields True for each value of the loop parameter.
24677 It is False otherwise. Evaluation of the quantified_expression
24678 stops when all values of the domain have been examined, or when the
24679 predicate yields False for a given value. Any exception raised by
24680 evaluation of the predicate is propagated.
24681
24682 8.a/3
24683 Ramification: The expression is True if the domain contains no
24684 values.
24685
24686 9/3
24687 * If the quantifier is some, the expression is True if the evaluation
24688 of the predicate yields True for some value of the loop parameter.
24689 It is False otherwise. Evaluation of the quantified_expression
24690 stops when all values of the domain have been examined, or when the
24691 predicate yields True for a given value. Any exception raised by
24692 evaluation of the predicate is propagated.
24693
24694 9.a/3
24695 Ramification: The expression is False if the domain contains
24696 no values.
24697
24698 _Examples_
24699
24700 10/3
24701 {AI05-0176-1AI05-0176-1} The postcondition for a sorting routine on an
24702 array A with an index subtype T can be written:
24703
24704 11/3
24705 Post => (A'Length < 2 or else
24706 (for all I in A'First .. T'Pred(A'Last) => A (I) <= A (T'Succ (I))))
24707
24708 12/3
24709 {AI05-0176-1AI05-0176-1} The assertion that a positive number is
24710 composite (as opposed to prime) can be written:
24711
24712 13/3
24713 pragma Assert (for some X in 2 .. N / 2 => N mod X = 0);
24714
24715 _Extensions to Ada 2005_
24716
24717 13.a/3
24718 {AI05-0176-1AI05-0176-1} Quantified expressions are new.
24719
24720 \1f
24721 File: aarm2012.info, Node: 4.6, Next: 4.7, Prev: 4.5, Up: 4
24722
24723 4.6 Type Conversions
24724 ====================
24725
24726 1/3
24727 {AI05-0299-1AI05-0299-1} [Explicit type conversions, both value
24728 conversions and view conversions, are allowed between closely related
24729 types as defined below. This subclause also defines rules for value and
24730 view conversions to a particular subtype of a type, both explicit ones
24731 and those implicit in other constructs. ]
24732
24733 _Syntax_
24734
24735 2
24736 type_conversion ::=
24737 subtype_mark(expression)
24738 | subtype_mark(name)
24739
24740 3
24741 The target subtype of a type_conversion is the subtype denoted by the
24742 subtype_mark. The operand of a type_conversion is the expression or
24743 name within the parentheses; its type is the operand type.
24744
24745 4/3
24746 {AI05-0299-1AI05-0299-1} One type is convertible to a second type if a
24747 type_conversion with the first type as operand type and the second type
24748 as target type is legal according to the rules of this subclause. Two
24749 types are convertible if each is convertible to the other.
24750
24751 4.a
24752 Ramification: Note that "convertible" is defined in terms of
24753 legality of the conversion. Whether the conversion would
24754 raise an exception at run time is irrelevant to this
24755 definition.
24756
24757 5/2
24758 {8652/00178652/0017} {AI95-00184-01AI95-00184-01}
24759 {AI95-00330-01AI95-00330-01} A type_conversion whose operand is the name
24760 of an object is called a view conversion if both its target type and
24761 operand type are tagged, or if it appears in a call as an actual
24762 parameter of mode out or in out; other type_conversions are called value
24763 conversions.
24764
24765 5.a
24766 Ramification: A view conversion to a tagged type can appear in
24767 any context that requires an object name, including in an
24768 object renaming, the prefix of a selected_component, and if
24769 the operand is a variable, on the left side of an
24770 assignment_statement. View conversions to other types only
24771 occur as actual parameters. Allowing view conversions of
24772 untagged types in all contexts seemed to incur an undue
24773 implementation burden.
24774
24775 5.b/2
24776 {AI95-00330-01AI95-00330-01} A type conversion appearing as an
24777 in out parameter in a generic instantiation is not a view
24778 conversion; the second part of the rule only applies to
24779 subprogram calls, not instantiations.
24780
24781 _Name Resolution Rules_
24782
24783 6
24784 The operand of a type_conversion is expected to be of any type.
24785
24786 6.a
24787 Discussion: This replaces the "must be determinable" wording
24788 of Ada 83. This is equivalent to (but hopefully more
24789 intuitive than) saying that the operand of a type_conversion
24790 is a "complete context."
24791
24792 7
24793 The operand of a view conversion is interpreted only as a name; the
24794 operand of a value conversion is interpreted as an expression.
24795
24796 7.a
24797 Reason: This formally resolves the syntactic ambiguity between
24798 the two forms of type_conversion, not that it really matters.
24799
24800 _Legality Rules_
24801
24802 8/2
24803 {AI95-00251-01AI95-00251-01} In a view conversion for an untagged type,
24804 the target type shall be convertible (back) to the operand type.
24805
24806 8.a/2
24807 Reason: Untagged view conversions appear only as [in] out
24808 parameters. Hence, the reverse conversion must be legal as
24809 well. The forward conversion must be legal even for an out
24810 parameter, because (for example) actual parameters of an
24811 access type are always copied in anyway.
24812
24813 Paragraphs 9 through 20 were reorganized and moved below.
24814
24815 8.b/2
24816 Discussion: {AI95-00251-01AI95-00251-01} The entire Legality
24817 Rules section has been reorganized to eliminate an
24818 unintentional incompatibility with Ada 83. In rare cases, a
24819 type conversion between two types related by derivation is not
24820 allowed by Ada 95, while it is allowed in Ada 83. The
24821 reorganization fixes this. Much of the wording of the
24822 legality section is unchanged, but it is reordered and
24823 reformatted. Because of the limitations of our tools, we had
24824 to delete and replace nearly the entire section. The text of
24825 Ada 95 paragraphs 8 through 12, 14, 15, 17, 19, 20, and 24 are
24826 unchanged (just moved); these are now 24.1 through 24.5,
24827 24.12, 24.13, 24.17, 24.19, 24.20, and 8.
24828
24829 21/3
24830 {AI95-00251-01AI95-00251-01} {AI05-0115-1AI05-0115-1} If there is a type
24831 (other than a root numeric type) that is an ancestor of both the target
24832 type and the operand type, or both types are class-wide types, then at
24833 least one of the following rules shall apply:
24834
24835 21.1/2
24836 * {AI95-00251-01AI95-00251-01} The target type shall be untagged; or
24837
24838 22
24839 * The operand type shall be covered by or descended from the target
24840 type; or
24841
24842 22.a
24843 Ramification: This is a conversion toward the root, which is
24844 always safe.
24845
24846 23/2
24847 * {AI95-00251-01AI95-00251-01} The operand type shall be a class-wide
24848 type that covers the target type; or
24849
24850 23.a
24851 Ramification: This is a conversion of a class-wide type toward
24852 the leaves, which requires a tag check. See Dynamic
24853 Semantics.
24854
24855 23.b/2
24856 {AI95-00251-01AI95-00251-01} These two rules imply that a
24857 conversion from an ancestor type to a type extension is not
24858 permitted, as this would require specifying the values for
24859 additional components, in general, and changing the tag. An
24860 extension_aggregate has to be used instead, constructing a new
24861 value, rather than converting an existing value. However, a
24862 conversion from the class-wide type rooted at an ancestor type
24863 is permitted; such a conversion just verifies that the
24864 operand's tag is a descendant of the target.
24865
24866 23.1/2
24867 * {AI95-00251-01AI95-00251-01} The operand and target types shall
24868 both be class-wide types and the specific type associated with at
24869 least one of them shall be an interface type.
24870
24871 23.c/2
24872 Ramification: We allow converting any class-wide type T'Class
24873 to or from a class-wide interface type even if the specific
24874 type T does not have an appropriate interface ancestor,
24875 because some extension of T might have the needed ancestor.
24876 This is similar to a conversion of a class-wide type toward
24877 the leaves of the tree, and we need to be consistent. Of
24878 course, there is a run-time check that the actual object has
24879 the needed interface.
24880
24881 24/3
24882 {AI95-00251-01AI95-00251-01} {AI05-0115-1AI05-0115-1} If there is no
24883 type (other than a root numeric type) that is the ancestor of both the
24884 target type and the operand type, and they are not both class-wide
24885 types, one of the following rules shall apply:
24886
24887 24.1/2
24888 * {AI95-00251-01AI95-00251-01} If the target type is a numeric type,
24889 then the operand type shall be a numeric type.
24890
24891 24.2/2
24892 * {AI95-00251-01AI95-00251-01} If the target type is an array type,
24893 then the operand type shall be an array type. Further:
24894
24895 24.3/2
24896 * {AI95-00251-01AI95-00251-01} The types shall have the
24897 same dimensionality;
24898
24899 24.4/2
24900 * {AI95-00251-01AI95-00251-01} Corresponding index types
24901 shall be convertible;
24902
24903 24.5/2
24904 * {AI95-00251-01AI95-00251-01} The component subtypes shall
24905 statically match;
24906
24907 24.6/2
24908 * {AI95-00392-01AI95-00392-01} If the component types are
24909 anonymous access types, then the accessibility level of
24910 the operand type shall not be statically deeper than that
24911 of the target type;
24912
24913 24.b/2
24914 Reason: For unrelated array types, the component types could
24915 have different accessibility, and we had better not allow a
24916 conversion of a local type into a global type, in case the
24917 local type points at local objects. We don't need a check for
24918 other types of components; such components necessarily are for
24919 related types, and either have the same accessibility or (for
24920 access discriminants) cannot be changed so the discriminant
24921 check will prevent problems.
24922
24923 24.7/2
24924 * {AI95-00246-01AI95-00246-01} Neither the target type nor
24925 the operand type shall be limited;
24926
24927 24.c/2
24928 Reason: We cannot allow conversions between unrelated limited
24929 types, as they may have different representations, and (since
24930 the types are limited), a copy cannot be made to reconcile the
24931 representations.
24932
24933 24.8/2
24934 * {AI95-00251-01AI95-00251-01} {AI95-00363-01AI95-00363-01}
24935 If the target type of a view conversion has aliased
24936 components, then so shall the operand type; and
24937
24938 24.d/2
24939 Reason: {AI95-00363-01AI95-00363-01} We cannot allow a view
24940 conversion from an object with unaliased components to an
24941 object with aliased components, because that would effectively
24942 allow pointers to unaliased components. This rule was missing
24943 from Ada 95.
24944
24945 24.9/2
24946 * {AI95-00246-01AI95-00246-01} {AI95-00251-01AI95-00251-01}
24947 The operand type of a view conversion shall not have a
24948 tagged, private, or volatile subcomponent.
24949
24950 24.e/2
24951 Reason: {AI95-00246-01AI95-00246-01} We cannot allow view
24952 conversions between unrelated might-be-by-reference types, as
24953 they may have different representations, and a copy cannot be
24954 made to reconcile the representations.
24955
24956 24.f/2
24957 Ramification: These rules only apply to unrelated array
24958 conversions; different (weaker) rules apply to conversions
24959 between related types.
24960
24961 24.10/2
24962 * {AI95-00230-01AI95-00230-01} If the target type is
24963 universal_access, then the operand type shall be an access type.
24964
24965 24.g/2
24966 Discussion: Such a conversion cannot be written explicitly, of
24967 course, but it can be implicit (see below).
24968
24969 24.11/2
24970 * {AI95-00230-01AI95-00230-01} {AI95-00251-01AI95-00251-01} If the
24971 target type is a general access-to-object type, then the operand
24972 type shall be universal_access or an access-to-object type.
24973 Further, if the operand type is not universal_access:
24974
24975 24.h/2
24976 Discussion: The Legality Rules and Dynamic Semantics are
24977 worded so that a type_conversion T(X) (where T is an access
24978 type) is (almost) equivalent to the attribute_reference
24979 X.all'Access, where the result is of type T. The only
24980 difference is that the type_conversion accepts a null value,
24981 whereas the attribute_reference would raise Constraint_Error.
24982
24983 24.12/2
24984 * {AI95-00251-01AI95-00251-01} If the target type is an
24985 access-to-variable type, then the operand type shall be
24986 an access-to-variable type;
24987
24988 24.i/2
24989 Ramification: If the target type is an access-to-constant
24990 type, then the operand type can be access-to-constant or
24991 access-to-variable.
24992
24993 24.13/2
24994 * {AI95-00251-01AI95-00251-01} If the target designated
24995 type is tagged, then the operand designated type shall be
24996 convertible to the target designated type;
24997
24998 24.14/2
24999 * {AI95-00251-01AI95-00251-01} {AI95-00363-01AI95-00363-01}
25000 If the target designated type is not tagged, then the
25001 designated types shall be the same, and either:
25002
25003 24.15/2
25004 * {AI95-00363-01AI95-00363-01} the designated subtypes
25005 shall statically match; or
25006
25007 24.16/2
25008 * {AI95-00363-01AI95-00363-01}
25009 {AI95-00384-01AI95-00384-01} the designated type
25010 shall be discriminated in its full view and
25011 unconstrained in any partial view, and one of the
25012 designated subtypes shall be unconstrained;
25013
25014 24.j/2
25015 Ramification: {AI95-00363-01AI95-00363-01} This does not
25016 require that types have a partial view in order to allow the
25017 conversion, simply that any partial view that does exist is
25018 unconstrained.
25019
25020 24.k/2
25021 {AI95-00384-01AI95-00384-01} This allows conversions both ways
25022 (either subtype can be unconstrained); while Ada 95 only
25023 allowed the conversion if the target subtype is unconstrained.
25024 We generally want type conversions to be symmetric; which type
25025 is the target shouldn't matter for legality.
25026
25027 24.l/2
25028 Reason: {AI95-00363-01AI95-00363-01} If the visible partial
25029 view is constrained, we do not allow conversion between
25030 unconstrained and constrained subtypes. This means that
25031 whether the full type had discriminants is not visible to
25032 clients of the partial view.
25033
25034 24.m/2
25035 Reason: These rules are designed to ensure that aliased array
25036 objects only need "dope" if their nominal subtype is
25037 unconstrained, but they can always have dope if required by
25038 the run-time model (since no sliding is permitted as part of
25039 access type conversion). By contrast, aliased discriminated
25040 objects will always need their discriminants stored with them,
25041 even if nominally constrained. (Here, we are assuming an
25042 implementation that represents an access value as a single
25043 pointer.)
25044
25045 24.17/3
25046 * {AI95-00251-01AI95-00251-01} {AI05-0148-1AI05-0148-1}
25047 {AI05-0248-1AI05-0248-1} The accessibility level of the
25048 operand type shall not be statically deeper than that of
25049 the target type, unless the target type is an anonymous
25050 access type of a stand-alone object. If the target type
25051 is that of such a stand-alone object, the accessibility
25052 level of the operand type shall not be statically deeper
25053 than that of the declaration of the stand-alone object.
25054 In addition to the places where Legality Rules normally
25055 apply (see *note 12.3::), this rule applies also in the
25056 private part of an instance of a generic unit.
25057
25058 24.n/3
25059 Ramification: {AI05-0148-1AI05-0148-1} The access parameter
25060 case is handled by a run-time check. Run-time checks are also
25061 done in instance bodies, and for stand-alone objects of
25062 anonymous access types.
25063
25064 24.n.1/3
25065 Reason: We prohibit storing accesses to objects deeper than a
25066 stand-alone object of an anonymous access-to-object (even
25067 while we allow storing all other accesses) in order to prevent
25068 dangling accesses.
25069
25070 24.18/2
25071 * {AI95-00230-01AI95-00230-01} If the target type is a pool-specific
25072 access-to-object type, then the operand type shall be
25073 universal_access.
25074
25075 24.o/2
25076 Reason: This allows null to be converted to pool-specific
25077 types. Without it, null could be converted to general access
25078 types but not pool-specific ones, which would be too
25079 inconsistent. Remember that these rules only apply to
25080 unrelated types, so we don't have to talk about conversions to
25081 derived or other related types.
25082
25083 24.19/2
25084 * {AI95-00230-01AI95-00230-01} {AI95-00251-01AI95-00251-01} If the
25085 target type is an access-to-subprogram type, then the operand type
25086 shall be universal_access or an access-to-subprogram type.
25087 Further, if the operand type is not universal_access:
25088
25089 24.20/3
25090 * {AI95-00251-01AI95-00251-01} {AI05-0239-1AI05-0239-1} The
25091 designated profiles shall be subtype conformant.
25092
25093 24.21/2
25094 * {AI95-00251-01AI95-00251-01} The accessibility level of
25095 the operand type shall not be statically deeper than that
25096 of the target type. In addition to the places where
25097 Legality Rules normally apply (see *note 12.3::), this
25098 rule applies also in the private part of an instance of a
25099 generic unit. If the operand type is declared within a
25100 generic body, the target type shall be declared within
25101 the generic body.
25102
25103 24.p/2
25104 Reason: The reason it is illegal to convert from an
25105 access-to-subprogram type declared in a generic body to one
25106 declared outside that body is that in an implementation that
25107 shares generic bodies, procedures declared inside the generic
25108 need to have a different calling convention -- they need an
25109 extra parameter pointing to the data declared in the current
25110 instance. For procedures declared in the spec, that's OK,
25111 because the compiler can know about them at compile time of
25112 the instantiation.
25113
25114 _Static Semantics_
25115
25116 25
25117 A type_conversion that is a value conversion denotes the value that is
25118 the result of converting the value of the operand to the target subtype.
25119
25120 26/3
25121 {AI05-0264-1AI05-0264-1} A type_conversion that is a view conversion
25122 denotes a view of the object denoted by the operand. This view is a
25123 variable of the target type if the operand denotes a variable;
25124 otherwise, it is a constant of the target type.
25125
25126 27
25127 The nominal subtype of a type_conversion is its target subtype.
25128
25129 _Dynamic Semantics_
25130
25131 28
25132 For the evaluation of a type_conversion that is a value conversion, the
25133 operand is evaluated, and then the value of the operand is converted to
25134 a corresponding value of the target type, if any. If there is no value
25135 of the target type that corresponds to the operand value,
25136 Constraint_Error is raised[; this can only happen on conversion to a
25137 modular type, and only when the operand value is outside the base range
25138 of the modular type.] Additional rules follow:
25139
25140 29
25141 * Numeric Type Conversion
25142
25143 30
25144 * If the target and the operand types are both integer
25145 types, then the result is the value of the target type
25146 that corresponds to the same mathematical integer as the
25147 operand.
25148
25149 31
25150 * If the target type is a decimal fixed point type, then
25151 the result is truncated (toward 0) if the value of the
25152 operand is not a multiple of the small of the target
25153 type.
25154
25155 32
25156 * If the target type is some other real type, then the
25157 result is within the accuracy of the target type (see
25158 *note G.2::, "*note G.2:: Numeric Performance
25159 Requirements", for implementations that support the
25160 Numerics Annex).
25161
25162 32.a
25163 Discussion: An integer type might have more bits of precision
25164 than a real type, so on conversion (of a large integer), some
25165 precision might be lost.
25166
25167 33
25168 * If the target type is an integer type and the operand
25169 type is real, the result is rounded to the nearest
25170 integer (away from zero if exactly halfway between two
25171 integers).
25172
25173 33.a/2
25174 Discussion: {AI95-00267-01AI95-00267-01} This was
25175 implementation defined in Ada 83. There seems no reason to
25176 preserve the nonportability in Ada 95. Round-away-from-zero
25177 is the conventional definition of rounding, and standard
25178 Fortran and COBOL both specify rounding away from zero, so for
25179 interoperability, it seems important to pick this. This is
25180 also the most easily "undone" by hand. Round-to-nearest-even
25181 is an alternative, but that is quite complicated if not
25182 supported by the hardware. In any case, this operation is not
25183 usually part of an inner loop, so predictability and
25184 portability are judged most important. A floating point
25185 attribute function Unbiased_Rounding is provided (see *note
25186 A.5.3::) for those applications that require
25187 round-to-nearest-even, and a floating point attribute function
25188 Machine_Rounding (also see *note A.5.3::) is provided for
25189 those applications that require the highest possible
25190 performance. "Deterministic" rounding is required for static
25191 conversions to integer as well. See *note 4.9::.
25192
25193 34
25194 * Enumeration Type Conversion
25195
25196 35
25197 * The result is the value of the target type with the same
25198 position number as that of the operand value.
25199
25200 36
25201 * Array Type Conversion
25202
25203 37
25204 * If the target subtype is a constrained array subtype,
25205 then a check is made that the length of each dimension of
25206 the value of the operand equals the length of the
25207 corresponding dimension of the target subtype. The
25208 bounds of the result are those of the target subtype.
25209
25210 38
25211 * If the target subtype is an unconstrained array subtype,
25212 then the bounds of the result are obtained by converting
25213 each bound of the value of the operand to the
25214 corresponding index type of the target type. For each
25215 nonnull index range, a check is made that the bounds of
25216 the range belong to the corresponding index subtype.
25217
25218 38.a
25219 Discussion: Only nonnull index ranges are checked, per
25220 AI83-00313.
25221
25222 39
25223 * In either array case, the value of each component of the
25224 result is that of the matching component of the operand
25225 value (see *note 4.5.2::).
25226
25227 39.a
25228 Ramification: This applies whether or not the component is
25229 initialized.
25230
25231 39.1/2
25232 * {AI95-00392-01AI95-00392-01} If the component types of
25233 the array types are anonymous access types, then a check
25234 is made that the accessibility level of the operand type
25235 is not deeper than that of the target type.
25236
25237 39.b/2
25238 Reason: This check is needed for operands that are access
25239 parameters and in instance bodies. Other cases are handled by
25240 the legality rule given previously.
25241
25242 40
25243 * Composite (Non-Array) Type Conversion
25244
25245 41
25246 * The value of each nondiscriminant component of the result
25247 is that of the matching component of the operand value.
25248
25249 41.a
25250 Ramification: This applies whether or not the component is
25251 initialized.
25252
25253 42
25254 * [The tag of the result is that of the operand.] If the
25255 operand type is class-wide, a check is made that the tag
25256 of the operand identifies a (specific) type that is
25257 covered by or descended from the target type.
25258
25259 42.a
25260 Ramification: This check is certain to succeed if the operand
25261 type is itself covered by or descended from the target type.
25262
25263 42.b
25264 Proof: The fact that a type_conversion preserves the tag is
25265 stated officially in *note 3.9::, "*note 3.9:: Tagged Types
25266 and Type Extensions"
25267
25268 43
25269 * For each discriminant of the target type that corresponds
25270 to a discriminant of the operand type, its value is that
25271 of the corresponding discriminant of the operand value;
25272 if it corresponds to more than one discriminant of the
25273 operand type, a check is made that all these
25274 discriminants are equal in the operand value.
25275
25276 44
25277 * For each discriminant of the target type that corresponds
25278 to a discriminant that is specified by the
25279 derived_type_definition for some ancestor of the operand
25280 type (or if class-wide, some ancestor of the specific
25281 type identified by the tag of the operand), its value in
25282 the result is that specified by the
25283 derived_type_definition.
25284
25285 44.a
25286 Ramification: It is a ramification of the rules for the
25287 discriminants of derived types that each discriminant of the
25288 result is covered either by this paragraph or the previous
25289 one. See *note 3.7::.
25290
25291 45
25292 * For each discriminant of the operand type that
25293 corresponds to a discriminant that is specified by the
25294 derived_type_definition for some ancestor of the target
25295 type, a check is made that in the operand value it equals
25296 the value specified for it.
25297
25298 46
25299 * For each discriminant of the result, a check is made that
25300 its value belongs to its subtype.
25301
25302 47
25303 * Access Type Conversion
25304
25305 48/3
25306 * {AI05-0148-1AI05-0148-1} {AI05-0248-1AI05-0248-1} For an
25307 access-to-object type, a check is made that the
25308 accessibility level of the operand type is not deeper
25309 than that of the target type, unless the target type is
25310 an anonymous access type of a stand-alone object. If the
25311 target type is that of such a stand-alone object, a check
25312 is made that the accessibility level of the operand type
25313 is not deeper than that of the declaration of the
25314 stand-alone object[; then if the check succeeds, the
25315 accessibility level of the target type becomes that of
25316 the operand type].
25317
25318 48.a/3
25319 Ramification: {AI05-0148-1AI05-0148-1} This check is needed
25320 for operands that are access parameters, for stand-alone
25321 anonymous access objects, and in instance bodies.
25322
25323 48.b
25324 Note that this check can never fail for the implicit
25325 conversion to the anonymous type of an access parameter that
25326 is done when calling a subprogram with an access parameter.
25327
25328 49/2
25329 * {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01}
25330 If the operand value is null, the result of the
25331 conversion is the null value of the target type.
25332
25333 49.a/2
25334 Ramification: A conversion to an anonymous access type happens
25335 implicitly as part of initializing or assigning to an
25336 anonymous access object.
25337
25338 50
25339 * If the operand value is not null, then the result
25340 designates the same object (or subprogram) as is
25341 designated by the operand value, but viewed as being of
25342 the target designated subtype (or profile); any checks
25343 associated with evaluating a conversion to the target
25344 designated subtype are performed.
25345
25346 50.a
25347 Ramification: The checks are certain to succeed if the target
25348 and operand designated subtypes statically match.
25349
25350 51/3
25351 {AI95-00231-01AI95-00231-01} {AI05-0153-3AI05-0153-3}
25352 {AI05-0290-1AI05-0290-1} After conversion of the value to the target
25353 type, if the target subtype is constrained, a check is performed that
25354 the value satisfies this constraint. If the target subtype excludes
25355 null, then a check is made that the value is not null. If predicate
25356 checks are enabled for the target subtype (see *note 3.2.4::), a check
25357 is performed that the predicate of the target subtype is satisfied for
25358 the value.
25359
25360 51.a/2
25361 Ramification: {AI95-00231-01AI95-00231-01} The first check
25362 above is a Range_Check for scalar subtypes, a
25363 Discriminant_Check or Index_Check for access subtypes, and a
25364 Discriminant_Check for discriminated subtypes. The
25365 Length_Check for an array conversion is performed as part of
25366 the conversion to the target type. The check for exclusion of
25367 null is an Access_Check.
25368
25369 52
25370 For the evaluation of a view conversion, the operand name is evaluated,
25371 and a new view of the object denoted by the operand is created, whose
25372 type is the target type; if the target type is composite, checks are
25373 performed as above for a value conversion.
25374
25375 53
25376 The properties of this new view are as follows:
25377
25378 54/1
25379 * {8652/00178652/0017} {AI95-00184-01AI95-00184-01} If the target
25380 type is composite, the bounds or discriminants (if any) of the view
25381 are as defined above for a value conversion; each nondiscriminant
25382 component of the view denotes the matching component of the operand
25383 object; the subtype of the view is constrained if either the target
25384 subtype or the operand object is constrained, or if the target
25385 subtype is indefinite, or if the operand type is a descendant of
25386 the target type and has discriminants that were not inherited from
25387 the target type;
25388
25389 55
25390 * If the target type is tagged, then an assignment to the view
25391 assigns to the corresponding part of the object denoted by the
25392 operand; otherwise, an assignment to the view assigns to the
25393 object, after converting the assigned value to the subtype of the
25394 object (which might raise Constraint_Error);
25395
25396 56
25397 * Reading the value of the view yields the result of converting the
25398 value of the operand object to the target subtype (which might
25399 raise Constraint_Error), except if the object is of an access type
25400 and the view conversion is passed as an out parameter; in this
25401 latter case, the value of the operand object is used to initialize
25402 the formal parameter without checking against any constraint of the
25403 target subtype (see *note 6.4.1::).
25404
25405 56.a
25406 Reason: This ensures that even an out parameter of an access
25407 type is initialized reasonably.
25408
25409 57/3
25410 {AI05-0290-1AI05-0290-1} If an Accessibility_Check fails, Program_Error
25411 is raised. If a predicate check fails, Assertions.Assertion_Error is
25412 raised. Any other check associated with a conversion raises
25413 Constraint_Error if it fails.
25414
25415 58
25416 Conversion to a type is the same as conversion to an unconstrained
25417 subtype of the type.
25418
25419 58.a
25420 Reason: This definition is needed because the semantics of
25421 various constructs involves converting to a type, whereas an
25422 explicit type_conversion actually converts to a subtype. For
25423 example, the evaluation of a range is defined to convert the
25424 values of the expressions to the type of the range.
25425
25426 58.b
25427 Ramification: A conversion to a scalar type, or, equivalently,
25428 to an unconstrained scalar subtype, can raise Constraint_Error
25429 if the value is outside the base range of the type.
25430
25431 NOTES
25432
25433 59
25434 19 In addition to explicit type_conversions, type conversions are
25435 performed implicitly in situations where the expected type and the
25436 actual type of a construct differ, as is permitted by the type
25437 resolution rules (see *note 8.6::). For example, an integer
25438 literal is of the type universal_integer, and is implicitly
25439 converted when assigned to a target of some specific integer type.
25440 Similarly, an actual parameter of a specific tagged type is
25441 implicitly converted when the corresponding formal parameter is of
25442 a class-wide type.
25443
25444 60
25445 Even when the expected and actual types are the same, implicit
25446 subtype conversions are performed to adjust the array bounds (if
25447 any) of an operand to match the desired target subtype, or to raise
25448 Constraint_Error if the (possibly adjusted) value does not satisfy
25449 the constraints of the target subtype.
25450
25451 61/2
25452 20 {AI95-00230-01AI95-00230-01} A ramification of the overload
25453 resolution rules is that the operand of an (explicit)
25454 type_conversion cannot be an allocator, an aggregate, a
25455 string_literal, a character_literal, or an attribute_reference for
25456 an Access or Unchecked_Access attribute. Similarly, such an
25457 expression enclosed by parentheses is not allowed. A
25458 qualified_expression (see *note 4.7::) can be used instead of such
25459 a type_conversion.
25460
25461 62
25462 21 The constraint of the target subtype has no effect for a
25463 type_conversion of an elementary type passed as an out parameter.
25464 Hence, it is recommended that the first subtype be specified as the
25465 target to minimize confusion (a similar recommendation applies to
25466 renaming and generic formal in out objects).
25467
25468 _Examples_
25469
25470 63
25471 Examples of numeric type conversion:
25472
25473 64
25474 Real(2*J) -- value is converted to floating point
25475 Integer(1.6) -- value is 2
25476 Integer(-0.4) -- value is 0
25477
25478 65
25479 Example of conversion between derived types:
25480
25481 66
25482 type A_Form is new B_Form;
25483
25484 67
25485 X : A_Form;
25486 Y : B_Form;
25487
25488 68
25489 X := A_Form(Y);
25490 Y := B_Form(X); -- the reverse conversion
25491
25492 69
25493 Examples of conversions between array types:
25494
25495 70
25496 type Sequence is array (Integer range <>) of Integer;
25497 subtype Dozen is Sequence(1 .. 12);
25498 Ledger : array(1 .. 100) of Integer;
25499
25500 71
25501 Sequence(Ledger) -- bounds are those of Ledger
25502 Sequence(Ledger(31 .. 42)) -- bounds are 31 and 42
25503 Dozen(Ledger(31 .. 42)) -- bounds are those of Dozen
25504
25505 _Incompatibilities With Ada 83_
25506
25507 71.a
25508 A character_literal is not allowed as the operand of a
25509 type_conversion, since there are now two character types in
25510 package Standard.
25511
25512 71.b
25513 The component subtypes have to statically match in an array
25514 conversion, rather than being checked for matching constraints
25515 at run time.
25516
25517 71.c
25518 Because sliding of array bounds is now provided for operations
25519 where it was not in Ada 83, programs that used to raise
25520 Constraint_Error might now continue executing and produce a
25521 reasonable result. This is likely to fix more bugs than it
25522 creates.
25523
25524 _Extensions to Ada 83_
25525
25526 71.d
25527 A type_conversion is considered the name of an object in
25528 certain circumstances (such a type_conversion is called a view
25529 conversion). In particular, as in Ada 83, a type_conversion
25530 can appear as an in out or out actual parameter. In addition,
25531 if the target type is tagged and the operand is the name of an
25532 object, then so is the type_conversion, and it can be used as
25533 the prefix to a selected_component, in an
25534 object_renaming_declaration, etc.
25535
25536 71.e
25537 We no longer require type-mark conformance between a parameter
25538 of the form of a type conversion, and the corresponding formal
25539 parameter. This had caused some problems for inherited
25540 subprograms (since there isn't really a type-mark for
25541 converted formals), as well as for renamings, formal
25542 subprograms, etc. See AI83-00245, AI83-00318, AI83-00547.
25543
25544 71.f
25545 We now specify "deterministic" rounding from real to integer
25546 types when the value of the operand is exactly between two
25547 integers (rounding is away from zero in this case).
25548
25549 71.g
25550 "Sliding" of array bounds (which is part of conversion to an
25551 array subtype) is performed in more cases in Ada 95 than in
25552 Ada 83. Sliding is not performed on the operand of a
25553 membership test, nor on the operand of a qualified_expression.
25554 It wouldn't make sense on a membership test, and we wish to
25555 retain a connection between subtype membership and subtype
25556 qualification. In general, a subtype membership test returns
25557 True if and only if a corresponding subtype qualification
25558 succeeds without raising an exception. Other operations that
25559 take arrays perform sliding.
25560
25561 _Wording Changes from Ada 83_
25562
25563 71.h
25564 We no longer explicitly list the kinds of things that are not
25565 allowed as the operand of a type_conversion, except in a NOTE.
25566
25567 71.i/3
25568 {AI05-0299-1AI05-0299-1} The rules in this subclause subsume
25569 the rules for "parameters of the form of a type conversion,"
25570 and have been generalized to cover the use of a type
25571 conversion as a name.
25572
25573 _Incompatibilities With Ada 95_
25574
25575 71.j/2
25576 {AI95-00246-01AI95-00246-01} Amendment Correction: Conversions
25577 between unrelated array types that are limited or (for view
25578 conversions) might be by-reference types are now illegal. The
25579 representations of two such arrays may differ, making the
25580 conversions impossible. We make the check here, because
25581 legality should not be based on representation properties.
25582 Such conversions are likely to be rare, anyway. There is a
25583 potential that this change would make a working program
25584 illegal (if the types have the same representation).
25585
25586 71.k/2
25587 {AI95-00363-01AI95-00363-01} If a discriminated full type has
25588 a partial view (private type) that is constrained, we do not
25589 allow conversion between access-to-unconstrained and
25590 access-to-constrained subtypes designating the type. Ada 95
25591 allowed this conversion and the declaration of various access
25592 subtypes, requiring that the designated object be constrained
25593 and thus making details of the implementation of the private
25594 type visible to the client of the private type. See *note
25595 4.8:: for more on this topic.
25596
25597 _Extensions to Ada 95_
25598
25599 71.l/2
25600 {AI95-00230-01AI95-00230-01} Conversion rules for
25601 universal_access were defined. These allow the use of
25602 anonymous access values in equality tests (see *note 4.5.2::),
25603 and also allow the use of null in type conversions and other
25604 contexts that do not provide a single expected type.
25605
25606 71.m/2
25607 {AI95-00384-01AI95-00384-01} A type conversion from an
25608 access-to-discriminated and unconstrained object to an
25609 access-to-discriminated and constrained one is allowed. Ada
25610 95 only allowed the reverse conversion, which was weird and
25611 asymmetric. Of course, a constraint check will be performed
25612 for this conversion.
25613
25614 _Wording Changes from Ada 95_
25615
25616 71.n/2
25617 {8652/00178652/0017} {AI95-00184-01AI95-00184-01} Corrigendum:
25618 Wording was added to ensure that view conversions are
25619 constrained, and that a tagged view conversion has a tagged
25620 object. Both rules are needed to avoid having a way to change
25621 the discriminants of a constrained object.
25622
25623 71.o/2
25624 {8652/00088652/0008} {AI95-00168-01AI95-00168-01} Corrigendum:
25625 Wording was added to ensure that the aliased status of array
25626 components cannot change in a view conversion. This rule was
25627 needed to avoid having a way to change the discriminants of an
25628 aliased object. This rule was repealed later, as Ada 2005
25629 allows changing the discriminants of an aliased object.
25630
25631 71.p/2
25632 {AI95-00231-01AI95-00231-01} Wording was added to check
25633 subtypes that exclude null (see *note 3.10::).
25634
25635 71.q/2
25636 {AI95-00251-01AI95-00251-01} The organization of the legality
25637 rules was changed, both to make it clearer, and to eliminate
25638 an unintentional incompatibility with Ada 83. The old
25639 organization prevented type conversions between some types
25640 that were related by derivation (which Ada 83 always allowed).
25641
25642 71.r/3
25643 {AI95-00330-01AI95-00330-01} {AI05-0005-1AI05-0005-1}
25644 Clarified that an untagged type conversion appearing as a
25645 generic actual parameter for a generic in out formal parameter
25646 is not a view conversion (and thus is illegal). This confirms
25647 the ACATS tests, so all implementations already follow this
25648 interpretation.
25649
25650 71.s/2
25651 {AI95-00363-01AI95-00363-01} Rules added by the Corrigendum to
25652 eliminate problems with discriminants of aliased components
25653 changing were removed, as we now generally allow discriminants
25654 of aliased components to be changed.
25655
25656 71.t/2
25657 {AI95-00392-01AI95-00392-01} Accessibility checks on
25658 conversions involving types with anonymous access components
25659 were added. These components have the level of the type, and
25660 conversions can be between types at different levels, which
25661 could cause dangling access values in the absence of such
25662 checks.
25663
25664 _Inconsistencies With Ada 2005_
25665
25666 71.u/3
25667 {AI05-0148-1AI05-0148-1} A stand-alone object of an anonymous
25668 access-to-object type now has dynamic accessibility.
25669 Normally, this will make programs legal that were illegal in
25670 Ada 2005. However, it is possible that a program that
25671 previously raised Program_Error now will not. It is very
25672 unlikely that an existing program intentionally depends on the
25673 exception being raised; the change is more likely to fix bugs
25674 than introduce them.
25675
25676 _Wording Changes from Ada 2005_
25677
25678 71.v/3
25679 {AI05-0115-1AI05-0115-1} Correction: Clarified that a root
25680 numeric type is not considered a common ancestor for a
25681 conversion.
25682
25683 71.w/3
25684 {AI05-0153-3AI05-0153-3} {AI05-0290-1AI05-0290-1} Added rules
25685 so that predicate aspects (see *note 3.2.4::) are enforced on
25686 subtype conversion.
25687
25688 \1f
25689 File: aarm2012.info, Node: 4.7, Next: 4.8, Prev: 4.6, Up: 4
25690
25691 4.7 Qualified Expressions
25692 =========================
25693
25694 1
25695 [A qualified_expression is used to state explicitly the type, and to
25696 verify the subtype, of an operand that is either an expression or an
25697 aggregate. ]
25698
25699 _Syntax_
25700
25701 2
25702 qualified_expression ::=
25703 subtype_mark'(expression) | subtype_mark'aggregate
25704
25705 _Name Resolution Rules_
25706
25707 3
25708 The operand (the expression or aggregate) shall resolve to be of the
25709 type determined by the subtype_mark (*note 3.2.2: S0028.), or a
25710 universal type that covers it.
25711
25712 _Static Semantics_
25713
25714 3.1/3
25715 {AI05-0003-1AI05-0003-1} [If the operand of a qualified_expression
25716 denotes an object, the qualified_expression denotes a constant view of
25717 that object.] The nominal subtype of a qualified_expression is the
25718 subtype denoted by the subtype_mark.
25719
25720 3.a/3
25721 Proof: {AI05-0003-1AI05-0003-1} This is stated in *note 3.3::.
25722
25723 _Dynamic Semantics_
25724
25725 4
25726 The evaluation of a qualified_expression evaluates the operand (and if
25727 of a universal type, converts it to the type determined by the
25728 subtype_mark) and checks that its value belongs to the subtype denoted
25729 by the subtype_mark. The exception Constraint_Error is raised if this
25730 check fails.
25731
25732 4.a
25733 Ramification: This is one of the few contexts in Ada 95 where
25734 implicit subtype conversion is not performed prior to a
25735 constraint check, and hence no "sliding" of array bounds is
25736 provided.
25737
25738 4.b
25739 Reason: Implicit subtype conversion is not provided because a
25740 qualified_expression with a constrained target subtype is
25741 essentially an assertion about the subtype of the operand,
25742 rather than a request for conversion. An explicit
25743 type_conversion can be used rather than a qualified_expression
25744 if subtype conversion is desired.
25745
25746 NOTES
25747
25748 5
25749 22 When a given context does not uniquely identify an expected
25750 type, a qualified_expression can be used to do so. In particular,
25751 if an overloaded name or aggregate is passed to an overloaded
25752 subprogram, it might be necessary to qualify the operand to resolve
25753 its type.
25754
25755 _Examples_
25756
25757 6
25758 Examples of disambiguating expressions using qualification:
25759
25760 7
25761 type Mask is (Fix, Dec, Exp, Signif);
25762 type Code is (Fix, Cla, Dec, Tnz, Sub);
25763
25764 8
25765 Print (Mask'(Dec)); -- Dec is of type Mask
25766 Print (Code'(Dec)); -- Dec is of type Code
25767
25768 9
25769 for J in Code'(Fix) .. Code'(Dec) loop ... -- qualification needed for either Fix or Dec
25770 for J in Code range Fix .. Dec loop ... -- qualification unnecessary
25771 for J in Code'(Fix) .. Dec loop ... -- qualification unnecessary for Dec
25772
25773 10
25774 Dozen'(1 | 3 | 5 | 7 => 2, others => 0) -- see *note 4.6::
25775
25776 _Wording Changes from Ada 2005_
25777
25778 10.a/3
25779 {AI05-0003-1AI05-0003-1} Added a definition of the nominal
25780 subtype of a qualified_expression.
25781
25782 \1f
25783 File: aarm2012.info, Node: 4.8, Next: 4.9, Prev: 4.7, Up: 4
25784
25785 4.8 Allocators
25786 ==============
25787
25788 1
25789 [The evaluation of an allocator creates an object and yields an access
25790 value that designates the object. ]
25791
25792 _Syntax_
25793
25794 2/3
25795 {AI05-0111-3AI05-0111-3} allocator ::=
25796 new [subpool_specification] subtype_indication
25797 | new [subpool_specification] qualified_expression
25798
25799 2.1/3
25800 {AI05-0111-3AI05-0111-3} subpool_specification ::= (subpool_handle_
25801 name)
25802
25803 2.2/3
25804 {AI05-0104-1AI05-0104-1} For an allocator with a
25805 subtype_indication, the subtype_indication shall not specify a
25806 null_exclusion.
25807
25808 2.a/3
25809 Reason: Such an uninitialized allocator would necessarily
25810 raise Constraint_Error, as the default value is null. Also
25811 note that the syntax does not allow a null_exclusion in an
25812 initialized allocator, so it makes sense to make the
25813 uninitialized case illegal as well.
25814
25815 _Name Resolution Rules_
25816
25817 3/3
25818 {8652/00108652/0010} {AI95-00127-01AI95-00127-01}
25819 {AI05-0111-3AI05-0111-3} {AI05-0269-1AI05-0269-1} The expected type for
25820 an allocator shall be a single access-to-object type with designated
25821 type D such that either D covers the type determined by the subtype_mark
25822 of the subtype_indication (*note 3.2.2: S0027.) or qualified_expression
25823 (*note 4.7: S0142.), or the expected type is anonymous and the
25824 determined type is D'Class. A subpool_handle_name is expected to be of
25825 any type descended from Subpool_Handle, which is the type used to
25826 identify a subpool, declared in package System.Storage_Pools.Subpools
25827 (see *note 13.11.4::).
25828
25829 3.a
25830 Discussion: See *note 8.6::, "*note 8.6:: The Context of
25831 Overload Resolution" for the meaning of "shall be a single ...
25832 type whose ..."
25833
25834 3.a.1/1
25835 Ramification: {8652/00108652/0010}
25836 {AI95-00127-01AI95-00127-01} An allocator is allowed as a
25837 controlling parameter of a dispatching call (see *note
25838 3.9.2::).
25839
25840 _Legality Rules_
25841
25842 4
25843 An initialized allocator is an allocator with a qualified_expression.
25844 An uninitialized allocator is one with a subtype_indication. In the
25845 subtype_indication of an uninitialized allocator, a constraint is
25846 permitted only if the subtype_mark denotes an [unconstrained] composite
25847 subtype; if there is no constraint, then the subtype_mark shall denote a
25848 definite subtype.
25849
25850 4.a
25851 Ramification: For example, ... new S'Class ... (with no
25852 initialization expression) is illegal, but ... new
25853 S'Class'(X) ... is legal, and takes its tag and constraints
25854 from the initial value X. (Note that the former case cannot
25855 have a constraint.)
25856
25857 5/2
25858 {AI95-00287-01AI95-00287-01} If the type of the allocator is an
25859 access-to-constant type, the allocator shall be an initialized
25860 allocator.
25861
25862 5.a/2
25863 This paragraph was deleted.{AI95-00287-01AI95-00287-01}
25864
25865 5.1/3
25866 {AI05-0111-3AI05-0111-3} If a subpool_specification is given, the type
25867 of the storage pool of the access type shall be a descendant of
25868 Root_Storage_Pool_With_Subpools.
25869
25870 5.2/3
25871 {AI95-00344-01AI95-00344-01} If the designated type of the type of the
25872 allocator is class-wide, the accessibility level of the type determined
25873 by the subtype_indication or qualified_expression shall not be
25874 statically deeper than that of the type of the allocator.
25875
25876 5.b/2
25877 Reason: This prevents the allocated object from outliving its
25878 type.
25879
25880 5.3/3
25881 {AI95-00416-01AI95-00416-01} {AI05-0051-1AI05-0051-1} If the subtype
25882 determined by the subtype_indication or qualified_expression of the
25883 allocator has one or more access discriminants, then the accessibility
25884 level of the anonymous access type of each access discriminant shall not
25885 be statically deeper than that of the type of the allocator (see *note
25886 3.10.2::).
25887
25888 5.c/2
25889 Reason: This prevents the allocated object from outliving its
25890 discriminants.
25891
25892 5.4/3
25893 {AI95-00366-01AI95-00366-01} {AI05-0052-1AI05-0052-1}
25894 {AI05-0157-1AI05-0157-1} An allocator shall not be of an access type for
25895 which the Storage_Size has been specified by a static expression with
25896 value zero or is defined by the language to be zero.
25897
25898 5.d/2
25899 Reason: An allocator for an access type that has Storage_Size
25900 specified to be zero is required to raise Storage_Error
25901 anyway. It's better to detect the error at compile-time, as
25902 the allocator might be executed infrequently. This also
25903 simplifies the rules for Pure units, where we do not want to
25904 allow any allocators for library-level access types, as they
25905 would represent state.
25906
25907 5.e/3
25908 {AI05-0157-1AI05-0157-1} We don't need a special rule to cover
25909 generic formals (unlike many other similar Legality Rules).
25910 There are only two cases of interest. For formal access
25911 types, the Storage_Size property is not known in the generic,
25912 and surely isn't static, so this Legality Rule can never
25913 apply. For a formal derived type, this Legality Rule can only
25914 be triggered by a parent type having one of the appropriate
25915 properties. But Storage_Size can never be specified for a
25916 derived access type, so it always has the same value for all
25917 child types; additionally, a type derived from a remote access
25918 type (which has Storage_Size defined to be zero) is also a
25919 remote access type. That means that any actual that would
25920 match the formal derived type necessarily has the same
25921 Storage_Size properties, so it is harmless (and preferable) to
25922 check them in the body - they are always known in that case.
25923 For other formal types,allocators are not allowed, so we don't
25924 need to consider them. So we don't need an assume-the-best
25925 rule here.
25926
25927 5.5/3
25928 {AI05-0052-1AI05-0052-1} If the designated type of the type of the
25929 allocator is limited, then the allocator shall not be used to define the
25930 value of an access discriminant, unless the discriminated type is
25931 immutably limited (see *note 7.5::).
25932
25933 5.f/3
25934 Reason: Because coextensions work very much like parts, we
25935 don't want users creating limited coextensions for nonlimited
25936 types. This would be similar to extending a nonlimited type
25937 with a limited component. We check this on the allocator.
25938 Note that there is an asymmetry in what types are considered
25939 limited; this is required to preserve privacy. We have to
25940 assume that the designated type might be limited as soon as we
25941 see a limited partial view, but we want to ensure that the
25942 containing object is of a type that is always limited.
25943
25944 5.6/3
25945 {AI05-0052-1AI05-0052-1} In addition to the places where Legality Rules
25946 normally apply (see *note 12.3::), these rules apply also in the private
25947 part of an instance of a generic unit.
25948
25949 5.g/3
25950 Discussion: This applies to all of the Legality Rules of this
25951 subclause.
25952
25953 _Static Semantics_
25954
25955 6/3
25956 {AI95-00363-01AI95-00363-01} {AI05-0041-1AI05-0041-1} If the designated
25957 type of the type of the allocator is elementary, then the subtype of the
25958 created object is the designated subtype. If the designated type is
25959 composite, then the subtype of the created object is the designated
25960 subtype when the designated subtype is constrained or there is an
25961 ancestor of the designated type that has a constrained partial view;
25962 otherwise, the created object is constrained by its initial value [(even
25963 if the designated subtype is unconstrained with defaults)].
25964
25965 6.a
25966 Discussion: See AI83-00331.
25967
25968 6.b/2
25969 Reason: {AI95-00363-01AI95-00363-01} All objects created by an
25970 allocator are aliased, and most aliased composite objects need
25971 to be constrained so that access subtypes work reasonably.
25972 Problematic access subtypes are prohibited for types with a
25973 constrained partial view.
25974
25975 6.c/2
25976 Discussion: {AI95-00363-01AI95-00363-01} If there is a
25977 constrained partial view of the type, this allows the objects
25978 to be unconstrained. This eliminates privacy breaking (we
25979 don't want the objects to act differently simply because
25980 they're allocated). Such a created object is effectively
25981 constrained by its initial value if the access type is an
25982 access-to-constant type, or the designated type is limited (in
25983 all views), but we don't need to state that here. It is
25984 implicit in other rules. Note, however, that a value of an
25985 access-to-constant type can designate a variable object via
25986 'Access or conversion, and the variable object might be
25987 assigned by some other access path, and that assignment might
25988 alter the discriminants.
25989
25990 _Dynamic Semantics_
25991
25992 7/2
25993 {AI95-00373-01AI95-00373-01} For the evaluation of an initialized
25994 allocator, the evaluation of the qualified_expression is performed
25995 first. An object of the designated type is created and the value of the
25996 qualified_expression is converted to the designated subtype and assigned
25997 to the object.
25998
25999 7.a
26000 Ramification: The conversion might raise Constraint_Error.
26001
26002 8
26003 For the evaluation of an uninitialized allocator, the elaboration of the
26004 subtype_indication is performed first. Then:
26005
26006 9/2
26007 * {AI95-00373-01AI95-00373-01} If the designated type is elementary,
26008 an object of the designated subtype is created and any implicit
26009 initial value is assigned;
26010
26011 10/2
26012 * {8652/00028652/0002} {AI95-00171-01AI95-00171-01}
26013 {AI95-00373-01AI95-00373-01} If the designated type is composite,
26014 an object of the designated type is created with tag, if any,
26015 determined by the subtype_mark of the subtype_indication. This
26016 object is then initialized by default (see *note 3.3.1::) using the
26017 subtype_indication to determine its nominal subtype. A check is
26018 made that the value of the object belongs to the designated
26019 subtype. Constraint_Error is raised if this check fails. This
26020 check and the initialization of the object are performed in an
26021 arbitrary order.
26022
26023 10.a
26024 Discussion: AI83-00150.
26025
26026 10.1/3
26027 {AI95-00344-01AI95-00344-01} {AI95-00416-01AI95-00416-01}
26028 {AI05-0024-1AI05-0024-1} {AI05-0051-1AI05-0051-1}
26029 {AI05-0234-1AI05-0234-1} For any allocator, if the designated type of
26030 the type of the allocator is class-wide, then a check is made that the
26031 master of the type determined by the subtype_indication, or by the tag
26032 of the value of the qualified_expression, includes the elaboration of
26033 the type of the allocator. If any part of the subtype determined by the
26034 subtype_indication or qualified_expression of the allocator (or by the
26035 tag of the value if the type of the qualified_expression is class-wide)
26036 has one or more access discriminants, then a check is made that the
26037 accessibility level of the anonymous access type of each access
26038 discriminant is not deeper than that of the type of the allocator.
26039 Program_Error is raised if either such check fails.
26040
26041 10.b/3
26042 Reason: {AI95-00344-01AI95-00344-01} {AI05-0024-1AI05-0024-1}
26043 The master check on class-wide types prevents the allocated
26044 object from outliving its type. We need the run-time check in
26045 instance bodies, or when the type of the qualified_expression
26046 is class-wide (other cases are statically detected).
26047
26048 10.b.1/3
26049 {AI05-0024-1AI05-0024-1} We can't use the normal accessibility
26050 level "deeper than" check here because we may have
26051 "incomparable" levels if the appropriate master and the type
26052 declaration belong to two different tasks. This can happen
26053 when checking the master of the tag for an allocator
26054 initialized by a parameter passed in to an accept statement,
26055 if the type of the allocator is an access type declared in the
26056 enclosing task body. For example:
26057
26058 10.b.2/3
26059 task body TT is
26060 type Acc_TC is access T'Class;
26061 P : Acc_TC;
26062 begin
26063 accept E(X : T'Class) do
26064 P := new T'Class'(X);
26065 -- Master check on tag of X.
26066 -- Can't use "accessibility levels" since they might be incomparable.
26067 -- Must revert to checking that the master of the type identified by
26068 -- X'tag includes the elaboration of Acc_TC, so it is sure to outlive it.
26069 end E;
26070
26071 10.c/2
26072 {AI95-00416-01AI95-00416-01} The accessibility check on access
26073 discriminants prevents the allocated object from outliving its
26074 discriminants.
26075
26076 10.2/2
26077 {AI95-00280-01AI95-00280-01} If the object to be created by an allocator
26078 has a controlled or protected part, and the finalization of the
26079 collection of the type of the allocator (see *note 7.6.1::) has started,
26080 Program_Error is raised.
26081
26082 10.d/2
26083 Reason: If the object has a controlled or protected part, its
26084 finalization is likely to be nontrivial. If the allocation
26085 was allowed, we could not know whether the finalization would
26086 actually be performed. That would be dangerous to otherwise
26087 safe abstractions, so we mandate a check here. On the other
26088 hand, if the finalization of the object will be trivial, we do
26089 not require (but allow) the check, as no real harm could come
26090 from late allocation.
26091
26092 10.e/2
26093 Discussion: This check can only fail if an allocator is
26094 evaluated in code reached from a Finalize routine for a type
26095 declared in the same master. That's highly unlikely; Finalize
26096 routines are much more likely to be deallocating objects than
26097 allocating them.
26098
26099 10.3/2
26100 {AI95-00280-01AI95-00280-01} If the object to be created by an allocator
26101 contains any tasks, and the master of the type of the allocator is
26102 completed, and all of the dependent tasks of the master are terminated
26103 (see *note 9.3::), then Program_Error is raised.
26104
26105 10.f/2
26106 Reason: A task created after waiting for tasks has finished
26107 could depend on freed data structures, and certainly would
26108 never be awaited.
26109
26110 10.4/3
26111 {AI05-0111-3AI05-0111-3} If the allocator includes a
26112 subpool_handle_name, Constraint_Error is raised if the subpool handle is
26113 null. Program_Error is raised if the subpool does not belong (see *note
26114 13.11.4::) to the storage pool of the access type of the allocator.
26115
26116 10.g/3
26117 Implementation Note: This can be implemented by comparing the
26118 result of Pool_of_Subpool to a reference to the storage pool
26119 object. Pool_of_Subpool's parameter is not null, so the check
26120 for null falls out naturally.
26121
26122 10.h/3
26123 Reason: This detects cases where the subpool belongs to
26124 another pool, or to no pool at all. This includes detecting
26125 dangling subpool handles so long as the subpool object (the
26126 object designated by the handle) still exists. (If the
26127 subpool object has been deallocated, execution is erroneous;
26128 it is likely that this check will still detect the problem,
26129 but there cannot be a guarantee.)
26130
26131 11
26132 [If the created object contains any tasks, they are activated (see *note
26133 9.2::).] Finally, an access value that designates the created object is
26134 returned.
26135
26136 _Bounded (Run-Time) Errors_
26137
26138 11.1/2
26139 {AI95-00280-01AI95-00280-01} It is a bounded error if the finalization
26140 of the collection of the type (see *note 7.6.1::) of the allocator has
26141 started. If the error is detected, Program_Error is raised. Otherwise,
26142 the allocation proceeds normally.
26143
26144 11.a/2
26145 Discussion: This check is required in some cases; see above.
26146
26147 NOTES
26148
26149 12
26150 23 Allocators cannot create objects of an abstract type. See
26151 *note 3.9.3::.
26152
26153 13
26154 24 If any part of the created object is controlled, the
26155 initialization includes calls on corresponding Initialize or Adjust
26156 procedures. See *note 7.6::.
26157
26158 14
26159 25 As explained in *note 13.11::, "*note 13.11:: Storage
26160 Management", the storage for an object allocated by an allocator
26161 comes from a storage pool (possibly user defined). The exception
26162 Storage_Error is raised by an allocator if there is not enough
26163 storage. Instances of Unchecked_Deallocation may be used to
26164 explicitly reclaim storage.
26165
26166 15/3
26167 26 {AI05-0229-1AI05-0229-1} Implementations are permitted, but not
26168 required, to provide garbage collection.
26169
26170 15.a
26171 Ramification: Note that in an allocator, the exception
26172 Constraint_Error can be raised by the evaluation of the
26173 qualified_expression, by the elaboration of the
26174 subtype_indication, or by the initialization.
26175
26176 15.b
26177 Discussion: By default, the implementation provides the
26178 storage pool. The user may exercise more control over storage
26179 management by associating a user-defined pool with an access
26180 type.
26181
26182 _Examples_
26183
26184 16
26185 Examples of allocators:
26186
26187 17
26188 new Cell'(0, null, null) -- initialized explicitly, see *note 3.10.1::
26189 new Cell'(Value => 0, Succ => null, Pred => null) -- initialized explicitly
26190 new Cell -- not initialized
26191
26192 18
26193 new Matrix(1 .. 10, 1 .. 20) -- the bounds only are given
26194 new Matrix'(1 .. 10 => (1 .. 20 => 0.0)) -- initialized explicitly
26195
26196 19
26197 new Buffer(100) -- the discriminant only is given
26198 new Buffer'(Size => 80, Pos => 0, Value => (1 .. 80 => 'A')) -- initialized explicitly
26199
26200 20
26201 Expr_Ptr'(new Literal) -- allocator for access-to-class-wide type, see *note 3.9.1::
26202 Expr_Ptr'(new Literal'(Expression with 3.5)) -- initialized explicitly
26203
26204 _Incompatibilities With Ada 83_
26205
26206 20.a/1
26207 The subtype_indication of an uninitialized allocator may not
26208 have an explicit constraint if the designated type is an
26209 access type. In Ada 83, this was permitted even though the
26210 constraint had no effect on the subtype of the created object.
26211
26212 _Extensions to Ada 83_
26213
26214 20.b
26215 Allocators creating objects of type T are now overloaded on
26216 access types designating T'Class and all class-wide types that
26217 cover T.
26218
26219 20.c
26220 Implicit array subtype conversion (sliding) is now performed
26221 as part of an initialized allocator.
26222
26223 _Wording Changes from Ada 83_
26224
26225 20.d
26226 We have used a new organization, inspired by the ACID
26227 document, that makes it clearer what is the subtype of the
26228 created object, and what subtype conversions take place.
26229
26230 20.e
26231 Discussion of storage management issues, such as garbage
26232 collection and the raising of Storage_Error, has been moved to
26233 *note 13.11::, "*note 13.11:: Storage Management".
26234
26235 _Inconsistencies With Ada 95_
26236
26237 20.f/2
26238 {AI95-00363-01AI95-00363-01} If the designated type has a
26239 constrained partial view, the allocated object can be
26240 unconstrained. This might cause the object to take up a
26241 different amount of memory, and might cause the operations to
26242 work where they previously would have raised Constraint_Error.
26243 It's unlikely that the latter would actually matter in a real
26244 program (Constraint_Error usually indicates a bug that would
26245 be fixed, not left in a program.) The former might cause
26246 Storage_Error to be raised at a different time than in an Ada
26247 95 program.
26248
26249 _Incompatibilities With Ada 95_
26250
26251 20.g/2
26252 {AI95-00366-01AI95-00366-01} An allocator for an access type
26253 that has Storage_Size specified to be zero is now illegal.
26254 Ada 95 allowed the allocator, but it had to raise
26255 Storage_Error if executed. The primary impact of this change
26256 should be to detect bugs.
26257
26258 _Extensions to Ada 95_
26259
26260 20.h/2
26261 {8652/00108652/0010} {AI95-00127-01AI95-00127-01} Corrigendum:
26262 An allocator can be a controlling parameter of a dispatching
26263 call. This was an oversight in Ada 95.
26264
26265 20.i/2
26266 {AI95-00287-01AI95-00287-01} Initialized allocators are
26267 allowed when the designated type is limited.
26268
26269 _Wording Changes from Ada 95_
26270
26271 20.j/2
26272 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
26273 Clarified the elaboration of per-object constraints for an
26274 uninitialized allocator.
26275
26276 20.k/2
26277 {AI95-00280-01AI95-00280-01} Program_Error is now raised if
26278 the allocator occurs after the finalization of the collection
26279 or the waiting for tasks. This is not listed as an
26280 incompatibility as the Ada 95 behavior was unspecified, and
26281 Ada 95 implementations tend to generate programs that crash in
26282 this case.
26283
26284 20.l/2
26285 {AI95-00344-01AI95-00344-01} Added accessibility checks to
26286 class-wide allocators. These checks could not fail in Ada 95
26287 (as all of the designated types had to be declared at the same
26288 level, so the access type would necessarily have been at the
26289 same level or more nested than the type of allocated object).
26290
26291 20.m/2
26292 {AI95-00373-01AI95-00373-01} Revised the description of
26293 evaluation of uninitialized allocators to use "initialized by
26294 default" so that the ordering requirements are the same for
26295 all kinds of objects that are default-initialized.
26296
26297 20.n/2
26298 {AI95-00416-01AI95-00416-01} Added accessibility checks to
26299 access discriminants of allocators. These checks could not
26300 fail in Ada 95 as the discriminants always have the
26301 accessibility of the object.
26302
26303 _Incompatibilities With Ada 2005_
26304
26305 20.o/3
26306 {AI05-0052-1AI05-0052-1} Correction: Added a rule to prevent
26307 limited coextensions of nonlimited types. Allowing this would
26308 have far-reaching implementation costs. Because of those
26309 costs, it seems unlikely that any implementation ever
26310 supported it properly and thus it is unlikely that any
26311 existing code depends on this capability.
26312
26313 20.p/3
26314 {AI05-0104-1AI05-0104-1} Correction: Added a rule to make
26315 null_exclusions illegal for uninitialized allocators, as such
26316 an allocator would always raise Constraint_Error. Programs
26317 that depend on the unconditional raising of a predefined
26318 exception should be very rare.
26319
26320 _Extensions to Ada 2005_
26321
26322 20.q/3
26323 {AI05-0111-3AI05-0111-3} Subpool handles (see *note 13.11.4::)
26324 can be specified in an allocator.
26325
26326 _Wording Changes from Ada 2005_
26327
26328 20.r/3
26329 {AI05-0024-1AI05-0024-1} Correction: Corrected the master
26330 check for tags since the masters may be for different tasks
26331 and thus incomparable.
26332
26333 20.s/3
26334 {AI05-0041-1AI05-0041-1} Correction: Corrected the rules for
26335 when a designated object is constrained by its initial value
26336 so that types derived from a partial view are handled
26337 properly.
26338
26339 20.t/3
26340 {AI05-0051-1AI05-0051-1} {AI05-0234-1AI05-0234-1} Correction:
26341 Corrected the accessibility check for access discriminants so
26342 that it does not depend on the designated type (which might
26343 not have discriminants when the allocated type does).
26344
26345 \1f
26346 File: aarm2012.info, Node: 4.9, Prev: 4.8, Up: 4
26347
26348 4.9 Static Expressions and Static Subtypes
26349 ==========================================
26350
26351 1
26352 Certain expressions of a scalar or string type are defined to be static.
26353 Similarly, certain discrete ranges are defined to be static, and certain
26354 scalar and string subtypes are defined to be static subtypes. [ Static
26355 means determinable at compile time, using the declared properties or
26356 values of the program entities.]
26357
26358 1.a
26359 Discussion: As opposed to more elaborate data flow analysis,
26360 etc.
26361
26362 _Language Design Principles_
26363
26364 1.b
26365 For an expression to be static, it has to be calculable at
26366 compile time.
26367
26368 1.c
26369 Only scalar and string expressions are static.
26370
26371 1.d
26372 To be static, an expression cannot have any nonscalar,
26373 nonstring subexpressions (though it can have nonscalar
26374 constituent names). A static scalar expression cannot have
26375 any nonscalar subexpressions. There is one exception -- a
26376 membership test for a string subtype can be static, and the
26377 result is scalar, even though a subexpression is nonscalar.
26378
26379 1.e
26380 The rules for evaluating static expressions are designed to
26381 maximize portability of static calculations.
26382
26383 2
26384 A static expression is [a scalar or string expression that is] one of
26385 the following:
26386
26387 3
26388 * a numeric_literal;
26389
26390 3.a
26391 Ramification: A numeric_literal is always a static expression,
26392 even if its expected type is not that of a static subtype.
26393 However, if its value is explicitly converted to, or qualified
26394 by, a nonstatic subtype, the resulting expression is
26395 nonstatic.
26396
26397 4
26398 * a string_literal of a static string subtype;
26399
26400 4.a
26401 Ramification: That is, the constrained subtype defined by the
26402 index range of the string is static. Note that elementary
26403 values don't generally have subtypes, while composite values
26404 do (since the bounds or discriminants are inherent in the
26405 value).
26406
26407 5
26408 * a name that denotes the declaration of a named number or a static
26409 constant;
26410
26411 5.a
26412 Ramification: Note that enumeration literals are covered by
26413 the function_call case.
26414
26415 6
26416 * a function_call whose function_name or function_prefix statically
26417 denotes a static function, and whose actual parameters, if any
26418 (whether given explicitly or by default), are all static
26419 expressions;
26420
26421 6.a
26422 Ramification: This includes uses of operators that are
26423 equivalent to function_calls.
26424
26425 7
26426 * an attribute_reference that denotes a scalar value, and whose
26427 prefix denotes a static scalar subtype;
26428
26429 7.a
26430 Ramification: Note that this does not include the case of an
26431 attribute that is a function; a reference to such an attribute
26432 is not even an expression. See above for function calls.
26433
26434 7.b
26435 An implementation may define the staticness and other
26436 properties of implementation-defined attributes.
26437
26438 8
26439 * an attribute_reference whose prefix statically denotes a statically
26440 constrained array object or array subtype, and whose
26441 attribute_designator is First, Last, or Length, with an optional
26442 dimension;
26443
26444 9
26445 * a type_conversion whose subtype_mark denotes a static scalar
26446 subtype, and whose operand is a static expression;
26447
26448 10
26449 * a qualified_expression whose subtype_mark denotes a static [(scalar
26450 or string)] subtype, and whose operand is a static expression;
26451
26452 10.a
26453 Ramification: This rules out the subtype_mark'aggregate case.
26454
26455 10.b
26456 Reason: Adding qualification to an expression shouldn't make
26457 it nonstatic, even for strings.
26458
26459 11/3
26460 * {AI05-0158-1AI05-0158-1} {AI05-0269-1AI05-0269-1} a membership test
26461 whose simple_expression is a static expression, and whose
26462 membership_choice_list consists only of membership_choices that are
26463 either static choice_expressions, static ranges, or subtype_marks
26464 that denote a static [(scalar or string)] subtype;
26465
26466 11.a
26467 Reason: Clearly, we should allow membership tests in exactly
26468 the same cases where we allow qualified_expressions.
26469
26470 12
26471 * a short-circuit control form both of whose relations are static
26472 expressions;
26473
26474 12.1/3
26475 * {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} a
26476 conditional_expression all of whose conditions,
26477 selecting_expressions, and dependent_expressions are static
26478 expressions;
26479
26480 13
26481 * a static expression enclosed in parentheses.
26482
26483 13.a
26484 Discussion: Informally, we talk about a static value. When we
26485 do, we mean a value specified by a static expression.
26486
26487 13.b
26488 Ramification: The language requires a static expression in a
26489 number_declaration, a numeric type definition, a
26490 discrete_choice (sometimes), certain representation items, an
26491 attribute_designator, and when specifying the value of a
26492 discriminant governing a variant_part in a record_aggregate or
26493 extension_aggregate.
26494
26495 14
26496 A name statically denotes an entity if it denotes the entity and:
26497
26498 15
26499 * It is a direct_name, expanded name, or character_literal, and it
26500 denotes a declaration other than a renaming_declaration; or
26501
26502 16
26503 * It is an attribute_reference whose prefix statically denotes some
26504 entity; or
26505
26506 17
26507 * It denotes a renaming_declaration with a name that statically
26508 denotes the renamed entity.
26509
26510 17.a
26511 Ramification: Selected_components that are not expanded names
26512 and indexed_components do not statically denote things.
26513
26514 18
26515 A static function is one of the following:
26516
26517 18.a
26518 Ramification: These are the functions whose calls can be
26519 static expressions.
26520
26521 19
26522 * a predefined operator whose parameter and result types are all
26523 scalar types none of which are descendants of formal scalar types;
26524
26525 20
26526 * a predefined concatenation operator whose result type is a string
26527 type;
26528
26529 21
26530 * an enumeration literal;
26531
26532 22
26533 * a language-defined attribute that is a function, if the prefix
26534 denotes a static scalar subtype, and if the parameter and result
26535 types are scalar.
26536
26537 23
26538 In any case, a generic formal subprogram is not a static function.
26539
26540 24
26541 A static constant is a constant view declared by a full constant
26542 declaration or an object_renaming_declaration (*note 8.5.1: S0200.) with
26543 a static nominal subtype, having a value defined by a static scalar
26544 expression or by a static string expression whose value has a length not
26545 exceeding the maximum length of a string_literal (*note 2.6: S0016.) in
26546 the implementation.
26547
26548 24.a
26549 Ramification: A deferred constant is not static; the view
26550 introduced by the corresponding full constant declaration can
26551 be static.
26552
26553 24.b/3
26554 Reason: {AI05-0229-1AI05-0229-1} The reason for restricting
26555 the length of static string constants is so that compilers
26556 don't have to store giant strings in their symbol tables.
26557 Since most string constants will be initialized from
26558 string_literals, the length limit seems pretty natural. The
26559 reason for avoiding nonstring types is also to save symbol
26560 table space. We're trying to keep it cheap and simple (from
26561 the implementer's viewpoint), while still allowing, for
26562 example, the aspect_definition for a Link_Name aspect to
26563 contain a concatenation.
26564
26565 24.c
26566 The length we're talking about is the maximum number of
26567 characters in the value represented by a string_literal, not
26568 the number of characters in the source representation; the
26569 quotes don't count.
26570
26571 25
26572 A static range is a range whose bounds are static expressions, [or a
26573 range_attribute_reference (*note 4.1.4: S0102.) that is equivalent to
26574 such a range.] A static discrete_range (*note 3.6.1: S0058.) is one
26575 that is a static range or is a subtype_indication (*note 3.2.2: S0027.)
26576 that defines a static scalar subtype. The base range of a scalar type
26577 is a static range, unless the type is a descendant of a formal scalar
26578 type.
26579
26580 26/3
26581 {AI95-00263-01AI95-00263-01} {AI05-0153-3AI05-0153-3} A static subtype
26582 is either a static scalar subtype or a static string subtype. A static
26583 scalar subtype is an unconstrained scalar subtype whose type is not a
26584 descendant of a formal type, or a constrained scalar subtype formed by
26585 imposing a compatible static constraint on a static scalar subtype. A
26586 static string subtype is an unconstrained string subtype whose index
26587 subtype and component subtype are static, or a constrained string
26588 subtype formed by imposing a compatible static constraint on a static
26589 string subtype. In any case, the subtype of a generic formal object of
26590 mode in out, and the result subtype of a generic formal function, are
26591 not static. Also, a subtype is not static if any Dynamic_Predicate
26592 specifications apply to it.
26593
26594 26.a
26595 Ramification: String subtypes are the only composite subtypes
26596 that can be static.
26597
26598 26.b
26599 Reason: The part about generic formal objects of mode in out
26600 is necessary because the subtype of the formal is not required
26601 to have anything to do with the subtype of the actual. For
26602 example:
26603
26604 26.c
26605 subtype Int10 is Integer range 1..10;
26606
26607 26.d
26608 generic
26609 F : in out Int10;
26610 procedure G;
26611
26612 26.e
26613 procedure G is
26614 begin
26615 case F is
26616 when 1..10 => null;
26617 -- Illegal!
26618 end case;
26619 end G;
26620
26621 26.f
26622 X : Integer range 1..20;
26623 procedure I is new G(F => X); -- OK.
26624
26625 26.g
26626 The case_statement is illegal, because the subtype of F is not
26627 static, so the choices have to cover all values of Integer,
26628 not just those in the range 1..10. A similar issue arises for
26629 generic formal functions, now that function calls are object
26630 names.
26631
26632 27
26633 The different kinds of static constraint are defined as follows:
26634
26635 28
26636 * A null constraint is always static;
26637
26638 29
26639 * A scalar constraint is static if it has no range_constraint, or one
26640 with a static range;
26641
26642 30
26643 * An index constraint is static if each discrete_range is static, and
26644 each index subtype of the corresponding array type is static;
26645
26646 31
26647 * A discriminant constraint is static if each expression of the
26648 constraint is static, and the subtype of each discriminant is
26649 static.
26650
26651 31.1/2
26652 {AI95-00311-01AI95-00311-01} In any case, the constraint of the first
26653 subtype of a scalar formal type is neither static nor null.
26654
26655 32
26656 A subtype is statically constrained if it is constrained, and its
26657 constraint is static. An object is statically constrained if its
26658 nominal subtype is statically constrained, or if it is a static string
26659 constant.
26660
26661 _Legality Rules_
26662
26663 32.1/3
26664 {AI05-0147-1AI05-0147-1} An expression is statically unevaluated if it
26665 is part of:
26666
26667 32.2/3
26668 * {AI05-0147-1AI05-0147-1} the right operand of a static
26669 short-circuit control form whose value is determined by its left
26670 operand; or
26671
26672 32.3/3
26673 * {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} a
26674 dependent_expression of an if_expression whose associated condition
26675 is static and equals False; or
26676
26677 32.4/3
26678 * {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} a condition or
26679 dependent_expression of an if_expression where the condition
26680 corresponding to at least one preceding dependent_expression of the
26681 if_expression is static and equals True; or
26682
26683 32.a/3
26684 Reason: We need this bullet so that only a single
26685 dependent_expression is evaluated in a static if_expression if
26686 there is more than one condition that evaluates to True. The
26687 part about conditions makes
26688
26689 32.b/3
26690 (if N = 0 then Min elsif 10_000/N > Min then 10_000/N else Min)
26691
26692 32.c/3
26693 legal if N and Min are static and N = 0.
26694
26695 32.d/3
26696 Discussion: {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1}
26697 We need the "of the if_expression" here so there is no
26698 confusion for nested if_expressions; this rule only applies to
26699 the conditions and dependent_expressions of a single
26700 if_expression. Similar reasoning applies to the "of a
26701 case_expression" of the last bullet.
26702
26703 32.5/3
26704 * {AI05-0188-1AI05-0188-1} {AI05-0269-1AI05-0269-1} a
26705 dependent_expression of a case_expression whose
26706 selecting_expression is static and whose value is not covered by
26707 the corresponding discrete_choice_list; or
26708
26709 32.6/3
26710 * {AI05-0158-1AI05-0158-1} a choice_expression (or a
26711 simple_expression of a range that occurs as a membership_choice of
26712 a membership_choice_list) of a static membership test that is
26713 preceded in the enclosing membership_choice_list by another item
26714 whose individual membership test (see *note 4.5.2::) statically
26715 yields True.
26716
26717 33/3
26718 {AI05-0147-1AI05-0147-1} A static expression is evaluated at compile
26719 time except when it is statically unevaluated. The compile-time
26720 evaluation of a static expression is performed exactly, without
26721 performing Overflow_Checks. For a static expression that is evaluated:
26722
26723 34/3
26724 * {AI05-0262-1AI05-0262-1} The expression is illegal if its
26725 evaluation fails a language-defined check other than
26726 Overflow_Check. For the purposes of this evaluation, the assertion
26727 policy is assumed to be Check.
26728
26729 34.a/3
26730 Reason: {AI05-0262-1AI05-0262-1} Assertion policies can
26731 control whether checks are made, but we don't want assertion
26732 policies to affect legality. For Ada 2012, subtype predicates
26733 are the only checks controlled by the assertion policy that
26734 can appear in static expressions.
26735
26736 35/2
26737 * {AI95-00269-01AI95-00269-01} If the expression is not part of a
26738 larger static expression and the expression is expected to be of a
26739 single specific type, then its value shall be within the base range
26740 of its expected type. Otherwise, the value may be arbitrarily
26741 large or small.
26742
26743 35.a/2
26744 Ramification: {AI95-00269-01AI95-00269-01} If the expression
26745 is expected to be of a universal type, or of "any integer
26746 type", there are no limits on the value of the expression.
26747
26748 36/2
26749 * {AI95-00269-01AI95-00269-01} If the expression is of type
26750 universal_real and its expected type is a decimal fixed point type,
26751 then its value shall be a multiple of the small of the decimal
26752 type. This restriction does not apply if the expected type is a
26753 descendant of a formal scalar type (or a corresponding actual type
26754 in an instance).
26755
26756 36.a
26757 Ramification: This means that a numeric_literal for a decimal
26758 type cannot have "extra" significant digits.
26759
26760 36.b/2
26761 Reason: {AI95-00269-01AI95-00269-01} The small is not known
26762 for a generic formal type, so we have to exclude formal types
26763 from this check.
26764
26765 37/2
26766 {AI95-00269-01AI95-00269-01} In addition to the places where Legality
26767 Rules normally apply (see *note 12.3::), the above restrictions also
26768 apply in the private part of an instance of a generic unit.
26769
26770 37.a
26771 Discussion: Values outside the base range are not permitted
26772 when crossing from the "static" domain to the "dynamic"
26773 domain. This rule is designed to enhance portability of
26774 programs containing static expressions. Note that this rule
26775 applies to the exact value, not the value after any rounding
26776 or truncation. (See below for the rounding and truncation
26777 requirements.)
26778
26779 37.b
26780 Short-circuit control forms are a special case:
26781
26782 37.c
26783 N: constant := 0.0;
26784 X: constant Boolean := (N = 0.0) or else (1.0/N > 0.5); -- Static.
26785
26786 37.d
26787 The declaration of X is legal, since the divide-by-zero part
26788 of the expression is not evaluated. X is a static constant
26789 equal to True.
26790
26791 _Implementation Requirements_
26792
26793 38/2
26794 {AI95-00268-01AI95-00268-01} {AI95-00269-01AI95-00269-01} For a real
26795 static expression that is not part of a larger static expression, and
26796 whose expected type is not a descendant of a formal type, the
26797 implementation shall round or truncate the value (according to the
26798 Machine_Rounds attribute of the expected type) to the nearest machine
26799 number of the expected type; if the value is exactly half-way between
26800 two machine numbers, the rounding performed is implementation-defined.
26801 If the expected type is a descendant of a formal type, or if the static
26802 expression appears in the body of an instance of a generic unit and the
26803 corresponding expression is nonstatic in the corresponding generic body,
26804 then no special rounding or truncating is required -- normal accuracy
26805 rules apply (see *note Annex G::).
26806
26807 38.a.1/2
26808 Implementation defined: Rounding of real static expressions
26809 which are exactly half-way between two machine numbers.
26810
26811 38.a/2
26812 Reason: {AI95-00268-01AI95-00268-01} Discarding extended
26813 precision enhances portability by ensuring that the value of a
26814 static constant of a real type is always a machine number of
26815 the type.
26816
26817 38.b
26818 When the expected type is a descendant of a formal floating
26819 point type, extended precision (beyond that of the machine
26820 numbers) can be retained when evaluating a static expression,
26821 to ease code sharing for generic instantiations. For similar
26822 reasons, normal (nondeterministic) rounding or truncating
26823 rules apply for descendants of a formal fixed point type.
26824
26825 38.b.1/2
26826 {AI95-00269-01AI95-00269-01} There is no requirement for exact
26827 evaluation or special rounding in an instance body (unless the
26828 expression is static in the generic body). This eliminates a
26829 potential contract issue where the exact value of a static
26830 expression depends on the actual parameters (which could then
26831 affect the legality of other code).
26832
26833 38.c
26834 Implementation Note: Note that the implementation of static
26835 expressions has to keep track of plus and minus zero for a
26836 type whose Signed_Zeros attribute is True.
26837
26838 38.d/2
26839 {AI95-00100-01AI95-00100-01} Note that the only machine
26840 numbers of a fixed point type are the multiples of the small,
26841 so a static conversion to a fixed-point type, or division by
26842 an integer, must do truncation to a multiple of small. It is
26843 not correct for the implementation to do all static
26844 calculations in infinite precision.
26845
26846 _Implementation Advice_
26847
26848 38.1/2
26849 {AI95-00268-01AI95-00268-01} For a real static expression that is not
26850 part of a larger static expression, and whose expected type is not a
26851 descendant of a formal type, the rounding should be the same as the
26852 default rounding for the target system.
26853
26854 38.e/2
26855 Implementation Advice: A real static expression with a
26856 nonformal type that is not part of a larger static expression
26857 should be rounded the same as the target system.
26858
26859 NOTES
26860
26861 39
26862 27 An expression can be static even if it occurs in a context
26863 where staticness is not required.
26864
26865 39.a
26866 Ramification: For example:
26867
26868 39.b
26869 X : Float := Float'(1.0E+400) + 1.0 - Float'(1.0E+400);
26870
26871 39.c
26872 The expression is static, which means that the value of X must
26873 be exactly 1.0, independent of the accuracy or range of the
26874 run-time floating point implementation.
26875
26876 39.d
26877 The following kinds of expressions are never static:
26878 explicit_dereference, indexed_component, slice, null,
26879 aggregate, allocator.
26880
26881 40
26882 28 A static (or run-time) type_conversion from a real type to an
26883 integer type performs rounding. If the operand value is exactly
26884 half-way between two integers, the rounding is performed away from
26885 zero.
26886
26887 40.a
26888 Reason: We specify this for portability. The reason for not
26889 choosing round-to-nearest-even, for example, is that this
26890 method is easier to undo.
26891
26892 40.b
26893 Ramification: The attribute Truncation (see *note A.5.3::) can
26894 be used to perform a (static) truncation prior to conversion,
26895 to prevent rounding.
26896
26897 40.c
26898 Implementation Note: The value of the literal
26899 0E999999999999999999999999999999999999999999999 is zero. The
26900 implementation must take care to evaluate such literals
26901 properly.
26902
26903 _Examples_
26904
26905 41
26906 Examples of static expressions:
26907
26908 42
26909 1 + 1 -- 2
26910 abs(-10)*3 -- 30
26911
26912 43
26913 Kilo : constant := 1000;
26914 Mega : constant := Kilo*Kilo; -- 1_000_000
26915 Long : constant := Float'Digits*2;
26916
26917 44
26918 Half_Pi : constant := Pi/2; -- see *note 3.3.2::
26919 Deg_To_Rad : constant := Half_Pi/90;
26920 Rad_To_Deg : constant := 1.0/Deg_To_Rad; -- equivalent to 1.0/((3.14159_26536/2)/90)
26921
26922 _Extensions to Ada 83_
26923
26924 44.a
26925 The rules for static expressions and static subtypes are
26926 generalized to allow more kinds of compile-time-known
26927 expressions to be used where compile-time-known values are
26928 required, as follows:
26929
26930 44.b
26931 * Membership tests and short-circuit control forms may
26932 appear in a static expression.
26933
26934 44.c
26935 * The bounds and length of statically constrained array
26936 objects or subtypes are static.
26937
26938 44.d
26939 * The Range attribute of a statically constrained array
26940 subtype or object gives a static range.
26941
26942 44.e
26943 * A type_conversion is static if the subtype_mark denotes a
26944 static scalar subtype and the operand is a static
26945 expression.
26946
26947 44.f
26948 * All numeric literals are now static, even if the expected
26949 type is a formal scalar type. This is useful in
26950 case_statements and variant_parts, which both now allow a
26951 value of a formal scalar type to control the selection,
26952 to ease conversion of a package into a generic package.
26953 Similarly, named array aggregates are also permitted for
26954 array types with an index type that is a formal scalar
26955 type.
26956
26957 44.g
26958 The rules for the evaluation of static expressions are revised
26959 to require exact evaluation at compile time, and force a
26960 machine number result when crossing from the static realm to
26961 the dynamic realm, to enhance portability and predictability.
26962 Exact evaluation is not required for descendants of a formal
26963 scalar type, to simplify generic code sharing and to avoid
26964 generic contract model problems.
26965
26966 44.h
26967 Static expressions are legal even if an intermediate in the
26968 expression goes outside the base range of the type.
26969 Therefore, the following will succeed in Ada 95, whereas it
26970 might raise an exception in Ada 83:
26971
26972 44.i
26973 type Short_Int is range -32_768 .. 32_767;
26974 I : Short_Int := -32_768;
26975
26976 44.j
26977 This might raise an exception in Ada 83 because "32_768" is
26978 out of range, even though "-32_768" is not. In Ada 95, this
26979 will always succeed.
26980
26981 44.k
26982 Certain expressions involving string operations (in particular
26983 concatenation and membership tests) are considered static in
26984 Ada 95.
26985
26986 44.l
26987 The reason for this change is to simplify the rule requiring
26988 compile-time-known string expressions as the link name in an
26989 interfacing pragma, and to simplify the preelaborability
26990 rules.
26991
26992 _Incompatibilities With Ada 83_
26993
26994 44.m
26995 An Ada 83 program that uses an out-of-range static value is
26996 illegal in Ada 95, unless the expression is part of a larger
26997 static expression, or the expression is not evaluated due to
26998 being on the right-hand side of a short-circuit control form.
26999
27000 _Wording Changes from Ada 83_
27001
27002 44.n/3
27003 {AI05-0299-1AI05-0299-1} This subclause (and *note 4.5.5::,
27004 "*note 4.5.5:: Multiplying Operators") subsumes the RM83
27005 section on Universal Expressions.
27006
27007 44.o
27008 The existence of static string expressions necessitated
27009 changing the definition of static subtype to include string
27010 subtypes. Most occurrences of "static subtype" have been
27011 changed to "static scalar subtype", in order to preserve the
27012 effect of the Ada 83 rules. This has the added benefit of
27013 clarifying the difference between "static subtype" and
27014 "statically constrained subtype", which has been a source of
27015 confusion. In cases where we allow static string subtypes, we
27016 explicitly use phrases like "static string subtype" or "static
27017 (scalar or string) subtype", in order to clarify the meaning
27018 for those who have gotten used to the Ada 83 terminology.
27019
27020 44.p
27021 In Ada 83, an expression was considered nonstatic if it raised
27022 an exception. Thus, for example:
27023
27024 44.q
27025 Bad: constant := 1/0; -- Illegal!
27026
27027 44.r
27028 was illegal because 1/0 was not static. In Ada 95, the above
27029 example is still illegal, but for a different reason: 1/0 is
27030 static, but there's a separate rule forbidding the exception
27031 raising.
27032
27033 _Inconsistencies With Ada 95_
27034
27035 44.s/2
27036 {AI95-00268-01AI95-00268-01} Amendment Correction: Rounding of
27037 static real expressions is implementation-defined in Ada 2005,
27038 while it was specified as away from zero in (original) Ada 95.
27039 This could make subtle differences in programs. However, the
27040 original Ada 95 rule required rounding that (probably)
27041 differed from the target processor, thus creating anomalies
27042 where the value of a static expression was required to be
27043 different than the same expression evaluated at run-time.
27044
27045 _Wording Changes from Ada 95_
27046
27047 44.t/2
27048 {AI95-00263-01AI95-00263-01} {AI95-00268-01AI95-00268-01} The
27049 Ada 95 wording that defined static subtypes unintentionally
27050 failed to exclude formal derived types that happen to be
27051 scalar (these aren't formal scalar types); and had a
27052 parenthetical remark excluding formal string types - but that
27053 was neither necessary nor parenthetical (it didn't follow from
27054 other wording). This issue also applies to the rounding rules
27055 for real static expressions.
27056
27057 44.u/2
27058 {AI95-00269-01AI95-00269-01} Ada 95 didn't clearly define the
27059 bounds of a value of a static expression for universal types
27060 and for "any integer/float/fixed type". We also make it clear
27061 that we do not intend exact evaluation of static expressions
27062 in an instance body if the expressions aren't static in the
27063 generic body.
27064
27065 44.v/2
27066 {AI95-00311-01AI95-00311-01} We clarify that the first subtype
27067 of a scalar formal type has a nonstatic, nonnull constraint.
27068
27069 _Wording Changes from Ada 2005_
27070
27071 44.w/3
27072 {AI05-0147-1AI05-0147-1} {AI05-0188-1AI05-0188-1} Added
27073 wording to define staticness and the lack of evaluation for
27074 if_expressions and case_expressions. These are new and
27075 defined elsewhere.
27076
27077 44.x/3
27078 {AI05-0153-3AI05-0153-3} Added wording to prevent subtypes
27079 that have dynamic predicates (see *note 3.2.4::) from being
27080 static.
27081
27082 44.y/3
27083 {AI05-0158-1AI05-0158-1} Revised wording for membership tests
27084 to allow for the new possibilities allowed by the
27085 membership_choice_list.
27086
27087 * Menu:
27088
27089 * 4.9.1 :: Statically Matching Constraints and Subtypes
27090
27091 \1f
27092 File: aarm2012.info, Node: 4.9.1, Up: 4.9
27093
27094 4.9.1 Statically Matching Constraints and Subtypes
27095 --------------------------------------------------
27096
27097 _Static Semantics_
27098
27099 1/2
27100 {AI95-00311-01AI95-00311-01} A constraint statically matches another
27101 constraint if:
27102
27103 1.1/2
27104 * both are null constraints;
27105
27106 1.2/2
27107 * both are static and have equal corresponding bounds or discriminant
27108 values;
27109
27110 1.3/2
27111 * both are nonstatic and result from the same elaboration of a
27112 constraint of a subtype_indication (*note 3.2.2: S0027.) or the
27113 same evaluation of a range of a discrete_subtype_definition (*note
27114 3.6: S0055.); or
27115
27116 1.4/2
27117 * {AI95-00311-01AI95-00311-01} both are nonstatic and come from the
27118 same formal_type_declaration.
27119
27120 2/3
27121 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01}
27122 {AI05-0153-3AI05-0153-3} A subtype statically matches another subtype of
27123 the same type if they have statically matching constraints, all
27124 predicate specifications that apply to them come from the same
27125 declarations, and, for access subtypes, either both or neither exclude
27126 null. Two anonymous access-to-object subtypes statically match if their
27127 designated subtypes statically match, and either both or neither exclude
27128 null, and either both or neither are access-to-constant. Two anonymous
27129 access-to-subprogram subtypes statically match if their designated
27130 profiles are subtype conformant, and either both or neither exclude
27131 null.
27132
27133 2.a
27134 Ramification: Statically matching constraints and subtypes are
27135 the basis for subtype conformance of profiles (see *note
27136 6.3.1::).
27137
27138 2.b/2
27139 Reason: Even though anonymous access types always represent
27140 different types, they can statically match. That's important
27141 so that they can be used widely. For instance, if this wasn't
27142 true, access parameters and access discriminants could never
27143 conform, so they couldn't be used in separate specifications.
27144
27145 3
27146 Two ranges of the same type statically match if both result from the
27147 same evaluation of a range, or if both are static and have equal
27148 corresponding bounds.
27149
27150 3.a
27151 Ramification: The notion of static matching of ranges is used
27152 in *note 12.5.3::, "*note 12.5.3:: Formal Array Types"; the
27153 index ranges of formal and actual constrained array subtypes
27154 have to statically match.
27155
27156 4/3
27157 {AI05-0086-1AI05-0086-1} {AI05-0153-3AI05-0153-3} A constraint is
27158 statically compatible with a scalar subtype if it statically matches the
27159 constraint of the subtype, or if both are static and the constraint is
27160 compatible with the subtype. A constraint is statically compatible with
27161 an access or composite subtype if it statically matches the constraint
27162 of the subtype, or if the subtype is unconstrained.
27163
27164 4.a
27165 Discussion: Static compatibility is required when constraining
27166 a parent subtype with a discriminant from a new
27167 discriminant_part. See *note 3.7::. Static compatibility is
27168 also used in matching generic formal derived types.
27169
27170 4.b
27171 Note that statically compatible with a subtype does not imply
27172 compatible with a type. It is OK since the terms are used in
27173 different contexts.
27174
27175 5/3
27176 {AI05-0153-3AI05-0153-3} Two statically matching subtypes are statically
27177 compatible with each other. In addition, a subtype S1 is statically
27178 compatible with a subtype S2 if:
27179
27180 6/3
27181 * the constraint of S1 is statically compatible with S2, and
27182
27183 7/3
27184 * {AI05-0086-1AI05-0086-1} if S2 excludes null, so does S1, and
27185
27186 8/3
27187 * either:
27188
27189 9/3
27190 * all predicate specifications that apply to S2 apply also
27191 to S1, or
27192
27193 10/3
27194 * both subtypes are static, every value that satisfies the
27195 predicate of S1 also satisfies the predicate of S2, and
27196 it is not the case that both types each have at least one
27197 applicable predicate specification, predicate checks are
27198 enabled (see *note 11.4.2::) for S2, and predicate checks
27199 are not enabled for S1.
27200
27201 _Wording Changes from Ada 83_
27202
27203 10.a
27204 This subclause is new to Ada 95.
27205
27206 _Wording Changes from Ada 95_
27207
27208 10.b/2
27209 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01}
27210 Added static matching rules for null exclusions and anonymous
27211 access-to-subprogram types; both of these are new.
27212
27213 10.c/2
27214 {AI95-00311-01AI95-00311-01} We clarify that the constraint of
27215 the first subtype of a scalar formal type statically matches
27216 itself.
27217
27218 _Incompatibilities With Ada 2005_
27219
27220 10.d/3
27221 {AI05-0086-1AI05-0086-1} Correction: Updated the statically
27222 compatible rules to take null exclusions into account. This
27223 is technically incompatible, as it could cause a legal Ada
27224 2005 program to be rejected; however, such a program violates
27225 the intent of the rules (for instance, *note 3.7::(15)) and
27226 this probably will simply detect bugs.
27227
27228 _Wording Changes from Ada 2005_
27229
27230 10.e/3
27231 {AI05-0153-3AI05-0153-3} {AI05-0290-1AI05-0290-1} Modified
27232 static matching and static compatibility to take predicate
27233 aspects (see *note 3.2.4::) into account.
27234
27235 \1f
27236 File: aarm2012.info, Node: 5, Next: 6, Prev: 4, Up: Top
27237
27238 5 Statements
27239 ************
27240
27241 1
27242 [A statement defines an action to be performed upon its execution.]
27243
27244 2/3
27245 {AI95-00318-02AI95-00318-02} {AI05-0299-1AI05-0299-1} [This clause
27246 describes the general rules applicable to all statements. Some
27247 statements are discussed in later clauses: Procedure_call_statement
27248 (*note 6.4: S0178.)s and return statements are described in *note 6::,
27249 "*note 6:: Subprograms". Entry_call_statement (*note 9.5.3: S0225.)s,
27250 requeue_statement (*note 9.5.4: S0226.)s, delay_statement (*note 9.6:
27251 S0227.)s, accept_statement (*note 9.5.2: S0219.)s, select_statement
27252 (*note 9.7: S0230.)s, and abort_statement (*note 9.8: S0245.)s are
27253 described in *note 9::, "*note 9:: Tasks and Synchronization".
27254 Raise_statement (*note 11.3: S0269.)s are described in *note 11::,
27255 "*note 11:: Exceptions", and code_statement (*note 13.8: S0317.)s in
27256 *note 13::. The remaining forms of statements are presented in this
27257 clause.]
27258
27259 _Wording Changes from Ada 83_
27260
27261 2.a/2
27262 {AI95-00318-02AI95-00318-02} The description of return
27263 statements has been moved to *note 6.5::, "*note 6.5:: Return
27264 Statements", so that it is closer to the description of
27265 subprograms.
27266
27267 * Menu:
27268
27269 * 5.1 :: Simple and Compound Statements - Sequences of Statements
27270 * 5.2 :: Assignment Statements
27271 * 5.3 :: If Statements
27272 * 5.4 :: Case Statements
27273 * 5.5 :: Loop Statements
27274 * 5.6 :: Block Statements
27275 * 5.7 :: Exit Statements
27276 * 5.8 :: Goto Statements
27277
27278 \1f
27279 File: aarm2012.info, Node: 5.1, Next: 5.2, Up: 5
27280
27281 5.1 Simple and Compound Statements - Sequences of Statements
27282 ============================================================
27283
27284 1
27285 [A statement is either simple or compound. A simple_statement encloses
27286 no other statement. A compound_statement can enclose simple_statements
27287 and other compound_statements.]
27288
27289 _Syntax_
27290
27291 2/3
27292 {AI05-0179-1AI05-0179-1} sequence_of_statements ::= statement {
27293 statement} {label}
27294
27295 3
27296 statement ::=
27297 {label} simple_statement | {label} compound_statement
27298
27299 4/2
27300 {AI95-00318-02AI95-00318-02} simple_statement ::= null_statement
27301 | assignment_statement | exit_statement
27302 | goto_statement | procedure_call_statement
27303 | simple_return_statement | entry_call_statement
27304 | requeue_statement | delay_statement
27305 | abort_statement | raise_statement
27306 | code_statement
27307
27308 5/2
27309 {AI95-00318-02AI95-00318-02} compound_statement ::=
27310 if_statement | case_statement
27311 | loop_statement | block_statement
27312 | extended_return_statement
27313 | accept_statement | select_statement
27314
27315 6
27316 null_statement ::= null;
27317
27318 7
27319 label ::= <<label_statement_identifier>>
27320
27321 8
27322 statement_identifier ::= direct_name
27323
27324 9
27325 The direct_name of a statement_identifier shall be an identifier
27326 (not an operator_symbol).
27327
27328 _Name Resolution Rules_
27329
27330 10
27331 The direct_name of a statement_identifier shall resolve to denote its
27332 corresponding implicit declaration (see below).
27333
27334 _Legality Rules_
27335
27336 11
27337 Distinct identifiers shall be used for all statement_identifiers that
27338 appear in the same body, including inner block_statements but excluding
27339 inner program units.
27340
27341 _Static Semantics_
27342
27343 12
27344 For each statement_identifier, there is an implicit declaration (with
27345 the specified identifier) at the end of the declarative_part of the
27346 innermost block_statement or body that encloses the
27347 statement_identifier. The implicit declarations occur in the same order
27348 as the statement_identifiers occur in the source text. If a usage name
27349 denotes such an implicit declaration, the entity it denotes is the
27350 label, loop_statement, or block_statement with the given
27351 statement_identifier.
27352
27353 12.a
27354 Reason: We talk in terms of individual statement_identifiers
27355 here rather than in terms of the corresponding statements,
27356 since a given statement may have multiple
27357 statement_identifiers.
27358
27359 12.b
27360 A block_statement that has no explicit declarative_part has an
27361 implicit empty declarative_part, so this rule can safely refer
27362 to the declarative_part of a block_statement.
27363
27364 12.c
27365 The scope of a declaration starts at the place of the
27366 declaration itself (see *note 8.2::). In the case of a label,
27367 loop, or block name, it follows from this rule that the scope
27368 of the implicit declaration starts before the first explicit
27369 occurrence of the corresponding name, since this occurrence is
27370 either in a statement label, a loop_statement, a
27371 block_statement, or a goto_statement. An implicit declaration
27372 in a block_statement may hide a declaration given in an outer
27373 program unit or block_statement (according to the usual rules
27374 of hiding explained in *note 8.3::).
27375
27376 12.d
27377 The syntax rule for label uses statement_identifier which is a
27378 direct_name (not a defining_identifier), because labels are
27379 implicitly declared. The same applies to loop and block
27380 names. In other words, the label itself is not the defining
27381 occurrence; the implicit declaration is.
27382
27383 12.e
27384 We cannot consider the label to be a defining occurrence. An
27385 example that can tell the difference is this:
27386
27387 12.f
27388 declare
27389 -- Label Foo is implicitly declared here.
27390 begin
27391 for Foo in ... loop
27392 ...
27393 <<Foo>> -- Illegal.
27394 ...
27395 end loop;
27396 end;
27397
27398
27399 12.g/3
27400 {AI05-0299-1AI05-0299-1} The label in this example is hidden
27401 from itself by the loop parameter with the same name; the
27402 example is illegal. We considered creating a new syntactic
27403 category name, separate from direct_name and selector_name,
27404 for use in the case of statement labels. However, that would
27405 confuse the rules in Clause 8, so we didn't do it.
27406
27407 12.1/3
27408 {AI05-0179-1AI05-0179-1} If one or more labels end a
27409 sequence_of_statements, an implicit null_statement follows the labels
27410 before any following constructs.
27411
27412 12.g.1/3
27413 Reason: The semantics of a goto_statement is defined in terms
27414 of the statement having (following) that label. Thus we
27415 ensure that every label has a following statement, which might
27416 be implicit.
27417
27418 _Dynamic Semantics_
27419
27420 13
27421 The execution of a null_statement has no effect.
27422
27423 14/2
27424 {AI95-00318-02AI95-00318-02} A transfer of control is the run-time
27425 action of an exit_statement, return statement, goto_statement, or
27426 requeue_statement, selection of a terminate_alternative, raising of an
27427 exception, or an abort, which causes the next action performed to be one
27428 other than what would normally be expected from the other rules of the
27429 language. [As explained in *note 7.6.1::, a transfer of control can
27430 cause the execution of constructs to be completed and then left, which
27431 may trigger finalization.]
27432
27433 15
27434 The execution of a sequence_of_statements consists of the execution of
27435 the individual statements in succession until the sequence_ is
27436 completed.
27437
27438 15.a
27439 Ramification: It could be completed by reaching the end of it,
27440 or by a transfer of control.
27441
27442 NOTES
27443
27444 16
27445 1 A statement_identifier that appears immediately within the
27446 declarative region of a named loop_statement or an accept_statement
27447 is nevertheless implicitly declared immediately within the
27448 declarative region of the innermost enclosing body or
27449 block_statement; in other words, the expanded name for a named
27450 statement is not affected by whether the statement occurs inside or
27451 outside a named loop or an accept_statement -- only nesting within
27452 block_statements is relevant to the form of its expanded name.
27453
27454 16.a
27455 Discussion: Each comment in the following example gives the
27456 expanded name associated with an entity declared in the task
27457 body:
27458
27459 16.b
27460 task body Compute is
27461 Sum : Integer := 0; -- Compute.Sum
27462 begin
27463 Outer: -- Compute.Outer
27464 for I in 1..10 loop -- Compute.Outer.I
27465 Blk: -- Compute.Blk
27466 declare
27467 Sum : Integer := 0; -- Compute.Blk.Sum
27468 begin
27469 accept Ent(I : out Integer; J : in Integer) do
27470 -- Compute.Ent.I, Compute.Ent.J
27471 Compute.Ent.I := Compute.Outer.I;
27472 Inner: -- Compute.Blk.Inner
27473 for J in 1..10 loop
27474 -- Compute.Blk.Inner.J
27475 Sum := Sum + Compute.Blk.Inner.J * Compute.Ent.J;
27476 end loop Inner;
27477 end Ent;
27478 Compute.Sum := Compute.Sum + Compute.Blk.Sum;
27479 end Blk;
27480 end loop Outer;
27481 Record_Result(Sum);
27482 end Compute;
27483
27484 _Examples_
27485
27486 17
27487 Examples of labeled statements:
27488
27489 18
27490 <<Here>> <<Ici>> <<Aqui>> <<Hier>> null;
27491
27492 19
27493 <<After>> X := 1;
27494
27495 _Extensions to Ada 83_
27496
27497 19.a
27498 The requeue_statement is new.
27499
27500 _Wording Changes from Ada 83_
27501
27502 19.b
27503 We define the syntactic category statement_identifier to
27504 simplify the description. It is used for labels, loop names,
27505 and block names. We define the entity associated with the
27506 implicit declarations of statement names.
27507
27508 19.c
27509 Completion includes completion caused by a transfer of
27510 control, although RM83-5.1(6) did not take this view.
27511
27512 _Extensions to Ada 95_
27513
27514 19.d/2
27515 {AI95-00318-02AI95-00318-02} The extended_return_statement is
27516 new (simple_return_statement is merely renamed).
27517
27518 _Extensions to Ada 2005_
27519
27520 19.e/3
27521 {AI95-0179-1AI95-0179-1} A label can end a
27522 sequence_of_statements, eliminating the requirement for having
27523 an explicit null; statement after an ending label (a common
27524 use).
27525
27526 \1f
27527 File: aarm2012.info, Node: 5.2, Next: 5.3, Prev: 5.1, Up: 5
27528
27529 5.2 Assignment Statements
27530 =========================
27531
27532 1
27533 [An assignment_statement replaces the current value of a variable with
27534 the result of evaluating an expression.]
27535
27536 _Syntax_
27537
27538 2
27539 assignment_statement ::=
27540 variable_name := expression;
27541
27542 3
27543 The execution of an assignment_statement includes the evaluation of the
27544 expression and the assignment of the value of the expression into the
27545 target. [An assignment operation (as opposed to an assignment_statement
27546 (*note 5.2: S0152.)) is performed in other contexts as well, including
27547 object initialization and by-copy parameter passing.] The target of an
27548 assignment operation is the view of the object to which a value is being
27549 assigned; the target of an assignment_statement (*note 5.2: S0152.) is
27550 the variable denoted by the variable_name.
27551
27552 3.a
27553 Discussion: Don't confuse this notion of the "target" of an
27554 assignment with the notion of the "target object" of an entry
27555 call or requeue.
27556
27557 3.b
27558 Don't confuse the term "assignment operation" with the
27559 assignment_statement. The assignment operation is just one
27560 part of the execution of an assignment_statement. The
27561 assignment operation is also a part of the execution of
27562 various other constructs; see *note 7.6.1::, "*note 7.6.1::
27563 Completion and Finalization" for a complete list. Note that
27564 when we say, "such-and-such is assigned to so-and-so", we mean
27565 that the assignment operation is being applied, and that
27566 so-and-so is the target of the assignment operation.
27567
27568 _Name Resolution Rules_
27569
27570 4/2
27571 {AI95-00287-01AI95-00287-01} The variable_name of an
27572 assignment_statement is expected to be of any type. The expected type
27573 for the expression is the type of the target.
27574
27575 4.a
27576 Implementation Note: An assignment_statement as a whole is a
27577 "complete context," so if the variable_name of an
27578 assignment_statement is overloaded, the expression can be used
27579 to help disambiguate it. For example:
27580
27581 4.b
27582 type P1 is access R1;
27583 type P2 is access R2;
27584
27585 4.c
27586 function F return P1;
27587 function F return P2;
27588
27589 4.d
27590 X : R1;
27591 begin
27592 F.all := X; -- Right hand side helps resolve left hand side
27593
27594 _Legality Rules_
27595
27596 5/2
27597 {AI95-00287-01AI95-00287-01} The target [denoted by the variable_name]
27598 shall be a variable of a nonlimited type.
27599
27600 6
27601 If the target is of a tagged class-wide type T'Class, then the
27602 expression shall either be dynamically tagged, or of type T and
27603 tag-indeterminate (see *note 3.9.2::).
27604
27605 6.a
27606 Reason: This is consistent with the general rule that a single
27607 dispatching operation shall not have both dynamically tagged
27608 and statically tagged operands. Note that for an object
27609 initialization (as opposed to the assignment_statement), a
27610 statically tagged initialization expression is permitted,
27611 since there is no chance for confusion (or Tag_Check failure).
27612 Also, in an object initialization, tag-indeterminate
27613 expressions of any type covered by T'Class would be allowed,
27614 but with an assignment_statement, that might not work if the
27615 tag of the target was for a type that didn't have one of the
27616 dispatching operations in the tag-indeterminate expression.
27617
27618 _Dynamic Semantics_
27619
27620 7
27621 For the execution of an assignment_statement, the variable_name and the
27622 expression are first evaluated in an arbitrary order.
27623
27624 7.a
27625 Ramification: Other rules of the language may require that the
27626 bounds of the variable be determined prior to evaluating the
27627 expression, but that does not necessarily require evaluation
27628 of the variable_name, as pointed out by the ACID.
27629
27630 8
27631 When the type of the target is class-wide:
27632
27633 9
27634 * If the expression is tag-indeterminate (see *note 3.9.2::), then
27635 the controlling tag value for the expression is the tag of the
27636 target;
27637
27638 9.a
27639 Ramification: See *note 3.9.2::, "*note 3.9.2:: Dispatching
27640 Operations of Tagged Types".
27641
27642 10
27643 * Otherwise [(the expression is dynamically tagged)], a check is made
27644 that the tag of the value of the expression is the same as that of
27645 the target; if this check fails, Constraint_Error is raised.
27646
27647 11
27648 The value of the expression is converted to the subtype of the target.
27649 [The conversion might raise an exception (see *note 4.6::).]
27650
27651 11.a
27652 Ramification: *note 4.6::, "*note 4.6:: Type Conversions"
27653 defines what actions and checks are associated with subtype
27654 conversion. For non-array subtypes, it is just a constraint
27655 check presuming the types match. For array subtypes, it
27656 checks the lengths and slides if the target is constrained.
27657 "Sliding" means the array doesn't have to have the same
27658 bounds, so long as it is the same length.
27659
27660 12
27661 In cases involving controlled types, the target is finalized, and an
27662 anonymous object might be used as an intermediate in the assignment, as
27663 described in *note 7.6.1::, "*note 7.6.1:: Completion and Finalization".
27664 In any case, the converted value of the expression is then assigned to
27665 the target, which consists of the following two steps:
27666
27667 12.a
27668 To be honest: *note 7.6.1:: actually says that finalization
27669 happens always, but unless controlled types are involved, this
27670 finalization during an assignment_statement does nothing.
27671
27672 13
27673 * The value of the target becomes the converted value.
27674
27675 14/3
27676 * {AI05-0299-1AI05-0299-1} If any part of the target is controlled,
27677 its value is adjusted as explained in subclause *note 7.6::.
27678
27679 14.a
27680 Ramification: If any parts of the object are controlled, abort
27681 is deferred during the assignment operation itself, but not
27682 during the rest of the execution of an assignment_statement.
27683
27684 NOTES
27685
27686 15
27687 2 The tag of an object never changes; in particular, an
27688 assignment_statement does not change the tag of the target.
27689
27690 16/2
27691 This paragraph was deleted.{AI95-00363-01AI95-00363-01}
27692
27693 16.a
27694 Ramification: The implicit subtype conversion described above
27695 for assignment_statements is performed only for the value of
27696 the right-hand side expression as a whole; it is not performed
27697 for subcomponents of the value.
27698
27699 16.b
27700 The determination of the type of the variable of an
27701 assignment_statement may require consideration of the
27702 expression if the variable name can be interpreted as the name
27703 of a variable designated by the access value returned by a
27704 function call, and similarly, as a component or slice of such
27705 a variable (see *note 8.6::, "*note 8.6:: The Context of
27706 Overload Resolution").
27707
27708 _Examples_
27709
27710 17
27711 Examples of assignment statements:
27712
27713 18
27714 Value := Max_Value - 1;
27715 Shade := Blue;
27716
27717 19
27718 Next_Frame(F)(M, N) := 2.5; -- see *note 4.1.1::
27719 U := Dot_Product(V, W); -- see *note 6.3::
27720
27721 20
27722 Writer := (Status => Open, Unit => Printer, Line_Count => 60); -- see *note 3.8.1::
27723 Next_Car.all := (72074, null); -- see *note 3.10.1::
27724
27725 21
27726 Examples involving scalar subtype conversions:
27727
27728 22
27729 I, J : Integer range 1 .. 10 := 5;
27730 K : Integer range 1 .. 20 := 15;
27731 ...
27732
27733 23
27734 I := J; -- identical ranges
27735 K := J; -- compatible ranges
27736 J := K; -- will raise Constraint_Error if K > 10
27737
27738 24
27739 Examples involving array subtype conversions:
27740
27741 25
27742 A : String(1 .. 31);
27743 B : String(3 .. 33);
27744 ...
27745
27746 26
27747 A := B; -- same number of components
27748
27749 27
27750 A(1 .. 9) := "tar sauce";
27751 A(4 .. 12) := A(1 .. 9); -- A(1 .. 12) = "tartar sauce"
27752
27753 NOTES
27754
27755 28
27756 3 Notes on the examples: Assignment_statements are allowed even in
27757 the case of overlapping slices of the same array, because the
27758 variable_name and expression are both evaluated before copying the
27759 value into the variable. In the above example, an implementation
27760 yielding A(1 .. 12) = "tartartartar" would be incorrect.
27761
27762 _Extensions to Ada 83_
27763
27764 28.a
27765 We now allow user-defined finalization and value adjustment
27766 actions as part of assignment_statements (see *note 7.6::,
27767 "*note 7.6:: Assignment and Finalization").
27768
27769 _Wording Changes from Ada 83_
27770
27771 28.b
27772 The special case of array assignment is subsumed by the
27773 concept of a subtype conversion, which is applied for all
27774 kinds of types, not just arrays. For arrays it provides
27775 "sliding". For numeric types it provides conversion of a
27776 value of a universal type to the specific type of the target.
27777 For other types, it generally has no run-time effect, other
27778 than a constraint check.
27779
27780 28.c
27781 We now cover in a general way in *note 3.7.2:: the erroneous
27782 execution possible due to changing the value of a discriminant
27783 when the variable in an assignment_statement is a subcomponent
27784 that depends on discriminants.
27785
27786 _Incompatibilities With Ada 95_
27787
27788 28.d/2
27789 {AI95-00287-01AI95-00287-01} The change of the limited check
27790 from a resolution rule to a legality rule is not quite upward
27791 compatible. For example
27792
27793 28.e/2
27794 type AccNonLim is access NonLim;
27795 function Foo (Arg : in Integer) return AccNonLim;
27796 type AccLim is access Lim;
27797 function Foo (Arg : in Integer) return AccLim;
27798 Foo(2).all := Foo(1).all;
27799
27800 28.f/2
27801 where NonLim is a nonlimited type and Lim is a limited type.
27802 The assignment is legal in Ada 95 (only the first Foo would be
27803 considered), and is ambiguous in Ada 2005. We made the change
27804 because we want limited types to be as similar to nonlimited
27805 types as possible. Limited expressions are now allowed in all
27806 other contexts (with a similar incompatibility), and it would
27807 be odd if assignments had different resolution rules (which
27808 would eliminate ambiguities in some cases). Moreover,
27809 examples like this one are rare, as they depend on assigning
27810 into overloaded function calls.
27811
27812 \1f
27813 File: aarm2012.info, Node: 5.3, Next: 5.4, Prev: 5.2, Up: 5
27814
27815 5.3 If Statements
27816 =================
27817
27818 1
27819 [An if_statement selects for execution at most one of the enclosed
27820 sequences_of_statements, depending on the (truth) value of one or more
27821 corresponding conditions.]
27822
27823 _Syntax_
27824
27825 2
27826 if_statement ::=
27827 if condition then
27828 sequence_of_statements
27829 {elsif condition then
27830 sequence_of_statements}
27831 [else
27832 sequence_of_statements]
27833 end if;
27834
27835 Paragraphs 3 and 4 were deleted.
27836
27837 _Dynamic Semantics_
27838
27839 5/3
27840 {AI05-0264-1AI05-0264-1} For the execution of an if_statement, the
27841 condition specified after if, and any conditions specified after elsif,
27842 are evaluated in succession (treating a final else as elsif True then),
27843 until one evaluates to True or all conditions are evaluated and yield
27844 False. If a condition evaluates to True, then the corresponding
27845 sequence_of_statements is executed; otherwise, none of them is executed.
27846
27847 5.a
27848 Ramification: The part about all evaluating to False can't
27849 happen if there is an else, since that is herein considered
27850 equivalent to elsif True then.
27851
27852 _Examples_
27853
27854 6
27855 Examples of if statements:
27856
27857 7
27858 if Month = December and Day = 31 then
27859 Month := January;
27860 Day := 1;
27861 Year := Year + 1;
27862 end if;
27863
27864 8
27865 if Line_Too_Short then
27866 raise Layout_Error;
27867 elsif Line_Full then
27868 New_Line;
27869 Put(Item);
27870 else
27871 Put(Item);
27872 end if;
27873
27874 9
27875 if My_Car.Owner.Vehicle /= My_Car then -- see *note 3.10.1::
27876 Report ("Incorrect data");
27877 end if;
27878
27879 _Wording Changes from Ada 2005_
27880
27881 9.a/3
27882 {AI05-0147-1AI05-0147-1} Moved definition of condition to
27883 *note 4.5.7:: in order to eliminate a forward reference.
27884
27885 \1f
27886 File: aarm2012.info, Node: 5.4, Next: 5.5, Prev: 5.3, Up: 5
27887
27888 5.4 Case Statements
27889 ===================
27890
27891 1
27892 [A case_statement selects for execution one of a number of alternative
27893 sequences_of_statements; the chosen alternative is defined by the value
27894 of an expression.]
27895
27896 _Syntax_
27897
27898 2/3
27899 {AI05-0188-1AI05-0188-1} case_statement ::=
27900 case selecting_expression is
27901 case_statement_alternative
27902 {case_statement_alternative}
27903 end case;
27904
27905 3
27906 case_statement_alternative ::=
27907 when discrete_choice_list =>
27908 sequence_of_statements
27909
27910 _Name Resolution Rules_
27911
27912 4/3
27913 {AI05-0188-1AI05-0188-1} The selecting_expression is expected to be of
27914 any discrete type. The expected type for each discrete_choice is the
27915 type of the selecting_expression.
27916
27917 _Legality Rules_
27918
27919 5/3
27920 {AI05-0153-3AI05-0153-3} The choice_expressions, subtype_indications,
27921 and ranges given as discrete_choices of a case_statement shall be
27922 static. [A discrete_choice others, if present, shall appear alone and
27923 in the last discrete_choice_list.]
27924
27925 6/3
27926 {AI05-0188-1AI05-0188-1} {AI05-0240-1AI05-0240-1} The possible values of
27927 the selecting_expression shall be covered (see *note 3.8.1::) as
27928 follows:
27929
27930 6.a/3
27931 Discussion: {AI05-0240-1AI05-0240-1} The meaning of "covered"
27932 here and in the following rules is that of the term "cover a
27933 value" that is defined in *note 3.8.1::.
27934
27935 7/3
27936 * {AI05-0003-1AI05-0003-1} {AI05-0153-3AI05-0153-3}
27937 {AI05-0188-1AI05-0188-1} {AI05-0262-1AI05-0262-1} If the
27938 selecting_expression is a name [(including a type_conversion,
27939 qualified_expression, or function_call)] having a static and
27940 constrained nominal subtype, then each non-others discrete_choice
27941 shall cover only values in that subtype that satisfy its predicate
27942 (see *note 3.2.4::), and each value of that subtype that satisfies
27943 its predicate shall be covered by some discrete_choice [(either
27944 explicitly or by others)].
27945
27946 7.a
27947 Ramification: Although not official names of objects, a value
27948 conversion still has a defined nominal subtype, namely its
27949 target subtype. See *note 4.6::.
27950
27951 8/3
27952 * {AI05-0188-1AI05-0188-1} If the type of the selecting_expression is
27953 root_integer, universal_integer, or a descendant of a formal scalar
27954 type, then the case_statement shall have an others discrete_choice.
27955
27956 8.a
27957 Reason: This is because the base range is implementation
27958 defined for root_integer and universal_integer, and not known
27959 statically in the case of a formal scalar type.
27960
27961 9/3
27962 * {AI05-0188-1AI05-0188-1} Otherwise, each value of the base range of
27963 the type of the selecting_expression shall be covered [(either
27964 explicitly or by others)].
27965
27966 10
27967 Two distinct discrete_choices of a case_statement shall not cover the
27968 same value.
27969
27970 10.a/3
27971 Ramification: {AI05-0188-1AI05-0188-1} The goal of these
27972 coverage rules is that any possible value of the
27973 selecting_expression of a case_statement should be covered by
27974 exactly one discrete_choice of the case_statement, and that
27975 this should be checked at compile time. The goal is achieved
27976 in most cases, but there are two minor loopholes:
27977
27978 10.b
27979 * If the expression reads an object with an invalid
27980 representation (e.g. an uninitialized object), then the
27981 value can be outside the covered range. This can happen
27982 for static constrained subtypes, as well as nonstatic or
27983 unconstrained subtypes. It cannot, however, happen if
27984 the case_statement has the discrete_choice others,
27985 because others covers all values, even those outside the
27986 subtype.
27987
27988 10.c/3
27989 * {AI95-00114-01AI95-00114-01} {AI05-0188-1AI05-0188-1} If
27990 the compiler chooses to represent the value of an
27991 expression of an unconstrained subtype in a way that
27992 includes values outside the bounds of the subtype, then
27993 those values can be outside the covered range. For
27994 example, if X: Integer := Integer'Last;, and the case
27995 selecting_expression is X+1, then the implementation
27996 might choose to produce the correct value, which is
27997 outside the bounds of Integer. (It might raise
27998 Constraint_Error instead.) This case can only happen for
27999 nongeneric subtypes that are either unconstrained or
28000 nonstatic (or both). It can only happen if there is no
28001 others discrete_choice.
28002
28003 10.d
28004 In the uninitialized variable case, the value might be
28005 anything; hence, any alternative can be chosen, or
28006 Constraint_Error can be raised. (We intend to prevent,
28007 however, jumping to random memory locations and the like.) In
28008 the out-of-range case, the behavior is more sensible: if there
28009 is an others, then the implementation may choose to raise
28010 Constraint_Error on the evaluation of the expression (as
28011 usual), or it may choose to correctly evaluate the expression
28012 and therefore choose the others alternative. Otherwise (no
28013 others), Constraint_Error is raised either way -- on the
28014 expression evaluation, or for the case_statement itself.
28015
28016 10.e
28017 For an enumeration type with a discontiguous set of internal
28018 codes (see *note 13.4::), the only way to get values in
28019 between the proper values is via an object with an invalid
28020 representation; there is no "out-of-range" situation that can
28021 produce them.
28022
28023 _Dynamic Semantics_
28024
28025 11/3
28026 {AI05-0188-1AI05-0188-1} For the execution of a case_statement the
28027 selecting_expression is first evaluated.
28028
28029 12/3
28030 {AI05-0188-1AI05-0188-1} If the value of the selecting_expression is
28031 covered by the discrete_choice_list (*note 3.8.1: S0073.) of some
28032 case_statement_alternative (*note 5.4: S0155.), then the
28033 sequence_of_statements (*note 5.1: S0145.) of the _alternative is
28034 executed.
28035
28036 13
28037 Otherwise (the value is not covered by any discrete_choice_list, perhaps
28038 due to being outside the base range), Constraint_Error is raised.
28039
28040 13.a
28041 Ramification: In this case, the value is outside the base
28042 range of its type, or is an invalid representation.
28043
28044 NOTES
28045
28046 14
28047 4 The execution of a case_statement chooses one and only one
28048 alternative. Qualification of the expression of a case_statement
28049 by a static subtype can often be used to limit the number of
28050 choices that need be given explicitly.
28051
28052 _Examples_
28053
28054 15
28055 Examples of case statements:
28056
28057 16
28058 case Sensor is
28059 when Elevation => Record_Elevation(Sensor_Value);
28060 when Azimuth => Record_Azimuth (Sensor_Value);
28061 when Distance => Record_Distance (Sensor_Value);
28062 when others => null;
28063 end case;
28064
28065 17
28066 case Today is
28067 when Mon => Compute_Initial_Balance;
28068 when Fri => Compute_Closing_Balance;
28069 when Tue .. Thu => Generate_Report(Today);
28070 when Sat .. Sun => null;
28071 end case;
28072
28073 18
28074 case Bin_Number(Count) is
28075 when 1 => Update_Bin(1);
28076 when 2 => Update_Bin(2);
28077 when 3 | 4 =>
28078 Empty_Bin(1);
28079 Empty_Bin(2);
28080 when others => raise Error;
28081 end case;
28082
28083 _Incompatibilities With Ada 83_
28084
28085 18.a.1/1
28086 In Ada 95, function_calls and type_conversions are names,
28087 whereas in Ada 83, they were expressions. Therefore, if the
28088 expression of a case_statement is a function_call or
28089 type_conversion, and the result subtype is static, it is
28090 illegal to specify a choice outside the bounds of the subtype.
28091 For this case in Ada 83 choices only are required to be in the
28092 base range of the type.
28093
28094 18.a.2/1
28095 In addition, the rule about which choices must be covered is
28096 unchanged in Ada 95. Therefore, for a case_statement whose
28097 expression is a function_call or type_conversion, Ada 83
28098 required covering all choices in the base range, while Ada 95
28099 only requires covering choices in the bounds of the subtype.
28100 If the case_statement does not include an others
28101 discrete_choice, then a legal Ada 83 case_statement will be
28102 illegal in Ada 95 if the bounds of the subtype are different
28103 than the bounds of the base type.
28104
28105 _Extensions to Ada 83_
28106
28107 18.a
28108 In Ada 83, the expression in a case_statement is not allowed
28109 to be of a generic formal type. This restriction is removed
28110 in Ada 95; an others discrete_choice is required instead.
28111
28112 18.b
28113 In Ada 95, a function call is the name of an object; this was
28114 not true in Ada 83 (see *note 4.1::, "*note 4.1:: Names").
28115 This change makes the following case_statement legal:
28116
28117 18.c
28118 subtype S is Integer range 1..2;
28119 function F return S;
28120 case F is
28121 when 1 => ...;
28122 when 2 => ...;
28123 -- No others needed.
28124 end case;
28125
28126 18.d/3
28127 {AI05-0005-1AI05-0005-1} Note that the result subtype given in
28128 a function renaming_declaration is ignored; for a
28129 case_statement whose expression calls a such a function, the
28130 full coverage rules are checked using the result subtype of
28131 the original function. Note that predefined operators such as
28132 "+" have an unconstrained result subtype (see *note 4.5.1::).
28133 Note that generic formal functions do not have static result
28134 subtypes. Note that the result subtype of an inherited
28135 subprogram need not correspond to any nameable subtype; there
28136 is still a perfectly good result subtype, though.
28137
28138 _Wording Changes from Ada 83_
28139
28140 18.e
28141 Ada 83 forgot to say what happens for "legally" out-of-bounds
28142 values.
28143
28144 18.f
28145 We take advantage of rules and terms (e.g. cover a value)
28146 defined for discrete_choices and discrete_choice_lists in
28147 *note 3.8.1::, "*note 3.8.1:: Variant Parts and Discrete
28148 Choices".
28149
28150 18.g
28151 In the Name Resolution Rule for the case expression, we no
28152 longer need RM83-5.4(3)'s "which must be determinable
28153 independently of the context in which the expression occurs,
28154 but using the fact that the expression must be of a discrete
28155 type," because the expression is now a complete context. See
28156 *note 8.6::, "*note 8.6:: The Context of Overload Resolution".
28157
28158 18.h
28159 Since type_conversions are now defined as names, their
28160 coverage rule is now covered under the general rule for names,
28161 rather than being separated out along with
28162 qualified_expressions.
28163
28164 _Wording Changes from Ada 2005_
28165
28166 18.i/3
28167 {AI05-0003-1AI05-0003-1} Rewording to reflect that a
28168 qualified_expression is now a name.
28169
28170 18.j/3
28171 {AI05-0153-3AI05-0153-3} Revised for changes to
28172 discrete_choices made to allow static predicates (see *note
28173 3.2.4::) as case choices (see *note 3.8.1::).
28174
28175 18.k/3
28176 {AI05-0188-1AI05-0188-1} Added the selecting_ prefix to make
28177 this wording consistent with case_expression, and to clarify
28178 which expression is being talked about in the wording.
28179
28180 \1f
28181 File: aarm2012.info, Node: 5.5, Next: 5.6, Prev: 5.4, Up: 5
28182
28183 5.5 Loop Statements
28184 ===================
28185
28186 1
28187 [A loop_statement includes a sequence_of_statements that is to be
28188 executed repeatedly, zero or more times.]
28189
28190 _Syntax_
28191
28192 2
28193 loop_statement ::=
28194 [loop_statement_identifier:]
28195 [iteration_scheme] loop
28196 sequence_of_statements
28197 end loop [loop_identifier];
28198
28199 3/3
28200 {AI05-0139-2AI05-0139-2} iteration_scheme ::= while condition
28201 | for loop_parameter_specification
28202 | for iterator_specification
28203
28204 4
28205 loop_parameter_specification ::=
28206 defining_identifier in [reverse] discrete_subtype_definition
28207
28208 5
28209 If a loop_statement has a loop_statement_identifier, then the
28210 identifier shall be repeated after the end loop; otherwise, there
28211 shall not be an identifier after the end loop.
28212
28213 _Static Semantics_
28214
28215 6
28216 A loop_parameter_specification declares a loop parameter, which is an
28217 object whose subtype is that defined by the discrete_subtype_definition.
28218
28219 _Dynamic Semantics_
28220
28221 7
28222 For the execution of a loop_statement, the sequence_of_statements is
28223 executed repeatedly, zero or more times, until the loop_statement is
28224 complete. The loop_statement is complete when a transfer of control
28225 occurs that transfers control out of the loop, or, in the case of an
28226 iteration_scheme, as specified below.
28227
28228 8
28229 For the execution of a loop_statement with a while iteration_scheme, the
28230 condition is evaluated before each execution of the
28231 sequence_of_statements (*note 5.1: S0145.); if the value of the
28232 condition is True, the sequence_of_statements (*note 5.1: S0145.) is
28233 executed; if False, the execution of the loop_statement (*note 5.5:
28234 S0156.) is complete.
28235
28236 9/3
28237 {AI05-0139-2AI05-0139-2} {AI05-0262-1AI05-0262-1} For the execution of a
28238 loop_statement with the iteration_scheme being for
28239 loop_parameter_specification (*note 5.5: S0158.), the
28240 loop_parameter_specification (*note 5.5: S0158.) is first elaborated.
28241 This elaboration creates the loop parameter and elaborates the
28242 discrete_subtype_definition (*note 3.6: S0055.). If the
28243 discrete_subtype_definition (*note 3.6: S0055.) defines a subtype with a
28244 null range, the execution of the loop_statement is complete. Otherwise,
28245 the sequence_of_statements (*note 5.1: S0145.) is executed once for each
28246 value of the discrete subtype defined by the discrete_subtype_definition
28247 (*note 3.6: S0055.) that satisfies the predicate of the subtype (or
28248 until the loop is left as a consequence of a transfer of control).
28249 Prior to each such iteration, the corresponding value of the discrete
28250 subtype is assigned to the loop parameter. These values are assigned in
28251 increasing order unless the reserved word reverse is present, in which
28252 case the values are assigned in decreasing order.
28253
28254 9.a
28255 Ramification: The order of creating the loop parameter and
28256 evaluating the discrete_subtype_definition doesn't matter,
28257 since the creation of the loop parameter has no side effects
28258 (other than possibly raising Storage_Error, but anything can
28259 do that).
28260
28261 9.b/3
28262 {AI05-0262-1AI05-0262-1} The predicate (if any) necessarily
28263 has to be a static predicate as a dynamic predicate is
28264 explicitly disallowed -- see *note 3.2.4::.
28265
28266 9.c/3
28267 Reason: {AI05-0262-1AI05-0262-1} If there is a predicate, the
28268 loop still visits the values in the order of the underlying
28269 base type; the order of the values in the predicate is
28270 irrelevant. This is the case so that the following loops have
28271 the same sequence of calls and parameters on procedure Call
28272 for any subtype S:
28273
28274 9.d
28275 for I in S loop
28276 Call (I);
28277 end loop;
28278
28279 9.e
28280 for I in S'Base loop
28281 if I in S then
28282 Call (I);
28283 end if;
28284 end loop;
28285
28286 9.1/3
28287 {AI05-0262-1AI05-0262-1} [For details about the execution of a
28288 loop_statement with the iteration_scheme being for
28289 iterator_specification, see *note 5.5.2::.]
28290
28291 NOTES
28292
28293 10
28294 5 A loop parameter is a constant; it cannot be updated within the
28295 sequence_of_statements of the loop (see *note 3.3::).
28296
28297 11
28298 6 An object_declaration should not be given for a loop parameter,
28299 since the loop parameter is automatically declared by the
28300 loop_parameter_specification. The scope of a loop parameter
28301 extends from the loop_parameter_specification to the end of the
28302 loop_statement, and the visibility rules are such that a loop
28303 parameter is only visible within the sequence_of_statements of the
28304 loop.
28305
28306 11.a
28307 Implementation Note: An implementation could give a warning if
28308 a variable is hidden by a loop_parameter_specification.
28309
28310 12
28311 7 The discrete_subtype_definition of a for loop is elaborated just
28312 once. Use of the reserved word reverse does not alter the discrete
28313 subtype defined, so that the following iteration_schemes are not
28314 equivalent; the first has a null range.
28315
28316 13
28317 for J in reverse 1 .. 0
28318 for J in 0 .. 1
28319
28320 13.a
28321 Ramification: If a loop_parameter_specification has a static
28322 discrete range, the subtype of the loop parameter is static.
28323
28324 _Examples_
28325
28326 14
28327 Example of a loop statement without an iteration scheme:
28328
28329 15
28330 loop
28331 Get(Current_Character);
28332 exit when Current_Character = '*';
28333 end loop;
28334
28335 16
28336 Example of a loop statement with a while iteration scheme:
28337
28338 17
28339 while Bid(N).Price < Cut_Off.Price loop
28340 Record_Bid(Bid(N).Price);
28341 N := N + 1;
28342 end loop;
28343
28344 18
28345 Example of a loop statement with a for iteration scheme:
28346
28347 19
28348 for J in Buffer'Range loop -- works even with a null range
28349 if Buffer(J) /= Space then
28350 Put(Buffer(J));
28351 end if;
28352 end loop;
28353
28354 20
28355 Example of a loop statement with a name:
28356
28357 21
28358 Summation:
28359 while Next /= Head loop -- see *note 3.10.1::
28360 Sum := Sum + Next.Value;
28361 Next := Next.Succ;
28362 end loop Summation;
28363
28364 _Wording Changes from Ada 83_
28365
28366 21.a
28367 The constant-ness of loop parameters is specified in *note
28368 3.3::, "*note 3.3:: Objects and Named Numbers".
28369
28370 _Wording Changes from Ada 2005_
28371
28372 21.b/3
28373 {AI05-0139-2AI05-0139-2} {AI05-0262-1AI05-0262-1}
28374 {AI05-0299-1AI05-0299-1} Generalized iterator_specifications
28375 are allowed in for loops; these are documented as an extension
28376 in the appropriate subclause.
28377
28378 * Menu:
28379
28380 * 5.5.1 :: User-Defined Iterator Types
28381 * 5.5.2 :: Generalized Loop Iteration
28382
28383 \1f
28384 File: aarm2012.info, Node: 5.5.1, Next: 5.5.2, Up: 5.5
28385
28386 5.5.1 User-Defined Iterator Types
28387 ---------------------------------
28388
28389 _Static Semantics_
28390
28391 1/3
28392 {AI05-0139-2AI05-0139-2} The following language-defined generic library
28393 package exists:
28394
28395 2/3
28396 generic
28397 type Cursor;
28398 with function Has_Element (Position : Cursor) return Boolean;
28399 package Ada.Iterator_Interfaces is
28400 pragma Pure (Iterator_Interfaces);
28401
28402 3/3
28403 type Forward_Iterator is limited interface;
28404 function First (Object : Forward_Iterator) return Cursor is abstract;
28405 function Next (Object : Forward_Iterator; Position : Cursor)
28406 return Cursor is abstract;
28407
28408 4/3
28409 type Reversible_Iterator is limited interface and Forward_Iterator;
28410 function Last (Object : Reversible_Iterator) return Cursor is abstract;
28411 function Previous (Object : Reversible_Iterator; Position : Cursor)
28412 return Cursor is abstract;
28413
28414 5/3
28415 end Ada.Iterator_Interfaces;
28416
28417 6/3
28418 {AI05-0139-2AI05-0139-2} An iterator type is a type descended from the
28419 Forward_Iterator interface from some instance of
28420 Ada.Iterator_Interfaces. A reversible iterator type is a type descended
28421 from the Reversible_Iterator interface from some instance of
28422 Ada.Iterator_Interfaces. An iterator object is an object of an iterator
28423 type. A reversible iterator object is an object of a reversible
28424 iterator type. The formal subtype Cursor from the associated instance
28425 of Ada.Iterator_Interfaces is the iteration cursor subtype for the
28426 iterator type.
28427
28428 7/3
28429 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} The following
28430 type-related operational aspects may be specified for an indexable
28431 container type T (see *note 4.1.6::):
28432
28433 8/3
28434 Default_Iterator
28435 This aspect is specified by a name that denotes exactly
28436 one function declared immediately within the same
28437 declaration list in which T is declared, whose first
28438 parameter is of type T or T'Class or an access parameter
28439 whose designated type is type T or T'Class, whose other
28440 parameters, if any, have default expressions, and whose
28441 result type is an iterator type. This function is the
28442 default iterator function for T. Its result subtype is
28443 the default iterator subtype for T. The iteration cursor
28444 subtype for the default iterator subtype is the default
28445 cursor subtype for T.
28446
28447 8.a/3
28448 Aspect Description for Default_Iterator: Default iterator to
28449 be used in for loops.
28450
28451 9/3
28452 Iterator_Element
28453 This aspect is specified by a name that denotes a
28454 subtype. This is the default element subtype for T.
28455
28456 9.a/3
28457 Aspect Description for Iterator_Element: Element type to be
28458 used for user-defined iterators.
28459
28460 10/3
28461 These aspects are inherited by descendants of type T (including
28462 T'Class).
28463
28464 11/3
28465 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} An iterable container
28466 type is an indexable container type with specified Default_Iterator and
28467 Iterator_Element aspects. A reversible iterable container type is an
28468 iterable container type with the default iterator type being a
28469 reversible iterator type. An iterable container object is an object of
28470 an iterable container type. A reversible iterable container object is
28471 an object of a reversible iterable container type.
28472
28473 11.a.1/3
28474 Glossary entry: An iterable container type is one that has
28475 user-defined behavior for iteration, via the Default_Iterator
28476 and Iterator_Element aspects.
28477
28478 _Legality Rules_
28479
28480 12/3
28481 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} The Constant_Indexing
28482 aspect (if any) of an iterable container type T shall denote exactly one
28483 function with the following properties:
28484
28485 13/3
28486 * the result type of the function is covered by the default element
28487 type of T or is a reference type (see *note 4.1.5::) with an access
28488 discriminant designating a type covered by the default element type
28489 of T;
28490
28491 14/3
28492 * the type of the second parameter of the function covers the default
28493 cursor type for T;
28494
28495 15/3
28496 * if there are more than two parameters, the additional parameters
28497 all have default expressions.
28498
28499 16/3
28500 This function (if any) is the default constant indexing function for T.
28501
28502 16.a/3
28503 Ramification: This does not mean that Constant_Indexing has to
28504 designate only one subprogram, only that there is only one
28505 routine that meets all of these properties. There can be
28506 other routines designated by Constant_Indexing, but they
28507 cannot have the profile described above. For instance, map
28508 containers have a version of Constant_Indexing that takes a
28509 key instead of a cursor; this is allowed.
28510
28511 17/3
28512 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} The Variable_Indexing
28513 aspect (if any) of an iterable container type T shall denote exactly one
28514 function with the following properties:
28515
28516 18/3
28517 * the result type of the function is a reference type (see *note
28518 4.1.5::) with an access discriminant designating a type covered by
28519 the default element type of T;
28520
28521 19/3
28522 * the type of the second parameter of the function covers the default
28523 cursor type for T;
28524
28525 20/3
28526 * if there are more than two parameters, the additional parameters
28527 all have default expressions.
28528
28529 21/3
28530 This function (if any) is the default variable indexing function for T.
28531
28532 _Extensions to Ada 2005_
28533
28534 21.a/3
28535 {AI05-0139-2AI05-0139-2} User-defined iterator types are new
28536 in Ada 2012.
28537
28538 \1f
28539 File: aarm2012.info, Node: 5.5.2, Prev: 5.5.1, Up: 5.5
28540
28541 5.5.2 Generalized Loop Iteration
28542 --------------------------------
28543
28544 1/3
28545 {AI05-0139-2AI05-0139-2} Generalized forms of loop iteration are
28546 provided by an iterator_specification.
28547
28548 _Syntax_
28549
28550 2/3
28551 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1}
28552 iterator_specification ::=
28553 defining_identifier in [reverse] iterator_name
28554 | defining_identifier [:
28555 subtype_indication] of [reverse] iterable_name
28556
28557 _Name Resolution Rules_
28558
28559 3/3
28560 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} For the first form of
28561 iterator_specification, called a generalized iterator, the expected type
28562 for the iterator_name is any iterator type. For the second form of
28563 iterator_specification, the expected type for the iterable_name is any
28564 array or iterable container type. If the iterable_name denotes an array
28565 object, the iterator_specification is called an array component
28566 iterator; otherwise it is called a container element iterator.
28567
28568 3.a.1/3
28569 Glossary entry: An iterator is a construct that is used to
28570 loop over the elements of an array or container. Iterators
28571 may be user defined, and may perform arbitrary computations to
28572 access elements from a container.
28573
28574 _Legality Rules_
28575
28576 4/3
28577 {AI05-0139-2AI05-0139-2} If the reserved word reverse appears, the
28578 iterator_specification is a reverse iterator; otherwise it is a forward
28579 iterator. In a reverse generalized iterator, the iterator_name shall be
28580 of a reversible iterator type. In a reverse container element iterator,
28581 the default iterator type for the type of the iterable_name shall be a
28582 reversible iterator type.
28583
28584 5/3
28585 {AI05-0139-2AI05-0139-2} The type of the subtype_indication, if any, of
28586 an array component iterator shall cover the component type of the type
28587 of the iterable_name. The type of the subtype_indication, if any, of a
28588 container element iterator shall cover the default element type for the
28589 type of the iterable_name.
28590
28591 6/3
28592 {AI05-0139-2AI05-0139-2} In a container element iterator whose
28593 iterable_name has type T, if the iterable_name denotes a constant or the
28594 Variable_Indexing aspect is not specified for T, then the
28595 Constant_Indexing aspect shall be specified for T.
28596
28597 _Static Semantics_
28598
28599 7/3
28600 {AI05-0139-2AI05-0139-2} {AI05-0269-1AI05-0269-1}
28601 {AI05-0292-1AI05-0292-1} An iterator_specification declares a loop
28602 parameter. In a generalized iterator, the nominal subtype of the loop
28603 parameter is the iteration cursor subtype. In an array component
28604 iterator or a container element iterator, if a subtype_indication is
28605 present, it determines the nominal subtype of the loop parameter. In an
28606 array component iterator, if a subtype_indication is not present, the
28607 nominal subtype of the loop parameter is the component subtype of the
28608 type of the iterable_name. In a container element iterator, if a
28609 subtype_indication is not present, the nominal subtype of the loop
28610 parameter is the default element subtype for the type of the
28611 iterable_name.
28612
28613 8/3
28614 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} In a generalized
28615 iterator, the loop parameter is a constant. In an array component
28616 iterator, the loop parameter is a constant if the iterable_name denotes
28617 a constant; otherwise it denotes a variable. In a container element
28618 iterator, the loop parameter is a constant if the iterable_name denotes
28619 a constant, or if the Variable_Indexing aspect is not specified for the
28620 type of the iterable_name; otherwise it is a variable.
28621
28622 _Dynamic Semantics_
28623
28624 9/3
28625 {AI05-0139-2AI05-0139-2} For the execution of a loop_statement with an
28626 iterator_specification, the iterator_specification is first elaborated.
28627 This elaboration elaborates the subtype_indication, if any.
28628
28629 10/3
28630 {AI05-0139-2AI05-0139-2} For a generalized iterator, the loop parameter
28631 is created, the iterator_name is evaluated, and the denoted iterator
28632 object becomes the loop iterator. In a forward generalized iterator,
28633 the operation First of the iterator type is called on the loop iterator,
28634 to produce the initial value for the loop parameter. If the result of
28635 calling Has_Element on the initial value is False, then the execution of
28636 the loop_statement is complete. Otherwise, the sequence_of_statements
28637 is executed and then the Next operation of the iterator type is called
28638 with the loop iterator and the current value of the loop parameter to
28639 produce the next value to be assigned to the loop parameter. This
28640 repeats until the result of calling Has_Element on the loop parameter is
28641 False, or the loop is left as a consequence of a transfer of control.
28642 For a reverse generalized iterator, the operations Last and Previous are
28643 called rather than First and Next.
28644
28645 11/3
28646 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} For an array component
28647 iterator, the iterable_name is evaluated and the denoted array object
28648 becomes the array for the loop. If the array for the loop is a null
28649 array, then the execution of the loop_statement is complete. Otherwise,
28650 the sequence_of_statements is executed with the loop parameter denoting
28651 each component of the array for the loop, using a canonical order of
28652 components, which is last dimension varying fastest (unless the array
28653 has convention Fortran, in which case it is first dimension varying
28654 fastest). For a forward array component iterator, the iteration starts
28655 with the component whose index values are each the first in their index
28656 range, and continues in the canonical order. For a reverse array
28657 component iterator, the iteration starts with the component whose index
28658 values are each the last in their index range, and continues in the
28659 reverse of the canonical order. The loop iteration proceeds until the
28660 sequence_of_statements has been executed for each component of the array
28661 for the loop, or until the loop is left as a consequence of a transfer
28662 of control.
28663
28664 12/3
28665 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} For a container
28666 element iterator, the iterable_name is evaluated and the denoted
28667 iterable container object becomes the iterable container object for the
28668 loop. The default iterator function for the type of the iterable
28669 container object for the loop is called on the iterable container object
28670 and the result is the loop iterator. An object of the default cursor
28671 subtype is created (the loop cursor).
28672
28673 13/3
28674 {AI05-0139-2AI05-0139-2} {AI05-0292-1AI05-0292-1} For a forward
28675 container element iterator, the operation First of the iterator type is
28676 called on the loop iterator, to produce the initial value for the loop
28677 cursor. If the result of calling Has_Element on the initial value is
28678 False, then the execution of the loop_statement is complete. Otherwise,
28679 the sequence_of_statements is executed with the loop parameter denoting
28680 an indexing (see *note 4.1.6::) into the iterable container object for
28681 the loop, with the only parameter to the indexing being the current
28682 value of the loop cursor; then the Next operation of the iterator type
28683 is called with the loop iterator and the loop cursor to produce the next
28684 value to be assigned to the loop cursor. This repeats until the result
28685 of calling Has_Element on the loop cursor is False, or until the loop is
28686 left as a consequence of a transfer of control. For a reverse container
28687 element iterator, the operations Last and Previous are called rather
28688 than First and Next. If the loop parameter is a constant (see above),
28689 then the indexing uses the default constant indexing function for the
28690 type of the iterable container object for the loop; otherwise it uses
28691 the default variable indexing function.
28692
28693 _Examples_
28694
28695 14/3
28696 {AI05-0269-1AI05-0269-1} -- Array component iterator example:
28697 for Element of Board loop -- See *note 3.6.1::.
28698 Element := Element * 2.0; -- Double each element of Board, a two-dimensional array.
28699 end loop;
28700
28701 15/3
28702 {AI05-0268-1AI05-0268-1} For examples of use of generalized iterators,
28703 see *note A.18.32:: and the corresponding container packages in *note
28704 A.18.2:: and *note A.18.3::.
28705
28706 _Extensions to Ada 2005_
28707
28708 15.a/3
28709 {AI05-0139-2AI05-0139-2} Generalized forms of loop iteration
28710 are new.
28711
28712 \1f
28713 File: aarm2012.info, Node: 5.6, Next: 5.7, Prev: 5.5, Up: 5
28714
28715 5.6 Block Statements
28716 ====================
28717
28718 1
28719 [A block_statement encloses a handled_sequence_of_statements optionally
28720 preceded by a declarative_part.]
28721
28722 _Syntax_
28723
28724 2
28725 block_statement ::=
28726 [block_statement_identifier:]
28727 [declare
28728 declarative_part]
28729 begin
28730 handled_sequence_of_statements
28731 end [block_identifier];
28732
28733 3
28734 If a block_statement has a block_statement_identifier, then the
28735 identifier shall be repeated after the end; otherwise, there shall
28736 not be an identifier after the end.
28737
28738 _Static Semantics_
28739
28740 4
28741 A block_statement that has no explicit declarative_part has an implicit
28742 empty declarative_part.
28743
28744 4.a
28745 Ramification: Thus, other rules can always refer to the
28746 declarative_part of a block_statement.
28747
28748 _Dynamic Semantics_
28749
28750 5
28751 The execution of a block_statement consists of the elaboration of its
28752 declarative_part followed by the execution of its
28753 handled_sequence_of_statements.
28754
28755 _Examples_
28756
28757 6
28758 Example of a block statement with a local variable:
28759
28760 7
28761 Swap:
28762 declare
28763 Temp : Integer;
28764 begin
28765 Temp := V; V := U; U := Temp;
28766 end Swap;
28767
28768 7.a
28769 Ramification: If task objects are declared within a
28770 block_statement whose execution is completed, the
28771 block_statement is not left until all its dependent tasks are
28772 terminated (see *note 7.6::). This rule applies to completion
28773 caused by a transfer of control.
28774
28775 7.b
28776 Within a block_statement, the block name can be used in
28777 expanded names denoting local entities such as Swap.Temp in
28778 the above example (see *note 4.1.3::).
28779
28780 _Wording Changes from Ada 83_
28781
28782 7.c
28783 The syntax rule for block_statement now uses the syntactic
28784 category handled_sequence_of_statements.
28785
28786 \1f
28787 File: aarm2012.info, Node: 5.7, Next: 5.8, Prev: 5.6, Up: 5
28788
28789 5.7 Exit Statements
28790 ===================
28791
28792 1
28793 [An exit_statement is used to complete the execution of an enclosing
28794 loop_statement; the completion is conditional if the exit_statement
28795 includes a condition.]
28796
28797 _Syntax_
28798
28799 2
28800 exit_statement ::=
28801 exit [loop_name] [when condition];
28802
28803 _Name Resolution Rules_
28804
28805 3
28806 The loop_name, if any, in an exit_statement shall resolve to denote a
28807 loop_statement.
28808
28809 _Legality Rules_
28810
28811 4
28812 Each exit_statement (*note 5.7: S0161.) applies to a loop_statement
28813 (*note 5.5: S0156.); this is the loop_statement (*note 5.5: S0156.)
28814 being exited. An exit_statement (*note 5.7: S0161.) with a name is only
28815 allowed within the loop_statement (*note 5.5: S0156.) denoted by the
28816 name, and applies to that loop_statement (*note 5.5: S0156.). An
28817 exit_statement (*note 5.7: S0161.) without a name is only allowed within
28818 a loop_statement (*note 5.5: S0156.), and applies to the innermost
28819 enclosing one. An exit_statement (*note 5.7: S0161.) that applies to a
28820 given loop_statement (*note 5.5: S0156.) shall not appear within a body
28821 or accept_statement (*note 9.5.2: S0219.), if this construct is itself
28822 enclosed by the given loop_statement.
28823
28824 _Dynamic Semantics_
28825
28826 5
28827 For the execution of an exit_statement, the condition, if present, is
28828 first evaluated. If the value of the condition is True, or if there is
28829 no condition, a transfer of control is done to complete the
28830 loop_statement (*note 5.5: S0156.). If the value of the condition is
28831 False, no transfer of control takes place.
28832
28833 NOTES
28834
28835 6
28836 8 Several nested loops can be exited by an exit_statement that
28837 names the outer loop.
28838
28839 _Examples_
28840
28841 7
28842 Examples of loops with exit statements:
28843
28844 8
28845 for N in 1 .. Max_Num_Items loop
28846 Get_New_Item(New_Item);
28847 Merge_Item(New_Item, Storage_File);
28848 exit when New_Item = Terminal_Item;
28849 end loop;
28850
28851 9
28852 Main_Cycle:
28853 loop
28854 -- initial statements
28855 exit Main_Cycle when Found;
28856 -- final statements
28857 end loop Main_Cycle;
28858
28859 \1f
28860 File: aarm2012.info, Node: 5.8, Prev: 5.7, Up: 5
28861
28862 5.8 Goto Statements
28863 ===================
28864
28865 1
28866 [A goto_statement specifies an explicit transfer of control from this
28867 statement to a target statement with a given label.]
28868
28869 _Syntax_
28870
28871 2
28872 goto_statement ::= goto label_name;
28873
28874 _Name Resolution Rules_
28875
28876 3
28877 The label_name shall resolve to denote a label; the statement with that
28878 label is the target statement.
28879
28880 _Legality Rules_
28881
28882 4
28883 The innermost sequence_of_statements that encloses the target statement
28884 shall also enclose the goto_statement. Furthermore, if a goto_statement
28885 is enclosed by an accept_statement or a body, then the target statement
28886 shall not be outside this enclosing construct.
28887
28888 4.a
28889 Ramification: The goto_statement can be a statement of an
28890 inner sequence_.
28891
28892 4.b
28893 It follows from the second rule that if the target statement
28894 is enclosed by such a construct, then the goto_statement
28895 cannot be outside.
28896
28897 _Dynamic Semantics_
28898
28899 5
28900 The execution of a goto_statement transfers control to the target
28901 statement, completing the execution of any compound_statement that
28902 encloses the goto_statement but does not enclose the target.
28903
28904 NOTES
28905
28906 6
28907 9 The above rules allow transfer of control to a statement of an
28908 enclosing sequence_of_statements but not the reverse. Similarly,
28909 they prohibit transfers of control such as between alternatives of
28910 a case_statement, if_statement, or select_statement; between
28911 exception_handlers; or from an exception_handler of a
28912 handled_sequence_of_statements back to its sequence_of_statements.
28913
28914 _Examples_
28915
28916 7
28917 Example of a loop containing a goto statement:
28918
28919 8
28920 <<Sort>>
28921 for I in 1 .. N-1 loop
28922 if A(I) > A(I+1) then
28923 Exchange(A(I), A(I+1));
28924 goto Sort;
28925 end if;
28926 end loop;
28927
28928 \1f
28929 File: aarm2012.info, Node: 6, Next: 7, Prev: 5, Up: Top
28930
28931 6 Subprograms
28932 *************
28933
28934 1
28935 A subprogram is a program unit or intrinsic operation whose execution is
28936 invoked by a subprogram call. There are two forms of subprogram:
28937 procedures and functions. A procedure call is a statement; a function
28938 call is an expression and returns a value. The definition of a
28939 subprogram can be given in two parts: a subprogram declaration defining
28940 its interface, and a subprogram_body defining its execution. [Operators
28941 and enumeration literals are functions.]
28942
28943 1.a
28944 To be honest: A function call is an expression, but more
28945 specifically it is a name.
28946
28947 1.b/2
28948 Glossary entry: A subprogram is a section of a program that
28949 can be executed in various contexts. It is invoked by a
28950 subprogram call that may qualify the effect of the subprogram
28951 through the passing of parameters. There are two forms of
28952 subprograms: functions, which return values, and procedures,
28953 which do not.
28954
28955 1.c/2
28956 Glossary entry: A function is a form of subprogram that
28957 returns a result and can be called as part of an expression.
28958
28959 1.d/2
28960 Glossary entry: A procedure is a form of subprogram that does
28961 not return a result and can only be called by a statement.
28962
28963 2/3
28964 {AI05-0299-1AI05-0299-1} A callable entity is a subprogram or entry (see
28965 Section 9). A callable entity is invoked by a call; that is, a
28966 subprogram call or entry call. A callable construct is a construct that
28967 defines the action of a call upon a callable entity: a subprogram_body,
28968 entry_body, or accept_statement.
28969
28970 2.a
28971 Ramification: Note that "callable entity" includes predefined
28972 operators, enumeration literals, and abstract subprograms.
28973 "Call" includes calls of these things. They do not have
28974 callable constructs, since they don't have completions.
28975
28976 * Menu:
28977
28978 * 6.1 :: Subprogram Declarations
28979 * 6.2 :: Formal Parameter Modes
28980 * 6.3 :: Subprogram Bodies
28981 * 6.4 :: Subprogram Calls
28982 * 6.5 :: Return Statements
28983 * 6.6 :: Overloading of Operators
28984 * 6.7 :: Null Procedures
28985 * 6.8 :: Expression Functions
28986
28987 \1f
28988 File: aarm2012.info, Node: 6.1, Next: 6.2, Up: 6
28989
28990 6.1 Subprogram Declarations
28991 ===========================
28992
28993 1
28994 [A subprogram_declaration declares a procedure or function.]
28995
28996 _Syntax_
28997
28998 2/3
28999 {AI95-00218-03AI95-00218-03} {AI05-0183-1AI05-0183-1}
29000 subprogram_declaration ::=
29001 [overriding_indicator]
29002 subprogram_specification
29003 [aspect_specification];
29004
29005 3/2
29006 This paragraph was deleted.{AI95-00348-01AI95-00348-01}
29007
29008 4/2
29009 {AI95-00348-01AI95-00348-01} subprogram_specification ::=
29010 procedure_specification
29011 | function_specification
29012
29013 4.1/2
29014 {AI95-00348-01AI95-00348-01} procedure_specification ::= procedure
29015 defining_program_unit_name parameter_profile
29016
29017 4.2/2
29018 {AI95-00348-01AI95-00348-01} function_specification ::= function
29019 defining_designator parameter_and_result_profile
29020
29021 5
29022 designator ::= [parent_unit_name . ]identifier | operator_symbol
29023
29024 6
29025 defining_designator ::= defining_program_unit_name |
29026 defining_operator_symbol
29027
29028 7
29029 defining_program_unit_name ::= [parent_unit_name . ]
29030 defining_identifier
29031
29032 8
29033 [The optional parent_unit_name is only allowed for library units
29034 (see *note 10.1.1::).]
29035
29036 9
29037 operator_symbol ::= string_literal
29038
29039 10/3
29040 {AI95-00395-01AI95-00395-01} {AI05-0299-1AI05-0299-1} The sequence
29041 of characters in an operator_symbol shall form a reserved word, a
29042 delimiter, or compound delimiter that corresponds to an operator
29043 belonging to one of the six categories of operators defined in
29044 subclause *note 4.5::.
29045
29046 10.a/3
29047 Reason: {AI95-00395-01AI95-00395-01} {AI05-0090-1AI05-0090-1}
29048 The "sequence of characters" of the string literal of the
29049 operator is a technical term (see *note 2.6::), and does not
29050 include the surrounding quote characters. As defined in *note
29051 2.2::, lexical elements are "formed" from a sequence of
29052 characters. Spaces are not allowed, and upper and lower case
29053 is not significant.
29054
29055 11
29056 defining_operator_symbol ::= operator_symbol
29057
29058 12
29059 parameter_profile ::= [formal_part]
29060
29061 13/2
29062 {AI95-00231-01AI95-00231-01} {AI95-00318-02AI95-00318-02}
29063 parameter_and_result_profile ::=
29064 [formal_part] return [null_exclusion] subtype_mark
29065 | [formal_part] return access_definition
29066
29067 14
29068 formal_part ::=
29069 (parameter_specification {; parameter_specification})
29070
29071 15/3
29072 {AI95-00231-01AI95-00231-01} {AI05-0142-4AI05-0142-4}
29073 parameter_specification ::=
29074 defining_identifier_list : [aliased] mode [null_exclusion]
29075 subtype_mark [:= default_expression]
29076 | defining_identifier_list : access_definition [:=
29077 default_expression]
29078
29079 16
29080 mode ::= [in] | in out | out
29081
29082 _Name Resolution Rules_
29083
29084 17
29085 A formal parameter is an object [directly visible within a
29086 subprogram_body] that represents the actual parameter passed to the
29087 subprogram in a call; it is declared by a parameter_specification. For
29088 a formal parameter, the expected type for its default_expression, if
29089 any, is that of the formal parameter.
29090
29091 _Legality Rules_
29092
29093 18/3
29094 {AI05-0143-1AI05-0143-1} The parameter mode of a formal parameter
29095 conveys the direction of information transfer with the actual parameter:
29096 in, in out, or out. Mode in is the default, and is the mode of a
29097 parameter defined by an access_definition.
29098
29099 18.a/3
29100 This paragraph was deleted.{AI05-0143-1AI05-0143-1}
29101
29102 19
29103 A default_expression is only allowed in a parameter_specification for a
29104 formal parameter of mode in.
29105
29106 20/3
29107 {AI95-00348-01AI95-00348-01} {AI05-0177-1AI05-0177-1}
29108 {AI05-0229-1AI05-0229-1} A subprogram_declaration or a
29109 generic_subprogram_declaration requires a completion [unless the Import
29110 aspect (see *note B.1::) is True for the declaration; the completion
29111 shall be a body or a renaming_declaration (see *note 8.5::)]. [A
29112 completion is not allowed for an abstract_subprogram_declaration (see
29113 *note 3.9.3::), a null_procedure_declaration (see *note 6.7::), or an
29114 expression_function_declaration (see *note 6.8::).]
29115
29116 20.a/3
29117 Ramification: {AI95-00348-01AI95-00348-01}
29118 {AI05-0177-1AI05-0177-1} Abstract subprograms , null
29119 procedures, and expression functions are not declared by
29120 subprogram_declarations, and so do not require completion
29121 (although the latter two can be completions). Protected
29122 subprograms are declared by subprogram_declarations, and so
29123 require completion. Note that an abstract subprogram is a
29124 subprogram, a null procedure is a subprogram, an expression
29125 function is a subprogram, and a protected subprogram is a
29126 subprogram, but a generic subprogram is not a subprogram.
29127
29128 20.b/3
29129 Proof: {AI05-0229-1AI05-0229-1} When the Import aspect is True
29130 for any entity, no completion is allowed (see *note B.1::).
29131
29132 21
29133 A name that denotes a formal parameter is not allowed within the
29134 formal_part in which it is declared, nor within the formal_part of a
29135 corresponding body or accept_statement.
29136
29137 21.a
29138 Ramification: By contrast,
29139 generic_formal_parameter_declarations are visible to
29140 subsequent declarations in the same generic_formal_part.
29141
29142 _Static Semantics_
29143
29144 22
29145 The profile of (a view of) a callable entity is either a
29146 parameter_profile or parameter_and_result_profile[; it embodies
29147 information about the interface to that entity -- for example, the
29148 profile includes information about parameters passed to the callable
29149 entity. All callable entities have a profile -- enumeration literals,
29150 other subprograms, and entries. An access-to-subprogram type has a
29151 designated profile.] Associated with a profile is a calling convention.
29152 A subprogram_declaration declares a procedure or a function, as
29153 indicated by the initial reserved word, with name and profile as given
29154 by its specification.
29155
29156 23/2
29157 {AI95-00231-01AI95-00231-01} {AI95-00318-02AI95-00318-02} The nominal
29158 subtype of a formal parameter is the subtype determined by the optional
29159 null_exclusion and the subtype_mark, or defined by the
29160 access_definition, in the parameter_specification. The nominal subtype
29161 of a function result is the subtype determined by the optional
29162 null_exclusion and the subtype_mark, or defined by the
29163 access_definition, in the parameter_and_result_profile.
29164
29165 23.1/3
29166 {AI05-0142-4AI05-0142-4} An explicitly aliased parameter is a formal
29167 parameter whose parameter_specification includes the reserved word
29168 aliased.
29169
29170 24/2
29171 {AI95-00231-01AI95-00231-01} {AI95-00254-01AI95-00254-01}
29172 {AI95-00318-02AI95-00318-02} An access parameter is a formal in
29173 parameter specified by an access_definition. An access result type is a
29174 function result type specified by an access_definition. An access
29175 parameter or result type is of an anonymous access type (see *note
29176 3.10::). [Access parameters of an access-to-object type allow
29177 dispatching calls to be controlled by access values. Access parameters
29178 of an access-to-subprogram type permit calls to subprograms passed as
29179 parameters irrespective of their accessibility level.]
29180
29181 24.a/2
29182 Discussion: {AI95-00318-02AI95-00318-02} Access result types
29183 have normal accessibility and thus don't have any special
29184 properties worth noting here.
29185
29186 25
29187 The subtypes of a profile are:
29188
29189 26
29190 * For any non-access parameters, the nominal subtype of the
29191 parameter.
29192
29193 27/2
29194 * {AI95-00254-01AI95-00254-01} For any access parameters of an
29195 access-to-object type, the designated subtype of the parameter
29196 type.
29197
29198 27.1/3
29199 * {AI95-00254-01AI95-00254-01} {AI05-0164-1AI05-0164-1} For any
29200 access parameters of an access-to-subprogram type, the subtypes of
29201 the designated profile of the parameter type.
29202
29203 28/2
29204 * {AI95-00231-01AI95-00231-01} {AI95-00318-02AI95-00318-02} For any
29205 non-access result, the nominal subtype of the function result.
29206
29207 28.1/2
29208 * {AI95-00318-02AI95-00318-02} For any access result type of an
29209 access-to-object type, the designated subtype of the result type.
29210
29211 28.2/3
29212 * {AI95-00318-02AI95-00318-02} {AI05-0164-1AI05-0164-1} For any
29213 access result type of an access-to-subprogram type, the subtypes of
29214 the designated profile of the result type.
29215
29216 29
29217 [ The types of a profile are the types of those subtypes.]
29218
29219 30/3
29220 {AI95-00348-01AI95-00348-01} {AI05-0177-1AI05-0177-1} [A subprogram
29221 declared by an abstract_subprogram_declaration is abstract; a subprogram
29222 declared by a subprogram_declaration is not. See *note 3.9.3::, "*note
29223 3.9.3:: Abstract Types and Subprograms". Similarly, a procedure
29224 declared by a null_procedure_declaration is a null procedure; a
29225 procedure declared by a subprogram_declaration is not. See *note 6.7::,
29226 "*note 6.7:: Null Procedures". Finally, a function declared by an
29227 expression_function_declaration is an expression function; a function
29228 declared by a subprogram_declaration is not. See *note 6.8::, "*note
29229 6.8:: Expression Functions".]
29230
29231 30.1/2
29232 {AI95-00218-03AI95-00218-03} [An overriding_indicator is used to
29233 indicate whether overriding is intended. See *note 8.3.1::, "*note
29234 8.3.1:: Overriding Indicators".]
29235
29236 _Dynamic Semantics_
29237
29238 31/2
29239 {AI95-00348-01AI95-00348-01} The elaboration of a subprogram_declaration
29240 has no effect.
29241
29242 NOTES
29243
29244 32
29245 1 A parameter_specification with several identifiers is equivalent
29246 to a sequence of single parameter_specifications, as explained in
29247 *note 3.3::.
29248
29249 33
29250 2 Abstract subprograms do not have bodies, and cannot be used in a
29251 nondispatching call (see *note 3.9.3::, "*note 3.9.3:: Abstract
29252 Types and Subprograms").
29253
29254 34
29255 3 The evaluation of default_expressions is caused by certain
29256 calls, as described in *note 6.4.1::. They are not evaluated
29257 during the elaboration of the subprogram declaration.
29258
29259 35
29260 4 Subprograms can be called recursively and can be called
29261 concurrently from multiple tasks.
29262
29263 _Examples_
29264
29265 36
29266 Examples of subprogram declarations:
29267
29268 37
29269 procedure Traverse_Tree;
29270 procedure Increment(X : in out Integer);
29271 procedure Right_Indent(Margin : out Line_Size); -- see *note 3.5.4::
29272 procedure Switch(From, To : in out Link); -- see *note 3.10.1::
29273
29274 38
29275 function Random return Probability; -- see *note 3.5.7::
29276
29277 39
29278 function Min_Cell(X : Link) return Cell; -- see *note 3.10.1::
29279 function Next_Frame(K : Positive) return Frame; -- see *note 3.10::
29280 function Dot_Product(Left, Right : Vector) return Real; -- see *note 3.6::
29281
29282 40
29283 function "*"(Left, Right : Matrix) return Matrix; -- see *note 3.6::
29284
29285 41
29286 Examples of in parameters with default expressions:
29287
29288 42
29289 procedure Print_Header(Pages : in Natural;
29290 Header : in Line := (1 .. Line'Last => ' '); -- see *note 3.6::
29291 Center : in Boolean := True);
29292
29293 _Extensions to Ada 83_
29294
29295 42.a
29296 The syntax for abstract_subprogram_declaration is added. The
29297 syntax for parameter_specification is revised to allow for
29298 access parameters (see *note 3.10::)
29299
29300 42.b/3
29301 {AI05-0299-1AI05-0299-1} Program units that are library units
29302 may have a parent_unit_name to indicate the parent of a child
29303 (see *note 10.1.1::).
29304
29305 _Wording Changes from Ada 83_
29306
29307 42.c
29308 We have incorporated the rules from RM83-6.5, "Function
29309 Subprograms" here and in *note 6.3::, "*note 6.3:: Subprogram
29310 Bodies"
29311
29312 42.d
29313 We have incorporated the definitions of RM83-6.6, "Parameter
29314 and Result Type Profile - Overloading of Subprograms" here.
29315
29316 42.e
29317 The syntax rule for defining_operator_symbol is new. It is
29318 used for the defining occurrence of an operator_symbol,
29319 analogously to defining_identifier. Usage occurrences use the
29320 direct_name or selector_name syntactic categories. The syntax
29321 rules for defining_designator and defining_program_unit_name
29322 are new.
29323
29324 _Extensions to Ada 95_
29325
29326 42.f/2
29327 {AI95-00218-03AI95-00218-03} Subprograms now allow
29328 overriding_indicators for better error checking of overriding.
29329
29330 42.g/2
29331 {AI95-00231-01AI95-00231-01} An optional null_exclusion can be
29332 used in a formal parameter declaration. Similarly, an
29333 optional null_exclusion can be used in a function result.
29334
29335 42.h/2
29336 {AI95-00318-02AI95-00318-02} The return type of a function can
29337 be an anonymous access type.
29338
29339 _Wording Changes from Ada 95_
29340
29341 42.i/2
29342 {AI95-00254-01AI95-00254-01} A description of the purpose of
29343 anonymous access-to-subprogram parameters and the definition
29344 of the profile of subprograms containing them was added.
29345
29346 42.j/2
29347 {AI95-00348-01AI95-00348-01} Split the production for
29348 subprogram_specification in order to make the declaration of
29349 null procedures (see *note 6.7::) easier.
29350
29351 42.k/2
29352 {AI95-00348-01AI95-00348-01} Moved the Syntax and Dynamic
29353 Semantics for abstract_subprogram_declaration to *note
29354 3.9.3::, so that the syntax and semantics are together. This
29355 also keeps abstract and null subprograms similar.
29356
29357 42.l/2
29358 {AI95-00395-01AI95-00395-01} Revised to allow other_format
29359 characters in operator_symbols in the same way as the
29360 underlying constructs.
29361
29362 _Extensions to Ada 2005_
29363
29364 42.m/3
29365 {AI05-0142-4AI05-0142-4} Parameters can now be explicitly
29366 aliased, allowing parts of function results to designate
29367 parameters and forcing by-reference parameter passing.
29368
29369 42.n/3
29370 {AI05-0143-1AI05-0143-1} The parameters of a function can now
29371 have any mode.
29372
29373 42.o/3
29374 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
29375 be used in a subprogram_declaration. This is described in
29376 *note 13.1.1::.
29377
29378 _Wording Changes from Ada 2005_
29379
29380 42.p/3
29381 {AI05-0177-1AI05-0177-1} Added expression functions (see *note
29382 6.8::) to the wording.
29383
29384 * Menu:
29385
29386 * 6.1.1 :: Preconditions and Postconditions
29387
29388 \1f
29389 File: aarm2012.info, Node: 6.1.1, Up: 6.1
29390
29391 6.1.1 Preconditions and Postconditions
29392 --------------------------------------
29393
29394 1/3
29395 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1} For a subprogram or
29396 entry, the following language-defined aspects may be specified with an
29397 aspect_specification (see *note 13.1.1::):
29398
29399 2/3
29400 Pre
29401 This aspect specifies a specific precondition for a
29402 callable entity; it shall be specified by an expression,
29403 called a specific precondition expression. If not
29404 specified for an entity, the specific precondition
29405 expression for the entity is the enumeration literal
29406 True.
29407
29408 2.a/3
29409 To be honest: In this and the following rules, we are talking
29410 about the enumeration literal True declared in package
29411 Standard (see *note A.1::), and not some other value or
29412 identifier True. That matters as some rules depend on full
29413 conformance of these expressions, which depends on the
29414 specific declarations involved.
29415
29416 2.b/3
29417 Aspect Description for Pre: Precondition; a condition that
29418 must hold true before a call.
29419
29420 3/3
29421 {AI05-0254-1AI05-0254-1} {AI05-0262-1AI05-0262-1} Pre'Class
29422 This aspect specifies a class-wide precondition for an
29423 operation of a tagged type and its descendants; it shall
29424 be specified by an expression, called a class-wide
29425 precondition expression. If not specified for an entity,
29426 then if no other class-wide precondition applies to the
29427 entity, the class-wide precondition expression for the
29428 entity is the enumeration literal True.
29429
29430 3.a/3
29431 Ramification: {AI05-0254-1AI05-0254-1} If other class-wide
29432 preconditions apply to the entity and no class-wide
29433 precondition is specified, no class-wide precondition is
29434 defined for the entity; of course, the class-wide
29435 preconditions (of ancestors) that apply are still going to be
29436 checked. We need subprograms that don't have ancestors and
29437 don't specify a class-wide precondition to have a class-wide
29438 precondition of True, so that adding such a precondition to a
29439 descendant has no effect (necessary as a dispatching call
29440 through the root routine would not check any precondition).
29441
29442 3.b/3
29443 Aspect Description for Pre'Class: Precondition inherited on
29444 type derivation.
29445
29446 4/3
29447 Post
29448 This aspect specifies a specific postcondition for a
29449 callable entity; it shall be specified by an expression,
29450 called a specific postcondition expression. If not
29451 specified for an entity, the specific postcondition
29452 expression for the entity is the enumeration literal
29453 True.
29454
29455 4.a/3
29456 Aspect Description for Post: Postcondition; a condition that
29457 must hold true after a call.
29458
29459 5/3
29460 {AI05-0262-1AI05-0262-1} Post'Class
29461 This aspect specifies a class-wide postcondition for an
29462 operation of a tagged type and its descendants; it shall
29463 be specified by an expression, called a class-wide
29464 postcondition expression. If not specified for an
29465 entity, the class-wide postcondition expression for the
29466 entity is the enumeration literal True.
29467
29468 5.a/3
29469 Aspect Description for Post'Class: Postcondition inherited on
29470 type derivation.
29471
29472 _Name Resolution Rules_
29473
29474 6/3
29475 {AI05-0145-2AI05-0145-2} The expected type for a precondition or
29476 postcondition expression is any boolean type.
29477
29478 7/3
29479 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1} Within the expression
29480 for a Pre'Class or Post'Class aspect for a primitive subprogram of a
29481 tagged type T, a name that denotes a formal parameter of type T is
29482 interpreted as having type T'Class. Similarly, a name that denotes a
29483 formal access parameter of type access-to-T is interpreted as having
29484 type access-to-T'Class. [This ensures that the expression is
29485 well-defined for a primitive subprogram of a type descended from T.]
29486
29487 8/3
29488 {AI05-0145-2AI05-0145-2} {AI05-0264-1AI05-0264-1} For an
29489 attribute_reference with attribute_designator Old, if the attribute
29490 reference has an expected type or shall resolve to a given type, the
29491 same applies to the prefix; otherwise, the prefix shall be resolved
29492 independently of context.
29493
29494 _Legality Rules_
29495
29496 9/3
29497 {AI05-0145-2AI05-0145-2} {AI05-0230-1AI05-0230-1} The Pre or Post aspect
29498 shall not be specified for an abstract subprogram or a null procedure.
29499 [Only the Pre'Class and Post'Class aspects may be specified for such a
29500 subprogram.]
29501
29502 9.a/3
29503 Discussion: {AI05-0183-1AI05-0183-1} Pre'Class and Post'Class
29504 can only be specified on primitive routines of tagged types,
29505 by a blanket rule found in *note 13.1.1::.
29506
29507 10/3
29508 {AI05-0247-1AI05-0247-1} {AI05-0254-1AI05-0254-1} If a type T has an
29509 implicitly declared subprogram P inherited from a parent type T1 and a
29510 homograph (see *note 8.3::) of P from a progenitor type T2, and
29511
29512 11/3
29513 * the corresponding primitive subprogram P1 of type T1 is neither
29514 null nor abstract; and
29515
29516 12/3
29517 * the class-wide precondition expression True does not apply to P1
29518 (implicitly or explicitly); and
29519
29520 13/3
29521 * there is a class-wide precondition expression that applies to the
29522 corresponding primitive subprogram P2 of T2 that does not fully
29523 conform to any class-wide precondition expression that applies to
29524 P1,
29525
29526 14/3
29527 {AI05-0247-1AI05-0247-1} {AI05-0254-1AI05-0254-1} then:
29528
29529 15/3
29530 * If the type T is abstract, the implicitly declared subprogram P is
29531 abstract.
29532
29533 16/3
29534 * Otherwise, the subprogram P requires overriding and shall be
29535 overridden with a nonabstract subprogram.
29536
29537 16.a/3
29538 Discussion: We use the term "requires overriding" here so that
29539 this rule is taken into account when calculating visibility in
29540 *note 8.3::; otherwise we would have a mess when this routine
29541 is overridden.
29542
29543 16.b/3
29544 Reason: Such an inherited subprogram would necessarily violate
29545 the Liskov Substitutability Principle (LSP) if called via a
29546 dispatching call from an ancestor other than the one that
29547 provides the called body. In such a case, the class-wide
29548 precondition of the actual body is stronger than the
29549 class-wide precondition of the ancestor. If we did not
29550 enforce that precondition for the body, the body could be
29551 called when the precondition it knows about is False -- such
29552 "counterfeiting" of preconditions has to be avoided. But
29553 enforcing the precondition violates LSP. We do not want the
29554 language to be implicitly creating bodies that violate LSP;
29555 the programmer can still write an explicit body that calls the
29556 appropriate parent subprogram. In that case, the violation of
29557 LSP is explicitly in the code and obvious to code reviewers
29558 (both human and automated).
29559
29560 16.c/3
29561 We have to say that the subprogram is abstract for an abstract
29562 type in this case, so that the next concrete type has to
29563 override it for the reasons above. Otherwise, inserting an
29564 extra level of abstract types would eliminate the requirement
29565 to override (as there is only one declared operation for the
29566 concrete type), and that would be bad for the reasons given
29567 above.
29568
29569 16.d/3
29570 Ramification: This requires the set of class-wide
29571 preconditions that apply to the interface routine to be
29572 strictly stronger than those that apply to the concrete
29573 routine. Since full conformance requires each name to denote
29574 the same declaration, it is unlikely that independently
29575 declared preconditions would conform. This rule does allow
29576 "diamond inheritance" of preconditions, and of course no
29577 preconditions at all match.
29578
29579 16.e/3
29580 We considered adopting a rule that would allow examples where
29581 the expressions would conform after all inheritance has been
29582 applied, but this is complex and is not likely to be common in
29583 practice. Since the penalty here is just that an explicit
29584 overriding is required, the complexity is too much.
29585
29586 17/3
29587 {AI05-0247-1AI05-0247-1} If a renaming of a subprogram or entry S1
29588 overrides an inherited subprogram S2, then the overriding is illegal
29589 unless each class-wide precondition expression that applies to S1 fully
29590 conforms to some class-wide precondition expression that applies to S2
29591 and each class-wide precondition expression that applies to S2 fully
29592 conforms to some class-wide precondition expression that applies to S1.
29593
29594 17.a/3
29595 Reason: Such an overriding subprogram would violate LSP, as
29596 the precondition of S1 would usually be different (and thus
29597 stronger) than the one known to a dispatching call through an
29598 ancestor routine of S2. This is always OK if the
29599 preconditions match, so we always allow that.
29600
29601 17.b/3
29602 Ramification: This only applies to primitives of tagged types;
29603 other routines cannot have class-wide preconditions.
29604
29605 _Static Semantics_
29606
29607 18/3
29608 {AI05-0145-2AI05-0145-2} If a Pre'Class or Post'Class aspect is
29609 specified for a primitive subprogram of a tagged type T, then the
29610 associated expression also applies to the corresponding primitive
29611 subprogram of each descendant of T.
29612
29613 19/3
29614 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1}
29615 {AI05-0290-1AI05-0290-1} If performing checks is required by the Pre,
29616 Pre'Class, Post, or Post'Class assertion policies (see *note 11.4.2::)
29617 in effect at the point of a corresponding aspect specification
29618 applicable to a given subprogram or entry, then the respective
29619 precondition or postcondition expressions are considered enabled.
29620
29621 19.a/3
29622 Ramification: {AI05-0290-1AI05-0290-1} If a class-wide
29623 precondition or postcondition expression is enabled, it
29624 remains enabled when inherited by an overriding subprogram,
29625 even if the policy in effect is Ignore for the inheriting
29626 subprogram.
29627
29628 20/3
29629 {AI05-0273-1AI05-0273-1} An expression is potentially unevaluated if it
29630 occurs within:
29631
29632 21/3
29633 * any part of an if_expression other than the first condition;
29634
29635 22/3
29636 * a dependent_expression of a case_expression;
29637
29638 23/3
29639 * the right operand of a short-circuit control form; or
29640
29641 24/3
29642 * a membership_choice other than the first of a membership operation.
29643
29644 25/3
29645 {AI05-0145-2AI05-0145-2} For a prefix X that denotes an object of a
29646 nonlimited type, the following attribute is defined:
29647
29648 26/3
29649 X'Old
29650 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1}
29651 {AI05-0273-1AI05-0273-1} For each X'Old in a
29652 postcondition expression that is enabled, a constant is
29653 implicitly declared at the beginning of the subprogram or
29654 entry. The constant is of the type of X and is
29655 initialized to the result of evaluating X (as an
29656 expression) at the point of the constant declaration.
29657 The value of X'Old in the postcondition expression is the
29658 value of this constant; the type of X'Old is the type of
29659 X. These implicit constant declarations occur in an
29660 arbitrary order.
29661
29662 27/3
29663 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1}
29664 {AI05-0273-1AI05-0273-1} Reference to this attribute is
29665 only allowed within a postcondition expression. The
29666 prefix of an Old attribute_reference shall not contain a
29667 Result attribute_reference, nor an Old
29668 attribute_reference, nor a use of an entity declared
29669 within the postcondition expression but not within prefix
29670 itself (for example, the loop parameter of an enclosing
29671 quantified_expression). The prefix of an Old
29672 attribute_reference that is potentially unevaluated shall
29673 statically denote an entity.
29674
29675 27.a/3
29676 Discussion: The prefix X can be any nonlimited object that
29677 obeys the syntax for prefix other than the few exceptions
29678 given above (discussed below). Useful cases are: the name of
29679 a formal parameter of mode [in] out, the name of a global
29680 variable updated by the subprogram, a function call passing
29681 those as parameters, a subcomponent of those things, etc.
29682
29683 27.b/3
29684 A qualified expression can be used to make an arbitrary
29685 expression into a valid prefix, so T'(X + Y)'Old is legal,
29686 even though (X + Y)'Old is not. The value being saved here is
29687 the sum of X and Y (a function result is an object). Of
29688 course, in this case "+"(X, Y)'Old is also legal, but the
29689 qualified expression is arguably more readable.
29690
29691 27.c/3
29692 Note that F(X)'Old and F(X'Old) are not necessarily equal.
29693 The former calls F(X) and saves that value for later use
29694 during the postcondition. The latter saves the value of X,
29695 and during the postcondition, passes that saved value to F. In
29696 most cases, the former is what one wants (but it is not always
29697 legal, see below).
29698
29699 27.d/3
29700 If X has controlled parts, adjustment and finalization are
29701 implied by the implicit constant declaration.
29702
29703 27.e/3
29704 If postconditions are disabled, we want the compiler to avoid
29705 any overhead associated with saving 'Old values.
29706
29707 27.f/3
29708 'Old makes no sense for limited types, because its
29709 implementation involves copying. It might make semantic sense
29710 to allow build-in-place, but it's not worth the trouble.
29711
29712 27.g/3
29713 Reason: {AI05-0273-1AI05-0273-1} Since the prefix is evaluated
29714 unconditionally when the subprogram is called, we cannot allow
29715 it to include values that do not exist at that time (like
29716 'Result and loop parameters of quantified_expressions). We
29717 also do not allow it to include 'Old references, as those
29718 would be redundant (the entire prefix is evaluated when the
29719 subprogram is called), and allowing them would require some
29720 sort of order to the implicit constant declarations (because
29721 in A(I'Old)'Old, we surely would want the value of I'Old
29722 evaluated before the A(I'Old) is evaluated).
29723
29724 27.h/3
29725 {AI05-0273-1AI05-0273-1} In addition, we only allow simple
29726 names as the prefix of the Old attribute if the
29727 attribute_reference might not be evaluated when the
29728 postcondition expression is evaluated. This is necessary
29729 because the Old prefixes have to be unconditionally evaluated
29730 when the subprogram is called; the compiler cannot in general
29731 know whether they will be needed in the postcondition
29732 expression. To see the problem, consider:
29733
29734 27.i/3
29735 Table : array (1..10) of Integer := ...
29736 procedure Bar (I : in out Natural)
29737 with Post => I > 0 and then Table(I)'Old = 1; -- Illegal
29738
29739 27.j/3
29740 In this example, the compiler cannot know the value of I when
29741 the subprogram returns (since the subprogram execution can
29742 change it), and thus it does not know whether Table(I)'Old
29743 will be needed then. Thus it has to always create an implicit
29744 constant and evaluate Table(I) when Bar is called (because not
29745 having the value when it is needed is not acceptable). But if
29746 I = 0 when the subprogram is called, that evaluation will
29747 raise Constraint_Error, and that will happen even if I is
29748 unchanged by the subprogram and the value of Table(I)'Old is
29749 not ultimately needed. It's easy to see how a similar problem
29750 could occur for a dereference of an access type. This would
29751 be mystifying (since the point of the short circuit is to
29752 eliminate this possibility, but it cannot do so). Therefore,
29753 we require the prefix of any Old attribute in such a context
29754 to statically denote an object, which eliminates anything that
29755 could change at during execution.
29756
29757 27.k/3
29758 It is easy to work around most errors that occur because of
29759 this rule. Just move the 'Old to the outer object, before any
29760 indexing, dereferences, or components. (That does not work
29761 for function calls, however, nor does it work for array
29762 indexing if the index can change during the execution of the
29763 subprogram.)
29764
29765 28/3
29766 {AI05-0145-2AI05-0145-2} For a prefix F that denotes a function
29767 declaration, the following attribute is defined:
29768
29769 29/3
29770 F'Result
29771 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1} Within
29772 a postcondition expression for function F, denotes the
29773 result object of the function. The type of this
29774 attribute is that of the function result except within a
29775 Post'Class postcondition expression for a function with a
29776 controlling result or with a controlling access result.
29777 For a controlling result, the type of the attribute is
29778 T'Class, where T is the function result type. For a
29779 controlling access result, the type of the attribute is
29780 an anonymous access type whose designated type is
29781 T'Class, where T is the designated type of the function
29782 result type.
29783
29784 30/3
29785 {AI05-0262-1AI05-0262-1} Use of this attribute is allowed
29786 only within a postcondition expression for F.
29787
29788 _Dynamic Semantics_
29789
29790 31/3
29791 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29792 {AI05-0290-1AI05-0290-1} Upon a call of the subprogram or entry, after
29793 evaluating any actual parameters, precondition checks are performed as
29794 follows:
29795
29796 32/3
29797 * The specific precondition check begins with the evaluation of the
29798 specific precondition expression that applies to the subprogram or
29799 entry, if it is enabled; if the expression evaluates to False,
29800 Assertions.Assertion_Error is raised; if the expression is not
29801 enabled, the check succeeds.
29802
29803 33/3
29804 * The class-wide precondition check begins with the evaluation of any
29805 enabled class-wide precondition expressions that apply to the
29806 subprogram or entry. If and only if all the class-wide
29807 precondition expressions evaluate to False,
29808 Assertions.Assertion_Error is raised.
29809
29810 33.a/3
29811 Ramification: The class-wide precondition expressions of the
29812 entity itself as well as those of any parent or progenitor
29813 operations are evaluated, as these expressions apply to the
29814 corresponding operations of all descendants.
29815
29816 33.b/3
29817 Class-wide precondition checks are performed for all
29818 appropriate calls, but only enabled precondition expressions
29819 are evaluated. Thus, the check would be trivial if no
29820 precondition expressions are enabled.
29821
29822 34/3
29823 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29824 {AI05-0254-1AI05-0254-1} {AI05-0269-1AI05-0269-1} The precondition
29825 checks are performed in an arbitrary order, and if any of the class-wide
29826 precondition expressions evaluate to True, it is not specified whether
29827 the other class-wide precondition expressions are evaluated. The
29828 precondition checks and any check for elaboration of the subprogram body
29829 are performed in an arbitrary order. It is not specified whether in a
29830 call on a protected operation, the checks are performed before or after
29831 starting the protected action. For an entry call, the checks are
29832 performed prior to checking whether the entry is open.
29833
29834 34.a/3
29835 Reason: We need to explicitly allow short-circuiting of the
29836 evaluation of the class-wide precondition check if any
29837 expression fails, as it consists of multiple expressions; we
29838 don't need a similar permission for the specific precondition
29839 check as it consists only of a single expression. Nothing is
29840 evaluated for the call after a check fails, as the failed
29841 check propagates an exception.
29842
29843 35/3
29844 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29845 {AI05-0254-1AI05-0254-1} {AI05-0262-1AI05-0262-1}
29846 {AI05-0290-1AI05-0290-1} Upon successful return from a call of the
29847 subprogram or entry, prior to copying back any by-copy in out or out
29848 parameters, the postcondition check is performed. This consists of the
29849 evaluation of any enabled specific and class-wide postcondition
29850 expressions that apply to the subprogram or entry. If any of the
29851 postcondition expressions evaluate to False, then
29852 Assertions.Assertion_Error is raised. The postcondition expressions are
29853 evaluated in an arbitrary order, and if any postcondition expression
29854 evaluates to False, it is not specified whether any other postcondition
29855 expressions are evaluated. The postcondition check, and any constraint
29856 or predicate checks associated with in out or out parameters are
29857 performed in an arbitrary order.
29858
29859 35.a/3
29860 Ramification: The class-wide postcondition expressions of the
29861 entity itself as well as those of any parent or progenitor
29862 operations are evaluated, as these apply to all descendants;
29863 in contrast, only the specific postcondition of the entity
29864 applies. Postconditions can always be evaluated inside the
29865 invoked body.
29866
29867 36/3
29868 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1} If a precondition or
29869 postcondition check fails, the exception is raised at the point of the
29870 call[; the exception cannot be handled inside the called subprogram or
29871 entry]. Similarly, any exception raised by the evaluation of a
29872 precondition or postcondition expression is raised at the point of call.
29873
29874 37/3
29875 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29876 {AI05-0254-1AI05-0254-1} {AI05-0262-1AI05-0262-1} For any subprogram or
29877 entry call (including dispatching calls), the checks that are performed
29878 to verify specific precondition expressions and specific and class-wide
29879 postcondition expressions are determined by those for the subprogram or
29880 entry actually invoked. Note that the class-wide postcondition
29881 expressions verified by the postcondition check that is part of a call
29882 on a primitive subprogram of type T includes all class-wide
29883 postcondition expressions originating in any progenitor of T[, even if
29884 the primitive subprogram called is inherited from a type T1 and some of
29885 the postcondition expressions do not apply to the corresponding
29886 primitive subprogram of T1].
29887
29888 37.a/3
29889 Ramification: This applies to access-to-subprogram calls,
29890 dispatching calls, and to statically bound calls. We need
29891 this rule to cover statically bound calls as well, as specific
29892 pre- and postconditions are not inherited, but the subprogram
29893 might be.
29894
29895 37.b/3
29896 For concrete subprograms, we require the original specific
29897 postcondition to be evaluated as well as the inherited
29898 class-wide postconditions in order that the semantics of an
29899 explicitly defined wrapper that does nothing but call the
29900 original subprogram is the same as that of an inherited
29901 subprogram.
29902
29903 37.c/3
29904 Note that this rule does not apply to class-wide
29905 preconditions; they have their own rules mentioned below.
29906
29907 38/3
29908 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29909 {AI05-0254-1AI05-0254-1} The class-wide precondition check for a call to
29910 a subprogram or entry consists solely of checking the class-wide
29911 precondition expressions that apply to the denoted callable entity (not
29912 necessarily the one that is invoked).
29913
29914 38.a/3
29915 Ramification: For a dispatching call, we are talking about the
29916 Pre'Class(es) that apply to the subprogram that the
29917 dispatching call is resolving to, not the Pre'Class(es) for
29918 the subprogram that is ultimately dispatched to. The
29919 class-wide precondition of the resolved call is necessarily
29920 the same or stronger than that of the invoked call. For a
29921 statically bound call, these are the same; for an
29922 access-to-subprogram, (which has no class-wide preconditions
29923 of its own), we check the class-wide preconditions of the
29924 invoked routine.
29925
29926 38.b/3
29927 Implementation Note: These rules imply that logically,
29928 class-wide preconditions of routines must be checked at the
29929 point of call (other than for access-to-subprogram calls,
29930 which must be checked in the body, probably using a wrapper).
29931 Specific preconditions that might be called with a dispatching
29932 call or via an access-to-subprogram value must be checked
29933 inside of the subprogram body. In contrast, the postcondition
29934 checks always need to be checked inside the body of the
29935 routine. Of course, an implementation can evaluate all of
29936 these at the point of call for statically bound calls if the
29937 implementation uses wrappers for dispatching bodies and for
29938 'Access values.
29939
29940 38.c/3
29941 There is no requirement for an implementation to generate
29942 special code for routines that are imported from outside of
29943 the Ada program. That's because there is a requirement on the
29944 programmer that the use of interfacing aspects do not violate
29945 Ada semantics (see B.1). That includes making pre- and
29946 postcondition checks. For instance, if the implementation
29947 expects routines to make their own postcondition checks in the
29948 body before returning, C code can be assumed to do this (even
29949 though that is highly unlikely). That's even though the
29950 formal definition of those checks is that they are evaluated
29951 at the call site. Note that pre- and postconditions can be
29952 very useful for verification tools (even if they aren't
29953 checked), because they tell the tool about the expectations on
29954 the foreign code that it most likely cannot analyze.
29955
29956 39/3
29957 {AI05-0145-2AI05-0145-2} {AI05-0247-1AI05-0247-1}
29958 {AI05-0254-1AI05-0254-1} For a call via an access-to-subprogram value,
29959 all precondition and postcondition checks performed are determined by
29960 the subprogram or entry denoted by the prefix of the Access attribute
29961 reference that produced the value.
29962
29963 NOTES
29964
29965 40/3
29966 5 {AI05-0145-2AI05-0145-2} {AI05-0262-1AI05-0262-1} A precondition
29967 is checked just before the call. If another task can change any
29968 value that the precondition expression depends on, the precondition
29969 need not hold within the subprogram or entry body.
29970
29971 _Extensions to Ada 2005_
29972
29973 40.a/3
29974 {AI05-0145-2AI05-0145-2} {AI05-0230-1AI05-0230-1}
29975 {AI05-0247-1AI05-0247-1} {AI05-0254-1AI05-0254-1}
29976 {AI05-0262-1AI05-0262-1} {AI05-0273-1AI05-0273-1}
29977 {AI05-0274-1AI05-0274-1} Pre and Post aspects are new.
29978
29979 \1f
29980 File: aarm2012.info, Node: 6.2, Next: 6.3, Prev: 6.1, Up: 6
29981
29982 6.2 Formal Parameter Modes
29983 ==========================
29984
29985 1
29986 [A parameter_specification declares a formal parameter of mode in, in
29987 out, or out.]
29988
29989 _Static Semantics_
29990
29991 2
29992 A parameter is passed either by copy or by reference. [When a parameter
29993 is passed by copy, the formal parameter denotes a separate object from
29994 the actual parameter, and any information transfer between the two
29995 occurs only before and after executing the subprogram. When a parameter
29996 is passed by reference, the formal parameter denotes (a view of) the
29997 object denoted by the actual parameter; reads and updates of the formal
29998 parameter directly reference the actual parameter object.]
29999
30000 3/3
30001 {AI05-0142-4AI05-0142-4} {AI05-0262-1AI05-0262-1} A type is a by-copy
30002 type if it is an elementary type, or if it is a descendant of a private
30003 type whose full type is a by-copy type. A parameter of a by-copy type
30004 is passed by copy, unless the formal parameter is explicitly aliased.
30005
30006 4
30007 A type is a by-reference type if it is a descendant of one of the
30008 following:
30009
30010 5
30011 * a tagged type;
30012
30013 6
30014 * a task or protected type;
30015
30016 7/3
30017 * {AI05-0096-1AI05-0096-1} an explicitly limited record type;
30018
30019 7.a/3
30020 This paragraph was deleted.{AI05-0096-1AI05-0096-1}
30021
30022 8
30023 * a composite type with a subcomponent of a by-reference type;
30024
30025 9
30026 * a private type whose full type is a by-reference type.
30027
30028 10/3
30029 {AI05-0142-4AI05-0142-4} {AI05-0188-1AI05-0188-1} A parameter of a
30030 by-reference type is passed by reference, as is an explicitly aliased
30031 parameter of any type. Each value of a by-reference type has an
30032 associated object. For a parenthesized expression,
30033 qualified_expression, or type_conversion, this object is the one
30034 associated with the operand. For a conditional_expression, this object
30035 is the one associated with the evaluated dependent_expression.
30036
30037 10.a
30038 Ramification: By-reference parameter passing makes sense only
30039 if there is an object to reference; hence, we define such an
30040 object for each case.
30041
30042 10.b
30043 Since tagged types are by-reference types, this implies that
30044 every value of a tagged type has an associated object. This
30045 simplifies things, because we can define the tag to be a
30046 property of the object, and not of the value of the object,
30047 which makes it clearer that object tags never change.
30048
30049 10.c
30050 We considered simplifying things even more by making every
30051 value (and therefore every expression) have an associated
30052 object. After all, there is little semantic difference
30053 between a constant object and a value. However, this would
30054 cause problems for untagged types. In particular, we would
30055 have to do a constraint check on every read of a type
30056 conversion (or a renaming thereof) in certain cases.
30057
30058 10.d/2
30059 {AI95-00318-02AI95-00318-02} We do not want this definition to
30060 depend on the view of the type; privateness is essentially
30061 ignored for this definition. Otherwise, things would be
30062 confusing (does the rule apply at the call site, at the site
30063 of the declaration of the subprogram, at the site of the
30064 return statement?), and requiring different calls to use
30065 different mechanisms would be an implementation burden.
30066
30067 10.e
30068 *note C.6::, "*note C.6:: Shared Variable Control" says that a
30069 composite type with an atomic or volatile subcomponent is a
30070 by-reference type, among other things.
30071
30072 10.f
30073 Every value of a limited by-reference type is the value of one
30074 and only one limited object. The associated object of a value
30075 of a limited by-reference type is the object whose value it
30076 represents. Two values of a limited by-reference type are the
30077 same if and only if they represent the value of the same
30078 object.
30079
30080 10.g
30081 We say "by-reference" above because these statements are not
30082 always true for limited private types whose underlying type is
30083 nonlimited (unfortunately).
30084
30085 11/3
30086 {AI05-0240-1AI05-0240-1} For other parameters, it is unspecified whether
30087 the parameter is passed by copy or by reference.
30088
30089 11.a/3
30090 Discussion: {AI05-0005-1AI05-0005-1} There is no need to
30091 incorporate the discussion of AI83-00178, which requires
30092 pass-by-copy for certain kinds of actual parameters, while
30093 allowing pass-by-reference for others. This is because we
30094 explicitly indicate that a function creates an anonymous
30095 constant object for its result (see *note 6.5::). We also
30096 provide a special dispensation for instances of
30097 Unchecked_Conversion to return by reference (see *note
30098 13.9::).
30099
30100 _Bounded (Run-Time) Errors_
30101
30102 12/3
30103 {AI05-0240-1AI05-0240-1} If one name denotes a part of a formal
30104 parameter, and a second name denotes a part of a distinct formal
30105 parameter or an object that is not part of a formal parameter, then the
30106 two names are considered distinct access paths. If an object is of a
30107 type for which the parameter passing mechanism is not specified and is
30108 not an explicitly aliased parameter, then it is a bounded error to
30109 assign to the object via one access path, and then read the value of the
30110 object via a distinct access path, unless the first access path denotes
30111 a part of a formal parameter that no longer exists at the point of the
30112 second access [(due to leaving the corresponding callable construct).]
30113 The possible consequences are that Program_Error is raised, or the newly
30114 assigned value is read, or some old value of the object is read.
30115
30116 12.a
30117 Discussion: For example, if we call "P(X => Global_Variable, Y
30118 => Global_Variable)", then within P, the names "X", "Y", and
30119 "Global_Variable" are all distinct access paths. If
30120 Global_Variable's type is neither pass-by-copy nor
30121 pass-by-reference, then it is a bounded error to assign to
30122 Global_Variable and then read X or Y, since the language does
30123 not specify whether the old or the new value would be read.
30124 On the other hand, if Global_Variable's type is pass-by-copy,
30125 then the old value would always be read, and there is no
30126 error. Similarly, if Global_Variable's type is defined by the
30127 language to be pass-by-reference, then the new value would
30128 always be read, and again there is no error.
30129
30130 12.b
30131 Reason: We are saying assign here, not update, because
30132 updating any subcomponent is considered to update the
30133 enclosing object.
30134
30135 12.c
30136 The "still exists" part is so that a read after the subprogram
30137 returns is OK.
30138
30139 12.d
30140 If the parameter is of a by-copy type, then there is no issue
30141 here -- the formal is not a view of the actual. If the
30142 parameter is of a by-reference type, then the programmer may
30143 depend on updates through one access path being visible
30144 through some other access path, just as if the parameter were
30145 of an access type.
30146
30147 12.e
30148 Implementation Note: The implementation can keep a copy in a
30149 register of a parameter whose parameter-passing mechanism is
30150 not specified. If a different access path is used to update
30151 the object (creating a bounded error situation), then the
30152 implementation can still use the value of the register, even
30153 though the in-memory version of the object has been changed.
30154 However, to keep the error properly bounded, if the
30155 implementation chooses to read the in-memory version, it has
30156 to be consistent -- it cannot then assume that something it
30157 has proven about the register is true of the memory location.
30158 For example, suppose the formal parameter is L, the value of
30159 L(6) is now in a register, and L(6) is used in an
30160 indexed_component as in "A(L(6)) := 99;", where A has bounds
30161 1..3. If the implementation can prove that the value for L(6)
30162 in the register is in the range 1..3, then it need not perform
30163 the constraint check if it uses the register value. However,
30164 if the memory value of L(6) has been changed to 4, and the
30165 implementation uses that memory value, then it had better not
30166 alter memory outside of A.
30167
30168 12.f
30169 Note that the rule allows the implementation to pass a
30170 parameter by reference and then keep just part of it in a
30171 register, or, equivalently, to pass part of the parameter by
30172 reference and another part by copy.
30173
30174 12.g
30175 Reason: We do not want to go so far as to say that the mere
30176 presence of aliasing is wrong. We wish to be able to write
30177 the following sorts of things in standard Ada:
30178
30179 12.h
30180 procedure Move ( Source : in String;
30181 Target : out String;
30182 Drop : in Truncation := Error;
30183 Justify : in Alignment := Left;
30184 Pad : in Character := Space);
30185 -- Copies elements from Source to Target (safely if they overlap)
30186
30187 12.i
30188 This is from the standard string handling package. It would
30189 be embarrassing if this couldn't be written in Ada!
30190
30191 12.j
30192 The "then" before "read" in the rule implies that the
30193 implementation can move a read to an earlier place in the
30194 code, but not to a later place after a potentially aliased
30195 assignment. Thus, if the subprogram reads one of its
30196 parameters into a local variable, and then updates another
30197 potentially aliased one, the local copy is safe -- it is known
30198 to have the old value. For example, the above-mentioned Move
30199 subprogram can be implemented by copying Source into a local
30200 variable before assigning into Target.
30201
30202 12.k
30203 For an assignment_statement assigning one array parameter to
30204 another, the implementation has to check which direction to
30205 copy at run time, in general, in case the actual parameters
30206 are overlapping slices. For example:
30207
30208 12.l
30209 procedure Copy(X : in out String; Y: String) is
30210 begin
30211 X := Y;
30212 end Copy;
30213
30214 12.m
30215 It would be wrong for the compiler to assume that X and Y do
30216 not overlap (unless, of course, it can prove otherwise).
30217
30218 NOTES
30219
30220 13
30221 6 A formal parameter of mode in is a constant view (see *note
30222 3.3::); it cannot be updated within the subprogram_body.
30223
30224 _Extensions to Ada 83_
30225
30226 13.a
30227 The value of an out parameter may be read. An out parameter
30228 is treated like a declared variable without an explicit
30229 initial expression.
30230
30231 _Wording Changes from Ada 83_
30232
30233 13.b
30234 Discussion of copy-in for parts of out parameters is now
30235 covered in *note 6.4.1::, "*note 6.4.1:: Parameter
30236 Associations".
30237
30238 13.c
30239 The concept of a by-reference type is new to Ada 95.
30240
30241 13.d
30242 We now cover in a general way in *note 3.7.2:: the rule
30243 regarding erroneous execution when a discriminant is changed
30244 and one of the parameters depends on the discriminant.
30245
30246 _Wording Changes from Ada 2005_
30247
30248 13.e/3
30249 {AI05-0096-1AI05-0096-1} Correction: Corrected so that limited
30250 derived types are by-reference only if their parent is.
30251
30252 13.f/3
30253 {AI05-0142-4AI05-0142-4} Defined that explicitly aliased
30254 parameters (see *note 6.1::) are always passed by reference.
30255
30256 \1f
30257 File: aarm2012.info, Node: 6.3, Next: 6.4, Prev: 6.2, Up: 6
30258
30259 6.3 Subprogram Bodies
30260 =====================
30261
30262 1
30263 [A subprogram_body specifies the execution of a subprogram.]
30264
30265 _Syntax_
30266
30267 2/3
30268 {AI95-00218-03AI95-00218-03} {AI05-0183-1AI05-0183-1}
30269 subprogram_body ::=
30270 [overriding_indicator]
30271 subprogram_specification
30272 [aspect_specification] is
30273 declarative_part
30274 begin
30275 handled_sequence_of_statements
30276 end [designator];
30277
30278 3
30279 If a designator appears at the end of a subprogram_body, it shall
30280 repeat the defining_designator of the subprogram_specification.
30281
30282 _Legality Rules_
30283
30284 4
30285 [In contrast to other bodies,] a subprogram_body need not be the
30286 completion of a previous declaration[, in which case the body declares
30287 the subprogram]. If the body is a completion, it shall be the
30288 completion of a subprogram_declaration or
30289 generic_subprogram_declaration. The profile of a subprogram_body that
30290 completes a declaration shall conform fully to that of the declaration.
30291
30292 _Static Semantics_
30293
30294 5
30295 A subprogram_body is considered a declaration. It can either complete a
30296 previous declaration, or itself be the initial declaration of the
30297 subprogram.
30298
30299 _Dynamic Semantics_
30300
30301 6
30302 The elaboration of a nongeneric subprogram_body has no other effect than
30303 to establish that the subprogram can from then on be called without
30304 failing the Elaboration_Check.
30305
30306 6.a
30307 Ramification: See *note 12.2:: for elaboration of a generic
30308 body. Note that protected subprogram_bodies never get
30309 elaborated; the elaboration of the containing protected_body
30310 allows them to be called without failing the
30311 Elaboration_Check.
30312
30313 7
30314 [The execution of a subprogram_body is invoked by a subprogram call.]
30315 For this execution the declarative_part is elaborated, and the
30316 handled_sequence_of_statements is then executed.
30317
30318 _Examples_
30319
30320 8
30321 Example of procedure body:
30322
30323 9
30324 procedure Push(E : in Element_Type; S : in out Stack) is
30325 begin
30326 if S.Index = S.Size then
30327 raise Stack_Overflow;
30328 else
30329 S.Index := S.Index + 1;
30330 S.Space(S.Index) := E;
30331 end if;
30332 end Push;
30333
30334 10
30335 Example of a function body:
30336
30337 11
30338 function Dot_Product(Left, Right : Vector) return Real is
30339 Sum : Real := 0.0;
30340 begin
30341 Check(Left'First = Right'First and Left'Last = Right'Last);
30342 for J in Left'Range loop
30343 Sum := Sum + Left(J)*Right(J);
30344 end loop;
30345 return Sum;
30346 end Dot_Product;
30347
30348 _Extensions to Ada 83_
30349
30350 11.a
30351 A renaming_declaration may be used instead of a
30352 subprogram_body.
30353
30354 _Wording Changes from Ada 83_
30355
30356 11.b
30357 The syntax rule for subprogram_body now uses the syntactic
30358 category handled_sequence_of_statements.
30359
30360 11.c
30361 The declarative_part of a subprogram_body is now required;
30362 that doesn't make any real difference, because a
30363 declarative_part can be empty.
30364
30365 11.d
30366 We have incorporated some rules from RM83-6.5 here.
30367
30368 11.e
30369 RM83 forgot to restrict the definition of elaboration of a
30370 subprogram_body to nongenerics.
30371
30372 _Wording Changes from Ada 95_
30373
30374 11.f/2
30375 {AI95-00218-03AI95-00218-03} Overriding_indicator is added to
30376 subprogram_body.
30377
30378 _Extensions to Ada 2005_
30379
30380 11.g/3
30381 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
30382 be used in a subprogram_body. This is described in *note
30383 13.1.1::.
30384
30385 * Menu:
30386
30387 * 6.3.1 :: Conformance Rules
30388 * 6.3.2 :: Inline Expansion of Subprograms
30389
30390 \1f
30391 File: aarm2012.info, Node: 6.3.1, Next: 6.3.2, Up: 6.3
30392
30393 6.3.1 Conformance Rules
30394 -----------------------
30395
30396 1
30397 [When subprogram profiles are given in more than one place, they are
30398 required to conform in one of four ways: type conformance, mode
30399 conformance, subtype conformance, or full conformance.]
30400
30401 _Static Semantics_
30402
30403 2/1
30404 {8652/00118652/0011} {AI95-00117-01AI95-00117-01} [As explained in *note
30405 B.1::, "*note B.1:: Interfacing Aspects", a convention can be specified
30406 for an entity.] Unless this International Standard states otherwise,
30407 the default convention of an entity is Ada. [For a callable entity or
30408 access-to-subprogram type, the convention is called the calling
30409 convention.] The following conventions are defined by the language:
30410
30411 3/3
30412 * {AI05-0229-1AI05-0229-1} The default calling convention for any
30413 subprogram not listed below is Ada. [The Convention aspect may be
30414 specified to override the default calling convention (see *note
30415 B.1::)].
30416
30417 3.a
30418 Ramification: See also the rule about renamings-as-body in
30419 *note 8.5.4::.
30420
30421 4
30422 * The Intrinsic calling convention represents subprograms that are
30423 "built in" to the compiler. The default calling convention is
30424 Intrinsic for the following:
30425
30426 5
30427 * an enumeration literal;
30428
30429 6
30430 * a "/=" operator declared implicitly due to the
30431 declaration of "=" (see *note 6.6::);
30432
30433 7
30434 * any other implicitly declared subprogram unless it is a
30435 dispatching operation of a tagged type;
30436
30437 8
30438 * an inherited subprogram of a generic formal tagged type
30439 with unknown discriminants;
30440
30441 8.a.1/1
30442 Reason: Consider:
30443
30444 8.a.2/1
30445 package P is
30446 type Root is tagged null record;
30447 procedure Proc(X: Root);
30448 end P;
30449
30450 8.a.3/1
30451 generic
30452 type Formal(<>) is new Root with private;
30453 package G is
30454 ...
30455 end G;
30456
30457 8.a.4/1
30458 package body G is
30459 ...
30460 X: Formal := ...;
30461 ...
30462 Proc(X); -- This is a dispatching call in Instance, because
30463 -- the actual type for Formal is class-wide.
30464 ...
30465 -- Proc'Access would be illegal here, because it is of
30466 -- convention Intrinsic, by the above rule.
30467 end G;
30468
30469 8.a.5/1
30470 type Actual is new Root with ...;
30471 procedure Proc(X: Actual);
30472 package Instance is new G(Formal => Actual'Class);
30473 -- It is legal to pass in a class-wide actual, because Formal
30474 -- has unknown discriminants.
30475
30476 8.a.6/1
30477 Within Instance, all calls to Proc will be dispatching calls,
30478 so Proc doesn't really exist in machine code, so we wish to
30479 avoid taking 'Access of it. This rule applies to those cases
30480 where the actual type might be class-wide, and makes these
30481 Intrinsic, thus forbidding 'Access.
30482
30483 9
30484 * an attribute that is a subprogram;
30485
30486 10/2
30487 * {AI95-00252-01AI95-00252-01} a subprogram declared
30488 immediately within a protected_body;
30489
30490 10.1/2
30491 * {AI95-00252-01AI95-00252-01} {AI95-00407-01AI95-00407-01}
30492 any prefixed view of a subprogram (see *note 4.1.3::).
30493
30494 10.a/2
30495 Reason: The profile of a prefixed view is different than the
30496 "real" profile of the subprogram (it doesn't have the first
30497 parameter), so we don't want to be able to take 'Access of it,
30498 as that would require generating a wrapper of some sort.
30499
30500 11
30501 [The Access attribute is not allowed for Intrinsic subprograms.]
30502
30503 11.a
30504 Ramification: The Intrinsic calling convention really
30505 represents any number of calling conventions at the machine
30506 code level; the compiler might have a different instruction
30507 sequence for each intrinsic. That's why the Access attribute
30508 is disallowed. We do not wish to require the implementation
30509 to generate an out of line body for an intrinsic.
30510
30511 11.b/3
30512 {AI05-0229-1AI05-0229-1} Whenever we wish to disallow the
30513 Access attribute in order to ease implementation, we make the
30514 subprogram Intrinsic. Several language-defined subprograms
30515 have "with Convention => Intrinsic;". An implementation might
30516 actually implement this as "with Import => True, Convention =>
30517 Intrinsic;", if there is really no body, and the
30518 implementation of the subprogram is built into the code
30519 generator.
30520
30521 11.c
30522 Subprograms declared in protected_bodies will generally have a
30523 special calling convention so as to pass along the
30524 identification of the current instance of the protected type.
30525 The convention is not protected since such local subprograms
30526 need not contain any "locking" logic since they are not
30527 callable via "external" calls; this rule prevents an access
30528 value designating such a subprogram from being passed outside
30529 the protected unit.
30530
30531 11.d
30532 The "implicitly declared subprogram" above refers to
30533 predefined operators (other than the "=" of a tagged type) and
30534 the inherited subprograms of untagged types.
30535
30536 12
30537 * The default calling convention is protected for a protected
30538 subprogram, and for an access-to-subprogram type with the reserved
30539 word protected in its definition.
30540
30541 13
30542 * The default calling convention is entry for an entry.
30543
30544 13.1/3
30545 * {AI95-00254-01AI95-00254-01} {AI95-00409-01AI95-00409-01}
30546 {AI05-0264-1AI05-0264-1} The calling convention for an anonymous
30547 access-to-subprogram parameter or anonymous access-to-subprogram
30548 result is protected if the reserved word protected appears in its
30549 definition; otherwise, it is the convention of the subprogram that
30550 contains the parameter.
30551
30552 13.a/2
30553 Ramification: The calling convention for other anonymous
30554 access-to-subprogram types is Ada.
30555
30556 13.2/1
30557 * {8652/00118652/0011} {AI95-00117-01AI95-00117-01} [If not specified
30558 above as Intrinsic, the calling convention for any inherited or
30559 overriding dispatching operation of a tagged type is that of the
30560 corresponding subprogram of the parent type.] The default calling
30561 convention for a new dispatching operation of a tagged type is the
30562 convention of the type.
30563
30564 13.a.1/1
30565 Reason: The first rule is officially stated in *note 3.9.2::.
30566 The second is intended to make interfacing to foreign OOP
30567 languages easier, by making the default be that the type and
30568 operations all have the same convention.
30569
30570 14/3
30571 {AI05-0229-1AI05-0229-1} Of these four conventions, only Ada and
30572 Intrinsic are allowed as a convention_identifier in the specification of
30573 a Convention aspect.
30574
30575 14.a/3
30576 Discussion: {AI05-0229-1AI05-0229-1} The names of the
30577 protected and entry calling conventions cannot be used in the
30578 specification of Convention. Note that protected and entry
30579 are reserved words.
30580
30581 15/2
30582 {AI95-00409-01AI95-00409-01} Two profiles are type conformant if they
30583 have the same number of parameters, and both have a result if either
30584 does, and corresponding parameter and result types are the same, or, for
30585 access parameters or access results, corresponding designated types are
30586 the same, or corresponding designated profiles are type conformant.
30587
30588 15.a/2
30589 Discussion: {AI95-00409-01AI95-00409-01} For anonymous
30590 access-to-object parameters, the designated types have to be
30591 the same for type conformance, not the access types, since in
30592 general each access parameter has its own anonymous access
30593 type, created when the subprogram is called. Of course,
30594 corresponding parameters have to be either both access
30595 parameters or both not access parameters.
30596
30597 15.b/2
30598 {AI95-00409-01AI95-00409-01} Similarly, for anonymous
30599 access-to-subprogram parameters, the designated profiles of
30600 the types, not the types themselves, have to be conformant.
30601
30602 16/3
30603 {AI95-00318-02AI95-00318-02} {AI95-00409-01AI95-00409-01}
30604 {AI05-0142-4AI05-0142-4} Two profiles are mode conformant if:
30605
30606 16.1/3
30607 * {AI05-0142-4AI05-0142-4} {AI05-0262-1AI05-0262-1} they are type
30608 conformant; and
30609
30610 16.2/3
30611 * {AI05-0142-4AI05-0142-4} corresponding parameters have identical
30612 modes and both or neither are explicitly aliased parameters; and
30613
30614 16.3/3
30615 * {AI05-0207-1AI05-0207-1} for corresponding access parameters and
30616 any access result type, the designated subtypes statically match
30617 and either both or neither are access-to-constant, or the
30618 designated profiles are subtype conformant.
30619
30620 17/3
30621 {AI05-0239-1AI05-0239-1} Two profiles are subtype conformant if they are
30622 mode conformant, corresponding subtypes of the profile statically match,
30623 and the associated calling conventions are the same. The profile of a
30624 generic formal subprogram is not subtype conformant with any other
30625 profile.
30626
30627 17.a
30628 Ramification:
30629
30630 18/3
30631 {AI05-0134-1AI05-0134-1} {AI05-0262-1AI05-0262-1} Two profiles are fully
30632 conformant if they are subtype conformant, if they have
30633 access-to-subprogram results whose designated profiles are fully
30634 conformant, and for corresponding parameters:
30635
30636 18.1/3
30637 * {AI05-0262-1AI05-0262-1} they have the same names; and
30638
30639 18.2/3
30640 * {AI05-0046-1AI05-0046-1} both or neither have null_exclusions; and
30641
30642 18.3/3
30643 * neither have default_expressions, or they both have
30644 default_expressions that are fully conformant with one another; and
30645
30646 18.4/3
30647 * {AI05-0134-1AI05-0134-1} for access-to-subprogram parameters, the
30648 designated profiles are fully conformant.
30649
30650 18.a
30651 Ramification: Full conformance requires subtype conformance,
30652 which requires the same calling conventions. However, the
30653 calling convention of the declaration and body of a subprogram
30654 or entry are always the same by definition.
30655
30656 18.b/3
30657 Reason: {AI05-0046-1AI05-0046-1} The part about
30658 null_exclusions is necessary to prevent controlling parameters
30659 from having different exclusions, as such a parameter is
30660 defined to exclude null whether or not an exclusion is given.
30661
30662 18.c/3
30663 {AI05-0134-1AI05-0134-1} The parts about access-to-subprogram
30664 parameters and results is necessary to prevent such types from
30665 having different default_expressions in the specification and
30666 body of a subprogram. If that was allowed, it would be
30667 undefined which default_expression was used in a call of an
30668 access-to-subprogram parameter.
30669
30670 19
30671 Two expressions are fully conformant if, [after replacing each use of an
30672 operator with the equivalent function_call:]
30673
30674 20
30675 * each constituent construct of one corresponds to an instance of the
30676 same syntactic category in the other, except that an expanded name
30677 may correspond to a direct_name (or character_literal) or to a
30678 different expanded name in the other; and
30679
30680 21
30681 * each direct_name, character_literal, and selector_name that is not
30682 part of the prefix of an expanded name in one denotes the same
30683 declaration as the corresponding direct_name, character_literal, or
30684 selector_name in the other; and
30685
30686 21.a
30687 Ramification: Note that it doesn't say "respectively" because
30688 a direct_name can correspond to a selector_name, and
30689 vice-versa, by the previous bullet. This rule allows the
30690 prefix of an expanded name to be removed, or replaced with a
30691 different prefix that denotes a renaming of the same entity.
30692 However, it does not allow a direct_name or selector_name to
30693 be replaced with one denoting a distinct renaming (except for
30694 direct_names and selector_names in prefixes of expanded
30695 names). Note that calls using operator notation are
30696 equivalent to calls using prefix notation.
30697
30698 21.b
30699 Given the following declarations:
30700
30701 21.c
30702 package A is
30703 function F(X : Integer := 1) return Boolean;
30704 end A;
30705
30706 21.c.1/3
30707 {AI05-0005-1AI05-0005-1} with A;
30708 package B is
30709 package A_View renames A;
30710 function F_View(X : Integer := 9999) return Boolean renames A.F;
30711 end B;
30712
30713 21.d
30714 with A, B; use A, B;
30715 procedure Main is ...
30716
30717 21.e
30718 Within Main, the expressions "F", "A.F", "B.A_View.F", and
30719 "A_View.F" are all fully conformant with one another.
30720 However, "F" and "F_View" are not fully conformant. If they
30721 were, it would be bad news, since the two denoted views have
30722 different default_expressions.
30723
30724 21.1/3
30725 * {8652/00188652/0018} {AI95-00175-01AI95-00175-01}
30726 {AI05-0092-1AI05-0092-1} each attribute_designator in one is the
30727 same as the corresponding attribute_designator in the other; and
30728
30729 22
30730 * each primary that is a literal in one has the same value as the
30731 corresponding literal in the other.
30732
30733 22.a
30734 Ramification: The literals may be written differently.
30735
30736 22.b
30737 Ramification: Note that the above definition makes full
30738 conformance a transitive relation.
30739
30740 23
30741 Two known_discriminant_parts are fully conformant if they have the same
30742 number of discriminants, and discriminants in the same positions have
30743 the same names, statically matching subtypes, and default_expressions
30744 that are fully conformant with one another.
30745
30746 24
30747 Two discrete_subtype_definitions are fully conformant if they are both
30748 subtype_indications or are both ranges, the subtype_marks (if any)
30749 denote the same subtype, and the corresponding simple_expressions of the
30750 ranges (if any) fully conform.
30751
30752 24.a
30753 Ramification: In the subtype_indication case, any ranges have
30754 to be corresponding; that is, two subtype_indications cannot
30755 conform unless both or neither has a range.
30756
30757 24.b
30758 Discussion: This definition is used in *note 9.5.2::, "*note
30759 9.5.2:: Entries and Accept Statements" for the conformance
30760 required between the discrete_subtype_definitions of an
30761 entry_declaration for a family of entries and the
30762 corresponding entry_index_specification of the entry_body.
30763
30764 24.1/2
30765 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01} The prefixed
30766 view profile of a subprogram is the profile obtained by omitting the
30767 first parameter of that subprogram. There is no prefixed view profile
30768 for a parameterless subprogram. For the purposes of defining subtype
30769 and mode conformance, the convention of a prefixed view profile is
30770 considered to match that of either an entry or a protected operation.
30771
30772 24.c/2
30773 Discussion: This definition is used to define how primitive
30774 subprograms of interfaces match operations in task and
30775 protected type definitions (see *note 9.1:: and *note 9.4::).
30776
30777 24.d/2
30778 Reason: The weird rule about conventions is pretty much
30779 required for synchronized interfaces to make any sense. There
30780 will be wrappers all over the place for interfaces anyway. Of
30781 course, this doesn't imply that entries have the same
30782 convention as protected operations.
30783
30784 _Implementation Permissions_
30785
30786 25
30787 An implementation may declare an operator declared in a language-defined
30788 library unit to be intrinsic.
30789
30790 _Extensions to Ada 83_
30791
30792 25.a
30793 The rules for full conformance are relaxed -- they are now
30794 based on the structure of constructs, rather than the sequence
30795 of lexical elements. This implies, for example, that "(X, Y:
30796 T)" conforms fully with "(X: T; Y: T)", and "(X: T)" conforms
30797 fully with "(X: in T)".
30798
30799 _Wording Changes from Ada 95_
30800
30801 25.b/2
30802 {8652/00118652/0011} {AI95-00117-01AI95-00117-01} Corrigendum:
30803 Clarified that the default convention is Ada. Also clarified
30804 that the convention of a primitive operation of a tagged type
30805 is the same as that of the type.
30806
30807 25.c/2
30808 {8652/00188652/0018} {AI95-00175-01AI95-00175-01} Corrigendum:
30809 Added wording to ensure that two attributes conform only if
30810 they have the same attribute_designator.
30811
30812 25.d/2
30813 {AI95-00252-01AI95-00252-01} {AI95-00254-01AI95-00254-01}
30814 {AI95-00407-01AI95-00407-01} Defined the calling convention
30815 for anonymous access-to-subprogram types and for prefixed
30816 views of subprograms (see *note 4.1.3::).
30817
30818 25.e/2
30819 {AI95-00318-02AI95-00318-02} Defined the conformance of access
30820 result types (see *note 6.1::).
30821
30822 25.f/2
30823 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01}
30824 Defined the prefixed view profile of subprograms for later
30825 use.
30826
30827 25.g/2
30828 {AI95-00409-01AI95-00409-01} Defined the conformance of
30829 anonymous access-to-subprogram parameters.
30830
30831 _Incompatibilities With Ada 2005_
30832
30833 25.h/3
30834 {AI05-0046-1AI05-0046-1} Correction: Now require
30835 null_exclusions to match for full conformance. While this is
30836 technically incompatible with Ada 2005 as defined by Amendment
30837 1, it is a new Ada 2005 feature and it is unlikely that users
30838 have been intentionally taking advantage of the ability to
30839 write mismatching exclusions. In any case, it is easy to fix:
30840 add a null_exclusion where needed for conformance.
30841
30842 25.i/3
30843 {AI05-0134-1AI05-0134-1} Correction: Now require full
30844 conformance of anonymous access-to-subprogram parameters and
30845 results for full conformance. This is necessary so that there
30846 is no confusion about the default expression that is used for
30847 a call. While this is technically incompatible with Ada 2005
30848 as defined by Amendment 1, it is a new Ada 2005 feature and it
30849 is unlikely that users have been intentionally taking
30850 advantage and writing different default expressions. In any
30851 case, it is easy to fix: change any default expressions that
30852 don't conform so that they do conform.
30853
30854 25.j/3
30855 {AI05-0207-1AI05-0207-1} Correction: Now include the presence
30856 or absence of constant in access parameters to be considered
30857 when checking mode conformance. This is necessary to prevent
30858 modification of constants. While this is technically
30859 incompatible with Ada 2005 as defined by Amendment 1, it is a
30860 new Ada 2005 feature and it is unlikely that users have been
30861 intentionally taking advantage and writing mismatching access
30862 types.
30863
30864 _Wording Changes from Ada 2005_
30865
30866 25.k/3
30867 {AI05-0142-4AI05-0142-4} Explicitly aliased parameters are
30868 included as part of mode conformance (since it affects the
30869 parameter passing mechanism).
30870
30871 \1f
30872 File: aarm2012.info, Node: 6.3.2, Prev: 6.3.1, Up: 6.3
30873
30874 6.3.2 Inline Expansion of Subprograms
30875 -------------------------------------
30876
30877 1
30878 [Subprograms may be expanded in line at the call site.]
30879
30880 Paragraphs 2 through 4 were moved to *note Annex J::, "*note Annex J::
30881 Obsolescent Features".
30882
30883 _Static Semantics_
30884
30885 5/3
30886 {AI05-0229-1AI05-0229-1} For a callable entity or a generic subprogram,
30887 the following language-defined representation aspect may be specified:
30888
30889 5.1/3
30890 Inline
30891 The type of aspect Inline is Boolean. When aspect Inline
30892 is True for a callable entity, inline expansion is
30893 desired for all calls to that entity. When aspect Inline
30894 is True for a generic subprogram, inline expansion is
30895 desired for all calls to all instances of that generic
30896 subprogram.
30897
30898 5.2/3
30899 If directly specified, the aspect_definition shall be a
30900 static expression. [This aspect is never inherited;] if
30901 not directly specified, the aspect is False.
30902
30903 5.a/3
30904 Aspect Description for Inline: For efficiency, Inline calls
30905 are requested for a subprogram.
30906
30907 5.b/3
30908 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
30909
30910 5.c/3
30911 This paragraph was deleted.
30912
30913 5.d/3
30914 This paragraph was deleted.
30915
30916 5.e/3
30917 Ramification: {AI05-0229-1AI05-0229-1} The meaning of a
30918 subprogram can be changed by inline expansion as requested by
30919 aspect Inline only in the presence of failing checks (see
30920 *note 11.6::).
30921
30922 _Implementation Permissions_
30923
30924 6/3
30925 {AI05-0229-1AI05-0229-1} For each call, an implementation is free to
30926 follow or to ignore the recommendation determined by the Inline aspect.
30927
30928 6.a
30929 Ramification: Note, in particular, that the recommendation
30930 cannot always be followed for a recursive call, and is often
30931 infeasible for entries. Note also that the implementation can
30932 inline calls even when no such desire was expressed via the
30933 Inline aspect, so long as the semantics of the program remains
30934 unchanged.
30935
30936 _Incompatibilities With Ada 83_
30937
30938 7.a/3
30939 This paragraph was deleted.{AI95-00309-01AI95-00309-01}
30940 {AI05-0229-1AI05-0229-1}
30941
30942 _Extensions to Ada 83_
30943
30944 7.b/3
30945 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
30946
30947 _Extensions to Ada 95_
30948
30949 7.c/3
30950 This paragraph was deleted.{AI95-00309-01AI95-00309-01}
30951 {AI05-0229-1AI05-0229-1}
30952
30953 _Extensions to Ada 2005_
30954
30955 7.d/3
30956 {AI05-0229-1AI05-0229-1} Aspect Inline is new; pragma Inline
30957 is now obsolescent.
30958
30959 \1f
30960 File: aarm2012.info, Node: 6.4, Next: 6.5, Prev: 6.3, Up: 6
30961
30962 6.4 Subprogram Calls
30963 ====================
30964
30965 1
30966 A subprogram call is either a procedure_call_statement or a
30967 function_call; [it invokes the execution of the subprogram_body. The
30968 call specifies the association of the actual parameters, if any, with
30969 formal parameters of the subprogram.]
30970
30971 _Syntax_
30972
30973 2
30974 procedure_call_statement ::=
30975 procedure_name;
30976 | procedure_prefix actual_parameter_part;
30977
30978 3
30979 function_call ::=
30980 function_name
30981 | function_prefix actual_parameter_part
30982
30983 3.a/3
30984 To be honest: {AI05-0005-1AI05-0005-1} For the purpose of
30985 non-syntax rules, infix operator calls are considered
30986 function_calls. See *note 6.6::.
30987
30988 4
30989 actual_parameter_part ::=
30990 (parameter_association {, parameter_association})
30991
30992 5
30993 parameter_association ::=
30994 [formal_parameter_selector_name =>] explicit_actual_parameter
30995
30996 6
30997 explicit_actual_parameter ::= expression | variable_name
30998
30999 7
31000 A parameter_association is named or positional according to whether
31001 or not the formal_parameter_selector_name (*note 4.1.3: S0099.) is
31002 specified. Any positional associations shall precede any named
31003 associations. Named associations are not allowed if the prefix in
31004 a subprogram call is an attribute_reference (*note 4.1.4: S0100.).
31005
31006 7.a
31007 Ramification: This means that the formal parameter names used
31008 in describing predefined attributes are to aid presentation of
31009 their semantics, but are not intended for use in actual calls.
31010
31011 _Name Resolution Rules_
31012
31013 8/2
31014 {AI95-00310-01AI95-00310-01} The name or prefix given in a
31015 procedure_call_statement shall resolve to denote a callable entity that
31016 is a procedure, or an entry renamed as (viewed as) a procedure. The
31017 name or prefix given in a function_call shall resolve to denote a
31018 callable entity that is a function. The name or prefix shall not
31019 resolve to denote an abstract subprogram unless it is also a dispatching
31020 subprogram. [When there is an actual_parameter_part (*note 6.4:
31021 S0180.), the prefix can be an implicit_dereference (*note 4.1: S0095.)
31022 of an access-to-subprogram value.]
31023
31024 8.a.1/2
31025 Discussion: {AI95-00310-01AI95-00310-01} This rule is talking
31026 about dispatching operations (which is a static concept) and
31027 not about dispatching calls (which is a dynamic concept).
31028
31029 8.a
31030 Ramification: The function can be an operator, enumeration
31031 literal, attribute that is a function, etc.
31032
31033 9
31034 A subprogram call shall contain at most one association for each formal
31035 parameter. Each formal parameter without an association shall have a
31036 default_expression (in the profile of the view denoted by the name or
31037 prefix). [This rule is an overloading rule (see *note 8.6::).]
31038
31039 9.a/3
31040 Proof: {AI05-0240-1AI05-0240-1} All Name Resolution Rules are
31041 overloading rules, see *note 8.6::.
31042
31043 _Dynamic Semantics_
31044
31045 10/2
31046 {AI95-00345-01AI95-00345-01} For the execution of a subprogram call, the
31047 name or prefix of the call is evaluated, and each parameter_association
31048 (*note 6.4: S0181.) is evaluated (see *note 6.4.1::). If a
31049 default_expression (*note 3.7: S0063.) is used, an implicit
31050 parameter_association (*note 6.4: S0181.) is assumed for this rule.
31051 These evaluations are done in an arbitrary order. The subprogram_body
31052 (*note 6.3: S0177.) is then executed, or a call on an entry or protected
31053 subprogram is performed (see *note 3.9.2::). Finally, if the subprogram
31054 completes normally, then after it is left, any necessary assigning back
31055 of formal to actual parameters occurs (see *note 6.4.1::).
31056
31057 10.a
31058 Discussion: The implicit association for a default is only for
31059 this run-time rule. At compile time, the visibility rules are
31060 applied to the default at the place where it occurs, not at
31061 the place of a call.
31062
31063 10.b
31064 To be honest: If the subprogram is inherited, see *note 3.4::,
31065 "*note 3.4:: Derived Types and Classes".
31066
31067 10.c
31068 If the subprogram is protected, see *note 9.5.1::, "*note
31069 9.5.1:: Protected Subprograms and Protected Actions".
31070
31071 10.d
31072 If the subprogram is really a renaming of an entry, see *note
31073 9.5.3::, "*note 9.5.3:: Entry Calls".
31074
31075 10.d.1/2
31076 {AI95-00345-01AI95-00345-01} If the subprogram is implemented
31077 by an entry or protected subprogram, it will be treated as a
31078 dispatching call to the corresponding entry (see *note
31079 9.5.3::, "*note 9.5.3:: Entry Calls") or protected subprogram
31080 (see *note 9.5.1::, "*note 9.5.1:: Protected Subprograms and
31081 Protected Actions").
31082
31083 10.e/2
31084 {AI95-00348-01AI95-00348-01} Normally, the subprogram_body
31085 that is executed by the above rule is the one for the
31086 subprogram being called. For an enumeration literal,
31087 implicitly declared (but noninherited) subprogram, null
31088 procedure, or an attribute that is a subprogram, an implicit
31089 body is assumed. For a dispatching call, *note 3.9.2::,
31090 "*note 3.9.2:: Dispatching Operations of Tagged Types" defines
31091 which subprogram_body is executed.
31092
31093 10.1/2
31094 {AI95-00407-01AI95-00407-01} If the name or prefix of a subprogram call
31095 denotes a prefixed view (see *note 4.1.3::), the subprogram call is
31096 equivalent to a call on the underlying subprogram, with the first actual
31097 parameter being provided by the prefix of the prefixed view (or the
31098 Access attribute of this prefix if the first formal parameter is an
31099 access parameter), and the remaining actual parameters given by the
31100 actual_parameter_part, if any.
31101
31102 11/2
31103 {AI95-00318-02AI95-00318-02} The exception Program_Error is raised at
31104 the point of a function_call if the function completes normally without
31105 executing a return statement.
31106
31107 11.a
31108 Discussion: We are committing to raising the exception at the
31109 point of call, for uniformity -- see AI83-00152. This happens
31110 after the function is left, of course.
31111
31112 11.b
31113 Note that there is no name for suppressing this check, since
31114 the check imposes no time overhead and minimal space overhead
31115 (since it can usually be statically eliminated as dead code).
31116
31117 12/2
31118 {AI95-00231-01AI95-00231-01} A function_call denotes a constant, as
31119 defined in *note 6.5::; the nominal subtype of the constant is given by
31120 the nominal subtype of the function result.
31121
31122 _Examples_
31123
31124 13
31125 Examples of procedure calls:
31126
31127 14
31128 Traverse_Tree; -- see *note 6.1::
31129 Print_Header(128, Title, True); -- see *note 6.1::
31130
31131 15
31132 Switch(From => X, To => Next); -- see *note 6.1::
31133 Print_Header(128, Header => Title, Center => True); -- see *note 6.1::
31134 Print_Header(Header => Title, Center => True, Pages => 128); -- see *note 6.1::
31135
31136 16
31137 Examples of function calls:
31138
31139 17
31140 Dot_Product(U, V) -- see *note 6.1:: and *note 6.3::
31141 Clock -- see *note 9.6::
31142 F.all -- presuming F is of an access-to-subprogram type -- see *note 3.10::
31143
31144 18
31145 Examples of procedures with default expressions:
31146
31147 19
31148 procedure Activate(Process : in Process_Name;
31149 After : in Process_Name := No_Process;
31150 Wait : in Duration := 0.0;
31151 Prior : in Boolean := False);
31152
31153 20/3
31154 {AI05-0299-1AI05-0299-1} procedure Pair(Left, Right : in Person_Name := new Person(M)); -- see *note 3.10.1::
31155
31156 21
31157 Examples of their calls:
31158
31159 22
31160 Activate(X);
31161 Activate(X, After => Y);
31162 Activate(X, Wait => 60.0, Prior => True);
31163 Activate(X, Y, 10.0, False);
31164
31165 23/3
31166 {AI05-0299-1AI05-0299-1} Pair;
31167 Pair(Left => new Person(F), Right => new Person(M));
31168
31169 NOTES
31170
31171 24
31172 7 If a default_expression is used for two or more parameters in a
31173 multiple parameter_specification (*note 6.1: S0175.), the
31174 default_expression (*note 3.7: S0063.) is evaluated once for each
31175 omitted parameter. Hence in the above examples, the two calls of
31176 Pair are equivalent.
31177
31178 _Examples_
31179
31180 25
31181 Examples of overloaded subprograms:
31182
31183 26
31184 procedure Put(X : in Integer);
31185 procedure Put(X : in String);
31186
31187 27
31188 procedure Set(Tint : in Color);
31189 procedure Set(Signal : in Light);
31190
31191 28
31192 Examples of their calls:
31193
31194 29
31195 Put(28);
31196 Put("no possible ambiguity here");
31197
31198 30
31199 Set(Tint => Red);
31200 Set(Signal => Red);
31201 Set(Color'(Red));
31202
31203 31
31204 -- Set(Red) would be ambiguous since Red may
31205 -- denote a value either of type Color or of type Light
31206
31207 _Wording Changes from Ada 83_
31208
31209 31.a
31210 We have gotten rid of parameters "of the form of a type
31211 conversion" (see RM83-6.4.1(3)). The new view semantics of
31212 type_conversions allows us to use normal type_conversions
31213 instead.
31214
31215 31.b
31216 We have moved wording about run-time semantics of parameter
31217 associations to *note 6.4.1::.
31218
31219 31.c
31220 We have moved wording about raising Program_Error for a
31221 function that falls off the end to here from RM83-6.5.
31222
31223 _Extensions to Ada 95_
31224
31225 31.d/2
31226 {AI95-00310-01AI95-00310-01} Nondispatching abstract
31227 operations are no longer considered when resolving a
31228 subprogram call. That makes it possible to use abstract to
31229 "undefine" a predefined operation for an untagged type.
31230 That's especially helpful when defining custom arithmetic
31231 packages.
31232
31233 _Wording Changes from Ada 95_
31234
31235 31.e/2
31236 {AI95-00231-01AI95-00231-01} Changed the definition of the
31237 nominal subtype of a function_call to use the nominal subtype
31238 wording of *note 6.1::, to take into account null_exclusions
31239 and access result types.
31240
31241 31.f/2
31242 {AI95-00345-01AI95-00345-01} Added wording to clarify that the
31243 meaning of a call on a subprogram "implemented by" an entry or
31244 protected operation is defined by *note 3.9.2::.
31245
31246 31.g/2
31247 {AI95-00407-01AI95-00407-01} Defined the meaning of a call on
31248 a prefixed view of a subprogram (see *note 4.1.3::).
31249
31250 * Menu:
31251
31252 * 6.4.1 :: Parameter Associations
31253
31254 \1f
31255 File: aarm2012.info, Node: 6.4.1, Up: 6.4
31256
31257 6.4.1 Parameter Associations
31258 ----------------------------
31259
31260 1
31261 [ A parameter association defines the association between an actual
31262 parameter and a formal parameter.]
31263
31264 _Language Design Principles_
31265
31266 1.a
31267 The parameter passing rules for out parameters are designed to
31268 ensure that the parts of a type that have implicit initial
31269 values (see *note 3.3.1::) don't become "de-initialized" by
31270 being passed as an out parameter.
31271
31272 1.b/3
31273 {AI05-0142-4AI05-0142-4} For explicitly aliased parameters of
31274 functions, we will ensure at the call site that a part of the
31275 parameter can be returned as part of the function result
31276 without creating a dangling pointer. We do this with
31277 accessibility checks at the call site that all actual objects
31278 of explicitly aliased parameters live at least as long as the
31279 function result; then we can allow them to be returned as
31280 access discriminants or anonymous access results, as those
31281 have the master of the function result.
31282
31283 _Name Resolution Rules_
31284
31285 2/3
31286 {AI05-0118-1AI05-0118-1} The formal_parameter_selector_name of a named
31287 parameter_association (*note 6.4: S0181.) shall resolve to denote a
31288 parameter_specification (*note 6.1: S0175.) of the view being called;
31289 this is the formal parameter of the association. The formal parameter
31290 for a positional parameter_association (*note 6.4: S0181.) is the
31291 parameter with the corresponding position in the formal part of the view
31292 being called.
31293
31294 2.a/3
31295 To be honest: {AI05-0118-1AI05-0118-1} For positional
31296 parameters, the "corresponding position" is calculated after
31297 any transformation of prefixed views.
31298
31299 3
31300 The actual parameter is either the explicit_actual_parameter given in a
31301 parameter_association for a given formal parameter, or the corresponding
31302 default_expression if no parameter_association is given for the formal
31303 parameter. The expected type for an actual parameter is the type of the
31304 corresponding formal parameter.
31305
31306 3.a
31307 To be honest: The corresponding default_expression is the one
31308 of the corresponding formal parameter in the profile of the
31309 view denoted by the name or prefix of the call.
31310
31311 4
31312 If the mode is in, the actual is interpreted as an expression;
31313 otherwise, the actual is interpreted only as a name, if possible.
31314
31315 4.a
31316 Ramification: This formally resolves the ambiguity present in
31317 the syntax rule for explicit_actual_parameter. Note that we
31318 don't actually require that the actual be a name if the mode
31319 is not in; we do that below.
31320
31321 _Legality Rules_
31322
31323 5
31324 If the mode is in out or out, the actual shall be a name that denotes a
31325 variable.
31326
31327 5.a
31328 Discussion: We no longer need "or a type_conversion whose
31329 argument is the name of a variable," because a type_conversion
31330 is now a name, and a type_conversion of a variable is a
31331 variable.
31332
31333 5.b
31334 Reason: The requirement that the actual be a (variable) name
31335 is not an overload resolution rule, since we don't want the
31336 difference between expression and name to be used to resolve
31337 overloading. For example:
31338
31339 5.c
31340 procedure Print(X : in Integer; Y : in Boolean := True);
31341 procedure Print(Z : in out Integer);
31342 . . .
31343 Print(3); -- Ambiguous!
31344
31345
31346 5.d
31347 The above call to Print is ambiguous even though the call is
31348 not compatible with the second Print which requires an actual
31349 that is a (variable) name ("3" is an expression, not a name).
31350 This requirement is a legality rule, so overload resolution
31351 fails before it is considered, meaning that the call is
31352 ambiguous.
31353
31354 6/3
31355 {AI05-0102-1AI05-0102-1} {AI05-0142-4AI05-0142-4} If the formal
31356 parameter is an explicitly aliased parameter, the type of the actual
31357 parameter shall be tagged or the actual parameter shall be an aliased
31358 view of an object. Further, if the formal parameter subtype F is
31359 untagged:
31360
31361 6.1/3
31362 * the subtype F shall statically match the nominal subtype of the
31363 actual object; or
31364
31365 6.2/3
31366 * the subtype F shall be unconstrained, discriminated in its full
31367 view, and unconstrained in any partial view.
31368
31369 6.a/3
31370 Ramification: Tagged objects (and tagged aggregates for in
31371 parameters) do not need to be aliased. This matches the
31372 behavior of unaliased formal parameters of tagged types, which
31373 allow 'Access to be taken of the formal parameter regardless
31374 of the form of the actual parameter.
31375
31376 6.b/3
31377 Reason: We need the subtype check on untagged actual
31378 parameters so that the requirements of 'Access are not lost.
31379 'Access makes its checks against the nominal subtype of its
31380 prefix, and parameter passing can change that subtype. But we
31381 don't want this parameter passing to change the objects that
31382 would be allowed as the prefix of 'Access. This is
31383 particularly important for arrays, where we don't want to
31384 require any additional implementation burden.
31385
31386 6.3/3
31387 {AI05-0142-4AI05-0142-4} {AI05-0234-1AI05-0234-1} In a function call,
31388 the accessibility level of the actual object for each explicitly aliased
31389 parameter shall not be statically deeper than the accessibility level of
31390 the master of the call (see *note 3.10.2::).
31391
31392 6.c/3
31393 Discussion: Since explicitly aliased parameters are either
31394 tagged or required to be objects, there is always an object
31395 (possibly anonymous) to talk about. This is discussing the
31396 static accessibility level of the actual object; it does not
31397 depend on any runtime information (for instance when the
31398 actual object is a formal parameter of another subprogram, it
31399 does not depend on the actual parameter of that other
31400 subprogram).
31401
31402 6.d/3
31403 Ramification: This accessibility check (and its dynamic cousin
31404 as well) can only fail if the function call is used to
31405 directly initialize a built-in-place object with a master
31406 different than that enclosing the call. The only place all of
31407 those conditions exist is in the initializer of an allocator;
31408 in all other cases this check will always pass.
31409
31410 6.4/3
31411 {AI05-0144-2AI05-0144-2} Two names are known to denote the same object
31412 if:
31413
31414 6.5/3
31415 * both names statically denote the same stand-alone object or
31416 parameter; or
31417
31418 6.6/3
31419 * both names are selected_components, their prefixes are known to
31420 denote the same object, and their selector_names denote the same
31421 component; or
31422
31423 6.7/3
31424 * both names are dereferences (implicit or explicit) and the
31425 dereferenced names are known to denote the same object; or
31426
31427 6.8/3
31428 * both names are indexed_components, their prefixes are known to
31429 denote the same object, and each of the pairs of corresponding
31430 index values are either both static expressions with the same
31431 static value or both names that are known to denote the same
31432 object; or
31433
31434 6.9/3
31435 * both names are slices, their prefixes are known to denote the same
31436 object, and the two slices have statically matching index
31437 constraints; or
31438
31439 6.10/3
31440 * one of the two names statically denotes a renaming declaration
31441 whose renamed object_name is known to denote the same object as the
31442 other, the prefix of any dereference within the renamed object_name
31443 is not a variable, and any expression within the renamed
31444 object_name contains no references to variables nor calls on
31445 nonstatic functions.
31446
31447 6.e/3
31448 Reason: This exposes known renamings of slices, indexing, and
31449 so on to this definition. In particular, if we have
31450
31451 6.f/3
31452 C : Character renames S(1);
31453
31454 6.g/3
31455 then C and S(1) are known to denote the same object.
31456
31457 6.h/3
31458 We need the requirement that no variables occur in the
31459 prefixes of dereferences and in (index) expressions of the
31460 renamed object in order to avoid problems from later changes
31461 to those parts of renamed names. Consider:
31462
31463 6.i/3
31464 type Ref is access Some_Type;
31465 Ptr : Ref := new Some_Type'(...);
31466 X : Some_Type renames Ptr.all;
31467 begin
31468 Ptr := new Some_Type'(...);
31469 P (Func_With_Out_Params (Ptr.all), X);
31470
31471 6.j/3
31472 X and Ptr.all should not be known to denote the same object,
31473 since they denote different allocated objects (and this is not
31474 an unreasonable thing to do).
31475
31476 6.k/3
31477 To be honest: The exclusion of variables from renamed
31478 object_names is not enough to prevent altering the value of
31479 the name or expression by another access path. For instance,
31480 both in parameters passed by reference and access-to-constant
31481 values can designate variables. For the intended use of
31482 "known to be the same object", this is OK; the modification
31483 via another access path is very tricky and it is OK to reject
31484 code that would be buggy except for the tricky code. Assuming
31485 Element is an elementary type, consider the following example:
31486
31487 6.l/3
31488 Global : Tagged_Type;
31489
31490 6.m/3
31491 procedure Foo (Param : in Tagged_Type := Global) is
31492 X : Element renames Some_Global_Array (Param.C);
31493 begin
31494 Global.C := Global.C + 1;
31495 Swap (X, Some_Global_Array (Param.C));
31496
31497 6.n/3
31498 The rules will flag the call of procedure Swap as illegal,
31499 since X and Some_Global_Array (Parameter.C) are known to
31500 denote the same object (even though they will actually
31501 represent different objects if Param = Global). But this is
31502 only incorrect if the parameter actually is Global and not
31503 some other value; the error could exist for some calls. So
31504 this flagging seems harmless.
31505
31506 6.o/3
31507 Similar examples can be constructed using stand-alone
31508 composite constants with controlled or immutably limited
31509 components, and (as previously noted) with dereferences of
31510 access-to-constant values. Even when these examples flag a
31511 call incorrectly, that call depends on very tricky code
31512 (modifying the value of a constant); the code is likely to
31513 confuse future maintainers as well and thus we do not mind
31514 rejecting it.
31515
31516 6.p/3
31517 Discussion: Whether or not names or prefixes are known to
31518 denote the same object is determined statically. If the name
31519 contains some dynamic portion other than a dereference,
31520 indexed_component, or slice, it is not "known to denote the
31521 same object".
31522
31523 6.q/3
31524 These rules make no attempt to handle slices of objects that
31525 are known to be the same when the slices have dynamic bounds
31526 (other than the trivial case of bounds being defined by the
31527 same subtype), even when the bounds could be proven to be the
31528 same, as it is just too complex to get right and these rules
31529 are intended to be conservative.
31530
31531 6.r/3
31532 Ramification: "Known to denote the same object" is intended to
31533 be an equivalence relationship, that is, it is reflexive,
31534 symmetric, and transitive. We believe this follows from the
31535 rules. For instance, given the following declarations:
31536
31537 6.s/3
31538 S : String(1..10);
31539 ONE : constant Natural := 1;
31540 R : Character renames S(1);
31541
31542 6.t/3
31543 the names R and S(1) are known to denote the same object by
31544 the sixth bullet, and S(1) and S(ONE) are known to denote the
31545 same object by the fourth bullet, so using the sixth bullet on
31546 R and S(ONE), we simply have to test S(1) vs. S(ONE), which
31547 we already know denote the same object.
31548
31549 6.11/3
31550 {AI05-0144-2AI05-0144-2} Two names are known to refer to the same object
31551 if
31552
31553 6.12/3
31554 * The two names are known to denote the same object; or
31555
31556 6.13/3
31557 * One of the names is a selected_component, indexed_component, or
31558 slice and its prefix is known to refer to the same object as the
31559 other name; or
31560
31561 6.14/3
31562 * One of the two names statically denotes a renaming declaration
31563 whose renamed object_name is known to refer to the same object as
31564 the other name.
31565
31566 6.u/3
31567 Reason: This ensures that names Prefix.Comp and Prefix are
31568 known to refer to the same object for the purposes of the
31569 rules below. This intentionally does not include
31570 dereferences; we only want to worry about accesses to the same
31571 object, and a dereference changes the object in question.
31572 (There is nothing shared between an access value and the
31573 object it designates.)
31574
31575 6.15/3
31576 {AI05-0144-2AI05-0144-2} If a call C has two or more parameters of mode
31577 in out or out that are of an elementary type, then the call is legal
31578 only if:
31579
31580 6.16/3
31581 * For each name N that is passed as a parameter of mode in out or out
31582 to the call C, there is no other name among the other parameters of
31583 mode in out or out to C that is known to denote the same object.
31584
31585 6.v/3
31586 To be honest: This means visibly an elementary type; it does
31587 not include partial views of elementary types (partial views
31588 are always composite). That's necessary to avoid having
31589 Legality Rules depend on the contents of the private part.
31590
31591 6.17/3
31592 {AI05-0144-2AI05-0144-2} If a construct C has two or more direct
31593 constituents that are names or expressions whose evaluation may occur in
31594 an arbitrary order, at least one of which contains a function call with
31595 an in out or out parameter, then the construct is legal only if:
31596
31597 6.w/3
31598 Ramification: All of the places where the language allows an
31599 arbitrary order can be found by looking in the index under
31600 "arbitrary order, allowed". Note that this listing includes
31601 places that don't involve names or expressions (such as checks
31602 or finalization).
31603
31604 6.18/3
31605 * For each name N that is passed as a parameter of mode in out or out
31606 to some inner function call C2 (not including the construct C
31607 itself), there is no other name anywhere within a direct
31608 constituent of the construct C other than the one containing C2,
31609 that is known to refer to the same object.
31610
31611 6.x/3
31612 Ramification: This requirement cannot fail for a procedure or
31613 entry call alone; there must be at least one function with an
31614 in out or out parameter called as part of a parameter
31615 expression of the call in order for it to fail.
31616
31617 6.y/3
31618 Reason: These rules prevent obvious cases of dependence on the
31619 order of evaluation of names or expressions. Such dependence
31620 is usually a bug, and in any case, is not portable to another
31621 implementation (or even another optimization setting).
31622
31623 6.z/3
31624 In the case that the top-level construct C is a call, these
31625 rules do not require checks for most in out parameters, as the
31626 rules about evaluation of calls prevent problems. Similarly,
31627 we do not need checks for short circuit operations or other
31628 operations with a defined order of evaluation. The rules
31629 about arbitrary order (see *note 1.1.4::) allow evaluating
31630 parameters and writing parameters back in an arbitrary order,
31631 but not interleaving of evaluating parameters of one call with
31632 writing parameters back from another -- that would not
31633 correspond to any allowed sequential order.
31634
31635 6.19/3
31636 {AI05-0144-2AI05-0144-2} For the purposes of checking this rule:
31637
31638 6.20/3
31639 * For an array aggregate, an expression associated with a
31640 discrete_choice_list that has two or more discrete choices, or that
31641 has a nonstatic range, is considered as two or more separate
31642 occurrences of the expression;
31643
31644 6.21/3
31645 * For a record aggregate:
31646
31647 6.22/3
31648 * The expression of a record_component_association is
31649 considered to occur once for each associated component;
31650 and
31651
31652 6.23/3
31653 * The default_expression for each
31654 record_component_association with <> for which the
31655 associated component has a default_expression is
31656 considered part of the aggregate;
31657
31658 6.24/3
31659 * For a call, any default_expression evaluated as part of the call is
31660 considered part of the call.
31661
31662 6.aa/3
31663 Ramification: We do not check expressions that are evaluated
31664 only because of a component initialized by default in an
31665 aggregate (via <>).
31666
31667 _Dynamic Semantics_
31668
31669 7
31670 For the evaluation of a parameter_association:
31671
31672 8
31673 * The actual parameter is first evaluated.
31674
31675 9
31676 * For an access parameter, the access_definition is elaborated, which
31677 creates the anonymous access type.
31678
31679 10
31680 * For a parameter [(of any mode)] that is passed by reference (see
31681 *note 6.2::), a view conversion of the actual parameter to the
31682 nominal subtype of the formal parameter is evaluated, and the
31683 formal parameter denotes that conversion.
31684
31685 10.a
31686 Discussion: We are always allowing sliding, even for [in] out
31687 by-reference parameters.
31688
31689 11
31690 * For an in or in out parameter that is passed by copy (see *note
31691 6.2::), the formal parameter object is created, and the value of
31692 the actual parameter is converted to the nominal subtype of the
31693 formal parameter and assigned to the formal.
31694
31695 11.a
31696 Ramification: The conversion mentioned here is a value
31697 conversion.
31698
31699 12
31700 * For an out parameter that is passed by copy, the formal parameter
31701 object is created, and:
31702
31703 13/3
31704 * {AI05-0153-3AI05-0153-3} {AI05-0196-1AI05-0196-1} For an
31705 access type, the formal parameter is initialized from the
31706 value of the actual, without checking that the value satisfies
31707 any constraint, any predicate, or any exclusion of the null
31708 value;
31709
31710 13.a
31711 Reason: This preserves the Language Design Principle that an
31712 object of an access type is always initialized with a
31713 "reasonable" value.
31714
31715 13.1/3
31716 * {AI05-0153-3AI05-0153-3} {AI05-0228-1AI05-0228-1} For a scalar
31717 type that has the Default_Value aspect specified, the formal
31718 parameter is initialized from the value of the actual, without
31719 checking that the value satisfies any constraint or any
31720 predicate;
31721
31722 13.b/3
31723 Reason: This preserves the Language Design Principle that all
31724 objects of a type with an implicit initial value are
31725 initialized. This is important so that a programmer can
31726 guarantee that all objects of a scalar type have a valid value
31727 with a carefully chosen Default_Value.
31728
31729 13.c/3
31730 Implementation Note: This rule means that out parameters of a
31731 subtype T with a specified Default_Value need to be large
31732 enough to support any possible value of the base type of T. In
31733 contrast, a type that does not have a Default_Value only need
31734 support the size of the subtype (since no values are passed
31735 in).
31736
31737 14
31738 * For a composite type with discriminants or that has implicit
31739 initial values for any subcomponents (see *note 3.3.1::), the
31740 behavior is as for an in out parameter passed by copy.
31741
31742 14.a
31743 Reason: This ensures that no part of an object of such a type
31744 can become "de-initialized" by being part of an out parameter.
31745
31746 14.b
31747 Ramification: This includes an array type whose component type
31748 is an access type, and a record type with a component that has
31749 a default_expression, among other things.
31750
31751 15
31752 * For any other type, the formal parameter is uninitialized. If
31753 composite, a view conversion of the actual parameter to the
31754 nominal subtype of the formal is evaluated [(which might raise
31755 Constraint_Error)], and the actual subtype of the formal is
31756 that of the view conversion. If elementary, the actual
31757 subtype of the formal is given by its nominal subtype.
31758
31759 15.a/3
31760 Ramification: {AI05-0228-1AI05-0228-1} This case covers scalar
31761 types that do not have Default_Value specified, and composite
31762 types whose subcomponent's subtypes do not have any implicit
31763 initial values. The view conversion for composite types
31764 ensures that if the lengths don't match between an actual and
31765 a formal array parameter, the Constraint_Error is raised
31766 before the call, rather than after.
31767
31768 15.1/3
31769 * {AI05-0142-4AI05-0142-4} {AI05-0234-1AI05-0234-1} In a function
31770 call, for each explicitly aliased parameter, a check is made that
31771 the accessibility level of the master of the actual object is not
31772 deeper than that of the master of the call (see *note 3.10.2::).
31773
31774 15.a.1/3
31775 Ramification: If the actual object to a call C is a formal
31776 parameter of some function call F, no dynamic check against
31777 the master of the actual parameter of F is necessary. Any
31778 case which could fail the dynamic check is already statically
31779 illegal (either at the call site of F, or at the call site C).
31780 This is important, as it would require nasty distributed
31781 overhead to accurately know the dynamic accessibility of a
31782 formal parameter (all tagged and explicitly aliased parameters
31783 would have to carry accessibility levels).
31784
31785 16
31786 A formal parameter of mode in out or out with discriminants is
31787 constrained if either its nominal subtype or the actual parameter is
31788 constrained.
31789
31790 17
31791 After normal completion and leaving of a subprogram, for each in out or
31792 out parameter that is passed by copy, the value of the formal parameter
31793 is converted to the subtype of the variable given as the actual
31794 parameter and assigned to it. These conversions and assignments occur
31795 in an arbitrary order.
31796
31797 17.a
31798 Ramification: The conversions mentioned above during parameter
31799 passing might raise Constraint_Error -- (see *note 4.6::).
31800
31801 17.b
31802 Ramification: If any conversion or assignment as part of
31803 parameter passing propagates an exception, the exception is
31804 raised at the place of the subprogram call; that is, it cannot
31805 be handled inside the subprogram_body.
31806
31807 17.c
31808 Proof: Since these checks happen before or after executing the
31809 subprogram_body, the execution of the subprogram_body does not
31810 dynamically enclose them, so it can't handle the exceptions.
31811
31812 17.d
31813 Discussion: The variable we're talking about is the one
31814 denoted by the variable_name given as the
31815 explicit_actual_parameter. If this variable_name is a
31816 type_conversion, then the rules in *note 4.6:: for assigning
31817 to a view conversion apply. That is, if X is of subtype S1,
31818 and the actual is S2(X), the above-mentioned conversion will
31819 convert to S2, and the one mentioned in *note 4.6:: will
31820 convert to S1.
31821
31822 _Erroneous Execution_
31823
31824 18/3
31825 {AI05-0008-1AI05-0008-1} If the nominal subtype of a formal parameter
31826 with discriminants is constrained or indefinite, and the parameter is
31827 passed by reference, then the execution of the call is erroneous if the
31828 value of any discriminant of the actual is changed while the formal
31829 parameter exists (that is, before leaving the corresponding callable
31830 construct).
31831
31832 _Extensions to Ada 83_
31833
31834 18.a
31835 In Ada 95, a program can rely on the fact that passing an
31836 object as an out parameter does not "de-initialize" any parts
31837 of the object whose subtypes have implicit initial values.
31838 (This generalizes the RM83 rule that required copy-in for
31839 parts that were discriminants or of an access type.)
31840
31841 _Wording Changes from Ada 83_
31842
31843 18.b/3
31844 {AI05-0299-1AI05-0299-1} We have eliminated the subclause on
31845 Default Parameters, as it is subsumed by earlier subclauses.
31846
31847 _Inconsistencies With Ada 2005_
31848
31849 18.c/3
31850 {AI05-0196-1AI05-0196-1} Correction: Clarified that out
31851 parameters of an access type are not checked for null
31852 exclusions when they are passed in (which is similar to the
31853 behavior for constraints). This was unspecified in Ada 2005,
31854 so a program which depends on the behavior of an
31855 implementation which does check the exclusion may malfunction.
31856 But a program depending on an exception being raised is
31857 unlikely.
31858
31859 _Incompatibilities With Ada 2005_
31860
31861 18.d/3
31862 {AI05-0144-2AI05-0144-2} Additional rules have been added to
31863 make illegal passing the same elementary object to more than
31864 one in out or out parameters of the same call. In this case,
31865 the result in the object could depend on the compiler version,
31866 optimization settings, and potentially the phase of the moon,
31867 so this check will mostly reject programs that are nonportable
31868 and could fail with any change. Even when the result is
31869 expected to be the same in both parameters, the code is
31870 unnecessarily tricky. Programs which fail this new check
31871 should be rare and are easily fixed by adding a temporary
31872 object.
31873
31874 _Wording Changes from Ada 2005_
31875
31876 18.e/3
31877 {AI05-0008-1AI05-0008-1} Correction: A missing rule was added
31878 to cover cases that were missed in Ada 95 and Ada 2005;
31879 specifically, that an in parameter passed by reference might
31880 have its discriminants changed via another path. Such cases
31881 are erroneous as requiring compilers to detect such errors
31882 would be expensive, and requiring such cases to work would be
31883 a major change of the user model (in parameters with
31884 discriminants could no longer be assumed constant). This is
31885 not an inconsistency, as compilers are not required to change
31886 any current behavior.
31887
31888 18.f/3
31889 {AI05-0102-1AI05-0102-1} Correction: Moved implicit conversion
31890 Legality Rule to *note 8.6::.
31891
31892 18.g/3
31893 {AI05-0118-1AI05-0118-1} Correction: Added a definition for
31894 positional parameters, as this is missing from Ada 95 and
31895 later.
31896
31897 18.h/3
31898 {AI05-0142-4AI05-0142-4} Rules have been added defining the
31899 legality and dynamic checks needed for explicitly aliased
31900 parameters (see *note 6.1::).
31901
31902 18.i/3
31903 {AI05-0144-2AI05-0144-2} Additional rules have been added such
31904 that passing an object to an in out or out parameter of a
31905 function is illegal if it is used elsewhere in a construct
31906 which allows evaluation in an arbitrary order. Such calls are
31907 not portable (since the results may depend on the evaluation
31908 order), and the results could even vary because of
31909 optimization settings and the like. Thus they've been banned.
31910
31911 \1f
31912 File: aarm2012.info, Node: 6.5, Next: 6.6, Prev: 6.4, Up: 6
31913
31914 6.5 Return Statements
31915 =====================
31916
31917 1/2
31918 {AI95-00318-02AI95-00318-02} A simple_return_statement (*note 6.5:
31919 S0183.) or extended_return_statement (*note 6.5: S0186.) (collectively
31920 called a return statement) is used to complete the execution of the
31921 innermost enclosing subprogram_body (*note 6.3: S0177.), entry_body
31922 (*note 9.5.2: S0221.), or accept_statement (*note 9.5.2: S0219.).
31923
31924 _Syntax_
31925
31926 2/2
31927 {AI95-00318-02AI95-00318-02} simple_return_statement ::= return [
31928 expression];
31929
31930 2.1/3
31931 {AI05-0277-1AI05-0277-1} extended_return_object_declaration ::=
31932 defining_identifier : [aliased][constant]
31933 return_subtype_indication [:= expression]
31934
31935 2.2/3
31936 {AI95-00318-02AI95-00318-02} {AI05-0015-1AI05-0015-1}
31937 {AI05-0053-1AI05-0053-1} {AI05-0277-1AI05-0277-1}
31938 {AI05-0299-1AI05-0299-1} extended_return_statement ::=
31939 return extended_return_object_declaration [do
31940 handled_sequence_of_statements
31941 end return];
31942
31943 2.3/2
31944 {AI95-00318-02AI95-00318-02} return_subtype_indication ::=
31945 subtype_indication | access_definition
31946
31947 _Name Resolution Rules_
31948
31949 3/2
31950 {AI95-00318-02AI95-00318-02} The result subtype of a function is the
31951 subtype denoted by the subtype_mark, or defined by the
31952 access_definition, after the reserved word return in the profile of the
31953 function. The expected type for the expression, if any, of a
31954 simple_return_statement (*note 6.5: S0183.) is the result type of the
31955 corresponding function. The expected type for the expression of an
31956 extended_return_statement is that of the return_subtype_indication
31957 (*note 6.5: S0187.).
31958
31959 3.a
31960 To be honest: The same applies to generic functions.
31961
31962 _Legality Rules_
31963
31964 4/2
31965 {AI95-00318-02AI95-00318-02} A return statement shall be within a
31966 callable construct, and it applies to the innermost callable construct
31967 or extended_return_statement that contains it. A return statement shall
31968 not be within a body that is within the construct to which the return
31969 statement applies.
31970
31971 5/3
31972 {AI95-00318-02AI95-00318-02} {AI05-0015-1AI05-0015-1} A function body
31973 shall contain at least one return statement that applies to the function
31974 body, unless the function contains code_statements. A
31975 simple_return_statement (*note 6.5: S0183.) shall include an expression
31976 if and only if it applies to a function body. An
31977 extended_return_statement shall apply to a function body. An
31978 extended_return_statement with the reserved word constant shall include
31979 an expression.
31980
31981 5.a/2
31982 Reason: {AI95-00318-02AI95-00318-02} The requirement that a
31983 function body has to have at least one return statement is a
31984 "helpful" restriction. There has been some interest in
31985 lifting this restriction, or allowing a raise statement to
31986 substitute for the return statement. However, there was
31987 enough interest in leaving it as is that we decided not to
31988 change it.
31989
31990 5.b/2
31991 Ramification: {AI95-00318-02AI95-00318-02} A return statement
31992 can apply to an extended_return_statement, so a
31993 simple_return_statement (*note 6.5: S0183.) without an
31994 expression can be given in one. However, neither
31995 simple_return_statement (*note 6.5: S0183.) with an expression
31996 nor an extended_return_statement can be given inside an
31997 extended_return_statement, as they must apply (directly) to a
31998 function body.
31999
32000 5.1/2
32001 {AI95-00318-02AI95-00318-02} For an extended_return_statement (*note
32002 6.5: S0186.) that applies to a function body:
32003
32004 5.2/3
32005 * {AI95-00318-02AI95-00318-02} {AI05-0032-1AI05-0032-1}
32006 {AI05-0103-1AI05-0103-1} If the result subtype of the function is
32007 defined by a subtype_mark, the return_subtype_indication (*note
32008 6.5: S0187.) shall be a subtype_indication. The type of the
32009 subtype_indication shall be covered by the result type of the
32010 function. The subtype defined by the subtype_indication shall be
32011 statically compatible with the result subtype of the function; if
32012 the result type of the function is elementary, the two subtypes
32013 shall statically match. If the result subtype of the function is
32014 indefinite, then the subtype defined by the subtype_indication
32015 shall be a definite subtype, or there shall be an expression.
32016
32017 5.3/2
32018 * {AI95-00318-02AI95-00318-02} If the result subtype of the function
32019 is defined by an access_definition, the return_subtype_indication
32020 (*note 6.5: S0187.) shall be an access_definition. The subtype
32021 defined by the access_definition shall statically match the result
32022 subtype of the function. The accessibility level of this anonymous
32023 access subtype is that of the result subtype.
32024
32025 5.4/3
32026 * {AI05-0032-1AI05-0032-1} If the result subtype of the function is
32027 class-wide, the accessibility level of the type of the subtype
32028 defined by the return_subtype_indication shall not be statically
32029 deeper than that of the master that elaborated the function body.
32030
32031 5.b.1/3
32032 Reason: In this case, the return_subtype_indication could be a
32033 specific type initialized by default; in that case there is no
32034 expression to check.
32035
32036 5.5/3
32037 {AI95-00318-02AI95-00318-02} {AI05-0032-1AI05-0032-1} For any return
32038 statement that applies to a function body:
32039
32040 5.6/3
32041 * {AI95-00318-02AI95-00318-02} {AI05-0188-1AI05-0188-1} [If the
32042 result subtype of the function is limited, then the expression of
32043 the return statement (if any) shall meet the restrictions described
32044 in *note 7.5::.]
32045
32046 5.c/3
32047 This paragraph was deleted.{AI05-0188-1AI05-0188-1}
32048
32049 5.7/3
32050 * {AI95-00416-01AI95-00416-01} {AI05-0032-1AI05-0032-1}
32051 {AI05-0051-1AI05-0051-1} If the result subtype of the function is
32052 class-wide, the accessibility level of the type of the expression
32053 (if any) of the return statement shall not be statically deeper
32054 than that of the master that elaborated the function body.
32055
32056 5.d/3
32057 Discussion: {AI05-0032-1AI05-0032-1} {AI05-0051-1AI05-0051-1}
32058 If the result type is class wide, then there must be an
32059 expression of the return statement unless this is an
32060 extended_return_statement whose return_subtype_indication is a
32061 specific type. We have a separate rule to cover that case.
32062 Note that if an extended_return_statement has an expression,
32063 then both this rule and the next one must be satisfied.
32064
32065 5.8/3
32066 * {AI05-0051-1AI05-0051-1} If the subtype determined by the
32067 expression of the simple_return_statement or by the
32068 return_subtype_indication has one or more access discriminants, the
32069 accessibility level of the anonymous access type of each access
32070 discriminant shall not be statically deeper than that of the master
32071 that elaborated the function body.
32072
32073 5.d.1/3
32074 Discussion: We use the type used by the return statement
32075 rather than from the function return type since we want to
32076 check whenever the return object has access discriminants,
32077 even if the function return type doesn't have any (mostly for
32078 a class-wide type).
32079
32080 5.9/3
32081 {AI05-0277-1AI05-0277-1} If the keyword aliased is present in an
32082 extended_return_object_declaration, the type of the extended return
32083 object shall be immutably limited.
32084
32085 _Static Semantics_
32086
32087 5.10/3
32088 {AI95-00318-02AI95-00318-02} {AI05-0015-1AI05-0015-1}
32089 {AI05-0144-2AI05-0144-2} Within an extended_return_statement, the return
32090 object is declared with the given defining_identifier, with the nominal
32091 subtype defined by the return_subtype_indication (*note 6.5: S0187.).
32092 An extended_return_statement with the reserved word constant is a full
32093 constant declaration that declares the return object to be a constant
32094 object.
32095
32096 _Dynamic Semantics_
32097
32098 5.11/3
32099 {AI95-00318-02AI95-00318-02} {AI95-00416-01AI95-00416-01}
32100 {AI05-0032-1AI05-0032-1} For the execution of an
32101 extended_return_statement, the subtype_indication or access_definition
32102 is elaborated. This creates the nominal subtype of the return object.
32103 If there is an expression, it is evaluated and converted to the nominal
32104 subtype (which might raise Constraint_Error -- see *note 4.6::); the
32105 return object is created and the converted value is assigned to the
32106 return object. Otherwise, the return object is created and initialized
32107 by default as for a stand-alone object of its nominal subtype (see *note
32108 3.3.1::). If the nominal subtype is indefinite, the return object is
32109 constrained by its initial value. A check is made that the value of the
32110 return object belongs to the function result subtype. Constraint_Error
32111 is raised if this check fails.
32112
32113 5.e/2
32114 Ramification: If the result type is controlled or has a
32115 controlled part, appropriate calls on Initialize or Adjust are
32116 performed prior to executing the
32117 handled_sequence_of_statements, except when the initial
32118 expression is an aggregate (which requires build-in-place with
32119 no call on Adjust).
32120
32121 5.f/3
32122 {AI05-0005-1AI05-0005-1} If the return statement is left
32123 without resulting in a return (for example, due to an
32124 exception propagated from the expression or the
32125 handled_sequence_of_statements, or a goto out of the
32126 handled_sequence_of_statements), if the return object has been
32127 created, it is finalized prior to leaving the return
32128 statement. If it has not been created when the return
32129 statement is left, it is not created or finalized.
32130
32131 5.g/3
32132 {AI05-0032-1AI05-0032-1} Other rules ensure that the check
32133 required by this rule cannot fail unless the function has a
32134 class-wide result subtype where the associated specific
32135 subtype is constrained. In other cases, either the subtypes
32136 have to match or the function's subtype is unconstrained and
32137 needs no checking.
32138
32139 6/2
32140 {AI95-00318-02AI95-00318-02} For the execution of a
32141 simple_return_statement (*note 6.5: S0183.), the expression (if any) is
32142 first evaluated, converted to the result subtype, and then is assigned
32143 to the anonymous return object.
32144
32145 6.a
32146 Ramification: The conversion might raise Constraint_Error --
32147 (see *note 4.6::).
32148
32149 7/2
32150 {AI95-00318-02AI95-00318-02} {AI95-00416-01AI95-00416-01} [If the return
32151 object has any parts that are tasks, the activation of those tasks does
32152 not occur until after the function returns (see *note 9.2::).]
32153
32154 7.a/2
32155 Proof: This is specified by the rules in *note 9.2::.
32156
32157 7.b/2
32158 Reason: Only the caller can know when task activations should
32159 take place, as it depends on the context of the call. If the
32160 function is being used to initialize the component of some
32161 larger object, then that entire object must be initialized
32162 before any task activations. Even after the outer object is
32163 fully initialized, task activations are still postponed until
32164 the begin at the end of the declarative part if the function
32165 is being used to initialize part of a declared object.
32166
32167 8/3
32168 {AI95-00318-02AI95-00318-02} {AI95-00344-01AI95-00344-01}
32169 {AI05-0024-1AI05-0024-1} {AI05-0032-1AI05-0032-1} If the result type of
32170 a function is a specific tagged type, the tag of the return object is
32171 that of the result type. If the result type is class-wide, the tag of
32172 the return object is that of the type of the subtype_indication if it is
32173 specific, or otherwise that of the value of the expression. A check is
32174 made that the master of the type identified by the tag of the result
32175 includes the elaboration of the master that elaborated the function
32176 body. If this check fails, Program_Error is raised.
32177
32178 8.a/2
32179 Ramification: {AI95-00318-02AI95-00318-02} The first sentence
32180 is true even if the tag of the expression is different, which
32181 could happen if the expression were a view conversion or a
32182 dereference of an access value. Note that for a limited type,
32183 because of the restriction to aggregates and function calls
32184 (and no conversions), the tag will already match.
32185
32186 8.b/2
32187 Reason: {AI95-00318-02AI95-00318-02} The first rule ensures
32188 that a function whose result type is a specific tagged type
32189 always returns an object whose tag is that of the result type.
32190 This is important for dispatching on controlling result, and
32191 allows the caller to allocate the appropriate amount of space
32192 to hold the value being returned (assuming there are no
32193 discriminants).
32194
32195 8.c/3
32196 The master check prevents the returned object from outliving
32197 its type. Note that this check cannot fail for a specific
32198 tagged type, as the tag represents the function's type, which
32199 necessarily must be declared outside of the function.
32200
32201 8.d/3
32202 We can't use the normal accessibility level "deeper than"
32203 check here because we may have "incomparable" levels if the
32204 masters belong to two different tasks. This can happen when
32205 an accept statement calls a function declared in the enclosing
32206 task body, and the function returns an object passed to it
32207 from the accept statement, and this object was itself a
32208 parameter to the accept statement.
32209
32210 8.1/3
32211 {AI05-0073-1AI05-0073-1} If the result subtype of the function is
32212 defined by an access_definition designating a specific tagged type T, a
32213 check is made that the result value is null or the tag of the object
32214 designated by the result value identifies T. Constraint_Error is raised
32215 if this check fails.
32216
32217 8.e/3
32218 Reason: This check is needed so that dispatching on
32219 controlling access results works for tag-indeterminate
32220 functions. If it was not made, it would be possible for such
32221 functions to return an access to a descendant type, meaning
32222 the function could return an object with a tag different than
32223 the one assumed by the dispatching rules.
32224
32225 Paragraphs 9 through 20 were deleted.
32226
32227 21/3
32228 {AI95-00318-02AI95-00318-02} {AI95-00402-01AI95-00402-01}
32229 {AI95-00416-01AI95-00416-01} {AI05-0051-1AI05-0051-1} If any part of the
32230 specific type of the return object of a function (or coextension
32231 thereof) has one or more access discriminants whose value is not
32232 constrained by the result subtype of the function, a check is made that
32233 the accessibility level of the anonymous access type of each access
32234 discriminant, as determined by the expression or the
32235 return_subtype_indication (*note 6.5: S0187.) of the return statement,
32236 is not deeper than the level of the master of the call (see *note
32237 3.10.2::). If this check fails, Program_Error is raised.
32238
32239 21.a/2
32240 This paragraph was deleted.
32241
32242 21.b/2
32243 Reason: The check prevents the returned object (for a
32244 nonlimited type) from outliving the object designated by one
32245 of its discriminants. The check is made on the values of the
32246 discriminants, which may come from the
32247 return_subtype_indication (*note 6.5: S0187.) (if
32248 constrained), or the expression, but it is never necessary to
32249 check both.
32250
32251 21.c/3
32252 Implementation Note: {AI05-0234-1AI05-0234-1} The reason for
32253 saying "any part of the specific type" is to simplify
32254 implementation. In the case of class-wide result objects,
32255 this allows the testing of a simple flag in the tagged type
32256 descriptor that indicates whether the specific type has any
32257 parts with access discriminants. By basing the test on the
32258 type of the object rather than the object itself, we avoid
32259 concerns about whether subcomponents in variant parts and of
32260 arrays (which might be empty) are present.
32261
32262 21.d/3
32263 Discussion: {AI05-0234-1AI05-0234-1} For a function with a
32264 class-wide result type, the access values that need to be
32265 checked are determined by the tag of the return object. In
32266 order to implement this accessibility check in the case where
32267 the tag of the result is not known statically at the point of
32268 the return statement, an implementation may need to somehow
32269 associate with the tag of a specific tagged type an indication
32270 of whether the type has unconstrained access discriminants
32271 (explicit or inherited) or has any subcomponents with such
32272 discriminants. If an implementation is already maintaining a
32273 statically initialized descriptor of some kind for each
32274 specific tagged type, then an additional Boolean could be
32275 added to this descriptor.
32276
32277 21.e/3
32278 {AI05-0005-1AI05-0005-1} {AI05-0234-1AI05-0234-1} Note that
32279 the flag should only be queried in the case where the result
32280 object might have access discriminants that might have
32281 subtypes with "bad" accessibility levels (as determined by the
32282 rules of *note 3.10.2:: for determining the accessibility
32283 level of the type of an access discriminant in the expression
32284 or return_subtype_indication of a return statement).
32285
32286 21.f/3
32287 Thus, in a case like
32288
32289 21.g/3
32290 type Global is access T'Class;
32291 function F (Ptr : Global) return T'Class is
32292 begin
32293 return Ptr.all;
32294 end F;
32295
32296 21.h/3
32297 there is no need for a run-time accessibility check. While an
32298 object of T'Class "might have" access discriminants, the
32299 accessibility of those potential discriminants cannot be bad.
32300 The setting of the bit doesn't matter and there is no need to
32301 query it.
32302
32303 21.i/3
32304 On the other hand, given
32305
32306 21.j/3
32307 function F return T'Class is
32308 Local : T'Class := ... ;
32309 begin
32310 return Local;
32311 end F;
32312
32313 21.k/3
32314 In this case, a check would typically be required.
32315
32316 21.l/3
32317 The need for including subcomponents in this check is
32318 illustrated by the following example:
32319
32320 21.m/3
32321 X : aliased Integer;
32322
32323 21.n/3
32324 type Component_Type (Discrim : access Integer := X'Access)
32325 is limited null record;
32326
32327 21.o/3
32328 type Undiscriminated is record
32329 Fld : Component_Type;
32330 end record;
32331
32332 21.p/3
32333 function F return Undiscriminated is
32334 Local : aliased Integer;
32335 begin
32336 return X : Undiscriminated := (Fld => (Discrim => Local'Access)) do
32337 Foo;
32338 end return;
32339 -- raises Program_Error after calling Foo.
32340 end F;
32341
32342 21.q/3
32343 Ramification: {AI05-0234-1AI05-0234-1} In the case where the
32344 tag of the result is not known statically at the point of the
32345 return statement and the run-time accessibility check is
32346 needed, discriminant values and array bounds play no role in
32347 performing this check. That is, array components are assumed
32348 to have nonzero length and components declared within variant
32349 parts are assumed to be present. Thus, the check may be
32350 implemented simply by testing the aforementioned descriptor
32351 bit and conditionally raising Program_Error.
32352
32353 22/3
32354 {AI95-00318-02AI95-00318-02} {AI05-0058-1AI05-0058-1} For the execution
32355 of an extended_return_statement (*note 6.5: S0186.), the
32356 handled_sequence_of_statements (*note 11.2: S0265.) is executed. Within
32357 this handled_sequence_of_statements (*note 11.2: S0265.), the execution
32358 of a simple_return_statement (*note 6.5: S0183.) that applies to the
32359 extended_return_statement (*note 6.5: S0186.) causes a transfer of
32360 control that completes the extended_return_statement (*note 6.5:
32361 S0186.). Upon completion of a return statement that applies to a
32362 callable construct by the normal completion of a simple_return_statement
32363 (*note 6.5: S0183.) or by reaching the end return of an
32364 extended_return_statement (*note 6.5: S0186.), a transfer of control is
32365 performed which completes the execution of the callable construct, and
32366 returns to the caller.
32367
32368 22.a/3
32369 Ramification: {AI05-0058-1AI05-0058-1} A transfer of control
32370 that completes an extended_return_statement (such as an exit
32371 or goto) does not cause a return to the caller unless it is
32372 caused by simple_return_statement (that is, triggers the
32373 second sentence of this paragraph). The return to the caller
32374 occurs for the simple_return_statement that applies to an
32375 extended_return_statement because the last sentence says "the
32376 normal completion of a simple_return_statement", which
32377 includes the one nested in the extended_return_statement.
32378
32379 23/2
32380 {AI95-00318-02AI95-00318-02} In the case of a function, the
32381 function_call denotes a constant view of the return object.
32382
32383 _Implementation Permissions_
32384
32385 24/3
32386 {AI95-00416-01AI95-00416-01} {AI05-0050-1AI05-0050-1} For a function
32387 call used to initialize a composite object with a constrained nominal
32388 subtype or used to initialize a return object that is built in place
32389 into such an object:
32390
32391 24.1/3
32392 * {AI05-0050-1AI05-0050-1} If the result subtype of the function is
32393 constrained, and conversion of an object of this subtype to the
32394 subtype of the object being initialized would raise
32395 Constraint_Error, then Constraint_Error may be raised before
32396 calling the function.
32397
32398 24.2/3
32399 * {AI05-0050-1AI05-0050-1} If the result subtype of the function is
32400 unconstrained, and a return statement is executed such that the
32401 return object is known to be constrained, and conversion of the
32402 return object to the subtype of the object being initialized would
32403 raise Constraint_Error, then Constraint_Error may be raised at the
32404 point of the call (after abandoning the execution of the function
32405 body).
32406
32407 24.a/3
32408 Reason: {AI95-00416-01AI95-00416-01} {AI05-0050-1AI05-0050-1}
32409 Without such a permission, it would be very difficult to
32410 implement "built-in-place" semantics. The intention is that
32411 the exception is raised at the same point that it would have
32412 been raised without the permission; it should not change
32413 handlers if the implementation switches between return-by-copy
32414 and built-in-place. This means that the exception is not
32415 handleable within the function, because in the return-by-copy
32416 case, the constraint check to verify that the result satisfies
32417 the constraints of the object being initialized happens after
32418 the function returns. This implies further that upon
32419 detecting such a situation, the implementation may need to
32420 simulate a goto to a point outside any local exception
32421 handlers prior to raising the exception.
32422
32423 24.b/3
32424 Ramification: {AI95-00416-01AI95-00416-01}
32425 {AI05-0050-1AI05-0050-1} These permissions do not apply in the
32426 case of an extended return object with mutable discriminants.
32427 That's necessary because in that case a return object can be
32428 created with the "wrong" discriminants and then changed to the
32429 "right" discriminants later (but before returning). We don't
32430 want this case raising an exception when the canonical
32431 semantics will not do so.
32432
32433 24.c/3
32434 {AI05-0050-1AI05-0050-1} It's still possible to write a
32435 program that will raise an exception using this permission
32436 that would not in the canonical semantics. That could happen
32437 if a return statement with the "wrong" discriminants or bounds
32438 is abandoned (via an exception, or for an
32439 extended_return_statement, via an exit or goto statement), and
32440 then a return statement with the "right" discriminants or
32441 bounds is executed. The only solution for this problem is to
32442 not have the permission at all, but this is too unusual of a
32443 case to worry about the effects of the permission, especially
32444 given the implementation difficulties for built-in-place
32445 objects that this permission is intended to ease.
32446
32447 24.d/3
32448 {AI05-0050-1AI05-0050-1} Note that the mutable-discriminant
32449 case only happens when built-in-place initialization is
32450 optional. This means that any difficulties associated with
32451 implementing built-in-place initialization without these
32452 permissions can be sidestepped by not building in place.
32453
32454 _Examples_
32455
32456 25
32457 Examples of return statements:
32458
32459 26/2
32460 {AI95-00318-02AI95-00318-02} return; -- in a procedure body, entry_body,
32461 -- accept_statement, or extended_return_statement
32462
32463 27
32464 return Key_Value(Last_Index); -- in a function body
32465
32466 28/2
32467 {AI95-00318-02AI95-00318-02} return Node : Cell do -- in a function body, see *note 3.10.1:: for Cell
32468 Node.Value := Result;
32469 Node.Succ := Next_Node;
32470 end return;
32471
32472 _Incompatibilities With Ada 83_
32473
32474 28.a/2
32475 {AI95-00318-02AI95-00318-02} In Ada 95, if the result type of
32476 a function has a part that is a task, then an attempt to
32477 return a local variable will raise Program_Error. This is
32478 illegal in Ada 2005, see below. In Ada 83, if a function
32479 returns a local variable containing a task, execution is
32480 erroneous according to AI83-00867. However, there are other
32481 situations where functions that return tasks (or that return a
32482 variant record only one of whose variants includes a task) are
32483 correct in Ada 83 but will raise Program_Error according to
32484 the new rules.
32485
32486 28.b
32487 The rule change was made because there will be more types
32488 (protected types, limited controlled types) in Ada 95 for
32489 which it will be meaningless to return a local variable, and
32490 making all of these erroneous is unacceptable. The current
32491 rule was felt to be the simplest that kept upward
32492 incompatibilities to situations involving returning tasks,
32493 which are quite rare.
32494
32495 _Wording Changes from Ada 83_
32496
32497 28.c/3
32498 {AI05-0299-1AI05-0299-1} This subclause has been moved here
32499 from chapter 5, since it has mainly to do with subprograms.
32500
32501 28.d
32502 A function now creates an anonymous object. This is necessary
32503 so that controlled types will work.
32504
32505 28.e/2
32506 {AI95-00318-02AI95-00318-02} We have clarified that a return
32507 statement applies to a callable construct, not to a callable
32508 entity.
32509
32510 28.f/2
32511 {AI95-00318-02AI95-00318-02} There is no need to mention
32512 generics in the rules about where a return statement can
32513 appear and what it applies to; the phrase "body of a
32514 subprogram or generic subprogram" is syntactic, and refers
32515 exactly to "subprogram_body".
32516
32517 _Inconsistencies With Ada 95_
32518
32519 28.f.1/3
32520 {AI95-0416-1AI95-0416-1} {AI05-0005-1AI05-0005-1}
32521 {AI05-0050-1AI05-0050-1} Added an Implementation Permission
32522 allowing early raising of Constraint_Error if the result
32523 cannot fit in the ultimate object. This gives implementations
32524 more flexibility to do built-in-place returns, and is
32525 essential for limited types (which cannot be built in a
32526 temporary). However, it allows raising Constraint_Error in
32527 some cases where it would not be raised if the permission was
32528 not used. See Inconsistencies With Ada 2005 for additional
32529 changes. This case is potentially inconsistent with Ada 95,
32530 but a compiler does not have to take advantage of these
32531 permissions for any Ada 95 code, so there should be little
32532 practical impact.
32533
32534 _Incompatibilities With Ada 95_
32535
32536 28.g/2
32537 {AI95-00318-02AI95-00318-02} The entire business about
32538 return-by-reference types has been dropped. Instead, the
32539 expression of a return statement of a limited type can only be
32540 an aggregate or function_call (see *note 7.5::). This means
32541 that returning a global object or type_conversion, legal in
32542 Ada 95, is now illegal. Such functions can be converted to
32543 use anonymous access return types by adding access in the
32544 function definition and return statement, adding .all in uses,
32545 and adding aliased in the object declarations. This has the
32546 advantage of making the reference return semantics much
32547 clearer to the casual reader.
32548
32549 28.h/2
32550 We changed these rules so that functions, combined with the
32551 new rules for limited types (*note 7.5::), can be used as
32552 build-in-place constructors for limited types. This reduces
32553 the differences between limited and nonlimited types, which
32554 will make limited types useful in more circumstances.
32555
32556 _Extensions to Ada 95_
32557
32558 28.i/2
32559 {AI95-00318-02AI95-00318-02} The extended_return_statement is
32560 new. This provides a name for the object being returned,
32561 which reduces the copying needed to return complex objects
32562 (including no copying at all for limited objects). It also
32563 allows component-by-component construction of the return
32564 object.
32565
32566 _Wording Changes from Ada 95_
32567
32568 28.j/2
32569 {AI95-00318-02AI95-00318-02} The wording was updated to
32570 support anonymous access return subtypes.
32571
32572 28.k/2
32573 {AI95-00318-02AI95-00318-02} The term "return expression" was
32574 dropped because reviewers found it confusing when applied to
32575 the default expression of an extended_return_statement.
32576
32577 28.l/2
32578 {AI95-00344-01AI95-00344-01} {AI95-00416-01AI95-00416-01}
32579 Added accessibility checks to class-wide return statements.
32580 These checks could not fail in Ada 95 (as all of the types had
32581 to be declared at the same level, so the tagged type would
32582 necessarily have been at the same level as the type of the
32583 object).
32584
32585 28.m/2
32586 {AI95-00402-01AI95-00402-01} {AI95-00416-01AI95-00416-01}
32587 Added accessibility checks to return statements for types with
32588 access discriminants. Since such types have to be limited in
32589 Ada 95, the expression of a return statement would have been
32590 illegal in order for this check to fail.
32591
32592 _Inconsistencies With Ada 2005_
32593
32594 28.n/3
32595 {AI05-0050-1AI05-0050-1} Correction: The Implementation
32596 Permission allowing early raising of Constraint_Error was
32597 modified to remove the most common of these cases from the
32598 permission (returning an object with mutable discriminants,
32599 where the return object is created with one set of
32600 discriminants and then changed to another). (The permission
32601 was also widened to allow the early check for constrained
32602 functions when that constraint is wrong.) However, there
32603 still is an unlikely case where the permission would allow an
32604 exception to be raised when none would be raised by the
32605 canonical semantics (when a return statement is abandoned).
32606 These changes can only remove the raising of an exception (or
32607 change the place where it is raised) compared to Ada 2005, so
32608 programs that depend on the previous behavior should be very
32609 rare.
32610
32611 28.o/3
32612 {AI05-0051-1AI05-0051-1} {AI05-0234-1AI05-0234-1} Correction:
32613 Accessibility checks for access discriminants now depend on
32614 the master of the call rather than the point of declaration of
32615 the function. This will result in cases that used to raise
32616 Program_Error now running without raising any exception. This
32617 is technically inconsistent with Ada 2005 (as defined by
32618 Amendment 1), but it is unlikely that any real code depends on
32619 the raising of this exception.
32620
32621 28.p/3
32622 {AI05-0073-1AI05-0073-1} Correction: Added a tag check for
32623 functions returning anonymous access-to-tagged types, so that
32624 dispatching of tag-indeterminate function works as expected.
32625 This is technically inconsistent with Ada 2005 (as defined by
32626 Amendment 1), but as the feature in question was newly added
32627 to Ada 2005, there should be little code that depends on the
32628 behavior that now raises an exception.
32629
32630 _Incompatibilities With Ada 2005_
32631
32632 28.q/3
32633 {AI05-0053-1AI05-0053-1} {AI05-0277-1AI05-0277-1} Correction:
32634 The aliased keyword can now only appear on extended return
32635 objects with an immutably limited type. Other types would
32636 provide a way to get an aliased view of an object that is not
32637 necessarily aliased, which would be very bad. This is
32638 incompatible, but since the feature was added in Ada 2005, the
32639 keyword had no defined meaning in Ada 2005 (a significant
32640 oversight), and most sensible uses involve immutably limited
32641 types, it is unlikely that it appears meaningfully in existing
32642 programs.
32643
32644 28.r/3
32645 {AI05-0103-1AI05-0103-1} Correction: Added wording to require
32646 static matching for unconstrained access types in extended
32647 return statements. This disallows adding or omitting null
32648 exclusions, and adding access constraints, in the declaration
32649 of the return object. While this is incompatible, the
32650 incompatible cases in question are either useless (access
32651 constraints - the constraint can be given on an allocator if
32652 necessary, and still must be given there even if given on the
32653 return object) or wrong (null exclusions - null could be
32654 returned from a function declared to be null excluding), so we
32655 expect them to be extremely rare in practice.
32656
32657 _Extensions to Ada 2005_
32658
32659 28.s/3
32660 {AI05-0015-1AI05-0015-1} {AI05-0144-2AI05-0144-2} The return
32661 object of an extended_return_statement can be declared
32662 constant; this works similarly to a constant object
32663 declaration.
32664
32665 28.t/3
32666 {AI05-0032-1AI05-0032-1} Added wording to allow the
32667 return_subtype_indication to have a specific type if the
32668 return subtype of the function is class-wide. Specifying the
32669 (specific) type of the return object is awkward without this
32670 change, and this is consistent with the way allocators work.
32671
32672 _Wording Changes from Ada 2005_
32673
32674 28.u/3
32675 {AI05-0024-1AI05-0024-1} Correction: Corrected the master
32676 check for tags since the masters may be for different tasks
32677 and thus incomparable.
32678
32679 28.v/3
32680 {AI05-0058-1AI05-0058-1} Correction: Corrected the wording
32681 defining returns for extended_return_statements, since leaving
32682 by an exit or goto is considered "normal" completion of the
32683 statement.
32684
32685 28.w/3
32686 {AI05-0205-1AI05-0205-1} {AI05-0277-1AI05-0277-1} Correction:
32687 Added the extended_return_object_declaration to make other
32688 rules easier to write and eliminate the problem described in
32689 AI05-0205-1.
32690
32691 * Menu:
32692
32693 * 6.5.1 :: Nonreturning Procedures
32694
32695 \1f
32696 File: aarm2012.info, Node: 6.5.1, Up: 6.5
32697
32698 6.5.1 Nonreturning Procedures
32699 -----------------------------
32700
32701 1/3
32702 {AI95-00329-01AI95-00329-01} {AI95-00414-01AI95-00414-01}
32703 {AI05-0229-1AI05-0229-1} Specifying aspect No_Return to have the value
32704 True indicates that a procedure cannot return normally[; it may
32705 propagate an exception or loop forever].
32706
32707 1.a/3
32708 Discussion: Aspect No_Deposit will have to wait for Ada 2020.
32709 :-)
32710
32711 Paragraphs 2 and 3 were moved to *note Annex J::, "*note Annex J::
32712 Obsolescent Features".
32713
32714 _Static Semantics_
32715
32716 3.1/3
32717 {AI05-0229-1AI05-0229-1} For a procedure or generic procedure, the
32718 following language-defined representation aspect may be specified:
32719
32720 3.2/3
32721 No_Return
32722 The type of aspect No_Return is Boolean. When aspect
32723 No_Return is True for an entity, the entity is said to be
32724 nonreturning.
32725
32726 3.3/3
32727 If directly specified, the aspect_definition shall be a
32728 static expression. [This aspect is never inherited;] if
32729 not directly specified, the aspect is False.
32730
32731 3.a/3
32732 Aspect Description for No_Return: A procedure will not return
32733 normally.
32734
32735 3.4/3
32736 {AI05-0229-1AI05-0229-1} If a generic procedure is nonreturning, then so
32737 are its instances. If a procedure declared within a generic unit is
32738 nonreturning, then so are the corresponding copies of that procedure in
32739 instances.
32740
32741 _Legality Rules_
32742
32743 4/3
32744 {AI95-00329-01AI95-00329-01} {AI95-00414-01AI95-00414-01}
32745 {AI05-0229-1AI05-0229-1} Aspect No_Return shall not be specified for a
32746 null procedure nor an instance of a generic unit.
32747
32748 4.a/2
32749 Reason: A null procedure cannot have the appropriate
32750 nonreturning semantics, as it does not raise an exception or
32751 loop forever.
32752
32753 4.b/3
32754 Ramification: {AI05-0229-1AI05-0229-1} The procedure can be
32755 abstract. If a nonreturning procedure is renamed (anywhere)
32756 calls through the new name still have the nonreturning
32757 semantics.
32758
32759 5/2
32760 {AI95-00329-01AI95-00329-01} {AI95-00414-01AI95-00414-01} A return
32761 statement shall not apply to a nonreturning procedure or generic
32762 procedure.
32763
32764 6/2
32765 {AI95-00414-01AI95-00414-01} A procedure shall be nonreturning if it
32766 overrides a dispatching nonreturning procedure. In addition to the
32767 places where Legality Rules normally apply (see *note 12.3::), this rule
32768 applies also in the private part of an instance of a generic unit.
32769
32770 6.a/2
32771 Reason: This ensures that dispatching calls to nonreturning
32772 procedures will, in fact, not return.
32773
32774 7/2
32775 {AI95-00414-01AI95-00414-01} If a renaming-as-body completes a
32776 nonreturning procedure declaration, then the renamed procedure shall be
32777 nonreturning.
32778
32779 7.a/2
32780 Reason: This ensures that no extra code is needed to implement
32781 the renames (that is, no wrapper is needed) as the body has
32782 the same property.
32783
32784 Paragraph 8 was deleted.
32785
32786 _Dynamic Semantics_
32787
32788 9/2
32789 {AI95-00329-01AI95-00329-01} {AI95-00414-01AI95-00414-01} If the body of
32790 a nonreturning procedure completes normally, Program_Error is raised at
32791 the point of the call.
32792
32793 9.a/2
32794 Discussion: Note that there is no name for suppressing this
32795 check, since the check represents a bug, imposes no time
32796 overhead, and minimal space overhead (since it can usually be
32797 statically eliminated as dead code).
32798
32799 9.b/2
32800 Implementation Note: If a nonreturning procedure tries to
32801 return, we raise Program_Error. This is stated as happening
32802 at the call site, because we do not wish to allow the
32803 procedure to handle the exception (and then, perhaps, try to
32804 return again!). However, the expected run-time model is that
32805 the compiler will generate raise Program_Error at the end of
32806 the procedure body (but not handleable by the procedure
32807 itself), as opposed to doing it at the call site. (This is
32808 just like the typical run-time model for functions that fall
32809 off the end without returning a value). The reason is
32810 indirect calls: in P.all(...);, the compiler cannot know
32811 whether P designates a nonreturning procedure or a normal one.
32812 Putting the raise Program_Error in the procedure's generated
32813 code solves this problem neatly.
32814
32815 9.c/2
32816 Similarly, if one passes a nonreturning procedure to a generic
32817 formal parameter, the compiler cannot know this at call sites
32818 (in shared code implementations); the raise-in-body solution
32819 deals with this neatly.
32820
32821 _Examples_
32822
32823 10/3
32824 {AI95-00433-01AI95-00433-01} {AI05-0229-1AI05-0229-1} procedure Fail(Msg : String) -- raises Fatal_Error exception
32825 with No_Return;
32826 -- Inform compiler and reader that procedure never returns normally
32827
32828 _Extensions to Ada 95_
32829
32830 10.a/2
32831 {AI95-00329-01AI95-00329-01} {AI95-00414-01AI95-00414-01}
32832 Pragma No_Return is new.
32833
32834 _Extensions to Ada 2005_
32835
32836 10.b/3
32837 {AI05-0229-1AI05-0229-1} Aspect No_Return is new; pragma
32838 No_Return is now obsolescent.
32839
32840 \1f
32841 File: aarm2012.info, Node: 6.6, Next: 6.7, Prev: 6.5, Up: 6
32842
32843 6.6 Overloading of Operators
32844 ============================
32845
32846 1
32847 An operator is a function whose designator is an operator_symbol.
32848 [Operators, like other functions, may be overloaded.]
32849
32850 _Name Resolution Rules_
32851
32852 2
32853 Each use of a unary or binary operator is equivalent to a function_call
32854 with function_prefix being the corresponding operator_symbol, and with
32855 (respectively) one or two positional actual parameters being the
32856 operand(s) of the operator (in order).
32857
32858 2.a/3
32859 To be honest: {AI05-0299-1AI05-0299-1} We also use the term
32860 operator (in Clause 4 and in *note 6.1::) to refer to one of
32861 the syntactic categories defined in *note 4.5::, "*note 4.5::
32862 Operators and Expression Evaluation" whose names end with
32863 "_operator:" logical_operator (*note 4.5: S0127.),
32864 relational_operator (*note 4.5: S0128.),
32865 binary_adding_operator (*note 4.5: S0129.),
32866 unary_adding_operator (*note 4.5: S0130.),
32867 multiplying_operator (*note 4.5: S0131.), and
32868 highest_precedence_operator (*note 4.5: S0132.).
32869
32870 2.b/3
32871 Discussion: {AI05-0005-1AI05-0005-1} This equivalence extends
32872 to uses of function_call in most other language rules.
32873 However, as often happens, the equivalence is not perfect, as
32874 operator calls are not a name, while a function_call is a
32875 name. Thus, operator calls cannot be used in contexts that
32876 require a name (such as a rename of an object). A direct fix
32877 for this problem would be very disruptive, and thus we have
32878 not done that. However, qualifying an operator call can be
32879 used as a workaround in contexts that require a name.
32880
32881 _Legality Rules_
32882
32883 3/3
32884 {AI05-0143-1AI05-0143-1} The subprogram_specification of a unary or
32885 binary operator shall have one or two parameters, respectively. The
32886 parameters shall be of mode in. A generic function instantiation whose
32887 designator is an operator_symbol is only allowed if the specification of
32888 the generic function has the corresponding number of parameters, and
32889 they are all of mode in.
32890
32891 4
32892 Default_expressions are not allowed for the parameters of an operator
32893 (whether the operator is declared with an explicit
32894 subprogram_specification or by a generic_instantiation).
32895
32896 5
32897 An explicit declaration of "/=" shall not have a result type of the
32898 predefined type Boolean.
32899
32900 _Static Semantics_
32901
32902 6/3
32903 {AI05-0128-1AI05-0128-1} An explicit declaration of "=" whose result
32904 type is Boolean implicitly declares an operator "/=" that gives the
32905 complementary result.
32906
32907 6.a/3
32908 Discussion: {AI05-0128-1AI05-0128-1} A "/=" defined by this
32909 rule is considered user-defined, which means that it will be
32910 inherited by a derived type. "User-defined" means "not
32911 language-defined" for the purposes of inheritance, that is
32912 anything other than predefined operators.
32913
32914 NOTES
32915
32916 7
32917 8 The operators "+" and "-" are both unary and binary operators,
32918 and hence may be overloaded with both one- and two-parameter
32919 functions.
32920
32921 _Examples_
32922
32923 8
32924 Examples of user-defined operators:
32925
32926 9
32927 function "+" (Left, Right : Matrix) return Matrix;
32928 function "+" (Left, Right : Vector) return Vector;
32929
32930 -- assuming that A, B, and C are of the type Vector
32931 -- the following two statements are equivalent:
32932
32933 A := B + C;
32934 A := "+"(B, C);
32935
32936 _Extensions to Ada 83_
32937
32938 9.a
32939 Explicit declarations of "=" are now permitted for any
32940 combination of parameter and result types.
32941
32942 9.b
32943 Explicit declarations of "/=" are now permitted, so long as
32944 the result type is not Boolean.
32945
32946 _Wording Changes from Ada 2005_
32947
32948 9.c/3
32949 {AI05-0128-1AI05-0128-1} Correction: Corrected the wording so
32950 that only explicit declarations of "=" cause an implicit
32951 declaration of "/="; otherwise, we could get multiple implicit
32952 definitions of "/=" without an obvious way to chose between
32953 them.
32954
32955 9.d/3
32956 {AI05-0143-1AI05-0143-1} Added wording so that operators only
32957 allow parameters of mode in. This was made necessary by the
32958 elimination elsewhere of the restriction that function
32959 parameters be only of mode in.
32960
32961 \1f
32962 File: aarm2012.info, Node: 6.7, Next: 6.8, Prev: 6.6, Up: 6
32963
32964 6.7 Null Procedures
32965 ===================
32966
32967 1/2
32968 {AI95-00348-01AI95-00348-01} A null_procedure_declaration provides a
32969 shorthand to declare a procedure with an empty body.
32970
32971 _Syntax_
32972
32973 2/3
32974 {AI95-00348-01AI95-00348-01} {AI05-0183-1AI05-0183-1}
32975 null_procedure_declaration ::=
32976 [overriding_indicator]
32977 procedure_specification is null
32978 [aspect_specification];
32979
32980 _Legality Rules_
32981
32982 2.1/3
32983 {AI05-0177-1AI05-0177-1} If a null_procedure_declaration is a
32984 completion, it shall be the completion of a subprogram_declaration or
32985 generic_subprogram_declaration. The profile of a
32986 null_procedure_declaration that completes a declaration shall conform
32987 fully to that of the declaration.
32988
32989 _Static Semantics_
32990
32991 3/3
32992 {AI95-00348-01AI95-00348-01} {AI05-0177-1AI05-0177-1}
32993 {AI05-0264-1AI05-0264-1} A null_procedure_declaration declares a null
32994 procedure. A completion is not allowed for a
32995 null_procedure_declaration; however, a null_procedure_declaration can
32996 complete a previous declaration.
32997
32998 3.a/2
32999 Reason: There are no null functions because the return value
33000 has to be constructed somehow; a function that always raises
33001 Program_Error doesn't seem very useful or worth the
33002 complication.
33003
33004 _Dynamic Semantics_
33005
33006 4/2
33007 {AI95-00348-01AI95-00348-01} The execution of a null procedure is
33008 invoked by a subprogram call. For the execution of a subprogram call on
33009 a null procedure, the execution of the subprogram_body has no effect.
33010
33011 4.a/2
33012 Ramification: Thus, a null procedure is equivalent to the body
33013
33014 4.b/2
33015 begin
33016 null;
33017 end;
33018
33019 4.c/2
33020 with the exception that a null procedure can be used in place
33021 of a procedure specification.
33022
33023 5/3
33024 {AI95-00348-01AI95-00348-01} {AI05-0177-1AI05-0177-1} The elaboration of
33025 a null_procedure_declaration has no other effect than to establish that
33026 the null procedure can be called without failing the Elaboration_Check.
33027
33028 _Examples_
33029
33030 6/2
33031 {AI95-00433-01AI95-00433-01} procedure Simplify(Expr : in out Expression) is null; -- see *note 3.9::
33032 -- By default, Simplify does nothing, but it may be overridden in extensions of Expression
33033
33034 _Extensions to Ada 95_
33035
33036 6.a/2
33037 {AI95-00348-01AI95-00348-01} Null procedures are new.
33038
33039 _Extensions to Ada 2005_
33040
33041 6.b/3
33042 {AI05-0177-1AI05-0177-1} A null_procedure_declaration can now
33043 be a completion.
33044
33045 6.c/3
33046 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
33047 be used in a null_procedure_declaration. This is described in
33048 *note 13.1.1::.
33049
33050 \1f
33051 File: aarm2012.info, Node: 6.8, Prev: 6.7, Up: 6
33052
33053 6.8 Expression Functions
33054 ========================
33055
33056 1/3
33057 {AI05-0177-1AI05-0177-1} An expression_function_declaration provides a
33058 shorthand to declare a function whose body consists of a single return
33059 statement.
33060
33061 _Syntax_
33062
33063 2/3
33064 {AI95-0177-1AI95-0177-1} expression_function_declaration ::=
33065 [overriding_indicator]
33066 function_specification is
33067 (expression)
33068 [aspect_specification];
33069
33070 _Name Resolution Rules_
33071
33072 3/3
33073 {AI05-0177-1AI05-0177-1} The expected type for the expression of an
33074 expression_function_declaration (*note 6.8: S0189.) is the result type
33075 (see *note 6.5::) of the function.
33076
33077 _Legality Rules_
33078
33079 4/3
33080 {AI05-0177-1AI05-0177-1} If an expression_function_declaration (*note
33081 6.8: S0189.) is a completion, it shall be the completion of a
33082 subprogram_declaration or generic_subprogram_declaration. The profile
33083 of an expression_function_declaration (*note 6.8: S0189.) that completes
33084 a declaration shall conform fully to that of the declaration.
33085
33086 5/3
33087 {AI05-0177-1AI05-0177-1} If the result subtype has one or more
33088 unconstrained access discriminants, the accessibility level of the
33089 anonymous access type of each access discriminant, as determined by the
33090 expression of the expression function, shall not be statically deeper
33091 than that of the master that elaborated the
33092 expression_function_declaration (*note 6.8: S0189.).
33093
33094 5.a/3
33095 Ramification: This can only fail if the discriminant is an
33096 access to a part of a non-aliased parameter, as there can be
33097 no local declarations here.
33098
33099 5.b/3
33100 Discussion: We don't need to repeat any of the other Legality
33101 Rules for return statements since none of them can fail here:
33102 the implicit return statement has to apply to this function
33103 (and isn't nested in something), there clearly is a return
33104 statement in this function, and the static classwide
33105 accessibility check cannot fail as a tagged type cannot be
33106 declared locally in an expression function.
33107
33108 _Static Semantics_
33109
33110 6/3
33111 {AI05-0177-1AI05-0177-1} {AI05-0264-1AI05-0264-1} An
33112 expression_function_declaration (*note 6.8: S0189.) declares an
33113 expression function. A completion is not allowed for an
33114 expression_function_declaration (*note 6.8: S0189.); however, an
33115 expression_function_declaration (*note 6.8: S0189.) can complete a
33116 previous declaration.
33117
33118 _Dynamic Semantics_
33119
33120 7/3
33121 {AI05-0177-1AI05-0177-1} {AI05-0262-1AI05-0262-1} The execution of an
33122 expression function is invoked by a subprogram call. For the execution
33123 of a subprogram call on an expression function, the execution of the
33124 subprogram_body executes an implicit function body containing only a
33125 simple_return_statement whose expression is that of the expression
33126 function.
33127
33128 7.a/3
33129 Discussion: The last sentence effectively means that all of
33130 the dynamic wording in *note 6.5:: applies as needed, and we
33131 don't have to repeat it here.
33132
33133 8/3
33134 {AI05-0177-1AI05-0177-1} The elaboration of an
33135 expression_function_declaration (*note 6.8: S0189.) has no other effect
33136 than to establish that the expression function can be called without
33137 failing the Elaboration_Check.
33138
33139 _Examples_
33140
33141 9/3
33142 {AI05-0177-1AI05-0177-1} function Is_Origin (P : in Point) return Boolean is -- see *note 3.9::
33143 (P.X = 0.0 and P.Y = 0.0);
33144
33145 _Extensions to Ada 2005_
33146
33147 9.a/3
33148 {AI05-0177-1AI05-0177-1} Expression functions are new in Ada
33149 2012.
33150
33151 \1f
33152 File: aarm2012.info, Node: 7, Next: 8, Prev: 6, Up: Top
33153
33154 7 Packages
33155 **********
33156
33157 1
33158 [Packages are program units that allow the specification of groups of
33159 logically related entities. Typically, a package contains the
33160 declaration of a type (often a private type or private extension) along
33161 with the declarations of primitive subprograms of the type, which can be
33162 called from outside the package, while their inner workings remain
33163 hidden from outside users. ]
33164
33165 * Menu:
33166
33167 * 7.1 :: Package Specifications and Declarations
33168 * 7.2 :: Package Bodies
33169 * 7.3 :: Private Types and Private Extensions
33170 * 7.4 :: Deferred Constants
33171 * 7.5 :: Limited Types
33172 * 7.6 :: Assignment and Finalization
33173
33174 \1f
33175 File: aarm2012.info, Node: 7.1, Next: 7.2, Up: 7
33176
33177 7.1 Package Specifications and Declarations
33178 ===========================================
33179
33180 1
33181 [A package is generally provided in two parts: a package_specification
33182 and a package_body. Every package has a package_specification, but not
33183 all packages have a package_body.]
33184
33185 _Syntax_
33186
33187 2
33188 package_declaration ::= package_specification;
33189
33190 3/3
33191 {AI05-0183-1AI05-0183-1} package_specification ::=
33192 package defining_program_unit_name
33193 [aspect_specification] is
33194 {basic_declarative_item}
33195 [private
33196 {basic_declarative_item}]
33197 end [[parent_unit_name.]identifier]
33198
33199 4
33200 If an identifier or parent_unit_name.identifier appears at the end
33201 of a package_specification, then this sequence of lexical elements
33202 shall repeat the defining_program_unit_name.
33203
33204 _Legality Rules_
33205
33206 5/2
33207 {AI95-00434-01AI95-00434-01} A package_declaration or
33208 generic_package_declaration requires a completion [(a body)] if it
33209 contains any basic_declarative_item that requires a completion, but
33210 whose completion is not in its package_specification.
33211
33212 5.a/3
33213 To be honest: {AI05-0229-1AI05-0229-1} If an implementation
33214 supports it, the body of a package or generic package may be
33215 imported (using aspect Import, see *note B.1::), in which case
33216 no explicit body is allowed.
33217
33218 _Static Semantics_
33219
33220 6/2
33221 {AI95-00420-01AI95-00420-01} {AI95-00434-01AI95-00434-01} The first list
33222 of basic_declarative_items of a package_specification of a package other
33223 than a generic formal package is called the visible part of the package.
33224 [ The optional list of basic_declarative_items after the reserved word
33225 private (of any package_specification) is called the private part of the
33226 package. If the reserved word private does not appear, the package has
33227 an implicit empty private part.] Each list of basic_declarative_items
33228 of a package_specification forms a declaration list of the package.
33229
33230 6.a
33231 Ramification: This definition of visible part does not apply
33232 to generic formal packages -- *note 12.7:: defines the visible
33233 part of a generic formal package.
33234
33235 6.b
33236 The implicit empty private part is important because certain
33237 implicit declarations occur there if the package is a child
33238 package, and it defines types in its visible part that are
33239 derived from, or contain as components, private types declared
33240 within the parent package. These implicit declarations are
33241 visible in children of the child package. See *note 10.1.1::.
33242
33243 7
33244 [An entity declared in the private part of a package is visible only
33245 within the declarative region of the package itself (including any child
33246 units -- see *note 10.1.1::). In contrast, expanded names denoting
33247 entities declared in the visible part can be used even outside the
33248 package; furthermore, direct visibility of such entities can be achieved
33249 by means of use_clauses (see *note 4.1.3:: and *note 8.4::).]
33250
33251 _Dynamic Semantics_
33252
33253 8
33254 The elaboration of a package_declaration consists of the elaboration of
33255 its basic_declarative_items in the given order.
33256
33257 NOTES
33258
33259 9
33260 1 The visible part of a package contains all the information that
33261 another program unit is able to know about the package.
33262
33263 10
33264 2 If a declaration occurs immediately within the specification of
33265 a package, and the declaration has a corresponding completion that
33266 is a body, then that body has to occur immediately within the body
33267 of the package.
33268
33269 10.a
33270 Proof: This follows from the fact that the declaration and
33271 completion are required to occur immediately within the same
33272 declarative region, and the fact that bodies are disallowed
33273 (by the Syntax Rules) in package_specifications. This does
33274 not apply to instances of generic units, whose bodies can
33275 occur in package_specifications.
33276
33277 _Examples_
33278
33279 11
33280 Example of a package declaration:
33281
33282 12
33283 package Rational_Numbers is
33284
33285 13
33286 type Rational is
33287 record
33288 Numerator : Integer;
33289 Denominator : Positive;
33290 end record;
33291
33292 14
33293 function "="(X,Y : Rational) return Boolean;
33294
33295 15
33296 function "/" (X,Y : Integer) return Rational; -- to construct a rational number
33297
33298 16
33299 function "+" (X,Y : Rational) return Rational;
33300 function "-" (X,Y : Rational) return Rational;
33301 function "*" (X,Y : Rational) return Rational;
33302 function "/" (X,Y : Rational) return Rational;
33303 end Rational_Numbers;
33304
33305 17
33306 There are also many examples of package declarations in the predefined
33307 language environment (see *note Annex A::).
33308
33309 _Incompatibilities With Ada 83_
33310
33311 17.a
33312 In Ada 83, a library package is allowed to have a body even if
33313 it doesn't need one. In Ada 95, a library package body is
33314 either required or forbidden -- never optional. The
33315 workaround is to add pragma Elaborate_Body, or something else
33316 requiring a body, to each library package that has a body that
33317 isn't otherwise required.
33318
33319 _Wording Changes from Ada 83_
33320
33321 17.b/3
33322 {AI05-0299-1AI05-0299-1} We have moved the syntax into this
33323 subclause and the next subclause from RM83-7.1, "Package
33324 Structure", which we have removed.
33325
33326 17.c
33327 RM83 was unclear on the rules about when a package requires a
33328 body. For example, RM83-7.1(4) and RM83-7.1(8) clearly forgot
33329 about the case of an incomplete type declared in a
33330 package_declaration but completed in the body. In addition,
33331 RM83 forgot to make this rule apply to a generic package. We
33332 have corrected these rules. Finally, since we now allow a
33333 pragma Import for any explicit declaration, the completion
33334 rules need to take this into account as well.
33335
33336 _Wording Changes from Ada 95_
33337
33338 17.d/2
33339 {AI95-00420-01AI95-00420-01} Defined "declaration list" to
33340 avoid ambiguity in other rules as to whether packages are
33341 included.
33342
33343 _Extensions to Ada 2005_
33344
33345 17.e/3
33346 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
33347 be used in a package_specification. This is described in
33348 *note 13.1.1::.
33349
33350 \1f
33351 File: aarm2012.info, Node: 7.2, Next: 7.3, Prev: 7.1, Up: 7
33352
33353 7.2 Package Bodies
33354 ==================
33355
33356 1
33357 [In contrast to the entities declared in the visible part of a package,
33358 the entities declared in the package_body are visible only within the
33359 package_body itself. As a consequence, a package with a package_body
33360 can be used for the construction of a group of related subprograms in
33361 which the logical operations available to clients are clearly isolated
33362 from the internal entities.]
33363
33364 _Syntax_
33365
33366 2/3
33367 {AI05-0267-1AI05-0267-1} package_body ::=
33368 package body defining_program_unit_name
33369 [aspect_specification] is
33370 declarative_part
33371 [begin
33372 handled_sequence_of_statements]
33373 end [[parent_unit_name.]identifier];
33374
33375 3
33376 If an identifier or parent_unit_name.identifier appears at the end
33377 of a package_body, then this sequence of lexical elements shall
33378 repeat the defining_program_unit_name.
33379
33380 _Legality Rules_
33381
33382 4
33383 A package_body shall be the completion of a previous package_declaration
33384 (*note 7.1: S0190.) or generic_package_declaration (*note 12.1: S0272.).
33385 A library package_declaration (*note 7.1: S0190.) or library
33386 generic_package_declaration (*note 12.1: S0272.) shall not have a body
33387 unless it requires a body[; pragma Elaborate_Body can be used to require
33388 a library_unit_declaration (*note 10.1.1: S0249.) to have a body (see
33389 *note 10.2.1::) if it would not otherwise require one].
33390
33391 4.a
33392 Ramification: The first part of the rule forbids a
33393 package_body from standing alone -- it has to belong to some
33394 previous package_declaration or generic_package_declaration.
33395
33396 4.b
33397 A nonlibrary package_declaration or nonlibrary
33398 generic_package_declaration that does not require a completion
33399 may have a corresponding body anyway.
33400
33401 _Static Semantics_
33402
33403 5/3
33404 {AI05-0299-1AI05-0299-1} In any package_body without statements there is
33405 an implicit null_statement (*note 5.1: S0149.). For any
33406 package_declaration (*note 7.1: S0190.) without an explicit completion,
33407 there is an implicit package_body (*note 7.2: S0192.) containing a
33408 single null_statement. For a noninstance, nonlibrary package, this body
33409 occurs at the end of the declarative_part (*note 3.11: S0086.) of the
33410 innermost enclosing program unit or block_statement (*note 5.6: S0160.);
33411 if there are several such packages, the order of the implicit
33412 package_bodies is unspecified. [(For an instance, the implicit
33413 package_body (*note 7.2: S0192.) occurs at the place of the
33414 instantiation (see *note 12.3::). For a library package, the place is
33415 partially determined by the elaboration dependences (see Clause *note
33416 10::).)]
33417
33418 5.a
33419 Discussion: Thus, for example, we can refer to something
33420 happening just after the begin of a package_body, and we can
33421 refer to the handled_sequence_of_statements of a package_body,
33422 without worrying about all the optional pieces. The place of
33423 the implicit body makes a difference for tasks activated by
33424 the package. See also RM83-9.3(5).
33425
33426 5.b
33427 The implicit body would be illegal if explicit in the case of
33428 a library package that does not require (and therefore does
33429 not allow) a body. This is a bit strange, but not harmful.
33430
33431 _Dynamic Semantics_
33432
33433 6
33434 For the elaboration of a nongeneric package_body, its declarative_part
33435 (*note 3.11: S0086.) is first elaborated, and its
33436 handled_sequence_of_statements (*note 11.2: S0265.) is then executed.
33437
33438 NOTES
33439
33440 7
33441 3 A variable declared in the body of a package is only visible
33442 within this body and, consequently, its value can only be changed
33443 within the package_body. In the absence of local tasks, the value
33444 of such a variable remains unchanged between calls issued from
33445 outside the package to subprograms declared in the visible part.
33446 The properties of such a variable are similar to those of a
33447 "static" variable of C.
33448
33449 8
33450 4 The elaboration of the body of a subprogram explicitly declared
33451 in the visible part of a package is caused by the elaboration of
33452 the body of the package. Hence a call of such a subprogram by an
33453 outside program unit raises the exception Program_Error if the call
33454 takes place before the elaboration of the package_body (see *note
33455 3.11::).
33456
33457 _Examples_
33458
33459 9
33460 Example of a package body (see *note 7.1::):
33461
33462 10
33463 package body Rational_Numbers is
33464
33465 11
33466 procedure Same_Denominator (X,Y : in out Rational) is
33467 begin
33468 -- reduces X and Y to the same denominator:
33469 ...
33470 end Same_Denominator;
33471
33472 12
33473 function "="(X,Y : Rational) return Boolean is
33474 U : Rational := X;
33475 V : Rational := Y;
33476 begin
33477 Same_Denominator (U,V);
33478 return U.Numerator = V.Numerator;
33479 end "=";
33480
33481 13
33482 function "/" (X,Y : Integer) return Rational is
33483 begin
33484 if Y > 0 then
33485 return (Numerator => X, Denominator => Y);
33486 else
33487 return (Numerator => -X, Denominator => -Y);
33488 end if;
33489 end "/";
33490
33491 14
33492 function "+" (X,Y : Rational) return Rational is ... end "+";
33493 function "-" (X,Y : Rational) return Rational is ... end "-";
33494 function "*" (X,Y : Rational) return Rational is ... end "*";
33495 function "/" (X,Y : Rational) return Rational is ... end "/";
33496
33497 15
33498 end Rational_Numbers;
33499
33500 _Wording Changes from Ada 83_
33501
33502 15.a
33503 The syntax rule for package_body now uses the syntactic
33504 category handled_sequence_of_statements.
33505
33506 15.b
33507 The declarative_part of a package_body is now required; that
33508 doesn't make any real difference, since a declarative_part can
33509 be empty.
33510
33511 15.c
33512 RM83 seems to have forgotten to say that a package_body can't
33513 stand alone, without a previous declaration. We state that
33514 rule here.
33515
33516 15.d
33517 RM83 forgot to restrict the definition of elaboration of
33518 package_bodies to nongeneric ones. We have corrected that
33519 omission.
33520
33521 15.e
33522 The rule about implicit bodies (from RM83-9.3(5)) is moved
33523 here, since it is more generally applicable.
33524
33525 _Extensions to Ada 2005_
33526
33527 15.f/3
33528 {AI05-0267-1AI05-0267-1} An optional aspect_specification can
33529 be used in a package_body. This is described in *note
33530 13.1.1::.
33531
33532 \1f
33533 File: aarm2012.info, Node: 7.3, Next: 7.4, Prev: 7.2, Up: 7
33534
33535 7.3 Private Types and Private Extensions
33536 ========================================
33537
33538 1
33539 [The declaration (in the visible part of a package) of a type as a
33540 private type or private extension serves to separate the characteristics
33541 that can be used directly by outside program units (that is, the logical
33542 properties) from other characteristics whose direct use is confined to
33543 the package (the details of the definition of the type itself). See
33544 *note 3.9.1:: for an overview of type extensions. ]
33545
33546 _Language Design Principles_
33547
33548 1.a
33549 A private (untagged) type can be thought of as a record type
33550 with the type of its single (hidden) component being the full
33551 view.
33552
33553 1.b
33554 A private tagged type can be thought of as a private extension
33555 of an anonymous parent with no components. The only
33556 dispatching operation of the parent is equality (although the
33557 Size attribute, and, if nonlimited, assignment are allowed,
33558 and those will presumably be implemented in terms of
33559 dispatching).
33560
33561 _Syntax_
33562
33563 2/3
33564 {AI05-0183-1AI05-0183-1} private_type_declaration ::=
33565 type defining_identifier [
33566 discriminant_part] is [[abstract] tagged] [limited] private
33567 [aspect_specification];
33568
33569 3/3
33570 {AI95-00251-01AI95-00251-01} {AI95-00419-01AI95-00419-01}
33571 {AI95-00443-01AI95-00443-01} {AI05-0183-1AI05-0183-1}
33572 private_extension_declaration ::=
33573 type defining_identifier [discriminant_part] is
33574 [abstract] [limited | synchronized] new ancestor_
33575 subtype_indication
33576 [and interface_list] with private
33577 [aspect_specification];
33578
33579 _Legality Rules_
33580
33581 4
33582 A private_type_declaration or private_extension_declaration declares a
33583 partial view of the type; such a declaration is allowed only as a
33584 declarative_item of the visible part of a package, and it requires a
33585 completion, which shall be a full_type_declaration that occurs as a
33586 declarative_item of the private part of the package. [ The view of the
33587 type declared by the full_type_declaration is called the full view.] A
33588 generic formal private type or a generic formal private extension is
33589 also a partial view.
33590
33591 4.a
33592 To be honest: A private type can also be imported (using
33593 aspect Import, see *note B.1::), in which case no completion
33594 is allowed, if supported by an implementation.
33595
33596 4.b
33597 Reason: We originally used the term "private view," but this
33598 was easily confused with the view provided from the private
33599 part, namely the full view.
33600
33601 4.c/2
33602 Proof: {AI95-00326-01AI95-00326-01} Full view is now defined
33603 in *note 3.2.1::, "*note 3.2.1:: Type Declarations", as all
33604 types now have them.
33605
33606 5
33607 [A type shall be completely defined before it is frozen (see *note
33608 3.11.1:: and *note 13.14::). Thus, neither the declaration of a
33609 variable of a partial view of a type, nor the creation by an allocator
33610 of an object of the partial view are allowed before the full declaration
33611 of the type. Similarly, before the full declaration, the name of the
33612 partial view cannot be used in a generic_instantiation or in a
33613 representation item.]
33614
33615 5.a
33616 Proof: This rule is stated officially in *note 3.11.1::,
33617 "*note 3.11.1:: Completions of Declarations".
33618
33619 6/2
33620 {AI95-00419-01AI95-00419-01} {AI95-00443-01AI95-00443-01} [A private
33621 type is limited if its declaration includes the reserved word limited; a
33622 private extension is limited if its ancestor type is a limited type that
33623 is not an interface type, or if the reserved word limited or
33624 synchronized appears in its definition.] If the partial view is
33625 nonlimited, then the full view shall be nonlimited. If a tagged partial
33626 view is limited, then the full view shall be limited. [On the other
33627 hand, if an untagged partial view is limited, the full view may be
33628 limited or nonlimited.]
33629
33630 7
33631 If the partial view is tagged, then the full view shall be tagged. [On
33632 the other hand, if the partial view is untagged, then the full view may
33633 be tagged or untagged.] In the case where the partial view is untagged
33634 and the full view is tagged, no derivatives of the partial view are
33635 allowed within the immediate scope of the partial view; [derivatives of
33636 the full view are allowed.]
33637
33638 7.a
33639 Ramification: Note that deriving from a partial view within
33640 its immediate scope can only occur in a package that is a
33641 child of the one where the partial view is declared. The rule
33642 implies that in the visible part of a public child package, it
33643 is impossible to derive from an untagged private type declared
33644 in the visible part of the parent package in the case where
33645 the full view of the parent type turns out to be tagged. We
33646 considered a model in which the derived type was implicitly
33647 redeclared at the earliest place within its immediate scope
33648 where characteristics needed to be added. However, we
33649 rejected that model, because (1) it would imply that (for an
33650 untagged type) subprograms explicitly declared after the
33651 derived type could be inherited, and (2) to make this model
33652 work for composite types as well, several implicit
33653 redeclarations would be needed, since new characteristics can
33654 become visible one by one; that seemed like too much
33655 mechanism.
33656
33657 7.b
33658 Discussion: The rule for tagged partial views is redundant for
33659 partial views that are private extensions, since all
33660 extensions of a given ancestor tagged type are tagged, and
33661 limited if the ancestor is limited. We phrase this rule
33662 partially redundantly to keep its structure parallel with the
33663 other rules.
33664
33665 7.c
33666 To be honest: This rule is checked in a generic unit, rather
33667 than using the "assume the best" or "assume the worst" method.
33668
33669 7.d/2
33670 Reason: {AI95-00230-01AI95-00230-01} Tagged limited private
33671 types have certain capabilities that are incompatible with
33672 having assignment for the full view of the type. In
33673 particular, tagged limited private types can be extended with
33674 components of a limited type, which works only because
33675 assignment is not allowed. Consider the following example:
33676
33677 7.e
33678 package P1 is
33679 type T1 is tagged limited private;
33680 procedure Foo(X : in T1'Class);
33681 private
33682 type T1 is tagged null record; -- Illegal!
33683 -- This should say "tagged limited null record".
33684 end P1;
33685
33686 7.f/1
33687 package body P1 is
33688 type A is access T1'Class;
33689 Global : A;
33690 procedure Foo(X : in T1'Class) is
33691 begin
33692 Global := new T1'Class'(X);
33693 -- This would be illegal if the full view of
33694 -- T1 were limited, like it's supposed to be.
33695 end Foo;
33696 end P1;
33697
33698 7.g/2
33699 {AI95-00230-01AI95-00230-01} with P1;
33700 package P2 is
33701 type T2(D : access Integer)
33702 is new P1.T1 with
33703 record
33704 My_Task : Some_Task_Type; -- Trouble!
33705 end record;
33706 end P2;
33707
33708 7.h/1
33709 with P1;
33710 with P2;
33711 procedure Main is
33712 Local : aliased Integer;
33713 Y : P2.T2(D => Local'Access);
33714 begin
33715 P1.Foo(Y);
33716 end Main;
33717
33718
33719 7.i/2
33720 {AI95-00230-01AI95-00230-01} If the above example were legal,
33721 we would have succeeded in doing an assignment of a task
33722 object, which is supposed to be a no-no.
33723
33724 7.j
33725 This rule is not needed for private extensions, because they
33726 inherit their limitedness from their ancestor, and there is a
33727 separate rule forbidding limited components of the
33728 corresponding record extension if the parent is nonlimited.
33729
33730 7.k
33731 Ramification: A type derived from an untagged private type is
33732 untagged, even if the full view of the parent is tagged, and
33733 even at places that can see the parent:
33734
33735 7.l
33736 package P is
33737 type Parent is private;
33738 private
33739 type Parent is tagged
33740 record
33741 X: Integer;
33742 end record;
33743 end P;
33744
33745 7.m/1
33746 with P;
33747 package Q is
33748 type T is new P.Parent;
33749 end Q;
33750
33751 7.n
33752 with Q; use Q;
33753 package body P is
33754 ... T'Class ... -- Illegal!
33755 Object: T;
33756 ... Object.X ... -- Illegal!
33757 ... Parent(Object).X ... -- OK.
33758 end P;
33759
33760 7.o
33761 The declaration of T declares an untagged view. This view is
33762 always untagged, so T'Class is illegal, it would be illegal to
33763 extend T, and so forth. The component name X is never visible
33764 for this view, although the component is still there -- one
33765 can get one's hands on it via a type_conversion.
33766
33767 7.1/2
33768 {AI95-00396-01AI95-00396-01} If a full type has a partial view that is
33769 tagged, then:
33770
33771 7.2/2
33772 * the partial view shall be a synchronized tagged type (see *note
33773 3.9.4::) if and only if the full type is a synchronized tagged
33774 type;
33775
33776 7.o.1/2
33777 Reason: Since we do not allow record extensions of
33778 synchronized tagged types, this property has to be visible in
33779 the partial view to avoid privacy breaking. Generic formals
33780 do not need a similar rule as any extensions are rechecked for
33781 legality in the specification, and extensions of tagged
33782 formals are always illegal in a generic body.
33783
33784 7.3/2
33785 * the partial view shall be a descendant of an interface type (see
33786 3.9.4) if and only if the full type is a descendant of the
33787 interface type.
33788
33789 7.p/2
33790 Reason: Consider the following example:
33791
33792 7.q/2
33793 package P is
33794 package Pkg is
33795 type Ifc is interface;
33796 procedure Foo (X : Ifc) is abstract;
33797 end Pkg;
33798
33799 7.r/2
33800 type Parent_1 is tagged null record;
33801
33802 7.s/2
33803 type T1 is new Parent_1 with private;
33804 private
33805 type Parent_2 is new Parent_1 and Pkg.Ifc with null record;
33806 procedure Foo (X : Parent_2); -- Foo #1
33807
33808 7.t/2
33809 type T1 is new Parent_2 with null record; -- Illegal.
33810 end P;
33811
33812 7.u/2
33813 with P;
33814 package P_Client is
33815 type T2 is new P.T1 and P.Pkg.Ifc with null record;
33816 procedure Foo (X : T2); -- Foo #2
33817 X : T2;
33818 end P_Client;
33819
33820 7.v/2
33821 with P_Client;
33822 package body P is
33823 ...
33824
33825 7.w/2
33826 procedure Bar (X : T1'Class) is
33827 begin
33828 Pkg.Foo (X); -- should call Foo #1 or an override thereof
33829 end;
33830
33831 7.x/2
33832 begin
33833 Pkg.Foo (Pkg.Ifc'Class (P_Client.X)); -- should call Foo #2
33834 Bar (T1'Class (P_Client.X));
33835 end P;
33836
33837 7.y/2
33838 This example is illegal because the completion of T1 is
33839 descended from an interface that the partial view is not
33840 descended from. If it were legal, T2 would implement Ifc
33841 twice, once in the visible part of P, and once in the visible
33842 part of P_Client. We would need to decide how Foo #1 and Foo
33843 #2 relate to each other. There are two options: either Foo #2
33844 overrides Foo #1, or it doesn't.
33845
33846 7.z/2
33847 If Foo #2 overrides Foo #1, we have a problem because the
33848 client redefines a behavior that it doesn't know about, and we
33849 try to avoid this at all costs, as it would lead to a
33850 breakdown of whatever abstraction was implemented. If the
33851 abstraction didn't expose that it implements Ifc, there must
33852 be a reason, and it should be able to depend on the fact that
33853 no overriding takes place in clients. Also, during
33854 maintenance, things may change and the full view might
33855 implement a different set of interfaces. Furthermore, the
33856 situation is even worse if the full type implements another
33857 interface Ifc2 that happens to have a conforming Foo
33858 (otherwise unrelated, except for its name and profile).
33859
33860 7.aa/2
33861 If Foo #2 doesn't override Foo #1, there is some similarity
33862 with the case of normal tagged private types, where a client
33863 can declare an operation that happens to conform to some
33864 private operation, and that's OK, it gets a different slot in
33865 the type descriptor. The problem here is that T2 would
33866 implement Ifc in two different ways, and through conversions
33867 to Ifc'Class we could end up with visibility on both of these
33868 two different implementations. This is the "diamond
33869 inheritance" problem of C++ all over again, and we would need
33870 some kind of a preference rule to pick one implementation. We
33871 don't want to go there (if we did, we might as well provide
33872 full-fledged multiple inheritance).
33873
33874 7.bb/2
33875 Note that there wouldn't be any difficulty to implement the
33876 first option, so the restriction is essentially
33877 methodological. The second option might be harder to
33878 implement, depending on the language rules that we would
33879 choose.
33880
33881 7.cc/3
33882 Ramification: {AI05-0005-1AI05-0005-1} This rule also prevents
33883 completing a private type with an interface. An interface,
33884 like all types, is a descendant of itself, and thus this rule
33885 is triggered. One reason this is necessary is that a client
33886 of a private extension should be able to inherit limitedness
33887 without having to look in the private part to see if the type
33888 is an interface (remember that limitedness of interfaces is
33889 never inherited, while it is inherited from other types).
33890
33891 8
33892 The ancestor subtype of a private_extension_declaration is the subtype
33893 defined by the ancestor_subtype_indication (*note 3.2.2: S0027.); the
33894 ancestor type shall be a specific tagged type. The full view of a
33895 private extension shall be derived (directly or indirectly) from the
33896 ancestor type. In addition to the places where Legality Rules normally
33897 apply (see *note 12.3::), the requirement that the ancestor be specific
33898 applies also in the private part of an instance of a generic unit.
33899
33900 8.a
33901 Reason: This rule allows the full view to be defined through
33902 several intermediate derivations, possibly from a series of
33903 types produced by generic_instantiations.
33904
33905 8.1/2
33906 {AI95-00419-01AI95-00419-01} {AI95-00443-01AI95-00443-01} If the
33907 reserved word limited appears in a private_extension_declaration, the
33908 ancestor type shall be a limited type. If the reserved word
33909 synchronized appears in a private_extension_declaration, the ancestor
33910 type shall be a limited interface.
33911
33912 9
33913 If the declaration of a partial view includes a known_discriminant_part,
33914 then the full_type_declaration shall have a fully conforming
33915 [(explicit)] known_discriminant_part [(see *note 6.3.1::, "*note 6.3.1::
33916 Conformance Rules")]. [The ancestor subtype may be unconstrained; the
33917 parent subtype of the full view is required to be constrained (see *note
33918 3.7::).]
33919
33920 9.a
33921 Discussion: If the ancestor subtype has discriminants, then it
33922 is usually best to make it unconstrained.
33923
33924 9.b
33925 Ramification: If the partial view has a
33926 known_discriminant_part, then the full view has to be a
33927 composite, non-array type, since only such types may have
33928 known discriminants. Also, the full view cannot inherit the
33929 discriminants in this case; the known_discriminant_part has to
33930 be explicit.
33931
33932 9.c
33933 That is, the following is illegal:
33934
33935 9.d
33936 package P is
33937 type T(D : Integer) is private;
33938 private
33939 type T is new Some_Other_Type; -- Illegal!
33940 end P;
33941
33942
33943 9.e
33944 even if Some_Other_Type has an integer discriminant called D.
33945
33946 9.f
33947 It is a ramification of this and other rules that in order for
33948 a tagged type to privately inherit unconstrained
33949 discriminants, the private type declaration has to have an
33950 unknown_discriminant_part.
33951
33952 10
33953 If a private extension inherits known discriminants from the ancestor
33954 subtype, then the full view shall also inherit its discriminants from
33955 the ancestor subtype, and the parent subtype of the full view shall be
33956 constrained if and only if the ancestor subtype is constrained.
33957
33958 10.a
33959 Reason: The first part ensures that the full view has the same
33960 discriminants as the partial view. The second part ensures
33961 that if the partial view is unconstrained, then the full view
33962 is also unconstrained; otherwise, a client might constrain the
33963 partial view in a way that conflicts with the constraint on
33964 the full view.
33965
33966 10.1/3
33967 {AI95-00419-01AI95-00419-01} {AI05-0004-1AI05-0004-1} If the
33968 full_type_declaration for a private extension includes a
33969 derived_type_definition, then the reserved word limited shall appear in
33970 the full_type_declaration if and only if it also appears in the
33971 private_extension_declaration.
33972
33973 10.b/3
33974 Reason: {AI05-0004-1AI05-0004-1} The word limited is optional
33975 (unless the ancestor is an interface), but it should be used
33976 consistently. Otherwise things would be too confusing for the
33977 reader. Of course, we only require that if the full type
33978 includes a derived_type_definition, as we want to allow task
33979 and protected types to complete extensions of synchronized
33980 interfaces.
33981
33982 11
33983 [If a partial view has unknown discriminants, then the
33984 full_type_declaration may define a definite or an indefinite subtype,
33985 with or without discriminants.]
33986
33987 12
33988 If a partial view has neither known nor unknown discriminants, then the
33989 full_type_declaration shall define a definite subtype.
33990
33991 13
33992 If the ancestor subtype of a private extension has constrained
33993 discriminants, then the parent subtype of the full view shall impose a
33994 statically matching constraint on those discriminants.
33995
33996 13.a
33997 Ramification: If the parent type of the full view is not the
33998 ancestor type, but is rather some descendant thereof, the
33999 constraint on the discriminants of the parent type might come
34000 from the declaration of some intermediate type in the
34001 derivation chain between the ancestor type and the parent
34002 type.
34003
34004 13.b
34005 Reason: This prevents the following:
34006
34007 13.c
34008 package P is
34009 type T2 is new T1(Discrim => 3) with private;
34010 private
34011 type T2 is new T1(Discrim => 999) -- Illegal!
34012 with record ...;
34013 end P;
34014
34015 13.d
34016 The constraints in this example do not statically match.
34017
34018 13.e
34019 If the constraint on the parent subtype of the full view
34020 depends on discriminants of the full view, then the ancestor
34021 subtype has to be unconstrained:
34022
34023 13.f
34024 type One_Discrim(A: Integer) is tagged ...;
34025 ...
34026 package P is
34027 type Two_Discrims(B: Boolean; C: Integer) is new One_Discrim with private;
34028 private
34029 type Two_Discrims(B: Boolean; C: Integer) is new One_Discrim(A => C) with
34030 record
34031 ...
34032 end record;
34033 end P;
34034
34035 13.g
34036 The above example would be illegal if the private extension
34037 said "is new One_Discrim(A => C);", because then the
34038 constraints would not statically match. (Constraints that
34039 depend on discriminants are not static.)
34040
34041 _Static Semantics_
34042
34043 14
34044 A private_type_declaration declares a private type and its first
34045 subtype. Similarly, a private_extension_declaration (*note 7.3: S0194.)
34046 declares a private extension and its first subtype.
34047
34048 14.a
34049 Discussion: A package-private type is one declared by a
34050 private_type_declaration; that is, a private type other than a
34051 generic formal private type. Similarly, a package-private
34052 extension is one declared by a private_extension_declaration.
34053 These terms are not used in the RM95 version of this document.
34054
34055 15/3
34056 {AI05-0269-1AI05-0269-1} A declaration of a partial view and the
34057 corresponding full_type_declaration define two views of a single type.
34058 The declaration of a partial view together with the visible part define
34059 the operations that are available to outside program units; the
34060 declaration of the full view together with the private part define other
34061 operations whose direct use is possible only within the declarative
34062 region of the package itself. Moreover, within the scope of the
34063 declaration of the full view, the characteristics (see *note 3.4::) of
34064 the type are determined by the full view; in particular, within its
34065 scope, the full view determines the classes that include the type, which
34066 components, entries, and protected subprograms are visible, what
34067 attributes and other predefined operations are allowed, and whether the
34068 first subtype is static. See *note 7.3.1::.
34069
34070 16/3
34071 {AI95-00401-01AI95-00401-01} {AI05-0110-1AI05-0110-1} For a private
34072 extension, the characteristics (including components, but excluding
34073 discriminants if there is a new discriminant_part specified), predefined
34074 operators, and inherited user-defined primitive subprograms are
34075 determined by its ancestor type and its progenitor types (if any), in
34076 the same way that those of a record extension are determined by those of
34077 its parent type and its progenitor types (see *note 3.4:: and *note
34078 7.3.1::).
34079
34080 16.a/3
34081 To be honest: {AI05-0110-1AI05-0110-1} If an operation of the
34082 ancestor or parent type is abstract, then the abstractness of
34083 the inherited operation is different for nonabstract record
34084 extensions than for nonabstract private extensions (see *note
34085 3.9.3::).
34086
34087 _Dynamic Semantics_
34088
34089 17
34090 The elaboration of a private_type_declaration creates a partial view of
34091 a type. The elaboration of a private_extension_declaration elaborates
34092 the ancestor_subtype_indication, and creates a partial view of a type.
34093
34094 NOTES
34095
34096 18
34097 5 The partial view of a type as declared by a
34098 private_type_declaration is defined to be a composite view (in
34099 *note 3.2::). The full view of the type might or might not be
34100 composite. A private extension is also composite, as is its full
34101 view.
34102
34103 19/2
34104 6 {AI95-00318-02AI95-00318-02} Declaring a private type with an
34105 unknown_discriminant_part is a way of preventing clients from
34106 creating uninitialized objects of the type; they are then forced to
34107 initialize each object by calling some operation declared in the
34108 visible part of the package.
34109
34110 19.a
34111 Discussion: Packages with private types are analogous to
34112 generic packages with formal private types, as follows: The
34113 declaration of a package-private type is like the declaration
34114 of a formal private type. The visible part of the package is
34115 like the generic formal part; these both specify a contract
34116 (that is, a set of operations and other things available for
34117 the private type). The private part of the package is like an
34118 instantiation of the generic; they both give a
34119 full_type_declaration that specifies implementation details of
34120 the private type. The clients of the package are like the
34121 body of the generic; usage of the private type in these places
34122 is restricted to the operations defined by the contract.
34123
34124 19.b
34125 In other words, being inside the package is like being outside
34126 the generic, and being outside the package is like being
34127 inside the generic; a generic is like an "inside-out" package.
34128
34129 19.c
34130 This analogy also works for private extensions in the same
34131 inside-out way.
34132
34133 19.d
34134 Many of the legality rules are defined with this analogy in
34135 mind. See, for example, the rules relating to operations of
34136 [formal] derived types.
34137
34138 19.e
34139 The completion rules for a private type are intentionally
34140 quite similar to the matching rules for a generic formal
34141 private type.
34142
34143 19.f
34144 This analogy breaks down in one respect: a generic actual
34145 subtype is a subtype, whereas the full view for a private type
34146 is always a new type. (We considered allowing the completion
34147 of a private_type_declaration to be a subtype_declaration, but
34148 the semantics just won't work.) This difference is behind the
34149 fact that a generic actual type can be class-wide, whereas the
34150 completion of a private type always declares a specific type.
34151
34152 20/2
34153 7 {AI95-00401AI95-00401} The ancestor type specified in a
34154 private_extension_declaration and the parent type specified in the
34155 corresponding declaration of a record extension given in the
34156 private part need not be the same. If the ancestor type is not an
34157 interface type, the parent type of the full view can be any
34158 descendant of the ancestor type. In this case, for a primitive
34159 subprogram that is inherited from the ancestor type and not
34160 overridden, the formal parameter names and default expressions (if
34161 any) come from the corresponding primitive subprogram of the
34162 specified ancestor type, while the body comes from the
34163 corresponding primitive subprogram of the parent type of the full
34164 view. See *note 3.9.2::.
34165
34166 20.1/2
34167 8 {AI95-00401AI95-00401} If the ancestor type specified in a
34168 private_extension_declaration is an interface type, the parent type
34169 can be any type so long as the full view is a descendant of the
34170 ancestor type. The progenitor types specified in a
34171 private_extension_declaration and the progenitor types specified in
34172 the corresponding declaration of a record extension given in the
34173 private part need not be the same -- the only requirement is that
34174 the private extension and the record extension be descended from
34175 the same set of interfaces.
34176
34177 _Examples_
34178
34179 21
34180 Examples of private type declarations:
34181
34182 22
34183 type Key is private;
34184 type File_Name is limited private;
34185
34186 23
34187 Example of a private extension declaration:
34188
34189 24
34190 type List is new Ada.Finalization.Controlled with private;
34191
34192 _Extensions to Ada 83_
34193
34194 24.a
34195 The syntax for a private_type_declaration is augmented to
34196 allow the reserved word tagged.
34197
34198 24.b
34199 In Ada 83, a private type without discriminants cannot be
34200 completed with a type with discriminants. Ada 95 allows the
34201 full view to have discriminants, so long as they have defaults
34202 (that is, so long as the first subtype is definite). This
34203 change is made for uniformity with generics, and because the
34204 rule as stated is simpler and easier to remember than the Ada
34205 83 rule. In the original version of Ada 83, the same
34206 restriction applied to generic formal private types. However,
34207 the restriction was removed by the ARG for generics. In order
34208 to maintain the "generic contract/private type contract
34209 analogy" discussed above, we have to apply the same rule to
34210 package-private types. Note that a private untagged type
34211 without discriminants can be completed with a tagged type with
34212 discriminants only if the full view is constrained, because
34213 discriminants of tagged types cannot have defaults.
34214
34215 _Wording Changes from Ada 83_
34216
34217 24.c
34218 RM83-7.4.1(4), "Within the specification of the package that
34219 declares a private type and before the end of the
34220 corresponding full type declaration, a restriction
34221 applies....", is subsumed (and corrected) by the rule that a
34222 type shall be completely defined before it is frozen, and the
34223 rule that the parent type of a derived type declaration shall
34224 be completely defined, unless the derived type is a private
34225 extension.
34226
34227 _Extensions to Ada 95_
34228
34229 24.d/2
34230 {AI95-00251-01AI95-00251-01} {AI95-00396-01AI95-00396-01}
34231 {AI95-00401-01AI95-00401-01} Added interface_list to private
34232 extensions to support interfaces and multiple inheritance (see
34233 *note 3.9.4::).
34234
34235 24.e/2
34236 {AI95-00419-01AI95-00419-01} A private extension may specify
34237 that it is a limited type. This is required for interface
34238 ancestors (from which limitedness is not inherited), but it is
34239 generally useful as documentation of limitedness.
34240
34241 24.f/2
34242 {AI95-00443-01AI95-00443-01} A private extension may specify
34243 that it is a synchronized type. This is required in order so
34244 that a regular limited interface can be used as the ancestor
34245 of a synchronized type (we do not allow hiding of
34246 synchronization).
34247
34248 _Extensions to Ada 2005_
34249
34250 24.g/3
34251 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
34252 be used in a private_type_declaration and a
34253 private_extension_declaration. This is described in *note
34254 13.1.1::.
34255
34256 _Wording Changes from Ada 2005_
34257
34258 24.h/3
34259 {AI05-0110-1AI05-0110-1} Correction: The description of how a
34260 private extension inherits characteristics was made consistent
34261 with the way formal derived types inherit characteristics (see
34262 *note 12.5.1::).
34263
34264 * Menu:
34265
34266 * 7.3.1 :: Private Operations
34267 * 7.3.2 :: Type Invariants
34268
34269 \1f
34270 File: aarm2012.info, Node: 7.3.1, Next: 7.3.2, Up: 7.3
34271
34272 7.3.1 Private Operations
34273 ------------------------
34274
34275 1
34276 [For a type declared in the visible part of a package or generic
34277 package, certain operations on the type do not become visible until
34278 later in the package -- either in the private part or the body. Such
34279 private operations are available only inside the declarative region of
34280 the package or generic package.]
34281
34282 _Static Semantics_
34283
34284 2
34285 The predefined operators that exist for a given type are determined by
34286 the classes to which the type belongs. For example, an integer type has
34287 a predefined "+" operator. In most cases, the predefined operators of a
34288 type are declared immediately after the definition of the type; the
34289 exceptions are explained below. Inherited subprograms are also
34290 implicitly declared immediately after the definition of the type, except
34291 as stated below.
34292
34293 3/3
34294 {8652/00198652/0019} {AI95-00033-01AI95-00033-01}
34295 {AI05-0029-1AI05-0029-1} For a composite type, the characteristics (see
34296 *note 7.3::) of the type are determined in part by the characteristics
34297 of its component types. At the place where the composite type is
34298 declared, the only characteristics of component types used are those
34299 characteristics visible at that place. If later immediately within the
34300 declarative region in which the composite type is declared additional
34301 characteristics become visible for a component type, then any
34302 corresponding characteristics become visible for the composite type.
34303 Any additional predefined operators are implicitly declared at that
34304 place. If there is no such place, then additional predefined operators
34305 are not declared at all, but they still exist.
34306
34307 3.a/3
34308 Reason: {AI05-0029-1AI05-0029-1} We say that the predefined
34309 operators exist because they can emerge in some unusual
34310 generic instantiations. See *note 12.5::.
34311
34312 3.b/3
34313 Discussion: {AI05-0029-1AI05-0029-1} The predefined operators
34314 for the underlying class of a type always exist, even if there
34315 is no visibility on that underlying class. This rule is
34316 simply about where (if ever) those operators are declared (and
34317 thus become usable). The "additional predefined operators"
34318 defined by this rule are any that are not declared at the
34319 point of the original type declaration. For instance, a type
34320 derived from a private type whose full type is type String
34321 always will have a ">" operator, but where that operator is
34322 declared (and thus whether it is visible) will depend on the
34323 visibility of the full type of the parent type.
34324
34325 4/1
34326 {8652/00198652/0019} {AI95-00033-01AI95-00033-01} The corresponding rule
34327 applies to a type defined by a derived_type_definition, if there is a
34328 place immediately within the declarative region in which the type is
34329 declared where additional characteristics of its parent type become
34330 visible.
34331
34332 5/1
34333 {8652/00198652/0019} {AI95-00033-01AI95-00033-01} [For example, an array
34334 type whose component type is limited private becomes nonlimited if the
34335 full view of the component type is nonlimited and visible at some later
34336 place immediately within the declarative region in which the array type
34337 is declared. In such a case, the predefined "=" operator is implicitly
34338 declared at that place, and assignment is allowed after that place.]
34339
34340 5.1/3
34341 {AI05-0115-1AI05-0115-1} {AI05-0269-1AI05-0269-1} A type is a descendant
34342 of the full view of some ancestor of its parent type only if the current
34343 view it has of its parent is a descendant of the full view of that
34344 ancestor. More generally, at any given place, a type is descended from
34345 the same view of an ancestor as that from which the current view of its
34346 parent is descended. This view determines what characteristics are
34347 inherited from the ancestor[, and, for example, whether the type is
34348 considered to be a descendant of a record type, or a descendant only
34349 through record extensions of a more distant ancestor].
34350
34351 5.2/3
34352 {AI05-0115-1AI05-0115-1} [It is possible for there to be places where a
34353 derived type is visibly a descendant of an ancestor type, but not a
34354 descendant of even a partial view of the ancestor type, because the
34355 parent of the derived type is not visibly a descendant of the ancestor.
34356 In this case, the derived type inherits no characteristics from that
34357 ancestor, but nevertheless is within the derivation class of the
34358 ancestor for the purposes of type conversion, the "covers" relationship,
34359 and matching against a formal derived type. In this case the derived
34360 type is considered to be a descendant of an incomplete view of the
34361 ancestor.]
34362
34363 5.a.1/3
34364 Discussion: Here is an example of this situation:
34365
34366 5.a.2/3
34367 package P is
34368 type T is private;
34369 C : constant T;
34370 private
34371 type T is new Integer;
34372 C : constant T := 42;
34373 end P;
34374
34375 5.a.3/3
34376 with P;
34377 package Q is
34378 type T2 is new P.T;
34379 end Q;
34380
34381 5.a.4/3
34382 with Q;
34383 package P.Child is
34384 type T3 is new Q.T2;
34385 private
34386 Int : Integer := 52;
34387 V : T3 := T3(P.C); -- Legal: conversion allowed
34388 W : T3 := T3(Int); -- Legal: conversion allowed
34389 X : T3 := T3(42); -- Error: T3 is not a numeric type
34390 Y : T3 := X + 1; -- Error: no visible "+" operator
34391 Z : T3 := T3(Integer(W) + 1); -- Legal: convert to Integer first
34392 end P.Child;
34393
34394 6/3
34395 {8652/00198652/0019} {AI95-00033-01AI95-00033-01}
34396 {AI05-0029-1AI05-0029-1} Inherited primitive subprograms follow a
34397 different rule. For a derived_type_definition, each inherited primitive
34398 subprogram is implicitly declared at the earliest place, if any,
34399 immediately within the declarative region in which the type_declaration
34400 occurs, but after the type_declaration, where the corresponding
34401 declaration from the parent is visible. If there is no such place, then
34402 the inherited subprogram is not declared at all, but it still exists.
34403 [For a tagged type, it is possible to dispatch to an inherited
34404 subprogram that is not declared at all.]
34405
34406 7
34407 For a private_extension_declaration, each inherited subprogram is
34408 declared immediately after the private_extension_declaration if the
34409 corresponding declaration from the ancestor is visible at that place.
34410 Otherwise, the inherited subprogram is not declared for the private
34411 extension, [though it might be for the full type].
34412
34413 7.a/1
34414 Reason: There is no need for the "earliest place immediately
34415 within the declarative region" business here, because a
34416 private_extension_declaration will be completed with a
34417 full_type_declaration, so we can hang the necessary private
34418 implicit declarations on the full_type_declaration.
34419
34420 7.b
34421 Discussion: The above rules matter only when the component
34422 type (or parent type) is declared in the visible part of a
34423 package, and the composite type (or derived type) is declared
34424 within the declarative region of that package (possibly in a
34425 nested package or a child package).
34426
34427 7.c
34428 Consider:
34429
34430 7.d
34431 package Parent is
34432 type Root is tagged null record;
34433 procedure Op1(X : Root);
34434
34435 7.e
34436 type My_Int is range 1..10;
34437 private
34438 procedure Op2(X : Root);
34439
34440 7.f
34441 type Another_Int is new My_Int;
34442 procedure Int_Op(X : My_Int);
34443 end Parent;
34444
34445 7.g
34446 with Parent; use Parent;
34447 package Unrelated is
34448 type T2 is new Root with null record;
34449 procedure Op2(X : T2);
34450 end Unrelated;
34451
34452 7.h
34453 package Parent.Child is
34454 type T3 is new Root with null record;
34455 -- Op1(T3) implicitly declared here.
34456
34457 7.i
34458 package Nested is
34459 type T4 is new Root with null record;
34460 private
34461 ...
34462 end Nested;
34463 private
34464 -- Op2(T3) implicitly declared here.
34465 ...
34466 end Parent.Child;
34467
34468 7.j
34469 with Unrelated; use Unrelated;
34470 package body Parent.Child is
34471 package body Nested is
34472 -- Op2(T4) implicitly declared here.
34473 end Nested;
34474
34475 7.k
34476 type T5 is new T2 with null record;
34477 end Parent.Child;
34478
34479 7.l
34480 Another_Int does not inherit Int_Op, because Int_Op does not
34481 "exist" at the place where Another_Int is declared.
34482
34483 7.m/1
34484 Type T2 inherits Op1 and Op2 from Root. However, the
34485 inherited Op2 is never declared, because Parent.Op2 is never
34486 visible immediately within the declarative region of T2. T2
34487 explicitly declares its own Op2, but this is unrelated to the
34488 inherited one -- it does not override the inherited one, and
34489 occupies a different slot in the type descriptor.
34490
34491 7.n
34492 T3 inherits both Op1 and Op2. Op1 is implicitly declared
34493 immediately after the type declaration, whereas Op2 is
34494 declared at the beginning of the private part. Note that if
34495 Child were a private child of Parent, then Op1 and Op2 would
34496 both be implicitly declared immediately after the type
34497 declaration.
34498
34499 7.o/1
34500 T4 is similar to T3, except that the earliest place
34501 immediately within the declarative region containing T4 where
34502 Root's Op2 is visible is in the body of Nested.
34503
34504 7.p
34505 If T3 or T4 were to declare a type-conformant Op2, this would
34506 override the one inherited from Root. This is different from
34507 the situation with T2.
34508
34509 7.q
34510 T5 inherits Op1 and two Op2's from T2. Op1 is implicitly
34511 declared immediately after the declaration of T5, as is the
34512 Op2 that came from Unrelated.Op2. However, the Op2 that
34513 originally came from Parent.Op2 is never implicitly declared
34514 for T5, since T2's version of that Op2 is never visible
34515 (anywhere -- it never got declared either).
34516
34517 7.r
34518 For all of these rules, implicit private parts and bodies are
34519 assumed as needed.
34520
34521 7.s
34522 It is possible for characteristics of a type to be revealed in
34523 more than one place:
34524
34525 7.t
34526 package P is
34527 type Comp1 is private;
34528 private
34529 type Comp1 is new Boolean;
34530 end P;
34531
34532 7.u
34533 package P.Q is
34534 package R is
34535 type Comp2 is limited private;
34536 type A is array(Integer range <>) of Comp2;
34537 private
34538 type Comp2 is new Comp1;
34539 -- A becomes nonlimited here.
34540 -- "="(A, A) return Boolean is implicitly declared here.
34541 ...
34542 end R;
34543 private
34544 -- Now we find out what Comp1 really is, which reveals
34545 -- more information about Comp2, but we're not within
34546 -- the immediate scope of Comp2, so we don't do anything
34547 -- about it yet.
34548 end P.Q;
34549
34550 7.v
34551 package body P.Q is
34552 package body R is
34553 -- Things like "xor"(A,A) return A are implicitly
34554 -- declared here.
34555 end R;
34556 end P.Q;
34557
34558 7.v.1/1
34559 {8652/00198652/0019} {AI95-00033-01AI95-00033-01} We say
34560 immediately within the declarative region in order that types
34561 do not gain operations within a nested scope. Consider:
34562
34563 7.v.2/1
34564 package Outer is
34565 package Inner is
34566 type Inner_Type is private;
34567 private
34568 type Inner_Type is new Boolean;
34569 end Inner;
34570 type Outer_Type is array(Natural range <>) of Inner.Inner_Type;
34571 end Outer;
34572
34573 7.v.3/1
34574 package body Outer is
34575 package body Inner is
34576 -- At this point, we can see that Inner_Type is a Boolean type.
34577 -- But we don't want Outer_Type to gain an "and" operator here.
34578 end Inner;
34579 end Outer;
34580
34581 8
34582 [The Class attribute is defined for tagged subtypes in *note 3.9::. In
34583 addition,] for every subtype S of an untagged private type whose full
34584 view is tagged, the following attribute is defined:
34585
34586 9
34587 S'Class
34588 Denotes the class-wide subtype corresponding to the full
34589 view of S. This attribute is allowed only from the
34590 beginning of the private part in which the full view is
34591 declared, until the declaration of the full view. [After
34592 the full view, the Class attribute of the full view can
34593 be used.]
34594
34595 NOTES
34596
34597 10
34598 9 Because a partial view and a full view are two different views
34599 of one and the same type, outside of the defining package the
34600 characteristics of the type are those defined by the visible part.
34601 Within these outside program units the type is just a private type
34602 or private extension, and any language rule that applies only to
34603 another class of types does not apply. The fact that the full
34604 declaration might implement a private type with a type of a
34605 particular class (for example, as an array type) is relevant only
34606 within the declarative region of the package itself including any
34607 child units.
34608
34609 11
34610 The consequences of this actual implementation are, however, valid
34611 everywhere. For example: any default initialization of components
34612 takes place; the attribute Size provides the size of the full view;
34613 finalization is still done for controlled components of the full
34614 view; task dependence rules still apply to components that are task
34615 objects.
34616
34617 12/2
34618 10 {AI95-00287-01AI95-00287-01} Partial views provide
34619 initialization, membership tests, selected components for the
34620 selection of discriminants and inherited components, qualification,
34621 and explicit conversion. Nonlimited partial views also allow use
34622 of assignment_statements.
34623
34624 13
34625 11 For a subtype S of a partial view, S'Size is defined (see *note
34626 13.3::). For an object A of a partial view, the attributes A'Size
34627 and A'Address are defined (see *note 13.3::). The Position,
34628 First_Bit, and Last_Bit attributes are also defined for
34629 discriminants and inherited components.
34630
34631 _Examples_
34632
34633 14
34634 Example of a type with private operations:
34635
34636 15
34637 package Key_Manager is
34638 type Key is private;
34639 Null_Key : constant Key; -- a deferred constant declaration (see *note 7.4::)
34640 procedure Get_Key(K : out Key);
34641 function "<" (X, Y : Key) return Boolean;
34642 private
34643 type Key is new Natural;
34644 Null_Key : constant Key := Key'First;
34645 end Key_Manager;
34646
34647 16
34648 package body Key_Manager is
34649 Last_Key : Key := Null_Key;
34650 procedure Get_Key(K : out Key) is
34651 begin
34652 Last_Key := Last_Key + 1;
34653 K := Last_Key;
34654 end Get_Key;
34655
34656 17
34657 function "<" (X, Y : Key) return Boolean is
34658 begin
34659 return Natural(X) < Natural(Y);
34660 end "<";
34661 end Key_Manager;
34662
34663 NOTES
34664
34665 18
34666 12 Notes on the example: Outside of the package Key_Manager, the
34667 operations available for objects of type Key include assignment,
34668 the comparison for equality or inequality, the procedure Get_Key
34669 and the operator "<"; they do not include other relational
34670 operators such as ">=", or arithmetic operators.
34671
34672 19
34673 The explicitly declared operator "<" hides the predefined operator
34674 "<" implicitly declared by the full_type_declaration. Within the
34675 body of the function, an explicit conversion of X and Y to the
34676 subtype Natural is necessary to invoke the "<" operator of the
34677 parent type. Alternatively, the result of the function could be
34678 written as not (X >= Y), since the operator ">=" is not redefined.
34679
34680 20
34681 The value of the variable Last_Key, declared in the package body,
34682 remains unchanged between calls of the procedure Get_Key. (See
34683 also the NOTES of *note 7.2::.)
34684
34685 _Wording Changes from Ada 83_
34686
34687 20.a
34688 The phrase in RM83-7.4.2(7), "...after the full type
34689 declaration", doesn't work in the presence of child units, so
34690 we define that rule in terms of visibility.
34691
34692 20.b
34693 The definition of the Constrained attribute for private types
34694 has been moved to "Obsolescent Features." (The Constrained
34695 attribute of an object has not been moved there.)
34696
34697 _Wording Changes from Ada 95_
34698
34699 20.c/2
34700 {8652/00188652/0018} {AI95-00033-01AI95-00033-01} Corrigendum:
34701 Clarified when additional operations are declared.
34702
34703 20.d/2
34704 {AI95-00287-01AI95-00287-01} Revised the note on operations of
34705 partial views to reflect that limited types do have an
34706 assignment operation, but not assignment_statements.
34707
34708 _Wording Changes from Ada 2005_
34709
34710 20.e/3
34711 {AI05-0029-1AI05-0029-1} Correction: Revised the wording to
34712 say that predefined operations still exist even if they are
34713 never declared, because it is possible to reference them in a
34714 generic unit.
34715
34716 20.f/3
34717 {AI05-0115-1AI05-0115-1} Correction: Clarified that the
34718 characteristics of a descendant of a private type depend on
34719 the visibility of the full view of the direct ancestor. This
34720 has to be the case (so that privacy is not violated), but it
34721 wasn't spelled out in earlier versions of Ada.
34722
34723 \1f
34724 File: aarm2012.info, Node: 7.3.2, Prev: 7.3.1, Up: 7.3
34725
34726 7.3.2 Type Invariants
34727 ---------------------
34728
34729 1/3
34730 {AI05-0146-1AI05-0146-1} For a private type or private extension, the
34731 following language-defined aspects may be specified with an
34732 aspect_specification (see *note 13.1.1::):
34733
34734 2/3
34735 {AI05-0146-1AI05-0146-1} {AI05-0250-1AI05-0250-1} Type_Invariant
34736 This aspect shall be specified by an expression, called
34737 an invariant expression. Type_Invariant may be specified
34738 on a private_type_declaration (*note 7.3: S0193.), on a
34739 private_extension_declaration (*note 7.3: S0194.), or on
34740 a full_type_declaration (*note 3.2.1: S0024.) that
34741 declares the completion of a private type or private
34742 extension.
34743
34744 2.a/3
34745 Aspect Description for Type_Invariant: A condition that must
34746 hold true for all objects of a type.
34747
34748 3/3
34749 {AI05-0146-1AI05-0146-1} Type_Invariant'Class
34750 This aspect shall be specified by an expression, called
34751 an invariant expression. Type_Invariant'Class may be
34752 specified on a private_type_declaration (*note 7.3:
34753 S0193.) or a private_extension_declaration (*note 7.3:
34754 S0194.).
34755
34756 3.a/3
34757 Reason: {AI05-0254-1AI05-0254-1} A class-wide type invariant
34758 cannot be hidden in the private part, as the creator of an
34759 extension needs to know about it in order to conform to it in
34760 any new or overriding operations. On the other hand, a
34761 specific type invariant is not inherited, so that no operation
34762 outside of the original package needs to conform to it; thus
34763 there is no need for it to be visible.
34764
34765 3.b/3
34766 Aspect Description for Type_Invariant'Class: A condition that
34767 must hold true for all objects in a class of types.
34768
34769 _Name Resolution Rules_
34770
34771 4/3
34772 {AI05-0146-1AI05-0146-1} The expected type for an invariant expression
34773 is any boolean type.
34774
34775 5/3
34776 {AI05-0146-1AI05-0146-1} [Within an invariant expression, the identifier
34777 of the first subtype of the associated type denotes the current instance
34778 of the type.] Within an invariant expression associated with type T,
34779 the type of the current instance is T for the Type_Invariant aspect and
34780 T'Class for the Type_Invariant'Class aspect.
34781
34782 5.a/3
34783 Proof: The first sentence is given formally in *note 13.1.1::.
34784
34785 _Legality Rules_
34786
34787 6/3
34788 {AI05-0146-1AI05-0146-1} [The Type_Invariant'Class aspect shall not be
34789 specified for an untagged type.] The Type_Invariant aspect shall not be
34790 specified for an abstract type.
34791
34792 6.a/3
34793 Proof: The first sentence is given formally in *note 13.1.1::.
34794
34795 _Static Semantics_
34796
34797 7/3
34798 {AI05-0250-1AI05-0250-1} [If the Type_Invariant aspect is specified for
34799 a type T, then the invariant expression applies to T.]
34800
34801 8/3
34802 {AI05-0146-1AI05-0146-1} [If the Type_Invariant'Class aspect is
34803 specified for a tagged type T, then the invariant expression applies to
34804 all descendants of T.]
34805
34806 8.a/3
34807 Proof: "Applies" is formally defined in *note 13.1.1::.
34808
34809 _Dynamic Semantics_
34810
34811 9/3
34812 {AI05-0146-1AI05-0146-1} {AI05-0247-1AI05-0247-1}
34813 {AI05-0290-1AI05-0290-1} If one or more invariant expressions apply to a
34814 type T, then an invariant check is performed at the following places, on
34815 the specified object(s):
34816
34817 10/3
34818 * After successful default initialization of an object of type T, the
34819 check is performed on the new object;
34820
34821 11/3
34822 * After successful conversion to type T, the check is performed on
34823 the result of the conversion;
34824
34825 12/3
34826 * {AI05-0146-1AI05-0146-1} {AI05-0269-1AI05-0269-1} For a view
34827 conversion, outside the immediate scope of T, that converts from a
34828 descendant of T (including T itself) to an ancestor of type T
34829 (other than T itself), a check is performed on the part of the
34830 object that is of type T:
34831
34832 13/3
34833 * after assigning to the view conversion; and
34834
34835 14/3
34836 * after successful return from a call that passes the view
34837 conversion as an in out or out parameter.
34838
34839 14.a/3
34840 Ramification: For a single view conversion that converts
34841 between distantly related types, this rule could be triggered
34842 for multiple types and thus multiple invariant checks may be
34843 needed.
34844
34845 14.b/3
34846 Implementation Note: {AI05-0299-1AI05-0299-1} For calls to
34847 inherited subprograms (including dispatching calls), the
34848 implied view conversions mean that a wrapper is probably
34849 needed. (See the Note at the bottom of this subclause for
34850 more on the model of checks for inherited subprograms.)
34851
34852 14.c/3
34853 For view conversions involving class-wide types, the exact
34854 checks needed may not be known at compile-time. One way to
34855 deal with this is to have an implicit dispatching operation
34856 that is given the object to check and the tag of the target of
34857 the conversion, and which first checks if the passed tag is
34858 not for itself, and if not, checks the its invariant on the
34859 object and then calls the operation of its parent type. If
34860 the tag is for itself, the operation is complete.
34861
34862 15/3
34863 * After a successful call on the Read or Input stream attribute of
34864 the type T, the check is performed on the object initialized by the
34865 stream attribute;
34866
34867 16/3
34868 * {AI05-0146-1AI05-0146-1} {AI05-0269-1AI05-0269-1} An invariant is
34869 checked upon successful return from a call on any subprogram or
34870 entry that:
34871
34872 17/3
34873 * {AI05-0146-1AI05-0146-1} {AI05-0269-1AI05-0269-1} is declared
34874 within the immediate scope of type T (or by an instance of a
34875 generic unit, and the generic is declared within the immediate
34876 scope of type T), and
34877
34878 18/3
34879 * is visible outside the immediate scope of type T or overrides
34880 an operation that is visible outside the immediate scope of T,
34881 and
34882
34883 19/3
34884 * {AI05-0289-1AI05-0289-1} has a result with a part of type T,
34885 or one or more parameters with a part of type T, or an access
34886 to variable parameter whose designated type has a part of type
34887 T.
34888
34889 20/3
34890 {AI05-0146-1AI05-0146-1} {AI05-0269-1AI05-0269-1} The check is
34891 performed on each such part of type T.
34892
34893 21/3
34894 {AI05-0290-1AI05-0290-1} If performing checks is required by the
34895 Invariant or Invariant'Class assertion policies (see *note 11.4.2::) in
34896 effect at the point of corresponding aspect specification applicable to
34897 a given type, then the respective invariant expression is considered
34898 enabled.
34899
34900 21.a/3
34901 Ramification: If a class-wide invariant expression is enabled
34902 for a type, it remains enabled when inherited by descendants
34903 of that type, even if the policy in effect is Ignore for the
34904 inheriting type.
34905
34906 22/3
34907 {AI05-0146-1AI05-0146-1} {AI05-0250-1AI05-0250-1}
34908 {AI05-0289-1AI05-0289-1} {AI05-0290-1AI05-0290-1} The invariant check
34909 consists of the evaluation of each enabled invariant expression that
34910 applies to T, on each of the objects specified above. If any of these
34911 evaluate to False, Assertions.Assertion_Error is raised at the point of
34912 the object initialization, conversion, or call. If a given call
34913 requires more than one evaluation of an invariant expression, either for
34914 multiple objects of a single type or for multiple types with invariants,
34915 the evaluations are performed in an arbitrary order, and if one of them
34916 evaluates to False, it is not specified whether the others are
34917 evaluated. Any invariant check is performed prior to copying back any
34918 by-copy in out or out parameters. Invariant checks, any postcondition
34919 check, and any constraint or predicate checks associated with in out or
34920 out parameters are performed in an arbitrary order.
34921
34922 23/3
34923 {AI05-0146-1AI05-0146-1} {AI05-0247-1AI05-0247-1}
34924 {AI05-0250-1AI05-0250-1} The invariant checks performed on a call are
34925 determined by the subprogram or entry actually invoked, whether
34926 directly, as part of a dispatching call, or as part of a call through an
34927 access-to-subprogram value.
34928
34929 23.a/3
34930 Ramification: Invariant checks on subprogram return are not
34931 performed on objects that are accessible only through access
34932 values. It is also possible to call through an
34933 access-to-subprogram value and reach a subprogram body that
34934 has visibility on the full declaration of a type, from outside
34935 the immediate scope of the type. No invariant checks will be
34936 performed if the designated subprogram is not itself
34937 externally visible. These cases represent "holes" in the
34938 protection provided by invariant checks; but note that these
34939 holes cannot be caused by clients of the type T with the
34940 invariant without help for the designer of the package
34941 containing T.
34942
34943 23.b/3
34944 Implementation Note: The implementation might want to produce
34945 a warning if a private extension has an ancestor type that is
34946 a visible extension, and an invariant expression depends on
34947 the value of one of the components from a visible extension
34948 part.
34949
34950 NOTES
34951
34952 24/3
34953 13 {AI05-0250-1AI05-0250-1} {AI05-0269-1AI05-0269-1} For a call of
34954 a primitive subprogram of type NT that is inherited from type T,
34955 the specified checks of the specific invariants of both the types
34956 NT and T are performed. For a call of a primitive subprogram of
34957 type NT that is overridden for type NT, the specified checks of the
34958 specific invariants of only type NT are performed.
34959
34960 24.a/3
34961 Proof: This follows from the definition of a call on an
34962 inherited subprogram as view conversions of the parameters of
34963 the type and a call to the original subprogram (see *note
34964 3.4::), along with the normal invariant checking rules. In
34965 particular, the call to the original subprogram takes care of
34966 any checks needed on type T, and the checks required on view
34967 conversions take care of any checks needed on type NT,
34968 specifically on in out and out parameters. We require this in
34969 order that the semantics of an explicitly defined wrapper that
34970 does nothing but call the original subprogram is the same as
34971 that of an inherited subprogram.
34972
34973 _Extensions to Ada 2005_
34974
34975 24.b/3
34976 {AI05-0146-1AI05-0146-1} {AI05-0247-1AI05-0247-1}
34977 {AI05-0250-1AI05-0250-1} {AI05-0289-1AI05-0289-1}
34978 Type_Invariant aspects are new.
34979
34980 \1f
34981 File: aarm2012.info, Node: 7.4, Next: 7.5, Prev: 7.3, Up: 7
34982
34983 7.4 Deferred Constants
34984 ======================
34985
34986 1
34987 [Deferred constant declarations may be used to declare constants in the
34988 visible part of a package, but with the value of the constant given in
34989 the private part. They may also be used to declare constants imported
34990 from other languages (see *note Annex B::).]
34991
34992 _Legality Rules_
34993
34994 2/3
34995 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} [ A deferred constant
34996 declaration is an object_declaration with the reserved word constant but
34997 no initialization expression.] The constant declared by a deferred
34998 constant declaration is called a deferred constant. [Unless the Import
34999 aspect (see *note B.1::) is True for a deferred constant declaration,
35000 the ] deferred constant declaration requires a completion, which shall
35001 be a full constant declaration (called the full declaration of the
35002 deferred constant).
35003
35004 2.a
35005 Proof: The first sentence is redundant, as it is stated
35006 officially in *note 3.3.1::.
35007
35008 2.b/3
35009 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} The first
35010 part of the last sentence is redundant, as no imported entity
35011 may have a completion, as stated in *note B.1::.
35012
35013 3
35014 A deferred constant declaration that is completed by a full constant
35015 declaration shall occur immediately within the visible part of a
35016 package_specification. For this case, the following additional rules
35017 apply to the corresponding full declaration:
35018
35019 4
35020 * The full declaration shall occur immediately within the private
35021 part of the same package;
35022
35023 5/2
35024 * {AI95-00385-01AI95-00385-01} The deferred and full constants shall
35025 have the same type, or shall have statically matching anonymous
35026 access subtypes;
35027
35028 5.a/2
35029 Ramification: {AI95-00385-01AI95-00385-01} This implies that
35030 both the deferred declaration and the full declaration have to
35031 have a subtype_indication or access_definition rather than an
35032 array_type_definition, because each array_type_definition
35033 would define a new type.
35034
35035 6/3
35036 * {AI95-00385-01AI95-00385-01} {AI05-0062-1AI05-0062-1}
35037 {AI05-0262-1AI05-0262-1} If the deferred constant declaration
35038 includes a subtype_indication S that defines a constrained subtype,
35039 then the constraint defined by the subtype_indication in the full
35040 declaration shall match the constraint defined by S statically.[ On
35041 the other hand, if the subtype of the deferred constant is
35042 unconstrained, then the full declaration is still allowed to impose
35043 a constraint. The constant itself will be constrained, like all
35044 constants;]
35045
35046 7/2
35047 * {AI95-00231-01AI95-00231-01} If the deferred constant declaration
35048 includes the reserved word aliased, then the full declaration shall
35049 also;
35050
35051 7.a
35052 Ramification: On the other hand, the full constant can be
35053 aliased even if the deferred constant is not.
35054
35055 7.1/2
35056 * {AI95-00231-01AI95-00231-01} If the subtype of the deferred
35057 constant declaration excludes null, the subtype of the full
35058 declaration shall also exclude null.
35059
35060 7.a.1/2
35061 Ramification: On the other hand, the full constant can exclude
35062 null even if the deferred constant does not. But that can
35063 only happen for a subtype_indication, as anonymous access
35064 types are required to statically match (which includes any
35065 null_exclusion).
35066
35067 8/3
35068 {AI05-0229-1AI05-0229-1} [A deferred constant declaration for which the
35069 Import aspect is True need not appear in the visible part of a
35070 package_specification, and has no full constant declaration.]
35071
35072 9/2
35073 {AI95-00256-01AI95-00256-01} The completion of a deferred constant
35074 declaration shall occur before the constant is frozen (see *note
35075 13.14::).
35076
35077 _Dynamic Semantics_
35078
35079 10/3
35080 {AI05-0004-1AI05-0004-1} The elaboration of a deferred constant
35081 declaration elaborates the subtype_indication, access_definition, or
35082 (only allowed in the case of an imported constant) the
35083 array_type_definition.
35084
35085 10.a/3
35086 Ramification: {AI05-0004-1AI05-0004-1} For nonimported
35087 constants, these elaborations cannot require any code or
35088 checks for a legal program, because the given
35089 subtype_indication has to be indefinite or statically match
35090 that of the full constant, meaning that either it is a
35091 subtype_mark or it has static constraints. If the deferred
35092 constant instead has an access_definition, the designated
35093 subtype must be a subtype_mark. We still say that these are
35094 elaborated, however, because part of elaboration is creating
35095 the type, which is clearly needed for access_definitions. (A
35096 deferred constant and its full constant have different types
35097 when they are specified by an access_definition, although
35098 there is no visible effect of these types being different as
35099 neither can be named.)
35100
35101 NOTES
35102
35103 11
35104 14 The full constant declaration for a deferred constant that is
35105 of a given private type or private extension is not allowed before
35106 the corresponding full_type_declaration. This is a consequence of
35107 the freezing rules for types (see *note 13.14::).
35108
35109 11.a
35110 Ramification: Multiple or single declarations are allowed for
35111 the deferred and the full declarations, provided that the
35112 equivalent single declarations would be allowed.
35113
35114 11.b
35115 Deferred constant declarations are useful for declaring
35116 constants of private views, and types with components of
35117 private views. They are also useful for declaring
35118 access-to-constant objects that designate variables declared
35119 in the private part of a package.
35120
35121 _Examples_
35122
35123 12
35124 Examples of deferred constant declarations:
35125
35126 13
35127 Null_Key : constant Key; -- see *note 7.3.1::
35128
35129 14/3
35130 {AI05-0229-1AI05-0229-1} CPU_Identifier : constant String(1..8)
35131 with Import => True, Convention => Assembler, Link_Name => "CPU_ID";
35132 -- see *note B.1::
35133
35134 _Extensions to Ada 83_
35135
35136 14.a
35137 In Ada 83, a deferred constant is required to be of a private
35138 type declared in the same visible part. This restriction is
35139 removed for Ada 95; deferred constants can be of any type.
35140
35141 14.b
35142 In Ada 83, a deferred constant declaration was not permitted
35143 to include a constraint, nor the reserved word aliased.
35144
35145 14.c
35146 In Ada 83, the rules required conformance of type marks; here
35147 we require static matching of subtypes if the deferred
35148 constant is constrained.
35149
35150 14.d
35151 A deferred constant declaration can be completed with a pragma
35152 Import. Such a deferred constant declaration need not be
35153 within a package_specification.
35154
35155 14.e
35156 The rules for too-early uses of deferred constants are
35157 modified in Ada 95 to allow more cases, and catch all errors
35158 at compile time. This change is necessary in order to allow
35159 deferred constants of a tagged type without violating the
35160 principle that for a dispatching call, there is always an
35161 implementation to dispatch to. It has the beneficial side
35162 effect of catching some Ada-83-erroneous programs at compile
35163 time. The new rule fits in well with the new freezing-point
35164 rules. Furthermore, we are trying to convert undefined-value
35165 problems into bounded errors, and we were having trouble for
35166 the case of deferred constants. Furthermore, uninitialized
35167 deferred constants cause trouble for the shared variable /
35168 tasking rules, since they are really variable, even though
35169 they purport to be constant. In Ada 95, they cannot be
35170 touched until they become constant.
35171
35172 14.f
35173 Note that we do not consider this change to be an upward
35174 incompatibility, because it merely changes an erroneous
35175 execution in Ada 83 into a compile-time error.
35176
35177 14.g
35178 The Ada 83 semantics are unclear in the case where the full
35179 view turns out to be an access type. It is a goal of the
35180 language design to prevent uninitialized access objects. One
35181 wonders if the implementation is required to initialize the
35182 deferred constant to null, and then initialize it (again!) to
35183 its real value. In Ada 95, the problem goes away.
35184
35185 _Wording Changes from Ada 83_
35186
35187 14.h/3
35188 {AI05-0299-1AI05-0299-1} Since deferred constants can now be
35189 of a nonprivate type, we have made this a stand-alone
35190 subclause, rather than a subclause of *note 7.3::, "*note
35191 7.3:: Private Types and Private Extensions".
35192
35193 14.i
35194 Deferred constant declarations used to have their own syntax,
35195 but now they are simply a special case of object_declarations.
35196
35197 _Extensions to Ada 95_
35198
35199 14.j/2
35200 {AI95-00385-01AI95-00385-01} Deferred constants were enhanced
35201 to allow the use of anonymous access types in them.
35202
35203 _Wording Changes from Ada 95_
35204
35205 14.k/2
35206 {AI95-00231-01AI95-00231-01} Added matching rules for subtypes
35207 that exclude null.
35208
35209 _Wording Changes from Ada 2005_
35210
35211 14.l/3
35212 {AI05-0062-1AI05-0062-1} Correction: Corrected rules so that
35213 the intent that a full constant may have a null exclusion even
35214 if the deferred constant does not is actually met.
35215
35216 \1f
35217 File: aarm2012.info, Node: 7.5, Next: 7.6, Prev: 7.4, Up: 7
35218
35219 7.5 Limited Types
35220 =================
35221
35222 1/2
35223 {AI95-00287-01AI95-00287-01} [A limited type is (a view of) a type for
35224 which copying (such as for an assignment_statement) is not allowed. A
35225 nonlimited type is a (view of a) type for which copying is allowed.]
35226
35227 1.a
35228 Discussion: The concept of the value of a limited type is
35229 difficult to define, since the abstract value of a limited
35230 type often extends beyond its physical representation. In
35231 some sense, values of a limited type cannot be divorced from
35232 their object. The value is the object.
35233
35234 1.b/2
35235 {AI95-00318-02AI95-00318-02} In Ada 83, in the two places
35236 where limited types were defined by the language, namely tasks
35237 and files, an implicit level of indirection was implied by the
35238 semantics to avoid the separation of the value from an
35239 associated object. In Ada 95, most limited types are passed
35240 by reference, and even return-ed by reference. In Ada 2005,
35241 most limited types are built-in-place upon return, rather than
35242 returned by reference. Thus the object "identity" is part of
35243 the logical value of most limited types.
35244
35245 1.c/2
35246 To be honest: {AI95-00287-01AI95-00287-01}
35247 {AI95-00419-01AI95-00419-01} For a limited partial view whose
35248 full view is nonlimited, copying is possible on parameter
35249 passing and function return. To prevent any copying
35250 whatsoever, one should make both the partial and full views
35251 limited.
35252
35253 1.d/2
35254 Glossary entry: A limited type is a type for which copying
35255 (such as in an assignment_statement) is not allowed. A
35256 nonlimited type is a type for which copying is allowed.
35257
35258 _Legality Rules_
35259
35260 2/2
35261 {AI95-00419-01AI95-00419-01} If a tagged record type has any limited
35262 components, then the reserved word limited shall appear in its
35263 record_type_definition. [If the reserved word limited appears in the
35264 definition of a derived_type_definition, its parent type and any
35265 progenitor interfaces shall be limited.]
35266
35267 2.a.1/2
35268 Proof: {AI95-00419-01AI95-00419-01} The rule about the parent
35269 type being required to be limited can be found in *note 3.4::.
35270 Rules about progenitor interfaces can be found in *note
35271 3.9.4::, specifically, a nonlimited interface can appear only
35272 on a nonlimited type. We repeat these rules here to gather
35273 these scattered rules in one obvious place.
35274
35275 2.a
35276 Reason: This prevents tagged limited types from becoming
35277 nonlimited. Otherwise, the following could happen:
35278
35279 2.b
35280 package P is
35281 type T is limited private;
35282 type R is tagged
35283 record -- Illegal!
35284 -- This should say "limited record".
35285 X : T;
35286 end record;
35287 private
35288 type T is new Integer; -- R becomes nonlimited here.
35289 end P;
35290
35291 2.c/2
35292 package Q is
35293 type R2 is new R with
35294 record
35295 Y : Some_Task_Type;
35296 end record;
35297 end Q;
35298
35299 2.d/2
35300 {AI95-00230-01AI95-00230-01} If the above were legal, then
35301 assignment would be defined for R'Class in the body of P,
35302 which is bad news, given the task.
35303
35304 2.1/3
35305 {AI95-00287-01AI95-00287-01} {AI95-00318-02AI95-00318-02}
35306 {AI05-0147-1AI05-0147-1} In the following contexts, an expression of a
35307 limited type is not permitted unless it is an aggregate, a
35308 function_call, a parenthesized expression or qualified_expression whose
35309 operand is permitted by this rule, or a conditional_expression all of
35310 whose dependent_expressions are permitted by this rule:
35311
35312 2.2/2
35313 * the initialization expression of an object_declaration (see *note
35314 3.3.1::)
35315
35316 2.3/2
35317 * the default_expression of a component_declaration (see *note 3.8::)
35318
35319 2.4/2
35320 * the expression of a record_component_association (see *note
35321 4.3.1::)
35322
35323 2.5/2
35324 * the expression for an ancestor_part of an extension_aggregate (see
35325 *note 4.3.2::)
35326
35327 2.6/2
35328 * an expression of a positional_array_aggregate or the expression of
35329 an array_component_association (see *note 4.3.3::)
35330
35331 2.7/2
35332 * the qualified_expression of an initialized allocator (see *note
35333 4.8::)
35334
35335 2.8/2
35336 * the expression of a return statement (see *note 6.5::)
35337
35338 2.9/3
35339 * {AI05-0177-1AI05-0177-1} the expression of an
35340 expression_function_declaration (see *note 6.8::)
35341
35342 2.10/3
35343 * the default_expression or actual parameter for a formal object of
35344 mode in (see *note 12.4::)
35345
35346 2.e/2
35347 Discussion: All of these contexts normally require copying; by
35348 restricting the uses as above, we can require the new object
35349 to be built-in-place.
35350
35351 _Static Semantics_
35352
35353 3/3
35354 {AI95-00419-01AI95-00419-01} {AI05-0178-1AI05-0178-1} A view of a type
35355 is limited if it is one of the following:
35356
35357 4/2
35358 * {AI95-00411-01AI95-00411-01} {AI95-00419-01AI95-00419-01} a type
35359 with the reserved word limited, synchronized, task, or protected in
35360 its definition;
35361
35362 4.a
35363 Ramification: Note that there is always a "definition,"
35364 conceptually, even if there is no syntactic category called
35365 "..._definition".
35366
35367 4.b/2
35368 {AI95-00419-01AI95-00419-01} This includes interfaces of the
35369 above kinds, derived types with the reserved word limited, as
35370 well as task and protected types.
35371
35372 5/3
35373 * {AI95-00419-01AI95-00419-01} {AI05-0087-1AI05-0087-1} a class-wide
35374 type whose specific type is limited;
35375
35376 6/2
35377 * {AI95-00419-01AI95-00419-01} a composite type with a limited
35378 component;
35379
35380 6.1/3
35381 * {AI05-0178-1AI05-0178-1} an incomplete view;
35382
35383 6.2/2
35384 * {AI95-00419-01AI95-00419-01} a derived type whose parent is limited
35385 and is not an interface.
35386
35387 6.a/2
35388 Ramification: {AI95-00419-01AI95-00419-01} Limitedness is not
35389 inherited from interfaces; it must be explicitly specified
35390 when the parent is an interface.
35391
35392 6.b/2
35393 To be honest: {AI95-00419-01AI95-00419-01} A derived type can
35394 become nonlimited if limited does not appear and the
35395 derivation takes place in the visible part of a child package,
35396 and the parent type is nonlimited as viewed from the private
35397 part or body of the child package.
35398
35399 6.c/2
35400 Reason: {AI95-00419-01AI95-00419-01} We considered a rule
35401 where limitedness was always inherited from the parent for
35402 derived types, but in the case of a type whose parent is an
35403 interface, this meant that the first interface is treated
35404 differently than other interfaces. It also would have forced
35405 users to declare dummy nonlimited interfaces just to get the
35406 limitedness right. We also considered a syntax like not
35407 limited to specify nonlimitedness when the parent was limited,
35408 but that was unsavory. The rule given is more uniform and
35409 simpler to understand.
35410
35411 6.d/2
35412 {AI95-00419-01AI95-00419-01} The rules for interfaces are
35413 asymmetrical, but the language is not: if the parent interface
35414 is limited, the presence of the word limited determines the
35415 limitedness, and nonlimited progenitors are illegal by the
35416 rules in *note 3.9.4:: if limited is present. If the parent
35417 interface is nonlimited, the word limited is illegal by the
35418 rules in *note 3.4::. The net effect is that the order of the
35419 interfaces doesn't matter.
35420
35421 7
35422 Otherwise, the type is nonlimited.
35423
35424 8
35425 [There are no predefined equality operators for a limited type.]
35426
35427 8.1/3
35428 {AI05-0052-1AI05-0052-1} A type is immutably limited if it is one of the
35429 following:
35430
35431 8.2/3
35432 * An explicitly limited record type;
35433
35434 8.3/3
35435 * {AI05-0217-1AI05-0217-1} A record extension with the reserved word
35436 limited;
35437
35438 8.4/3
35439 * A nonformal limited private type that is tagged or has at least one
35440 access discriminant with a default_expression;
35441
35442 8.a/3
35443 Reason: The full type in both of these cases must necessarily
35444 be immutably limited. We need to include private types as
35445 much as possible so that we aren't unintentionally
35446 discouraging the use of private types.
35447
35448 8.5/3
35449 * A task type, a protected type, or a synchronized interface;
35450
35451 8.6/3
35452 * A type derived from an immutably limited type.
35453
35454 8.b/3
35455 Discussion: An immutably limited type is a type that cannot
35456 become nonlimited subsequently in a private part or in a child
35457 unit. If a view of the type makes it immutably limited, then
35458 no copying (assignment) operations are ever available for
35459 objects of the type. This allows other properties; for
35460 instance, it is safe for such objects to have access
35461 discriminants that have defaults or designate other limited
35462 objects.
35463
35464 8.c/3
35465 Ramification: A nonsynchronized limited interface type is not
35466 immutably limited; a type derived from it can be nonlimited.
35467
35468 8.7/3
35469 {AI05-0052-1AI05-0052-1} A descendant of a generic formal limited
35470 private type is presumed to be immutably limited except within the body
35471 of a generic unit or a body declared within the declarative region of a
35472 generic unit, if the formal type is declared within the formal part of
35473 the generic unit.
35474
35475 8.d/3
35476 Ramification: In an instance, a type is descended from the
35477 actual type corresponding to the formal, and all rules are
35478 rechecked in the specification. Bodies are excepted so that
35479 we assume the worst there; the complex wording is required to
35480 handle children of generics and unrelated bodies properly.
35481
35482 NOTES
35483
35484 9/3
35485 15 {AI95-00287-01AI95-00287-01} {AI95-00318-02AI95-00318-02}
35486 {AI05-0067-1AI05-0067-1} While it is allowed to write
35487 initializations of limited objects, such initializations never copy
35488 a limited object. The source of such an assignment operation must
35489 be an aggregate or function_call, and such aggregates and
35490 function_calls must be built directly in the target object (see
35491 *note 7.6::).
35492
35493 9.a/2
35494 To be honest: This isn't quite true if the type can become
35495 nonlimited (see below); function_calls only are required to be
35496 build-in-place for "really" limited types.
35497
35498 Paragraphs 10 through 15 were deleted.
35499
35500 16
35501 16 As illustrated in *note 7.3.1::, an untagged limited type can
35502 become nonlimited under certain circumstances.
35503
35504 16.a
35505 Ramification: Limited private types do not become nonlimited;
35506 instead, their full view can be nonlimited, which has a
35507 similar effect.
35508
35509 16.b
35510 It is important to remember that a single nonprivate type can
35511 be both limited and nonlimited in different parts of its
35512 scope. In other words, "limited" is a property that depends
35513 on where you are in the scope of the type. We don't call this
35514 a "view property" because there is no particular declaration
35515 to declare the nonlimited view.
35516
35517 16.c
35518 Tagged types never become nonlimited.
35519
35520 _Examples_
35521
35522 17
35523 Example of a package with a limited type:
35524
35525 18
35526 package IO_Package is
35527 type File_Name is limited private;
35528
35529 19
35530 procedure Open (F : in out File_Name);
35531 procedure Close(F : in out File_Name);
35532 procedure Read (F : in File_Name; Item : out Integer);
35533 procedure Write(F : in File_Name; Item : in Integer);
35534 private
35535 type File_Name is
35536 limited record
35537 Internal_Name : Integer := 0;
35538 end record;
35539 end IO_Package;
35540
35541 20
35542 package body IO_Package is
35543 Limit : constant := 200;
35544 type File_Descriptor is record ... end record;
35545 Directory : array (1 .. Limit) of File_Descriptor;
35546 ...
35547 procedure Open (F : in out File_Name) is ... end;
35548 procedure Close(F : in out File_Name) is ... end;
35549 procedure Read (F : in File_Name; Item : out Integer) is ... end;
35550 procedure Write(F : in File_Name; Item : in Integer) is ... end;
35551 begin
35552 ...
35553 end IO_Package;
35554
35555 NOTES
35556
35557 21
35558 17 Notes on the example: In the example above, an outside
35559 subprogram making use of IO_Package may obtain a file name by
35560 calling Open and later use it in calls to Read and Write. Thus,
35561 outside the package, a file name obtained from Open acts as a kind
35562 of password; its internal properties (such as containing a numeric
35563 value) are not known and no other operations (such as addition or
35564 comparison of internal names) can be performed on a file name.
35565 Most importantly, clients of the package cannot make copies of
35566 objects of type File_Name.
35567
35568 22
35569 This example is characteristic of any case where complete control
35570 over the operations of a type is desired. Such packages serve a
35571 dual purpose. They prevent a user from making use of the internal
35572 structure of the type. They also implement the notion of an
35573 encapsulated data type where the only operations on the type are
35574 those given in the package specification.
35575
35576 23/2
35577 {AI95-00318-02AI95-00318-02} The fact that the full view of
35578 File_Name is explicitly declared limited means that parameter
35579 passing will always be by reference and function results will
35580 always be built directly in the result object (see *note 6.2:: and
35581 *note 6.5::).
35582
35583 _Extensions to Ada 83_
35584
35585 23.a
35586 The restrictions in RM83-7.4.4(4), which disallowed out
35587 parameters of limited types in certain cases, are removed.
35588
35589 _Wording Changes from Ada 83_
35590
35591 23.b/3
35592 {AI05-0299-1AI05-0299-1} Since limitedness and privateness are
35593 orthogonal in Ada 95 (and to some extent in Ada 83), this is
35594 now its own subclause rather than being a subclause of *note
35595 7.3::, "*note 7.3:: Private Types and Private Extensions".
35596
35597 _Extensions to Ada 95_
35598
35599 23.c/2
35600 {AI95-00287-01AI95-00287-01} {AI95-00318-02AI95-00318-02}
35601 Limited types now have an assignment operation, but its use is
35602 restricted such that all uses are build-in-place. This is
35603 accomplished by restricting uses to aggregates and
35604 function_calls. Aggregates were not allowed to have a limited
35605 type in Ada 95, which causes a compatibility issue discussed
35606 in *note 4.3::, "*note 4.3:: Aggregates". Compatibility
35607 issues with return statements for limited function_calls are
35608 discussed in *note 6.5::, "*note 6.5:: Return Statements".
35609
35610 _Wording Changes from Ada 95_
35611
35612 23.d/2
35613 {AI95-00411-01AI95-00411-01} {AI95-00419-01AI95-00419-01}
35614 Rewrote the definition of limited to ensure that interfaces
35615 are covered, but that limitedness is not inherited from
35616 interfaces. Derived types that explicitly include limited are
35617 now also covered.
35618
35619 _Wording Changes from Ada 2005_
35620
35621 23.e/3
35622 {AI05-0052-1AI05-0052-1} {AI05-0217-1AI05-0217-1} Correction:
35623 Added a definition for immutably limited types, so that the
35624 fairly complex definition does not need to be repeated in
35625 rules elsewhere in the Standard.
35626
35627 23.f/3
35628 {AI05-0067-1AI05-0067-1} {AI05-0299-1AI05-0299-1} Correction:
35629 The built-in-place rules are consolidated in *note 7.6::, and
35630 thus they are removed from this subclause.
35631
35632 23.g/3
35633 {AI05-0087-1AI05-0087-1} Correction: Fixed an oversight:
35634 class-wide types were never defined to be limited, even if
35635 their associated specific type is. It is thought that this
35636 oversight was never implemented incorrectly by any compiler,
35637 thus we have not classified it as an incompatibility.
35638
35639 23.h/3
35640 {AI05-0147-1AI05-0147-1} Allowed conditional_expressions in
35641 limited constructor contexts -- we want to treat these as
35642 closely to parentheses as possible.
35643
35644 23.i/3
35645 {AI05-0178-1AI05-0178-1} Added wording so that expression
35646 functions can return limited entities.
35647
35648 23.j/3
35649 {AI05-0178-1AI05-0178-1} Correction: Added incomplete views to
35650 the list of reasons for a view of a type to be limited. This
35651 is not a change as the definition already was in *note
35652 3.10.1::. But it is much better to have all of the reasons
35653 for limitedness together.
35654
35655 \1f
35656 File: aarm2012.info, Node: 7.6, Prev: 7.5, Up: 7
35657
35658 7.6 Assignment and Finalization
35659 ===============================
35660
35661 1
35662 [ Three kinds of actions are fundamental to the manipulation of objects:
35663 initialization, finalization, and assignment. Every object is
35664 initialized, either explicitly or by default, after being created (for
35665 example, by an object_declaration or allocator). Every object is
35666 finalized before being destroyed (for example, by leaving a
35667 subprogram_body containing an object_declaration, or by a call to an
35668 instance of Unchecked_Deallocation). An assignment operation is used as
35669 part of assignment_statements, explicit initialization, parameter
35670 passing, and other operations.
35671
35672 2
35673 Default definitions for these three fundamental operations are provided
35674 by the language, but a controlled type gives the user additional control
35675 over parts of these operations. In particular, the user can define, for
35676 a controlled type, an Initialize procedure which is invoked immediately
35677 after the normal default initialization of a controlled object, a
35678 Finalize procedure which is invoked immediately before finalization of
35679 any of the components of a controlled object, and an Adjust procedure
35680 which is invoked as the last step of an assignment to a (nonlimited)
35681 controlled object.]
35682
35683 2.a
35684 Glossary entry: A controlled type supports user-defined
35685 assignment and finalization. Objects are always finalized
35686 before being destroyed.
35687
35688 2.b/2
35689 Ramification: {AI95-00114-01AI95-00114-01}
35690 {AI95-00287-01AI95-00287-01} Here's the basic idea of
35691 initialization, value adjustment, and finalization, whether or
35692 not user defined: When an object is created, if it is
35693 explicitly assigned an initial value, the object is either
35694 built-in-place from an aggregate or function call (in which
35695 case neither Adjust nor Initialize is applied), or the
35696 assignment copies and adjusts the initial value. Otherwise,
35697 Initialize is applied to it (except in the case of an
35698 aggregate as a whole). An assignment_statement finalizes the
35699 target before copying in and adjusting the new value.
35700 Whenever an object goes away, it is finalized. Calls on
35701 Initialize and Adjust happen bottom-up; that is, components
35702 first, followed by the containing object. Calls on Finalize
35703 happen top-down; that is, first the containing object, and
35704 then its components. These ordering rules ensure that any
35705 components will be in a well-defined state when Initialize,
35706 Adjust, or Finalize is applied to the containing object.
35707
35708 _Static Semantics_
35709
35710 3
35711 The following language-defined library package exists:
35712
35713 4/3
35714 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} {AI05-0212-1AI05-0212-1} package Ada.Finalization is
35715 pragma Pure(Finalization);
35716
35717 5/2
35718 {AI95-00161-01AI95-00161-01} type Controlled is abstract tagged private;
35719 pragma Preelaborable_Initialization(Controlled);
35720
35721 6/2
35722 {AI95-00348-01AI95-00348-01} procedure Initialize (Object : in out Controlled) is null;
35723 procedure Adjust (Object : in out Controlled) is null;
35724 procedure Finalize (Object : in out Controlled) is null;
35725
35726 7/2
35727 {AI95-00161-01AI95-00161-01} type Limited_Controlled is abstract tagged limited private;
35728 pragma Preelaborable_Initialization(Limited_Controlled);
35729
35730 8/2
35731 {AI95-00348-01AI95-00348-01} procedure Initialize (Object : in out Limited_Controlled) is null;
35732 procedure Finalize (Object : in out Limited_Controlled) is null;
35733 private
35734 ... -- not specified by the language
35735 end Ada.Finalization;
35736
35737 9/2
35738 {AI95-00348-01AI95-00348-01} A controlled type is a descendant of
35739 Controlled or Limited_Controlled. The predefined "=" operator of type
35740 Controlled always returns True, [since this operator is incorporated
35741 into the implementation of the predefined equality operator of types
35742 derived from Controlled, as explained in *note 4.5.2::.] The type
35743 Limited_Controlled is like Controlled, except that it is limited and it
35744 lacks the primitive subprogram Adjust.
35745
35746 9.a
35747 Discussion: We say "nonlimited controlled type" (rather than
35748 just "controlled type";) when we want to talk about
35749 descendants of Controlled only.
35750
35751 9.b
35752 Reason: We considered making Adjust and Finalize abstract.
35753 However, a reasonable coding convention is e.g. for Finalize
35754 to always call the parent's Finalize after doing whatever work
35755 is needed for the extension part. (Unlike CLOS, we have no
35756 way to do that automatically in Ada 95.) For this to work,
35757 Finalize cannot be abstract. In a generic unit, for a generic
35758 formal abstract derived type whose ancestor is Controlled or
35759 Limited_Controlled, calling the ancestor's Finalize would be
35760 illegal if it were abstract, even though the actual type might
35761 have a concrete version.
35762
35763 9.c
35764 Types Controlled and Limited_Controlled are abstract, even
35765 though they have no abstract primitive subprograms. It is not
35766 clear that they need to be abstract, but there seems to be no
35767 harm in it, and it might make an implementation's life easier
35768 to know that there are no objects of these types -- in case
35769 the implementation wishes to make them "magic" in some way.
35770
35771 9.d/2
35772 {AI95-00251-01AI95-00251-01} For Ada 2005, we considered
35773 making these types interfaces. That would have the advantage
35774 of allowing them to be added to existing trees. But that was
35775 rejected both because it would cause massive disruptions to
35776 existing implementations, and because it would be very
35777 incompatible due to the "no hidden interfaces" rule. The
35778 latter rule would prevent a tagged private type from being
35779 completed with a derivation from Controlled or
35780 Limited_Controlled -- a very common idiom.
35781
35782 9.1/2
35783 {AI95-00360-01AI95-00360-01} A type is said to need finalization if:
35784
35785 9.2/2
35786 * it is a controlled type, a task type or a protected type; or
35787
35788 9.3/3
35789 * {AI05-0092-1AI05-0092-1} it has a component whose type needs
35790 finalization; or
35791
35792 9.4/3
35793 * {AI05-0013-1AI05-0013-1} it is a class-wide type; or
35794
35795 9.5/3
35796 * {AI05-0026-1AI05-0026-1} it is a partial view whose full view needs
35797 finalization; or
35798
35799 9.6/2
35800 * it is one of a number of language-defined types that are explicitly
35801 defined to need finalization.
35802
35803 9.e/2
35804 Ramification: The fact that a type needs finalization does not
35805 require it to be implemented with a controlled type. It just
35806 has to be recognized by the No_Nested_Finalization
35807 restriction.
35808
35809 9.f/2
35810 This property is defined for the type, not for a particular
35811 view. That's necessary as restrictions look in private parts
35812 to enforce their restrictions; the point is to eliminate all
35813 controlled parts, not just ones that are visible.
35814
35815 _Dynamic Semantics_
35816
35817 10/2
35818 {AI95-00373-01AI95-00373-01} During the elaboration or evaluation of a
35819 construct that causes an object to be initialized by default, for every
35820 controlled subcomponent of the object that is not assigned an initial
35821 value (as defined in *note 3.3.1::), Initialize is called on that
35822 subcomponent. Similarly, if the object that is initialized by default
35823 as a whole is controlled, Initialize is called on the object.
35824
35825 11/2
35826 {8652/00218652/0021} {AI95-00182-01AI95-00182-01}
35827 {AI95-00373-01AI95-00373-01} For an extension_aggregate whose
35828 ancestor_part is a subtype_mark denoting a controlled subtype, the
35829 Initialize procedure of the ancestor type is called, unless that
35830 Initialize procedure is abstract.
35831
35832 11.a
35833 Discussion: Example:
35834
35835 11.b
35836 type T1 is new Controlled with
35837 record
35838 ... -- some components might have defaults
35839 end record;
35840
35841 11.c
35842 type T2 is new Controlled with
35843 record
35844 X : T1; -- no default
35845 Y : T1 := ...; -- default
35846 end record;
35847
35848 11.d
35849 A : T2;
35850 B : T2 := ...;
35851
35852 11.e
35853 As part of the elaboration of A's declaration, A.Y is assigned
35854 a value; therefore Initialize is not applied to A.Y. Instead,
35855 Adjust is applied to A.Y as part of the assignment operation.
35856 Initialize is applied to A.X and to A, since those objects are
35857 not assigned an initial value. The assignment to A.Y is not
35858 considered an assignment to A.
35859
35860 11.f
35861 For the elaboration of B's declaration, Initialize is not
35862 called at all. Instead the assignment adjusts B's value; that
35863 is, it applies Adjust to B.X, B.Y, and B.
35864
35865 11.f.1/2
35866 {8652/00218652/0021} {AI95-00182-01AI95-00182-01}
35867 {AI95-00373-01AI95-00373-01} The ancestor_part of an
35868 extension_aggregate, <> in aggregates, and the return object
35869 of an extended_return_statement are handled similarly.
35870
35871 12
35872 Initialize and other initialization operations are done in an arbitrary
35873 order, except as follows. Initialize is applied to an object after
35874 initialization of its subcomponents, if any [(including both implicit
35875 initialization and Initialize calls)]. If an object has a component
35876 with an access discriminant constrained by a per-object expression,
35877 Initialize is applied to this component after any components that do not
35878 have such discriminants. For an object with several components with
35879 such a discriminant, Initialize is applied to them in order of their
35880 component_declarations. For an allocator, any task activations follow
35881 all calls on Initialize.
35882
35883 12.a
35884 Reason: The fact that Initialize is done for subcomponents
35885 first allows Initialize for a composite object to refer to its
35886 subcomponents knowing they have been properly initialized.
35887
35888 12.b
35889 The fact that Initialize is done for components with access
35890 discriminants after other components allows the Initialize
35891 operation for a component with a self-referential access
35892 discriminant to assume that other components of the enclosing
35893 object have already been properly initialized. For multiple
35894 such components, it allows some predictability.
35895
35896 13
35897 When a target object with any controlled parts is assigned a value,
35898 [either when created or in a subsequent assignment_statement,] the
35899 assignment operation proceeds as follows:
35900
35901 14
35902 * The value of the target becomes the assigned value.
35903
35904 15
35905 * The value of the target is adjusted.
35906
35907 15.a
35908 Ramification: If any parts of the object are controlled, abort
35909 is deferred during the assignment operation.
35910
35911 16/3
35912 {AI05-0067-1AI05-0067-1} To adjust the value of a composite object, the
35913 values of the components of the object are first adjusted in an
35914 arbitrary order, and then, if the object is nonlimited controlled,
35915 Adjust is called. Adjusting the value of an elementary object has no
35916 effect[, nor does adjusting the value of a composite object with no
35917 controlled parts.]
35918
35919 16.a/3
35920 Ramification: {AI05-0067-1AI05-0067-1} Adjustment is never
35921 actually performed for values of an immutably limited type,
35922 since all assignment operations for such types are required to
35923 be built-in-place. Even so, we still define adjustment for
35924 all types in order that the canonical semantics is
35925 well-defined.
35926
35927 16.b/3
35928 Reason: {AI05-0005-1AI05-0005-1} The verbiage in the
35929 Initialize rule about access discriminants constrained by
35930 per-object expressions is not necessary here, since such types
35931 are either limited or do not have defaults, so the
35932 discriminant can only be changed by an assignment to an outer
35933 object. Such an assignment could happen only before any
35934 adjustments or (if part of an outer Adjust) only after any
35935 inner (component) adjustments have completed.
35936
35937 17
35938 For an assignment_statement, [ after the name and expression have been
35939 evaluated, and any conversion (including constraint checking) has been
35940 done,] an anonymous object is created, and the value is assigned into
35941 it; [that is, the assignment operation is applied]. [(Assignment
35942 includes value adjustment.)] The target of the assignment_statement is
35943 then finalized. The value of the anonymous object is then assigned into
35944 the target of the assignment_statement. Finally, the anonymous object
35945 is finalized. [As explained below, the implementation may eliminate the
35946 intermediate anonymous object, so this description subsumes the one
35947 given in *note 5.2::, "*note 5.2:: Assignment Statements".]
35948
35949 17.a
35950 Reason: An alternative design for user-defined assignment
35951 might involve an Assign operation instead of Adjust:
35952
35953 17.b
35954 procedure Assign(Target : in out Controlled; Source : in out Controlled);
35955
35956 17.c
35957 Or perhaps even a syntax like this:
35958
35959 17.d
35960 procedure ":="(Target : in out Controlled; Source : in out Controlled);
35961
35962 17.e
35963 Assign (or ":=") would have the responsibility of doing the
35964 copy, as well as whatever else is necessary. This would have
35965 the advantage that the Assign operation knows about both the
35966 target and the source at the same time -- it would be possible
35967 to do things like reuse storage belonging to the target, for
35968 example, which Adjust cannot do. However, this sort of design
35969 would not work in the case of unconstrained discriminated
35970 variables, because there is no way to change the discriminants
35971 individually. For example:
35972
35973 17.f
35974 type Mutable(D : Integer := 0) is
35975 record
35976 X : Array_Of_Controlled_Things(1..D);
35977 case D is
35978 when 17 => Y : Controlled_Thing;
35979 when others => null;
35980 end D;
35981 end record;
35982
35983 17.g
35984 An assignment to an unconstrained variable of type Mutable can
35985 cause some of the components of X, and the component Y, to
35986 appear and/or disappear. There is no way to write the Assign
35987 operation to handle this sort of case.
35988
35989 17.h
35990 Forbidding such cases is not an option -- it would cause
35991 generic contract model violations.
35992
35993 17.1/3
35994 {AI05-0067-1AI05-0067-1} When a function call or aggregate is used to
35995 initialize an object, the result of the function call or aggregate is an
35996 anonymous object, which is assigned into the newly-created object. For
35997 such an assignment, the anonymous object might be built in place, in
35998 which case the assignment does not involve any copying. Under certain
35999 circumstances, the anonymous object is required to be built in place.
36000 In particular:
36001
36002 17.i/3
36003 Discussion: {AI05-0067-1AI05-0067-1} We say assignment to
36004 built-in-place objects does not involve copying, which matches
36005 the intended implementation (see below). Of course, the
36006 implementation can do any copying it likes, if it can make
36007 such copying semantically invisible (by patching up access
36008 values to point to the copy, and so forth).
36009
36010 17.2/3
36011 * If the full type of any part of the object is immutably limited,
36012 the anonymous object is built in place.
36013
36014 17.j/3
36015 Reason: {AI05-0067-1AI05-0067-1} We talk about the full types
36016 being immutably limited, as this is independent of the view of
36017 a type (in the same way that it is for determining the
36018 technique of parameter passing). That is, privacy is ignored
36019 for this purpose.
36020
36021 17.k/3
36022 {AI05-0005-1AI05-0005-1} {AI05-0067-1AI05-0067-1} For function
36023 calls, we only require building in place for immutably limited
36024 types. These are the types that would have been
36025 return-by-reference types in Ada 95. We limited the
36026 requirement because we want to minimize disruption to Ada 95
36027 implementations and users.
36028
36029 17.l/3
36030 To be honest: {AI05-0232-1AI05-0232-1} This is a dynamic
36031 property and is determined by the specific type of the parts
36032 of the actual object. In particular, if a part has a
36033 class-wide type, the tag of the object might need to be
36034 examined in order to determine if build-in-place is required.
36035 However, we expect that most Ada implementations will
36036 determine this property at compile-time using some
36037 assume-the-worst algorithm in order to chose the appropriate
36038 method to implement a given call or aggregate. In addition,
36039 there is no attribute or other method for a program to
36040 determine if a particular object has this property (or not),
36041 so there is no value to a more careful description of this
36042 rule.
36043
36044 17.3/3
36045 * In the case of an aggregate, if the full type of any part of the
36046 newly-created object is controlled, the anonymous object is built
36047 in place.
36048
36049 17.m/3
36050 Reason: {AI05-0067-1AI05-0067-1} This is necessary to prevent
36051 elaboration problems with deferred constants of controlled
36052 types. Consider:
36053
36054 17.m.1/3
36055 package P is
36056 type Dyn_String is private;
36057 Null_String : constant Dyn_String;
36058 ...
36059 private
36060 type Dyn_String is new Ada.Finalization.Controlled with ...
36061 procedure Finalize(X : in out Dyn_String);
36062 procedure Adjust(X : in out Dyn_String);
36063
36064 Null_String : constant Dyn_String :=
36065 (Ada.Finalization.Controlled with ...);
36066 ...
36067 end P;
36068
36069 17.m.2/3
36070 When Null_String is elaborated, the bodies of Finalize and
36071 Adjust clearly have not been elaborated. Without this rule,
36072 this declaration would necessarily raise Program_Error (unless
36073 the permissions given below are used by the implementation).
36074
36075 17.n/3
36076 Ramification: An aggregate with a controlled part used in the
36077 return expression of a simple_return_statement (*note 6.5:
36078 S0183.) has to be built in place in the anonymous return
36079 object, as this is similar to an object declaration. (This is
36080 a change from Ada 95, but it is not an inconsistency as it
36081 only serves to restrict implementation choices.) But this
36082 only covers the aggregate; a separate anonymous return object
36083 can still be used unless it too is required to be built in
36084 place.
36085
36086 17.o/3
36087 Similarly, an aggregate that has a controlled part but is not
36088 itself controlled and that is used to initialize an object
36089 also has to be built in place. This is also a change from Ada
36090 95, but it is not an inconsistency as it only serves to
36091 restrict implementation choices. This avoids problems if a
36092 type like Dyn_String (in the example above) is used as a
36093 component in a type used as a deferred constant in package P.
36094
36095 17.4/3
36096 * In other cases, it is unspecified whether the anonymous object is
36097 built in place.
36098
36099 17.p/3
36100 Reason: This is left unspecified so the implementation can use
36101 any appropriate criteria for determining when to build in
36102 place. That includes making the decision on a call-by-call
36103 basis. Reasonable programs will not care what decision is
36104 made here anyway.
36105
36106 17.5/3
36107 {AI05-0067-1AI05-0067-1} Notwithstanding what this International
36108 Standard says elsewhere, if an object is built in place:
36109
36110 17.6/3
36111 * Upon successful completion of the return statement or aggregate,
36112 the anonymous object mutates into the newly-created object; that
36113 is, the anonymous object ceases to exist, and the newly-created
36114 object appears in its place.
36115
36116 17.7/3
36117 * Finalization is not performed on the anonymous object.
36118
36119 17.8/3
36120 * Adjustment is not performed on the newly-created object.
36121
36122 17.9/3
36123 * All access values that designate parts of the anonymous object now
36124 designate the corresponding parts of the newly-created object.
36125
36126 17.10/3
36127 * All renamings of parts of the anonymous object now denote views of
36128 the corresponding parts of the newly-created object.
36129
36130 17.11/3
36131 * Coextensions of the anonymous object become coextensions of the
36132 newly-created object.
36133
36134 17.q/3
36135 To be honest: This "mutating" does not necessarily happen
36136 atomically with respect to abort and other tasks. For
36137 example, if a function call is used as the parent part of an
36138 extension_aggregate, then the tag of the anonymous object (the
36139 function result) will be different from the tag of the
36140 newly-created object (the parent part of the
36141 extension_aggregate). In implementation terms, this involves
36142 modifying the tag field. If the current task is aborted
36143 during this modification, the object might become abnormal.
36144 Likewise, if some other task accesses the tag field during
36145 this modification, it constitutes improper use of shared
36146 variables, and is erroneous.
36147
36148 17.r/3
36149 Implementation Note: The intended implementation is that the
36150 anonymous object is allocated at the same address as the
36151 newly-created object. Thus, no run-time action is required to
36152 cause all the access values and renamings to point to the
36153 right place. They just point to the newly-created object,
36154 which is what the return object has magically "mutated into".
36155
36156 17.s/3
36157 There is no requirement that 'Address of the return object is
36158 equal to 'Address of the newly-created object, but that will
36159 be true in the intended implementation.
36160
36161 17.t/3
36162 For a function call, if the size of the newly-created object
36163 is known at the call site, the object is allocated there, and
36164 the address is implicitly passed to the function; the return
36165 object is created at that address. Otherwise, a storage pool
36166 is implicitly passed to the function; the size is determined
36167 at the point of the return statement, and passed to the
36168 Allocate procedure. The address returned by the storage pool
36169 is returned from the function, and the newly-created object
36170 uses that same address. If the return statement is left
36171 without returning (via an exception or a goto, for example),
36172 then Deallocate is called. The storage pool might be a dummy
36173 pool that represents "allocate on the stack".
36174
36175 17.u/3
36176 The Tag of the newly-created object may be different from that
36177 of the result object. Likewise, the master and accessibility
36178 level may be different.
36179
36180 17.v/3
36181 An alternative implementation model might allow objects to
36182 move around to different addresses. In this case, access
36183 values and renamings would need to be modified at run time.
36184 It seems that this model requires the full power of tracing
36185 garbage collection.
36186
36187 _Implementation Permissions_
36188
36189 18/3
36190 {AI05-0067-1AI05-0067-1} An implementation is allowed to relax the above
36191 rules for assignment_statements in the following ways:
36192
36193 18.a/3
36194 This paragraph was deleted.{AI05-0067-1AI05-0067-1}
36195
36196 18.b/3
36197 Ramification: {AI05-0067-1AI05-0067-1} The relaxations apply
36198 only to nonlimited types, as assignment_statements are not
36199 allowed for limited types. This is important so that the
36200 programmer can count on a stricter semantics for limited
36201 controlled types.
36202
36203 19/3
36204 * {AI05-0067-1AI05-0067-1} If an object is assigned the value of that
36205 same object, the implementation need not do anything.
36206
36207 19.a
36208 Ramification: In other words, even if an object is controlled
36209 and a combination of Finalize and Adjust on the object might
36210 have a net side effect, they need not be performed.
36211
36212 20/3
36213 * {AI05-0067-1AI05-0067-1} For assignment of a noncontrolled type,
36214 the implementation may finalize and assign each component of the
36215 variable separately (rather than finalizing the entire variable and
36216 assigning the entire new value) unless a discriminant of the
36217 variable is changed by the assignment.
36218
36219 20.a
36220 Reason: For example, in a slice assignment, an anonymous
36221 object is not necessary if the slice is copied
36222 component-by-component in the right direction, since array
36223 types are not controlled (although their components may be).
36224 Note that the direction, and even the fact that it's a slice
36225 assignment, can in general be determined only at run time.
36226
36227 20.b/3
36228 Ramification: {AI05-0005-1AI05-0005-1} This potentially breaks
36229 a single assignment operation into many, and thus abort
36230 deferral (see *note 9.8::) needs to last only across an
36231 individual component assignment when the component has a
36232 controlled part. It is only important that the copy step is
36233 not separated (by an abort) from the adjust step, so aborts
36234 between component assignments is not harmful.
36235
36236 21/3
36237 * {AI95-00147-01AI95-00147-01} {AI05-0067-1AI05-0067-1} The
36238 implementation need not create an anonymous object if the value
36239 being assigned is the result of evaluating a name denoting an
36240 object (the source object) whose storage cannot overlap with the
36241 target. If the source object might overlap with the target object,
36242 then the implementation can avoid the need for an intermediary
36243 anonymous object by exercising one of the above permissions and
36244 perform the assignment one component at a time (for an overlapping
36245 array assignment), or not at all (for an assignment where the
36246 target and the source of the assignment are the same object).
36247
36248 21.a/3
36249 Ramification: {AI05-0005-1AI05-0005-1} If the anonymous object
36250 is eliminated by this permission, there is no anonymous object
36251 to be finalized and thus the Finalize call on it is
36252 eliminated.
36253
36254 21.b/3
36255 {AI95-00147-01AI95-00147-01} {AI05-0005-1AI05-0005-1} Note
36256 that if the anonymous object is eliminated but the new value
36257 is not built in place in the target object, that Adjust must
36258 be called directly on the target object as the last step of
36259 the assignment, since some of the subcomponents may be
36260 self-referential or otherwise position-dependent. This Adjust
36261 can be eliminated only by using one of the following
36262 permissions.
36263
36264 22/2
36265 {AI95-00147-01AI95-00147-01} Furthermore, an implementation is permitted
36266 to omit implicit Initialize, Adjust, and Finalize calls and associated
36267 assignment operations on an object of a nonlimited controlled type
36268 provided that:
36269
36270 23/2
36271 * any omitted Initialize call is not a call on a user-defined
36272 Initialize procedure, and
36273
36274 23.a/2
36275 To be honest: This does not apply to any calls to a
36276 user-defined Initialize routine that happen to occur in an
36277 Adjust or Finalize routine. It is intended that it is never
36278 necessary to look inside of an Adjust or Finalize routine to
36279 determine if the call can be omitted.
36280
36281 23.b/2
36282 Reason: We don't want to eliminate objects for which the
36283 Initialize might have side effects (such as locking a
36284 resource).
36285
36286 24/2
36287 * any usage of the value of the object after the implicit Initialize
36288 or Adjust call and before any subsequent Finalize call on the
36289 object does not change the external effect of the program, and
36290
36291 25/2
36292 * after the omission of such calls and operations, any execution of
36293 the program that executes an Initialize or Adjust call on an object
36294 or initializes an object by an aggregate will also later execute a
36295 Finalize call on the object and will always do so prior to
36296 assigning a new value to the object, and
36297
36298 26/2
36299 * the assignment operations associated with omitted Adjust calls are
36300 also omitted.
36301
36302 27/2
36303 This permission applies to Adjust and Finalize calls even if the
36304 implicit calls have additional external effects.
36305
36306 27.a/2
36307 Reason: The goal of the above permissions is to allow typical
36308 dead assignment and dead variable removal algorithms to work
36309 for nonlimited controlled types. We require that "pairs" of
36310 Initialize/Adjust/Finalize operations are removed. (These
36311 aren't always pairs, which is why we talk about "any execution
36312 of the program".)
36313
36314 _Extensions to Ada 83_
36315
36316 27.b
36317 Controlled types and user-defined finalization are new to Ada
36318 95. (Ada 83 had finalization semantics only for masters of
36319 tasks.)
36320
36321 _Extensions to Ada 95_
36322
36323 27.c/2
36324 {AI95-00161-01AI95-00161-01} Amendment Correction: Types
36325 Controlled and Limited_Controlled now have
36326 Preelaborable_Initialization, so that objects of types derived
36327 from these types can be used in preelaborated packages.
36328
36329 _Wording Changes from Ada 95_
36330
36331 27.d/2
36332 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} Corrigendum:
36333 Clarified that Ada.Finalization is a remote types package.
36334
36335 27.e/2
36336 {8652/00218652/0021} {AI95-00182-01AI95-00182-01} Corrigendum:
36337 Added wording to clarify that the default initialization
36338 (whatever it is) of an ancestor part is used.
36339
36340 27.f/2
36341 {8652/00228652/0022} {AI95-00083-01AI95-00083-01} Corrigendum:
36342 Clarified that Adjust is never called on an aggregate used for
36343 the initialization of an object or subaggregate, or passed as
36344 a parameter.
36345
36346 27.g/2
36347 {AI95-00147-01AI95-00147-01} Additional optimizations are
36348 allowed for nonlimited controlled types. These allow
36349 traditional dead variable elimination to be applied to such
36350 types.
36351
36352 27.h/2
36353 {AI95-00318-02AI95-00318-02} Corrected the build-in-place
36354 requirement for controlled aggregates to be consistent with
36355 the requirements for limited types.
36356
36357 27.i/2
36358 {AI95-00348-01AI95-00348-01} The operations of types
36359 Controlled and Limited_Controlled are now declared as null
36360 procedures (see *note 6.7::) to make the semantics clear (and
36361 to provide a good example of what null procedures can be used
36362 for).
36363
36364 27.j/2
36365 {AI95-00360-01AI95-00360-01} Types that need finalization are
36366 defined; this is used by the No_Nested_Finalization
36367 restriction (see *note D.7::, "*note D.7:: Tasking
36368 Restrictions").
36369
36370 27.k/2
36371 {AI95-00373-01AI95-00373-01} Generalized the description of
36372 objects that have Initialize called for them to say that it is
36373 done for all objects that are initialized by default. This is
36374 needed so that all of the new cases are covered.
36375
36376 _Extensions to Ada 2005_
36377
36378 27.l/3
36379 {AI05-0212-1AI05-0212-1} Package Ada.Finalization now has Pure
36380 categorization, so it can be mentioned for any package. Note
36381 that this does not change the preelaborability of objects
36382 descended from Controlled and Limited_Controlled.
36383
36384 _Wording Changes from Ada 2005_
36385
36386 27.m/3
36387 {AI05-0013-1AI05-0013-1} Correction: Eliminated coextensions
36388 from the "needs finalization" rules, as this cannot be
36389 determined in general in the compilation unit that declares
36390 the type. (The designated type of the coextension may have
36391 been imported as a limited view.) Uses of "needs
36392 finalization" need to ensure that coextensions are handled by
36393 other means (such as in No_Nested_Finalization - see *note
36394 D.7::) or that coextensions cannot happen.
36395
36396 27.n/3
36397 {AI05-0013-1AI05-0013-1} Correction: Corrected the "needs
36398 finalization" rules to include class-wide types, as a future
36399 extension can include a part that needs finalization.
36400
36401 27.o/3
36402 {AI05-0026-1AI05-0026-1} Correction: Corrected the "needs
36403 finalization" rules to clearly say that they ignore privacy.
36404
36405 27.p/3
36406 {AI05-0067-1AI05-0067-1} Correction: Changed "built in place"
36407 to Dynamic Semantics and centralized the rules here. This
36408 eliminates the fiction that built in place is just a
36409 combination of a permission and a requirement; it clearly has
36410 noticeable semantic effects. This wording change is not
36411 intended to change the semantics of any correct Ada program.
36412
36413 * Menu:
36414
36415 * 7.6.1 :: Completion and Finalization
36416
36417 \1f
36418 File: aarm2012.info, Node: 7.6.1, Up: 7.6
36419
36420 7.6.1 Completion and Finalization
36421 ---------------------------------
36422
36423 1
36424 [This subclause defines completion and leaving of the execution of
36425 constructs and entities. A master is the execution of a construct that
36426 includes finalization of local objects after it is complete (and after
36427 waiting for any local tasks -- see *note 9.3::), but before leaving.
36428 Other constructs and entities are left immediately upon completion. ]
36429
36430 _Dynamic Semantics_
36431
36432 2/2
36433 {AI95-00318-02AI95-00318-02} The execution of a construct or entity is
36434 complete when the end of that execution has been reached, or when a
36435 transfer of control (see *note 5.1::) causes it to be abandoned.
36436 Completion due to reaching the end of execution, or due to the transfer
36437 of control of an exit_statement, return statement, goto_statement, or
36438 requeue_statement or of the selection of a terminate_alternative is
36439 normal completion. Completion is abnormal otherwise [-- when control is
36440 transferred out of a construct due to abort or the raising of an
36441 exception].
36442
36443 2.a
36444 Discussion: Don't confuse the run-time concept of completion
36445 with the compile-time concept of completion defined in *note
36446 3.11.1::.
36447
36448 3/2
36449 {AI95-00162-01AI95-00162-01} {AI95-00416-01AI95-00416-01} After
36450 execution of a construct or entity is complete, it is left, meaning that
36451 execution continues with the next action, as defined for the execution
36452 that is taking place. Leaving an execution happens immediately after
36453 its completion, except in the case of a master: the execution of a body
36454 other than a package_body; the execution of a statement; or the
36455 evaluation of an expression, function_call, or range that is not part of
36456 an enclosing expression, function_call, range, or simple_statement
36457 (*note 5.1: S0147.) other than a simple_return_statement (*note 6.5:
36458 S0183.). A master is finalized after it is complete, and before it is
36459 left.
36460
36461 3.a/2
36462 Reason: {AI95-00162-01AI95-00162-01}
36463 {AI95-00416-01AI95-00416-01} Expressions and statements are
36464 masters so that objects created by subprogram calls (in
36465 aggregates, allocators for anonymous access-to-object types,
36466 and so on) are finalized and have their tasks awaited before
36467 the expressions or statements are left. Note that expressions
36468 like the condition of an if_statement are masters, because
36469 they are not enclosed by a simple_statement. Similarly, a
36470 function_call which is renamed is a master, as it is not in a
36471 simple_statement (*note 5.1: S0147.).
36472
36473 3.b/2
36474 {AI95-00416-01AI95-00416-01} We have to include function_calls
36475 in the contexts that do not cause masters to occur so that
36476 expressions contained in a function_call (that is not part of
36477 an expression or simple_statement) do not individually become
36478 masters. We certainly do not want the parameter expressions
36479 of a function_call to be separate masters, as they would then
36480 be finalized before the function is called.
36481
36482 3.c/2
36483 Ramification: {AI95-00416-01AI95-00416-01} The fact that a
36484 function_call is a master does not change the accessibility of
36485 the return object denoted by the function_call; that depends
36486 on the use of the function_call. The function_call is the
36487 master of any short-lived entities (such as aggregates used as
36488 parameters of types with task or controlled parts).
36489
36490 4
36491 For the finalization of a master, dependent tasks are first awaited, as
36492 explained in *note 9.3::. Then each object whose accessibility level is
36493 the same as that of the master is finalized if the object was
36494 successfully initialized and still exists. [These actions are performed
36495 whether the master is left by reaching the last statement or via a
36496 transfer of control.] When a transfer of control causes completion of
36497 an execution, each included master is finalized in order, from innermost
36498 outward.
36499
36500 4.a
36501 Ramification: As explained in *note 3.10.2::, the set of
36502 objects with the same accessibility level as that of the
36503 master includes objects declared immediately within the
36504 master, objects declared in nested packages, objects created
36505 by allocators (if the ultimate ancestor access type is
36506 declared in one of those places) and subcomponents of all of
36507 these things. If an object was already finalized by
36508 Unchecked_Deallocation, then it is not finalized again when
36509 the master is left.
36510
36511 4.b
36512 Note that any object whose accessibility level is deeper than
36513 that of the master would no longer exist; those objects would
36514 have been finalized by some inner master. Thus, after leaving
36515 a master, the only objects yet to be finalized are those whose
36516 accessibility level is less deep than that of the master.
36517
36518 4.c
36519 To be honest: Subcomponents of objects due to be finalized are
36520 not finalized by the finalization of the master; they are
36521 finalized by the finalization of the containing object.
36522
36523 4.d
36524 Reason: We need to finalize subcomponents of objects even if
36525 the containing object is not going to get finalized because it
36526 was not fully initialized. But if the containing object is
36527 finalized, we don't want to require repeated finalization of
36528 the subcomponents, as might normally be implied by the
36529 recursion in finalization of a master and the recursion in
36530 finalization of an object.
36531
36532 4.e
36533 To be honest: Formally, completion and leaving refer to
36534 executions of constructs or entities. However, the standard
36535 sometimes (informally) refers to the constructs or entities
36536 whose executions are being completed. Thus, for example, "the
36537 subprogram call or task is complete" really means "the
36538 execution of the subprogram call or task is complete."
36539
36540 5
36541 For the finalization of an object:
36542
36543 6/3
36544 * {AI05-0099-1AI05-0099-1} If the full type of the object is an
36545 elementary type, finalization has no effect;
36546
36547 6.a/3
36548 Reason: {AI05-0099-1AI05-0099-1} We say "full type" in this
36549 and the following bullets as privacy is ignored for the
36550 purpose of determining the finalization actions of an object;
36551 that is as expected for Dynamic Semantics rules.
36552
36553 7/3
36554 * {AI05-0099-1AI05-0099-1} If the full type of the object is a tagged
36555 type, and the tag of the object identifies a controlled type, the
36556 Finalize procedure of that controlled type is called;
36557
36558 8/3
36559 * {AI05-0099-1AI05-0099-1} If the full type of the object is a
36560 protected type, or if the full type of the object is a tagged type
36561 and the tag of the object identifies a protected type, the actions
36562 defined in *note 9.4:: are performed;
36563
36564 9/3
36565 * {AI95-00416-01AI95-00416-01} {AI05-0099-1AI05-0099-1} If the full
36566 type of the object is a composite type, then after performing the
36567 above actions, if any, every component of the object is finalized
36568 in an arbitrary order, except as follows: if the object has a
36569 component with an access discriminant constrained by a per-object
36570 expression, this component is finalized before any components that
36571 do not have such discriminants; for an object with several
36572 components with such a discriminant, they are finalized in the
36573 reverse of the order of their component_declarations;
36574
36575 9.a
36576 Reason: This allows the finalization of a component with an
36577 access discriminant to refer to other components of the
36578 enclosing object prior to their being finalized.
36579
36580 9.b/3
36581 To be honest: {AI05-0099-1AI05-0099-1} The components
36582 discussed here are all of the components that the object
36583 actually has, not just those components that are statically
36584 identified by the type of the object. These can be different
36585 if the object has a classwide type.
36586
36587 9.1/2
36588 * {AI95-00416-01AI95-00416-01} If the object has coextensions (see
36589 *note 3.10.2::), each coextension is finalized after the object
36590 whose access discriminant designates it.
36591
36592 9.c/3
36593 Ramification: {AI05-0066-1AI05-0066-1} In the case of an
36594 aggregate or function call that is used (in its entirety) to
36595 directly initialize a part of an object, the coextensions of
36596 the result of evaluating the aggregate or function call are
36597 transfered to become coextensions of the object being
36598 initialized and are not finalized until the object being
36599 initialized is ultimately finalized, even if an anonymous
36600 object is created as part of the operation.
36601
36602 10
36603 Immediately before an instance of Unchecked_Deallocation reclaims the
36604 storage of an object, the object is finalized. [If an instance of
36605 Unchecked_Deallocation is never applied to an object created by an
36606 allocator, the object will still exist when the corresponding master
36607 completes, and it will be finalized then.]
36608
36609 11/3
36610 {AI95-00280-01AI95-00280-01} {AI05-0051-1AI05-0051-1}
36611 {AI05-0190-1AI05-0190-1} The finalization of a master performs
36612 finalization of objects created by declarations in the master in the
36613 reverse order of their creation. After the finalization of a master is
36614 complete, the objects finalized as part of its finalization cease to
36615 exist, as do any types and subtypes defined and created within the
36616 master.
36617
36618 11.a/3
36619 This paragraph was deleted.{AI05-0190-1AI05-0190-1}
36620
36621 11.b/3
36622 This paragraph was deleted.{AI05-0190-1AI05-0190-1}
36623
36624 11.c/3
36625 This paragraph was deleted.{AI05-0190-1AI05-0190-1}
36626
36627 11.d/3
36628 This paragraph was deleted.{AI05-0190-1AI05-0190-1}
36629
36630 11.e
36631 Ramification: Note that a deferred constant declaration does
36632 not create the constant; the full constant declaration creates
36633 it. Therefore, the order of finalization depends on where the
36634 full constant declaration occurs, not the deferred constant
36635 declaration.
36636
36637 11.f
36638 An imported object is not created by its declaration. It is
36639 neither initialized nor finalized.
36640
36641 11.g
36642 Implementation Note: An implementation has to ensure that the
36643 storage for an object is not reclaimed when references to the
36644 object are still possible (unless, of course, the user
36645 explicitly requests reclamation via an instance of
36646 Unchecked_Deallocation). This implies, in general, that
36647 objects cannot be deallocated one by one as they are
36648 finalized; a subsequent finalization might reference an object
36649 that has been finalized, and that object had better be in its
36650 (well-defined) finalized state.
36651
36652 11.1/3
36653 {AI05-0190-1AI05-0190-1} Each nonderived access type T has an associated
36654 collection, which is the set of objects created by allocators of T, or
36655 of types derived from T. Unchecked_Deallocation removes an object from
36656 its collection. Finalization of a collection consists of finalization
36657 of each object in the collection, in an arbitrary order. The collection
36658 of an access type is an object implicitly declared at the following
36659 place:
36660
36661 11.h/3
36662 Ramification: {AI05-0190-1AI05-0190-1} The place of the
36663 implicit declaration determines when allocated objects are
36664 finalized. For multiple collections declared at the same
36665 place, we do not define the order of their implicit
36666 declarations.
36667
36668 11.i/3
36669 {AI05-0190-1AI05-0190-1} Finalization of allocated objects is
36670 done according to the (ultimate ancestor) allocator type, not
36671 according to the storage pool in which they are allocated.
36672 Pool finalization might reclaim storage (see *note 13.11::,
36673 "*note 13.11:: Storage Management"), but has nothing
36674 (directly) to do with finalization of the pool elements.
36675
36676 11.j/3
36677 {AI05-0190-1AI05-0190-1} Note that finalization is done only
36678 for objects that still exist; if an instance of
36679 Unchecked_Deallocation has already gotten rid of a given pool
36680 element, that pool element will not be finalized when the
36681 master is left.
36682
36683 11.k/3
36684 Reason: {AI05-0190-1AI05-0190-1} Note that we talk about the
36685 type of the allocator here. There may be access values of a
36686 (general) access type pointing at objects created by
36687 allocators for some other type; these are not (necessarily)
36688 finalized at this point.
36689
36690 11.2/3
36691 * For a named access type, the first freezing point (see *note
36692 13.14::) of the type.
36693
36694 11.l/3
36695 Reason: {AI05-0190-1AI05-0190-1} The freezing point of the
36696 ultimate ancestor access type is chosen because before that
36697 point, pool elements cannot be created, and after that point,
36698 access values designating (parts of) the pool elements can be
36699 created. This is also the point after which the pool object
36700 cannot have been declared. We don't want to finalize the pool
36701 elements until after anything finalizing objects that contain
36702 access values designating them. Nor do we want to finalize
36703 pool elements after finalizing the pool object itself.
36704
36705 11.3/3
36706 * For the type of an access parameter, the call that contains the
36707 allocator.
36708
36709 11.4/3
36710 * For the type of an access result, within the master of the call
36711 (see *note 3.10.2::).
36712
36713 11.m/3
36714 To be honest: {AI05-0005-1AI05-0005-1}
36715 {AI05-0190-1AI05-0190-1} We mean at a place within the master
36716 consistent with the execution of the call within the master.
36717 We don't say that normatively, as it is difficult to explain
36718 that when the master of the call need not be the master that
36719 immediately includes the call (such as when an anonymous
36720 result is converted to a named access type).
36721
36722 11.5/3
36723 * For any other anonymous access type, the first freezing point of
36724 the innermost enclosing declaration.
36725
36726 12/2
36727 {AI95-00256-01AI95-00256-01} The target of an assignment_statement is
36728 finalized before copying in the new value, as explained in *note 7.6::.
36729
36730 13/3
36731 {8652/00218652/0021} {AI95-00182-01AI95-00182-01}
36732 {AI95-00162-01AI95-00162-01} {AI05-0066-1AI05-0066-1}
36733 {AI05-0142-4AI05-0142-4} {AI05-0269-1AI05-0269-1} The master of an
36734 object is the master enclosing its creation whose accessibility level
36735 (see *note 3.10.2::) is equal to that of the object, except in the case
36736 of an anonymous object representing the result of an aggregate or
36737 function call. If such an anonymous object is part of the result of
36738 evaluating the actual parameter expression for an explicitly aliased
36739 parameter of a function call, the master of the object is the innermost
36740 master enclosing the evaluation of the aggregate or function call,
36741 excluding the aggregate or function call itself. Otherwise, the master
36742 of such an anonymous object is the innermost master enclosing the
36743 evaluation of the aggregate or function call, which may be the aggregate
36744 or function call itself.
36745
36746 13.a/2
36747 This paragraph was deleted.{AI95-00162-01AI95-00162-01}
36748
36749 13.b/2
36750 This paragraph was deleted.
36751
36752 13.c/2
36753 This paragraph was deleted.
36754
36755 13.d/2
36756 Reason: {AI95-00162-01AI95-00162-01} This effectively imports
36757 all of the special rules for the accessibility level of
36758 renames, allocators, and so on, and applies them to determine
36759 where objects created in them are finalized. For instance,
36760 the master of a rename of a subprogram is that of the renamed
36761 subprogram.
36762
36763 13.e/3
36764 {AI05-0066-1AI05-0066-1} In *note 3.10.2:: we assign an
36765 accessibility level to the result of an aggregate or function
36766 call that is used to directly initialize a part of an object
36767 based on the object being initialized. This is important to
36768 ensure that any access discriminants denote objects that live
36769 at least as long as the object being initialized. However, if
36770 the result of the aggregate or function call is not built
36771 directly in the target object, but instead is built in an
36772 anonymous object that is then assigned to the target, the
36773 anonymous object needs to be finalized after the assignment
36774 rather than persisting until the target object is finalized
36775 (but not its coextensions). (Note than an implementation is
36776 never required to create such an anonymous object, and in some
36777 cases is required to not have such a separate object, but
36778 rather to build the result directly in the target.)
36779
36780 13.f/3
36781 {AI05-0142-4AI05-0142-4} The special case for explicitly
36782 aliased parameters of functions is needed for the same reason,
36783 as access discriminants of the returned object may designate
36784 one of these parameters. In that case, we want to lengthen
36785 the lifetime of the anonymous objects as long as the possible
36786 lifetime of the result.
36787
36788 13.g/3
36789 {AI05-0142-4AI05-0142-4} We don't do a similar change for
36790 other kinds of calls, because the extended lifetime of the
36791 parameters adds no value, but could constitute a storage leak.
36792 For instance, such an anonymous object created by a procedure
36793 call in the elaboration part of a package body would have to
36794 live until the end of the program, even though it could not be
36795 used after the procedure returns (other than via
36796 Unchecked_Access).
36797
36798 13.h/3
36799 Ramification: {AI05-0142-4AI05-0142-4} Note that the lifetime
36800 of the master given to anonymous objects in explicitly aliased
36801 parameters of functions is not necessarily as long as the
36802 lifetime of the master of the object being initialized (if the
36803 function call is used to initialize an allocator, for
36804 instance). In that case, the accessibility check on
36805 explicitly aliased parameters will necessarily fail if any
36806 such anonymous objects exist. This is necessary to avoid
36807 requiring the objects to live as long as the access type or
36808 having the implementation complexity of an implicit
36809 coextension.
36810
36811 13.1/3
36812 {8652/00238652/0023} {AI95-00169-01AI95-00169-01}
36813 {AI95-00162-01AI95-00162-01} {AI05-0066-1AI05-0066-1}
36814 {AI05-0262-1AI05-0262-1} In the case of an expression that is a master,
36815 finalization of any (anonymous) objects occurs after completing
36816 evaluation of the expression and all use of the objects, prior to
36817 starting the execution of any subsequent construct.
36818
36819 _Bounded (Run-Time) Errors_
36820
36821 14/1
36822 {8652/00238652/0023} {AI95-00169-01AI95-00169-01} It is a bounded error
36823 for a call on Finalize or Adjust that occurs as part of object
36824 finalization or assignment to propagate an exception. The possible
36825 consequences depend on what action invoked the Finalize or Adjust
36826 operation:
36827
36828 14.a
36829 Ramification: It is not a bounded error for Initialize to
36830 propagate an exception. If Initialize propagates an
36831 exception, then no further calls on Initialize are performed,
36832 and those components that have already been initialized
36833 (either explicitly or by default) are finalized in the usual
36834 way.
36835
36836 14.a.1/1
36837 {8652/00238652/0023} {AI95-00169-01AI95-00169-01} It also is
36838 not a bounded error for an explicit call to Finalize or Adjust
36839 to propagate an exception. We do not want implementations to
36840 have to treat explicit calls to these routines specially.
36841
36842 15
36843 * For a Finalize invoked as part of an assignment_statement,
36844 Program_Error is raised at that point.
36845
36846 16/2
36847 * {8652/00248652/0024} {AI95-00193-01AI95-00193-01}
36848 {AI95-00256-01AI95-00256-01} For an Adjust invoked as part of
36849 assignment operations other than those invoked as part of an
36850 assignment_statement, other adjustments due to be performed might
36851 or might not be performed, and then Program_Error is raised.
36852 During its propagation, finalization might or might not be applied
36853 to objects whose Adjust failed. For an Adjust invoked as part of
36854 an assignment_statement, any other adjustments due to be performed
36855 are performed, and then Program_Error is raised.
36856
36857 16.a/2
36858 Reason: {8652/00248652/0024} {AI95-00193-01AI95-00193-01}
36859 {AI95-00256-01AI95-00256-01} In the case of assignments that
36860 are part of initialization, there is no need to complete all
36861 adjustments if one propagates an exception, as the object will
36862 immediately be finalized. So long as a subcomponent is not
36863 going to be finalized, it need not be adjusted, even if it is
36864 initialized as part of an enclosing composite assignment
36865 operation for which some adjustments are performed. However,
36866 there is no harm in an implementation making additional Adjust
36867 calls (as long as any additional components that are adjusted
36868 are also finalized), so we allow the implementation
36869 flexibility here. On the other hand, for an
36870 assignment_statement, it is important that all adjustments be
36871 performed, even if one fails, because all controlled
36872 subcomponents are going to be finalized. Other kinds of
36873 assignment are more like initialization than
36874 assignment_statements, so we include them as well in the
36875 permission.
36876
36877 16.a.1/1
36878 Ramification: {8652/00248652/0024}
36879 {AI95-00193-01AI95-00193-01} Even if an Adjust invoked as part
36880 of the initialization of a controlled object propagates an
36881 exception, objects whose initialization (including any Adjust
36882 or Initialize calls) successfully completed will be finalized.
36883 The permission above only applies to objects whose Adjust
36884 failed. Objects for which Adjust was never even invoked must
36885 not be finalized.
36886
36887 17
36888 * For a Finalize invoked as part of a call on an instance of
36889 Unchecked_Deallocation, any other finalizations due to be performed
36890 are performed, and then Program_Error is raised.
36891
36892 17.a.1/1
36893 Discussion: {8652/01048652/0104} {AI95-00179-01AI95-00179-01}
36894 The standard does not specify if storage is recovered in this
36895 case. If storage is not recovered (and the object continues
36896 to exist), Finalize may be called on the object again (when
36897 the allocator's master is finalized).
36898
36899 17.1/3
36900 * This paragraph was deleted.{8652/00238652/0023}
36901 {AI95-00169-01AI95-00169-01} {AI05-0064-1AI05-0064-1}
36902
36903 17.2/1
36904 * {8652/00238652/0023} {AI95-00169-01AI95-00169-01} For a Finalize
36905 invoked due to reaching the end of the execution of a master, any
36906 other finalizations associated with the master are performed, and
36907 Program_Error is raised immediately after leaving the master.
36908
36909 17.a/3
36910 Discussion: {AI05-0064-1AI05-0064-1} This rule covers both
36911 ordinary objects created by a declaration, and anonymous
36912 objects created as part of evaluating an expression. All
36913 contexts that create objects that need finalization are
36914 defined to be masters.
36915
36916 18/2
36917 * {AI95-00318-02AI95-00318-02} For a Finalize invoked by the transfer
36918 of control of an exit_statement, return statement, goto_statement,
36919 or requeue_statement (*note 9.5.4: S0226.), Program_Error is raised
36920 no earlier than after the finalization of the master being
36921 finalized when the exception occurred, and no later than the point
36922 where normal execution would have continued. Any other
36923 finalizations due to be performed up to that point are performed
36924 before raising Program_Error.
36925
36926 18.a
36927 Ramification: For example, upon leaving a block_statement due
36928 to a goto_statement, the Program_Error would be raised at the
36929 point of the target statement denoted by the label, or else in
36930 some more dynamically nested place, but not so nested as to
36931 allow an exception_handler that has visibility upon the
36932 finalized object to handle it. For example,
36933
36934 18.b
36935 procedure Main is
36936 begin
36937 <<The_Label>>
36938 Outer_Block_Statement : declare
36939 X : Some_Controlled_Type;
36940 begin
36941 Inner_Block_Statement : declare
36942 Y : Some_Controlled_Type;
36943 Z : Some_Controlled_Type;
36944 begin
36945 goto The_Label;
36946 exception
36947 when Program_Error => ... -- Handler number 1.
36948 end;
36949 exception
36950 when Program_Error => ... -- Handler number 2.
36951 end;
36952 exception
36953 when Program_Error => ... -- Handler number 3.
36954 end Main;
36955
36956 18.c
36957 The goto_statement will first cause Finalize(Y) to be called.
36958 Suppose that Finalize(Y) propagates an exception.
36959 Program_Error will be raised after leaving
36960 Inner_Block_Statement, but before leaving Main. Thus, handler
36961 number 1 cannot handle this Program_Error; it will be handled
36962 either by handler number 2 or handler number 3. If it is
36963 handled by handler number 2, then Finalize(Z) will be done
36964 before executing the handler. If it is handled by handler
36965 number 3, then Finalize(Z) and Finalize(X) will both be done
36966 before executing the handler.
36967
36968 19
36969 * For a Finalize invoked by a transfer of control that is due to
36970 raising an exception, any other finalizations due to be performed
36971 for the same master are performed; Program_Error is raised
36972 immediately after leaving the master.
36973
36974 19.a
36975 Ramification: If, in the above example, the goto_statement
36976 were replaced by a raise_statement, then the Program_Error
36977 would be handled by handler number 2, and Finalize(Z) would be
36978 done before executing the handler.
36979
36980 19.b
36981 Reason: We considered treating this case in the same way as
36982 the others, but that would render certain exception_handlers
36983 useless. For example, suppose the only exception_handler is
36984 one for others in the main subprogram. If some deeply nested
36985 call raises an exception, causing some Finalize operation to
36986 be called, which then raises an exception, then normal
36987 execution "would have continued" at the beginning of the
36988 exception_handler. Raising Program_Error at that point would
36989 cause that handler's code to be skipped. One would need two
36990 nested exception_handlers to be sure of catching such cases!
36991
36992 19.c
36993 On the other hand, the exception_handler for a given master
36994 should not be allowed to handle exceptions raised during
36995 finalization of that master.
36996
36997 20
36998 * For a Finalize invoked by a transfer of control due to an abort or
36999 selection of a terminate alternative, the exception is ignored; any
37000 other finalizations due to be performed are performed.
37001
37002 20.a
37003 Ramification: This case includes an asynchronous transfer of
37004 control.
37005
37006 20.b
37007 To be honest: This violates the general principle that it is
37008 always possible for a bounded error to raise Program_Error
37009 (see *note 1.1.5::, "*note 1.1.5:: Classification of Errors").
37010
37011 _Implementation Permissions_
37012
37013 20.1/3
37014 {AI05-0107-1AI05-0107-1} If the execution of an allocator propagates an
37015 exception, any parts of the allocated object that were successfully
37016 initialized may be finalized as part of the finalization of the
37017 innermost master enclosing the allocator.
37018
37019 20.c/3
37020 Reason: This allows deallocating the memory for the allocated
37021 object at the innermost master, preventing a storage leak.
37022 Otherwise, the object would have to stay around until the
37023 finalization of the collection that it belongs to, which could
37024 be the entire life of the program if the associated access
37025 type is library level.
37026
37027 20.2/3
37028 {AI05-0111-3AI05-0111-3} {AI05-0262-1AI05-0262-1} The implementation may
37029 finalize objects created by allocators for an access type whose storage
37030 pool supports subpools (see *note 13.11.4::) as if the objects were
37031 created (in an arbitrary order) at the point where the storage pool was
37032 elaborated instead of at the first freezing point of the access type.
37033
37034 20.d/3
37035 Ramification: This allows the finalization of such objects to
37036 occur later than they otherwise would, but still as part of
37037 the finalization of the same master. Accessibility rules in
37038 *note 13.11.4:: ensure that it is the same master (usually
37039 that of the environment task).
37040
37041 20.e/3
37042 Implementation Note: This permission is intended to allow the
37043 allocated objects to "belong" to the subpool objects and to
37044 allow those objects to be finalized at the time that the
37045 storage pool is finalized (if they are not finalized earlier).
37046 This is expected to ease implementation, as the objects will
37047 only need to belong to the subpool and not also to the
37048 collection.
37049
37050 NOTES
37051
37052 21/3
37053 18 {AI05-0299-1AI05-0299-1} The rules of Clause 10 imply that
37054 immediately prior to partition termination, Finalize operations are
37055 applied to library-level controlled objects (including those
37056 created by allocators of library-level access types, except those
37057 already finalized). This occurs after waiting for library-level
37058 tasks to terminate.
37059
37060 21.a
37061 Discussion: We considered defining a pragma that would apply
37062 to a controlled type that would suppress Finalize operations
37063 for library-level objects of the type upon partition
37064 termination. This would be useful for types whose
37065 finalization actions consist of simply reclaiming global heap
37066 storage, when this is already provided automatically by the
37067 environment upon program termination.
37068
37069 22
37070 19 A constant is only constant between its initialization and
37071 finalization. Both initialization and finalization are allowed to
37072 change the value of a constant.
37073
37074 23
37075 20 Abort is deferred during certain operations related to
37076 controlled types, as explained in *note 9.8::. Those rules prevent
37077 an abort from causing a controlled object to be left in an
37078 ill-defined state.
37079
37080 24
37081 21 The Finalize procedure is called upon finalization of a
37082 controlled object, even if Finalize was called earlier, either
37083 explicitly or as part of an assignment; hence, if a controlled type
37084 is visibly controlled (implying that its Finalize primitive is
37085 directly callable), or is nonlimited (implying that assignment is
37086 allowed), its Finalize procedure should be designed to have no ill
37087 effect if it is applied a second time to the same object.
37088
37089 24.a
37090 Discussion: Or equivalently, a Finalize procedure should be
37091 "idempotent"; applying it twice to the same object should be
37092 equivalent to applying it once.
37093
37094 24.b
37095 Reason: A user-written Finalize procedure should be idempotent
37096 since it can be called explicitly by a client (at least if the
37097 type is "visibly" controlled). Also, Finalize is used
37098 implicitly as part of the assignment_statement if the type is
37099 nonlimited, and an abort is permitted to disrupt an
37100 assignment_statement between finalizing the left-hand side and
37101 assigning the new value to it (an abort is not permitted to
37102 disrupt an assignment operation between copying in the new
37103 value and adjusting it).
37104
37105 24.c/2
37106 Discussion: {AI95-00287-01AI95-00287-01} Either Initialize or
37107 Adjust, but not both, is applied to (almost) every controlled
37108 object when it is created: Initialize is done when no initial
37109 value is assigned to the object, whereas Adjust is done as
37110 part of assigning the initial value. The one exception is the
37111 object initialized by an aggregate (both the anonymous object
37112 created for an aggregate, or an object initialized by an
37113 aggregate that is built-in-place); Initialize is not applied
37114 to the aggregate as a whole, nor is the value of the aggregate
37115 or object adjusted.
37116
37117 24.d
37118 All of the following use the assignment operation, and thus
37119 perform value adjustment:
37120
37121 24.e
37122 * the assignment_statement (see *note 5.2::);
37123
37124 24.f
37125 * explicit initialization of a stand-alone object (see
37126 *note 3.3.1::) or of a pool element (see *note 4.8::);
37127
37128 24.g
37129 * default initialization of a component of a stand-alone
37130 object or pool element (in this case, the value of each
37131 component is assigned, and therefore adjusted, but the
37132 value of the object as a whole is not adjusted);
37133
37134 24.h/2
37135 * {AI95-00318-02AI95-00318-02} function return, when the
37136 result is not built-in-place (adjustment of the result
37137 happens before finalization of the function);
37138
37139 24.i
37140 * predefined operators (although the only one that matters
37141 is concatenation; see *note 4.5.3::);
37142
37143 24.j
37144 * generic formal objects of mode in (see *note 12.4::);
37145 these are defined in terms of constant declarations; and
37146
37147 24.k/2
37148 * {AI95-00287-01AI95-00287-01} aggregates (see *note
37149 4.3::), when the result is not built-in-place (in this
37150 case, the value of each component, and the parent part,
37151 for an extension_aggregate, is assigned, and therefore
37152 adjusted, but the value of the aggregate as a whole is
37153 not adjusted; neither is Initialize called);
37154
37155 24.l
37156 The following also use the assignment operation, but
37157 adjustment never does anything interesting in these cases:
37158
37159 24.m
37160 * By-copy parameter passing uses the assignment operation
37161 (see *note 6.4.1::), but controlled objects are always
37162 passed by reference, so the assignment operation never
37163 does anything interesting in this case. If we were to
37164 allow by-copy parameter passing for controlled objects,
37165 we would need to make sure that the actual is finalized
37166 before doing the copy back for [in] out parameters. The
37167 finalization of the parameter itself needs to happen
37168 after the copy back (if any), similar to the finalization
37169 of an anonymous function return object or aggregate
37170 object.
37171
37172 24.n
37173 * For loops use the assignment operation (see *note 5.5::),
37174 but since the type of the loop parameter is never
37175 controlled, nothing interesting happens there, either.
37176
37177 24.n.1/2
37178 * {AI95-00318-02AI95-00318-02} Objects initialized by
37179 function results and aggregates that are built-in-place.
37180 In this case, the assignment operation is never executed,
37181 and no adjustment takes place. While built-in-place is
37182 always allowed, it is required for some types -- see
37183 *note 7.5:: and *note 7.6:: -- and that's important since
37184 limited types have no Adjust to call.
37185
37186 24.o/2
37187 This paragraph was deleted.{AI95-00287-01AI95-00287-01}
37188
37189 24.p
37190 Finalization of the parts of a protected object are not done
37191 as protected actions. It is possible (in pathological cases)
37192 to create tasks during finalization that access these parts in
37193 parallel with the finalization itself. This is an erroneous
37194 use of shared variables.
37195
37196 24.q
37197 Implementation Note: One implementation technique for
37198 finalization is to chain the controlled objects together on a
37199 per-task list. When leaving a master, the list can be walked
37200 up to a marked place. The links needed to implement the list
37201 can be declared (privately) in types Controlled and
37202 Limited_Controlled, so they will be inherited by all
37203 controlled types.
37204
37205 24.r
37206 Another implementation technique, which we refer to as the
37207 "PC-map" approach essentially implies inserting exception
37208 handlers at various places, and finalizing objects based on
37209 where the exception was raised.
37210
37211 24.s
37212 The PC-map approach is for the compiler/linker to create a map
37213 of code addresses; when an exception is raised, or abort
37214 occurs, the map can be consulted to see where the task was
37215 executing, and what finalization needs to be performed. This
37216 approach was given in the Ada 83 Rationale as a possible
37217 implementation strategy for exception handling -- the map is
37218 consulted to determine which exception handler applies.
37219
37220 24.t
37221 If the PC-map approach is used, the implementation must take
37222 care in the case of arrays. The generated code will generally
37223 contain a loop to initialize an array. If an exception is
37224 raised part way through the array, the components that have
37225 been initialized must be finalized, and the others must not be
37226 finalized.
37227
37228 24.u
37229 It is our intention that both of these implementation methods
37230 should be possible.
37231
37232 _Wording Changes from Ada 83_
37233
37234 24.v/3
37235 {AI05-0299-1AI05-0299-1} Finalization depends on the concepts
37236 of completion and leaving, and on the concept of a master.
37237 Therefore, we have moved the definitions of these concepts
37238 here, from where they used to be in Clause *note 9::. These
37239 concepts also needed to be generalized somewhat. Task waiting
37240 is closely related to user-defined finalization; the rules
37241 here refer to the task-waiting rules of Clause *note 9::.
37242
37243 _Inconsistencies With Ada 95_
37244
37245 24.v.1/3
37246 {AI05-0066-1AI05-0066-1} Ada 2012 Correction: Changed the
37247 definition of the master of an anonymous object used to
37248 directly initialize an object, so it can be finalized
37249 immediately rather than having to hang around as long as the
37250 object. In this case, the Ada 2005 definition was
37251 inconsistent with Ada 95, and Ada 2012 changes it back. It is
37252 unlikely that many compilers implemented the rule as written
37253 in Amendment 1, so an inconsistency is unlikely to arise in
37254 practice.
37255
37256 _Wording Changes from Ada 95_
37257
37258 24.w/2
37259 {8652/00218652/0021} {AI95-00182-01AI95-00182-01} Corrigendum:
37260 Fixed the wording to say that anonymous objects aren't
37261 finalized until the object can't be used anymore.
37262
37263 24.x/2
37264 {8652/00238652/0023} {AI95-00169-01AI95-00169-01} Corrigendum:
37265 Added wording to clarify what happens when Adjust or Finalize
37266 raises an exception; some cases had been omitted.
37267
37268 24.y/2
37269 {8652/00248652/0024} {AI95-00193-01AI95-00193-01}
37270 {AI95-00256-01AI95-00256-01} Corrigendum: Stated that if
37271 Adjust raises an exception during initialization, nothing
37272 further is required. This is corrected in Ada 2005 to include
37273 all kinds of assignment other than assignment_statements.
37274
37275 24.z/2
37276 {AI95-00162-01AI95-00162-01} {AI95-00416-01AI95-00416-01}
37277 Revised the definition of master to include expressions and
37278 statements, in order to cleanly define what happens for tasks
37279 and controlled objects created as part of a subprogram call.
37280 Having done that, all of the special wording to cover those
37281 cases is eliminated (at least until the Ada comments start
37282 rolling in).
37283
37284 24.aa/2
37285 {AI95-00280-01AI95-00280-01} We define finalization of the
37286 collection here, so as to be able to conveniently refer to it
37287 in other rules (especially in *note 4.8::, "*note 4.8::
37288 Allocators").
37289
37290 24.bb/2
37291 {AI95-00416-01AI95-00416-01} Clarified that a coextension is
37292 finalized at the same time as the outer object. (This was
37293 intended for Ada 95, but since the concept did not have a
37294 name, it was overlooked.)
37295
37296 _Inconsistencies With Ada 2005_
37297
37298 24.cc/3
37299 {AI05-0051-1AI05-0051-1} {AI05-0190-1AI05-0190-1} Correction:
37300 Better defined when objects allocated from anonymous access
37301 types are finalized. This could be inconsistent if objects
37302 are finalized in a different order than in an Ada 2005
37303 implementation and that order caused different program
37304 behavior; however programs that depend on the order of
37305 finalization within a single master are already fragile and
37306 hopefully are rare.
37307
37308 _Wording Changes from Ada 2005_
37309
37310 24.dd/3
37311 {AI05-0064-1AI05-0064-1} Correction: Removed a redundant rule,
37312 which is now covered by the additional places where masters
37313 are defined.
37314
37315 24.ee/3
37316 {AI05-0099-1AI05-0099-1} Correction: Clarified the
37317 finalization rules so that there is no doubt that privacy is
37318 ignored, and to ensure that objects of classwide interface
37319 types are finalized based on their specific concrete type.
37320
37321 24.ff/3
37322 {AI05-0107-1AI05-0107-1} Correction: Allowed premature
37323 finalization of parts of failed allocators. This could be an
37324 inconsistency, but the previous behavior is still allowed and
37325 there is no requirement that implementations take advantage of
37326 the permission.
37327
37328 24.gg/3
37329 {AI05-0111-3AI05-0111-3} Added a permission to finalize object
37330 allocated from a subpool later than usual.
37331
37332 24.hh/3
37333 {AI05-0142-4AI05-0142-4} Added text to specially define the
37334 master of anonymous objects which are passed as explicitly
37335 aliased parameters (see *note 6.1::) of functions. The model
37336 for these parameters is explained in detail in *note 6.4.1::.
37337
37338 \1f
37339 File: aarm2012.info, Node: 8, Next: 9, Prev: 7, Up: Top
37340
37341 8 Visibility Rules
37342 ******************
37343
37344 1/3
37345 {AI05-0299-1AI05-0299-1} [The rules defining the scope of declarations
37346 and the rules defining which identifiers, character_literals, and
37347 operator_symbols are visible at (or from) various places in the text of
37348 the program are described in this clause. The formulation of these
37349 rules uses the notion of a declarative region.
37350
37351 2/3
37352 {AI05-0299-1AI05-0299-1} As explained in Clause *note 3::, a declaration
37353 declares a view of an entity and associates a defining name with that
37354 view. The view comprises an identification of the viewed entity, and
37355 possibly additional properties. A usage name denotes a declaration. It
37356 also denotes the view declared by that declaration, and denotes the
37357 entity of that view. Thus, two different usage names might denote two
37358 different views of the same entity; in this case they denote the same
37359 entity.]
37360
37361 2.a
37362 To be honest: In some cases, a usage name that denotes a
37363 declaration does not denote the view declared by that
37364 declaration, nor the entity of that view, but instead denotes
37365 a view of the current instance of the entity, and denotes the
37366 current instance of the entity. This sometimes happens when
37367 the usage name occurs inside the declarative region of the
37368 declaration.
37369
37370 _Wording Changes from Ada 83_
37371
37372 2.b
37373 We no longer define the term "basic operation;" thus we no
37374 longer have to worry about the visibility of them. Since they
37375 were essentially always visible in Ada 83, this change has no
37376 effect. The reason for this change is that the definition in
37377 Ada 83 was confusing, and not quite correct, and we found it
37378 difficult to fix. For example, one wonders why an
37379 if_statement was not a basic operation of type Boolean. For
37380 another example, one wonders what it meant for a basic
37381 operation to be "inherent in" something. Finally, this fixes
37382 the problem addressed by AI83-00027/07.
37383
37384 * Menu:
37385
37386 * 8.1 :: Declarative Region
37387 * 8.2 :: Scope of Declarations
37388 * 8.3 :: Visibility
37389 * 8.4 :: Use Clauses
37390 * 8.5 :: Renaming Declarations
37391 * 8.6 :: The Context of Overload Resolution
37392
37393 \1f
37394 File: aarm2012.info, Node: 8.1, Next: 8.2, Up: 8
37395
37396 8.1 Declarative Region
37397 ======================
37398
37399 _Static Semantics_
37400
37401 1
37402 For each of the following constructs, there is a portion of the program
37403 text called its declarative region, [within which nested declarations
37404 can occur]:
37405
37406 2
37407 * any declaration, other than that of an enumeration type, that is
37408 not a completion [of a previous declaration];
37409
37410 3
37411 * a block_statement;
37412
37413 4
37414 * a loop_statement;
37415
37416 4.1/3
37417 * {AI05-0255-1AI05-0255-1} a quantified_expression;
37418
37419 4.2/3
37420 * {AI95-00318-02AI95-00318-02} an extended_return_statement;
37421
37422 5
37423 * an accept_statement;
37424
37425 6
37426 * an exception_handler.
37427
37428 7
37429 The declarative region includes the text of the construct together with
37430 additional text determined [(recursively)], as follows:
37431
37432 8
37433 * If a declaration is included, so is its completion, if any.
37434
37435 9
37436 * If the declaration of a library unit [(including Standard -- see
37437 *note 10.1.1::)] is included, so are the declarations of any child
37438 units [(and their completions, by the previous rule)]. The child
37439 declarations occur after the declaration.
37440
37441 10
37442 * If a body_stub is included, so is the corresponding subunit.
37443
37444 11
37445 * If a type_declaration is included, then so is a corresponding
37446 record_representation_clause, if any.
37447
37448 11.a
37449 Reason: This is so that the component_declarations can be
37450 directly visible in the record_representation_clause.
37451
37452 12
37453 The declarative region of a declaration is also called the declarative
37454 region of any view or entity declared by the declaration.
37455
37456 12.a
37457 Reason: The constructs that have declarative regions are the
37458 constructs that can have declarations nested inside them.
37459 Nested declarations are declared in that declarative region.
37460 The one exception is for enumeration literals; although they
37461 are nested inside an enumeration type declaration, they behave
37462 as if they were declared at the same level as the type.
37463
37464 12.b
37465 To be honest: A declarative region does not include
37466 parent_unit_names.
37467
37468 12.c
37469 Ramification: A declarative region does not include
37470 context_clauses.
37471
37472 13
37473 A declaration occurs immediately within a declarative region if this
37474 region is the innermost declarative region that encloses the declaration
37475 (the immediately enclosing declarative region), not counting the
37476 declarative region (if any) associated with the declaration itself.
37477
37478 13.a
37479 Discussion: Don't confuse the declarative region of a
37480 declaration with the declarative region in which it
37481 immediately occurs.
37482
37483 14
37484 [ A declaration is local to a declarative region if the declaration
37485 occurs immediately within the declarative region.] [An entity is local
37486 to a declarative region if the entity is declared by a declaration that
37487 is local to the declarative region.]
37488
37489 14.a
37490 Ramification: "Occurs immediately within" and "local to" are
37491 synonyms (when referring to declarations).
37492
37493 14.b
37494 Thus, "local to" applies to both declarations and entities,
37495 whereas "occurs immediately within" only applies to
37496 declarations. We use this term only informally; for cases
37497 where precision is required, we use the term "occurs
37498 immediately within", since it is less likely to cause
37499 confusion.
37500
37501 15
37502 A declaration is global to a declarative region if the declaration
37503 occurs immediately within another declarative region that encloses the
37504 declarative region. An entity is global to a declarative region if the
37505 entity is declared by a declaration that is global to the declarative
37506 region.
37507
37508 NOTES
37509
37510 16
37511 1 The children of a parent library unit are inside the parent's
37512 declarative region, even though they do not occur inside the
37513 parent's declaration or body. This implies that one can use (for
37514 example) "P.Q" to refer to a child of P whose defining name is Q,
37515 and that after "use P;" Q can refer (directly) to that child.
37516
37517 17
37518 2 As explained above and in *note 10.1.1::, "*note 10.1.1::
37519 Compilation Units - Library Units", all library units are
37520 descendants of Standard, and so are contained in the declarative
37521 region of Standard. They are not inside the declaration or body of
37522 Standard, but they are inside its declarative region.
37523
37524 18
37525 3 For a declarative region that comes in multiple parts, the text
37526 of the declarative region does not contain any text that might
37527 appear between the parts. Thus, when a portion of a declarative
37528 region is said to extend from one place to another in the
37529 declarative region, the portion does not contain any text that
37530 might appear between the parts of the declarative region.
37531
37532 18.a
37533 Discussion: It is necessary for the things that have a
37534 declarative region to include anything that contains
37535 declarations (except for enumeration type declarations). This
37536 includes any declaration that has a profile (that is,
37537 subprogram_declaration, subprogram_body, entry_declaration,
37538 subprogram_renaming_declaration,
37539 formal_subprogram_declaration, access-to-subprogram
37540 type_declaration), anything that has a discriminant_part (that
37541 is, various kinds of type_declaration), anything that has a
37542 component_list (that is, record type_declaration and record
37543 extension type_declaration), and finally the declarations of
37544 task and protected units and packages.
37545
37546 _Wording Changes from Ada 83_
37547
37548 18.b
37549 It was necessary to extend Ada 83's definition of declarative
37550 region to take the following Ada 95 features into account:
37551
37552 18.c
37553 * Child library units.
37554
37555 18.d
37556 * Derived types/type extensions -- we need a declarative
37557 region for inherited components and also for new
37558 components.
37559
37560 18.e
37561 * All the kinds of types that allow discriminants.
37562
37563 18.f
37564 * Protected units.
37565
37566 18.g
37567 * Entries that have bodies instead of accept statements.
37568
37569 18.h
37570 * The choice_parameter_specification of an
37571 exception_handler.
37572
37573 18.i
37574 * The formal parameters of access-to-subprogram types.
37575
37576 18.j
37577 * Renamings-as-body.
37578
37579 18.k
37580 Discriminated and access-to-subprogram type declarations need
37581 a declarative region. Enumeration type declarations cannot
37582 have one, because you don't have to say "Color.Red" to refer
37583 to the literal Red of Color. For other type declarations, it
37584 doesn't really matter whether or not there is an associated
37585 declarative region, so for simplicity, we give one to all
37586 types except enumeration types.
37587
37588 18.l
37589 We now say that an accept_statement has its own declarative
37590 region, rather than being part of the declarative region of
37591 the entry_declaration, so that declarative regions are
37592 properly nested regions of text, so that it makes sense to
37593 talk about "inner declarative regions," and "...extends to the
37594 end of a declarative region." Inside an accept_statement, the
37595 name of one of the parameters denotes the
37596 parameter_specification of the accept_statement, not that of
37597 the entry_declaration. If the accept_statement is nested
37598 within a block_statement, these parameter_specifications can
37599 hide declarations of the block_statement. The semantics of
37600 such cases was unclear in RM83.
37601
37602 18.m
37603 To be honest: Unfortunately, we have the same problem for the
37604 entry name itself -- it should denote the accept_statement,
37605 but accept_statements are not declarations. They should be,
37606 and they should hide the entry from all visibility within
37607 themselves.
37608
37609 18.n
37610 Note that we can't generalize this to entry_bodies, or other
37611 bodies, because the declarative_part of a body is not supposed
37612 to contain (explicit) homographs of things in the declaration.
37613 It works for accept_statements only because an
37614 accept_statement does not have a declarative_part.
37615
37616 18.o
37617 To avoid confusion, we use the term "local to" only informally
37618 in Ada 95. Even RM83 used the term incorrectly (see, for
37619 example, RM83-12.3(13)).
37620
37621 18.p
37622 In Ada 83, (root) library units were inside Standard; it was
37623 not clear whether the declaration or body of Standard was
37624 meant. In Ada 95, they are children of Standard, and so occur
37625 immediately within Standard's declarative region, but not
37626 within either the declaration or the body. (See RM83-8.6(2)
37627 and RM83-10.1.1(5).)
37628
37629 _Wording Changes from Ada 95_
37630
37631 18.q/2
37632 {AI95-00318-02AI95-00318-02} Extended_return_statement (see
37633 *note 6.5::) is added to the list of constructs that have a
37634 declarative region.
37635
37636 \1f
37637 File: aarm2012.info, Node: 8.2, Next: 8.3, Prev: 8.1, Up: 8
37638
37639 8.2 Scope of Declarations
37640 =========================
37641
37642 1
37643 [For each declaration, the language rules define a certain portion of
37644 the program text called the scope of the declaration. The scope of a
37645 declaration is also called the scope of any view or entity declared by
37646 the declaration. Within the scope of an entity, and only there, there
37647 are places where it is legal to refer to the declared entity. These
37648 places are defined by the rules of visibility and overloading.]
37649
37650 _Static Semantics_
37651
37652 2
37653 The immediate scope of a declaration is a portion of the declarative
37654 region immediately enclosing the declaration. The immediate scope
37655 starts at the beginning of the declaration, except in the case of an
37656 overloadable declaration, in which case the immediate scope starts just
37657 after the place where the profile of the callable entity is determined
37658 (which is at the end of the _specification for the callable entity, or
37659 at the end of the generic_instantiation if an instance). The immediate
37660 scope extends to the end of the declarative region, with the following
37661 exceptions:
37662
37663 2.a
37664 Reason: The reason for making overloadable declarations with
37665 profiles special is to simplify compilation: until the
37666 compiler has determined the profile, it doesn't know which
37667 other declarations are homographs of this one, so it doesn't
37668 know which ones this one should hide. Without this rule, two
37669 passes over the _specification or generic_instantiation would
37670 be required to resolve names that denote things with the same
37671 name as this one.
37672
37673 3
37674 * The immediate scope of a library_item includes only its semantic
37675 dependents.
37676
37677 3.a/3
37678 Reason: {AI05-0299-1AI05-0299-1} Clause 10 defines only a
37679 partial ordering of library_items. Therefore, it is a good
37680 idea to restrict the immediate scope (and the scope, defined
37681 below) to semantic dependents.
37682
37683 3.b
37684 Consider also examples like this:
37685
37686 3.c
37687 package P is end P;
37688
37689 3.d
37690 package P.Q is
37691 I : Integer := 0;
37692 end P.Q;
37693
37694 3.e/1
37695 with P;
37696 package R is
37697 package X renames P;
37698 J : Integer := X.Q.I; -- Illegal!
37699 end R;
37700
37701 3.f
37702 The scope of P.Q does not contain R. Hence, neither P.Q nor
37703 X.Q are visible within R. However, the name R.X.Q would be
37704 visible in some other library unit where both R and P.Q are
37705 visible (assuming R were made legal by removing the offending
37706 declaration).
37707
37708 3.g/2
37709 Ramification: {AI95-00217-06AI95-00217-06} This rule applies
37710 to limited views as well as "normal" library items. In that
37711 case, the semantic dependents are the units that have a
37712 limited_with_clause for the limited view.
37713
37714 4
37715 * The immediate scope of a declaration in the private part of a
37716 library unit does not include the visible part of any public
37717 descendant of that library unit.
37718
37719 4.a
37720 Ramification: In other words, a declaration in the private
37721 part can be visible within the visible part, private part and
37722 body of a private child unit. On the other hand, such a
37723 declaration can be visible within only the private part and
37724 body of a public child unit.
37725
37726 4.b
37727 Reason: The purpose of this rule is to prevent children from
37728 giving private information to clients.
37729
37730 4.c/2
37731 Ramification: {AI95-00231-01AI95-00231-01} For a public child
37732 subprogram, this means that the parent's private part is not
37733 visible in the profile of the declaration and of the body.
37734 This is true even for subprogram_bodies that are not
37735 completions. For a public child generic unit, it means that
37736 the parent's private part is not visible in the
37737 generic_formal_part, as well as in the first list of
37738 basic_declarative_items (for a generic package), or the
37739 (syntactic) profile (for a generic subprogram).
37740
37741 5
37742 [The visible part of (a view of) an entity is a portion of the text of
37743 its declaration containing declarations that are visible from outside.]
37744 The private part of (a view of) an entity that has a visible part
37745 contains all declarations within the declaration of (the view of) the
37746 entity, except those in the visible part; [these are not visible from
37747 outside. Visible and private parts are defined only for these kinds of
37748 entities: callable entities, other program units, and composite types.]
37749
37750 6
37751 * The visible part of a view of a callable entity is its profile.
37752
37753 7
37754 * The visible part of a composite type other than a task or protected
37755 type consists of the declarations of all components declared
37756 [(explicitly or implicitly)] within the type_declaration.
37757
37758 8
37759 * The visible part of a generic unit includes the
37760 generic_formal_part. For a generic package, it also includes the
37761 first list of basic_declarative_items of the package_specification.
37762 For a generic subprogram, it also includes the profile.
37763
37764 8.a
37765 Reason: Although there is no way to reference anything but the
37766 formals from outside a generic unit, they are still in the
37767 visible part in the sense that the corresponding declarations
37768 in an instance can be referenced (at least in some cases). In
37769 other words, these declarations have an effect on the outside
37770 world. The visible part of a generic unit needs to be defined
37771 this way in order to properly support the rule that makes a
37772 parent's private part invisible within a public child's
37773 visible part.
37774
37775 8.b
37776 Ramification: The visible part of an instance of a generic
37777 unit is as defined for packages and subprograms; it is not
37778 defined in terms of the visible part of a generic unit.
37779
37780 9
37781 * [The visible part of a package, task unit, or protected unit
37782 consists of declarations in the program unit's declaration other
37783 than those following the reserved word private, if any; see *note
37784 7.1:: and *note 12.7:: for packages, *note 9.1:: for task units,
37785 and *note 9.4:: for protected units.]
37786
37787 10
37788 The scope of a declaration always contains the immediate scope of the
37789 declaration. In addition, for a given declaration that occurs
37790 immediately within the visible part of an outer declaration, or is a
37791 public child of an outer declaration, the scope of the given declaration
37792 extends to the end of the scope of the outer declaration, except that
37793 the scope of a library_item includes only its semantic dependents.
37794
37795 10.a
37796 Ramification: Note the recursion. If a declaration appears in
37797 the visible part of a library unit, its scope extends to the
37798 end of the scope of the library unit, but since that only
37799 includes dependents of the declaration of the library unit,
37800 the scope of the inner declaration also only includes those
37801 dependents. If X renames library package P, which has a child
37802 Q, a with_clause mentioning P.Q is necessary to be able to
37803 refer to X.Q, even if P.Q is visible at the place where X is
37804 declared.
37805
37806 10.1/3
37807 {AI95-00408-01AI95-00408-01} {AI05-0183-1AI05-0183-1} The scope of an
37808 attribute_definition_clause is identical to the scope of a declaration
37809 that would occur at the point of the attribute_definition_clause. The
37810 scope of an aspect_specification is identical to the scope of the
37811 associated declaration.
37812
37813 11
37814 The immediate scope of a declaration is also the immediate scope of the
37815 entity or view declared by the declaration. Similarly, the scope of a
37816 declaration is also the scope of the entity or view declared by the
37817 declaration.
37818
37819 11.a
37820 Ramification: The rule for immediate scope implies the
37821 following:
37822
37823 11.b
37824 * If the declaration is that of a library unit, then the
37825 immediate scope includes the declarative region of the
37826 declaration itself, but not other places, unless they are
37827 within the scope of a with_clause that mentions the
37828 library unit.
37829
37830 11.c
37831 It is necessary to attach the semantics of with_clauses
37832 to [immediate] scopes (as opposed to visibility), in
37833 order for various rules to work properly. A library unit
37834 should hide a homographic implicit declaration that
37835 appears in its parent, but only within the scope of a
37836 with_clause that mentions the library unit. Otherwise,
37837 we would violate the "legality determinable via semantic
37838 dependences" rule of *note 10::, "*note 10:: Program
37839 Structure and Compilation Issues". The declaration of a
37840 library unit should be allowed to be a homograph of an
37841 explicit declaration in its parent's body, so long as
37842 that body does not mention the library unit in a
37843 with_clause.
37844
37845 11.d
37846 This means that one cannot denote the declaration of the
37847 library unit, but one might still be able to denote the
37848 library unit via another view.
37849
37850 11.e
37851 A with_clause does not make the declaration of a library
37852 unit visible; the lack of a with_clause prevents it from
37853 being visible. Even if a library unit is mentioned in a
37854 with_clause, its declaration can still be hidden.
37855
37856 11.f
37857 * The completion of the declaration of a library unit
37858 (assuming that's also a declaration) is not visible,
37859 neither directly nor by selection, outside that
37860 completion.
37861
37862 11.g
37863 * The immediate scope of a declaration immediately within
37864 the body of a library unit does not include any child of
37865 that library unit.
37866
37867 11.h
37868 This is needed to prevent children from looking inside
37869 their parent's body. The children are in the declarative
37870 region of the parent, and they might be after the
37871 parent's body. Therefore, the scope of a declaration
37872 that occurs immediately within the body might include
37873 some children.
37874
37875 NOTES
37876
37877 12/3
37878 4 {AI05-0299-1AI05-0299-1} There are notations for denoting
37879 visible declarations that are not directly visible. For example,
37880 parameter_specification (*note 6.1: S0175.)s are in the visible
37881 part of a subprogram_declaration (*note 6.1: S0163.) so that they
37882 can be used in named-notation calls appearing outside the called
37883 subprogram. For another example, declarations of the visible part
37884 of a package can be denoted by expanded names appearing outside the
37885 package, and can be made directly visible by a use_clause.
37886
37887 12.a/3
37888 Ramification: {AI95-00114-01AI95-00114-01}
37889 {AI05-0299-1AI05-0299-1} There are some obscure cases
37890 involving generics in which there is no such notation. See
37891 Clause *note 12::.
37892
37893 _Extensions to Ada 83_
37894
37895 12.b
37896 The fact that the immediate scope of an overloadable
37897 declaration does not include its profile is new to Ada 95. It
37898 replaces RM83-8.3(16), which said that within a subprogram
37899 specification and within the formal part of an entry
37900 declaration or accept statement, all declarations with the
37901 same designator as the subprogram or entry were hidden from
37902 all visibility. The RM83-8.3(16) rule seemed to be overkill,
37903 and created both implementation difficulties and unnecessary
37904 semantic complexity.
37905
37906 _Wording Changes from Ada 83_
37907
37908 12.c
37909 We no longer need to talk about the scope of notations,
37910 identifiers, character_literals, and operator_symbols.
37911
37912 12.d/3
37913 {AI05-0299-1AI05-0299-1} The notion of "visible part" has been
37914 extended in Ada 95. The syntax of task and protected units
37915 now allows private parts, thus requiring us to be able to talk
37916 about the visible part as well. It was necessary to extend
37917 the concept to subprograms and to generic units, in order for
37918 the visibility rules related to child library units to work
37919 properly. It was necessary to define the concept separately
37920 for generic formal packages, since their visible part is
37921 slightly different from that of a normal package. Extending
37922 the concept to composite types made the definition of scope
37923 slightly simpler. We define visible part for some things
37924 elsewhere, since it makes a big difference to the user for
37925 those things. For composite types and subprograms, however,
37926 the concept is used only in arcane visibility rules, so we
37927 localize it to this subclause.
37928
37929 12.e
37930 In Ada 83, the semantics of with_clauses was described in
37931 terms of visibility. It is now described in terms of
37932 [immediate] scope.
37933
37934 12.f
37935 We have clarified that the following is illegal (where Q and R
37936 are library units):
37937
37938 12.g
37939 package Q is
37940 I : Integer := 0;
37941 end Q;
37942
37943 12.h
37944 package R is
37945 package X renames Standard;
37946 X.Q.I := 17; -- Illegal!
37947 end R;
37948
37949 12.i
37950 even though Q is declared in the declarative region of
37951 Standard, because R does not mention Q in a with_clause.
37952
37953 _Wording Changes from Ada 95_
37954
37955 12.j/2
37956 {AI95-00408-01AI95-00408-01} The scope of an
37957 attribute_definition_clause is defined so that it can be used
37958 to define the visibility of such a clause, so that can be used
37959 by the stream attribute availability rules (see *note
37960 13.13.2::).
37961
37962 _Wording Changes from Ada 2005_
37963
37964 12.k/3
37965 {AI05-0183-1AI05-0183-1} The scope of an aspect_specification
37966 is defined for similar reasons that it was defined for
37967 attribute_definition_clauses.
37968
37969 \1f
37970 File: aarm2012.info, Node: 8.3, Next: 8.4, Prev: 8.2, Up: 8
37971
37972 8.3 Visibility
37973 ==============
37974
37975 1
37976 [ The visibility rules, given below, determine which declarations are
37977 visible and directly visible at each place within a program. The
37978 visibility rules apply to both explicit and implicit declarations.]
37979
37980 _Static Semantics_
37981
37982 2
37983 A declaration is defined to be directly visible at places where a name
37984 consisting of only an identifier or operator_symbol is sufficient to
37985 denote the declaration; that is, no selected_component notation or
37986 special context (such as preceding => in a named association) is
37987 necessary to denote the declaration. A declaration is defined to be
37988 visible wherever it is directly visible, as well as at other places
37989 where some name (such as a selected_component) can denote the
37990 declaration.
37991
37992 3
37993 The syntactic category direct_name is used to indicate contexts where
37994 direct visibility is required. The syntactic category selector_name is
37995 used to indicate contexts where visibility, but not direct visibility,
37996 is required.
37997
37998 4
37999 There are two kinds of direct visibility: immediate visibility and
38000 use-visibility. A declaration is immediately visible at a place if it
38001 is directly visible because the place is within its immediate scope. A
38002 declaration is use-visible if it is directly visible because of a
38003 use_clause (see *note 8.4::). Both conditions can apply.
38004
38005 5
38006 A declaration can be hidden, either from direct visibility, or from all
38007 visibility, within certain parts of its scope. Where hidden from all
38008 visibility, it is not visible at all (neither using a direct_name nor a
38009 selector_name). Where hidden from direct visibility, only direct
38010 visibility is lost; visibility using a selector_name is still possible.
38011
38012 6
38013 [ Two or more declarations are overloaded if they all have the same
38014 defining name and there is a place where they are all directly visible.]
38015
38016 6.a
38017 Ramification: Note that a name can have more than one possible
38018 interpretation even if it denotes a nonoverloadable entity.
38019 For example, if there are two functions F that return records,
38020 both containing a component called C, then the name F.C has
38021 two possible interpretations, even though component
38022 declarations are not overloadable.
38023
38024 7
38025 The declarations of callable entities [(including enumeration literals)]
38026 are overloadable[, meaning that overloading is allowed for them].
38027
38028 7.a
38029 Ramification: A generic_declaration is not overloadable within
38030 its own generic_formal_part. This follows from the rules
38031 about when a name denotes a current instance. See AI83-00286.
38032 This implies that within a generic_formal_part, outer
38033 declarations with the same defining name are hidden from
38034 direct visibility. It also implies that if a generic formal
38035 parameter has the same defining name as the generic itself,
38036 the formal parameter hides the generic from direct visibility.
38037
38038 8
38039 Two declarations are homographs if they have the same defining name,
38040 and, if both are overloadable, their profiles are type conformant. [An
38041 inner declaration hides any outer homograph from direct visibility.]
38042
38043 8.a/2
38044 Glossary entry: An overriding operation is one that replaces
38045 an inherited primitive operation. Operations may be marked
38046 explicitly as overriding or not overriding.
38047
38048 9/1
38049 {8652/00258652/0025} {AI95-00044-01AI95-00044-01} [Two homographs are
38050 not generally allowed immediately within the same declarative region
38051 unless one overrides the other (see Legality Rules below).] The only
38052 declarations that are overridable are the implicit declarations for
38053 predefined operators and inherited primitive subprograms. A declaration
38054 overrides another homograph that occurs immediately within the same
38055 declarative region in the following cases:
38056
38057 10/1
38058 * {8652/00258652/0025} {AI95-00044-01AI95-00044-01} A declaration
38059 that is not overridable overrides one that is overridable,
38060 [regardless of which declaration occurs first];
38061
38062 10.a/1
38063 Ramification: {8652/00258652/0025}
38064 {AI95-00044-01AI95-00044-01} And regardless of whether the
38065 nonoverridable declaration is overloadable or not. For
38066 example, statement_identifiers are covered by this rule.
38067
38068 10.b
38069 The "regardless of which declaration occurs first" is there
38070 because the explicit declaration could be a primitive
38071 subprogram of a partial view, and then the full view might
38072 inherit a homograph. We are saying that the explicit one wins
38073 (within its scope), even though the implicit one comes later.
38074
38075 10.c
38076 If the overriding declaration is also a subprogram, then it is
38077 a primitive subprogram.
38078
38079 10.d
38080 As explained in *note 7.3.1::, "*note 7.3.1:: Private
38081 Operations", some inherited primitive subprograms are never
38082 declared. Such subprograms cannot be overridden, although
38083 they can be reached by dispatching calls in the case of a
38084 tagged type.
38085
38086 11
38087 * The implicit declaration of an inherited operator overrides that of
38088 a predefined operator;
38089
38090 11.a
38091 Ramification: In a previous version of Ada 9X, we tried to
38092 avoid the notion of predefined operators, and say that they
38093 were inherited from some magical root type. However, this
38094 seemed like too much mechanism. Therefore, a type can have a
38095 predefined "+" as well as an inherited "+". The above rule
38096 says the inherited one wins.
38097
38098 11.b/2
38099 {AI95-00114-01AI95-00114-01} The "regardless of which
38100 declaration occurs first" applies here as well, in the case
38101 where derived_type_definition in the visible part of a public
38102 library unit derives from a private type declared in the
38103 parent unit, and the full view of the parent type has
38104 additional predefined operators, as explained in *note
38105 7.3.1::, "*note 7.3.1:: Private Operations". Those predefined
38106 operators can be overridden by inherited subprograms
38107 implicitly declared earlier.
38108
38109 12
38110 * An implicit declaration of an inherited subprogram overrides a
38111 previous implicit declaration of an inherited subprogram.
38112
38113 12.1/2
38114 * {AI95-00251-01AI95-00251-01} If two or more homographs are
38115 implicitly declared at the same place:
38116
38117 12.2/2
38118 * {AI95-00251-01AI95-00251-01} If at least one is a
38119 subprogram that is neither a null procedure nor an
38120 abstract subprogram, and does not require overriding (see
38121 *note 3.9.3::), then they override those that are null
38122 procedures, abstract subprograms, or require overriding.
38123 If more than one such homograph remains that is not thus
38124 overridden, then they are all hidden from all visibility.
38125
38126 12.3/2
38127 * {AI95-00251-01AI95-00251-01} Otherwise (all are null
38128 procedures, abstract subprograms, or require overriding),
38129 then any null procedure overrides all abstract
38130 subprograms and all subprograms that require overriding;
38131 if more than one such homograph remains that is not thus
38132 overridden, then if they are all fully conformant with
38133 one another, one is chosen arbitrarily; if not, they are
38134 all hidden from all visibility.
38135
38136 12.a/2
38137 Discussion: In the case where the implementation arbitrarily
38138 chooses one overrider from among a group of inherited
38139 subprograms, users should not be able to determine which
38140 member was chosen, as the set of inherited subprograms which
38141 are chosen from must be fully conformant. This rule is needed
38142 in order to allow
38143
38144 12.b/2
38145 package Outer is
38146 package P1 is
38147 type Ifc1 is interface;
38148 procedure Null_Procedure (X : Ifc1) is null;
38149 procedure Abstract_Subp (X : Ifc1) is abstract;
38150 end P1;
38151
38152 12.c/2
38153 package P2 is
38154 type Ifc2 is interface;
38155 procedure Null_Procedure (X : Ifc2) is null;
38156 procedure Abstract_Subp (X : Ifc2) is abstract;
38157 end P2;
38158
38159 12.d/2
38160 type T is abstract new P1.Ifc1 and P2.Ifc2 with null record;
38161 end Outer;
38162
38163 12.e/2
38164 without requiring that T explicitly override any of its
38165 inherited operations.
38166
38167 12.f/2
38168 Full conformance is required here, as we cannot allow the
38169 parameter names to differ. If they did differ, the routine
38170 which was selected for overriding could be determined by using
38171 named parameter notation in a call.
38172
38173 12.g/2
38174 When the subprograms do not conform, we chose not to adopt the
38175 "use clause" rule which would make them all visible resulting
38176 in likely ambiguity. If we had used such a rule, any
38177 successful calls would be confusing; and the fact that there
38178 are no Beaujolais-like effect to worry about means we can
38179 consider other rules. The hidden-from-all-visibility
38180 homographs are still inherited by further derivations, which
38181 avoids order-of-declaration dependencies and other anomalies.
38182
38183 12.h/2
38184 We have to be careful to not include arbitrary selection if
38185 the routines have real bodies. (This can happen in generics,
38186 see the example in the incompatibilities section below.) We
38187 don't want the ability to successfully call routines where the
38188 body executed depends on the compiler or a phase of the moon.
38189
38190 12.i/2
38191 Note that if the type is concrete, abstract subprograms are
38192 inherited as subprograms that require overriding. We include
38193 functions that require overriding as well; these don't have
38194 real bodies, so they can use the more liberal rules.
38195
38196 13
38197 * [For an implicit declaration of a primitive subprogram in a generic
38198 unit, there is a copy of this declaration in an instance.]
38199 However, a whole new set of primitive subprograms is implicitly
38200 declared for each type declared within the visible part of the
38201 instance. These new declarations occur immediately after the type
38202 declaration, and override the copied ones. [The copied ones can be
38203 called only from within the instance; the new ones can be called
38204 only from outside the instance, although for tagged types, the body
38205 of a new one can be executed by a call to an old one.]
38206
38207 13.a
38208 Discussion: In addition, this is also stated redundantly
38209 (again), and is repeated, in *note 12.3::, "*note 12.3::
38210 Generic Instantiation". The rationale for the rule is
38211 explained there.
38212
38213 13.b/3
38214 To be honest: {AI05-0042-1AI05-0042-1} The implicit
38215 subprograms declared when an operation of a progenitor is
38216 implemented by an entry or subprogram also override the
38217 appropriate implicitly declared inherited operations of the
38218 progenitor.
38219
38220 14
38221 A declaration is visible within its scope, except where hidden from all
38222 visibility, as follows:
38223
38224 15
38225 * An overridden declaration is hidden from all visibility within the
38226 scope of the overriding declaration.
38227
38228 15.a
38229 Ramification: We have to talk about the scope of the
38230 overriding declaration, not its visibility, because it hides
38231 even when it is itself hidden.
38232
38233 15.b
38234 Note that the scope of an explicit subprogram_declaration does
38235 not start until after its profile.
38236
38237 16
38238 * A declaration is hidden from all visibility until the end of the
38239 declaration, except:
38240
38241 17
38242 * For a record type or record extension, the declaration is
38243 hidden from all visibility only until the reserved word
38244 record;
38245
38246 18/3
38247 * {AI95-00345-01AI95-00345-01} {AI05-0177-1AI05-0177-1} For
38248 a package_declaration, generic_package_declaration (*note
38249 12.1: S0272.), subprogram_body (*note 6.3: S0177.), or
38250 expression_function_declaration (*note 6.8: S0189.), the
38251 declaration is hidden from all visibility only until the
38252 reserved word is of the declaration;
38253
38254 18.a
38255 Ramification: We're talking about the is of the construct
38256 itself, here, not some random is that might appear in a
38257 generic_formal_part.
38258
38259 18.1/2
38260 * {AI95-00345-01AI95-00345-01} For a task declaration or
38261 protected declaration, the declaration is hidden from all
38262 visibility only until the reserved word with of the
38263 declaration if there is one, or the reserved word is of
38264 the declaration if there is no with.
38265
38266 18.b/2
38267 To be honest: If there is neither a with nor is, then the
38268 exception does not apply and the name is hidden from all
38269 visibility until the end of the declaration. This oddity was
38270 inherited from Ada 95.
38271
38272 18.c/2
38273 Reason: We need the "with or is" rule so that the visibility
38274 within an interface_list does not vary by construct. That
38275 would make it harder to complete private extensions and would
38276 complicate implementations.
38277
38278 19
38279 * If the completion of a declaration is a declaration, then within
38280 the scope of the completion, the first declaration is hidden from
38281 all visibility. Similarly, a discriminant_specification (*note
38282 3.7: S0062.) or parameter_specification (*note 6.1: S0175.) is
38283 hidden within the scope of a corresponding
38284 discriminant_specification (*note 3.7: S0062.) or
38285 parameter_specification (*note 6.1: S0175.) of a corresponding
38286 completion, or of a corresponding accept_statement (*note 9.5.2:
38287 S0219.).
38288
38289 19.a
38290 Ramification: This rule means, for example, that within the
38291 scope of a full_type_declaration that completes a
38292 private_type_declaration, the name of the type will denote the
38293 full_type_declaration, and therefore the full view of the
38294 type. On the other hand, if the completion is not a
38295 declaration, then it doesn't hide anything, and you can't
38296 denote it.
38297
38298 20/2
38299 * {AI95-00217-06AI95-00217-06} {AI95-00412-01AI95-00412-01} The
38300 declaration of a library unit (including a
38301 library_unit_renaming_declaration) is hidden from all visibility at
38302 places outside its declarative region that are not within the scope
38303 of a nonlimited_with_clause that mentions it. The limited view of
38304 a library package is hidden from all visibility at places that are
38305 not within the scope of a limited_with_clause that mentions it; in
38306 addition, the limited view is hidden from all visibility within the
38307 declarative region of the package, as well as within the scope of
38308 any nonlimited_with_clause that mentions the package. Where the
38309 declaration of the limited view of a package is visible, any name
38310 that denotes the package denotes the limited view, including those
38311 provided by a package renaming.
38312
38313 20.a/2
38314 Discussion: {AI95-00217-06AI95-00217-06} This is the rule that
38315 prevents with_clauses from being transitive; the [immediate]
38316 scope includes indirect semantic dependents. This rule also
38317 prevents the limited view of a package from being visible in
38318 the same place as the full view of the package, which prevents
38319 various ripple effects.
38320
38321 20.1/2
38322 * {AI95-00217-06AI95-00217-06} {AI95-00412-01AI95-00412-01} [For each
38323 declaration or renaming of a generic unit as a child of some parent
38324 generic package, there is a corresponding declaration nested
38325 immediately within each instance of the parent.] Such a nested
38326 declaration is hidden from all visibility except at places that are
38327 within the scope of a with_clause that mentions the child.
38328
38329 21
38330 A declaration with a defining_identifier or defining_operator_symbol is
38331 immediately visible [(and hence directly visible)] within its immediate
38332 scope except where hidden from direct visibility, as follows:
38333
38334 22
38335 * A declaration is hidden from direct visibility within the immediate
38336 scope of a homograph of the declaration, if the homograph occurs
38337 within an inner declarative region;
38338
38339 23
38340 * A declaration is also hidden from direct visibility where hidden
38341 from all visibility.
38342
38343 23.1/3
38344 {AI95-00195-01AI95-00195-01} {AI95-00408-01AI95-00408-01}
38345 {AI05-0183-1AI05-0183-1} An attribute_definition_clause or an
38346 aspect_specification is visible everywhere within its scope.
38347
38348 _Name Resolution Rules_
38349
38350 24
38351 A direct_name shall resolve to denote a directly visible declaration
38352 whose defining name is the same as the direct_name. A selector_name
38353 shall resolve to denote a visible declaration whose defining name is the
38354 same as the selector_name.
38355
38356 24.a
38357 Discussion: "The same as" has the obvious meaning here, so for
38358 +, the possible interpretations are declarations whose
38359 defining name is "+" (an operator_symbol).
38360
38361 25
38362 These rules on visibility and direct visibility do not apply in a
38363 context_clause, a parent_unit_name, or a pragma that appears at the
38364 place of a compilation_unit. For those contexts, see the rules in *note
38365 10.1.6::, "*note 10.1.6:: Environment-Level Visibility Rules".
38366
38367 25.a
38368 Ramification: Direct visibility is irrelevant for
38369 character_literals. In terms of overload resolution
38370 character_literals are similar to other literals, like null --
38371 see *note 4.2::. For character_literals, there is no need to
38372 worry about hiding, since there is no way to declare
38373 homographs.
38374
38375 _Legality Rules_
38376
38377 26/2
38378 {8652/00258652/0025} {8652/00268652/0026} {AI95-00044-01AI95-00044-01}
38379 {AI95-00150-01AI95-00150-01} {AI95-00377-01AI95-00377-01} A
38380 nonoverridable declaration is illegal if there is a homograph occurring
38381 immediately within the same declarative region that is visible at the
38382 place of the declaration, and is not hidden from all visibility by the
38383 nonoverridable declaration. In addition, a type extension is illegal if
38384 somewhere within its immediate scope it has two visible components with
38385 the same name. Similarly, the context_clause for a compilation unit is
38386 illegal if it mentions (in a with_clause) some library unit, and there
38387 is a homograph of the library unit that is visible at the place of the
38388 compilation unit, and the homograph and the mentioned library unit are
38389 both declared immediately within the same declarative region. These
38390 rules also apply to dispatching operations declared in the visible part
38391 of an instance of a generic unit. However, they do not apply to other
38392 overloadable declarations in an instance[; such declarations may have
38393 type conformant profiles in the instance, so long as the corresponding
38394 declarations in the generic were not type conformant].
38395
38396 26.a
38397 Discussion: Normally, these rules just mean you can't
38398 explicitly declare two homographs immediately within the same
38399 declarative region. The wording is designed to handle the
38400 following special cases:
38401
38402 26.b
38403 * If the second declaration completes the first one, the
38404 second declaration is legal.
38405
38406 26.c
38407 * If the body of a library unit contains an explicit
38408 homograph of a child of that same library unit, this is
38409 illegal only if the body mentions the child in its
38410 context_clause, or if some subunit mentions the child.
38411 Here's an example:
38412
38413 26.d
38414 package P is
38415 end P;
38416
38417 26.e
38418 package P.Q is
38419 end P.Q;
38420
38421 26.f
38422 package body P is
38423 Q : Integer; -- OK; we cannot see package P.Q here.
38424 procedure Sub is separate;
38425 end P;
38426
38427 26.g
38428 with P.Q;
38429 separate(P)
38430 procedure Sub is -- Illegal.
38431 begin
38432 null;
38433 end Sub;
38434
38435 26.h
38436 If package body P said "with P.Q;", then it would be
38437 illegal to declare the homograph Q: Integer. But it does
38438 not, so the body of P is OK. However, the subunit would
38439 be able to see both P.Q's, and is therefore illegal.
38440
38441 26.i
38442 A previous version of Ada 9X allowed the subunit, and
38443 said that references to P.Q would tend to be ambiguous.
38444 However, that was a bad idea, because it requires
38445 overload resolution to resolve references to directly
38446 visible nonoverloadable homographs, which is something
38447 compilers have never before been required to do.
38448
38449 26.i.1/1
38450 * {8652/00268652/0026} {8652/01028652/0102}
38451 {AI95-00150-01AI95-00150-01} {AI95-00157-01AI95-00157-01}
38452 If a type extension contains a component with the same
38453 name as a component in an ancestor type, there must be no
38454 place where both components are visible. For instance:
38455
38456 26.i.2/1
38457 package A is
38458 type T is tagged private;
38459 package B is
38460 type NT is new T with record
38461 I: Integer; -- Illegal because T.I is visible in the body.
38462 end record; -- T.I is not visible here.
38463 end B;
38464 private
38465 type T is tagged record
38466 I: Integer; -- Illegal because T.I is visible in the body.
38467 end record;
38468 end A;
38469
38470 26.i.3/2
38471 {AI95-00114-01AI95-00114-01} package body A is
38472 package body B is
38473 -- T.I becomes visible here.
38474 end B;
38475 end A;
38476
38477 26.i.4/1
38478 package A.C is
38479 type NT2 is new A.T with record
38480 I: Integer; -- Illegal because T.I is visible in the private part.
38481 end record; -- T.I is not visible here.
38482 private
38483 -- T.I is visible here.
38484 end A.C;
38485
38486 26.i.5/1
38487 with A;
38488 package D is
38489 type NT3 is new A.T with record
38490 I: Integer; -- Legal because T.I is never visible in this package.
38491 end record;
38492 end D;
38493
38494 26.i.6/1
38495 with D;
38496 package A.E is
38497 type NT4 is new D.NT3 with null record;
38498 X : NT4;
38499 I1 : Integer := X.I; -- D.NT3.I
38500 I2 : Integer := D.NT3(X).I; -- D.NT3.I
38501 I3 : Integer := A.T(X).I; -- A.T.I
38502 end A.E;
38503
38504 26.i.7/1
38505 {8652/01028652/0102} {AI95-00157-01AI95-00157-01} D.NT3
38506 can have a component I because the component I of the
38507 parent type is never visible. The parent component
38508 exists, of course, but is never declared for the type
38509 D.NT3. In the child package A.E, the component I of A.T
38510 is visible, but that does not change the fact that the
38511 A.T.I component was never declared for type D.NT3. Thus,
38512 A.E.NT4 does not (visibly) inherit the component I from
38513 A.T, while it does inherit the component I from D.NT3.
38514 Of course, both components exist, and can be accessed by
38515 a type conversion as shown above. This behavior stems
38516 from the fact that every characteristic of a type
38517 (including components) must be declared somewhere in the
38518 innermost declarative region containing the type -- if
38519 the characteristic is never visible in that declarative
38520 region, it is never declared. Therefore, such
38521 characteristics do not suddenly become available even if
38522 they are in fact visible in some other scope. See *note
38523 7.3.1:: for more on the rules.
38524
38525 26.i.8/2
38526 * {AI95-00377-01AI95-00377-01} It is illegal to mention
38527 both an explicit child of an instance, and a child of the
38528 generic from which the instance was instantiated. This
38529 is easier to understand with an example:
38530
38531 26.i.9/2
38532 generic
38533 package G1 is
38534 end G1;
38535
38536 26.i.10/2
38537 generic
38538 package G1.G2 is
38539 end G1.G2;
38540
38541 26.i.11/2
38542 with G1;
38543 package I1 is new G1;
38544
38545 26.i.12/2
38546 package I1.G2 renames ...
38547
38548 26.i.13/2
38549 with G1.G2;
38550 with I1.G2; -- Illegal
38551 package Bad is ...
38552
38553 26.i.14/2
38554 The context clause for Bad is illegal as I1 has an
38555 implicit declaration of I1.G2 based on the generic child
38556 G1.G2, as well as the mention of the explicit child
38557 I1.G2. As in the previous cases, this is illegal only if
38558 the context clause makes both children visible; the
38559 explicit child can be mentioned as long as the generic
38560 child is not (and vice-versa).
38561
38562 26.j
38563 Note that we need to be careful which things we make "hidden
38564 from all visibility" versus which things we make simply
38565 illegal for names to denote. The distinction is subtle. The
38566 rules that disallow names denoting components within a type
38567 declaration (see *note 3.7::) do not make the components
38568 invisible at those places, so that the above rule makes
38569 components with the same name illegal. The same is true for
38570 the rule that disallows names denoting formal parameters
38571 within a formal_part (see *note 6.1::).
38572
38573 26.k
38574 Discussion: The part about instances is from AI83-00012. The
38575 reason it says "overloadable declarations" is because we don't
38576 want it to apply to type extensions that appear in an
38577 instance; components are not overloadable.
38578
38579 NOTES
38580
38581 27
38582 5 Visibility for compilation units follows from the definition of
38583 the environment in *note 10.1.4::, except that it is necessary to
38584 apply a with_clause to obtain visibility to a
38585 library_unit_declaration or library_unit_renaming_declaration.
38586
38587 28
38588 6 In addition to the visibility rules given above, the meaning of
38589 the occurrence of a direct_name or selector_name at a given place
38590 in the text can depend on the overloading rules (see *note 8.6::).
38591
38592 29
38593 7 Not all contexts where an identifier, character_literal, or
38594 operator_symbol are allowed require visibility of a corresponding
38595 declaration. Contexts where visibility is not required are
38596 identified by using one of these three syntactic categories
38597 directly in a syntax rule, rather than using direct_name or
38598 selector_name.
38599
38600 29.a
38601 Ramification: An identifier, character_literal or
38602 operator_symbol that occurs in one of the following contexts
38603 is not required to denote a visible or directly visible
38604 declaration:
38605
38606 29.b
38607 1. A defining name.
38608
38609 29.c
38610 2. The identifiers or operator_symbol that appear after
38611 the reserved word end in a proper_body. Similarly for
38612 "end loop", etc.
38613
38614 29.d
38615 3. An attribute_designator.
38616
38617 29.e
38618 4. A pragma identifier.
38619
38620 29.f
38621 5. A pragma_argument_identifier.
38622
38623 29.g
38624 6. An identifier specific to a pragma used in a pragma
38625 argument.
38626
38627 29.g.1/3
38628 7. {AI05-0183-1AI05-0183-1} An aspect_mark;
38629
38630 29.g.2/3
38631 8. {AI05-0183-1AI05-0183-1} An identifier specific to an
38632 aspect used in an aspect_definition.
38633
38634 29.h
38635 The visibility rules have nothing to do with the above cases;
38636 the meanings of such things are defined elsewhere. Reserved
38637 words are not identifiers; the visibility rules don't apply to
38638 them either.
38639
38640 29.i
38641 Because of the way we have defined "declaration", it is
38642 possible for a usage name to denote a subprogram_body, either
38643 within that body, or (for a nonlibrary unit) after it (since
38644 the body hides the corresponding declaration, if any). Other
38645 bodies do not work that way. Completions of type_declarations
38646 and deferred constant declarations do work that way.
38647 Accept_statements are never denoted, although the
38648 parameter_specifications in their profiles can be.
38649
38650 29.j
38651 The scope of a subprogram does not start until after its
38652 profile. Thus, the following is legal:
38653
38654 29.k
38655 X : constant Integer := 17;
38656 ...
38657 package P is
38658 procedure X(Y : in Integer := X);
38659 end P;
38660
38661 29.l
38662 The body of the subprogram will probably be illegal, however,
38663 since the constant X will be hidden by then.
38664
38665 29.m
38666 The rule is different for generic subprograms, since they are
38667 not overloadable; the following is illegal:
38668
38669 29.n
38670 X : constant Integer := 17;
38671 package P is
38672 generic
38673 Z : Integer := X; -- Illegal!
38674 procedure X(Y : in Integer := X); -- Illegal!
38675 end P;
38676
38677 29.o
38678 The constant X is hidden from direct visibility by the generic
38679 declaration.
38680
38681 _Extensions to Ada 83_
38682
38683 29.p
38684 Declarations with the same defining name as that of a
38685 subprogram or entry being defined are nevertheless visible
38686 within the subprogram specification or entry declaration.
38687
38688 _Wording Changes from Ada 83_
38689
38690 29.q
38691 The term "visible by selection" is no longer defined. We use
38692 the terms "directly visible" and "visible" (among other
38693 things). There are only two regions of text that are of
38694 interest, here: the region in which a declaration is visible,
38695 and the region in which it is directly visible.
38696
38697 29.r
38698 Visibility is defined only for declarations.
38699
38700 _Incompatibilities With Ada 95_
38701
38702 29.s/2
38703 {AI95-00251-01AI95-00251-01} Added rules to handle the
38704 inheritance and overriding of multiple homographs for a single
38705 type declaration, in order to support multiple inheritance
38706 from interfaces. The new rules are intended to be compatible
38707 with the existing rules so that programs that do not use
38708 interfaces do not change their legality. However, there is a
38709 very rare case where this is not true:
38710
38711 29.t/2
38712 generic
38713 type T1 is private;
38714 type T2 is private;
38715 package G is
38716 type T is null record;
38717 procedure P (X : T; Y : T1);
38718 procedure P (X : T; Z : T2);
38719 end G;]
38720
38721 29.u/2
38722 package I is new G (Integer, Integer); -- Exports homographs of P.
38723
38724 29.v/2
38725 type D is new I.T; -- Both Ps are inherited.
38726
38727 29.w/2
38728 Obj : D;
38729
38730 29.x/2
38731 P (Obj, Z => 10); -- Legal in Ada 95, illegal in Ada 2005.
38732
38733 29.y/2
38734 The call to P would resolve in Ada 95 by using the parameter
38735 name, while the procedures P would be hidden from all
38736 visibility in Ada 2005 and thus would not resolve. This case
38737 doesn't seem worth making the rules any more complex than they
38738 already are.
38739
38740 29.z/2
38741 {AI95-00377-01AI95-00377-01} Amendment Correction: A
38742 with_clause is illegal if it would create a homograph of an
38743 implicitly declared generic child (see *note 10.1.1::). An
38744 Ada 95 compiler could have allowed this, but which unit of the
38745 two units involved would be denoted wasn't specified, so any
38746 successful use isn't portable. Removing one of the two
38747 with_clauses involved will fix the problem.
38748
38749 _Wording Changes from Ada 95_
38750
38751 29.aa/2
38752 {8652/00258652/0025} {AI95-00044-01AI95-00044-01} Corrigendum:
38753 Clarified the overriding rules so that "/=" and
38754 statement_identifiers are covered.
38755
38756 29.bb/2
38757 {8652/00268652/0026} {AI95-00150-01AI95-00150-01} Corrigendum:
38758 Clarified that is it never possible for two components with
38759 the same name to be visible; any such program is illegal.
38760
38761 29.cc/2
38762 {AI95-00195-01AI95-00195-01} {AI95-00408-01AI95-00408-01} The
38763 visibility of an attribute_definition_clause is defined so
38764 that it can be used by the stream attribute availability rules
38765 (see *note 13.13.2::).
38766
38767 29.dd/2
38768 {AI95-00217-06AI95-00217-06} The visibility of a limited view
38769 of a library package is defined (see *note 10.1.1::).
38770
38771 _Wording Changes from Ada 2005_
38772
38773 29.ee/3
38774 {AI05-0177-1AI05-0177-1} Added wording so that the parameters
38775 of an expression_function_declaration (*note 6.8: S0189.) are
38776 visible in the expression of the function. (It would be
38777 pretty useless without such a rule.)
38778
38779 29.ff/3
38780 {AI05-0183-1AI05-0183-1} The visibility of an
38781 aspect_specification is defined so that it can be used in
38782 various other rules.
38783
38784 * Menu:
38785
38786 * 8.3.1 :: Overriding Indicators
38787
38788 \1f
38789 File: aarm2012.info, Node: 8.3.1, Up: 8.3
38790
38791 8.3.1 Overriding Indicators
38792 ---------------------------
38793
38794 1/2
38795 {AI95-00218-03AI95-00218-03} An overriding_indicator is used to declare
38796 that an operation is intended to override (or not override) an inherited
38797 operation.
38798
38799 _Syntax_
38800
38801 2/2
38802 {AI95-00218-03AI95-00218-03} overriding_indicator ::=
38803 [not] overriding
38804
38805 _Legality Rules_
38806
38807 3/3
38808 {AI95-00218-03AI95-00218-03} {AI95-00348-01AI95-00348-01}
38809 {AI95-00397-01AI95-00397-01} {AI05-0177-1AI05-0177-1} If an
38810 abstract_subprogram_declaration (*note 3.9.3: S0076.),
38811 null_procedure_declaration (*note 6.7: S0188.),
38812 expression_function_declaration (*note 6.8: S0189.), subprogram_body,
38813 subprogram_body_stub (*note 10.1.3: S0259.),
38814 subprogram_renaming_declaration (*note 8.5.4: S0203.),
38815 generic_instantiation (*note 12.3: S0275.) of a subprogram, or
38816 subprogram_declaration (*note 6.1: S0163.) other than a protected
38817 subprogram has an overriding_indicator (*note 8.3.1: S0195.), then:
38818
38819 4/2
38820 * the operation shall be a primitive operation for some type;
38821
38822 5/2
38823 * if the overriding_indicator is overriding, then the operation shall
38824 override a homograph at the place of the declaration or body;
38825
38826 5.a/3
38827 To be honest: {AI05-0005-1AI05-0005-1} This doesn't require
38828 that the overriding happen at precisely the place of the
38829 declaration or body; it only requires that the region in which
38830 the overriding is known to have happened includes this place.
38831 That is, the overriding can happen at or before the place of
38832 the declaration or body.
38833
38834 6/2
38835 * if the overriding_indicator is not overriding, then the operation
38836 shall not override any homograph (at any place).
38837
38838 7/2
38839 In addition to the places where Legality Rules normally apply, these
38840 rules also apply in the private part of an instance of a generic unit.
38841
38842 7.a/2
38843 Discussion: The overriding and not overriding rules differ
38844 slightly. For overriding, we want the indicator to reflect
38845 the overriding state at the place of the declaration;
38846 otherwise the indicator would be "lying". Whether a homograph
38847 is implicitly declared after the declaration (see 7.3.1 to see
38848 how this can happen) has no impact on this check. However,
38849 not overriding is different; "lying" would happen if a
38850 homograph declared later actually is overriding. So, we
38851 require this check to take into account later overridings.
38852 That can be implemented either by looking ahead, or by
38853 rechecking when additional operations are declared.
38854
38855 7.b/2
38856 The "no lying" rules are needed to prevent a
38857 subprogram_declaration and subprogram_body from having
38858 contradictory overriding_indicators.
38859
38860 NOTES
38861
38862 8/2
38863 8 {AI95-00397-01AI95-00397-01} Rules for overriding_indicators of
38864 task and protected entries and of protected subprograms are found
38865 in *note 9.5.2:: and *note 9.4::, respectively.
38866
38867 _Examples_
38868
38869 9/2
38870 {AI95-00433-01AI95-00433-01} The use of overriding_indicators allows the
38871 detection of errors at compile-time that otherwise might not be detected
38872 at all. For instance, we might declare a security queue derived from
38873 the Queue interface of 3.9.4 as:
38874
38875 10/2
38876 type Security_Queue is new Queue with record ...;
38877
38878 11/2
38879 overriding
38880 procedure Append(Q : in out Security_Queue; Person : in Person_Name);
38881
38882 12/2
38883 overriding
38884 procedure Remove_First(Q : in out Security_Queue; Person : in Person_Name);
38885
38886 13/2
38887 overriding
38888 function Cur_Count(Q : in Security_Queue) return Natural;
38889
38890 14/2
38891 overriding
38892 function Max_Count(Q : in Security_Queue) return Natural;
38893
38894 15/2
38895 not overriding
38896 procedure Arrest(Q : in out Security_Queue; Person : in Person_Name);
38897
38898 16/2
38899 The first four subprogram declarations guarantee that these subprograms
38900 will override the four subprograms inherited from the Queue interface.
38901 A misspelling in one of these subprograms will be detected by the
38902 implementation. Conversely, the declaration of Arrest guarantees that
38903 this is a new operation.
38904
38905 16.a/2
38906 Discussion: In this case, the subprograms are abstract, so
38907 misspellings will get detected anyway. But for other
38908 subprograms (especially when deriving from concrete types),
38909 the error might never be detected, and a body other than the
38910 one the programmer intended might be executed without warning.
38911 Thus our new motto: "Overriding indicators -- don't derive a
38912 type without them!"
38913
38914 _Extensions to Ada 95_
38915
38916 16.b/2
38917 {AI95-00218-03AI95-00218-03} Overriding_indicators are new.
38918 These let the programmer state her overriding intentions to
38919 the compiler; if the compiler disagrees, an error will be
38920 produced rather than a hard to find bug.
38921
38922 _Wording Changes from Ada 2005_
38923
38924 16.c/3
38925 {AI95-0177-1AI95-0177-1} Expression functions can have
38926 overriding indicators.
38927
38928 \1f
38929 File: aarm2012.info, Node: 8.4, Next: 8.5, Prev: 8.3, Up: 8
38930
38931 8.4 Use Clauses
38932 ===============
38933
38934 1
38935 [A use_package_clause achieves direct visibility of declarations that
38936 appear in the visible part of a package; a use_type_clause achieves
38937 direct visibility of the primitive operators of a type.]
38938
38939 _Language Design Principles_
38940
38941 1.a
38942 If and only if the visibility rules allow P.A, "use P;" should
38943 make A directly visible (barring name conflicts). This means,
38944 for example, that child library units, and generic formals of
38945 a formal package whose formal_package_actual_part is (<>),
38946 should be made visible by a use_clause for the appropriate
38947 package.
38948
38949 1.b
38950 The rules for use_clauses were carefully constructed to avoid
38951 so-called Beaujolais effects, where the addition or removal of
38952 a single use_clause, or a single declaration in a "use"d
38953 package, would change the meaning of a program from one legal
38954 interpretation to another.
38955
38956 _Syntax_
38957
38958 2
38959 use_clause ::= use_package_clause | use_type_clause
38960
38961 3
38962 use_package_clause ::= use package_name {, package_name};
38963
38964 4/3
38965 {AI05-0150-1AI05-0150-1} use_type_clause ::= use [all] type
38966 subtype_mark {, subtype_mark};
38967
38968 _Legality Rules_
38969
38970 5/2
38971 {AI95-00217-06AI95-00217-06} A package_name of a use_package_clause
38972 shall denote a nonlimited view of a package.
38973
38974 5.a
38975 Ramification: This includes formal packages.
38976
38977 _Static Semantics_
38978
38979 6
38980 For each use_clause, there is a certain region of text called the scope
38981 of the use_clause. For a use_clause within a context_clause of a
38982 library_unit_declaration or library_unit_renaming_declaration, the scope
38983 is the entire declarative region of the declaration. For a use_clause
38984 within a context_clause of a body, the scope is the entire body [and any
38985 subunits (including multiply nested subunits). The scope does not
38986 include context_clauses themselves.]
38987
38988 7
38989 For a use_clause immediately within a declarative region, the scope is
38990 the portion of the declarative region starting just after the use_clause
38991 and extending to the end of the declarative region. However, the scope
38992 of a use_clause in the private part of a library unit does not include
38993 the visible part of any public descendant of that library unit.
38994
38995 7.a
38996 Reason: The exception echoes the similar exception for
38997 "immediate scope (of a declaration)" (see *note 8.2::). It
38998 makes use_clauses work like this:
38999
39000 7.b
39001 package P is
39002 type T is range 1..10;
39003 end P;
39004
39005 7.c
39006 with P;
39007 package Parent is
39008 private
39009 use P;
39010 X : T;
39011 end Parent;
39012
39013 7.d
39014 package Parent.Child is
39015 Y : T; -- Illegal!
39016 Z : P.T;
39017 private
39018 W : T;
39019 end Parent.Child;
39020
39021 7.e
39022 The declaration of Y is illegal because the scope of the "use
39023 P" does not include that place, so T is not directly visible
39024 there. The declarations of X, Z, and W are legal.
39025
39026 7.1/2
39027 {AI95-00217-06AI95-00217-06} A package is named in a use_package_clause
39028 if it is denoted by a package_name of that clause. A type is named in a
39029 use_type_clause if it is determined by a subtype_mark of that clause.
39030
39031 8/3
39032 {AI95-00217-06AI95-00217-06} {AI05-0150-1AI05-0150-1} For each package
39033 named in a use_package_clause whose scope encloses a place, each
39034 declaration that occurs immediately within the declarative region of the
39035 package is potentially use-visible at this place if the declaration is
39036 visible at this place. For each type T or T'Class named in a
39037 use_type_clause whose scope encloses a place, the declaration of each
39038 primitive operator of type T is potentially use-visible at this place if
39039 its declaration is visible at this place. If a use_type_clause whose
39040 scope encloses a place includes the reserved word all, then the
39041 following entities are also potentially use-visible at this place if the
39042 declaration of the entity is visible at this place:
39043
39044 8.1/3
39045 * {AI05-0150-1AI05-0150-1} Each primitive subprogram of T including
39046 each enumeration literal (if any);
39047
39048 8.2/3
39049 * {AI05-0150-1AI05-0150-1} Each subprogram that is declared
39050 immediately within the declarative region in which an ancestor type
39051 of T is declared and that operates on a class-wide type that covers
39052 T.
39053
39054 8.a/3
39055 Ramification: {AI05-0150-1AI05-0150-1} Primitive subprograms
39056 whose defining name is an identifier are not made potentially
39057 visible by a use_type_clause unless reserved word all is
39058 included. A use_type_clause without all is only for
39059 operators.
39060
39061 8.b
39062 The semantics described here should be similar to the
39063 semantics for expanded names given in *note 4.1.3::, "*note
39064 4.1.3:: Selected Components" so as to achieve the effect
39065 requested by the "principle of equivalence of use_clauses and
39066 selected_components." Thus, child library units and generic
39067 formal parameters of a formal package are potentially
39068 use-visible when their enclosing package is use'd.
39069
39070 8.c
39071 The "visible at that place" part implies that applying a
39072 use_clause to a parent unit does not make all of its children
39073 use-visible -- only those that have been made visible by a
39074 with_clause. It also implies that we don't have to worry
39075 about hiding in the definition of "directly visible" -- a
39076 declaration cannot be use-visible unless it is visible.
39077
39078 8.d
39079 Note that "use type T'Class;" is equivalent to "use type T;",
39080 which helps avoid breaking the generic contract model.
39081
39082 8.3/3
39083 {AI05-0131-1AI05-0131-1} Certain implicit declarations may become
39084 potentially use-visible in certain contexts as described in *note
39085 12.6::.
39086
39087 9
39088 A declaration is use-visible if it is potentially use-visible, except in
39089 these naming-conflict cases:
39090
39091 10
39092 * A potentially use-visible declaration is not use-visible if the
39093 place considered is within the immediate scope of a homograph of
39094 the declaration.
39095
39096 11
39097 * Potentially use-visible declarations that have the same identifier
39098 are not use-visible unless each of them is an overloadable
39099 declaration.
39100
39101 11.a
39102 Ramification: Overloadable declarations don't cancel each
39103 other out, even if they are homographs, though if they are not
39104 distinguishable by formal parameter names or the presence or
39105 absence of default_expressions, any use will be ambiguous. We
39106 only mention identifiers here, because declarations named by
39107 operator_symbols are always overloadable, and hence never
39108 cancel each other. Direct visibility is irrelevant for
39109 character_literals.
39110
39111 _Dynamic Semantics_
39112
39113 12
39114 The elaboration of a use_clause has no effect.
39115
39116 _Examples_
39117
39118 13
39119 Example of a use clause in a context clause:
39120
39121 14
39122 with Ada.Calendar; use Ada;
39123
39124 15
39125 Example of a use type clause:
39126
39127 16
39128 use type Rational_Numbers.Rational; -- see *note 7.1::
39129 Two_Thirds: Rational_Numbers.Rational := 2/3;
39130
39131 16.a
39132 Ramification: In "use X, Y;", Y cannot refer to something made
39133 visible by the "use" of X. Thus, it's not (quite) equivalent
39134 to "use X; use Y;".
39135
39136 16.b
39137 If a given declaration is already immediately visible, then a
39138 use_clause that makes it potentially use-visible has no
39139 effect. Therefore, a use_type_clause for a type whose
39140 declaration appears in a place other than the visible part of
39141 a package has no effect; it cannot make a declaration
39142 use-visible unless that declaration is already immediately
39143 visible.
39144
39145 16.c
39146 "Use type S1;" and "use type S2;" are equivalent if S1 and S2
39147 are both subtypes of the same type. In particular, "use type
39148 S;" and "use type S'Base;" are equivalent.
39149
39150 16.d
39151 Reason: We considered adding a rule that prevented several
39152 declarations of views of the same entity that all have the
39153 same semantics from cancelling each other out. For example,
39154 if a (possibly implicit) subprogram_declaration for "+" is
39155 potentially use-visible, and a fully conformant renaming of it
39156 is also potentially use-visible, then they (annoyingly) cancel
39157 each other out; neither one is use-visible. The considered
39158 rule would have made just one of them use-visible. We gave up
39159 on this idea due to the complexity of the rule. It would have
39160 had to account for both overloadable and nonoverloadable
39161 renaming_declarations, the case where the rule should apply
39162 only to some subset of the declarations with the same defining
39163 name, and the case of subtype_declarations (since they are
39164 claimed to be sufficient for renaming of subtypes).
39165
39166 _Extensions to Ada 83_
39167
39168 16.e
39169 The use_type_clause is new to Ada 95.
39170
39171 _Wording Changes from Ada 83_
39172
39173 16.f
39174 The phrase "omitting from this set any packages that enclose
39175 this place" is no longer necessary to avoid making something
39176 visible outside its scope, because we explicitly state that
39177 the declaration has to be visible in order to be potentially
39178 use-visible.
39179
39180 _Wording Changes from Ada 95_
39181
39182 16.g/2
39183 {AI95-00217-06AI95-00217-06} Limited views of packages are not
39184 allowed in use clauses. Defined named in a use clause for use
39185 in other limited view rules (see *note 10.1.2::).
39186
39187 _Extensions to Ada 2005_
39188
39189 16.h/3
39190 {AI05-0150-1AI05-0150-1} The use all type version of the
39191 use_type_clause is new to Ada 2012. It works similarly to
39192 prefixed views.
39193
39194 _Wording Changes from Ada 2005_
39195
39196 16.i/3
39197 {AI05-0131-1AI05-0131-1} Correction: Added wording to allow
39198 other declarations to be potentially use-visible, to support
39199 corrections to formal subprograms.
39200
39201 \1f
39202 File: aarm2012.info, Node: 8.5, Next: 8.6, Prev: 8.4, Up: 8
39203
39204 8.5 Renaming Declarations
39205 =========================
39206
39207 1
39208 [A renaming_declaration declares another name for an entity, such as an
39209 object, exception, package, subprogram, entry, or generic unit.
39210 Alternatively, a subprogram_renaming_declaration can be the completion
39211 of a previous subprogram_declaration.]
39212
39213 1.a.1/2
39214 Glossary entry: A renaming_declaration is a declaration that
39215 does not define a new entity, but instead defines a view of an
39216 existing entity.
39217
39218 _Syntax_
39219
39220 2
39221 renaming_declaration ::=
39222 object_renaming_declaration
39223 | exception_renaming_declaration
39224 | package_renaming_declaration
39225 | subprogram_renaming_declaration
39226 | generic_renaming_declaration
39227
39228 _Dynamic Semantics_
39229
39230 3
39231 The elaboration of a renaming_declaration evaluates the name that
39232 follows the reserved word renames and thereby determines the view and
39233 entity denoted by this name (the renamed view and renamed entity). [A
39234 name that denotes the renaming_declaration denotes (a new view of) the
39235 renamed entity.]
39236
39237 NOTES
39238
39239 4
39240 9 Renaming may be used to resolve name conflicts and to act as a
39241 shorthand. Renaming with a different identifier or operator_symbol
39242 does not hide the old name; the new name and the old name need not
39243 be visible at the same places.
39244
39245 5
39246 10 A task or protected object that is declared by an explicit
39247 object_declaration can be renamed as an object. However, a single
39248 task or protected object cannot be renamed since the corresponding
39249 type is anonymous (meaning it has no nameable subtypes). For
39250 similar reasons, an object of an anonymous array or access type
39251 cannot be renamed.
39252
39253 6
39254 11 A subtype defined without any additional constraint can be used
39255 to achieve the effect of renaming another subtype (including a task
39256 or protected subtype) as in
39257
39258 7
39259 subtype Mode is Ada.Text_IO.File_Mode;
39260
39261 _Wording Changes from Ada 83_
39262
39263 7.a
39264 The second sentence of RM83-8.5(3), "At any point where a
39265 renaming declaration is visible, the identifier, or operator
39266 symbol of this declaration denotes the renamed entity." is
39267 incorrect. It doesn't say directly visible. Also, such an
39268 identifier might resolve to something else.
39269
39270 7.b
39271 The verbiage about renamings being legal "only if exactly
39272 one...", which appears in RM83-8.5(4) (for objects) and
39273 RM83-8.5(7) (for subprograms) is removed, because it follows
39274 from the normal rules about overload resolution. For language
39275 lawyers, these facts are obvious; for programmers, they are
39276 irrelevant, since failing these tests is highly unlikely.
39277
39278 * Menu:
39279
39280 * 8.5.1 :: Object Renaming Declarations
39281 * 8.5.2 :: Exception Renaming Declarations
39282 * 8.5.3 :: Package Renaming Declarations
39283 * 8.5.4 :: Subprogram Renaming Declarations
39284 * 8.5.5 :: Generic Renaming Declarations
39285
39286 \1f
39287 File: aarm2012.info, Node: 8.5.1, Next: 8.5.2, Up: 8.5
39288
39289 8.5.1 Object Renaming Declarations
39290 ----------------------------------
39291
39292 1
39293 [An object_renaming_declaration is used to rename an object.]
39294
39295 _Syntax_
39296
39297 2/3
39298 {AI95-00230-01AI95-00230-01} {AI95-00423-01AI95-00423-01}
39299 {AI05-0183-1AI05-0183-1} object_renaming_declaration ::=
39300 defining_identifier : [null_exclusion]
39301 subtype_mark renames object_name
39302 [aspect_specification];
39303 | defining_identifier : access_definition renames object_name
39304 [aspect_specification];
39305
39306 _Name Resolution Rules_
39307
39308 3/2
39309 {AI95-00230-01AI95-00230-01} {AI95-00254-01AI95-00254-01}
39310 {AI95-00409-01AI95-00409-01} The type of the object_name shall resolve
39311 to the type determined by the subtype_mark, or in the case where the
39312 type is defined by an access_definition, to an anonymous access type.
39313 If the anonymous access type is an access-to-object type, the type of
39314 the object_name shall have the same designated type as that of the
39315 access_definition. If the anonymous access type is an
39316 access-to-subprogram type, the type of the object_name shall have a
39317 designated profile that is type conformant with that of the
39318 access_definition.
39319
39320 3.a
39321 Reason: A previous version of Ada 9X used the usual "expected
39322 type" wording:
39323 "The expected type for the object_name is that determined by
39324 the subtype_mark."
39325 We changed it so that this would be illegal:
39326
39327 3.b
39328 X: T;
39329 Y: T'Class renames X; -- Illegal!
39330
39331 3.c
39332 When the above was legal, it was unclear whether Y was of type
39333 T or T'Class. Note that we still allow this:
39334
39335 3.d
39336 Z: T'Class := ...;
39337 W: T renames F(Z);
39338
39339 3.e
39340 where F is a function with a controlling parameter and result.
39341 This is admittedly a bit odd.
39342
39343 3.f
39344 Note that the matching rule for generic formal parameters of
39345 mode in out was changed to keep it consistent with the rule
39346 for renaming. That makes the rule different for in vs. in
39347 out.
39348
39349 _Legality Rules_
39350
39351 4
39352 The renamed entity shall be an object.
39353
39354 4.1/2
39355 {AI95-00231-01AI95-00231-01} {AI95-00409-01AI95-00409-01} In the case
39356 where the type is defined by an access_definition, the type of the
39357 renamed object and the type defined by the access_definition:
39358
39359 4.2/2
39360 * {AI95-00231-01AI95-00231-01} {AI95-00409-01AI95-00409-01} shall
39361 both be access-to-object types with statically matching designated
39362 subtypes and with both or neither being access-to-constant types;
39363 or
39364
39365 4.3/2
39366 * {AI95-00409-01AI95-00409-01} shall both be access-to-subprogram
39367 types with subtype conformant designated profiles.
39368
39369 4.4/2
39370 {AI95-00423-01AI95-00423-01} For an object_renaming_declaration with a
39371 null_exclusion or an access_definition that has a null_exclusion:
39372
39373 4.5/2
39374 * if the object_name denotes a generic formal object of a generic
39375 unit G, and the object_renaming_declaration occurs within the body
39376 of G or within the body of a generic unit declared within the
39377 declarative region of G, then the declaration of the formal object
39378 of G shall have a null_exclusion;
39379
39380 4.6/2
39381 * otherwise, the subtype of the object_name shall exclude null. In
39382 addition to the places where Legality Rules normally apply (see
39383 *note 12.3::), this rule applies also in the private part of an
39384 instance of a generic unit.
39385
39386 4.a/2
39387 Reason: This rule prevents "lying". Null must never be the
39388 value of an object with an explicit null_exclusion. The first
39389 bullet is an assume-the-worst rule which prevents trouble in
39390 one obscure case:
39391
39392 4.b/2
39393 type Acc_I is access Integer;
39394 subtype Acc_NN_I is not null Acc_I;
39395 Obj : Acc_I := null;
39396
39397 4.c/2
39398 generic
39399 B : in out Acc_NN_I;
39400 package Gen is
39401 ...
39402 end Gen;
39403
39404 4.d/2
39405 package body Gen is
39406 D : not null Acc_I renames B;
39407 end Gen;
39408
39409 4.e/2
39410 package Inst is new Gen (B => Obj);
39411
39412 4.f/2
39413 Without the first bullet rule, D would be legal, and contain
39414 the value null, because the rule about lying is satisfied for
39415 generic matching (Obj matches B; B does not explicitly state
39416 not null), Legality Rules are not rechecked in the body of any
39417 instance, and the template passes the lying rule as well. The
39418 rule is so complex because it has to apply to formals used in
39419 bodies of child generics as well as in the bodies of generics.
39420
39421 5/3
39422 {8652/00178652/0017} {AI95-00184-01AI95-00184-01}
39423 {AI95-00363-01AI95-00363-01} {AI05-0008-1AI05-0008-1} The renamed entity
39424 shall not be a subcomponent that depends on discriminants of an object
39425 whose nominal subtype is unconstrained unless the object is known to be
39426 constrained. A slice of an array shall not be renamed if this
39427 restriction disallows renaming of the array. In addition to the places
39428 where Legality Rules normally apply, these rules apply also in the
39429 private part of an instance of a generic unit.
39430
39431 5.a
39432 Reason: This prevents renaming of subcomponents that might
39433 disappear, which might leave dangling references. Similar
39434 restrictions exist for the Access attribute.
39435
39436 5.a.1/3
39437 {8652/00178652/0017} {AI95-00184-01AI95-00184-01}
39438 {AI05-0008-1AI05-0008-1} The "recheck on instantiation"
39439 requirement on generics is necessary to avoid renaming of
39440 components which could disappear even when the nominal subtype
39441 would prevent the problem:
39442
39443 5.a.2/1
39444 type T1 (D1 : Boolean) is
39445 record
39446 case D1 is
39447 when False =>
39448 C1 : Integer;
39449 when True =>
39450 null;
39451 end case;
39452 end record;
39453
39454 5.a.3/1
39455 generic
39456 type F is new T1;
39457 X : in out F;
39458 package G is
39459 C1_Ren : Integer renames X.C1;
39460 end G;
39461
39462 5.a.4/1
39463 type T2 (D2 : Boolean := False) is new T1 (D1 => D2);
39464
39465 Y : T2;
39466
39467 package I is new G (T2, Y);
39468
39469 Y := (D1 => True); -- Oops! What happened to I.C1_Ren?
39470
39471 5.a.5/3
39472 {AI05-0008-1AI05-0008-1} In addition, the "known to be
39473 constrained" rules include assume-the-worst rules for generic
39474 bodies partially to prevent such problems.
39475
39476 5.b
39477 Implementation Note: Note that if an implementation chooses to
39478 deallocate-then-reallocate on assignment_statement (*note 5.2:
39479 S0152.)s assigning to unconstrained definite objects, then it
39480 cannot represent renamings and access values as simple
39481 addresses, because the above rule does not apply to all
39482 components of such an object.
39483
39484 5.c
39485 Ramification: If it is a generic formal object, then the
39486 assume-the-best or assume-the-worst rules are applied as
39487 appropriate.
39488
39489 _Static Semantics_
39490
39491 6/2
39492 {AI95-00230-01AI95-00230-01} {AI95-00409-01AI95-00409-01} An
39493 object_renaming_declaration declares a new view [of the renamed object]
39494 whose properties are identical to those of the renamed view. [Thus, the
39495 properties of the renamed object are not affected by the
39496 renaming_declaration. In particular, its value and whether or not it is
39497 a constant are unaffected; similarly, the null exclusion or constraints
39498 that apply to an object are not affected by renaming (any constraint
39499 implied by the subtype_mark or access_definition of the
39500 object_renaming_declaration is ignored).]
39501
39502 6.a
39503 Discussion: Because the constraints are ignored, it is a good
39504 idea to use the nominal subtype of the renamed object when
39505 writing an object_renaming_declaration.
39506
39507 6.b/2
39508 {AI95-00409-01AI95-00409-01} If no null_exclusion is given in
39509 the renaming, the object may or may not exclude null. This is
39510 similar to the way that constraints need not match, and
39511 constant is not specified. The renaming defines a view of the
39512 renamed entity, inheriting the original properties.
39513
39514 _Examples_
39515
39516 7
39517 Example of renaming an object:
39518
39519 8
39520 declare
39521 L : Person renames Leftmost_Person; -- see *note 3.10.1::
39522 begin
39523 L.Age := L.Age + 1;
39524 end;
39525
39526 _Wording Changes from Ada 83_
39527
39528 8.a
39529 The phrase "subtype ... as defined in a corresponding object
39530 declaration, component declaration, or component subtype
39531 indication," from RM83-8.5(5), is incorrect in Ada 95;
39532 therefore we removed it. It is incorrect in the case of an
39533 object with an indefinite unconstrained nominal subtype.
39534
39535 _Incompatibilities With Ada 95_
39536
39537 8.b/2
39538 {AI95-00363-01AI95-00363-01} Aliased variables are not
39539 necessarily constrained in Ada 2005 (see *note 3.6::).
39540 Therefore, a subcomponent of an aliased variable may disappear
39541 or change shape, and renaming such a subcomponent thus is
39542 illegal, while the same operation would have been legal in Ada
39543 95. Note that most allocated objects are still constrained by
39544 their initial value (see *note 4.8::), and thus have no change
39545 in the legality of renaming for them. For example, using the
39546 type T2 of the previous example:
39547
39548 8.c/2
39549 AT2 : aliased T2;
39550 C1_Ren : Integer renames AT2.C1; -- Illegal in Ada 2005, legal in Ada 95
39551 AT2 := (D1 => True); -- Raised Constraint_Error in Ada 95,
39552 -- but does not in Ada 2005, so C1_Ren becomes
39553 -- invalid when this is assigned.
39554
39555 _Extensions to Ada 95_
39556
39557 8.d/2
39558 {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01}
39559 {AI95-00254-01AI95-00254-01} {AI95-00409-01AI95-00409-01} A
39560 renaming can have an anonymous access type. In that case, the
39561 accessibility of the renaming is that of the original object
39562 (accessibility is not lost as it is for assignment to a
39563 component or stand-alone object).
39564
39565 8.e/2
39566 {AI95-00231-01AI95-00231-01} {AI95-00423-01AI95-00423-01} A
39567 renaming can have a null_exclusion; if so, the renamed object
39568 must also exclude null, so that the null_exclusion does not
39569 lie. On the other hand, if the renaming does not have a
39570 null_exclusion. it excludes null if the renamed object does.
39571
39572 _Wording Changes from Ada 95_
39573
39574 8.f/2
39575 {8652/00178652/0017} {AI95-00184-01AI95-00184-01} Corrigendum:
39576 Fixed to forbid renamings of depends-on-discriminant
39577 components if the type might be definite.
39578
39579 _Incompatibilities With Ada 2005_
39580
39581 8.g/3
39582 {AI05-0008-1AI05-0008-1} Correction: Simplified the
39583 description of when a discriminant-dependent component is
39584 allowed to be renamed -- it's now simply when the object is
39585 known to be constrained. This fixes a confusion as to whether
39586 a subcomponent of an object that is not certain to be
39587 constrained can be renamed. The fix introduces an
39588 incompatibility, as the rule did not apply in Ada 95 if the
39589 prefix was a constant; but it now applies no matter what kind
39590 of object is involved. The incompatibility is not too bad,
39591 since most kinds of constants are known to be constrained.
39592
39593 _Extensions to Ada 2005_
39594
39595 8.h/3
39596 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
39597 be used in an object_renaming_declaration. This is described
39598 in *note 13.1.1::.
39599
39600 \1f
39601 File: aarm2012.info, Node: 8.5.2, Next: 8.5.3, Prev: 8.5.1, Up: 8.5
39602
39603 8.5.2 Exception Renaming Declarations
39604 -------------------------------------
39605
39606 1
39607 [An exception_renaming_declaration is used to rename an exception.]
39608
39609 _Syntax_
39610
39611 2/3
39612 {AI05-0183-1AI05-0183-1} exception_renaming_declaration ::=
39613 defining_identifier : exception renames exception_name
39614 [aspect_specification];
39615
39616 _Legality Rules_
39617
39618 3
39619 The renamed entity shall be an exception.
39620
39621 _Static Semantics_
39622
39623 4
39624 An exception_renaming_declaration declares a new view [of the renamed
39625 exception].
39626
39627 _Examples_
39628
39629 5
39630 Example of renaming an exception:
39631
39632 6
39633 EOF : exception renames Ada.IO_Exceptions.End_Error; -- see *note A.13::
39634
39635 _Extensions to Ada 2005_
39636
39637 6.a/3
39638 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
39639 be used in an exception_renaming_declaration. This is
39640 described in *note 13.1.1::.
39641
39642 \1f
39643 File: aarm2012.info, Node: 8.5.3, Next: 8.5.4, Prev: 8.5.2, Up: 8.5
39644
39645 8.5.3 Package Renaming Declarations
39646 -----------------------------------
39647
39648 1
39649 [A package_renaming_declaration is used to rename a package.]
39650
39651 _Syntax_
39652
39653 2/3
39654 {AI05-0183-1AI05-0183-1} package_renaming_declaration ::= package
39655 defining_program_unit_name renames package_name
39656 [aspect_specification];
39657
39658 _Legality Rules_
39659
39660 3
39661 The renamed entity shall be a package.
39662
39663 3.1/2
39664 {AI95-00217-06AI95-00217-06} {AI95-00412-01AI95-00412-01} If the
39665 package_name of a package_renaming_declaration denotes a limited view of
39666 a package P, then a name that denotes the package_renaming_declaration
39667 shall occur only within the immediate scope of the renaming or the scope
39668 of a with_clause that mentions the package P or, if P is a nested
39669 package, the innermost library package enclosing P.
39670
39671 3.a.1/2
39672 Discussion: The use of a renaming that designates a limited
39673 view is restricted to locations where we know whether the view
39674 is limited or nonlimited (based on a with_clause). We don't
39675 want to make an implicit limited view, as those are not
39676 transitive like a regular view. Implementations should be
39677 able to see all limited views needed based on the
39678 context_clause.
39679
39680 _Static Semantics_
39681
39682 4
39683 A package_renaming_declaration declares a new view [of the renamed
39684 package].
39685
39686 4.1/2
39687 {AI95-00412-01AI95-00412-01} [At places where the declaration of the
39688 limited view of the renamed package is visible, a name that denotes the
39689 package_renaming_declaration denotes a limited view of the package (see
39690 *note 10.1.1::).]
39691
39692 4.a.1/2
39693 Proof: This rule is found in *note 8.3::, "*note 8.3::
39694 Visibility".
39695
39696 _Examples_
39697
39698 5
39699 Example of renaming a package:
39700
39701 6
39702 package TM renames Table_Manager;
39703
39704 _Wording Changes from Ada 95_
39705
39706 6.a/2
39707 {AI95-00217-06AI95-00217-06} {AI95-00412-01AI95-00412-01} Uses
39708 of renamed limited views of packages can only be used within
39709 the scope of a with_clause for the renamed package.
39710
39711 _Extensions to Ada 2005_
39712
39713 6.b/3
39714 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
39715 be used in a package_renaming_declaration. This is described
39716 in *note 13.1.1::.
39717
39718 \1f
39719 File: aarm2012.info, Node: 8.5.4, Next: 8.5.5, Prev: 8.5.3, Up: 8.5
39720
39721 8.5.4 Subprogram Renaming Declarations
39722 --------------------------------------
39723
39724 1/3
39725 {AI05-0299-1AI05-0299-1} A subprogram_renaming_declaration can serve as
39726 the completion of a subprogram_declaration; such a renaming_declaration
39727 is called a renaming-as-body. A subprogram_renaming_declaration that is
39728 not a completion is called a renaming-as-declaration[, and is used to
39729 rename a subprogram (possibly an enumeration literal) or an entry].
39730
39731 1.a/3
39732 Ramification: {AI05-0299-1AI05-0299-1} A renaming-as-body is a
39733 declaration, as defined in Clause *note 3::.
39734
39735 _Syntax_
39736
39737 2/3
39738 {AI95-00218-03AI95-00218-03} {AI05-0183-1AI05-0183-1}
39739 subprogram_renaming_declaration ::=
39740 [overriding_indicator]
39741 subprogram_specification renames callable_entity_name
39742 [aspect_specification];
39743
39744 _Name Resolution Rules_
39745
39746 3
39747 The expected profile for the callable_entity_name is the profile given
39748 in the subprogram_specification.
39749
39750 _Legality Rules_
39751
39752 4/3
39753 {AI05-0239-1AI05-0239-1} The profile of a renaming-as-declaration shall
39754 be mode conformant, with that of the renamed callable entity.
39755
39756 4.1/2
39757 {AI95-00423-01AI95-00423-01} For a parameter or result subtype of the
39758 subprogram_specification that has an explicit null_exclusion:
39759
39760 4.2/2
39761 * if the callable_entity_name denotes a generic formal subprogram of
39762 a generic unit G, and the subprogram_renaming_declaration occurs
39763 within the body of a generic unit G or within the body of a generic
39764 unit declared within the declarative region of the generic unit G,
39765 then the corresponding parameter or result subtype of the formal
39766 subprogram of G shall have a null_exclusion;
39767
39768 4.3/2
39769 * otherwise, the subtype of the corresponding parameter or result
39770 type of the renamed callable entity shall exclude null. In
39771 addition to the places where Legality Rules normally apply (see
39772 *note 12.3::), this rule applies also in the private part of an
39773 instance of a generic unit.
39774
39775 4.a/2
39776 Reason: This rule prevents "lying". Null must never be the
39777 value of a parameter or result with an explicit
39778 null_exclusion. The first bullet is an assume-the-worst rule
39779 which prevents trouble in generic bodies (including bodies of
39780 child units) when the formal subtype excludes null implicitly.
39781
39782 5/3
39783 {8652/00278652/0027} {8652/00288652/0028} {AI95-00135-01AI95-00135-01}
39784 {AI95-00145-01AI95-00145-01} {AI05-0239-1AI05-0239-1} The profile of a
39785 renaming-as-body shall conform fully to that of the declaration it
39786 completes. If the renaming-as-body completes that declaration before
39787 the subprogram it declares is frozen, the profile shall be mode
39788 conformant with that of the renamed callable entity and the subprogram
39789 it declares takes its convention from the renamed subprogram; otherwise,
39790 the profile shall be subtype conformant with that of the renamed
39791 callable entity and the convention of the renamed subprogram shall not
39792 be Intrinsic. A renaming-as-body is illegal if the declaration occurs
39793 before the subprogram whose declaration it completes is frozen, and the
39794 renaming renames the subprogram itself, through one or more subprogram
39795 renaming declarations, none of whose subprograms has been frozen.
39796
39797 5.a/1
39798 Reason: The otherwise part of the second sentence is to allow
39799 an implementation of a renaming-as-body as a single jump
39800 instruction to the target subprogram. Among other things,
39801 this prevents a subprogram from being completed with a
39802 renaming of an entry. (In most cases, the target of the jump
39803 can be filled in at link time. In some cases, such as a
39804 renaming of a name like "A(I).all", an indirect jump is
39805 needed. Note that the name is evaluated at renaming time, not
39806 at call time.)
39807
39808 5.a.1/1
39809 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} The first
39810 part of the second sentence is intended to allow
39811 renaming-as-body of predefined operators before the
39812 subprogram_declaration is frozen. For some types (such as
39813 integer types), the parameter type for operators is the base
39814 type, and it would be very strange for
39815 function Equal (A, B : in T) return Boolean;
39816 function Equal (A, B : in T) return Boolean renames "=";
39817 to be illegal. (Note that predefined operators cannot be
39818 renamed this way after the subprogram_declaration is frozen,
39819 as they have convention Intrinsic.)
39820
39821 5.b/1
39822 The first sentence is the normal rule for completions of
39823 subprogram_declarations.
39824
39825 5.c
39826 Ramification: An entry_declaration, unlike a
39827 subprogram_declaration, cannot be completed with a
39828 renaming_declaration (*note 8.5: S0199.). Nor can a
39829 generic_subprogram_declaration (*note 12.1: S0271.).
39830
39831 5.d
39832 The syntax rules prevent a protected subprogram declaration
39833 from being completed by a renaming. This is fortunate,
39834 because it allows us to avoid worrying about whether the
39835 implicit protected object parameter of a protected operation
39836 is involved in the conformance rules.
39837
39838 5.d.1/1
39839 Reason: {8652/00278652/0027} {AI95-00135-01AI95-00135-01}
39840 Circular renames before freezing is illegal, as the compiler
39841 would not be able to determine the convention of the
39842 subprogram. Other circular renames are handled below; see
39843 Bounded (Run-Time) Errors.
39844
39845 5.1/2
39846 {AI95-00228-01AI95-00228-01} The callable_entity_name of a renaming
39847 shall not denote a subprogram that requires overriding (see *note
39848 3.9.3::).
39849
39850 5.d.2/2
39851 Reason: {AI95-00228-01AI95-00228-01} Such a rename cannot be
39852 of the inherited subprogram (which requires overriding because
39853 it cannot be called), and thus cannot squirrel away a
39854 subprogram (see below). That would be confusing, so we make
39855 it illegal. The renaming is allowed after the overriding, as
39856 then the name will denote the overriding subprogram, not the
39857 inherited one.
39858
39859 5.2/2
39860 {AI95-00228-01AI95-00228-01} The callable_entity_name of a
39861 renaming-as-body shall not denote an abstract subprogram.
39862
39863 5.d.3/2
39864 Reason: {AI95-00228-01AI95-00228-01} Such a subprogram has no
39865 body, so it hardly can replace one in the program.
39866
39867 6
39868 A name that denotes a formal parameter of the subprogram_specification
39869 is not allowed within the callable_entity_name.
39870
39871 6.a
39872 Reason: This is to prevent things like this:
39873
39874 6.b
39875 function F(X : Integer) return Integer renames Table(X).all;
39876
39877 6.c
39878 A similar rule in *note 6.1:: forbids things like this:
39879
39880 6.d
39881 function F(X : Integer; Y : Integer := X) return Integer;
39882
39883 _Static Semantics_
39884
39885 7
39886 A renaming-as-declaration declares a new view of the renamed entity.
39887 The profile of this new view takes its subtypes, parameter modes, and
39888 calling convention from the original profile of the callable entity,
39889 while taking the formal parameter names and default_expressions from the
39890 profile given in the subprogram_renaming_declaration. The new view is a
39891 function or procedure, never an entry.
39892
39893 7.a
39894 To be honest: When renaming an entry as a procedure, the
39895 compile-time rules apply as if the new view is a procedure,
39896 but the run-time semantics of a call are that of an entry
39897 call.
39898
39899 7.b
39900 Ramification: For example, it is illegal for the
39901 entry_call_statement of a timed_entry_call to call the new
39902 view. But what looks like a procedure call will do things
39903 like barrier waiting.
39904
39905 7.b.1/3
39906 {8652/01058652/0105} {AI95-00211-01AI95-00211-01}
39907 {AI95-00228-01AI95-00228-01} {AI05-0095-1AI05-0095-1} All
39908 properties of the renamed entity are inherited by the new view
39909 unless otherwise stated by this International Standard. In
39910 particular, if the renamed entity is abstract, the new view
39911 also is abstract. Similarly, if the renamed entity is not a
39912 program unit, then neither is the renaming. (Implicitly
39913 declared subprograms are not program units, see *note 10.1::).
39914
39915 _Dynamic Semantics_
39916
39917 7.1/1
39918 {8652/00148652/0014} {AI95-00064-01AI95-00064-01} For a call to a
39919 subprogram whose body is given as a renaming-as-body, the execution of
39920 the renaming-as-body is equivalent to the execution of a subprogram_body
39921 that simply calls the renamed subprogram with its formal parameters as
39922 the actual parameters and, if it is a function, returns the value of the
39923 call.
39924
39925 7.b.2/1
39926 Ramification: This implies that the subprogram completed by
39927 the renaming-as-body has its own elaboration check.
39928
39929 8/3
39930 {AI05-0123-1AI05-0123-1} For a call on a renaming of a dispatching
39931 subprogram that is overridden, if the overriding occurred before the
39932 renaming, then the body executed is that of the overriding declaration,
39933 even if the overriding declaration is not visible at the place of the
39934 renaming; otherwise, the inherited or predefined subprogram is called.
39935 A corresponding rule applies to a call on a renaming of a predefined
39936 equality operator for an untagged record type.
39937
39938 8.a
39939 Discussion: Note that whether or not the renaming is itself
39940 primitive has nothing to do with the renamed subprogram.
39941
39942 8.b/3
39943 {AI05-0123-1AI05-0123-1} Note that the above rule is only for
39944 tagged types and equality of untagged record types.
39945
39946 8.c
39947 Consider the following example:
39948
39949 8.d
39950 package P is
39951 type T is tagged null record;
39952 function Predefined_Equal(X, Y : T) return Boolean renames "=";
39953 private
39954 function "="(X, Y : T) return Boolean; -- Override predefined "=".
39955 end P;
39956
39957 8.e
39958 with P; use P;
39959 package Q is
39960 function User_Defined_Equal(X, Y : T) return Boolean renames P."=";
39961 end Q;
39962
39963 8.f
39964 A call on Predefined_Equal will execute the predefined
39965 equality operator of T, whereas a call on User_Defined_Equal
39966 will execute the body of the overriding declaration in the
39967 private part of P.
39968
39969 8.g
39970 Thus a renaming allows one to squirrel away a copy of an
39971 inherited or predefined subprogram before later overriding it.
39972
39973 _Bounded (Run-Time) Errors_
39974
39975 8.1/1
39976 {8652/00278652/0027} {AI95-00135-01AI95-00135-01} If a subprogram
39977 directly or indirectly renames itself, then it is a bounded error to
39978 call that subprogram. Possible consequences are that Program_Error or
39979 Storage_Error is raised, or that the call results in infinite recursion.
39980
39981 8.g.1/1
39982 Reason: {8652/00278652/0027} {AI95-00135-01AI95-00135-01} This
39983 has to be a bounded error, as it is possible for a
39984 renaming-as-body appearing in a package body to cause this
39985 problem. Thus it is not possible in general to detect this
39986 problem at compile time.
39987
39988 NOTES
39989
39990 9
39991 12 A procedure can only be renamed as a procedure. A function
39992 whose defining_designator is either an identifier or an
39993 operator_symbol can be renamed with either an identifier or an
39994 operator_symbol; for renaming as an operator, the subprogram
39995 specification given in the renaming_declaration is subject to the
39996 rules given in *note 6.6:: for operator declarations. Enumeration
39997 literals can be renamed as functions; similarly,
39998 attribute_references that denote functions (such as references to
39999 Succ and Pred) can be renamed as functions. An entry can only be
40000 renamed as a procedure; the new name is only allowed to appear in
40001 contexts that allow a procedure name. An entry of a family can be
40002 renamed, but an entry family cannot be renamed as a whole.
40003
40004 10
40005 13 The operators of the root numeric types cannot be renamed
40006 because the types in the profile are anonymous, so the
40007 corresponding specifications cannot be written; the same holds for
40008 certain attributes, such as Pos.
40009
40010 11
40011 14 Calls with the new name of a renamed entry are
40012 procedure_call_statements and are not allowed at places where the
40013 syntax requires an entry_call_statement in conditional_ and
40014 timed_entry_calls, nor in an asynchronous_select; similarly, the
40015 Count attribute is not available for the new name.
40016
40017 12
40018 15 The primitiveness of a renaming-as-declaration is determined by
40019 its profile, and by where it occurs, as for any declaration of (a
40020 view of) a subprogram; primitiveness is not determined by the
40021 renamed view. In order to perform a dispatching call, the
40022 subprogram name has to denote a primitive subprogram, not a
40023 nonprimitive renaming of a primitive subprogram.
40024
40025 12.a
40026 Reason: A subprogram_renaming_declaration could more properly
40027 be called renaming_as_subprogram_declaration, since you're
40028 renaming something as a subprogram, but you're not necessarily
40029 renaming a subprogram. But that's too much of a mouthful.
40030 Or, alternatively, we could call it a
40031 callable_entity_renaming_declaration, but that's even worse.
40032 Not only is it a mouthful, it emphasizes the entity being
40033 renamed, rather than the new view, which we think is a bad
40034 idea. We'll live with the oddity.
40035
40036 _Examples_
40037
40038 13
40039 Examples of subprogram renaming declarations:
40040
40041 14
40042 procedure My_Write(C : in Character) renames Pool(K).Write; -- see *note 4.1.3::
40043
40044 15
40045 function Real_Plus(Left, Right : Real ) return Real renames "+";
40046 function Int_Plus (Left, Right : Integer) return Integer renames "+";
40047
40048 16
40049 function Rouge return Color renames Red; -- see *note 3.5.1::
40050 function Rot return Color renames Red;
40051 function Rosso return Color renames Rouge;
40052
40053 17
40054 function Next(X : Color) return Color renames Color'Succ; -- see *note 3.5.1::
40055
40056 18
40057 Example of a subprogram renaming declaration with new parameter names:
40058
40059 19
40060 function "*" (X,Y : Vector) return Real renames Dot_Product; -- see *note 6.1::
40061
40062 20
40063 Example of a subprogram renaming declaration with a new default
40064 expression:
40065
40066 21
40067 function Minimum(L : Link := Head) return Cell renames Min_Cell; -- see *note 6.1::
40068
40069 _Extensions to Ada 95_
40070
40071 21.a/2
40072 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} Corrigendum:
40073 Allowed a renaming-as-body to be just mode conformant with the
40074 specification if the subprogram is not yet frozen.
40075
40076 21.b/2
40077 {AI95-00218-03AI95-00218-03} Overriding_indicator (see *note
40078 8.3.1::) is optionally added to subprogram renamings.
40079
40080 _Wording Changes from Ada 95_
40081
40082 21.c/2
40083 {8652/00148652/0014} {AI95-00064-01AI95-00064-01} Corrigendum:
40084 Described the semantics of renaming-as-body, so that the
40085 location of elaboration checks is clear.
40086
40087 21.d/2
40088 {8652/00278652/0027} {AI95-00135-01AI95-00135-01} Corrigendum:
40089 Clarified that circular renaming-as-body is illegal (if it can
40090 be detected in time) or a bounded error.
40091
40092 21.e/2
40093 {AI95-00228-01AI95-00228-01} Amendment Correction: Clarified
40094 that renaming a shall-be-overridden subprogram is illegal, as
40095 well as renaming-as-body an abstract subprogram.
40096
40097 21.f/2
40098 {AI95-00423-01AI95-00423-01} Added matching rules for
40099 null_exclusions.
40100
40101 _Inconsistencies With Ada 2005_
40102
40103 21.f.1/3
40104 {AI05-0123-1AI05-0123-1} Renaming of user-defined untagged
40105 record equality is now defined to call the overridden body so
40106 long as the overriding occurred before the renames. This
40107 could change the body called in unusual cases; the change is
40108 necessary to preserve the principle that the body called for
40109 an explicit call to "=" (via a renames in this case) is the
40110 same as the one inherited for a derived type and used in
40111 generics. Note that any renamings before the overriding will
40112 be unchanged. Any differences caused by the change will be
40113 rare and most likely will fix a bug.
40114
40115 _Extensions to Ada 2005_
40116
40117 21.g/3
40118 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
40119 be used in a subprogram_renaming_declaration. This is
40120 described in *note 13.1.1::.
40121
40122 \1f
40123 File: aarm2012.info, Node: 8.5.5, Prev: 8.5.4, Up: 8.5
40124
40125 8.5.5 Generic Renaming Declarations
40126 -----------------------------------
40127
40128 1
40129 [A generic_renaming_declaration is used to rename a generic unit.]
40130
40131 _Syntax_
40132
40133 2/3
40134 {AI05-0183-1AI05-0183-1} generic_renaming_declaration ::=
40135 generic package
40136 defining_program_unit_name renames generic_package_name
40137 [aspect_specification];
40138 | generic procedure
40139 defining_program_unit_name renames generic_procedure_name
40140 [aspect_specification];
40141 | generic function
40142 defining_program_unit_name renames generic_function_name
40143 [aspect_specification];
40144
40145 _Legality Rules_
40146
40147 3
40148 The renamed entity shall be a generic unit of the corresponding kind.
40149
40150 _Static Semantics_
40151
40152 4
40153 A generic_renaming_declaration declares a new view [of the renamed
40154 generic unit].
40155
40156 NOTES
40157
40158 5
40159 16 Although the properties of the new view are the same as those
40160 of the renamed view, the place where the
40161 generic_renaming_declaration occurs may affect the legality of
40162 subsequent renamings and instantiations that denote the
40163 generic_renaming_declaration, in particular if the renamed generic
40164 unit is a library unit (see *note 10.1.1::).
40165
40166 _Examples_
40167
40168 6
40169 Example of renaming a generic unit:
40170
40171 7
40172 generic package Enum_IO renames Ada.Text_IO.Enumeration_IO; -- see *note A.10.10::
40173
40174 _Extensions to Ada 83_
40175
40176 7.a
40177 Renaming of generic units is new to Ada 95. It is
40178 particularly important for renaming child library units that
40179 are generic units. For example, it might be used to rename
40180 Numerics.Generic_Elementary_Functions as simply
40181 Generic_Elementary_Functions, to match the name for the
40182 corresponding Ada-83-based package.
40183
40184 _Wording Changes from Ada 83_
40185
40186 7.b
40187 The information in RM83-8.6, "The Package Standard," has been
40188 updated for the child unit feature, and moved to *note Annex
40189 A::, except for the definition of "predefined type," which has
40190 been moved to *note 3.2.1::.
40191
40192 _Extensions to Ada 2005_
40193
40194 7.c/3
40195 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
40196 be used in a generic_renaming_declaration. This is described
40197 in *note 13.1.1::.
40198
40199 \1f
40200 File: aarm2012.info, Node: 8.6, Prev: 8.5, Up: 8
40201
40202 8.6 The Context of Overload Resolution
40203 ======================================
40204
40205 1/3
40206 {AI05-0299-1AI05-0299-1} [ Because declarations can be overloaded, it is
40207 possible for an occurrence of a usage name to have more than one
40208 possible interpretation; in most cases, ambiguity is disallowed. This
40209 subclause describes how the possible interpretations resolve to the
40210 actual interpretation.
40211
40212 2
40213 Certain rules of the language (the Name Resolution Rules) are considered
40214 "overloading rules". If a possible interpretation violates an
40215 overloading rule, it is assumed not to be the intended interpretation;
40216 some other possible interpretation is assumed to be the actual
40217 interpretation. On the other hand, violations of nonoverloading rules
40218 do not affect which interpretation is chosen; instead, they cause the
40219 construct to be illegal. To be legal, there usually has to be exactly
40220 one acceptable interpretation of a construct that is a "complete
40221 context", not counting any nested complete contexts.
40222
40223 3
40224 The syntax rules of the language and the visibility rules given in *note
40225 8.3:: determine the possible interpretations. Most type checking rules
40226 (rules that require a particular type, or a particular class of types,
40227 for example) are overloading rules. Various rules for the matching of
40228 formal and actual parameters are overloading rules.]
40229
40230 _Language Design Principles_
40231
40232 3.a
40233 The type resolution rules are intended to minimize the need
40234 for implicit declarations and preference rules associated with
40235 implicit conversion and dispatching operations.
40236
40237 _Name Resolution Rules_
40238
40239 4
40240 [Overload resolution is applied separately to each complete context, not
40241 counting inner complete contexts.] Each of the following constructs is
40242 a complete context:
40243
40244 5
40245 * A context_item.
40246
40247 6
40248 * A declarative_item or declaration.
40249
40250 6.a
40251 Ramification: A loop_parameter_specification is a declaration,
40252 and hence a complete context.
40253
40254 7
40255 * A statement.
40256
40257 8
40258 * A pragma_argument_association.
40259
40260 8.a
40261 Reason: We would make it the whole pragma, except that certain
40262 pragma arguments are allowed to be ambiguous, and ambiguity
40263 applies to a complete context.
40264
40265 9
40266 * The expression of a case_statement.
40267
40268 9.a
40269 Ramification: This means that the expression is resolved
40270 without looking at the choices.
40271
40272 10
40273 An (overall) interpretation of a complete context embodies its meaning,
40274 and includes the following information about the constituents of the
40275 complete context, not including constituents of inner complete contexts:
40276
40277 11
40278 * for each constituent of the complete context, to which syntactic
40279 categories it belongs, and by which syntax rules; and
40280
40281 11.a
40282 Ramification: Syntactic categories is plural here, because
40283 there are lots of trivial productions -- an expression might
40284 also be all of the following, in this order: identifier, name,
40285 primary, factor, term, simple_expression, and relation.
40286 Basically, we're trying to capture all the information in the
40287 parse tree here, without using compiler-writer's jargon like
40288 "parse tree".
40289
40290 12
40291 * for each usage name, which declaration it denotes (and, therefore,
40292 which view and which entity it denotes); and
40293
40294 12.a/2
40295 Ramification: {AI95-00382-01AI95-00382-01} In most cases, a
40296 usage name denotes the view declared by the denoted
40297 declaration. However, in certain cases, a usage name that
40298 denotes a declaration and appears inside the declarative
40299 region of that same declaration, denotes the current instance
40300 of the declaration. For example, within a task_body other
40301 than in an access_definition, a usage name that denotes the
40302 task_type_declaration denotes the object containing the
40303 currently executing task, and not the task type declared by
40304 the declaration.
40305
40306 13
40307 * for a complete context that is a declarative_item, whether or not
40308 it is a completion of a declaration, and (if so) which declaration
40309 it completes.
40310
40311 13.a
40312 Ramification: Unfortunately, we are not confident that the
40313 above list is complete. We'll have to live with that.
40314
40315 13.b
40316 To be honest: For "possible" interpretations, the above
40317 information is tentative.
40318
40319 13.c
40320 Discussion: A possible interpretation (an input to overload
40321 resolution) contains information about what a usage name might
40322 denote, but what it actually does denote requires overload
40323 resolution to determine. Hence the term "tentative" is needed
40324 for possible interpretations; otherwise, the definition would
40325 be circular.
40326
40327 14
40328 A possible interpretation is one that obeys the syntax rules and the
40329 visibility rules. An acceptable interpretation is a possible
40330 interpretation that obeys the overloading rules[, that is, those rules
40331 that specify an expected type or expected profile, or specify how a
40332 construct shall resolve or be interpreted.]
40333
40334 14.a
40335 To be honest: One rule that falls into this category, but does
40336 not use the above-mentioned magic words, is the rule about
40337 numbers of parameter associations in a call (see *note 6.4::).
40338
40339 14.b
40340 Ramification: The Name Resolution Rules are the ones that
40341 appear under the Name Resolution Rules heading. Some Syntax
40342 Rules are written in English, instead of BNF. No rule is a
40343 Syntax Rule or Name Resolution Rule unless it appears under
40344 the appropriate heading.
40345
40346 15
40347 The interpretation of a constituent of a complete context is determined
40348 from the overall interpretation of the complete context as a whole.
40349 [Thus, for example, "interpreted as a function_call," means that the
40350 construct's interpretation says that it belongs to the syntactic
40351 category function_call.]
40352
40353 16
40354 [Each occurrence of] a usage name denotes the declaration determined by
40355 its interpretation. It also denotes the view declared by its denoted
40356 declaration, except in the following cases:
40357
40358 16.a
40359 Ramification: As explained below, a pragma argument is allowed
40360 to be ambiguous, so it can denote several declarations, and
40361 all of the views declared by those declarations.
40362
40363 17/3
40364 * {AI95-00382-01AI95-00382-01} {AI05-0287-1AI05-0287-1} If a usage
40365 name appears within the declarative region of a type_declaration
40366 and denotes that same type_declaration, then it denotes the current
40367 instance of the type (rather than the type itself); the current
40368 instance of a type is the object or value of the type that is
40369 associated with the execution that evaluates the usage name.
40370 Similarly, if a usage name appears within the declarative region of
40371 a subtype_declaration and denotes that same subtype_declaration,
40372 then it denotes the current instance of the subtype. These rules
40373 do not apply if the usage name appears within the subtype_mark of
40374 an access_definition for an access-to-object type, or within the
40375 subtype of a parameter or result of an access-to-subprogram type.
40376
40377 17.a/2
40378 Reason: {AI95-00382-01AI95-00382-01} This is needed, for
40379 example, for references to the Access attribute from within
40380 the type_declaration. Also, within a task_body or
40381 protected_body, we need to be able to denote the current task
40382 or protected object. (For a single_task_declaration or
40383 single_protected_declaration, the rule about current instances
40384 is not needed.) We exclude anonymous access types so that
40385 they can be used to create self-referencing types in the
40386 natural manner (otherwise such types would be illegal).
40387
40388 17.b/2
40389 Discussion: {AI95-00382-01AI95-00382-01} The phrase "within
40390 the subtype_mark" in the "this rule does not apply" part is
40391 intended to cover a case like access T'Class appearing within
40392 the declarative region of T: here T denotes the type, not the
40393 current instance.
40394
40395 18
40396 * If a usage name appears within the declarative region of a
40397 generic_declaration (but not within its generic_formal_part) and it
40398 denotes that same generic_declaration, then it denotes the current
40399 instance of the generic unit (rather than the generic unit itself).
40400 See also *note 12.3::.
40401
40402 18.a
40403 To be honest: The current instance of a generic unit is the
40404 instance created by whichever generic_instantiation is of
40405 interest at any given time.
40406
40407 18.b
40408 Ramification: Within a generic_formal_part, a name that
40409 denotes the generic_declaration denotes the generic unit,
40410 which implies that it is not overloadable.
40411
40412 19
40413 A usage name that denotes a view also denotes the entity of that view.
40414
40415 19.a
40416 Ramification: Usually, a usage name denotes only one
40417 declaration, and therefore one view and one entity.
40418
40419 20/2
40420 {AI95-00231-01AI95-00231-01} The expected type for a given expression,
40421 name, or other construct determines, according to the type resolution
40422 rules given below, the types considered for the construct during
40423 overload resolution. [ The type resolution rules provide support for
40424 class-wide programming, universal literals, dispatching operations, and
40425 anonymous access types:]
40426
40427 20.a
40428 Ramification: Expected types are defined throughout the RM95.
40429 The most important definition is that, for a subprogram, the
40430 expected type for the actual parameter is the type of the
40431 formal parameter.
40432
40433 20.b
40434 The type resolution rules are trivial unless either the actual
40435 or expected type is universal, class-wide, or of an anonymous
40436 access type.
40437
40438 21
40439 * If a construct is expected to be of any type in a class of types,
40440 or of the universal or class-wide type for a class, then the type
40441 of the construct shall resolve to a type in that class or to a
40442 universal type that covers the class.
40443
40444 21.a
40445 Ramification: This matching rule handles (among other things)
40446 cases like the Val attribute, which denotes a function that
40447 takes a parameter of type universal_integer.
40448
40449 21.b/1
40450 The last part of the rule, "or to a universal type that covers
40451 the class" implies that if the expected type for an expression
40452 is universal_fixed, then an expression whose type is
40453 universal_real (such as a real literal) is OK.
40454
40455 22
40456 * If the expected type for a construct is a specific type T, then the
40457 type of the construct shall resolve either to T, or:
40458
40459 22.a
40460 Ramification: This rule is not intended to create a preference
40461 for the specific type -- such a preference would cause
40462 Beaujolais effects.
40463
40464 23
40465 * to T'Class; or
40466
40467 23.a
40468 Ramification: This will only be legal as part of a call on a
40469 dispatching operation; see *note 3.9.2::, "*note 3.9.2::
40470 Dispatching Operations of Tagged Types". Note that that rule
40471 is not a Name Resolution Rule.
40472
40473 24
40474 * to a universal type that covers T; or
40475
40476 25/2
40477 * {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01}
40478 {AI95-00254-01AI95-00254-01} {AI95-00409-01AI95-00409-01}
40479 when T is a specific anonymous access-to-object type (see
40480 *note 3.10::) with designated type D, to an
40481 access-to-object type whose designated type is D'Class or
40482 is covered by D; or
40483
40484 25.a/2
40485 This paragraph was deleted.{AI95-00409-01AI95-00409-01}
40486
40487 25.b
40488 Ramification: The case where the actual is access-to-D'Class
40489 will only be legal as part of a call on a dispatching
40490 operation; see *note 3.9.2::, "*note 3.9.2:: Dispatching
40491 Operations of Tagged Types". Note that that rule is not a
40492 Name Resolution Rule.
40493
40494 25.1/3
40495 * {AI05-0149-1AI05-0149-1} when T is a named general
40496 access-to-object type (see *note 3.10::) with designated
40497 type D, to an anonymous access-to-object type whose
40498 designated type covers or is covered by D; or
40499
40500 25.2/3
40501 * {AI95-00254-01AI95-00254-01} {AI95-00409-01AI95-00409-01}
40502 {AI05-0239-1AI05-0239-1} when T is an anonymous
40503 access-to-subprogram type (see *note 3.10::), to an
40504 access-to-subprogram type whose designated profile is
40505 type conformant with that of T.
40506
40507 26
40508 In certain contexts, [such as in a subprogram_renaming_declaration,] the
40509 Name Resolution Rules define an expected profile for a given name; in
40510 such cases, the name shall resolve to the name of a callable entity
40511 whose profile is type conformant with the expected profile.
40512
40513 26.a/3
40514 Ramification: {AI05-0239-1AI05-0239-1} The parameter and
40515 result subtypes are not used in overload resolution. Only
40516 type conformance of profiles is considered during overload
40517 resolution. Legality rules generally require at least mode
40518 conformance in addition, but those rules are not used in
40519 overload resolution.
40520
40521 _Legality Rules_
40522
40523 27/2
40524 {AI95-00332-01AI95-00332-01} When a construct is one that requires that
40525 its expected type be a single type in a given class, the type of the
40526 construct shall be determinable solely from the context in which the
40527 construct appears, excluding the construct itself, but using the
40528 requirement that it be in the given class. Furthermore, the context
40529 shall not be one that expects any type in some class that contains types
40530 of the given class; in particular, the construct shall not be the
40531 operand of a type_conversion.
40532
40533 27.a/2
40534 Ramification: {AI95-00230-01AI95-00230-01} For example, the
40535 expected type for a string literal is required to be a single
40536 string type. But the expected type for the operand of a
40537 type_conversion is any type. Therefore, a string literal is
40538 not allowed as the operand of a type_conversion. This is true
40539 even if there is only one string type in scope (which is never
40540 the case). The reason for these rules is so that the compiler
40541 will not have to search "everywhere" to see if there is
40542 exactly one type in a class in scope.
40543
40544 27.b/2
40545 Discussion: {AI95-00332-01AI95-00332-01} The first sentence is
40546 carefully worded so that it only mentions "expected type" as
40547 part of identifying the interesting case, but doesn't require
40548 that the context actually provide such an expected type. This
40549 allows such constructs to be used inside of constructs that
40550 don't provide an expected type (like qualified expressions and
40551 renames). Otherwise, such constructs wouldn't allow
40552 aggregates, 'Access, and so on.
40553
40554 27.1/3
40555 {AI05-0102-1AI05-0102-1} {AI05-0149-1AI05-0149-1}
40556 {AI05-0299-1AI05-0299-1} Other than for the simple_expression of a
40557 membership test, if the expected type for a name or expression is not
40558 the same as the actual type of the name or expression, the actual type
40559 shall be convertible to the expected type (see *note 4.6::); further, if
40560 the expected type is a named access-to-object type with designated type
40561 D1 and the actual type is an anonymous access-to-object type with
40562 designated type D2, then D1 shall cover D2, and the name or expression
40563 shall denote a view with an accessibility level for which the statically
40564 deeper relationship applies[; in particular it shall not denote an
40565 access parameter nor a stand-alone access object].
40566
40567 27.c/3
40568 Reason: This rule prevents an implicit conversion that would
40569 be illegal if it was an explicit conversion. For instance,
40570 this prevents assigning an access-to-constant value into a
40571 stand-alone anonymous access-to-variable object. It also
40572 covers convertibility of the designated type and accessibility
40573 checks.
40574
40575 27.d/3
40576 The rule also minimizes cases of implicit conversions when the
40577 tag check or the accessibility check might fail. We word it
40578 this way because access discriminants should also be
40579 disallowed if their enclosing object is designated by an
40580 access parameter.
40581
40582 27.e/3
40583 Ramification: This rule does not apply to expressions that
40584 don't have expected types (such as the operand of a qualified
40585 expression or the expression of a renames). We don't need a
40586 rule like this in those cases, as the type needs to be the
40587 same; there is no implicit conversion.
40588
40589 28
40590 A complete context shall have at least one acceptable interpretation; if
40591 there is exactly one, then that one is chosen.
40592
40593 28.a
40594 Ramification: This, and the rule below about ambiguity, are
40595 the ones that suck in all the Syntax Rules and Name Resolution
40596 Rules as compile-time rules. Note that this and the ambiguity
40597 rule have to be Legality Rules.
40598
40599 29
40600 There is a preference for the primitive operators (and ranges) of the
40601 root numeric types root_integer and root_real. In particular, if two
40602 acceptable interpretations of a constituent of a complete context differ
40603 only in that one is for a primitive operator (or range) of the type
40604 root_integer or root_real, and the other is not, the interpretation
40605 using the primitive operator (or range) of the root numeric type is
40606 preferred.
40607
40608 29.a
40609 Reason: The reason for this preference is so that expressions
40610 involving literals and named numbers can be unambiguous. For
40611 example, without the preference rule, the following would be
40612 ambiguous:
40613
40614 29.b/1
40615 N : constant := 123;
40616 if N > 100 then -- Preference for root_integer ">" operator.
40617 ...
40618 end if;
40619
40620 29.1/3
40621 {AI05-0149-1AI05-0149-1} Similarly, there is a preference for the
40622 equality operators of the universal_access type (see *note 4.5.2::). If
40623 two acceptable interpretations of a constituent of a complete context
40624 differ only in that one is for an equality operator of the
40625 universal_access type, and the other is not, the interpretation using
40626 the equality operator of the universal_access type is preferred.
40627
40628 29.c/3
40629 Reason: This preference is necessary because of implicit
40630 conversion from an anonymous access type to a named access
40631 type, which would allow the equality operator of any named
40632 access type to be used to compare anonymous access values (and
40633 that way lies madness).
40634
40635 30
40636 For a complete context, if there is exactly one overall acceptable
40637 interpretation where each constituent's interpretation is the same as or
40638 preferred (in the above sense) over those in all other overall
40639 acceptable interpretations, then that one overall acceptable
40640 interpretation is chosen. Otherwise, the complete context is ambiguous.
40641
40642 31
40643 A complete context other than a pragma_argument_association shall not be
40644 ambiguous.
40645
40646 32
40647 A complete context that is a pragma_argument_association is allowed to
40648 be ambiguous (unless otherwise specified for the particular pragma), but
40649 only if every acceptable interpretation of the pragma argument is as a
40650 name that statically denotes a callable entity. Such a name denotes all
40651 of the declarations determined by its interpretations, and all of the
40652 views declared by these declarations.
40653
40654 32.a/3
40655 Ramification: {AI95-00224-01AI95-00224-01}
40656 {AI05-0229-1AI05-0229-1} This applies to Inline, Suppress,
40657 Import, Export, and Convention pragmas. For example, it is OK
40658 to say "pragma Export(C, Entity_Name => P.Q);", even if there
40659 are two directly visible P's, and there are two Q's declared
40660 in the visible part of each P. In this case, P.Q denotes four
40661 different declarations. This rule also applies to certain
40662 pragmas defined in the Specialized Needs Annexes. It almost
40663 applies to Pure, Elaborate_Body, and Elaborate_All pragmas,
40664 but those can't have overloading for other reasons. Note that
40665 almost all of these pragmas are obsolescent (see *note J.10::
40666 and *note J.15::), and a major reason is that this rule has
40667 proven to be too broad in practice (it is common to want to
40668 specify something on a single subprogram of an overloaded set,
40669 that can't be done easily with this rule).
40670 Aspect_specifications, which are given on individual
40671 declarations, are preferred in Ada 2012.
40672
40673 32.b
40674 Note that if a pragma argument denotes a call to a callable
40675 entity, rather than the entity itself, this exception does not
40676 apply, and ambiguity is disallowed.
40677
40678 32.c
40679 Note that we need to carefully define which pragma-related
40680 rules are Name Resolution Rules, so that, for example, a
40681 pragma Inline does not pick up subprograms declared in
40682 enclosing declarative regions, and therefore make itself
40683 illegal.
40684
40685 32.d
40686 We say "statically denotes" in the above rule in order to
40687 avoid having to worry about how many times the name is
40688 evaluated, in case it denotes more than one callable entity.
40689
40690 NOTES
40691
40692 33
40693 17 If a usage name has only one acceptable interpretation, then it
40694 denotes the corresponding entity. However, this does not mean that
40695 the usage name is necessarily legal since other requirements exist
40696 which are not considered for overload resolution; for example, the
40697 fact that an expression is static, whether an object is constant,
40698 mode and subtype conformance rules, freezing rules, order of
40699 elaboration, and so on.
40700
40701 34
40702 Similarly, subtypes are not considered for overload resolution (the
40703 violation of a constraint does not make a program illegal but
40704 raises an exception during program execution).
40705
40706 _Incompatibilities With Ada 83_
40707
40708 34.a
40709 The new preference rule for operators of root numeric types is
40710 upward incompatible, but only in cases that involved
40711 Beaujolais effects in Ada 83. Such cases are ambiguous in Ada
40712 95.
40713
40714 _Extensions to Ada 83_
40715
40716 34.b
40717 The rule that allows an expected type to match an actual
40718 expression of a universal type, in combination with the new
40719 preference rule for operators of root numeric types, subsumes
40720 the Ada 83 "implicit conversion" rules for universal types.
40721
40722 _Wording Changes from Ada 83_
40723
40724 34.c
40725 In Ada 83, it is not clear what the "syntax rules" are.
40726 AI83-00157 states that a certain textual rule is a syntax
40727 rule, but it's still not clear how one tells in general which
40728 textual rules are syntax rules. We have solved the problem by
40729 stating exactly which rules are syntax rules -- the ones that
40730 appear under the "Syntax" heading.
40731
40732 34.d
40733 RM83 has a long list of the "forms" of rules that are to be
40734 used in overload resolution (in addition to the syntax rules).
40735 It is not clear exactly which rules fall under each form. We
40736 have solved the problem by explicitly marking all rules that
40737 are used in overload resolution. Thus, the list of kinds of
40738 rules is unnecessary. It is replaced with some introductory
40739 (intentionally vague) text explaining the basic idea of what
40740 sorts of rules are overloading rules.
40741
40742 34.e/3
40743 {AI05-0299-1AI05-0299-1} It is not clear from RM83 what
40744 information is embodied in a "meaning" or an "interpretation."
40745 "Meaning" and "interpretation" were intended to be synonymous;
40746 we now use the latter only in defining the rules about
40747 overload resolution. "Meaning" is used only informally. This
40748 subclause attempts to clarify what is meant by
40749 "interpretation."
40750
40751 34.f
40752 For example, RM83 does not make it clear that overload
40753 resolution is required in order to match subprogram_bodies
40754 with their corresponding declarations (and even to tell
40755 whether a given subprogram_body is the completion of a
40756 previous declaration). Clearly, the information needed to do
40757 this is part of the "interpretation" of a subprogram_body.
40758 The resolution of such things is defined in terms of the
40759 "expected profile" concept. Ada 95 has some new cases where
40760 expected profiles are needed -- the resolution of P'Access,
40761 where P might denote a subprogram, is an example.
40762
40763 34.g
40764 RM83-8.7(2) might seem to imply that an interpretation
40765 embodies information about what is denoted by each usage name,
40766 but not information about which syntactic category each
40767 construct belongs to. However, it seems necessary to include
40768 such information, since the Ada grammar is highly ambiguous.
40769 For example, X(Y) might be a function_call or an
40770 indexed_component, and no context-free/syntactic information
40771 can tell the difference. It seems like we should view X(Y) as
40772 being, for example, "interpreted as a function_call" (if
40773 that's what overload resolution decides it is). Note that
40774 there are examples where the denotation of each usage name
40775 does not imply the syntactic category. However, even if that
40776 were not true, it seems that intuitively, the interpretation
40777 includes that information. Here's an example:
40778
40779 34.h
40780 type T;
40781 type A is access T;
40782 type T is array(Integer range 1..10) of A;
40783 I : Integer := 3;
40784 function F(X : Integer := 7) return A;
40785 Y : A := F(I); -- Ambiguous? (We hope so.)
40786
40787 34.i/1
40788 Consider the declaration of Y (a complete context). In the
40789 above example, overload resolution can easily determine the
40790 declaration, and therefore the entity, denoted by Y, A, F, and
40791 I. However, given all of that information, we still don't know
40792 whether F(I) is a function_call or an indexed_component whose
40793 prefix is a function_call. (In the latter case, it is
40794 equivalent to F(7).all(I).)
40795
40796 34.j
40797 It seems clear that the declaration of Y ought to be
40798 considered ambiguous. We describe that by saying that there
40799 are two interpretations, one as a function_call, and one as an
40800 indexed_component. These interpretations are both acceptable
40801 to the overloading rules. Therefore, the complete context is
40802 ambiguous, and therefore illegal.
40803
40804 34.k
40805 It is the intent that the Ada 95 preference rule for root
40806 numeric operators is more locally enforceable than that of
40807 RM83-4.6(15). It should also eliminate interpretation shifts
40808 due to the addition or removal of a use_clause (the so called
40809 Beaujolais effect).
40810
40811 34.l/2
40812 {AI95-00114-01AI95-00114-01} RM83-8.7 seems to be missing some
40813 complete contexts, such as pragma_argument_associations,
40814 declarative_items that are not declarations or aspect_clauses,
40815 and context_items. We have added these, and also replaced the
40816 "must be determinable" wording of RM83-5.4(3) with the notion
40817 that the expression of a case_statement is a complete context.
40818
40819 34.m
40820 Cases like the Val attribute are now handled using the normal
40821 type resolution rules, instead of having special cases that
40822 explicitly allow things like "any integer type."
40823
40824 _Incompatibilities With Ada 95_
40825
40826 34.n/2
40827 {AI95-00409-01AI95-00409-01} Ada 95 allowed name resolution to
40828 distinguish between anonymous access-to-variable and
40829 access-to-constant types. This is similar to distinguishing
40830 between subprograms with in and in out parameters, which is
40831 known to be bad. Thus, that part of the rule was dropped as
40832 we now have anonymous access-to-constant types, making this
40833 much more likely.
40834
40835 34.o/2
40836 type Cacc is access constant Integer;
40837 procedure Proc (Acc : access Integer) ...
40838 procedure Proc (Acc : Cacc) ...
40839 List : Cacc := ...;
40840 Proc (List); -- OK in Ada 95, ambiguous in Ada 2005.
40841
40842 34.p/2
40843 If there is any code like this (such code should be rare), it
40844 will be ambiguous in Ada 2005.
40845
40846 _Extensions to Ada 95_
40847
40848 34.q/2
40849 {AI95-00230-01AI95-00230-01} {AI95-00231-01AI95-00231-01}
40850 {AI95-00254-01AI95-00254-01} Generalized the anonymous access
40851 resolution rules to support the new capabilities of anonymous
40852 access types (that is, access-to-subprogram and
40853 access-to-constant).
40854
40855 34.r/2
40856 {AI95-00382-01AI95-00382-01} We now allow the creation of
40857 self-referencing types via anonymous access types. This is an
40858 extension in unusual cases involving task and protected types.
40859 For example:
40860
40861 34.s/2
40862 task type T;
40863
40864 34.t/2
40865 task body T is
40866 procedure P (X : access T) is -- Illegal in Ada 95, legal in Ada 2005
40867 ...
40868 end P;
40869 begin
40870 ...
40871 end T;
40872
40873 _Wording Changes from Ada 95_
40874
40875 34.u/2
40876 {AI95-00332-01AI95-00332-01} Corrected the "single expected
40877 type" so that it works in contexts that don't have expected
40878 types (like object renames and qualified expressions). This
40879 fixes a hole in Ada 95 that appears to prohibit using
40880 aggregates, 'Access, character literals, string literals, and
40881 allocators in qualified expressions.
40882
40883 _Incompatibilities With Ada 2005_
40884
40885 34.v/3
40886 {AI05-0149-1AI05-0149-1} Implicit conversion is now allowed
40887 from anonymous access-to-object types to general
40888 access-to-object types. Such conversions can make calls
40889 ambiguous. That can only happen when there are two visible
40890 subprograms with the same name and have profiles that differ
40891 only by a parameter that is of a named or anonymous access
40892 type, and the actual argument is of an anonymous access type.
40893 This should be rare, as many possible calls would be ambiguous
40894 even in Ada 2005 (including allocators and any actual of a
40895 named access type if the designated types are the same).
40896
40897 _Extensions to Ada 2005_
40898
40899 34.w/3
40900 {AI05-0149-1AI05-0149-1} Implicit conversion is allowed from
40901 anonymous access-to-object types to general access-to-object
40902 types if the designated type is convertible and runtime checks
40903 are minimized. See also the incompatibilities section.
40904
40905 _Wording Changes from Ada 2005_
40906
40907 34.x/3
40908 {AI05-0102-1AI05-0102-1} Added a requirement here that
40909 implicit conversions are convertible to the appropriate type.
40910 This rule was scattered about the Standard, we moved a single
40911 generalized version here.
40912
40913 \1f
40914 File: aarm2012.info, Node: 9, Next: 10, Prev: 8, Up: Top
40915
40916 9 Tasks and Synchronization
40917 ***************************
40918
40919 1/3
40920 {AI05-0299-1AI05-0299-1} The execution of an Ada program consists of the
40921 execution of one or more tasks. Each task represents a separate thread
40922 of control that proceeds independently and concurrently between the
40923 points where it interacts with other tasks. The various forms of task
40924 interaction are described in this clause, and include:
40925
40926 1.a
40927 To be honest: The execution of an Ada program consists of the
40928 execution of one or more partitions (see *note 10.2::), each
40929 of which in turn consists of the execution of an environment
40930 task and zero or more subtasks.
40931
40932 2
40933 * the activation and termination of a task;
40934
40935 3
40936 * a call on a protected subprogram of a protected object, providing
40937 exclusive read-write access, or concurrent read-only access to
40938 shared data;
40939
40940 4
40941 * a call on an entry, either of another task, allowing for
40942 synchronous communication with that task, or of a protected object,
40943 allowing for asynchronous communication with one or more other
40944 tasks using that same protected object;
40945
40946 5
40947 * a timed operation, including a simple delay statement, a timed
40948 entry call or accept, or a timed asynchronous select statement (see
40949 next item);
40950
40951 6
40952 * an asynchronous transfer of control as part of an asynchronous
40953 select statement, where a task stops what it is doing and begins
40954 execution at a different point in response to the completion of an
40955 entry call or the expiration of a delay;
40956
40957 7
40958 * an abort statement, allowing one task to cause the termination of
40959 another task.
40960
40961 8
40962 In addition, tasks can communicate indirectly by reading and updating
40963 (unprotected) shared variables, presuming the access is properly
40964 synchronized through some other kind of task interaction.
40965
40966 _Static Semantics_
40967
40968 9
40969 The properties of a task are defined by a corresponding task declaration
40970 and task_body, which together define a program unit called a task unit.
40971
40972 _Dynamic Semantics_
40973
40974 10
40975 Over time, tasks proceed through various states. A task is initially
40976 inactive; upon activation, and prior to its termination it is either
40977 blocked (as part of some task interaction) or ready to run. While
40978 ready, a task competes for the available execution resources that it
40979 requires to run.
40980
40981 10.a/3
40982 Discussion: {AI05-0229-1AI05-0229-1} The means for selecting
40983 which of the ready tasks to run, given the currently available
40984 execution resources, is determined by the task dispatching
40985 policy in effect, which is generally implementation defined,
40986 but may be controlled by aspects, pragmas, and operations
40987 defined in the Real-Time Annex (see *note D.2:: and *note
40988 D.5::).
40989
40990 NOTES
40991
40992 11
40993 1 Concurrent task execution may be implemented on multicomputers,
40994 multiprocessors, or with interleaved execution on a single physical
40995 processor. On the other hand, whenever an implementation can
40996 determine that the required semantic effects can be achieved when
40997 parts of the execution of a given task are performed by different
40998 physical processors acting in parallel, it may choose to perform
40999 them in this way.
41000
41001 _Wording Changes from Ada 83_
41002
41003 11.a
41004 The introduction has been rewritten.
41005
41006 11.b
41007 We use the term "concurrent" rather than "parallel" when
41008 talking about logically independent execution of threads of
41009 control. The term "parallel" is reserved for referring to the
41010 situation where multiple physical processors run
41011 simultaneously.
41012
41013 * Menu:
41014
41015 * 9.1 :: Task Units and Task Objects
41016 * 9.2 :: Task Execution - Task Activation
41017 * 9.3 :: Task Dependence - Termination of Tasks
41018 * 9.4 :: Protected Units and Protected Objects
41019 * 9.5 :: Intertask Communication
41020 * 9.6 :: Delay Statements, Duration, and Time
41021 * 9.7 :: Select Statements
41022 * 9.8 :: Abort of a Task - Abort of a Sequence of Statements
41023 * 9.9 :: Task and Entry Attributes
41024 * 9.10 :: Shared Variables
41025 * 9.11 :: Example of Tasking and Synchronization
41026
41027 \1f
41028 File: aarm2012.info, Node: 9.1, Next: 9.2, Up: 9
41029
41030 9.1 Task Units and Task Objects
41031 ===============================
41032
41033 1
41034 A task unit is declared by a task declaration, which has a corresponding
41035 task_body. A task declaration may be a task_type_declaration, in which
41036 case it declares a named task type; alternatively, it may be a
41037 single_task_declaration, in which case it defines an anonymous task
41038 type, as well as declaring a named task object of that type.
41039
41040 _Syntax_
41041
41042 2/3
41043 {AI95-00345-01AI95-00345-01} {AI05-0183-1AI05-0183-1}
41044 task_type_declaration ::=
41045 task type defining_identifier [known_discriminant_part]
41046 [aspect_specification] [is
41047 [new interface_list with]
41048 task_definition];
41049
41050 3/3
41051 {AI95-00399-01AI95-00399-01} {AI05-0183-1AI05-0183-1}
41052 single_task_declaration ::=
41053 task defining_identifier
41054 [aspect_specification][is
41055 [new interface_list with]
41056 task_definition];
41057
41058 4
41059 task_definition ::=
41060 {task_item}
41061 [ private
41062 {task_item}]
41063 end [task_identifier]
41064
41065 5/1
41066 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} task_item ::=
41067 entry_declaration | aspect_clause
41068
41069 6/3
41070 {AI05-0267-1AI05-0267-1} task_body ::=
41071 task body defining_identifier
41072 [aspect_specification] is
41073 declarative_part
41074 begin
41075 handled_sequence_of_statements
41076 end [task_identifier];
41077
41078 7
41079 If a task_identifier appears at the end of a task_definition or
41080 task_body, it shall repeat the defining_identifier.
41081
41082 8.a/2
41083 This paragraph was deleted.
41084
41085 Paragraph 8 was deleted.
41086
41087 _Static Semantics_
41088
41089 9
41090 A task_definition defines a task type and its first subtype. The first
41091 list of task_items of a task_definition (*note 9.1: S0207.), together
41092 with the known_discriminant_part (*note 3.7: S0061.), if any, is called
41093 the visible part of the task unit. [ The optional list of task_items
41094 after the reserved word private is called the private part of the task
41095 unit.]
41096
41097 9.a/3
41098 Proof: {AI05-0299-1AI05-0299-1} Private part is defined in
41099 Clause *note 8::.
41100
41101 9.1/1
41102 {8652/00298652/0029} {AI95-00116-01AI95-00116-01} For a task declaration
41103 without a task_definition, a task_definition without task_items is
41104 assumed.
41105
41106 9.2/3
41107 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01}
41108 {AI95-00399-01AI95-00399-01} {AI95-00419-01AI95-00419-01}
41109 {AI05-0042-1AI05-0042-1} For a task declaration with an interface_list,
41110 the task type inherits user-defined primitive subprograms from each
41111 progenitor type (see *note 3.9.4::), in the same way that a derived type
41112 inherits user-defined primitive subprograms from its progenitor types
41113 (see *note 3.4::). If the first parameter of a primitive inherited
41114 subprogram is of the task type or an access parameter designating the
41115 task type, and there is an entry_declaration for a single entry with the
41116 same identifier within the task declaration, whose profile is type
41117 conformant with the prefixed view profile of the inherited subprogram,
41118 the inherited subprogram is said to be implemented by the conforming
41119 task entry using an implicitly declared nonabstract subprogram which has
41120 the same profile as the inherited subprogram and which overrides it.
41121
41122 9.b/2
41123 Ramification: The inherited subprograms can only come from an
41124 interface given as part of the task declaration.
41125
41126 9.b.1/3
41127 Reason: {AI05-0042-1AI05-0042-1} The part about the implicitly
41128 declared subprogram is needed so that a subprogram implemented
41129 by an entry is considered to be overridden for the purpose of
41130 the other rules of the language. Without it, it would for
41131 instance be illegal for an abstract subprogram to be
41132 implemented by an entry, because the abstract subprogram would
41133 not be overridden. The Legality Rules below ensure that there
41134 is no conflict between the implicit overriding subprogram and
41135 a user-defined overriding subprogram.
41136
41137 _Legality Rules_
41138
41139 9.3/2
41140 {AI95-00345-01AI95-00345-01} A task declaration requires a completion[,
41141 which shall be a task_body,] and every task_body shall be the completion
41142 of some task declaration.
41143
41144 9.c/3
41145 To be honest: {AI05-0229-1AI05-0229-1} If the implementation
41146 supports it, the task body can be imported (using aspect
41147 Import, see *note B.1::), in which case no explicit task_body
41148 is allowed.
41149
41150 9.4/2
41151 {AI95-00345-01AI95-00345-01} {AI95-00399-01AI95-00399-01} [Each
41152 interface_subtype_mark of an interface_list appearing within a task
41153 declaration shall denote a limited interface type that is not a
41154 protected interface.]
41155
41156 9.d/2
41157 Proof: *note 3.9.4:: requires that an interface_list only name
41158 interface types, and limits the descendants of the various
41159 kinds of interface types. Only a limited, task, or
41160 synchronized interface can have a task type descendant.
41161 Nonlimited or protected interfaces are not allowed, as they
41162 offer operations that a task does not have.
41163
41164 9.5/3
41165 {AI95-00397-01AI95-00397-01} {AI05-0090-1AI05-0090-1} The prefixed view
41166 profile of an explicitly declared primitive subprogram of a tagged task
41167 type shall not be type conformant with any entry of the task type, if
41168 the subprogram has the same defining name as the entry and the first
41169 parameter of the subprogram is of the task type or is an access
41170 parameter designating the task type.
41171
41172 9.e/2
41173 Reason: This prevents the existence of two operations with the
41174 same name and profile which could be called with a prefixed
41175 view. If the operation was inherited, this would be illegal
41176 by the following rules; this rule puts inherited and
41177 noninherited routines on the same footing. Note that this
41178 only applies to tagged task types (that is, those with an
41179 interface in their declaration); we do that as there is no
41180 problem with prefixed view calls of primitive operations for
41181 "normal" task types, and having this rule apply to all tasks
41182 would be incompatible with Ada 95.
41183
41184 9.6/2
41185 {AI95-00345-01AI95-00345-01} {AI95-00399-01AI95-00399-01} For each
41186 primitive subprogram inherited by the type declared by a task
41187 declaration, at most one of the following shall apply:
41188
41189 9.7/2
41190 * {AI95-00345-01AI95-00345-01} the inherited subprogram is overridden
41191 with a primitive subprogram of the task type, in which case the
41192 overriding subprogram shall be subtype conformant with the
41193 inherited subprogram and not abstract; or
41194
41195 9.8/2
41196 * {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01} the
41197 inherited subprogram is implemented by a single entry of the task
41198 type; in which case its prefixed view profile shall be subtype
41199 conformant with that of the task entry.
41200
41201 9.f/2
41202 Ramification: An entry may implement two subprograms from the
41203 ancestors, one whose first parameter is of type T and one
41204 whose first parameter is of type access T. That doesn't cause
41205 implementation problems because "implemented by" (unlike
41206 "overridden') probably entails the creation of wrappers.
41207
41208 9.9/2
41209 If neither applies, the inherited subprogram shall be a null procedure.
41210 In addition to the places where Legality Rules normally apply (see *note
41211 12.3::), these rules also apply in the private part of an instance of a
41212 generic unit.
41213
41214 9.g/2
41215 Reason: Each inherited subprogram can only have a single
41216 implementation (either from overriding a subprogram or
41217 implementing an entry), and must have an implementation unless
41218 the subprogram is a null procedure.
41219
41220 _Dynamic Semantics_
41221
41222 10
41223 [ The elaboration of a task declaration elaborates the task_definition.
41224 The elaboration of a single_task_declaration (*note 9.1: S0206.) also
41225 creates an object of an (anonymous) task type.]
41226
41227 10.a
41228 Proof: This is redundant with the general rules for the
41229 elaboration of a full_type_declaration and an
41230 object_declaration.
41231
41232 11
41233 [The elaboration of a task_definition creates the task type and its
41234 first subtype;] it also includes the elaboration of the
41235 entry_declarations in the given order.
41236
41237 12/1
41238 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} As part of the
41239 initialization of a task object, any aspect_clauses and any per-object
41240 constraints associated with entry_declaration (*note 9.5.2: S0218.)s of
41241 the corresponding task_definition (*note 9.1: S0207.) are elaborated in
41242 the given order.
41243
41244 12.a/1
41245 Reason: The only aspect_clauses defined for task entries are
41246 ones that specify the Address of an entry, as part of defining
41247 an interrupt entry. These clearly need to be elaborated
41248 per-object, not per-type. Normally the address will be a
41249 function of a discriminant, if such an Address clause is in a
41250 task type rather than a single task declaration, though it
41251 could rely on a parameterless function that allocates
41252 sequential interrupt vectors.
41253
41254 12.b
41255 We do not mention representation pragmas, since each pragma
41256 may have its own elaboration rules.
41257
41258 13
41259 The elaboration of a task_body has no effect other than to establish
41260 that tasks of the type can from then on be activated without failing the
41261 Elaboration_Check.
41262
41263 14
41264 [The execution of a task_body is invoked by the activation of a task of
41265 the corresponding type (see *note 9.2::).]
41266
41267 15
41268 The content of a task object of a given task type includes:
41269
41270 16
41271 * The values of the discriminants of the task object, if any;
41272
41273 17
41274 * An entry queue for each entry of the task object;
41275
41276 17.a
41277 Ramification: "For each entry" implies one queue for each
41278 single entry, plus one for each entry of each entry family.
41279
41280 18
41281 * A representation of the state of the associated task.
41282
41283 NOTES
41284
41285 19/2
41286 2 {AI95-00382-01AI95-00382-01} Other than in an access_definition,
41287 the name of a task unit within the declaration or body of the task
41288 unit denotes the current instance of the unit (see *note 8.6::),
41289 rather than the first subtype of the corresponding task type (and
41290 thus the name cannot be used as a subtype_mark).
41291
41292 19.a/2
41293 Discussion: {AI95-00382-01AI95-00382-01} It can be used as a
41294 subtype_mark in an anonymous access type. In addition, it is
41295 possible to refer to some other subtype of the task type
41296 within its body, presuming such a subtype has been declared
41297 between the task_type_declaration and the task_body.
41298
41299 20
41300 3 The notation of a selected_component can be used to denote a
41301 discriminant of a task (see *note 4.1.3::). Within a task unit,
41302 the name of a discriminant of the task type denotes the
41303 corresponding discriminant of the current instance of the unit.
41304
41305 21/2
41306 4 {AI95-00287-01AI95-00287-01} A task type is a limited type (see
41307 *note 7.5::), and hence precludes use of assignment_statements and
41308 predefined equality operators. If an application needs to store
41309 and exchange task identities, it can do so by defining an access
41310 type designating the corresponding task objects and by using access
41311 values for identification purposes. Assignment is available for
41312 such an access type as for any access type. Alternatively, if the
41313 implementation supports the Systems Programming Annex, the Identity
41314 attribute can be used for task identification (see *note C.7.1::).
41315
41316 _Examples_
41317
41318 22
41319 Examples of declarations of task types:
41320
41321 23
41322 task type Server is
41323 entry Next_Work_Item(WI : in Work_Item);
41324 entry Shut_Down;
41325 end Server;
41326
41327 24/2
41328 {AI95-00433-01AI95-00433-01} task type Keyboard_Driver(ID : Keyboard_ID := New_ID) is
41329 new Serial_Device with -- see *note 3.9.4::
41330 entry Read (C : out Character);
41331 entry Write(C : in Character);
41332 end Keyboard_Driver;
41333
41334 25
41335 Examples of declarations of single tasks:
41336
41337 26
41338 task Controller is
41339 entry Request(Level)(D : Item); -- a family of entries
41340 end Controller;
41341
41342 27
41343 task Parser is
41344 entry Next_Lexeme(L : in Lexical_Element);
41345 entry Next_Action(A : out Parser_Action);
41346 end;
41347
41348 28
41349 task User; -- has no entries
41350
41351 29
41352 Examples of task objects:
41353
41354 30
41355 Agent : Server;
41356 Teletype : Keyboard_Driver(TTY_ID);
41357 Pool : array(1 .. 10) of Keyboard_Driver;
41358
41359 31
41360 Example of access type designating task objects:
41361
41362 32
41363 type Keyboard is access Keyboard_Driver;
41364 Terminal : Keyboard := new Keyboard_Driver(Term_ID);
41365
41366 _Extensions to Ada 83_
41367
41368 32.a/1
41369 The syntax rules for task declarations are modified to allow a
41370 known_discriminant_part, and to allow a private part. They
41371 are also modified to allow entry_declarations and
41372 aspect_clauses to be mixed.
41373
41374 _Wording Changes from Ada 83_
41375
41376 32.b
41377 The syntax rules for tasks have been split up according to
41378 task types and single tasks. In particular: The syntax rules
41379 for task_declaration and task_specification are removed. The
41380 syntax rules for task_type_declaration,
41381 single_task_declaration, task_definition and task_item are
41382 new.
41383
41384 32.c
41385 The syntax rule for task_body now uses the nonterminal
41386 handled_sequence_of_statements.
41387
41388 32.d
41389 The declarative_part of a task_body is now required; that
41390 doesn't make any real difference, because a declarative_part
41391 can be empty.
41392
41393 _Extensions to Ada 95_
41394
41395 32.e/2
41396 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01}
41397 {AI95-00399-01AI95-00399-01} {AI95-00419-01AI95-00419-01} Task
41398 types and single tasks can be derived from one or more
41399 interfaces. Entries of the task type can implement the
41400 primitive operations of an interface. Overriding_indicators
41401 can be used to specify whether or not an entry implements a
41402 primitive operation.
41403
41404 _Wording Changes from Ada 95_
41405
41406 32.f/2
41407 {8652/00298652/0029} {AI95-00116-01AI95-00116-01} Corrigendum:
41408 Clarified that a task type has an implicit empty
41409 task_definition if none is given.
41410
41411 32.g/2
41412 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
41413 Changed representation clauses to aspect clauses to reflect
41414 that they are used for more than just representation.
41415
41416 32.h/2
41417 {AI95-00287-01AI95-00287-01} Revised the note on operations of
41418 task types to reflect that limited types do have an assignment
41419 operation, but not copying (assignment_statements).
41420
41421 32.i/2
41422 {AI95-00382-01AI95-00382-01} Revised the note on use of the
41423 name of a task type within itself to reflect the exception for
41424 anonymous access types.
41425
41426 _Extensions to Ada 2005_
41427
41428 32.j/3
41429 {AI05-0183-1AI05-0183-1} {AI05-0267-1AI05-0267-1} An optional
41430 aspect_specification can be used in a task_type_declaration, a
41431 single_task_declaration, and a task_body. This is described
41432 in *note 13.1.1::.
41433
41434 _Wording Changes from Ada 2005_
41435
41436 32.k/3
41437 {AI05-0042-1AI05-0042-1} Correction: Clarified that an
41438 inherited procedure of a progenitor is overridden when it is
41439 implemented by an entry.
41440
41441 32.l/3
41442 {AI05-0090-1AI05-0090-1} Correction: Added the missing
41443 defining name in the no conflicting primitive operation rule.
41444
41445 \1f
41446 File: aarm2012.info, Node: 9.2, Next: 9.3, Prev: 9.1, Up: 9
41447
41448 9.2 Task Execution - Task Activation
41449 ====================================
41450
41451 _Dynamic Semantics_
41452
41453 1
41454 The execution of a task of a given task type consists of the execution
41455 of the corresponding task_body. The initial part of this execution is
41456 called the activation of the task; it consists of the elaboration of the
41457 declarative_part of the task_body. Should an exception be propagated by
41458 the elaboration of its declarative_part, the activation of the task is
41459 defined to have failed, and it becomes a completed task.
41460
41461 2/2
41462 {AI95-00416-01AI95-00416-01} A task object (which represents one task)
41463 can be a part of a stand-alone object, of an object created by an
41464 allocator, or of an anonymous object of a limited type, or a coextension
41465 of one of these. All tasks that are part or coextensions of any of the
41466 stand-alone objects created by the elaboration of object_declaration
41467 (*note 3.3.1: S0032.)s (or generic_associations of formal objects of
41468 mode in) of a single declarative region are activated together. All
41469 tasks that are part or coextensions of a single object that is not a
41470 stand-alone object are activated together.
41471
41472 2.a
41473 Discussion: The initialization of an object_declaration or
41474 allocator can indirectly include the creation of other objects
41475 that contain tasks. For example, the default expression for a
41476 subcomponent of an object created by an allocator might call a
41477 function that evaluates a completely different allocator.
41478 Tasks created by the two allocators are not activated
41479 together.
41480
41481 3/2
41482 {AI95-00416-01AI95-00416-01} For the tasks of a given declarative
41483 region, the activations are initiated within the context of the
41484 handled_sequence_of_statements (*note 11.2: S0265.) (and its associated
41485 exception_handler (*note 11.2: S0266.)s if any -- see *note 11.2::),
41486 just prior to executing the statements of the
41487 handled_sequence_of_statements. [For a package without an explicit body
41488 or an explicit handled_sequence_of_statements (*note 11.2: S0265.), an
41489 implicit body or an implicit null_statement (*note 5.1: S0149.) is
41490 assumed, as defined in *note 7.2::.]
41491
41492 3.a
41493 Ramification: If Tasking_Error is raised, it can be handled by
41494 handlers of the handled_sequence_of_statements (*note 11.2:
41495 S0265.).
41496
41497 4/2
41498 {AI95-00416-01AI95-00416-01} For tasks that are part or coextensions of
41499 a single object that is not a stand-alone object, activations are
41500 initiated after completing any initialization of the outermost object
41501 enclosing these tasks, prior to performing any other operation on the
41502 outermost object. In particular, for tasks that are part or
41503 coextensions of the object created by the evaluation of an allocator,
41504 the activations are initiated as the last step of evaluating the
41505 allocator, prior to returning the new access value. For tasks that are
41506 part or coextensions of an object that is the result of a function call,
41507 the activations are not initiated until after the function returns.
41508
41509 4.a/2
41510 Discussion: {AI95-00416-01AI95-00416-01} The intent is that
41511 "temporary" objects with task parts (or coextensions) are
41512 treated similarly to an object created by an allocator. The
41513 "whole" object is initialized, and then all of the task parts
41514 (including the coextensions) are activated together. Each
41515 such "whole" object has its own task activation sequence,
41516 involving the activating task being suspended until all the
41517 new tasks complete their activation.
41518
41519 5
41520 The task that created the new tasks and initiated their activations (the
41521 activator) is blocked until all of these activations complete
41522 (successfully or not). Once all of these activations are complete, if
41523 the activation of any of the tasks has failed [(due to the propagation
41524 of an exception)], Tasking_Error is raised in the activator, at the
41525 place at which it initiated the activations. Otherwise, the activator
41526 proceeds with its execution normally. Any tasks that are aborted prior
41527 to completing their activation are ignored when determining whether to
41528 raise Tasking_Error.
41529
41530 5.a
41531 Ramification: Note that a task created by an allocator does
41532 not necessarily depend on its activator; in such a case the
41533 activator's termination can precede the termination of the
41534 newly created task.
41535
41536 5.b
41537 Discussion: Tasking_Error is raised only once, even if two or
41538 more of the tasks being activated fail their activation.
41539
41540 5.c/2
41541 To be honest: {AI95-00265-01AI95-00265-01} The pragma
41542 Partition_Elaboration_Policy (see *note H.6::) can be used to
41543 defer task activation to a later point, thus changing many of
41544 these rules.
41545
41546 6/3
41547 {AI05-0045-1AI05-0045-1} If the master that directly encloses the point
41548 where the activation of a task T would be initiated, completes before
41549 the activation of T is initiated, T becomes terminated and is never
41550 activated. Furthermore, if a return statement is left such that the
41551 return object is not returned to the caller, any task that was created
41552 as a part of the return object or one of its coextensions immediately
41553 becomes terminated and is never activated.
41554
41555 6.a/3
41556 Ramification: {AI05-0045-1AI05-0045-1} The first case can only
41557 happen if the activation point of T is not reached due to an
41558 exception being raised or a task or statement being aborted.
41559 Note that this is exclusive; if the master completes normally
41560 and starts finalization, we're already past the activation
41561 point.
41562
41563 6.b/3
41564 {AI05-0045-1AI05-0045-1} The second case can happen with an
41565 exception being raised in a return statement, by an exit or
41566 goto from an extended_return_statement, or by a return
41567 statement being aborted. Any tasks created for the return
41568 object of such a return statement are never activated.
41569
41570 NOTES
41571
41572 7
41573 5 An entry of a task can be called before the task has been
41574 activated.
41575
41576 8
41577 6 If several tasks are activated together, the execution of any of
41578 these tasks need not await the end of the activation of the other
41579 tasks.
41580
41581 9
41582 7 A task can become completed during its activation either because
41583 of an exception or because it is aborted (see *note 9.8::).
41584
41585 _Examples_
41586
41587 10
41588 Example of task activation:
41589
41590 11
41591 procedure P is
41592 A, B : Server; -- elaborate the task objects A, B
41593 C : Server; -- elaborate the task object C
41594 begin
41595 -- the tasks A, B, C are activated together before the first statement
41596 ...
41597 end;
41598
41599 _Wording Changes from Ada 83_
41600
41601 11.a
41602 We have replaced the term suspended with blocked, since we
41603 didn't want to consider a task blocked when it was simply
41604 competing for execution resources. "Suspended" is sometimes
41605 used more generally to refer to tasks that are not actually
41606 running on some processor, due to the lack of resources.
41607
41608 11.b/3
41609 {AI05-0299-1AI05-0299-1} This subclause has been rewritten in
41610 an attempt to improve presentation.
41611
41612 _Wording Changes from Ada 95_
41613
41614 11.c/2
41615 {AI95-00416-01AI95-00416-01} Adjusted the wording for
41616 activating tasks to handle the case of anonymous function
41617 return objects. This is critical; we don't want to be waiting
41618 for the tasks in a return object when we exit the function
41619 normally.
41620
41621 _Wording Changes from Ada 2005_
41622
41623 11.d/3
41624 {AI05-0045-1AI05-0045-1} Correction: Corrected the wording
41625 that handles tasks that are never activated to ensure that no
41626 lookahead is implied and to make it clear that tasks created
41627 by return statements that never return are never activated.
41628
41629 \1f
41630 File: aarm2012.info, Node: 9.3, Next: 9.4, Prev: 9.2, Up: 9
41631
41632 9.3 Task Dependence - Termination of Tasks
41633 ==========================================
41634
41635 _Dynamic Semantics_
41636
41637 1
41638 Each task (other than an environment task -- see *note 10.2::) depends
41639 on one or more masters (see *note 7.6.1::), as follows:
41640
41641 2
41642 * If the task is created by the evaluation of an allocator for a
41643 given access type, it depends on each master that includes the
41644 elaboration of the declaration of the ultimate ancestor of the
41645 given access type.
41646
41647 3
41648 * If the task is created by the elaboration of an object_declaration,
41649 it depends on each master that includes this elaboration.
41650
41651 3.1/2
41652 * {AI95-00416-01AI95-00416-01} Otherwise, the task depends on the
41653 master of the outermost object of which it is a part (as determined
41654 by the accessibility level of that object -- see *note 3.10.2:: and
41655 *note 7.6.1::), as well as on any master whose execution includes
41656 that of the master of the outermost object.
41657
41658 3.a/2
41659 Ramification: {AI95-00416-01AI95-00416-01} The master of a
41660 task created by a return statement changes when the
41661 accessibility of the return object changes. Note that its
41662 activation happens, if at all, only after the function returns
41663 and all accessibility level changes have occurred.
41664
41665 4
41666 Furthermore, if a task depends on a given master, it is defined to
41667 depend on the task that executes the master, and (recursively) on any
41668 master of that task.
41669
41670 4.a
41671 Discussion: Don't confuse these kinds of dependences with the
41672 dependences among compilation units defined in *note 10.1.1::,
41673 "*note 10.1.1:: Compilation Units - Library Units".
41674
41675 5
41676 A task is said to be completed when the execution of its corresponding
41677 task_body is completed. A task is said to be terminated when any
41678 finalization of the task_body has been performed (see *note 7.6.1::).
41679 [The first step of finalizing a master (including a task_body) is to
41680 wait for the termination of any tasks dependent on the master.] The
41681 task executing the master is blocked until all the dependents have
41682 terminated. [Any remaining finalization is then performed and the
41683 master is left.]
41684
41685 6/1
41686 Completion of a task (and the corresponding task_body) can occur when
41687 the task is blocked at a select_statement (*note 9.7: S0230.) with an
41688 open terminate_alternative (see *note 9.7.1::); the open
41689 terminate_alternative is selected if and only if the following
41690 conditions are satisfied:
41691
41692 7/2
41693 * {AI95-00415-01AI95-00415-01} The task depends on some completed
41694 master; and
41695
41696 8
41697 * Each task that depends on the master considered is either already
41698 terminated or similarly blocked at a select_statement with an open
41699 terminate_alternative.
41700
41701 9
41702 When both conditions are satisfied, the task considered becomes
41703 completed, together with all tasks that depend on the master considered
41704 that are not yet completed.
41705
41706 9.a
41707 Ramification: Any required finalization is performed after the
41708 selection of terminate_alternatives. The tasks are not
41709 callable during the finalization. In some ways it is as
41710 though they were aborted.
41711
41712 NOTES
41713
41714 10
41715 8 The full view of a limited private type can be a task type, or
41716 can have subcomponents of a task type. Creation of an object of
41717 such a type creates dependences according to the full type.
41718
41719 11
41720 9 An object_renaming_declaration defines a new view of an existing
41721 entity and hence creates no further dependence.
41722
41723 12
41724 10 The rules given for the collective completion of a group of
41725 tasks all blocked on select_statements with open
41726 terminate_alternatives ensure that the collective completion can
41727 occur only when there are no remaining active tasks that could call
41728 one of the tasks being collectively completed.
41729
41730 13
41731 11 If two or more tasks are blocked on select_statements with open
41732 terminate_alternatives, and become completed collectively, their
41733 finalization actions proceed concurrently.
41734
41735 14
41736 12 The completion of a task can occur due to any of the following:
41737
41738 15
41739 * the raising of an exception during the elaboration of the
41740 declarative_part of the corresponding task_body;
41741
41742 16
41743 * the completion of the handled_sequence_of_statements of the
41744 corresponding task_body;
41745
41746 17
41747 * the selection of an open terminate_alternative of a
41748 select_statement in the corresponding task_body;
41749
41750 18
41751 * the abort of the task.
41752
41753 _Examples_
41754
41755 19
41756 Example of task dependence:
41757
41758 20
41759 declare
41760 type Global is access Server; -- see *note 9.1::
41761 A, B : Server;
41762 G : Global;
41763 begin
41764 -- activation of A and B
41765 declare
41766 type Local is access Server;
41767 X : Global := new Server; -- activation of X.all
41768 L : Local := new Server; -- activation of L.all
41769 C : Server;
41770 begin
41771 -- activation of C
41772 G := X; -- both G and X designate the same task object
41773 ...
41774 end; -- await termination of C and L.all (but not X.all)
41775 ...
41776 end; -- await termination of A, B, and G.all
41777
41778 _Wording Changes from Ada 83_
41779
41780 20.a
41781 We have revised the wording to be consistent with the
41782 definition of master now given in *note 7.6.1::, "*note
41783 7.6.1:: Completion and Finalization".
41784
41785 20.b
41786 Tasks that used to depend on library packages in Ada 83, now
41787 depend on the (implicit) task_body of the environment task
41788 (see *note 10.2::). Therefore, the environment task has to
41789 wait for them before performing library level finalization and
41790 terminating the partition. In Ada 83 the requirement to wait
41791 for tasks that depended on library packages was not as clear.
41792
41793 20.c
41794 What was "collective termination" is now "collective
41795 completion" resulting from selecting terminate_alternatives.
41796 This is because finalization still occurs for such tasks, and
41797 this happens after selecting the terminate_alternative, but
41798 before termination.
41799
41800 _Wording Changes from Ada 95_
41801
41802 20.d/2
41803 {AI95-00416-01AI95-00416-01} Added missing wording that
41804 explained the master of tasks that are neither object
41805 declarations nor allocators, such as function returns.
41806
41807 \1f
41808 File: aarm2012.info, Node: 9.4, Next: 9.5, Prev: 9.3, Up: 9
41809
41810 9.4 Protected Units and Protected Objects
41811 =========================================
41812
41813 1
41814 A protected object provides coordinated access to shared data, through
41815 calls on its visible protected operations, which can be protected
41816 subprograms or protected entries. A protected unit is declared by a
41817 protected declaration, which has a corresponding protected_body. A
41818 protected declaration may be a protected_type_declaration, in which case
41819 it declares a named protected type; alternatively, it may be a
41820 single_protected_declaration, in which case it defines an anonymous
41821 protected type, as well as declaring a named protected object of that
41822 type.
41823
41824 _Syntax_
41825
41826 2/3
41827 {AI95-00345-01AI95-00345-01} {AI05-0183-1AI05-0183-1}
41828 protected_type_declaration ::=
41829 protected type defining_identifier [known_discriminant_part]
41830 [aspect_specification] is
41831 [new interface_list with]
41832 protected_definition;
41833
41834 3/3
41835 {AI95-00399-01AI95-00399-01} {AI05-0183-1AI05-0183-1}
41836 single_protected_declaration ::=
41837 protected defining_identifier
41838 [aspect_specification] is
41839 [new interface_list with]
41840 protected_definition;
41841
41842 4
41843 protected_definition ::=
41844 { protected_operation_declaration }
41845 [ private
41846 { protected_element_declaration } ]
41847 end [protected_identifier]
41848
41849 5/1
41850 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
41851 protected_operation_declaration ::= subprogram_declaration
41852 | entry_declaration
41853 | aspect_clause
41854
41855 6
41856 protected_element_declaration ::= protected_operation_declaration
41857 | component_declaration
41858
41859 6.a
41860 Reason: We allow the operations and components to be mixed
41861 because that's how other things work (for example, package
41862 declarations). We have relaxed the ordering rules for the
41863 items inside declarative_parts and task_definitions as well.
41864
41865 7/3
41866 {AI05-0267-1AI05-0267-1} protected_body ::=
41867 protected body defining_identifier
41868 [aspect_specification] is
41869 { protected_operation_item }
41870 end [protected_identifier];
41871
41872 8/1
41873 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
41874 protected_operation_item ::= subprogram_declaration
41875 | subprogram_body
41876 | entry_body
41877 | aspect_clause
41878
41879 9
41880 If a protected_identifier appears at the end of a
41881 protected_definition or protected_body, it shall repeat the
41882 defining_identifier.
41883
41884 10.a/2
41885 This paragraph was deleted.
41886
41887 Paragraph 10 was deleted.
41888
41889 _Static Semantics_
41890
41891 11/2
41892 {AI95-00345-01AI95-00345-01} {AI95-00401-01AI95-00401-01} A
41893 protected_definition defines a protected type and its first subtype.
41894 The list of protected_operation_declaration (*note 9.4: S0213.)s of a
41895 protected_definition (*note 9.4: S0212.), together with the
41896 known_discriminant_part (*note 3.7: S0061.), if any, is called the
41897 visible part of the protected unit. [ The optional list of
41898 protected_element_declaration (*note 9.4: S0214.)s after the reserved
41899 word private is called the private part of the protected unit.]
41900
41901 11.a/3
41902 Proof: {AI05-0299-1AI05-0299-1} Private part is defined in
41903 Clause *note 8::.
41904
41905 11.1/3
41906 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01}
41907 {AI95-00399-01AI95-00399-01} {AI95-00419-01AI95-00419-01}
41908 {AI05-0042-1AI05-0042-1} For a protected declaration with an
41909 interface_list, the protected type inherits user-defined primitive
41910 subprograms from each progenitor type (see *note 3.9.4::), in the same
41911 way that a derived type inherits user-defined primitive subprograms from
41912 its progenitor types (see *note 3.4::). If the first parameter of a
41913 primitive inherited subprogram is of the protected type or an access
41914 parameter designating the protected type, and there is a
41915 protected_operation_declaration for a protected subprogram or single
41916 entry with the same identifier within the protected declaration, whose
41917 profile is type conformant with the prefixed view profile of the
41918 inherited subprogram, the inherited subprogram is said to be implemented
41919 by the conforming protected subprogram or entry using an implicitly
41920 declared nonabstract subprogram which has the same profile as the
41921 inherited subprogram and which overrides it.
41922
41923 11.b/2
41924 Ramification: The inherited subprograms can only come from an
41925 interface given as part of the protected declaration.
41926
41927 11.b.1/3
41928 Reason: {AI05-0042-1AI05-0042-1} The part about the implicitly
41929 declared subprogram is needed so that a subprogram implemented
41930 by an entry or subprogram is considered to be overridden for
41931 the purpose of the other rules of the language. Without it,
41932 it would for instance be illegal for an abstract subprogram to
41933 be implemented by an entry, because the abstract subprogram
41934 would not be overridden. The Legality Rules below ensure that
41935 there is no conflict between the implicit overriding
41936 subprogram and a user-defined overriding subprogram.
41937
41938 _Legality Rules_
41939
41940 11.2/2
41941 {AI95-00345-01AI95-00345-01} A protected declaration requires a
41942 completion[, which shall be a protected_body (*note 9.4: S0215.),] and
41943 every protected_body (*note 9.4: S0215.) shall be the completion of some
41944 protected declaration.
41945
41946 11.c/3
41947 To be honest: {AI05-0229-1AI05-0229-1} If the implementation
41948 supports it, the protected body can be imported (using aspect
41949 Import, see *note B.1::), in which case no explicit
41950 protected_body is allowed.
41951
41952 11.3/2
41953 {AI95-00345-01AI95-00345-01} {AI95-00399-01AI95-00399-01} [Each
41954 interface_subtype_mark of an interface_list appearing within a protected
41955 declaration shall denote a limited interface type that is not a task
41956 interface.]
41957
41958 11.d/2
41959 Proof: *note 3.9.4:: requires that an interface_list only name
41960 interface types, and limits the descendants of the various
41961 kinds of interface types. Only a limited, protected, or
41962 synchronized interface can have a protected type descendant.
41963 Nonlimited or task interfaces are not allowed, as they offer
41964 operations that a protected type does not have.
41965
41966 11.4/3
41967 {AI95-00397-01AI95-00397-01} {AI05-0042-1AI05-0042-1} The prefixed view
41968 profile of an explicitly declared primitive subprogram of a tagged
41969 protected type shall not be type conformant with any protected operation
41970 of the protected type, if the subprogram has the same defining name as
41971 the protected operation and the first parameter of the subprogram is of
41972 the protected type or is an access parameter designating the protected
41973 type.
41974
41975 11.e/2
41976 Reason: This prevents the existence of two operations with the
41977 same name and profile which could be called with a prefixed
41978 view. If the operation was inherited, this would be illegal
41979 by the following rules; this rule puts inherited and
41980 noninherited routines on the same footing. Note that this
41981 only applies to tagged protected types (that is, those with an
41982 interface in their declaration); we do that as there is no
41983 problem with prefixed view calls of primitive operations for
41984 "normal" protected types, and having this rule apply to all
41985 protected types would be incompatible with Ada 95.
41986
41987 11.5/2
41988 {AI95-00345-01AI95-00345-01} {AI95-00399-01AI95-00399-01} For each
41989 primitive subprogram inherited by the type declared by a protected
41990 declaration, at most one of the following shall apply:
41991
41992 11.6/2
41993 * {AI95-00345-01AI95-00345-01} the inherited subprogram is overridden
41994 with a primitive subprogram of the protected type, in which case
41995 the overriding subprogram shall be subtype conformant with the
41996 inherited subprogram and not abstract; or
41997
41998 11.7/2
41999 * {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01} the
42000 inherited subprogram is implemented by a protected subprogram or
42001 single entry of the protected type, in which case its prefixed view
42002 profile shall be subtype conformant with that of the protected
42003 subprogram or entry.
42004
42005 11.8/2
42006 If neither applies, the inherited subprogram shall be a null procedure.
42007 In addition to the places where Legality Rules normally apply (see *note
42008 12.3::), these rules also apply in the private part of an instance of a
42009 generic unit.
42010
42011 11.f/2
42012 Reason: Each inherited subprogram can only have a single
42013 implementation (either from overriding a subprogram,
42014 implementing a subprogram, or implementing an entry), and must
42015 have an implementation unless the subprogram is a null
42016 procedure.
42017
42018 11.9/3
42019 {AI95-00345-01AI95-00345-01} {AI05-0291-1AI05-0291-1} If an inherited
42020 subprogram is implemented by a protected procedure or an entry, then the
42021 first parameter of the inherited subprogram shall be of mode out or in
42022 out, or an access-to-variable parameter. If an inherited subprogram is
42023 implemented by a protected function, then the first parameter of the
42024 inherited subprogram shall be of mode in, but not an access-to-variable
42025 parameter.
42026
42027 11.g/3
42028 Reason: For a protected procedure or entry, the protected
42029 object can be read or written (see *note 9.5.1::). A
42030 subprogram that is implemented by a protected procedure or
42031 entry must have a profile which reflects that in order to
42032 avoid confusion. Similarly, a protected function has a
42033 parameter that is a constant, and the inherited routine should
42034 reflect that.
42035
42036 11.10/2
42037 {AI95-00397-01AI95-00397-01} If a protected subprogram declaration has
42038 an overriding_indicator, then at the point of the declaration:
42039
42040 11.11/2
42041 * if the overriding_indicator is overriding, then the subprogram
42042 shall implement an inherited subprogram;
42043
42044 11.12/2
42045 * if the overriding_indicator is not overriding, then the subprogram
42046 shall not implement any inherited subprogram.
42047
42048 11.13/2
42049 In addition to the places where Legality Rules normally apply (see *note
42050 12.3::), these rules also apply in the private part of an instance of a
42051 generic unit.
42052
42053 11.h/2
42054 Discussion: These rules are subtly different than those for
42055 subprograms (see *note 8.3.1::) because there cannot be "late"
42056 inheritance of primitives from interfaces. Hidden (that is,
42057 private) interfaces are prohibited explicitly (see *note
42058 7.3::), as are hidden primitive operations (as private
42059 operations of public abstract types are prohibited -- see
42060 *note 3.9.3::).
42061
42062 _Dynamic Semantics_
42063
42064 12
42065 [The elaboration of a protected declaration elaborates the
42066 protected_definition. The elaboration of a single_protected_declaration
42067 (*note 9.4: S0211.) also creates an object of an (anonymous) protected
42068 type.]
42069
42070 12.a
42071 Proof: This is redundant with the general rules for the
42072 elaboration of a full_type_declaration and an
42073 object_declaration.
42074
42075 13
42076 [The elaboration of a protected_definition creates the protected type
42077 and its first subtype;] it also includes the elaboration of the
42078 component_declarations and protected_operation_declarations in the given
42079 order.
42080
42081 14
42082 [As part of the initialization of a protected object, any per-object
42083 constraints (see *note 3.8::) are elaborated.]
42084
42085 14.a
42086 Discussion: We do not mention pragmas since each pragma has
42087 its own elaboration rules.
42088
42089 15
42090 The elaboration of a protected_body has no other effect than to
42091 establish that protected operations of the type can from then on be
42092 called without failing the Elaboration_Check.
42093
42094 16
42095 The content of an object of a given protected type includes:
42096
42097 17
42098 * The values of the components of the protected object, including
42099 (implicitly) an entry queue for each entry declared for the
42100 protected object;
42101
42102 17.a
42103 Ramification: "For each entry" implies one queue for each
42104 single entry, plus one for each entry of each entry family.
42105
42106 18
42107 * A representation of the state of the execution resource associated
42108 with the protected object (one such resource is associated with
42109 each protected object).
42110
42111 19
42112 [The execution resource associated with a protected object has to be
42113 acquired to read or update any components of the protected object; it
42114 can be acquired (as part of a protected action -- see *note 9.5.1::)
42115 either for concurrent read-only access, or for exclusive read-write
42116 access.]
42117
42118 20
42119 As the first step of the finalization of a protected object, each call
42120 remaining on any entry queue of the object is removed from its queue and
42121 Program_Error is raised at the place of the corresponding
42122 entry_call_statement (*note 9.5.3: S0225.).
42123
42124 20.a
42125 Reason: This is analogous to the raising of Tasking_Error in
42126 callers of a task that completes before accepting the calls.
42127 This situation can only occur due to a requeue (ignoring
42128 premature unchecked_deallocation), since any task that has
42129 accessibility to a protected object is awaited before
42130 finalizing the protected object. For example:
42131
42132 20.b
42133 procedure Main is
42134 task T is
42135 entry E;
42136 end T;
42137
42138 20.c
42139 task body T is
42140 protected PO is
42141 entry Ee;
42142 end PO;
42143
42144 20.d
42145 protected body PO is
42146 entry Ee when False is
42147 begin
42148 null;
42149 end Ee;
42150 end PO;
42151 begin
42152 accept E do
42153 requeue PO.Ee;
42154 end E;
42155 end T;
42156 begin
42157 T.E;
42158 end Main;
42159
42160 20.e/3
42161 {AI05-0005-1AI05-0005-1} The environment task is queued on
42162 PO.Ee when PO is finalized.
42163
42164 20.f
42165 In a real example, a server task might park callers on a local
42166 protected object for some useful purpose, so we didn't want to
42167 disallow this case.
42168
42169 _Bounded (Run-Time) Errors_
42170
42171 20.1/2
42172 {AI95-00280-01AI95-00280-01} It is a bounded error to call an entry or
42173 subprogram of a protected object after that object is finalized. If the
42174 error is detected, Program_Error is raised. Otherwise, the call
42175 proceeds normally, which may leave a task queued forever.
42176
42177 20.g/2
42178 Reason: This is very similar to the finalization rule. It is
42179 a bounded error so that an implementation can avoid the
42180 overhead of the check if it can ensure that the call still
42181 will operate properly. Such an implementation cannot need to
42182 return resources (such as locks) to an executive that it needs
42183 to execute calls.
42184
42185 20.h/2
42186 This case can happen (and has happened in production code)
42187 when a protected object is accessed from the Finalize routine
42188 of a type. For example:
42189
42190 20.i/2
42191 with Ada.Finalization.Controlled;
42192 package Window_Manager is
42193 ...
42194 type Root_Window is new Ada.Finalization.Controlled with private;
42195 type Any_Window is access all Root_Window;
42196 ...
42197 private
42198 ...
42199 procedure Finalize (Object : in out Root_Window);
42200 ...
42201 end Window_Manager;
42202
42203 20.j/2
42204 package body Window_Manager is
42205 protected type Lock is
42206 entry Get_Lock;
42207 procedure Free_Lock;
42208 ...
42209 end Lock;
42210
42211 20.k/2
42212 Window_Lock : Lock;
42213
42214 20.l/2
42215 procedure Finalize (Object : in out Root_Window) is
42216 begin
42217 Window_Lock.Get_Lock;
42218 ...
42219 Window_Lock.Free_Lock;
42220 end Finalize;
42221 ...
42222 A_Window : Any_Window := new Root_Window;
42223 end Window_Manager;
42224
42225 20.m/2
42226 The environment task will call Window_Lock for the object
42227 allocated for A_Window when the collection for Any_Window is
42228 finalized, which will happen after the finalization of
42229 Window_Lock (because finalization of the package body will
42230 occur before that of the package specification).
42231
42232 NOTES
42233
42234 21/2
42235 13 {AI95-00382-01AI95-00382-01} Within the declaration or body of
42236 a protected unit other than in an access_definition, the name of
42237 the protected unit denotes the current instance of the unit (see
42238 *note 8.6::), rather than the first subtype of the corresponding
42239 protected type (and thus the name cannot be used as a
42240 subtype_mark).
42241
42242 21.a/2
42243 Discussion: {AI95-00382-01AI95-00382-01} It can be used as a
42244 subtype_mark in an anonymous access type. In addition, it is
42245 possible to refer to some other subtype of the protected type
42246 within its body, presuming such a subtype has been declared
42247 between the protected_type_declaration and the protected_body.
42248
42249 22
42250 14 A selected_component can be used to denote a discriminant of a
42251 protected object (see *note 4.1.3::). Within a protected unit, the
42252 name of a discriminant of the protected type denotes the
42253 corresponding discriminant of the current instance of the unit.
42254
42255 23/2
42256 15 {AI95-00287-01AI95-00287-01} A protected type is a limited type
42257 (see *note 7.5::), and hence precludes use of assignment_statements
42258 and predefined equality operators.
42259
42260 24
42261 16 The bodies of the protected operations given in the
42262 protected_body define the actions that take place upon calls to the
42263 protected operations.
42264
42265 25
42266 17 The declarations in the private part are only visible within
42267 the private part and the body of the protected unit.
42268
42269 25.a
42270 Reason: Component_declarations are disallowed in a
42271 protected_body because, for efficiency, we wish to allow the
42272 compiler to determine the size of protected objects (when not
42273 dynamic); the compiler cannot necessarily see the body.
42274 Furthermore, the semantics of initialization of such objects
42275 would be problematic -- we do not wish to give protected
42276 objects complex initialization semantics similar to task
42277 activation.
42278
42279 25.b
42280 The same applies to entry_declarations, since an entry
42281 involves an implicit component -- the entry queue.
42282
42283 _Examples_
42284
42285 26
42286 Example of declaration of protected type and corresponding body:
42287
42288 27
42289 protected type Resource is
42290 entry Seize;
42291 procedure Release;
42292 private
42293 Busy : Boolean := False;
42294 end Resource;
42295
42296 28
42297 protected body Resource is
42298 entry Seize when not Busy is
42299 begin
42300 Busy := True;
42301 end Seize;
42302
42303 29
42304 procedure Release is
42305 begin
42306 Busy := False;
42307 end Release;
42308 end Resource;
42309
42310 30
42311 Example of a single protected declaration and corresponding body:
42312
42313 31
42314 protected Shared_Array is
42315 -- Index, Item, and Item_Array are global types
42316 function Component (N : in Index) return Item;
42317 procedure Set_Component(N : in Index; E : in Item);
42318 private
42319 Table : Item_Array(Index) := (others => Null_Item);
42320 end Shared_Array;
42321
42322 32
42323 protected body Shared_Array is
42324 function Component(N : in Index) return Item is
42325 begin
42326 return Table(N);
42327 end Component;
42328
42329 33
42330 procedure Set_Component(N : in Index; E : in Item) is
42331 begin
42332 Table(N) := E;
42333 end Set_Component;
42334 end Shared_Array;
42335
42336 34
42337 Examples of protected objects:
42338
42339 35
42340 Control : Resource;
42341 Flags : array(1 .. 100) of Resource;
42342
42343 _Extensions to Ada 83_
42344
42345 35.a/3
42346 {AI05-0299-1AI05-0299-1} This entire subclause is new;
42347 protected units do not exist in Ada 83.
42348
42349 _Extensions to Ada 95_
42350
42351 35.b/2
42352 {AI95-00345-01AI95-00345-01} {AI95-00397-01AI95-00397-01}
42353 {AI95-00399-01AI95-00399-01} {AI95-00401-01AI95-00401-01}
42354 {AI95-00419-01AI95-00419-01} Protected types and single
42355 protected objects can be derived from one or more interfaces.
42356 Operations declared in the protected type can implement the
42357 primitive operations of an interface. Overriding_indicators
42358 can be used to specify whether or not a protected operation
42359 implements a primitive operation.
42360
42361 _Wording Changes from Ada 95_
42362
42363 35.c/2
42364 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
42365 Changed representation clauses to aspect clauses to reflect
42366 that they are used for more than just representation.
42367
42368 35.d/2
42369 {AI95-00280-01AI95-00280-01} Described what happens when an
42370 operation of a finalized protected object is called.
42371
42372 35.e/2
42373 {AI95-00287-01AI95-00287-01} Revised the note on operations of
42374 protected types to reflect that limited types do have an
42375 assignment operation, but not copying (assignment_statements).
42376
42377 35.f/2
42378 {AI95-00382-01AI95-00382-01} Revised the note on use of the
42379 name of a protected type within itself to reflect the
42380 exception for anonymous access types.
42381
42382 _Incompatibilities With Ada 2005_
42383
42384 35.g/3
42385 {AI05-0291-1AI05-0291-1} When an inherited subprogram is
42386 implemented by a protected function, the first parameter has
42387 to be an in parameter, but not an access-to-variable type.
42388 Ada 2005 allowed access-to-variable parameters in this case;
42389 the parameter will need to be changed to access-to-constant
42390 with the addition of the constant keyword.
42391
42392 _Extensions to Ada 2005_
42393
42394 35.h/3
42395 {AI05-0183-1AI05-0183-1} {AI05-0267-1AI05-0267-1} An optional
42396 aspect_specification can be used in a
42397 protected_type_declaration, a single_protected_declaration,
42398 and a protected_body. This is described in *note 13.1.1::.
42399
42400 _Wording Changes from Ada 2005_
42401
42402 35.i/3
42403 {AI05-0042-1AI05-0042-1} Correction: Clarified that an
42404 inherited subprogram of a progenitor is overridden when it is
42405 implemented by an entry or subprogram.
42406
42407 35.j/3
42408 {AI05-0090-1AI05-0090-1} Correction: Added the missing
42409 defining name in the no conflicting primitive operation rule.
42410
42411 \1f
42412 File: aarm2012.info, Node: 9.5, Next: 9.6, Prev: 9.4, Up: 9
42413
42414 9.5 Intertask Communication
42415 ===========================
42416
42417 1
42418 The primary means for intertask communication is provided by calls on
42419 entries and protected subprograms. Calls on protected subprograms allow
42420 coordinated access to shared data objects. Entry calls allow for
42421 blocking the caller until a given condition is satisfied (namely, that
42422 the corresponding entry is open -- see *note 9.5.3::), and then
42423 communicating data or control information directly with another task or
42424 indirectly via a shared protected object.
42425
42426 _Static Semantics_
42427
42428 2/3
42429 {AI05-0225-1AI05-0225-1} {AI05-0291-1AI05-0291-1} When a name or prefix
42430 denotes an entry, protected subprogram, or a prefixed view of a
42431 primitive subprogram of a limited interface whose first parameter is a
42432 controlling parameter, the name or prefix determines a target object, as
42433 follows:
42434
42435 2.a/3
42436 To be honest: {AI05-0291-1AI05-0291-1} This wording uses
42437 "denotes" to mean "denotes a view of an entity" (when the term
42438 is used in Legality Rules), and "denotes an entity" (when the
42439 term is used in Dynamic Semantics rules). It does not mean
42440 "view of a declaration", as that would not include renames (a
42441 renames is not an entry or protected subprogram).
42442
42443 3/3
42444 * {AI05-0291-1AI05-0291-1} If it is a direct_name or expanded name
42445 that denotes the declaration (or body) of the operation, then the
42446 target object is implicitly specified to be the current instance of
42447 the task or protected unit immediately enclosing the operation; a
42448 call using such a name is defined to be an internal call;
42449
42450 4/3
42451 * {AI05-0291-1AI05-0291-1} If it is a selected_component that is not
42452 an expanded name, then the target object is explicitly specified to
42453 be the object denoted by the prefix of the name; a call using such
42454 a name is defined to be an external call;
42455
42456 4.a
42457 Discussion: For example:
42458
42459 4.b
42460 protected type Pt is
42461 procedure Op1;
42462 procedure Op2;
42463 end Pt;
42464
42465 4.c
42466 PO : Pt;
42467 Other_Object : Some_Other_Protected_Type;
42468
42469 4.d
42470 protected body Pt is
42471 procedure Op1 is begin ... end Op1;
42472
42473 4.e
42474 procedure Op2 is
42475 begin
42476 Op1; -- An internal call.
42477 Pt.Op1; -- Another internal call.
42478 PO.Op1; -- An external call. It the current instance is PO, then
42479 -- this is a bounded error (see *note 9.5.1::).
42480 Other_Object.Some_Op; -- An external call.
42481 end Op2;
42482 end Pt;
42483
42484 5/3
42485 * {AI05-0291-1AI05-0291-1} If the name or prefix is a dereference
42486 (implicit or explicit) of an access-to-protected-subprogram value,
42487 then the target object is determined by the prefix of the Access
42488 attribute_reference that produced the access value originally; a
42489 call using such a name is defined to be an external call;
42490
42491 6
42492 * If the name or prefix denotes a subprogram_renaming_declaration,
42493 then the target object is as determined by the name of the renamed
42494 entity.
42495
42496 6.1/3
42497 {AI05-0291-1AI05-0291-1} A call on an entry or a protected subprogram
42498 either uses a name or prefix that determines a target object implicitly,
42499 as above, or is a call on (a non-prefixed view of) a primitive
42500 subprogram of a limited interface whose first parameter is a controlling
42501 parameter, in which case the target object is identified explicitly by
42502 the first parameter. This latter case is an external call.
42503
42504 7
42505 A corresponding definition of target object applies to a
42506 requeue_statement (see *note 9.5.4::), with a corresponding distinction
42507 between an internal requeue and an external requeue.
42508
42509 _Legality Rules_
42510
42511 7.1/3
42512 {AI95-00345-01AI95-00345-01} {AI05-0225-1AI05-0225-1}
42513 {AI05-0291-1AI05-0291-1} If a name or prefix determines a target object,
42514 and the name denotes a protected entry or procedure, then the target
42515 object shall be a variable, unless the prefix is for an
42516 attribute_reference to the Count attribute (see *note 9.9::).
42517
42518 7.a/3
42519 Reason: {AI05-0225-1AI05-0225-1} The point is to prevent any
42520 calls to such a name whose target object is a constant view of
42521 a protected object, directly, or via an access value, renames,
42522 or generic formal subprogram. It is, however, legal to say
42523 P'Count in a protected function body, even though the
42524 protected object is a constant view there.
42525
42526 7.b/3
42527 Ramification: {AI05-0291-1AI05-0291-1} This rule does not
42528 apply to calls that are not to a prefixed view. Specifically
42529 a "normal" call to a primitive operation of a limited
42530 interface is not covered by this rule. In that case, the
42531 normal parameter passing mode checks will prevent passing a
42532 constant protected object to an operation implemented by a
42533 protected entry or procedure as the mode is required to be in
42534 out or out.
42535
42536 _Dynamic Semantics_
42537
42538 8
42539 Within the body of a protected operation, the current instance (see
42540 *note 8.6::) of the immediately enclosing protected unit is determined
42541 by the target object specified (implicitly or explicitly) in the call
42542 (or requeue) on the protected operation.
42543
42544 8.a
42545 To be honest: The current instance is defined in the same way
42546 within the body of a subprogram declared immediately within a
42547 protected_body.
42548
42549 9
42550 Any call on a protected procedure or entry of a target protected object
42551 is defined to be an update to the object, as is a requeue on such an
42552 entry.
42553
42554 9.a
42555 Reason: Read/write access to the components of a protected
42556 object is granted while inside the body of a protected
42557 procedure or entry. Also, any protected entry call can change
42558 the value of the Count attribute, which represents an update.
42559 Any protected procedure call can result in servicing the
42560 entries, which again might change the value of a Count
42561 attribute.
42562
42563 _Syntax_
42564
42565 10/3
42566 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1}
42567 synchronization_kind ::=
42568 By_Entry | By_Protected_Procedure | Optional
42569
42570 _Static Semantics_
42571
42572 11/3
42573 {AI05-0215-1AI05-0215-1} For the declaration of a primitive procedure of
42574 a synchronized tagged type the following language-defined representation
42575 aspect may be specified with an aspect_specification (see *note
42576 13.1.1::):
42577
42578 12/3
42579 Synchronization
42580 If specified, the aspect definition shall be a
42581 synchronization_kind.
42582
42583 12.a/3
42584 Aspect Description for Synchronization: Defines whether a
42585 given primitive operation of a synchronized interface must be
42586 implemented by an entry or protected procedure.
42587
42588 13/3
42589 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} Inherited subprograms
42590 inherit the Synchronization aspect, if any, from the corresponding
42591 subprogram of the parent or progenitor type. If an overriding operation
42592 does not have a directly specified Synchronization aspect then the
42593 Synchronization aspect of the inherited operation is inherited by the
42594 overriding operation.
42595
42596 _Legality Rules_
42597
42598 14/3
42599 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} The
42600 synchronization_kind By_Protected_Procedure shall not be applied to a
42601 primitive procedure of a task interface.
42602
42603 15/3
42604 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} A procedure for which
42605 the specified synchronization_kind is By_Entry shall be implemented by
42606 an entry. A procedure for which the specified synchronization_kind is
42607 By_Protected_Procedure shall be implemented by a protected procedure. A
42608 procedure for which the specified synchronization_kind is Optional may
42609 be implemented by an entry or by a procedure (including a protected
42610 procedure).
42611
42612 16/3
42613 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} If a primitive
42614 procedure overrides an inherited operation for which the Synchronization
42615 aspect has been specified to be By_Entry or By_Protected_Procedure, then
42616 any specification of the aspect Synchronization applied to the
42617 overriding operation shall have the same synchronization_kind.
42618
42619 17/3
42620 {AI05-0030-2AI05-0030-2} In addition to the places where Legality Rules
42621 normally apply (see *note 12.3::), these rules also apply in the private
42622 part of an instance of a generic unit.
42623
42624 NOTES
42625
42626 18/3
42627 18 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} The
42628 synchronization_kind By_Protected_Procedure implies that the
42629 operation will not block.
42630
42631 _Wording Changes from Ada 95_
42632
42633 18.a/2
42634 {AI95-00345-01AI95-00345-01} Added a Legality Rule to make it
42635 crystal-clear that the protected object of an entry or
42636 procedure call must be a variable. This rule was implied by
42637 the Dynamic Semantics here, along with the Static Semantics of
42638 *note 3.3::, but it is much better to explicitly say it.
42639 While many implementations have gotten this wrong, this is not
42640 an incompatibility -- allowing updates of protected constants
42641 has always been wrong.
42642
42643 _Extensions to Ada 2005_
42644
42645 18.b/3
42646 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} Added the
42647 Synchronization aspect to allow specifying that an interface
42648 procedure is really an entry or a protected procedure.
42649
42650 _Wording Changes from Ada 2005_
42651
42652 18.c/3
42653 {AI05-0225-1AI05-0225-1} Correction: Clarified that the target
42654 object of any name denoted a protected procedure or entry can
42655 never be a constant (other than for the 'Count attribute).
42656 This closes holes involving calls to access-to-protected,
42657 renaming as a procedure, and generic formal subprograms.
42658
42659 * Menu:
42660
42661 * 9.5.1 :: Protected Subprograms and Protected Actions
42662 * 9.5.2 :: Entries and Accept Statements
42663 * 9.5.3 :: Entry Calls
42664 * 9.5.4 :: Requeue Statements
42665
42666 \1f
42667 File: aarm2012.info, Node: 9.5.1, Next: 9.5.2, Up: 9.5
42668
42669 9.5.1 Protected Subprograms and Protected Actions
42670 -------------------------------------------------
42671
42672 1
42673 A protected subprogram is a subprogram declared immediately within a
42674 protected_definition. Protected procedures provide exclusive read-write
42675 access to the data of a protected object; protected functions provide
42676 concurrent read-only access to the data.
42677
42678 1.a
42679 Ramification: A subprogram declared immediately within a
42680 protected_body is not a protected subprogram; it is an
42681 intrinsic subprogram. See *note 6.3.1::, "*note 6.3.1::
42682 Conformance Rules".
42683
42684 _Static Semantics_
42685
42686 2
42687 [Within the body of a protected function (or a function declared
42688 immediately within a protected_body), the current instance of the
42689 enclosing protected unit is defined to be a constant (that is, its
42690 subcomponents may be read but not updated). Within the body of a
42691 protected procedure (or a procedure declared immediately within a
42692 protected_body), and within an entry_body, the current instance is
42693 defined to be a variable (updating is permitted).]
42694
42695 2.a.1/3
42696 Proof: {AI05-0120-1AI05-0120-1} All constant views are defined
42697 in *note 3.3::, "*note 3.3:: Objects and Named Numbers",
42698 anything not named there is a variable view.
42699
42700 2.a
42701 Ramification: The current instance is like an implicit
42702 parameter, of mode in for a protected function, and of mode in
42703 out for a protected procedure (or protected entry).
42704
42705 _Dynamic Semantics_
42706
42707 3
42708 For the execution of a call on a protected subprogram, the evaluation of
42709 the name or prefix and of the parameter associations, and any assigning
42710 back of in out or out parameters, proceeds as for a normal subprogram
42711 call (see *note 6.4::). If the call is an internal call (see *note
42712 9.5::), the body of the subprogram is executed as for a normal
42713 subprogram call. If the call is an external call, then the body of the
42714 subprogram is executed as part of a new protected action on the target
42715 protected object; the protected action completes after the body of the
42716 subprogram is executed. [A protected action can also be started by an
42717 entry call (see *note 9.5.3::).]
42718
42719 4
42720 A new protected action is not started on a protected object while
42721 another protected action on the same protected object is underway,
42722 unless both actions are the result of a call on a protected function.
42723 This rule is expressible in terms of the execution resource associated
42724 with the protected object:
42725
42726 5
42727 * Starting a protected action on a protected object corresponds to
42728 acquiring the execution resource associated with the protected
42729 object, either for concurrent read-only access if the protected
42730 action is for a call on a protected function, or for exclusive
42731 read-write access otherwise;
42732
42733 6
42734 * Completing the protected action corresponds to releasing the
42735 associated execution resource.
42736
42737 7
42738 [After performing an operation on a protected object other than a call
42739 on a protected function, but prior to completing the associated
42740 protected action, the entry queues (if any) of the protected object are
42741 serviced (see *note 9.5.3::).]
42742
42743 _Bounded (Run-Time) Errors_
42744
42745 8
42746 During a protected action, it is a bounded error to invoke an operation
42747 that is potentially blocking. The following are defined to be
42748 potentially blocking operations:
42749
42750 8.a
42751 Reason: Some of these operations are not directly blocking.
42752 However, they are still treated as bounded errors during a
42753 protected action, because allowing them might impose an
42754 undesirable implementation burden.
42755
42756 9
42757 * a select_statement;
42758
42759 10
42760 * an accept_statement;
42761
42762 11
42763 * an entry_call_statement;
42764
42765 12
42766 * a delay_statement;
42767
42768 13
42769 * an abort_statement;
42770
42771 14
42772 * task creation or activation;
42773
42774 15
42775 * an external call on a protected subprogram (or an external requeue)
42776 with the same target object as that of the protected action;
42777
42778 15.a
42779 Reason: This is really a deadlocking call, rather than a
42780 blocking call, but we include it in this list for simplicity.
42781
42782 16
42783 * a call on a subprogram whose body contains a potentially blocking
42784 operation.
42785
42786 16.a
42787 Reason: This allows an implementation to check and raise
42788 Program_Error as soon as a subprogram is called, rather than
42789 waiting to find out whether it actually reaches the
42790 potentially blocking operation. This in turn allows the
42791 potentially blocking operation check to be performed prior to
42792 run time in some environments.
42793
42794 17
42795 If the bounded error is detected, Program_Error is raised. If not
42796 detected, the bounded error might result in deadlock or a (nested)
42797 protected action on the same target object.
42798
42799 17.a/2
42800 Discussion: {AI95-00305-01AI95-00305-01} By "nested protected
42801 action", we mean that an additional protected action can be
42802 started by another task on the same protected object. This
42803 means that mutual exclusion may be broken in this bounded
42804 error case. A way to ensure that this does not happen is to
42805 use pragma Detect_Blocking (see *note H.5::).
42806
42807 18
42808 Certain language-defined subprograms are potentially blocking. In
42809 particular, the subprograms of the language-defined input-output
42810 packages that manipulate files (implicitly or explicitly) are
42811 potentially blocking. Other potentially blocking subprograms are
42812 identified where they are defined. When not specified as potentially
42813 blocking, a language-defined subprogram is nonblocking.
42814
42815 18.a/2
42816 Discussion: {AI95-00178-01AI95-00178-01} Any subprogram in a
42817 language-defined input-output package that has a file
42818 parameter or result or operates on a default file is
42819 considered to manipulate a file. An instance of a
42820 language-defined input-output generic package provides
42821 subprograms that are covered by this rule. The only
42822 subprograms in language-defined input-output packages not
42823 covered by this rule (and thus not potentially blocking) are
42824 the Get and Put routines that take string parameters defined
42825 in the packages nested in Text_IO.
42826
42827 NOTES
42828
42829 19
42830 19 If two tasks both try to start a protected action on a
42831 protected object, and at most one is calling a protected function,
42832 then only one of the tasks can proceed. Although the other task
42833 cannot proceed, it is not considered blocked, and it might be
42834 consuming processing resources while it awaits its turn. There is
42835 no language-defined ordering or queuing presumed for tasks
42836 competing to start a protected action -- on a multiprocessor such
42837 tasks might use busy-waiting; for monoprocessor considerations, see
42838 *note D.3::, "*note D.3:: Priority Ceiling Locking".
42839
42840 19.a
42841 Discussion: The intended implementation on a multi-processor
42842 is in terms of "spin locks" -- the waiting task will spin.
42843
42844 20
42845 20 The body of a protected unit may contain declarations and
42846 bodies for local subprograms. These are not visible outside the
42847 protected unit.
42848
42849 21
42850 21 The body of a protected function can contain internal calls on
42851 other protected functions, but not protected procedures, because
42852 the current instance is a constant. On the other hand, the body of
42853 a protected procedure can contain internal calls on both protected
42854 functions and procedures.
42855
42856 22
42857 22 From within a protected action, an internal call on a protected
42858 subprogram, or an external call on a protected subprogram with a
42859 different target object is not considered a potentially blocking
42860 operation.
42861
42862 22.a
42863 Reason: This is because a task is not considered blocked while
42864 attempting to acquire the execution resource associated with a
42865 protected object. The acquisition of such a resource is
42866 rather considered part of the normal competition for execution
42867 resources between the various tasks that are ready. External
42868 calls that turn out to be on the same target object are
42869 considered potentially blocking, since they can deadlock the
42870 task indefinitely.
42871
42872 22.1/2
42873 23 {AI95-00305-01AI95-00305-01} The pragma Detect_Blocking may be
42874 used to ensure that all executions of potentially blocking
42875 operations during a protected action raise Program_Error. See
42876 *note H.5::.
42877
42878 _Examples_
42879
42880 23
42881 Examples of protected subprogram calls (see *note 9.4::):
42882
42883 24
42884 Shared_Array.Set_Component(N, E);
42885 E := Shared_Array.Component(M);
42886 Control.Release;
42887
42888 _Wording Changes from Ada 95_
42889
42890 24.a/2
42891 {AI95-00305-01AI95-00305-01} Added a note pointing out the
42892 existence of pragma Detect_Blocking. This pragma can be used
42893 to ensure portable (somewhat pessimistic) behavior of
42894 protected actions by converting the Bounded Error into a
42895 required check.
42896
42897 \1f
42898 File: aarm2012.info, Node: 9.5.2, Next: 9.5.3, Prev: 9.5.1, Up: 9.5
42899
42900 9.5.2 Entries and Accept Statements
42901 -----------------------------------
42902
42903 1
42904 Entry_declarations, with the corresponding entry_bodies or
42905 accept_statements, are used to define potentially queued operations on
42906 tasks and protected objects.
42907
42908 _Syntax_
42909
42910 2/3
42911 {AI95-00397-01AI95-00397-01} {AI05-0183-1AI05-0183-1}
42912 entry_declaration ::=
42913 [overriding_indicator]
42914 entry defining_identifier [(discrete_subtype_definition)]
42915 parameter_profile
42916 [aspect_specification];
42917
42918 3
42919 accept_statement ::=
42920 accept entry_direct_name [(entry_index)] parameter_profile [do
42921 handled_sequence_of_statements
42922 end [entry_identifier]];
42923
42924 3.a
42925 Reason: We cannot use defining_identifier for
42926 accept_statements. Although an accept_statement is sort of
42927 like a body, it can appear nested within a block_statement,
42928 and therefore be hidden from its own entry by an outer
42929 homograph.
42930
42931 4
42932 entry_index ::= expression
42933
42934 5
42935 entry_body ::=
42936 entry defining_identifier entry_body_formal_part
42937 entry_barrier is
42938 declarative_part
42939 begin
42940 handled_sequence_of_statements
42941 end [entry_identifier];
42942
42943 5.a/2
42944 Discussion: {AI95-00397-01AI95-00397-01} We don't allow an
42945 overriding_indicator on an entry_body because entries always
42946 implement procedures at the point of the type declaration;
42947 there is no late implementation. And we don't want to have to
42948 think about overriding_indicators on accept_statements.
42949
42950 6
42951 entry_body_formal_part ::= [(entry_index_specification)]
42952 parameter_profile
42953
42954 7
42955 entry_barrier ::= when condition
42956
42957 8
42958 entry_index_specification ::= for defining_identifier in
42959 discrete_subtype_definition
42960
42961 9
42962 If an entry_identifier appears at the end of an accept_statement,
42963 it shall repeat the entry_direct_name (*note 4.1: S0092.). If an
42964 entry_identifier appears at the end of an entry_body (*note 9.5.2:
42965 S0221.), it shall repeat the defining_identifier (*note 3.1:
42966 S0022.).
42967
42968 10
42969 [An entry_declaration is allowed only in a protected or task
42970 declaration.]
42971
42972 10.a
42973 Proof: This follows from the BNF.
42974
42975 10.1/2
42976 {AI95-00397-01AI95-00397-01} An overriding_indicator is not allowed
42977 in an entry_declaration that includes a
42978 discrete_subtype_definition.
42979
42980 10.a.1/2
42981 Reason: An entry family can never implement something, so
42982 allowing an indicator is felt by the majority of the ARG to be
42983 redundant.
42984
42985 _Name Resolution Rules_
42986
42987 11
42988 In an accept_statement, the expected profile for the entry_direct_name
42989 is that of the entry_declaration (*note 9.5.2: S0218.); the expected
42990 type for an entry_index is that of the subtype defined by the
42991 discrete_subtype_definition (*note 3.6: S0055.) of the corresponding
42992 entry_declaration (*note 9.5.2: S0218.).
42993
42994 12
42995 Within the handled_sequence_of_statements of an accept_statement, if a
42996 selected_component (*note 4.1.3: S0098.) has a prefix that denotes the
42997 corresponding entry_declaration (*note 9.5.2: S0218.), then the entity
42998 denoted by the prefix is the accept_statement (*note 9.5.2: S0219.), and
42999 the selected_component (*note 4.1.3: S0098.) is interpreted as an
43000 expanded name (see *note 4.1.3::)[; the selector_name of the
43001 selected_component (*note 4.1.3: S0098.) has to be the identifier for
43002 some formal parameter of the accept_statement (*note 9.5.2: S0219.)].
43003
43004 12.a
43005 Proof: The only declarations that occur immediately within the
43006 declarative region of an accept_statement are those for its
43007 formal parameters.
43008
43009 _Legality Rules_
43010
43011 13
43012 An entry_declaration in a task declaration shall not contain a
43013 specification for an access parameter (see *note 3.10::).
43014
43015 13.a
43016 Reason: Access parameters for task entries would require a
43017 complex implementation. For example:
43018
43019 13.b
43020 task T is
43021 entry E(Z : access Integer); -- Illegal!
43022 end T;
43023
43024 13.c
43025 task body T is
43026 begin
43027 declare
43028 type A is access all Integer;
43029 X : A;
43030 Int : aliased Integer;
43031 task Inner;
43032 task body Inner is
43033 begin
43034 T.E(Int'Access);
43035 end Inner;
43036 begin
43037 accept E(Z : access Integer) do
43038 X := A(Z); -- Accessibility_Check
43039 end E;
43040 end;
43041 end T;
43042
43043 13.d
43044 Implementing the Accessibility_Check inside the
43045 accept_statement for E is difficult, since one does not know
43046 whether the entry caller is calling from inside the
43047 immediately enclosing declare block or from outside it. This
43048 means that the lexical nesting level associated with the
43049 designated object is not sufficient to determine whether the
43050 Accessibility_Check should pass or fail.
43051
43052 13.e
43053 Note that such problems do not arise with protected entries,
43054 because entry_bodies are always nested immediately within the
43055 protected_body; they cannot be further nested as can
43056 accept_statements, nor can they be called from within the
43057 protected_body (since no entry calls are permitted inside a
43058 protected_body).
43059
43060 13.1/2
43061 {AI95-00397-01AI95-00397-01} If an entry_declaration has an
43062 overriding_indicator, then at the point of the declaration:
43063
43064 13.2/2
43065 * if the overriding_indicator is overriding, then the entry shall
43066 implement an inherited subprogram;
43067
43068 13.3/2
43069 * if the overriding_indicator is not overriding, then the entry shall
43070 not implement any inherited subprogram.
43071
43072 13.4/2
43073 In addition to the places where Legality Rules normally apply (see *note
43074 12.3::), these rules also apply in the private part of an instance of a
43075 generic unit.
43076
43077 13.f/2
43078 Discussion: These rules are subtly different than those for
43079 subprograms (see *note 8.3.1::) because there cannot be "late"
43080 inheritance of primitives from interfaces. Hidden (that is,
43081 private) interfaces are prohibited explicitly (see *note
43082 7.3::), as are hidden primitive operations (as private
43083 operations of public abstract types are prohibited -- see
43084 *note 3.9.3::).
43085
43086 14
43087 For an accept_statement, the innermost enclosing body shall be a
43088 task_body, and the entry_direct_name (*note 4.1: S0092.) shall denote an
43089 entry_declaration (*note 9.5.2: S0218.) in the corresponding task
43090 declaration; the profile of the accept_statement (*note 9.5.2: S0219.)
43091 shall conform fully to that of the corresponding entry_declaration
43092 (*note 9.5.2: S0218.). An accept_statement (*note 9.5.2: S0219.) shall
43093 have a parenthesized entry_index (*note 9.5.2: S0220.) if and only if
43094 the corresponding entry_declaration (*note 9.5.2: S0218.) has a
43095 discrete_subtype_definition (*note 3.6: S0055.).
43096
43097 15
43098 An accept_statement shall not be within another accept_statement that
43099 corresponds to the same entry_declaration (*note 9.5.2: S0218.), nor
43100 within an asynchronous_select (*note 9.7.4: S0241.) inner to the
43101 enclosing task_body.
43102
43103 15.a
43104 Reason: Accept_statements are required to be immediately
43105 within the enclosing task_body (as opposed to being in a
43106 nested subprogram) to ensure that a nested task does not
43107 attempt to accept the entry of its enclosing task. We
43108 considered relaxing this restriction, either by making the
43109 check a run-time check, or by allowing a nested task to accept
43110 an entry of its enclosing task. However, neither change
43111 seemed to provide sufficient benefit to justify the additional
43112 implementation burden.
43113
43114 15.b
43115 Nested accept_statements for the same entry (or entry family)
43116 are prohibited to ensure that there is no ambiguity in the
43117 resolution of an expanded name for a formal parameter of the
43118 entry. This could be relaxed by allowing the inner one to
43119 hide the outer one from all visibility, but again the small
43120 added benefit didn't seem to justify making the change for Ada
43121 95.
43122
43123 15.c
43124 Accept_statements are not permitted within asynchronous_select
43125 statements to simplify the semantics and implementation: an
43126 accept_statement in an abortable_part could result in
43127 Tasking_Error being propagated from an entry call even though
43128 the target task was still callable; implementations that use
43129 multiple tasks implicitly to implement an asynchronous_select
43130 might have trouble supporting "up-level" accepts.
43131 Furthermore, if accept_statements were permitted in the
43132 abortable_part, a task could call its own entry and then
43133 accept it in the abortable_part, leading to rather unusual and
43134 possibly difficult-to-specify semantics.
43135
43136 16
43137 An entry_declaration of a protected unit requires a completion[, which
43138 shall be an entry_body,] and every entry_body (*note 9.5.2: S0221.)
43139 shall be the completion of an entry_declaration (*note 9.5.2: S0218.) of
43140 a protected unit. The profile of the entry_body (*note 9.5.2: S0221.)
43141 shall conform fully to that of the corresponding declaration.
43142
43143 16.a
43144 Ramification: An entry_declaration, unlike a
43145 subprogram_declaration, cannot be completed with a
43146 renaming_declaration (*note 8.5: S0199.).
43147
43148 16.b/3
43149 To be honest: {AI05-0229-1AI05-0229-1} If the implementation
43150 supports it, the entry body can be imported (using aspect
43151 Import, see *note B.1::), in which case no explicit entry_body
43152 is allowed.
43153
43154 16.c
43155 Discussion: The above applies only to protected entries, which
43156 are the only ones completed with entry_bodies. Task entries
43157 have corresponding accept_statements instead of having
43158 entry_bodies, and we do not consider an accept_statement to be
43159 a "completion," because a task entry_declaration is allowed to
43160 have zero, one, or more than one corresponding
43161 accept_statements.
43162
43163 17
43164 An entry_body_formal_part shall have an entry_index_specification (*note
43165 9.5.2: S0224.) if and only if the corresponding entry_declaration (*note
43166 9.5.2: S0218.) has a discrete_subtype_definition (*note 3.6: S0055.).
43167 In this case, the discrete_subtype_definition (*note 3.6: S0055.)s of
43168 the entry_declaration (*note 9.5.2: S0218.) and the
43169 entry_index_specification (*note 9.5.2: S0224.) shall fully conform to
43170 one another (see *note 6.3.1::).
43171
43172 18
43173 A name that denotes a formal parameter of an entry_body is not allowed
43174 within the entry_barrier of the entry_body.
43175
43176 _Static Semantics_
43177
43178 19
43179 The parameter modes defined for parameters in the parameter_profile of
43180 an entry_declaration are the same as for a subprogram_declaration and
43181 have the same meaning (see *note 6.2::).
43182
43183 19.a
43184 Discussion: Note that access parameters are not allowed for
43185 task entries (see above).
43186
43187 20
43188 An entry_declaration with a discrete_subtype_definition (see *note
43189 3.6::) declares a family of distinct entries having the same profile,
43190 with one such entry for each value of the entry index subtype defined by
43191 the discrete_subtype_definition (*note 3.6: S0055.). [A name for an
43192 entry of a family takes the form of an indexed_component, where the
43193 prefix denotes the entry_declaration for the family, and the index value
43194 identifies the entry within the family.] The term single entry is used
43195 to refer to any entry other than an entry of an entry family.
43196
43197 21
43198 In the entry_body for an entry family, the entry_index_specification
43199 declares a named constant whose subtype is the entry index subtype
43200 defined by the corresponding entry_declaration; the value of the named
43201 entry index identifies which entry of the family was called.
43202
43203 21.a
43204 Ramification: The discrete_subtype_definition of the
43205 entry_index_specification is not elaborated; the subtype of
43206 the named constant declared is defined by the
43207 discrete_subtype_definition of the corresponding
43208 entry_declaration, which is elaborated, either when the type
43209 is declared, or when the object is created, if its constraint
43210 is per-object.
43211
43212 _Dynamic Semantics_
43213
43214 22/1
43215 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} The elaboration of an
43216 entry_declaration for an entry family consists of the elaboration of the
43217 discrete_subtype_definition (*note 3.6: S0055.), as described in *note
43218 3.8::. The elaboration of an entry_declaration (*note 9.5.2: S0218.)
43219 for a single entry has no effect.
43220
43221 22.a/3
43222 Discussion: {AI05-0299-1AI05-0299-1} The elaboration of the
43223 declaration of a protected subprogram has no effect, as
43224 specified in subclause *note 6.1::. The default
43225 initialization of an object of a task or protected type is
43226 covered in *note 3.3.1::.
43227
43228 23
43229 [The actions to be performed when an entry is called are specified by
43230 the corresponding accept_statement (*note 9.5.2: S0219.)s (if any) for
43231 an entry of a task unit, and by the corresponding entry_body (*note
43232 9.5.2: S0221.) for an entry of a protected unit.]
43233
43234 24
43235 For the execution of an accept_statement, the entry_index, if any, is
43236 first evaluated and converted to the entry index subtype; this index
43237 value identifies which entry of the family is to be accepted. Further
43238 execution of the accept_statement is then blocked until a caller of the
43239 corresponding entry is selected (see *note 9.5.3::), whereupon the
43240 handled_sequence_of_statements, if any, of the accept_statement is
43241 executed, with the formal parameters associated with the corresponding
43242 actual parameters of the selected entry call. Upon completion of the
43243 handled_sequence_of_statements, the accept_statement completes and is
43244 left. When an exception is propagated from the
43245 handled_sequence_of_statements of an accept_statement, the same
43246 exception is also raised by the execution of the corresponding
43247 entry_call_statement.
43248
43249 24.a
43250 Ramification: This is in addition to propagating it to the
43251 construct containing the accept_statement. In other words,
43252 for a rendezvous, the raising splits in two, and continues
43253 concurrently in both tasks.
43254
43255 24.b
43256 The caller gets a new occurrence; this isn't considered
43257 propagation.
43258
43259 24.c
43260 Note that we say "propagated from the
43261 handled_sequence_of_statements of an accept_statement", not
43262 "propagated from an accept_statement." The latter would be
43263 wrong -- we don't want exceptions propagated by the
43264 entry_index to be sent to the caller (there is none yet!).
43265
43266 25
43267 The above interaction between a calling task and an accepting task is
43268 called a rendezvous. [After a rendezvous, the two tasks continue their
43269 execution independently.]
43270
43271 26
43272 [An entry_body is executed when the condition of the entry_barrier
43273 evaluates to True and a caller of the corresponding single entry, or
43274 entry of the corresponding entry family, has been selected (see *note
43275 9.5.3::).] For the execution of the entry_body (*note 9.5.2: S0221.),
43276 the declarative_part (*note 3.11: S0086.) of the entry_body (*note
43277 9.5.2: S0221.) is elaborated, and the handled_sequence_of_statements
43278 (*note 11.2: S0265.) of the body is executed, as for the execution of a
43279 subprogram_body. The value of the named entry index, if any, is
43280 determined by the value of the entry index specified in the entry_name
43281 of the selected entry call (or intermediate requeue_statement (*note
43282 9.5.4: S0226.) -- see *note 9.5.4::).
43283
43284 26.a
43285 To be honest: If the entry had been renamed as a subprogram,
43286 and the call was a procedure_call_statement using the name
43287 declared by the renaming, the entry index (if any) comes from
43288 the entry name specified in the
43289 subprogram_renaming_declaration.
43290
43291 NOTES
43292
43293 27
43294 24 A task entry has corresponding accept_statements (zero or
43295 more), whereas a protected entry has a corresponding entry_body
43296 (exactly one).
43297
43298 28
43299 25 A consequence of the rule regarding the allowed placements of
43300 accept_statements is that a task can execute accept_statements only
43301 for its own entries.
43302
43303 29/2
43304 26 {AI95-00318-02AI95-00318-02} A return statement (see *note
43305 6.5::) or a requeue_statement (see *note 9.5.4::) may be used to
43306 complete the execution of an accept_statement or an entry_body.
43307
43308 29.a
43309 Ramification: An accept_statement need not have a
43310 handled_sequence_of_statements even if the corresponding entry
43311 has parameters. Equally, it can have a
43312 handled_sequence_of_statements even if the corresponding entry
43313 has no parameters.
43314
43315 29.b
43316 Ramification: A single entry overloads a subprogram, an
43317 enumeration literal, or another single entry if they have the
43318 same defining_identifier. Overloading is not allowed for
43319 entry family names. A single entry or an entry of an entry
43320 family can be renamed as a procedure as explained in *note
43321 8.5.4::.
43322
43323 30
43324 27 The condition in the entry_barrier may reference anything
43325 visible except the formal parameters of the entry. This includes
43326 the entry index (if any), the components (including discriminants)
43327 of the protected object, the Count attribute of an entry of that
43328 protected object, and data global to the protected unit.
43329
43330 31
43331 The restriction against referencing the formal parameters within an
43332 entry_barrier ensures that all calls of the same entry see the same
43333 barrier value. If it is necessary to look at the parameters of an
43334 entry call before deciding whether to handle it, the entry_barrier
43335 can be "when True" and the caller can be requeued (on some private
43336 entry) when its parameters indicate that it cannot be handled
43337 immediately.
43338
43339 _Examples_
43340
43341 32
43342 Examples of entry declarations:
43343
43344 33
43345 entry Read(V : out Item);
43346 entry Seize;
43347 entry Request(Level)(D : Item); -- a family of entries
43348
43349 34
43350 Examples of accept statements:
43351
43352 35
43353 accept Shut_Down;
43354
43355 36
43356 accept Read(V : out Item) do
43357 V := Local_Item;
43358 end Read;
43359
43360 37
43361 accept Request(Low)(D : Item) do
43362 ...
43363 end Request;
43364
43365 _Extensions to Ada 83_
43366
43367 37.a
43368 The syntax rule for entry_body is new.
43369
43370 37.b
43371 Accept_statements can now have exception_handlers.
43372
43373 _Wording Changes from Ada 95_
43374
43375 37.c/2
43376 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
43377 Clarified the elaboration of per-object constraints.
43378
43379 37.d/2
43380 {AI95-00397-01AI95-00397-01} Overriding_indicators can be used
43381 on entries; this is only useful when a task or protected type
43382 inherits from an interface.
43383
43384 _Extensions to Ada 2005_
43385
43386 37.e/3
43387 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
43388 be used in an entry_declaration. This is described in *note
43389 13.1.1::.
43390
43391 \1f
43392 File: aarm2012.info, Node: 9.5.3, Next: 9.5.4, Prev: 9.5.2, Up: 9.5
43393
43394 9.5.3 Entry Calls
43395 -----------------
43396
43397 1
43398 [An entry_call_statement (an entry call) can appear in various
43399 contexts.] A simple entry call is a stand-alone statement that
43400 represents an unconditional call on an entry of a target task or a
43401 protected object. [Entry calls can also appear as part of
43402 select_statements (see *note 9.7::).]
43403
43404 _Syntax_
43405
43406 2
43407 entry_call_statement ::= entry_name [actual_parameter_part];
43408
43409 _Name Resolution Rules_
43410
43411 3
43412 The entry_name given in an entry_call_statement shall resolve to denote
43413 an entry. The rules for parameter associations are the same as for
43414 subprogram calls (see *note 6.4:: and *note 6.4.1::).
43415
43416 _Static Semantics_
43417
43418 4
43419 [The entry_name of an entry_call_statement specifies (explicitly or
43420 implicitly) the target object of the call, the entry or entry family,
43421 and the entry index, if any (see *note 9.5::).]
43422
43423 _Dynamic Semantics_
43424
43425 5
43426 Under certain circumstances (detailed below), an entry of a task or
43427 protected object is checked to see whether it is open or closed:
43428
43429 6/3
43430 * {AI05-0264-1AI05-0264-1} An entry of a task is open if the task is
43431 blocked on an accept_statement that corresponds to the entry (see
43432 *note 9.5.2::), or on a selective_accept (see *note 9.7.1::) with
43433 an open accept_alternative that corresponds to the entry;
43434 otherwise, it is closed.
43435
43436 7/3
43437 * {AI05-0264-1AI05-0264-1} An entry of a protected object is open if
43438 the condition of the entry_barrier of the corresponding entry_body
43439 evaluates to True; otherwise, it is closed. If the evaluation of
43440 the condition propagates an exception, the exception Program_Error
43441 is propagated to all current callers of all entries of the
43442 protected object.
43443
43444 7.a
43445 Reason: An exception during barrier evaluation is considered
43446 essentially a fatal error. All current entry callers are
43447 notified with a Program_Error. In a fault-tolerant system, a
43448 protected object might provide a Reset protected procedure, or
43449 equivalent, to support attempts to restore such a "broken"
43450 protected object to a reasonable state.
43451
43452 7.b
43453 Discussion: Note that the definition of when a task entry is
43454 open is based on the state of the (accepting) task, whereas
43455 the "openness" of a protected entry is defined only when it is
43456 explicitly checked, since the barrier expression needs to be
43457 evaluated. Implementation permissions are given (below) to
43458 allow implementations to evaluate the barrier expression more
43459 or less often than it is checked, but the basic semantic model
43460 presumes it is evaluated at the times when it is checked.
43461
43462 8
43463 For the execution of an entry_call_statement, evaluation of the name and
43464 of the parameter associations is as for a subprogram call (see *note
43465 6.4::). The entry call is then issued: For a call on an entry of a
43466 protected object, a new protected action is started on the object (see
43467 *note 9.5.1::). The named entry is checked to see if it is open; if
43468 open, the entry call is said to be selected immediately, and the
43469 execution of the call proceeds as follows:
43470
43471 9
43472 * For a call on an open entry of a task, the accepting task becomes
43473 ready and continues the execution of the corresponding
43474 accept_statement (see *note 9.5.2::).
43475
43476 10
43477 * For a call on an open entry of a protected object, the
43478 corresponding entry_body is executed (see *note 9.5.2::) as part of
43479 the protected action.
43480
43481 11
43482 If the accept_statement or entry_body completes other than by a requeue
43483 (see *note 9.5.4::), return is made to the caller (after servicing the
43484 entry queues -- see below); any necessary assigning back of formal to
43485 actual parameters occurs, as for a subprogram call (see *note 6.4.1::);
43486 such assignments take place outside of any protected action.
43487
43488 11.a
43489 Ramification: The return to the caller will generally not
43490 occur until the protected action completes, unless some other
43491 thread of control is given the job of completing the protected
43492 action and releasing the associated execution resource.
43493
43494 12
43495 If the named entry is closed, the entry call is added to an entry queue
43496 (as part of the protected action, for a call on a protected entry), and
43497 the call remains queued until it is selected or cancelled; there is a
43498 separate (logical) entry queue for each entry of a given task or
43499 protected object [(including each entry of an entry family)].
43500
43501 13
43502 When a queued call is selected, it is removed from its entry queue.
43503 Selecting a queued call from a particular entry queue is called
43504 servicing the entry queue. An entry with queued calls can be serviced
43505 under the following circumstances:
43506
43507 14
43508 * When the associated task reaches a corresponding accept_statement,
43509 or a selective_accept with a corresponding open accept_alternative;
43510
43511 15
43512 * If after performing, as part of a protected action on the
43513 associated protected object, an operation on the object other than
43514 a call on a protected function, the entry is checked and found to
43515 be open.
43516
43517 16
43518 If there is at least one call on a queue corresponding to an open entry,
43519 then one such call is selected according to the entry queuing policy in
43520 effect (see below), and the corresponding accept_statement or entry_body
43521 is executed as above for an entry call that is selected immediately.
43522
43523 17
43524 The entry queuing policy controls selection among queued calls both for
43525 task and protected entry queues. The default entry queuing policy is to
43526 select calls on a given entry queue in order of arrival. If calls from
43527 two or more queues are simultaneously eligible for selection, the
43528 default entry queuing policy does not specify which queue is serviced
43529 first. Other entry queuing policies can be specified by pragmas (see
43530 *note D.4::).
43531
43532 18
43533 For a protected object, the above servicing of entry queues continues
43534 until there are no open entries with queued calls, at which point the
43535 protected action completes.
43536
43537 18.a
43538 Discussion: While servicing the entry queues of a protected
43539 object, no new calls can be added to any entry queue of the
43540 object, except due to an internal requeue (see *note 9.5.4::).
43541 This is because the first step of a call on a protected entry
43542 is to start a new protected action, which implies acquiring
43543 (for exclusive read-write access) the execution resource
43544 associated with the protected object, which cannot be done
43545 while another protected action is already in progress.
43546
43547 19
43548 For an entry call that is added to a queue, and that is not the
43549 triggering_statement of an asynchronous_select (*note 9.7.4: S0241.)
43550 (see *note 9.7.4::), the calling task is blocked until the call is
43551 cancelled, or the call is selected and a corresponding accept_statement
43552 or entry_body completes without requeuing. In addition, the calling
43553 task is blocked during a rendezvous.
43554
43555 19.a
43556 Ramification: For a call on a protected entry, the caller is
43557 not blocked if the call is selected immediately, unless a
43558 requeue causes the call to be queued.
43559
43560 20
43561 An attempt can be made to cancel an entry call upon an abort (see *note
43562 9.8::) and as part of certain forms of select_statement (see *note
43563 9.7.2::, *note 9.7.3::, and *note 9.7.4::). The cancellation does not
43564 take place until a point (if any) when the call is on some entry queue,
43565 and not protected from cancellation as part of a requeue (see *note
43566 9.5.4::); at such a point, the call is removed from the entry queue and
43567 the call completes due to the cancellation. The cancellation of a call
43568 on an entry of a protected object is a protected action[, and as such
43569 cannot take place while any other protected action is occurring on the
43570 protected object. Like any protected action, it includes servicing of
43571 the entry queues (in case some entry barrier depends on a Count
43572 attribute).]
43573
43574 20.a/2
43575 Implementation Note: {AI95-00114-01AI95-00114-01} In the case
43576 of an attempted cancellation due to abort, this removal might
43577 have to be performed by the calling task itself if the ceiling
43578 priority of the protected object is lower than the priority of
43579 the task initiating the abort.
43580
43581 21
43582 A call on an entry of a task that has already completed its execution
43583 raises the exception Tasking_Error at the point of the call; similarly,
43584 this exception is raised at the point of the call if the called task
43585 completes its execution or becomes abnormal before accepting the call or
43586 completing the rendezvous (see *note 9.8::). This applies equally to a
43587 simple entry call and to an entry call as part of a select_statement.
43588
43589 _Implementation Permissions_
43590
43591 22
43592 An implementation may perform the sequence of steps of a protected
43593 action using any thread of control; it need not be that of the task that
43594 started the protected action. If an entry_body completes without
43595 requeuing, then the corresponding calling task may be made ready without
43596 waiting for the entire protected action to complete.
43597
43598 22.a
43599 Reason: These permissions are intended to allow flexibility
43600 for implementations on multiprocessors. On a monoprocessor,
43601 which thread of control executes the protected action is
43602 essentially invisible, since the thread is not abortable in
43603 any case, and the "current_task" function is not guaranteed to
43604 work during a protected action (see *note C.7.1::).
43605
43606 23
43607 When the entry of a protected object is checked to see whether it is
43608 open, the implementation need not reevaluate the condition of the
43609 corresponding entry_barrier if no variable or attribute referenced by
43610 the condition (directly or indirectly) has been altered by the execution
43611 (or cancellation) of a protected procedure or entry call on the object
43612 since the condition was last evaluated.
43613
43614 23.a
43615 Ramification: Changes to variables referenced by an entry
43616 barrier that result from actions outside of a protected
43617 procedure or entry call on the protected object need not be
43618 "noticed." For example, if a global variable is referenced by
43619 an entry barrier, it should not be altered (except as part of
43620 a protected action on the object) any time after the barrier
43621 is first evaluated. In other words, globals can be used to
43622 "parameterize" a protected object, but they cannot reliably be
43623 used to control it after the first use of the protected
43624 object.
43625
43626 23.b
43627 Implementation Note: Note that even if a global variable is
43628 volatile, the implementation need only reevaluate a barrier if
43629 the global is updated during a protected action on the
43630 protected object. This ensures that an entry-open bit-vector
43631 implementation approach is possible, where the bit-vector is
43632 computed at the end of a protected action, rather than upon
43633 each entry call.
43634
43635 24
43636 An implementation may evaluate the conditions of all entry_barriers of a
43637 given protected object any time any entry of the object is checked to
43638 see if it is open.
43639
43640 24.a
43641 Ramification: In other words, any side effects of evaluating
43642 an entry barrier should be innocuous, since an entry barrier
43643 might be evaluated more or less often than is implied by the
43644 "official" dynamic semantics.
43645
43646 24.b
43647 Implementation Note: It is anticipated that when the number of
43648 entries is known to be small, all barriers will be evaluated
43649 any time one of them needs to be, to produce an "entry-open
43650 bit-vector." The appropriate bit will be tested when the
43651 entry is called, and only if the bit is false will a check be
43652 made to see whether the bit-vector might need to be
43653 recomputed. This should allow an implementation to maximize
43654 the performance of a call on an open entry, which seems like
43655 the most important case.
43656
43657 24.c
43658 In addition to the entry-open bit-vector, an "is-valid" bit is
43659 needed per object, which indicates whether the current
43660 bit-vector setting is valid. A "depends-on-Count-attribute"
43661 bit is needed per type. The "is-valid" bit is set to false
43662 (as are all the bits of the bit-vector) when the protected
43663 object is first created, as well as any time an exception is
43664 propagated from computing the bit-vector. Is-valid would also
43665 be set false any time the Count is changed and
43666 "depends-on-Count-attribute" is true for the type, or a
43667 protected procedure or entry returns indicating it might have
43668 updated a variable referenced in some barrier.
43669
43670 24.d
43671 A single procedure can be compiled to evaluate all of the
43672 barriers, set the entry-open bit-vector accordingly, and set
43673 the is-valid bit to true. It could have a "when others"
43674 handler to set them all false, and call a routine to propagate
43675 Program_Error to all queued callers.
43676
43677 24.e
43678 For protected types where the number of entries is not known
43679 to be small, it makes more sense to evaluate a barrier only
43680 when the corresponding entry is checked to see if it is open.
43681 It isn't worth saving the state of the entry between checks,
43682 because of the space that would be required. Furthermore, the
43683 entry queues probably want to take up space only when there is
43684 actually a caller on them, so rather than an array of all
43685 entry queues, a linked list of nonempty entry queues make the
43686 most sense in this case, with the first caller on each entry
43687 queue acting as the queue header.
43688
43689 25
43690 When an attempt is made to cancel an entry call, the implementation need
43691 not make the attempt using the thread of control of the task (or
43692 interrupt) that initiated the cancellation; in particular, it may use
43693 the thread of control of the caller itself to attempt the cancellation,
43694 even if this might allow the entry call to be selected in the interim.
43695
43696 25.a
43697 Reason: Because cancellation of a protected entry call is a
43698 protected action (which helps make the Count attribute of a
43699 protected entry meaningful), it might not be practical to
43700 attempt the cancellation from the thread of control that
43701 initiated the cancellation. For example, if the cancellation
43702 is due to the expiration of a delay, it is unlikely that the
43703 handler of the timer interrupt could perform the necessary
43704 protected action itself (due to being on the interrupt level).
43705 Similarly, if the cancellation is due to an abort, it is
43706 possible that the task initiating the abort has a priority
43707 higher than the ceiling priority of the protected object (for
43708 implementations that support ceiling priorities). Similar
43709 considerations could apply in a multiprocessor situation.
43710
43711 NOTES
43712
43713 26
43714 28 If an exception is raised during the execution of an
43715 entry_body, it is propagated to the corresponding caller (see *note
43716 11.4::).
43717
43718 27
43719 29 For a call on a protected entry, the entry is checked to see if
43720 it is open prior to queuing the call, and again thereafter if its
43721 Count attribute (see *note 9.9::) is referenced in some entry
43722 barrier.
43723
43724 27.a
43725 Ramification: Given this, extra care is required if a
43726 reference to the Count attribute of an entry appears in the
43727 entry's own barrier.
43728
43729 27.b
43730 Reason: An entry is checked to see if it is open prior to
43731 queuing to maximize the performance of a call on an open
43732 entry.
43733
43734 28
43735 30 In addition to simple entry calls, the language permits timed,
43736 conditional, and asynchronous entry calls (see *note 9.7.2::, *note
43737 9.7.3::, and see *note 9.7.4::).
43738
43739 28.a
43740 Ramification: A task can call its own entries, but the task
43741 will deadlock if the call is a simple entry call.
43742
43743 29
43744 31 The condition of an entry_barrier is allowed to be evaluated by
43745 an implementation more often than strictly necessary, even if the
43746 evaluation might have side effects. On the other hand, an
43747 implementation need not reevaluate the condition if nothing it
43748 references was updated by an intervening protected action on the
43749 protected object, even if the condition references some global
43750 variable that might have been updated by an action performed from
43751 outside of a protected action.
43752
43753 _Examples_
43754
43755 30
43756 Examples of entry calls:
43757
43758 31
43759 Agent.Shut_Down; -- see *note 9.1::
43760 Parser.Next_Lexeme(E); -- see *note 9.1::
43761 Pool(5).Read(Next_Char); -- see *note 9.1::
43762 Controller.Request(Low)(Some_Item); -- see *note 9.1::
43763 Flags(3).Seize; -- see *note 9.4::
43764
43765 \1f
43766 File: aarm2012.info, Node: 9.5.4, Prev: 9.5.3, Up: 9.5
43767
43768 9.5.4 Requeue Statements
43769 ------------------------
43770
43771 1
43772 [A requeue_statement can be used to complete an accept_statement or
43773 entry_body, while redirecting the corresponding entry call to a new (or
43774 the same) entry queue. Such a requeue can be performed with or without
43775 allowing an intermediate cancellation of the call, due to an abort or
43776 the expiration of a delay. ]
43777
43778 _Syntax_
43779
43780 2/3
43781 {AI05-0030-2AI05-0030-2} requeue_statement ::=
43782 requeue procedure_or_entry_name [with abort];
43783
43784 _Name Resolution Rules_
43785
43786 3/3
43787 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} The
43788 procedure_or_entry_name of a requeue_statement shall resolve to denote a
43789 procedure or an entry (the requeue target). The profile of the entry,
43790 or the profile or prefixed profile of the procedure, shall either have
43791 no parameters, or be type conformant (see *note 6.3.1::) with the
43792 profile of the innermost enclosing entry_body (*note 9.5.2: S0221.) or
43793 accept_statement (*note 9.5.2: S0219.).
43794
43795 _Legality Rules_
43796
43797 4
43798 A requeue_statement shall be within a callable construct that is either
43799 an entry_body or an accept_statement, and this construct shall be the
43800 innermost enclosing body or callable construct.
43801
43802 5/3
43803 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} If the requeue target
43804 has parameters, then its (prefixed) profile shall be subtype conformant
43805 with the profile of the innermost enclosing callable construct.
43806
43807 5.1/3
43808 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} If the target is a
43809 procedure, the name shall denote a renaming of an entry, or shall denote
43810 a view or a prefixed view of a primitive subprogram of a synchronized
43811 interface, where the first parameter of the unprefixed view of the
43812 primitive subprogram shall be a controlling parameter, and the
43813 Synchronization aspect shall be specified with synchronization_kind
43814 By_Entry for the primitive subprogram.
43815
43816 6/3
43817 {AI05-0030-2AI05-0030-2} In a requeue_statement of an accept_statement
43818 of some task unit, either the target object shall be a part of a formal
43819 parameter of the accept_statement, or the accessibility level of the
43820 target object shall not be equal to or statically deeper than any
43821 enclosing accept_statement of the task unit. In a requeue_statement
43822 (*note 9.5.4: S0226.) of an entry_body (*note 9.5.2: S0221.) of some
43823 protected unit, either the target object shall be a part of a formal
43824 parameter of the entry_body (*note 9.5.2: S0221.), or the accessibility
43825 level of the target object shall not be statically deeper than that of
43826 the entry_declaration for the entry_body.
43827
43828 6.a
43829 Ramification: In the entry_body case, the intent is that the
43830 target object can be global, or can be a component of the
43831 protected unit, but cannot be a local variable of the
43832 entry_body.
43833
43834 6.b
43835 Reason: These restrictions ensure that the target object of
43836 the requeue outlives the completion and finalization of the
43837 enclosing callable construct. They also prevent requeuing
43838 from a nested accept_statement on a parameter of an outer
43839 accept_statement, which could create some strange
43840 "long-distance" connections between an entry caller and its
43841 server.
43842
43843 6.c
43844 Note that in the strange case where a task_body is nested
43845 inside an accept_statement, it is permissible to requeue from
43846 an accept_statement of the inner task_body on parameters of
43847 the outer accept_statement. This is not a problem because all
43848 calls on the inner task have to complete before returning from
43849 the outer accept_statement, meaning no "dangling calls" will
43850 be created.
43851
43852 6.d
43853 Implementation Note: By disallowing certain requeues, we
43854 ensure that the normal terminate_alternative rules remain
43855 sensible, and that explicit clearing of the entry queues of a
43856 protected object during finalization is rarely necessary. In
43857 particular, such clearing of the entry queues is necessary
43858 only (ignoring premature Unchecked_Deallocation) for protected
43859 objects declared in a task_body (or created by an allocator
43860 for an access type declared in such a body) containing one or
43861 more requeue_statements. Protected objects declared in
43862 subprograms, or at the library level, will never need to have
43863 their entry queues explicitly cleared during finalization.
43864
43865 _Dynamic Semantics_
43866
43867 7/3
43868 {AI05-0030-2AI05-0030-2} The execution of a requeue_statement proceeds
43869 by first evaluating the procedure_or_entry_name[, including the prefix
43870 identifying the target task or protected object and the expression
43871 identifying the entry within an entry family, if any]. The entry_body
43872 or accept_statement enclosing the requeue_statement is then completed[,
43873 finalized, and left (see *note 7.6.1::)].
43874
43875 8
43876 For the execution of a requeue on an entry of a target task, after
43877 leaving the enclosing callable construct, the named entry is checked to
43878 see if it is open and the requeued call is either selected immediately
43879 or queued, as for a normal entry call (see *note 9.5.3::).
43880
43881 9
43882 For the execution of a requeue on an entry of a target protected object,
43883 after leaving the enclosing callable construct:
43884
43885 10
43886 * if the requeue is an internal requeue (that is, the requeue is back
43887 on an entry of the same protected object -- see *note 9.5::), the
43888 call is added to the queue of the named entry and the ongoing
43889 protected action continues (see *note 9.5.1::);
43890
43891 10.a
43892 Ramification: Note that for an internal requeue, the call is
43893 queued without checking whether the target entry is open.
43894 This is because the entry queues will be serviced before the
43895 current protected action completes anyway, and considering the
43896 requeued call immediately might allow it to "jump" ahead of
43897 existing callers on the same queue.
43898
43899 11
43900 * if the requeue is an external requeue (that is, the target
43901 protected object is not implicitly the same as the current object
43902 -- see *note 9.5::), a protected action is started on the target
43903 object and proceeds as for a normal entry call (see *note 9.5.3::).
43904
43905 12/3
43906 {AI05-0030-2AI05-0030-2} If the requeue target named in the
43907 requeue_statement has formal parameters, then during the execution of
43908 the accept_statement or entry_body corresponding to the new entry, the
43909 formal parameters denote the same objects as did the corresponding
43910 formal parameters of the callable construct completed by the requeue.
43911 [In any case, no parameters are specified in a requeue_statement; any
43912 parameter passing is implicit.]
43913
43914 13
43915 If the requeue_statement includes the reserved words with abort (it is a
43916 requeue-with-abort), then:
43917
43918 14
43919 * if the original entry call has been aborted (see *note 9.8::), then
43920 the requeue acts as an abort completion point for the call, and the
43921 call is cancelled and no requeue is performed;
43922
43923 15
43924 * if the original entry call was timed (or conditional), then the
43925 original expiration time is the expiration time for the requeued
43926 call.
43927
43928 16
43929 If the reserved words with abort do not appear, then the call remains
43930 protected against cancellation while queued as the result of the
43931 requeue_statement.
43932
43933 16.a
43934 Ramification: This protection against cancellation lasts only
43935 until the call completes or a subsequent requeue-with-abort is
43936 performed on the call.
43937
43938 16.b
43939 Reason: We chose to protect a requeue, by default, against
43940 abort or cancellation. This seemed safer, since it is likely
43941 that extra steps need to be taken to allow for possible
43942 cancellation once the servicing of an entry call has begun.
43943 This also means that in the absence of with abort the usual
43944 Ada 83 behavior is preserved, namely that once an entry call
43945 is accepted, it cannot be cancelled until it completes.
43946
43947 NOTES
43948
43949 17
43950 32 A requeue is permitted from a single entry to an entry of an
43951 entry family, or vice-versa. The entry index, if any, plays no
43952 part in the subtype conformance check between the profiles of the
43953 two entries; an entry index is part of the entry_name for an entry
43954 of a family.
43955
43956 _Examples_
43957
43958 18
43959 Examples of requeue statements:
43960
43961 19
43962 requeue Request(Medium) with abort;
43963 -- requeue on a member of an entry family of the current task, see *note 9.1::
43964
43965 20
43966 requeue Flags(I).Seize;
43967 -- requeue on an entry of an array component, see *note 9.4::
43968
43969 _Extensions to Ada 83_
43970
43971 20.a
43972 The requeue_statement is new.
43973
43974 _Extensions to Ada 2005_
43975
43976 20.b/3
43977 {AI05-0030-2AI05-0030-2} {AI05-0215-1AI05-0215-1} Added the
43978 ability to requeue on operations of synchronized interfaces
43979 that are declared to be an entry.
43980
43981 \1f
43982 File: aarm2012.info, Node: 9.6, Next: 9.7, Prev: 9.5, Up: 9
43983
43984 9.6 Delay Statements, Duration, and Time
43985 ========================================
43986
43987 1
43988 [ A delay_statement is used to block further execution until a specified
43989 expiration time is reached. The expiration time can be specified either
43990 as a particular point in time (in a delay_until_statement (*note 9.6:
43991 S0228.)), or in seconds from the current time (in a
43992 delay_relative_statement (*note 9.6: S0229.)). The language-defined
43993 package Calendar provides definitions for a type Time and associated
43994 operations, including a function Clock that returns the current time. ]
43995
43996 _Syntax_
43997
43998 2
43999 delay_statement ::= delay_until_statement |
44000 delay_relative_statement
44001
44002 3
44003 delay_until_statement ::= delay until delay_expression;
44004
44005 4
44006 delay_relative_statement ::= delay delay_expression;
44007
44008 _Name Resolution Rules_
44009
44010 5
44011 The expected type for the delay_expression in a delay_relative_statement
44012 is the predefined type Duration. The delay_expression in a
44013 delay_until_statement is expected to be of any nonlimited type.
44014
44015 _Legality Rules_
44016
44017 6/3
44018 {AI05-0092-1AI05-0092-1} There can be multiple time bases, each with a
44019 corresponding clock, and a corresponding time type. The type of the
44020 delay_expression in a delay_until_statement shall be a time type --
44021 either the type Time defined in the language-defined package Calendar
44022 (see below), the type Time in the package Real_Time (see *note D.8::),
44023 or some other implementation-defined time type.
44024
44025 6.a
44026 Implementation defined: Any implementation-defined time types.
44027
44028 _Static Semantics_
44029
44030 7
44031 [There is a predefined fixed point type named Duration, declared in the
44032 visible part of package Standard;] a value of type Duration is used to
44033 represent the length of an interval of time, expressed in seconds. [The
44034 type Duration is not specific to a particular time base, but can be used
44035 with any time base.]
44036
44037 8/3
44038 {AI05-0092-1AI05-0092-1} A value of the type Time in package Calendar,
44039 or of some other time type, represents a time as reported by a
44040 corresponding clock.
44041
44042 9
44043 The following language-defined library package exists:
44044
44045 10
44046
44047 package Ada.Calendar is
44048 type Time is private;
44049
44050 11/2
44051 {AI95-00351-01AI95-00351-01} subtype Year_Number is Integer range 1901 .. 2399;
44052 subtype Month_Number is Integer range 1 .. 12;
44053 subtype Day_Number is Integer range 1 .. 31;
44054 subtype Day_Duration is Duration range 0.0 .. 86_400.0;
44055
44056 11.a/2
44057 Reason: {AI95-00351-01AI95-00351-01} A range of 500 years was
44058 chosen, as that only requires one extra bit for the year as
44059 compared to Ada 95. This was done to minimize disruptions
44060 with existing implementations. (One implementor reports that
44061 their time values represent nanoseconds, and this year range
44062 requires 63.77 bits to represent.)
44063
44064 12
44065 function Clock return Time;
44066
44067 13
44068 function Year (Date : Time) return Year_Number;
44069 function Month (Date : Time) return Month_Number;
44070 function Day (Date : Time) return Day_Number;
44071 function Seconds(Date : Time) return Day_Duration;
44072
44073 14
44074 procedure Split (Date : in Time;
44075 Year : out Year_Number;
44076 Month : out Month_Number;
44077 Day : out Day_Number;
44078 Seconds : out Day_Duration);
44079
44080 15
44081 function Time_Of(Year : Year_Number;
44082 Month : Month_Number;
44083 Day : Day_Number;
44084 Seconds : Day_Duration := 0.0)
44085 return Time;
44086
44087 16
44088 function "+" (Left : Time; Right : Duration) return Time;
44089 function "+" (Left : Duration; Right : Time) return Time;
44090 function "-" (Left : Time; Right : Duration) return Time;
44091 function "-" (Left : Time; Right : Time) return Duration;
44092
44093 17
44094 function "<" (Left, Right : Time) return Boolean;
44095 function "<="(Left, Right : Time) return Boolean;
44096 function ">" (Left, Right : Time) return Boolean;
44097 function ">="(Left, Right : Time) return Boolean;
44098
44099 18
44100 Time_Error : exception;
44101
44102 19
44103 private
44104 ... -- not specified by the language
44105 end Ada.Calendar;
44106
44107 _Dynamic Semantics_
44108
44109 20
44110 For the execution of a delay_statement, the delay_expression is first
44111 evaluated. For a delay_until_statement, the expiration time for the
44112 delay is the value of the delay_expression, in the time base associated
44113 with the type of the expression. For a delay_relative_statement, the
44114 expiration time is defined as the current time, in the time base
44115 associated with relative delays, plus the value of the delay_expression
44116 converted to the type Duration, and then rounded up to the next clock
44117 tick. The time base associated with relative delays is as defined in
44118 *note D.9::, "*note D.9:: Delay Accuracy" or is implementation defined.
44119
44120 20.a
44121 Implementation defined: The time base associated with relative
44122 delays.
44123
44124 20.b
44125 Ramification: Rounding up to the next clock tick means that
44126 the reading of the delay-relative clock when the delay expires
44127 should be no less than the current reading of the
44128 delay-relative clock plus the specified duration.
44129
44130 21
44131 The task executing a delay_statement is blocked until the expiration
44132 time is reached, at which point it becomes ready again. If the
44133 expiration time has already passed, the task is not blocked.
44134
44135 21.a
44136 Discussion: For a delay_relative_statement, this case
44137 corresponds to when the value of the delay_expression is zero
44138 or negative.
44139
44140 21.b
44141 Even though the task is not blocked, it might be put back on
44142 the end of its ready queue. See *note D.2::, "*note D.2::
44143 Priority Scheduling".
44144
44145 22/3
44146 {AI05-0092-1AI05-0092-1} If an attempt is made to cancel the
44147 delay_statement [(as part of an asynchronous_select (*note 9.7.4:
44148 S0241.) or abort -- see *note 9.7.4:: and *note 9.8::)], the statement
44149 is cancelled if the expiration time has not yet passed, thereby
44150 completing the delay_statement.
44151
44152 22.a
44153 Reason: This is worded this way so that in an
44154 asynchronous_select where the triggering_statement is a
44155 delay_statement, an attempt to cancel the delay when the
44156 abortable_part completes is ignored if the expiration time has
44157 already passed, in which case the optional statements of the
44158 triggering_alternative are executed.
44159
44160 23
44161 The time base associated with the type Time of package Calendar is
44162 implementation defined. The function Clock of package Calendar returns
44163 a value representing the current time for this time base. [The
44164 implementation-defined value of the named number System.Tick (see *note
44165 13.7::) is an approximation of the length of the real-time interval
44166 during which the value of Calendar.Clock remains constant.]
44167
44168 23.a
44169 Implementation defined: The time base of the type
44170 Calendar.Time.
44171
44172 24/2
44173 {AI95-00351-01AI95-00351-01} The functions Year, Month, Day, and Seconds
44174 return the corresponding values for a given value of the type Time, as
44175 appropriate to an implementation-defined time zone; the procedure Split
44176 returns all four corresponding values. Conversely, the function Time_Of
44177 combines a year number, a month number, a day number, and a duration,
44178 into a value of type Time. The operators "+" and "-" for addition and
44179 subtraction of times and durations, and the relational operators for
44180 times, have the conventional meaning.
44181
44182 24.a/2
44183 Implementation defined: The time zone used for package
44184 Calendar operations.
44185
44186 24.b/3
44187 Ramification: {AI05-0119-1AI05-0119-1} The behavior of these
44188 values and subprograms if the time zone changes is also
44189 implementation-defined. In particular, the changes associated
44190 with summer time adjustments (like Daylight Savings Time in
44191 the United States) should be treated as a change in the
44192 implementation-defined time zone. The language does not
44193 specify whether the time zone information is stored in values
44194 of type Time; therefore the results of binary operators are
44195 unspecified when the operands are the two values with
44196 different effective time zones. In particular, the results of
44197 "-" may differ from the "real" result by the difference in the
44198 time zone adjustment. Similarly, the result of
44199 UTC_Time_Offset (see 9.6.1) may or may not reflect a time zone
44200 adjustment.
44201
44202 25
44203 If Time_Of is called with a seconds value of 86_400.0, the value
44204 returned is equal to the value of Time_Of for the next day with a
44205 seconds value of 0.0. The value returned by the function Seconds or
44206 through the Seconds parameter of the procedure Split is always less than
44207 86_400.0.
44208
44209 26/1
44210 {8652/00308652/0030} {AI95-00113-01AI95-00113-01} The exception
44211 Time_Error is raised by the function Time_Of if the actual parameters do
44212 not form a proper date. This exception is also raised by the operators
44213 "+" and "-" if the result is not representable in the type Time or
44214 Duration, as appropriate. This exception is also raised by the
44215 functions Year, Month, Day, and Seconds and the procedure Split if the
44216 year number of the given date is outside of the range of the subtype
44217 Year_Number.
44218
44219 26.a/1
44220 To be honest: {8652/01068652/0106}
44221 {AI95-00160-01AI95-00160-01} By "proper date" above we mean
44222 that the given year has a month with the given day. For
44223 example, February 29th is a proper date only for a leap year.
44224 We do not mean to include the Seconds in this notion; in
44225 particular, we do not mean to require implementations to check
44226 for the "missing hour" that occurs when Daylight Savings Time
44227 starts in the spring.
44228
44229 26.b/2
44230 Reason: {8652/00308652/0030} {AI95-00113-01AI95-00113-01}
44231 {AI95-00351-01AI95-00351-01} We allow Year and Split to raise
44232 Time_Error because the arithmetic operators are allowed (but
44233 not required) to produce times that are outside the range of
44234 years from 1901 to 2399. This is similar to the way integer
44235 operators may return values outside the base range of their
44236 type so long as the value is mathematically correct. We allow
44237 the functions Month, Day and Seconds to raise Time_Error so
44238 that they can be implemented in terms of Split.
44239
44240 _Implementation Requirements_
44241
44242 27
44243 The implementation of the type Duration shall allow representation of
44244 time intervals (both positive and negative) up to at least 86400 seconds
44245 (one day); Duration'Small shall not be greater than twenty milliseconds.
44246 The implementation of the type Time shall allow representation of all
44247 dates with year numbers in the range of Year_Number[; it may allow
44248 representation of other dates as well (both earlier and later).]
44249
44250 _Implementation Permissions_
44251
44252 28/3
44253 {AI05-0092-1AI05-0092-1} An implementation may define additional time
44254 types.
44255
44256 29
44257 An implementation may raise Time_Error if the value of a
44258 delay_expression in a delay_until_statement of a select_statement
44259 represents a time more than 90 days past the current time. The actual
44260 limit, if any, is implementation-defined.
44261
44262 29.a
44263 Implementation defined: Any limit on delay_until_statements of
44264 select_statements.
44265
44266 29.b
44267 Implementation Note: This allows an implementation to
44268 implement select_statement timeouts using a representation
44269 that does not support the full range of a time type. In
44270 particular 90 days of seconds can be represented in 23 bits,
44271 allowing a signed 24-bit representation for the seconds part
44272 of a timeout. There is no similar restriction allowed for
44273 stand-alone delay_until_statements, as these can be
44274 implemented internally using a loop if necessary to
44275 accommodate a long delay.
44276
44277 _Implementation Advice_
44278
44279 30
44280 Whenever possible in an implementation, the value of Duration'Small
44281 should be no greater than 100 microseconds.
44282
44283 30.a
44284 Implementation Note: This can be satisfied using a 32-bit 2's
44285 complement representation with a small of 2.0**(-14) -- that
44286 is, 61 microseconds -- and a range of ± 2.0**17 -- that is,
44287 131_072.0.
44288
44289 30.b/2
44290 Implementation Advice: The value of Duration'Small should be
44291 no greater than 100 microseconds.
44292
44293 31
44294 The time base for delay_relative_statements should be monotonic; it need
44295 not be the same time base as used for Calendar.Clock.
44296
44297 31.a/2
44298 Implementation Advice: The time base for
44299 delay_relative_statements should be monotonic.
44300
44301 NOTES
44302
44303 32
44304 33 A delay_relative_statement with a negative value of the
44305 delay_expression is equivalent to one with a zero value.
44306
44307 33
44308 34 A delay_statement may be executed by the environment task;
44309 consequently delay_statements may be executed as part of the
44310 elaboration of a library_item or the execution of the main
44311 subprogram. Such statements delay the environment task (see *note
44312 10.2::).
44313
44314 34
44315 35 A delay_statement is an abort completion point and a
44316 potentially blocking operation, even if the task is not actually
44317 blocked.
44318
44319 35
44320 36 There is no necessary relationship between System.Tick (the
44321 resolution of the clock of package Calendar) and Duration'Small
44322 (the small of type Duration).
44323
44324 35.a
44325 Ramification: The inaccuracy of the delay_statement has no
44326 relation to System.Tick. In particular, it is possible that
44327 the clock used for the delay_statement is less accurate than
44328 Calendar.Clock.
44329
44330 35.b
44331 We considered making Tick a run-time-determined quantity, to
44332 allow for easier configurability. However, this would not be
44333 upward compatible, and the desired configurability can be
44334 achieved using functionality defined in *note Annex D::,
44335 "*note Annex D:: Real-Time Systems".
44336
44337 36
44338 37 Additional requirements associated with delay_statements are
44339 given in *note D.9::, "*note D.9:: Delay Accuracy".
44340
44341 _Examples_
44342
44343 37
44344 Example of a relative delay statement:
44345
44346 38
44347 delay 3.0; -- delay 3.0 seconds
44348
44349 39
44350 Example of a periodic task:
44351
44352 40
44353 declare
44354 use Ada.Calendar;
44355 Next_Time : Time := Clock + Period;
44356 -- Period is a global constant of type Duration
44357 begin
44358 loop -- repeated every Period seconds
44359 delay until Next_Time;
44360 ... -- perform some actions
44361 Next_Time := Next_Time + Period;
44362 end loop;
44363 end;
44364
44365 _Inconsistencies With Ada 83_
44366
44367 40.a
44368 For programs that raise Time_Error on "+" or "-" in Ada 83,the
44369 exception might be deferred until a call on Split or
44370 Year_Number, or might not be raised at all (if the offending
44371 time is never Split after being calculated). This should not
44372 affect typical programs, since they deal only with times
44373 corresponding to the relatively recent past or near future.
44374
44375 _Extensions to Ada 83_
44376
44377 40.b
44378 The syntax rule for delay_statement is modified to allow
44379 delay_until_statements.
44380
44381 40.c/2
44382 {AI95-00351-01AI95-00351-01} The type Time may represent dates
44383 with year numbers outside of Year_Number. Therefore, the
44384 operations "+" and "-" need only raise Time_Error if the
44385 result is not representable in Time (or Duration); also, Split
44386 or Year will now raise Time_Error if the year number is
44387 outside of Year_Number. This change is intended to simplify
44388 the implementation of "+" and "-" (allowing them to depend on
44389 overflow for detecting when to raise Time_Error) and to allow
44390 local time zone information to be considered at the time of
44391 Split rather than Clock (depending on the implementation
44392 approach). For example, in a POSIX environment, it is natural
44393 for the type Time to be based on GMT, and the results of
44394 procedure Split (and the functions Year, Month, Day, and
44395 Seconds) to depend on local time zone information. In other
44396 environments, it is more natural for the type Time to be based
44397 on the local time zone, with the results of Year, Month, Day,
44398 and Seconds being pure functions of their input.
44399
44400 40.d/2
44401 This paragraph was deleted.{AI95-00351-01AI95-00351-01}
44402
44403 _Inconsistencies With Ada 95_
44404
44405 40.e/2
44406 {AI95-00351-01AI95-00351-01} The upper bound of Year_Number
44407 has been changed to avoid a year 2100 problem. A program
44408 which expects years past 2099 to raise Constraint_Error will
44409 fail in Ada 2005. We don't expect there to be many programs
44410 which are depending on an exception to be raised. A program
44411 that uses Year_Number'Last as a magic number may also fail if
44412 values of Time are stored outside of the program. Note that
44413 the lower bound of Year_Number wasn't changed, because it is
44414 not unusual to use that value in a constant to represent an
44415 unknown time.
44416
44417 _Wording Changes from Ada 95_
44418
44419 40.f/2
44420 {8652/00028652/0002} {AI95-00171-01AI95-00171-01} Corrigendum:
44421 Clarified that Month, Day, and Seconds can raise Time_Error.
44422
44423 * Menu:
44424
44425 * 9.6.1 :: Formatting, Time Zones, and other operations for Time
44426
44427 \1f
44428 File: aarm2012.info, Node: 9.6.1, Up: 9.6
44429
44430 9.6.1 Formatting, Time Zones, and other operations for Time
44431 -----------------------------------------------------------
44432
44433 _Static Semantics_
44434
44435 1/2
44436 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01} The following
44437 language-defined library packages exist:
44438
44439 2/2
44440 package Ada.Calendar.Time_Zones is
44441
44442 3/2
44443 -- Time zone manipulation:
44444
44445 4/2
44446 type Time_Offset is range -28*60 .. 28*60;
44447
44448 4.a/2
44449 Reason: We want to be able to specify the difference between
44450 any two arbitrary time zones. You might think that 1440 (24
44451 hours) would be enough, but there are places (like Tonga,
44452 which is UTC+13hr) which are more than 12 hours than UTC.
44453 Combined with summer time (known as daylight saving time in
44454 some parts of the world) - which switches opposite in the
44455 northern and souther hemispheres - and even greater
44456 differences are possible. We know of cases of a 26 hours
44457 difference, so we err on the safe side by selecting 28 hours
44458 as the limit.
44459
44460 5/2
44461 Unknown_Zone_Error : exception;
44462
44463 6/2
44464 function UTC_Time_Offset (Date : Time := Clock) return Time_Offset;
44465
44466 7/2
44467 end Ada.Calendar.Time_Zones;
44468
44469 8/2
44470
44471 package Ada.Calendar.Arithmetic is
44472
44473 9/2
44474 -- Arithmetic on days:
44475
44476 10/2
44477 type Day_Count is range
44478 -366*(1+Year_Number'Last - Year_Number'First)
44479 ..
44480 366*(1+Year_Number'Last - Year_Number'First);
44481
44482 11/2
44483 subtype Leap_Seconds_Count is Integer range -2047 .. 2047;
44484
44485 11.a/2
44486 Reason: The maximum number of leap seconds is likely to be
44487 much less than this, but we don't want to reach the limit too
44488 soon if the earth's behavior suddenly changes. We believe
44489 that the maximum number is 1612, based on the current rules,
44490 but that number is too weird to use here.
44491
44492 12/2
44493 procedure Difference (Left, Right : in Time;
44494 Days : out Day_Count;
44495 Seconds : out Duration;
44496 Leap_Seconds : out Leap_Seconds_Count);
44497
44498 13/2
44499 function "+" (Left : Time; Right : Day_Count) return Time;
44500 function "+" (Left : Day_Count; Right : Time) return Time;
44501 function "-" (Left : Time; Right : Day_Count) return Time;
44502 function "-" (Left, Right : Time) return Day_Count;
44503
44504 14/2
44505 end Ada.Calendar.Arithmetic;
44506
44507 15/2
44508
44509 with Ada.Calendar.Time_Zones;
44510 package Ada.Calendar.Formatting is
44511
44512 16/2
44513 -- Day of the week:
44514
44515 17/2
44516 type Day_Name is (Monday, Tuesday, Wednesday, Thursday,
44517 Friday, Saturday, Sunday);
44518
44519 18/2
44520 function Day_of_Week (Date : Time) return Day_Name;
44521
44522 19/2
44523 -- Hours:Minutes:Seconds access:
44524
44525 20/2
44526 subtype Hour_Number is Natural range 0 .. 23;
44527 subtype Minute_Number is Natural range 0 .. 59;
44528 subtype Second_Number is Natural range 0 .. 59;
44529 subtype Second_Duration is Day_Duration range 0.0 .. 1.0;
44530
44531 21/2
44532 function Year (Date : Time;
44533 Time_Zone : Time_Zones.Time_Offset := 0)
44534 return Year_Number;
44535
44536 22/2
44537 function Month (Date : Time;
44538 Time_Zone : Time_Zones.Time_Offset := 0)
44539 return Month_Number;
44540
44541 23/2
44542 function Day (Date : Time;
44543 Time_Zone : Time_Zones.Time_Offset := 0)
44544 return Day_Number;
44545
44546 24/2
44547 function Hour (Date : Time;
44548 Time_Zone : Time_Zones.Time_Offset := 0)
44549 return Hour_Number;
44550
44551 25/2
44552 function Minute (Date : Time;
44553 Time_Zone : Time_Zones.Time_Offset := 0)
44554 return Minute_Number;
44555
44556 26/2
44557 function Second (Date : Time)
44558 return Second_Number;
44559
44560 27/2
44561 function Sub_Second (Date : Time)
44562 return Second_Duration;
44563
44564 28/2
44565 function Seconds_Of (Hour : Hour_Number;
44566 Minute : Minute_Number;
44567 Second : Second_Number := 0;
44568 Sub_Second : Second_Duration := 0.0)
44569 return Day_Duration;
44570
44571 29/2
44572 procedure Split (Seconds : in Day_Duration;
44573 Hour : out Hour_Number;
44574 Minute : out Minute_Number;
44575 Second : out Second_Number;
44576 Sub_Second : out Second_Duration);
44577
44578 30/2
44579 function Time_Of (Year : Year_Number;
44580 Month : Month_Number;
44581 Day : Day_Number;
44582 Hour : Hour_Number;
44583 Minute : Minute_Number;
44584 Second : Second_Number;
44585 Sub_Second : Second_Duration := 0.0;
44586 Leap_Second: Boolean := False;
44587 Time_Zone : Time_Zones.Time_Offset := 0)
44588 return Time;
44589
44590 31/2
44591 function Time_Of (Year : Year_Number;
44592 Month : Month_Number;
44593 Day : Day_Number;
44594 Seconds : Day_Duration := 0.0;
44595 Leap_Second: Boolean := False;
44596 Time_Zone : Time_Zones.Time_Offset := 0)
44597 return Time;
44598
44599 32/2
44600 procedure Split (Date : in Time;
44601 Year : out Year_Number;
44602 Month : out Month_Number;
44603 Day : out Day_Number;
44604 Hour : out Hour_Number;
44605 Minute : out Minute_Number;
44606 Second : out Second_Number;
44607 Sub_Second : out Second_Duration;
44608 Time_Zone : in Time_Zones.Time_Offset := 0);
44609
44610 33/2
44611 procedure Split (Date : in Time;
44612 Year : out Year_Number;
44613 Month : out Month_Number;
44614 Day : out Day_Number;
44615 Hour : out Hour_Number;
44616 Minute : out Minute_Number;
44617 Second : out Second_Number;
44618 Sub_Second : out Second_Duration;
44619 Leap_Second: out Boolean;
44620 Time_Zone : in Time_Zones.Time_Offset := 0);
44621
44622 34/2
44623 procedure Split (Date : in Time;
44624 Year : out Year_Number;
44625 Month : out Month_Number;
44626 Day : out Day_Number;
44627 Seconds : out Day_Duration;
44628 Leap_Second: out Boolean;
44629 Time_Zone : in Time_Zones.Time_Offset := 0);
44630
44631 35/2
44632 -- Simple image and value:
44633 function Image (Date : Time;
44634 Include_Time_Fraction : Boolean := False;
44635 Time_Zone : Time_Zones.Time_Offset := 0) return String;
44636
44637 36/2
44638 function Value (Date : String;
44639 Time_Zone : Time_Zones.Time_Offset := 0) return Time;
44640
44641 37/2
44642 function Image (Elapsed_Time : Duration;
44643 Include_Time_Fraction : Boolean := False) return String;
44644
44645 38/2
44646 function Value (Elapsed_Time : String) return Duration;
44647
44648 39/2
44649 end Ada.Calendar.Formatting;
44650
44651 40/2
44652 {AI95-00351-01AI95-00351-01} Type Time_Offset represents the number of
44653 minutes difference between the implementation-defined time zone used by
44654 Calendar and another time zone.
44655
44656 41/2
44657 function UTC_Time_Offset (Date : Time := Clock) return Time_Offset;
44658
44659 42/3
44660 {AI95-00351-01AI95-00351-01} {AI05-0119-1AI05-0119-1}
44661 {AI05-0269-1AI05-0269-1} Returns, as a number of minutes, the
44662 result of subtracting the implementation-defined time zone of
44663 Calendar from UTC time, at the time Date. If the time zone of
44664 the Calendar implementation is unknown, then
44665 Unknown_Zone_Error is raised.
44666
44667 42.a.1/3
44668 Ramification: {AI05-0119-1AI05-0119-1} In North America, the
44669 result will be negative; in Europe, the result will be zero or
44670 positive.
44671
44672 42.a/2
44673 Discussion: The Date parameter is needed to take into account
44674 time differences caused by daylight-savings time and other
44675 time changes. This parameter is measured in the time zone of
44676 Calendar, if any, not necessarily the UTC time zone.
44677
44678 42.b/2
44679 Other time zones can be supported with a child package. We
44680 don't define one because of the lack of agreement on the
44681 definition of a time zone.
44682
44683 42.c/2
44684 The accuracy of this routine is not specified; the intent is
44685 that the facilities of the underlying target operating system
44686 are used to implement it.
44687
44688 43/2
44689 procedure Difference (Left, Right : in Time;
44690 Days : out Day_Count;
44691 Seconds : out Duration;
44692 Leap_Seconds : out Leap_Seconds_Count);
44693
44694 44/2
44695 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44696 Returns the difference between Left and Right. Days is the
44697 number of days of difference, Seconds is the remainder seconds
44698 of difference excluding leap seconds, and Leap_Seconds is the
44699 number of leap seconds. If Left < Right, then Seconds <= 0.0,
44700 Days <= 0, and Leap_Seconds <= 0. Otherwise, all values are
44701 nonnegative. The absolute value of Seconds is always less
44702 than 86_400.0. For the returned values, if Days = 0, then
44703 Seconds + Duration(Leap_Seconds) = Calendar."-" (Left, Right).
44704
44705 44.a/2
44706 Discussion: Leap_Seconds, if any, are not included in Seconds.
44707 However, Leap_Seconds should be included in calculations using
44708 the operators defined in Calendar, as is specified for "-"
44709 above.
44710
44711 45/2
44712 function "+" (Left : Time; Right : Day_Count) return Time;
44713 function "+" (Left : Day_Count; Right : Time) return Time;
44714
44715 46/2
44716 {AI95-00351-01AI95-00351-01} Adds a number of days to a time
44717 value. Time_Error is raised if the result is not
44718 representable as a value of type Time.
44719
44720 47/2
44721 function "-" (Left : Time; Right : Day_Count) return Time;
44722
44723 48/2
44724 {AI95-00351-01AI95-00351-01} Subtracts a number of days from a
44725 time value. Time_Error is raised if the result is not
44726 representable as a value of type Time.
44727
44728 49/2
44729 function "-" (Left, Right : Time) return Day_Count;
44730
44731 50/2
44732 {AI95-00351-01AI95-00351-01} Subtracts two time values, and
44733 returns the number of days between them. This is the same
44734 value that Difference would return in Days.
44735
44736 51/2
44737 function Day_of_Week (Date : Time) return Day_Name;
44738
44739 52/2
44740 {AI95-00351-01AI95-00351-01} Returns the day of the week for
44741 Time. This is based on the Year, Month, and Day values of
44742 Time.
44743
44744 53/2
44745 function Year (Date : Time;
44746 Time_Zone : Time_Zones.Time_Offset := 0)
44747 return Year_Number;
44748
44749 54/2
44750 {AI95-00427-01AI95-00427-01} Returns the year for Date, as
44751 appropriate for the specified time zone offset.
44752
44753 55/2
44754 function Month (Date : Time;
44755 Time_Zone : Time_Zones.Time_Offset := 0)
44756 return Month_Number;
44757
44758 56/2
44759 {AI95-00427-01AI95-00427-01} Returns the month for Date, as
44760 appropriate for the specified time zone offset.
44761
44762 57/2
44763 function Day (Date : Time;
44764 Time_Zone : Time_Zones.Time_Offset := 0)
44765 return Day_Number;
44766
44767 58/2
44768 {AI95-00427-01AI95-00427-01} Returns the day number for Date,
44769 as appropriate for the specified time zone offset.
44770
44771 59/2
44772 function Hour (Date : Time;
44773 Time_Zone : Time_Zones.Time_Offset := 0)
44774 return Hour_Number;
44775
44776 60/2
44777 {AI95-00351-01AI95-00351-01} Returns the hour for Date, as
44778 appropriate for the specified time zone offset.
44779
44780 61/2
44781 function Minute (Date : Time;
44782 Time_Zone : Time_Zones.Time_Offset := 0)
44783 return Minute_Number;
44784
44785 62/2
44786 {AI95-00351-01AI95-00351-01} Returns the minute within the
44787 hour for Date, as appropriate for the specified time zone
44788 offset.
44789
44790 63/2
44791 function Second (Date : Time)
44792 return Second_Number;
44793
44794 64/2
44795 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44796 Returns the second within the hour and minute for Date.
44797
44798 65/2
44799 function Sub_Second (Date : Time)
44800 return Second_Duration;
44801
44802 66/2
44803 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44804 Returns the fraction of second for Date (this has the same
44805 accuracy as Day_Duration). The value returned is always less
44806 than 1.0.
44807
44808 67/2
44809 function Seconds_Of (Hour : Hour_Number;
44810 Minute : Minute_Number;
44811 Second : Second_Number := 0;
44812 Sub_Second : Second_Duration := 0.0)
44813 return Day_Duration;
44814
44815 68/2
44816 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44817 Returns a Day_Duration value for the combination of the given
44818 Hour, Minute, Second, and Sub_Second. This value can be used
44819 in Calendar.Time_Of as well as the argument to Calendar."+"
44820 and Calendar."-". If Seconds_Of is called with a Sub_Second
44821 value of 1.0, the value returned is equal to the value of
44822 Seconds_Of for the next second with a Sub_Second value of 0.0.
44823
44824 69/2
44825 procedure Split (Seconds : in Day_Duration;
44826 Hour : out Hour_Number;
44827 Minute : out Minute_Number;
44828 Second : out Second_Number;
44829 Sub_Second : out Second_Duration);
44830
44831 70/3
44832 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44833 {AI05-0238-1AI05-0238-1} Splits Seconds into Hour, Minute,
44834 Second and Sub_Second in such a way that the resulting values
44835 all belong to their respective subtypes. The value returned
44836 in the Sub_Second parameter is always less than 1.0. If
44837 Seconds = 86400.0, Split propagates Time_Error.
44838
44839 70.a/2
44840 Ramification: There is only one way to do the split which
44841 meets all of the requirements.
44842
44843 70.b/3
44844 Reason: {AI05-0238-1AI05-0238-1} If Seconds = 86400.0, one of
44845 the returned values would have to be out of its defined range
44846 (either Sub_Second = 1.0 or Hour = 24 with the other value
44847 being 0). This doesn't seem worth breaking the invariants.
44848
44849 71/2
44850 function Time_Of (Year : Year_Number;
44851 Month : Month_Number;
44852 Day : Day_Number;
44853 Hour : Hour_Number;
44854 Minute : Minute_Number;
44855 Second : Second_Number;
44856 Sub_Second : Second_Duration := 0.0;
44857 Leap_Second: Boolean := False;
44858 Time_Zone : Time_Zones.Time_Offset := 0)
44859 return Time;
44860
44861 72/2
44862 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01} If
44863 Leap_Second is False, returns a Time built from the date and
44864 time values, relative to the specified time zone offset. If
44865 Leap_Second is True, returns the Time that represents the time
44866 within the leap second that is one second later than the time
44867 specified by the other parameters. Time_Error is raised if
44868 the parameters do not form a proper date or time. If Time_Of
44869 is called with a Sub_Second value of 1.0, the value returned
44870 is equal to the value of Time_Of for the next second with a
44871 Sub_Second value of 0.0.
44872
44873 72.a/2
44874 Discussion: Time_Error should be raised if Leap_Second is
44875 True, and the date and time values do not represent the second
44876 before a leap second. A leap second always occurs at midnight
44877 UTC, and is 23:59:60 UTC in ISO notation. So, if the time
44878 zone is UTC and Leap_Second is True, if any of Hour /= 23,
44879 Minute /= 59, or Second /= 59, then Time_Error should be
44880 raised. However, we do not say that, because other time zones
44881 will have different values where a leap second is allowed.
44882
44883 73/2
44884 function Time_Of (Year : Year_Number;
44885 Month : Month_Number;
44886 Day : Day_Number;
44887 Seconds : Day_Duration := 0.0;
44888 Leap_Second: Boolean := False;
44889 Time_Zone : Time_Zones.Time_Offset := 0)
44890 return Time;
44891
44892 74/2
44893 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01} If
44894 Leap_Second is False, returns a Time built from the date and
44895 time values, relative to the specified time zone offset. If
44896 Leap_Second is True, returns the Time that represents the time
44897 within the leap second that is one second later than the time
44898 specified by the other parameters. Time_Error is raised if
44899 the parameters do not form a proper date or time. If Time_Of
44900 is called with a Seconds value of 86_400.0, the value returned
44901 is equal to the value of Time_Of for the next day with a
44902 Seconds value of 0.0.
44903
44904 75/2
44905 procedure Split (Date : in Time;
44906 Year : out Year_Number;
44907 Month : out Month_Number;
44908 Day : out Day_Number;
44909 Hour : out Hour_Number;
44910 Minute : out Minute_Number;
44911 Second : out Second_Number;
44912 Sub_Second : out Second_Duration;
44913 Leap_Second: out Boolean;
44914 Time_Zone : in Time_Zones.Time_Offset := 0);
44915
44916 76/2
44917 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01} If
44918 Date does not represent a time within a leap second, splits
44919 Date into its constituent parts (Year, Month, Day, Hour,
44920 Minute, Second, Sub_Second), relative to the specified time
44921 zone offset, and sets Leap_Second to False. If Date
44922 represents a time within a leap second, set the constituent
44923 parts to values corresponding to a time one second earlier
44924 than that given by Date, relative to the specified time zone
44925 offset, and sets Leap_Seconds to True. The value returned in
44926 the Sub_Second parameter is always less than 1.0.
44927
44928 77/2
44929 procedure Split (Date : in Time;
44930 Year : out Year_Number;
44931 Month : out Month_Number;
44932 Day : out Day_Number;
44933 Hour : out Hour_Number;
44934 Minute : out Minute_Number;
44935 Second : out Second_Number;
44936 Sub_Second : out Second_Duration;
44937 Time_Zone : in Time_Zones.Time_Offset := 0);
44938
44939 78/2
44940 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01}
44941 Splits Date into its constituent parts (Year, Month, Day,
44942 Hour, Minute, Second, Sub_Second), relative to the specified
44943 time zone offset. The value returned in the Sub_Second
44944 parameter is always less than 1.0.
44945
44946 79/2
44947 procedure Split (Date : in Time;
44948 Year : out Year_Number;
44949 Month : out Month_Number;
44950 Day : out Day_Number;
44951 Seconds : out Day_Duration;
44952 Leap_Second: out Boolean;
44953 Time_Zone : in Time_Zones.Time_Offset := 0);
44954
44955 80/2
44956 {AI95-00351-01AI95-00351-01} {AI95-00427-01AI95-00427-01} If
44957 Date does not represent a time within a leap second, splits
44958 Date into its constituent parts (Year, Month, Day, Seconds),
44959 relative to the specified time zone offset, and sets
44960 Leap_Second to False. If Date represents a time within a leap
44961 second, set the constituent parts to values corresponding to a
44962 time one second earlier than that given by Date, relative to
44963 the specified time zone offset, and sets Leap_Seconds to True.
44964 The value returned in the Seconds parameter is always less
44965 than 86_400.0.
44966
44967 81/2
44968 function Image (Date : Time;
44969 Include_Time_Fraction : Boolean := False;
44970 Time_Zone : Time_Zones.Time_Offset := 0) return String;
44971
44972 82/2
44973 {AI95-00351-01AI95-00351-01} Returns a string form of the Date
44974 relative to the given Time_Zone. The format is
44975 "Year-Month-Day Hour:Minute:Second", where the Year is a
44976 4-digit value, and all others are 2-digit values, of the
44977 functions defined in Calendar and Calendar.Formatting,
44978 including a leading zero, if needed. The separators between
44979 the values are a minus, another minus, a colon, and a single
44980 space between the Day and Hour. If Include_Time_Fraction is
44981 True, the integer part of Sub_Seconds*100 is suffixed to the
44982 string as a point followed by a 2-digit value.
44983
44984 82.a/2
44985 Discussion: The Image provides a string in ISO 8601 format,
44986 the international standard time format. Alternative
44987 representations allowed in ISO 8601 are not supported here.
44988
44989 82.b/2
44990 ISO 8601 allows 24:00:00 for midnight; and a seconds value of
44991 60 for leap seconds. These are not allowed here (the routines
44992 mentioned above cannot produce those results).
44993
44994 82.c/2
44995 Ramification: The fractional part is truncated, not rounded.
44996 It would be quite hard to define the result with proper
44997 rounding, as it can change all of the values of the image.
44998 Values can be rounded up by adding an appropriate constant
44999 (0.5 if Include_Time_Fraction is False, 0.005 otherwise) to
45000 the time before taking the image.
45001
45002 83/2
45003 function Value (Date : String;
45004 Time_Zone : Time_Zones.Time_Offset := 0) return Time;
45005
45006 84/2
45007 {AI95-00351-01AI95-00351-01} Returns a Time value for the
45008 image given as Date, relative to the given time zone.
45009 Constraint_Error is raised if the string is not formatted as
45010 described for Image, or the function cannot interpret the
45011 given string as a Time value.
45012
45013 84.a/3
45014 Discussion: {AI05-0005-1AI05-0005-1} The intent is that the
45015 implementation enforce the same range rules on the string as
45016 the appropriate function Time_Of, except for the hour, so
45017 "cannot interpret the given string as a Time value" happens
45018 when one of the values is out of the required range. For
45019 example, "2005-08-31 24:00:00" should raise Constraint_Error
45020 (the hour is out of range).
45021
45022 85/2
45023 function Image (Elapsed_Time : Duration;
45024 Include_Time_Fraction : Boolean := False) return String;
45025
45026 86/2
45027 {AI95-00351-01AI95-00351-01} Returns a string form of the
45028 Elapsed_Time. The format is "Hour:Minute:Second", where all
45029 values are 2-digit values, including a leading zero, if
45030 needed. The separators between the values are colons. If
45031 Include_Time_Fraction is True, the integer part of
45032 Sub_Seconds*100 is suffixed to the string as a point followed
45033 by a 2-digit value. If Elapsed_Time < 0.0, the result is
45034 Image (abs Elapsed_Time, Include_Time_Fraction) prefixed with
45035 a minus sign. If abs Elapsed_Time represents 100 hours or
45036 more, the result is implementation-defined.
45037
45038 86.a/2
45039 Implementation defined: The result of Calendar.Formating.Image
45040 if its argument represents more than 100 hours.
45041
45042 86.b/2
45043 Implementation Note: This cannot be implemented (directly) by
45044 calling Calendar.Formatting.Split, since it may be out of the
45045 range of Day_Duration, and thus the number of hours may be out
45046 of the range of Hour_Number.
45047
45048 86.c
45049 If a Duration value can represent more then 100 hours, the
45050 implementation will need to define a format for the return of
45051 Image.
45052
45053 87/2
45054 function Value (Elapsed_Time : String) return Duration;
45055
45056 88/2
45057 {AI95-00351-01AI95-00351-01} Returns a Duration value for the
45058 image given as Elapsed_Time. Constraint_Error is raised if
45059 the string is not formatted as described for Image, or the
45060 function cannot interpret the given string as a Duration
45061 value.
45062
45063 88.a/2
45064 Discussion: The intent is that the implementation enforce the
45065 same range rules on the string as the appropriate function
45066 Time_Of, except for the hour, so "cannot interpret the given
45067 string as a Time value" happens when one of the values is out
45068 of the required range. For example, "10:23:60" should raise
45069 Constraint_Error (the seconds value is out of range).
45070
45071 _Implementation Advice_
45072
45073 89/2
45074 {AI95-00351-01AI95-00351-01} An implementation should support leap
45075 seconds if the target system supports them. If leap seconds are not
45076 supported, Difference should return zero for Leap_Seconds, Split should
45077 return False for Leap_Second, and Time_Of should raise Time_Error if
45078 Leap_Second is True.
45079
45080 89.a/2
45081 Implementation Advice: Leap seconds should be supported if the
45082 target system supports them. Otherwise, operations in
45083 Calendar.Formatting should return results consistent with no
45084 leap seconds.
45085
45086 89.b/2
45087 Discussion: An implementation can always support leap seconds
45088 when the target system does not; indeed, this isn't
45089 particularly hard (all that is required is a table of when
45090 leap seconds were inserted). As such, leap second support
45091 isn't "impossible or impractical" in the sense of *note
45092 1.1.3::. However, for some purposes, it may be important to
45093 follow the target system's lack of leap second support (if the
45094 target is a GPS satellite, which does not use leap seconds,
45095 leap second support would be a handicap to work around).
45096 Thus, this Implementation Advice should be read as giving
45097 permission to not support leap seconds on target systems that
45098 don't support leap seconds. Implementers should use the needs
45099 of their customers to determine whether or not support leap
45100 seconds on such targets.
45101
45102 NOTES
45103
45104 90/2
45105 38 {AI95-00351-01AI95-00351-01} The implementation-defined time
45106 zone of package Calendar may, but need not, be the local time zone.
45107 UTC_Time_Offset always returns the difference relative to the
45108 implementation-defined time zone of package Calendar. If
45109 UTC_Time_Offset does not raise Unknown_Zone_Error, UTC time can be
45110 safely calculated (within the accuracy of the underlying
45111 time-base).
45112
45113 90.a/2
45114 Discussion: {AI95-00351-01AI95-00351-01} The time in the time
45115 zone known as Greenwich Mean Time (GMT) is generally very
45116 close to UTC time; for most purposes they can be treated the
45117 same. GMT is the time based on the rotation of the Earth; UTC
45118 is the time based on atomic clocks, with leap seconds
45119 periodically inserted to realign with GMT (because most human
45120 activities depend on the rotation of the Earth). At any point
45121 in time, there will be a sub-second difference between GMT and
45122 UTC.
45123
45124 91/2
45125 39 {AI95-00351-01AI95-00351-01} Calling Split on the results of
45126 subtracting Duration(UTC_Time_Offset*60) from Clock provides the
45127 components (hours, minutes, and so on) of the UTC time. In the
45128 United States, for example, UTC_Time_Offset will generally be
45129 negative.
45130
45131 91.a/2
45132 Discussion: This is an illustration to help specify the value
45133 of UTC_Time_Offset. A user should pass UTC_Time_Offset as the
45134 Time_Zone parameter of Split, rather than trying to make the
45135 above calculation.
45136
45137 _Extensions to Ada 95_
45138
45139 91.b/2
45140 {AI95-00351-01AI95-00351-01} {AI95-00428-01AI95-00428-01}
45141 Packages Calendar.Time_Zones, Calendar.Arithmetic, and
45142 Calendar.Formatting are new.
45143
45144 _Inconsistencies With Ada 2005_
45145
45146 91.c/3
45147 {AI05-0238-1AI05-0238-1} Correction: Defined that Split for
45148 Seconds raises Time_Error for a value of exactly 86400.0,
45149 rather than breaking some invariant or raising some other
45150 exception. Ada 2005 left this unspecified; a program that
45151 depended on what some implementation does might break, but
45152 such a program is not portable anyway.
45153
45154 _Wording Changes from Ada 2005_
45155
45156 91.d/3
45157 {AI05-0119-1AI05-0119-1} Correction: Clarified the sign of
45158 UTC_Time_Offset.
45159
45160 \1f
45161 File: aarm2012.info, Node: 9.7, Next: 9.8, Prev: 9.6, Up: 9
45162
45163 9.7 Select Statements
45164 =====================
45165
45166 1
45167 [There are four forms of the select_statement. One form provides a
45168 selective wait for one or more select_alternatives. Two provide timed
45169 and conditional entry calls. The fourth provides asynchronous transfer
45170 of control.]
45171
45172 _Syntax_
45173
45174 2
45175 select_statement ::=
45176 selective_accept
45177 | timed_entry_call
45178 | conditional_entry_call
45179 | asynchronous_select
45180
45181 _Examples_
45182
45183 3
45184 Example of a select statement:
45185
45186 4
45187 select
45188 accept Driver_Awake_Signal;
45189 or
45190 delay 30.0*Seconds;
45191 Stop_The_Train;
45192 end select;
45193
45194 _Extensions to Ada 83_
45195
45196 4.a
45197 Asynchronous_select is new.
45198
45199 * Menu:
45200
45201 * 9.7.1 :: Selective Accept
45202 * 9.7.2 :: Timed Entry Calls
45203 * 9.7.3 :: Conditional Entry Calls
45204 * 9.7.4 :: Asynchronous Transfer of Control
45205
45206 \1f
45207 File: aarm2012.info, Node: 9.7.1, Next: 9.7.2, Up: 9.7
45208
45209 9.7.1 Selective Accept
45210 ----------------------
45211
45212 1
45213 [This form of the select_statement allows a combination of waiting for,
45214 and selecting from, one or more alternatives. The selection may depend
45215 on conditions associated with each alternative of the selective_accept.
45216 ]
45217
45218 _Syntax_
45219
45220 2
45221 selective_accept ::=
45222 select
45223 [guard]
45224 select_alternative
45225 { or
45226 [guard]
45227 select_alternative }
45228 [ else
45229 sequence_of_statements ]
45230 end select;
45231
45232 3
45233 guard ::= when condition =>
45234
45235 4
45236 select_alternative ::=
45237 accept_alternative
45238 | delay_alternative
45239 | terminate_alternative
45240
45241 5
45242 accept_alternative ::=
45243 accept_statement [sequence_of_statements]
45244
45245 6
45246 delay_alternative ::=
45247 delay_statement [sequence_of_statements]
45248
45249 7
45250 terminate_alternative ::= terminate;
45251
45252 8
45253 A selective_accept shall contain at least one accept_alternative.
45254 In addition, it can contain:
45255
45256 9
45257 * a terminate_alternative (only one); or
45258
45259 10
45260 * one or more delay_alternatives; or
45261
45262 11
45263 * an else part (the reserved word else followed by a
45264 sequence_of_statements).
45265
45266 12
45267 These three possibilities are mutually exclusive.
45268
45269 _Legality Rules_
45270
45271 13
45272 If a selective_accept contains more than one delay_alternative, then all
45273 shall be delay_relative_statement (*note 9.6: S0229.)s, or all shall be
45274 delay_until_statement (*note 9.6: S0228.)s for the same time type.
45275
45276 13.a
45277 Reason: This simplifies the implementation and the description
45278 of the semantics.
45279
45280 _Dynamic Semantics_
45281
45282 14
45283 A select_alternative is said to be open if it is not immediately
45284 preceded by a guard, or if the condition of its guard evaluates to True.
45285 It is said to be closed otherwise.
45286
45287 15
45288 For the execution of a selective_accept, any guard conditions are
45289 evaluated; open alternatives are thus determined. For an open
45290 delay_alternative, the delay_expression is also evaluated. Similarly,
45291 for an open accept_alternative for an entry of a family, the entry_index
45292 is also evaluated. These evaluations are performed in an arbitrary
45293 order, except that a delay_expression or entry_index is not evaluated
45294 until after evaluating the corresponding condition, if any. Selection
45295 and execution of one open alternative, or of the else part, then
45296 completes the execution of the selective_accept; the rules for this
45297 selection are described below.
45298
45299 16
45300 Open accept_alternatives are first considered. Selection of one such
45301 alternative takes place immediately if the corresponding entry already
45302 has queued calls. If several alternatives can thus be selected, one of
45303 them is selected according to the entry queuing policy in effect (see
45304 *note 9.5.3:: and *note D.4::). When such an alternative is selected,
45305 the selected call is removed from its entry queue and the
45306 handled_sequence_of_statements (*note 11.2: S0265.) (if any) of the
45307 corresponding accept_statement is executed; after the rendezvous
45308 completes any subsequent sequence_of_statements (*note 5.1: S0145.) of
45309 the alternative is executed. If no selection is immediately possible
45310 (in the above sense) and there is no else part, the task blocks until an
45311 open alternative can be selected.
45312
45313 17
45314 Selection of the other forms of alternative or of an else part is
45315 performed as follows:
45316
45317 18
45318 * An open delay_alternative is selected when its expiration time is
45319 reached if no accept_alternative (*note 9.7.1: S0234.) or other
45320 delay_alternative (*note 9.7.1: S0235.) can be selected prior to
45321 the expiration time. If several delay_alternative (*note 9.7.1:
45322 S0235.)s have this same expiration time, one of them is selected
45323 according to the queuing policy in effect (see *note D.4::); the
45324 default queuing policy chooses arbitrarily among the
45325 delay_alternative (*note 9.7.1: S0235.)s whose expiration time has
45326 passed.
45327
45328 19
45329 * The else part is selected and its sequence_of_statements (*note
45330 5.1: S0145.) is executed if no accept_alternative can immediately
45331 be selected; in particular, if all alternatives are closed.
45332
45333 20/3
45334 * {AI05-0299-1AI05-0299-1} An open terminate_alternative is selected
45335 if the conditions stated at the end of subclause *note 9.3:: are
45336 satisfied.
45337
45338 20.a
45339 Ramification: In the absence of a requeue_statement, the
45340 conditions stated are such that a terminate_alternative cannot
45341 be selected while there is a queued entry call for any entry
45342 of the task. In the presence of requeues from a task to one
45343 of its subtasks, it is possible that when a
45344 terminate_alternative of the subtask is selected, requeued
45345 calls (for closed entries only) might still be queued on some
45346 entry of the subtask. Tasking_Error will be propagated to
45347 such callers, as is usual when a task completes while queued
45348 callers remain.
45349
45350 21
45351 The exception Program_Error is raised if all alternatives are closed and
45352 there is no else part.
45353
45354 NOTES
45355
45356 22
45357 40 A selective_accept is allowed to have several open
45358 delay_alternatives. A selective_accept is allowed to have several
45359 open accept_alternatives for the same entry.
45360
45361 _Examples_
45362
45363 23
45364 Example of a task body with a selective accept:
45365
45366 24
45367 task body Server is
45368 Current_Work_Item : Work_Item;
45369 begin
45370 loop
45371 select
45372 accept Next_Work_Item(WI : in Work_Item) do
45373 Current_Work_Item := WI;
45374 end;
45375 Process_Work_Item(Current_Work_Item);
45376 or
45377 accept Shut_Down;
45378 exit; -- Premature shut down requested
45379 or
45380 terminate; -- Normal shutdown at end of scope
45381 end select;
45382 end loop;
45383 end Server;
45384
45385 _Wording Changes from Ada 83_
45386
45387 24.a
45388 The name of selective_wait was changed to selective_accept to
45389 better describe what is being waited for. We kept
45390 select_alternative as is, because selective_accept_alternative
45391 was too easily confused with accept_alternative.
45392
45393 \1f
45394 File: aarm2012.info, Node: 9.7.2, Next: 9.7.3, Prev: 9.7.1, Up: 9.7
45395
45396 9.7.2 Timed Entry Calls
45397 -----------------------
45398
45399 1/2
45400 {AI95-00345-01AI95-00345-01} [A timed_entry_call issues an entry call
45401 that is cancelled if the call (or a requeue-with-abort of the call) is
45402 not selected before the expiration time is reached. A procedure call
45403 may appear rather than an entry call for cases where the procedure might
45404 be implemented by an entry. ]
45405
45406 _Syntax_
45407
45408 2
45409 timed_entry_call ::=
45410 select
45411 entry_call_alternative
45412 or
45413 delay_alternative
45414 end select;
45415
45416 3/2
45417 {AI95-00345-01AI95-00345-01} entry_call_alternative ::=
45418 procedure_or_entry_call [sequence_of_statements]
45419
45420 3.1/2
45421 {AI95-00345-01AI95-00345-01} procedure_or_entry_call ::=
45422 procedure_call_statement | entry_call_statement
45423
45424 _Legality Rules_
45425
45426 3.2/2
45427 {AI95-00345-01AI95-00345-01} If a procedure_call_statement is used for a
45428 procedure_or_entry_call, the procedure_name or procedure_prefix of the
45429 procedure_call_statement shall statically denote an entry renamed as a
45430 procedure or (a view of) a primitive subprogram of a limited interface
45431 whose first parameter is a controlling parameter (see *note 3.9.2::).
45432
45433 3.a/2
45434 Reason: This would be a confusing way to call a procedure, so
45435 we only allow it when it is possible that the procedure is
45436 actually an entry. We could have allowed formal subprograms
45437 here, but we didn't because we'd have to allow all formal
45438 subprograms, and it would increase the difficulty of generic
45439 code sharing.
45440
45441 3.b/2
45442 We say "statically denotes" because an access-to-subprogram
45443 cannot be primitive, and we don't have anything like
45444 access-to-entry. So only names of entries or procedures are
45445 possible.
45446
45447 _Dynamic Semantics_
45448
45449 4/2
45450 {AI95-00345-01AI95-00345-01} For the execution of a timed_entry_call,
45451 the entry_name, procedure_name, or procedure_prefix, and any actual
45452 parameters are evaluated, as for a simple entry call (see *note 9.5.3::)
45453 or procedure call (see *note 6.4::). The expiration time (see *note
45454 9.6::) for the call is determined by evaluating the delay_expression of
45455 the delay_alternative. If the call is an entry call or a call on a
45456 procedure implemented by an entry, the entry call is then issued.
45457 Otherwise, the call proceeds as described in *note 6.4:: for a procedure
45458 call, followed by the sequence_of_statements (*note 5.1: S0145.) of the
45459 entry_call_alternative (*note 9.7.2: S0238.); the sequence_of_statements
45460 (*note 5.1: S0145.) of the delay_alternative (*note 9.7.1: S0235.) is
45461 ignored.
45462
45463 5
45464 If the call is queued (including due to a requeue-with-abort), and not
45465 selected before the expiration time is reached, an attempt to cancel the
45466 call is made. If the call completes due to the cancellation, the
45467 optional sequence_of_statements (*note 5.1: S0145.) of the
45468 delay_alternative (*note 9.7.1: S0235.) is executed; if the entry call
45469 completes normally, the optional sequence_of_statements (*note 5.1:
45470 S0145.) of the entry_call_alternative (*note 9.7.2: S0238.) is executed.
45471
45472 5.a/2
45473 This paragraph was deleted.{AI95-00345-01AI95-00345-01}
45474
45475 _Examples_
45476
45477 6
45478 Example of a timed entry call:
45479
45480 7
45481 select
45482 Controller.Request(Medium)(Some_Item);
45483 or
45484 delay 45.0;
45485 -- controller too busy, try something else
45486 end select;
45487
45488 _Wording Changes from Ada 83_
45489
45490 7.a/3
45491 {AI05-0299-1AI05-0299-1} This subclause comes before the one
45492 for Conditional Entry Calls, so we can define conditional
45493 entry calls in terms of timed entry calls.
45494
45495 _Incompatibilities With Ada 95_
45496
45497 7.b/3
45498 {AI95-00345-01AI95-00345-01} {AI05-0005-1AI05-0005-1} A
45499 procedure call can be used as the entry_call_alternative in a
45500 timed or conditional entry call, if the procedure might
45501 actually be an entry. Since the fact that something is an
45502 entry could be used in resolving these calls in Ada 95, it is
45503 possible for timed or conditional entry calls that resolved in
45504 Ada 95 to be ambiguous in Ada 2005. That could happen if both
45505 an entry and procedure with the same name and profile exist,
45506 which should be rare.
45507
45508 \1f
45509 File: aarm2012.info, Node: 9.7.3, Next: 9.7.4, Prev: 9.7.2, Up: 9.7
45510
45511 9.7.3 Conditional Entry Calls
45512 -----------------------------
45513
45514 1/2
45515 {AI95-00345-01AI95-00345-01} [A conditional_entry_call issues an entry
45516 call that is then cancelled if it is not selected immediately (or if a
45517 requeue-with-abort of the call is not selected immediately). A
45518 procedure call may appear rather than an entry call for cases where the
45519 procedure might be implemented by an entry.]
45520
45521 1.a
45522 To be honest: In the case of an entry call on a protected
45523 object, it is OK if the entry is closed at the start of the
45524 corresponding protected action, so long as it opens and the
45525 call is selected before the end of that protected action (due
45526 to changes in the Count attribute).
45527
45528 _Syntax_
45529
45530 2
45531 conditional_entry_call ::=
45532 select
45533 entry_call_alternative
45534 else
45535 sequence_of_statements
45536 end select;
45537
45538 _Dynamic Semantics_
45539
45540 3
45541 The execution of a conditional_entry_call is defined to be equivalent to
45542 the execution of a timed_entry_call (*note 9.7.2: S0237.) with a
45543 delay_alternative (*note 9.7.1: S0235.) specifying an immediate
45544 expiration time and the same sequence_of_statements (*note 5.1: S0145.)
45545 as given after the reserved word else.
45546
45547 NOTES
45548
45549 4
45550 41 A conditional_entry_call may briefly increase the Count
45551 attribute of the entry, even if the conditional call is not
45552 selected.
45553
45554 _Examples_
45555
45556 5
45557 Example of a conditional entry call:
45558
45559 6
45560 procedure Spin(R : in Resource) is
45561 begin
45562 loop
45563 select
45564 R.Seize;
45565 return;
45566 else
45567 null; -- busy waiting
45568 end select;
45569 end loop;
45570 end;
45571
45572 _Wording Changes from Ada 83_
45573
45574 6.a/3
45575 {AI05-0299-1AI05-0299-1} This subclause comes after the one
45576 for Timed Entry Calls, so we can define conditional entry
45577 calls in terms of timed entry calls. We do that so that an
45578 "expiration time" is defined for both, thereby simplifying the
45579 definition of what happens on a requeue-with-abort.
45580
45581 \1f
45582 File: aarm2012.info, Node: 9.7.4, Prev: 9.7.3, Up: 9.7
45583
45584 9.7.4 Asynchronous Transfer of Control
45585 --------------------------------------
45586
45587 1
45588 [An asynchronous select_statement provides asynchronous transfer of
45589 control upon completion of an entry call or the expiration of a delay.]
45590
45591 _Syntax_
45592
45593 2
45594 asynchronous_select ::=
45595 select
45596 triggering_alternative
45597 then abort
45598 abortable_part
45599 end select;
45600
45601 3
45602 triggering_alternative ::= triggering_statement [
45603 sequence_of_statements]
45604
45605 4/2
45606 {AI95-00345-01AI95-00345-01} triggering_statement ::=
45607 procedure_or_entry_call | delay_statement
45608
45609 5
45610 abortable_part ::= sequence_of_statements
45611
45612 _Dynamic Semantics_
45613
45614 6/2
45615 {AI95-00345-01AI95-00345-01} For the execution of an asynchronous_select
45616 whose triggering_statement (*note 9.7.4: S0243.) is a
45617 procedure_or_entry_call, the entry_name, procedure_name, or
45618 procedure_prefix, and actual parameters are evaluated as for a simple
45619 entry call (see *note 9.5.3::) or procedure call (see *note 6.4::). If
45620 the call is an entry call or a call on a procedure implemented by an
45621 entry, the entry call is issued. If the entry call is queued (or
45622 requeued-with-abort), then the abortable_part is executed. [If the
45623 entry call is selected immediately, and never requeued-with-abort, then
45624 the abortable_part is never started.] If the call is on a procedure
45625 that is not implemented by an entry, the call proceeds as described in
45626 *note 6.4::, followed by the sequence_of_statements (*note 5.1: S0145.)
45627 of the triggering_alternative (*note 9.7.4: S0242.)[; the abortable_part
45628 is never started].
45629
45630 7
45631 For the execution of an asynchronous_select whose triggering_statement
45632 (*note 9.7.4: S0243.) is a delay_statement, the delay_expression is
45633 evaluated and the expiration time is determined, as for a normal
45634 delay_statement. If the expiration time has not already passed, the
45635 abortable_part is executed.
45636
45637 8
45638 If the abortable_part completes and is left prior to completion of the
45639 triggering_statement (*note 9.7.4: S0243.), an attempt to cancel the
45640 triggering_statement (*note 9.7.4: S0243.) is made. If the attempt to
45641 cancel succeeds (see *note 9.5.3:: and *note 9.6::), the
45642 asynchronous_select is complete.
45643
45644 9
45645 If the triggering_statement (*note 9.7.4: S0243.) completes other than
45646 due to cancellation, the abortable_part is aborted (if started but not
45647 yet completed -- see *note 9.8::). If the triggering_statement (*note
45648 9.7.4: S0243.) completes normally, the optional sequence_of_statements
45649 (*note 5.1: S0145.) of the triggering_alternative (*note 9.7.4: S0242.)
45650 is executed after the abortable_part is left.
45651
45652 9.a
45653 Discussion: We currently don't specify when the by-copy [in]
45654 out parameters are assigned back into the actuals. We
45655 considered requiring that to happen after the abortable_part
45656 is left. However, that doesn't seem useful enough to justify
45657 possibly overspecifying the implementation approach, since
45658 some of the parameters are passed by reference anyway.
45659
45660 9.b
45661 In an earlier description, we required that the
45662 sequence_of_statements (*note 5.1: S0145.) of the
45663 triggering_alternative (*note 9.7.4: S0242.) execute after
45664 aborting the abortable_part, but before waiting for it to
45665 complete and finalize, to provide more rapid response to the
45666 triggering event in case the finalization was unbounded.
45667 However, various reviewers felt that this created unnecessary
45668 complexity in the description, and a potential for undesirable
45669 concurrency (and nondeterminism) within a single task. We
45670 have now reverted to simpler, more deterministic semantics,
45671 but anticipate that further discussion of this issue might be
45672 appropriate during subsequent reviews. One possibility is to
45673 leave this area implementation defined, so as to encourage
45674 experimentation. The user would then have to assume the worst
45675 about what kinds of actions are appropriate for the
45676 sequence_of_statements (*note 5.1: S0145.) of the
45677 triggering_alternative (*note 9.7.4: S0242.) to achieve
45678 portability.
45679
45680 _Examples_
45681
45682 10
45683 Example of a main command loop for a command interpreter:
45684
45685 11
45686 loop
45687 select
45688 Terminal.Wait_For_Interrupt;
45689 Put_Line("Interrupted");
45690 then abort
45691 -- This will be abandoned upon terminal interrupt
45692 Put_Line("-> ");
45693 Get_Line(Command, Last);
45694 Process_Command(Command(1..Last));
45695 end select;
45696 end loop;
45697
45698 12
45699 Example of a time-limited calculation:
45700
45701 13
45702 select
45703 delay 5.0;
45704 Put_Line("Calculation does not converge");
45705 then abort
45706 -- This calculation should finish in 5.0 seconds;
45707 -- if not, it is assumed to diverge.
45708 Horribly_Complicated_Recursive_Function(X, Y);
45709 end select;
45710
45711 _Extensions to Ada 83_
45712
45713 13.a
45714 Asynchronous_select is new.
45715
45716 _Extensions to Ada 95_
45717
45718 13.b/2
45719 {AI95-00345-01AI95-00345-01} A procedure can be used as the
45720 triggering_statement (*note 9.7.4: S0243.) of an
45721 asynchronous_select, if the procedure might actually be an
45722 entry.
45723
45724 \1f
45725 File: aarm2012.info, Node: 9.8, Next: 9.9, Prev: 9.7, Up: 9
45726
45727 9.8 Abort of a Task - Abort of a Sequence of Statements
45728 =======================================================
45729
45730 1
45731 [An abort_statement causes one or more tasks to become abnormal, thus
45732 preventing any further interaction with such tasks. The completion of
45733 the triggering_statement (*note 9.7.4: S0243.) of an asynchronous_select
45734 causes a sequence_of_statements (*note 5.1: S0145.) to be aborted.]
45735
45736 _Syntax_
45737
45738 2
45739 abort_statement ::= abort task_name {, task_name};
45740
45741 _Name Resolution Rules_
45742
45743 3
45744 Each task_name is expected to be of any task type[; they need not all be
45745 of the same task type.]
45746
45747 _Dynamic Semantics_
45748
45749 4
45750 For the execution of an abort_statement, the given task_names are
45751 evaluated in an arbitrary order. Each named task is then aborted, which
45752 consists of making the task abnormal and aborting the execution of the
45753 corresponding task_body, unless it is already completed.
45754
45755 4.a/2
45756 Ramification: {AI95-00114-01AI95-00114-01} Note that aborting
45757 those tasks is not defined to be an abort-deferred operation.
45758 Therefore, if one of the named tasks is the task executing the
45759 abort_statement, or if the task executing the abort_statement
45760 depends on one of the named tasks, then it is possible for the
45761 execution of the abort_statement to be aborted, thus leaving
45762 some of the tasks unaborted. This allows the implementation
45763 to use either a sequence of calls to an "abort task" run-time
45764 system primitive, or a single call to an "abort list of tasks"
45765 run-time system primitive.
45766
45767 5
45768 When the execution of a construct is aborted (including that of a
45769 task_body (*note 9.1: S0209.) or of a sequence_of_statements (*note 5.1:
45770 S0145.)), the execution of every construct included within the aborted
45771 execution is also aborted, except for executions included within the
45772 execution of an abort-deferred operation; the execution of an
45773 abort-deferred operation continues to completion without being affected
45774 by the abort; the following are the abort-deferred operations:
45775
45776 6
45777 * a protected action;
45778
45779 7
45780 * waiting for an entry call to complete (after having initiated the
45781 attempt to cancel it -- see below);
45782
45783 8
45784 * waiting for the termination of dependent tasks;
45785
45786 9
45787 * the execution of an Initialize procedure as the last step of the
45788 default initialization of a controlled object;
45789
45790 10
45791 * the execution of a Finalize procedure as part of the finalization
45792 of a controlled object;
45793
45794 11
45795 * an assignment operation to an object with a controlled part.
45796
45797 12
45798 [The last three of these are discussed further in *note 7.6::.]
45799
45800 12.a
45801 Reason: Deferring abort during Initialize and finalization
45802 allows, for example, the result of an allocator performed in
45803 an Initialize operation to be assigned into an access object
45804 without being interrupted in the middle, which would cause
45805 storage leaks. For an object with several controlled parts,
45806 each individual Initialize is abort-deferred. Note that there
45807 is generally no semantic difference between making each
45808 Finalize abort-deferred, versus making a group of them
45809 abort-deferred, because if the task gets aborted, the first
45810 thing it will do is complete any remaining finalizations.
45811 Individual objects are finalized prior to an assignment
45812 operation (if nonlimited controlled) and as part of
45813 Unchecked_Deallocation.
45814
45815 12.b
45816 Ramification: Abort is deferred during the entire assignment
45817 operation to an object with a controlled part, even if only
45818 some subcomponents are controlled. Note that this says
45819 "assignment operation," not "assignment_statement." Explicit
45820 calls to Initialize, Finalize, or Adjust are not
45821 abort-deferred.
45822
45823 13
45824 When a master is aborted, all tasks that depend on that master are
45825 aborted.
45826
45827 14
45828 The order in which tasks become abnormal as the result of an
45829 abort_statement or the abort of a sequence_of_statements (*note 5.1:
45830 S0145.) is not specified by the language.
45831
45832 15
45833 If the execution of an entry call is aborted, an immediate attempt is
45834 made to cancel the entry call (see *note 9.5.3::). If the execution of
45835 a construct is aborted at a time when the execution is blocked, other
45836 than for an entry call, at a point that is outside the execution of an
45837 abort-deferred operation, then the execution of the construct completes
45838 immediately. For an abort due to an abort_statement, these immediate
45839 effects occur before the execution of the abort_statement completes.
45840 Other than for these immediate cases, the execution of a construct that
45841 is aborted does not necessarily complete before the abort_statement
45842 completes. However, the execution of the aborted construct completes no
45843 later than its next abort completion point (if any) that occurs outside
45844 of an abort-deferred operation; the following are abort completion
45845 points for an execution:
45846
45847 16
45848 * the point where the execution initiates the activation of another
45849 task;
45850
45851 17
45852 * the end of the activation of a task;
45853
45854 18
45855 * the start or end of the execution of an entry call,
45856 accept_statement, delay_statement, or abort_statement;
45857
45858 18.a
45859 Ramification: Although the abort completion point doesn't
45860 occur until the end of the entry call or delay_statement,
45861 these operations might be cut short because an abort attempts
45862 to cancel them.
45863
45864 19
45865 * the start of the execution of a select_statement, or of the
45866 sequence_of_statements (*note 5.1: S0145.) of an exception_handler.
45867
45868 19.a
45869 Reason: The start of an exception_handler is considered an
45870 abort completion point simply because it is easy for an
45871 implementation to check at such points.
45872
45873 19.b
45874 Implementation Note: Implementations may of course check for
45875 abort more often than at each abort completion point; ideally,
45876 a fully preemptive implementation of abort will be provided.
45877 If preemptive abort is not supported in a given environment,
45878 then supporting the checking for abort as part of subprogram
45879 calls and loop iterations might be a useful option.
45880
45881 _Bounded (Run-Time) Errors_
45882
45883 20/3
45884 {AI05-0264-1AI05-0264-1} An attempt to execute an asynchronous_select as
45885 part of the execution of an abort-deferred operation is a bounded error.
45886 Similarly, an attempt to create a task that depends on a master that is
45887 included entirely within the execution of an abort-deferred operation is
45888 a bounded error. In both cases, Program_Error is raised if the error is
45889 detected by the implementation; otherwise, the operations proceed as
45890 they would outside an abort-deferred operation, except that an abort of
45891 the abortable_part or the created task might or might not have an
45892 effect.
45893
45894 20.a
45895 Reason: An asynchronous_select relies on an abort of the
45896 abortable_part to effect the asynchronous transfer of control.
45897 For an asynchronous_select within an abort-deferred operation,
45898 the abort might have no effect.
45899
45900 20.b
45901 Creating a task dependent on a master included within an
45902 abort-deferred operation is considered an error, because such
45903 tasks could be aborted while the abort-deferred operation was
45904 still progressing, undermining the purpose of abort-deferral.
45905 Alternatively, we could say that such tasks are abort-deferred
45906 for their entire execution, but that seems too easy to abuse.
45907 Note that task creation is already a bounded error in
45908 protected actions, so this additional rule only applies to
45909 local task creation as part of Initialize, Finalize, or
45910 Adjust.
45911
45912 _Erroneous Execution_
45913
45914 21
45915 If an assignment operation completes prematurely due to an abort, the
45916 assignment is said to be disrupted; the target of the assignment or its
45917 parts can become abnormal, and certain subsequent uses of the object can
45918 be erroneous, as explained in *note 13.9.1::.
45919
45920 NOTES
45921
45922 22
45923 42 An abort_statement should be used only in situations requiring
45924 unconditional termination.
45925
45926 23
45927 43 A task is allowed to abort any task it can name, including
45928 itself.
45929
45930 24
45931 44 Additional requirements associated with abort are given in
45932 *note D.6::, "*note D.6:: Preemptive Abort".
45933
45934 _Wording Changes from Ada 83_
45935
45936 24.a/3
45937 {AI05-0299-1AI05-0299-1} This subclause has been rewritten to
45938 accommodate the concept of aborting the execution of a
45939 construct, rather than just of a task.
45940
45941 \1f
45942 File: aarm2012.info, Node: 9.9, Next: 9.10, Prev: 9.8, Up: 9
45943
45944 9.9 Task and Entry Attributes
45945 =============================
45946
45947 _Dynamic Semantics_
45948
45949 1
45950 For a prefix T that is of a task type [(after any implicit
45951 dereference)], the following attributes are defined:
45952
45953 2
45954 T'Callable
45955 Yields the value True when the task denoted by T is
45956 callable, and False otherwise; a task is callable unless
45957 it is completed or abnormal. The value of this attribute
45958 is of the predefined type Boolean.
45959
45960 3
45961 T'Terminated
45962 Yields the value True if the task denoted by T is
45963 terminated, and False otherwise. The value of this
45964 attribute is of the predefined type Boolean.
45965
45966 4
45967 For a prefix E that denotes an entry of a task or protected unit, the
45968 following attribute is defined. This attribute is only allowed within
45969 the body of the task or protected unit, but excluding, in the case of an
45970 entry of a task unit, within any program unit that is, itself, inner to
45971 the body of the task unit.
45972
45973 5
45974 E'Count
45975 Yields the number of calls presently queued on the entry
45976 E of the current instance of the unit. The value of this
45977 attribute is of the type universal_integer.
45978
45979 NOTES
45980
45981 6
45982 45 For the Count attribute, the entry can be either a single entry
45983 or an entry of a family. The name of the entry or entry family can
45984 be either a direct_name or an expanded name.
45985
45986 7
45987 46 Within task units, algorithms interrogating the attribute
45988 E'Count should take precautions to allow for the increase of the
45989 value of this attribute for incoming entry calls, and its decrease,
45990 for example with timed_entry_calls. Also, a conditional_entry_call
45991 may briefly increase this value, even if the conditional call is
45992 not accepted.
45993
45994 8
45995 47 Within protected units, algorithms interrogating the attribute
45996 E'Count in the entry_barrier for the entry E should take
45997 precautions to allow for the evaluation of the condition of the
45998 barrier both before and after queuing a given caller.
45999
46000 \1f
46001 File: aarm2012.info, Node: 9.10, Next: 9.11, Prev: 9.9, Up: 9
46002
46003 9.10 Shared Variables
46004 =====================
46005
46006 _Static Semantics_
46007
46008 1/3
46009 {AI05-0009-1AI05-0009-1} {AI05-0201-1AI05-0201-1}
46010 {AI05-0229-1AI05-0229-1} {AI05-0295-1AI05-0295-1} If two different
46011 objects, including nonoverlapping parts of the same object, are
46012 independently addressable, they can be manipulated concurrently by two
46013 different tasks without synchronization. Any two nonoverlapping objects
46014 are independently addressable if either object is specified as
46015 independently addressable (see *note C.6::). Otherwise, two
46016 nonoverlapping objects are independently addressable except when they
46017 are both parts of a composite object for which a nonconfirming value is
46018 specified for any of the following representation aspects: (record)
46019 Layout, Component_Size, Pack, Atomic, or Convention; in this case it is
46020 unspecified whether the parts are independently addressable.
46021
46022 1.a/3
46023 This paragraph was deleted.
46024
46025 1.b/3
46026 Implementation Note: {AI05-0229-1AI05-0229-1} Independent
46027 addressability is the only high level semantic effect of
46028 aspect Pack. If two objects are independently addressable,
46029 the implementation should allocate them in such a way that
46030 each can be written by the hardware without writing the other.
46031 For example, unless the user asks for it, it is generally not
46032 feasible to choose a bit-packed representation on a machine
46033 without an atomic bit field insertion instruction, because
46034 there might be tasks that update neighboring subcomponents
46035 concurrently, and locking operations on all subcomponents is
46036 generally not a good idea.
46037
46038 1.c/3
46039 {AI05-0229-1AI05-0229-1} Even if Pack or one of the other
46040 above-mentioned aspects is specified, subcomponents should
46041 still be updated independently if the hardware efficiently
46042 supports it.
46043
46044 1.d/3
46045 Ramification: {AI05-0009-1AI05-0009-1}
46046 {AI05-0201-1AI05-0201-1} An atomic object (including atomic
46047 components) is always independently addressable from any other
46048 nonoverlapping object. Any aspect_specification or
46049 representation item which would prevent this from being true
46050 should be rejected, notwithstanding what this Standard says
46051 elsewhere. Note, however, that the components of an atomic
46052 object are not necessarily atomic.
46053
46054 _Dynamic Semantics_
46055
46056 2
46057 [Separate tasks normally proceed independently and concurrently with one
46058 another. However, task interactions can be used to synchronize the
46059 actions of two or more tasks to allow, for example, meaningful
46060 communication by the direct updating and reading of variables shared
46061 between the tasks.] The actions of two different tasks are synchronized
46062 in this sense when an action of one task signals an action of the other
46063 task; an action A1 is defined to signal an action A2 under the following
46064 circumstances:
46065
46066 3
46067 * If A1 and A2 are part of the execution of the same task, and the
46068 language rules require A1 to be performed before A2;
46069
46070 4
46071 * If A1 is the action of an activator that initiates the activation
46072 of a task, and A2 is part of the execution of the task that is
46073 activated;
46074
46075 5
46076 * If A1 is part of the activation of a task, and A2 is the action of
46077 waiting for completion of the activation;
46078
46079 6
46080 * If A1 is part of the execution of a task, and A2 is the action of
46081 waiting for the termination of the task;
46082
46083 6.1/3
46084 * {8652/00318652/0031} {AI95-00118-01AI95-00118-01}
46085 {AI05-0072-1AI05-0072-1} If A1 is the termination of a task T, and
46086 A2 is either an evaluation of the expression T'Terminated that
46087 results in True, or a call to Ada.Task_Identification.Is_Terminated
46088 with an actual parameter that identifies T and a result of True
46089 (see *note C.7.1::);
46090
46091 7/3
46092 * {AI05-0262-1AI05-0262-1} If A1 is the action of issuing an entry
46093 call, and A2 is part of the corresponding execution of the
46094 appropriate entry_body or accept_statement;
46095
46096 7.a
46097 Ramification: Evaluating the entry_index of an
46098 accept_statement is not synchronized with a corresponding
46099 entry call, nor is evaluating the entry barrier of an
46100 entry_body.
46101
46102 8
46103 * If A1 is part of the execution of an accept_statement or
46104 entry_body, and A2 is the action of returning from the
46105 corresponding entry call;
46106
46107 9
46108 * If A1 is part of the execution of a protected procedure body or
46109 entry_body for a given protected object, and A2 is part of a later
46110 execution of an entry_body for the same protected object;
46111
46112 9.a
46113 Reason: The underlying principle here is that for one action
46114 to "signal" a second, the second action has to follow a
46115 potentially blocking operation, whose blocking is dependent on
46116 the first action in some way. Protected procedures are not
46117 potentially blocking, so they can only be "signalers," they
46118 cannot be signaled.
46119
46120 9.b
46121 Ramification: Protected subprogram calls are not defined to
46122 signal one another, which means that such calls alone cannot
46123 be used to synchronize access to shared data outside of a
46124 protected object.
46125
46126 9.c
46127 Reason: The point of this distinction is so that on
46128 multiprocessors with inconsistent caches, the caches only need
46129 to be refreshed at the beginning of an entry body, and forced
46130 out at the end of an entry body or protected procedure that
46131 leaves an entry open. Protected function calls, and protected
46132 subprogram calls for entryless protected objects do not
46133 require full cache consistency. Entryless protected objects
46134 are intended to be treated roughly like atomic objects -- each
46135 operation is indivisible with respect to other operations
46136 (unless both are reads), but such operations cannot be used to
46137 synchronize access to other nonvolatile shared variables.
46138
46139 10
46140 * If A1 signals some action that in turn signals A2.
46141
46142 _Erroneous Execution_
46143
46144 11
46145 Given an action of assigning to an object, and an action of reading or
46146 updating a part of the same object (or of a neighboring object if the
46147 two are not independently addressable), then the execution of the
46148 actions is erroneous unless the actions are sequential. Two actions are
46149 sequential if one of the following is true:
46150
46151 12
46152 * One action signals the other;
46153
46154 13
46155 * Both actions occur as part of the execution of the same task;
46156
46157 13.a
46158 Reason: Any two actions of the same task are sequential, even
46159 if one does not signal the other because they can be executed
46160 in an "arbitrary" (but necessarily equivalent to some
46161 "sequential") order.
46162
46163 14
46164 * Both actions occur as part of protected actions on the same
46165 protected object, and at most one of the actions is part of a call
46166 on a protected function of the protected object.
46167
46168 14.a
46169 Reason: Because actions within protected actions do not always
46170 imply signaling, we have to mention them here explicitly to
46171 make sure that actions occurring within different protected
46172 actions of the same protected object are sequential with
46173 respect to one another (unless both are part of calls on
46174 protected functions).
46175
46176 14.b
46177 Ramification: It doesn't matter whether or not the variable
46178 being assigned is actually a subcomponent of the protected
46179 object; globals can be safely updated from within the bodies
46180 of protected procedures or entries.
46181
46182 15/3
46183 {AI05-0229-1AI05-0229-1} Aspect Atomic or aspect Atomic_Components may
46184 also be specified to ensure that certain reads and updates are
46185 sequential -- see *note C.6::.
46186
46187 15.a
46188 Ramification: If two actions are "sequential" it is known that
46189 their executions don't overlap in time, but it is not
46190 necessarily specified which occurs first. For example, all
46191 actions of a single task are sequential, even though the exact
46192 order of execution is not fully specified for all constructs.
46193
46194 15.b
46195 Discussion: Note that if two assignments to the same variable
46196 are sequential, but neither signals the other, then the
46197 program is not erroneous, but it is not specified which
46198 assignment ultimately prevails. Such a situation usually
46199 corresponds to a programming mistake, but in some (rare)
46200 cases, the order makes no difference, and for this reason this
46201 situation is not considered erroneous nor even a bounded
46202 error. In Ada 83, this was considered an "incorrect order
46203 dependence" if the "effect" of the program was affected, but
46204 "effect" was never fully defined. In Ada 95, this situation
46205 represents a potential nonportability, and a friendly compiler
46206 might want to warn the programmer about the situation, but it
46207 is not considered an error. An example where this would come
46208 up would be in gathering statistics as part of referencing
46209 some information, where the assignments associated with
46210 statistics gathering don't need to be ordered since they are
46211 just accumulating aggregate counts, sums, products, etc.
46212
46213 _Wording Changes from Ada 95_
46214
46215 15.c/2
46216 {8652/00318652/0031} {AI95-00118-01AI95-00118-01} Corrigendum:
46217 Clarified that a task T2 can rely on values of variables that
46218 are updated by another task T1, if task T2 first verifies that
46219 T1'Terminated is True.
46220
46221 _Wording Changes from Ada 2005_
46222
46223 15.d/3
46224 {AI05-0009-1AI05-0009-1} {AI05-0201-1AI05-0201-1} Correction:
46225 Revised the definition of independent addressability to
46226 exclude conforming representation clauses and to require that
46227 atomic and independent objects always have independent
46228 addressability. This should not change behavior that the user
46229 sees for any Ada program, so it is not an inconsistency.
46230
46231 15.e/3
46232 {AI05-0072-1AI05-0072-1} Correction: Corrected the wording of
46233 AI95-00118-01 to actually say what was intended (as described
46234 above).
46235
46236 \1f
46237 File: aarm2012.info, Node: 9.11, Prev: 9.10, Up: 9
46238
46239 9.11 Example of Tasking and Synchronization
46240 ===========================================
46241
46242 _Examples_
46243
46244 1
46245 The following example defines a buffer protected object to smooth
46246 variations between the speed of output of a producing task and the speed
46247 of input of some consuming task. For instance, the producing task might
46248 have the following structure:
46249
46250 2
46251 task Producer;
46252
46253 3/2
46254 {AI95-00433-01AI95-00433-01} task body Producer is
46255 Person : Person_Name; -- see *note 3.10.1::
46256 begin
46257 loop
46258 ... -- simulate arrival of the next customer
46259 Buffer.Append_Wait(Person);
46260 exit when Person = null;
46261 end loop;
46262 end Producer;
46263
46264 4
46265 and the consuming task might have the following structure:
46266
46267 5
46268 task Consumer;
46269
46270 6/2
46271 {AI95-00433-01AI95-00433-01} task body Consumer is
46272 Person : Person_Name;
46273 begin
46274 loop
46275 Buffer.Remove_First_Wait(Person);
46276 exit when Person = null;
46277 ... -- simulate serving a customer
46278 end loop;
46279 end Consumer;
46280
46281 7/2
46282 {AI95-00433-01AI95-00433-01} The buffer object contains an internal
46283 array of person names managed in a round-robin fashion. The array has
46284 two indices, an In_Index denoting the index for the next input person
46285 name and an Out_Index denoting the index for the next output person
46286 name.
46287
46288 7.1/2
46289 {AI95-00433-01AI95-00433-01} The Buffer is defined as an extension of
46290 the Synchronized_Queue interface (see *note 3.9.4::), and as such
46291 promises to implement the abstraction defined by that interface. By
46292 doing so, the Buffer can be passed to the Transfer class-wide operation
46293 defined for objects of a type covered by Queue'Class.
46294
46295 8/2
46296 {AI95-00433-01AI95-00433-01} protected Buffer is new Synchronized_Queue with -- see *note 3.9.4::
46297 entry Append_Wait(Person : in Person_Name);
46298 entry Remove_First_Wait(Person : out Person_Name);
46299 function Cur_Count return Natural;
46300 function Max_Count return Natural;
46301 procedure Append(Person : in Person_Name);
46302 procedure Remove_First(Person : out Person_Name);
46303 private
46304 Pool : Person_Name_Array(1 .. 100);
46305 Count : Natural := 0;
46306 In_Index, Out_Index : Positive := 1;
46307 end Buffer;
46308
46309 9/2
46310 {AI95-00433-01AI95-00433-01} protected body Buffer is
46311 entry Append_Wait(Person : in Person_Name)
46312 when Count < Pool'Length is
46313 begin
46314 Append(Person);
46315 end Append_Wait;
46316
46317 9.1/2
46318 {AI95-00433-01AI95-00433-01} procedure Append(Person : in Person_Name) is
46319 begin
46320 if Count = Pool'Length then
46321 raise Queue_Error with "Buffer Full"; -- see *note 11.3::
46322 end if;
46323 Pool(In_Index) := Person;
46324 In_Index := (In_Index mod Pool'Length) + 1;
46325 Count := Count + 1;
46326 end Append;
46327
46328 10/2
46329 {AI95-00433-01AI95-00433-01} entry Remove_First_Wait(Person : out Person_Name)
46330 when Count > 0 is
46331 begin
46332 Remove_First(Person);
46333 end Remove_First_Wait;
46334
46335 11/2
46336 {AI95-00433-01AI95-00433-01} procedure Remove_First(Person : out Person_Name) is
46337 begin
46338 if Count = 0 then
46339 raise Queue_Error with "Buffer Empty"; -- see *note 11.3::
46340 end if;
46341 Person := Pool(Out_Index);
46342 Out_Index := (Out_Index mod Pool'Length) + 1;
46343 Count := Count - 1;
46344 end Remove_First;
46345
46346 12/2
46347 {AI95-00433-01AI95-00433-01} function Cur_Count return Natural is
46348 begin
46349 return Buffer.Count;
46350 end Cur_Count;
46351
46352 13/2
46353 {AI95-00433-01AI95-00433-01} function Max_Count return Natural is
46354 begin
46355 return Pool'Length;
46356 end Max_Count;
46357 end Buffer;
46358
46359 \1f
46360 File: aarm2012.info, Node: 10, Next: 11, Prev: 9, Up: Top
46361
46362 10 Program Structure and Compilation Issues
46363 *******************************************
46364
46365 1/3
46366 {AI05-0299-1AI05-0299-1} [The overall structure of programs and the
46367 facilities for separate compilation are described in this clause. A
46368 program is a set of partitions, each of which may execute in a separate
46369 address space, possibly on a separate computer.
46370
46371 1.a
46372 Glossary entry: A program is a set of partitions, each of
46373 which may execute in a separate address space, possibly on a
46374 separate computer. A partition consists of a set of library
46375 units.
46376
46377 1.b
46378 Glossary entry: A partition is a part of a program. Each
46379 partition consists of a set of library units. Each partition
46380 may run in a separate address space, possibly on a separate
46381 computer. A program may contain just one partition. A
46382 distributed program typically contains multiple partitions,
46383 which can execute concurrently.
46384
46385 2
46386 As explained below, a partition is constructed from library units.
46387 Syntactically, the declaration of a library unit is a library_item, as
46388 is the body of a library unit. An implementation may support a concept
46389 of a program library (or simply, a "library"), which contains
46390 library_items and their subunits. Library units may be organized into a
46391 hierarchy of children, grandchildren, and so on.]
46392
46393 3/3
46394 {AI05-0299-1AI05-0299-1} This clause has two subclauses: *note 10.1::,
46395 "*note 10.1:: Separate Compilation" discusses compile-time issues
46396 related to separate compilation. *note 10.2::, "*note 10.2:: Program
46397 Execution" discusses issues related to what is traditionally known as
46398 "link time" and "run time" -- building and executing partitions.
46399
46400 _Language Design Principles_
46401
46402 3.a
46403 We should avoid specifying details that are outside the domain
46404 of the language itself. The standard is intended (at least in
46405 part) to promote portability of Ada programs at the source
46406 level. It is not intended to standardize extra-language
46407 issues such as how one invokes the compiler (or other tools),
46408 how one's source is represented and organized, version
46409 management, the format of error messages, etc.
46410
46411 3.b
46412 The rules of the language should be enforced even in the
46413 presence of separate compilation. Using separate compilation
46414 should not make a program less safe.
46415
46416 3.c
46417 It should be possible to determine the legality of a
46418 compilation unit by looking only at the compilation unit
46419 itself and the compilation units upon which it depends
46420 semantically. As an example, it should be possible to analyze
46421 the legality of two compilation units in parallel if they do
46422 not depend semantically upon each other.
46423
46424 3.d
46425 On the other hand, it may be necessary to look outside that
46426 set in order to generate code -- this is generally true for
46427 generic instantiation and inlining, for example. Also on the
46428 other hand, it is generally necessary to look outside that set
46429 in order to check Post-Compilation Rules.
46430
46431 3.e
46432 See also the "generic contract model" Language Design
46433 Principle of *note 12.3::, "*note 12.3:: Generic
46434 Instantiation".
46435
46436 _Wording Changes from Ada 83_
46437
46438 3.f/3
46439 {AI05-0299-1AI05-0299-1} The clause organization mentioned
46440 above is different from that of RM83.
46441
46442 * Menu:
46443
46444 * 10.1 :: Separate Compilation
46445 * 10.2 :: Program Execution
46446
46447 \1f
46448 File: aarm2012.info, Node: 10.1, Next: 10.2, Up: 10
46449
46450 10.1 Separate Compilation
46451 =========================
46452
46453 1
46454 [ A program unit is either a package, a task unit, a protected unit, a
46455 protected entry, a generic unit, or an explicitly declared subprogram
46456 other than an enumeration literal. Certain kinds of program units can
46457 be separately compiled. Alternatively, they can appear physically
46458 nested within other program units.
46459
46460 2
46461 The text of a program can be submitted to the compiler in one or more
46462 compilations. Each compilation is a succession of compilation_units. A
46463 compilation_unit contains either the declaration, the body, or a
46464 renaming of a program unit.] The representation for a compilation is
46465 implementation-defined.
46466
46467 2.a
46468 Implementation defined: The representation for a compilation.
46469
46470 2.b
46471 Ramification: Some implementations might choose to make a
46472 compilation be a source (text) file. Others might allow
46473 multiple source files to be automatically concatenated to form
46474 a single compilation. Others still may represent the source
46475 in a nontextual form such as a parse tree. Note that the RM95
46476 does not even define the concept of a source file.
46477
46478 2.c
46479 Note that a protected subprogram is a subprogram, and
46480 therefore a program unit. An instance of a generic unit is a
46481 program unit.
46482
46483 2.d
46484 A protected entry is a program unit, but protected entries
46485 cannot be separately compiled.
46486
46487 3
46488 A library unit is a separately compiled program unit, and is always a
46489 package, subprogram, or generic unit. Library units may have other
46490 (logically nested) library units as children, and may have other program
46491 units physically nested within them. A root library unit, together with
46492 its children and grandchildren and so on, form a subsystem.
46493
46494 _Implementation Permissions_
46495
46496 4
46497 An implementation may impose implementation-defined restrictions on
46498 compilations that contain multiple compilation_units.
46499
46500 4.a
46501 Implementation defined: Any restrictions on compilations that
46502 contain multiple compilation_units.
46503
46504 4.b
46505 Discussion: For example, an implementation might disallow a
46506 compilation that contains two versions of the same compilation
46507 unit, or that contains the declarations for library packages
46508 P1 and P2, where P1 precedes P2 in the compilation but P1 has
46509 a with_clause that mentions P2.
46510
46511 _Wording Changes from Ada 83_
46512
46513 4.c
46514 The interactions between language issues and environmental
46515 issues are left open in Ada 95. The environment concept is
46516 new. In Ada 83, the concept of the program library, for
46517 example, appeared to be quite concrete, although the rules had
46518 no force, since implementations could get around them simply
46519 by defining various mappings from the concept of an Ada
46520 program library to whatever data structures were actually
46521 stored in support of separate compilation. Indeed,
46522 implementations were encouraged to do so.
46523
46524 4.d
46525 In RM83, it was unclear which was the official definition of
46526 "program unit." Definitions appeared in RM83-5, 6, 7, and 9,
46527 but not 12. Placing it here seems logical, since a program
46528 unit is sort of a potential compilation unit.
46529
46530 * Menu:
46531
46532 * 10.1.1 :: Compilation Units - Library Units
46533 * 10.1.2 :: Context Clauses - With Clauses
46534 * 10.1.3 :: Subunits of Compilation Units
46535 * 10.1.4 :: The Compilation Process
46536 * 10.1.5 :: Pragmas and Program Units
46537 * 10.1.6 :: Environment-Level Visibility Rules
46538
46539 \1f
46540 File: aarm2012.info, Node: 10.1.1, Next: 10.1.2, Up: 10.1
46541
46542 10.1.1 Compilation Units - Library Units
46543 ----------------------------------------
46544
46545 1
46546 [A library_item is a compilation unit that is the declaration, body, or
46547 renaming of a library unit. Each library unit (except Standard) has a
46548 parent unit, which is a library package or generic library package.] A
46549 library unit is a child of its parent unit. The root library units are
46550 the children of the predefined library package Standard.
46551
46552 1.a
46553 Ramification: Standard is a library unit.
46554
46555 _Syntax_
46556
46557 2
46558 compilation ::= {compilation_unit}
46559
46560 3
46561 compilation_unit ::=
46562 context_clause library_item
46563 | context_clause subunit
46564
46565 4
46566 library_item ::= [private] library_unit_declaration
46567 | library_unit_body
46568 | [private] library_unit_renaming_declaration
46569
46570 5
46571 library_unit_declaration ::=
46572 subprogram_declaration | package_declaration
46573 | generic_declaration | generic_instantiation
46574
46575 6
46576 library_unit_renaming_declaration ::=
46577 package_renaming_declaration
46578 | generic_renaming_declaration
46579 | subprogram_renaming_declaration
46580
46581 7
46582 library_unit_body ::= subprogram_body | package_body
46583
46584 8
46585 parent_unit_name ::= name
46586
46587 8.1/2
46588 {AI95-00397-01AI95-00397-01} An overriding_indicator is not allowed
46589 in a subprogram_declaration, generic_instantiation, or
46590 subprogram_renaming_declaration that declares a library unit.
46591
46592 8.a.1/2
46593 Reason: All of the listed items syntactically include
46594 overriding_indicator, but a library unit can never override
46595 anything. A majority of the ARG thought that allowing not
46596 overriding in that case would be confusing instead of helpful.
46597
46598 9
46599 A library unit is a program unit that is declared by a library_item.
46600 When a program unit is a library unit, the prefix "library" is used to
46601 refer to it (or "generic library" if generic), as well as to its
46602 declaration and body, as in "library procedure", "library package_body",
46603 or "generic library package". The term compilation unit is used to
46604 refer to a compilation_unit. When the meaning is clear from context,
46605 the term is also used to refer to the library_item of a compilation_unit
46606 or to the proper_body of a subunit [(that is, the compilation_unit
46607 without the context_clause and the separate (parent_unit_name))].
46608
46609 9.a
46610 Discussion: In this example:
46611
46612 9.b
46613 with Ada.Text_IO;
46614 package P is
46615 ...
46616 end P;
46617
46618 9.c
46619 the term "compilation unit" can refer to this text: "with
46620 Ada.Text_IO; package P is ... end P;" or to this text:
46621 "package P is ... end P;". We use this shorthand because it
46622 corresponds to common usage.
46623
46624 9.d
46625 We like to use the word "unit" for declaration-plus-body
46626 things, and "item" for declaration or body separately (as in
46627 declarative_item). The terms "compilation_unit," "compilation
46628 unit," and "subunit" are exceptions to this rule. We
46629 considered changing "compilation_unit," "compilation unit" to
46630 "compilation_item," "compilation item," respectively, but we
46631 decided not to.
46632
46633 10
46634 The parent declaration of a library_item (and of the library unit) is
46635 the declaration denoted by the parent_unit_name (*note 10.1.1: S0252.),
46636 if any, of the defining_program_unit_name (*note 6.1: S0169.) of the
46637 library_item. If there is no parent_unit_name (*note 10.1.1: S0252.),
46638 the parent declaration is the declaration of Standard, the library_item
46639 is a root library_item, and the library unit (renaming) is a root
46640 library unit (renaming). The declaration and body of Standard itself
46641 have no parent declaration. The parent unit of a library_item or
46642 library unit is the library unit declared by its parent declaration.
46643
46644 10.a
46645 Discussion: The declaration and body of Standard are presumed
46646 to exist from the beginning of time, as it were. There is no
46647 way to actually write them, since there is no syntactic way to
46648 indicate lack of a parent. An attempt to compile a package
46649 Standard would result in Standard.Standard.
46650
46651 10.b
46652 Reason: Library units (other than Standard) have "parent
46653 declarations" and "parent units". Subunits have "parent
46654 bodies". We didn't bother to define the other possibilities:
46655 parent body of a library unit, parent declaration of a
46656 subunit, parent unit of a subunit. These are not needed, and
46657 might get in the way of a correct definition of "child."
46658
46659 11
46660 [The children of a library unit occur immediately within the declarative
46661 region of the declaration of the library unit.] The ancestors of a
46662 library unit are itself, its parent, its parent's parent, and so on.
46663 [(Standard is an ancestor of every library unit.)] The descendant
46664 relation is the inverse of the ancestor relation.
46665
46666 11.a
46667 Reason: These definitions are worded carefully to avoid
46668 defining subunits as children. Only library units can be
46669 children.
46670
46671 11.b
46672 We use the unadorned term "ancestors" here to concisely define
46673 both "ancestor unit" and "ancestor declaration."
46674
46675 12
46676 A library_unit_declaration or a library_unit_renaming_declaration (*note
46677 10.1.1: S0250.) is private if the declaration is immediately preceded by
46678 the reserved word private; it is otherwise public. A library unit is
46679 private or public according to its declaration. The public descendants
46680 of a library unit are the library unit itself, and the public
46681 descendants of its public children. Its other descendants are private
46682 descendants.
46683
46684 12.a
46685 Discussion: The first concept defined here is that a
46686 library_item is either public or private (not in relation to
46687 anything else -- it's just a property of the library unit).
46688 The second concept is that a library_item is a public
46689 descendant or private descendant of a given ancestor. A given
46690 library_item can be a public descendant of one of its
46691 ancestors, but a private descendant of some other ancestor.
46692
46693 12.b
46694 A subprogram declared by a subprogram_body (as opposed to a
46695 subprogram_declaration) is always public, since the syntax
46696 rules disallow the reserved word private on a body.
46697
46698 12.c
46699 Note that a private library unit is a public descendant of
46700 itself, but a private descendant of its parent. This is
46701 because it is visible outside itself -- its privateness means
46702 that it is not visible outside its parent.
46703
46704 12.d
46705 Private children of Standard are legal, and follow the normal
46706 rules. It is intended that implementations might have some
46707 method for taking an existing environment, and treating it as
46708 a package to be "imported" into another environment, treating
46709 children of Standard in the imported environment as children
46710 of the imported package.
46711
46712 12.e
46713 Ramification: Suppose we have a public library unit A, a
46714 private library unit A.B, and a public library unit A.B.C.
46715 A.B.C is a public descendant of itself and of A.B, but a
46716 private descendant of A; since A.B is private to A, we don't
46717 allow A.B.C to escape outside A either. This is similar to
46718 the situation that would occur with physical nesting, like
46719 this:
46720
46721 12.f
46722 package A is
46723 private
46724 package B is
46725 package C is
46726 end C;
46727 private
46728 end B;
46729 end A;
46730
46731 12.g
46732 Here, A.B.C is visible outside itself and outside A.B, but not
46733 outside A. (Note that this example is intended to illustrate
46734 the visibility of program units from the outside; the
46735 visibility within child units is not quite identical to that
46736 of physically nested units, since child units are nested after
46737 their parent's declaration.)
46738
46739 12.1/2
46740 {AI95-00217-06AI95-00217-06} For each library package_declaration in the
46741 environment, there is an implicit declaration of a limited view of that
46742 library package. The limited view of a package contains:
46743
46744 12.2/3
46745 * {AI95-00217-06AI95-00217-06} {AI05-0129-1AI05-0129-1}
46746 {AI05-0262-1AI05-0262-1} For each package_declaration occurring
46747 immediately within the visible part, a declaration of the limited
46748 view of that package, with the same defining_program_unit_name.
46749
46750 12.3/3
46751 * {AI95-00217-06AI95-00217-06} {AI95-00326-01AI95-00326-01}
46752 {AI05-0108-1AI05-0108-1} {AI05-0129-1AI05-0129-1}
46753 {AI05-0262-1AI05-0262-1} For each type_declaration occurring
46754 immediately within the visible part that is not an
46755 incomplete_type_declaration, an incomplete view of the type with no
46756 discriminant_part; if the type_declaration is tagged, then the view
46757 is a tagged incomplete view.
46758
46759 12.g.1/3
46760 Reason: {AI05-0108-1AI05-0108-1} The incomplete view of a type
46761 does not have a discriminant_part even if the type_declaration
46762 does have one. This is necessary because semantic analysis
46763 (and the associated dependence on with_clauses) would be
46764 necessary to determine the types of the discriminants.
46765
46766 12.g.2/3
46767 {AI05-0129-1AI05-0129-1} No incomplete views of incomplete
46768 types are included in the limited view. The rules of *note
46769 3.10.1:: ensure that the completion of any visible incomplete
46770 type is declared in the same visible part, so such an
46771 incomplete view would simply be redundant.
46772
46773 12.g.3/2
46774 Discussion: {AI95-00217-06AI95-00217-06} The implementation
46775 model of a limited view is that it can be determined solely
46776 from the syntax of the source of the unit, without any
46777 semantic analysis. That allows it to be created without the
46778 semantic dependences of a full unit, which is necessary for it
46779 to break mutual dependences of units.
46780
46781 12.g.4/2
46782 Ramification: The limited view does not include package
46783 instances and their contents. Semantic analysis of a unit
46784 (and dependence on its with_clauses) would be needed to
46785 determine the contents of an instance.
46786
46787 12.4/2
46788 The limited view of a library package_declaration is private if that
46789 library package_declaration is immediately preceded by the reserved word
46790 private.
46791
46792 12.5/2
46793 [There is no syntax for declaring limited views of packages, because
46794 they are always implicit.] The implicit declaration of a limited view
46795 of a library package [is not the declaration of a library unit (the
46796 library package_declaration is); nonetheless, it] is a library_item.
46797 The implicit declaration of the limited view of a library package forms
46798 an (implicit) compilation unit whose context_clause is empty.
46799
46800 12.6/2
46801 A library package_declaration is the completion of the declaration of
46802 its limited view.
46803
46804 12.h/2
46805 To be honest: This is notwithstanding the rule in *note
46806 3.11.1:: that says that implicit declarations don't have
46807 completions.
46808
46809 12.i/2
46810 Reason: This rule explains where to find the completions of
46811 the incomplete views defined by the limited view.
46812
46813 _Legality Rules_
46814
46815 13
46816 The parent unit of a library_item shall be a [library] package or
46817 generic [library] package.
46818
46819 14
46820 If a defining_program_unit_name of a given declaration or body has a
46821 parent_unit_name, then the given declaration or body shall be a
46822 library_item. The body of a program unit shall be a library_item if and
46823 only if the declaration of the program unit is a library_item. In a
46824 library_unit_renaming_declaration (*note 10.1.1: S0250.), the [(old)]
46825 name shall denote a library_item.
46826
46827 14.a
46828 Discussion: We could have allowed nested program units to be
46829 children of other program units; their semantics would make
46830 sense. We disallow them to keep things simpler and because
46831 they wouldn't be particularly useful.
46832
46833 15/2
46834 {AI95-00217-06AI95-00217-06} A parent_unit_name [(which can be used
46835 within a defining_program_unit_name of a library_item and in the
46836 separate clause of a subunit)], and each of its prefixes, shall not
46837 denote a renaming_declaration. [On the other hand, a name that denotes
46838 a library_unit_renaming_declaration (*note 10.1.1: S0250.) is allowed in
46839 a nonlimited_with_clause and other places where the name of a library
46840 unit is allowed.]
46841
46842 16
46843 If a library package is an instance of a generic package, then every
46844 child of the library package shall either be itself an instance or be a
46845 renaming of a library unit.
46846
46847 16.a
46848 Discussion: A child of an instance of a given generic unit
46849 will often be an instance of a (generic) child of the given
46850 generic unit. This is not required, however.
46851
46852 16.b
46853 Reason: Instances are forbidden from having noninstance
46854 children for two reasons:
46855
46856 16.c
46857 1. We want all source code that can depend on
46858 information from the private part of a library unit to be
46859 inside the "subsystem" rooted at the library unit. If an
46860 instance of a generic unit were allowed to have a
46861 noninstance as a child, the source code of that child
46862 might depend on information from the private part of the
46863 generic unit, even though it is outside the subsystem
46864 rooted at the generic unit.
46865
46866 16.d
46867 2. Disallowing noninstance children simplifies the
46868 description of the semantics of children of generic
46869 packages.
46870
46871 17/3
46872 {AI05-0004-1AI05-0004-1} A child of a generic library package shall
46873 either be itself a generic unit or be a renaming of some other child of
46874 the same generic unit.
46875
46876 18
46877 A child of a parent generic package shall be instantiated or renamed
46878 only within the declarative region of the parent generic.
46879
46880 19/2
46881 {AI95-00331-01AI95-00331-01} For each child C of some parent generic
46882 package P, there is a corresponding declaration C nested immediately
46883 within each instance of P. For the purposes of this rule, if a child C
46884 itself has a child D, each corresponding declaration for C has a
46885 corresponding child D. [The corresponding declaration for a child within
46886 an instance is visible only within the scope of a with_clause that
46887 mentions the (original) child generic unit.]
46888
46889 19.a
46890 Implementation Note: Within the child, like anything nested in
46891 a generic unit, one can make up-level references to the
46892 current instance of its parent, and thereby gain access to the
46893 formal parameters of the parent, to the types declared in the
46894 parent, etc. This "nesting" model applies even within the
46895 generic_formal_part of the child, as it does for a generic
46896 child of a nongeneric unit.
46897
46898 19.b
46899 Ramification: Suppose P is a generic library package, and P.C
46900 is a generic child of P. P.C can be instantiated inside the
46901 declarative region of P. Outside P, P.C can be mentioned only
46902 in a with_clause. Conceptually, an instance I of P is a
46903 package that has a nested generic unit called I.C. Mentioning
46904 P.C in a with_clause allows I.C to be instantiated. I need
46905 not be a library unit, and the instantiation of I.C need not
46906 be a library unit. If I is a library unit, and an instance of
46907 I.C is a child of I, then this instance has to be called
46908 something other than C.
46909
46910 20
46911 A library subprogram shall not override a primitive subprogram.
46912
46913 20.a
46914 Reason: This prevents certain obscure anomalies. For example,
46915 if a library subprogram were to override a subprogram declared
46916 in its parent package, then in a compilation unit that depends
46917 indirectly on the library subprogram, the library subprogram
46918 could hide the overridden operation from all visibility, but
46919 the library subprogram itself would not be visible.
46920
46921 20.b
46922 Note that even without this rule, such subprograms would be
46923 illegal for tagged types, because of the freezing rules.
46924
46925 21
46926 The defining name of a function that is a compilation unit shall not be
46927 an operator_symbol.
46928
46929 21.a
46930 Reason: Since overloading is not permitted among compilation
46931 units, it seems unlikely that it would be useful to define one
46932 as an operator. Note that a subunit could be renamed within
46933 its parent to be an operator.
46934
46935 _Static Semantics_
46936
46937 22
46938 A subprogram_renaming_declaration that is a
46939 library_unit_renaming_declaration (*note 10.1.1: S0250.) is a
46940 renaming-as-declaration, not a renaming-as-body.
46941
46942 23
46943 [There are two kinds of dependences among compilation units:]
46944
46945 24
46946 * [The semantic dependences (see below) are the ones needed to check
46947 the compile-time rules across compilation unit boundaries; a
46948 compilation unit depends semantically on the other compilation
46949 units needed to determine its legality. The visibility rules are
46950 based on the semantic dependences.
46951
46952 25
46953 * The elaboration dependences (see *note 10.2::) determine the order
46954 of elaboration of library_items.]
46955
46956 25.a
46957 Discussion: Don't confuse these kinds of dependences with the
46958 run-time dependences among tasks and masters defined in *note
46959 9.3::, "*note 9.3:: Task Dependence - Termination of Tasks".
46960
46961 26/2
46962 {AI95-00217-06AI95-00217-06} A library_item depends semantically upon
46963 its parent declaration. A subunit depends semantically upon its parent
46964 body. A library_unit_body depends semantically upon the corresponding
46965 library_unit_declaration, if any. The declaration of the limited view
46966 of a library package depends semantically upon the declaration of the
46967 limited view of its parent. The declaration of a library package
46968 depends semantically upon the declaration of its limited view. A
46969 compilation unit depends semantically upon each library_item mentioned
46970 in a with_clause of the compilation unit. In addition, if a given
46971 compilation unit contains an attribute_reference of a type defined in
46972 another compilation unit, then the given compilation unit depends
46973 semantically upon the other compilation unit. The semantic dependence
46974 relationship is transitive.
46975
46976 26.a
46977 Discussion: The "if any" in the third sentence is necessary
46978 because library subprograms are not required to have a
46979 subprogram_declaration.
46980
46981 26.b
46982 To be honest: If a given compilation unit contains a
46983 choice_parameter_specification, then the given compilation
46984 unit depends semantically upon the declaration of
46985 Ada.Exceptions.
46986
46987 26.c
46988 If a given compilation unit contains a pragma with an argument
46989 of a type defined in another compilation unit, then the given
46990 compilation unit depends semantically upon the other
46991 compilation unit.
46992
46993 26.d
46994 Discussion: For example, a compilation unit containing
46995 X'Address depends semantically upon the declaration of package
46996 System.
46997
46998 26.e
46999 For the Address attribute, this fixes a hole in Ada 83. Note
47000 that in almost all cases, the dependence will need to exist
47001 due to with_clauses, even without this rule. Hence, the rule
47002 has very little effect on programmers.
47003
47004 26.f
47005 Note that the semantic dependence does not have the same
47006 effect as a with_clause; in order to denote a declaration in
47007 one of those packages, a with_clause will generally be needed.
47008
47009 26.g
47010 Note that no special rule is needed for an
47011 attribute_definition_clause, since an expression after use
47012 will require semantic dependence upon the compilation unit
47013 containing the type_declaration of interest.
47014
47015 26.h/2
47016 {AI95-00217-06AI95-00217-06} Unlike a full view of a package,
47017 a limited view does not depend semantically on units mentioned
47018 in with_clauses of the compilation_unit that defines the
47019 package. Formally, this is achieved by saying that the
47020 limited view has an empty context_clause. This is necessary
47021 so that they can be useful for their intended purpose:
47022 allowing mutual dependences between packages. The lack of
47023 semantic dependence limits the contents of a limited view to
47024 the items that can be determined solely from the syntax of the
47025 source of the package, without any semantic analysis. That
47026 allows it to be created without the semantic dependences of a
47027 full package.
47028
47029 _Dynamic Semantics_
47030
47031 26.1/2
47032 {AI95-00217-06AI95-00217-06} The elaboration of the declaration of the
47033 limited view of a package has no effect.
47034
47035 NOTES
47036
47037 27
47038 1 A simple program may consist of a single compilation unit. A
47039 compilation need not have any compilation units; for example, its
47040 text can consist of pragmas.
47041
47042 27.a
47043 Ramification: Such pragmas cannot have any arguments that are
47044 names, by a previous rule of this subclause. A compilation
47045 can even be entirely empty, which is probably not useful.
47046
47047 27.b
47048 Some interesting properties of the three kinds of dependence:
47049 The elaboration dependences also include the semantic
47050 dependences, except that subunits are taken together with
47051 their parents. The semantic dependences partly determine the
47052 order in which the compilation units appear in the environment
47053 at compile time. At run time, the order is partly determined
47054 by the elaboration dependences.
47055
47056 27.c
47057 The model whereby a child is inside its parent's declarative
47058 region, after the parent's declaration, as explained in *note
47059 8.1::, has the following ramifications:
47060
47061 27.d
47062 * The restrictions on "early" use of a private type
47063 (RM83-7.4.1(4)) or a deferred constant (RM83-7.4.3(2)) do
47064 not apply to uses in child units, because they follow the
47065 full declaration.
47066
47067 27.e
47068 * A library subprogram is never primitive, even if its
47069 profile includes a type declared immediately within the
47070 parent's package_specification, because the child is not
47071 declared immediately within the same
47072 package_specification as the type (so it doesn't declare
47073 a new primitive subprogram), and because the child is
47074 forbidden from overriding an old primitive subprogram.
47075 It is immediately within the same declarative region, but
47076 not the same package_specification. Thus, for a tagged
47077 type, it is not possible to call a child subprogram in a
47078 dispatching manner. (This is also forbidden by the
47079 freezing rules.) Similarly, it is not possible for the
47080 user to declare primitive subprograms of the types
47081 declared in the declaration of Standard, such as Integer
47082 (even if the rules were changed to allow a library unit
47083 whose name is an operator symbol).
47084
47085 27.f
47086 * When the parent unit is "used" the simple names of the
47087 with'd child units are directly visible (see *note 8.4::,
47088 "*note 8.4:: Use Clauses").
47089
47090 27.g
47091 * When a parent body with's its own child, the defining
47092 name of the child is directly visible, and the parent
47093 body is not allowed to include a declaration of a
47094 homograph of the child unit immediately within the
47095 declarative_part of the body (RM83-8.3(17)).
47096
47097 27.h
47098 Note that "declaration of a library unit" is different from
47099 "library_unit_declaration" -- the former includes
47100 subprogram_body. Also, we sometimes really mean "declaration
47101 of a view of a library unit", which includes
47102 library_unit_renaming_declaration (*note 10.1.1: S0250.)s.
47103
47104 27.i
47105 The visibility rules generally imply that the renamed view of
47106 a library_unit_renaming_declaration (*note 10.1.1: S0250.) has
47107 to be mentioned in a with_clause (*note 10.1.2: S0255.) of the
47108 library_unit_renaming_declaration (*note 10.1.1: S0250.).
47109
47110 27.j
47111 To be honest: The real rule is that the renamed library unit
47112 has to be visible in the library_unit_renaming_declaration
47113 (*note 10.1.1: S0250.).
47114
47115 27.k
47116 Reason: In most cases, "has to be visible" means there has to
47117 be a with_clause. However, it is possible in obscure cases to
47118 avoid the need for a with_clause; in particular, a compilation
47119 unit such as "package P.Q renames P;" is legal with no
47120 with_clauses (though not particularly interesting). ASCII is
47121 physically nested in Standard, and so is not a library unit,
47122 and cannot be renamed as a library unit.
47123
47124 28
47125 2 The designator of a library function cannot be an
47126 operator_symbol, but a nonlibrary renaming_declaration is allowed
47127 to rename a library function as an operator. Within a partition,
47128 two library subprograms are required to have distinct names and
47129 hence cannot overload each other. However, renaming_declarations
47130 are allowed to define overloaded names for such subprograms, and a
47131 locally declared subprogram is allowed to overload a library
47132 subprogram. The expanded name Standard.L can be used to denote a
47133 root library unit L (unless the declaration of Standard is hidden)
47134 since root library unit declarations occur immediately within the
47135 declarative region of package Standard.
47136
47137 _Examples_
47138
47139 29
47140 Examples of library units:
47141
47142 30
47143 package Rational_Numbers.IO is -- public child of Rational_Numbers, see *note 7.1::
47144 procedure Put(R : in Rational);
47145 procedure Get(R : out Rational);
47146 end Rational_Numbers.IO;
47147
47148 31
47149 private procedure Rational_Numbers.Reduce(R : in out Rational);
47150 -- private child of Rational_Numbers
47151
47152 32
47153 with Rational_Numbers.Reduce; -- refer to a private child
47154 package body Rational_Numbers is
47155 ...
47156 end Rational_Numbers;
47157
47158 33
47159 with Rational_Numbers.IO; use Rational_Numbers;
47160 with Ada.Text_io; -- see *note A.10::
47161 procedure Main is -- a root library procedure
47162 R : Rational;
47163 begin
47164 R := 5/3; -- construct a rational number, see *note 7.1::
47165 Ada.Text_IO.Put("The answer is: ");
47166 IO.Put(R);
47167 Ada.Text_IO.New_Line;
47168 end Main;
47169
47170 34
47171 with Rational_Numbers.IO;
47172 package Rational_IO renames Rational_Numbers.IO;
47173 -- a library unit renaming declaration
47174
47175 35
47176 Each of the above library_items can be submitted to the compiler
47177 separately.
47178
47179 35.a
47180 Discussion: Example of a generic package with children:
47181
47182 35.b
47183 generic
47184 type Element is private;
47185 with function Image(E : Element) return String;
47186 package Generic_Bags is
47187 type Bag is limited private; -- A bag of Elements.
47188 procedure Add(B : in out Bag; E : Element);
47189 function Bag_Image(B : Bag) return String;
47190 private
47191 type Bag is ...;
47192 end Generic_Bags;
47193
47194 35.c
47195 generic
47196 package Generic_Bags.Generic_Iterators is
47197 ... -- various additional operations on Bags.
47198
47199 35.d
47200 generic
47201 with procedure Use_Element(E : in Element);
47202 -- Called once per bag element.
47203 procedure Iterate(B : in Bag);
47204 end Generic_Bags.Generic_Iterators;
47205
47206 35.e
47207 A package that instantiates the above generic units:
47208
47209 35.f
47210 with Generic_Bags;
47211 with Generic_Bags.Generic_Iterators;
47212 package My_Abstraction is
47213 type My_Type is ...;
47214 function Image(X : My_Type) return String;
47215 package Bags_Of_My_Type is new Generic_Bags(My_Type, Image);
47216 package Iterators_Of_Bags_Of_My_Type is new Bags_Of_My_Type.Generic_Iterators;
47217 end My_Abstraction;
47218
47219 35.g
47220 In the above example, Bags_Of_My_Type has a nested generic
47221 unit called Generic_Iterators. The second with_clause makes
47222 that nested unit visible.
47223
47224 35.h
47225 Here we show how the generic body could depend on one of its
47226 own children:
47227
47228 35.i
47229 with Generic_Bags.Generic_Iterators;
47230 package body Generic_Bags is
47231 procedure Add(B : in out Bag; E : Element) is ... end Add;
47232
47233 35.j
47234 package Iters is new Generic_Iterators;
47235
47236 35.k
47237 function Bag_Image(B : Bag) return String is
47238 Buffer : String(1..10_000);
47239 Last : Integer := 0;
47240
47241 35.l
47242 procedure Append_Image(E : in Element) is
47243 Im : constant String := Image(E);
47244 begin
47245 if Last /= 0 then -- Insert a comma.
47246 Last := Last + 1;
47247 Buffer(Last) := ',';
47248 end if;
47249 Buffer(Last+1 .. Last+Im'Length) := Im;
47250 Last := Last + Im'Length;
47251 end Append_Image;
47252
47253 35.m
47254 procedure Append_All is new Iters.Iterate(Append_Image);
47255 begin
47256 Append_All(B);
47257 return Buffer(1..Last);
47258 end Bag_Image;
47259 end Generic_Bags;
47260
47261 _Extensions to Ada 83_
47262
47263 35.n
47264 The syntax rule for library_item is modified to allow the
47265 reserved word private before a library_unit_declaration.
47266
47267 35.o
47268 Children (other than children of Standard) are new in Ada 95.
47269
47270 35.p
47271 Library unit renaming is new in Ada 95.
47272
47273 _Wording Changes from Ada 83_
47274
47275 35.q
47276 Standard is considered a library unit in Ada 95. This
47277 simplifies the descriptions, since it implies that the parent
47278 of each library unit is a library unit. (Standard itself has
47279 no parent, of course.) As in Ada 83, the language does not
47280 define any way to recompile Standard, since the name given in
47281 the declaration of a library unit is always interpreted in
47282 relation to Standard. That is, an attempt to compile a
47283 package Standard would result in Standard.Standard.
47284
47285 _Extensions to Ada 95_
47286
47287 35.r/2
47288 {AI95-00217-06AI95-00217-06} The concept of a limited view is
47289 new. Combined with limited_with_clauses (see *note 10.1.2::),
47290 they facilitate construction of mutually recursive types in
47291 multiple packages.
47292
47293 _Wording Changes from Ada 95_
47294
47295 35.s/2
47296 {AI95-00331-01AI95-00331-01} Clarified the wording so that a
47297 grandchild generic unit will work as expected.
47298
47299 _Wording Changes from Ada 2005_
47300
47301 35.t/3
47302 {AI05-0108-1AI05-0108-1} {AI05-0129-1AI05-0129-1} Correction:
47303 Clarified the wording so that it is clear that limited views
47304 of types never have discriminants and never are of incomplete
47305 types.
47306
47307 \1f
47308 File: aarm2012.info, Node: 10.1.2, Next: 10.1.3, Prev: 10.1.1, Up: 10.1
47309
47310 10.1.2 Context Clauses - With Clauses
47311 -------------------------------------
47312
47313 1
47314 [A context_clause is used to specify the library_items whose names are
47315 needed within a compilation unit.]
47316
47317 _Language Design Principles_
47318
47319 1.a
47320 The reader should be able to understand a context_clause
47321 without looking ahead. Similarly, when compiling a
47322 context_clause, the compiler should not have to look ahead at
47323 subsequent context_items, nor at the compilation unit to which
47324 the context_clause is attached. (We have not completely
47325 achieved this.)
47326
47327 1.b/2
47328 {AI95-00217-06AI95-00217-06} A ripple effect occurs when the
47329 legality of a compilation unit could be affected by adding or
47330 removing an otherwise unneeded with_clause on some compilation
47331 unit on which the unit depends, directly or indirectly. We
47332 try to avoid ripple effects because they make understanding
47333 and maintenance more difficult. However, ripple effects can
47334 occur because of direct visibility (as in child units); this
47335 seems impossible to eliminate. The ripple effect for
47336 with_clauses is somewhat similar to the Beaujolais effect (see
47337 *note 8.4::) for use_clauses, which we also try to avoid.
47338
47339 _Syntax_
47340
47341 2
47342 context_clause ::= {context_item}
47343
47344 3
47345 context_item ::= with_clause | use_clause
47346
47347 4/2
47348 {AI95-00217-06AI95-00217-06} {AI95-00262-01AI95-00262-01}
47349 with_clause ::= limited_with_clause | nonlimited_with_clause
47350
47351 4.1/2
47352 limited_with_clause ::= limited [private] with library_unit_
47353 name {, library_unit_name};
47354
47355 4.2/2
47356 nonlimited_with_clause ::= [private] with library_unit_
47357 name {, library_unit_name};
47358
47359 4.a/2
47360 Discussion: {AI95-00217-06AI95-00217-06} A limited_with_clause
47361 makes a limited view of a unit visible.
47362
47363 4.b/2
47364 {AI95-00262-01AI95-00262-01} A with_clause containing the
47365 reserved word private is called a private with_clause. It can
47366 be thought of as making items visible only in the private
47367 part, although it really makes items visible everywhere except
47368 the visible part. It can be used both for documentation
47369 purposes (to say that a unit is not used in the visible part),
47370 and to allow access to private units that otherwise would be
47371 prohibited.
47372
47373 _Name Resolution Rules_
47374
47375 5
47376 The scope of a with_clause that appears on a library_unit_declaration
47377 (*note 10.1.1: S0249.) or library_unit_renaming_declaration (*note
47378 10.1.1: S0250.) consists of the entire declarative region of the
47379 declaration[, which includes all children and subunits]. The scope of a
47380 with_clause that appears on a body consists of the body[, which includes
47381 all subunits].
47382
47383 5.a/2
47384 Discussion: {AI95-00262-01AI95-00262-01} Suppose a nonprivate
47385 with_clause of a public library unit mentions one of its
47386 private siblings. (This is only allowed on the body of the
47387 public library unit.) We considered making the scope of that
47388 with_clause not include the visible part of the public library
47389 unit. (This would only matter for a subprogram_body, since
47390 those are the only kinds of body that have a visible part, and
47391 only if the subprogram_body completes a
47392 subprogram_declaration, since otherwise the with_clause would
47393 be illegal.) We did not put in such a rule for two reasons:
47394 (1) It would complicate the wording of the rules, because we
47395 would have to split each with_clause into pieces, in order to
47396 correctly handle "with P, Q;" where P is public and Q is
47397 private. (2) The conformance rules prevent any problems. It
47398 doesn't matter if a type name in the spec of the body denotes
47399 the completion of a private_type_declaration.
47400
47401 5.b
47402 A with_clause also affects visibility within subsequent
47403 use_clauses and pragmas of the same context_clause, even
47404 though those are not in the scope of the with_clause.
47405
47406 6/2
47407 {AI95-00217-06AI95-00217-06} A library_item (and the corresponding
47408 library unit) is named in a with_clause if it is denoted by a
47409 library_unit_name in the with_clause. A library_item (and the
47410 corresponding library unit) is mentioned in a with_clause if it is named
47411 in the with_clause or if it is denoted by a prefix in the with_clause.
47412
47413 6.a/3
47414 Discussion: {AI05-0299-1AI05-0299-1} With_clauses control the
47415 visibility of declarations or renamings of library units.
47416 Mentioning a root library unit in a with_clause makes its
47417 declaration directly visible. Mentioning a nonroot library
47418 unit makes its declaration visible. See Clause *note 8:: for
47419 details.
47420
47421 6.b/2
47422 {AI95-00114-01AI95-00114-01} Note that this rule implies that
47423 "with A.B.C;" is almost equivalent to "with A, A.B, A.B.C;".
47424 The reason for making a with_clause apply to all the ancestor
47425 units is to avoid "visibility holes" -- situations in which an
47426 inner program unit is visible while an outer one is not.
47427 Visibility holes would cause semantic complexity and
47428 implementation difficulty. (This is not exactly equivalent
47429 because the latter with_clause names A and A.B, while the
47430 previous one does not. Whether a unit is "named" does not
47431 have any effect on visibility, however, so it is equivalent
47432 for visibility purposes.)
47433
47434 7
47435 [Outside its own declarative region, the declaration or renaming of a
47436 library unit can be visible only within the scope of a with_clause that
47437 mentions it. The visibility of the declaration or renaming of a library
47438 unit otherwise follows from its placement in the environment.]
47439
47440 _Legality Rules_
47441
47442 8/2
47443 {AI95-00262-01AI95-00262-01} If a with_clause of a given
47444 compilation_unit mentions a private child of some library unit, then the
47445 given compilation_unit shall be one of:
47446
47447 9/2
47448 * {AI95-00262-01AI95-00262-01} the declaration, body, or subunit of a
47449 private descendant of that library unit;
47450
47451 10/2
47452 * {AI95-00220-01AI95-00220-01} {AI95-00262-01AI95-00262-01} the body
47453 or subunit of a public descendant of that library unit, but not a
47454 subprogram body acting as a subprogram declaration (see *note
47455 10.1.4::); or
47456
47457 11/2
47458 * {AI95-00262-01AI95-00262-01} the declaration of a public descendant
47459 of that library unit, in which case the with_clause shall include
47460 the reserved word private.
47461
47462 11.a/2
47463 Reason: {AI95-00262-01AI95-00262-01} The purpose of this rule
47464 is to prevent a private child from being visible from outside
47465 the subsystem rooted at its parent. A private child can be
47466 semantically depended-on without violating this principle if
47467 it is used in a private with_clause.
47468
47469 11.b
47470 Discussion: This rule violates the one-pass context_clauses
47471 Language Design Principle. We rationalize this by saying that
47472 at least that Language Design Principle works for legal
47473 compilation units.
47474
47475 11.c
47476 Example:
47477
47478 11.d
47479 package A is
47480 end A;
47481
47482 11.e
47483 package A.B is
47484 end A.B;
47485
47486 11.f
47487 private package A.B.C is
47488 end A.B.C;
47489
47490 11.g
47491 package A.B.C.D is
47492 end A.B.C.D;
47493
47494 11.h
47495 with A.B.C; -- (1)
47496 private package A.B.X is
47497 end A.B.X;
47498
47499 11.i
47500 package A.B.Y is
47501 end A.B.Y;
47502
47503 11.j
47504 with A.B.C; -- (2)
47505 package body A.B.Y is
47506 end A.B.Y;
47507
47508 11.j.1/2
47509 private with A.B.C; -- (3)
47510 package A.B.Z is
47511 end A.B.Z;
47512
47513 11.k/2
47514 {AI95-00262-01AI95-00262-01} (1) is OK because it's a private
47515 child of A.B -- it would be illegal if we made A.B.X a public
47516 child of A.B. (2) is OK because it's the body of a child of
47517 A.B. (3) is OK because it's a child of A.B, and it is a
47518 private with_clause. It would be illegal to say "with A.B.C;"
47519 on any library_item whose name does not start with "A.B". Note
47520 that mentioning A.B.C.D in a with_clause automatically
47521 mentions A.B.C as well, so "with A.B.C.D;" is illegal in the
47522 same places as "with A.B.C;".
47523
47524 12/3
47525 {AI05-0005-1AI05-0005-1} {AI95-00262-01AI95-00262-01}
47526 {AI95-00262-01AI95-00262-01} {AI05-0077-1AI05-0077-1}
47527 {AI05-0122-1AI05-0122-1} A name denoting a library_item (or the
47528 corresponding declaration for a child of a generic within an instance --
47529 see *note 10.1.1::), if it is visible only due to being mentioned in one
47530 or more with_clauses that include the reserved word private, shall
47531 appear only within:
47532
47533 13/2
47534 * a private part;
47535
47536 14/2
47537 * a body, but not within the subprogram_specification of a library
47538 subprogram body;
47539
47540 15/2
47541 * a private descendant of the unit on which one of these with_clauses
47542 appear; or
47543
47544 16/2
47545 * a pragma within a context clause.
47546
47547 16.a/2
47548 Ramification: These rules apply only if all of the
47549 with_clauses that mention the name include the reserved word
47550 private. They do not apply if the name is mentioned in any
47551 with_clause that does not include private.
47552
47553 16.b/3
47554 Reason: {AI05-0077-1AI05-0077-1} These rules make the
47555 library_item visible anywhere that is not visible outside the
47556 subsystem rooted at the compilation_unit having the private
47557 with_clause, including private parts of packages nested in the
47558 visible part, private parts of child packages, the visible
47559 part of private children, and context clause pragmas like
47560 Elaborate_All.
47561
47562 16.c/2
47563 We considered having the scope of a private with_clause not
47564 include the visible part. However, that rule would mean that
47565 moving a declaration between the visible part and the private
47566 part could change its meaning from one legal interpretation to
47567 a different legal interpretation. For example:
47568
47569 16.d/2
47570 package A is
47571 function B return Integer;
47572 end A;
47573
47574 16.e/2
47575 function B return Integer;
47576
47577 16.f/2
47578 with A;
47579 private with B;
47580 package C is
47581 use A;
47582 V1 : Integer := B; -- (1)
47583 private
47584 V2 : Integer := B; -- (2)
47585 end C;
47586
47587 16.g/2
47588 If we say that library subprogram B is not in scope in the
47589 visible part of C, then the B at (1) resolves to A.B, while
47590 (2) resolves to library unit B. Simply moving a declaration
47591 could silently change its meaning. With the legality rule
47592 defined above, the B at (1) is illegal. If the user really
47593 meant A.B, they still can say that.
47594
47595 17/2
47596 {AI95-00217-06AI95-00217-06} [A library_item mentioned in a
47597 limited_with_clause shall be the implicit declaration of the limited
47598 view of a library package, not the declaration of a subprogram, generic
47599 unit, generic instance, or a renaming.]
47600
47601 17.a/2
47602 Proof: This is redundant because only such implicit
47603 declarations are visible in a limited_with_clause. See *note
47604 10.1.6::.
47605
47606 18/2
47607 {AI95-00217-06AI95-00217-06} {AI95-00412-01AI95-00412-01} A
47608 limited_with_clause shall not appear on a library_unit_body, subunit, or
47609 library_unit_renaming_declaration (*note 10.1.1: S0250.).
47610
47611 18.a/2
47612 Reason: {AI95-00412-01AI95-00412-01} We don't allow a
47613 limited_with_clause on a library_unit_renaming_declaration
47614 (*note 10.1.1: S0250.) because it would be useless and
47615 therefore probably is a mistake. A renaming cannot appear in
47616 a limited_with_clause (by the rule prior to this one), and a
47617 renaming of a limited view cannot appear in a
47618 nonlimited_with_clause (because the name would not be within
47619 the scope of a with_clause denoting the package, see *note
47620 8.5.3::). Nor could it be the parent of another unit. That
47621 doesn't leave anywhere that the name of such a renaming could
47622 appear, so we simply make writing it illegal.
47623
47624 19/2
47625 {AI95-00217-06AI95-00217-06} A limited_with_clause that names a library
47626 package shall not appear:
47627
47628 20/3
47629 * {AI95-00217-06AI95-00217-06} {AI05-0040-1AI05-0040-1} in the
47630 context_clause for the explicit declaration of the named library
47631 package or any of its descendants;
47632
47633 20.a/2
47634 Reason: We have to explicitly disallow
47635
47636 20.b/2
47637 limited with P;
47638 package P is ...
47639
47640 20.c/2
47641 as we can't depend on the semantic dependence rules to do it
47642 for us as with regular withs. This says "named" and not
47643 "mentioned" in order that
47644
47645 20.d/2
47646 limited private with P.Child;
47647 package P is ...
47648
47649 20.e/2
47650 can be used to allow a mutual dependence between the private
47651 part of P and the private child P.Child, which occurs in
47652 interfacing and other problems. Since the child always
47653 semantically depends on the parent, this is the only way such
47654 a dependence can be broken.
47655
47656 20.f/3
47657 {AI05-0040-1AI05-0040-1} The part about descendants catches
47658 examples like
47659
47660 20.g/3
47661 limited with P;
47662 package P.Child is ...
47663
47664 21/3
47665 * {AI95-00217-06AI95-00217-06} {AI05-0077-1AI05-0077-1}
47666 {AI05-0262-1AI05-0262-1} within a context_clause for a library_item
47667 that is within the scope of a nonlimited_with_clause that mentions
47668 the same library package; or
47669
47670 21.a.1/3
47671 Ramification: {AI05-0077-1AI05-0077-1} This applies to
47672 nonlimited_with_clauses found in the same context_clause, as
47673 well as nonlimited_with_clauses found on parent units.
47674
47675 21.a/3
47676 Reason: {AI05-0077-1AI05-0077-1} Such a limited_with_clause
47677 could have no effect, and would be confusing. If a
47678 nonlimited_with_clause for the same package is inherited from
47679 a parent unit or given in the context_clause, the full view is
47680 available, which strictly provides more information than the
47681 limited view.
47682
47683 22/3
47684 * {AI95-00217-06AI95-00217-06} {AI05-0077-1AI05-0077-1}
47685 {AI05-0262-1AI05-0262-1} within a context_clause for a library_item
47686 that is within the scope of a use_clause that names an entity
47687 declared within the declarative region of the library package.
47688
47689 22.a.1/3
47690 Ramification: {AI05-0077-1AI05-0077-1} This applies to
47691 use_clauses found in the same context_clause, as well as
47692 use_clauses found in (or on) parent units.
47693
47694 22.a/2
47695 Reason: This prevents visibility issues, where whether an
47696 entity is an incomplete or full view depends on how the name
47697 of the entity is written. The limited_with_clause cannot be
47698 useful, as we must have the full view available in the parent
47699 in order for the use_clause to be legal.
47700
47701 NOTES
47702
47703 23/2
47704 3 {AI95-00217-06AI95-00217-06} A library_item mentioned in a
47705 nonlimited_with_clause of a compilation unit is visible within the
47706 compilation unit and hence acts just like an ordinary declaration.
47707 Thus, within a compilation unit that mentions its declaration, the
47708 name of a library package can be given in use_clauses and can be
47709 used to form expanded names, a library subprogram can be called,
47710 and instances of a generic library unit can be declared. If a
47711 child of a parent generic package is mentioned in a
47712 nonlimited_with_clause, then the corresponding declaration nested
47713 within each visible instance is visible within the compilation
47714 unit. Similarly, a library_item mentioned in a limited_with_clause
47715 of a compilation unit is visible within the compilation unit and
47716 thus can be used to form expanded names.
47717
47718 23.a
47719 Ramification: The rules given for with_clauses are such that
47720 the same effect is obtained whether the name of a library unit
47721 is mentioned once or more than once by the applicable
47722 with_clauses, or even within a given with_clause.
47723
47724 23.b
47725 If a with_clause mentions a library_unit_renaming_declaration
47726 (*note 10.1.1: S0250.), it only "mentions" the prefixes
47727 appearing explicitly in the with_clause (and the renamed view
47728 itself); the with_clause is not defined to mention the
47729 ancestors of the renamed entity. Thus, if X renames Y.Z, then
47730 "with X;" does not make the declarations of Y or Z visible.
47731 Note that this does not cause the dreaded visibility holes
47732 mentioned above.
47733
47734 _Examples_
47735
47736 24/2
47737 {AI95-00433-01AI95-00433-01} package Office is
47738 end Office;
47739
47740 25/2
47741 {AI95-00433-01AI95-00433-01} with Ada.Strings.Unbounded;
47742 package Office.Locations is
47743 type Location is new Ada.Strings.Unbounded.Unbounded_String;
47744 end Office.Locations;
47745
47746 26/2
47747 {AI95-00433-01AI95-00433-01} limited with Office.Departments; -- types are incomplete
47748 private with Office.Locations; -- only visible in private part
47749 package Office.Employees is
47750 type Employee is private;
47751
47752 27/2
47753 function Dept_Of(Emp : Employee) return access Departments.Department;
47754 procedure Assign_Dept(Emp : in out Employee;
47755 Dept : access Departments.Department);
47756
47757 28/2
47758 ...
47759 private
47760 type Employee is
47761 record
47762 Dept : access Departments.Department;
47763 Loc : Locations.Location;
47764 ...
47765 end record;
47766 end Office.Employees;
47767
47768 29/2
47769 limited with Office.Employees;
47770 package Office.Departments is
47771 type Department is private;
47772
47773 30/2
47774 function Manager_Of(Dept : Department) return access Employees.Employee;
47775 procedure Assign_Manager(Dept : in out Department;
47776 Mgr : access Employees.Employee);
47777 ...
47778 end Office.Departments;
47779
47780 31/2
47781 {AI95-00433-01AI95-00433-01} The limited_with_clause may be used to
47782 support mutually dependent abstractions that are split across multiple
47783 packages. In this case, an employee is assigned to a department, and a
47784 department has a manager who is an employee. If a with_clause with the
47785 reserved word private appears on one library unit and mentions a second
47786 library unit, it provides visibility to the second library unit, but
47787 restricts that visibility to the private part and body of the first
47788 unit. The compiler checks that no use is made of the second unit in the
47789 visible part of the first unit.
47790
47791 _Extensions to Ada 83_
47792
47793 31.a
47794 The syntax rule for with_clause is modified to allow expanded
47795 name notation.
47796
47797 31.b
47798 A use_clause in a context_clause may be for a package (or
47799 type) nested in a library package.
47800
47801 _Wording Changes from Ada 83_
47802
47803 31.c
47804 The syntax rule for context_clause is modified to more closely
47805 reflect the semantics. The Ada 83 syntax rule implies that
47806 the use_clauses that appear immediately after a particular
47807 with_clause are somehow attached to that with_clause, which is
47808 not true. The new syntax allows a use_clause to appear first,
47809 but that is prevented by a textual rule that already exists in
47810 Ada 83.
47811
47812 31.d
47813 The concept of "scope of a with_clause" (which is a region of
47814 text) replaces RM83's notion of "apply to" (a with_clause
47815 applies to a library_item) The visibility rules are interested
47816 in a region of text, not in a set of compilation units.
47817
47818 31.e
47819 No need to define "apply to" for use_clauses. Their semantics
47820 are fully covered by the "scope (of a use_clause)" definition
47821 in *note 8.4::.
47822
47823 _Incompatibilities With Ada 95_
47824
47825 31.f/2
47826 {AI95-00220-01AI95-00220-01} Amendment Correction: A
47827 subprogram body acting as a declaration cannot with a private
47828 child unit. This would allow public export of types declared
47829 in private child packages, and thus cannot be allowed. This
47830 was allowed by mistake in Ada 95; a subprogram that does this
47831 will now be illegal.
47832
47833 _Extensions to Ada 95_
47834
47835 31.g/2
47836 {AI95-00217-06AI95-00217-06} limited_with_clauses are new.
47837 They make a limited view of a package visible, where all of
47838 the types in the package are incomplete. They facilitate
47839 construction of mutually recursive types in multiple packages.
47840
47841 31.h/3
47842 {AI95-00262-01AI95-00262-01} {AI05-0077-1AI05-0077-1} The
47843 syntax rules for with_clause are modified to allow the
47844 reserved word private. Private with_clauses do not allow the
47845 use of their library_item in the visible part of their
47846 compilation_unit. They also allow using private units in more
47847 locations than in Ada 95.
47848
47849 _Incompatibilities With Ada 2005_
47850
47851 31.i/3
47852 {AI05-0040-1AI05-0040-1} Correction: Added missing rule that a
47853 limited with clause cannot name an ancestor unit. This is
47854 incompatible if an Ada 2005 program does this, but as this is
47855 a new Ada 2005 feature and the unintentionally allowed
47856 capability is not useful, the incompatibility is very unlikely
47857 to occur in practice.
47858
47859 _Wording Changes from Ada 2005_
47860
47861 31.j/3
47862 {AI05-0077-1AI05-0077-1} Correction: Fixed wording so that we
47863 are not checking whether something in a context_clause is
47864 "within the scope of" something, as context_clauses are never
47865 included in anything's scope. The intended meaning is
47866 unchanged, however.
47867
47868 31.k/3
47869 {AI05-0122-1AI05-0122-1} Correction: Fixed wording so the
47870 rules for private with clauses also apply to "sprouted"
47871 generic child units.
47872
47873 \1f
47874 File: aarm2012.info, Node: 10.1.3, Next: 10.1.4, Prev: 10.1.2, Up: 10.1
47875
47876 10.1.3 Subunits of Compilation Units
47877 ------------------------------------
47878
47879 1
47880 [Subunits are like child units, with these (important) differences:
47881 subunits support the separate compilation of bodies only (not
47882 declarations); the parent contains a body_stub to indicate the existence
47883 and place of each of its subunits; declarations appearing in the
47884 parent's body can be visible within the subunits.]
47885
47886 _Syntax_
47887
47888 2
47889 body_stub ::= subprogram_body_stub | package_body_stub |
47890 task_body_stub | protected_body_stub
47891
47892 3/3
47893 {AI95-00218-03AI95-00218-03} {AI05-0267-1AI05-0267-1}
47894 subprogram_body_stub ::=
47895 [overriding_indicator]
47896 subprogram_specification is separate
47897 [aspect_specification];
47898
47899 3.a
47900 Discussion: Although this syntax allows a parent_unit_name,
47901 that is disallowed by *note 10.1.1::, "*note 10.1.1::
47902 Compilation Units - Library Units".
47903
47904 4
47905 package_body_stub ::=
47906 package body defining_identifier is separate
47907 [aspect_specification];
47908
47909 5
47910 task_body_stub ::=
47911 task body defining_identifier is separate
47912 [aspect_specification];
47913
47914 6
47915 protected_body_stub ::=
47916 protected body defining_identifier is separate
47917 [aspect_specification];
47918
47919 7
47920 subunit ::= separate (parent_unit_name) proper_body
47921
47922 _Legality Rules_
47923
47924 8/2
47925 {AI95-00243-01AI95-00243-01} The parent body of a subunit is the body of
47926 the program unit denoted by its parent_unit_name. The term subunit is
47927 used to refer to a subunit and also to the proper_body of a subunit.
47928 The subunits of a program unit include any subunit that names that
47929 program unit as its parent, as well as any subunit that names such a
47930 subunit as its parent (recursively).
47931
47932 8.a.1/2
47933 Reason: {AI95-00243-01AI95-00243-01} We want any rule that
47934 applies to a subunit to apply to a subunit of a subunit as
47935 well.
47936
47937 9
47938 The parent body of a subunit shall be present in the current
47939 environment, and shall contain a corresponding body_stub with the same
47940 defining_identifier as the subunit.
47941
47942 9.a
47943 Discussion: This can't be a Name Resolution Rule, because a
47944 subunit is not a complete context.
47945
47946 10/3
47947 {AI05-0004-1AI05-0004-1} A package_body_stub shall be the completion of
47948 a package_declaration (*note 7.1: S0190.) or generic_package_declaration
47949 (*note 12.1: S0272.); a task_body_stub (*note 10.1.3: S0261.) shall be
47950 the completion of a task declaration; a protected_body_stub (*note
47951 10.1.3: S0262.) shall be the completion of a protected declaration.
47952
47953 11
47954 In contrast, a subprogram_body_stub need not be the completion of a
47955 previous declaration, [in which case the _stub declares the subprogram].
47956 If the _stub is a completion, it shall be the completion of a
47957 subprogram_declaration or generic_subprogram_declaration. The profile
47958 of a subprogram_body_stub that completes a declaration shall conform
47959 fully to that of the declaration.
47960
47961 11.a
47962 Discussion: The part about subprogram_body_stubs echoes the
47963 corresponding rule for subprogram_bodies in *note 6.3::,
47964 "*note 6.3:: Subprogram Bodies".
47965
47966 12
47967 A subunit that corresponds to a body_stub shall be of the same kind
47968 (package_, subprogram_, task_, or protected_) as the body_stub. The
47969 profile of a subprogram_body subunit shall be fully conformant to that
47970 of the corresponding body_stub.
47971
47972 13
47973 A body_stub shall appear immediately within the declarative_part of a
47974 compilation unit body. This rule does not apply within an instance of a
47975 generic unit.
47976
47977 13.a
47978 Discussion: This is a methodological restriction; that is, it
47979 is not necessary for the semantics of the language to make
47980 sense.
47981
47982 14
47983 The defining_identifiers of all body_stubs that appear immediately
47984 within a particular declarative_part shall be distinct.
47985
47986 _Post-Compilation Rules_
47987
47988 15
47989 For each body_stub, there shall be a subunit containing the
47990 corresponding proper_body.
47991
47992 NOTES
47993
47994 16
47995 4 The rules in *note 10.1.4::, "*note 10.1.4:: The Compilation
47996 Process" say that a body_stub is equivalent to the corresponding
47997 proper_body. This implies:
47998
47999 17
48000 * Visibility within a subunit is the visibility that would be
48001 obtained at the place of the corresponding body_stub (within
48002 the parent body) if the context_clause of the subunit were
48003 appended to that of the parent body.
48004
48005 17.a
48006 Ramification: Recursively. Note that this transformation
48007 might make the parent illegal; hence it is not a true
48008 equivalence, but applies only to visibility within the
48009 subunit.
48010
48011 18
48012 * The effect of the elaboration of a body_stub is to elaborate
48013 the subunit.
48014
48015 18.a
48016 Ramification: The elaboration of a subunit is part of its
48017 parent body's elaboration, whereas the elaboration of a child
48018 unit is not part of its parent declaration's elaboration.
48019
48020 18.b
48021 Ramification: A library_item that is mentioned in a
48022 with_clause of a subunit can be hidden (from direct
48023 visibility) by a declaration (with the same identifier) given
48024 in the subunit. Moreover, such a library_item can even be
48025 hidden by a declaration given within the parent body since a
48026 library unit is declared in its parent's declarative region;
48027 this however does not affect the interpretation of the
48028 with_clauses themselves, since only library_items are visible
48029 or directly visible in with_clauses.
48030
48031 18.c
48032 The body of a protected operation cannot be a subunit. This
48033 follows from the syntax rules. The body of a protected unit
48034 can be a subunit.
48035
48036 _Examples_
48037
48038 19
48039 The package Parent is first written without subunits:
48040
48041 20
48042 package Parent is
48043 procedure Inner;
48044 end Parent;
48045
48046 21
48047 with Ada.Text_IO;
48048 package body Parent is
48049 Variable : String := "Hello, there.";
48050 procedure Inner is
48051 begin
48052 Ada.Text_IO.Put_Line(Variable);
48053 end Inner;
48054 end Parent;
48055
48056 22
48057 The body of procedure Inner may be turned into a subunit by rewriting
48058 the package body as follows (with the declaration of Parent remaining
48059 the same):
48060
48061 23
48062 package body Parent is
48063 Variable : String := "Hello, there.";
48064 procedure Inner is separate;
48065 end Parent;
48066
48067 24
48068 with Ada.Text_IO;
48069 separate(Parent)
48070 procedure Inner is
48071 begin
48072 Ada.Text_IO.Put_Line(Variable);
48073 end Inner;
48074
48075 _Extensions to Ada 83_
48076
48077 24.a
48078 Subunits of the same ancestor library unit are no longer
48079 restricted to have distinct identifiers. Instead, we require
48080 only that the full expanded names be distinct.
48081
48082 _Extensions to Ada 95_
48083
48084 24.b/2
48085 {AI95-00218-03AI95-00218-03} An overriding_indicator (see
48086 *note 8.3.1::) is allowed on a subprogram stub.
48087
48088 _Wording Changes from Ada 95_
48089
48090 24.c/2
48091 {AI95-00243-01AI95-00243-01} Clarified that a subunit of a
48092 subunit is still a subunit.
48093
48094 _Extensions to Ada 2005_
48095
48096 24.d/3
48097 {AI05-0267-1AI05-0267-1} An optional aspect_specification can
48098 be used in a body_stub. This is described in *note 13.1.1::.
48099
48100 \1f
48101 File: aarm2012.info, Node: 10.1.4, Next: 10.1.5, Prev: 10.1.3, Up: 10.1
48102
48103 10.1.4 The Compilation Process
48104 ------------------------------
48105
48106 1
48107 Each compilation unit submitted to the compiler is compiled in the
48108 context of an environment declarative_part (or simply, an environment),
48109 which is a conceptual declarative_part that forms the outermost
48110 declarative region of the context of any compilation. At run time, an
48111 environment forms the declarative_part of the body of the environment
48112 task of a partition (see *note 10.2::, "*note 10.2:: Program
48113 Execution").
48114
48115 1.a
48116 Ramification: At compile time, there is no particular
48117 construct that the declarative region is considered to be
48118 nested within -- the environment is the universe.
48119
48120 1.b
48121 To be honest: The environment is really just a portion of a
48122 declarative_part, since there might, for example, be bodies
48123 that do not yet exist.
48124
48125 2
48126 The declarative_items of the environment are library_items appearing in
48127 an order such that there are no forward semantic dependences. Each
48128 included subunit occurs in place of the corresponding stub. The
48129 visibility rules apply as if the environment were the outermost
48130 declarative region, except that with_clause (*note 10.1.2: S0255.)s are
48131 needed to make declarations of library units visible (see *note
48132 10.1.2::).
48133
48134 3/2
48135 {AI95-00217-06AI95-00217-06} The mechanisms for creating an environment
48136 and for adding and replacing compilation units within an environment are
48137 implementation defined. The mechanisms for adding a compilation unit
48138 mentioned in a limited_with_clause to an environment are implementation
48139 defined.
48140
48141 3.a
48142 Implementation defined: The mechanisms for creating an
48143 environment and for adding and replacing compilation units.
48144
48145 3.a.1/2
48146 Implementation defined: The mechanisms for adding a
48147 compilation unit mentioned in a limited_with_clause to an
48148 environment.
48149
48150 3.b
48151 Ramification: The traditional model, used by most Ada 83
48152 implementations, is that one places a compilation unit in the
48153 environment by compiling it. Other models are possible. For
48154 example, an implementation might define the environment to be
48155 a directory; that is, the compilation units in the environment
48156 are all the compilation units in the source files contained in
48157 the directory. In this model, the mechanism for replacing a
48158 compilation unit with a new one is simply to edit the source
48159 file containing that compilation unit.
48160
48161 _Name Resolution Rules_
48162
48163 4/3
48164 {8652/00328652/0032} {AI95-00192-01AI95-00192-01}
48165 {AI05-0264-1AI05-0264-1} If a library_unit_body that is a
48166 subprogram_body is submitted to the compiler, it is interpreted only as
48167 a completion if a library_unit_declaration with the same
48168 defining_program_unit_name already exists in the environment for a
48169 subprogram other than an instance of a generic subprogram or for a
48170 generic subprogram (even if the profile of the body is not type
48171 conformant with that of the declaration); otherwise, the subprogram_body
48172 is interpreted as both the declaration and body of a library subprogram.
48173
48174 4.a
48175 Ramification: The principle here is that a subprogram_body
48176 should be interpreted as only a completion if and only if it
48177 "might" be legal as the completion of some preexisting
48178 declaration, where "might" is defined in a way that does not
48179 require overload resolution to determine.
48180
48181 4.b
48182 Hence, if the preexisting declaration is a
48183 subprogram_declaration or generic_subprogram_declaration, we
48184 treat the new subprogram_body as its completion, because it
48185 "might" be legal. If it turns out that the profiles don't
48186 fully conform, it's an error. In all other cases (the
48187 preexisting declaration is a package or a generic package, or
48188 an instance of a generic subprogram, or a renaming, or a
48189 "spec-less" subprogram, or in the case where there is no
48190 preexisting thing), the subprogram_body declares a new
48191 subprogram.
48192
48193 4.c
48194 See also AI83-00266/09.
48195
48196 _Legality Rules_
48197
48198 5
48199 When a compilation unit is compiled, all compilation units upon which it
48200 depends semantically shall already exist in the environment; the set of
48201 these compilation units shall be consistent in the sense that the new
48202 compilation unit shall not semantically depend (directly or indirectly)
48203 on two different versions of the same compilation unit, nor on an
48204 earlier version of itself.
48205
48206 5.a
48207 Discussion: For example, if package declarations A and B both
48208 say "with X;", and the user compiles a compilation unit that
48209 says "with A, B;", then the A and B have to be talking about
48210 the same version of X.
48211
48212 5.b
48213 Ramification: What it means to be a "different version" is not
48214 specified by the language. In some implementations, it means
48215 that the compilation unit has been recompiled. In others, it
48216 means that the source of the compilation unit has been edited
48217 in some significant way.
48218
48219 5.c
48220 Note that an implementation cannot require the existence of
48221 compilation units upon which the given one does not
48222 semantically depend. For example, an implementation is
48223 required to be able to compile a compilation unit that says
48224 "with A;" when A's body does not exist. It has to be able to
48225 detect errors without looking at A's body.
48226
48227 5.d/3
48228 {AI05-0229-1AI05-0229-1} Similarly, the implementation has to
48229 be able to compile a call to a subprogram for which aspect
48230 Inline has been specified without seeing the body of that
48231 subprogram -- inlining would not be achieved in this case, but
48232 the call is still legal.
48233
48234 5.e/3
48235 {AI95-00217-06AI95-00217-06} {AI05-0005-1AI05-0005-1} The
48236 consistency rule applies to limited views as well as the full
48237 view of a compilation unit. That means that an implementation
48238 needs a way to enforce consistency of limited views, not just
48239 of full views.
48240
48241 _Implementation Permissions_
48242
48243 6/2
48244 {AI95-00217-06AI95-00217-06} The implementation may require that a
48245 compilation unit be legal before it can be mentioned in a
48246 limited_with_clause or it can be inserted into the environment.
48247
48248 7/3
48249 {AI95-00214-01AI95-00214-01} {AI05-0229-1AI05-0229-1} When a compilation
48250 unit that declares or renames a library unit is added to the
48251 environment, the implementation may remove from the environment any
48252 preexisting library_item or subunit with the same full expanded name.
48253 When a compilation unit that is a subunit or the body of a library unit
48254 is added to the environment, the implementation may remove from the
48255 environment any preexisting version of the same compilation unit. When
48256 a compilation unit that contains a body_stub is added to the
48257 environment, the implementation may remove any preexisting library_item
48258 or subunit with the same full expanded name as the body_stub. When a
48259 given compilation unit is removed from the environment, the
48260 implementation may also remove any compilation unit that depends
48261 semantically upon the given one. If the given compilation unit contains
48262 the body of a subprogram for which aspect Inline is True, the
48263 implementation may also remove any compilation unit containing a call to
48264 that subprogram.
48265
48266 7.a/3
48267 Ramification: {AI05-0005-1AI05-0005-1} The permissions given
48268 in this paragraph correspond to the traditional model, where
48269 compilation units enter the environment by being compiled into
48270 it, and the compiler checks their legality at that time. An
48271 implementation model in which the environment consists of all
48272 source files in a given directory might not want to take
48273 advantage of these permissions. Compilation units would not
48274 be checked for legality as soon as they enter the environment;
48275 legality checking would happen later, when compilation units
48276 are compiled. In this model, compilation units might never be
48277 automatically removed from the environment; they would be
48278 removed when the user explicitly deletes a source file.
48279
48280 7.b
48281 Note that the rule is recursive: if the above permission is
48282 used to remove a compilation unit containing an inlined
48283 subprogram call, then compilation units that depend
48284 semantically upon the removed one may also be removed, and so
48285 on.
48286
48287 7.c
48288 Note that here we are talking about dependences among existing
48289 compilation units in the environment; it doesn't matter what
48290 with_clauses are attached to the new compilation unit that
48291 triggered all this.
48292
48293 7.d/3
48294 {AI05-0229-1AI05-0229-1} An implementation may have other
48295 modes in which compilation units in addition to the ones
48296 mentioned above are removed. For example, an implementation
48297 might inline subprogram calls without an explicit aspect
48298 Inline. If so, it either has to have a mode in which that
48299 optimization is turned off, or it has to automatically
48300 regenerate code for the inlined calls without requiring the
48301 user to resubmit them to the compiler.
48302
48303 7.d.1/2
48304 Discussion: {8652/01088652/0108} {AI95-00077-01AI95-00077-01}
48305 {AI95-00114-01AI95-00114-01} In the standard mode,
48306 implementations may only remove units from the environment for
48307 one of the reasons listed here, or in response to an explicit
48308 user command to modify the environment. It is not intended
48309 that the act of compiling a unit is one of the "mechanisms"
48310 for removing units other than those specified by this
48311 International Standard.
48312
48313 7.e/2
48314 {AI95-00214-01AI95-00214-01} These rules are intended to
48315 ensure that an implementation never need keep more than one
48316 compilation unit with any full expanded name. In particular,
48317 it is not necessary to be able to have a subunit and a child
48318 unit with the same name in the environment at one time.
48319
48320 NOTES
48321
48322 8
48323 5 The rules of the language are enforced across compilation and
48324 compilation unit boundaries, just as they are enforced within a
48325 single compilation unit.
48326
48327 8.a/3
48328 Ramification: {AI05-0299-1AI05-0299-1} Note that Clause *note
48329 1:: requires an implementation to detect illegal compilation
48330 units at compile time.
48331
48332 9
48333 6 An implementation may support a concept of a library, which
48334 contains library_items. If multiple libraries are supported, the
48335 implementation has to define how a single environment is
48336 constructed when a compilation unit is submitted to the compiler.
48337 Naming conflicts between different libraries might be resolved by
48338 treating each library as the root of a hierarchy of child library
48339 units.
48340
48341 9.a
48342 Implementation Note: Alternatively, naming conflicts could be
48343 resolved via some sort of hiding rule.
48344
48345 9.b
48346 Discussion: For example, the implementation might support a
48347 command to import library Y into library X. If a root library
48348 unit called LU (that is, Standard.LU) exists in Y, then from
48349 the point of view of library X, it could be called Y.LU. X
48350 might contain library units that say, "with Y.LU;".
48351
48352 10
48353 7 A compilation unit containing an instantiation of a separately
48354 compiled generic unit does not semantically depend on the body of
48355 the generic unit. Therefore, replacing the generic body in the
48356 environment does not result in the removal of the compilation unit
48357 containing the instantiation.
48358
48359 10.a
48360 Implementation Note: Therefore, implementations have to be
48361 prepared to automatically instantiate generic bodies at
48362 link-time, as needed. This might imply a complete automatic
48363 recompilation, but it is the intent of the language that
48364 generic bodies can be (re)instantiated without forcing all of
48365 the compilation units that semantically depend on the
48366 compilation unit containing the instantiation to be
48367 recompiled.
48368
48369 _Extensions to Ada 83_
48370
48371 10.b/2
48372 {AI95-00077-01AI95-00077-01} {AI95-00114-01AI95-00114-01} Ada
48373 83 allowed implementations to require that the body of a
48374 generic unit be available when the instantiation is compiled;
48375 that permission is dropped in Ada 95. This isn't really an
48376 extension (it doesn't allow Ada users to write anything that
48377 they couldn't in Ada 83), but there isn't a more appropriate
48378 category, and it does allow users more flexibility when
48379 developing programs.
48380
48381 _Wording Changes from Ada 95_
48382
48383 10.c/2
48384 {8652/00328652/0032} {AI95-00192-01AI95-00192-01} Corrigendum:
48385 The wording was clarified to ensure that a subprogram_body is
48386 not considered a completion of an instance of a generic
48387 subprogram.
48388
48389 10.d/2
48390 {AI95-00214-01AI95-00214-01} The permissions to remove a unit
48391 from the environment were clarified to ensure that it is never
48392 necessary to keep multiple (sub)units with the same full
48393 expanded name in the environment.
48394
48395 10.e/2
48396 {AI95-00217-06AI95-00217-06} Units mentioned in a
48397 limited_with_clause were added to several rules; limited views
48398 have the same presence in the environment as the corresponding
48399 full views.
48400
48401 \1f
48402 File: aarm2012.info, Node: 10.1.5, Next: 10.1.6, Prev: 10.1.4, Up: 10.1
48403
48404 10.1.5 Pragmas and Program Units
48405 --------------------------------
48406
48407 1
48408 [This subclause discusses pragmas related to program units, library
48409 units, and compilations.]
48410
48411 _Name Resolution Rules_
48412
48413 2
48414 Certain pragmas are defined to be program unit pragmas. A name given as
48415 the argument of a program unit pragma shall resolve to denote the
48416 declarations or renamings of one or more program units that occur
48417 immediately within the declarative region or compilation in which the
48418 pragma immediately occurs, or it shall resolve to denote the declaration
48419 of the immediately enclosing program unit (if any); the pragma applies
48420 to the denoted program unit(s). If there are no names given as
48421 arguments, the pragma applies to the immediately enclosing program unit.
48422
48423 2.a
48424 Ramification: The fact that this is a Name Resolution Rule
48425 means that the pragma will not apply to declarations from
48426 outer declarative regions.
48427
48428 _Legality Rules_
48429
48430 3
48431 A program unit pragma shall appear in one of these places:
48432
48433 4
48434 * At the place of a compilation_unit, in which case the pragma shall
48435 immediately follow in the same compilation (except for other
48436 pragmas) a library_unit_declaration (*note 10.1.1: S0249.) that is
48437 a subprogram_declaration (*note 6.1: S0163.),
48438 generic_subprogram_declaration (*note 12.1: S0271.), or
48439 generic_instantiation (*note 12.3: S0275.), and the pragma shall
48440 have an argument that is a name denoting that declaration.
48441
48442 4.a
48443 Ramification: The name has to denote the immediately preceding
48444 library_unit_declaration.
48445
48446 5/1
48447 * {8652/00338652/0033} {AI95-00136-01AI95-00136-01} Immediately
48448 within the visible part of a program unit and before any nested
48449 declaration (but not within a generic formal part), in which case
48450 the argument, if any, shall be a direct_name that denotes the
48451 immediately enclosing program unit declaration.
48452
48453 5.a
48454 Ramification: The argument is optional in this case.
48455
48456 6
48457 * At the place of a declaration other than the first, of a
48458 declarative_part or program unit declaration, in which case the
48459 pragma shall have an argument, which shall be a direct_name that
48460 denotes one or more of the following (and nothing else): a
48461 subprogram_declaration (*note 6.1: S0163.), a
48462 generic_subprogram_declaration (*note 12.1: S0271.), or a
48463 generic_instantiation (*note 12.3: S0275.), of the same
48464 declarative_part (*note 3.11: S0086.) or program unit declaration.
48465
48466 6.a
48467 Ramification: If you want to denote a subprogram_body that is
48468 not a completion, or a package_declaration, for example, you
48469 have to put the pragma inside.
48470
48471 7/3
48472 {AI05-0132-1AI05-0132-1} Certain program unit pragmas are defined to be
48473 library unit pragmas. If a library unit pragma applies to a program
48474 unit, the program unit shall be a library unit.
48475
48476 7.a
48477 Ramification: This, together with the rules for program unit
48478 pragmas above, implies that if a library unit pragma applies
48479 to a subprogram_declaration (and similar things), it has to
48480 appear immediately after the compilation_unit, whereas if the
48481 pragma applies to a package_declaration, a subprogram_body
48482 that is not a completion (and similar things), it has to
48483 appear inside, as the first declarative_item.
48484
48485 _Static Semantics_
48486
48487 7.1/1
48488 {8652/00348652/0034} {AI95-00041-01AI95-00041-01} A library unit pragma
48489 that applies to a generic unit does not apply to its instances, unless a
48490 specific rule for the pragma specifies the contrary.
48491
48492 _Post-Compilation Rules_
48493
48494 8
48495 Certain pragmas are defined to be configuration pragmas; they shall
48496 appear before the first compilation_unit of a compilation. [They are
48497 generally used to select a partition-wide or system-wide option.] The
48498 pragma applies to all compilation_units appearing in the compilation,
48499 unless there are none, in which case it applies to all future
48500 compilation_units compiled into the same environment.
48501
48502 _Implementation Permissions_
48503
48504 9/2
48505 {AI95-00212-01AI95-00212-01} An implementation may require that
48506 configuration pragmas that select partition-wide or system-wide options
48507 be compiled when the environment contains no library_items other than
48508 those of the predefined environment. In this case, the implementation
48509 shall still accept configuration pragmas in individual compilations that
48510 confirm the initially selected partition-wide or system-wide options.
48511
48512 _Implementation Advice_
48513
48514 10/1
48515 {8652/00348652/0034} {AI95-00041-01AI95-00041-01} When applied to a
48516 generic unit, a program unit pragma that is not a library unit pragma
48517 should apply to each instance of the generic unit for which there is not
48518 an overriding pragma applied directly to the instance.
48519
48520 10.a/2
48521 Implementation Advice: When applied to a generic unit, a
48522 program unit pragma that is not a library unit pragma should
48523 apply to each instance of the generic unit for which there is
48524 not an overriding pragma applied directly to the instance.
48525
48526 _Wording Changes from Ada 95_
48527
48528 10.b/2
48529 {8652/00338652/0033} {AI95-00136-01AI95-00136-01} Corrigendum:
48530 The wording was corrected to ensure that a program unit pragma
48531 cannot appear in private parts or generic formal parts.
48532
48533 10.c/2
48534 {8652/00348652/0034} {AI95-00041-01AI95-00041-01} Corrigendum:
48535 The wording was clarified to explain the meaning of program
48536 unit and library unit pragmas in generic units.
48537
48538 10.d/2
48539 The Implementation Advice added by the Corrigendum was moved,
48540 as it was not in the normal order. (This changes the
48541 paragraph number.) It originally was directly after the new
48542 Static Semantics rule.
48543
48544 10.e/2
48545 {AI95-00212-01AI95-00212-01} The permission to place
48546 restrictions was clarified to:
48547
48548 10.f/2
48549 * Ensure that it applies only to partition-wide
48550 configuration pragmas, not ones like Assertion_Policy
48551 (see *note 11.4.2::), which can be different in different
48552 units; and
48553
48554 10.g/2
48555 * Ensure that confirming pragmas are always allowed.
48556
48557 _Wording Changes from Ada 2005_
48558
48559 10.h/3
48560 {AI05-0132-1AI05-0132-1} Correction: A library unit pragma
48561 must apply directly to a library unit, even if no name is
48562 given in the pragma.
48563
48564 \1f
48565 File: aarm2012.info, Node: 10.1.6, Prev: 10.1.5, Up: 10.1
48566
48567 10.1.6 Environment-Level Visibility Rules
48568 -----------------------------------------
48569
48570 1
48571 [The normal visibility rules do not apply within a parent_unit_name or a
48572 context_clause, nor within a pragma that appears at the place of a
48573 compilation unit. The special visibility rules for those contexts are
48574 given here.]
48575
48576 _Static Semantics_
48577
48578 2/2
48579 {AI95-00217-06AI95-00217-06} {AI95-00312-01AI95-00312-01} Within the
48580 parent_unit_name at the beginning of an explicit library_item, and
48581 within a nonlimited_with_clause, the only declarations that are visible
48582 are those that are explicit library_items of the environment, and the
48583 only declarations that are directly visible are those that are explicit
48584 root library_items of the environment. Within a limited_with_clause,
48585 the only declarations that are visible are those that are the implicit
48586 declaration of the limited view of a library package of the environment,
48587 and the only declarations that are directly visible are those that are
48588 the implicit declaration of the limited view of a root library package.
48589
48590 2.a
48591 Ramification: In "package P.Q.R is ... end P.Q.R;", this rule
48592 requires P to be a root library unit, and Q to be a library
48593 unit (because those are the things that are directly visible
48594 and visible). Note that visibility does not apply between the
48595 "end" and the ";".
48596
48597 2.b
48598 Physically nested declarations are not visible at these
48599 places.
48600
48601 2.c
48602 Although Standard is visible at these places, it is impossible
48603 to name it, since it is not directly visible, and it has no
48604 parent.
48605
48606 2.c.1/2
48607 {AI95-00217-06AI95-00217-06} Only compilation units defining
48608 limited views can be mentioned in a limited_with_clause, while
48609 only compilation units defining full views (that is, the
48610 explicit declarations) can be mentioned in a
48611 nonlimited_with_clause. This resolves the conflict inherent
48612 in having two compilation units with the same defining name.
48613
48614 2.d/2
48615 This paragraph was deleted.{AI95-00312-01AI95-00312-01}
48616
48617 3
48618 Within a use_clause or pragma that is within a context_clause, each
48619 library_item mentioned in a previous with_clause of the same
48620 context_clause is visible, and each root library_item so mentioned is
48621 directly visible. In addition, within such a use_clause, if a given
48622 declaration is visible or directly visible, each declaration that occurs
48623 immediately within the given declaration's visible part is also visible.
48624 No other declarations are visible or directly visible.
48625
48626 3.a
48627 Discussion: Note the word "same". For example, if a
48628 with_clause on a declaration mentions X, this does not make X
48629 visible in use_clauses and pragmas that are on the body. The
48630 reason for this rule is the one-pass context_clauses Language
48631 Design Principle.
48632
48633 3.b
48634 Note that the second part of the rule does not mention
48635 pragmas.
48636
48637 4
48638 Within the parent_unit_name of a subunit, library_items are visible as
48639 they are in the parent_unit_name of a library_item; in addition, the
48640 declaration corresponding to each body_stub in the environment is also
48641 visible.
48642
48643 4.a
48644 Ramification: For a subprogram without a separate
48645 subprogram_declaration, the body_stub itself is the
48646 declaration.
48647
48648 5
48649 Within a pragma that appears at the place of a compilation unit, the
48650 immediately preceding library_item and each of its ancestors is visible.
48651 The ancestor root library_item is directly visible.
48652
48653 6/2
48654 {AI95-00312-01AI95-00312-01} Notwithstanding the rules of *note 4.1.3::,
48655 an expanded name in a with_clause, a pragma in a context_clause, or a
48656 pragma that appears at the place of a compilation unit may consist of a
48657 prefix that denotes a generic package and a selector_name that denotes a
48658 child of that generic package. [(The child is necessarily a generic
48659 unit; see *note 10.1.1::.)]
48660
48661 6.a/2
48662 Reason: This rule allows with A.B; and pragma Elaborate(A.B);
48663 where A is a generic library package and B is one of its
48664 (generic) children. This is necessary because it is not
48665 normally legal to use an expanded name to reach inside a
48666 generic package.
48667
48668 _Wording Changes from Ada 83_
48669
48670 6.b
48671 The special visibility rules that apply within a
48672 parent_unit_name or a context_clause, and within a pragma that
48673 appears at the place of a compilation_unit are clarified.
48674
48675 6.c
48676 Note that a context_clause is not part of any declarative
48677 region.
48678
48679 6.d
48680 We considered making the visibility rules within
48681 parent_unit_names and context_clauses follow from the context
48682 of compilation. However, this attempt failed for various
48683 reasons. For example, it would require use_clauses in
48684 context_clauses to be within the declarative region of
48685 Standard, which sounds suspiciously like a kludge. And we
48686 would still need a special rule to prevent seeing things (in
48687 our own context_clause) that were with-ed by our parent, etc.
48688
48689 _Wording Changes from Ada 95_
48690
48691 6.e/2
48692 {AI95-00217-06AI95-00217-06} Added separate visibility rules
48693 for limited_with_clauses; the existing rules apply only to
48694 nonlimited_with_clauses.
48695
48696 6.f/2
48697 {AI95-00312-01AI95-00312-01} Clarified that the name of a
48698 generic child unit may appear in a pragma in a context_clause.
48699
48700 \1f
48701 File: aarm2012.info, Node: 10.2, Prev: 10.1, Up: 10
48702
48703 10.2 Program Execution
48704 ======================
48705
48706 1
48707 An Ada program consists of a set of partitions[, which can execute in
48708 parallel with one another, possibly in a separate address space, and
48709 possibly on a separate computer.]
48710
48711 _Post-Compilation Rules_
48712
48713 2
48714 A partition is a program or part of a program that can be invoked from
48715 outside the Ada implementation. [For example, on many systems, a
48716 partition might be an executable file generated by the system linker.]
48717 The user can explicitly assign library units to a partition. The
48718 assignment is done in an implementation-defined manner. The compilation
48719 units included in a partition are those of the explicitly assigned
48720 library units, as well as other compilation units needed by those
48721 library units. The compilation units needed by a given compilation unit
48722 are determined as follows (unless specified otherwise via an
48723 implementation-defined pragma, or by some other implementation-defined
48724 means):
48725
48726 2.a
48727 Discussion: From a run-time point of view, an Ada 95 partition
48728 is identical to an Ada 83 program -- implementations were
48729 always allowed to provide inter-program communication
48730 mechanisms. The additional semantics of partitions is that
48731 interfaces between them can be defined to obey normal language
48732 rules (as is done in *note Annex E::, "*note Annex E::
48733 Distributed Systems"), whereas interfaces between separate
48734 programs had no particular semantics.
48735
48736 2.b
48737 Implementation defined: The manner of explicitly assigning
48738 library units to a partition.
48739
48740 2.c
48741 Implementation defined: The implementation-defined means, if
48742 any, of specifying which compilation units are needed by a
48743 given compilation unit.
48744
48745 2.d
48746 Discussion: There are no pragmas that "specify otherwise"
48747 defined by the core language. However, an implementation is
48748 allowed to provide such pragmas, and in fact *note Annex E::,
48749 "*note Annex E:: Distributed Systems" defines some pragmas
48750 whose semantics includes reducing the set of compilation units
48751 described here.
48752
48753 3
48754 * A compilation unit needs itself;
48755
48756 4
48757 * If a compilation unit is needed, then so are any compilation units
48758 upon which it depends semantically;
48759
48760 5
48761 * If a library_unit_declaration is needed, then so is any
48762 corresponding library_unit_body;
48763
48764 6/2
48765 * {AI95-00217-06AI95-00217-06} If a compilation unit with stubs is
48766 needed, then so are any corresponding subunits;
48767
48768 6.a
48769 Discussion: Note that in the environment, the stubs are
48770 replaced with the corresponding proper_bodies.
48771
48772 6.1/2
48773 * {AI95-00217-06AI95-00217-06} If the (implicit) declaration of the
48774 limited view of a library package is needed, then so is the
48775 explicit declaration of the library package.
48776
48777 6.b
48778 Discussion: Note that a child unit is not included just
48779 because its parent is included -- to include a child, mention
48780 it in a with_clause.
48781
48782 6.c/2
48783 {AI95-00217-06AI95-00217-06} A package is included in a
48784 partition even if the only reference to it is in a
48785 limited_with_clause. While this isn't strictly necessary (no
48786 objects of types imported from such a unit can be created), it
48787 ensures that all incomplete types are eventually completed,
48788 and is the least surprising option.
48789
48790 7
48791 The user can optionally designate (in an implementation-defined manner)
48792 one subprogram as the main subprogram for the partition. A main
48793 subprogram, if specified, shall be a subprogram.
48794
48795 7.a
48796 Discussion: This may seem superfluous, since it follows from
48797 the definition. But we would like to have every error message
48798 that might be generated (before run time) by an implementation
48799 correspond to some explicitly stated "shall" rule.
48800
48801 7.b
48802 Of course, this does not mean that the "shall" rules
48803 correspond one-to-one with an implementation's error messages.
48804 For example, the rule that says overload resolution "shall"
48805 succeed in producing a single interpretation would correspond
48806 to many error messages in a good implementation -- the
48807 implementation would want to explain to the user exactly why
48808 overload resolution failed. This is especially true for the
48809 syntax rules -- they are considered part of overload
48810 resolution, but in most cases, one would expect an error
48811 message based on the particular syntax rule that was violated.
48812
48813 7.c
48814 Implementation defined: The manner of designating the main
48815 subprogram of a partition.
48816
48817 7.d
48818 Ramification: An implementation cannot require the user to
48819 specify, say, all of the library units to be included. It has
48820 to support, for example, perhaps the most typical case, where
48821 the user specifies just one library unit, the main program.
48822 The implementation has to do the work of tracking down all the
48823 other ones.
48824
48825 8
48826 Each partition has an anonymous environment task[, which is an implicit
48827 outermost task whose execution elaborates the library_items of the
48828 environment declarative_part, and then calls the main subprogram, if
48829 there is one. A partition's execution is that of its tasks.]
48830
48831 8.a
48832 Ramification: An environment task has no master; all
48833 nonenvironment tasks have masters.
48834
48835 8.b
48836 An implementation is allowed to support multiple concurrent
48837 executions of the same partition.
48838
48839 9
48840 [The order of elaboration of library units is determined primarily by
48841 the elaboration dependences.] There is an elaboration dependence of a
48842 given library_item upon another if the given library_item or any of its
48843 subunits depends semantically on the other library_item. In addition,
48844 if a given library_item or any of its subunits has a pragma Elaborate or
48845 Elaborate_All that names another library unit, then there is an
48846 elaboration dependence of the given library_item upon the body of the
48847 other library unit, and, for Elaborate_All only, upon each library_item
48848 needed by the declaration of the other library unit.
48849
48850 9.a.1/2
48851 Discussion: {8652/01078652/0107} {AI95-00180-01AI95-00180-01}
48852 {AI95-00256-01AI95-00256-01} "Mentions" was used informally in
48853 the above rule; it was not intended to refer to the definition
48854 of mentions in *note 10.1.2::. It was changed to "names" to
48855 make this clear.
48856
48857 9.a
48858 See above for a definition of which library_items are "needed
48859 by" a given declaration.
48860
48861 9.b
48862 Note that elaboration dependences are among library_items,
48863 whereas the other two forms of dependence are among
48864 compilation units. Note that elaboration dependence includes
48865 semantic dependence. It's a little bit sad that pragma
48866 Elaborate_Body can't be folded into this mechanism. It
48867 follows from the definition that the elaboration dependence
48868 relationship is transitive. Note that the wording of the rule
48869 does not need to take into account a semantic dependence of a
48870 library_item or one of its subunits upon a subunit of a
48871 different library unit, because that can never happen.
48872
48873 10
48874 The environment task for a partition has the following structure:
48875
48876 11
48877 task Environment_Task;
48878
48879 12
48880 task body Environment_Task is
48881 ... (1) -- The environment declarative_part
48882 -- (that is, the sequence of library_items) goes here.
48883 begin
48884 ... (2) -- Call the main subprogram, if there is one.
48885 end Environment_Task;
48886
48887 12.a
48888 Ramification: The name of the environment task is written in
48889 italics here to indicate that this task is anonymous.
48890
48891 12.b
48892 Discussion: The model is different for a "passive partition"
48893 (see *note E.1::). Either there is no environment task, or
48894 its sequence_of_statements is an infinite loop rather than a
48895 call on a main subprogram.
48896
48897 13
48898 The environment declarative_part at (1) is a sequence of
48899 declarative_items consisting of copies of the library_items included in
48900 the partition[. The order of elaboration of library_items is the order
48901 in which they appear in the environment declarative_part]:
48902
48903 14
48904 * The order of all included library_items is such that there are no
48905 forward elaboration dependences.
48906
48907 14.a
48908 Ramification: This rule is written so that if a library_item
48909 depends on itself, we don't require it to be elaborated before
48910 itself. See AI83-00113/12. This can happen only in
48911 pathological circumstances. For example, if a library
48912 subprogram_body has no corresponding subprogram_declaration,
48913 and one of the subunits of the subprogram_body mentions the
48914 subprogram_body in a with_clause, the subprogram_body will
48915 depend on itself. For another example, if a library_unit_body
48916 applies a pragma Elaborate_All to its own declaration, then
48917 the library_unit_body will depend on itself.
48918
48919 15/3
48920 * {AI05-0229-1AI05-0229-1} Any included library_unit_declaration for
48921 which aspect Elaborate_Body is True [(including when a pragma
48922 Elaborate_Body applies)] is immediately followed by its
48923 library_unit_body, if included.
48924
48925 15.a
48926 Discussion: This implies that the body of such a library unit
48927 shall not "with" any of its own children, or anything else
48928 that depends semantically upon the declaration of the library
48929 unit.
48930
48931 15.b/3
48932 Proof: {AI05-0229-1AI05-0229-1} Pragma Elaborate_Body sets
48933 aspect Elaborate_Body, see *note 10.2.1::.
48934
48935 16
48936 * All library_items declared pure occur before any that are not
48937 declared pure.
48938
48939 17
48940 * All preelaborated library_items occur before any that are not
48941 preelaborated.
48942
48943 17.a
48944 Discussion: Normally, if two partitions contain the same
48945 compilation unit, they each contain a separate copy of that
48946 compilation unit. See *note Annex E::, "*note Annex E::
48947 Distributed Systems" for cases where two partitions share the
48948 same copy of something.
48949
48950 17.b
48951 There is no requirement that the main subprogram be elaborated
48952 last. In fact, it is possible to write a partition in which
48953 the main subprogram cannot be elaborated last.
48954
48955 17.c
48956 Ramification: This declarative_part has the properties
48957 required of all environments (see *note 10.1.4::). However,
48958 the environment declarative_part of a partition will typically
48959 contain fewer compilation units than the environment
48960 declarative_part used at compile time -- only the "needed"
48961 ones are included in the partition.
48962
48963 18
48964 There shall be a total order of the library_items that obeys the above
48965 rules. The order is otherwise implementation defined.
48966
48967 18.a
48968 Discussion: The only way to violate this rule is to have
48969 Elaborate, Elaborate_All, or Elaborate_Body pragmas that cause
48970 circular ordering requirements, thus preventing an order that
48971 has no forward elaboration dependences.
48972
48973 18.b
48974 Implementation defined: The order of elaboration of
48975 library_items.
48976
48977 18.c
48978 To be honest: Notwithstanding what the RM95 says elsewhere,
48979 each rule that requires a declaration to have a corresponding
48980 completion is considered to be a Post-Compilation Rule when
48981 the declaration is that of a library unit.
48982
48983 18.d
48984 Discussion: Such rules may be checked at "link time," for
48985 example. Rules requiring the completion to have certain
48986 properties, on the other hand, are checked at compile time of
48987 the completion.
48988
48989 19
48990 The full expanded names of the library units and subunits included in a
48991 given partition shall be distinct.
48992
48993 19.a
48994 Reason: This is a Post-Compilation Rule because making it a
48995 Legality Rule would violate the Language Design Principle
48996 labeled "legality determinable via semantic dependences."
48997
48998 20
48999 The sequence_of_statements of the environment task (see (2) above)
49000 consists of either:
49001
49002 21
49003 * A call to the main subprogram, if the partition has one. If the
49004 main subprogram has parameters, they are passed; where the actuals
49005 come from is implementation defined. What happens to the result of
49006 a main function is also implementation defined.
49007
49008 21.a
49009 Implementation defined: Parameter passing and function return
49010 for the main subprogram.
49011
49012 22
49013 or:
49014
49015 23
49016 * A null_statement, if there is no main subprogram.
49017
49018 23.a
49019 Discussion: For a passive partition, either there is no
49020 environment task, or its sequence_of_statements is an infinite
49021 loop. See *note E.1::.
49022
49023 24
49024 The mechanisms for building and running partitions are implementation
49025 defined. [These might be combined into one operation, as, for example,
49026 in dynamic linking, or "load-and-go" systems.]
49027
49028 24.a
49029 Implementation defined: The mechanisms for building and
49030 running partitions.
49031
49032 _Dynamic Semantics_
49033
49034 25
49035 The execution of a program consists of the execution of a set of
49036 partitions. Further details are implementation defined. The execution
49037 of a partition starts with the execution of its environment task, ends
49038 when the environment task terminates, and includes the executions of all
49039 tasks of the partition. [The execution of the (implicit) task_body of
49040 the environment task acts as a master for all other tasks created as
49041 part of the execution of the partition. When the environment task
49042 completes (normally or abnormally), it waits for the termination of all
49043 such tasks, and then finalizes any remaining objects of the partition.]
49044
49045 25.a
49046 Ramification: The "further details" mentioned above include,
49047 for example, program termination -- it is implementation
49048 defined. There is no need to define it here; it's entirely up
49049 to the implementation whether it wants to consider the program
49050 as a whole to exist beyond the existence of individual
49051 partitions.
49052
49053 25.b
49054 Implementation defined: The details of program execution,
49055 including program termination.
49056
49057 25.c
49058 To be honest: The execution of the partition terminates
49059 (normally or abnormally) when the environment task terminates
49060 (normally or abnormally, respectively).
49061
49062 _Bounded (Run-Time) Errors_
49063
49064 26
49065 Once the environment task has awaited the termination of all other tasks
49066 of the partition, any further attempt to create a task (during
49067 finalization) is a bounded error, and may result in the raising of
49068 Program_Error either upon creation or activation of the task. If such a
49069 task is activated, it is not specified whether the task is awaited prior
49070 to termination of the environment task.
49071
49072 _Implementation Requirements_
49073
49074 27
49075 The implementation shall ensure that all compilation units included in a
49076 partition are consistent with one another, and are legal according to
49077 the rules of the language.
49078
49079 27.a
49080 Discussion: The consistency requirement implies that a
49081 partition cannot contain two versions of the same compilation
49082 unit. That is, a partition cannot contain two different
49083 library units with the same full expanded name, nor two
49084 different bodies for the same program unit. For example,
49085 suppose we compile the following:
49086
49087 27.b
49088 package A is -- Version 1.
49089 ...
49090 end A;
49091
49092 27.c
49093 with A;
49094 package B is
49095 end B;
49096
49097 27.d
49098 package A is -- Version 2.
49099 ...
49100 end A;
49101
49102 27.e
49103 with A;
49104 package C is
49105 end C;
49106
49107 27.f
49108 It would be wrong for a partition containing B and C to
49109 contain both versions of A. Typically, the implementation
49110 would require the use of Version 2 of A, which might require
49111 the recompilation of B. Alternatively, the implementation
49112 might automatically recompile B when the partition is built.
49113 A third alternative would be an incremental compiler that,
49114 when Version 2 of A is compiled, automatically patches the
49115 object code for B to reflect the changes to A (if there are
49116 any relevant changes -- there might not be any).
49117
49118 27.g
49119 An implementation that supported fancy version management
49120 might allow the use of Version 1 in some circumstances. In no
49121 case can the implementation allow the use of both versions in
49122 the same partition (unless, of course, it can prove that the
49123 two versions are semantically identical).
49124
49125 27.h
49126 The core language says nothing about inter-partition
49127 consistency; see also *note Annex E::, "*note Annex E::
49128 Distributed Systems".
49129
49130 _Implementation Permissions_
49131
49132 28/3
49133 {AI05-0299-1AI05-0299-1} The kind of partition described in this
49134 subclause is known as an active partition. An implementation is allowed
49135 to support other kinds of partitions, with implementation-defined
49136 semantics.
49137
49138 28.a
49139 Implementation defined: The semantics of any nonactive
49140 partitions supported by the implementation.
49141
49142 28.b
49143 Discussion: *note Annex E::, "*note Annex E:: Distributed
49144 Systems" defines the concept of passive partitions; they may
49145 be thought of as a partition without an environment task, or
49146 as one with a particularly simple form of environment task,
49147 having an infinite loop rather than a call on a main
49148 subprogram as its sequence_of_statements.
49149
49150 29
49151 An implementation may restrict the kinds of subprograms it supports as
49152 main subprograms. However, an implementation is required to support all
49153 main subprograms that are public parameterless library procedures.
49154
49155 29.a
49156 Ramification: The implementation is required to support main
49157 subprograms that are procedures declared by
49158 generic_instantiations, as well as those that are children of
49159 library units other than Standard. Generic units are, of
49160 course, not allowed to be main subprograms, since they are not
49161 subprograms.
49162
49163 29.b
49164 Note that renamings are irrelevant to this rule. This rules
49165 says which subprograms (not views) have to be supported. The
49166 implementation can choose any way it wants for the user to
49167 indicate which subprogram should be the main subprogram. An
49168 implementation might allow any name of any view, including
49169 those declared by renamings. Another implementation might
49170 require it to be the original name. Another implementation
49171 still might use the name of the source file or some such
49172 thing.
49173
49174 30
49175 If the environment task completes abnormally, the implementation may
49176 abort any dependent tasks.
49177
49178 30.a
49179 Reason: If the implementation does not take advantage of this
49180 permission, the normal action takes place -- the environment
49181 task awaits those tasks.
49182
49183 30.b
49184 The possibility of aborting them is not shown in the
49185 Environment_Task code above, because there is nowhere to put
49186 an exception_handler that can handle exceptions raised in both
49187 the environment declarative_part and the main subprogram, such
49188 that the dependent tasks can be aborted. If we put an
49189 exception_handler in the body of the environment task, then it
49190 won't handle exceptions that occur during elaboration of the
49191 environment declarative_part. If we were to move those things
49192 into a nested block_statement, with the exception_handler
49193 outside that, then the block_statement would await the library
49194 tasks we are trying to abort.
49195
49196 30.c
49197 Furthermore, this is merely a permission, and is not
49198 fundamental to the model, so it is probably better to state it
49199 separately anyway.
49200
49201 30.d
49202 Note that implementations (and tools like debuggers) can have
49203 modes that provide other behaviors in addition.
49204
49205 NOTES
49206
49207 31
49208 8 An implementation may provide inter-partition communication
49209 mechanism(s) via special packages and pragmas. Standard pragmas
49210 for distribution and methods for specifying inter-partition
49211 communication are defined in *note Annex E::, "*note Annex E::
49212 Distributed Systems". If no such mechanisms are provided, then
49213 each partition is isolated from all others, and behaves as a
49214 program in and of itself.
49215
49216 31.a
49217 Ramification: Not providing such mechanisms is equivalent to
49218 disallowing multi-partition programs.
49219
49220 31.b
49221 An implementation may provide mechanisms to facilitate
49222 checking the consistency of library units elaborated in
49223 different partitions; *note Annex E::, "*note Annex E::
49224 Distributed Systems" does so.
49225
49226 32
49227 9 Partitions are not required to run in separate address spaces.
49228 For example, an implementation might support dynamic linking via
49229 the partition concept.
49230
49231 33
49232 10 An order of elaboration of library_items that is consistent
49233 with the partial ordering defined above does not always ensure that
49234 each library_unit_body is elaborated before any other compilation
49235 unit whose elaboration necessitates that the library_unit_body be
49236 already elaborated. (In particular, there is no requirement that
49237 the body of a library unit be elaborated as soon as possible after
49238 the library_unit_declaration is elaborated, unless the pragmas in
49239 subclause *note 10.2.1:: are used.)
49240
49241 34
49242 11 A partition (active or otherwise) need not have a main
49243 subprogram. In such a case, all the work done by the partition
49244 would be done by elaboration of various library_items, and by tasks
49245 created by that elaboration. Passive partitions, which cannot have
49246 main subprograms, are defined in *note Annex E::, "*note Annex E::
49247 Distributed Systems".
49248
49249 34.a
49250 Ramification: The environment task is the outermost semantic
49251 level defined by the language.
49252
49253 34.b
49254 Standard has no private part. This prevents strange
49255 implementation-dependences involving private children of
49256 Standard having visibility upon Standard's private part. It
49257 doesn't matter where the body of Standard appears in the
49258 environment, since it doesn't do anything. See *note Annex
49259 A::, "*note Annex A:: Predefined Language Environment".
49260
49261 34.c
49262 Note that elaboration dependence is carefully defined in such
49263 a way that if (say) the body of something doesn't exist yet,
49264 then there is no elaboration dependence upon the nonexistent
49265 body. (This follows from the fact that "needed by" is defined
49266 that way, and the elaboration dependences caused by a pragma
49267 Elaborate or Elaborate_All are defined in terms of "needed
49268 by".) This property allows us to use the environment concept
49269 both at compile time and at partition-construction time/run
49270 time.
49271
49272 _Extensions to Ada 83_
49273
49274 34.d
49275 The concept of partitions is new to Ada 95.
49276
49277 34.e
49278 A main subprogram is now optional. The language-defined
49279 restrictions on main subprograms are relaxed.
49280
49281 _Wording Changes from Ada 83_
49282
49283 34.f
49284 Ada 95 uses the term "main subprogram" instead of Ada 83's
49285 "main program" (which was inherited from Pascal). This is
49286 done to avoid confusion -- a main subprogram is a subprogram,
49287 not a program. The program as a whole is an entirely
49288 different thing.
49289
49290 _Wording Changes from Ada 95_
49291
49292 34.g/2
49293 {AI95-00256-01AI95-00256-01} The mistaken use of "mentions" in
49294 the elaboration dependence rule was fixed.
49295
49296 34.h/2
49297 {AI95-00217-06AI95-00217-06} The needs relationship was
49298 extended to include limited views.
49299
49300 * Menu:
49301
49302 * 10.2.1 :: Elaboration Control
49303
49304 \1f
49305 File: aarm2012.info, Node: 10.2.1, Up: 10.2
49306
49307 10.2.1 Elaboration Control
49308 --------------------------
49309
49310 1
49311 [ This subclause defines pragmas that help control the elaboration order
49312 of library_items.]
49313
49314 _Language Design Principles_
49315
49316 1.a
49317 The rules governing preelaboration are designed to allow it to
49318 be done largely by bulk initialization of statically allocated
49319 storage from information in a "load module" created by a
49320 linker. Some implementations may require run-time code to be
49321 executed in some cases, but we consider these cases rare
49322 enough that we need not further complicate the rules.
49323
49324 1.b
49325 It is important that programs be able to declare data
49326 structures that are link-time initialized with aggregates,
49327 string_literals, and concatenations thereof. It is important
49328 to be able to write link-time evaluated expressions involving
49329 the First, Last, and Length attributes of such data structures
49330 (including variables), because they might be initialized with
49331 positional aggregates or string_literals, and we don't want
49332 the user to have to count the elements. There is no
49333 corresponding need for accessing discriminants, since they can
49334 be initialized with a static constant, and then the constant
49335 can be referred to elsewhere. It is important to allow
49336 link-time initialized data structures involving
49337 discriminant-dependent components. It is important to be able
49338 to write link-time evaluated expressions involving pointers
49339 (both access values and addresses) to the above-mentioned data
49340 structures.
49341
49342 1.c
49343 The rules also ensure that no Elaboration_Check need be
49344 performed for calls on library-level subprograms declared
49345 within a preelaborated package. This is true also of the
49346 Elaboration_Check on task activation for library level task
49347 types declared in a preelaborated package. However, it is not
49348 true of the Elaboration_Check on instantiations.
49349
49350 1.d
49351 A static expression should never prevent a library unit from
49352 being preelaborable.
49353
49354 _Syntax_
49355
49356 2
49357 The form of a pragma Preelaborate is as follows:
49358
49359 3
49360 pragma Preelaborate[(library_unit_name)];
49361
49362 4
49363 A pragma Preelaborate is a library unit pragma.
49364
49365 4.1/2
49366 {AI95-00161-01AI95-00161-01} The form of a pragma
49367 Preelaborable_Initialization is as follows:
49368
49369 4.2/2
49370 pragma Preelaborable_Initialization(direct_name);
49371
49372 _Legality Rules_
49373
49374 5
49375 An elaborable construct is preelaborable unless its elaboration performs
49376 any of the following actions:
49377
49378 5.a
49379 Ramification: A preelaborable construct can be elaborated
49380 without using any information that is available only at run
49381 time. Note that we don't try to prevent exceptions in
49382 preelaborable constructs; if the implementation wishes to
49383 generate code to raise an exception, that's OK.
49384
49385 5.b
49386 Because there is no flow of control and there are no calls
49387 (other than to predefined subprograms), these run-time
49388 properties can actually be detected at compile time. This is
49389 necessary in order to require compile-time enforcement of the
49390 rules.
49391
49392 6
49393 * The execution of a statement other than a null_statement.
49394
49395 6.a
49396 Ramification: A preelaborable construct can contain labels and
49397 null_statements.
49398
49399 7
49400 * A call to a subprogram other than a static function.
49401
49402 8
49403 * The evaluation of a primary that is a name of an object, unless the
49404 name is a static expression, or statically denotes a discriminant
49405 of an enclosing type.
49406
49407 8.a
49408 Ramification: One can evaluate such a name, but not as a
49409 primary. For example, one can evaluate an attribute of the
49410 object. One can evaluate an attribute_reference, so long as
49411 it does not denote an object, and its prefix does not disobey
49412 any of these rules. For example, Obj'Access,
49413 Obj'Unchecked_Access, and Obj'Address are generally legal in
49414 preelaborated library units.
49415
49416 9/3
49417 * {AI95-00161-01AI95-00161-01} {AI05-0028-1AI05-0028-1} The creation
49418 of an object [(including a component)] that is initialized by
49419 default, if its type does not have preelaborable initialization.
49420 Similarly, the evaluation of an extension_aggregate (*note 4.3.2:
49421 S0111.) with an ancestor subtype_mark (*note 3.2.2: S0028.)
49422 denoting a subtype of such a type.
49423
49424 9.a
49425 Ramification: One can declare these kinds of types, but one
49426 cannot create objects of those types.
49427
49428 9.b
49429 It is also nonpreelaborable to create an object if that will
49430 cause the evaluation of a default expression that will call a
49431 user-defined function. This follows from the rule above
49432 forbidding nonnull statements.
49433
49434 9.c/2
49435 This paragraph was deleted.{AI95-00161-01AI95-00161-01}
49436
49437 10/2
49438 {AI95-00403-01AI95-00403-01} A generic body is preelaborable only if
49439 elaboration of a corresponding instance body would not perform any such
49440 actions, presuming that:
49441
49442 10.1/3
49443 * {AI95-00403-01AI95-00403-01} {AI95-0028-1AI95-0028-1} the actual
49444 for each discriminated formal derived type, formal private type, or
49445 formal private extension declared within the formal part of the
49446 generic unit is a type that does not have preelaborable
49447 initialization, unless pragma Preelaborable_Initialization has been
49448 applied to the formal type;
49449
49450 10.2/2
49451 * {AI95-00403-01AI95-00403-01} the actual for each formal type is
49452 nonstatic;
49453
49454 10.3/2
49455 * {AI95-00403-01AI95-00403-01} the actual for each formal object is
49456 nonstatic; and
49457
49458 10.4/2
49459 * {AI95-00403-01AI95-00403-01} the actual for each formal subprogram
49460 is a user-defined subprogram.
49461
49462 10.a.1/2
49463 Discussion: {AI95-00403-01AI95-00403-01} This is an
49464 "assume-the-worst" rule. The elaboration of a generic unit
49465 doesn't perform any of the actions listed above, because its
49466 sole effect is to establish that the generic can from now on
49467 be instantiated. So the elaboration of the generic itself is
49468 not the interesting part when it comes to preelaboration
49469 rules. The interesting part is what happens when you
49470 elaborate "any instantiation" of the generic. For instance,
49471 declaring an object of a limited formal private type might
49472 well start tasks, call functions, and do all sorts of
49473 nonpreelaborable things. We prevent these situations by
49474 assuming that the actual parameters are as badly behaved as
49475 possible.
49476
49477 10.a
49478 Reason: Without this rule about generics, we would have to
49479 forbid instantiations in preelaborated library units, which
49480 would significantly reduce their usefulness.
49481
49482 11/3
49483 {8652/00358652/0035} {AI95-00002-01AI95-00002-01}
49484 {AI05-0034-1AI05-0034-1} {AI05-0243-1AI05-0243-1} A pragma Preelaborate
49485 (or pragma Pure -- see below) is used to specify that a library unit is
49486 preelaborated, namely that the Preelaborate aspect of the library unit
49487 is True; all compilation units of the library unit are preelaborated.
49488 The declaration and body of a preelaborated library unit, and all
49489 subunits that are elaborated as part of elaborating the library unit,
49490 shall be preelaborable. All compilation units of a preelaborated
49491 library unit shall depend semantically only on declared pure or
49492 preelaborated library_items. In addition to the places where Legality
49493 Rules normally apply (see *note 12.3::), these rules also apply in the
49494 private part of an instance of a generic unit. [ If a library unit is
49495 preelaborated, then its declaration, if any, and body, if any, are
49496 elaborated prior to all nonpreelaborated library_items of the
49497 partition.]
49498
49499 11.a
49500 Ramification: In a generic body, we assume the worst about
49501 formal private types and extensions.
49502
49503 11.a.1/1
49504 {8652/00358652/0035} {AI95-00002-01AI95-00002-01} Subunits of
49505 a preelaborated subprogram unit do not need to be
49506 preelaborable. This is needed in order to be consistent with
49507 units nested in a subprogram body, which do not need to be
49508 preelaborable even if the subprogram is preelaborated.
49509 However, such subunits cannot depend semantically on
49510 nonpreelaborated units, which is also consistent with nested
49511 units.
49512
49513 11.b/3
49514 Aspect Description for Preelaborate: Code execution during
49515 elaboration is avoided for a given package.
49516
49517 11.1/2
49518 {AI95-00161-01AI95-00161-01} The following rules specify which entities
49519 have preelaborable initialization:
49520
49521 11.2/3
49522 * {AI05-0028-1AI05-0028-1} The partial view of a private type or
49523 private extension, a protected type without entry_declarations, a
49524 generic formal private type, or a generic formal derived type, has
49525 preelaborable initialization if and only if the pragma
49526 Preelaborable_Initialization has been applied to them. [A
49527 protected type with entry_declarations or a task type never has
49528 preelaborable initialization.]
49529
49530 11.3/2
49531 * A component (including a discriminant) of a record or protected
49532 type has preelaborable initialization if its declaration includes a
49533 default_expression whose execution does not perform any actions
49534 prohibited in preelaborable constructs as described above, or if
49535 its declaration does not include a default expression and its type
49536 has preelaborable initialization.
49537
49538 11.4/3
49539 * {AI05-0028-1AI05-0028-1} {AI05-0221-1AI05-0221-1} A derived type
49540 has preelaborable initialization if its parent type has
49541 preelaborable initialization and if the noninherited components all
49542 have preelaborable initialization. However, a controlled type with
49543 an Initialize procedure that is not a null procedure does not have
49544 preelaborable initialization.
49545
49546 11.5/2
49547 * {AI95-00161-01AI95-00161-01} {AI95-00345-01AI95-00345-01} A view of
49548 a type has preelaborable initialization if it is an elementary
49549 type, an array type whose component type has preelaborable
49550 initialization, a record type whose components all have
49551 preelaborable initialization, or an interface type.
49552
49553 11.6/2
49554 {AI95-00161-01AI95-00161-01} A pragma Preelaborable_Initialization
49555 specifies that a type has preelaborable initialization. This pragma
49556 shall appear in the visible part of a package or generic package.
49557
49558 11.7/3
49559 {AI95-00161-01AI95-00161-01} {AI95-00345-01AI95-00345-01}
49560 {AI05-0028-1AI05-0028-1} If the pragma appears in the first list of
49561 basic_declarative_items of a package_specification, then the direct_name
49562 shall denote the first subtype of a composite type, and the type shall
49563 be declared immediately within the same package as the pragma. If the
49564 pragma is applied to a private type or a private extension, the full
49565 view of the type shall have preelaborable initialization. If the pragma
49566 is applied to a protected type, the protected type shall not have
49567 entries, and each component of the protected type shall have
49568 preelaborable initialization. For any other composite type, the type
49569 shall have preelaborable initialization. In addition to the places
49570 where Legality Rules normally apply (see *note 12.3::), these rules
49571 apply also in the private part of an instance of a generic unit.
49572
49573 11.c/3
49574 Reason: {AI05-0028-1AI05-0028-1} The reason why we need the
49575 pragma for private types, private extensions, and protected
49576 types is fairly clear: the properties of the full view
49577 determine whether the type has preelaborable initialization or
49578 not; in order to preserve privacy we need a way to express on
49579 the partial view that the full view is well-behaved. The
49580 reason why we need the pragma for other composite types is
49581 more subtle: a nonnull override for Initialize might occur in
49582 the private part, even for a nonprivate type; in order to
49583 preserve privacy, we need a way to express on a type declared
49584 in a visible part that the private part does not contain any
49585 nasty override of Initialize.
49586
49587 11.8/2
49588 {AI95-00161-01AI95-00161-01} If the pragma appears in a
49589 generic_formal_part, then the direct_name shall denote a generic formal
49590 private type or a generic formal derived type declared in the same
49591 generic_formal_part as the pragma. In a generic_instantiation the
49592 corresponding actual type shall have preelaborable initialization.
49593
49594 11.d/2
49595 Ramification: Not only do protected types with
49596 entry_declarations and task types not have preelaborable
49597 initialization, but they cannot have pragma
49598 Preelaborable_Initialization applied to them.
49599
49600 _Implementation Advice_
49601
49602 12
49603 In an implementation, a type declared in a preelaborated package should
49604 have the same representation in every elaboration of a given version of
49605 the package, whether the elaborations occur in distinct executions of
49606 the same program, or in executions of distinct programs or partitions
49607 that include the given version.
49608
49609 12.a/2
49610 Implementation Advice: A type declared in a preelaborated
49611 package should have the same representation in every
49612 elaboration of a given version of the package.
49613
49614 _Syntax_
49615
49616 13
49617 The form of a pragma Pure is as follows:
49618
49619 14
49620 pragma Pure[(library_unit_name)];
49621
49622 15
49623 A pragma Pure is a library unit pragma.
49624
49625 _Static Semantics_
49626
49627 15.1/3
49628 {AI95-00366-01AI95-00366-01} {AI05-0035-1AI05-0035-1} A pure compilation
49629 unit is a preelaborable compilation unit whose elaboration does not
49630 perform any of the following actions:
49631
49632 15.2/2
49633 * the elaboration of a variable declaration;
49634
49635 15.3/2
49636 * the evaluation of an allocator of an access-to-variable type; for
49637 the purposes of this rule, the partial view of a type is presumed
49638 to have nonvisible components whose default initialization
49639 evaluates such an allocator;
49640
49641 15.a.1/3
49642 Reason: {AI05-0004-1AI05-0004-1} Such an allocator would
49643 provide a backdoor way to get a global variable into a pure
49644 unit, so it is prohibited. Most such allocators are illegal
49645 anyway, as their type is required to have Storage_Size = 0
49646 (see the next two rules). But access parameters and access
49647 discriminants don't necessarily disallow allocators. However,
49648 a call is also illegal here (by the preelaboration rules), so
49649 access parameters cannot cause trouble. So this rule is
49650 really about prohibiting allocators in discriminant
49651 constraints:
49652
49653 15.a.2/3
49654 type Rec (Acc : access Integer) is record
49655 C : Character;
49656 end record;
49657
49658 15.a.3/3
49659 Not_Const : constant Rec (Acc => new Integer'(2)); -- Illegal in a pure unit.
49660
49661 15.a/3
49662 {AI05-0004-1AI05-0004-1} The second half of the rule is needed
49663 because aggregates can specify the default initialization of a
49664 private type or extension using <> or the ancestor subtype of
49665 an extension aggregate. The subtype of a component could use
49666 an allocator to initialize an access discriminant; the type
49667 still could have a pragma Preelaborable_Initialization given.
49668 Ada 95 did not allow such private types to have preelaborable
49669 initialization, so such a default initialization could not
49670 have occurred. Thus this rule is not incompatible with Ada
49671 95.
49672
49673 15.4/3
49674 * {AI05-0035-1AI05-0035-1} the elaboration of the declaration of a
49675 nonderived named access-to-variable type unless the Storage_Size of
49676 the type has been specified by a static expression with value zero
49677 or is defined by the language to be zero;
49678
49679 15.b/2
49680 Discussion: A remote access-to-class-wide type (see *note
49681 E.2.2::) has its Storage_Size defined to be zero.
49682
49683 15.c/2
49684 Reason: {AI95-00366-01AI95-00366-01} We disallow most named
49685 access-to-object types because an allocator has a side effect;
49686 the pool constitutes variable data. We allow
49687 access-to-subprogram types because they don't have allocators.
49688 We even allow named access-to-object types if they have an
49689 empty predefined pool (they can't have a user-defined pool as
49690 System.Storage_Pools is not pure). In this case, most
49691 attempts to use an allocator are illegal, and any others (in a
49692 generic body) will raise Storage_Error.
49693
49694 15.5/3
49695 * {AI05-0035-1AI05-0035-1} the elaboration of the declaration of a
49696 nonderived named access-to-constant type for which the Storage_Size
49697 has been specified by an expression other than a static expression
49698 with value zero.
49699
49700 15.d/2
49701 Discussion: We allow access-to-constant types so long as there
49702 is no user-specified nonzero Storage_Size; if there were a
49703 user-specified nonzero Storage_Size restricting the size of
49704 the storage pool, allocators would be problematic since the
49705 package is supposedly 'stateless', and the allocated size
49706 count for the storage pool would represent state.
49707
49708 15.6/3
49709 {AI05-0035-1AI05-0035-1} A generic body is pure only if elaboration of a
49710 corresponding instance body would not perform any such actions presuming
49711 any composite formal types have nonvisible components whose default
49712 initialization evaluates an allocator of an access-to-variable type.
49713
49714 15.7/2
49715 {AI95-00366-01AI95-00366-01} The Storage_Size for an anonymous
49716 access-to-variable type declared at library level in a library unit that
49717 is declared pure is defined to be zero.
49718
49719 15.e/2
49720 Ramification: This makes allocators illegal for such types
49721 (see *note 4.8::), making a storage pool unnecessary for these
49722 types. A storage pool would represent state.
49723
49724 15.f/2
49725 Note that access discriminants and access parameters are never
49726 library-level, even when they are declared in a type or
49727 subprogram declared at library-level. That's because they
49728 have their own special accessibility rules (see *note
49729 3.10.2::).
49730
49731 _Legality Rules_
49732
49733 16/2
49734 This paragraph was deleted.{AI95-00366-01AI95-00366-01}
49735
49736 17/3
49737 {AI95-00366-01AI95-00366-01} {AI05-0034-1AI05-0034-1}
49738 {AI05-0035-1AI05-0035-1} {AI05-0243-1AI05-0243-1} A pragma Pure is used
49739 to specify that a library unit is declared pure, namely that the Pure
49740 aspect of the library unit is True; all compilation units of the library
49741 unit are declared pure. In addition, the limited view of any library
49742 package is declared pure. The declaration and body of a declared pure
49743 library unit, and all subunits that are elaborated as part of
49744 elaborating the library unit, shall be pure. All compilation units of a
49745 declared pure library unit shall depend semantically only on declared
49746 pure library_items. In addition to the places where Legality Rules
49747 normally apply (see *note 12.3::), these rules also apply in the private
49748 part of an instance of a generic unit. Furthermore, the full view of
49749 any partial view declared in the visible part of a declared pure library
49750 unit that has any available stream attributes shall support external
49751 streaming (see *note 13.13.2::).
49752
49753 17.a/3
49754 This paragraph was deleted.{AI05-0243-1AI05-0243-1}
49755
49756 17.b
49757 Discussion: A declared-pure package is useful for defining
49758 types to be shared between partitions with no common address
49759 space.
49760
49761 17.c
49762 Reason: Note that generic packages are not mentioned in the
49763 list of things that can contain variable declarations. Note
49764 that the Ada 95 rules for deferred constants make them
49765 allowable in library units that are declared pure; that isn't
49766 true of Ada 83's deferred constants.
49767
49768 17.d/2
49769 Ramification: {AI95-00366-01AI95-00366-01} Anonymous access
49770 types are allowed.
49771
49772 17.d.1/3
49773 {AI05-0243-1AI05-0243-1} A limited view is not a library unit,
49774 so any rule that starts "declared pure library unit" does not
49775 apply to a limited view. In particular, the 3rd and last
49776 sentences never apply to limited views. However, a limited
49777 view is a library_item, so rules that discuss "declared pure
49778 library_items" do include limited views.
49779
49780 17.e/2
49781 Reason: {AI95-00366-01AI95-00366-01} Ada 95 didn't allow any
49782 access types as these (including access-to-subprogram types)
49783 cause trouble for *note Annex E::, "*note Annex E::
49784 Distributed Systems", because such types allow access values
49785 in a shared passive partition to designate objects in an
49786 active partition, thus allowing inter-address space
49787 references. We decided to disallow such uses in the
49788 relatively rare cases where they cause problems, rather than
49789 making life harder for the majority of users. Types declared
49790 in a pure package can be used in remote operations only if
49791 they are externally streamable. That simply means that there
49792 is a means to transport values of the type; that's
49793 automatically true for nonlimited types that don't have an
49794 access part. The only tricky part about this is to avoid
49795 privacy leakage; that was handled by ensuring that any private
49796 types (and private extensions) declared in a pure package that
49797 have available stream attributes (which include all nonlimited
49798 types by definition) have to be externally streamable.
49799
49800 17.f/3
49801 Aspect Description for Pure: Side effects are avoided in the
49802 subprograms of a given package.
49803
49804 _Implementation Permissions_
49805
49806 18/3
49807 {AI95-00366-01AI95-00366-01} {AI05-0219-1AI05-0219-1} If a library unit
49808 is declared pure, then the implementation is permitted to omit a call on
49809 a library-level subprogram of the library unit if the results are not
49810 needed after the call. In addition, the implementation may omit a call
49811 on such a subprogram and simply reuse the results produced by an earlier
49812 call on the same subprogram, provided that none of the parameters nor
49813 any object accessible via access values from the parameters have any
49814 part that is of a type whose full type is an immutably limited type, and
49815 the addresses and values of all by-reference actual parameters, the
49816 values of all by-copy-in actual parameters, and the values of all
49817 objects accessible via access values from the parameters, are the same
49818 as they were at the earlier call. [This permission applies even if the
49819 subprogram produces other side effects when called.]
49820
49821 18.a/3
49822 Discussion: {AI95-00366-01AI95-00366-01}
49823 {AI05-0005-1AI05-0005-1} {AI05-0299-1AI05-0299-1} A
49824 declared-pure library_item has no variable state. Hence, a
49825 call on one of its (nonnested) subprograms cannot normally
49826 have side effects. Side effects are still possible via
49827 dispatching calls and via indirect calls through
49828 access-to-subprogram values. Other mechanisms that might be
49829 used to modify variable state include machine code insertions,
49830 imported subprograms, and unchecked conversion to an access
49831 type declared within the subprogram; this list is not
49832 exhaustive. Thus, the permissions described in this subclause
49833 may apply to a subprogram whose execution has side effects.
49834 The compiler may omit a call to such a subprogram even if side
49835 effects exist, so the writer of such a subprogram has to keep
49836 this in mind.
49837
49838 _Syntax_
49839
49840 19
49841 The form of a pragma Elaborate, Elaborate_All, or Elaborate_Body is
49842 as follows:
49843
49844 20
49845 pragma Elaborate(library_unit_name{, library_unit_name});
49846
49847 21
49848 pragma Elaborate_All(library_unit_name{, library_unit_name});
49849
49850 22
49851 pragma Elaborate_Body[(library_unit_name)];
49852
49853 23
49854 A pragma Elaborate or Elaborate_All is only allowed within a
49855 context_clause.
49856
49857 23.a
49858 Ramification: "Within a context_clause" allows it to be the
49859 last item in the context_clause. It can't be first, because
49860 the name has to denote something mentioned earlier.
49861
49862 24
49863 A pragma Elaborate_Body is a library unit pragma.
49864
49865 24.a
49866 Discussion: Hence, a pragma Elaborate or Elaborate_All is not
49867 elaborated, not that it makes any practical difference.
49868
49869 24.b
49870 Note that a pragma Elaborate or Elaborate_All is neither a
49871 program unit pragma, nor a library unit pragma.
49872
49873 _Legality Rules_
49874
49875 25/3
49876 {AI05-0229-1AI05-0229-1} If the aspect Elaborate_Body is True for a
49877 declaration [(including when pragma Elaborate_Body applies)], then the
49878 declaration requires a completion [(a body)].
49879
49880 25.a/3
49881 Proof: {AI05-0229-1AI05-0229-1} Pragma Elaborate_Body sets the
49882 aspect (see below).
49883
49884 25.1/2
49885 {AI95-00217-06AI95-00217-06} The library_unit_name of a pragma Elaborate
49886 or Elaborate_All shall denote a nonlimited view of a library unit.
49887
49888 25.b/2
49889 Reason: These pragmas are intended to prevent elaboration
49890 check failures. But a limited view does not make anything
49891 visible that has an elaboration check, so the pragmas cannot
49892 do anything useful. Moreover, the pragmas would probably
49893 reintroduce the circularity that the limited_with_clause was
49894 intended to break. So we make such uses illegal.
49895
49896 _Static Semantics_
49897
49898 26/3
49899 {AI05-0229-1AI05-0229-1} [A pragma Elaborate specifies that the body of
49900 the named library unit is elaborated before the current library_item. A
49901 pragma Elaborate_All specifies that each library_item that is needed by
49902 the named library unit declaration is elaborated before the current
49903 library_item.]
49904
49905 26.a
49906 Proof: The official statement of the semantics of these
49907 pragmas is given in *note 10.2::.
49908
49909 26.1/3
49910 {AI05-0229-1AI05-0229-1} A pragma Elaborate_Body sets the Elaborate_Body
49911 representation aspect of the library unit to which it applies to the
49912 value True. [If the Elaborate_Body aspect of a library unit is True,
49913 the body of the library unit is elaborated immediately after its
49914 declaration.]
49915
49916 26.a.1/3
49917 Proof: The official statement of the semantics of this aspect
49918 is given in *note 10.2::.
49919
49920 26.b
49921 Implementation Note: The presence of a pragma Elaborate_Body
49922 simplifies the removal of unnecessary Elaboration_Checks. For
49923 a subprogram declared immediately within a library unit to
49924 which a pragma Elaborate_Body applies, the only calls that can
49925 fail the Elaboration_Check are those that occur in the library
49926 unit itself, between the declaration and body of the called
49927 subprogram; if there are no such calls (which can easily be
49928 detected at compile time if there are no stubs), then no
49929 Elaboration_Checks are needed for that subprogram. The same
49930 is true for Elaboration_Checks on task activations and
49931 instantiations, and for library subprograms and generic units.
49932
49933 26.c
49934 Ramification: The fact that the unit of elaboration is the
49935 library_item means that if a subprogram_body is not a
49936 completion, it is impossible for any library_item to be
49937 elaborated between the declaration and the body of such a
49938 subprogram. Therefore, it is impossible for a call to such a
49939 subprogram to fail its Elaboration_Check.
49940
49941 26.d
49942 Discussion: The visibility rules imply that each
49943 library_unit_name of a pragma Elaborate or Elaborate_All has
49944 to denote a library unit mentioned by a previous with_clause
49945 of the same context_clause.
49946
49947 26.e/3
49948 Aspect Description for Elaborate_Body: A given package must
49949 have a body, and that body is elaborated immediately after the
49950 declaration.
49951
49952 NOTES
49953
49954 27
49955 12 A preelaborated library unit is allowed to have
49956 nonpreelaborable children.
49957
49958 27.a/1
49959 Ramification: {8652/00358652/0035}
49960 {AI95-00002-01AI95-00002-01} But generally not
49961 nonpreelaborated subunits. (Nonpreelaborated subunits of
49962 subprograms are allowed as discussed above.)
49963
49964 28
49965 13 A library unit that is declared pure is allowed to have impure
49966 children.
49967
49968 28.a/1
49969 Ramification: {8652/00358652/0035}
49970 {AI95-00002-01AI95-00002-01} But generally not impure
49971 subunits. (Impure subunits of subprograms are allowed as
49972 discussed above.)
49973
49974 28.b
49975 Ramification: Pragma Elaborate is mainly for closely related
49976 library units, such as when two package bodies 'with' each
49977 other's declarations. In such cases, Elaborate_All sometimes
49978 won't work.
49979
49980 _Extensions to Ada 83_
49981
49982 28.c
49983 The concepts of preelaborability and purity are new to Ada 95.
49984 The Elaborate_All, Elaborate_Body, Preelaborate, and Pure
49985 pragmas are new to Ada 95.
49986
49987 28.d
49988 Pragmas Elaborate are allowed to be mixed in with the other
49989 things in the context_clause -- in Ada 83, they were required
49990 to appear last.
49991
49992 _Incompatibilities With Ada 95_
49993
49994 28.e/2
49995 {AI95-00366-01AI95-00366-01} The requirement that a partial
49996 view with available stream attributes be externally streamable
49997 can cause an incompatibility in rare cases. If there is a
49998 limited tagged type declared in a pure package with available
49999 attributes, and that type is used to declare a private
50000 extension in another pure package, and the full type for the
50001 private extension has a component of an explicitly limited
50002 record type, a protected type, or a type with access
50003 discriminants, then the stream attributes will have to be
50004 user-specified in the visible part of the package. That is
50005 not a requirement for Ada 95, but this combination seems very
50006 unlikely in pure packages. Note that this cannot be an
50007 incompatibility for a nonlimited type, as all of the types
50008 that are allowed in Ada 95 that would require explicitly
50009 defined stream attributes are limited (and thus cannot be used
50010 as components in a nonlimited type).
50011
50012 28.f/2
50013 {AI95-00403-01AI95-00403-01} Amendment Correction: Added
50014 wording to cover missing cases for preelaborated generic
50015 units. This is incompatible as a preelaborated unit could
50016 have used a formal object to initialize a library-level
50017 object; that isn't allowed in Ada 2005. But such a unit
50018 wouldn't really be preelaborable, and Ada 95 compilers can
50019 reject such units (as this is a Binding Interpretation), so
50020 such units should be very rare.
50021
50022 _Extensions to Ada 95_
50023
50024 28.g/2
50025 {AI95-00161-01AI95-00161-01} Amendment Correction: The concept
50026 of preelaborable initialization and pragma
50027 Preelaborable_Initialization are new. These allow more types
50028 of objects to be created in preelaborable units, and fix holes
50029 in the old rules.
50030
50031 28.h/2
50032 {AI95-00366-01AI95-00366-01} Access-to-subprogram types and
50033 access-to-object types with a Storage_Size of 0 are allowed in
50034 pure units. The permission to omit calls was adjusted
50035 accordingly (which also fixes a hole in Ada 95, as access
50036 parameters are allowed, and changes in the values accessed by
50037 them must be taken into account).
50038
50039 _Wording Changes from Ada 95_
50040
50041 28.i/2
50042 {AI95-00002-01AI95-00002-01} Corrigendum: The wording was
50043 changed so that subunits of a preelaborated subprogram are
50044 also preelaborated.
50045
50046 28.j/2
50047 {AI95-00217-06AI95-00217-06} Disallowed pragma Elaborate and
50048 Elaborate_All for packages that are mentioned in a
50049 limited_with_clause.
50050
50051 _Incompatibilities With Ada 2005_
50052
50053 28.k/3
50054 {AI05-0028-1AI05-0028-1} Correction: Corrected a serious
50055 unintended incompatibility with Ada 95 in the new
50056 preelaboration wording -- explicit initialization of objects
50057 of types that don't have preelaborable initialization was not
50058 allowed. Ada 2012 switches back to the Ada 95 rule in these
50059 cases. This is unlikely to occur in practice, as it is
50060 unlikely that a compiler would have implemented the more
50061 restrictive rule (it would fail many ACATS tests if it did).
50062
50063 28.l/3
50064 {AI05-0035-1AI05-0035-1} Correction: Added an assume-the-worst
50065 rule for generic bodies (else they would never be checked for
50066 purity) and added the boilerplate so that the entire generic
50067 specification is rechecked. Also fixed wording to have
50068 consistent handling for subunits for Pure and Preelaborate.
50069 An Ada 95 program could have depended on marking a generic
50070 pure that was not really pure, although this would defeat the
50071 purpose of the categorization and likely cause problems with
50072 distributed programs.
50073
50074 _Extensions to Ada 2005_
50075
50076 28.m/3
50077 {AI05-0035-1AI05-0035-1} Correction: Adjusted wording so that
50078 a subunit can be pure (it is not a library_item, but it is a
50079 compilation unit).
50080
50081 28.n/3
50082 {AI05-0035-1AI05-0035-1} Correction: Adjusted wording so that
50083 the rules for access types only apply to nonderived types
50084 (derived types share their storage pool with their parent, so
50085 if the parent access type is legal, so is any derived type.)
50086
50087 28.o/3
50088 {AI05-0229-1AI05-0229-1} Elaborate_Body is now an aspect, so
50089 it can be specified by an aspect_specification -- although the
50090 pragma is still preferred by the Standard.
50091
50092 28.p/3
50093 {AI05-0243-1AI05-0243-1} Pure and Preelaborate are now
50094 aspects, so they can be specified by an aspect_specification
50095 -- although the pragmas are still preferred by the Standard.
50096
50097 _Wording Changes from Ada 2005_
50098
50099 28.q/3
50100 {AI05-0034-1AI05-0034-1} Correction: Added wording so that a
50101 limited view is always treated as pure, no matter what
50102 categorization is used for the originating unit. This was
50103 undefined in Ada 2005.
50104
50105 28.r/3
50106 {AI05-0028-1AI05-0028-1} {AI05-0221-1AI05-0221-1} Correction:
50107 Fixed minor issues with preelaborable initialization (PI):
50108 null Initialize procedures do not make a type non-PI; formal
50109 types with pragma PI can be assumed to have PI; formal
50110 extensions are assumed to not have PI; all composite types can
50111 have pragma PI (so that the possibility of hidden Initialize
50112 routines can be handled); added discriminants of a derived
50113 type are not considered in calculating PI.
50114
50115 28.s/3
50116 {AI05-0219-1AI05-0219-1} Correction: Clarified that the
50117 implementation permission to omit pure subprogram calls does
50118 not apply if any part of the parameters or any designated
50119 object has a part that is immutably limited. The old wording
50120 just said "limited type", which can change via visibility and
50121 thus isn't appropriate for dynamic semantics permissions.
50122
50123 \1f
50124 File: aarm2012.info, Node: 11, Next: 12, Prev: 10, Up: Top
50125
50126 11 Exceptions
50127 *************
50128
50129 1/3
50130 {AI05-0299-1AI05-0299-1} [This clause defines the facilities for dealing
50131 with errors or other exceptional situations that arise during program
50132 execution.] An exception represents a kind of exceptional situation; an
50133 occurrence of such a situation (at run time) is called an exception
50134 occurrence. [ To raise an exception is to abandon normal program
50135 execution so as to draw attention to the fact that the corresponding
50136 situation has arisen. Performing some actions in response to the
50137 arising of an exception is called handling the exception. ]
50138
50139 1.a
50140 To be honest: ...or handling the exception occurrence.
50141
50142 1.b
50143 Ramification: For example, an exception End_Error might
50144 represent error situations in which an attempt is made to read
50145 beyond end-of-file. During the execution of a partition,
50146 there might be numerous occurrences of this exception.
50147
50148 1.c
50149 To be honest: When the meaning is clear from the context, we
50150 sometimes use "occurrence" as a short-hand for "exception
50151 occurrence."
50152
50153 2/3
50154 {AI05-0043-1AI05-0043-1} {AI05-0258-1AI05-0258-1} [An
50155 exception_declaration declares a name for an exception. An exception
50156 can be raised explicitly (for example, by a raise_statement) or
50157 implicitly (for example, by the failure of a language-defined check).
50158 When an exception arises, control can be transferred to a user-provided
50159 exception_handler at the end of a handled_sequence_of_statements (*note
50160 11.2: S0265.), or it can be propagated to a dynamically enclosing
50161 execution.]
50162
50163 _Wording Changes from Ada 83_
50164
50165 2.a
50166 We are more explicit about the difference between an exception
50167 and an occurrence of an exception. This is necessary because
50168 we now have a type (Exception_Occurrence) that represents
50169 exception occurrences, so the program can manipulate them.
50170 Furthermore, we say that when an exception is propagated, it
50171 is the same occurrence that is being propagated (as opposed to
50172 a new occurrence of the same exception). The same issue
50173 applies to a re-raise statement. In order to understand these
50174 semantics, we have to make this distinction.
50175
50176 _Wording Changes from Ada 2005_
50177
50178 2.b/3
50179 {AI05-0043-1AI05-0043-1} Correction: Generalized the
50180 introductory description of how an exception can be raised so
50181 that it does not appear to cover all of the cases.
50182
50183 * Menu:
50184
50185 * 11.1 :: Exception Declarations
50186 * 11.2 :: Exception Handlers
50187 * 11.3 :: Raise Statements
50188 * 11.4 :: Exception Handling
50189 * 11.5 :: Suppressing Checks
50190 * 11.6 :: Exceptions and Optimization
50191
50192 \1f
50193 File: aarm2012.info, Node: 11.1, Next: 11.2, Up: 11
50194
50195 11.1 Exception Declarations
50196 ===========================
50197
50198 1
50199 An exception_declaration declares a name for an exception.
50200
50201 _Syntax_
50202
50203 2/3
50204 {AI05-0183-1AI05-0183-1} exception_declaration ::=
50205 defining_identifier_list : exception
50206 [aspect_specification];
50207
50208 _Static Semantics_
50209
50210 3
50211 Each single exception_declaration declares a name for a different
50212 exception. If a generic unit includes an exception_declaration, the
50213 exception_declarations implicitly generated by different instantiations
50214 of the generic unit refer to distinct exceptions (but all have the same
50215 defining_identifier). The particular exception denoted by an exception
50216 name is determined at compilation time and is the same regardless of how
50217 many times the exception_declaration is elaborated.
50218
50219 3.a
50220 Reason: We considered removing this requirement inside generic
50221 bodies, because it is an implementation burden for
50222 implementations that wish to share code among several
50223 instances. In the end, it was decided that it would introduce
50224 too much implementation dependence.
50225
50226 3.b
50227 Ramification: Hence, if an exception_declaration occurs in a
50228 recursive subprogram, the exception name denotes the same
50229 exception for all invocations of the recursive subprogram.
50230 The reason for this rule is that we allow an exception
50231 occurrence to propagate out of its declaration's innermost
50232 containing master; if exceptions were created by their
50233 declarations like other entities, they would presumably be
50234 destroyed upon leaving the master; we would have to do
50235 something special to prevent them from propagating to places
50236 where they no longer exist.
50237
50238 3.c
50239 Ramification: Exception identities are unique across all
50240 partitions of a program.
50241
50242 4
50243 The predefined exceptions are the ones declared in the declaration of
50244 package Standard: Constraint_Error, Program_Error, Storage_Error, and
50245 Tasking_Error[; one of them is raised when a language-defined check
50246 fails.]
50247
50248 4.a
50249 Ramification: The exceptions declared in the language-defined
50250 package IO_Exceptions, for example, are not predefined.
50251
50252 _Dynamic Semantics_
50253
50254 5
50255 The elaboration of an exception_declaration has no effect.
50256
50257 6
50258 The execution of any construct raises Storage_Error if there is
50259 insufficient storage for that execution. The amount of storage needed
50260 for the execution of constructs is unspecified.
50261
50262 6.a
50263 Ramification: Note that any execution whatsoever can raise
50264 Storage_Error. This allows much implementation freedom in
50265 storage management.
50266
50267 _Examples_
50268
50269 7
50270 Examples of user-defined exception declarations:
50271
50272 8
50273 Singular : exception;
50274 Error : exception;
50275 Overflow, Underflow : exception;
50276
50277 _Inconsistencies With Ada 83_
50278
50279 8.a
50280 The exception Numeric_Error is now defined in the Obsolescent
50281 features Annex, as a rename of Constraint_Error. All checks
50282 that raise Numeric_Error in Ada 83 instead raise
50283 Constraint_Error in Ada 95. To increase upward compatibility,
50284 we also changed the rules to allow the same exception to be
50285 named more than once by a given handler. Thus, "when
50286 Constraint_Error | Numeric_Error =>" will remain legal in Ada
50287 95, even though Constraint_Error and Numeric_Error now denote
50288 the same exception. However, it will not be legal to have
50289 separate handlers for Constraint_Error and Numeric_Error.
50290 This change is inconsistent in the rare case that an existing
50291 program explicitly raises Numeric_Error at a point where there
50292 is a handler for Constraint_Error; the exception will now be
50293 caught by that handler.
50294
50295 _Wording Changes from Ada 83_
50296
50297 8.b
50298 We explicitly define elaboration for exception_declarations.
50299
50300 _Extensions to Ada 2005_
50301
50302 8.c/3
50303 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
50304 be used in a exception_declaration. This is described in
50305 *note 13.1.1::.
50306
50307 \1f
50308 File: aarm2012.info, Node: 11.2, Next: 11.3, Prev: 11.1, Up: 11
50309
50310 11.2 Exception Handlers
50311 =======================
50312
50313 1
50314 [The response to one or more exceptions is specified by an
50315 exception_handler.]
50316
50317 _Syntax_
50318
50319 2
50320 handled_sequence_of_statements ::=
50321 sequence_of_statements
50322 [exception
50323 exception_handler
50324 {exception_handler}]
50325
50326 3
50327 exception_handler ::=
50328 when [choice_parameter_specification:] exception_choice {|
50329 exception_choice} =>
50330 sequence_of_statements
50331
50332 4
50333 choice_parameter_specification ::= defining_identifier
50334
50335 5
50336 exception_choice ::= exception_name | others
50337
50338 5.a
50339 To be honest: "Handler" is an abbreviation for
50340 "exception_handler."
50341
50342 5.b/3
50343 {AI05-0299-1AI05-0299-1} Within this clause, we sometimes
50344 abbreviate "exception_choice" to "choice."
50345
50346 _Legality Rules_
50347
50348 6
50349 A choice with an exception_name covers the named exception. A choice
50350 with others covers all exceptions not named by previous choices of the
50351 same handled_sequence_of_statements (*note 11.2: S0265.). Two choices
50352 in different exception_handlers of the same
50353 handled_sequence_of_statements (*note 11.2: S0265.) shall not cover the
50354 same exception.
50355
50356 6.a
50357 Ramification: Two exception_choices of the same
50358 exception_handler may cover the same exception. For example,
50359 given two renaming declarations in separate packages for the
50360 same exception, one may nevertheless write, for example, "when
50361 Ada.Text_IO.Data_Error | My_Seq_IO.Data_Error =>".
50362
50363 6.b
50364 An others choice even covers exceptions that are not visible
50365 at the place of the handler. Since exception raising is a
50366 dynamic activity, it is entirely possible for an others
50367 handler to handle an exception that it could not have named.
50368
50369 7
50370 A choice with others is allowed only for the last handler of a
50371 handled_sequence_of_statements and as the only choice of that handler.
50372
50373 8
50374 An exception_name of a choice shall not denote an exception declared in
50375 a generic formal package.
50376
50377 8.a
50378 Reason: This is because the compiler doesn't know the identity
50379 of such an exception, and thus can't enforce the coverage
50380 rules.
50381
50382 _Static Semantics_
50383
50384 9
50385 A choice_parameter_specification declares a choice parameter, which is a
50386 constant object of type Exception_Occurrence (see *note 11.4.1::).
50387 During the handling of an exception occurrence, the choice parameter, if
50388 any, of the handler represents the exception occurrence that is being
50389 handled.
50390
50391 _Dynamic Semantics_
50392
50393 10
50394 The execution of a handled_sequence_of_statements consists of the
50395 execution of the sequence_of_statements (*note 5.1: S0145.). [The
50396 optional handlers are used to handle any exceptions that are propagated
50397 by the sequence_of_statements (*note 5.1: S0145.).]
50398
50399 _Examples_
50400
50401 11
50402 Example of an exception handler:
50403
50404 12
50405 begin
50406 Open(File, In_File, "input.txt"); -- see *note A.8.2::
50407 exception
50408 when E : Name_Error =>
50409 Put("Cannot open input file : ");
50410 Put_Line(Exception_Message(E)); -- see *note 11.4.1::
50411 raise;
50412 end;
50413
50414 _Extensions to Ada 83_
50415
50416 12.a
50417 The syntax rule for exception_handler is modified to allow a
50418 choice_parameter_specification.
50419
50420 12.b/2
50421 {AI95-00114-01AI95-00114-01} Different exception_choices of
50422 the same exception_handler may cover the same exception. This
50423 allows for "when Numeric_Error | Constraint_Error =>" even
50424 though Numeric_Error is a rename of Constraint_Error. This
50425 also allows one to "with" two different I/O packages, and then
50426 write, for example, "when Ada.Text_IO.Data_Error |
50427 My_Seq_IO.Data_Error =>" even though these might both be
50428 renames of the same exception.
50429
50430 _Wording Changes from Ada 83_
50431
50432 12.c
50433 The syntax rule for handled_sequence_of_statements is new.
50434 These are now used in all the places where handlers are
50435 allowed. This obviates the need to explain (in Clauses 5, 6,
50436 7, and 9) what portions of the program are handled by the
50437 handlers. Note that there are more such cases in Ada 95.
50438
50439 12.d
50440 The syntax rule for choice_parameter_specification is new.
50441
50442 \1f
50443 File: aarm2012.info, Node: 11.3, Next: 11.4, Prev: 11.2, Up: 11
50444
50445 11.3 Raise Statements
50446 =====================
50447
50448 1
50449 [A raise_statement raises an exception.]
50450
50451 _Syntax_
50452
50453 2/2
50454 {AI95-00361-01AI95-00361-01} raise_statement ::= raise;
50455 | raise exception_name [with string_expression];
50456
50457 _Legality Rules_
50458
50459 3
50460 The name, if any, in a raise_statement shall denote an exception. A
50461 raise_statement with no exception_name (that is, a re-raise statement)
50462 shall be within a handler, but not within a body enclosed by that
50463 handler.
50464
50465 _Name Resolution Rules_
50466
50467 3.1/2
50468 {AI95-00361-01AI95-00361-01} The expression, if any, in a
50469 raise_statement, is expected to be of type String.
50470
50471 _Dynamic Semantics_
50472
50473 4/2
50474 {AI95-00361-01AI95-00361-01} To raise an exception is to raise a new
50475 occurrence of that exception[, as explained in *note 11.4::]. For the
50476 execution of a raise_statement with an exception_name, the named
50477 exception is raised. [If a string_expression is present, the expression
50478 is evaluated and its value is associated with the exception occurrence.]
50479 For the execution of a re-raise statement, the exception occurrence that
50480 caused transfer of control to the innermost enclosing handler is raised
50481 [again].
50482
50483 4.a.1/2
50484 Proof: {AI95-00361-01AI95-00361-01} The definition of
50485 Exceptions.Exception_Message includes a statement that the
50486 string is returned (see *note 11.4.1::). We describe the use
50487 of the string here so that we don't have an unexplained
50488 parameter in this subclause.
50489
50490 4.a
50491 Implementation Note: For a re-raise statement, the
50492 implementation does not create a new Exception_Occurrence, but
50493 instead propagates the same Exception_Occurrence value. This
50494 allows the original cause of the exception to be determined.
50495
50496 _Examples_
50497
50498 5
50499 Examples of raise statements:
50500
50501 6/2
50502 {AI95-00433-01AI95-00433-01} raise Ada.IO_Exceptions.Name_Error; -- see *note A.13::
50503 raise Queue_Error with "Buffer Full"; -- see *note 9.11::
50504
50505 7
50506 raise; -- re-raise the current exception
50507
50508 _Wording Changes from Ada 83_
50509
50510 7.a
50511 The fact that the name in a raise_statement has to denote an
50512 exception is not clear from RM83. Clearly that was the
50513 intent, since the italicized part of the syntax rules so
50514 indicate, but there was no explicit rule. RM83-1.5(11)
50515 doesn't seem to give the italicized parts of the syntax any
50516 force.
50517
50518 _Extensions to Ada 95_
50519
50520 7.b/2
50521 {AI95-00361-01AI95-00361-01} The syntax of a raise_statement
50522 is extended to include a string message. This is more
50523 convenient than calling Exceptions.Exception_Message
50524 (exception_name'Identity, string_expression), and should
50525 encourage the use of message strings when raising exceptions.
50526
50527 \1f
50528 File: aarm2012.info, Node: 11.4, Next: 11.5, Prev: 11.3, Up: 11
50529
50530 11.4 Exception Handling
50531 =======================
50532
50533 1
50534 [When an exception occurrence is raised, normal program execution is
50535 abandoned and control is transferred to an applicable exception_handler,
50536 if any. To handle an exception occurrence is to respond to the
50537 exceptional event. To propagate an exception occurrence is to raise it
50538 again in another context; that is, to fail to respond to the exceptional
50539 event in the present context.]
50540
50541 1.a
50542 Ramification: In other words, if the execution of a given
50543 construct raises an exception, but does not handle it, the
50544 exception is propagated to an enclosing execution (except in
50545 the case of a task_body).
50546
50547 1.b/1
50548 Propagation involves re-raising the same exception occurrence.
50549 For example, calling an entry of an uncallable task raises
50550 Tasking_Error; this is not propagation.
50551
50552 _Dynamic Semantics_
50553
50554 2
50555 Within a given task, if the execution of construct a is defined by this
50556 International Standard to consist (in part) of the execution of
50557 construct b, then while b is executing, the execution of a is said to
50558 dynamically enclose the execution of b. The innermost dynamically
50559 enclosing execution of a given execution is the dynamically enclosing
50560 execution that started most recently.
50561
50562 2.a
50563 To be honest: If the execution of a dynamically encloses that
50564 of b, then we also say that the execution of b is included in
50565 the execution of a.
50566
50567 2.b
50568 Ramification: Examples: The execution of an if_statement
50569 dynamically encloses the evaluation of the condition after the
50570 if (during that evaluation). (Recall that "execution"
50571 includes both "elaboration" and "evaluation", as well as other
50572 executions.) The evaluation of a function call dynamically
50573 encloses the execution of the sequence_of_statements of the
50574 function body (during that execution). Note that, due to
50575 recursion, several simultaneous executions of the same
50576 construct can be occurring at once during the execution of a
50577 particular task.
50578
50579 2.c
50580 Dynamically enclosing is not defined across task boundaries; a
50581 task's execution does not include the execution of any other
50582 tasks.
50583
50584 2.d
50585 Dynamically enclosing is only defined for executions that are
50586 occurring at a given moment in time; if an if_statement is
50587 currently executing the sequence_of_statements after then,
50588 then the evaluation of the condition is no longer dynamically
50589 enclosed by the execution of the if_statement (or anything
50590 else).
50591
50592 3
50593 When an exception occurrence is raised by the execution of a given
50594 construct, the rest of the execution of that construct is abandoned;
50595 that is, any portions of the execution that have not yet taken place are
50596 not performed. The construct is first completed, and then left, as
50597 explained in *note 7.6.1::. Then:
50598
50599 4
50600 * If the construct is a task_body, the exception does not propagate
50601 further;
50602
50603 4.a
50604 Ramification: When an exception is raised by the execution of
50605 a task_body, there is no dynamically enclosing execution, so
50606 the exception does not propagate any further. If the
50607 exception occurred during the activation of the task, then the
50608 activator raises Tasking_Error, as explained in *note 9.2::,
50609 "*note 9.2:: Task Execution - Task Activation", but we don't
50610 define that as propagation; it's a special rule. Otherwise
50611 (the exception occurred during the execution of the
50612 handled_sequence_of_statements of the task), the task silently
50613 disappears. Thus, abnormal termination of tasks is not always
50614 considered to be an error.
50615
50616 5
50617 * If the construct is the sequence_of_statements of a
50618 handled_sequence_of_statements that has a handler with a choice
50619 covering the exception, the occurrence is handled by that handler;
50620
50621 6
50622 * Otherwise, the occurrence is propagated to the innermost
50623 dynamically enclosing execution, which means that the occurrence is
50624 raised again in that context.
50625
50626 6.a
50627 To be honest: As shorthands, we refer to the propagation of an
50628 exception, and the propagation by a construct, if the
50629 execution of the construct propagates an exception occurrence.
50630
50631 7
50632 When an occurrence is handled by a given handler, the
50633 choice_parameter_specification, if any, is first elaborated, which
50634 creates the choice parameter and initializes it to the occurrence.
50635 Then, the sequence_of_statements of the handler is executed; this
50636 execution replaces the abandoned portion of the execution of the
50637 sequence_of_statements.
50638
50639 7.a/2
50640 Ramification: {AI95-00318-02AI95-00318-02} This "replacement"
50641 semantics implies that the handler can do pretty much anything
50642 the abandoned sequence could do; for example, in a function,
50643 the handler can execute a return statement that applies to the
50644 function.
50645
50646 7.b
50647 Ramification: The rules for exceptions raised in library
50648 units, main subprograms and partitions follow from the normal
50649 rules, plus the semantics of the environment task described in
50650 Clause *note 10:: (for example, the environment task of a
50651 partition elaborates library units and calls the main
50652 subprogram). If an exception is propagated by the main
50653 subprogram, it is propagated to the environment task, which
50654 then terminates abnormally, causing the partition to terminate
50655 abnormally. Although abnormal termination of tasks is not
50656 necessarily an error, abnormal termination of a partition due
50657 to an exception is an error.
50658
50659 NOTES
50660
50661 8
50662 1 Note that exceptions raised in a declarative_part of a body are
50663 not handled by the handlers of the handled_sequence_of_statements
50664 (*note 11.2: S0265.) of that body.
50665
50666 * Menu:
50667
50668 * 11.4.1 :: The Package Exceptions
50669 * 11.4.2 :: Pragmas Assert and Assertion_Policy
50670 * 11.4.3 :: Example of Exception Handling
50671
50672 \1f
50673 File: aarm2012.info, Node: 11.4.1, Next: 11.4.2, Up: 11.4
50674
50675 11.4.1 The Package Exceptions
50676 -----------------------------
50677
50678 _Static Semantics_
50679
50680 1
50681 The following language-defined library package exists:
50682
50683 2/2
50684 {AI95-00362-01AI95-00362-01} {AI95-00400-01AI95-00400-01} {AI95-00438-01AI95-00438-01} with Ada.Streams;
50685 package Ada.Exceptions is
50686 pragma Preelaborate(Exceptions);
50687 type Exception_Id is private;
50688 pragma Preelaborable_Initialization(Exception_Id);
50689 Null_Id : constant Exception_Id;
50690 function Exception_Name(Id : Exception_Id) return String;
50691 function Wide_Exception_Name(Id : Exception_Id) return Wide_String;
50692 function Wide_Wide_Exception_Name(Id : Exception_Id)
50693 return Wide_Wide_String;
50694
50695 3/2
50696 {AI95-00362-01AI95-00362-01} type Exception_Occurrence is limited private;
50697 pragma Preelaborable_Initialization(Exception_Occurrence);
50698 type Exception_Occurrence_Access is access all Exception_Occurrence;
50699 Null_Occurrence : constant Exception_Occurrence;
50700
50701 4/3
50702 {AI95-00329-01AI95-00329-01} {AI05-0229-1AI05-0229-1} procedure Raise_Exception(E : in Exception_Id;
50703 Message : in String := "")
50704 with No_Return;
50705 function Exception_Message(X : Exception_Occurrence) return String;
50706 procedure Reraise_Occurrence(X : in Exception_Occurrence);
50707
50708 5/2
50709 {AI95-00400-01AI95-00400-01} function Exception_Identity(X : Exception_Occurrence)
50710 return Exception_Id;
50711 function Exception_Name(X : Exception_Occurrence) return String;
50712 -- Same as Exception_Name(Exception_Identity(X)).
50713 function Wide_Exception_Name(X : Exception_Occurrence)
50714 return Wide_String;
50715 -- Same as Wide_Exception_Name(Exception_Identity(X)).
50716 function Wide_Wide_Exception_Name(X : Exception_Occurrence)
50717 return Wide_Wide_String;
50718 -- Same as Wide_Wide_Exception_Name(Exception_Identity(X)).
50719 function Exception_Information(X : Exception_Occurrence) return String;
50720
50721 6/2
50722 {AI95-00438-01AI95-00438-01} procedure Save_Occurrence(Target : out Exception_Occurrence;
50723 Source : in Exception_Occurrence);
50724 function Save_Occurrence(Source : Exception_Occurrence)
50725 return Exception_Occurrence_Access;
50726
50727 6.1/2
50728 {AI95-00438-01AI95-00438-01} procedure Read_Exception_Occurrence
50729 (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
50730 Item : out Exception_Occurrence);
50731 procedure Write_Exception_Occurrence
50732 (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
50733 Item : in Exception_Occurrence);
50734
50735 6.2/2
50736 {AI95-00438-01AI95-00438-01} for Exception_Occurrence'Read use Read_Exception_Occurrence;
50737 for Exception_Occurrence'Write use Write_Exception_Occurrence;
50738
50739 6.3/2
50740 {AI95-00438-01AI95-00438-01} private
50741 ... -- not specified by the language
50742 end Ada.Exceptions;
50743
50744 7
50745 Each distinct exception is represented by a distinct value of type
50746 Exception_Id. Null_Id does not represent any exception, and is the
50747 default initial value of type Exception_Id. Each occurrence of an
50748 exception is represented by a value of type Exception_Occurrence.
50749 Null_Occurrence does not represent any exception occurrence, and is the
50750 default initial value of type Exception_Occurrence.
50751
50752 8/1
50753 For a prefix E that denotes an exception, the following attribute is
50754 defined:
50755
50756 9
50757 E'Identity
50758 E'Identity returns the unique identity of the exception.
50759 The type of this attribute is Exception_Id.
50760
50761 9.a
50762 Ramification: In a distributed program, the identity is unique
50763 across an entire program, not just across a single partition.
50764 Exception propagation works properly across RPC's. An
50765 exception can be propagated from one partition to another, and
50766 then back to the first, where its identity is known.
50767
50768 10/2
50769 {AI95-00361-01AI95-00361-01} Raise_Exception raises a new occurrence of
50770 the identified exception.
50771
50772 10.1/3
50773 {AI95-00361-01AI95-00361-01} {AI95-00378-01AI95-00378-01}
50774 {AI05-0043-1AI05-0043-1} {AI05-0248-1AI05-0248-1} Exception_Message
50775 returns the message associated with the given Exception_Occurrence. For
50776 an occurrence raised by a call to Raise_Exception, the message is the
50777 Message parameter passed to Raise_Exception. For the occurrence raised
50778 by a raise_statement with an exception_name and a string_expression, the
50779 message is the string_expression. For the occurrence raised by a
50780 raise_statement with an exception_name but without a string_expression,
50781 the message is a string giving implementation-defined information about
50782 the exception occurrence. For an occurrence originally raised in some
50783 other manner (including by the failure of a language-defined check), the
50784 message is an unspecified string. In all cases, Exception_Message
50785 returns a string with lower bound 1.
50786
50787 10.a
50788 Implementation defined: The information returned by
50789 Exception_Message.
50790
50791 10.a.1/3
50792 Discussion: {AI05-0043-1AI05-0043-1} There is Implementation
50793 Advice about the contents of this string for language-defined
50794 checks.
50795
50796 10.b
50797 Ramification: Given an exception E, the raise_statement:
50798
50799 10.c
50800 raise E;
50801
50802 10.d
50803 is equivalent to this call to Raise_Exception:
50804
50805 10.e
50806 Raise_Exception(E'Identity, Message => implementation-defined-string);
50807
50808 10.e.1/2
50809 {AI95-00361-01AI95-00361-01} Similarly, the raise_statement:
50810
50811 10.e.2/2
50812 raise E with "some information";
50813
50814 10.e.3/2
50815 is equivalent to this call to Raise_Exception:
50816
50817 10.e.4/2
50818 Raise_Exception(E'Identity, Message => "some information");
50819
50820 10.2/2
50821 {AI95-00361-01AI95-00361-01} Reraise_Occurrence reraises the specified
50822 exception occurrence.
50823
50824 10.f
50825 Ramification: The following handler:
50826
50827 10.g
50828 when others =>
50829 Cleanup;
50830 raise;
50831
50832 10.h
50833 is equivalent to this one:
50834
50835 10.i
50836 when X : others =>
50837 Cleanup;
50838 Reraise_Occurrence(X);
50839
50840 11
50841 Exception_Identity returns the identity of the exception of the
50842 occurrence.
50843
50844 12/2
50845 {AI95-00400-01AI95-00400-01} The Wide_Wide_Exception_Name functions
50846 return the full expanded name of the exception, in upper case, starting
50847 with a root library unit. For an exception declared immediately within
50848 package Standard, the defining_identifier (*note 3.1: S0022.) is
50849 returned. The result is implementation defined if the exception is
50850 declared within an unnamed block_statement.
50851
50852 12.a
50853 Ramification: See the Implementation Permission below.
50854
50855 12.b
50856 To be honest: This name, as well as each prefix of it, does
50857 not denote a renaming_declaration.
50858
50859 12.c/2
50860 Implementation defined: The result of
50861 Exceptions.Wide_Wide_Exception_Name for exceptions declared
50862 within an unnamed block_statement.
50863
50864 12.d
50865 Ramification: Note that we're talking about the name of the
50866 exception, not the name of the occurrence.
50867
50868 12.1/2
50869 {AI95-00400-01AI95-00400-01} The Exception_Name functions (respectively,
50870 Wide_Exception_Name) return the same sequence of graphic characters as
50871 that defined for Wide_Wide_Exception_Name, if all the graphic characters
50872 are defined in Character (respectively, Wide_Character); otherwise, the
50873 sequence of characters is implementation defined, but no shorter than
50874 that returned by Wide_Wide_Exception_Name for the same value of the
50875 argument.
50876
50877 12.e/2
50878 Implementation defined: The sequence of characters of the
50879 value returned by Exceptions.Exception_Name (respectively,
50880 Exceptions.Wide_Exception_Name) when some of the graphic
50881 characters of Exceptions.Wide_Wide_Exception_Name are not
50882 defined in Character (respectively, Wide_Character).
50883
50884 12.2/2
50885 {AI95-00378-01AI95-00378-01} {AI95-00417-01AI95-00417-01} The string
50886 returned by the Exception_Name, Wide_Exception_Name, and
50887 Wide_Wide_Exception_Name functions has lower bound 1.
50888
50889 13/2
50890 {AI95-00378-01AI95-00378-01} Exception_Information returns
50891 implementation-defined information about the exception occurrence. The
50892 returned string has lower bound 1.
50893
50894 13.a
50895 Implementation defined: The information returned by
50896 Exception_Information.
50897
50898 14/2
50899 {AI95-00241-01AI95-00241-01} {AI95-00446-01AI95-00446-01}
50900 Reraise_Occurrence has no effect in the case of Null_Occurrence.
50901 Raise_Exception and Exception_Name raise Constraint_Error for a Null_Id.
50902 Exception_Message, Exception_Name, and Exception_Information raise
50903 Constraint_Error for a Null_Occurrence. Exception_Identity applied to
50904 Null_Occurrence returns Null_Id.
50905
50906 14.a.1/2
50907 Ramification: {AI95-00241-01AI95-00241-01} Null_Occurrence can
50908 be tested for by comparing Exception_Identity(Occurrence) to
50909 Null_Id.
50910
50911 14.a.2/2
50912 Discussion: {AI95-00446-01AI95-00446-01} Raise_Exception was
50913 changed so that it always raises an exception and thus can be
50914 a No_Return procedure. A similar change was not made for
50915 Reraise_Occurrence, as doing so was determined to be a
50916 significant incompatibility. It is not unusual to pass an
50917 Exception_Occurrence to other code to delay raising it. If
50918 there was no exception, passing Null_Occurrence works fine
50919 (nothing is raised). Moreover, as there is no test for
50920 Null_Occurrence in Ada 95, this is the only way to write such
50921 code without using additional flags. Breaking this sort of
50922 code is unacceptable.
50923
50924 15
50925 The Save_Occurrence procedure copies the Source to the Target. The
50926 Save_Occurrence function uses an allocator of type
50927 Exception_Occurrence_Access to create a new object, copies the Source to
50928 this new object, and returns an access value designating this new
50929 object; [the result may be deallocated using an instance of
50930 Unchecked_Deallocation.]
50931
50932 15.a
50933 Ramification: It's OK to pass Null_Occurrence to the
50934 Save_Occurrence subprograms; they don't raise an exception,
50935 but simply save the Null_Occurrence.
50936
50937 15.1/2
50938 {AI95-00438-01AI95-00438-01} Write_Exception_Occurrence writes a
50939 representation of an exception occurrence to a stream;
50940 Read_Exception_Occurrence reconstructs an exception occurrence from a
50941 stream (including one written in a different partition).
50942
50943 15.b/2
50944 Ramification: This routines are used to define the stream
50945 attributes (see *note 13.13.2::) for Exception_Occurrence.
50946
50947 15.c/2
50948 The identity of the exception, as well as the Exception_Name
50949 and Exception_Message, have to be preserved across partitions.
50950
50951 15.d/2
50952 The string returned by Exception_Name or Exception_Message on
50953 the result of calling the Read attribute on a given stream has
50954 to be the same as the value returned by calling the
50955 corresponding function on the exception occurrence that was
50956 written into the stream with the Write attribute. The string
50957 returned by Exception_Information need not be the same, since
50958 it is implementation defined anyway.
50959
50960 15.e/2
50961 Reason: This is important for supporting writing exception
50962 occurrences to external files for post-mortem analysis, as
50963 well as propagating exceptions across remote subprogram calls
50964 in a distributed system (see *note E.4::).
50965
50966 Paragraph 16 was deleted.
50967
50968 _Implementation Permissions_
50969
50970 17
50971 An implementation of Exception_Name in a space-constrained environment
50972 may return the defining_identifier (*note 3.1: S0022.) instead of the
50973 full expanded name.
50974
50975 18
50976 The string returned by Exception_Message may be truncated (to no less
50977 than 200 characters) by the Save_Occurrence procedure [(not the
50978 function)], the Reraise_Occurrence procedure, and the re-raise
50979 statement.
50980
50981 18.a
50982 Reason: The reason for allowing truncation is to ease
50983 implementations. The reason for choosing the number 200 is
50984 that this is the minimum source line length that
50985 implementations have to support, and this feature seems
50986 vaguely related since it's usually a "one-liner". Note that
50987 an implementation is allowed to do this truncation even if it
50988 supports arbitrarily long lines.
50989
50990 _Implementation Advice_
50991
50992 19
50993 Exception_Message (by default) and Exception_Information should produce
50994 information useful for debugging. Exception_Message should be short
50995 (about one line), whereas Exception_Information can be long.
50996 Exception_Message should not include the Exception_Name.
50997 Exception_Information should include both the Exception_Name and the
50998 Exception_Message.
50999
51000 19.a.1/2
51001 Implementation Advice: Exception_Information should provide
51002 information useful for debugging, and should include the
51003 Exception_Name and Exception_Message.
51004
51005 19.a.2/2
51006 Implementation Advice: Exception_Message by default should be
51007 short, provide information useful for debugging, and should
51008 not include the Exception_Name.
51009
51010 19.a
51011 Reason: It may seem strange to define two subprograms whose
51012 semantics is implementation defined. The idea is that a
51013 program can print out debugging/error-logging information in a
51014 portable way. The program is portable in the sense that it
51015 will work in any implementation; it might print out different
51016 information, but the presumption is that the information
51017 printed out is appropriate for debugging/error analysis on
51018 that system.
51019
51020 19.b
51021 Implementation Note: As an example, Exception_Information
51022 might include information identifying the location where the
51023 exception occurred, and, for predefined exceptions, the
51024 specific kind of language-defined check that failed. There is
51025 an implementation trade-off here, between how much information
51026 is represented in an Exception_Occurrence, and how much can be
51027 passed through a re-raise.
51028
51029 19.c
51030 The string returned should be in a form suitable for printing
51031 to an error log file. This means that it might need to
51032 contain line-termination control characters with
51033 implementation-defined I/O semantics. The string should
51034 neither start nor end with a newline.
51035
51036 19.d
51037 If an implementation chooses to provide additional
51038 functionality related to exceptions and their occurrences, it
51039 should do so by providing one or more children of
51040 Ada.Exceptions.
51041
51042 19.e
51043 Note that exceptions behave as if declared at library level;
51044 there is no "natural scope" for an exception; an exception
51045 always exists. Hence, there is no harm in saving an exception
51046 occurrence in a data structure, and reraising it later. The
51047 reraise has to occur as part of the same program execution, so
51048 saving an exception occurrence in a file, reading it back in
51049 from a different program execution, and then reraising it is
51050 not required to work. This is similar to I/O of access types.
51051 Note that it is possible to use RPC to propagate exceptions
51052 across partitions.
51053
51054 19.f
51055 Here's one way to implement Exception_Occurrence in the
51056 private part of the package. Using this method, an
51057 implementation need store only the actual number of characters
51058 in exception messages. If the user always uses small
51059 messages, then exception occurrences can be small. If the
51060 user never uses messages, then exception occurrences can be
51061 smaller still:
51062
51063 19.g
51064 type Exception_Occurrence(Message_Length : Natural := 200) is
51065 limited record
51066 Id : Exception_Id;
51067 Message : String(1..Message_Length);
51068 end record;
51069
51070 19.h
51071 At the point where an exception is raised, an
51072 Exception_Occurrence can be allocated on the stack with
51073 exactly the right amount of space for the message -- none for
51074 an empty message. This is just like declaring a constrained
51075 object of the type:
51076
51077 19.i
51078 Temp : Exception_Occurrence(10); -- for a 10-character message
51079
51080 19.j
51081 After finding the appropriate handler, the stack can be cut
51082 back, and the Temp copied to the right place. This is similar
51083 to returning an unknown-sized object from a function. It is
51084 not necessary to allocate the maximum possible size for every
51085 Exception_Occurrence. If, however, the user declares an
51086 Exception_Occurrence object, the discriminant will be
51087 permanently set to 200. The Save_Occurrence procedure would
51088 then truncate the Exception_Message. Thus, nothing is lost
51089 until the user tries to save the occurrence. If the user is
51090 willing to pay the cost of heap allocation, the
51091 Save_Occurrence function can be used instead.
51092
51093 19.k
51094 Note that any arbitrary-sized implementation-defined
51095 Exception_Information can be handled in a similar way. For
51096 example, if the Exception_Occurrence includes a stack
51097 traceback, a discriminant can control the number of stack
51098 frames stored. The traceback would be truncated or entirely
51099 deleted by the Save_Occurrence procedure -- as the
51100 implementation sees fit.
51101
51102 19.l
51103 If the internal representation involves pointers to data
51104 structures that might disappear, it would behoove the
51105 implementation to implement it as a controlled type, so that
51106 assignment can either copy the data structures or else null
51107 out the pointers. Alternatively, if the data structures being
51108 pointed at are in a task control block, the implementation
51109 could keep a unique sequence number for each task, so it could
51110 tell when a task's data structures no longer exist.
51111
51112 19.m
51113 Using the above method, heap space is never allocated unless
51114 the user calls the Save_Occurrence function.
51115
51116 19.n
51117 An alternative implementation would be to store the message
51118 strings on the heap when the exception is raised. (It could
51119 be the global heap, or it could be a special heap just for
51120 this purpose -- it doesn't matter.) This representation would
51121 be used only for choice parameters. For normal user-defined
51122 exception occurrences, the Save_Occurrence procedure would
51123 copy the message string into the occurrence itself, truncating
51124 as necessary. Thus, in this implementation,
51125 Exception_Occurrence would be implemented as a variant record:
51126
51127 19.o
51128 type Exception_Occurrence_Kind is (Normal, As_Choice_Param);
51129
51130 19.p
51131 type Exception_Occurrence(Kind : Exception_Occurrence_Kind := Normal) is
51132 limited record
51133 case Kind is
51134 when Normal =>
51135 ... -- space for 200 characters
51136 when As_Choice_Param =>
51137 ... -- pointer to heap string
51138 end case;
51139 end record;
51140
51141 19.q
51142 Exception_Occurrences created by the run-time system during
51143 exception raising would be As_Choice_Param. User-declared
51144 ones would be Normal -- the user cannot see the discriminant,
51145 and so cannot set it to As_Choice_Param. The strings in the
51146 heap would be freed upon completion of the handler.
51147
51148 19.r
51149 This alternative implementation corresponds to a heap-based
51150 implementation of functions returning unknown-sized results.
51151
51152 19.s
51153 One possible implementation of Reraise_Occurrence is as
51154 follows:
51155
51156 19.t
51157 procedure Reraise_Occurrence(X : in Exception_Occurrence) is
51158 begin
51159 Raise_Exception(Identity(X), Exception_Message(X));
51160 end Reraise_Occurrence;
51161
51162 19.u
51163 However, some implementations may wish to retain more
51164 information across a re-raise -- a stack traceback, for
51165 example.
51166
51167 19.v
51168 Ramification: Note that Exception_Occurrence is a definite
51169 subtype. Hence, values of type Exception_Occurrence may be
51170 written to an error log for later analysis, or may be passed
51171 to subprograms for immediate error analysis.
51172
51173 19.w/2
51174 This paragraph was deleted.{AI95-00400-01AI95-00400-01}
51175
51176 _Extensions to Ada 83_
51177
51178 19.x
51179 The Identity attribute of exceptions is new, as is the package
51180 Exceptions.
51181
51182 _Inconsistencies With Ada 95_
51183
51184 19.y/2
51185 {AI95-00241-01AI95-00241-01} Amendment Correction:
51186 Exception_Identity of an Exception_Occurrence now is defined
51187 to return Null_Id for Null_Occurrence, rather than raising
51188 Constraint_Error. This provides a simple way to test for
51189 Null_Occurrence. We expect that programs that need
51190 Constraint_Error raised will be very rare; they can be easily
51191 fixed by explicitly testing for Null_Id or by using
51192 Exception_Name instead.
51193
51194 19.z/2
51195 {AI95-00378-01AI95-00378-01} {AI95-00417-01AI95-00417-01}
51196 Amendment Correction: We now define the lower bound of the
51197 string returned from [[Wide_]Wide_]Exception_Name,
51198 Exception_Message, and Exception_Information. This makes
51199 working with the returned string easier, and is consistent
51200 with many other string-returning functions in Ada. This is
51201 technically an inconsistency; if a program depended on some
51202 other lower bound for the string returned from one of these
51203 functions, it could fail when compiled with Ada 2005. Such
51204 code is not portable even between Ada 95 implementations, so
51205 it should be very rare.
51206
51207 19.aa/2
51208 {AI95-00446-01AI95-00446-01} Amendment Correction:
51209 Raise_Exception now raises Constraint_Error if passed Null_Id.
51210 This means that it always raises an exception, and thus we can
51211 apply pragma No_Return to it. We expect that programs that
51212 call Raise_Exception with Null_Id will be rare, and programs
51213 that do that and expect no exception to be raised will be
51214 rarer; such programs can be easily fixed by explicitly testing
51215 for Null_Id before calling Raise_Exception.
51216
51217 _Incompatibilities With Ada 95_
51218
51219 19.bb/3
51220 {AI95-00400-01AI95-00400-01} {AI95-00438-01AI95-00438-01}
51221 {AI05-0005-1AI05-0005-1} Functions Wide_Exception_Name and
51222 Wide_Wide_Exception_Name, and procedures
51223 Read_Exception_Occurrence and Write_Exception_Occurrence are
51224 added to Exceptions. If Exceptions is referenced in a
51225 use_clause, and an entity E with the same defining_identifier
51226 as a new entity in Exceptions is defined in a package that is
51227 also referenced in a use_clause, the entity E may no longer be
51228 use-visible, resulting in errors. This should be rare and is
51229 easily fixed if it does occur.
51230
51231 _Extensions to Ada 95_
51232
51233 19.cc/2
51234 {AI95-00362-01AI95-00362-01} The package Exceptions is
51235 preelaborated, and types Exception_Id and Exception_Occurrence
51236 have preelaborable initialization, allowing this package to be
51237 used in preelaborated units.
51238
51239 _Wording Changes from Ada 95_
51240
51241 19.dd/2
51242 {AI95-00361-01AI95-00361-01} The meaning of Exception_Message
51243 is reworded to reflect that the string can come from a
51244 raise_statement as well as a call of Raise_Exception.
51245
51246 19.ee/2
51247 {AI95-00400-01AI95-00400-01} Added Wide_Exception_Name and
51248 Wide_Wide_Exception_Name because identifiers can now contain
51249 characters outside of Latin-1.
51250
51251 _Wording Changes from Ada 2005_
51252
51253 19.ff/3
51254 {AI05-0043-1AI05-0043-1} Correction: Added explicit wording
51255 that the exception message for language-defined checks is
51256 unspecified. The old wording appeared inclusive, but it was
51257 not.
51258
51259 \1f
51260 File: aarm2012.info, Node: 11.4.2, Next: 11.4.3, Prev: 11.4.1, Up: 11.4
51261
51262 11.4.2 Pragmas Assert and Assertion_Policy
51263 ------------------------------------------
51264
51265 1/3
51266 {AI95-00286-01AI95-00286-01} {AI05-0274-1AI05-0274-1} Pragma Assert is
51267 used to assert the truth of a boolean expression at a point within a
51268 sequence of declarations or statements.
51269
51270 1.1/3
51271 {AI05-0274-1AI05-0274-1} Assert pragmas, subtype predicates (see *note
51272 3.2.4::), preconditions and postconditions (see *note 6.1.1::), and type
51273 invariants (see *note 7.3.2::) are collectively referred to as
51274 assertions; their boolean expressions are referred to as assertion
51275 expressions.
51276
51277 1.a.1/3
51278 Glossary entry: A predicate is an assertion that is expected
51279 to be True for all objects of a given subtype.
51280
51281 1.a.2/3
51282 Glossary entry: A precondition is an assertion that is
51283 expected to be True when a given subprogram is called.
51284
51285 1.a.3/3
51286 Glossary entry: A postcondition is an assertion that is
51287 expected to be True when a given subprogram returns normally.
51288
51289 1.a.4/3
51290 Glossary entry: A invariant is an assertion that is expected
51291 to be True for all objects of a given private type when viewed
51292 from outside the defining package.
51293
51294 1.a.5/3
51295 Glossary entry: An assertion is a boolean expression that
51296 appears in any of the following: a pragma Assert, a predicate,
51297 a precondition, a postcondition, an invariant, a constraint,
51298 or a null exclusion. An assertion is expected to be True at
51299 run time at certain specified places.
51300
51301 1.2/3
51302 {AI05-0274-1AI05-0274-1} Pragma Assertion_Policy is used to control
51303 whether assertions are to be ignored by the implementation, checked at
51304 run time, or handled in some implementation-defined manner.
51305
51306 _Syntax_
51307
51308 2/2
51309 {AI95-00286-01AI95-00286-01} The form of a pragma Assert is as
51310 follows:
51311
51312 3/2
51313 pragma Assert([Check =>] boolean_expression[, [Message =>]
51314 string_expression]);
51315
51316 4/2
51317 A pragma Assert is allowed at the place where a declarative_item or
51318 a statement is allowed.
51319
51320 5/2
51321 {AI95-00286-01AI95-00286-01} The form of a pragma Assertion_Policy
51322 is as follows:
51323
51324 6/2
51325 pragma Assertion_Policy(policy_identifier);
51326
51327 6.1/3
51328 {AI05-0290-1AI05-0290-1} pragma Assertion_Policy(
51329 assertion_aspect_mark => policy_identifier
51330 {, assertion_aspect_mark => policy_identifier});
51331
51332 7/3
51333 {AI05-0290-1AI05-0290-1} A pragma Assertion_Policy is allowed only
51334 immediately within a declarative_part, immediately within a
51335 package_specification, or as a configuration pragma.
51336
51337 _Name Resolution Rules_
51338
51339 8/2
51340 {AI95-00286-01AI95-00286-01} The expected type for the
51341 boolean_expression of a pragma Assert is any boolean type. The expected
51342 type for the string_expression of a pragma Assert is type String.
51343
51344 8.a/2
51345 Reason: We allow any boolean type to be like if_statements and
51346 other conditionals; we only allow String for the message in
51347 order to match raise_statements.
51348
51349 _Legality Rules_
51350
51351 9/3
51352 {AI95-00286-01AI95-00286-01} {AI05-0290-1AI05-0290-1} The
51353 assertion_aspect_mark of a pragma Assertion_Policy shall be one of
51354 Assert, Static_Predicate, Dynamic_Predicate, Pre, Pre'Class, Post,
51355 Post'Class, Type_Invariant, Type_Invariant'Class, or some implementation
51356 defined aspect_mark. The policy_identifier shall be either Check,
51357 Ignore, or some implementation-defined identifier.
51358
51359 9.a/3
51360 Implementation defined: Implementation-defined
51361 policy_identifiers and assertion_aspect_marks allowed in a
51362 pragma Assertion_Policy.
51363
51364 _Static Semantics_
51365
51366 10/3
51367 {AI95-00286-01AI95-00286-01} {AI05-0290-1AI05-0290-1} A pragma
51368 Assertion_Policy determines for each assertion aspect named in the
51369 pragma_argument_associations whether assertions of the given aspect are
51370 to be enforced by a run-time check. The policy_identifier Check
51371 requires that assertion expressions of the given aspect be checked that
51372 they evaluate to True at the points specified for the given aspect; the
51373 policy_identifier Ignore requires that the assertion expression not be
51374 evaluated at these points, and the run-time checks not be performed.
51375 [Note that for subtype predicate aspects (see *note 3.2.4::), even when
51376 the applicable Assertion_Policy is Ignore, the predicate will still be
51377 evaluated as part of membership tests and Valid attribute_references,
51378 and if static, will still have an effect on loop iteration over the
51379 subtype, and the selection of case_statement_alternatives and variants.]
51380
51381 10.1/3
51382 {AI05-0290-1AI05-0290-1} If no assertion_aspect_marks are specified in
51383 the pragma, the specified policy applies to all assertion aspects.
51384
51385 10.2/3
51386 {AI05-0290-1AI05-0290-1} A pragma Assertion_Policy applies to the named
51387 assertion aspects in a specific region, and applies to all assertion
51388 expressions specified in that region. A pragma Assertion_Policy given
51389 in a declarative_part or immediately within a package_specification
51390 applies from the place of the pragma to the end of the innermost
51391 enclosing declarative region. The region for a pragma Assertion_Policy
51392 given as a configuration pragma is the declarative region for the entire
51393 compilation unit (or units) to which it applies.
51394
51395 10.3/3
51396 {AI05-0290-1AI05-0290-1} If a pragma Assertion_Policy applies to a
51397 generic_instantiation, then the pragma Assertion_Policy applies to the
51398 entire instance.
51399
51400 10.a.1/3
51401 Ramification: This means that an Assertion_Policy pragma that
51402 occurs in a scope enclosing the declaration of a generic unit
51403 but not also enclosing the declaration of a given instance of
51404 that generic unit will not apply to assertion expressions
51405 occurring within the given instance.
51406
51407 10.4/3
51408 {AI05-0290-1AI05-0290-1} If multiple Assertion_Policy pragmas apply to a
51409 given construct for a given assertion aspect, the assertion policy is
51410 determined by the one in the innermost enclosing region of a pragma
51411 Assertion_Policy specifying a policy for the assertion aspect. If no
51412 such Assertion_Policy pragma exists, the policy is implementation
51413 defined.
51414
51415 10.a/2
51416 Implementation defined: The default assertion policy.
51417
51418 11/2
51419 {AI95-00286-01AI95-00286-01} The following language-defined library
51420 package exists:
51421
51422 12/2
51423 package Ada.Assertions is
51424 pragma Pure(Assertions);
51425
51426 13/2
51427 Assertion_Error : exception;
51428
51429 14/2
51430 procedure Assert(Check : in Boolean);
51431 procedure Assert(Check : in Boolean; Message : in String);
51432
51433 15/2
51434 end Ada.Assertions;
51435
51436 16/3
51437 {AI95-00286-01AI95-00286-01} {AI05-0290-1AI05-0290-1} A compilation unit
51438 containing a check for an assertion (including a pragma Assert) has a
51439 semantic dependence on the Assertions library unit.
51440
51441 17/3
51442 This paragraph was deleted.{AI95-00286-01AI95-00286-01}
51443 {AI05-0290-1AI05-0290-1}
51444
51445 _Dynamic Semantics_
51446
51447 18/3
51448 {AI95-00286-01AI95-00286-01} {AI05-0290-1AI05-0290-1} If performing
51449 checks is required by the Assert assertion policy in effect at the place
51450 of a pragma Assert, the elaboration of the pragma consists of evaluating
51451 the boolean expression, and if the result is False, evaluating the
51452 Message argument, if any, and raising the exception
51453 Assertions.Assertion_Error, with a message if the Message argument is
51454 provided.
51455
51456 19/2
51457 {AI95-00286-01AI95-00286-01} Calling the procedure Assertions.Assert
51458 without a Message parameter is equivalent to:
51459
51460 20/2
51461 if Check = False then
51462 raise Ada.Assertions.Assertion_Error;
51463 end if;
51464
51465 21/2
51466 {AI95-00286-01AI95-00286-01} Calling the procedure Assertions.Assert
51467 with a Message parameter is equivalent to:
51468
51469 22/2
51470 if Check = False then
51471 raise Ada.Assertions.Assertion_Error with Message;
51472 end if;
51473
51474 23/2
51475 {AI95-00286-01AI95-00286-01} The procedures Assertions.Assert have these
51476 effects independently of the assertion policy in effect.
51477
51478 _Bounded (Run-Time) Errors_
51479
51480 23.1/3
51481 {AI05-0274-1AI05-0274-1} It is a bounded error to invoke a potentially
51482 blocking operation (see *note 9.5.1::) during the evaluation of an
51483 assertion expression associated with a call on, or return from, a
51484 protected operation. If the bounded error is detected, Program_Error is
51485 raised. If not detected, execution proceeds normally, but if it is
51486 invoked within a protected action, it might result in deadlock or a
51487 (nested) protected action.
51488
51489 _Implementation Permissions_
51490
51491 24/2
51492 {AI95-00286-01AI95-00286-01} Assertion_Error may be declared by renaming
51493 an implementation-defined exception from another package.
51494
51495 24.a/2
51496 Reason: This permission is intended to allow implementations
51497 which had an implementation-defined Assert pragma to continue
51498 to use their originally defined exception. Without this
51499 permission, such an implementation would be incorrect, as
51500 Exception_Name would return the wrong name.
51501
51502 25/2
51503 {AI95-00286-01AI95-00286-01} Implementations may define their own
51504 assertion policies.
51505
51506 26/3
51507 {AI05-0274-1AI05-0274-1} If the result of a function call in an
51508 assertion is not needed to determine the value of the assertion
51509 expression, an implementation is permitted to omit the function call.
51510 [This permission applies even if the function has side effects.]
51511
51512 27/3
51513 {AI05-0274-1AI05-0274-1} An implementation need not allow the
51514 specification of an assertion expression if the evaluation of the
51515 expression has a side effect such that an immediate reevaluation of the
51516 expression could produce a different value. Similarly, an
51517 implementation need not allow the specification of an assertion
51518 expression that is checked as part of a call on or return from a
51519 callable entity C, if the evaluation of the expression has a side effect
51520 such that the evaluation of some other assertion expression associated
51521 with the same call of (or return from) C could produce a different value
51522 than it would if the first expression had not been evaluated.
51523
51524 27.a/3
51525 Ramification: This allows an implementation to reject such
51526 assertions. To maximize portability, assertions should not
51527 include expressions that contain these sorts of side effects.
51528
51529 27.b/3
51530 Discussion: The intended effect of the second part of the rule
51531 (the part starting with "Similarly") is that an evaluation of
51532 the involved assertion expressions (subtype predicates, type
51533 invariants, preconditions and postconditions) in any order
51534 yields identical results.
51535
51536 27.c/3
51537 The rule is intended to apply to all of the assertion
51538 expressions that are evaluated at the start of call (and
51539 similarly for the assertion expressions that are evaluated
51540 during the return from a call), but not other assertions
51541 actually given in the body, nor between the assertions checked
51542 at the start and end of the call. Specifically, a side effect
51543 that alters a variable in a function called from a
51544 precondition expression that changes the result of a
51545 postcondition expression of the same subprogram does not
51546 trigger these rules unless it also changes the value of a
51547 reevaluation of the precondition expression.
51548
51549 NOTES
51550
51551 28/2
51552 2 {AI95-00286-01AI95-00286-01} Normally, the boolean expression in
51553 a pragma Assert should not call functions that have significant
51554 side effects when the result of the expression is True, so that the
51555 particular assertion policy in effect will not affect normal
51556 operation of the program.
51557
51558 _Extensions to Ada 95_
51559
51560 28.a/2
51561 {AI95-00286-01AI95-00286-01} Pragmas Assert and
51562 Assertion_Policy, and package Assertions are new.
51563
51564 _Incompatibilities With Ada 2005_
51565
51566 28.b/3
51567 {AI05-0274-1AI05-0274-1} There now is an Implementation
51568 Permission to reject an assertion expression that calls a
51569 function that has a side effect such that an immediate
51570 reevalution of the expression could produce a different value.
51571 This means that a pragma Assert that works in Ada 2005 might
51572 be illegal in Ada 2012 in the unlikely event that the compiler
51573 detected such an error. This should be unlikely to occur in
51574 practice and it is considered a good thing, as the original
51575 expression was tricky and probably was not portable (as order
51576 of evaluation is unspecified within an expression). Moreover,
51577 no compiler is required to reject such expressions, so there
51578 is no need for any compiler to change behavior.
51579
51580 _Extensions to Ada 2005_
51581
51582 28.c/3
51583 {AI05-0290-1AI05-0290-1} Assertion_Policy pragmas are now
51584 allowed in more places and can specify behavior for invidivual
51585 kinds of assertions.
51586
51587 \1f
51588 File: aarm2012.info, Node: 11.4.3, Prev: 11.4.2, Up: 11.4
51589
51590 11.4.3 Example of Exception Handling
51591 ------------------------------------
51592
51593 _Examples_
51594
51595 1
51596 Exception handling may be used to separate the detection of an error
51597 from the response to that error:
51598
51599 2/2
51600 {AI95-00433-01AI95-00433-01} package File_System is
51601 type File_Handle is limited private;
51602
51603 3
51604 File_Not_Found : exception;
51605 procedure Open(F : in out File_Handle; Name : String);
51606 -- raises File_Not_Found if named file does not exist
51607
51608 4
51609 End_Of_File : exception;
51610 procedure Read(F : in out File_Handle; Data : out Data_Type);
51611 -- raises End_Of_File if the file is not open
51612
51613 5
51614 ...
51615 end File_System;
51616
51617 6/2
51618 {AI95-00433-01AI95-00433-01} package body File_System is
51619 procedure Open(F : in out File_Handle; Name : String) is
51620 begin
51621 if File_Exists(Name) then
51622 ...
51623 else
51624 raise File_Not_Found with "File not found: " & Name & ".";
51625 end if;
51626 end Open;
51627
51628 7
51629 procedure Read(F : in out File_Handle; Data : out Data_Type) is
51630 begin
51631 if F.Current_Position <= F.Last_Position then
51632 ...
51633 else
51634 raise End_Of_File;
51635 end if;
51636 end Read;
51637
51638 8
51639 ...
51640
51641 9
51642 end File_System;
51643
51644 10
51645 with Ada.Text_IO;
51646 with Ada.Exceptions;
51647 with File_System; use File_System;
51648 use Ada;
51649 procedure Main is
51650 begin
51651 ... -- call operations in File_System
51652 exception
51653 when End_Of_File =>
51654 Close(Some_File);
51655 when Not_Found_Error : File_Not_Found =>
51656 Text_IO.Put_Line(Exceptions.Exception_Message(Not_Found_Error));
51657 when The_Error : others =>
51658 Text_IO.Put_Line("Unknown error:");
51659 if Verbosity_Desired then
51660 Text_IO.Put_Line(Exceptions.Exception_Information(The_Error));
51661 else
51662 Text_IO.Put_Line(Exceptions.Exception_Name(The_Error));
51663 Text_IO.Put_Line(Exceptions.Exception_Message(The_Error));
51664 end if;
51665 raise;
51666 end Main;
51667
51668 11
51669 In the above example, the File_System package contains information about
51670 detecting certain exceptional situations, but it does not specify how to
51671 handle those situations. Procedure Main specifies how to handle them;
51672 other clients of File_System might have different handlers, even though
51673 the exceptional situations arise from the same basic causes.
51674
51675 _Wording Changes from Ada 83_
51676
51677 11.a/3
51678 {AI05-0299-1AI05-0299-1} The sections labeled "Exceptions
51679 Raised During ..." are subsumed by this subclause, and by
51680 parts of Clause *note 9::.
51681
51682 \1f
51683 File: aarm2012.info, Node: 11.5, Next: 11.6, Prev: 11.4, Up: 11
51684
51685 11.5 Suppressing Checks
51686 =======================
51687
51688 1/2
51689 {AI95-00224-01AI95-00224-01} Checking pragmas give instructions to an
51690 implementation on handling language-defined checks. A pragma Suppress
51691 gives permission to an implementation to omit certain language-defined
51692 checks, while a pragma Unsuppress revokes the permission to omit
51693 checks..
51694
51695 2/3
51696 {AI05-0264-1AI05-0264-1} A language-defined check (or simply, a "check")
51697 is one of the situations defined by this International Standard that
51698 requires a check to be made at run time to determine whether some
51699 condition is true. A check fails when the condition being checked is
51700 False, causing an exception to be raised.
51701
51702 2.a
51703 Discussion: All such checks are defined under "Dynamic
51704 Semantics" in clauses and subclauses throughout the standard.
51705
51706 _Syntax_
51707
51708 3/2
51709 {AI95-00224-01AI95-00224-01} The forms of checking pragmas are as
51710 follows:
51711
51712 4/2
51713 {AI95-00224-01AI95-00224-01} pragma Suppress(identifier);
51714
51715 4.1/2
51716 {AI95-00224-01AI95-00224-01} pragma Unsuppress(identifier);
51717
51718 5/2
51719 {AI95-00224-01AI95-00224-01} A checking pragma is allowed only
51720 immediately within a declarative_part, immediately within a
51721 package_specification (*note 7.1: S0191.), or as a configuration
51722 pragma.
51723
51724 _Legality Rules_
51725
51726 6/2
51727 {AI95-00224-01AI95-00224-01} The identifier shall be the name of a
51728 check.
51729
51730 7/2
51731 This paragraph was deleted.{AI95-00224-01AI95-00224-01}
51732
51733 _Static Semantics_
51734
51735 7.1/2
51736 {AI95-00224-01AI95-00224-01} A checking pragma applies to the named
51737 check in a specific region, and applies to all entities in that region.
51738 A checking pragma given in a declarative_part or immediately within a
51739 package_specification applies from the place of the pragma to the end of
51740 the innermost enclosing declarative region. The region for a checking
51741 pragma given as a configuration pragma is the declarative region for the
51742 entire compilation unit (or units) to which it applies.
51743
51744 7.2/3
51745 {AI95-00224-01AI95-00224-01} {AI05-0229-1AI05-0229-1}
51746 {AI05-0290-1AI05-0290-1} If a checking pragma applies to a
51747 generic_instantiation, then the checking pragma also applies to the
51748 entire instance.
51749
51750 7.a/3
51751 Ramification: {AI05-0290-1AI05-0290-1} This means that a
51752 Suppress pragma that occurs in a scope enclosing the
51753 declaration of a generic unit but not also enclosing the
51754 declaration of a given instance of that generic unit will not
51755 apply to constructs within the given instance.
51756
51757 8/2
51758 {AI95-00224-01AI95-00224-01} A pragma Suppress gives permission to an
51759 implementation to omit the named check (or every check in the case of
51760 All_Checks) for any entities to which it applies. If permission has
51761 been given to suppress a given check, the check is said to be
51762 suppressed.
51763
51764 8.a
51765 Ramification: A check is suppressed even if the implementation
51766 chooses not to actually generate better code. This allows the
51767 implementation to raise Program_Error, for example, if the
51768 erroneousness is detected.
51769
51770 8.1/2
51771 {AI95-00224-01AI95-00224-01} A pragma Unsuppress revokes the permission
51772 to omit the named check (or every check in the case of All_Checks) given
51773 by any pragma Suppress that applies at the point of the pragma
51774 Unsuppress. The permission is revoked for the region to which the
51775 pragma Unsuppress applies. If there is no such permission at the point
51776 of a pragma Unsuppress, then the pragma has no effect. A later pragma
51777 Suppress can renew the permission.
51778
51779 9
51780 The following are the language-defined checks:
51781
51782 10
51783 * [The following checks correspond to situations in which the
51784 exception Constraint_Error is raised upon failure.]
51785
51786 11/2
51787 {8652/00368652/0036} {AI95-00176-01AI95-00176-01}
51788 {AI95-00231-01AI95-00231-01} Access_Check
51789 [When evaluating a dereference (explicit or implicit),
51790 check that the value of the name is not null. When
51791 converting to a subtype that excludes null, check that
51792 the converted value is not null.]
51793
51794 12
51795 Discriminant_Check
51796 [Check that the discriminants of a composite value have
51797 the values imposed by a discriminant constraint. Also,
51798 when accessing a record component, check that it exists
51799 for the current discriminant values.]
51800
51801 13/2
51802 {AI95-00434-01AI95-00434-01} Division_Check
51803 [Check that the second operand is not zero for the
51804 operations /, rem and mod.]
51805
51806 14
51807 Index_Check
51808 [Check that the bounds of an array value are equal to the
51809 corresponding bounds of an index constraint. Also, when
51810 accessing a component of an array object, check for each
51811 dimension that the given index value belongs to the range
51812 defined by the bounds of the array object. Also, when
51813 accessing a slice of an array object, check that the
51814 given discrete range is compatible with the range defined
51815 by the bounds of the array object.]
51816
51817 15
51818 Length_Check
51819 [Check that two arrays have matching components, in the
51820 case of array subtype conversions, and logical operators
51821 for arrays of boolean components.]
51822
51823 16
51824 Overflow_Check
51825 [Check that a scalar value is within the base range of
51826 its type, in cases where the implementation chooses to
51827 raise an exception instead of returning the correct
51828 mathematical result.]
51829
51830 17
51831 Range_Check
51832 [Check that a scalar value satisfies a range constraint.
51833 Also, for the elaboration of a subtype_indication, check
51834 that the constraint (if present) is compatible with the
51835 subtype denoted by the subtype_mark. Also, for an
51836 aggregate, check that an index or discriminant value
51837 belongs to the corresponding subtype. Also, check that
51838 when the result of an operation yields an array, the
51839 value of each component belongs to the component
51840 subtype.]
51841
51842 18
51843 Tag_Check
51844 [Check that operand tags in a dispatching call are all
51845 equal. Check for the correct tag on tagged type
51846 conversions, for an assignment_statement, and when
51847 returning a tagged limited object from a function.]
51848
51849 19
51850 * [The following checks correspond to situations in which the
51851 exception Program_Error is raised upon failure.]
51852
51853 19.1/2
51854 {AI95-00280AI95-00280} Accessibility_Check
51855 [Check the accessibility level of an entity or view.]
51856
51857 19.2/2
51858 {AI95-00280AI95-00280} Allocation_Check
51859 [For an allocator, check that the master of any tasks to
51860 be created by the allocator is not yet completed or some
51861 dependents have not yet terminated, and that the
51862 finalization of the collection has not started.]
51863
51864 20
51865 Elaboration_Check
51866 [When a subprogram or protected entry is called, a task
51867 activation is accomplished, or a generic instantiation is
51868 elaborated, check that the body of the corresponding unit
51869 has already been elaborated.]
51870
51871 21/2
51872
51873 This paragraph was deleted.{AI95-00280AI95-00280}
51874
51875 22
51876 * [The following check corresponds to situations in which the
51877 exception Storage_Error is raised upon failure.]
51878
51879 23
51880 Storage_Check
51881 [Check that evaluation of an allocator does not require
51882 more space than is available for a storage pool. Check
51883 that the space available for a task or subprogram has not
51884 been exceeded.]
51885
51886 23.a
51887 Reason: We considered splitting this out into three
51888 categories: Pool_Check (for allocators), Stack_Check (for
51889 stack usage), and Heap_Check (for implicit use of the heap --
51890 use of the heap other than through an allocator).
51891 Storage_Check would then represent the union of these three.
51892 However, there seems to be no compelling reason to do this,
51893 given that it is not feasible to split Storage_Error.
51894
51895 24
51896 * [The following check corresponds to all situations in which any
51897 predefined exception is raised.]
51898
51899 25/3
51900 {AI05-0290-1AI05-0290-1} All_Checks
51901 Represents the union of all checks; suppressing
51902 All_Checks suppresses all checks other than those
51903 associated with assertions. In addition, an
51904 implementation is allowed (but not required) to behave as
51905 if a pragma Assertion_Policy(Ignore) applies to any
51906 region to which pragma Suppress(All_Checks) applies.
51907
51908 25.a
51909 Ramification: All_Checks includes both language-defined and
51910 implementation-defined checks.
51911
51912 25.b/3
51913 To be honest: {AI05-0005-1AI05-0005-1} There are additional
51914 checks defined in various Specialized Needs Annexes that are
51915 not listed here. Nevertheless, they are included in
51916 All_Checks and named in a Suppress pragma on implementations
51917 that support the relevant annex. Look up "check,
51918 language-defined" in the index to find the complete list.
51919
51920 25.c/3
51921 Discussion: {AI05-0290-1AI05-0290-1} We don't want to say that
51922 assertions are suppressed, because we don't want the potential
51923 failure of an assertion to cause erroneous execution (see
51924 below). Thus they are excluded from the suppression part of
51925 the above rule and then handled with an implicit Ignore
51926 policy.
51927
51928 _Erroneous Execution_
51929
51930 26
51931 If a given check has been suppressed, and the corresponding error
51932 situation occurs, the execution of the program is erroneous.
51933
51934 _Implementation Permissions_
51935
51936 27/2
51937 {AI95-00224-01AI95-00224-01} An implementation is allowed to place
51938 restrictions on checking pragmas, subject only to the requirement that
51939 pragma Unsuppress shall allow any check names supported by pragma
51940 Suppress. An implementation is allowed to add additional check names,
51941 with implementation-defined semantics. When Overflow_Check has been
51942 suppressed, an implementation may also suppress an unspecified subset of
51943 the Range_Checks.
51944
51945 27.a/2
51946 This paragraph was deleted.{AI95-00224-01AI95-00224-01}
51947
51948 27.b
51949 Implementation defined: Implementation-defined check names.
51950
51951 27.c
51952 Discussion: For Overflow_Check, the intention is that the
51953 implementation will suppress any Range_Checks that are
51954 implemented in the same manner as Overflow_Checks (unless they
51955 are free).
51956
51957 27.1/2
51958 {AI95-00224-01AI95-00224-01} An implementation may support an additional
51959 parameter on pragma Unsuppress similar to the one allowed for pragma
51960 Suppress (see *note J.10::). The meaning of such a parameter is
51961 implementation-defined.
51962
51963 27.c.1/2
51964 Implementation defined: Existence and meaning of second
51965 parameter of pragma Unsuppress.
51966
51967 _Implementation Advice_
51968
51969 28
51970 The implementation should minimize the code executed for checks that
51971 have been suppressed.
51972
51973 28.a.1/2
51974 Implementation Advice: Code executed for checks that have been
51975 suppressed should be minimized.
51976
51977 28.a
51978 Implementation Note: However, if a given check comes for free
51979 (for example, the hardware automatically performs the check in
51980 parallel with doing useful work) or nearly free (for example,
51981 the check is a tiny portion of an expensive run-time system
51982 call), the implementation should not bother to suppress the
51983 check. Similarly, if the implementation detects the failure
51984 at compile time and provides a warning message, there is no
51985 need to actually suppress the check.
51986
51987 NOTES
51988
51989 29
51990 3 There is no guarantee that a suppressed check is actually
51991 removed; hence a pragma Suppress should be used only for efficiency
51992 reasons.
51993
51994 29.1/2
51995 4 {AI95-00224-01AI95-00224-01} It is possible to give both a
51996 pragma Suppress and Unsuppress for the same check immediately
51997 within the same declarative_part. In that case, the last pragma
51998 given determines whether or not the check is suppressed.
51999 Similarly, it is possible to resuppress a check which has been
52000 unsuppressed by giving a pragma Suppress in an inner declarative
52001 region.
52002
52003 _Examples_
52004
52005 30/2
52006 {AI95-00224-01AI95-00224-01} Examples of suppressing and unsuppressing
52007 checks:
52008
52009 31/2
52010 {AI95-00224-01AI95-00224-01} pragma Suppress(Index_Check);
52011 pragma Unsuppress(Overflow_Check);
52012
52013 _Extensions to Ada 83_
52014
52015 31.a
52016 A pragma Suppress is allowed as a configuration pragma. A
52017 pragma Suppress without a name is allowed in a
52018 package_specification.
52019
52020 31.b
52021 Additional check names are added. We allow implementations to
52022 define their own checks.
52023
52024 _Wording Changes from Ada 83_
52025
52026 31.c
52027 We define the checks in a distributed manner. Therefore, the
52028 long list of what checks apply to what is merely a NOTE.
52029
52030 31.d
52031 We have removed the detailed rules about what is allowed in a
52032 pragma Suppress, and allow implementations to invent their
52033 own. The RM83 rules weren't quite right, and such a change is
52034 necessary anyway in the presence of implementation-defined
52035 checks.
52036
52037 31.e
52038 We make it clear that the difference between a Range_Check and
52039 an Overflow_Check is fuzzy. This was true in Ada 83, given
52040 RM83-11.6, but it was not clear. We considered removing
52041 Overflow_Check from the language or making it obsolescent,
52042 just as we did for Numeric_Error. However, we kept it for
52043 upward compatibility, and because it may be useful on machines
52044 where range checking costs more than overflow checking, but
52045 overflow checking still costs something. Different compilers
52046 will suppress different checks when asked to suppress
52047 Overflow_Check -- the nonuniformity in this case is not
52048 harmful, and removing it would have a serious impact on
52049 optimizers.
52050
52051 31.f
52052 Under Access_Check, dereferences cover the cases of
52053 selected_component, indexed_component, slice, and attribute
52054 that are listed in RM83, as well as the new
52055 explicit_dereference, which was included in selected_component
52056 in RM83.
52057
52058 _Extensions to Ada 95_
52059
52060 31.g/2
52061 {AI95-00224-01AI95-00224-01} Pragma Unsuppress is new.
52062
52063 31.h/2
52064 {AI95-00280-01AI95-00280-01} Allocation_Check was added to
52065 support suppressing the new check on allocators (see *note
52066 4.8::).
52067
52068 _Wording Changes from Ada 95_
52069
52070 31.i/2
52071 {8652/00368652/0036} {AI95-00176-01AI95-00176-01}
52072 {AI95-00224-01AI95-00224-01} The description of Access_Check
52073 was corrected by the Corrigendum to include the discriminant
52074 case. This change was then replaced by the more general
52075 notion of checking conversions to subtypes that exclude null
52076 in Ada 2005.
52077
52078 31.j/2
52079 {AI95-00224-01AI95-00224-01} The On parameter of pragma
52080 Suppress was moved to Annex J (see *note J.10::). This
52081 feature's effect is inherently nonportable, depending on the
52082 implementation's model of computation. Compiler surveys
52083 demonstrated this, showing that implementations vary widely in
52084 the interpretation of these parameters, even on the same
52085 target. While this is relatively harmless for Suppress (which
52086 is never required to do anything), it would be a significant
52087 problem for Unsuppress (we want the checks to be made for all
52088 implementations). By moving it, we avoid needing to define
52089 the meaning of Unsuppress with an On parameter.
52090
52091 31.k/2
52092 {AI95-00280-01AI95-00280-01} The order of the Program_Error
52093 checks was corrected to be alphabetical.
52094
52095 _Wording Changes from Ada 2005_
52096
52097 31.l/3
52098 {AI05-0290-1AI05-0290-1} The effect of a checking pragma no
52099 longer applies inside an inlined subprogram body. While this
52100 could change the behavior of a program that depends on a check
52101 being suppressed in an inlined body, such a program is
52102 erroneous and thus no behavior can be depended upon anyway.
52103 It's also likely to be very rare. We make this change so that
52104 inlining has no effect on the meaning of the subprogram body
52105 (since inlining is never requiring, this is necessary in order
52106 to be able to reason about the body), and so that assertion
52107 policies and suppress work the same way for inlining.
52108
52109 \1f
52110 File: aarm2012.info, Node: 11.6, Prev: 11.5, Up: 11
52111
52112 11.6 Exceptions and Optimization
52113 ================================
52114
52115 1/3
52116 {AI05-0299-1AI05-0299-1} [ This subclause gives permission to the
52117 implementation to perform certain "optimizations" that do not
52118 necessarily preserve the canonical semantics.]
52119
52120 _Dynamic Semantics_
52121
52122 2/3
52123 {AI05-0299-1AI05-0299-1} The rest of this International Standard
52124 (outside this subclause) defines the canonical semantics of the
52125 language. [The canonical semantics of a given (legal) program
52126 determines a set of possible external effects that can result from the
52127 execution of the program with given inputs.]
52128
52129 2.a
52130 Ramification: Note that the canonical semantics is a set of
52131 possible behaviors, since some reordering, parallelism, and
52132 nondeterminism is allowed by the canonical semantics.
52133
52134 2.b/3
52135 Discussion: {AI05-0299-1AI05-0299-1} The following parts of
52136 the canonical semantics are of particular interest to the
52137 reader of this subclause:
52138
52139 2.c
52140 * Behavior in the presence of abnormal objects and objects
52141 with invalid representations (see *note 13.9.1::).
52142
52143 2.d
52144 * Various actions that are defined to occur in an arbitrary
52145 order.
52146
52147 2.e/3
52148 * {AI05-0299-1AI05-0299-1} Behavior in the presence of a
52149 misuse of Unchecked_Deallocation, Unchecked_Access, or
52150 imported or exported entity (see Clause *note 13::).
52151
52152 3/3
52153 {AI05-0299-1AI05-0299-1} [As explained in *note 1.1.3::, "*note 1.1.3::
52154 Conformity of an Implementation with the Standard", the external effect
52155 of a program is defined in terms of its interactions with its external
52156 environment. Hence, the implementation can perform any internal actions
52157 whatsoever, in any order or in parallel, so long as the external effect
52158 of the execution of the program is one that is allowed by the canonical
52159 semantics, or by the rules of this subclause.]
52160
52161 3.a
52162 Ramification: Note that an optimization can change the
52163 external effect of the program, so long as the changed
52164 external effect is an external effect that is allowed by the
52165 semantics. Note that the canonical semantics of an erroneous
52166 execution allows any external effect whatsoever. Hence, if
52167 the implementation can prove that program execution will be
52168 erroneous in certain circumstances, there need not be any
52169 constraints on the machine code executed in those
52170 circumstances.
52171
52172 _Implementation Permissions_
52173
52174 4
52175 The following additional permissions are granted to the implementation:
52176
52177 5
52178 * An implementation need not always raise an exception when a
52179 language-defined check fails. Instead, the operation that failed
52180 the check can simply yield an undefined result. The exception need
52181 be raised by the implementation only if, in the absence of raising
52182 it, the value of this undefined result would have some effect on
52183 the external interactions of the program. In determining this, the
52184 implementation shall not presume that an undefined result has a
52185 value that belongs to its subtype, nor even to the base range of
52186 its type, if scalar. [Having removed the raise of the exception,
52187 the canonical semantics will in general allow the implementation to
52188 omit the code for the check, and some or all of the operation
52189 itself.]
52190
52191 5.a
52192 Ramification: Even without this permission, an implementation
52193 can always remove a check if it cannot possibly fail.
52194
52195 5.b
52196 Reason: We express the permission in terms of removing the
52197 raise, rather than the operation or the check, as it minimizes
52198 the disturbance to the canonical semantics (thereby
52199 simplifying reasoning). By allowing the implementation to
52200 omit the raise, it thereby does not need to "look" at what
52201 happens in the exception handler to decide whether the
52202 optimization is allowed.
52203
52204 5.c
52205 Discussion: The implementation can also omit checks if they
52206 cannot possibly fail, or if they could only fail in erroneous
52207 executions. This follows from the canonical semantics.
52208
52209 5.d
52210 Implementation Note: This permission is intended to allow
52211 normal "dead code removal" optimizations, even if some of the
52212 removed code might have failed some language-defined check.
52213 However, one may not eliminate the raise of an exception if
52214 subsequent code presumes in some way that the check succeeded.
52215 For example:
52216
52217 5.e
52218 if X * Y > Integer'Last then
52219 Put_Line("X * Y overflowed");
52220 end if;
52221 exception
52222 when others =>
52223 Put_Line("X * Y overflowed");
52224
52225 5.e.1
52226 If X*Y does overflow, you may not remove the raise of the
52227 exception if the code that does the comparison against
52228 Integer'Last presumes that it is comparing it with an in-range
52229 Integer value, and hence always yields False.
52230
52231 5.f
52232 As another example where a raise may not be eliminated:
52233
52234 5.g
52235 subtype Str10 is String(1..10);
52236 type P10 is access Str10;
52237 X : P10 := null;
52238 begin
52239 if X.all'Last = 10 then
52240 Put_Line("Oops");
52241 end if;
52242
52243 5.g.1
52244 In the above code, it would be wrong to eliminate the raise of
52245 Constraint_Error on the "X.all" (since X is null), if the code
52246 to evaluate 'Last always yields 10 by presuming that X.all
52247 belongs to the subtype Str10, without even "looking."
52248
52249 6/3
52250 * {AI05-0229-1AI05-0229-1} If an exception is raised due to the
52251 failure of a language-defined check, then upon reaching the
52252 corresponding exception_handler (or the termination of the task, if
52253 none), the external interactions that have occurred need reflect
52254 only that the exception was raised somewhere within the execution
52255 of the sequence_of_statements with the handler (or the task_body),
52256 possibly earlier (or later if the interactions are independent of
52257 the result of the checked operation) than that defined by the
52258 canonical semantics, but not within the execution of some
52259 abort-deferred operation or independent subprogram that does not
52260 dynamically enclose the execution of the construct whose check
52261 failed. An independent subprogram is one that is defined outside
52262 the library unit containing the construct whose check failed, and
52263 for which the Inline aspect is False. Any assignment that occurred
52264 outside of such abort-deferred operations or independent
52265 subprograms can be disrupted by the raising of the exception,
52266 causing the object or its parts to become abnormal, and certain
52267 subsequent uses of the object to be erroneous, as explained in
52268 *note 13.9.1::.
52269
52270 6.a
52271 Reason: We allow such variables to become abnormal so that
52272 assignments (other than to atomic variables) can be disrupted
52273 due to "imprecise" exceptions or instruction scheduling, and
52274 so that assignments can be reordered so long as the correct
52275 results are produced in the end if no language-defined checks
52276 fail.
52277
52278 6.b
52279 Ramification: If a check fails, no result dependent on the
52280 check may be incorporated in an external interaction. In
52281 other words, there is no permission to output meaningless
52282 results due to postponing a check.
52283
52284 6.c
52285 Discussion: We believe it is important to state the extra
52286 permission to reorder actions in terms of what the programmer
52287 can expect at run time, rather than in terms of what the
52288 implementation can assume, or what transformations the
52289 implementation can perform. Otherwise, how can the programmer
52290 write reliable programs?
52291
52292 6.d/3
52293 {AI05-0299-1AI05-0299-1} This subclause has two conflicting
52294 goals: to allow as much optimization as possible, and to make
52295 program execution as predictable as possible (to ease the
52296 writing of reliable programs). The rules given above
52297 represent a compromise.
52298
52299 6.e
52300 Consider the two extremes:
52301
52302 6.f/3
52303 {AI05-0299-1AI05-0299-1} The extreme conservative rule would
52304 be to delete this subclause entirely. The semantics of Ada
52305 would be the canonical semantics. This achieves the best
52306 predictability. It sounds like a disaster from the efficiency
52307 point of view, but in practice, implementations would provide
52308 modes in which less predictability but more efficiency would
52309 be achieved. Such a mode could even be the out-of-the-box
52310 mode. In practice, implementers would provide a compromise
52311 based on their customer's needs. Therefore, we view this as
52312 one viable alternative.
52313
52314 6.g
52315 The extreme liberal rule would be "the language does not
52316 specify the execution of a program once a language-defined
52317 check has failed; such execution can be unpredictable." This
52318 achieves the best efficiency. It sounds like a disaster from
52319 the predictability point of view, but in practice it might not
52320 be so bad. A user would have to assume that exception
52321 handlers for exceptions raised by language-defined checks are
52322 not portable. They would have to isolate such code (like all
52323 nonportable code), and would have to find out, for each
52324 implementation of interest, what behaviors can be expected.
52325 In practice, implementations would tend to avoid going so far
52326 as to punish their customers too much in terms of
52327 predictability.
52328
52329 6.h/3
52330 {AI05-0299-1AI05-0299-1} The most important thing about this
52331 subclause is that users understand what they can expect at run
52332 time, and implementers understand what optimizations are
52333 allowed. Any solution that makes this subclause contain rules
52334 that can interpreted in more than one way is unacceptable.
52335
52336 6.i
52337 We have chosen a compromise between the extreme conservative
52338 and extreme liberal rules. The current rule essentially
52339 allows arbitrary optimizations within a library unit and
52340 inlined subprograms reachable from it, but disallow
52341 semantics-disrupting optimizations across library units in the
52342 absence of inlined subprograms. This allows a library unit to
52343 be debugged, and then reused with some confidence that the
52344 abstraction it manages cannot be broken by bugs outside the
52345 library unit.
52346
52347 NOTES
52348
52349 7/3
52350 5 {AI05-0299-1AI05-0299-1} The permissions granted by this
52351 subclause can have an effect on the semantics of a program only if
52352 the program fails a language-defined check.
52353
52354 _Wording Changes from Ada 83_
52355
52356 7.a
52357 RM83-11.6 was unclear. It has been completely rewritten here;
52358 we hope this version is clearer. Here's what happened to each
52359 paragraph of RM83-11.6:
52360
52361 7.b
52362 * Paragraphs 1 and 2 contain no semantics; they are merely
52363 pointing out that anything goes if the canonical
52364 semantics is preserved. We have similar introductory
52365 paragraphs, but we have tried to clarify that these are
52366 not granting any "extra" permission beyond what the rest
52367 of the document allows.
52368
52369 7.c
52370 * Paragraphs 3 and 4 are reflected in the "extra permission
52371 to reorder actions". Note that this permission now
52372 allows the reordering of assignments in many cases.
52373
52374 7.d
52375 * Paragraph 5 is moved to *note 4.5::, "*note 4.5::
52376 Operators and Expression Evaluation", where operator
52377 association is discussed. Hence, this is no longer an
52378 "extra permission" but is part of the canonical
52379 semantics.
52380
52381 7.e
52382 * Paragraph 6 now follows from the general permission to
52383 store out-of-range values for unconstrained subtypes.
52384 Note that the parameters and results of all the
52385 predefined operators of a type are of the unconstrained
52386 subtype of the type.
52387
52388 7.f
52389 * Paragraph 7 is reflected in the "extra permission to
52390 avoid raising exceptions".
52391
52392 7.g/3
52393 {AI05-0299-1AI05-0299-1} We moved subclause *note 11.5::,
52394 "*note 11.5:: Suppressing Checks" from after 11.6 to before
52395 11.6, in order to preserve the famous number "11.6" (given the
52396 changes to earlier subclauses in Clause *note 11::).
52397
52398 \1f
52399 File: aarm2012.info, Node: 12, Next: 13, Prev: 11, Up: Top
52400
52401 12 Generic Units
52402 ****************
52403
52404 1
52405 A generic unit is a program unit that is either a generic subprogram or
52406 a generic package. A generic unit is a template[, which can be
52407 parameterized, and from which corresponding (nongeneric) subprograms or
52408 packages can be obtained]. The resulting program units are said to be
52409 instances of the original generic unit.
52410
52411 1.a
52412 Glossary entry: A generic unit is a template for a
52413 (nongeneric) program unit; the template can be parameterized
52414 by objects, types, subprograms, and packages. An instance of
52415 a generic unit is created by a generic_instantiation. The
52416 rules of the language are enforced when a generic unit is
52417 compiled, using a generic contract model; additional checks
52418 are performed upon instantiation to verify the contract is
52419 met. That is, the declaration of a generic unit represents a
52420 contract between the body of the generic and instances of the
52421 generic. Generic units can be used to perform the role that
52422 macros sometimes play in other languages.
52423
52424 2
52425 [A generic unit is declared by a generic_declaration. This form of
52426 declaration has a generic_formal_part (*note 12.1: S0273.) declaring any
52427 generic formal parameters. An instance of a generic unit is obtained as
52428 the result of a generic_instantiation with appropriate generic actual
52429 parameters for the generic formal parameters. An instance of a generic
52430 subprogram is a subprogram. An instance of a generic package is a
52431 package.
52432
52433 3
52434 Generic units are templates. As templates they do not have the
52435 properties that are specific to their nongeneric counterparts. For
52436 example, a generic subprogram can be instantiated but it cannot be
52437 called. In contrast, an instance of a generic subprogram is a
52438 (nongeneric) subprogram; hence, this instance can be called but it
52439 cannot be used to produce further instances.]
52440
52441 * Menu:
52442
52443 * 12.1 :: Generic Declarations
52444 * 12.2 :: Generic Bodies
52445 * 12.3 :: Generic Instantiation
52446 * 12.4 :: Formal Objects
52447 * 12.5 :: Formal Types
52448 * 12.6 :: Formal Subprograms
52449 * 12.7 :: Formal Packages
52450 * 12.8 :: Example of a Generic Package
52451
52452 \1f
52453 File: aarm2012.info, Node: 12.1, Next: 12.2, Up: 12
52454
52455 12.1 Generic Declarations
52456 =========================
52457
52458 1
52459 [A generic_declaration declares a generic unit, which is either a
52460 generic subprogram or a generic package. A generic_declaration includes
52461 a generic_formal_part declaring any generic formal parameters. A
52462 generic formal parameter can be an object; alternatively (unlike a
52463 parameter of a subprogram), it can be a type, a subprogram, or a
52464 package.]
52465
52466 _Syntax_
52467
52468 2
52469 generic_declaration ::= generic_subprogram_declaration |
52470 generic_package_declaration
52471
52472 3/3
52473 {AI05-0183-1AI05-0183-1} generic_subprogram_declaration ::=
52474 generic_formal_part subprogram_specification
52475 [aspect_specification];
52476
52477 4
52478 generic_package_declaration ::=
52479 generic_formal_part package_specification;
52480
52481 4.a/3
52482 Ramification: {AI05-0183-1AI05-0183-1} No syntax change is
52483 needed here to allow an aspect_specification; a generic
52484 package can have an aspect_specification because a
52485 package_specification allows an aspect_specification.
52486
52487 5
52488 generic_formal_part ::= generic {
52489 generic_formal_parameter_declaration | use_clause}
52490
52491 6
52492 generic_formal_parameter_declaration ::=
52493 formal_object_declaration
52494 | formal_type_declaration
52495 | formal_subprogram_declaration
52496 | formal_package_declaration
52497
52498 7
52499 The only form of subtype_indication allowed within a
52500 generic_formal_part is a subtype_mark [(that is, the
52501 subtype_indication shall not include an explicit constraint)]. The
52502 defining name of a generic subprogram shall be an identifier [(not
52503 an operator_symbol)].
52504
52505 7.a
52506 Reason: The reason for forbidding constraints in
52507 subtype_indications is that it simplifies the elaboration of
52508 generic_declarations (since there is nothing to evaluate), and
52509 that it simplifies the matching rules, and makes them more
52510 checkable at compile time.
52511
52512 _Static Semantics_
52513
52514 8/2
52515 {AI95-00434-01AI95-00434-01} A generic_declaration declares a generic
52516 unit -- a generic package, generic procedure, or generic function, as
52517 appropriate.
52518
52519 9
52520 An entity is a generic formal entity if it is declared by a
52521 generic_formal_parameter_declaration. "Generic formal," or simply
52522 "formal," is used as a prefix in referring to objects, subtypes (and
52523 types), functions, procedures and packages, that are generic formal
52524 entities, as well as to their respective declarations. [Examples:
52525 "generic formal procedure" or a "formal integer type declaration."]
52526
52527 _Dynamic Semantics_
52528
52529 10
52530 The elaboration of a generic_declaration has no effect.
52531
52532 NOTES
52533
52534 11
52535 1 Outside a generic unit a name that denotes the
52536 generic_declaration denotes the generic unit. In contrast, within
52537 the declarative region of the generic unit, a name that denotes the
52538 generic_declaration denotes the current instance.
52539
52540 11.a
52541 Proof: This is stated officially as part of the "current
52542 instance" rule in *note 8.6::, "*note 8.6:: The Context of
52543 Overload Resolution". See also *note 12.3::, "*note 12.3::
52544 Generic Instantiation".
52545
52546 12
52547 2 Within a generic subprogram_body, the name of this program unit
52548 acts as the name of a subprogram. Hence this name can be
52549 overloaded, and it can appear in a recursive call of the current
52550 instance. For the same reason, this name cannot appear after the
52551 reserved word new in a (recursive) generic_instantiation.
52552
52553 13
52554 3 A default_expression or default_name appearing in a
52555 generic_formal_part is not evaluated during elaboration of the
52556 generic_formal_part; instead, it is evaluated when used. (The
52557 usual visibility rules apply to any name used in a default: the
52558 denoted declaration therefore has to be visible at the place of the
52559 expression.)
52560
52561 _Examples_
52562
52563 14
52564 Examples of generic formal parts:
52565
52566 15
52567 generic -- parameterless
52568
52569 16
52570 generic
52571 Size : Natural; -- formal object
52572
52573 17
52574 generic
52575 Length : Integer := 200; -- formal object with a default expression
52576
52577 18
52578 Area : Integer := Length*Length; -- formal object with a default expression
52579
52580 19
52581 generic
52582 type Item is private; -- formal type
52583 type Index is (<>); -- formal type
52584 type Row is array(Index range <>) of Item; -- formal type
52585 with function "<"(X, Y : Item) return Boolean; -- formal subprogram
52586
52587 20
52588 Examples of generic declarations declaring generic subprograms Exchange
52589 and Squaring:
52590
52591 21
52592 generic
52593 type Elem is private;
52594 procedure Exchange(U, V : in out Elem);
52595
52596 22
52597 generic
52598 type Item is private;
52599 with function "*"(U, V : Item) return Item is <>;
52600 function Squaring(X : Item) return Item;
52601
52602 23
52603 Example of a generic declaration declaring a generic package:
52604
52605 24
52606 generic
52607 type Item is private;
52608 type Vector is array (Positive range <>) of Item;
52609 with function Sum(X, Y : Item) return Item;
52610 package On_Vectors is
52611 function Sum (A, B : Vector) return Vector;
52612 function Sigma(A : Vector) return Item;
52613 Length_Error : exception;
52614 end On_Vectors;
52615
52616 _Extensions to Ada 83_
52617
52618 24.a
52619 The syntax rule for generic_formal_parameter_declaration is
52620 modified to allow the reserved words tagged and abstract, to
52621 allow formal derived types, and to allow formal packages.
52622
52623 24.b
52624 Use_clauses are allowed in generic_formal_parts. This is
52625 necessary in order to allow a use_clause within a formal part
52626 to provide direct visibility of declarations within a generic
52627 formal package.
52628
52629 _Wording Changes from Ada 83_
52630
52631 24.c/3
52632 {AI05-0299-1AI05-0299-1} The syntax for
52633 generic_formal_parameter_declaration and
52634 formal_type_definition is split up into more named categories.
52635 The rules for these categories are moved to the appropriate
52636 subclauses. The names of the categories are changed to be
52637 more intuitive and uniform. For example, we changed
52638 generic_parameter_declaration to
52639 generic_formal_parameter_declaration, because the thing it
52640 declares is a generic formal, not a generic. In the others,
52641 we abbreviate "generic_formal" to just "formal". We can't do
52642 that for generic_formal_parameter_declaration, because of
52643 confusion with normal formal parameters of subprograms.
52644
52645 _Extensions to Ada 2005_
52646
52647 24.d/3
52648 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
52649 be used in a generic_subprogram_declaration (as well as a
52650 generic_package_declaration). This is described in *note
52651 13.1.1::.
52652
52653 \1f
52654 File: aarm2012.info, Node: 12.2, Next: 12.3, Prev: 12.1, Up: 12
52655
52656 12.2 Generic Bodies
52657 ===================
52658
52659 1
52660 The body of a generic unit (a generic body) [is a template for the
52661 instance bodies. The syntax of a generic body is identical to that of a
52662 nongeneric body].
52663
52664 1.a
52665 Ramification: We also use terms like "generic function body"
52666 and "nongeneric package body."
52667
52668 _Dynamic Semantics_
52669
52670 2
52671 The elaboration of a generic body has no other effect than to establish
52672 that the generic unit can from then on be instantiated without failing
52673 the Elaboration_Check. If the generic body is a child of a generic
52674 package, then its elaboration establishes that each corresponding
52675 declaration nested in an instance of the parent (see *note 10.1.1::) can
52676 from then on be instantiated without failing the Elaboration_Check.
52677
52678 NOTES
52679
52680 3
52681 4 The syntax of generic subprograms implies that a generic
52682 subprogram body is always the completion of a declaration.
52683
52684 _Examples_
52685
52686 4
52687 Example of a generic procedure body:
52688
52689 5
52690 procedure Exchange(U, V : in out Elem) is -- see *note 12.1::
52691 T : Elem; -- the generic formal type
52692 begin
52693 T := U;
52694 U := V;
52695 V := T;
52696 end Exchange;
52697
52698 6
52699 Example of a generic function body:
52700
52701 7
52702 function Squaring(X : Item) return Item is -- see *note 12.1::
52703 begin
52704 return X*X; -- the formal operator "*"
52705 end Squaring;
52706
52707 8
52708 Example of a generic package body:
52709
52710 9
52711 package body On_Vectors is -- see *note 12.1::
52712
52713 10
52714 function Sum(A, B : Vector) return Vector is
52715 Result : Vector(A'Range); -- the formal type Vector
52716 Bias : constant Integer := B'First - A'First;
52717 begin
52718 if A'Length /= B'Length then
52719 raise Length_Error;
52720 end if;
52721
52722 11
52723 for N in A'Range loop
52724 Result(N) := Sum(A(N), B(N + Bias)); -- the formal function Sum
52725 end loop;
52726 return Result;
52727 end Sum;
52728
52729 12
52730 function Sigma(A : Vector) return Item is
52731 Total : Item := A(A'First); -- the formal type Item
52732 begin
52733 for N in A'First + 1 .. A'Last loop
52734 Total := Sum(Total, A(N)); -- the formal function Sum
52735 end loop;
52736 return Total;
52737 end Sigma;
52738 end On_Vectors;
52739
52740 \1f
52741 File: aarm2012.info, Node: 12.3, Next: 12.4, Prev: 12.2, Up: 12
52742
52743 12.3 Generic Instantiation
52744 ==========================
52745
52746 1
52747 [ An instance of a generic unit is declared by a generic_instantiation.]
52748
52749 _Language Design Principles_
52750
52751 1.a/3
52752 {AI05-0299-1AI05-0299-1} The legality of an instance should be
52753 determinable without looking at the generic body. Likewise,
52754 the legality of a generic body should be determinable without
52755 looking at any instances. Thus, the generic_declaration forms
52756 a contract between the body and the instances; if each obeys
52757 the rules with respect to the generic_declaration, then no
52758 legality problems will arise. This is really a special case
52759 of the "legality determinable via semantic dependences"
52760 Language Design Principle (see Clause *note 10::), given that
52761 a generic_instantiation does not depend semantically upon the
52762 generic body, nor vice-versa.
52763
52764 1.b
52765 Run-time issues are another story. For example, whether
52766 parameter passing is by copy or by reference is determined in
52767 part by the properties of the generic actuals, and thus cannot
52768 be determined at compile time of the generic body. Similarly,
52769 the contract model does not apply to Post-Compilation Rules.
52770
52771 _Syntax_
52772
52773 2/3
52774 {AI95-00218-03AI95-00218-03} {AI05-0183-1AI05-0183-1}
52775 generic_instantiation ::=
52776 package defining_program_unit_name is
52777 new generic_package_name [generic_actual_part]
52778 [aspect_specification];
52779 | [overriding_indicator]
52780 procedure defining_program_unit_name is
52781 new generic_procedure_name [generic_actual_part]
52782 [aspect_specification];
52783 | [overriding_indicator]
52784 function defining_designator is
52785 new generic_function_name [generic_actual_part]
52786 [aspect_specification];
52787
52788 3
52789 generic_actual_part ::=
52790 (generic_association {, generic_association})
52791
52792 4
52793 generic_association ::=
52794 [generic_formal_parameter_selector_name =>]
52795 explicit_generic_actual_parameter
52796
52797 5
52798 explicit_generic_actual_parameter ::= expression | variable_name
52799 | subprogram_name | entry_name | subtype_mark
52800 | package_instance_name
52801
52802 6
52803 A generic_association is named or positional according to whether
52804 or not the generic_formal_parameter_selector_name (*note 4.1.3:
52805 S0099.) is specified. Any positional associations shall precede
52806 any named associations.
52807
52808 7/3
52809 {AI05-0004-1AI05-0004-1} The generic actual parameter is either the
52810 explicit_generic_actual_parameter given in a generic_association (*note
52811 12.3: S0277.) for each formal, or the corresponding default_expression
52812 (*note 3.7: S0063.) or default_name (*note 12.6: S0299.) if no
52813 generic_association (*note 12.3: S0277.) is given for the formal. When
52814 the meaning is clear from context, the term "generic actual," or simply
52815 "actual," is used as a synonym for "generic actual parameter" and also
52816 for the view denoted by one, or the value of one.
52817
52818 _Legality Rules_
52819
52820 8
52821 In a generic_instantiation for a particular kind of program unit
52822 [(package, procedure, or function)], the name shall denote a generic
52823 unit of the corresponding kind [(generic package, generic procedure, or
52824 generic function, respectively)].
52825
52826 9/3
52827 {AI05-0118-1AI05-0118-1} The generic_formal_parameter_selector_name of a
52828 named generic_association shall denote a
52829 generic_formal_parameter_declaration of the generic unit being
52830 instantiated. If two or more formal subprograms have the same defining
52831 name, then named associations are not allowed for the corresponding
52832 actuals.
52833
52834 9.1/3
52835 {AI05-0118-1AI05-0118-1} The generic_formal_parameter_declaration for a
52836 positional generic_association is the parameter with the corresponding
52837 position in the generic_formal_part of the generic unit being
52838 instantiated.
52839
52840 10
52841 A generic_instantiation shall contain at most one generic_association
52842 for each formal. Each formal without an association shall have a
52843 default_expression or subprogram_default.
52844
52845 11
52846 In a generic unit Legality Rules are enforced at compile time of the
52847 generic_declaration and generic body, given the properties of the
52848 formals. In the visible part and formal part of an instance, Legality
52849 Rules are enforced at compile time of the generic_instantiation, given
52850 the properties of the actuals. In other parts of an instance, Legality
52851 Rules are not enforced; this rule does not apply when a given rule
52852 explicitly specifies otherwise.
52853
52854 11.a/2
52855 Reason: {AI95-00114-01AI95-00114-01} Since rules are checked
52856 using the properties of the formals, and since these
52857 properties do not always carry over to the actuals, we need to
52858 check the rules again in the visible part of the instance.
52859 For example, only if a tagged type is limited may an extension
52860 of it have limited components in the record_extension_part. A
52861 formal tagged limited type is limited, but the actual might be
52862 nonlimited. Hence any rule that requires a tagged type to be
52863 limited runs into this problem. Such rules are rare; in most
52864 cases, the rules for matching of formals and actuals guarantee
52865 that if the rule is obeyed in the generic unit, then it has to
52866 be obeyed in the instance.
52867
52868 11.a.1/3
52869 {AI05-0005-1AI05-0005-1} Ada 2012 addendum: Such Legality
52870 Rules are not as rare as the authors of Ada 95 hoped; there
52871 are more than 30 of them known at this point. They are
52872 indexed under "generic contract issue" and are associated with
52873 the boilerplate "In addition to the places where Legality
52874 Rules normally apply...". Indeed, there is only one known
52875 rule where rechecking in the specification is needed and where
52876 rechecking in the private part is not wanted (it is in *note
52877 3.4::, but even it needs rechecking when tagged types are
52878 involved).
52879
52880 11.b
52881 Ramification: The "properties" of the formals are determined
52882 without knowing anything about the actuals:
52883
52884 11.c/1
52885 * {8652/00958652/0095} {AI95-00034-01AI95-00034-01} A
52886 formal derived subtype is constrained if and only if the
52887 ancestor subtype is constrained. A formal array type is
52888 constrained if and only if the declarations say so. A
52889 formal private type is constrained if it does not have a
52890 discriminant part. Other formal subtypes are
52891 unconstrained, even though they might be constrained in
52892 an instance.
52893
52894 11.d
52895 * A formal subtype can be indefinite, even though the copy
52896 might be definite in an instance.
52897
52898 11.e
52899 * A formal object of mode in is not a static constant; in
52900 an instance, the copy is static if the actual is.
52901
52902 11.f
52903 * A formal subtype is not static, even though the actual
52904 might be.
52905
52906 11.g
52907 * Formal types are specific, even though the actual can be
52908 class-wide.
52909
52910 11.h
52911 * The subtype of a formal object of mode in out is not
52912 static. (This covers the case of AI83-00878.)
52913
52914 11.i
52915 * The subtype of a formal parameter of a formal subprogram
52916 does not provide an applicable index constraint.
52917
52918 11.j/3
52919 * {AI05-0239-1AI05-0239-1} The profile of a formal
52920 subprogram is not subtype conformant with any other
52921 profile.
52922
52923 11.k
52924 * A generic formal function is not static.
52925
52926 11.l
52927 Ramification: The exceptions to the above rule about when
52928 legality rules are enforced fall into these categories:
52929
52930 11.m
52931 * Some rules are checked in the generic declaration, and
52932 then again in both the visible and private parts of the
52933 instance:
52934
52935 11.n
52936 * The parent type of a record extension has to be
52937 specific (see *note 3.9.1::). This rule is not
52938 checked in the instance body.
52939
52940 11.o
52941 * The parent type of a private extension has to
52942 be specific (see *note 7.3::). This rule is
52943 not checked in the instance body.
52944
52945 11.p/3
52946 * {AI95-00402-01AI95-00402-01}
52947 {AI05-0093-1AI05-0093-1} A type with an access
52948 discriminant with a default_expression has to
52949 be immutably limited. In the generic body, the
52950 definition of immutably limited is adjusted in
52951 an assume-the-worst manner (thus the rule is
52952 checked that way).
52953
52954 11.q
52955 * In the declaration of a record extension, if
52956 the parent type is nonlimited, then each of the
52957 components of the record_extension_part have to
52958 be nonlimited (see *note 3.9.1::). In the
52959 generic body, this rule is checked in an
52960 assume-the-worst manner.
52961
52962 11.r
52963 * A preelaborated library unit has to be
52964 preelaborable (see *note 10.2.1::). In the
52965 generic body, this rule is checked in an
52966 assume-the-worst manner.
52967
52968 11.r.1/2
52969 {AI95-00402-01AI95-00402-01} The corrections made by the
52970 Corrigendum added a number of such rules, and the
52971 Amendment added many more. There doesn't seem to be much
52972 value in repeating all of these rules here (as of this
52973 writing, there are roughly 33 such rules). As noted
52974 below, all such rules are indexed in the AARM.
52975
52976 11.s
52977 * For the accessibility rules, the formals have nothing to
52978 say about the property in question. Like the above
52979 rules, these rules are checked in the generic
52980 declaration, and then again in both the visible and
52981 private parts of the instance. In the generic body, we
52982 have explicit rules that essentially assume the worst (in
52983 the cases of type extensions and access-to-subprogram
52984 types), and we have run-time checks (in the case of
52985 access-to-object types). See *note 3.9.1::, *note
52986 3.10.2::, and *note 4.6::.
52987
52988 11.t
52989 We considered run-time checks for access-to-subprogram
52990 types as well. However, this would present difficulties
52991 for implementations that share generic bodies.
52992
52993 11.u
52994 * The rules requiring "reasonable" values for static
52995 expressions are ignored when the expected type for the
52996 expression is a descendant of a generic formal type other
52997 than a generic formal derived type, and do not apply in
52998 an instance.
52999
53000 11.v
53001 * The rule forbidding two explicit homographs in the same
53002 declarative region does not apply in an instance of a
53003 generic unit, except that it does apply in the
53004 declaration of a record extension that appears in the
53005 visible part of an instance.
53006
53007 11.w
53008 * Some rules do not apply at all in an instance, not even
53009 in the visible part:
53010
53011 11.x
53012 * Body_stubs are not normally allowed to be
53013 multiply nested, but they can be in instances.
53014
53015 11.y
53016 Each rule that is an exception is marked with "generic
53017 contract issue;" look that up in the index to find them all.
53018
53019 11.z
53020 Ramification: The Legality Rules are the ones labeled Legality
53021 Rules. We are talking about all Legality Rules in the entire
53022 language here. Note that, with some exceptions, the legality
53023 of a generic unit is checked even if there are no
53024 instantiations of the generic unit.
53025
53026 11.aa/3
53027 Ramification: {AI05-0299-1AI05-0299-1} The Legality Rules are
53028 described here, and the overloading rules were described
53029 earlier in this subclause. Presumably, every Static Semantic
53030 Item is sucked in by one of those. Thus, we have covered all
53031 the compile-time rules of the language. There is no need to
53032 say anything special about the Post-Compilation Rules or the
53033 Dynamic Semantic Items.
53034
53035 11.bb
53036 Discussion: Here is an example illustrating how this rule is
53037 checked: "In the declaration of a record extension, if the
53038 parent type is nonlimited, then each of the components of the
53039 record_extension_part shall be nonlimited."
53040
53041 11.cc
53042 generic
53043 type Parent is tagged private;
53044 type Comp is limited private;
53045 package G1 is
53046 type Extension is new Parent with
53047 record
53048 C : Comp; -- Illegal!
53049 end record;
53050 end G1;
53051
53052 11.dd/1
53053 The parent type is nonlimited, and the component type is
53054 limited, which is illegal. It doesn't matter that one could
53055 imagine writing an instantiation with the actual for Comp
53056 being nonlimited -- we never get to the instance, because the
53057 generic itself is illegal.
53058
53059 11.ee
53060 On the other hand:
53061
53062 11.ff
53063 generic
53064 type Parent is tagged limited private; -- Parent is limited.
53065 type Comp is limited private;
53066 package G2 is
53067 type Extension is new Parent with
53068 record
53069 C : Comp; -- OK.
53070 end record;
53071 end G2;
53072
53073 11.gg
53074 type Limited_Tagged is tagged limited null record;
53075 type Non_Limited_Tagged is tagged null record;
53076
53077 11.hh
53078 type Limited_Untagged is limited null record;
53079 type Non_Limited_Untagged is null record;
53080
53081 11.ii
53082 package Good_1 is new G2(Parent => Limited_Tagged,
53083 Comp => Limited_Untagged);
53084 package Good_2 is new G2(Parent => Non_Limited_Tagged,
53085 Comp => Non_Limited_Untagged);
53086 package Bad is new G2(Parent => Non_Limited_Tagged,
53087 Comp => Limited_Untagged); -- Illegal!
53088
53089 11.jj
53090 The first instantiation is legal, because in the instance the
53091 parent is limited, so the rule is not violated. Likewise, in
53092 the second instantiation, the rule is not violated in the
53093 instance. However, in the Bad instance, the parent type is
53094 nonlimited, and the component type is limited, so this
53095 instantiation is illegal.
53096
53097 _Static Semantics_
53098
53099 12
53100 A generic_instantiation declares an instance; it is equivalent to the
53101 instance declaration (a package_declaration (*note 7.1: S0190.) or
53102 subprogram_declaration (*note 6.1: S0163.)) immediately followed by the
53103 instance body, both at the place of the instantiation.
53104
53105 12.a
53106 Ramification: The declaration and the body of the instance are
53107 not "implicit" in the technical sense, even though you can't
53108 see them in the program text. Nor are declarations within an
53109 instance "implicit" (unless they are implicit by other rules).
53110 This is necessary because implicit declarations have special
53111 semantics that should not be attached to instances. For a
53112 generic subprogram, the profile of a generic_instantiation is
53113 that of the instance declaration, by the stated equivalence.
53114
53115 12.b
53116 Ramification: The visible and private parts of a package
53117 instance are defined in *note 7.1::, "*note 7.1:: Package
53118 Specifications and Declarations" and *note 12.7::, "*note
53119 12.7:: Formal Packages". The visible and private parts of a
53120 subprogram instance are defined in *note 8.2::, "*note 8.2::
53121 Scope of Declarations".
53122
53123 13
53124 The instance is a copy of the text of the template. [Each use of a
53125 formal parameter becomes (in the copy) a use of the actual, as explained
53126 below.] An instance of a generic package is a package, that of a
53127 generic procedure is a procedure, and that of a generic function is a
53128 function.
53129
53130 13.a
53131 Ramification: An instance is a package or subprogram (because
53132 we say so), even though it contains a copy of the
53133 generic_formal_part, and therefore doesn't look like one.
53134 This is strange, but it's OK, since the syntax rules are
53135 overloading rules, and therefore do not apply in an instance.
53136
53137 13.b
53138 Discussion: We use a macro-expansion model, with some
53139 explicitly-stated exceptions (see below). The main exception
53140 is that the interpretation of each construct in a generic unit
53141 (especially including the denotation of each name) is
53142 determined when the declaration and body of the generic unit
53143 (as opposed to the instance) are compiled, and in each
53144 instance this interpretation is (a copy of) the template
53145 interpretation. In other words, if a construct is interpreted
53146 as a name denoting a declaration D, then in an instance, the
53147 copy of the construct will still be a name, and will still
53148 denote D (or a copy of D). From an implementation point of
53149 view, overload resolution is performed on the template, and
53150 not on each copy.
53151
53152 13.c
53153 We describe the substitution of generic actual parameters by
53154 saying (in most cases) that the copy of each generic formal
53155 parameter declares a view of the actual. Suppose a name in a
53156 generic unit denotes a generic_formal_parameter_declaration.
53157 The copy of that name in an instance will denote the copy of
53158 that generic_formal_parameter_declaration in the instance.
53159 Since the generic_formal_parameter_declaration in the instance
53160 declares a view of the actual, the name will denote a view of
53161 the actual.
53162
53163 13.d/2
53164 {AI95-00442-01AI95-00442-01} Other properties of the copy (for
53165 example, staticness, categories to which types belong) are
53166 recalculated for each instance; this is implied by the fact
53167 that it's a copy.
53168
53169 13.e/2
53170 {AI95-00317-01AI95-00317-01} Although the generic_formal_part
53171 is included in an instance, the declarations in the
53172 generic_formal_part are only visible outside the instance in
53173 the case of a generic formal package whose
53174 formal_package_actual_part includes one or more <> indicators
53175 -- see *note 12.7::.
53176
53177 14
53178 The interpretation of each construct within a generic declaration or
53179 body is determined using the overloading rules when that generic
53180 declaration or body is compiled. In an instance, the interpretation of
53181 each (copied) construct is the same, except in the case of a name that
53182 denotes the generic_declaration or some declaration within the generic
53183 unit; the corresponding name in the instance then denotes the
53184 corresponding copy of the denoted declaration. The overloading rules do
53185 not apply in the instance.
53186
53187 14.a
53188 Ramification: See *note 8.6::, "*note 8.6:: The Context of
53189 Overload Resolution" for definitions of "interpretation" and
53190 "overloading rule."
53191
53192 14.b
53193 Even the generic_formal_parameter_declarations have
53194 corresponding declarations in the instance, which declare
53195 views of the actuals.
53196
53197 14.c
53198 Although the declarations in the instance are copies of those
53199 in the generic unit, they often have quite different
53200 properties, as explained below. For example a constant
53201 declaration in the generic unit might declare a nonstatic
53202 constant, whereas the copy of that declaration might declare a
53203 static constant. This can happen when the staticness depends
53204 on some generic formal.
53205
53206 14.d
53207 This rule is partly a ramification of the "current instance"
53208 rule in *note 8.6::, "*note 8.6:: The Context of Overload
53209 Resolution". Note that that rule doesn't cover the
53210 generic_formal_part.
53211
53212 14.e
53213 Although the overloading rules are not observed in the
53214 instance, they are, of course, observed in the _instantiation
53215 in order to determine the interpretation of the constituents
53216 of the _instantiation.
53217
53218 14.f
53219 Since children are considered to occur within their parent's
53220 declarative region, the above rule applies to a name that
53221 denotes a child of a generic unit, or a declaration inside
53222 such a child.
53223
53224 14.g
53225 Since the Syntax Rules are overloading rules, it is possible
53226 (legal) to violate them in an instance. For example, it is
53227 possible for an instance body to occur in a
53228 package_specification, even though the Syntax Rules forbid
53229 bodies in package_specifications.
53230
53231 15
53232 In an instance, a generic_formal_parameter_declaration declares a view
53233 whose properties are identical to those of the actual, except as
53234 specified in *note 12.4::, "*note 12.4:: Formal Objects" and *note
53235 12.6::, "*note 12.6:: Formal Subprograms". Similarly, for a declaration
53236 within a generic_formal_parameter_declaration, the corresponding
53237 declaration in an instance declares a view whose properties are
53238 identical to the corresponding declaration within the declaration of the
53239 actual.
53240
53241 15.a
53242 Ramification: In an instance, there are no "properties" of
53243 types and subtypes that come from the formal. The primitive
53244 operations of the type come from the formal, but these are
53245 declarations in their own right, and are therefore handled
53246 separately.
53247
53248 15.b
53249 Note that certain properties that come from the actuals are
53250 irrelevant in the instance. For example, if an actual type is
53251 of a class deeper in the derived-type hierarchy than the
53252 formal, it is impossible to call the additional operations of
53253 the deeper class in the instance, because any such call would
53254 have to be a copy of some corresponding call in the generic
53255 unit, which would have been illegal. However, it is sometimes
53256 possible to reach into the specification of the instance from
53257 outside, and notice such properties. For example, one could
53258 pass an object declared in the instance specification to one
53259 of the additional operations of the deeper type.
53260
53261 15.c/2
53262 {AI95-00114-01AI95-00114-01} A formal_type_declaration can
53263 contain discriminant_specifications, a
53264 formal_subprogram_declaration can contain
53265 parameter_specifications, and a formal_package_declaration can
53266 contain many kinds of declarations. These are all inside the
53267 generic unit, and have corresponding declarations in the
53268 instance.
53269
53270 15.d
53271 This rule implies, for example, that if a subtype in a generic
53272 unit is a subtype of a generic formal subtype, then the
53273 corresponding subtype in the instance is a subtype of the
53274 corresponding actual subtype.
53275
53276 15.e
53277 For a generic_instantiation, if a generic actual is a static
53278 [(scalar or string)] subtype, then each use of the
53279 corresponding formal parameter within the specification of the
53280 instance is considered to be static. (See AI83-00409.)
53281
53282 15.f
53283 Similarly, if a generic actual is a static expression and the
53284 corresponding formal parameter has a static [(scalar or
53285 string)] subtype, then each use of the formal parameter in the
53286 specification of the instance is considered to be static.
53287 (See AI83-00505.)
53288
53289 15.g
53290 If a primitive subprogram of a type derived from a generic
53291 formal derived tagged type is not overriding (that is, it is a
53292 new subprogram), it is possible for the copy of that
53293 subprogram in an instance to override a subprogram inherited
53294 from the actual. For example:
53295
53296 15.h
53297 type T1 is tagged record ... end record;
53298
53299 15.i
53300 generic
53301 type Formal is new T1;
53302 package G is
53303 type Derived_From_Formal is new Formal with record ... end record;
53304 procedure Foo(X : in Derived_From_Formal); -- Does not override anything.
53305 end G;
53306
53307 15.j
53308 type T2 is new T1 with record ... end record;
53309 procedure Foo(X : in T2);
53310
53311 15.k
53312 package Inst is new G(Formal => T2);
53313
53314 15.l
53315 In the instance Inst, the declaration of Foo for
53316 Derived_From_Formal overrides the Foo inherited from T2.
53317
53318 15.m/1
53319 Implementation Note: {8652/00098652/0009}
53320 {AI95-00137-01AI95-00137-01} For formal types, an
53321 implementation that shares the code among multiple instances
53322 of the same generic unit needs to beware that things like
53323 parameter passing mechanisms (by-copy vs. by-reference) and
53324 aspect_clauses are determined by the actual.
53325
53326 16
53327 [Implicit declarations are also copied, and a name that denotes an
53328 implicit declaration in the generic denotes the corresponding copy in
53329 the instance. However, for a type declared within the visible part of
53330 the generic, a whole new set of primitive subprograms is implicitly
53331 declared for use outside the instance, and may differ from the copied
53332 set if the properties of the type in some way depend on the properties
53333 of some actual type specified in the instantiation. For example, if the
53334 type in the generic is derived from a formal private type, then in the
53335 instance the type will inherit subprograms from the corresponding actual
53336 type.
53337
53338 17
53339 These new implicit declarations occur immediately after the type
53340 declaration in the instance, and override the copied ones. The copied
53341 ones can be called only from within the instance; the new ones can be
53342 called only from outside the instance, although for tagged types, the
53343 body of a new one can be executed by a call to an old one.]
53344
53345 17.a
53346 Proof: This rule is stated officially in *note 8.3::, "*note
53347 8.3:: Visibility".
53348
53349 17.b
53350 Ramification: The new ones follow from the class(es) of the
53351 formal types. For example, for a type T derived from a
53352 generic formal private type, if the actual is Integer, then
53353 the copy of T in the instance has a "+" primitive operator,
53354 which can be called from outside the instance (assuming T is
53355 declared in the visible part of the instance).
53356
53357 17.c
53358 AI83-00398.
53359
53360 17.d/2
53361 {AI95-00442-01AI95-00442-01} Since an actual type is always in
53362 the category determined for the formal, the new subprograms
53363 hide all of the copied ones, except for a declaration of "/="
53364 that corresponds to an explicit declaration of "=". Such "/="
53365 operators are special, because unlike other implicit
53366 declarations of primitive subprograms, they do not appear by
53367 virtue of the class, but because of an explicit declaration of
53368 "=". If the declaration of "=" is implicit (and therefore
53369 overridden in the instance), then a corresponding implicitly
53370 declared "/=" is also overridden. But if the declaration of
53371 "=" is explicit (and therefore not overridden in the
53372 instance), then a corresponding implicitly declared "/=" is
53373 not overridden either, even though it's implicit.
53374
53375 17.e
53376 Note that the copied ones can be called from inside the
53377 instance, even though they are hidden from all visibility,
53378 because the names are resolved in the generic unit --
53379 visibility is irrelevant for calls in the instance.
53380
53381 18
53382 [In the visible part of an instance, an explicit declaration overrides
53383 an implicit declaration if they are homographs, as described in *note
53384 8.3::.] On the other hand, an explicit declaration in the private part
53385 of an instance overrides an implicit declaration in the instance, only
53386 if the corresponding explicit declaration in the generic overrides a
53387 corresponding implicit declaration in the generic. Corresponding rules
53388 apply to the other kinds of overriding described in *note 8.3::.
53389
53390 18.a
53391 Ramification: For example:
53392
53393 18.b
53394 type Ancestor is tagged null record;
53395
53396 18.c
53397 generic
53398 type Formal is new Ancestor with private;
53399 package G is
53400 type T is new Formal with null record;
53401 procedure P(X : in T); -- (1)
53402 private
53403 procedure Q(X : in T); -- (2)
53404 end G;
53405
53406 18.d
53407 type Actual is new Ancestor with null record;
53408 procedure P(X : in Actual);
53409 procedure Q(X : in Actual);
53410
53411 18.e
53412 package Instance is new G(Formal => Actual);
53413
53414 18.f
53415 In the instance, the copy of P at (1) overrides Actual's P,
53416 whereas the copy of Q at (2) does not override anything; in
53417 implementation terms, it occupies a separate slot in the type
53418 descriptor.
53419
53420 18.g
53421 Reason: The reason for this rule is so a programmer writing an
53422 _instantiation need not look at the private part of the
53423 generic in order to determine which subprograms will be
53424 overridden.
53425
53426 _Post-Compilation Rules_
53427
53428 19
53429 Recursive generic instantiation is not allowed in the following sense:
53430 if a given generic unit includes an instantiation of a second generic
53431 unit, then the instance generated by this instantiation shall not
53432 include an instance of the first generic unit [(whether this instance is
53433 generated directly, or indirectly by intermediate instantiations)].
53434
53435 19.a
53436 Discussion: Note that this rule is not a violation of the
53437 generic contract model, because it is not a Legality Rule.
53438 Some implementations may be able to check this rule at compile
53439 time, but that requires access to all the bodies, so we allow
53440 implementations to check the rule at link time.
53441
53442 _Dynamic Semantics_
53443
53444 20
53445 For the elaboration of a generic_instantiation, each generic_association
53446 is first evaluated. If a default is used, an implicit
53447 generic_association is assumed for this rule. These evaluations are
53448 done in an arbitrary order, except that the evaluation for a default
53449 actual takes place after the evaluation for another actual if the
53450 default includes a name that denotes the other one. Finally, the
53451 instance declaration and body are elaborated.
53452
53453 20.a
53454 Ramification: Note that if the evaluation of a default depends
53455 on some side effect of some other evaluation, the order is
53456 still arbitrary.
53457
53458 21
53459 For the evaluation of a generic_association the generic actual parameter
53460 is evaluated. Additional actions are performed in the case of a formal
53461 object of mode in (see *note 12.4::).
53462
53463 21.a
53464 To be honest: Actually, the actual is evaluated only if
53465 evaluation is defined for that kind of construct -- we don't
53466 actually "evaluate" subtype_marks.
53467
53468 NOTES
53469
53470 22
53471 5 If a formal type is not tagged, then the type is treated as an
53472 untagged type within the generic body. Deriving from such a type
53473 in a generic body is permitted; the new type does not get a new tag
53474 value, even if the actual is tagged. Overriding operations for
53475 such a derived type cannot be dispatched to from outside the
53476 instance.
53477
53478 22.a
53479 Ramification: If two overloaded subprograms declared in a
53480 generic package specification differ only by the (formal) type
53481 of their parameters and results, then there exist legal
53482 instantiations for which all calls of these subprograms from
53483 outside the instance are ambiguous. For example:
53484
53485 22.b
53486 generic
53487 type A is (<>);
53488 type B is private;
53489 package G is
53490 function Next(X : A) return A;
53491 function Next(X : B) return B;
53492 end G;
53493
53494 22.c
53495 package P is new G(A => Boolean, B => Boolean);
53496 -- All calls of P.Next are ambiguous.
53497
53498 22.d
53499 Ramification: The following example illustrates some of the
53500 subtleties of the substitution of formals and actuals:
53501
53502 22.e
53503 generic
53504 type T1 is private;
53505 -- A predefined "=" operator is implicitly declared here:
53506 -- function "="(Left, Right : T1) return Boolean;
53507 -- Call this "="1.
53508 package G is
53509 subtype S1 is T1; -- So we can get our hands on the type from
53510 -- outside an instance.
53511 type T2 is new T1;
53512 -- An inherited "=" operator is implicitly declared here:
53513 -- function "="(Left, Right : T2) return Boolean;
53514 -- Call this "="2.
53515
53516 22.f
53517 T1_Obj : T1 := ...;
53518 Bool_1 : Boolean := T1_Obj = T1_Obj;
53519
53520 22.g
53521 T2_Obj : T2 := ...;
53522 Bool_2 : Boolean := T2_Obj = T2_Obj;
53523 end G;
53524 ...
53525
53526 22.h
53527 package P is
53528 type My_Int is new Integer;
53529 -- A predefined "=" operator is implicitly declared here:
53530 -- function "="(Left, Right : My_Int) return Boolean;
53531 -- Call this "="3.
53532 function "="(X, Y : My_Int) return Boolean;
53533 -- Call this "="4.
53534 -- "="3 is hidden from all visibility by "="4.
53535 -- Nonetheless, "="3 can "reemerge" in certain circumstances.
53536 end P;
53537 use P;
53538 ...
53539 package I is new G(T1 => My_Int); -- "="5 is declared in I (see below).
53540 use I;
53541
53542 22.i
53543 Another_T1_Obj : S1 := 13; -- Can't denote T1, but S1 will do.
53544 Bool_3 : Boolean := Another_T1_Obj = Another_T1_Obj;
53545
53546 22.j
53547 Another_T2_Obj : T2 := 45;
53548 Bool_4 : Boolean := Another_T2_Obj = Another_T2_Obj;
53549
53550 22.k
53551 Double : T2 := T2_Obj + Another_T2_Obj;
53552
53553 22.l
53554 In the instance I, there is a copy of "="1 (call it "="1i) and
53555 "="2 (call it "="2i). The "="1i and "="2i declare views of
53556 the predefined "=" of My_Int (that is, "="3). In the
53557 initialization of Bool_1 and Bool_2 in the generic unit G, the
53558 names "=" denote "="1 and "="2, respectively. Therefore, the
53559 copies of these names in the instances denote "="1i and "="2i,
53560 respectively. Thus, the initialization of I.Bool_1 and
53561 I.Bool_2 call the predefined equality operator of My_Int; they
53562 will not call "="4.
53563
53564 22.m
53565 The declarations "="1i and "="2i are hidden from all
53566 visibility. This prevents them from being called from outside
53567 the instance.
53568
53569 22.n
53570 The declaration of Bool_3 calls "="4.
53571
53572 22.o
53573 The instance I also contains implicit declarations of the
53574 primitive operators of T2, such as "=" (call it "="5) and "+".
53575 These operations cannot be called from within the instance,
53576 but the declaration of Bool_4 calls "="5.
53577
53578 _Examples_
53579
53580 23
53581 Examples of generic instantiations (see *note 12.1::):
53582
53583 24
53584 procedure Swap is new Exchange(Elem => Integer);
53585 procedure Swap is new Exchange(Character); -- Swap is overloaded
53586 function Square is new Squaring(Integer); -- "*" of Integer used by default
53587 function Square is new Squaring(Item => Matrix, "*" => Matrix_Product);
53588 function Square is new Squaring(Matrix, Matrix_Product); -- same as previous
53589
53590 25
53591 package Int_Vectors is new On_Vectors(Integer, Table, "+");
53592
53593 26
53594 Examples of uses of instantiated units:
53595
53596 27
53597 Swap(A, B);
53598 A := Square(A);
53599
53600 28
53601 T : Table(1 .. 5) := (10, 20, 30, 40, 50);
53602 N : Integer := Int_Vectors.Sigma(T); -- 150 (see *note 12.2::, "*note 12.2:: Generic Bodies" for the body of Sigma)
53603
53604 29
53605 use Int_Vectors;
53606 M : Integer := Sigma(T); -- 150
53607
53608 _Inconsistencies With Ada 83_
53609
53610 29.a
53611 In Ada 83, all explicit actuals are evaluated before all
53612 defaults, and the defaults are evaluated in the order of the
53613 formal declarations. This ordering requirement is relaxed in
53614 Ada 95.
53615
53616 _Incompatibilities With Ada 83_
53617
53618 29.b
53619 We have attempted to remove every violation of the contract
53620 model. Any remaining contract model violations should be
53621 considered bugs in the RM95. The unfortunate property of
53622 reverting to the predefined operators of the actual types is
53623 retained for upward compatibility. (Note that fixing this
53624 would require subtype conformance rules.) However, tagged
53625 types do not revert in this sense.
53626
53627 _Extensions to Ada 83_
53628
53629 29.c
53630 The syntax rule for explicit_generic_actual_parameter is
53631 modified to allow a package_instance_name.
53632
53633 _Wording Changes from Ada 83_
53634
53635 29.d
53636 The fact that named associations cannot be used for two formal
53637 subprograms with the same defining name is moved to AARM-only
53638 material, because it is a ramification of other rules, and
53639 because it is not of interest to the average user.
53640
53641 29.e/2
53642 {AI95-00114-01AI95-00114-01} The rule that "An explicit
53643 explicit_generic_actual_parameter shall not be supplied more
53644 than once for a given generic formal parameter" seems to be
53645 missing from RM83, although it was clearly the intent.
53646
53647 29.f
53648 In the explanation that the instance is a copy of the
53649 template, we have left out RM83-12.3(5)'s "apart from the
53650 generic formal part", because it seems that things in the
53651 formal part still need to exist in instances. This is
53652 particularly true for generic formal packages, where you're
53653 sometimes allowed to reach in and denote the formals of the
53654 formal package from outside it. This simplifies the
53655 explanation of what each name in an instance denotes: there
53656 are just two cases: the declaration can be inside or outside
53657 (where inside needs to include the generic unit itself). Note
53658 that the RM83 approach of listing many cases (see
53659 RM83-12.5(5-14)) would have become even more unwieldy with the
53660 addition of generic formal packages, and the declarations that
53661 occur therein.
53662
53663 29.g
53664 We have corrected the definition of the elaboration of a
53665 generic_instantiation (RM83-12.3(17)); we don't elaborate
53666 entities, and the instance is not "implicit."
53667
53668 29.h
53669 In RM83, there is a rule saying the formal and actual shall
53670 match, and then there is much text defining what it means to
53671 match. Here, we simply state all the latter text as rules.
53672 For example, "A formal foo is matched by an actual greenish
53673 bar" becomes "For a formal foo, the actual shall be a greenish
53674 bar." This is necessary to split the Name Resolution Rules
53675 from the Legality Rules. Besides, there's really no need to
53676 define the concept of matching for generic parameters.
53677
53678 _Extensions to Ada 95_
53679
53680 29.i/2
53681 {AI95-00218-03AI95-00218-03} An overriding_indicator (see
53682 *note 8.3.1::) is allowed on a subprogram instantiation.
53683
53684 _Extensions to Ada 2005_
53685
53686 29.j/3
53687 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
53688 be used in a generic_instantiation. This is described in
53689 *note 13.1.1::.
53690
53691 _Wording Changes from Ada 2005_
53692
53693 29.k/3
53694 {AI05-0118-1AI05-0118-1} Correction: Added a definition for
53695 positional parameters, as this is missing from Ada 95 and Ada
53696 2005.
53697
53698 \1f
53699 File: aarm2012.info, Node: 12.4, Next: 12.5, Prev: 12.3, Up: 12
53700
53701 12.4 Formal Objects
53702 ===================
53703
53704 1
53705 [ A generic formal object can be used to pass a value or variable to a
53706 generic unit.]
53707
53708 _Language Design Principles_
53709
53710 1.a
53711 A generic formal object of mode in is like a constant
53712 initialized to the value of the
53713 explicit_generic_actual_parameter.
53714
53715 1.b
53716 A generic formal object of mode in out is like a renaming of
53717 the explicit_generic_actual_parameter.
53718
53719 _Syntax_
53720
53721 2/3
53722 {AI95-00423-01AI95-00423-01} {AI05-0005-1AI05-0005-1}
53723 {AI05-0183-1AI05-0183-1} formal_object_declaration ::=
53724 defining_identifier_list : mode [null_exclusion]
53725 subtype_mark [:= default_expression]
53726 [aspect_specification];
53727 | defining_identifier_list : mode access_definition [:=
53728 default_expression]
53729 [aspect_specification];
53730
53731 _Name Resolution Rules_
53732
53733 3
53734 The expected type for the default_expression, if any, of a formal object
53735 is the type of the formal object.
53736
53737 4
53738 For a generic formal object of mode in, the expected type for the actual
53739 is the type of the formal.
53740
53741 5/2
53742 {AI95-00423-01AI95-00423-01} For a generic formal object of mode in out,
53743 the type of the actual shall resolve to the type determined by the
53744 subtype_mark, or for a formal_object_declaration with an
53745 access_definition, to a specific anonymous access type. If the
53746 anonymous access type is an access-to-object type, the type of the
53747 actual shall have the same designated type as that of the
53748 access_definition. If the anonymous access type is an
53749 access-to-subprogram type, the type of the actual shall have a
53750 designated profile which is type conformant with that of the
53751 access_definition.
53752
53753 5.a
53754 Reason: See the corresponding rule for
53755 object_renaming_declarations for a discussion of the reason
53756 for this rule.
53757
53758 _Legality Rules_
53759
53760 6
53761 If a generic formal object has a default_expression, then the mode shall
53762 be in [(either explicitly or by default)]; otherwise, its mode shall be
53763 either in or in out.
53764
53765 6.a
53766 Ramification: Mode out is not allowed for generic formal
53767 objects.
53768
53769 7
53770 For a generic formal object of mode in, the actual shall be an
53771 expression. For a generic formal object of mode in out, the actual
53772 shall be a name that denotes a variable for which renaming is allowed
53773 (see *note 8.5.1::).
53774
53775 7.a
53776 To be honest: The part of this that requires an expression or
53777 name is a Name Resolution Rule, but that's too pedantic to
53778 worry about. (The part about denoting a variable, and
53779 renaming being allowed, is most certainly not a Name
53780 Resolution Rule.)
53781
53782 8/2
53783 {AI95-00287-01AI95-00287-01} {AI95-00423-01AI95-00423-01} In the case
53784 where the type of the formal is defined by an access_definition, the
53785 type of the actual and the type of the formal:
53786
53787 8.1/2
53788 * {AI95-00423-01AI95-00423-01} shall both be access-to-object types
53789 with statically matching designated subtypes and with both or
53790 neither being access-to-constant types; or
53791
53792 8.2/2
53793 * {AI95-00423-01AI95-00423-01} shall both be access-to-subprogram
53794 types with subtype conformant designated profiles.
53795
53796 8.3/2
53797 {AI95-00423-01AI95-00423-01} For a formal_object_declaration with a
53798 null_exclusion or an access_definition that has a null_exclusion:
53799
53800 8.4/2
53801 * if the actual matching the formal_object_declaration denotes the
53802 generic formal object of another generic unit G, and the
53803 instantiation containing the actual occurs within the body of G or
53804 within the body of a generic unit declared within the declarative
53805 region of G, then the declaration of the formal object of G shall
53806 have a null_exclusion;
53807
53808 8.5/2
53809 * otherwise, the subtype of the actual matching the
53810 formal_object_declaration shall exclude null. In addition to the
53811 places where Legality Rules normally apply (see *note 12.3::), this
53812 rule applies also in the private part of an instance of a generic
53813 unit.
53814
53815 8.a/2
53816 Reason: {AI95-00287-01AI95-00287-01}
53817 {AI95-00423-01AI95-00423-01} This rule prevents "lying". Null
53818 must never be the value of an object with an explicit
53819 null_exclusion. The first bullet is an assume-the-worst rule
53820 which prevents trouble in generic bodies (including bodies of
53821 child units) when the subtype of the formal object excludes
53822 null implicitly.
53823
53824 _Static Semantics_
53825
53826 9/2
53827 {AI95-00255-01AI95-00255-01} {AI95-00423-01AI95-00423-01} A
53828 formal_object_declaration declares a generic formal object. The default
53829 mode is in. For a formal object of mode in, the nominal subtype is the
53830 one denoted by the subtype_mark or access_definition in the declaration
53831 of the formal. For a formal object of mode in out, its type is
53832 determined by the subtype_mark or access_definition in the declaration;
53833 its nominal subtype is nonstatic, even if the subtype_mark denotes a
53834 static subtype; for a composite type, its nominal subtype is
53835 unconstrained if the first subtype of the type is unconstrained[, even
53836 if the subtype_mark denotes a constrained subtype].
53837
53838 9.a/2
53839 Reason: {AI95-00255-01AI95-00255-01} We require that the
53840 subtype is unconstrained because a formal in out acts like a
53841 renaming, and thus the given subtype is ignored for purposes
53842 of matching; any value of the type can be passed. Thus we can
53843 assume only that the object is constrained if the first
53844 subtype is constrained (and thus there can be no unconstrained
53845 subtypes for the type). If we didn't do this, it would be
53846 possible to rename or take 'Access of components that could
53847 disappear due to an assignment to the whole object.
53848
53849 9.b/2
53850 Discussion: {AI95-00423-01AI95-00423-01} The two "even if"
53851 clauses are OK even though they don't mention
53852 access_definitions; an access subtype can neither be a static
53853 subtype nor be a composite type.
53854
53855 10/2
53856 {AI95-00269-01AI95-00269-01} In an instance, a formal_object_declaration
53857 of mode in is a full constant declaration and declares a new stand-alone
53858 constant object whose initialization expression is the actual, whereas a
53859 formal_object_declaration of mode in out declares a view whose
53860 properties are identical to those of the actual.
53861
53862 10.a/2
53863 Ramification: {AI95-00287-01AI95-00287-01} These rules imply
53864 that generic formal objects of mode in are passed by copy (or
53865 are built-in-place for a limited type), whereas generic formal
53866 objects of mode in out are passed by reference.
53867
53868 10.b
53869 Initialization and finalization happen for the constant
53870 declared by a formal_object_declaration of mode in as for any
53871 constant; see *note 3.3.1::, "*note 3.3.1:: Object
53872 Declarations" and *note 7.6::, "*note 7.6:: Assignment and
53873 Finalization".
53874
53875 10.c
53876 In an instance, the subtype of a generic formal object of mode
53877 in is as for the equivalent constant. In an instance, the
53878 subtype of a generic formal object of mode in out is the
53879 subtype of the corresponding generic actual.
53880
53881 _Dynamic Semantics_
53882
53883 11
53884 For the evaluation of a generic_association for a formal object of mode
53885 in, a constant object is created, the value of the actual parameter is
53886 converted to the nominal subtype of the formal object, and assigned to
53887 the object[, including any value adjustment -- see *note 7.6::].
53888
53889 11.a
53890 Ramification: This includes evaluating the actual and doing a
53891 subtype conversion, which might raise an exception.
53892
53893 11.b
53894 Discussion: The rule for evaluating a generic_association for
53895 a formal object of mode in out is covered by the general
53896 Dynamic Semantics rule in *note 12.3::.
53897
53898 NOTES
53899
53900 12
53901 6 The constraints that apply to a generic formal object of mode in
53902 out are those of the corresponding generic actual parameter (not
53903 those implied by the subtype_mark that appears in the
53904 formal_object_declaration). Therefore, to avoid confusion, it is
53905 recommended that the name of a first subtype be used for the
53906 declaration of such a formal object.
53907
53908 12.a
53909 Ramification: Constraint checks are done at instantiation time
53910 for formal objects of mode in, but not for formal objects of
53911 mode in out.
53912
53913 _Extensions to Ada 83_
53914
53915 12.b
53916 In Ada 83, it is forbidden to pass a (nongeneric) formal
53917 parameter of mode out, or a subcomponent thereof, to a generic
53918 formal object of mode in out. This restriction is removed in
53919 Ada 95.
53920
53921 _Wording Changes from Ada 83_
53922
53923 12.c
53924 We make "mode" explicit in the syntax. RM83 refers to the
53925 mode without saying what it is. This is also more uniform
53926 with the way (nongeneric) formal parameters are defined.
53927
53928 12.d
53929 We considered allowing mode out in Ada 95, for uniformity with
53930 (nongeneric) formal parameters. The semantics would be
53931 identical for modes in out and out. (Note that generic formal
53932 objects of mode in out are passed by reference. Note that for
53933 (nongeneric) formal parameters that are allowed to be passed
53934 by reference, the semantics of in out and out is the same.
53935 The difference might serve as documentation. The same would
53936 be true for generic formal objects, if out were allowed, so it
53937 would be consistent.) We decided not to make this change,
53938 because it does not produce any important benefit, and any
53939 change has some cost.
53940
53941 _Extensions to Ada 95_
53942
53943 12.e/2
53944 {AI95-00287-01AI95-00287-01} A generic formal in object can
53945 have a limited type. The actual for such an object must be
53946 built-in-place via a function_call or aggregate, see *note
53947 7.5::.
53948
53949 12.f/2
53950 {AI95-00423-01AI95-00423-01} A generic formal object can have
53951 a null_exclusion or an anonymous access type.
53952
53953 _Wording Changes from Ada 95_
53954
53955 12.g/2
53956 {AI95-00255-01AI95-00255-01} Clarified that the nominal
53957 subtype of a composite formal in out object is unconstrained
53958 if the first subtype of the type is unconstrained.
53959
53960 12.h/2
53961 {AI95-00269-01AI95-00269-01} Clarified that a formal in object
53962 can be static when referenced from outside of the instance (by
53963 declaring such an object to be a full constant declaration).
53964
53965 _Extensions to Ada 2005_
53966
53967 12.i/3
53968 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
53969 be used in a formal_object_declaration. This is described in
53970 *note 13.1.1::.
53971
53972 \1f
53973 File: aarm2012.info, Node: 12.5, Next: 12.6, Prev: 12.4, Up: 12
53974
53975 12.5 Formal Types
53976 =================
53977
53978 1/2
53979 {AI95-00442-01AI95-00442-01} [A generic formal subtype can be used to
53980 pass to a generic unit a subtype whose type is in a certain category of
53981 types.]
53982
53983 1.a
53984 Reason: We considered having intermediate syntactic categories
53985 formal_integer_type_definition, formal_real_type_definition,
53986 and formal_fixed_point_definition, to be more uniform with the
53987 syntax rules for non-generic-formal types. However, that
53988 would make the rules for formal types slightly more
53989 complicated, and it would cause confusion, since
53990 formal_discrete_type_definition would not fit into the scheme
53991 very well.
53992
53993 _Syntax_
53994
53995 2/3
53996 {AI05-0213-1AI05-0213-1} formal_type_declaration ::=
53997 formal_complete_type_declaration
53998 | formal_incomplete_type_declaration
53999
54000 2.1/3
54001 {AI05-0183-1AI05-0183-1} {AI05-0213-1AI05-0213-1}
54002 formal_complete_type_declaration ::=
54003 type defining_identifier[discriminant_part] is
54004 formal_type_definition
54005 [aspect_specification];
54006
54007 2.2/3
54008 {AI05-0213-1AI05-0213-1} formal_incomplete_type_declaration ::=
54009 type defining_identifier[discriminant_part] [is tagged];
54010
54011 3/2
54012 {AI95-00251-01AI95-00251-01} formal_type_definition ::=
54013 formal_private_type_definition
54014 | formal_derived_type_definition
54015 | formal_discrete_type_definition
54016 | formal_signed_integer_type_definition
54017 | formal_modular_type_definition
54018 | formal_floating_point_definition
54019 | formal_ordinary_fixed_point_definition
54020 | formal_decimal_fixed_point_definition
54021 | formal_array_type_definition
54022 | formal_access_type_definition
54023 | formal_interface_type_definition
54024
54025 _Legality Rules_
54026
54027 4
54028 For a generic formal subtype, the actual shall be a subtype_mark; it
54029 denotes the (generic) actual subtype.
54030
54031 4.a
54032 Ramification: When we say simply "formal" or "actual" (for a
54033 generic formal that denotes a subtype) we're talking about the
54034 subtype, not the type, since a name that denotes a
54035 formal_type_declaration denotes a subtype, and the
54036 corresponding actual also denotes a subtype.
54037
54038 _Static Semantics_
54039
54040 5
54041 A formal_type_declaration declares a (generic) formal type, and its
54042 first subtype, the (generic) formal subtype.
54043
54044 5.a
54045 Ramification: A subtype (other than the first subtype) of a
54046 generic formal type is not a generic formal subtype.
54047
54048 6/3
54049 {AI95-00442-01AI95-00442-01} {AI05-0213-1AI05-0213-1} The form of a
54050 formal_type_definition determines a category (of types) to which the
54051 formal type belongs. For a formal_private_type_definition the reserved
54052 words tagged and limited indicate the category of types (see *note
54053 12.5.1::). The reserved word tagged also plays this role in the case of
54054 a formal_incomplete_type_declaration. For a
54055 formal_derived_type_definition the category of types is the derivation
54056 class rooted at the ancestor type. For other formal types, the name of
54057 the syntactic category indicates the category of types; a
54058 formal_discrete_type_definition defines a discrete type, and so on.
54059
54060 6.a
54061 Reason: This rule is clearer with the flat syntax rule for
54062 formal_type_definition given above. Adding
54063 formal_integer_type_definition and others would make this rule
54064 harder to state clearly.
54065
54066 6.b/2
54067 {AI95-00442-01AI95-00442-01} We use "category' rather than
54068 "class" above, because the requirement that classes are closed
54069 under derivation is not important here. Moreover, there are
54070 interesting categories that are not closed under derivation.
54071 For instance, limited and interface are categories that do not
54072 form classes.
54073
54074 _Legality Rules_
54075
54076 7/2
54077 {AI95-00442-01AI95-00442-01} The actual type shall be in the category
54078 determined for the formal.
54079
54080 7.a/2
54081 Ramification: {AI95-00442-01AI95-00442-01} For example, if the
54082 category determined for the formal is the category of all
54083 discrete types, then the actual has to be discrete.
54084
54085 7.b/2
54086 {AI95-00442-01AI95-00442-01} Note that this rule does not
54087 require the actual to belong to every category to which the
54088 formal belongs. For example, formal private types are in the
54089 category of composite types, but the actual need not be
54090 composite. Furthermore, one can imagine an infinite number of
54091 categories that are just arbitrary sets of types (even though
54092 we don't give them names, since they are uninteresting). We
54093 don't want this rule to apply to those categories.
54094
54095 7.c/2
54096 {AI95-00114-01AI95-00114-01} {AI95-00442-01AI95-00442-01}
54097 "Limited" is not an "interesting" category, but "nonlimited"
54098 is; it is legal to pass a nonlimited type to a limited formal
54099 type, but not the other way around. The reserved word limited
54100 really represents a category containing both limited and
54101 nonlimited types. "Private" is not a category for this
54102 purpose; a generic formal private type accepts both private
54103 and nonprivate actual types.
54104
54105 7.d/2
54106 {AI95-00442-01AI95-00442-01} It is legal to pass a class-wide
54107 subtype as the actual if it is in the right category, so long
54108 as the formal has unknown discriminants.
54109
54110 _Static Semantics_
54111
54112 8/3
54113 {8652/00378652/0037} {AI95-00043-01AI95-00043-01}
54114 {AI95-00233-01AI95-00233-01} {AI95-00442-01AI95-00442-01}
54115 {AI05-0029-1AI05-0029-1} [The formal type also belongs to each category
54116 that contains the determined category.] The primitive subprograms of
54117 the type are as for any type in the determined category. For a formal
54118 type other than a formal derived type, these are the predefined
54119 operators of the type. For an elementary formal type, the predefined
54120 operators are implicitly declared immediately after the declaration of
54121 the formal type. For a composite formal type, the predefined operators
54122 are implicitly declared either immediately after the declaration of the
54123 formal type, or later immediately within the declarative region in which
54124 the type is declared according to the rules of *note 7.3.1::. In an
54125 instance, the copy of such an implicit declaration declares a view of
54126 the predefined operator of the actual type, even if this operator has
54127 been overridden for the actual type and even if it is never declared for
54128 the actual type. [The rules specific to formal derived types are given
54129 in *note 12.5.1::.]
54130
54131 8.a/2
54132 Ramification: {AI95-00442-01AI95-00442-01} All properties of
54133 the type are as for any type in the category. Some examples:
54134 The primitive operations available are as defined by the
54135 language for each category. The form of constraint applicable
54136 to a formal type in a subtype_indication depends on the
54137 category of the type as for a nonformal type. The formal type
54138 is tagged if and only if it is declared as a tagged private
54139 type, or as a type derived from a (visibly) tagged type.
54140 (Note that the actual type might be tagged even if the formal
54141 type is not.)
54142
54143 8.b/3
54144 Reason: {AI05-0029-1AI05-0029-1} The somewhat cryptic phrase
54145 "even if it is never declared" is intended to deal with the
54146 following oddity:
54147
54148 8.c/3
54149 package Q is
54150 type T is limited private;
54151 private
54152 type T is range 1 .. 10;
54153 end Q;
54154
54155 8.d/3
54156 generic
54157 type A is array (Positive range <>) of T;
54158 package Q.G is
54159 A1, A2 : A (1 .. 1);
54160 private
54161 B : Boolean := A1 = A2;
54162 end Q.G;
54163
54164 8.e/3
54165 with Q.G;
54166 package R is
54167 type C is array (Positive range <>) of Q.T;
54168
54169 8.f/3
54170 package I is new Q.G (C); -- Where is the predefined "=" for C?
54171 end R;
54172
54173 8.g/3
54174 An "=" is available for the formal type A in the private part
54175 of Q.G. However, no "=" operator is ever declared for type C,
54176 because its component type Q.T is limited. Still, in the
54177 instance I the name "=" declares a view of the "=" for C which
54178 exists-but-is-never-declared.
54179
54180 NOTES
54181
54182 9
54183 7 Generic formal types, like all types, are not named. Instead, a
54184 name can denote a generic formal subtype. Within a generic unit, a
54185 generic formal type is considered as being distinct from all other
54186 (formal or nonformal) types.
54187
54188 9.a
54189 Proof: This follows from the fact that each
54190 formal_type_declaration declares a type.
54191
54192 10
54193 8 A discriminant_part is allowed only for certain kinds of types,
54194 and therefore only for certain kinds of generic formal types. See
54195 *note 3.7::.
54196
54197 10.a
54198 Ramification: The term "formal floating point type" refers to
54199 a type defined by a formal_floating_point_definition. It does
54200 not include a formal derived type whose ancestor is floating
54201 point. Similar terminology applies to the other kinds of
54202 formal_type_definition.
54203
54204 _Examples_
54205
54206 11
54207 Examples of generic formal types:
54208
54209 12
54210 type Item is private;
54211 type Buffer(Length : Natural) is limited private;
54212
54213 13
54214 type Enum is (<>);
54215 type Int is range <>;
54216 type Angle is delta <>;
54217 type Mass is digits <>;
54218
54219 14
54220 type Table is array (Enum) of Item;
54221
54222 15
54223 Example of a generic formal part declaring a formal integer type:
54224
54225 16
54226 generic
54227 type Rank is range <>;
54228 First : Rank := Rank'First;
54229 Second : Rank := First + 1; -- the operator "+" of the type Rank
54230
54231 _Wording Changes from Ada 83_
54232
54233 16.a
54234 RM83 has separate sections "Generic Formal Xs" and "Matching
54235 Rules for Formal Xs" (for various X's) with most of the text
54236 redundant between the two. We have combined the two in order
54237 to reduce the redundancy. In RM83, there is no "Matching
54238 Rules for Formal Types" section; nor is there a "Generic
54239 Formal Y Types" section (for Y = Private, Scalar, Array, and
54240 Access). This causes, for example, the duplication across all
54241 the "Matching Rules for Y Types" sections of the rule that the
54242 actual passed to a formal type shall be a subtype; the new
54243 organization avoids that problem.
54244
54245 16.b
54246 The matching rules are stated more concisely.
54247
54248 16.c
54249 We no longer consider the multiplying operators that deliver a
54250 result of type universal_fixed to be predefined for the
54251 various types; there is only one of each in package Standard.
54252 Therefore, we need not mention them here as RM83 had to.
54253
54254 _Wording Changes from Ada 95_
54255
54256 16.d/2
54257 {8652/00378652/0037} {AI95-00043-01AI95-00043-01}
54258 {AI95-00233-01AI95-00233-01} Corrigendum 1 corrected the
54259 wording to properly define the location where operators are
54260 defined for formal array types. The wording here was
54261 inconsistent with that in *note 7.3.1::, "*note 7.3.1::
54262 Private Operations". For the Amendment, this wording was
54263 corrected again, because it didn't reflect the Corrigendum 1
54264 revisions in *note 7.3.1::.
54265
54266 16.e/2
54267 {AI95-00251-01AI95-00251-01} Formal interface types are
54268 defined; see *note 12.5.5::, "*note 12.5.5:: Formal Interface
54269 Types".
54270
54271 16.f/2
54272 {AI95-00442-01AI95-00442-01} We use "determines a category"
54273 rather than class, since not all interesting properties form a
54274 class.
54275
54276 _Extensions to Ada 2005_
54277
54278 16.g/3
54279 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
54280 be used in a formal_type_declaration. This is described in
54281 *note 13.1.1::.
54282
54283 _Wording Changes from Ada 2005_
54284
54285 16.h/3
54286 {AI05-0029-1AI05-0029-1} Correction: Updated the wording to
54287 acknowledge the possibility of operations that are never
54288 declared for an actual type but still can be used inside of a
54289 generic unit.
54290
54291 16.i/3
54292 {AI05-0213-1AI05-0213-1} {AI05-0299-1AI05-0299-1} Formal
54293 incomplete types are added; these are documented as an
54294 extension in the next subclause.
54295
54296 * Menu:
54297
54298 * 12.5.1 :: Formal Private and Derived Types
54299 * 12.5.2 :: Formal Scalar Types
54300 * 12.5.3 :: Formal Array Types
54301 * 12.5.4 :: Formal Access Types
54302 * 12.5.5 :: Formal Interface Types
54303
54304 \1f
54305 File: aarm2012.info, Node: 12.5.1, Next: 12.5.2, Up: 12.5
54306
54307 12.5.1 Formal Private and Derived Types
54308 ---------------------------------------
54309
54310 1/3
54311 {AI95-00442-01AI95-00442-01} {AI05-0213-1AI05-0213-1} [In its most
54312 general form, the category determined for a formal private type is all
54313 types, but the category can be restricted to only nonlimited types or to
54314 only tagged types. Similarly, the category for a formal incomplete type
54315 is all types but the category can be restricted to only tagged types;
54316 unlike other formal types, the actual type does not need to be able to
54317 be frozen (see *note 13.14::). The category determined for a formal
54318 derived type is the derivation class rooted at the ancestor type.]
54319
54320 1.a/3
54321 Proof: {AI95-00442-01AI95-00442-01} {AI05-0213-1AI05-0213-1}
54322 The first two rules are given normatively below, and the third
54323 rule is given normatively in *note 12.5::; they are repeated
54324 here to give a capsule summary of what this subclause is
54325 about.
54326
54327 1.b/3
54328 Ramification: {AI05-0213-1AI05-0213-1} Since the actual of a
54329 formal incomplete type does not need to be able to be frozen,
54330 the actual can be an incomplete type or a partial view before
54331 its completion.
54332
54333 _Syntax_
54334
54335 2
54336 formal_private_type_definition ::=
54337 [[abstract] tagged] [limited] private
54338
54339 3/2
54340 {AI95-00251-01AI95-00251-01} {AI95-00419-01AI95-00419-01}
54341 {AI95-00443-01AI95-00443-01} formal_derived_type_definition ::=
54342 [abstract] [limited | synchronized] new subtype_mark [[and
54343 interface_list]with private]
54344
54345 _Legality Rules_
54346
54347 4
54348 If a generic formal type declaration has a known_discriminant_part, then
54349 it shall not include a default_expression for a discriminant.
54350
54351 4.a
54352 Ramification: Consequently, a generic formal subtype with a
54353 known_discriminant_part is an indefinite subtype, so the
54354 declaration of a stand-alone variable has to provide a
54355 constraint on such a subtype, either explicitly, or by its
54356 initial value.
54357
54358 5/3
54359 {AI95-00401-01AI95-00401-01} {AI95-00419-01AI95-00419-01}
54360 {AI95-00443-01AI95-00443-01} {AI05-0237-1AI05-0237-1} The ancestor
54361 subtype of a formal derived type is the subtype denoted by the
54362 subtype_mark of the formal_derived_type_definition. For a formal
54363 derived type declaration, the reserved words with private shall appear
54364 if and only if the ancestor type is a tagged type; in this case the
54365 formal derived type is a private extension of the ancestor type and the
54366 ancestor shall not be a class-wide type. [Similarly, an interface_list
54367 or the optional reserved words abstract or synchronized shall appear
54368 only if the ancestor type is a tagged type]. The reserved word limited
54369 or synchronized shall appear only if the ancestor type [and any
54370 progenitor types] are limited types. The reserved word synchronized
54371 shall appear (rather than limited) if the ancestor type or any of the
54372 progenitor types are synchronized interfaces. The ancestor type shall
54373 be a limited interface if the reserved word synchronized appears.
54374
54375 5.a
54376 Reason: We use the term "ancestor" here instead of "parent"
54377 because the actual can be any descendant of the ancestor, not
54378 necessarily a direct descendant.
54379
54380 5.b/3
54381 {AI95-00419-01AI95-00419-01} {AI05-0005-1AI05-0005-1} We
54382 require the ancestor type to be limited when limited appears
54383 so that we avoid oddities like limited integer types.
54384 Normally, limited means "match anything" for a generic formal,
54385 but it was felt that allowing limited elementary types to be
54386 declared was just too weird. Integer still matches a formal
54387 limited private type; it is only a problem when the type is
54388 known to be elementary. Note that the progenitors are
54389 required to be limited by rules in *note 3.9.4::, thus that
54390 part of the rule is redundant.
54391
54392 5.c/2
54393 {AI95-00443-01AI95-00443-01} We require that synchronized
54394 appear if the ancestor or any of the progenitors are
54395 synchronized, so that property is explicitly given in the
54396 program text - it is not automatically inherited from the
54397 ancestors. However, it can be given even if neither the
54398 ancestor nor the progenitors are synchronized.
54399
54400 5.1/3
54401 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01}
54402 {AI95-00443-01AI95-00443-01} {AI05-0087-1AI05-0087-1} The actual type
54403 for a formal derived type shall be a descendant of [the ancestor type
54404 and] every progenitor of the formal type. If the formal type is
54405 nonlimited, the actual type shall be nonlimited. If the reserved word
54406 synchronized appears in the declaration of the formal derived type, the
54407 actual type shall be a synchronized tagged type.
54408
54409 5.d/2
54410 Proof: The actual type has to be a descendant of the ancestor
54411 type, in order that it be in the correct class. Thus, that
54412 part of the rule is redundant.
54413
54414 5.e/3
54415 Discussion: {AI05-0005-1AI05-0005-1} For a nonformal private
54416 extension, we require the partial view to be synchronized if
54417 the full view is synchronized tagged. This does not apply to
54418 a formal private extension -- it is OK if the formal is not
54419 synchronized. Any attempt to extend the formal type will be
54420 rechecked in the instance, where the rule disallowing
54421 extending a synchronized noninterface type will be enforced.
54422 This is consistent with the "no hidden interfaces" rule also
54423 applying only to nonformal private extensions, as well as the
54424 rule that a limited nonformal private extension implies a
54425 limited full type. Formal private extensions are exempted
54426 from all these rules to enable the construction of generics
54427 that can be used with the widest possible range of types. In
54428 particular, an indefinite tagged limited formal private type
54429 can match any "concrete" actual tagged type.
54430
54431 5.f/3
54432 {AI05-0087-1AI05-0087-1} A type (including formal types)
54433 derived from a limited interface could be nonlimited; we do
54434 not want a limited type derived from such an interface to
54435 match a nonlimited formal derived type. Otherwise, we could
54436 assign limited objects. Thus, we have to explicitly ban this
54437 case.
54438
54439 6/3
54440 {AI05-0213-1AI05-0213-1} If a formal private or derived subtype is
54441 definite, then the actual subtype shall also be definite.
54442
54443 6.a
54444 Ramification: On the other hand, for an indefinite formal
54445 subtype, the actual can be either definite or indefinite.
54446
54447 6.1/3
54448 {AI05-0213-1AI05-0213-1} A formal_incomplete_type_declaration declares a
54449 formal incomplete type. The only view of a formal incomplete type is an
54450 incomplete view. [Thus, a formal incomplete type is subject to the same
54451 usage restrictions as any other incomplete type -- see *note 3.10.1::.]
54452
54453 7
54454 For a generic formal derived type with no discriminant_part:
54455
54456 8
54457 * If the ancestor subtype is constrained, the actual subtype shall be
54458 constrained, and shall be statically compatible with the ancestor;
54459
54460 8.a
54461 Ramification: In other words, any constraint on the ancestor
54462 subtype is considered part of the "contract."
54463
54464 9
54465 * If the ancestor subtype is an unconstrained access or composite
54466 subtype, the actual subtype shall be unconstrained.
54467
54468 9.a
54469 Reason: This rule ensures that if a composite constraint is
54470 allowed on the formal, one is also allowed on the actual. If
54471 the ancestor subtype is an unconstrained scalar subtype, the
54472 actual is allowed to be constrained, since a scalar constraint
54473 does not cause further constraints to be illegal.
54474
54475 10
54476 * If the ancestor subtype is an unconstrained discriminated subtype,
54477 then the actual shall have the same number of discriminants, and
54478 each discriminant of the actual shall correspond to a discriminant
54479 of the ancestor, in the sense of *note 3.7::.
54480
54481 10.a
54482 Reason: This ensures that if a discriminant constraint is
54483 given on the formal subtype, the corresponding constraint in
54484 the instance will make sense, without additional run-time
54485 checks. This is not necessary for arrays, since the bounds
54486 cannot be overridden in a type extension. An
54487 unknown_discriminant_part may be used to relax these matching
54488 requirements.
54489
54490 10.1/2
54491 * {AI95-00231-01AI95-00231-01} If the ancestor subtype is an access
54492 subtype, the actual subtype shall exclude null if and only if the
54493 ancestor subtype excludes null.
54494
54495 10.b/2
54496 Reason: We require that the "excludes null" property match,
54497 because it would be difficult to write a correct generic for a
54498 formal access type without knowing this property. Many
54499 typical algorithms and techniques will not work for a subtype
54500 that excludes null (setting an unused component to null,
54501 default-initialized objects, and so on). We want this sort of
54502 requirement to be reflected in the contract of the generic.
54503
54504 11/3
54505 {AI05-0213-1AI05-0213-1} The declaration of a formal derived type shall
54506 not have a known_discriminant_part. For a generic formal private or
54507 incomplete type with a known_discriminant_part:
54508
54509 12
54510 * The actual type shall be a type with the same number of
54511 discriminants.
54512
54513 13
54514 * The actual subtype shall be unconstrained.
54515
54516 14
54517 * The subtype of each discriminant of the actual type shall
54518 statically match the subtype of the corresponding discriminant of
54519 the formal type.
54520
54521 14.a
54522 Reason: We considered defining the first and third rule to be
54523 called "subtype conformance" for discriminant_parts. We
54524 rejected that idea, because it would require implicit
54525 (inherited) discriminant_parts, which seemed like too much
54526 mechanism.
54527
54528 15
54529 [For a generic formal type with an unknown_discriminant_part, the actual
54530 may, but need not, have discriminants, and may be definite or
54531 indefinite.]
54532
54533 _Static Semantics_
54534
54535 16/2
54536 {AI95-00442-01AI95-00442-01} The category determined for a formal
54537 private type is as follows:
54538
54539 17/2
54540 Type Definition Determined Category
54541
54542 limited private the category of all types
54543 private the category of all nonlimited types
54544 tagged limited private the category of all tagged types
54545 tagged private the category of all nonlimited tagged types
54546
54547 18
54548 [The presence of the reserved word abstract determines whether the
54549 actual type may be abstract.]
54550
54551 18.1/3
54552 {AI05-0213-1AI05-0213-1} The category determined for a formal incomplete
54553 type is the category of all types, unless the formal_type_declaration
54554 includes the reserved word tagged; in this case, it is the category of
54555 all tagged types.
54556
54557 19
54558 A formal private or derived type is a private or derived type,
54559 respectively. A formal derived tagged type is a private extension. [A
54560 formal private or derived type is abstract if the reserved word abstract
54561 appears in its declaration.]
54562
54563 20/3
54564 {AI95-00233-01AI95-00233-01} {AI05-0110-1AI05-0110-1} For a formal
54565 derived type, the characteristics (including components, but excluding
54566 discriminants if there is a new discriminant_part), predefined
54567 operators, and inherited user-defined primitive subprograms are
54568 determined by its ancestor type and its progenitor types (if any), in
54569 the same way that those of a derived type are determined by those of its
54570 parent type and its progenitor types (see *note 3.4:: and *note
54571 7.3.1::).
54572
54573 21/3
54574 {8652/00388652/0038} {AI95-00202AI95-00202} {AI95-00233-01AI95-00233-01}
54575 {AI95-00401-01AI95-00401-01} {AI05-0029-1AI05-0029-1}
54576 {AI05-0110-1AI05-0110-1} In an instance, the copy of an implicit
54577 declaration of a primitive subprogram of a formal derived type declares
54578 a view of the corresponding primitive subprogram of the ancestor or
54579 progenitor of the formal derived type, even if this primitive has been
54580 overridden for the actual type and even if it is never declared for the
54581 actual type. When the ancestor or progenitor of the formal derived type
54582 is itself a formal type, the copy of the implicit declaration declares a
54583 view of the corresponding copied operation of the ancestor or
54584 progenitor. [In the case of a formal private extension, however, the
54585 tag of the formal type is that of the actual type, so if the tag in a
54586 call is statically determined to be that of the formal type, the body
54587 executed will be that corresponding to the actual type.]
54588
54589 21.a/3
54590 Ramification: {AI95-00401-01AI95-00401-01}
54591 {AI05-0239-1AI05-0239-1} The above rule defining the
54592 properties of primitive subprograms in an instance applies
54593 even if the subprogram has been overridden or hidden for the
54594 actual type. This rule is necessary for untagged types,
54595 because their primitive subprograms might have been overridden
54596 by operations that are not subtype conformant with the
54597 operations defined for the class. For tagged types, the rule
54598 still applies, but the primitive subprograms will dispatch to
54599 the appropriate implementation based on the type and tag of
54600 the operands. Even for tagged types, the formal parameter
54601 names and default_expressions are determined by those of the
54602 primitive subprograms of the specified ancestor type (or
54603 progenitor type, for subprograms inherited from an interface
54604 type).
54605
54606 22/1
54607 For a prefix S that denotes a formal indefinite subtype, the following
54608 attribute is defined:
54609
54610 23/3
54611 S'Definite
54612 {AI05-0264-1AI05-0264-1} S'Definite yields True if the
54613 actual subtype corresponding to S is definite; otherwise,
54614 it yields False. The value of this attribute is of the
54615 predefined type Boolean.
54616
54617 23.a/2
54618 Discussion: {AI95-00114-01AI95-00114-01} Whether an actual
54619 subtype is definite or indefinite may have a major effect on
54620 the algorithm used in a generic. For example, in a generic
54621 I/O package, whether to use fixed-length or variable-length
54622 records could depend on whether the actual is definite or
54623 indefinite. This attribute is essentially a replacement for
54624 the Constrained attribute, which is now considered obsolete.
54625
54626 _Dynamic Semantics_
54627
54628 23.1/3
54629 {AI95-00158-01AI95-00158-01} {AI05-0071-1AI05-0071-1} In the case where
54630 a formal type has unknown discriminants, and the actual type is a
54631 class-wide type T'Class:
54632
54633 23.2/2
54634 * {AI95-00158-01AI95-00158-01} For the purposes of defining the
54635 primitive operations of the formal type, each of the primitive
54636 operations of the actual type is considered to be a subprogram
54637 (with an intrinsic calling convention -- see *note 6.3.1::) whose
54638 body consists of a dispatching call upon the corresponding
54639 operation of T, with its formal parameters as the actual
54640 parameters. If it is a function, the result of the dispatching
54641 call is returned.
54642
54643 23.3/2
54644 * {AI95-00158-01AI95-00158-01} If the corresponding operation of T
54645 has no controlling formal parameters, then the controlling tag
54646 value is determined by the context of the call, according to the
54647 rules for tag-indeterminate calls (see *note 3.9.2:: and *note
54648 5.2::). In the case where the tag would be statically determined
54649 to be that of the formal type, the call raises Program_Error. If
54650 such a function is renamed, any call on the renaming raises
54651 Program_Error.
54652
54653 23.b/2
54654 Discussion: As it states in *note 6.3.1::, the convention of
54655 an inherited subprogram of a generic formal tagged type with
54656 unknown discriminants is intrinsic.
54657
54658 23.c/2
54659 In the case of a corresponding primitive of T with no
54660 controlling formal parameters, the context of the call
54661 provides the controlling tag value for the dispatch. If no
54662 tag is provided by context, Program_Error is raised rather
54663 than resorting to a nondispatching call. For example:
54664
54665 23.d/2
54666 generic
54667 type NT(<>) is new T with private;
54668 -- Assume T has operation "function Empty return T;"
54669 package G is
54670 procedure Test(X : in out NT);
54671 end G;
54672
54673 23.e/2
54674 package body G is
54675 procedure Test(X : in out NT) is
54676 begin
54677 X := Empty; -- Dispatching based on X'Tag takes
54678 -- place if actual is class-wide.
54679 declare
54680 Y : NT := Empty;
54681 -- If actual is class-wide, this raises Program_Error
54682 -- as there is no tag provided by context.
54683 begin
54684 X := Y; -- We never get this far.
54685 end;
54686 end Test;
54687 end G;
54688
54689 23.f/2
54690 type T1 is new T with null record;
54691 package I is new G(T1'Class);
54692
54693 NOTES
54694
54695 24/2
54696 9 {AI95-00442-01AI95-00442-01} In accordance with the general rule
54697 that the actual type shall belong to the category determined for
54698 the formal (see *note 12.5::, "*note 12.5:: Formal Types"):
54699
54700 25
54701 * If the formal type is nonlimited, then so shall be the actual;
54702
54703 26
54704 * For a formal derived type, the actual shall be in the class
54705 rooted at the ancestor subtype.
54706
54707 27
54708 10 The actual type can be abstract only if the formal type is
54709 abstract (see *note 3.9.3::).
54710
54711 27.a
54712 Reason: This is necessary to avoid contract model problems,
54713 since one or more of its primitive subprograms are abstract;
54714 it is forbidden to create objects of the type, or to declare
54715 functions returning the type.
54716
54717 27.b
54718 Ramification: On the other hand, it is OK to pass a
54719 nonabstract actual to an abstract formal -- abstract on the
54720 formal indicates that the actual might be abstract.
54721
54722 28
54723 11 If the formal has a discriminant_part, the actual can be either
54724 definite or indefinite. Otherwise, the actual has to be definite.
54725
54726 _Incompatibilities With Ada 83_
54727
54728 28.a
54729 Ada 83 does not have unknown_discriminant_parts, so it allows
54730 indefinite subtypes to be passed to definite formals, and
54731 applies a legality rule to the instance body. This is a
54732 contract model violation. Ada 95 disallows such cases at the
54733 point of the instantiation. The workaround is to add (<>) as
54734 the discriminant_part of any formal subtype if it is intended
54735 to be used with indefinite actuals. If that's the intent,
54736 then there can't be anything in the generic body that would
54737 require a definite subtype.
54738
54739 28.b
54740 The check for discriminant subtype matching is changed from a
54741 run-time check to a compile-time check.
54742
54743 _Extensions to Ada 95_
54744
54745 28.c/2
54746 {AI95-00251-01AI95-00251-01} {AI95-00401-01AI95-00401-01}
54747 {AI95-00419-01AI95-00419-01} {AI95-00443-01AI95-00443-01} A
54748 generic formal derived type can include progenitors
54749 (interfaces) as well as a primary ancestor. It also may
54750 include limited to indicate that it is a limited type, and
54751 synchronized to indicate that it is a synchronized type.
54752
54753 _Wording Changes from Ada 95_
54754
54755 28.d/2
54756 {8652/00388652/0038} {AI95-00202-01AI95-00202-01} Corrigendum:
54757 Corrected wording to define the operations that are inherited
54758 when the ancestor of a formal type is itself a formal type to
54759 avoid anomalies.
54760
54761 28.e/2
54762 {AI95-00158-01AI95-00158-01} Added a semantic description of
54763 the meaning of operations of an actual class-wide type, as
54764 such a type does not have primitive operations of its own.
54765
54766 28.f/2
54767 {AI95-00231-01AI95-00231-01} Added a matching rule for access
54768 subtypes that exclude null.
54769
54770 28.g/2
54771 {AI95-00233-01AI95-00233-01} The wording for the declaration
54772 of implicit operations is corrected to be consistent with
54773 *note 7.3.1:: as modified by Corrigendum 1.
54774
54775 28.h/2
54776 {AI95-00442-01AI95-00442-01} We change to "determines a
54777 category" as that is the new terminology (it avoids confusion,
54778 since not all interesting properties form a class).
54779
54780 _Incompatibilities With Ada 2005_
54781
54782 28.i/3
54783 {AI05-0087-1AI05-0087-1} Correction: Added wording to prevent
54784 a limited type from being passed to a nonlimited formal
54785 derived type. While this was allowed, it would break the
54786 contract for the limited type, so hopefully no programs
54787 actually depend on that.
54788
54789 _Extensions to Ada 2005_
54790
54791 28.j/3
54792 {AI05-0213-1AI05-0213-1} Formal incomplete types are a new
54793 kind of generic formal; these can be instantiated with
54794 incomplete types and unfrozen private types.
54795
54796 _Wording Changes from Ada 2005_
54797
54798 28.k/3
54799 {AI05-0029-1AI05-0029-1} Correction: Updated the wording to
54800 acknowledge the possibility of operations that are never
54801 declared for an actual type but still can be used inside of a
54802 generic unit.
54803
54804 28.l/3
54805 {AI05-0071-1AI05-0071-1} Correction: Fixed hole that failed to
54806 define what happened for "=" for an untagged private type
54807 whose actual is class-wide.
54808
54809 28.m/3
54810 {AI05-0110-1AI05-0110-1} Correction: Revised the wording for
54811 inheritance of characteristics and operations of formal
54812 derived types to be reuse the rules as defined for derived
54813 types; this should eliminate holes in the wording which have
54814 plagued us since Ada 95 was defined (it has been "corrected"
54815 four previous times).
54816
54817 28.n/3
54818 {AI05-0237-1AI05-0237-1} Correction: Added missing rule for
54819 the ancestors of formal derived types. The added rule would
54820 formally be incompatible, but since it would be impossible to
54821 instantiate any such generic, this cannot happen outside of
54822 test suites and thus is not documented as an incompatibility.
54823
54824 \1f
54825 File: aarm2012.info, Node: 12.5.2, Next: 12.5.3, Prev: 12.5.1, Up: 12.5
54826
54827 12.5.2 Formal Scalar Types
54828 --------------------------
54829
54830 1/2
54831 {AI95-00442-01AI95-00442-01} A formal scalar type is one defined by any
54832 of the formal_type_definitions in this subclause. [The category
54833 determined for a formal scalar type is the category of all discrete,
54834 signed integer, modular, floating point, ordinary fixed point, or
54835 decimal types.]
54836
54837 1.a/2
54838 Proof: {AI95-00442-01AI95-00442-01} The second rule follows
54839 from the rule in *note 12.5:: that says that the category is
54840 determined by the one given in the name of the syntax
54841 production. The effect of the rule is repeated here to give a
54842 capsule summary of what this subclause is about.
54843
54844 1.b/2
54845 Ramification: {AI95-00442-01AI95-00442-01} The "category of a
54846 type" includes any classes that the type belongs to.
54847
54848 _Syntax_
54849
54850 2
54851 formal_discrete_type_definition ::= (<>)
54852
54853 3
54854 formal_signed_integer_type_definition ::= range <>
54855
54856 4
54857 formal_modular_type_definition ::= mod <>
54858
54859 5
54860 formal_floating_point_definition ::= digits <>
54861
54862 6
54863 formal_ordinary_fixed_point_definition ::= delta <>
54864
54865 7
54866 formal_decimal_fixed_point_definition ::= delta <> digits <>
54867
54868 _Legality Rules_
54869
54870 8
54871 The actual type for a formal scalar type shall not be a nonstandard
54872 numeric type.
54873
54874 8.a
54875 Reason: This restriction is necessary because nonstandard
54876 numeric types have some number of restrictions on their use,
54877 which could cause contract model problems in a generic body.
54878 Note that nonstandard numeric types can be passed to formal
54879 derived and formal private subtypes, assuming they obey all
54880 the other rules, and assuming the implementation allows it
54881 (being nonstandard means the implementation might disallow
54882 anything).
54883
54884 NOTES
54885
54886 9
54887 12 The actual type shall be in the class of types implied by the
54888 syntactic category of the formal type definition (see *note 12.5::,
54889 "*note 12.5:: Formal Types"). For example, the actual for a
54890 formal_modular_type_definition shall be a modular type.
54891
54892 _Wording Changes from Ada 95_
54893
54894 9.a/2
54895 {AI95-00442-01AI95-00442-01} We change to "determines a
54896 category" as that is the new terminology (it avoids confusion,
54897 since not all interesting properties form a class).
54898
54899 \1f
54900 File: aarm2012.info, Node: 12.5.3, Next: 12.5.4, Prev: 12.5.2, Up: 12.5
54901
54902 12.5.3 Formal Array Types
54903 -------------------------
54904
54905 1/2
54906 {AI95-00442-01AI95-00442-01} [The category determined for a formal array
54907 type is the category of all array types.]
54908
54909 1.a/2
54910 Proof: {AI95-00442-01AI95-00442-01} This rule follows from the
54911 rule in *note 12.5:: that says that the category is determined
54912 by the one given in the name of the syntax production. The
54913 effect of the rule is repeated here to give a capsule summary
54914 of what this subclause is about.
54915
54916 _Syntax_
54917
54918 2
54919 formal_array_type_definition ::= array_type_definition
54920
54921 _Legality Rules_
54922
54923 3
54924 The only form of discrete_subtype_definition that is allowed within the
54925 declaration of a generic formal (constrained) array subtype is a
54926 subtype_mark.
54927
54928 3.a
54929 Reason: The reason is the same as for forbidding constraints
54930 in subtype_indications (see *note 12.1::).
54931
54932 4
54933 For a formal array subtype, the actual subtype shall satisfy the
54934 following conditions:
54935
54936 5
54937 * The formal array type and the actual array type shall have the same
54938 dimensionality; the formal subtype and the actual subtype shall be
54939 either both constrained or both unconstrained.
54940
54941 6
54942 * For each index position, the index types shall be the same, and the
54943 index subtypes (if unconstrained), or the index ranges (if
54944 constrained), shall statically match (see *note 4.9.1::).
54945
54946 7
54947 * The component subtypes of the formal and actual array types shall
54948 statically match.
54949
54950 8
54951 * If the formal type has aliased components, then so shall the
54952 actual.
54953
54954 8.a
54955 Ramification: On the other hand, if the formal's components
54956 are not aliased, then the actual's components can be either
54957 aliased or not.
54958
54959 _Examples_
54960
54961 9
54962 Example of formal array types:
54963
54964 10
54965 -- given the generic package
54966
54967 11
54968 generic
54969 type Item is private;
54970 type Index is (<>);
54971 type Vector is array (Index range <>) of Item;
54972 type Table is array (Index) of Item;
54973 package P is
54974 ...
54975 end P;
54976
54977 12
54978 -- and the types
54979
54980 13
54981 type Mix is array (Color range <>) of Boolean;
54982 type Option is array (Color) of Boolean;
54983
54984 14
54985 -- then Mix can match Vector and Option can match Table
54986
54987 15
54988 package R is new P(Item => Boolean, Index => Color,
54989 Vector => Mix, Table => Option);
54990
54991 16
54992 -- Note that Mix cannot match Table and Option cannot match Vector
54993
54994 _Incompatibilities With Ada 83_
54995
54996 16.a
54997 The check for matching of component subtypes and index
54998 subtypes or index ranges is changed from a run-time check to a
54999 compile-time check. The Ada 83 rule that "If the component
55000 type is not a scalar type, then the component subtypes shall
55001 be either both constrained or both unconstrained" is removed,
55002 since it is subsumed by static matching. Likewise, the rules
55003 requiring that component types be the same is subsumed.
55004
55005 _Wording Changes from Ada 95_
55006
55007 16.b/2
55008 {AI95-00442-01AI95-00442-01} We change to "determines a
55009 category" as that is the new terminology (it avoids confusion,
55010 since not all interesting properties form a class).
55011
55012 \1f
55013 File: aarm2012.info, Node: 12.5.4, Next: 12.5.5, Prev: 12.5.3, Up: 12.5
55014
55015 12.5.4 Formal Access Types
55016 --------------------------
55017
55018 1/2
55019 {AI95-00442-01AI95-00442-01} [The category determined for a formal
55020 access type is the category of all access types.]
55021
55022 1.a/2
55023 Proof: {AI95-00442-01AI95-00442-01} This rule follows from the
55024 rule in *note 12.5:: that says that the category is determined
55025 by the one given in the name of the syntax production. The
55026 effect of the rule is repeated here to give a capsule summary
55027 of what this subclause is about.
55028
55029 _Syntax_
55030
55031 2
55032 formal_access_type_definition ::= access_type_definition
55033
55034 _Legality Rules_
55035
55036 3
55037 For a formal access-to-object type, the designated subtypes of the
55038 formal and actual types shall statically match.
55039
55040 4/2
55041 {AI95-00231-01AI95-00231-01} If and only if the general_access_modifier
55042 constant applies to the formal, the actual shall be an
55043 access-to-constant type. If the general_access_modifier all applies to
55044 the formal, then the actual shall be a general access-to-variable type
55045 (see *note 3.10::). If and only if the formal subtype excludes null,
55046 the actual subtype shall exclude null.
55047
55048 4.a
55049 Ramification: If no _modifier applies to the formal, then the
55050 actual type may be either a pool-specific or a general
55051 access-to-variable type.
55052
55053 4.a.1/1
55054 Reason: {8652/01098652/0109} {AI95-00025-01AI95-00025-01}
55055 Matching an access-to-variable to a formal access-to-constant
55056 type cannot be allowed. If it were allowed, it would be
55057 possible to create an access-to-variable value designating a
55058 constant.
55059
55060 4.b/2
55061 {AI95-00231-01AI95-00231-01} We require that the "excludes
55062 null" property match, because it would be difficult to write a
55063 correct generic for a formal access type without knowing this
55064 property. Many typical algorithms and techniques will not
55065 work for a subtype that excludes null (setting an unused
55066 component to null, default-initialized objects, and so on).
55067 Even Ada.Unchecked_Deallocation would fail for a subtype that
55068 excludes null. Most generics would end up with comments
55069 saying that they are not intended to work for subtypes that
55070 exclude null. We would rather that this sort of requirement
55071 be reflected in the contract of the generic.
55072
55073 5/3
55074 {AI05-0239-1AI05-0239-1} {AI05-0288-1AI05-0288-1} For a formal
55075 access-to-subprogram subtype, the designated profiles of the formal and
55076 the actual shall be subtype conformant.
55077
55078 _Examples_
55079
55080 6
55081 Example of formal access types:
55082
55083 7
55084 -- the formal types of the generic package
55085
55086 8
55087 generic
55088 type Node is private;
55089 type Link is access Node;
55090 package P is
55091 ...
55092 end P;
55093
55094 9
55095 -- can be matched by the actual types
55096
55097 10
55098 type Car;
55099 type Car_Name is access Car;
55100
55101 11
55102 type Car is
55103 record
55104 Pred, Succ : Car_Name;
55105 Number : License_Number;
55106 Owner : Person;
55107 end record;
55108
55109 12
55110 -- in the following generic instantiation
55111
55112 13
55113 package R is new P(Node => Car, Link => Car_Name);
55114
55115 _Incompatibilities With Ada 83_
55116
55117 13.a
55118 The check for matching of designated subtypes is changed from
55119 a run-time check to a compile-time check. The Ada 83 rule
55120 that "If the designated type is other than a scalar type, then
55121 the designated subtypes shall be either both constrained or
55122 both unconstrained" is removed, since it is subsumed by static
55123 matching.
55124
55125 _Extensions to Ada 83_
55126
55127 13.b
55128 Formal access-to-subprogram subtypes and formal general access
55129 types are new concepts.
55130
55131 _Wording Changes from Ada 95_
55132
55133 13.c/2
55134 {AI95-00231-01AI95-00231-01} Added a matching rule for
55135 subtypes that exclude null.
55136
55137 13.d/2
55138 {AI95-00442-01AI95-00442-01} We change to "determines a
55139 category" as that is the new terminology (it avoids confusion,
55140 since not all interesting properties form a class).
55141
55142 _Incompatibilities With Ada 2005_
55143
55144 13.e/3
55145 {AI05-0288-1AI05-0288-1} Correction: Matching of formal
55146 access-to-subprogram types now uses subtype conformance rather
55147 than mode conformance, which is needed to plug a hole. This
55148 could cause some instantiations legal in Ada 95 and Ada 2005
55149 to be rejected in Ada 2012. We believe that formal
55150 access-to-subprogram types occur rarely, and actuals that are
55151 not subtype conformant are rarer still, so this should not
55152 happen often. (In addition, one popular compiler has a bug
55153 that causes such instances to be rejected, so no code compiled
55154 with that compiler could have an incompatibility.)
55155
55156 \1f
55157 File: aarm2012.info, Node: 12.5.5, Prev: 12.5.4, Up: 12.5
55158
55159 12.5.5 Formal Interface Types
55160 -----------------------------
55161
55162 1/2
55163 {AI95-00251-01AI95-00251-01} {AI95-00442-01AI95-00442-01} [The category
55164 determined for a formal interface type is the category of all interface
55165 types.]
55166
55167 1.a/2
55168 Proof: {AI95-00442-01AI95-00442-01} This rule follows from the
55169 rule in *note 12.5:: that says that the category is determined
55170 by the one given in the name of the syntax production. The
55171 effect of the rule is repeated here to give a capsule summary
55172 of what this subclause is about.
55173
55174 1.b/2
55175 Ramification: Here we're taking advantage of our switch in
55176 terminology from "determined class" to "determined category";
55177 by saying "category" rather than "class", we require that any
55178 actual type be an interface type, not just some type derived
55179 from an interface type.
55180
55181 _Syntax_
55182
55183 2/2
55184 {AI95-00251-01AI95-00251-01} formal_interface_type_definition ::=
55185 interface_type_definition
55186
55187 _Legality Rules_
55188
55189 3/2
55190 {AI95-00251AI95-00251} {AI95-00401AI95-00401} The actual type shall be a
55191 descendant of every progenitor of the formal type.
55192
55193 4/2
55194 {AI95-00345AI95-00345} The actual type shall be a limited, task,
55195 protected, or synchronized interface if and only if the formal type is
55196 also, respectively, a limited, task, protected, or synchronized
55197 interface.
55198
55199 4.a/2
55200 Discussion: We require the kind of interface type to match
55201 exactly because without that it is almost impossible to
55202 properly implement the interface.
55203
55204 _Examples_
55205
55206 5/2
55207 {AI95-00433-01AI95-00433-01} type Root_Work_Item is tagged private;
55208
55209 6/2
55210 {AI95-00433-01AI95-00433-01} generic
55211 type Managed_Task is task interface;
55212 type Work_Item(<>) is new Root_Work_Item with private;
55213 package Server_Manager is
55214 task type Server is new Managed_Task with
55215 entry Start(Data : in out Work_Item);
55216 end Server;
55217 end Server_Manager;
55218
55219 7/2
55220 {AI95-00433-01AI95-00433-01} This generic allows an application to
55221 establish a standard interface that all tasks need to implement so they
55222 can be managed appropriately by an application-specific scheduler.
55223
55224 _Extensions to Ada 95_
55225
55226 7.a/2
55227 {AI95-00251-01AI95-00251-01} {AI95-00345-01AI95-00345-01}
55228 {AI95-00401-01AI95-00401-01} {AI95-00442-01AI95-00442-01} The
55229 formal interface type is new.
55230
55231 \1f
55232 File: aarm2012.info, Node: 12.6, Next: 12.7, Prev: 12.5, Up: 12
55233
55234 12.6 Formal Subprograms
55235 =======================
55236
55237 1
55238 [ Formal subprograms can be used to pass callable entities to a generic
55239 unit.]
55240
55241 _Language Design Principles_
55242
55243 1.a
55244 Generic formal subprograms are like renames of the
55245 explicit_generic_actual_parameter.
55246
55247 _Syntax_
55248
55249 2/2
55250 {AI95-00260-02AI95-00260-02} formal_subprogram_declaration ::=
55251 formal_concrete_subprogram_declaration
55252 | formal_abstract_subprogram_declaration
55253
55254 2.1/3
55255 {AI95-00260-02AI95-00260-02} {AI05-0183-1AI05-0183-1}
55256 formal_concrete_subprogram_declaration ::=
55257 with subprogram_specification [is subprogram_default]
55258 [aspect_specification];
55259
55260 2.2/3
55261 {AI95-00260-02AI95-00260-02} {AI05-0183-1AI05-0183-1}
55262 formal_abstract_subprogram_declaration ::=
55263 with subprogram_specification is abstract [subprogram_default]
55264 [aspect_specification];
55265
55266 3/2
55267 {AI95-00348-01AI95-00348-01} subprogram_default ::=
55268 default_name | <> | null
55269
55270 4
55271 default_name ::= name
55272
55273 4.1/2
55274 {AI95-00260-02AI95-00260-02} {AI95-00348-01AI95-00348-01} A
55275 subprogram_default of null shall not be specified for a formal
55276 function or for a formal_abstract_subprogram_declaration.
55277
55278 4.a/2
55279 Reason: There are no null functions because the return value
55280 has to be constructed somehow. We don't allow null for
55281 abstract formal procedures, as the operation is dispatching.
55282 It doesn't seem appropriate (or useful) to say that the
55283 implementation of something is null in the formal type and all
55284 possible descendants of that type. This also would define a
55285 dispatching operation that doesn't correspond to a slot in the
55286 tag of the controlling type, which would be a new concept.
55287 Finally, additional rules would be needed to define the
55288 meaning of a dispatching null procedure (for instance, the
55289 convention of such a subprogram should be intrinsic, but
55290 that's not what the language says). It doesn't seem worth the
55291 effort.
55292
55293 _Name Resolution Rules_
55294
55295 5
55296 The expected profile for the default_name, if any, is that of the formal
55297 subprogram.
55298
55299 5.a/3
55300 Ramification: {AI05-0299-1AI05-0299-1} This rule, unlike
55301 others in this subclause, is observed at compile time of the
55302 generic_declaration.
55303
55304 5.b
55305 The evaluation of the default_name takes place during the
55306 elaboration of each instantiation that uses the default, as
55307 defined in *note 12.3::, "*note 12.3:: Generic Instantiation".
55308
55309 6
55310 For a generic formal subprogram, the expected profile for the actual is
55311 that of the formal subprogram.
55312
55313 _Legality Rules_
55314
55315 7/3
55316 {AI05-0239-1AI05-0239-1} The profiles of the formal and any named
55317 default shall be mode conformant.
55318
55319 7.a/3
55320 Ramification: {AI05-0299-1AI05-0299-1} This rule, unlike
55321 others in this subclause, is checked at compile time of the
55322 generic_declaration.
55323
55324 8/3
55325 {AI05-0239-1AI05-0239-1} The profiles of the formal and actual shall be
55326 mode conformant.
55327
55328 8.1/2
55329 {AI95-00423-01AI95-00423-01} For a parameter or result subtype of a
55330 formal_subprogram_declaration that has an explicit null_exclusion:
55331
55332 8.2/2
55333 * if the actual matching the formal_subprogram_declaration denotes a
55334 generic formal object of another generic unit G, and the
55335 instantiation containing the actual that occurs within the body of
55336 a generic unit G or within the body of a generic unit declared
55337 within the declarative region of the generic unit G, then the
55338 corresponding parameter or result type of the formal subprogram of
55339 G shall have a null_exclusion;
55340
55341 8.3/2
55342 * otherwise, the subtype of the corresponding parameter or result
55343 type of the actual matching the formal_subprogram_declaration shall
55344 exclude null. In addition to the places where Legality Rules
55345 normally apply (see *note 12.3::), this rule applies also in the
55346 private part of an instance of a generic unit.
55347
55348 8.a/2
55349 Reason: This rule prevents "lying". Null must never be the
55350 value of a parameter or result with an explicit
55351 null_exclusion. The first bullet is an assume-the-worst rule
55352 which prevents trouble in generic bodies (including bodies of
55353 child generics) when the formal subtype excludes null
55354 implicitly.
55355
55356 8.4/3
55357 {AI95-00260-02AI95-00260-02} {AI05-0296-1AI05-0296-1} If a formal
55358 parameter of a formal_abstract_subprogram_declaration (*note 12.6:
55359 S0297.) is of a specific tagged type T or of an anonymous access type
55360 designating a specific tagged type T, T is called a controlling type of
55361 the formal_abstract_subprogram_declaration (*note 12.6: S0297.).
55362 Similarly, if the result of a formal_abstract_subprogram_declaration
55363 (*note 12.6: S0297.) for a function is of a specific tagged type T or of
55364 an anonymous access type designating a specific tagged type T, T is
55365 called a controlling type of the formal_abstract_subprogram_declaration
55366 (*note 12.6: S0297.). A formal_abstract_subprogram_declaration (*note
55367 12.6: S0297.) shall have exactly one controlling type, and that type
55368 shall not be incomplete.
55369
55370 8.b/2
55371 Ramification: The specific tagged type could be any of a
55372 formal tagged private type, a formal derived type, a formal
55373 interface type, or a normal tagged type. While the last case
55374 doesn't seem to be very useful, there isn't any good reason
55375 for disallowing it. This rule ensures that the operation is a
55376 dispatching operation of some type, and that we unambiguously
55377 know what that type is.
55378
55379 8.c/2
55380 We informally call a subprogram declared by a
55381 formal_abstract_subprogram_declaration (*note 12.6: S0297.) an
55382 abstract formal subprogram, but we do not use this term in
55383 normative wording. (We do use it often in these notes.)
55384
55385 8.5/2
55386 {AI95-00260-02AI95-00260-02} The actual subprogram for a
55387 formal_abstract_subprogram_declaration (*note 12.6: S0297.) shall be a
55388 dispatching operation of the controlling type or of the actual type
55389 corresponding to the controlling type.
55390
55391 8.d/2
55392 To be honest: We mean the controlling type of the
55393 formal_abstract_subprogram_declaration (*note 12.6: S0297.),
55394 of course. Saying that gets unwieldy and redundant (so says
55395 at least one reviewer, anyway).
55396
55397 8.e/2
55398 Ramification: This means that the actual is either a primitive
55399 operation of the controlling type, or an abstract formal
55400 subprogram. Also note that this prevents the controlling type
55401 from being class-wide (with one exception explained below), as
55402 only specific types have primitive operations (and a formal
55403 subprogram eventually has to have an actual that is a
55404 primitive of some type). This could happen in a case like:
55405
55406 8.f/2
55407 generic
55408 type T(<>) is tagged private;
55409 with procedure Foo (Obj : in T) is abstract;
55410 package P ...
55411
55412 8.g/2
55413 package New_P is new P (Something'Class, Some_Proc);
55414
55415 8.h/2
55416 The instantiation here is always illegal, because Some_Proc
55417 could never be a primitive operation of Something'Class (there
55418 are no such operations). That's good, because we want calls
55419 to Foo always to be dispatching calls.
55420
55421 8.i/2
55422 Since it is possible for a formal tagged type to be
55423 instantiated with a class-wide type, it is possible for the
55424 (real) controlling type to be class-wide in one unusual case:
55425
55426 8.j/2
55427 generic
55428 type NT(<>) is new T with private;
55429 -- Presume that T has the following primitive operation:
55430 -- with procedure Bar (Obj : in T);
55431 package Gr ...
55432
55433 8.k/2
55434 package body Gr is
55435 package New_P2 is new P (NT, Foo => Bar);
55436 end Gr;
55437
55438 8.l/2
55439 package New_Gr is new Gr (Something'Class);
55440
55441 8.m/2
55442 The instantiation of New_P2 is legal, since Bar is a
55443 dispatching operation of the actual type of the controlling
55444 type of the abstract formal subprogram Foo. This is not a
55445 problem, since the rules given in *note 12.5.1:: explain how
55446 this routine dispatches even though its parameter is
55447 class-wide.
55448
55449 8.n/2
55450 Note that this legality rule never needs to be rechecked in an
55451 instance (that contains a nested instantiation). The rule
55452 only talks about the actual type of the instantiation; it does
55453 not require looking further; if the actual type is in fact a
55454 formal type, we do not intend looking at the actual for that
55455 formal.
55456
55457 _Static Semantics_
55458
55459 9
55460 A formal_subprogram_declaration declares a generic formal subprogram.
55461 The types of the formal parameters and result, if any, of the formal
55462 subprogram are those determined by the subtype_marks given in the
55463 formal_subprogram_declaration; however, independent of the particular
55464 subtypes that are denoted by the subtype_marks, the nominal subtypes of
55465 the formal parameters and result, if any, are defined to be nonstatic,
55466 and unconstrained if of an array type [(no applicable index constraint
55467 is provided in a call on a formal subprogram)]. In an instance, a
55468 formal_subprogram_declaration declares a view of the actual. The
55469 profile of this view takes its subtypes and calling convention from the
55470 original profile of the actual entity, while taking the formal parameter
55471 names and default_expression (*note 3.7: S0063.)s from the profile given
55472 in the formal_subprogram_declaration (*note 12.6: S0295.). The view is
55473 a function or procedure, never an entry.
55474
55475 9.a
55476 Discussion: This rule is intended to be the same as the one
55477 for renamings-as-declarations, where the
55478 formal_subprogram_declaration is analogous to a
55479 renaming-as-declaration, and the actual is analogous to the
55480 renamed view.
55481
55482 9.1/3
55483 {AI05-0071-1AI05-0071-1} {AI05-0131-1AI05-0131-1} If a subtype_mark in
55484 the profile of the formal_subprogram_declaration denotes a formal
55485 private or formal derived type and the actual type for this formal type
55486 is a class-wide type T'Class, then for the purposes of resolving the
55487 corresponding actual subprogram at the point of the instantiation,
55488 certain implicit declarations may be available as possible resolutions
55489 as follows:
55490
55491 9.2/3
55492 For each primitive subprogram of T that is directly visible at
55493 the point of the instantiation, and that has at least one
55494 controlling formal parameter, a corresponding implicitly
55495 declared subprogram with the same defining name, and having
55496 the same profile as the primitive subprogram except that T is
55497 systematically replaced by T'Class in the types of its
55498 profile, is potentially use-visible. The body of such a
55499 subprogram is as defined in *note 12.5.1:: for primitive
55500 subprograms of a formal type when the actual type is
55501 class-wide.
55502
55503 9.b/3
55504 Reason: {AI05-0071-1AI05-0071-1} {AI05-0131-1AI05-0131-1} This
55505 gives the same capabilities to formal subprograms as those
55506 that primitive operations of the formal type have when the
55507 actual type is class-wide. We do not want to discourage the
55508 use of explicit declarations for (formal) subprograms!
55509
55510 9.c/3
55511 Implementation Note: {AI05-0071-1AI05-0071-1}
55512 {AI05-0131-1AI05-0131-1} Although the above wording seems to
55513 require constructing implicit versions of all of the primitive
55514 subprograms of type T, it should be clear that a compiler only
55515 needs to consider those that could possibly resolve to the
55516 corresponding actual subprogram. For instance, if the formal
55517 subprogram is a procedure with two parameters, and the actual
55518 subprogram name is Bar (either given explicitly or by
55519 default), the compiler need not consider primitives that are
55520 functions, that have the wrong number of parameters, that have
55521 defining names other than Bar, and so on; thus it does not
55522 need to construct implicit declarations for those primitives.
55523
55524 9.d/3
55525 Ramification: {AI05-0071-1AI05-0071-1}
55526 {AI05-0131-1AI05-0131-1} Functions that only have a
55527 controlling result and do not have a controlling parameter of
55528 T are not covered by this rule, as any call would be required
55529 to raise Program_Error by *note 12.5.1::. It is better to
55530 detect the error earlier than at run time.
55531
55532 10
55533 If a generic unit has a subprogram_default specified by a box, and the
55534 corresponding actual parameter is omitted, then it is equivalent to an
55535 explicit actual parameter that is a usage name identical to the defining
55536 name of the formal.
55537
55538 10.1/2
55539 {AI95-00348-01AI95-00348-01} If a generic unit has a subprogram_default
55540 specified by the reserved word null, and the corresponding actual
55541 parameter is omitted, then it is equivalent to an explicit actual
55542 parameter that is a null procedure having the profile given in the
55543 formal_subprogram_declaration (*note 12.6: S0295.).
55544
55545 10.2/2
55546 {AI95-00260-02AI95-00260-02} The subprogram declared by a
55547 formal_abstract_subprogram_declaration (*note 12.6: S0297.) with a
55548 controlling type T is a dispatching operation of type T.
55549
55550 10.a/2
55551 Reason: This is necessary to trigger all of the dispatching
55552 operation rules. It otherwise would not be considered a
55553 dispatching operation, as formal subprograms are never
55554 primitive operations.
55555
55556 NOTES
55557
55558 11
55559 13 The matching rules for formal subprograms state requirements
55560 that are similar to those applying to
55561 subprogram_renaming_declarations (see *note 8.5.4::). In
55562 particular, the name of a parameter of the formal subprogram need
55563 not be the same as that of the corresponding parameter of the
55564 actual subprogram; similarly, for these parameters,
55565 default_expressions need not correspond.
55566
55567 12
55568 14 The constraints that apply to a parameter of a formal
55569 subprogram are those of the corresponding formal parameter of the
55570 matching actual subprogram (not those implied by the corresponding
55571 subtype_mark in the _specification of the formal subprogram). A
55572 similar remark applies to the result of a function. Therefore, to
55573 avoid confusion, it is recommended that the name of a first subtype
55574 be used in any declaration of a formal subprogram.
55575
55576 13
55577 15 The subtype specified for a formal parameter of a generic
55578 formal subprogram can be any visible subtype, including a generic
55579 formal subtype of the same generic_formal_part.
55580
55581 14
55582 16 A formal subprogram is matched by an attribute of a type if the
55583 attribute is a function with a matching specification. An
55584 enumeration literal of a given type matches a parameterless formal
55585 function whose result type is the given type.
55586
55587 15
55588 17 A default_name denotes an entity that is visible or directly
55589 visible at the place of the generic_declaration; a box used as a
55590 default is equivalent to a name that denotes an entity that is
55591 directly visible at the place of the _instantiation.
55592
55593 15.a
55594 Proof: Visibility and name resolution are applied to the
55595 equivalent explicit actual parameter.
55596
55597 16/2
55598 18 {AI95-00260-02AI95-00260-02} The actual subprogram cannot be
55599 abstract unless the formal subprogram is a
55600 formal_abstract_subprogram_declaration (*note 12.6: S0297.) (see
55601 *note 3.9.3::).
55602
55603 16.1/2
55604 19 {AI95-00260-02AI95-00260-02} The subprogram declared by a
55605 formal_abstract_subprogram_declaration (*note 12.6: S0297.) is an
55606 abstract subprogram. All calls on a subprogram declared by a
55607 formal_abstract_subprogram_declaration (*note 12.6: S0297.) must be
55608 dispatching calls. See *note 3.9.3::.
55609
55610 16.2/2
55611 20 {AI95-00348-01AI95-00348-01} A null procedure as a subprogram
55612 default has convention Intrinsic (see *note 6.3.1::).
55613
55614 16.a.1/2
55615 Proof: This is an implicitly declared subprogram, so it has
55616 convention Intrinsic as defined in *note 6.3.1::.
55617
55618 _Examples_
55619
55620 17
55621 Examples of generic formal subprograms:
55622
55623 18/2
55624 {AI95-00433-01AI95-00433-01} with function "+"(X, Y : Item) return Item is <>;
55625 with function Image(X : Enum) return String is Enum'Image;
55626 with procedure Update is Default_Update;
55627 with procedure Pre_Action(X : in Item) is null; -- defaults to no action
55628 with procedure Write(S : not null access Root_Stream_Type'Class;
55629 Desc : Descriptor)
55630 is abstract Descriptor'Write; -- see *note 13.13.2::
55631 -- Dispatching operation on Descriptor with default
55632
55633 19
55634 -- given the generic procedure declaration
55635
55636 20
55637 generic
55638 with procedure Action (X : in Item);
55639 procedure Iterate(Seq : in Item_Sequence);
55640
55641 21
55642 -- and the procedure
55643
55644 22
55645 procedure Put_Item(X : in Item);
55646
55647 23
55648 -- the following instantiation is possible
55649
55650 24
55651 procedure Put_List is new Iterate(Action => Put_Item);
55652
55653 _Extensions to Ada 95_
55654
55655 24.a/2
55656 {AI95-00260-02AI95-00260-02} The
55657 formal_abstract_subprogram_declaration is new. It allows the
55658 passing of dispatching operations to generic units.
55659
55660 24.b/2
55661 {AI95-00348-01AI95-00348-01} The formal subprogram default of
55662 null is new. It allows the default of a generic procedure to
55663 do nothing, such as for passing a debugging routine.
55664
55665 _Wording Changes from Ada 95_
55666
55667 24.c/2
55668 {AI95-00423-01AI95-00423-01} Added matching rules for
55669 null_exclusions.
55670
55671 _Incompatibilities With Ada 2005_
55672
55673 24.d/3
55674 {AI05-0296-1AI05-0296-1} It is now illegal to declare a formal
55675 abstract subprogram whose controlling type is incomplete. It
55676 was never intended to allow that, and such a type would have
55677 to come from outside of the generic unit in Ada 2005, so it is
55678 unlikely to be useful. Moreover, a dispatching call on the
55679 subprogram is likely to fail in many implementations. So it
55680 is very unlikely that any code will need to be changed because
55681 of this new rule.
55682
55683 _Extensions to Ada 2005_
55684
55685 24.e/3
55686 {AI05-0071-1AI05-0071-1} {AI05-0131-1AI05-0131-1} Correction:
55687 Added construction of implicit subprograms for primitives of
55688 class-wide actual types, to make it possible to import
55689 subprograms via formal subprograms as well as by implicit
55690 primitive operations of a formal type. (This is a Correction
55691 as it is very important for the usability of indefinite
55692 containers when instantiated with class-wide types; thus we
55693 want Ada 2005 implementations to support it.)
55694
55695 24.f/3
55696 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
55697 be used in a formal_concrete_subprogram_declaration and a
55698 formal_abstract_subprogram_declaration. This is described in
55699 *note 13.1.1::.
55700
55701 \1f
55702 File: aarm2012.info, Node: 12.7, Next: 12.8, Prev: 12.6, Up: 12
55703
55704 12.7 Formal Packages
55705 ====================
55706
55707 1
55708 [ Formal packages can be used to pass packages to a generic unit. The
55709 formal_package_declaration declares that the formal package is an
55710 instance of a given generic package. Upon instantiation, the actual
55711 package has to be an instance of that generic package.]
55712
55713 _Syntax_
55714
55715 2/3
55716 {AI05-0183-1AI05-0183-1} formal_package_declaration ::=
55717 with package defining_identifier is new generic_package_name
55718 formal_package_actual_part
55719 [aspect_specification];
55720
55721 3/2
55722 {AI95-00317-01AI95-00317-01} formal_package_actual_part ::=
55723 ([others =>] <>)
55724 | [generic_actual_part]
55725 | (formal_package_association {,
55726 formal_package_association} [, others => <>])
55727
55728 3.1/2
55729 {AI95-00317-01AI95-00317-01} formal_package_association ::=
55730 generic_association
55731 | generic_formal_parameter_selector_name => <>
55732
55733 3.2/2
55734 {AI95-00317-01AI95-00317-01} Any positional
55735 formal_package_associations shall precede any named
55736 formal_package_associations.
55737
55738 _Legality Rules_
55739
55740 4
55741 The generic_package_name shall denote a generic package (the template
55742 for the formal package); the formal package is an instance of the
55743 template.
55744
55745 4.1/3
55746 {AI05-0025-1AI05-0025-1} The generic_formal_parameter_selector_name of a
55747 formal_package_association shall denote a
55748 generic_formal_parameter_declaration of the template. If two or more
55749 formal subprograms of the template have the same defining name, then
55750 named associations are not allowed for the corresponding actuals.
55751
55752 4.2/3
55753 {AI95-00398-01AI95-00398-01} A formal_package_actual_part shall contain
55754 at most one formal_package_association for each formal parameter. If
55755 the formal_package_actual_part does not include "others => <>", each
55756 formal parameter without an association shall have a default_expression
55757 or subprogram_default.
55758
55759 4.3/3
55760 {AI05-0200-1AI05-0200-1} The rules for matching between
55761 formal_package_associations and the generic formals of the template are
55762 as follows:
55763
55764 4.4/3
55765 * If all of the formal_package_associations are given by generic
55766 associations, the explicit_generic_actual_parameters of the
55767 formal_package_associations shall be legal for an instantiation of
55768 the template.
55769
55770 4.5/3
55771 * If a formal_package_association for a formal type T of the template
55772 is given by <>, then the formal_package_association for any other
55773 generic_formal_parameter_declaration of the template that mentions
55774 T directly or indirectly must be given by <> as well.
55775
55776 4.a/3
55777 Discussion: {AI05-0200-1AI05-0200-1} The above rule is simple
55778 to state, though it does not reflect the fact that the formal
55779 package functions like an instantiation of a special kind,
55780 where each box association for a
55781 generic_formal_parameter_declaration F is replaced with a new
55782 entity F' that has the same characteristics as F: if F is a
55783 formal discrete type then F' is a discrete type, if F is a
55784 formal subprogram then F' is a subprogram with a similar
55785 signature, etc. In practice this is achieved by making the
55786 association into a copy of the declaration of the generic
55787 formal.
55788
55789 5/2
55790 {AI95-00317-01AI95-00317-01} The actual shall be an instance of the
55791 template. If the formal_package_actual_part is (<>) or (others => <>),
55792 [then the actual may be any instance of the template]; otherwise,
55793 certain of the actual parameters of the actual instance shall match the
55794 corresponding actual parameters of the formal package, determined as
55795 follows:
55796
55797 5.1/2
55798 * {AI95-00317-01AI95-00317-01} If the formal_package_actual_part
55799 (*note 12.7: S0301.) includes generic_associations as well as
55800 associations with <>, then only the actual parameters specified
55801 explicitly with generic_associations are required to match;
55802
55803 5.2/2
55804 * {AI95-00317-01AI95-00317-01} Otherwise, all actual parameters shall
55805 match[, whether any actual parameter is given explicitly or by
55806 default].
55807
55808 5.3/2
55809 {AI95-00317-01AI95-00317-01} The rules for matching of actual parameters
55810 between the actual instance and the formal package are as follows:
55811
55812 6/2
55813 * {AI95-00317-01AI95-00317-01} For a formal object of mode in, the
55814 actuals match if they are static expressions with the same value,
55815 or if they statically denote the same constant, or if they are both
55816 the literal null.
55817
55818 6.a
55819 Reason: We can't simply require full conformance between the
55820 two actual parameter expressions, because the two expressions
55821 are being evaluated at different times.
55822
55823 7
55824 * For a formal subtype, the actuals match if they denote statically
55825 matching subtypes.
55826
55827 8
55828 * For other kinds of formals, the actuals match if they statically
55829 denote the same entity.
55830
55831 8.1/1
55832 {8652/00398652/0039} {AI95-00213-01AI95-00213-01} For the purposes of
55833 matching, any actual parameter that is the name of a formal object of
55834 mode in is replaced by the formal object's actual expression
55835 (recursively).
55836
55837 _Static Semantics_
55838
55839 9
55840 A formal_package_declaration declares a generic formal package.
55841
55842 10/2
55843 {AI95-00317-01AI95-00317-01} The visible part of a formal package
55844 includes the first list of basic_declarative_items of the
55845 package_specification (*note 7.1: S0191.). In addition, for each actual
55846 parameter that is not required to match, a copy of the declaration of
55847 the corresponding formal parameter of the template is included in the
55848 visible part of the formal package. If the copied declaration is for a
55849 formal type, copies of the implicit declarations of the primitive
55850 subprograms of the formal type are also included in the visible part of
55851 the formal package.
55852
55853 10.a/2
55854 Ramification: {AI95-00317-01AI95-00317-01} If the
55855 formal_package_actual_part is (<>), then the declarations that
55856 occur immediately within the generic_formal_part of the
55857 template for the formal package are visible outside the formal
55858 package, and can be denoted by expanded names outside the
55859 formal package.If only some of the actual parameters are given
55860 by <>, then the declaration corresponding to those parameters
55861 (but not the others) are made visible.
55862
55863 10.b/3
55864 Reason: {AI05-0005-1AI05-0005-1} We always want either the
55865 actuals or the formals of an instance to be nameable from
55866 outside, but never both. If both were nameable, one would get
55867 some funny anomalies since they denote the same entity, but,
55868 in the case of types at least, they might have different and
55869 inconsistent sets of primitive operators due to predefined
55870 operator "reemergence." Formal derived types exacerbate the
55871 difference. We want the implicit declarations of the
55872 generic_formal_part as well as the explicit declarations, so
55873 we get operations on the formal types.
55874
55875 10.c
55876 Ramification: A generic formal package is a package, and is an
55877 instance. Hence, it is possible to pass a generic formal
55878 package as an actual to another generic formal package.
55879
55880 11/2
55881 {AI95-00317-01AI95-00317-01} For the purposes of matching, if the actual
55882 instance A is itself a formal package, then the actual parameters of A
55883 are those specified explicitly or implicitly in the
55884 formal_package_actual_part for A, plus, for those not specified, the
55885 copies of the formal parameters of the template included in the visible
55886 part of A.
55887
55888 _Examples_
55889
55890 12/2
55891 {AI95-00433-01AI95-00433-01} Example of a generic package with formal
55892 package parameters:
55893
55894 13/2
55895 with Ada.Containers.Ordered_Maps; -- see *note A.18.6::
55896 generic
55897 with package Mapping_1 is new Ada.Containers.Ordered_Maps(<>);
55898 with package Mapping_2 is new Ada.Containers.Ordered_Maps
55899 (Key_Type => Mapping_1.Element_Type,
55900 others => <>);
55901 package Ordered_Join is
55902 -- Provide a "join" between two mappings
55903
55904 14/2
55905 subtype Key_Type is Mapping_1.Key_Type;
55906 subtype Element_Type is Mapping_2.Element_Type;
55907
55908 15/2
55909 function Lookup(Key : Key_Type) return Element_Type;
55910
55911 16/2
55912 ...
55913 end Ordered_Join;
55914
55915 17/2
55916 {AI95-00433-01AI95-00433-01} Example of an instantiation of a package
55917 with formal packages:
55918
55919 18/2
55920 with Ada.Containers.Ordered_Maps;
55921 package Symbol_Package is
55922
55923 19/2
55924 type String_Id is ...
55925
55926 20/2
55927 type Symbol_Info is ...
55928
55929 21/2
55930 package String_Table is new Ada.Containers.Ordered_Maps
55931 (Key_Type => String,
55932 Element_Type => String_Id);
55933
55934 22/2
55935 package Symbol_Table is new Ada.Containers.Ordered_Maps
55936 (Key_Type => String_Id,
55937 Element_Type => Symbol_Info);
55938
55939 23/2
55940 package String_Info is new Ordered_Join(Mapping_1 => String_Table,
55941 Mapping_2 => Symbol_Table);
55942
55943 24/2
55944 Apple_Info : constant Symbol_Info := String_Info.Lookup("Apple");
55945
55946 25/2
55947 end Symbol_Package;
55948
55949 _Extensions to Ada 83_
55950
55951 25.a
55952 Formal packages are new to Ada 95.
55953
55954 _Extensions to Ada 95_
55955
55956 25.b/2
55957 {AI95-00317-01AI95-00317-01} {AI95-00398-01AI95-00398-01} It's
55958 now allowed to mix actuals of a formal package that are
55959 specified with those that are not specified.
55960
55961 _Wording Changes from Ada 95_
55962
55963 25.c/2
55964 {8652/00398652/0039} {AI95-00213-01AI95-00213-01} Corrigendum:
55965 Corrected the description of formal package matching to say
55966 that formal parameters are always replaced by their actual
55967 parameters (recursively). This matches the actual practice of
55968 compilers, as the ACATS has always required this behavior.
55969
55970 25.d/2
55971 {AI95-00317-01AI95-00317-01} The description of which
55972 operations are visible in a formal package has been clarified.
55973 We also specify how matching is done when the actual is a
55974 formal package.
55975
55976 _Incompatibilities With Ada 2005_
55977
55978 25.e/3
55979 {AI05-0025-1AI05-0025-1} {AI05-0200-1AI05-0200-1} Correction:
55980 Added missing rules for parameters of generic formal package
55981 that parallel those in *note 12.3::, as well as some specific
55982 to <> parameters. These are technically incompatibilities
55983 because generic formal package parameters that Ada 95 and Ada
55984 2005 would have considered legal now have to be rejected. But
55985 this should not be an issue in practice as such formal
55986 parameters could not have matched any actual generics. And it
55987 is quite likely that implementations already enforce some of
55988 these rules.
55989
55990 _Extensions to Ada 2005_
55991
55992 25.f/3
55993 {AI05-0183-1AI05-0183-1} An optional aspect_specification can
55994 be used in a formal_package_declaration. This is described in
55995 *note 13.1.1::.
55996
55997 \1f
55998 File: aarm2012.info, Node: 12.8, Prev: 12.7, Up: 12
55999
56000 12.8 Example of a Generic Package
56001 =================================
56002
56003 1
56004 The following example provides a possible formulation of stacks by means
56005 of a generic package. The size of each stack and the type of the stack
56006 elements are provided as generic formal parameters.
56007
56008 _Examples_
56009
56010 2/1
56011 This paragraph was deleted.
56012
56013 3
56014 generic
56015 Size : Positive;
56016 type Item is private;
56017 package Stack is
56018 procedure Push(E : in Item);
56019 procedure Pop (E : out Item);
56020 Overflow, Underflow : exception;
56021 end Stack;
56022
56023 4
56024 package body Stack is
56025
56026 5
56027 type Table is array (Positive range <>) of Item;
56028 Space : Table(1 .. Size);
56029 Index : Natural := 0;
56030
56031 6
56032 procedure Push(E : in Item) is
56033 begin
56034 if Index >= Size then
56035 raise Overflow;
56036 end if;
56037 Index := Index + 1;
56038 Space(Index) := E;
56039 end Push;
56040
56041 7
56042 procedure Pop(E : out Item) is
56043 begin
56044 if Index = 0 then
56045 raise Underflow;
56046 end if;
56047 E := Space(Index);
56048 Index := Index - 1;
56049 end Pop;
56050
56051 8
56052 end Stack;
56053
56054 9
56055 Instances of this generic package can be obtained as follows:
56056
56057 10
56058 package Stack_Int is new Stack(Size => 200, Item => Integer);
56059 package Stack_Bool is new Stack(100, Boolean);
56060
56061 11
56062 Thereafter, the procedures of the instantiated packages can be called as
56063 follows:
56064
56065 12
56066 Stack_Int.Push(N);
56067 Stack_Bool.Push(True);
56068
56069 13
56070 Alternatively, a generic formulation of the type Stack can be given as
56071 follows (package body omitted):
56072
56073 14
56074 generic
56075 type Item is private;
56076 package On_Stacks is
56077 type Stack(Size : Positive) is limited private;
56078 procedure Push(S : in out Stack; E : in Item);
56079 procedure Pop (S : in out Stack; E : out Item);
56080 Overflow, Underflow : exception;
56081 private
56082 type Table is array (Positive range <>) of Item;
56083 type Stack(Size : Positive) is
56084 record
56085 Space : Table(1 .. Size);
56086 Index : Natural := 0;
56087 end record;
56088 end On_Stacks;
56089
56090 15
56091 In order to use such a package, an instance has to be created and
56092 thereafter stacks of the corresponding type can be declared:
56093
56094 16
56095 declare
56096 package Stack_Real is new On_Stacks(Real); use Stack_Real;
56097 S : Stack(100);
56098 begin
56099 ...
56100 Push(S, 2.54);
56101 ...
56102 end;
56103
56104 \1f
56105 File: aarm2012.info, Node: 13, Next: Annex A, Prev: 12, Up: Top
56106
56107 13 Representation Issues
56108 ************************
56109
56110 1/3
56111 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56112 {AI05-0299-1AI05-0299-1} [This clause describes features for querying
56113 and controlling certain aspects of entities and for interfacing to
56114 hardware.]
56115
56116 _Wording Changes from Ada 83_
56117
56118 1.a/3
56119 {AI05-0299-1AI05-0299-1} The subclauses of this clause have
56120 been reorganized. This was necessary to preserve a logical
56121 order, given the new Ada 95 semantics given in this section.
56122
56123 * Menu:
56124
56125 * 13.1 :: Operational and Representation Aspects
56126 * 13.2 :: Packed Types
56127 * 13.3 :: Operational and Representation Attributes
56128 * 13.4 :: Enumeration Representation Clauses
56129 * 13.5 :: Record Layout
56130 * 13.6 :: Change of Representation
56131 * 13.7 :: The Package System
56132 * 13.8 :: Machine Code Insertions
56133 * 13.9 :: Unchecked Type Conversions
56134 * 13.10 :: Unchecked Access Value Creation
56135 * 13.11 :: Storage Management
56136 * 13.12 :: Pragma Restrictions and Pragma Profile
56137 * 13.13 :: Streams
56138 * 13.14 :: Freezing Rules
56139
56140 \1f
56141 File: aarm2012.info, Node: 13.1, Next: 13.2, Up: 13
56142
56143 13.1 Operational and Representation Aspects
56144 ===========================================
56145
56146 0.1/3
56147 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56148 {AI05-0295-1AI05-0295-1} [Two kinds of aspects of entities can be
56149 specified: representation aspects and operational aspects.
56150 Representation aspects affect how the types and other entities of the
56151 language are to be mapped onto the underlying machine. Operational
56152 aspects determine other properties of entities.]
56153
56154 0.2/3
56155 {AI05-0183-1AI05-0183-1} {AI05-0295-1AI05-0295-1} [Either kind of aspect
56156 of an entity may be specified by means of an aspect_specification (see
56157 *note 13.1.1::), which is an optional element of most kinds of
56158 declarations and applies to the entity or entities being declared.
56159 Aspects may also be specified by certain other constructs occurring
56160 subsequent to the declaration of the affected entity: a representation
56161 aspect value may be specified by means of a representation item and an
56162 operational aspect value may be specified by means of an operational
56163 item.]
56164
56165 1/1
56166 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} There are six kinds of
56167 representation items: attribute_definition_clause (*note 13.3: S0309.)s
56168 for representation attributes, enumeration_representation_clause (*note
56169 13.4: S0310.)s, record_representation_clause (*note 13.5.1: S0312.)s,
56170 at_clauses, component_clauses, and representation pragmas. [ They can
56171 be provided to give more efficient representation or to interface with
56172 features that are outside the domain of the language (for example,
56173 peripheral hardware). ]
56174
56175 1.1/1
56176 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} An operational item is
56177 an attribute_definition_clause for an operational attribute.
56178
56179 1.2/1
56180 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} [An operational item
56181 or a representation item applies to an entity identified by a
56182 local_name, which denotes an entity declared local to the current
56183 declarative region, or a library unit declared immediately preceding a
56184 representation pragma in a compilation.]
56185
56186 _Language Design Principles_
56187
56188 1.a/3
56189 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56190 {AI05-0295-1AI05-0295-1} Representation aspects are intended
56191 to refer to properties that need to be known before the
56192 compiler can generate code to create or access an entity. For
56193 instance, the size of an object needs to be known before the
56194 object can be created. Conversely, operational aspects are
56195 those that only need to be known before they can be used. For
56196 instance, how an object is read from a stream only needs to be
56197 known when a stream read is executed. Thus, representation
56198 aspects have stricter rules as to when they can be specified.
56199
56200 1.a.1/3
56201 {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1}
56202 Confirming the value of an aspect should never change the
56203 semantics of the aspect. Thus Size = 8 (for example) means
56204 the same thing whether it was specified with a representation
56205 item or whether the compiler chose this value by default.
56206
56207 1.a.2/3
56208 Glossary entry: An aspect is a specifiable property of an
56209 entity. An aspect may be specified by an aspect_specification
56210 on the declaration of the entity. Some aspects may be queried
56211 via attributes.
56212
56213 _Syntax_
56214
56215 2/1
56216 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} aspect_clause ::=
56217 attribute_definition_clause
56218 | enumeration_representation_clause
56219 | record_representation_clause
56220 | at_clause
56221
56222 3
56223 local_name ::= direct_name
56224 | direct_name'attribute_designator
56225 | library_unit_name
56226
56227 4/1
56228 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} A representation
56229 pragma is allowed only at places where an aspect_clause or
56230 compilation_unit is allowed.
56231
56232 _Name Resolution Rules_
56233
56234 5/1
56235 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} In an operational item
56236 or representation item, if the local_name is a direct_name, then it
56237 shall resolve to denote a declaration (or, in the case of a pragma, one
56238 or more declarations) that occurs immediately within the same
56239 declarative region as the item. If the local_name has an
56240 attribute_designator, then it shall resolve to denote an
56241 implementation-defined component (see *note 13.5.1::) or a class-wide
56242 type implicitly declared immediately within the same declarative region
56243 as the item. A local_name that is a library_unit_name (only permitted
56244 in a representation pragma) shall resolve to denote the library_item
56245 that immediately precedes (except for other pragmas) the representation
56246 pragma.
56247
56248 5.a/1
56249 Reason: {8652/00098652/0009} {AI95-00137-01AI95-00137-01} This
56250 is a Name Resolution Rule, because we don't want an
56251 operational or representation item for X to be ambiguous just
56252 because there's another X declared in an outer declarative
56253 region. It doesn't make much difference, since most
56254 operational or representation items are for types or subtypes,
56255 and type and subtype names can't be overloaded.
56256
56257 5.b/1
56258 Ramification: {8652/00098652/0009}
56259 {AI95-00137-01AI95-00137-01} The visibility rules imply that
56260 the declaration has to occur before the operational or
56261 representation item.
56262
56263 5.c/1
56264 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} For objects,
56265 this implies that operational or representation items can be
56266 applied only to stand-alone objects.
56267
56268 _Legality Rules_
56269
56270 6/1
56271 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} The local_name of an
56272 aspect_clause or representation pragma shall statically denote an entity
56273 (or, in the case of a pragma, one or more entities) declared immediately
56274 preceding it in a compilation, or within the same declarative_part
56275 (*note 3.11: S0086.), package_specification (*note 7.1: S0191.),
56276 task_definition (*note 9.1: S0207.), protected_definition (*note 9.4:
56277 S0212.), or record_definition (*note 3.8: S0067.) as the representation
56278 or operational item. If a local_name denotes a [local] callable entity,
56279 it may do so through a [local] subprogram_renaming_declaration (*note
56280 8.5.4: S0203.) [(as a way to resolve ambiguity in the presence of
56281 overloading)]; otherwise, the local_name shall not denote a
56282 renaming_declaration (*note 8.5: S0199.).
56283
56284 6.a
56285 Ramification: The "statically denote" part implies that it is
56286 impossible to specify the representation of an object that is
56287 not a stand-alone object, except in the case of a
56288 representation item like pragma Atomic that is allowed inside
56289 a component_list (in which case the representation item
56290 specifies the representation of components of all objects of
56291 the type). It also prevents the problem of renamings of
56292 things like "P.all" (where P is an access-to-subprogram value)
56293 or "E(I)" (where E is an entry family).
56294
56295 6.b
56296 The part about where the denoted entity has to have been
56297 declared appears twice -- once as a Name Resolution Rule, and
56298 once as a Legality Rule. Suppose P renames Q, and we have a
56299 representation item in a declarative_part whose local_name is
56300 P. The fact that the representation item has to appear in the
56301 same declarative_part as P is a Name Resolution Rule, whereas
56302 the fact that the representation item has to appear in the
56303 same declarative_part as Q is a Legality Rule. This is
56304 subtle, but it seems like the least confusing set of rules.
56305
56306 6.c
56307 Discussion: A separate Legality Rule applies for
56308 component_clauses. See *note 13.5.1::, "*note 13.5.1:: Record
56309 Representation Clauses".
56310
56311 7/2
56312 {AI95-00291-02AI95-00291-02} The representation of an object consists of
56313 a certain number of bits (the size of the object). For an object of an
56314 elementary type, these are the bits that are normally read or updated by
56315 the machine code when loading, storing, or operating-on the value of the
56316 object. For an object of a composite type, these are the bits reserved
56317 for this object, and include bits occupied by subcomponents of the
56318 object. If the size of an object is greater than that of its subtype,
56319 the additional bits are padding bits. For an elementary object, these
56320 padding bits are normally read and updated along with the others. For a
56321 composite object, padding bits might not be read or updated in any given
56322 composite operation, depending on the implementation.
56323
56324 7.a/2
56325 To be honest: {AI95-00291-02AI95-00291-02} Discontiguous
56326 representations are allowed, but the ones we're interested in
56327 here are generally contiguous sequences of bits. For a
56328 discontiguous representation, the size doesn't necessarily
56329 describe the "footprint" of the object in memory (that is, the
56330 amount of space taken in the address space for the object).
56331
56332 7.a.1/2
56333 Discussion: {AI95-00291-02AI95-00291-02} In the case of
56334 composite objects, we want the implementation to have the
56335 flexibility to either do operations component-by-component, or
56336 with a block operation covering all of the bits. We carefully
56337 avoid giving a preference in the wording. There is no
56338 requirement for the choice to be documented, either, as the
56339 implementation can make that choice based on many factors, and
56340 could make a different choice for different operations on the
56341 same object.
56342
56343 7.a.2/2
56344 {AI95-00291-02AI95-00291-02} In the case of a properly
56345 aligned, contiguous object whose size is a multiple of the
56346 storage unit size, no other bits should be read or updated as
56347 part of operating on the object. We don't say this
56348 normatively because it would be difficult to normatively
56349 define "properly aligned" or "contiguous".
56350
56351 7.b
56352 Ramification: Two objects with the same value do not
56353 necessarily have the same representation. For example, an
56354 implementation might represent False as zero and True as any
56355 odd value. Similarly, two objects (of the same type) with the
56356 same sequence of bits do not necessarily have the same value.
56357 For example, an implementation might use a biased
56358 representation in some cases but not others:
56359
56360 7.c/3
56361 {AI05-0229-1AI05-0229-1} subtype S is Integer range 1..256;
56362 type A is array(Natural range 1..4) of S
56363 with Pack;
56364 X : S := 3;
56365 Y : A := (1, 2, 3, 4);
56366
56367 7.d
56368 The implementation might use a biased-by-1 representation for
56369 the array elements, but not for X. X and Y(3) have the same
56370 value, but different representation: the representation of X
56371 is a sequence of (say) 32 bits: 0...011, whereas the
56372 representation of Y(3) is a sequence of 8 bits: 00000010
56373 (assuming a two's complement representation).
56374
56375 7.e
56376 Such tricks are not required, but are allowed.
56377
56378 7.f
56379 Discussion: The value of any padding bits is not specified by
56380 the language, though for a numeric type, it will be much
56381 harder to properly implement the predefined operations if the
56382 padding bits are not either all zero, or a sign extension.
56383
56384 7.g/3
56385 Ramification: {AI05-0229-1AI05-0229-1} For example, suppose
56386 S'Size = 2, and an object X is of subtype S. If the machine
56387 code typically uses a 32-bit load instruction to load the
56388 value of X, then X'Size should be 32, even though 30 bits of
56389 the value are just zeros or sign-extension bits. On the other
56390 hand, if the machine code typically masks out those 30 bits,
56391 then X'Size should be 2. Usually, such masking only happens
56392 for components of a composite type for which Pack,
56393 Component_Size, or record layout is specified.
56394
56395 7.h
56396 Note, however, that the formal parameter of an instance of
56397 Unchecked_Conversion is a special case. Its Size is required
56398 to be the same as that of its subtype.
56399
56400 7.i
56401 Note that we don't generally talk about the representation of
56402 a value. A value is considered to be an amorphous blob
56403 without any particular representation. An object is
56404 considered to be more concrete.
56405
56406 8/3
56407 {AI05-0112-1AI05-0112-1} {AI05-0295-1AI05-0295-1} A representation item
56408 directly specifies a representation aspect of the entity denoted by the
56409 local_name, except in the case of a type-related representation item,
56410 whose local_name shall denote a first subtype, and which directly
56411 specifies an aspect of the subtype's type. A representation item that
56412 names a subtype is either subtype-specific (Size and Alignment clauses)
56413 or type-related (all others). [Subtype-specific aspects may differ for
56414 different subtypes of the same type.]
56415
56416 8.a
56417 To be honest: Type-related and subtype-specific are defined
56418 likewise for the corresponding aspects of representation.
56419
56420 8.b
56421 To be honest: Some representation items directly specify more
56422 than one aspect.
56423
56424 8.c/3
56425 Discussion: {AI05-0229-1AI05-0229-1} For example, a pragma
56426 Export (see *note J.15.5::) specifies the convention of an
56427 entity, and also specifies that it is exported. Such items
56428 are obsolescent; directly specifying the associated aspects is
56429 preferred.
56430
56431 8.d
56432 Ramification: Each specifiable attribute constitutes a
56433 separate aspect. An enumeration_representation_clause
56434 specifies the coding aspect. A record_representation_clause
56435 (without the mod_clause) specifies the record layout aspect.
56436 Each representation pragma specifies a separate aspect.
56437
56438 8.e
56439 Reason: We don't need to say that an at_clause or a mod_clause
56440 specify separate aspects, because these are equivalent to
56441 attribute_definition_clauses. See *note J.7::, "*note J.7::
56442 At Clauses", and *note J.8::, "*note J.8:: Mod Clauses".
56443
56444 8.e.1/3
56445 {AI05-0112-1AI05-0112-1} We give a default naming for
56446 representation aspects of representation pragmas so we don't
56447 have to do that for every pragma. Operational and
56448 representation attributes are given a default naming in *note
56449 13.3::. We don't want any anonymous aspects; that would make
56450 other rules more difficult to write and understand.
56451
56452 8.f
56453 Ramification: The following representation items are
56454 type-related:
56455
56456 8.g
56457 * enumeration_representation_clause
56458
56459 8.h
56460 * record_representation_clause
56461
56462 8.i
56463 * Component_Size clause
56464
56465 8.j/1
56466 * This paragraph was deleted.{8652/00098652/0009}
56467 {AI95-00137-01AI95-00137-01}
56468
56469 8.k
56470 * Small clause
56471
56472 8.l
56473 * Bit_Order clause
56474
56475 8.m
56476 * Storage_Pool clause
56477
56478 8.n
56479 * Storage_Size clause
56480
56481 8.n.1/2
56482 * {AI95-00270-01AI95-00270-01} Stream_Size clause
56483
56484 8.o/1
56485 * This paragraph was deleted.{8652/00098652/0009}
56486 {AI95-00137-01AI95-00137-01}
56487
56488 8.p/1
56489 * This paragraph was deleted.{8652/00098652/0009}
56490 {AI95-00137-01AI95-00137-01}
56491
56492 8.q/1
56493 * This paragraph was deleted.{8652/00098652/0009}
56494 {AI95-00137-01AI95-00137-01}
56495
56496 8.r/1
56497 * This paragraph was deleted.{8652/00098652/0009}
56498 {AI95-00137-01AI95-00137-01}
56499
56500 8.s
56501 * Machine_Radix clause
56502
56503 8.t
56504 * pragma Pack
56505
56506 8.u
56507 * pragmas Import, Export, and Convention (when applied to a
56508 type)
56509
56510 8.v/3
56511 * {AI05-0009-1AI05-0009-1} pragmas Atomic, Independent, and
56512 Volatile (when applied to a type)
56513
56514 8.w/3
56515 * {AI05-0009-1AI05-0009-1} pragmas Atomic_Components,
56516 Independent_Components, and Volatile_Components (when
56517 applied to a type)
56518
56519 8.x
56520 * pragma Discard_Names (when applied to an enumeration or
56521 tagged type)
56522
56523 8.y
56524 The following representation items are subtype-specific:
56525
56526 8.z
56527 * Alignment clause (when applied to a first subtype)
56528
56529 8.aa
56530 * Size clause (when applied to a first subtype)
56531
56532 8.bb
56533 The following representation items do not apply to subtypes,
56534 so they are neither type-related nor subtype-specific:
56535
56536 8.cc
56537 * Address clause (applies to objects and program units)
56538
56539 8.dd
56540 * Alignment clause (when applied to an object)
56541
56542 8.ee
56543 * Size clause (when applied to an object)
56544
56545 8.ff
56546 * pragmas Import, Export, and Convention (when applied to
56547 anything other than a type)
56548
56549 8.gg
56550 * pragmas Atomic and Volatile (when applied to an object or
56551 a component)
56552
56553 8.hh/3
56554 * {AI05-0009-1AI05-0009-1} pragmas Atomic_Components,
56555 Independent_Components, and Volatile_Components (when
56556 applied to an array object)
56557
56558 8.ii
56559 * pragma Discard_Names (when applied to an exception)
56560
56561 8.jj
56562 * pragma Asynchronous (applies to procedures)
56563
56564 8.kk/2
56565 * {AI95-00414-01AI95-00414-01} pragma No_Return (applies to
56566 subprograms)
56567
56568 8.ll/3
56569 {AI05-0229-1AI05-0229-1} While an aspect_specification is not
56570 a representation item, a similar categorization applies to the
56571 aspect that corresponds to each of these representation items
56572 (along with aspects that do not have associated representation
56573 items).
56574
56575 8.1/3
56576 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56577 {AI05-0183-1AI05-0183-1} An operational item directly specifies an
56578 operational aspect of the entity denoted by the local_name, except in
56579 the case of a type-related operational item, whose local_name shall
56580 denote a first subtype, and which directly specifies an aspect of the
56581 type of the subtype.
56582
56583 8.mm/1
56584 Ramification: {8652/00098652/0009}
56585 {AI95-00137-01AI95-00137-01} The following operational items
56586 are type-related:
56587
56588 8.nn/1
56589 * External_Tag clause
56590
56591 8.oo/1
56592 * Read clause
56593
56594 8.pp/1
56595 * Write clause
56596
56597 8.qq/1
56598 * Input clause
56599
56600 8.rr/1
56601 * Output clause
56602
56603 9/3
56604 {AI05-0183-1AI05-0183-1} A representation item that directly specifies
56605 an aspect of a subtype or type shall appear after the type is completely
56606 defined (see *note 3.11.1::), and before the subtype or type is frozen
56607 (see *note 13.14::). If a representation item or aspect_specification
56608 is given that directly specifies an aspect of an entity, then it is
56609 illegal to give another representation item or aspect_specification that
56610 directly specifies the same aspect of the entity.
56611
56612 9.a/1
56613 Ramification: {8652/00098652/0009}
56614 {AI95-00137-01AI95-00137-01} The fact that a representation
56615 item (or operational item, see next paragraph) that directly
56616 specifies an aspect of an entity is required to appear before
56617 the entity is frozen prevents changing the representation of
56618 an entity after using the entity in ways that require the
56619 representation to be known.
56620
56621 9.b/3
56622 To be honest: {AI05-0183-1AI05-0183-1} The rule preventing
56623 multiple specification is also intended to cover other ways to
56624 specify representation aspects, such as obsolescent pragma
56625 Priority. Priority is not a representation pragma, and as
56626 such is neither a representation item nor an
56627 aspect_specification. Regardless, giving both a pragma
56628 Priority and an aspect_specification for Priority is illegal.
56629 We didn't want to complicate the wording solely to support
56630 obsolescent features.
56631
56632 9.1/3
56633 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56634 {AI05-0183-1AI05-0183-1} An operational item that directly specifies an
56635 aspect of an entity shall appear before the entity is frozen (see *note
56636 13.14::). If an operational item or aspect_specification is given that
56637 directly specifies an aspect of an entity, then it is illegal to give
56638 another operational item or aspect_specification that directly specifies
56639 the same aspect of the entity.
56640
56641 9.c/1
56642 Ramification: Unlike representation items, operational items
56643 can be specified on partial views. Since they don't affect
56644 the representation, the full declaration need not be known to
56645 determine their legality.
56646
56647 9.2/3
56648 {AI05-0106-1AI05-0106-1} {AI05-0295-1AI05-0295-1} Unless otherwise
56649 specified, it is illegal to specify an operational or representation
56650 aspect of a generic formal parameter.
56651
56652 9.d/3
56653 Reason: Specifying an aspect on a generic formal parameter
56654 implies an added contract for a generic unit. That contract
56655 needs to be defined via generic parameter matching rules, and,
56656 as aspects vary widely, that has to be done for each such
56657 aspect. Since most aspects do not need this complexity
56658 (including all language-defined aspects as of this writing),
56659 we avoid the complexity by saying that such contract-forming
56660 aspect specifications are banned unless the rules defining
56661 them explicitly exist. Note that the method of specification
56662 does not matter: aspect_specifications, representation items,
56663 and operational items are all covered by this (and similar)
56664 rules.
56665
56666 10/3
56667 {AI05-0295-1AI05-0295-1} For an untagged derived type, it is illegal to
56668 specify a type-related representation aspect if the parent type is a
56669 by-reference type, or has any user-defined primitive subprograms.
56670
56671 10.a/3
56672 Ramification: {8652/00098652/0009}
56673 {AI95-00137-01AI95-00137-01} {AI05-0295-1AI05-0295-1} On the
56674 other hand, subtype-specific representation aspects may be
56675 specified for the first subtype of such a type, as can
56676 operational aspects.
56677
56678 10.b/3
56679 Reason: {AI05-0229-1AI05-0229-1} {AI05-0295-1AI05-0295-1} The
56680 reason for forbidding specification of type-related
56681 representation aspects on untagged by-reference types is
56682 because a change of representation is impossible when passing
56683 by reference (to an inherited subprogram). The reason for
56684 forbidding specification of type-related representation
56685 aspects on untagged types with user-defined primitive
56686 subprograms was to prevent implicit change of representation
56687 for type-related aspects of representation upon calling
56688 inherited subprograms, because such changes of representation
56689 are likely to be expensive at run time. Changes of
56690 subtype-specific representation attributes, however, are
56691 likely to be cheap. This rule is not needed for tagged types,
56692 because other rules prevent a type-related representation
56693 aspect from changing the representation of the parent part; we
56694 want to allow specifying a type-related representation aspect
56695 on a type extension to specify aspects of the extension part.
56696 For example, specifying aspect Pack will cause packing of the
56697 extension part, but not of the parent part.
56698
56699 11/3
56700 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} {8652/00118652/0011}
56701 {AI95-00117-01AI95-00117-01} {AI95-00326-01AI95-00326-01}
56702 {AI05-0295-1AI05-0295-1} Operational and representation aspects of a
56703 generic formal parameter are the same as those of the actual.
56704 Operational and representation aspects are the same for all views of a
56705 type. Specification of a type-related representation aspect is not
56706 allowed for a descendant of a generic formal untagged type.
56707
56708 11.a/3
56709 Ramification: {8652/00098652/0009}
56710 {AI95-00137-01AI95-00137-01} {AI05-0295-1AI05-0295-1}
56711 Specifying representation aspects is allowed for types whose
56712 subcomponent types or index subtypes are generic formal types.
56713 Specifying operational aspects and subtype-related
56714 representation aspects is allowed on descendants of generic
56715 formal types.
56716
56717 11.b/3
56718 Reason: {AI05-0295-1AI05-0295-1} Since it is not known whether
56719 a formal type has user-defined primitive subprograms,
56720 specifying type-related representation aspects for them is not
56721 allowed, unless they are tagged (in which case only the
56722 extension part is affected in any case).
56723
56724 11.c/2
56725 Ramification: {AI95-00326-01AI95-00326-01} All views of a
56726 type, including the incomplete and partial views, have the
56727 same operational and representation aspects. That's important
56728 so that the properties don't change when changing views.
56729 While most aspects are not available for an incomplete view,
56730 we don't want to leave any holes by not saying that they are
56731 the same.
56732
56733 11.d/3
56734 {AI05-0083-1AI05-0083-1} However, this does not apply to
56735 objects. Different views of an object can have different
56736 representation aspects. For instance, an actual object passed
56737 by reference and the associated formal parameter may have
56738 different values for Alignment even though the formal
56739 parameter is merely a view of the actual object. This is
56740 necessary to maintain the language design principle that
56741 Alignments are always known at compile time.
56742
56743 12/3
56744 {AI05-0295-1AI05-0295-1} The specification of the Size aspect for a
56745 given subtype, or the size or storage place for an object (including a
56746 component) of a given subtype, shall allow for enough storage space to
56747 accommodate any value of the subtype.
56748
56749 13/3
56750 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
56751 {AI05-0295-1AI05-0295-1} If a specification of a representation or
56752 operational aspect is not supported by the implementation, it is illegal
56753 or raises an exception at run time.
56754
56755 13.1/3
56756 {AI95-00251-01AI95-00251-01} {AI05-0295-1AI05-0295-1} A type_declaration
56757 is illegal if it has one or more progenitors, and a nonconfirming value
56758 was specified for a representation aspect of an ancestor, and this
56759 conflicts with the representation of some other ancestor. The cases
56760 that cause conflicts are implementation defined.
56761
56762 13.a/2
56763 Implementation defined: The cases that cause conflicts between
56764 the representation of the ancestors of a type_declaration.
56765
56766 13.b/3
56767 Reason: {AI05-0295-1AI05-0295-1} This rule is needed because
56768 it may be the case that only the combination of types in a
56769 type declaration causes a conflict. Thus it is not possible,
56770 in general, to reject the original representation item or
56771 aspect_specification. For instance:
56772
56773 13.c/2
56774 package Pkg1 is
56775 type Ifc is interface;
56776 type T is tagged record
56777 Fld : Integer;
56778 end record;
56779 for T use record
56780 Fld at 0 range 0 .. Integer'Size - 1;
56781 end record;
56782 end Pkg1;
56783
56784 13.d/2
56785 Assume the implementation uses a single tag with a default
56786 offset of zero, and that it allows the use of nondefault
56787 locations for the tag (and thus accepts representation items
56788 like the one above). The representation item will force a
56789 nondefault location for the tag (by putting a component other
56790 than the tag into the default location). Clearly, this
56791 package will be accepted by the implementation. However,
56792 other declarations could cause trouble. For instance, the
56793 implementation could reject:
56794
56795 13.e/2
56796 with Pkg1;
56797 package Pkg2 is
56798 type NewT is new Pkg1.T and Pkg1.Ifc with null record;
56799 end Pkg2;
56800
56801 13.f/3
56802 {AI05-0295-1AI05-0295-1} because the declarations of T and Ifc
56803 have a conflict in their representation items. This is
56804 clearly necessary (it's hard to imagine how Ifc'Class could
56805 work with the tag at a location other than the one it is
56806 expecting without introducing distributed overhead).
56807
56808 13.g/3
56809 {AI05-0295-1AI05-0295-1} Conflicts will usually involve
56810 implementation-defined attributes (for specifying the location
56811 of the tag, for instance), although the example above shows
56812 that doesn't have to be the case. For this reason, we didn't
56813 try to specify exactly what causes a conflict; it will depend
56814 on the implementation's implementation model and what
56815 representation aspects it allows to be changed.
56816
56817 13.h/3
56818 Implementation Note: {AI05-0295-1AI05-0295-1} An
56819 implementation can only use this rule to reject
56820 type_declarations where one of its ancestors had a
56821 nonconfirming representation value specified. An
56822 implementation must ensure that the default representations of
56823 ancestors cannot conflict.
56824
56825 _Static Semantics_
56826
56827 14
56828 If two subtypes statically match, then their subtype-specific aspects
56829 (Size and Alignment) are the same.
56830
56831 14.a/3
56832 Reason: {AI05-0295-1AI05-0295-1} This is necessary because we
56833 allow (for example) conversion between access types whose
56834 designated subtypes statically match. Note that most aspects
56835 (including the subtype-specific aspects Size and Alignment)
56836 may not be specified for a nonfirst subtype. The only
56837 language-defined exceptions to this rule are the
56838 Static_Predicate and Dynamic_Predicate aspects.
56839
56840 14.b
56841 Consider, for example:
56842
56843 14.c/1
56844 package P1 is
56845 subtype S1 is Integer range 0..2**16-1;
56846 for S1'Size use 16; -- Illegal!
56847 -- S1'Size would be 16 by default.
56848 type A1 is access all S1;
56849 X1: A1;
56850 end P1;
56851
56852 14.d/1
56853 package P2 is
56854 subtype S2 is Integer range 0..2**16-1;
56855 for S2'Size use 32; -- Illegal!
56856 type A2 is access all S2;
56857 X2: A2;
56858 end P2;
56859
56860 14.e/3
56861 {AI05-0229-1AI05-0229-1} procedure Q is
56862 use P1, P2;
56863 type Array1 is array(Integer range <>) of aliased S1
56864 with Pack;
56865 Obj1: Array1(1..100);
56866 type Array2 is array(Integer range <>) of aliased S2
56867 with Pack;
56868 Obj2: Array2(1..100);
56869 begin
56870 X1 := Obj2(17)'Unchecked_Access;
56871 X2 := Obj1(17)'Unchecked_Access;
56872 end Q;
56873
56874 14.f
56875 Loads and stores through X1 would read and write 16 bits, but
56876 X1 points to a 32-bit location. Depending on the endianness
56877 of the machine, loads might load the wrong 16 bits. Stores
56878 would fail to zero the other half in any case.
56879
56880 14.g
56881 Loads and stores through X2 would read and write 32 bits, but
56882 X2 points to a 16-bit location. Thus, adjacent memory
56883 locations would be trashed.
56884
56885 14.h
56886 Hence, the above is illegal. Furthermore, the compiler is
56887 forbidden from choosing different Sizes by default, for the
56888 same reason.
56889
56890 14.i
56891 The same issues apply to Alignment.
56892
56893 15/3
56894 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
56895 {AI05-0009-1AI05-0009-1} {AI05-0295-1AI05-0295-1} A derived type
56896 inherits each type-related representation aspect of its parent type that
56897 was directly specified before the declaration of the derived type, or
56898 (in the case where the parent is derived) that was inherited by the
56899 parent type from the grandparent type. A derived subtype inherits each
56900 subtype-specific representation aspect of its parent subtype that was
56901 directly specified before the declaration of the derived type, or (in
56902 the case where the parent is derived) that was inherited by the parent
56903 subtype from the grandparent subtype, but only if the parent subtype
56904 statically matches the first subtype of the parent type. An inherited
56905 representation aspect is overridden by a subsequent aspect_specification
56906 or representation item that specifies a different value for the same
56907 aspect of the type or subtype.
56908
56909 15.a
56910 To be honest: A record_representation_clause for a record
56911 extension does not override the layout of the parent part; if
56912 the layout was specified for the parent type, it is inherited
56913 by the record extension.
56914
56915 15.b
56916 Ramification: If a representation item for the parent appears
56917 after the derived_type_definition (*note 3.4: S0035.), then
56918 inheritance does not happen for that representation item.
56919
56920 15.b.1/3
56921 {AI05-0009-1AI05-0009-1} {AI05-0295-1AI05-0295-1} If an
56922 inherited aspect is confirmed by an aspect_specification or a
56923 later representation item for a derived type, the confirming
56924 specification does not override the inherited one. Thus the
56925 derived type has both a specified confirming value and an
56926 inherited nonconfirming representation value -- this means
56927 that rules that apply only to nonconfirming representation
56928 values still apply to this type.
56929
56930 15.1/3
56931 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
56932 {AI95-00444-01AI95-00444-01} {AI05-0183-1AI05-0183-1}
56933 {AI05-0295-1AI05-0295-1} In contrast, whether operational aspects are
56934 inherited by a derived type depends on each specific aspect; unless
56935 specified, an operational aspect is not inherited. When operational
56936 aspects are inherited by a derived type, aspects that were directly
56937 specified by aspect_specifications or operational items that are visible
56938 at the point of the derived type declaration, or (in the case where the
56939 parent is derived) that were inherited by the parent type from the
56940 grandparent type are inherited. An inherited operational aspect is
56941 overridden by a subsequent aspect_specification or operational item that
56942 specifies the same aspect of the type.
56943
56944 15.b.2/1
56945 Ramification: As with representation items, if an operational
56946 item for the parent appears after the derived_type_definition
56947 (*note 3.4: S0035.), then inheritance does not happen for that
56948 operational item.
56949
56950 15.2/2
56951 {AI95-00444-01AI95-00444-01} When an aspect that is a subprogram is
56952 inherited, the derived type inherits the aspect in the same way that a
56953 derived type inherits a user-defined primitive subprogram from its
56954 parent (see *note 3.4::).
56955
56956 15.c/2
56957 Reason: This defines the parameter names and types, and the
56958 needed implicit conversions.
56959
56960 16
56961 Each aspect of representation of an entity is as follows:
56962
56963 17
56964 * If the aspect is specified for the entity, meaning that it is
56965 either directly specified or inherited, then that aspect of the
56966 entity is as specified, except in the case of Storage_Size, which
56967 specifies a minimum.
56968
56969 17.a
56970 Ramification: This rule implies that queries of the aspect
56971 return the specified value. For example, if the user writes
56972 "for X'Size use 32;", then a query of X'Size will return 32.
56973
56974 18
56975 * If an aspect of representation of an entity is not specified, it is
56976 chosen by default in an unspecified manner.
56977
56978 18.a/3
56979 Ramification: {8652/00098652/0009}
56980 {AI95-00137-01AI95-00137-01} {AI05-0295-1AI05-0295-1} Note
56981 that specifying a representation aspect can affect the
56982 semantics of the entity.
56983
56984 18.b
56985 The rules forbid things like "for S'Base'Alignment use ..."
56986 and "for S'Base use record ...".
56987
56988 18.c
56989 Discussion: The intent is that implementations will represent
56990 the components of a composite value in the same way for all
56991 subtypes of a given composite type. Hence, Component_Size and
56992 record layout are type-related aspects.
56993
56994 18.d/3
56995 Ramification: {AI05-0083-1AI05-0083-1} As noted previously, in
56996 the case of an object, the entity mentioned in this text is a
56997 specific view of an object. That means that only references
56998 to the same view of an object that has a specified value for a
56999 representation aspect R necessarily have that value for the
57000 aspect R. The value of the aspect R for a different view of
57001 that object is unspecified. In particular, this means that
57002 the representation values for by-reference parameters is
57003 unspecified; they do not have to be the same as those of the
57004 underlying object.
57005
57006 18.1/1
57007 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} If an operational
57008 aspect is specified for an entity (meaning that it is either directly
57009 specified or inherited), then that aspect of the entity is as specified.
57010 Otherwise, the aspect of the entity has the default value for that
57011 aspect.
57012
57013 18.2/3
57014 {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} An
57015 aspect_specification or representation item that specifies a
57016 representation aspect that would have been chosen in the absence of the
57017 aspect_specification or representation item is said to be confirming.
57018 The aspect value specified in this case is said to be a confirming
57019 representation aspect value. Other values of the aspect are said to be
57020 nonconfirming, as are the aspect_specifications and representation items
57021 that specified them.
57022
57023 _Dynamic Semantics_
57024
57025 19/1
57026 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} For the elaboration of
57027 an aspect_clause, any evaluable constructs within it are evaluated.
57028
57029 19.a/3
57030 Ramification: {AI05-0299-1AI05-0299-1} Elaboration of
57031 representation pragmas is covered by the general rules for
57032 pragmas in *note 2.8::.
57033
57034 _Implementation Permissions_
57035
57036 20/3
57037 {AI05-0295-1AI05-0295-1} An implementation may interpret representation
57038 aspects in an implementation-defined manner. An implementation may
57039 place implementation-defined restrictions on the specification of
57040 representation aspects. A recommended level of support is defined for
57041 the specification of representation aspects and related features in each
57042 subclause. These recommendations are changed to requirements for
57043 implementations that support the Systems Programming Annex (see *note
57044 C.2::, "*note C.2:: Required Representation Support").
57045
57046 20.a/3
57047 Implementation defined: The interpretation of each
57048 representation aspect.
57049
57050 20.b/3
57051 Implementation defined: Any restrictions placed upon the
57052 specification of representation aspects.
57053
57054 20.c
57055 Ramification: Implementation-defined restrictions may be
57056 enforced either at compile time or at run time. There is no
57057 requirement that an implementation justify any such
57058 restrictions. They can be based on avoiding implementation
57059 complexity, or on avoiding excessive inefficiency, for
57060 example.
57061
57062 20.c.1/1
57063 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} There is no
57064 such permission for operational aspects.
57065
57066 _Implementation Advice_
57067
57068 21/3
57069 {AI05-0295-1AI05-0295-1} The recommended level of support for the
57070 specification of all representation aspects is qualified as follows:
57071
57072 21.1/3
57073 * {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} A confirming
57074 specification for a representation aspect should be supported.
57075
57076 21.a/3
57077 To be honest: {AI05-0295-1AI05-0295-1} A confirming
57078 representation aspect value might not be possible for some
57079 entities. For instance, consider an unconstrained array. The
57080 size of such a type is implementation-defined, and might not
57081 actually be a representable value, or might not be static.
57082
57083 22/3
57084 * {AI05-0295-1AI05-0295-1} An implementation need not support the
57085 specification for a representation aspect that contains nonstatic
57086 expressions, unless each nonstatic expression is a name that
57087 statically denotes a constant declared before the entity.
57088
57089 22.a
57090 Reason: This is to avoid the following sort of thing:
57091
57092 22.b
57093 X : Integer := F(...);
57094 Y : Address := G(...);
57095 for X'Address use Y;
57096
57097 22.c
57098 In the above, we have to evaluate the initialization
57099 expression for X before we know where to put the result. This
57100 seems like an unreasonable implementation burden.
57101
57102 22.d
57103 The above code should instead be written like this:
57104
57105 22.e
57106 Y : constant Address := G(...);
57107 X : Integer := F(...);
57108 for X'Address use Y;
57109
57110 22.f
57111 This allows the expression "Y" to be safely evaluated before X
57112 is created.
57113
57114 22.g
57115 The constant could be a formal parameter of mode in.
57116
57117 22.h
57118 An implementation can support other nonstatic expressions if
57119 it wants to. Expressions of type Address are hardly ever
57120 static, but their value might be known at compile time anyway
57121 in many cases.
57122
57123 23
57124 * An implementation need not support a specification for the Size for
57125 a given composite subtype, nor the size or storage place for an
57126 object (including a component) of a given composite subtype, unless
57127 the constraints on the subtype and its composite subcomponents (if
57128 any) are all static constraints.
57129
57130 24/3
57131 * {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} An
57132 implementation need not support specifying a nonconfirming
57133 representation aspect value if it could cause an aliased object or
57134 an object of a by-reference type to be allocated at a
57135 nonaddressable location or, when the alignment attribute of the
57136 subtype of such an object is nonzero, at an address that is not an
57137 integral multiple of that alignment.
57138
57139 24.a/1
57140 Reason: The intent is that access types, type System.Address,
57141 and the pointer used for a by-reference parameter should be
57142 implementable as a single machine address -- bit-field
57143 pointers should not be required. (There is no requirement
57144 that this implementation be used -- we just want to make sure
57145 it's feasible.)
57146
57147 24.b/2
57148 Implementation Note: {AI95-00291-02AI95-00291-02} We want
57149 subprograms to be able to assume the properties of the types
57150 of their parameters inside of subprograms. While many objects
57151 can be copied to allow this (and thus do not need
57152 limitations), aliased or by-reference objects cannot be copied
57153 (their memory location is part of their identity). Thus, the
57154 above rule does not apply to types that merely allow
57155 by-reference parameter passing; for such types, a copy
57156 typically needs to be made at the call site when a bit-aligned
57157 component is passed as a parameter.
57158
57159 25/3
57160 * {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} An
57161 implementation need not support specifying a nonconfirming
57162 representation aspect value if it could cause an aliased object of
57163 an elementary type to have a size other than that which would have
57164 been chosen by default.
57165
57166 25.a/2
57167 Reason: Since all bits of elementary objects participate in
57168 operations, aliased objects must not have a different size
57169 than that assumed by users of the access type.
57170
57171 26/3
57172 * {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} An
57173 implementation need not support specifying a nonconfirming
57174 representation aspect value if it could cause an aliased object of
57175 a composite type, or an object whose type is by-reference, to have
57176 a size smaller than that which would have been chosen by default.
57177
57178 26.a/2
57179 Reason: Unlike elementary objects, there is no requirement
57180 that all bits of a composite object participate in operations.
57181 Thus, as long as the object is the same or larger in size than
57182 that expected by the access type, all is well.
57183
57184 26.b/2
57185 Ramification: This rule presumes that the implementation
57186 allocates an object of a size specified to be larger than the
57187 default size in such a way that access of the default size
57188 suffices to correctly read and write the value of the object.
57189
57190 27/3
57191 * {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} An
57192 implementation need not support specifying a nonconfirming
57193 subtype-specific representation aspect value for an indefinite or
57194 abstract subtype.
57195
57196 27.a/3
57197 Reason: {AI05-0295-1AI05-0295-1} Representation aspects are
57198 often not well-defined for such types.
57199
57200 27.b/3
57201 Ramification: {AI95-00291-02AI95-00291-02}
57202 {AI05-0229-1AI05-0229-1} A type with the Pack aspect specified
57203 will typically not be packed so tightly as to disobey the
57204 above rules. A Component_Size clause or
57205 record_representation_clause will typically be illegal if it
57206 disobeys the above rules. Atomic components have similar
57207 restrictions (see *note C.6::, "*note C.6:: Shared Variable
57208 Control").
57209
57210 28/3
57211 {AI95-00291-02AI95-00291-02} {AI05-0295-1AI05-0295-1} For purposes of
57212 these rules, the determination of whether specifying a representation
57213 aspect value for a type could cause an object to have some property is
57214 based solely on the properties of the type itself, not on any available
57215 information about how the type is used. In particular, it presumes that
57216 minimally aligned objects of this type might be declared at some point.
57217
57218 28.a/2
57219 Implementation Advice: The recommended level of support for
57220 all representation items should be followed.
57221
57222 NOTES
57223
57224 29/3
57225 1 {AI05-0229-1AI05-0229-1} Aspects that can be specified are
57226 defined throughout this International Standard, and are summarized
57227 in *note K.1::.
57228
57229 _Incompatibilities With Ada 83_
57230
57231 29.a
57232 It is now illegal for a representation item to cause a derived
57233 by-reference type to have a different record layout from its
57234 parent. This is necessary for by-reference parameter passing
57235 to be feasible. This only affects programs that specify the
57236 representation of types derived from types containing tasks;
57237 most by-reference types are new to Ada 95. For example, if A1
57238 is an array of tasks, and A2 is derived from A1, it is illegal
57239 to apply a pragma Pack to A2.
57240
57241 _Extensions to Ada 83_
57242
57243 29.b/1
57244 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Ada 95
57245 allows additional aspect_clauses for objects.
57246
57247 _Wording Changes from Ada 83_
57248
57249 29.c/1
57250 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} The syntax
57251 rule for type_representation_clause is removed; the right-hand
57252 side of that rule is moved up to where it was used, in
57253 aspect_clause. There are two references to "type
57254 representation clause" in RM83, both in Section 13; these have
57255 been reworded. Also, the representation_clause has been
57256 renamed the aspect_clause to reflect that it can be used to
57257 control more than just representation aspects.
57258
57259 29.d/2
57260 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
57261 {AI95-00114-01AI95-00114-01} We have defined a new term
57262 "representation item," which includes all representation
57263 clauses and representation pragmas, as well as
57264 component_clauses. This is convenient because the rules are
57265 almost identical for all of them. We have also defined the
57266 new terms "operational item" and "operational aspects" in
57267 order to conveniently handle new types of specifiable
57268 entities.
57269
57270 29.e
57271 All of the forcing occurrence stuff has been moved into its
57272 own subclause (see *note 13.14::), and rewritten to use the
57273 term "freezing".
57274
57275 29.f
57276 RM83-13.1(10) requires implementation-defined restrictions on
57277 representation items to be enforced at compile time. However,
57278 that is impossible in some cases. If the user specifies a
57279 junk (nonstatic) address in an address clause, and the
57280 implementation chooses to detect the error (for example, using
57281 hardware memory management with protected pages), then it's
57282 clearly going to be a run-time error. It seems silly to call
57283 that "semantics" rather than "a restriction."
57284
57285 29.g
57286 RM83-13.1(10) tries to pretend that representation_clauses
57287 don't affect the semantics of the program. One
57288 counter-example is the Small clause. Ada 95 has more
57289 counter-examples. We have noted the opposite above.
57290
57291 29.h
57292 Some of the more stringent requirements are moved to *note
57293 C.2::, "*note C.2:: Required Representation Support".
57294
57295 _Extensions to Ada 95_
57296
57297 29.i/2
57298 {AI95-00291-02AI95-00291-02} Amendment Correction: Confirming
57299 representation items are defined, and the recommended level of
57300 support is now that they always be supported.
57301
57302 _Wording Changes from Ada 95_
57303
57304 29.j/2
57305 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
57306 Added operational items in order to eliminate unnecessary
57307 restrictions and permissions on stream attributes. As part of
57308 this, representation_clause was renamed to aspect_clause.
57309
57310 29.k/2
57311 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
57312 {AI95-00326-01AI95-00326-01} Corrigendum: Added wording to say
57313 that the partial and full views have the same operational and
57314 representation aspects. Ada 2005 extends this to cover all
57315 views, including the incomplete view.
57316
57317 29.l/2
57318 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} Corrigendum:
57319 Changed operational items to have inheritance specified for
57320 each such aspect.
57321
57322 29.m/2
57323 {AI95-00251-01AI95-00251-01} Added wording to allow the
57324 rejection of types with progenitors that have conflicting
57325 representation items.
57326
57327 29.n/2
57328 {AI95-00291-02AI95-00291-02} The description of the
57329 representation of an object was clarified (with great
57330 difficulty reaching agreement). Added wording to say that
57331 representation items on aliased and by-reference objects never
57332 need be supported if they would not be implementable without
57333 distributed overhead even if other recommended level of
57334 support says otherwise. This wording matches the rules with
57335 reality.
57336
57337 29.o/3
57338 {AI95-00444-01AI95-00444-01} {AI05-0005-1AI05-0005-1} Added
57339 wording so that inheritance depends on whether operational
57340 items are visible rather than whether they occur before the
57341 declaration (we don't want to look into private parts). Also
57342 limited operational inheritance to untagged types to avoid
57343 anomalies with private extensions (this is not incompatible,
57344 no existing operational attribute used this capability). Also
57345 added wording to clearly define that subprogram inheritance
57346 works like derivation of subprograms.
57347
57348 _Incompatibilities With Ada 2005_
57349
57350 29.p/3
57351 {AI05-0106-1AI05-0106-1} Correction: Specifying a
57352 language-defined aspect for a generic formal parameter is no
57353 longer allowed. Most aspects could not be specified on these
57354 anyway; moreover, this was not allowed in Ada 83, so it is
57355 unlikely that compilers are supporting this as a capability
57356 (and it is not likely that they have a consistent definition
57357 of what it means if it is allowed). Thus, we expect this to
57358 occur rarely in existing programs.
57359
57360 _Wording Changes from Ada 2005_
57361
57362 29.q/3
57363 {AI05-0009-1AI05-0009-1} Correction: Defined that overriding
57364 of an representation aspect only happens for a nonconfirming
57365 representation item. This prevents a derived type from being
57366 considered to have only a confirming representation item when
57367 the value would be nonconfirming if given on a type that does
57368 not inherit any aspects of representation. This change just
57369 eliminates a wording confusion and ought not change any
57370 behavior.
57371
57372 29.r/3
57373 {AI05-0112-1AI05-0112-1} Correction: Defined a default naming
57374 for representation aspects that are representation pragmas.
57375
57376 29.s/3
57377 {AI05-0183-1AI05-0183-1} Added text ensuring that the rules
57378 for representational and operational items also apply
57379 appropriately to aspect_specifications; generalized
57380 operational aspects so that they can be defined for entities
57381 other than types. Any extensions are documented elsewhere.
57382
57383 29.t/3
57384 {AI05-0295-1AI05-0295-1} Rewrote many rules to be in terms of
57385 "specifying a representation aspect" rather than use of a
57386 "representation item". This better separates how an aspect is
57387 specified from what rules apply to the value of the aspect.
57388
57389 * Menu:
57390
57391 * 13.1.1 :: Aspect Specifications
57392
57393 \1f
57394 File: aarm2012.info, Node: 13.1.1, Up: 13.1
57395
57396 13.1.1 Aspect Specifications
57397 ----------------------------
57398
57399 1/3
57400 {AI05-0183-1AI05-0183-1} [Certain representation or operational aspects
57401 of an entity may be specified as part of its declaration using an
57402 aspect_specification, rather than using a separate representation or
57403 operational item.] The declaration with the aspect_specification is
57404 termed the associated declaration.
57405
57406 _Syntax_
57407
57408 2/3
57409 {AI05-0183-1AI05-0183-1} aspect_specification ::=
57410 with aspect_mark [=> aspect_definition] {,
57411 aspect_mark [=> aspect_definition] }
57412
57413 3/3
57414 {AI05-0183-1AI05-0183-1} aspect_mark ::= aspect_identifier['Class]
57415
57416 4/3
57417 {AI05-0183-1AI05-0183-1} aspect_definition ::= name | expression |
57418 identifier
57419
57420 _Language Design Principles_
57421
57422 4.a/3
57423 {AI05-0183-1AI05-0183-1} {AI05-0267-1AI05-0267-1} The
57424 aspect_specification is an optional element in most kinds of
57425 declarations. Here is a list of all kinds of declarations and
57426 an indication of whether or not they allow aspect clauses, and
57427 in some cases a short discussion of why (* = allowed, NO = not
57428 allowed). Kinds of declarations with no indication are
57429 followed by their subdivisions (which have indications).
57430
57431 4.b/3
57432 basic_declaration
57433 type_declaration
57434 full_type_declaration
57435 type declaration syntax*
57436 task_type_declaration*
57437 protected_type_declaration*
57438 incomplete_type_declaration -- NO
57439 -- Incomplete type aspects cannot be read by an attribute or specified by attribute_definition_clauses
57440 -- (the attribute name is illegal), so it would not make sense to allow this in another way.
57441 private_type_declaration*
57442 private_extension_declaration*
57443 subtype_declaration*
57444 object_declaration
57445 object declaration syntax*
57446 single_task_declaration*
57447 single_protected_declaration*
57448 number_declaration -- NO
57449 subprogram_declaration*
57450 abstract_subprogram_declaration*
57451 null_procedure_declaration*
57452 package_declaration* -- via package_specification
57453 renaming_declaration*
57454 -- There are no language-defined aspects that may be specified
57455 -- on renames, but implementations might support some.
57456 exception_declaration*
57457 generic_declaration
57458 generic_subprogram_declaration*
57459 generic_package_declaration* -- via package_specification
57460 generic_instantiation*
57461 enumeration_literal_specification -- NO
57462 discriminant_specification -- NO
57463 component_declaration*
57464 loop_parameter_specification -- NO
57465 iterator_specification -- NO
57466 parameter_specification -- NO
57467 subprogram_body* -- - but language-defined aspects only if there is no explicit specification
57468 entry_declaration*
57469 entry_index_specification -- NO
57470 subprogram_body_stub* -- - but language-defined aspects only if there is no explicit specification
57471 choice_parameter_specification -- NO
57472 generic_formal_parameter_declaration
57473 -- There are no language-defined aspects that may be specified
57474 -- on generic formals, but implementations might support some.
57475 formal_object_declaration*
57476 formal_type_declaration*
57477 formal_subprogram_declaration
57478 formal_concrete_subprogram_declaration*
57479 formal_abstract_subprogram_declaration*
57480 formal_package_declaration*
57481 extended_return_statement -- NO
57482
57483 4.c/3
57484 -- We also allow aspect_specifications on all kinds of bodies, but are no language-defined aspects
57485 -- that may be specified on a body. These are allowed for implementation-defined aspects.
57486 -- See above for subprogram bodies and stubs (as these can be declarations).
57487 package_body*
57488 task_body*
57489 protected_body*
57490 package_body_stub*
57491 task_body_stub*
57492 protected_body_stub*
57493
57494 4.d/3
57495 {AI05-0267-1AI05-0267-1} Syntactically, aspect_specifications
57496 generally are located at the end of declarations. When a
57497 declaration is all in one piece such as a
57498 null_procedure_declaration, object_declaration, or
57499 generic_instantiation the aspect_specification goes at the end
57500 of the declaration; it is then more visible and less likely to
57501 interfere with the layout of the rest of the structure.
57502 However, we make an exception for program units (other than
57503 subprogram specifications) and bodies, in which the
57504 aspect_specification goes before the is. In these cases, the
57505 entity could be large and could contain other declarations
57506 that also have aspect_specifications, so it is better to put
57507 the aspect_specification toward the top of the declaration.
57508 (Some aspects - such as Pure - also affect the legality of the
57509 contents of a unit, so it would be annoying to only see those
57510 after reading the entire unit.)
57511
57512 _Name Resolution Rules_
57513
57514 5/3
57515 {AI05-0183-1AI05-0183-1} An aspect_mark identifies an aspect of the
57516 entity defined by the associated declaration (the associated entity);
57517 the aspect denotes an object, a value, an expression, a subprogram, or
57518 some other kind of entity. If the aspect_mark identifies:
57519
57520 6/3
57521 * an aspect that denotes an object, the aspect_definition shall be a
57522 name. The expected type for the name is the type of the identified
57523 aspect of the associated entity;
57524
57525 7/3
57526 * an aspect that is a value or an expression, the aspect_definition
57527 shall be an expression. The expected type for the expression is
57528 the type of the identified aspect of the associated entity;
57529
57530 8/3
57531 * an aspect that denotes a subprogram, the aspect_definition shall be
57532 a name; the expected profile for the name is the profile required
57533 for the aspect of the associated entity;
57534
57535 9/3
57536 * an aspect that denotes some other kind of entity, the
57537 aspect_definition shall be a name, and the name shall resolve to
57538 denote an entity of the appropriate kind;
57539
57540 10/3
57541 * an aspect that is given by an identifier specific to the aspect,
57542 the aspect_definition shall be an identifier, and the identifier
57543 shall be one of the identifiers specific to the identified aspect.
57544
57545 11/3
57546 {AI05-0183-1AI05-0183-1} The usage names in an aspect_definition [ are
57547 not resolved at the point of the associated declaration, but rather] are
57548 resolved at the end of the immediately enclosing declaration list.
57549
57550 12/3
57551 {AI05-0183-1AI05-0183-1} If the associated declaration is for a
57552 subprogram or entry, the names of the formal parameters are directly
57553 visible within the aspect_definition, as are certain attributes, as
57554 specified elsewhere in this International Standard for the identified
57555 aspect. If the associated declaration is a type_declaration, within the
57556 aspect_definition the names of any components are directly visible, and
57557 the name of the first subtype denotes the current instance of the type
57558 (see *note 8.6::). If the associated declaration is a
57559 subtype_declaration, within the aspect_definition the name of the new
57560 subtype denotes the current instance of the subtype.
57561
57562 _Legality Rules_
57563
57564 13/3
57565 {AI05-0183-1AI05-0183-1} If the first freezing point of the associated
57566 entity comes before the end of the immediately enclosing declaration
57567 list, then each usage name in the aspect_definition shall resolve to the
57568 same entity at the first freezing point as it does at the end of the
57569 immediately enclosing declaration list.
57570
57571 14/3
57572 {AI05-0183-1AI05-0183-1} At most one occurrence of each aspect_mark is
57573 allowed within a single aspect_specification. The aspect identified by
57574 the aspect_mark shall be an aspect that can be specified for the
57575 associated entity (or view of the entity defined by the associated
57576 declaration).
57577
57578 15/3
57579 {AI05-0183-1AI05-0183-1} The aspect_definition associated with a given
57580 aspect_mark may be omitted only when the aspect_mark identifies an
57581 aspect of a boolean type, in which case it is equivalent to the
57582 aspect_definition being specified as True.
57583
57584 16/3
57585 {AI05-0183-1AI05-0183-1} If the aspect_mark includes 'Class, then the
57586 associated entity shall be a tagged type or a primitive subprogram of a
57587 tagged type.
57588
57589 17/3
57590 {AI05-0183-1AI05-0183-1} {AI05-0267-1AI05-0267-1} There are no
57591 language-defined aspects that may be specified on a
57592 renaming_declaration, a generic_formal_parameter_declaration, a subunit,
57593 a package_body, a task_body, a protected_body, or a body_stub other than
57594 a subprogram_body_stub.
57595
57596 17.a/3
57597 Discussion: Implementation-defined aspects can be allowed on
57598 these, of course; the implementation will need to define the
57599 semantics. In particular, the implementation will need to
57600 define actual type matching rules for any aspects allowed on
57601 formal types; there are no default matching rules defined by
57602 the language.
57603
57604 18/3
57605 {AI05-0183-1AI05-0183-1} {AI05-0267-1AI05-0267-1} A language-defined
57606 aspect shall not be specified in an aspect_specification given on a
57607 subprogram_body or subprogram_body_stub that is a completion of another
57608 declaration.
57609
57610 18.a/3
57611 Reason: Most language-defined aspects (for example,
57612 preconditions) are intended to be available to callers, and
57613 specifying them on a body that has a separate declaration
57614 hides them from callers. Specific language-defined aspects
57615 may allow this, but they have to do so explicitly (by defining
57616 an alternative Legality Rule), and provide any needed rules
57617 about visibility. Note that this rule does not apply to
57618 implementation-defined aspects, so implementers need to
57619 carefully define whether such aspects can be applied to bodies
57620 and stubs, and what happens if they are specified on both the
57621 declaration and body of a unit.
57622
57623 _Static Semantics_
57624
57625 19/3
57626 {AI05-0183-1AI05-0183-1} Depending on which aspect is identified by the
57627 aspect_mark, an aspect_definition specifies:
57628
57629 20/3
57630 * a name that denotes a subprogram, object, or other kind of entity;
57631
57632 21/3
57633 * an expression, which is either evaluated to produce a single value,
57634 or which (as in a precondition) is to be evaluated at particular
57635 points during later execution; or
57636
57637 22/3
57638 * an identifier specific to the aspect.
57639
57640 23/3
57641 {AI05-0183-1AI05-0183-1} The identified aspect of the associated entity,
57642 or in some cases, the view of the entity defined by the declaration, is
57643 as specified by the aspect_definition (or by the default of True when
57644 boolean). Whether an aspect_specification applies to an entity or only
57645 to the particular view of the entity defined by the declaration is
57646 determined by the aspect_mark and the kind of entity. The following
57647 aspects are view specific:
57648
57649 24/3
57650 * An aspect specified on an object_declaration;
57651
57652 25/3
57653 * An aspect specified on a subprogram_declaration;
57654
57655 26/3
57656 * An aspect specified on a renaming_declaration.
57657
57658 27/3
57659 {AI05-0183-1AI05-0183-1} All other aspect_specifications are associated
57660 with the entity, and apply to all views of the entity, unless otherwise
57661 specified in this International Standard.
57662
57663 28/3
57664 {AI05-0183-1AI05-0183-1} If the aspect_mark includes 'Class, then:
57665
57666 29/3
57667 * if the associated entity is a tagged type, the specification
57668 applies to all descendants of the type;
57669
57670 30/3
57671 * if the associated entity is a primitive subprogram of a tagged type
57672 T, the specification applies to the corresponding primitive
57673 subprogram of all descendants of T.
57674
57675 31/3
57676 {AI05-0183-1AI05-0183-1} {AI05-0229-1AI05-0229-1} All specifiable
57677 operational and representation attributes may be specified with an
57678 aspect_specification instead of an attribute_definition_clause (see
57679 *note 13.3::).
57680
57681 31.a/3
57682 Ramification: The name of the aspect is the same as that of
57683 the attribute (see *note 13.3::), so the aspect_mark is the
57684 attribute_designator of the attribute.
57685
57686 32/3
57687 {AI05-0229-1AI05-0229-1} Any aspect specified by a representation pragma
57688 or library unit pragma that has a local_name as its single argument may
57689 be specified by an aspect_specification, with the entity being the
57690 local_name. The aspect_definition is expected to be of type Boolean.
57691 The expression shall be static.
57692
57693 32.a/3
57694 Ramification: The name of the aspect is the same as that of
57695 the pragma (see *note 13.1::), so the aspect_mark is the name
57696 of the pragma.
57697
57698 33/3
57699 {AI05-0229-1AI05-0229-1} In addition, other operational and
57700 representation aspects not associated with specifiable attributes or
57701 representation pragmas may be specified, as specified elsewhere in this
57702 International Standard.
57703
57704 34/3
57705 {AI05-0183-1AI05-0183-1} If an aspect of a derived type is inherited
57706 from an ancestor type and has the boolean value True, the inherited
57707 value shall not be overridden to have the value False for the derived
57708 type, unless otherwise specified in this International Standard.
57709
57710 35/3
57711 {AI05-0183-1AI05-0183-1} If a Legality Rule or Static Semantics rule
57712 only applies when a particular aspect has been specified, the aspect is
57713 considered to have been specified only when the aspect_specification or
57714 attribute_definition_clause is visible (see *note 8.3::) at the point of
57715 the application of the rule.
57716
57717 35.a/3
57718 Reason: Some rules only apply when an aspect has been
57719 specified (for instance, an indexable type is one that has
57720 aspect Variable_Indexing specified). In order to prevent
57721 privacy breaking, this can only be true when the specification
57722 of the aspect is visible. In particular, if the
57723 Variable_Indexing aspect is specified on the full view of a
57724 private type, the private type is not considered an indexable
57725 type.
57726
57727 36/3
57728 {AI05-0183-1AI05-0183-1} Alternative legality and semantics rules may
57729 apply for particular aspects, as specified elsewhere in this
57730 International Standard.
57731
57732 _Dynamic Semantics_
57733
57734 37/3
57735 {AI05-0183-1AI05-0183-1} At the freezing point of the associated entity,
57736 the aspect_specification is elaborated. The elaboration of the
57737 aspect_specification includes the evaluation of the name or expression,
57738 if any, unless the aspect itself is an expression. If the corresponding
57739 aspect represents an expression (as in a precondition), the elaboration
57740 has no effect; the expression is evaluated later at points within the
57741 execution as specified elsewhere in this International Standard for the
57742 particular aspect.
57743
57744 _Implementation Permissions_
57745
57746 38/3
57747 {AI05-0183-1AI05-0183-1} Implementations may support
57748 implementation-defined aspects. The aspect_specification for an
57749 implementation-defined aspect may use an implementation-defined syntax
57750 for the aspect_definition, and may follow implementation-defined
57751 legality and semantics rules.
57752
57753 38.a/3
57754 Discussion: The intent is to allow implementations to support
57755 aspects that are defined, for example, by a subtype_indication
57756 rather than an expression or a name. We chose not to try to
57757 enumerate all possible aspect_definition syntaxes, but to give
57758 implementations maximum freedom. Unrecognized aspects are
57759 illegal whether or not they use custom syntax, so this freedom
57760 does not reduce portability.
57761
57762 38.a.1/3
57763 Implementation defined: Implementation-defined aspects,
57764 inluding the syntax for specifying such aspects and the
57765 legality rules for such aspects.
57766
57767 _Extensions to Ada 2005_
57768
57769 38.b/3
57770 {AI05-0183-1AI05-0183-1} {AI05-0229-1AI05-0229-1}
57771 {AI05-0267-1AI05-0267-1} Aspect specifications are new.
57772
57773 \1f
57774 File: aarm2012.info, Node: 13.2, Next: 13.3, Prev: 13.1, Up: 13
57775
57776 13.2 Packed Types
57777 =================
57778
57779 1/3
57780 {AI05-0229-1AI05-0229-1} [The Pack aspect having the value True
57781 specifies that storage minimization should be the main criterion when
57782 selecting the representation of a composite type.]
57783
57784 Paragraphs 2 through 4 were moved to *note Annex J::, "*note Annex J::
57785 Obsolescent Features".
57786
57787 _Static Semantics_
57788
57789 5/3
57790 {AI05-0229-1AI05-0229-1} For a full type declaration of a composite
57791 type, the following language-defined representation aspect may be
57792 specified:
57793
57794 5.1/3
57795 Pack
57796 The type of aspect Pack is Boolean. When aspect Pack is
57797 True for a type, the type (or the extension part) is said
57798 to be packed. For a type extension, the parent part is
57799 packed as for the parent type, and specifying Pack causes
57800 packing only of the extension part.
57801
57802 5.a/3
57803 Aspect Description for Pack: Minimize storage when laying out
57804 records and arrays.
57805
57806 5.2/3
57807 If directly specified, the aspect_definition shall be a
57808 static expression. If not specified (including by
57809 inheritance), the aspect is False.
57810
57811 5.b/3
57812 Ramification: {AI05-0229-1AI05-0229-1} The only high level
57813 semantic effect of specifying the Pack aspect is potential
57814 loss of independent addressability (see *note 9.10::, "*note
57815 9.10:: Shared Variables").]
57816
57817 _Implementation Advice_
57818
57819 6
57820 If a type is packed, then the implementation should try to minimize
57821 storage allocated to objects of the type, possibly at the expense of
57822 speed of accessing components, subject to reasonable complexity in
57823 addressing calculations.
57824
57825 6.a.1/2
57826 Implementation Advice: Storage allocated to objects of a
57827 packed type should be minimized.
57828
57829 6.a/3
57830 Ramification: {AI05-0229-1AI05-0229-1} Specifying the Pack
57831 aspect is for gaining space efficiency, possibly at the
57832 expense of time. If more explicit control over representation
57833 is desired, then a record_representation_clause, a
57834 Component_Size clause, or a Size clause should be used instead
57835 of, or in addition to, the Pack aspect.
57836
57837 6.1/2
57838 {AI95-00291-02AI95-00291-02} If a packed type has a component that is
57839 not of a by-reference type and has no aliased part, then such a
57840 component need not be aligned according to the Alignment of its subtype;
57841 in particular it need not be allocated on a storage element boundary.
57842
57843 7/3
57844 {AI05-0229-1AI05-0229-1} The recommended level of support for the Pack
57845 aspect is:
57846
57847 8
57848 * For a packed record type, the components should be packed as
57849 tightly as possible subject to the Sizes of the component subtypes,
57850 and subject to any record_representation_clause that applies to the
57851 type; the implementation may, but need not, reorder components or
57852 cross aligned word boundaries to improve the packing. A component
57853 whose Size is greater than the word size may be allocated an
57854 integral number of words.
57855
57856 8.a
57857 Ramification: The implementation can always allocate an
57858 integral number of words for a component that will not fit in
57859 a word. The rule also allows small component sizes to be
57860 rounded up if such rounding does not waste space. For
57861 example, if Storage_Unit = 8, then a component of size 8 is
57862 probably more efficient than a component of size 7 plus a
57863 1-bit gap (assuming the gap is needed anyway).
57864
57865 9/3
57866 * {AI05-0009-1AI05-0009-1} For a packed array type, if the Size of
57867 the component subtype is less than or equal to the word size,
57868 Component_Size should be less than or equal to the Size of the
57869 component subtype, rounded up to the nearest factor of the word
57870 size.
57871
57872 9.a
57873 Ramification: If a component subtype is aliased, its Size will
57874 generally be a multiple of Storage_Unit, so it probably won't
57875 get packed very tightly.
57876
57877 9.b/3
57878 Implementation Advice: The recommended level of support for
57879 the Pack aspect should be followed.
57880
57881 _Wording Changes from Ada 95_
57882
57883 9.c/3
57884 {AI95-00291-02AI95-00291-02} {AI05-0229-1AI05-0229-1} Added
57885 clarification that the Pack aspect can ignore alignment
57886 requirements on types that don't have by-reference or aliased
57887 parts. This was always intended, but there was no wording to
57888 that effect.
57889
57890 _Extensions to Ada 2005_
57891
57892 9.d/3
57893 {AI05-0229-1AI05-0229-1} Aspect Pack is new; pragma Pack is
57894 now obsolescent.
57895
57896 _Wording Changes from Ada 2005_
57897
57898 9.e/3
57899 {AI05-0009-1AI05-0009-1} Correction: Fixed so that the
57900 presence or absence of a confirming Component_Size
57901 representation clause does not change the meaning of the Pack
57902 aspect.
57903
57904 \1f
57905 File: aarm2012.info, Node: 13.3, Next: 13.4, Prev: 13.2, Up: 13
57906
57907 13.3 Operational and Representation Attributes
57908 ==============================================
57909
57910 1/1
57911 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} [ The values of
57912 certain implementation-dependent characteristics can be obtained by
57913 interrogating appropriate operational or representation attributes.
57914 Some of these attributes are specifiable via an
57915 attribute_definition_clause.]
57916
57917 _Language Design Principles_
57918
57919 1.a
57920 In general, the meaning of a given attribute should not depend
57921 on whether the attribute was specified via an
57922 attribute_definition_clause, or chosen by default by the
57923 implementation.
57924
57925 _Syntax_
57926
57927 2
57928 attribute_definition_clause ::=
57929 for local_name'attribute_designator use expression;
57930 | for local_name'attribute_designator use name;
57931
57932 _Name Resolution Rules_
57933
57934 3
57935 For an attribute_definition_clause that specifies an attribute that
57936 denotes a value, the form with an expression shall be used. Otherwise,
57937 the form with a name shall be used.
57938
57939 4
57940 For an attribute_definition_clause that specifies an attribute that
57941 denotes a value or an object, the expected type for the expression or
57942 name is that of the attribute. For an attribute_definition_clause that
57943 specifies an attribute that denotes a subprogram, the expected profile
57944 for the name is the profile required for the attribute. For an
57945 attribute_definition_clause that specifies an attribute that denotes
57946 some other kind of entity, the name shall resolve to denote an entity of
57947 the appropriate kind.
57948
57949 4.a
57950 Ramification: For example, the Size attribute is of type
57951 universal_integer. Therefore, the expected type for Y in "for
57952 X'Size use Y;" is universal_integer, which means that Y can be
57953 of any integer type.
57954
57955 4.b
57956 Discussion: For attributes that denote subprograms, the
57957 required profile is indicated separately for the individual
57958 attributes.
57959
57960 4.c
57961 Ramification: For an attribute_definition_clause with a name,
57962 the name need not statically denote the entity it denotes.
57963 For example, the following kinds of things are allowed:
57964
57965 4.d
57966 for Some_Access_Type'Storage_Pool use Storage_Pool_Array(I);
57967 for Some_Type'Read use Subprogram_Pointer.all;
57968
57969 _Legality Rules_
57970
57971 5/3
57972 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
57973 {AI05-0183-1AI05-0183-1} An attribute_designator is allowed in an
57974 attribute_definition_clause only if this International Standard
57975 explicitly allows it, or for an implementation-defined attribute if the
57976 implementation allows it. Each specifiable attribute constitutes an
57977 operational aspect or aspect of representation; the name of the aspect
57978 is that of the attribute.
57979
57980 5.a
57981 Discussion: For each specifiable attribute, we generally say
57982 something like, "The ... attribute may be specified for ...
57983 via an attribute_definition_clause."
57984
57985 5.b
57986 The above wording allows for T'Class'Alignment, T'Class'Size,
57987 T'Class'Input, and T'Class'Output to be specifiable.
57988
57989 5.c
57990 A specifiable attribute is not necessarily specifiable for all
57991 entities for which it is defined. For example, one is allowed
57992 to ask T'Component_Size for an array subtype T, but "for
57993 T'Component_Size use ..." is only allowed if T is a first
57994 subtype, because Component_Size is a type-related aspect.
57995
57996 6
57997 For an attribute_definition_clause that specifies an attribute that
57998 denotes a subprogram, the profile shall be mode conformant with the one
57999 required for the attribute, and the convention shall be Ada. Additional
58000 requirements are defined for particular attributes.
58001
58002 6.a
58003 Ramification: This implies, for example, that if one writes:
58004
58005 6.b
58006 for T'Read use R;
58007
58008 6.c
58009 R has to be a procedure with two parameters with the
58010 appropriate subtypes and modes as shown in *note 13.13.2::.
58011
58012 _Static Semantics_
58013
58014 7/2
58015 {AI95-00270-01AI95-00270-01} A Size clause is an
58016 attribute_definition_clause whose attribute_designator is Size. Similar
58017 definitions apply to the other specifiable attributes.
58018
58019 7.a
58020 To be honest: An attribute_definition_clause is type-related
58021 or subtype-specific if the attribute_designator denotes a
58022 type-related or subtype-specific attribute, respectively.
58023
58024 8
58025 A storage element is an addressable element of storage in the machine.
58026 A word is the largest amount of storage that can be conveniently and
58027 efficiently manipulated by the hardware, given the implementation's
58028 run-time model. A word consists of an integral number of storage
58029 elements.
58030
58031 8.a
58032 Discussion: A storage element is not intended to be a single
58033 bit, unless the machine can efficiently address individual
58034 bits.
58035
58036 8.b
58037 Ramification: For example, on a machine with 8-bit storage
58038 elements, if there exist 32-bit integer registers, with a full
58039 set of arithmetic and logical instructions to manipulate those
58040 registers, a word ought to be 4 storage elements -- that is,
58041 32 bits.
58042
58043 8.c
58044 Discussion: The "given the implementation's run-time model"
58045 part is intended to imply that, for example, on an 80386
58046 running MS-DOS, the word might be 16 bits, even though the
58047 hardware can support 32 bits.
58048
58049 8.d
58050 A word is what ACID refers to as a "natural hardware
58051 boundary".
58052
58053 8.e
58054 Storage elements may, but need not be, independently
58055 addressable (see *note 9.10::, "*note 9.10:: Shared
58056 Variables"). Words are expected to be independently
58057 addressable.
58058
58059 8.1/3
58060 {AI95-00133-01AI95-00133-01} {AI05-0092-1AI05-0092-1} A machine scalar
58061 is an amount of storage that can be conveniently and efficiently loaded,
58062 stored, or operated upon by the hardware. Machine scalars consist of an
58063 integral number of storage elements. The set of machine scalars is
58064 implementation defined, but includes at least the storage element and
58065 the word. Machine scalars are used to interpret component_clauses when
58066 the nondefault bit ordering applies.
58067
58068 8.e.1/2
58069 Implementation defined: The set of machine scalars.
58070
58071 8.f/3
58072 Ramification: {AI05-0092-1AI05-0092-1} A single storage
58073 element is a machine scalar in all Ada implementations.
58074 Similarly, a word is a machine scalar in all implementations
58075 (although it might be the same as a storage element). An
58076 implementation may define other machine scalars that make
58077 sense on the target (a half-word, for instance).
58078
58079 9/3
58080 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
58081 {AI05-0191-1AI05-0191-1} The following representation attributes are
58082 defined: Address, Alignment, Size, Storage_Size, Component_Size,
58083 Has_Same_Storage, and Overlaps_Storage.
58084
58085 10/1
58086 For a prefix X that denotes an object, program unit, or label:
58087
58088 11
58089 X'Address
58090 Denotes the address of the first of the storage elements
58091 allocated to X. For a program unit or label, this value
58092 refers to the machine code associated with the
58093 corresponding body or statement. The value of this
58094 attribute is of type System.Address.
58095
58096 11.a
58097 Ramification: Here, the "first of the storage elements" is
58098 intended to mean the one with the lowest address; the
58099 endianness of the machine doesn't matter.
58100
58101 11.1/3
58102 {AI05-0095-1AI05-0095-1} The prefix of X'Address shall
58103 not statically denote a subprogram that has convention
58104 Intrinsic. X'Address raises Program_Error if X denotes a
58105 subprogram that has convention Intrinsic.
58106
58107 12
58108 Address may be specified for stand-alone objects and for
58109 program units via an attribute_definition_clause.
58110
58111 12.a
58112 Ramification: Address is not allowed for enumeration literals,
58113 predefined operators, derived task types, or derived protected
58114 types, since they are not program units.
58115
58116 12.b/3
58117 Address is not allowed for intrinsic subprograms, either.
58118 That can be checked statically unless the prefix is a generic
58119 formal subprogram and the attribute reference is in the body
58120 of a generic unit. We define that case to raise
58121 Program_Error, in order that the compiler does not have to
58122 build a wrapper for intrinsic subprograms.
58123
58124 12.c
58125 The validity of a given address depends on the run-time model;
58126 thus, in order to use Address clauses correctly, one needs
58127 intimate knowledge of the run-time model.
58128
58129 12.d/3
58130 {AI05-0229-1AI05-0229-1} If the Address of an object is
58131 specified, any explicit or implicit initialization takes place
58132 as usual, unless the Import aspect is also specified for the
58133 object (in which case any necessary initialization is
58134 presumably done in the foreign language).
58135
58136 12.e
58137 Any compilation unit containing an attribute_reference of a
58138 given type depends semantically on the declaration of the
58139 package in which the type is declared, even if not mentioned
58140 in an applicable with_clause -- see *note 10.1.1::. In this
58141 case, it means that if a compilation unit contains X'Address,
58142 then it depends on the declaration of System. Otherwise, the
58143 fact that the value of Address is of a type in System wouldn't
58144 make sense; it would violate the "legality determinable via
58145 semantic dependences" Language Design Principle.
58146
58147 12.f
58148 AI83-00305 -- If X is a task type, then within the body of X,
58149 X denotes the current task object; thus, X'Address denotes the
58150 object's address.
58151
58152 12.g
58153 Interrupt entries and their addresses are described in *note
58154 J.7.1::, "*note J.7.1:: Interrupt Entries".
58155
58156 12.h
58157 If X is not allocated on a storage element boundary, X'Address
58158 points at the first of the storage elements that contains any
58159 part of X. This is important for the definition of the
58160 Position attribute to be sensible.
58161
58162 12.i/3
58163 Aspect Description for Address: Machine address of an entity.
58164
58165 _Erroneous Execution_
58166
58167 13/3
58168 {AI05-0009-1AI05-0009-1} If an Address is specified, it is the
58169 programmer's responsibility to ensure that the address is valid and
58170 appropriate for the entity and its use; otherwise, program execution is
58171 erroneous.
58172
58173 13.a
58174 Discussion: "Appropriate for the entity and its use" covers
58175 cases such as misaligned addresses, read-only code addresses
58176 for variable data objects (and nonexecutable data addresses
58177 for code units), and addresses which would force objects that
58178 are supposed to be independently addressable to not be. Such
58179 addresses may be "valid" as they designate locations that are
58180 accessible to the program, but the program execution is still
58181 erroneous (meaning that implementations do not have to worry
58182 about these cases).
58183
58184 _Implementation Advice_
58185
58186 14
58187 For an array X, X'Address should point at the first component of the
58188 array, and not at the array bounds.
58189
58190 14.a.1/2
58191 Implementation Advice: For an array X, X'Address should point
58192 at the first component of the array rather than the array
58193 bounds.
58194
58195 14.a
58196 Ramification: On the other hand, we have no advice to offer
58197 about discriminants and tag fields; whether or not the address
58198 points at them is not specified by the language. If
58199 discriminants are stored separately, then the Position of a
58200 discriminant might be negative, or might raise an exception.
58201
58202 15
58203 The recommended level of support for the Address attribute is:
58204
58205 16
58206 * X'Address should produce a useful result if X is an object that is
58207 aliased or of a by-reference type, or is an entity whose Address
58208 has been specified.
58209
58210 16.a
58211 Reason: Aliased objects are the ones for which the
58212 Unchecked_Access attribute is allowed; hence, these have to be
58213 allocated on an addressable boundary anyway. Similar
58214 considerations apply to objects of a by-reference type.
58215
58216 16.b
58217 An implementation need not go to any trouble to make Address
58218 work in other cases. For example, if an object X is not
58219 aliased and not of a by-reference type, and the implementation
58220 chooses to store it in a register, X'Address might return
58221 System.Null_Address (assuming registers are not addressable).
58222 For a subprogram whose calling convention is Intrinsic, or for
58223 a package, the implementation need not generate an out-of-line
58224 piece of code for it.
58225
58226 17
58227 * An implementation should support Address clauses for imported
58228 subprograms.
58229
58230 18/2
58231 * This paragraph was deleted.{AI95-00291-02AI95-00291-02}
58232
58233 18.a/2
58234 This paragraph was deleted.
58235
58236 19
58237 * If the Address of an object is specified, or it is imported or
58238 exported, then the implementation should not perform optimizations
58239 based on assumptions of no aliases.
58240
58241 19.a/2
58242 Implementation Advice: The recommended level of support for
58243 the Address attribute should be followed.
58244
58245 NOTES
58246
58247 20
58248 2 The specification of a link name with the Link_Name aspect (see
58249 *note B.1::) for a subprogram or object is an alternative to
58250 explicit specification of its link-time address, allowing a
58251 link-time directive to place the subprogram or object within
58252 memory.
58253
58254 21
58255 3 The rules for the Size attribute imply, for an aliased object X,
58256 that if X'Size = Storage_Unit, then X'Address points at a storage
58257 element containing all of the bits of X, and only the bits of X.
58258
58259 _Wording Changes from Ada 83_
58260
58261 21.a
58262 The intended meaning of the various attributes, and their
58263 attribute_definition_clauses, is more explicit.
58264
58265 21.b
58266 The address_clause has been renamed to at_clause and moved to
58267 *note Annex J::, "*note Annex J:: Obsolescent Features". One
58268 can use an Address clause ("for T'Address use ...;") instead.
58269
58270 21.c
58271 The attributes defined in RM83-13.7.3 are moved to *note Annex
58272 G::, *note A.5.3::, and *note A.5.4::.
58273
58274 _Wording Changes from Ada 2005_
58275
58276 21.c.1/3
58277 {AI05-0183-1AI05-0183-1} Defined that the names of aspects are
58278 the same as the name of the attribute; that gives a name to
58279 use in aspect_specifications (see *note 13.1.1::).
58280
58281 _Language Design Principles_
58282
58283 21.d
58284 By default, the Alignment of a subtype should reflect the
58285 "natural" alignment for objects of the subtype on the machine.
58286 The Alignment, whether specified or default, should be known
58287 at compile time, even though Addresses are generally not known
58288 at compile time. (The generated code should never need to
58289 check at run time the number of zero bits at the end of an
58290 address to determine an alignment).
58291
58292 21.e
58293 There are two symmetric purposes of Alignment clauses,
58294 depending on whether or not the implementation has control
58295 over object allocation. If the implementation allocates an
58296 object, the implementation should ensure that the Address and
58297 Alignment are consistent with each other. If something
58298 outside the implementation allocates an object, the
58299 implementation should be allowed to assume that the Address
58300 and Alignment are consistent, but should not assume stricter
58301 alignments than that.
58302
58303 _Static Semantics_
58304
58305 22/2
58306 {AI95-00291-02AI95-00291-02} For a prefix X that denotes an object:
58307
58308 23/2
58309 X'Alignment
58310 {AI95-00291-02AI95-00291-02} The value of this attribute
58311 is of type universal_integer, and nonnegative; zero means
58312 that the object is not necessarily aligned on a storage
58313 element boundary. If X'Alignment is not zero, then X is
58314 aligned on a storage unit boundary and X'Address is an
58315 integral multiple of X'Alignment (that is, the Address
58316 modulo the Alignment is zero).
58317
58318 24/2
58319
58320 This paragraph was deleted.{AI95-00291-02AI95-00291-02}
58321
58322 24.a
58323 Ramification: The Alignment is passed by an allocator to the
58324 Allocate operation; the implementation has to choose a value
58325 such that if the address returned by Allocate is aligned as
58326 requested, the generated code can correctly access the object.
58327
58328 24.b
58329 The above mention of "modulo" is referring to the "mod"
58330 operator declared in System.Storage_Elements; if X mod N = 0,
58331 then X is by definition aligned on an N-storage-element
58332 boundary.
58333
58334 25/2
58335 {AI95-00291-02AI95-00291-02} Alignment may be specified
58336 for [stand-alone] objects via an
58337 attribute_definition_clause (*note 13.3: S0309.); the
58338 expression of such a clause shall be static, and its
58339 value nonnegative.
58340
58341 25.a/3
58342 Aspect Description for Alignment (object): Alignment of an
58343 object.
58344
58345 26/2
58346
58347 This paragraph was deleted.{AI95-00247-01AI95-00247-01}
58348
58349 26.1/2
58350 {AI95-00291-02AI95-00291-02} For every subtype S:
58351
58352 26.2/2
58353 S'Alignment
58354 {AI95-00291-02AI95-00291-02} The value of this attribute
58355 is of type universal_integer, and nonnegative.
58356
58357 26.3/2
58358 {AI95-00051-02AI95-00051-02} {AI95-00291-02AI95-00291-02}
58359 For an object X of subtype S, if S'Alignment is not zero,
58360 then X'Alignment is a nonzero integral multiple of
58361 S'Alignment unless specified otherwise by a
58362 representation item.
58363
58364 26.4/2
58365 {AI95-00291-02AI95-00291-02} Alignment may be specified
58366 for first subtypes via an attribute_definition_clause
58367 (*note 13.3: S0309.); the expression of such a clause
58368 shall be static, and its value nonnegative.
58369
58370 26.a/3
58371 Aspect Description for Alignment (subtype): Alignment of a
58372 subtype.
58373
58374 _Erroneous Execution_
58375
58376 27
58377 Program execution is erroneous if an Address clause is given that
58378 conflicts with the Alignment.
58379
58380 27.a
58381 Ramification: The user has to either give an Alignment clause
58382 also, or else know what Alignment the implementation will
58383 choose by default.
58384
58385 28/2
58386 {AI95-00051-02AI95-00051-02} {AI95-00291-02AI95-00291-02} For an object
58387 that is not allocated under control of the implementation, execution is
58388 erroneous if the object is not aligned according to its Alignment.
58389
58390 _Implementation Advice_
58391
58392 28.1/3
58393 {AI05-0116-1AI05-0116-1} For any tagged specific subtype S,
58394 S'Class'Alignment should equal S'Alignment.
58395
58396 28.a/3
58397 Reason: A tagged object should never be less aligned than the
58398 alignment of the type of its view, so for a class-wide type
58399 T'Class, the alignment should be no greater than that of any
58400 type covered by T'Class. If the implementation only supports
58401 alignments that are required by the recommended level of
58402 support (and this is most likely), then the alignment of any
58403 covered type has to be the same or greater than that of T --
58404 which leaves the only reasonable value of T'Class'Alignment
58405 being T'Alignment. Thus we recommend this, but don't require
58406 it so that in the unlikely case that the implementation does
58407 support smaller alignments for covered types, it can select a
58408 smaller value for T'Class'Alignment.
58409
58410 28.a.1/3
58411 Implementation Advice: For any tagged specific subtype S,
58412 S'Class'Alignment should equal S'Alignment.
58413
58414 29
58415 The recommended level of support for the Alignment attribute for
58416 subtypes is:
58417
58418 30/2
58419 * {AI95-00051-02AI95-00051-02} An implementation should support an
58420 Alignment clause for a discrete type, fixed point type, record
58421 type, or array type, specifying an Alignment value that is zero or
58422 a power of two, subject to the following:
58423
58424 31/2
58425 * {AI95-00051-02AI95-00051-02} An implementation need not support an
58426 Alignment clause for a signed integer type specifying an Alignment
58427 greater than the largest Alignment value that is ever chosen by
58428 default by the implementation for any signed integer type. A
58429 corresponding limitation may be imposed for modular integer types,
58430 fixed point types, enumeration types, record types, and array
58431 types.
58432
58433 32/2
58434 * {AI95-00051-02AI95-00051-02} An implementation need not support a
58435 nonconfirming Alignment clause which could enable the creation of
58436 an object of an elementary type which cannot be easily loaded and
58437 stored by available machine instructions.
58438
58439 32.1/2
58440 * {AI95-00291-02AI95-00291-02} An implementation need not support an
58441 Alignment specified for a derived tagged type which is not a
58442 multiple of the Alignment of the parent type. An implementation
58443 need not support a nonconfirming Alignment specified for a derived
58444 untagged by-reference type.
58445
58446 32.a/2
58447 Ramification: {AI95-00291-02AI95-00291-02} There is no
58448 recommendation to support any nonconfirming Alignment clauses
58449 for types not mentioned above. Remember that *note 13.1::
58450 requires support for confirming Alignment clauses for all
58451 types.
58452
58453 32.b/3
58454 Implementation Note: {AI05-0116-1AI05-0116-1} An
58455 implementation that tries to support other alignments for
58456 derived tagged types will need to allow inherited subprograms
58457 to be passed objects that are less aligned than expected by
58458 the parent subprogram and type. This is unlikely to work if
58459 alignment has any effect on code selection. Similar issues
58460 arise for untagged derived types whose parameters are passed
58461 by reference.
58462
58463 33
58464 The recommended level of support for the Alignment attribute for objects
58465 is:
58466
58467 34/2
58468 * This paragraph was deleted.{AI95-00291-02AI95-00291-02}
58469
58470 35
58471 * For stand-alone library-level objects of statically constrained
58472 subtypes, the implementation should support all Alignments
58473 supported by the target linker. For example, page alignment is
58474 likely to be supported for such objects, but not for subtypes.
58475
58476 35.1/2
58477 * {AI95-00291-02AI95-00291-02} For other objects, an implementation
58478 should at least support the alignments supported for their subtype,
58479 subject to the following:
58480
58481 35.2/2
58482 * {AI95-00291-02AI95-00291-02} An implementation need not support
58483 Alignments specified for objects of a by-reference type or for
58484 objects of types containing aliased subcomponents if the specified
58485 Alignment is not a multiple of the Alignment of the subtype of the
58486 object.
58487
58488 35.a/2
58489 Implementation Advice: The recommended level of support for
58490 the Alignment attribute should be followed.
58491
58492 NOTES
58493
58494 36
58495 4 Alignment is a subtype-specific attribute.
58496
58497 37/2
58498 This paragraph was deleted.{AI95-00247-01AI95-00247-01}
58499
58500 37.a/2
58501 This paragraph was deleted.
58502
58503 38/3
58504 5 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} A
58505 component_clause, Component_Size clause, or specifying the Pack
58506 aspect as True can override a specified Alignment.
58507
58508 38.a
58509 Discussion: Most objects are allocated by the implementation;
58510 for these, the implementation obeys the Alignment. The
58511 implementation is of course allowed to make an object more
58512 aligned than its Alignment requires -- an object whose
58513 Alignment is 4 might just happen to land at an address that's
58514 a multiple of 4096. For formal parameters, the implementation
58515 might want to force an Alignment stricter than the parameter's
58516 subtype. For example, on some systems, it is customary to
58517 always align parameters to 4 storage elements.
58518
58519 38.b
58520 Hence, one might initially assume that the implementation
58521 could evilly make all Alignments 1 by default, even though
58522 integers, say, are normally aligned on a 4-storage-element
58523 boundary. However, the implementation cannot get away with
58524 that -- if the Alignment is 1, the generated code cannot
58525 assume an Alignment of 4, at least not for objects allocated
58526 outside the control of the implementation.
58527
58528 38.c
58529 Of course implementations can assume anything they can prove,
58530 but typically an implementation will be unable to prove much
58531 about the alignment of, say, an imported object. Furthermore,
58532 the information about where an address "came from" can be lost
58533 to the compiler due to separate compilation.
58534
58535 38.d/3
58536 {AI95-00114-01AI95-00114-01} {AI05-0229-1AI05-0229-1} The
58537 Alignment of an object that is a component of a packed
58538 composite object will usually be 0, to indicate that the
58539 component is not necessarily aligned on a storage element
58540 boundary. For a subtype, an Alignment of 0 means that objects
58541 of the subtype are not normally aligned on a storage element
58542 boundary at all. For example, an implementation might choose
58543 to make Component_Size be 1 for an array of Booleans, even
58544 when the Pack aspect has not been specified for the array. In
58545 this case, Boolean'Alignment would be 0. (In the presence of
58546 tasking, this would in general be feasible only on a machine
58547 that had atomic test-bit and set-bit instructions.)
58548
58549 38.e
58550 If the machine has no particular natural alignments, then all
58551 subtype Alignments will probably be 1 by default.
58552
58553 38.f
58554 Specifying an Alignment of 0 in an attribute_definition_clause
58555 does not require the implementation to do anything (except
58556 return 0 when the Alignment is queried). However, it might be
58557 taken as advice on some implementations.
58558
58559 38.g
58560 It is an error for an Address clause to disobey the object's
58561 Alignment. The error cannot be detected at compile time, in
58562 general, because the Address is not necessarily known at
58563 compile time (and is almost certainly not static). We do not
58564 require a run-time check, since efficiency seems paramount
58565 here, and Address clauses are treading on thin ice anyway.
58566 Hence, this misuse of Address clauses is just like any other
58567 misuse of Address clauses -- it's erroneous.
58568
58569 38.h
58570 A type extension can have a stricter Alignment than its
58571 parent. This can happen, for example, if the Alignment of the
58572 parent is 4, but the extension contains a component with
58573 Alignment 8. The Alignment of a class-wide type or object
58574 will have to be the maximum possible Alignment of any
58575 extension.
58576
58577 38.i
58578 The recommended level of support for the Alignment attribute
58579 is intended to reflect a minimum useful set of capabilities.
58580 An implementation can assume that all Alignments are multiples
58581 of each other -- 1, 2, 4, and 8 might be the only supported
58582 Alignments for subtypes. An Alignment of 3 or 6 is unlikely
58583 to be useful. For objects that can be allocated statically,
58584 we recommend that the implementation support larger
58585 alignments, such as 4096. We do not recommend such large
58586 alignments for subtypes, because the maximum subtype alignment
58587 will also have to be used as the alignment of stack frames,
58588 heap objects, and class-wide objects. Similarly, we do not
58589 recommend such large alignments for stack-allocated objects.
58590
58591 38.j
58592 If the maximum default Alignment is 8 (say,
58593 Long_Float'Alignment = 8), then the implementation can refuse
58594 to accept stricter alignments for subtypes. This simplifies
58595 the generated code, since the compiler can align the stack and
58596 class-wide types to this maximum without a substantial waste
58597 of space (or time).
58598
58599 38.k
58600 Note that the recommended level of support takes into account
58601 interactions between Size and Alignment. For example, on a
58602 32-bit machine with 8-bit storage elements, where load and
58603 store instructions have to be aligned according to the size of
58604 the thing being loaded or stored, the implementation might
58605 accept an Alignment of 1 if the Size is 8, but might reject an
58606 Alignment of 1 if the Size is 32. On a machine where
58607 unaligned loads and stores are merely inefficient (as opposed
58608 to causing hardware traps), we would expect an Alignment of 1
58609 to be supported for any Size.
58610
58611 _Wording Changes from Ada 83_
58612
58613 38.l
58614 The nonnegative part is missing from RM83 (for mod_clauses,
58615 nee alignment_clauses, which are an obsolete version of
58616 Alignment clauses).
58617
58618 _Static Semantics_
58619
58620 39/1
58621 For a prefix X that denotes an object:
58622
58623 40
58624 X'Size
58625 Denotes the size in bits of the representation of the
58626 object. The value of this attribute is of the type
58627 universal_integer.
58628
58629 40.a
58630 Ramification: Note that Size is in bits even if Machine_Radix
58631 is 10. Each decimal digit (and the sign) is presumably
58632 represented as some number of bits.
58633
58634 41
58635 Size may be specified for [stand-alone] objects via an
58636 attribute_definition_clause; the expression of such a
58637 clause shall be static and its value nonnegative.
58638
58639 41.a/3
58640 Aspect Description for Size (object): Size in bits of an
58641 object.
58642
58643 _Implementation Advice_
58644
58645 41.1/2
58646 {AI95-00051-02AI95-00051-02} The size of an array object should not
58647 include its bounds.
58648
58649 41.a.1/2
58650 Implementation Advice: The Size of an array object should not
58651 include its bounds.
58652
58653 42/2
58654 {AI95-00051-02AI95-00051-02} {AI95-00291-02AI95-00291-02} The
58655 recommended level of support for the Size attribute of objects is the
58656 same as for subtypes (see below), except that only a confirming Size
58657 clause need be supported for an aliased elementary object.
58658
58659 43/2
58660 * This paragraph was deleted.{AI95-00051-02AI95-00051-02}
58661
58662 _Static Semantics_
58663
58664 44
58665 For every subtype S:
58666
58667 45
58668 S'Size
58669 If S is definite, denotes the size [(in bits)] that the
58670 implementation would choose for the following objects of
58671 subtype S:
58672
58673 46
58674 * A record component of subtype S when the record type
58675 is packed.
58676
58677 47
58678 * The formal parameter of an instance of
58679 Unchecked_Conversion that converts from subtype S to
58680 some other subtype.
58681
58682 48
58683 If S is indefinite, the meaning is implementation
58684 defined. The value of this attribute is of the type
58685 universal_integer. The Size of an object is at least as
58686 large as that of its subtype, unless the object's Size is
58687 determined by a Size clause, a component_clause, or a
58688 Component_Size clause. Size may be specified for first
58689 subtypes via an attribute_definition_clause (*note 13.3:
58690 S0309.); the expression of such a clause shall be static
58691 and its value nonnegative.
58692
58693 48.a
58694 Implementation defined: The meaning of Size for indefinite
58695 subtypes.
58696
58697 48.b
58698 Reason: The effects of specifying the Size of a subtype are:
58699
58700 48.c
58701 * Unchecked_Conversion works in a predictable manner.
58702
58703 48.d
58704 * A composite type cannot be packed so tightly as to
58705 override the specified Size of a component's subtype.
58706
58707 48.e
58708 * Assuming the Implementation Advice is obeyed, if the
58709 specified Size allows independent addressability, then
58710 the Size of certain objects of the subtype should be
58711 equal to the subtype's Size. This applies to stand-alone
58712 objects and to components (unless a component_clause or a
58713 Component_Size clause applies).
58714
58715 48.f/3
58716 {AI05-0229-1AI05-0229-1} A component_clause or a
58717 Component_Size clause can cause an object to be smaller than
58718 its subtype's specified size. The aspect Pack cannot; if a
58719 component subtype's size is specified, this limits how tightly
58720 the composite object can be packed.
58721
58722 48.g
58723 The Size of a class-wide (tagged) subtype is unspecified,
58724 because it's not clear what it should mean; it should
58725 certainly not depend on all of the descendants that happen to
58726 exist in a given program. Note that this cannot be detected
58727 at compile time, because in a generic unit, it is not
58728 necessarily known whether a given subtype is class-wide. It
58729 might raise an exception on some implementations.
58730
58731 48.h
58732 Ramification: A Size clause for a numeric subtype need not
58733 affect the underlying numeric type. For example, if I say:
58734
58735 48.i
58736 type S is range 1..2;
58737 for S'Size use 64;
58738
58739
58740 48.j
58741 I am not guaranteed that S'Base'Last >= 2**63-1, nor that
58742 intermediate results will be represented in 64 bits.
58743
58744 48.k
58745 Reason: There is no need to complicate implementations for
58746 this sort of thing, because the right way to affect the base
58747 range of a type is to use the normal way of declaring the base
58748 range:
58749
58750 48.l
58751 type Big is range -2**63 .. 2**63 - 1;
58752 subtype Small is Big range 1..1000;
58753
58754
58755 48.m
58756 Ramification: The Size of a large unconstrained subtype (e.g.
58757 String'Size) is likely to raise Constraint_Error, since it is
58758 a nonstatic expression of type universal_integer that might
58759 overflow the largest signed integer type. There is no
58760 requirement that the largest integer type be able to represent
58761 the size in bits of the largest possible object.
58762
58763 48.n/3
58764 Aspect Description for Size (subtype): Size in bits of a
58765 subtype.
58766
58767 _Implementation Requirements_
58768
58769 49
58770 In an implementation, Boolean'Size shall be 1.
58771
58772 _Implementation Advice_
58773
58774 50/2
58775 {AI95-00051-02AI95-00051-02} If the Size of a subtype allows for
58776 efficient independent addressability (see *note 9.10::) on the target
58777 architecture, then the Size of the following objects of the subtype
58778 should equal the Size of the subtype:
58779
58780 51
58781 * Aliased objects (including components).
58782
58783 52
58784 * Unaliased components, unless the Size of the component is
58785 determined by a component_clause or Component_Size clause.
58786
58787 52.a.1/2
58788 Implementation Advice: If the Size of a subtype allows for
58789 efficient independent addressability, then the Size of most
58790 objects of the subtype should equal the Size of the subtype.
58791
58792 52.a
58793 Ramification: Thus, on a typical 32-bit machine, "for S'Size
58794 use 32;" will guarantee that aliased objects of subtype S, and
58795 components whose subtype is S, will have Size = 32 (assuming
58796 the implementation chooses to obey this Implementation
58797 Advice). On the other hand, if one writes, "for S2'Size use
58798 5;" then stand-alone objects of subtype S2 will typically have
58799 their Size rounded up to ensure independent addressability.
58800
58801 52.b
58802 Note that "for S'Size use 32;" does not cause things like
58803 formal parameters to have Size = 32 -- the implementation is
58804 allowed to make all parameters be at least 64 bits, for
58805 example.
58806
58807 52.c
58808 Note that "for S2'Size use 5;" requires record components
58809 whose subtype is S2 to be exactly 5 bits if the record type is
58810 packed. The same is not true of array components; their Size
58811 may be rounded up to the nearest factor of the word size.
58812
58813 52.d/2
58814 Implementation Note: {AI95-00291-02AI95-00291-02} On most
58815 machines, arrays don't contain gaps between elementary
58816 components; if the Component_Size is greater than the Size of
58817 the component subtype, the extra bits are generally considered
58818 part of each component, rather than gaps between components.
58819 On the other hand, a record might contain gaps between
58820 elementary components, depending on what sorts of loads,
58821 stores, and masking operations are generally done by the
58822 generated code.
58823
58824 52.e/2
58825 {AI95-00291-02AI95-00291-02} For an array, any extra bits
58826 stored for each elementary component will generally be part of
58827 the component -- the whole point of storing extra bits is to
58828 make loads and stores more efficient by avoiding the need to
58829 mask out extra bits. The PDP-10 is one counter-example; since
58830 the hardware supports byte strings with a gap at the end of
58831 each word, one would want to pack in that manner.
58832
58833 53
58834 A Size clause on a composite subtype should not affect the internal
58835 layout of components.
58836
58837 53.a.1/2
58838 Implementation Advice: A Size clause on a composite subtype
58839 should not affect the internal layout of components.
58840
58841 53.a/3
58842 Reason: {AI05-0229-1AI05-0229-1} That's what Pack aspects,
58843 record_representation_clauses, and Component_Size clauses are
58844 for.
58845
58846 54
58847 The recommended level of support for the Size attribute of subtypes is:
58848
58849 55
58850 * The Size (if not specified) of a static discrete or fixed point
58851 subtype should be the number of bits needed to represent each value
58852 belonging to the subtype using an unbiased representation, leaving
58853 space for a sign bit only if the subtype contains negative values.
58854 If such a subtype is a first subtype, then an implementation should
58855 support a specified Size for it that reflects this representation.
58856
58857 55.a
58858 Implementation Note: This applies to static enumeration
58859 subtypes, using the internal codes used to represent the
58860 values.
58861
58862 55.b
58863 For a two's-complement machine, this implies that for a static
58864 signed integer subtype S, if all values of S are in the range
58865 0 .. 2n-1, or all values of S are in the range -2n-1 ..
58866 2n-1-1, for some n less than or equal to the word size, then
58867 S'Size should be <= the smallest such n. For a
58868 one's-complement machine, it is the same except that in the
58869 second range, the lower bound "-2n-1" is replaced by
58870 "-2n-1+1".
58871
58872 55.c
58873 If an integer subtype (whether signed or unsigned) contains no
58874 negative values, the Size should not include space for a sign
58875 bit.
58876
58877 55.d
58878 Typically, the implementation will choose to make the Size of
58879 a subtype be exactly the smallest such n. However, it might,
58880 for example, choose a biased representation, in which case it
58881 could choose a smaller value.
58882
58883 55.e/3
58884 {AI05-0229-1AI05-0229-1} On most machines, it is in general
58885 not a good idea to pack (parts of) multiple stand-alone
58886 objects into the same storage element, because (1) it usually
58887 doesn't save much space, and (2) it requires locking to
58888 prevent tasks from interfering with each other, since separate
58889 stand-alone objects are independently addressable. Therefore,
58890 if S'Size = 2 on a machine with 8-bit storage elements, the
58891 size of a stand-alone object of subtype S will probably not be
58892 2. It might, for example, be 8, 16 or 32, depending on the
58893 availability and efficiency of various machine instructions.
58894 The same applies to components of composite types, unless
58895 Pack, Component_Size, or record layout is specified.
58896
58897 55.f
58898 For an unconstrained discriminated object, if the
58899 implementation allocates the maximum possible size, then the
58900 Size attribute should return that maximum possible size.
58901
58902 55.g
58903 Ramification: The Size of an object X is not usually the same
58904 as that of its subtype S. If X is a stand-alone object or a
58905 parameter, for example, most implementations will round X'Size
58906 up to a storage element boundary, or more, so X'Size might be
58907 greater than S'Size. On the other hand, X'Size cannot be less
58908 than S'Size, even if the implementation can prove, for
58909 example, that the range of values actually taken on by X
58910 during execution is smaller than the range of S.
58911
58912 55.h
58913 For example, if S is a first integer subtype whose range is
58914 0..3, S'Size will be probably be 2 bits, and components of
58915 packed composite types of this subtype will be 2 bits
58916 (assuming Storage_Unit is a multiple of 2), but stand-alone
58917 objects and parameters will probably not have a size of 2
58918 bits; they might be rounded up to 32 bits, for example. On
58919 the other hand, Unchecked_Conversion will use the 2-bit size,
58920 even when converting a stand-alone object, as one would
58921 expect.
58922
58923 55.i
58924 Another reason for making the Size of an object bigger than
58925 its subtype's Size is to support the run-time detection of
58926 uninitialized variables. The implementation might add an
58927 extra value to a discrete subtype that represents the
58928 uninitialized state, and check for this value on use. In some
58929 cases, the extra value will require an extra bit in the
58930 representation of the object. Such detection is not required
58931 by the language. If it is provided, the implementation has to
58932 be able to turn it off. For example, if the programmer gives
58933 a record_representation_clause or Component_Size clause that
58934 makes a component too small to allow the extra bit, then the
58935 implementation will not be able to perform the checking (not
58936 using this method, anyway).
58937
58938 55.j
58939 The fact that the size of an object is not necessarily the
58940 same as its subtype can be confusing:
58941
58942 55.k
58943 type Device_Register is range 0..2**8 - 1;
58944 for Device_Register'Size use 8; -- Confusing!
58945 My_Device : Device_Register;
58946 for My_Device'Address use To_Address(16#FF00#);
58947
58948
58949 55.l
58950 The programmer might think that My_Device'Size is 8, and that
58951 My_Device'Address points at an 8-bit location. However, this
58952 is not true. In Ada 83 (and in Ada 95), My_Device'Size might
58953 well be 32, and My_Device'Address might well point at the
58954 high-order 8 bits of the 32-bit object, which are always all
58955 zero bits. If My_Device'Address is passed to an assembly
58956 language subprogram, based on the programmer's assumption, the
58957 program will not work properly.
58958
58959 55.m
58960 Reason: It is not reasonable to require that an implementation
58961 allocate exactly 8 bits to all objects of subtype
58962 Device_Register. For example, in many run-time models,
58963 stand-alone objects and parameters are always aligned to a
58964 word boundary. Such run-time models are generally based on
58965 hardware considerations that are beyond the control of the
58966 implementer. (It is reasonable to require that an
58967 implementation allocate exactly 8 bits to all components of
58968 subtype Device_Register, if packed.)
58969
58970 55.n
58971 Ramification: The correct way to write the above code is like
58972 this:
58973
58974 55.o
58975 type Device_Register is range 0..2**8 - 1;
58976 My_Device : Device_Register;
58977 for My_Device'Size use 8;
58978 for My_Device'Address use To_Address(16#FF00#);
58979
58980
58981 55.p
58982 If the implementation cannot accept 8-bit stand-alone objects,
58983 then this will be illegal. However, on a machine where an
58984 8-bit device register exists, the implementation will probably
58985 be able to accept 8-bit stand-alone objects. Therefore,
58986 My_Device'Size will be 8, and My_Device'Address will point at
58987 those 8 bits, as desired.
58988
58989 55.q
58990 If an object of subtype Device_Register is passed to a foreign
58991 language subprogram, it will be passed according to that
58992 subprogram's conventions. Most foreign language
58993 implementations have similar run-time model restrictions. For
58994 example, when passing to a C function, where the argument is
58995 of the C type char* (that is, pointer to char), the C compiler
58996 will generally expect a full word value, either on the stack,
58997 or in a register. It will not expect a single byte. Thus,
58998 Size clauses for subtypes really have nothing to do with
58999 passing parameters to foreign language subprograms.
59000
59001 56
59002 * For a subtype implemented with levels of indirection, the Size
59003 should include the size of the pointers, but not the size of what
59004 they point at.
59005
59006 56.a
59007 Ramification: For example, if a task object is represented as
59008 a pointer to some information (including a task stack), then
59009 the size of the object should be the size of the pointer. The
59010 Storage_Size, on the other hand, should include the size of
59011 the stack.
59012
59013 56.1/2
59014 * {AI95-00051-02AI95-00051-02} An implementation should support a
59015 Size clause for a discrete type, fixed point type, record type, or
59016 array type, subject to the following:
59017
59018 56.2/2
59019 * {AI95-00051-02AI95-00051-02} An implementation need not
59020 support a Size clause for a signed integer type
59021 specifying a Size greater than that of the largest signed
59022 integer type supported by the implementation in the
59023 absence of a size clause (that is, when the size is
59024 chosen by default). A corresponding limitation may be
59025 imposed for modular integer types, fixed point types,
59026 enumeration types, record types, and array types.
59027
59028 56.b/2
59029 Discussion: {AI95-00051-02AI95-00051-02} Note that the
59030 "corresponding limitation" for a record or array type implies
59031 that an implementation may impose some reasonable maximum size
59032 for records and arrays (e.g. 2**32 bits), which is an upper
59033 bound ("capacity" limit) on the size, whether chosen by
59034 default or by being specified by the user. The largest size
59035 supported for records need not be the same as the largest size
59036 supported for arrays.
59037
59038 56.b.1/3
59039 Ramification: {AI05-0155-1AI05-0155-1} Only Size clauses with
59040 a size greater than or equal to the Size that would be chosen
59041 by default may be safely presumed to be supported on nonstatic
59042 elementary subtypes. Implementations may choose to support
59043 smaller sizes, but only if the Size allows any value of the
59044 subtype to be represented, for any possible value of the
59045 bounds.
59046
59047 56.3/2
59048 * {AI95-00291-02AI95-00291-02} A nonconfirming size clause
59049 for the first subtype of a derived untagged by-reference
59050 type need not be supported.
59051
59052 56.c/2
59053 Implementation Advice: The recommended level of support for
59054 the Size attribute should be followed.
59055
59056 56.d/2
59057 Ramification: {AI95-00291-02AI95-00291-02} There is no
59058 recommendation to support any nonconfirming Size clauses for
59059 types not mentioned above. Remember that *note 13.1::
59060 requires support for confirming Size clauses for all types.
59061
59062 NOTES
59063
59064 57
59065 6 Size is a subtype-specific attribute.
59066
59067 58/3
59068 7 {AI05-0229-1AI05-0229-1} A component_clause or Component_Size
59069 clause can override a specified Size. Aspect Pack cannot.
59070
59071 _Inconsistencies With Ada 83_
59072
59073 58.a.1/2
59074 {AI95-00114-01AI95-00114-01} We specify the meaning of Size in
59075 much more detail than Ada 83. This is not technically an
59076 inconsistency, but it is in practice, as most Ada 83 compilers
59077 use a different definition for Size than is required here.
59078 This should have been documented more explicitly during the
59079 Ada 9X process.
59080
59081 _Wording Changes from Ada 83_
59082
59083 58.a
59084 The requirement for a nonnegative value in a Size clause was
59085 not in RM83, but it's hard to see how it would make sense.
59086 For uniformity, we forbid negative sizes, rather than letting
59087 implementations define their meaning.
59088
59089 _Static Semantics_
59090
59091 59/1
59092 For a prefix T that denotes a task object [(after any implicit
59093 dereference)]:
59094
59095 60/3
59096 T'Storage_Size
59097 {AI05-0229-1AI05-0229-1} Denotes the number of storage
59098 elements reserved for the task. The value of this
59099 attribute is of the type universal_integer. The
59100 Storage_Size includes the size of the task's stack, if
59101 any. The language does not specify whether or not it
59102 includes other storage associated with the task (such as
59103 the "task control block" used by some implementations.)
59104 If the aspect Storage_Size is specified for the type of
59105 the object, the value of the Storage_Size attribute is at
59106 least the value determined by the aspect.
59107
59108 60.a
59109 Ramification: The value of this attribute is never negative,
59110 since it is impossible to "reserve" a negative number of
59111 storage elements.
59112
59113 60.b
59114 If the implementation chooses to allocate an initial amount of
59115 storage, and then increase this as needed, the Storage_Size
59116 cannot include the additional amounts (assuming the allocation
59117 of the additional amounts can raise Storage_Error); this is
59118 inherent in the meaning of "reserved."
59119
59120 60.c
59121 The implementation is allowed to allocate different amounts of
59122 storage for different tasks of the same subtype.
59123
59124 60.d
59125 Storage_Size is also defined for access subtypes -- see *note
59126 13.11::.
59127
59128 61/3
59129 {AI95-0229-1AI95-0229-1} [Aspect Storage_Size specifies the amount of
59130 storage to be reserved for the execution of a task.]
59131
59132 Paragraphs 62 through 65 were moved to *note Annex J::, "*note Annex J::
59133 Obsolescent Features".
59134
59135 _Static Semantics_
59136
59137 65.1/3
59138 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} For a task type
59139 (including the anonymous type of a single_task_declaration), the
59140 following language-defined representation aspect may be specified:
59141
59142 65.2/3
59143 Storage_Size
59144 The Storage_Size aspect is an expression, which shall be
59145 of any integer type.
59146
59147 65.a/3
59148 To be honest: This definition somewhat conflicts with the
59149 "automatic" one for the obsolescent attribute Storage_Size
59150 (which can be specified). The only difference is where the
59151 given expression is evaluated. We intend for the above
59152 definition to supersede that "automatic" definition for this
59153 attribute.
59154
59155 65.b/3
59156 Ramification: Note that the value of the Storage_Size aspect
59157 is an expression; it is not the value of an expression. The
59158 expression is evaluated for each object of the type (see
59159 below).
59160
59161 65.c/3
59162 Aspect Description for Storage_Size (task): Size in storage
59163 elements reserved for a task type or single task object.
59164
59165 _Legality Rules_
59166
59167 65.3/3
59168 {AI05-0229-1AI05-0229-1} The Storage_Size aspect shall not be specified
59169 for a task interface type.
59170
59171 _Dynamic Semantics_
59172
59173 66/3
59174 {AI05-0229-1AI05-0229-1} When a task object is created, the expression
59175 (if any) associated with the Storage_Size aspect of its type is
59176 evaluated; the Storage_Size attribute of the newly created task object
59177 is at least the value of the expression.
59178
59179 66.a
59180 Ramification: The implementation is allowed to round up a
59181 specified Storage_Size amount. For example, if the
59182 implementation always allocates in chunks of 4096 bytes, the
59183 number 200 might be rounded up to 4096. Also, if the user
59184 specifies a negative number, the implementation has to
59185 normalize this to 0, or perhaps to a positive number.
59186
59187 66.b/3
59188 {AI05-0229-1AI05-0229-1} If the Storage_Size aspect is not
59189 specified for the type of the task object, the value of the
59190 Storage_Size attribute is unspecified.
59191
59192 67
59193 At the point of task object creation, or upon task activation,
59194 Storage_Error is raised if there is insufficient free storage to
59195 accommodate the requested Storage_Size.
59196
59197 _Static Semantics_
59198
59199 68/1
59200 For a prefix X that denotes an array subtype or array object [(after any
59201 implicit dereference)]:
59202
59203 69
59204 X'Component_Size
59205 Denotes the size in bits of components of the type of X.
59206 The value of this attribute is of type universal_integer.
59207
59208 70
59209 Component_Size may be specified for array types via an
59210 attribute_definition_clause (*note 13.3: S0309.); the
59211 expression of such a clause shall be static, and its
59212 value nonnegative.
59213
59214 70.a
59215 Implementation Note: The intent is that the value of
59216 X'Component_Size is always nonnegative. If the array is
59217 stored "backwards" in memory (which might be caused by an
59218 implementation-defined pragma), X'Component_Size is still
59219 positive.
59220
59221 70.b
59222 Ramification: For an array object A, A'Component_Size =
59223 A(I)'Size for any index I.
59224
59225 70.c/3
59226 Aspect Description for Component_Size: Size in bits of a
59227 component of an array type.
59228
59229 _Implementation Advice_
59230
59231 71
59232 The recommended level of support for the Component_Size attribute is:
59233
59234 72
59235 * An implementation need not support specified Component_Sizes that
59236 are less than the Size of the component subtype.
59237
59238 73/3
59239 * {AI05-0229-1AI05-0229-1} An implementation should support specified
59240 Component_Sizes that are factors and multiples of the word size.
59241 For such Component_Sizes, the array should contain no gaps between
59242 components. For other Component_Sizes (if supported), the array
59243 should contain no gaps between components when Pack is also
59244 specified; the implementation should forbid this combination in
59245 cases where it cannot support a no-gaps representation.
59246
59247 73.a/3
59248 Ramification: {AI05-0229-1AI05-0229-1} For example, if
59249 Storage_Unit = 8, and Word_Size = 32, then the user is allowed
59250 to specify a Component_Size of 1, 2, 4, 8, 16, and 32, with no
59251 gaps. In addition, n*32 is allowed for positive integers n,
59252 again with no gaps. If the implementation accepts
59253 Component_Size = 3, then it might allocate 10 components per
59254 word, with a 2-bit gap at the end of each word (unless Pack is
59255 also specified), or it might not have any internal gaps at
59256 all. (There can be gaps at either end of the array.)
59257
59258 73.b/2
59259 Implementation Advice: The recommended level of support for
59260 the Component_Size attribute should be followed.
59261
59262 _Static Semantics_
59263
59264 73.1/3
59265 {AI05-0191-1AI05-0191-1} For a prefix X that denotes an object:
59266
59267 73.2/3
59268 X'Has_Same_Storage
59269 {AI05-0191-1AI05-0191-1} X'Has_Same_Storage denotes a
59270 function with the following specification:
59271
59272 73.3/3
59273 function X'Has_Same_Storage (Arg : any_type)
59274 return Boolean
59275
59276 73.4/3
59277 {AI05-0191-1AI05-0191-1} {AI05-0264-1AI05-0264-1} The
59278 actual parameter shall be a name that denotes an object.
59279 The object denoted by the actual parameter can be of any
59280 type. This function evaluates the names of the objects
59281 involved and returns True if the representation of the
59282 object denoted by the actual parameter occupies exactly
59283 the same bits as the representation of the object denoted
59284 by X; otherwise, it returns False.
59285
59286 73.c/3
59287 Discussion: Has_Same_Storage means that, if the representation
59288 is contiguous, the objects sit at the same address and occupy
59289 the same length of memory.
59290
59291 73.5/3
59292 {AI05-0191-1AI05-0191-1} For a prefix X that denotes an object:
59293
59294 73.6/3
59295 X'Overlaps_Storage
59296 {AI05-0191-1AI05-0191-1} X'Overlaps_Storage denotes a
59297 function with the following specification:
59298
59299 73.7/3
59300 function X'Overlaps_Storage (Arg : any_type)
59301 return Boolean
59302
59303 73.8/3
59304 {AI05-0191-1AI05-0191-1} {AI05-0264-1AI05-0264-1} The
59305 actual parameter shall be a name that denotes an object.
59306 The object denoted by the actual parameter can be of any
59307 type. This function evaluates the names of the objects
59308 involved and returns True if the representation of the
59309 object denoted by the actual parameter shares at least
59310 one bit with the representation of the object denoted by
59311 X; otherwise, it returns False.
59312
59313 NOTES
59314
59315 73.9/3
59316 8 {AI05-0191-1AI05-0191-1} X'Has_Same_Storage(Y) implies
59317 X'Overlaps_Storage(Y).
59318
59319 73.10/3
59320 9 {AI05-0191-1AI05-0191-1} X'Has_Same_Storage(Y) and
59321 X'Overlaps_Storage(Y) are not considered to be reads of X and Y.
59322
59323 _Static Semantics_
59324
59325 73.11/3
59326 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
59327 {AI05-0183-1AI05-0183-1} The following type-related operational
59328 attribute is defined: External_Tag.
59329
59330 74/1
59331 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} For every subtype S of
59332 a tagged type T (specific or class-wide):
59333
59334 75/3
59335 S'External_Tag
59336 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
59337 {AI05-0092-1AI05-0092-1} S'External_Tag denotes an
59338 external string representation for S'Tag; it is of the
59339 predefined type String. External_Tag may be specified
59340 for a specific tagged type via an
59341 attribute_definition_clause; the expression of such a
59342 clause shall be static. The default external tag
59343 representation is implementation defined. See *note
59344 13.13.2::. The value of External_Tag is never
59345 inherited[; the default value is always used unless a new
59346 value is directly specified for a type].
59347
59348 75.a
59349 Implementation defined: The default external representation
59350 for a type tag.
59351
59352 75.b/3
59353 Aspect Description for External_Tag: Unique identifier for a
59354 tagged type in streams.
59355
59356 _Dynamic Semantics_
59357
59358 75.1/3
59359 {AI05-0113-1AI05-0113-1} If a user-specified external tag S'External_Tag
59360 is the same as T'External_Tag for some other tagged type declared by a
59361 different declaration in the partition, Program_Error is raised by the
59362 elaboration of the attribute_definition_clause.
59363
59364 75.c/3
59365 Ramification: This rule does not depend on the visibility of
59366 the other tagged type, but it does depend on the existence of
59367 the other tagged type. The other tagged type could have the
59368 default external tag or a user-specified external tag.
59369
59370 75.d/3
59371 This rule allows the same declaration to be elaborated
59372 multiple times. In that case, different types could have the
59373 same external tag. If that happens, Internal_Tag would return
59374 some unspecified tag, and Descendant_Tag probably would return
59375 the intended tag (using the given ancestor to determine which
59376 type is intended). However, in some cases (such as multiple
59377 instantiations of a derived tagged type declared in a generic
59378 body), Tag_Error might be raised by Descendant_Tag if multiple
59379 types are identified.
59380
59381 75.e/3
59382 Note that while there is a race condition inherent in this
59383 definition (which attribute_definition_clause raises
59384 Program_Error depends on the order of elaboration), it doesn't
59385 matter as a program with two such clauses is simply wrong.
59386 Two types that both come from the same declaration are
59387 allowed, as noted previously.
59388
59389 _Implementation Requirements_
59390
59391 76
59392 In an implementation, the default external tag for each specific tagged
59393 type declared in a partition shall be distinct, so long as the type is
59394 declared outside an instance of a generic body. If the compilation unit
59395 in which a given tagged type is declared, and all compilation units on
59396 which it semantically depends, are the same in two different partitions,
59397 then the external tag for the type shall be the same in the two
59398 partitions. What it means for a compilation unit to be the same in two
59399 different partitions is implementation defined. At a minimum, if the
59400 compilation unit is not recompiled between building the two different
59401 partitions that include it, the compilation unit is considered the same
59402 in the two partitions.
59403
59404 76.a
59405 Implementation defined: What determines whether a compilation
59406 unit is the same in two different partitions.
59407
59408 76.b
59409 Reason: These requirements are important because external tags
59410 are used for input/output of class-wide types. These
59411 requirements ensure that what is written by one program can be
59412 read back by some other program so long as they share the same
59413 declaration for the type (and everything it depends on).
59414
59415 76.c
59416 The user may specify the external tag if (s)he wishes its
59417 value to be stable even across changes to the compilation unit
59418 in which the type is declared (or changes in some unit on
59419 which it depends).
59420
59421 76.d/2
59422 {AI95-00114-01AI95-00114-01} We use a String rather than a
59423 Stream_Element_Array to represent an external tag for
59424 portability.
59425
59426 76.e
59427 Ramification: Note that the characters of an external tag need
59428 not all be graphic characters. In other words, the external
59429 tag can be a sequence of arbitrary 8-bit bytes.
59430
59431 _Implementation Permissions_
59432
59433 76.1/3
59434 {AI05-0113-1AI05-0113-1} If a user-specified external tag S'External_Tag
59435 is the same as T'External_Tag for some other tagged type declared by a
59436 different declaration in the partition, the partition may be rejected.
59437
59438 76.f/3
59439 Ramification: This is, in general, a post-compilation check.
59440 This permission is intended for implementations that do
59441 link-time construction of the external tag lookup table;
59442 implementations that dynamically construct the table will
59443 likely prefer to raise Program_Error upon elaboration of the
59444 problem construct. We don't want this check to require any
59445 implementation complexity, as it will be very rare that there
59446 would be a problem.
59447
59448 NOTES
59449
59450 77/2
59451 10 {AI95-00270-01AI95-00270-01} The following language-defined
59452 attributes are specifiable, at least for some of the kinds of
59453 entities to which they apply: Address, Alignment, Bit_Order,
59454 Component_Size, External_Tag, Input, Machine_Radix, Output, Read,
59455 Size, Small, Storage_Pool, Storage_Size, Stream_Size, and Write.
59456
59457 78
59458 11 It follows from the general rules in *note 13.1:: that if one
59459 writes "for X'Size use Y;" then the X'Size attribute_reference will
59460 return Y (assuming the implementation allows the Size clause). The
59461 same is true for all of the specifiable attributes except
59462 Storage_Size.
59463
59464 78.a
59465 Ramification: An implementation may specify that an
59466 implementation-defined attribute is specifiable for certain
59467 entities. This follows from the fact that the semantics of
59468 implementation-defined attributes is implementation defined.
59469 An implementation is not allowed to make a language-defined
59470 attribute specifiable if it isn't.
59471
59472 _Examples_
59473
59474 79
59475 Examples of attribute definition clauses:
59476
59477 80
59478 Byte : constant := 8;
59479 Page : constant := 2**12;
59480
59481 81
59482 type Medium is range 0 .. 65_000;
59483 for Medium'Size use 2*Byte;
59484 for Medium'Alignment use 2;
59485 Device_Register : Medium;
59486 for Device_Register'Size use Medium'Size;
59487 for Device_Register'Address use System.Storage_Elements.To_Address(16#FFFF_0020#);
59488
59489 82
59490 type Short is delta 0.01 range -100.0 .. 100.0;
59491 for Short'Size use 15;
59492
59493 83
59494 for Car_Name'Storage_Size use -- specify access type's storage pool size
59495 2000*((Car'Size/System.Storage_Unit) +1); -- approximately 2000 cars
59496
59497 84/2
59498 {AI95-00441-01AI95-00441-01} function My_Input(Stream : not null access Ada.Streams.Root_Stream_Type'Class)
59499 return T;
59500 for T'Input use My_Input; -- see *note 13.13.2::
59501
59502 NOTES
59503
59504 85
59505 12 Notes on the examples: In the Size clause for Short, fifteen
59506 bits is the minimum necessary, since the type definition requires
59507 Short'Small <= 2**(-7).
59508
59509 _Extensions to Ada 83_
59510
59511 85.a
59512 The syntax rule for length_clause is replaced with the new
59513 syntax rule for attribute_definition_clause, and it is
59514 modified to allow a name (as well as an expression).
59515
59516 _Wording Changes from Ada 83_
59517
59518 85.b
59519 The syntax rule for attribute_definition_clause now requires
59520 that the prefix of the attribute be a local_name; in Ada 83
59521 this rule was stated in the text.
59522
59523 85.c/2
59524 {AI95-00114-01AI95-00114-01} In Ada 83, the relationship
59525 between a aspect_clause specifying a certain aspect and an
59526 attribute that queried that aspect was unclear. In Ada 95,
59527 they are the same, except for certain explicit exceptions.
59528
59529 _Wording Changes from Ada 95_
59530
59531 85.d/2
59532 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
59533 Added wording to specify for each attribute whether it is an
59534 operational or representation attribute.
59535
59536 85.e/2
59537 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} Corrigendum:
59538 Added wording to specify that External_Tag is never inherited.
59539
59540 85.f/2
59541 {AI95-00051-01AI95-00051-01} {AI95-00291-01AI95-00291-01}
59542 Adjusted the Recommended Level of Support for Alignment to
59543 eliminate nonsense requirements and to ensure that useful
59544 capabilities are required.
59545
59546 85.g/2
59547 {AI95-00051-01AI95-00051-01} {AI95-00291-01AI95-00291-01}
59548 Adjusted the Recommended Level of Support for Size to
59549 eliminate nonsense requirements and to ensure that useful
59550 capabilities are required. Also eliminated any dependence on
59551 whether an aspect was specified (a confirming representation
59552 item should not affect the semantics).
59553
59554 85.h/2
59555 {AI95-00133-01AI95-00133-01} Added the definition of machine
59556 scalar.
59557
59558 85.i/2
59559 {AI95-00247-01AI95-00247-01} Removed the requirement that
59560 specified alignments for a composite type cannot override
59561 those for their components, because it was never intended to
59562 apply to components whose location was specified with a
59563 representation item. Moreover, it causes a difference in
59564 legality when a confirming alignment is specified for one of
59565 the composite types.
59566
59567 85.j/2
59568 {AI95-00291-02AI95-00291-02} Removed recommended level of
59569 support rules about types with by-reference and aliased parts,
59570 because there are now blanket rules covering all recommended
59571 level of support rules.
59572
59573 85.k/2
59574 {AI95-00291-02AI95-00291-02} Split the definition of Alignment
59575 for subtypes and for objects. This simplified the wording and
59576 eliminated confusion about which rules applied to objects,
59577 which applied to subtypes, and which applied to both.
59578
59579 _Inconsistencies With Ada 2005_
59580
59581 85.l/3
59582 {AI95-0095-1AI95-0095-1} Correction: An address attribute with
59583 a prefix of a generic formal subprogram whose actual parameter
59584 has convention Intrinsic now raises Program_Error. Since it
59585 is unlikely that such an attribute would have done anything
59586 useful (a subprogram with convention Intrinsic is not expected
59587 to have a normal subprogram body), it is highly unlikely that
59588 any existing programs would notice the difference, and any
59589 that do probably are buggy.
59590
59591 85.m/3
59592 {AI95-0113-1AI95-0113-1} Correction: User-specified external
59593 tags that conflict with other external tags raise
59594 Program_Error (or are optionally illegal). This was legal and
59595 did not raise an exception in the past, although the effects
59596 were not defined. So while a program might depend on such
59597 behavior, the results were not portable (even to different
59598 versions of the same implementation). Such programs should be
59599 rare.
59600
59601 _Incompatibilities With Ada 2005_
59602
59603 85.n/3
59604 {AI05-0095-1AI05-0095-1} Correction: An address attribute with
59605 a prefix of a subprogram with convention Intrinsic is now
59606 illegal. Such attributes are very unlikely to have provided a
59607 useful answer (the intended meaning of convention Intrinsic is
59608 that there is no actual subprogram body for the operation), so
59609 this is highly unlikely to affect any existing programs unless
59610 they have a hidden bug.
59611
59612 _Extensions to Ada 2005_
59613
59614 85.o/3
59615 {AI05-0191-1AI05-0191-1} Attributes Has_Same_Storage and
59616 Overlaps_Storage are new.
59617
59618 85.p/3
59619 {AI05-0229-1AI05-0229-1} Aspect Storage_Size is new; pragma
59620 Storage_Size is now obsolescent, joining attribute
59621 Storage_Size for task types.
59622
59623 _Wording Changes from Ada 2005_
59624
59625 85.q/3
59626 {AI05-0009-1AI05-0009-1} Correction: Improved the description
59627 of erroneous execution for address clauses to make it clear
59628 that specifying an address inappropriate for the entity will
59629 lead to erroneous execution.
59630
59631 85.r/3
59632 {AI05-0116-1AI05-0116-1} Correction: Added Implementation
59633 Advice for the alignment of class-wide types.
59634
59635 \1f
59636 File: aarm2012.info, Node: 13.4, Next: 13.5, Prev: 13.3, Up: 13
59637
59638 13.4 Enumeration Representation Clauses
59639 =======================================
59640
59641 1
59642 [An enumeration_representation_clause specifies the internal codes for
59643 enumeration literals.]
59644
59645 _Syntax_
59646
59647 2
59648 enumeration_representation_clause ::=
59649 for first_subtype_local_name use enumeration_aggregate;
59650
59651 3
59652 enumeration_aggregate ::= array_aggregate
59653
59654 _Name Resolution Rules_
59655
59656 4
59657 The enumeration_aggregate shall be written as a one-dimensional
59658 array_aggregate, for which the index subtype is the unconstrained
59659 subtype of the enumeration type, and each component expression is
59660 expected to be of any integer type.
59661
59662 4.a
59663 Ramification: The "full coverage rules" for aggregates
59664 applies. An others is not allowed -- there is no applicable
59665 index constraint in this context.
59666
59667 _Legality Rules_
59668
59669 5
59670 The first_subtype_local_name of an enumeration_representation_clause
59671 shall denote an enumeration subtype.
59672
59673 5.a
59674 Ramification: As for all type-related representation items,
59675 the local_name is required to denote a first subtype.
59676
59677 6/2
59678 {AI95-00287-01AI95-00287-01} Each component of the array_aggregate shall
59679 be given by an expression rather than a <>. The expressions given in
59680 the array_aggregate shall be static, and shall specify distinct integer
59681 codes for each value of the enumeration type; the associated integer
59682 codes shall satisfy the predefined ordering relation of the type.
59683
59684 6.a
59685 Reason: Each value of the enumeration type has to be given an
59686 internal code, even if the first subtype of the enumeration
59687 type is constrained to only a subrange (this is only possible
59688 if the enumeration type is a derived type). This "full
59689 coverage" requirement is important because one may refer to
59690 Enum'Base'First and Enum'Base'Last, which need to have defined
59691 representations.
59692
59693 _Static Semantics_
59694
59695 7
59696 An enumeration_representation_clause specifies the coding aspect of
59697 representation. The coding consists of the internal code for each
59698 enumeration literal, that is, the integral value used internally to
59699 represent each literal.
59700
59701 7.a/3
59702 Aspect Description for Coding: Internal representation of
59703 enumeration literals. Specified by an
59704 enumeration_representation_clause, not by an
59705 aspect_specification.
59706
59707 _Implementation Requirements_
59708
59709 8
59710 For nonboolean enumeration types, if the coding is not specified for the
59711 type, then for each value of the type, the internal code shall be equal
59712 to its position number.
59713
59714 8.a
59715 Reason: This default representation is already used by all
59716 known Ada compilers for nonboolean enumeration types.
59717 Therefore, we make it a requirement so users can depend on it,
59718 rather than feeling obliged to supply for every enumeration
59719 type an enumeration representation clause that is equivalent
59720 to this default rule.
59721
59722 8.b
59723 Discussion: For boolean types, it is relatively common to use
59724 all ones for True, and all zeros for False, since some
59725 hardware supports that directly. Of course, for a one-bit
59726 Boolean object (like in a packed array), False is presumably
59727 zero and True is presumably one (choosing the reverse would be
59728 extremely unfriendly!).
59729
59730 _Implementation Advice_
59731
59732 9
59733 The recommended level of support for enumeration_representation_clauses
59734 is:
59735
59736 10
59737 * An implementation should support at least the internal codes in the
59738 range System.Min_Int..System.Max_Int. An implementation need not
59739 support enumeration_representation_clause (*note 13.4: S0310.)s for
59740 boolean types.
59741
59742 10.a
59743 Ramification: The implementation may support numbers outside
59744 the above range, such as numbers greater than System.Max_Int.
59745 See AI83-00564.
59746
59747 10.b
59748 Reason: The benefits of specifying the internal coding of a
59749 boolean type do not outweigh the implementation costs.
59750 Consider, for example, the implementation of the logical
59751 operators on a packed array of booleans with strange internal
59752 codes. It's implementable, but not worth it.
59753
59754 10.c/2
59755 Implementation Advice: The recommended level of support for
59756 enumeration_representation_clauses should be followed.
59757
59758 NOTES
59759
59760 11/3
59761 13 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
59762 {AI05-0299-1AI05-0299-1} Unchecked_Conversion may be used to query
59763 the internal codes used for an enumeration type. The attributes of
59764 the type, such as Succ, Pred, and Pos, are unaffected by the
59765 enumeration_representation_clause. For example, Pos always returns
59766 the position number, not the internal integer code that might have
59767 been specified in an enumeration_representation_clause.
59768
59769 11.a
59770 Discussion: Suppose the enumeration type in question is
59771 derived:
59772
59773 11.b
59774 type T1 is (Red, Green, Blue);
59775 subtype S1 is T1 range Red .. Green;
59776 type S2 is new S1;
59777 for S2 use (Red => 10, Green => 20, Blue => 30);
59778
59779 11.c/1
59780 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} The
59781 enumeration_representation_clause has to specify values for
59782 all enumerals, even ones that are not in S2 (such as Blue).
59783 The Base attribute can be used to get at these values. For
59784 example:
59785
59786 11.d
59787 for I in S2'Base loop
59788 ... -- When I equals Blue, the internal code is 30.
59789 end loop;
59790
59791 11.e
59792 We considered allowing or requiring "for S2'Base use ..." in
59793 cases like this, but it didn't seem worth the trouble.
59794
59795 _Examples_
59796
59797 12
59798 Example of an enumeration representation clause:
59799
59800 13
59801 type Mix_Code is (ADD, SUB, MUL, LDA, STA, STZ);
59802
59803 14
59804 for Mix_Code use
59805 (ADD => 1, SUB => 2, MUL => 3, LDA => 8, STA => 24, STZ =>33);
59806
59807 _Extensions to Ada 83_
59808
59809 14.a
59810 As in other similar contexts, Ada 95 allows expressions of any
59811 integer type, not just expressions of type universal_integer,
59812 for the component expressions in the enumeration_aggregate.
59813 The preference rules for the predefined operators of
59814 root_integer eliminate any ambiguity.
59815
59816 14.b
59817 For portability, we now require that the default coding for an
59818 enumeration type be the "obvious" coding using position
59819 numbers. This is satisfied by all known implementations.
59820
59821 _Wording Changes from Ada 95_
59822
59823 14.c/2
59824 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
59825 Updated to reflect that we no longer have something called
59826 representation_clause.
59827
59828 14.d/2
59829 {AI95-00287-01AI95-00287-01} Added wording to prevent the use
59830 of <> in a enumeration_representation_clause. (<> is newly
59831 added to array_aggregates.)
59832
59833 \1f
59834 File: aarm2012.info, Node: 13.5, Next: 13.6, Prev: 13.4, Up: 13
59835
59836 13.5 Record Layout
59837 ==================
59838
59839 1
59840 The (record) layout aspect of representation consists of the storage
59841 places for some or all components, that is, storage place attributes of
59842 the components. The layout can be specified with a
59843 record_representation_clause (*note 13.5.1: S0312.).
59844
59845 * Menu:
59846
59847 * 13.5.1 :: Record Representation Clauses
59848 * 13.5.2 :: Storage Place Attributes
59849 * 13.5.3 :: Bit Ordering
59850
59851 \1f
59852 File: aarm2012.info, Node: 13.5.1, Next: 13.5.2, Up: 13.5
59853
59854 13.5.1 Record Representation Clauses
59855 ------------------------------------
59856
59857 1
59858 [A record_representation_clause specifies the storage representation of
59859 records and record extensions, that is, the order, position, and size of
59860 components (including discriminants, if any). ]
59861
59862 _Language Design Principles_
59863
59864 1.a/2
59865 {AI95-00114-01AI95-00114-01} It should be feasible for an
59866 implementation to use negative offsets in the representation
59867 of composite types. However, no implementation should be
59868 forced to support negative offsets. Therefore, in the
59869 interest of uniformity, negative offsets should be disallowed
59870 in record_representation_clauses.
59871
59872 _Syntax_
59873
59874 2
59875 record_representation_clause ::=
59876 for first_subtype_local_name use
59877 record [mod_clause]
59878 {component_clause}
59879 end record;
59880
59881 3
59882 component_clause ::=
59883 component_local_name at position range first_bit .. last_bit;
59884
59885 4
59886 position ::= static_expression
59887
59888 5
59889 first_bit ::= static_simple_expression
59890
59891 6
59892 last_bit ::= static_simple_expression
59893
59894 6.a
59895 Reason: First_bit and last_bit need to be simple_expression
59896 instead of expression for the same reason as in range (see
59897 *note 3.5::, "*note 3.5:: Scalar Types").
59898
59899 _Name Resolution Rules_
59900
59901 7
59902 Each position, first_bit, and last_bit is expected to be of any integer
59903 type.
59904
59905 7.a
59906 Ramification: These need not have the same integer type.
59907
59908 _Legality Rules_
59909
59910 8/2
59911 {AI95-00436-01AI95-00436-01} The first_subtype_local_name of a
59912 record_representation_clause shall denote a specific record or record
59913 extension subtype.
59914
59915 8.a
59916 Ramification: As for all type-related representation items,
59917 the local_name is required to denote a first subtype.
59918
59919 9
59920 If the component_local_name is a direct_name, the local_name shall
59921 denote a component of the type. For a record extension, the component
59922 shall not be inherited, and shall not be a discriminant that corresponds
59923 to a discriminant of the parent type. If the component_local_name
59924 (*note 13.1: S0305.) has an attribute_designator (*note 4.1.4: S0101.),
59925 the direct_name (*note 4.1: S0092.) of the local_name (*note 13.1:
59926 S0305.) shall denote either the declaration of the type or a component
59927 of the type, and the attribute_designator (*note 4.1.4: S0101.) shall
59928 denote an implementation-defined implicit component of the type.
59929
59930 10
59931 The position, first_bit, and last_bit shall be static expressions. The
59932 value of position and first_bit shall be nonnegative. The value of
59933 last_bit shall be no less than first_bit - 1.
59934
59935 10.a
59936 Ramification: A component_clause such as "X at 4 range 0..-1;"
59937 is allowed if X can fit in zero bits.
59938
59939 10.1/2
59940 {AI95-00133-01AI95-00133-01} If the nondefault bit ordering applies to
59941 the type, then either:
59942
59943 10.2/2
59944 * the value of last_bit shall be less than the size of the largest
59945 machine scalar; or
59946
59947 10.3/2
59948 * the value of first_bit shall be zero and the value of last_bit + 1
59949 shall be a multiple of System.Storage_Unit.
59950
59951 11
59952 At most one component_clause is allowed for each component of the type,
59953 including for each discriminant (component_clauses may be given for
59954 some, all, or none of the components). Storage places within a
59955 component_list shall not overlap, unless they are for components in
59956 distinct variants of the same variant_part.
59957
59958 12
59959 A name that denotes a component of a type is not allowed within a
59960 record_representation_clause for the type, except as the
59961 component_local_name of a component_clause.
59962
59963 12.a
59964 Reason: It might seem strange to make the
59965 record_representation_clause part of the declarative region,
59966 and then disallow mentions of the components within almost all
59967 of the record_representation_clause. The alternative would be
59968 to treat the component_local_name like a formal parameter name
59969 in a subprogram call (in terms of visibility). However, this
59970 rule would imply slightly different semantics, because (given
59971 the actual rule) the components can hide other declarations.
59972 This was the rule in Ada 83, and we see no reason to change
59973 it. The following, for example, was and is illegal:
59974
59975 12.b
59976 type T is
59977 record
59978 X : Integer;
59979 end record;
59980 X : constant := 31; -- Same defining name as the component.
59981 for T use
59982 record
59983 X at 0 range 0..X; -- Illegal!
59984 end record;
59985
59986
59987 12.c
59988 The component X hides the named number X throughout the
59989 record_representation_clause.
59990
59991 _Static Semantics_
59992
59993 13/2
59994 {AI95-00133-01AI95-00133-01} A record_representation_clause (without the
59995 mod_clause) specifies the layout.
59996
59997 13.a/3
59998 Aspect Description for Layout (record): Layout of record
59999 components. Specified by a record_representation_clause, not
60000 by an aspect_specification.
60001
60002 13.b/3
60003 Aspect Description for Record layout: See Layout.
60004
60005 13.1/2
60006 {AI95-00133-01AI95-00133-01} If the default bit ordering applies to the
60007 type, the position, first_bit, and last_bit of each component_clause
60008 directly specify the position and size of the corresponding component.
60009
60010 13.2/3
60011 {AI95-00133-01AI95-00133-01} {AI05-0264-1AI05-0264-1} If the nondefault
60012 bit ordering applies to the type, then the layout is determined as
60013 follows:
60014
60015 13.3/2
60016 * the component_clauses for which the value of last_bit is greater
60017 than or equal to the size of the largest machine scalar directly
60018 specify the position and size of the corresponding component;
60019
60020 13.4/2
60021 * for other component_clauses, all of the components having the same
60022 value of position are considered to be part of a single machine
60023 scalar, located at that position; this machine scalar has a size
60024 which is the smallest machine scalar size larger than the largest
60025 last_bit for all component_clauses at that position; the first_bit
60026 and last_bit of each component_clause are then interpreted as bit
60027 offsets in this machine scalar.
60028
60029 13.c/2
60030 This paragraph was deleted.{AI95-00133-01AI95-00133-01}
60031
60032 13.d
60033 Ramification: A component_clause also determines the value of
60034 the Size attribute of the component, since this attribute is
60035 related to First_Bit and Last_Bit.
60036
60037 14
60038 [A record_representation_clause for a record extension does not override
60039 the layout of the parent part;] if the layout was specified for the
60040 parent type, it is inherited by the record extension.
60041
60042 _Implementation Permissions_
60043
60044 15
60045 An implementation may generate implementation-defined components (for
60046 example, one containing the offset of another component). An
60047 implementation may generate names that denote such
60048 implementation-defined components; such names shall be
60049 implementation-defined attribute_references. An implementation may
60050 allow such implementation-defined names to be used in
60051 record_representation_clause (*note 13.5.1: S0312.)s. An implementation
60052 can restrict such component_clause (*note 13.5.1: S0313.)s in any manner
60053 it sees fit.
60054
60055 15.a
60056 Implementation defined: Implementation-defined components.
60057
60058 15.b
60059 Ramification: Of course, since the semantics of
60060 implementation-defined attributes is implementation defined,
60061 the implementation need not support these names in all
60062 situations. They might be purely for the purpose of
60063 component_clauses, for example. The visibility rules for such
60064 names are up to the implementation.
60065
60066 15.c
60067 We do not allow such component names to be normal identifiers
60068 -- that would constitute blanket permission to do all kinds of
60069 evil things.
60070
60071 15.d
60072 Discussion: Such implementation-defined components are known
60073 in the vernacular as "dope." Their main purpose is for
60074 storing offsets of components that depend on discriminants.
60075
60076 16
60077 If a record_representation_clause is given for an untagged derived type,
60078 the storage place attributes for all of the components of the derived
60079 type may differ from those of the corresponding components of the parent
60080 type, even for components whose storage place is not specified
60081 explicitly in the record_representation_clause (*note 13.5.1: S0312.).
60082
60083 16.a
60084 Reason: This is clearly necessary, since the whole record may
60085 need to be laid out differently.
60086
60087 _Implementation Advice_
60088
60089 17
60090 The recommended level of support for record_representation_clauses is:
60091
60092 17.1/2
60093 * {AI95-00133-01AI95-00133-01} An implementation should support
60094 machine scalars that correspond to all of the integer, floating
60095 point, and address formats supported by the machine.
60096
60097 18
60098 * An implementation should support storage places that can be
60099 extracted with a load, mask, shift sequence of machine code, and
60100 set with a load, shift, mask, store sequence, given the available
60101 machine instructions and run-time model.
60102
60103 19
60104 * A storage place should be supported if its size is equal to the
60105 Size of the component subtype, and it starts and ends on a boundary
60106 that obeys the Alignment of the component subtype.
60107
60108 20/2
60109 * {AI95-00133-01AI95-00133-01} For a component with a subtype whose
60110 Size is less than the word size, any storage place that does not
60111 cross an aligned word boundary should be supported.
60112
60113 20.a
60114 Reason: The above recommendations are sufficient to define
60115 interfaces to most interesting hardware. This causes less
60116 implementation burden than the definition in ACID, which
60117 requires arbitrary bit alignments of arbitrarily large
60118 components. Since the ACID definition is neither enforced by
60119 the ACVC, nor supported by all implementations, it seems OK
60120 for us to weaken it.
60121
60122 21
60123 * An implementation may reserve a storage place for the tag field of
60124 a tagged type, and disallow other components from overlapping that
60125 place.
60126
60127 21.a
60128 Ramification: Similar permission for other dope is not
60129 granted.
60130
60131 22
60132 * An implementation need not support a component_clause for a
60133 component of an extension part if the storage place is not after
60134 the storage places of all components of the parent type, whether or
60135 not those storage places had been specified.
60136
60137 22.a
60138 Reason: These restrictions are probably necessary if block
60139 equality operations are to be feasible for class-wide types.
60140 For block comparison to work, the implementation typically has
60141 to fill in any gaps with zero (or one) bits. If a "gap" in
60142 the parent type is filled in with a component in a type
60143 extension, then this won't work when a class-wide object is
60144 passed by reference, as is required.
60145
60146 22.b/2
60147 Implementation Advice: The recommended level of support for
60148 record_representation_clauses should be followed.
60149
60150 NOTES
60151
60152 23
60153 14 If no component_clause is given for a component, then the
60154 choice of the storage place for the component is left to the
60155 implementation. If component_clauses are given for all components,
60156 the record_representation_clause completely specifies the
60157 representation of the type and will be obeyed exactly by the
60158 implementation.
60159
60160 23.a
60161 Ramification: The visibility rules prevent the name of a
60162 component of the type from appearing in a
60163 record_representation_clause at any place except for the
60164 component_local_name of a component_clause. However, since
60165 the record_representation_clause is part of the declarative
60166 region of the type declaration, the component names hide outer
60167 homographs throughout.
60168
60169 23.b/1
60170 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} A
60171 record_representation_clause cannot be given for a protected
60172 type, even though protected types, like record types, have
60173 components. The primary reason for this rule is that there is
60174 likely to be too much dope in a protected type -- entry
60175 queues, bit maps for barrier values, etc. In order to control
60176 the representation of the user-defined components, simply
60177 declare a record type, give it a record_representation_clause
60178 (*note 13.5.1: S0312.), and give the protected type one
60179 component whose type is the record type. Alternatively, if
60180 the protected object is protecting something like a device
60181 register, it makes more sense to keep the thing being
60182 protected outside the protected object (possibly with a
60183 pointer to it in the protected object), in order to keep
60184 implementation-defined components out of the way.
60185
60186 _Examples_
60187
60188 24
60189 Example of specifying the layout of a record type:
60190
60191 25
60192 Word : constant := 4; -- storage element is byte, 4 bytes per word
60193
60194 26
60195 type State is (A,M,W,P);
60196 type Mode is (Fix, Dec, Exp, Signif);
60197
60198 27
60199 type Byte_Mask is array (0..7) of Boolean;
60200 type State_Mask is array (State) of Boolean;
60201 type Mode_Mask is array (Mode) of Boolean;
60202
60203 28
60204 type Program_Status_Word is
60205 record
60206 System_Mask : Byte_Mask;
60207 Protection_Key : Integer range 0 .. 3;
60208 Machine_State : State_Mask;
60209 Interrupt_Cause : Interruption_Code;
60210 Ilc : Integer range 0 .. 3;
60211 Cc : Integer range 0 .. 3;
60212 Program_Mask : Mode_Mask;
60213 Inst_Address : Address;
60214 end record;
60215
60216 29
60217 for Program_Status_Word use
60218 record
60219 System_Mask at 0*Word range 0 .. 7;
60220 Protection_Key at 0*Word range 10 .. 11; -- bits 8,9 unused
60221 Machine_State at 0*Word range 12 .. 15;
60222 Interrupt_Cause at 0*Word range 16 .. 31;
60223 Ilc at 1*Word range 0 .. 1; -- second word
60224 Cc at 1*Word range 2 .. 3;
60225 Program_Mask at 1*Word range 4 .. 7;
60226 Inst_Address at 1*Word range 8 .. 31;
60227 end record;
60228
60229 30
60230 for Program_Status_Word'Size use 8*System.Storage_Unit;
60231 for Program_Status_Word'Alignment use 8;
60232
60233 NOTES
60234
60235 31
60236 15 Note on the example: The record_representation_clause defines
60237 the record layout. The Size clause guarantees that (at least)
60238 eight storage elements are used for objects of the type. The
60239 Alignment clause guarantees that aliased, imported, or exported
60240 objects of the type will have addresses divisible by eight.
60241
60242 _Wording Changes from Ada 83_
60243
60244 31.a
60245 The alignment_clause has been renamed to mod_clause and moved
60246 to *note Annex J::, "*note Annex J:: Obsolescent Features".
60247
60248 31.b
60249 We have clarified that implementation-defined component names
60250 have to be in the form of an attribute_reference of a
60251 component or of the first subtype itself; surely Ada 83 did
60252 not intend to allow arbitrary identifiers.
60253
60254 31.c
60255 The RM83-13.4(7) wording incorrectly allows components in
60256 nonvariant records to overlap. We have corrected that
60257 oversight.
60258
60259 _Incompatibilities With Ada 95_
60260
60261 31.d/2
60262 {AI95-00133-01AI95-00133-01} Amendment Correction: The meaning
60263 of a record_representation_clause for the nondefault bit order
60264 is now clearly defined. Thus, such clauses can be portably
60265 written. In order to do that though, the equivalence of bit 1
60266 in word 1 to bit 9 in word 0 (for a machine with Storage_Unit
60267 = 8) had to be dropped for the nondefault bit order. Any
60268 record_representation_clauses which depends on that
60269 equivalence will break (although such code would imply a
60270 noncontiguous representation for a component, and it seems
60271 unlikely that compilers were supporting that anyway).
60272
60273 _Extensions to Ada 95_
60274
60275 31.e/2
60276 {AI95-00436-01AI95-00436-01} Amendment Correction: The
60277 undocumented (and likely unintentional) incompatibility with
60278 Ada 83 caused by not allowing record_representation_clauses on
60279 limited record types is removed.
60280
60281 \1f
60282 File: aarm2012.info, Node: 13.5.2, Next: 13.5.3, Prev: 13.5.1, Up: 13.5
60283
60284 13.5.2 Storage Place Attributes
60285 -------------------------------
60286
60287 _Static Semantics_
60288
60289 1
60290 For a component C of a composite, non-array object R, the storage place
60291 attributes are defined:
60292
60293 1.a
60294 Ramification: The storage place attributes are not
60295 (individually) specifiable, but the user may control their
60296 values by giving a record_representation_clause.
60297
60298 2/2
60299 R.C'Position
60300 {AI95-00133-01AI95-00133-01} If the nondefault bit
60301 ordering applies to the composite type, and if a
60302 component_clause specifies the placement of C, denotes
60303 the value given for the position of the component_clause;
60304 otherwise, denotes the same value as R.C'Address -
60305 R'Address. The value of this attribute is of the type
60306 universal_integer.
60307
60308 2.a/2
60309 Ramification: {AI95-00133-01AI95-00133-01} Thus, for the
60310 default bit order, R.C'Position is the offset of C in storage
60311 elements from the beginning of the object, where the first
60312 storage element of an object is numbered zero. R'Address +
60313 R.C'Position = R.C'Address. For record extensions, the offset
60314 is not measured from the beginning of the extension part, but
60315 from the beginning of the whole object, as usual.
60316
60317 2.b
60318 In "R.C'Address - R'Address", the "-" operator is the one in
60319 System.Storage_Elements that takes two Addresses and returns a
60320 Storage_Offset.
60321
60322 3/2
60323 R.C'First_Bit
60324 {AI95-00133-01AI95-00133-01} If the nondefault bit
60325 ordering applies to the composite type, and if a
60326 component_clause specifies the placement of C, denotes
60327 the value given for the first_bit of the
60328 component_clause; otherwise, denotes the offset, from the
60329 start of the first of the storage elements occupied by C,
60330 of the first bit occupied by C. This offset is measured
60331 in bits. The first bit of a storage element is numbered
60332 zero. The value of this attribute is of the type
60333 universal_integer.
60334
60335 4/2
60336 R.C'Last_Bit
60337 {AI95-00133-01AI95-00133-01} If the nondefault bit
60338 ordering applies to the composite type, and if a
60339 component_clause specifies the placement of C, denotes
60340 the value given for the last_bit of the component_clause;
60341 otherwise, denotes the offset, from the start of the
60342 first of the storage elements occupied by C, of the last
60343 bit occupied by C. This offset is measured in bits. The
60344 value of this attribute is of the type universal_integer.
60345
60346 4.a/2
60347 Ramification: {AI95-00114-01AI95-00114-01} The ordering of
60348 bits in a storage element is defined in *note 13.5.3::, "*note
60349 13.5.3:: Bit Ordering".
60350
60351 4.b
60352 R.C'Size = R.C'Last_Bit - R.C'First_Bit + 1. (Unless the
60353 implementation chooses an indirection representation.)
60354
60355 4.c
60356 If a component_clause applies to a component, then that
60357 component will be at the same relative storage place in all
60358 objects of the type. Otherwise, there is no such requirement.
60359
60360 _Implementation Advice_
60361
60362 5
60363 If a component is represented using some form of pointer (such as an
60364 offset) to the actual data of the component, and this data is contiguous
60365 with the rest of the object, then the storage place attributes should
60366 reflect the place of the actual data, not the pointer. If a component
60367 is allocated discontiguously from the rest of the object, then a warning
60368 should be generated upon reference to one of its storage place
60369 attributes.
60370
60371 5.a
60372 Reason: For discontiguous components, these attributes make no
60373 sense. For example, an implementation might allocate
60374 dynamic-sized components on the heap. For another example, an
60375 implementation might allocate the discriminants separately
60376 from the other components, so that multiple objects of the
60377 same subtype can share discriminants. Such representations
60378 cannot happen if there is a component_clause for that
60379 component.
60380
60381 5.b/2
60382 Implementation Advice: If a component is represented using a
60383 pointer to the actual data of the component which is
60384 contiguous with the rest of the object, then the storage place
60385 attributes should reflect the place of the actual data. If a
60386 component is allocated discontiguously from the rest of the
60387 object, then a warning should be generated upon reference to
60388 one of its storage place attributes.
60389
60390 _Incompatibilities With Ada 95_
60391
60392 5.c/2
60393 {AI95-00133-01AI95-00133-01} Amendment Correction: The meaning
60394 of the storage place attributes for the nondefault bit order
60395 is now clearly defined, and can be different than that given
60396 by strictly following the Ada 95 wording. Any code which
60397 depends on the original Ada 95 values for a type using the
60398 nondefault bit order where they are different will break.
60399
60400 \1f
60401 File: aarm2012.info, Node: 13.5.3, Prev: 13.5.2, Up: 13.5
60402
60403 13.5.3 Bit Ordering
60404 -------------------
60405
60406 1
60407 [The Bit_Order attribute specifies the interpretation of the storage
60408 place attributes.]
60409
60410 1.a
60411 Reason: The intention is to provide uniformity in the
60412 interpretation of storage places across implementations on a
60413 particular machine by allowing the user to specify the
60414 Bit_Order. It is not intended to fully support data
60415 interoperability across different machines, although it can be
60416 used for that purpose in some situations.
60417
60418 1.b/2
60419 {AI95-00114-01AI95-00114-01} We can't require all
60420 implementations on a given machine to use the same bit
60421 ordering by default; if the user cares, a Bit_Order
60422 attribute_definition_clause can be used to force all
60423 implementations to use the same bit ordering.
60424
60425 _Static Semantics_
60426
60427 2
60428 A bit ordering is a method of interpreting the meaning of the storage
60429 place attributes. High_Order_First [(known in the vernacular as "big
60430 endian")] means that the first bit of a storage element (bit 0) is the
60431 most significant bit (interpreting the sequence of bits that represent a
60432 component as an unsigned integer value). Low_Order_First [(known in the
60433 vernacular as "little endian")] means the opposite: the first bit is the
60434 least significant.
60435
60436 3
60437 For every specific record subtype S, the following attribute is defined:
60438
60439 4
60440 S'Bit_Order
60441 Denotes the bit ordering for the type of S. The value of
60442 this attribute is of type System.Bit_Order. Bit_Order
60443 may be specified for specific record types via an
60444 attribute_definition_clause; the expression of such a
60445 clause shall be static.
60446
60447 4.a/3
60448 Aspect Description for Bit_Order: Order of bit numbering in a
60449 record_representation_clause.
60450
60451 5
60452 If Word_Size = Storage_Unit, the default bit ordering is implementation
60453 defined. If Word_Size > Storage_Unit, the default bit ordering is the
60454 same as the ordering of storage elements in a word, when interpreted as
60455 an integer.
60456
60457 5.a
60458 Implementation defined: If Word_Size = Storage_Unit, the
60459 default bit ordering.
60460
60461 5.b
60462 Ramification: Consider machines whose Word_Size = 32, and
60463 whose Storage_Unit = 8. Assume the default bit ordering
60464 applies. On a machine with big-endian addresses, the most
60465 significant storage element of an integer is at the address of
60466 the integer. Therefore, bit zero of a storage element is the
60467 most significant bit. On a machine with little-endian
60468 addresses, the least significant storage element of an integer
60469 is at the address of the integer. Therefore, bit zero of a
60470 storage element is the least significant bit.
60471
60472 6
60473 The storage place attributes of a component of a type are interpreted
60474 according to the bit ordering of the type.
60475
60476 6.a
60477 Ramification: This implies that the interpretation of the
60478 position, first_bit, and last_bit of a component_clause of a
60479 record_representation_clause obey the bit ordering given in a
60480 representation item.
60481
60482 _Implementation Advice_
60483
60484 7
60485 The recommended level of support for the nondefault bit ordering is:
60486
60487 8/2
60488 * {AI95-00133-01AI95-00133-01} The implementation should support the
60489 nondefault bit ordering in addition to the default bit ordering.
60490
60491 8.a/2
60492 Ramification: {AI95-00133-01AI95-00133-01} The implementation
60493 should support both bit orderings. Implementations are
60494 required to support storage positions that cross storage
60495 element boundaries when Word_Size > Storage_Unit but the
60496 definition of the storage place attributes for the nondefault
60497 bit order ensures that such storage positions will not be
60498 split into two or three pieces. Thus, there is no significant
60499 implementation burden to supporting the nondefault bit order,
60500 given that the set of machine scalars is
60501 implementation-defined.
60502
60503 8.b/2
60504 Implementation Advice: The recommended level of support for
60505 the nondefault bit ordering should be followed.
60506
60507 NOTES
60508
60509 9/2
60510 16 {AI95-00133-01AI95-00133-01} Bit_Order clauses make it possible
60511 to write record_representation_clauses that can be ported between
60512 machines having different bit ordering. They do not guarantee
60513 transparent exchange of data between such machines.
60514
60515 _Extensions to Ada 83_
60516
60517 9.a
60518 The Bit_Order attribute is new to Ada 95.
60519
60520 _Wording Changes from Ada 95_
60521
60522 9.b/2
60523 {AI95-00133-01AI95-00133-01} We now suggest that all
60524 implementations support the nondefault bit order.
60525
60526 \1f
60527 File: aarm2012.info, Node: 13.6, Next: 13.7, Prev: 13.5, Up: 13
60528
60529 13.6 Change of Representation
60530 =============================
60531
60532 1/3
60533 {AI05-0229-1AI05-0229-1} [ A type_conversion (see *note 4.6::) can be
60534 used to convert between two different representations of the same array
60535 or record. To convert an array from one representation to another, two
60536 array types need to be declared with matching component subtypes, and
60537 convertible index types. If one type has Pack specified and the other
60538 does not, then explicit conversion can be used to pack or unpack an
60539 array.
60540
60541 2
60542 To convert a record from one representation to another, two record types
60543 with a common ancestor type need to be declared, with no inherited
60544 subprograms. Distinct representations can then be specified for the
60545 record types, and explicit conversion between the types can be used to
60546 effect a change in representation.]
60547
60548 2.a
60549 Ramification: This technique does not work if the first type
60550 is an untagged type with user-defined primitive subprograms.
60551 It does not work at all for tagged types.
60552
60553 _Examples_
60554
60555 3
60556 Example of change of representation:
60557
60558 4
60559 -- Packed_Descriptor and Descriptor are two different types
60560 -- with identical characteristics, apart from their
60561 -- representation
60562
60563 5
60564 type Descriptor is
60565 record
60566 -- components of a descriptor
60567 end record;
60568
60569 6
60570 type Packed_Descriptor is new Descriptor;
60571
60572 7
60573 for Packed_Descriptor use
60574 record
60575 -- component clauses for some or for all components
60576 end record;
60577
60578 8
60579 -- Change of representation can now be accomplished by explicit type conversions:
60580
60581 9
60582 D : Descriptor;
60583 P : Packed_Descriptor;
60584
60585 10
60586 P := Packed_Descriptor(D); -- pack D
60587 D := Descriptor(P); -- unpack P
60588
60589 \1f
60590 File: aarm2012.info, Node: 13.7, Next: 13.8, Prev: 13.6, Up: 13
60591
60592 13.7 The Package System
60593 =======================
60594
60595 1
60596 [For each implementation there is a library package called System which
60597 includes the definitions of certain configuration-dependent
60598 characteristics.]
60599
60600 _Static Semantics_
60601
60602 2
60603 The following language-defined library package exists:
60604
60605 2.a/2
60606 Implementation defined: The contents of the visible part of
60607 package System.
60608
60609 3/2
60610 {AI95-00362-01AI95-00362-01} package System is
60611 pragma Pure(System);
60612
60613 4
60614 type Name is implementation-defined-enumeration-type;
60615 System_Name : constant Name := implementation-defined;
60616
60617 5
60618 -- System-Dependent Named Numbers:
60619
60620 6
60621 Min_Int : constant := root_integer'First;
60622 Max_Int : constant := root_integer'Last;
60623
60624 7
60625 Max_Binary_Modulus : constant := implementation-defined;
60626 Max_Nonbinary_Modulus : constant := implementation-defined;
60627
60628 8
60629 Max_Base_Digits : constant := root_real'Digits;
60630 Max_Digits : constant := implementation-defined;
60631
60632 9
60633 Max_Mantissa : constant := implementation-defined;
60634 Fine_Delta : constant := implementation-defined;
60635
60636 10
60637 Tick : constant := implementation-defined;
60638
60639 11
60640 -- Storage-related Declarations:
60641
60642 12
60643 type Address is implementation-defined;
60644 Null_Address : constant Address;
60645
60646 13
60647 Storage_Unit : constant := implementation-defined;
60648 Word_Size : constant := implementation-defined * Storage_Unit;
60649 Memory_Size : constant := implementation-defined;
60650
60651 14/3
60652 {AI05-0229-1AI05-0229-1} -- Address Comparison:
60653 function "<" (Left, Right : Address) return Boolean
60654 with Convention => Intrinsic;
60655 function "<="(Left, Right : Address) return Boolean
60656 with Convention => Intrinsic;
60657 function ">" (Left, Right : Address) return Boolean
60658 with Convention => Intrinsic;
60659 function ">="(Left, Right : Address) return Boolean
60660 with Convention => Intrinsic;
60661 function "=" (Left, Right : Address) return Boolean
60662 with Convention => Intrinsic;
60663 -- function "/=" (Left, Right : Address) return Boolean;
60664 -- "/=" is implicitly defined
60665
60666 15/2
60667 {AI95-00221-01AI95-00221-01} -- Other System-Dependent Declarations:
60668 type Bit_Order is (High_Order_First, Low_Order_First);
60669 Default_Bit_Order : constant Bit_Order := implementation-defined;
60670
60671 16
60672 -- Priority-related declarations (see *note D.1::):
60673 subtype Any_Priority is Integer range implementation-defined;
60674 subtype Priority is Any_Priority range Any_Priority'First ..
60675 implementation-defined;
60676 subtype Interrupt_Priority is Any_Priority range Priority'Last+1 ..
60677 Any_Priority'Last;
60678
60679 17
60680 Default_Priority : constant Priority :=
60681 (Priority'First + Priority'Last)/2;
60682
60683 18
60684 private
60685 ... -- not specified by the language
60686 end System;
60687
60688 19
60689 Name is an enumeration subtype. Values of type Name are the names of
60690 alternative machine configurations handled by the implementation.
60691 System_Name represents the current machine configuration.
60692
60693 20
60694 The named numbers Fine_Delta and Tick are of the type universal_real;
60695 the others are of the type universal_integer.
60696
60697 21
60698 The meanings of the named numbers are:
60699
60700 22
60701 [ Min_Int
60702 The smallest (most negative) value allowed for the
60703 expressions of a signed_integer_type_definition (*note
60704 3.5.4: S0042.).
60705
60706 23
60707 Max_Int
60708 The largest (most positive) value allowed for the
60709 expressions of a signed_integer_type_definition (*note
60710 3.5.4: S0042.).
60711
60712 24
60713 Max_Binary_Modulus
60714 A power of two such that it, and all lesser positive
60715 powers of two, are allowed as the modulus of a
60716 modular_type_definition.
60717
60718 25
60719 Max_Nonbinary_Modulus
60720 A value such that it, and all lesser positive integers,
60721 are allowed as the modulus of a modular_type_definition.
60722
60723 25.a
60724 Ramification: There is no requirement that
60725 Max_Nonbinary_Modulus be less than or equal to
60726 Max_Binary_Modulus, although that's what makes most sense. On
60727 a typical 32-bit machine, for example, Max_Binary_Modulus will
60728 be 2**32 and Max_Nonbinary_Modulus will be 2**31, because
60729 supporting nonbinary moduli in above 2**31 causes
60730 implementation difficulties.
60731
60732 26
60733 Max_Base_Digits
60734 The largest value allowed for the requested decimal
60735 precision in a floating_point_definition (*note 3.5.7:
60736 S0045.).
60737
60738 27
60739 Max_Digits
60740 The largest value allowed for the requested decimal
60741 precision in a floating_point_definition (*note 3.5.7:
60742 S0045.) that has no real_range_specification (*note
60743 3.5.7: S0046.). Max_Digits is less than or equal to
60744 Max_Base_Digits.
60745
60746 28
60747 Max_Mantissa
60748 The largest possible number of binary digits in the
60749 mantissa of machine numbers of a user-defined ordinary
60750 fixed point type. (The mantissa is defined in *note
60751 Annex G::.)
60752
60753 29
60754 Fine_Delta
60755 The smallest delta allowed in an
60756 ordinary_fixed_point_definition that has the
60757 real_range_specification (*note 3.5.7: S0046.) range -1.0
60758 .. 1.0. ]
60759
60760 30
60761 Tick
60762 A period in seconds approximating the real time interval
60763 during which the value of Calendar.Clock remains
60764 constant.
60765
60766 30.a
60767 Ramification: There is no required relationship between
60768 System.Tick and Duration'Small, other than the one described
60769 here.
60770
60771 30.b
60772 The inaccuracy of the delay_statement has no relation to Tick.
60773 In particular, it is possible that the clock used for the
60774 delay_statement is less accurate than Calendar.Clock.
60775
60776 30.c
60777 We considered making Tick a run-time-determined quantity, to
60778 allow for easier configurability. However, this would not be
60779 upward compatible, and the desired configurability can be
60780 achieved using functionality defined in *note Annex D::,
60781 "*note Annex D:: Real-Time Systems".
60782
60783 31
60784 Storage_Unit
60785 The number of bits per storage element.
60786
60787 32
60788 Word_Size
60789 The number of bits per word.
60790
60791 33
60792 Memory_Size
60793 An implementation-defined value [that is intended to
60794 reflect the memory size of the configuration in storage
60795 elements.]
60796
60797 33.a
60798 Discussion: It is unspecified whether this refers to the size
60799 of the address space, the amount of physical memory on the
60800 machine, or perhaps some other interpretation of "memory
60801 size." In any case, the value has to be given by a static
60802 expression, even though the amount of memory on many modern
60803 machines is a dynamic quantity in several ways. Thus,
60804 Memory_Size is not very useful.
60805
60806 34/2
60807 {AI95-00161-01AI95-00161-01} Address is a definite, nonlimited type with
60808 preelaborable initialization (see *note 10.2.1::). Address represents
60809 machine addresses capable of addressing individual storage elements.
60810 Null_Address is an address that is distinct from the address of any
60811 object or program unit.
60812
60813 34.a
60814 Ramification: The implementation has to ensure that there is
60815 at least one address that nothing will be allocated to;
60816 Null_Address will be one such address.
60817
60818 34.b
60819 Ramification: Address is the type of the result of the
60820 attribute Address.
60821
60822 34.c
60823 Reason: Address is required to be nonlimited and definite
60824 because it is important to be able to assign addresses, and to
60825 declare uninitialized address variables.
60826
60827 34.d/2
60828 Ramification: {AI95-00161-01AI95-00161-01} If System.Address
60829 is defined as a private type (as suggested below), it might be
60830 necessary to add a pragma Preelaborable_Initialization to the
60831 specification of System in order that Address have
60832 preelaborable initialization as required.
60833
60834 35/2
60835 {AI95-00221-01AI95-00221-01} Default_Bit_Order shall be a static
60836 constant. See *note 13.5.3:: for an explanation of Bit_Order and
60837 Default_Bit_Order.
60838
60839 _Implementation Permissions_
60840
60841 36/2
60842 {AI95-00362-01AI95-00362-01} An implementation may add additional
60843 implementation-defined declarations to package System and its children.
60844 [However, it is usually better for the implementation to provide
60845 additional functionality via implementation-defined children of System.]
60846
60847 36.a
60848 Ramification: The declarations in package System and its
60849 children can be implicit. For example, since Address is not
60850 limited, the predefined "=" and "/=" operations are probably
60851 sufficient. However, the implementation is not required to
60852 use the predefined "=".
60853
60854 _Implementation Advice_
60855
60856 37
60857 Address should be a private type.
60858
60859 37.a
60860 Reason: This promotes uniformity by avoiding having
60861 implementation-defined predefined operations for the type. We
60862 don't require it, because implementations may want to stick
60863 with what they have.
60864
60865 37.a.1/2
60866 Implementation Advice: Type System.Address should be a private
60867 type.
60868
60869 37.b
60870 Implementation Note: It is not necessary for Address to be
60871 able to point at individual bits within a storage element.
60872 Nor is it necessary for it to be able to point at machine
60873 registers. It is intended as a memory address that matches
60874 the hardware's notion of an address.
60875
60876 37.c
60877 The representation of the null value of a general access type
60878 should be the same as that of Null_Address; instantiations of
60879 Unchecked_Conversion should work accordingly. If the
60880 implementation supports interfaces to other languages, the
60881 representation of the null value of a general access type
60882 should be the same as in those other languages, if
60883 appropriate.
60884
60885 37.d
60886 Note that the children of the Interfaces package will
60887 generally provide foreign-language-specific null values where
60888 appropriate. See UI-0065 regarding Null_Address.
60889
60890 NOTES
60891
60892 38
60893 17 There are also some language-defined child packages of System
60894 defined elsewhere.
60895
60896 _Extensions to Ada 83_
60897
60898 38.a.1/1
60899 The declarations Max_Binary_Modulus, Max_Nonbinary_Modulus,
60900 Max_Base_Digits, Null_Address, Word_Size, Bit_Order,
60901 Default_Bit_Order, Any_Priority, Interrupt_Priority, and
60902 Default_Priority are added to System in Ada 95. The presence
60903 of ordering operators for type Address is also guaranteed (the
60904 existence of these depends on the definition of Address in an
60905 Ada 83 implementation). We do not list these as
60906 incompatibilities, as the contents of System can vary between
60907 implementations anyway; thus a program that depends on the
60908 contents of System (by using use System; for example) is
60909 already at risk of being incompatible when moved between Ada
60910 implementations.
60911
60912 _Wording Changes from Ada 83_
60913
60914 38.a
60915 Much of the content of System is standardized, to provide more
60916 uniformity across implementations. Implementations can still
60917 add their own declarations to System, but are encouraged to do
60918 so via children of System.
60919
60920 38.b
60921 Some of the named numbers are defined more explicitly in terms
60922 of the standard numeric types.
60923
60924 38.c
60925 The pragmas System_Name, Storage_Unit, and Memory_Size are no
60926 longer defined by the language. However, the corresponding
60927 declarations in package System still exist. Existing
60928 implementations may continue to support the three pragmas as
60929 implementation-defined pragmas, if they so desire.
60930
60931 38.d
60932 Priority semantics, including subtype Priority, have been
60933 moved to the Real Time Annex.
60934
60935 _Extensions to Ada 95_
60936
60937 38.e/2
60938 {AI95-00161-01AI95-00161-01} Amendment Correction: Type
60939 Address is defined to have preelaborable initialization, so
60940 that it can be used without restriction in preelaborated
60941 units. (If Address is defined to be a private type, as
60942 suggested by the Implementation Advice, in Ada 95 it cannot be
60943 used in some contexts in a preelaborated units. This is an
60944 unnecessary portability issue.)
60945
60946 38.f/2
60947 {AI95-00221-01AI95-00221-01} Amendment Correction:
60948 Default_Bit_Order is now a static constant.
60949
60950 38.g/2
60951 {AI95-00362-01AI95-00362-01} Package System is now Pure, so it
60952 can be portably used in more places. (Ada 95 allowed it to be
60953 Pure, but did not require that.)
60954
60955 * Menu:
60956
60957 * 13.7.1 :: The Package System.Storage_Elements
60958 * 13.7.2 :: The Package System.Address_To_Access_Conversions
60959
60960 \1f
60961 File: aarm2012.info, Node: 13.7.1, Next: 13.7.2, Up: 13.7
60962
60963 13.7.1 The Package System.Storage_Elements
60964 ------------------------------------------
60965
60966 _Static Semantics_
60967
60968 1
60969 The following language-defined library package exists:
60970
60971 2/2
60972 {AI95-00362-01AI95-00362-01} package System.Storage_Elements is
60973 pragma Pure(Storage_Elements);
60974
60975 3
60976 type Storage_Offset is range implementation-defined;
60977
60978 4
60979 subtype Storage_Count is Storage_Offset range 0..Storage_Offset'Last;
60980
60981 5
60982 type Storage_Element is mod implementation-defined;
60983 for Storage_Element'Size use Storage_Unit;
60984 type Storage_Array is array
60985 (Storage_Offset range <>) of aliased Storage_Element;
60986 for Storage_Array'Component_Size use Storage_Unit;
60987
60988 6
60989 -- Address Arithmetic:
60990
60991 7/3
60992 {AI05-0229-1AI05-0229-1} function "+"(Left : Address; Right : Storage_Offset) return Address
60993 with Convention => Intrinsic;
60994 function "+"(Left : Storage_Offset; Right : Address) return Address
60995 with Convention => Intrinsic;
60996 function "-"(Left : Address; Right : Storage_Offset) return Address
60997 with Convention => Intrinsic;
60998 function "-"(Left, Right : Address) return Storage_Offset
60999 with Convention => Intrinsic;
61000
61001 8/3
61002 {AI05-0229-1AI05-0229-1} function "mod"(Left : Address; Right : Storage_Offset)
61003 return Storage_Offset
61004 with Convention => Intrinsic;
61005
61006 9
61007 -- Conversion to/from integers:
61008
61009 10/3
61010 {AI05-0229-1AI05-0229-1} type Integer_Address is implementation-defined;
61011 function To_Address(Value : Integer_Address) return Address
61012 with Convention => Intrinsic;
61013 function To_Integer(Value : Address) return Integer_Address
61014 with Convention => Intrinsic;
61015
61016 11/3
61017 {AI05-0229-1AI05-0229-1} end System.Storage_Elements;
61018
61019 11.a/3
61020 Reason: {AI05-0229-1AI05-0229-1} The Convention aspects imply
61021 that the attribute Access is not allowed for those operations.
61022
61023 11.b
61024 The mod function is needed so that the definition of Alignment
61025 makes sense.
61026
61027 11.c/2
61028 Implementation defined: The range of
61029 Storage_Elements.Storage_Offset, the modulus of
61030 Storage_Elements.Storage_Element, and the declaration of
61031 Storage_Elements.Integer_Address..
61032
61033 12
61034 Storage_Element represents a storage element. Storage_Offset represents
61035 an offset in storage elements. Storage_Count represents a number of
61036 storage elements. Storage_Array represents a contiguous sequence of
61037 storage elements.
61038
61039 12.a
61040 Reason: The index subtype of Storage_Array is Storage_Offset
61041 because we wish to allow maximum flexibility. Most
61042 Storage_Arrays will probably have a lower bound of 0 or 1, but
61043 other lower bounds, including negative ones, make sense in
61044 some situations.
61045
61046 12.b/2
61047 This paragraph was deleted.{AI95-00114-01AI95-00114-01}
61048
61049 13
61050 Integer_Address is a [(signed or modular)] integer subtype. To_Address
61051 and To_Integer convert back and forth between this type and Address.
61052
61053 _Implementation Requirements_
61054
61055 14
61056 Storage_Offset'Last shall be greater than or equal to Integer'Last or
61057 the largest possible storage offset, whichever is smaller.
61058 Storage_Offset'First shall be <= (-Storage_Offset'Last).
61059
61060 Paragraph 15 was deleted.
61061
61062 _Implementation Advice_
61063
61064 16
61065 Operations in System and its children should reflect the target
61066 environment semantics as closely as is reasonable. For example, on most
61067 machines, it makes sense for address arithmetic to "wrap around."
61068 Operations that do not make sense should raise Program_Error.
61069
61070 16.a.1/2
61071 Implementation Advice: Operations in System and its children
61072 should reflect the target environment; operations that do not
61073 make sense should raise Program_Error.
61074
61075 16.a
61076 Discussion: For example, on a segmented architecture, X < Y
61077 might raise Program_Error if X and Y do not point at the same
61078 segment (assuming segments are unordered). Similarly, on a
61079 segmented architecture, the conversions between
61080 Integer_Address and Address might not make sense for some
61081 values, and so might raise Program_Error.
61082
61083 16.b
61084 Reason: We considered making Storage_Element a private type.
61085 However, it is better to declare it as a modular type in the
61086 visible part, since code that uses it is already low level,
61087 and might as well have access to the underlying
61088 representation. We also considered allowing Storage_Element
61089 to be any integer type, signed integer or modular, but it is
61090 better to have uniformity across implementations in this
61091 regard, and viewing storage elements as unsigned seemed to
61092 make the most sense.
61093
61094 16.c
61095 Implementation Note: To_Address is intended for use in Address
61096 clauses. Implementations should overload To_Address if
61097 appropriate. For example, on a segmented architecture, it
61098 might make sense to have a record type representing a
61099 segment/offset pair, and have a To_Address conversion that
61100 converts from that record type to type Address.
61101
61102 _Extensions to Ada 95_
61103
61104 16.d/2
61105 {AI95-00362-01AI95-00362-01} Package System.Storage_Elements
61106 is now Pure, so it can be portably used in more places. (Ada
61107 95 allowed it to be Pure, but did not require that.)
61108
61109 \1f
61110 File: aarm2012.info, Node: 13.7.2, Prev: 13.7.1, Up: 13.7
61111
61112 13.7.2 The Package System.Address_To_Access_Conversions
61113 -------------------------------------------------------
61114
61115 _Static Semantics_
61116
61117 1
61118 The following language-defined generic library package exists:
61119
61120 2
61121 generic
61122 type Object(<>) is limited private;
61123 package System.Address_To_Access_Conversions is
61124 pragma Preelaborate(Address_To_Access_Conversions);
61125
61126 3/3
61127 {AI05-0229-1AI05-0229-1} type Object_Pointer is access all Object;
61128 function To_Pointer(Value : Address) return Object_Pointer
61129 with Convention => Intrinsic;
61130 function To_Address(Value : Object_Pointer) return Address
61131 with Convention => Intrinsic;
61132
61133 4/3
61134 {AI05-0229-1AI05-0229-1} end System.Address_To_Access_Conversions;
61135
61136 5/2
61137 {AI95-00230-01AI95-00230-01} The To_Pointer and To_Address subprograms
61138 convert back and forth between values of types Object_Pointer and
61139 Address. To_Pointer(X'Address) is equal to X'Unchecked_Access for any X
61140 that allows Unchecked_Access. To_Pointer(Null_Address) returns null.
61141 For other addresses, the behavior is unspecified. To_Address(null)
61142 returns Null_Address. To_Address(Y), where Y /= null, returns
61143 Y.all'Address.
61144
61145 5.a/3
61146 Discussion: {AI95-00114-01AI95-00114-01}
61147 {AI05-0005-1AI05-0005-1} The programmer should ensure that the
61148 address passed to To_Pointer is either Null_Address, or the
61149 address of an object of type Object. (If Object is not a
61150 by-reference type, the object ought to be aliased; recall that
61151 the Address attribute is not required to provide a useful
61152 result for other objects.) Otherwise, the behavior of the
61153 program is unspecified; it might raise an exception or crash,
61154 for example.
61155
61156 5.b
61157 Reason: Unspecified is almost the same thing as erroneous;
61158 they both allow arbitrarily bad behavior. We don't say
61159 erroneous here, because the implementation might allow the
61160 address passed to To_Pointer to point at some memory that just
61161 happens to "look like" an object of type Object. That's not
61162 necessarily an error; it's just not portable. However, if the
61163 actual type passed to Object is (for example) an array type,
61164 the programmer would need to be aware of any dope that the
61165 implementation expects to exist, when passing an address that
61166 did not come from the Address attribute of an object of type
61167 Object.
61168
61169 5.c
61170 One might wonder why To_Pointer and To_Address are any better
61171 than unchecked conversions. The answer is that Address does
61172 not necessarily have the same representation as an access
61173 type. For example, an access value might point at the bounds
61174 of an array when an address would point at the first element.
61175 Or an access value might be an offset in words from someplace,
61176 whereas an address might be an offset in bytes from the
61177 beginning of memory.
61178
61179 _Implementation Permissions_
61180
61181 6
61182 An implementation may place restrictions on instantiations of
61183 Address_To_Access_Conversions.
61184
61185 6.a
61186 Ramification: For example, if the hardware requires aligned
61187 loads and stores, then dereferencing an access value that is
61188 not properly aligned might raise an exception.
61189
61190 6.b
61191 For another example, if the implementation has chosen to use
61192 negative component offsets (from an access value), it might
61193 not be possible to preserve the semantics, since negative
61194 offsets from the Address are not allowed. (The Address
61195 attribute always points at "the first of the storage
61196 elements....") Note that while the implementation knows how
61197 to convert an access value into an address, it might not be
61198 able to do the reverse. To avoid generic contract model
61199 violations, the restriction might have to be detected at run
61200 time in some cases.
61201
61202 \1f
61203 File: aarm2012.info, Node: 13.8, Next: 13.9, Prev: 13.7, Up: 13
61204
61205 13.8 Machine Code Insertions
61206 ============================
61207
61208 1
61209 [ A machine code insertion can be achieved by a call to a subprogram
61210 whose sequence_of_statements contains code_statements.]
61211
61212 _Syntax_
61213
61214 2
61215 code_statement ::= qualified_expression;
61216
61217 3
61218 A code_statement is only allowed in the
61219 handled_sequence_of_statements (*note 11.2: S0265.) of a
61220 subprogram_body (*note 6.3: S0177.). If a subprogram_body (*note
61221 6.3: S0177.) contains any code_statement (*note 13.8: S0317.)s,
61222 then within this subprogram_body (*note 6.3: S0177.) the only
61223 allowed form of statement is a code_statement (*note 13.8: S0317.)
61224 (labeled or not), the only allowed declarative_item (*note 3.11:
61225 S0087.)s are use_clause (*note 8.4: S0196.)s, and no
61226 exception_handler (*note 11.2: S0266.) is allowed (comments and
61227 pragmas are allowed as usual).
61228
61229 _Name Resolution Rules_
61230
61231 4
61232 The qualified_expression is expected to be of any type.
61233
61234 _Legality Rules_
61235
61236 5
61237 The qualified_expression shall be of a type declared in package
61238 System.Machine_Code.
61239
61240 5.a
61241 Ramification: This includes types declared in children of
61242 System.Machine_Code.
61243
61244 6
61245 A code_statement shall appear only within the scope of a with_clause
61246 that mentions package System.Machine_Code.
61247
61248 6.a
61249 Ramification: Note that this is not a note; without this rule,
61250 it would be possible to write machine code in compilation
61251 units which depend on System.Machine_Code only indirectly.
61252
61253 _Static Semantics_
61254
61255 7
61256 The contents of the library package System.Machine_Code (if provided)
61257 are implementation defined. The meaning of code_statements is
61258 implementation defined. [Typically, each qualified_expression
61259 represents a machine instruction or assembly directive.]
61260
61261 7.a
61262 Discussion: For example, an instruction might be a record with
61263 an Op_Code component and other components for the operands.
61264
61265 7.b
61266 Implementation defined: The contents of the visible part of
61267 package System.Machine_Code, and the meaning of
61268 code_statements.
61269
61270 _Implementation Permissions_
61271
61272 8
61273 An implementation may place restrictions on code_statements. An
61274 implementation is not required to provide package System.Machine_Code.
61275
61276 NOTES
61277
61278 9
61279 18 An implementation may provide implementation-defined pragmas
61280 specifying register conventions and calling conventions.
61281
61282 10/2
61283 19 {AI95-00318-02AI95-00318-02} Machine code functions are exempt
61284 from the rule that a return statement is required. In fact, return
61285 statements are forbidden, since only code_statements are allowed.
61286
61287 10.a
61288 Discussion: The idea is that the author of a machine code
61289 subprogram knows the calling conventions, and refers to
61290 parameters and results accordingly. The implementation should
61291 document where to put the result of a machine code function,
61292 for example, "Scalar results are returned in register 0."
61293
61294 11
61295 20 Intrinsic subprograms (see *note 6.3.1::, "*note 6.3.1::
61296 Conformance Rules") can also be used to achieve machine code
61297 insertions. Interface to assembly language can be achieved using
61298 the features in *note Annex B::, "*note Annex B:: Interface to
61299 Other Languages".
61300
61301 _Examples_
61302
61303 12
61304 Example of a code statement:
61305
61306 13/3
61307 {AI05-0229-1AI05-0229-1} M : Mask;
61308 procedure Set_Mask
61309 with Inline;
61310
61311 14
61312 procedure Set_Mask is
61313 use System.Machine_Code; -- assume "with System.Machine_Code;" appears somewhere above
61314 begin
61315 SI_Format'(Code => SSM, B => M'Base_Reg, D => M'Disp);
61316 -- Base_Reg and Disp are implementation-defined attributes
61317 end Set_Mask;
61318
61319 _Extensions to Ada 83_
61320
61321 14.a
61322 Machine code functions are allowed in Ada 95; in Ada 83, only
61323 procedures were allowed.
61324
61325 _Wording Changes from Ada 83_
61326
61327 14.b
61328 The syntax for code_statement is changed to say
61329 "qualified_expression" instead of "subtype_mark'
61330 record_aggregate". Requiring the type of each instruction to
61331 be a record type is overspecification.
61332
61333 \1f
61334 File: aarm2012.info, Node: 13.9, Next: 13.10, Prev: 13.8, Up: 13
61335
61336 13.9 Unchecked Type Conversions
61337 ===============================
61338
61339 1
61340 [ An unchecked type conversion can be achieved by a call to an instance
61341 of the generic function Unchecked_Conversion.]
61342
61343 _Static Semantics_
61344
61345 2
61346 The following language-defined generic library function exists:
61347
61348 3/3
61349 {AI05-0229-1AI05-0229-1} generic
61350 type Source(<>) is limited private;
61351 type Target(<>) is limited private;
61352 function Ada.Unchecked_Conversion(S : Source) return Target
61353 with Convention => Intrinsic;
61354 pragma Pure(Ada.Unchecked_Conversion);
61355
61356 3.a/3
61357 Reason: {AI05-0229-1AI05-0229-1} The aspect Convention implies
61358 that the attribute Access is not allowed for instances of
61359 Unchecked_Conversion.
61360
61361 _Dynamic Semantics_
61362
61363 4
61364 The size of the formal parameter S in an instance of
61365 Unchecked_Conversion is that of its subtype. [This is the actual
61366 subtype passed to Source, except when the actual is an unconstrained
61367 composite subtype, in which case the subtype is constrained by the
61368 bounds or discriminants of the value of the actual expression passed to
61369 S.]
61370
61371 5
61372 If all of the following are true, the effect of an unchecked conversion
61373 is to return the value of an object of the target subtype whose
61374 representation is the same as that of the source object S:
61375
61376 6
61377 * S'Size = Target'Size.
61378
61379 6.a
61380 Ramification: Note that there is no requirement that the Sizes
61381 be known at compile time.
61382
61383 7/3
61384 * {AI05-0078-1AI05-0078-1} S'Alignment is a multiple of
61385 Target'Alignment or Target'Alignment is zero.
61386
61387 8
61388 * The target subtype is not an unconstrained composite subtype.
61389
61390 9
61391 * S and the target subtype both have a contiguous representation.
61392
61393 10
61394 * The representation of S is a representation of an object of the
61395 target subtype.
61396
61397 11/2
61398 {AI95-00426-01AI95-00426-01} Otherwise, if the result type is scalar,
61399 the result of the function is implementation defined, and can have an
61400 invalid representation (see *note 13.9.1::). If the result type is
61401 nonscalar, the effect is implementation defined; in particular, the
61402 result can be abnormal (see *note 13.9.1::).
61403
61404 11.a.1/2
61405 Implementation defined: The result of unchecked conversion for
61406 instances with scalar result types whose result is not defined
61407 by the language.
61408
61409 11.a/2
61410 Implementation defined: The effect of unchecked conversion for
61411 instances with nonscalar result types whose effect is not
61412 defined by the language.
61413
61414 11.a.1/2
61415 Reason: {AI95-00426-01AI95-00426-01} Note the difference
61416 between these sentences; the first only says that the bits
61417 returned are implementation defined, while the latter allows
61418 any effect. The difference is because scalar objects should
61419 never be abnormal unless their assignment was disrupted or if
61420 they are a subcomponent of an abnormal composite object.
61421 Neither exception applies to instances of
61422 Unchecked_Conversion.
61423
61424 11.a.2/2
61425 Ramification: {AI95-00426-01AI95-00426-01} Whenever unchecked
61426 conversions are used, it is the programmer's responsibility to
61427 ensure that these conversions maintain the properties that are
61428 guaranteed by the language for objects of the target type.
61429 For nonscalar types, this requires the user to understand the
61430 underlying run-time model of the implementation. The
61431 execution of a program that violates these properties by means
61432 of unchecked conversions returning a nonscalar type is
61433 erroneous. Properties of scalar types can be checked by using
61434 the Valid attribute (see *note 13.9.2::); programs can avoid
61435 violating properties of the type (and erroneous execution) by
61436 careful use of this attribute.
61437
61438 11.b
61439 An instance of Unchecked_Conversion can be applied to an
61440 object of a private type, assuming the implementation allows
61441 it.
61442
61443 _Implementation Permissions_
61444
61445 12
61446 An implementation may return the result of an unchecked conversion by
61447 reference, if the Source type is not a by-copy type. [In this case, the
61448 result of the unchecked conversion represents simply a different
61449 (read-only) view of the operand of the conversion.]
61450
61451 12.a
61452 Ramification: In other words, the result object of a call on
61453 an instance of Unchecked_Conversion can occupy the same
61454 storage as the formal parameter S.
61455
61456 13
61457 An implementation may place restrictions on Unchecked_Conversion.
61458
61459 13.a
61460 Ramification: For example, an instantiation of
61461 Unchecked_Conversion for types for which unchecked conversion
61462 doesn't make sense may be disallowed.
61463
61464 _Implementation Advice_
61465
61466 14/2
61467 {AI95-00051-02AI95-00051-02} Since the Size of an array object generally
61468 does not include its bounds, the bounds should not be part of the
61469 converted data.
61470
61471 14.a.1/2
61472 Implementation Advice: Since the Size of an array object
61473 generally does not include its bounds, the bounds should not
61474 be part of the converted data in an instance of
61475 Unchecked_Conversion.
61476
61477 14.a
61478 Ramification: On the other hand, we have no advice to offer
61479 about discriminants and tag fields.
61480
61481 15
61482 The implementation should not generate unnecessary run-time checks to
61483 ensure that the representation of S is a representation of the target
61484 type. It should take advantage of the permission to return by reference
61485 when possible. Restrictions on unchecked conversions should be avoided
61486 unless required by the target environment.
61487
61488 15.a.1/2
61489 Implementation Advice: There should not be unnecessary
61490 run-time checks on the result of an Unchecked_Conversion; the
61491 result should be returned by reference when possible.
61492 Restrictions on Unchecked_Conversions should be avoided.
61493
61494 15.a
61495 Implementation Note: As an example of an unnecessary run-time
61496 check, consider a record type with gaps between components.
61497 The compiler might assume that such gaps are always zero bits.
61498 If a value is produced that does not obey that assumption,
61499 then the program might misbehave. The implementation should
61500 not generate extra code to check for zero bits (except,
61501 perhaps, in a special error-checking mode).
61502
61503 16
61504 The recommended level of support for unchecked conversions is:
61505
61506 17/3
61507 * {AI05-0299-1AI05-0299-1} Unchecked conversions should be supported
61508 and should be reversible in the cases where this subclause defines
61509 the result. To enable meaningful use of unchecked conversion, a
61510 contiguous representation should be used for elementary subtypes,
61511 for statically constrained array subtypes whose component subtype
61512 is one of the subtypes described in this paragraph, and for record
61513 subtypes without discriminants whose component subtypes are
61514 described in this paragraph.
61515
61516 17.a/2
61517 Implementation Advice: The recommended level of support for
61518 Unchecked_Conversion should be followed.
61519
61520 _Wording Changes from Ada 95_
61521
61522 17.b/2
61523 {AI95-00051-02AI95-00051-02} The implementation advice about
61524 the size of array objects was moved to 13.3 so that all of the
61525 advice about Size is in one place.
61526
61527 17.c/2
61528 {AI95-00426-01AI95-00426-01} Clarified that the result of
61529 Unchecked_Conversion for scalar types can be invalid, but not
61530 abnormal.
61531
61532 _Wording Changes from Ada 2005_
61533
61534 17.d/3
61535 {AI05-0078-1AI05-0078-1} Correction: Relaxed the alignment
61536 requirement slightly, giving a defined result in more cases.
61537
61538 * Menu:
61539
61540 * 13.9.1 :: Data Validity
61541 * 13.9.2 :: The Valid Attribute
61542
61543 \1f
61544 File: aarm2012.info, Node: 13.9.1, Next: 13.9.2, Up: 13.9
61545
61546 13.9.1 Data Validity
61547 --------------------
61548
61549 1
61550 Certain actions that can potentially lead to erroneous execution are not
61551 directly erroneous, but instead can cause objects to become abnormal.
61552 Subsequent uses of abnormal objects can be erroneous.
61553
61554 2
61555 A scalar object can have an invalid representation, which means that the
61556 object's representation does not represent any value of the object's
61557 subtype. The primary cause of invalid representations is uninitialized
61558 variables.
61559
61560 3
61561 Abnormal objects and invalid representations are explained in this
61562 subclause.
61563
61564 _Dynamic Semantics_
61565
61566 4
61567 When an object is first created, and any explicit or default
61568 initializations have been performed, the object and all of its parts are
61569 in the normal state. Subsequent operations generally leave them normal.
61570 However, an object or part of an object can become abnormal in the
61571 following ways:
61572
61573 5
61574 * An assignment to the object is disrupted due to an abort (see *note
61575 9.8::) or due to the failure of a language-defined check (see *note
61576 11.6::).
61577
61578 6/2
61579 * {AI95-00426-01AI95-00426-01} The object is not scalar, and is
61580 passed to an in out or out parameter of an imported procedure, the
61581 Read procedure of an instance of Sequential_IO, Direct_IO, or
61582 Storage_IO, or the stream attribute T'Read, if after return from
61583 the procedure the representation of the parameter does not
61584 represent a value of the parameter's subtype.
61585
61586 6.1/2
61587 * {AI95-00426-01AI95-00426-01} The object is the return object of a
61588 function call of a nonscalar type, and the function is an imported
61589 function, an instance of Unchecked_Conversion, or the stream
61590 attribute T'Input, if after return from the function the
61591 representation of the return object does not represent a value of
61592 the function's subtype.
61593
61594 6.a/2
61595 Discussion: We explicitly list the routines involved in order
61596 to avoid future arguments. All possibilities are listed.
61597
61598 6.b/2
61599 We did not include Stream_IO.Read in the list above. A
61600 Stream_Element should include all possible bit patterns, and
61601 thus it cannot be invalid. Therefore, the parameter will
61602 always represent a value of its subtype. By omitting this
61603 routine, we make it possible to write arbitrary I/O operations
61604 without any possibility of abnormal objects.
61605
61606 6.2/2
61607 {AI95-00426-01AI95-00426-01} [For an imported object, it is the
61608 programmer's responsibility to ensure that the object remains in a
61609 normal state.]
61610
61611 6.c/2
61612 Proof: This follows (and echos) the standard rule of
61613 interfacing; the programmer must ensure that Ada semantics are
61614 followed (see *note B.1::).
61615
61616 7
61617 Whether or not an object actually becomes abnormal in these cases is not
61618 specified. An abnormal object becomes normal again upon successful
61619 completion of an assignment to the object as a whole.
61620
61621 _Erroneous Execution_
61622
61623 8
61624 It is erroneous to evaluate a primary that is a name denoting an
61625 abnormal object, or to evaluate a prefix that denotes an abnormal
61626 object.
61627
61628 8.a/2
61629 This paragraph was deleted.{AI95-00114-01AI95-00114-01}
61630
61631 8.b
61632 Ramification: The in out or out parameter case does not apply
61633 to scalars; bad scalars are merely invalid representations,
61634 rather than abnormal, in this case.
61635
61636 8.c/2
61637 Reason: {AI95-00114-01AI95-00114-01} The reason we allow
61638 access objects, and objects containing subcomponents of an
61639 access type, to become abnormal is because the correctness of
61640 an access value cannot necessarily be determined merely by
61641 looking at the bits of the object. The reason we allow scalar
61642 objects to become abnormal is that we wish to allow the
61643 compiler to optimize assuming that the value of a scalar
61644 object belongs to the object's subtype, if the compiler can
61645 prove that the object is initialized with a value that belongs
61646 to the subtype. The reason we allow composite objects to
61647 become abnormal is that such object might be represented with
61648 implicit levels of indirection; if those are corrupted, then
61649 even assigning into a component of the object, or simply
61650 asking for its Address, might have an unpredictable effect.
61651 The same is true if the discriminants have been destroyed.
61652
61653 _Bounded (Run-Time) Errors_
61654
61655 9
61656 If the representation of a scalar object does not represent a value of
61657 the object's subtype (perhaps because the object was not initialized),
61658 the object is said to have an invalid representation. It is a bounded
61659 error to evaluate the value of such an object. If the error is
61660 detected, either Constraint_Error or Program_Error is raised.
61661 Otherwise, execution continues using the invalid representation. The
61662 rules of the language outside this subclause assume that all objects
61663 have valid representations. The semantics of operations on invalid
61664 representations are as follows:
61665
61666 9.a
61667 Discussion: The AARM is more explicit about what happens when
61668 the value of the case expression is an invalid representation.
61669
61670 9.b/2
61671 Ramification: {AI95-00426-01AI95-00426-01} This includes the
61672 result object of functions, including the result of
61673 Unchecked_Conversion, T'Input, and imported functions.
61674
61675 10
61676 * If the representation of the object represents a value of the
61677 object's type, the value of the type is used.
61678
61679 11
61680 * If the representation of the object does not represent a value of
61681 the object's type, the semantics of operations on such
61682 representations is implementation-defined, but does not by itself
61683 lead to erroneous or unpredictable execution, or to other objects
61684 becoming abnormal.
61685
61686 11.a/2
61687 Implementation Note: {AI95-00426-01AI95-00426-01} This means
61688 that the implementation must take care not to use an invalid
61689 representation in a way that might cause erroneous execution.
61690 For instance, the exception mandated for case_statements must
61691 be raised. Array indexing must not cause memory outside of
61692 the array to be written (and usually, not read either). These
61693 cases and similar cases may require explicit checks by the
61694 implementation.
61695
61696 _Erroneous Execution_
61697
61698 12/3
61699 {AI95-00167-01AI95-00167-01} {AI05-0279-1AI05-0279-1} A call to an
61700 imported function or an instance of Unchecked_Conversion is erroneous if
61701 the result is scalar, the result object has an invalid representation,
61702 and the result is used other than as the expression of an
61703 assignment_statement or an object_declaration, as the object_name of an
61704 object_renaming_declaration, or as the prefix of a Valid attribute. If
61705 such a result object is used as the source of an assignment, and the
61706 assigned value is an invalid representation for the target of the
61707 assignment, then any use of the target object prior to a further
61708 assignment to the target object, other than as the prefix of a Valid
61709 attribute reference, is erroneous.
61710
61711 12.a/2
61712 Ramification: {AI95-00167-01AI95-00167-01} In a typical
61713 implementation, every bit pattern that fits in an object of a
61714 signed integer subtype will represent a value of the type, if
61715 not of the subtype. However, for an enumeration or floating
61716 point type, as well as some modular types, there are typically
61717 bit patterns that do not represent any value of the type. In
61718 such cases, the implementation ought to define the semantics
61719 of operations on the invalid representations in the obvious
61720 manner (assuming the bounded error is not detected): a given
61721 representation should be equal to itself, a representation
61722 that is in between the internal codes of two enumeration
61723 literals should behave accordingly when passed to comparison
61724 operators and membership tests, etc. We considered requiring
61725 such sensible behavior, but it resulted in too much arcane
61726 verbiage, and since implementations have little incentive to
61727 behave irrationally, such verbiage is not important to have.
61728
61729 12.b/2
61730 {AI95-00167-01AI95-00167-01} If a stand-alone scalar object is
61731 initialized to a an in-range value, then the implementation
61732 can take advantage of the fact that the use of any
61733 out-of-range value has to be erroneous. Such an out-of-range
61734 value can be produced only by things like unchecked
61735 conversion, imported functions, and abnormal values caused by
61736 disruption of an assignment due to abort or to failure of a
61737 language-defined check. This depends on out-of-range values
61738 being checked before assignment (that is, checks are not
61739 optimized away unless they are proven redundant).
61740
61741 12.c
61742 Consider the following example:
61743
61744 12.d/2
61745 {AI95-00167-01AI95-00167-01} type My_Int is range 0..99;
61746 function Safe_Convert is new Unchecked_Conversion(My_Int, Integer);
61747 function Unsafe_Convert is new Unchecked_Conversion(My_Int, Positive);
61748 X : Positive := Safe_Convert(0); -- Raises Constraint_Error.
61749 Y : Positive := Unsafe_Convert(0); -- Bounded Error, may be invalid.
61750 B : Boolean := Y'Valid; -- OK, B = False.
61751 Z : Positive := Y+1; -- Erroneous to use Y.
61752
61753 12.e/2
61754 {AI95-00167-01AI95-00167-01} {AI95-00426-01AI95-00426-01} The
61755 call to Unsafe_Convert is a bounded error, which might raise
61756 Constraint_Error, Program_Error, or return an invalid value.
61757 Moreover, if an exception is not raised, most uses of that
61758 invalid value (including the use of Y) cause erroneous
61759 execution. The call to Safe_Convert is not erroneous. The
61760 result object is an object of subtype Integer containing the
61761 value 0. The assignment to X is required to do a constraint
61762 check; the fact that the conversion is unchecked does not
61763 obviate the need for subsequent checks required by the
61764 language rules.
61765
61766 12.e.1/2
61767 {AI95-00167-01AI95-00167-01} {AI95-00426-01AI95-00426-01} The
61768 reason for delaying erroneous execution until the object is
61769 used is so that the invalid representation can be tested for
61770 validity using the Valid attribute (see *note 13.9.2::)
61771 without causing execution to become erroneous. Note that this
61772 delay does not imply an exception will not be raised; an
61773 implementation could treat both conversions in the example in
61774 the same way and raise Constraint_Error.
61775
61776 12.e.2/3
61777 {AI05-0279-1AI05-0279-1} The rules are defined in terms of the
61778 result object, and thus the name used to reference that object
61779 is irrelevant. That is why we don't need any special rules to
61780 describe what happens when the function result is renamed.
61781
61782 12.f
61783 Implementation Note: If an implementation wants to have a
61784 "friendly" mode, it might always assign an uninitialized
61785 scalar a default initial value that is outside the object's
61786 subtype (if there is one), and check for this value on some or
61787 all reads of the object, so as to help detect references to
61788 uninitialized scalars. Alternatively, an implementation might
61789 want to provide an "unsafe" mode where it presumed even
61790 uninitialized scalars were always within their subtype.
61791
61792 12.g
61793 Ramification: The above rules imply that it is a bounded error
61794 to apply a predefined operator to an object with a scalar
61795 subcomponent having an invalid representation, since this
61796 implies reading the value of each subcomponent. Either
61797 Program_Error or Constraint_Error is raised, or some result is
61798 produced, which if composite, might have a corresponding
61799 scalar subcomponent still with an invalid representation.
61800
61801 12.h
61802 Note that it is not an error to assign, convert, or pass as a
61803 parameter a composite object with an uninitialized scalar
61804 subcomponent. In the other hand, it is a (bounded) error to
61805 apply a predefined operator such as =, <, and xor to a
61806 composite operand with an invalid scalar subcomponent.
61807
61808 13/3
61809 {AI05-0054-2AI05-0054-2} The dereference of an access value is erroneous
61810 if it does not designate an object of an appropriate type or a
61811 subprogram with an appropriate profile, if it designates a nonexistent
61812 object, or if it is an access-to-variable value that designates a
61813 constant object and it did not originate from an attribute_reference
61814 applied to an aliased variable view of a controlled or immutably limited
61815 object. [An access value whose dereference is erroneous can exist, for
61816 example, because of Unchecked_Deallocation, Unchecked_Access, or
61817 Unchecked_Conversion.]
61818
61819 13.a
61820 Ramification: The above mentioned Unchecked_... features are
61821 not the only causes of such access values. For example,
61822 interfacing to other languages can also cause the problem.
61823
61824 13.b/3
61825 {AI05-0054-2AI05-0054-2} We permit the use of
61826 access-to-variable values that designate constant objects so
61827 long as they originate from an aliased variable view of a
61828 controlled or immutably limited constant, such as during the
61829 initialization of a constant (both via the "current instance"
61830 and during a call to Initialize) or during an assignment
61831 (during a call to Adjust).
61832
61833 NOTES
61834
61835 14
61836 21 Objects can become abnormal due to other kinds of actions that
61837 directly update the object's representation; such actions are
61838 generally considered directly erroneous, however.
61839
61840 _Wording Changes from Ada 83_
61841
61842 14.a
61843 In order to reduce the amount of erroneousness, we separate
61844 the concept of an undefined value into objects with invalid
61845 representation (scalars only) and abnormal objects.
61846
61847 14.b
61848 Reading an object with an invalid representation is a bounded
61849 error rather than erroneous; reading an abnormal object is
61850 still erroneous. In fact, the only safe thing to do to an
61851 abnormal object is to assign to the object as a whole.
61852
61853 _Wording Changes from Ada 95_
61854
61855 14.c/2
61856 {AI95-00167-01AI95-00167-01} The description of erroneous
61857 execution for Unchecked_Conversion and imported objects was
61858 tightened up so that using the Valid attribute to test such a
61859 value is not erroneous.
61860
61861 14.d/2
61862 {AI95-00426-01AI95-00426-01} Clarified the definition of
61863 objects that can become abnormal; made sure that all of the
61864 possibilities are included.
61865
61866 _Wording Changes from Ada 2005_
61867
61868 14.e/3
61869 {AI05-0054-2AI05-0054-2} Correction: Common programming
61870 techniques such as squirreling away an access to a controlled
61871 object during initialization and using a self-referencing
61872 discriminant (the so-called "Rosen trick") no longer are
61873 immediately erroneous if the object is declared constant, so
61874 these techniques can be used portably and safely.
61875 Practically, these techniques already worked as compilers did
61876 not take much advantage of this rule, so the impact of this
61877 change will be slight.
61878
61879 14.f/3
61880 {AI05-0279-1AI05-0279-1} Correction: The description of
61881 erroneous execution for Unchecked_Conversion and imported
61882 objects was adjusted to clarify that renaming such an object
61883 is not, by itself, erroneous.
61884
61885 \1f
61886 File: aarm2012.info, Node: 13.9.2, Prev: 13.9.1, Up: 13.9
61887
61888 13.9.2 The Valid Attribute
61889 --------------------------
61890
61891 1
61892 The Valid attribute can be used to check the validity of data produced
61893 by unchecked conversion, input, interface to foreign languages, and the
61894 like.
61895
61896 _Static Semantics_
61897
61898 2
61899 For a prefix X that denotes a scalar object [(after any implicit
61900 dereference)], the following attribute is defined:
61901
61902 3/3
61903 X'Valid
61904 {AI05-0153-3AI05-0153-3} Yields True if and only if the
61905 object denoted by X is normal, has a valid
61906 representation, and the predicate of the nominal subtype
61907 of X evaluates to True. The value of this attribute is
61908 of the predefined type Boolean.
61909
61910 3.a
61911 Ramification: Having checked that X'Valid is True, it is safe
61912 to read the value of X without fear of erroneous execution
61913 caused by abnormality, or a bounded error caused by an invalid
61914 representation. Such a read will produce a value in the
61915 subtype of X.
61916
61917 NOTES
61918
61919 4
61920 22 Invalid data can be created in the following cases (not
61921 counting erroneous or unpredictable execution):
61922
61923 5
61924 * an uninitialized scalar object,
61925
61926 6
61927 * the result of an unchecked conversion,
61928
61929 7
61930 * input,
61931
61932 8
61933 * interface to another language (including machine code),
61934
61935 9
61936 * aborting an assignment,
61937
61938 10
61939 * disrupting an assignment due to the failure of a
61940 language-defined check (see *note 11.6::), and
61941
61942 11
61943 * use of an object whose Address has been specified.
61944
61945 12
61946 23 X'Valid is not considered to be a read of X; hence, it is not
61947 an error to check the validity of invalid data.
61948
61949 13/2
61950 24 {AI95-00426-01AI95-00426-01} The Valid attribute may be used to
61951 check the result of calling an instance of Unchecked_Conversion (or
61952 any other operation that can return invalid values). However, an
61953 exception handler should also be provided because implementations
61954 are permitted to raise Constraint_Error or Program_Error if they
61955 detect the use of an invalid representation (see *note 13.9.1::).
61956
61957 13.a
61958 Ramification: If X is of an enumeration type with a
61959 representation clause, then X'Valid checks that the value of X
61960 when viewed as an integer is one of the specified internal
61961 codes.
61962
61963 13.b
61964 Reason: Valid is defined only for scalar objects because the
61965 implementation and description burden would be too high for
61966 other types. For example, given a typical run-time model, it
61967 is impossible to check the validity of an access value. The
61968 same applies to composite types implemented with internal
61969 pointers. One can check the validity of a composite object by
61970 checking the validity of each of its scalar subcomponents.
61971 The user should ensure that any composite types that need to
61972 be checked for validity are represented in a way that does not
61973 involve implementation-defined components, or gaps between
61974 components. Furthermore, such types should not contain access
61975 subcomponents.
61976
61977 13.c/2
61978 This paragraph was deleted.{AI95-00114-01AI95-00114-01}
61979
61980 _Extensions to Ada 83_
61981
61982 13.d
61983 X'Valid is new in Ada 95.
61984
61985 _Wording Changes from Ada 95_
61986
61987 13.e/2
61988 {AI95-00426-01AI95-00426-01} Added a note explaining that
61989 handlers for Constraint_Error and Program_Error are needed in
61990 the general case of testing for validity. (An implementation
61991 could document cases where these are not necessary, but there
61992 is no language requirement.)
61993
61994 _Wording Changes from Ada 2005_
61995
61996 13.f/3
61997 {AI05-0153-3AI05-0153-3} The validity check now also includes
61998 a check of the predicate aspects (see *note 3.2.4::), if any,
61999 of the subtype of the object.
62000
62001 \1f
62002 File: aarm2012.info, Node: 13.10, Next: 13.11, Prev: 13.9, Up: 13
62003
62004 13.10 Unchecked Access Value Creation
62005 =====================================
62006
62007 1
62008 [The attribute Unchecked_Access is used to create access values in an
62009 unsafe manner -- the programmer is responsible for preventing "dangling
62010 references."]
62011
62012 _Static Semantics_
62013
62014 2
62015 The following attribute is defined for a prefix X that denotes an
62016 aliased view of an object:
62017
62018 3
62019 X'Unchecked_Access
62020 All rules and semantics that apply to X'Access (see *note
62021 3.10.2::) apply also to X'Unchecked_Access, except that,
62022 for the purposes of accessibility rules and checks, it is
62023 as if X were declared immediately within a library
62024 package.
62025
62026 3.a/3
62027 Ramification: {AI05-0005-1AI05-0005-1} We say "rules and
62028 semantics" here so that library-level accessibility applies to
62029 the value created by X'Unchecked_Access as well as to the
62030 checks needed for the attribute itself. This means that any
62031 anonymous access values that inherit the accessibility of this
62032 attribute (such as access parameters) also act as if they have
62033 library-level accessibility. We don't want the "real"
62034 accessibility of the created value re-emerging at a later
62035 point - that would create hard-to-understand bugs.
62036
62037 NOTES
62038
62039 4
62040 25 This attribute is provided to support the situation where a
62041 local object is to be inserted into a global linked data structure,
62042 when the programmer knows that it will always be removed from the
62043 data structure prior to exiting the object's scope. The Access
62044 attribute would be illegal in this case (see *note 3.10.2::, "*note
62045 3.10.2:: Operations of Access Types").
62046
62047 4.a
62048 Ramification: The expected type for X'Unchecked_Access is as
62049 for X'Access.
62050
62051 4.b
62052 If an attribute_reference with Unchecked_Access is used as the
62053 actual parameter for an access parameter, an
62054 Accessibility_Check can never fail on that access parameter.
62055
62056 5
62057 26 There is no Unchecked_Access attribute for subprograms.
62058
62059 5.a/2
62060 Reason: {AI95-00254-01AI95-00254-01} Such an attribute would
62061 allow unsafe "downward closures", where an access value
62062 designating a more nested subprogram is passed to a less
62063 nested subprogram. (Anonymous access-to-subprogram parameters
62064 provide safe "downward closures".) This requires some means
62065 of reconstructing the global environment for the more nested
62066 subprogram, so that it can do up-level references to objects.
62067 The two methods of implementing up-level references are
62068 displays and static links. If unsafe downward closures were
62069 supported, each access-to-subprogram value would have to carry
62070 the static link or display with it. We don't want to require
62071 the space and time overhead of requiring the extra information
62072 for all access-to-subprogram types, especially as including it
62073 would make interfacing to other languages (like C) harder.
62074
62075 5.b
62076 If desired, an instance of Unchecked_Conversion can be used to
62077 create an access value of a global access-to-subprogram type
62078 that designates a local subprogram. The semantics of using
62079 such a value are not specified by the language. In
62080 particular, it is not specified what happens if such
62081 subprograms make up-level references; even if the frame being
62082 referenced still exists, the up-level reference might go awry
62083 if the representation of a value of a global
62084 access-to-subprogram type doesn't include a static link.
62085
62086 \1f
62087 File: aarm2012.info, Node: 13.11, Next: 13.12, Prev: 13.10, Up: 13
62088
62089 13.11 Storage Management
62090 ========================
62091
62092 1
62093 [ Each access-to-object type has an associated storage pool. The
62094 storage allocated by an allocator comes from the pool; instances of
62095 Unchecked_Deallocation return storage to the pool. Several access types
62096 can share the same pool.]
62097
62098 2/2
62099 {AI95-00435-01AI95-00435-01} [A storage pool is a variable of a type in
62100 the class rooted at Root_Storage_Pool, which is an abstract limited
62101 controlled type. By default, the implementation chooses a standard
62102 storage pool for each access-to-object type. The user may define new
62103 pool types, and may override the choice of pool for an access-to-object
62104 type by specifying Storage_Pool for the type.]
62105
62106 2.a
62107 Ramification: By default, the implementation might choose to
62108 have a single global storage pool, which is used (by default)
62109 by all access types, which might mean that storage is
62110 reclaimed automatically only upon partition completion.
62111 Alternatively, it might choose to create a new pool at each
62112 accessibility level, which might mean that storage is
62113 reclaimed for an access type when leaving the appropriate
62114 scope. Other schemes are possible.
62115
62116 2.a.1/3
62117 Glossary entry: Each access-to-object type has an associated
62118 storage pool object. The storage for an object created by an
62119 allocator comes from the storage pool of the type of the
62120 allocator. Some storage pools may be partitioned into
62121 subpools in order to support finer-grained storage management.
62122
62123 _Legality Rules_
62124
62125 3
62126 If Storage_Pool is specified for a given access type, Storage_Size shall
62127 not be specified for it.
62128
62129 3.a
62130 Reason: The Storage_Pool determines the Storage_Size; hence it
62131 would not make sense to specify both. Note that this rule is
62132 simplified by the fact that the aspects in question cannot be
62133 specified for derived types, nor for nonfirst subtypes, so we
62134 don't have to worry about whether, say, Storage_Pool on a
62135 derived type overrides Storage_Size on the parent type. For
62136 the same reason, "specified" means the same thing as "directly
62137 specified" here.
62138
62139 _Static Semantics_
62140
62141 4
62142 The following language-defined library package exists:
62143
62144 5
62145 with Ada.Finalization;
62146 with System.Storage_Elements;
62147 package System.Storage_Pools is
62148 pragma Preelaborate(System.Storage_Pools);
62149
62150 6/2
62151 {AI95-00161-01AI95-00161-01} type Root_Storage_Pool is
62152 abstract new Ada.Finalization.Limited_Controlled with private;
62153 pragma Preelaborable_Initialization(Root_Storage_Pool);
62154
62155 7
62156 procedure Allocate(
62157 Pool : in out Root_Storage_Pool;
62158 Storage_Address : out Address;
62159 Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
62160 Alignment : in Storage_Elements.Storage_Count) is abstract;
62161
62162 8
62163 procedure Deallocate(
62164 Pool : in out Root_Storage_Pool;
62165 Storage_Address : in Address;
62166 Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
62167 Alignment : in Storage_Elements.Storage_Count) is abstract;
62168
62169 9
62170 function Storage_Size(Pool : Root_Storage_Pool)
62171 return Storage_Elements.Storage_Count is abstract;
62172
62173 10
62174 private
62175 ... -- not specified by the language
62176 end System.Storage_Pools;
62177
62178 10.a
62179 Reason: The Alignment parameter is provided to Deallocate
62180 because some allocation strategies require it. If it is not
62181 needed, it can be ignored.
62182
62183 11
62184 A storage pool type (or pool type) is a descendant of Root_Storage_Pool.
62185 The elements of a storage pool are the objects allocated in the pool by
62186 allocators.
62187
62188 11.a
62189 Discussion: In most cases, an element corresponds to a single
62190 memory block allocated by Allocate. However, in some cases
62191 the implementation may choose to associate more than one
62192 memory block with a given pool element.
62193
62194 12/2
62195 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
62196 {AI95-00435-01AI95-00435-01} For every access-to-object subtype S, the
62197 following representation attributes are defined:
62198
62199 13
62200 S'Storage_Pool
62201 Denotes the storage pool of the type of S. The type of
62202 this attribute is Root_Storage_Pool'Class.
62203
62204 14
62205 S'Storage_Size
62206 Yields the result of calling
62207 Storage_Size(S'Storage_Pool)[, which is intended to be a
62208 measure of the number of storage elements reserved for
62209 the pool.] The type of this attribute is
62210 universal_integer.
62211
62212 14.a
62213 Ramification: Storage_Size is also defined for task subtypes
62214 and objects -- see *note 13.3::.
62215
62216 14.b
62217 Storage_Size is not a measure of how much un-allocated space
62218 is left in the pool. That is, it includes both allocated and
62219 unallocated space. Implementations and users may provide a
62220 Storage_Available function for their pools, if so desired.
62221
62222 15
62223 Storage_Size or Storage_Pool may be specified for a nonderived
62224 access-to-object type via an attribute_definition_clause (*note 13.3:
62225 S0309.); the name in a Storage_Pool clause shall denote a variable.
62226
62227 15.a/3
62228 Aspect Description for Storage_Pool: Pool of memory from which
62229 new will allocate for a given access type.
62230
62231 15.b/3
62232 Aspect Description for Storage_Size (access): Sets memory size
62233 for allocations for an access type.
62234
62235 16/3
62236 {AI05-0107-1AI05-0107-1} {AI05-0111-3AI05-0111-3}
62237 {AI05-0116-1AI05-0116-1} An allocator of a type T that does not support
62238 subpools allocates storage from T's storage pool. If the storage pool
62239 is a user-defined object, then the storage is allocated by calling
62240 Allocate as described below. Allocators for types that support subpools
62241 are described in *note 13.11.4::.
62242
62243 16.a
62244 Ramification: If the implementation chooses to represent the
62245 designated subtype in multiple pieces, one allocator
62246 evaluation might result in more than one call upon Allocate.
62247 In any case, allocators for the access type obtain all the
62248 required storage for an object of the designated type by
62249 calling the specified Allocate procedure.
62250
62251 16.b/3
62252 This paragraph was deleted.{AI05-0107-1AI05-0107-1}
62253
62254 16.b.1/1
62255 {8652/01118652/0111} {AI95-00103-01AI95-00103-01} If D (the
62256 designated type of T) includes subcomponents of other access
62257 types, they will be allocated from the storage pools for those
62258 types, even if those allocators are executed as part of the
62259 allocator of T (as part of the initialization of the object).
62260 For instance, an access-to-task type TT may allocate the data
62261 structures used to implement the task value from other storage
62262 pools. (In particular, the task stack does not necessarily
62263 need to be allocated from the storage pool for TT.)
62264
62265 17
62266 If Storage_Pool is not specified for a type defined by an
62267 access_to_object_definition, then the implementation chooses a standard
62268 storage pool for it in an implementation-defined manner. In this case,
62269 the exception Storage_Error is raised by an allocator if there is not
62270 enough storage. It is implementation defined whether or not the
62271 implementation provides user-accessible names for the standard pool
62272 type(s).
62273
62274 17.a/2
62275 This paragraph was deleted.
62276
62277 17.a.1/2
62278 Discussion: The manner of choosing a storage pool is covered
62279 by a Documentation Requirement below, so it is not summarized
62280 here.
62281
62282 17.b
62283 Implementation defined: Whether or not the implementation
62284 provides user-accessible names for the standard pool type(s).
62285
62286 17.c/2
62287 Ramification: {AI95-00230-01AI95-00230-01} An access-to-object
62288 type defined by a derived_type_definition inherits its pool
62289 from its parent type, so all access-to-object types in the
62290 same derivation class share the same pool. Hence the "defined
62291 by an access_to_object_definition" wording above.
62292
62293 17.d
62294 There is no requirement that all storage pools be implemented
62295 using a contiguous block of memory (although each allocation
62296 returns a pointer to a contiguous block of memory).
62297
62298 18
62299 If Storage_Size is specified for an access type, then the Storage_Size
62300 of this pool is at least that requested, and the storage for the pool is
62301 reclaimed when the master containing the declaration of the access type
62302 is left. If the implementation cannot satisfy the request,
62303 Storage_Error is raised at the point of the attribute_definition_clause
62304 (*note 13.3: S0309.). If neither Storage_Pool nor Storage_Size are
62305 specified, then the meaning of Storage_Size is implementation defined.
62306
62307 18.a/2
62308 Implementation defined: The meaning of Storage_Size when
62309 neither the Storage_Size nor the Storage_Pool is specified for
62310 an access type.
62311
62312 18.b
62313 Ramification: The Storage_Size function and attribute will
62314 return the actual size, rather than the requested size.
62315 Comments about rounding up, zero, and negative on task
62316 Storage_Size apply here, as well. See also AI83-00557,
62317 AI83-00558, and AI83-00608.
62318
62319 18.c
62320 The expression in a Storage_Size clause need not be static.
62321
62322 18.d
62323 The reclamation happens after the master is finalized.
62324
62325 18.e
62326 Implementation Note: For a pool allocated on the stack, normal
62327 stack cut-back can accomplish the reclamation. For a
62328 library-level pool, normal partition termination actions can
62329 accomplish the reclamation.
62330
62331 19
62332 If Storage_Pool is specified for an access type, then the specified pool
62333 is used.
62334
62335 20
62336 The effect of calling Allocate and Deallocate for a standard storage
62337 pool directly (rather than implicitly via an allocator or an instance of
62338 Unchecked_Deallocation) is unspecified.
62339
62340 20.a
62341 Ramification: For example, an allocator might put the pool
62342 element on a finalization list. If the user directly
62343 Deallocates it, instead of calling an instance of
62344 Unchecked_Deallocation, then the implementation would probably
62345 try to finalize the object upon master completion, which would
62346 be bad news. Therefore, the implementation should define such
62347 situations as erroneous.
62348
62349 _Erroneous Execution_
62350
62351 21
62352 If Storage_Pool is specified for an access type, then if Allocate can
62353 satisfy the request, it should allocate a contiguous block of memory,
62354 and return the address of the first storage element in Storage_Address.
62355 The block should contain Size_In_Storage_Elements storage elements, and
62356 should be aligned according to Alignment. The allocated storage should
62357 not be used for any other purpose while the pool element remains in
62358 existence. If the request cannot be satisfied, then Allocate should
62359 propagate an exception [(such as Storage_Error)]. If Allocate behaves
62360 in any other manner, then the program execution is erroneous.
62361
62362 _Implementation Requirements_
62363
62364 21.1/3
62365 {AI05-0107-1AI05-0107-1} {AI05-0262-1AI05-0262-1} The Allocate procedure
62366 of a user-defined storage pool object P may be called by the
62367 implementation only to allocate storage for a type T whose pool is P,
62368 only at the following points:
62369
62370 21.2/3
62371 * During the execution of an allocator of type T;
62372
62373 21.a/3
62374 Ramification: This includes during the evaluation of the
62375 initializing expression such as an aggregate; this is
62376 important if the initializing expression is built in place.
62377 We need to allow allocation to be deferred until the size of
62378 the object is known.
62379
62380 21.3/3
62381 * During the execution of a return statement for a function whose
62382 result is built-in-place in the result of an allocator of type T;
62383
62384 21.b/3
62385 Reason: We need this bullet as well as the preceding one in
62386 order that exceptions that propagate from such a call to
62387 Allocate can be handled within the return statement. We don't
62388 want to require the generation of special handling code in
62389 this unusual case, as it would add overhead to most return
62390 statements of composite types.
62391
62392 21.4/3
62393 * During the execution of an assignment operation with a target of an
62394 allocated object of type T with a part that has an unconstrained
62395 discriminated subtype with defaults.
62396
62397 21.c/3
62398 Reason: We allow Allocate to be called during assignment of
62399 objects with mutable parts so that mutable objects can be
62400 implemented with reallocation on assignment. (Unfortunately,
62401 the term "mutable" is only defined in the AARM, so we have to
62402 use the long-winded wording shown here.)
62403
62404 21.d/3
62405 Discussion: Of course, explicit calls to Allocate are also
62406 allowed and are not bound by any of the rules found here.
62407
62408 21.5/3
62409 {AI05-0107-1AI05-0107-1} {AI05-0116-1AI05-0116-1}
62410 {AI05-0193-1AI05-0193-1} {AI05-0262-1AI05-0262-1}
62411 {AI05-0269-1AI05-0269-1} For each of the calls of Allocate described
62412 above, P (equivalent to T'Storage_Pool) is passed as the Pool parameter.
62413 The Size_In_Storage_Elements parameter indicates the number of storage
62414 elements to be allocated, and is no more than
62415 D'Max_Size_In_Storage_Elements, where D is the designated subtype of T.
62416 The Alignment parameter is a nonzero integral multiple of D'Alignment if
62417 D is a specific type, and otherwise is a nonzero integral multiple of
62418 the alignment of the specific type identified by the tag of the object
62419 being created; it is unspecified if there is no such value. The
62420 Alignment parameter is no more than D'Max_Alignment_For_Allocation. The
62421 result returned in the Storage_Address parameter is used as the address
62422 of the allocated storage, which is a contiguous block of memory of
62423 Size_In_Storage_Elements storage elements. [Any exception propagated by
62424 Allocate is propagated by the construct that contained the call.]
62425
62426 21.e/3
62427 Ramification: Note that the implementation does not turn other
62428 exceptions into Storage_Error.
62429
62430 21.f/3
62431 "Nonzero integral multiple" of an alignment includes the
62432 alignment value itself, of course. The value is unspecified
62433 if the alignment of the specific type is zero.
62434
62435 21.6/3
62436 {AI05-0107-1AI05-0107-1} The number of calls to Allocate needed to
62437 implement an allocator for any particular type is unspecified. The
62438 number of calls to Deallocate needed to implement an instance of
62439 Unchecked_Deallocation (see *note 13.11.2::) for any particular object
62440 is the same as the number of Allocate calls for that object.
62441
62442 21.g/3
62443 Reason: This supports objects that are allocated in one or
62444 more parts. The second sentence prevents extra or missing
62445 calls to Deallocate.
62446
62447 21.h/3
62448 To be honest: {AI05-0005-1AI05-0005-1} The number of calls to
62449 Deallocate from all sources for an object always will be the
62450 same as the number of calls to Allocate from all sources for
62451 that object. However, in unusual cases, not all of those
62452 Deallocate calls may be made by an instance of
62453 Unchecked_Deallocation. Specifically, in the unusual case of
62454 assigning to an object of a mutable variant record type such
62455 that the variant changes, some of the Deallocate calls may be
62456 made by the assignment (as may some of the Allocate calls).
62457
62458 21.i/3
62459 Ramification: We do not define the relative order of multiple
62460 calls used to deallocate the same object -- that is, if the
62461 allocator allocated two pieces x and y, then an instance of
62462 Unchecked_Deallocation might deallocate x and then y, or it
62463 might deallocate y and then x.
62464
62465 21.7/3
62466 {AI05-0107-1AI05-0107-1} The Deallocate procedure of a user-defined
62467 storage pool object P may be called by the implementation to deallocate
62468 storage for a type T whose pool is P only at the places when an Allocate
62469 call is allowed for P, during the execution of an instance of
62470 Unchecked_Deallocation for T, or as part of the finalization of the
62471 collection of T. For such a call of Deallocate, P (equivalent to
62472 T'Storage_Pool) is passed as the Pool parameter. The value of the
62473 Storage_Address parameter for a call to Deallocate is the value returned
62474 in the Storage_Address parameter of the corresponding successful call to
62475 Allocate. The values of the Size_In_Storage_Elements and Alignment
62476 parameters are the same values passed to the corresponding Allocate
62477 call. Any exception propagated by Deallocate is propagated by the
62478 construct that contained the call.
62479
62480 21.j/3
62481 Reason: We allow Deallocate to be called anywhere that
62482 Allocate is, in order to allow the recovery of storage from
62483 failed allocations (that is, those that raise exceptions);
62484 from extended return statements that exit via a goto, exit, or
62485 locally handled exception; and from objects that are
62486 reallocated when they are assigned. In each of these cases,
62487 we would have a storage leak if the implementation did not
62488 recover the storage (there is no way for the programmer to do
62489 it). We do not require such recovery, however, as it could be
62490 a serious performance drag on these operations.
62491
62492 _Documentation Requirements_
62493
62494 22
62495 An implementation shall document the set of values that a user-defined
62496 Allocate procedure needs to accept for the Alignment parameter. An
62497 implementation shall document how the standard storage pool is chosen,
62498 and how storage is allocated by standard storage pools.
62499
62500 22.a/2
62501 This paragraph was deleted.
62502
62503 22.b/2
62504 Documentation Requirement: The set of values that a
62505 user-defined Allocate procedure needs to accept for the
62506 Alignment parameter. How the standard storage pool is chosen,
62507 and how storage is allocated by standard storage pools.
62508
62509 _Implementation Advice_
62510
62511 23
62512 An implementation should document any cases in which it dynamically
62513 allocates heap storage for a purpose other than the evaluation of an
62514 allocator.
62515
62516 23.a.1/2
62517 Implementation Advice: Any cases in which heap storage is
62518 dynamically allocated other than as part of the evaluation of
62519 an allocator should be documented.
62520
62521 23.a
62522 Reason: This is "Implementation Advice" because the term "heap
62523 storage" is not formally definable; therefore, it is not
62524 testable whether the implementation obeys this advice.
62525
62526 24
62527 A default (implementation-provided) storage pool for an
62528 access-to-constant type should not have overhead to support deallocation
62529 of individual objects.
62530
62531 24.a.1/2
62532 Implementation Advice: A default storage pool for an
62533 access-to-constant type should not have overhead to support
62534 deallocation of individual objects.
62535
62536 24.a
62537 Ramification: Unchecked_Deallocation is not defined for such
62538 types. If the access-to-constant type is library-level, then
62539 no deallocation (other than at partition completion) will ever
62540 be necessary, so if the size needed by an allocator of the
62541 type is known at link-time, then the allocation should be
62542 performed statically. If, in addition, the initial value of
62543 the designated object is known at compile time, the object can
62544 be allocated to read-only memory.
62545
62546 24.b
62547 Implementation Note: If the Storage_Size for an access type is
62548 specified, the storage pool should consist of a contiguous
62549 block of memory, possibly allocated on the stack. The pool
62550 should contain approximately this number of storage elements.
62551 These storage elements should be reserved at the place of the
62552 Storage_Size clause, so that allocators cannot raise
62553 Storage_Error due to running out of pool space until the
62554 appropriate number of storage elements has been used up. This
62555 approximate (possibly rounded-up) value should be used as a
62556 maximum; the implementation should not increase the size of
62557 the pool on the fly. If the Storage_Size for an access type
62558 is specified as zero, then the pool should not take up any
62559 storage space, and any allocator for the type should raise
62560 Storage_Error.
62561
62562 24.c
62563 Ramification: Note that most of this is approximate, and so
62564 cannot be (portably) tested. That's why we make it an
62565 Implementation Note. There is no particular number of
62566 allocations that is guaranteed to succeed, and there is no
62567 particular number of allocations that is guaranteed to fail.
62568
62569 25/2
62570 {AI95-00230-01AI95-00230-01} The storage pool used for an allocator of
62571 an anonymous access type should be determined as follows:
62572
62573 25.1/2
62574 * {AI95-00230-01AI95-00230-01} {AI95-00416-01AI95-00416-01} If the
62575 allocator is defining a coextension (see *note 3.10.2::) of an
62576 object being created by an outer allocator, then the storage pool
62577 used for the outer allocator should also be used for the
62578 coextension;
62579
62580 25.2/2
62581 * {AI95-00230-01AI95-00230-01} For other access discriminants and
62582 access parameters, the storage pool should be created at the point
62583 of the allocator, and be reclaimed when the allocated object
62584 becomes inaccessible;
62585
62586 25.3/3
62587 * {AI05-0051-1AI05-0051-1} If the allocator defines the result of a
62588 function with an access result, the storage pool is determined as
62589 though the allocator were in place of the call of the function. If
62590 the call is the operand of a type conversion, the storage pool is
62591 that of the target access type of the conversion. If the call is
62592 itself defining the result of a function with an access result,
62593 this rule is applied recursively;
62594
62595 25.4/2
62596 * {AI95-00230-01AI95-00230-01} Otherwise, a default storage pool
62597 should be created at the point where the anonymous access type is
62598 elaborated; such a storage pool need not support deallocation of
62599 individual objects.
62600
62601 25.a.1/2
62602 Implementation Advice: Usually, a storage pool for an access
62603 discriminant or access parameter should be created at the
62604 point of an allocator, and be reclaimed when the designated
62605 object becomes inaccessible. For other anonymous access
62606 types, the pool should be created at the point where the type
62607 is elaborated and need not support deallocation of individual
62608 objects.
62609
62610 25.a/2
62611 Implementation Note: {AI95-00230-01AI95-00230-01} For access
62612 parameters and access discriminants, the "storage pool" for an
62613 anonymous access type would not normally exist as a separate
62614 entity. Instead, the designated object of the allocator would
62615 be allocated, in the case of an access parameter, as a local
62616 aliased variable at the call site, and in the case of an
62617 access discriminant, contiguous with the object containing the
62618 discriminant. This is similar to the way storage for
62619 aggregates is typically managed.
62620
62621 25.b/2
62622 {AI95-00230-01AI95-00230-01} For other sorts of anonymous
62623 access types, this implementation is not possible in general,
62624 as the accessibility of the anonymous access type is that of
62625 its declaration, while the allocator could be more nested. In
62626 this case, a "real" storage pool is required. Note, however,
62627 that this storage pool need not support (separate)
62628 deallocation, as it is not possible to instantiate
62629 Unchecked_Deallocation with an anonymous access type. (If
62630 deallocation is needed, the object should be allocated for a
62631 named access type and converted.) Thus, deallocation only
62632 need happen when the anonymous access type itself goes out of
62633 scope; this is similar to the case of an access-to-constant
62634 type.
62635
62636 NOTES
62637
62638 26
62639 27 A user-defined storage pool type can be obtained by extending
62640 the Root_Storage_Pool type, and overriding the primitive
62641 subprograms Allocate, Deallocate, and Storage_Size. A user-defined
62642 storage pool can then be obtained by declaring an object of the
62643 type extension. The user can override Initialize and Finalize if
62644 there is any need for nontrivial initialization and finalization
62645 for a user-defined pool type. For example, Finalize might reclaim
62646 blocks of storage that are allocated separately from the pool
62647 object itself.
62648
62649 27
62650 28 The writer of the user-defined allocation and deallocation
62651 procedures, and users of allocators for the associated access type,
62652 are responsible for dealing with any interactions with tasking. In
62653 particular:
62654
62655 28
62656 * If the allocators are used in different tasks, they require
62657 mutual exclusion.
62658
62659 29
62660 * If they are used inside protected objects, they cannot block.
62661
62662 30
62663 * If they are used by interrupt handlers (see *note C.3::,
62664 "*note C.3:: Interrupt Support"), the mutual exclusion
62665 mechanism has to work properly in that context.
62666
62667 31
62668 29 The primitives Allocate, Deallocate, and Storage_Size are
62669 declared as abstract (see *note 3.9.3::), and therefore they have
62670 to be overridden when a new (nonabstract) storage pool type is
62671 declared.
62672
62673 31.a
62674 Ramification: Note that the Storage_Pool attribute denotes an
62675 object, rather than a value, which is somewhat unusual for
62676 attributes.
62677
62678 31.b
62679 The calls to Allocate, Deallocate, and Storage_Size are
62680 dispatching calls -- this follows from the fact that the
62681 actual parameter for Pool is T'Storage_Pool, which is of type
62682 Root_Storage_Pool'Class. In many cases (including all cases
62683 in which Storage_Pool is not specified), the compiler can
62684 determine the tag statically. However, it is possible to
62685 construct cases where it cannot.
62686
62687 31.c
62688 All access types in the same derivation class share the same
62689 pool, whether implementation defined or user defined. This is
62690 necessary because we allow type conversions among them (even
62691 if they are pool-specific), and we want pool-specific access
62692 values to always designate an element of the right pool.
62693
62694 31.d
62695 Implementation Note: If an access type has a standard storage
62696 pool, then the implementation doesn't actually have to follow
62697 the pool interface described here, since this would be
62698 semantically invisible. For example, the allocator could
62699 conceivably be implemented with inline code.
62700
62701 _Examples_
62702
62703 32
62704 To associate an access type with a storage pool object, the user first
62705 declares a pool object of some type derived from Root_Storage_Pool.
62706 Then, the user defines its Storage_Pool attribute, as follows:
62707
62708 33
62709 Pool_Object : Some_Storage_Pool_Type;
62710
62711 34
62712 type T is access Designated;
62713 for T'Storage_Pool use Pool_Object;
62714
62715 35
62716 Another access type may be added to an existing storage pool, via:
62717
62718 36
62719 for T2'Storage_Pool use T'Storage_Pool;
62720
62721 37
62722 The semantics of this is implementation defined for a standard storage
62723 pool.
62724
62725 37.a
62726 Reason: For example, the implementation is allowed to choose a
62727 storage pool for T that takes advantage of the fact that T is
62728 of a certain size. If T2 is not of that size, then the above
62729 will probably not work.
62730
62731 38/3
62732 {AI05-0111-3AI05-0111-3} As usual, a derivative of Root_Storage_Pool may
62733 define additional operations. For example, consider the
62734 Mark_Release_Pool_Type defined in *note 13.11.6::, that has two
62735 additional operations, Mark and Release, the following is a possible
62736 use:
62737
62738 39/3
62739 {8652/00418652/0041} {AI95-00066-01AI95-00066-01} {AI05-0111-3AI05-0111-3} type Mark_Release_Pool_Type
62740 (Pool_Size : Storage_Elements.Storage_Count)
62741 is new Subpools.Root_Storage_Pool_With_Subpools with private;
62742 -- As defined in package MR_Pool, see *note 13.11.6::
62743
62744 40
62745 ...
62746
62747 41/3
62748 {AI05-0111-3AI05-0111-3} Our_Pool : Mark_Release_Pool_Type (Pool_Size => 2000);
62749 My_Mark : MR_Pool.Subpool_Handle; -- See *note 13.11.6::
62750
62751 42/3
62752 {AI05-0111-3AI05-0111-3} type Acc is access ...;
62753 for Acc'Storage_Pool use Our_Pool;
62754 ...
62755
62756 43/3
62757 {AI05-0111-3AI05-0111-3} My_Mark := Mark(Our_Pool);
62758 ... -- Allocate objects using "new (My_Mark) Designated(...)".
62759 Release(My_Mark); -- Finalize objects and reclaim storage.
62760
62761 _Extensions to Ada 83_
62762
62763 43.a
62764 User-defined storage pools are new to Ada 95.
62765
62766 _Wording Changes from Ada 83_
62767
62768 43.b/3
62769 {AI05-0005-1AI05-0005-1} {AI05-0190-1AI05-0190-1} Ada 83
62770 originally introduced the concept called a "collection," which
62771 is similar to what we call a storage pool. All access types
62772 in the same derivation class share the same collection. Ada
62773 95 introduces the storage pool, which is similar in that all
62774 access types in the same derivation class share the same
62775 storage pool, but other (unrelated) access types can also
62776 share the same storage pool, either by default, or as
62777 specified by the user. A collection is an amorphous grouping
62778 of objects (mainly used to describe finalization of access
62779 types); a storage pool is a more concrete concept -- hence the
62780 different name.
62781
62782 43.c
62783 RM83 states the erroneousness of reading or updating
62784 deallocated objects incorrectly by missing various cases.
62785
62786 _Incompatibilities With Ada 95_
62787
62788 43.d/2
62789 {AI95-00435-01AI95-00435-01} Amendment Correction: Storage
62790 pools (and Storage_Size) are not defined for
62791 access-to-subprogram types. The original Ada 95 wording
62792 defined the attributes, but said nothing about their values.
62793 If a program uses attributes Storage_Pool or Storage_Size on
62794 an access-to-subprogram type, it will need to be corrected for
62795 Ada 2005. That's a good thing, as such a use is a bug -- the
62796 concepts never were defined for such types.
62797
62798 _Extensions to Ada 95_
62799
62800 43.e/2
62801 {AI95-00161-01AI95-00161-01} Amendment Correction: Added
62802 pragma Preelaborable_Initialization to type Root_Storage_Pool,
62803 so that extensions of it can be used to declare
62804 default-initialized objects in preelaborated units.
62805
62806 _Wording Changes from Ada 95_
62807
62808 43.f/2
62809 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
62810 Added wording to specify that these are representation
62811 attributes.
62812
62813 43.g/2
62814 {AI95-00230-01AI95-00230-01} {AI95-00416-01AI95-00416-01}
62815 Added wording to clarify that an allocator for a coextension
62816 nested inside an outer allocator shares the pool with the
62817 outer allocator.
62818
62819 _Wording Changes from Ada 2005_
62820
62821 43.h/3
62822 {AI05-0051-1AI05-0051-1} Correction: Added the missing
62823 definition of the storage pool of an allocator for an
62824 anonymous access result type.
62825
62826 43.i/3
62827 {AI05-0107-1AI05-0107-1} Correction: Clarified when an
62828 implementation is allowed to call Allocate and Deallocate, and
62829 the requirements on such calls.
62830
62831 43.j/3
62832 {AI05-0111-3AI05-0111-3} Added wording to support subpools and
62833 refer to the subpool example, see *note 13.11.4::.
62834
62835 43.k/3
62836 {AI05-0116-1AI05-0116-1} Correction: Added wording to specify
62837 that the alignment for an allocator with a class-wide
62838 designated type comes from the specific type that is
62839 allocated.
62840
62841 43.l/3
62842 {AI05-0193-1AI05-0193-1} Added wording to allow larger
62843 alignments for calls to Allocate made by allocators, up to
62844 Max_Alignment_For_Allocation. This eases implementation in
62845 some cases.
62846
62847 * Menu:
62848
62849 * 13.11.1 :: Storage Allocation Attributes
62850 * 13.11.2 :: Unchecked Storage Deallocation
62851 * 13.11.3 :: Default Storage Pools
62852 * 13.11.4 :: Storage Subpools
62853 * 13.11.5 :: Subpool Reclamation
62854 * 13.11.6 :: Storage Subpool Example
62855
62856 \1f
62857 File: aarm2012.info, Node: 13.11.1, Next: 13.11.2, Up: 13.11
62858
62859 13.11.1 Storage Allocation Attributes
62860 -------------------------------------
62861
62862 1/3
62863 {AI05-0193-1AI05-0193-1} [The Max_Size_In_Storage_Elements and
62864 Max_Alignment_For_Allocation attributes may be useful in writing
62865 user-defined pool types.]
62866
62867 _Static Semantics_
62868
62869 2/3
62870 {AI05-0193-1AI05-0193-1} For every subtype S, the following attributes
62871 are defined:
62872
62873 3/3
62874 S'Max_Size_In_Storage_Elements
62875 {AI95-00256-01AI95-00256-01} {AI95-00416-01AI95-00416-01}
62876 {AI05-0193-1AI05-0193-1} Denotes the maximum value for
62877 Size_In_Storage_Elements that could be requested by the
62878 implementation via Allocate for an access type whose
62879 designated subtype is S. The value of this attribute is
62880 of type universal_integer.
62881
62882 3.a
62883 Ramification: If S is an unconstrained array subtype, or an
62884 unconstrained subtype with discriminants,
62885 S'Max_Size_In_Storage_Elements might be very large.
62886
62887 4/3
62888 S'Max_Alignment_For_Allocation
62889 {AI05-0193-1AI05-0193-1} Denotes the maximum value for
62890 Alignment that could be requested by the implementation
62891 via Allocate for an access type whose designated subtype
62892 is S. The value of this attribute is of type
62893 universal_integer.
62894
62895 5/3
62896 {AI05-0193-1AI05-0193-1} For a type with access discriminants, if the
62897 implementation allocates space for a coextension in the same pool as
62898 that of the object having the access discriminant, then these attributes
62899 account for any calls on Allocate that could be performed to provide
62900 space for such coextensions.
62901
62902 5.a/3
62903 Reason: {AI05-0193-1AI05-0193-1} The values of these
62904 attributes should reflect only the calls that might be made to
62905 the pool specified for an access type with designated type S.
62906 Thus, if the coextensions would normally be allocated from a
62907 different pool than the one used for the main object (that is,
62908 the Implementation Advice of *note 13.11:: for determining the
62909 pool of an anonymous access discriminant is not followed),
62910 then these attributes should not reflect any calls on Allocate
62911 used to allocate the coextensions.
62912
62913 5.b/3
62914 Ramification: {AI05-0193-1AI05-0193-1} Coextensions of
62915 coextensions of this type (and so on) are included in the
62916 values of these attributes if they are allocated from the same
62917 pool.
62918
62919 _Wording Changes from Ada 95_
62920
62921 5.c/2
62922 {AI95-00256-01AI95-00256-01} Corrected the wording so that a
62923 fortune-telling compiler that can see the future execution of
62924 the program is not required.
62925
62926 _Extensions to Ada 2005_
62927
62928 5.d/3
62929 {AI05-0193-1AI05-0193-1} The Max_Alignment_For_Allocation
62930 attribute is new.
62931
62932 \1f
62933 File: aarm2012.info, Node: 13.11.2, Next: 13.11.3, Prev: 13.11.1, Up: 13.11
62934
62935 13.11.2 Unchecked Storage Deallocation
62936 --------------------------------------
62937
62938 1
62939 [ Unchecked storage deallocation of an object designated by a value of
62940 an access type is achieved by a call to an instance of the generic
62941 procedure Unchecked_Deallocation.]
62942
62943 _Static Semantics_
62944
62945 2
62946 The following language-defined generic library procedure exists:
62947
62948 3/3
62949 {AI05-0229-1AI05-0229-1} generic
62950 type Object(<>) is limited private;
62951 type Name is access Object;
62952 procedure Ada.Unchecked_Deallocation(X : in out Name)
62953 with Convention => Intrinsic;
62954 pragma Preelaborate(Ada.Unchecked_Deallocation);
62955
62956 3.a/3
62957 Reason: {AI05-0229-1AI05-0229-1} The aspect Convention implies
62958 that the attribute Access is not allowed for instances of
62959 Unchecked_Deallocation.
62960
62961 _Legality Rules_
62962
62963 3.1/3
62964 {AI05-0157-1AI05-0157-1} A call on an instance of Unchecked_Deallocation
62965 is illegal if the actual access type of the instance is a type for which
62966 the Storage_Size has been specified by a static expression with value
62967 zero or is defined by the language to be zero. In addition to the
62968 places where Legality Rules normally apply (see *note 12.3::), this rule
62969 applies also in the private part of an instance of a generic unit.
62970
62971 3.b/3
62972 Discussion: This rule is the same as the rule for allocators.
62973 We could have left the last sentence out, as a call to
62974 Unchecked_Deallocation cannot occur in a specification as it
62975 is a procedure call, but we left it for consistency and to
62976 avoid future maintenance hazards.
62977
62978 _Dynamic Semantics_
62979
62980 4
62981 Given an instance of Unchecked_Deallocation declared as follows:
62982
62983 5
62984 procedure Free is
62985 new Ada.Unchecked_Deallocation(
62986 object_subtype_name, access_to_variable_subtype_name);
62987
62988 6
62989 Procedure Free has the following effect:
62990
62991 7
62992 1. After executing Free(X), the value of X is null.
62993
62994 8
62995 2. Free(X), when X is already equal to null, has no effect.
62996
62997 9/3
62998 3. {AI95-00416-01AI95-00416-01} {AI05-0107-1AI05-0107-1} Free(X),
62999 when X is not equal to null first performs finalization of the
63000 object designated by X (and any coextensions of the object -- see
63001 *note 3.10.2::), as described in *note 7.6.1::. It then
63002 deallocates the storage occupied by the object designated by X (and
63003 any coextensions). If the storage pool is a user-defined object,
63004 then the storage is deallocated by calling Deallocate as described
63005 in *note 13.11::. There is one exception: if the object being
63006 freed contains tasks, the object might not be deallocated.
63007
63008 9.a/3
63009 Ramification: {AI05-0107-1AI05-0107-1} Free calls only the
63010 specified Deallocate procedure to do deallocation.
63011
63012 10/2
63013 {AI95-00416-01AI95-00416-01} After Free(X), the object designated by X,
63014 and any subcomponents (and coextensions) thereof, no longer exist; their
63015 storage can be reused for other purposes.
63016
63017 _Bounded (Run-Time) Errors_
63018
63019 11
63020 It is a bounded error to free a discriminated, unterminated task object.
63021 The possible consequences are:
63022
63023 11.a
63024 Reason: This is an error because the task might refer to its
63025 discriminants, and the discriminants might be deallocated by
63026 freeing the task object.
63027
63028 12
63029 * No exception is raised.
63030
63031 13
63032 * Program_Error or Tasking_Error is raised at the point of the
63033 deallocation.
63034
63035 14
63036 * Program_Error or Tasking_Error is raised in the task the next time
63037 it references any of the discriminants.
63038
63039 14.a
63040 Implementation Note: This last case presumes an implementation
63041 where the task references its discriminants indirectly, and
63042 the pointer is nulled out when the task object is deallocated.
63043
63044 15
63045 In the first two cases, the storage for the discriminants (and for any
63046 enclosing object if it is designated by an access discriminant of the
63047 task) is not reclaimed prior to task termination.
63048
63049 15.a
63050 Ramification: The storage might never be reclaimed.
63051
63052 _Erroneous Execution_
63053
63054 16/3
63055 {AI05-0033-1AI05-0033-1} {AI05-0262-1AI05-0262-1} Evaluating a name that
63056 denotes a nonexistent object, or a protected subprogram or subprogram
63057 renaming whose associated object (if any) is nonexistent, is erroneous.
63058 The execution of a call to an instance of Unchecked_Deallocation is
63059 erroneous if the object was created other than by an allocator for an
63060 access type whose pool is Name'Storage_Pool.
63061
63062 16.a/3
63063 Reason: {AI05-0033-1AI05-0033-1} {AI05-0262-1AI05-0262-1} The
63064 part about a protected subprogram is intended to cover the
63065 case of an access-to-protected-subprogram where the associated
63066 object has been deallocated. The part about a subprogram
63067 renaming is intended to cover the case of a renaming of a
63068 prefixed view where the prefix object has been deallocated, or
63069 the case of a renaming of an entry or protected subprogram
63070 where the associated task or protected object has been
63071 deallocated.
63072
63073 16.b/3
63074 Ramification: {AI05-0157-1AI05-0157-1} This text does not
63075 cover the case of a name that contains a null access value, as
63076 null does not denote an object (rather than denoting a
63077 nonexistent object).
63078
63079 _Implementation Advice_
63080
63081 17
63082 For a standard storage pool, Free should actually reclaim the storage.
63083
63084 17.a.1/2
63085 Implementation Advice: For a standard storage pool, an
63086 instance of Unchecked_Deallocation should actually reclaim the
63087 storage.
63088
63089 17.a/2
63090 Ramification: {AI95-00114-01AI95-00114-01} This is not a
63091 testable property, since we do not know how much storage is
63092 used by a given pool element, nor whether fragmentation can
63093 occur.
63094
63095 17.1/3
63096 {AI05-0157-1AI05-0157-1} A call on an instance of Unchecked_Deallocation
63097 with a nonnull access value should raise Program_Error if the actual
63098 access type of the instance is a type for which the Storage_Size has
63099 been specified to be zero or is defined by the language to be zero.
63100
63101 17.a.1/3
63102 Implementation Advice: A call on an instance of
63103 Unchecked_Deallocation with a nonnull access value should
63104 raise Program_Error if the actual access type of the instance
63105 is a type for which the Storage_Size has been specified to be
63106 zero or is defined by the language to be zero.
63107
63108 17.b
63109 Discussion: If the call is not illegal (as in a generic body),
63110 we recommend that it raise Program_Error. Since the execution
63111 of this call is erroneous (any allocator from the pool will
63112 have raised Storage_Error, so the nonnull access value must
63113 have been allocated from a different pool or be a
63114 stack-allocated object), we can't require any behavior --
63115 anything at all would be a legitimate implementation.
63116
63117 NOTES
63118
63119 18
63120 30 The rules here that refer to Free apply to any instance of
63121 Unchecked_Deallocation.
63122
63123 19
63124 31 Unchecked_Deallocation cannot be instantiated for an
63125 access-to-constant type. This is implied by the rules of *note
63126 12.5.4::.
63127
63128 _Wording Changes from Ada 95_
63129
63130 19.a/2
63131 {AI95-00416-01AI95-00416-01} The rules for coextensions are
63132 clarified (mainly by adding that term). In theory, this
63133 reflects no change from Ada 95 (coextensions existed in Ada
63134 95, they just didn't have a name).
63135
63136 _Wording Changes from Ada 2005_
63137
63138 19.b/3
63139 {AI05-0033-1AI05-0033-1} Correction: Added a rule that using
63140 an access-to-protected-subprogram is erroneous if the
63141 associated object no longer exists. It is hard to imagine an
63142 alternative meaning here, and this has no effect on correct
63143 programs.
63144
63145 19.c/3
63146 {AI05-0107-1AI05-0107-1} Correction: Moved the requirements on
63147 an implementation-generated call to Deallocate to *note
63148 13.11::, in order to put all of the rules associated with
63149 implementation-generated calls to Allocate and Deallocate
63150 together.
63151
63152 19.d/3
63153 {AI05-0157-1AI05-0157-1} Correction: Added wording so that
63154 calling an instance of Unchecked_Deallocation is treated
63155 similarly to allocators for access types where allocators
63156 would be banned.
63157
63158 \1f
63159 File: aarm2012.info, Node: 13.11.3, Next: 13.11.4, Prev: 13.11.2, Up: 13.11
63160
63161 13.11.3 Default Storage Pools
63162 -----------------------------
63163
63164 1/3
63165 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
63166
63167 _Syntax_
63168
63169 2/3
63170 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} The form of a
63171 pragma Default_Storage_Pool is as follows:
63172
63173 3/3
63174 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} pragma
63175 Default_Storage_Pool (storage_pool_indicator);
63176
63177 3.1/3
63178 {AI05-0190-1AI05-0190-1} storage_pool_indicator ::= storage_pool_
63179 name | null
63180
63181 3.2/3
63182 {AI05-0190-1AI05-0190-1} A pragma Default_Storage_Pool is allowed
63183 immediately within the visible part of a package_specification,
63184 immediately within a declarative_part, or as a configuration
63185 pragma.
63186
63187 _Name Resolution Rules_
63188
63189 3.3/3
63190 {AI05-0190-1AI05-0190-1} The storage_pool_name is expected to be of type
63191 Root_Storage_Pool'Class.
63192
63193 _Legality Rules_
63194
63195 4/3
63196 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} The storage_pool_name
63197 shall denote a variable.
63198
63199 4.1/3
63200 {AI05-0190-1AI05-0190-1} If the pragma is used as a configuration
63201 pragma, the storage_pool_indicator shall be null, and it defines the
63202 default pool to be null within all applicable compilation units (see
63203 *note 10.1.5::), except within the immediate scope of another pragma
63204 Default_Storage_Pool. Otherwise, [the pragma occurs immediately within
63205 a sequence of declarations, and] it defines the default pool within the
63206 immediate scope of the pragma to be either null or the pool denoted by
63207 the storage_pool_name, except within the immediate scope of a later
63208 pragma Default_Storage_Pool. [Thus, an inner pragma overrides an outer
63209 one.]
63210
63211 4.2/3
63212 {AI05-0190-1AI05-0190-1} {AI05-0262-1AI05-0262-1} A pragma
63213 Default_Storage_Pool shall not be used as a configuration pragma that
63214 applies to a compilation unit that is within the immediate scope of
63215 another pragma Default_Storage_Pool.
63216
63217 4.a/3
63218 Reason: This is to prevent confusion in cases like this:
63219
63220 4.b/3
63221 package Parent is
63222 pragma Default_Storage_Pool(...);
63223 ...
63224 end Parent;
63225
63226 4.c/3
63227 pragma Default_Storage_Pool(...); -- Illegal!
63228 package Parent.Child is
63229 ...
63230 end Parent.Child;
63231
63232 4.d/3
63233 where the Default_Storage_Pool on Parent.Child would not (if
63234 it were legal) override the one in Parent.
63235
63236 _Static Semantics_
63237
63238 5/3
63239 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} The language-defined
63240 aspect Default_Storage_Pool may be specified for a generic instance; it
63241 defines the default pool for access types within an instance. The
63242 expected type for the Default_Storage_Pool aspect is
63243 Root_Storage_Pool'Class. The aspect_definition must be a name that
63244 denotes a variable. This aspect overrides any Default_Storage_Pool
63245 pragma that might apply to the generic unit; if the aspect is not
63246 specified, the default pool of the instance is that defined for the
63247 generic unit.
63248
63249 5.a/3
63250 Aspect Description for Default_Storage_Pool: Default storage
63251 pool for a generic instance.
63252
63253 6/3
63254 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} For nonderived access
63255 types declared in places where the default pool is defined by the pragma
63256 or aspect, their Storage_Pool or Storage_Size attribute is determined as
63257 follows, unless Storage_Pool or Storage_Size is specified for the type:
63258
63259 6.1/3
63260 * {AI05-0190-1AI05-0190-1} If the default pool is null, the
63261 Storage_Size attribute is defined by the language to be zero.
63262 [Therefore, an allocator for such a type is illegal.]
63263
63264 6.2/3
63265 * {AI05-0190-1AI05-0190-1} If the default pool is nonnull, the
63266 Storage_Pool attribute is that pool.
63267
63268 6.3/3
63269 {AI05-0190-1AI05-0190-1} [Otherwise, there is no default pool; the
63270 standard storage pool is used for the type as described in *note
63271 13.11::.]
63272
63273 6.a/3
63274 Ramification: {AI05-0190-1AI05-0190-1}
63275 {AI05-0229-1AI05-0229-1} Default_Storage_Pool is the only way
63276 to specify the storage pool for an anonymous access type.
63277
63278 6.b/3
63279 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} Note that
63280 coextensions should be allocated in the same pool (or on the
63281 stack) as the outer object (see *note 13.11::); the
63282 Storage_Pool of the access discriminant (and hence the
63283 Default_Storage_Pool) is supposed to be ignored for
63284 coextensions. This matches the required finalization point
63285 for coextensions.
63286
63287 6.b.1/3
63288 {AI05-0190-1AI05-0190-1} The default storage pool for an
63289 allocator that occurs within an instance of a generic is
63290 defined by the Default_Storage_Pool aspect of the
63291 instantiation (if specified), or by the Default_Storage_Pool
63292 pragma that applied to the generic; the Default_Storage_Pool
63293 pragma that applies to the instantiation is irrelevant.
63294
63295 6.b.2/3
63296 {AI05-0190-1AI05-0190-1} It is possible to specify the
63297 Default_Storage_Pool aspect for an instantiation such that
63298 allocations will fail. For example, the generic unit might be
63299 expecting a pool that supports certain sizes and alignments,
63300 and the one on the instance might be more restrictive. It is
63301 the programmer's responsibility to get this right.
63302
63303 6.b.3/3
63304 {AI05-0190-1AI05-0190-1} The semantics of the
63305 Default_Storage_Pool aspect are similar to passing a pool
63306 object as a generic formal, and putting pragma
63307 Default_Storage_Pool at the top of the generic's visible part,
63308 specifying that formal.
63309
63310 7/3
63311 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
63312
63313 _Implementation Permissions_
63314
63315 8/3
63316 {AI05-0190-1AI05-0190-1} {AI05-0229-1AI05-0229-1} An object created by
63317 an allocator that is passed as the actual parameter to an access
63318 parameter may be allocated on the stack, and automatically reclaimed,
63319 regardless of the default pool..
63320
63321 8.a/3
63322 Discussion: {AI05-0190-1AI05-0190-1} This matches the required
63323 finalization point for such an allocated object.
63324
63325 NOTES
63326
63327 9/3
63328 32 {AI05-0190-1AI05-0190-1} Default_Storage_Pool may be used with
63329 restrictions No_Coextensions and No_Access_Parameter_Allocators
63330 (see *note H.4::) to ensure that all allocators use the default
63331 pool.
63332
63333 _Wording Changes from Ada 83_
63334
63335 9.a/3
63336 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
63337
63338 _Incompatibilities With Ada 2005_
63339
63340 9.b/3
63341 {AI05-0229-1AI05-0229-1} Pragma Controlled has been dropped
63342 from Ada, as it has no effect in any known Ada implementations
63343 and it seems to promise capabilities not expected in Ada
63344 implementations. This is usually not an incompatibility, as
63345 the pragma merely becomes unrecognized (with a warning) and
63346 can be implemented as an implementation-defined pragma if
63347 desired. However, it is incompatible if it is (now)
63348 implemented as an implementation-defined pragma, someone used
63349 this pragma in a unit, and they also used restriction
63350 No_Implementation_Pragmas on that unit. In that case, the
63351 pragma would now violate the restriction; but use of this
63352 pragma (which does nothing) should be very rare, so this is
63353 not a significant issue.
63354
63355 _Extensions to Ada 2005_
63356
63357 9.c/3
63358 {AI05-0190-1AI05-0190-1} The pragma Default_Storage_Pool is
63359 new.
63360
63361 _Wording Changes from Ada 2005_
63362
63363 9.d/3
63364 {AI05-0229-1AI05-0229-1} The entire discussion of garbage
63365 collection (and especially that of controlled objects) is
63366 deleted. Ada 2012 provides subpools (see *note 13.11.4::) for
63367 storage management of objects, including controlled objects, a
63368 mechanism which is much more predictable than garbage
63369 collection. Note that no version of Ada allows early
63370 finalization of controlled objects (other than via the use of
63371 Unchecked_Deallocation or Unchecked_Deallocate_Subpool), so
63372 that garbage collection of such objects would be ineffective
63373 in the standard mode anyway.
63374
63375 \1f
63376 File: aarm2012.info, Node: 13.11.4, Next: 13.11.5, Prev: 13.11.3, Up: 13.11
63377
63378 13.11.4 Storage Subpools
63379 ------------------------
63380
63381 1/3
63382 {AI05-0111-3AI05-0111-3} This subclause defines a package to support the
63383 partitioning of a storage pool into subpools. A subpool may be
63384 specified as the default to be used for allocation from the associated
63385 storage pool, or a particular subpool may be specified as part of an
63386 allocator (see *note 4.8::).
63387
63388 _Static Semantics_
63389
63390 2/3
63391 {AI05-0111-3AI05-0111-3} The following language-defined library package
63392 exists:
63393
63394 3/3
63395 package System.Storage_Pools.Subpools is
63396 pragma Preelaborate (Subpools);
63397
63398 4/3
63399 type Root_Storage_Pool_With_Subpools is
63400 abstract new Root_Storage_Pool with private;
63401
63402 5/3
63403 type Root_Subpool is abstract tagged limited private;
63404
63405 6/3
63406 type Subpool_Handle is access all Root_Subpool'Class;
63407 for Subpool_Handle'Storage_Size use 0;
63408
63409 7/3
63410 function Create_Subpool (Pool : in out Root_Storage_Pool_With_Subpools)
63411 return not null Subpool_Handle is abstract;
63412
63413 8/3
63414 {AI05-0252-1AI05-0252-1} -- The following operations are intended for pool implementers:
63415
63416 9/3
63417 function Pool_of_Subpool (Subpool : not null Subpool_Handle)
63418 return access Root_Storage_Pool_With_Subpools'Class;
63419
63420 10/3
63421 procedure Set_Pool_of_Subpool (
63422 Subpool : in not null Subpool_Handle;
63423 To : in out Root_Storage_Pool_With_Subpools'Class);
63424
63425 11/3
63426 procedure Allocate_From_Subpool (
63427 Pool : in out Root_Storage_Pool_With_Subpools;
63428 Storage_Address : out Address;
63429 Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
63430 Alignment : in Storage_Elements.Storage_Count;
63431 Subpool : in not null Subpool_Handle) is abstract
63432 with Pre'Class => Pool_of_Subpool(Subpool) = Pool'Access;
63433
63434 12/3
63435 procedure Deallocate_Subpool (
63436 Pool : in out Root_Storage_Pool_With_Subpools;
63437 Subpool : in out Subpool_Handle) is abstract
63438 with Pre'Class => Pool_of_Subpool(Subpool) = Pool'Access;
63439
63440 13/3
63441 {AI05-0298-1AI05-0298-1} function Default_Subpool_for_Pool (
63442 Pool : in out Root_Storage_Pool_With_Subpools)
63443 return not null Subpool_Handle;
63444
63445 14/3
63446 overriding
63447 procedure Allocate (
63448 Pool : in out Root_Storage_Pool_With_Subpools;
63449 Storage_Address : out Address;
63450 Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
63451 Alignment : in Storage_Elements.Storage_Count);
63452
63453 15/3
63454 overriding
63455 procedure Deallocate (
63456 Pool : in out Root_Storage_Pool_With_Subpools;
63457 Storage_Address : in Address;
63458 Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
63459 Alignment : in Storage_Elements.Storage_Count) is null;
63460
63461 16/3
63462 {AI05-0298-1AI05-0298-1} overriding
63463 function Storage_Size (Pool : Root_Storage_Pool_With_Subpools)
63464 return Storage_Elements.Storage_Count
63465 is (Storage_Elements.Storage_Count'Last);
63466
63467 17/3
63468 private
63469 ... -- not specified by the language
63470 end System.Storage_Pools.Subpools;
63471
63472 18/3
63473 {AI05-0111-3AI05-0111-3} A subpool is a separately reclaimable portion
63474 of a storage pool, identified by an object of type Subpool_Handle (a
63475 subpool handle). A subpool handle also identifies the enclosing storage
63476 pool, a storage pool that supports subpools, which is a storage pool
63477 whose type is descended from Root_Storage_Pool_With_Subpools. A subpool
63478 is created by calling Create_Subpool or a similar constructor; the
63479 constructor returns the subpool handle.
63480
63481 19/3
63482 {AI05-0111-3AI05-0111-3} {AI05-0269-1AI05-0269-1} A subpool object is an
63483 object of a type descended from Root_Subpool. [Typically, subpool
63484 objects are managed by the containing storage pool; only the handles
63485 need be exposed to clients of the storage pool. Subpool objects are
63486 designated by subpool handles, and are the run-time representation of a
63487 subpool.]
63488
63489 19.a/3
63490 Proof: We know that subpool handles designate subpool objects
63491 because the declaration of Subpool_Handle says so.
63492
63493 20/3
63494 {AI05-0111-3AI05-0111-3} Each subpool belongs to a single storage pool
63495 [(which will always be a pool that supports subpools)]. An access to
63496 the pool that a subpool belongs to can be obtained by calling
63497 Pool_of_Subpool with the subpool handle. Set_Pool_of_Subpool causes the
63498 subpool of the subpool handle to belong to the given pool[; this is
63499 intended to be called from subpool constructors like Create_Subpool.]
63500 Set_Pool_of_Subpool propagates Program_Error if the subpool already
63501 belongs to a pool.
63502
63503 20.a/3
63504 Discussion: Pool_of_Subpool and Set_Pool_of_Subpool are
63505 provided by the Ada implementation and typically will not be
63506 overridden by the pool implementer.
63507
63508 21/3
63509 {AI05-0111-3AI05-0111-3} When an allocator for a type whose storage pool
63510 supports subpools is evaluated, a call is made on Allocate_From_Subpool
63511 passing in a Subpool_Handle, in addition to the parameters as defined
63512 for calls on Allocate (see *note 13.11::). The subpool designated by
63513 the subpool_handle_name is used, if specified in an allocator.
63514 Otherwise, Default_Subpool_for_Pool of the Pool is used to provide a
63515 subpool handle. All requirements on the Allocate procedure also apply
63516 to Allocate_from_Subpool.
63517
63518 21.a/3
63519 Discussion: Deallocate_Subpool is expected to do whatever is
63520 needed to deallocate all of the objects contained in the
63521 subpool; it is called from Unchecked_Deallocate_Subpool (see
63522 *note 13.11.5::).
63523
63524 21.b/3
63525 Typically, the pool implementer will not override Allocate.
63526 In the canonical definition of the language, it will never be
63527 called for a pool that supports subpools (there is an
63528 Implementation Permission below that allows it to be called in
63529 certain rare cases).
63530
63531 _Legality Rules_
63532
63533 22/3
63534 {AI05-0111-3AI05-0111-3} If a storage pool that supports subpools is
63535 specified as the Storage_Pool for an access type, the access type is
63536 called a subpool access type. A subpool access type shall be a
63537 pool-specific access type.
63538
63539 23/3
63540 {AI05-0111-3AI05-0111-3} {AI05-0252-1AI05-0252-1} The accessibility
63541 level of a subpool access type shall not be statically deeper than that
63542 of the storage pool object. If the specified storage pool object is a
63543 storage pool that supports subpools, then the name that denotes the
63544 object shall not denote part of a formal parameter, nor shall it denote
63545 part of a dereference of a value of a non-library-level general access
63546 type. In addition to the places where Legality Rules normally apply
63547 (see *note 12.3::), these rules also apply in the private part of an
63548 instance of a generic unit.
63549
63550 _Dynamic Semantics_
63551
63552 24/3
63553 {AI05-0111-3AI05-0111-3} {AI05-0252-1AI05-0252-1} When an access type
63554 with a specified storage pool is frozen (see *note 13.14::), if the tag
63555 of the storage pool object identifies a storage pool that supports
63556 subpools, the following checks are made:
63557
63558 25/3
63559 * the name used to specify the storage pool object does not denote
63560 part of a formal parameter nor part of a dereference of a value of
63561 a non-library-level general access type; and
63562
63563 26/3
63564 * the accessibility level of the access type is not deeper than that
63565 of the storage pool object.
63566
63567 27/3
63568 {AI05-0252-1AI05-0252-1} Program_Error is raised if either of these
63569 checks fail.
63570
63571 27.a/3
63572 Reason: This check (and its static counterpart) ensures that
63573 the type of the allocated objects exists at least as long as
63574 the storage pool object, so that the subpools are finalized
63575 (which finalizes any remaining allocated objects) before the
63576 type of the objects ceases to exist. The access type itself
63577 (and the associated collection) will cease to exist before the
63578 storage pool ceases to exist.
63579
63580 27.b/3
63581 We also disallow the use of formal parameters and dereferences
63582 of non-library-level general access types when specifying a
63583 storage pool object if it supports subpools, because the
63584 "apparent" accessibility level is potentially deeper than that
63585 of the underlying object. Neither of these cases is very
63586 likely to occur in practice.
63587
63588 28/3
63589 {AI05-0111-3AI05-0111-3} A call to Subpools.Allocate(P, Addr, Size,
63590 Align) does the following:
63591
63592 29/3
63593 Allocate_From_Subpool
63594 (Root_Storage_Pool_With_Subpools'Class(P),
63595 Addr, Size, Align,
63596 Subpool => Default_Subpool_for_Pool
63597 (Root_Storage_Pool_With_Subpools'Class(P)));
63598
63599 30/3
63600 {AI05-0111-3AI05-0111-3} An allocator that allocates in a subpool raises
63601 Program_Error if the allocated object has task parts.
63602
63603 30.a/3
63604 Reason: This is to ease implementation. We envision relaxing
63605 this restriction in a future version of Ada, once
63606 implementation experience has been gained. At this time, we
63607 are unable to come up with a set of rules for task termination
63608 that is both useful, and surely feasible to implement.
63609
63610 31/3
63611 {AI05-0111-3AI05-0111-3} Unless overridden, Default_Subpool_for_Pool
63612 propagates Program_Error.
63613
63614 _Implementation Permissions_
63615
63616 32/3
63617 {AI05-0111-3AI05-0111-3} When an allocator for a type whose storage pool
63618 is of type Root_Storage_Pool'Class is evaluated, but supports subpools,
63619 the implementation may call Allocate rather than Allocate_From_Subpool.
63620 [This will have the same effect, so long as Allocate has not been
63621 overridden.]
63622
63623 32.a/3
63624 Reason: This ensures either of two implementation models are
63625 possible for an allocator with no subpool_specification. Note
63626 that the "supports subpools" property is not known at compile
63627 time for a pool of the class-wide type.
63628
63629 32.b/3
63630 * The implementation can dispatch to
63631 Storage_Pools.Allocate. If the pool supports subpools,
63632 this will call Allocate_From_Subpool with the default
63633 subpool so long as Allocate has not been overridden.
63634
63635 32.c/3
63636 * The implementation can declare Allocate_From_Subpool as a
63637 primitive of Root_Storage_Pool in the private part of
63638 Storage_Pools. This means that the Allocate_From_Subpool
63639 for Root_Storage_Pool_With_Subpools overrides that
63640 private one. The implementation can thus call the
63641 private one, which will call Allocate for
63642 non-subpool-supporting pools. The effect of this
63643 implementation does not change if Allocate is overridden
63644 for a pool that supports subpools.
63645
63646 NOTES
63647
63648 33/3
63649 33 {AI05-0111-3AI05-0111-3} A user-defined storage pool type that
63650 supports subpools can be implemented by extending the
63651 Root_Storage_Pool_With_Subpools type, and overriding the primitive
63652 subprograms Create_Subpool, Allocate_From_Subpool, and
63653 Deallocate_Subpool. Create_Subpool should call Set_Pool_Of_Subpool
63654 before returning the subpool handle. To make use of such a pool, a
63655 user would declare an object of the type extension, use it to
63656 define the Storage_Pool attribute of one or more access types, and
63657 then call Create_Subpool to obtain subpool handles associated with
63658 the pool.
63659
63660 34/3
63661 34 {AI05-0111-3AI05-0111-3} A user-defined storage pool type that
63662 supports subpools may define additional subpool constructors
63663 similar to Create_Subpool (these typically will have additional
63664 parameters).
63665
63666 35/3
63667 35 {AI05-0111-3AI05-0111-3} The pool implementor should override
63668 Default_Subpool_For_Pool if the pool is to support a default
63669 subpool for the pool. The implementor can override Deallocate if
63670 individual object reclamation is to be supported, and can override
63671 Storage_Size if there is some limit on the total size of the
63672 storage pool. The implementor can override Initialize and Finalize
63673 if there is any need for nontrivial initialization and finalization
63674 for the pool as a whole. For example, Finalize might reclaim
63675 blocks of storage that are allocated over and above the space
63676 occupied by the pool object itself. The pool implementor may
63677 extend the Root_Subpool type as necessary to carry additional
63678 information with each subpool provided by Create_Subpool.
63679
63680 _Extensions to Ada 2005_
63681
63682 35.a/3
63683 {AI05-0111-3AI05-0111-3} {AI05-0252-1AI05-0252-1} Subpools and
63684 the package System.Storage_Pools.Subpools are new.
63685
63686 \1f
63687 File: aarm2012.info, Node: 13.11.5, Next: 13.11.6, Prev: 13.11.4, Up: 13.11
63688
63689 13.11.5 Subpool Reclamation
63690 ---------------------------
63691
63692 1/3
63693 {AI05-0111-3AI05-0111-3} A subpool may be explicitly deallocated using
63694 Unchecked_Deallocate_Subpool.
63695
63696 _Static Semantics_
63697
63698 2/3
63699 {AI05-0111-3AI05-0111-3} The following language-defined library
63700 procedure exists:
63701
63702 3/3
63703 with System.Storage_Pools.Subpools;
63704 procedure Ada.Unchecked_Deallocate_Subpool
63705 (Subpool : in out System.Storage_Pools.Subpools.Subpool_Handle);
63706
63707 4/3
63708 {AI05-0111-3AI05-0111-3} If Subpool is null, a call on
63709 Unchecked_Deallocate_Subpool has no effect. Otherwise, the subpool is
63710 finalized, and Subpool is set to null.
63711
63712 5/3
63713 {AI05-0111-3AI05-0111-3} Finalization of a subpool has the following
63714 effects:
63715
63716 6/3
63717 * The subpool no longer belongs to any pool;
63718
63719 7/3
63720 * Any of the objects allocated from the subpool that still exist are
63721 finalized in an arbitrary order;
63722
63723 8/3
63724 * The following [dispatching] call is then made:
63725
63726 9/3
63727 Deallocate_Subpool(Pool_of_Subpool(Subpool).all, Subpool);
63728
63729 10/3
63730 {AI05-0111-3AI05-0111-3} Finalization of a
63731 Root_Storage_Pool_With_Subpools object finalizes all subpools that
63732 belong to that pool that have not yet been finalized.
63733
63734 10.a/3
63735 Discussion: There is no need to call Unchecked_Deallocation on
63736 an object allocated in a subpool. Such objects are
63737 deallocated all at once, when Unchecked_Deallocate_Subpool is
63738 called.
63739
63740 10.b/3
63741 If Unchecked_Deallocation is called, the object is finalized,
63742 and then Deallocate is called on the Pool, which typically
63743 will do nothing. If it wants to free memory, it will need
63744 some way to get from the address of the object to the subpool.
63745
63746 10.c/3
63747 There is no Deallocate_From_Subpool. There is no efficient
63748 way for the implementation to determine the subpool for an
63749 arbitrary object, and if the pool implementer can determinate
63750 that, they can use that as part of the implementation of
63751 Deallocate.
63752
63753 10.d/3
63754 If Unchecked_Deallocation is not called (the usual case), the
63755 object will be finalized when Unchecked_Deallocate_Subpool is
63756 called.
63757
63758 10.e/3
63759 If that's never called, then the object will be finalized when
63760 the Pool_With_Subpools is finalized (by permission -- it might
63761 happen when the collection of the access type is finalized).
63762
63763 _Extensions to Ada 2005_
63764
63765 10.f/3
63766 {AI05-0111-3AI05-0111-3} Unchecked_Deallocate_Subpool is new.
63767
63768 \1f
63769 File: aarm2012.info, Node: 13.11.6, Prev: 13.11.5, Up: 13.11
63770
63771 13.11.6 Storage Subpool Example
63772 -------------------------------
63773
63774 _Examples_
63775
63776 1/3
63777 {AI05-0111-3AI05-0111-3} The following example is a simple but complete
63778 implementation of the classic Mark/Release pool using subpools:
63779
63780 2/3
63781 with System.Storage_Pools.Subpools;
63782 with System.Storage_Elements;
63783 with Ada.Unchecked_Deallocate_Subpool;
63784 package MR_Pool is
63785
63786 3/3
63787 use System.Storage_Pools;
63788 -- For uses of Subpools.
63789 use System.Storage_Elements;
63790 -- For uses of Storage_Count and Storage_Array.
63791
63792 4/3
63793 -- Mark and Release work in a stack fashion, and allocations are not allowed
63794 -- from a subpool other than the one at the top of the stack. This is also
63795 -- the default pool.
63796
63797 5/3
63798 subtype Subpool_Handle is Subpools.Subpool_Handle;
63799
63800 6/3
63801 type Mark_Release_Pool_Type (Pool_Size : Storage_Count) is new
63802 Subpools.Root_Storage_Pool_With_Subpools with private;
63803
63804 7/3
63805 function Mark (Pool : in out Mark_Release_Pool_Type)
63806 return not null Subpool_Handle;
63807
63808 8/3
63809 procedure Release (Subpool : in out Subpool_Handle) renames
63810 Ada.Unchecked_Deallocate_Subpool;
63811
63812 9/3
63813 private
63814
63815 10/3
63816 type MR_Subpool is new Subpools.Root_Subpool with record
63817 Start : Storage_Count;
63818 end record;
63819 subtype Subpool_Indexes is Positive range 1 .. 10;
63820 type Subpool_Array is array (Subpool_Indexes) of aliased MR_Subpool;
63821
63822 11/3
63823 {AI05-0298-1AI05-0298-1} type Mark_Release_Pool_Type (Pool_Size : Storage_Count) is new
63824 Subpools.Root_Storage_Pool_With_Subpools with record
63825 Storage : Storage_Array (0 .. Pool_Size-1);
63826 Next_Allocation : Storage_Count := 0;
63827 Markers : Subpool_Array;
63828 Current_Pool : Subpool_Indexes := 1;
63829 end record;
63830
63831 12/3
63832 {AI05-0298-1AI05-0298-1} overriding
63833 function Create_Subpool (Pool : in out Mark_Release_Pool_Type)
63834 return not null Subpool_Handle;
63835
63836 13/3
63837 function Mark (Pool : in out Mark_Release_Pool_Type)
63838 return not null Subpool_Handle renames Create_Subpool;
63839
63840 14/3
63841 overriding
63842 procedure Allocate_From_Subpool (
63843 Pool : in out Mark_Release_Pool_Type;
63844 Storage_Address : out System.Address;
63845 Size_In_Storage_Elements : in Storage_Count;
63846 Alignment : in Storage_Count;
63847 Subpool : not null Subpool_Handle);
63848
63849 15/3
63850 overriding
63851 procedure Deallocate_Subpool (
63852 Pool : in out Mark_Release_Pool_Type;
63853 Subpool : in out Subpool_Handle);
63854
63855 16/3
63856 {AI05-0298-1AI05-0298-1} overriding
63857 function Default_Subpool_for_Pool (Pool : in out Mark_Release_Pool_Type)
63858 return not null Subpool_Handle;
63859
63860 17/3
63861 overriding
63862 procedure Initialize (Pool : in out Mark_Release_Pool_Type);
63863
63864 18/3
63865 -- We don't need Finalize.
63866
63867 19/3
63868 end MR_Pool;
63869
63870 20/3
63871 package body MR_Pool is
63872
63873 21/3
63874 {AI05-0298-1AI05-0298-1} use type Subpool_Handle;
63875
63876 22/3
63877 {AI05-0298-1AI05-0298-1} procedure Initialize (Pool : in out Mark_Release_Pool_Type) is
63878 -- Initialize the first default subpool.
63879 begin
63880 Pool.Markers(1).Start := 1;
63881 Subpools.Set_Pool_of_Subpool
63882 (Pool.Markers(1)'Unchecked_Access, Pool);
63883 end Initialize;
63884
63885 23/3
63886 function Create_Subpool (Pool : in out Mark_Release_Pool_Type)
63887 return not null Subpool_Handle is
63888 -- Mark the current allocation location.
63889 begin
63890 if Pool.Current_Pool = Subpool_Indexes'Last then
63891 raise Storage_Error; -- No more subpools.
63892 end if;
63893 Pool.Current_Pool := Pool.Current_Pool + 1; -- Move to the next subpool
63894
63895 24/3
63896 {AI05-0298-1AI05-0298-1} return Result : constant not null Subpool_Handle :=
63897 Pool.Markers(Pool.Current_Pool)'Unchecked_Access
63898 do
63899 Pool.Markers(Pool.Current_Pool).Start := Pool.Next_Allocation;
63900 Subpools.Set_Pool_of_Subpool (Result, Pool);
63901 end return;
63902 end Create_Subpool;
63903
63904 25/3
63905 {AI05-0298-1AI05-0298-1} procedure Deallocate_Subpool (
63906 Pool : in out Mark_Release_Pool_Type;
63907 Subpool : in out Subpool_Handle) is
63908 begin
63909 if Subpool /= Pool.Markers(Pool.Current_Pool)'Unchecked_Access then
63910 raise Program_Error; -- Only the last marked subpool can be released.
63911 end if;
63912 if Pool.Current_Pool /= 1 then
63913 Pool.Next_Allocation := Pool.Markers(Pool.Current_Pool).Start;
63914 Pool.Current_Pool := Pool.Current_Pool - 1; -- Move to the previous subpool
63915 else -- Reinitialize the default subpool:
63916 Pool.Next_Allocation := 1;
63917 Subpools.Set_Pool_of_Subpool
63918 (Pool.Markers(1)'Unchecked_Access, Pool);
63919 end if;
63920 end Deallocate_Subpool;
63921
63922 26/3
63923 {AI05-0298-1AI05-0298-1} function Default_Subpool_for_Pool (Pool : in out Mark_Release_Pool_Type)
63924 return not null Subpool_Handle is
63925 begin
63926 return Pool.Markers(Pool.Current_Pool)'Unchecked_Access;
63927 end Default_Subpool_for_Pool;
63928
63929 27/3
63930 procedure Allocate_From_Subpool (
63931 Pool : in out Mark_Release_Pool_Type;
63932 Storage_Address : out System.Address;
63933 Size_In_Storage_Elements : in Storage_Count;
63934 Alignment : in Storage_Count;
63935 Subpool : not null Subpool_Handle) is
63936 begin
63937 if Subpool /= Pool.Markers(Pool.Current_Pool)'Unchecked_Access then
63938 raise Program_Error; -- Only the last marked subpool can be used for allocations.
63939 end if;
63940
63941 28/3
63942 -- Correct the alignment if necessary:
63943 Pool.Next_Allocation := Pool.Next_Allocation +
63944 ((-Pool.Next_Allocation) mod Alignment);
63945 if Pool.Next_Allocation + Size_In_Storage_Elements >
63946 Pool.Pool_Size then
63947 raise Storage_Error; -- Out of space.
63948 end if;
63949 Storage_Address := Pool.Storage (Pool.Next_Allocation)'Address;
63950 Pool.Next_Allocation :=
63951 Pool.Next_Allocation + Size_In_Storage_Elements;
63952 end Allocate_From_Subpool;
63953
63954 29/3
63955 end MR_Pool;
63956
63957 _Wording Changes from Ada 2005_
63958
63959 29.a/3
63960 {AI05-0111-3AI05-0111-3} This example of subpools is new.
63961
63962 \1f
63963 File: aarm2012.info, Node: 13.12, Next: 13.13, Prev: 13.11, Up: 13
63964
63965 13.12 Pragma Restrictions and Pragma Profile
63966 ============================================
63967
63968 1/3
63969 {AI05-0246-1AI05-0246-1} [A pragma Restrictions expresses the user's
63970 intent to abide by certain restrictions. A pragma Profile expresses the
63971 user's intent to abide by a set of Restrictions or other specified
63972 run-time policies. These may facilitate the construction of simpler
63973 run-time environments.]
63974
63975 _Syntax_
63976
63977 2
63978 The form of a pragma Restrictions is as follows:
63979
63980 3
63981 pragma Restrictions(restriction{, restriction});
63982
63983 4/2
63984 {AI95-00381-01AI95-00381-01} restriction ::= restriction_identifier
63985 | restriction_parameter_identifier =>
63986 restriction_parameter_argument
63987
63988 4.1/2
63989 {AI95-00381-01AI95-00381-01} restriction_parameter_argument ::=
63990 name | expression
63991
63992 _Name Resolution Rules_
63993
63994 5
63995 Unless otherwise specified for a particular restriction, the expression
63996 is expected to be of any integer type.
63997
63998 _Legality Rules_
63999
64000 6
64001 Unless otherwise specified for a particular restriction, the expression
64002 shall be static, and its value shall be nonnegative.
64003
64004 7.a/3
64005 This paragraph was deleted.
64006
64007 Paragraph 7 was deleted.
64008
64009 _Post-Compilation Rules_
64010
64011 8/3
64012 {AI05-0013-1AI05-0013-1} A pragma Restrictions is a configuration
64013 pragma. If a pragma Restrictions applies to any compilation unit
64014 included in the partition, this may impose either (or both) of two kinds
64015 of requirements, as specified for the particular restriction:
64016
64017 8.1/3
64018 * {AI05-0013-1AI05-0013-1} A restriction may impose requirements on
64019 some or all of the units comprising the partition. Unless
64020 otherwise specified for a particular restriction, such a
64021 requirement applies to all of the units comprising the partition
64022 and is enforced via a post-compilation check.
64023
64024 8.2/3
64025 * {AI05-0013-1AI05-0013-1} A restriction may impose requirements on
64026 the run-time behavior of the program, as indicated by the
64027 specification of run-time behavior associated with a violation of
64028 the requirement.
64029
64030 8.a.1/3
64031 Ramification: In this latter case, there is no
64032 post-compilation check needed for the requirement.
64033
64034 8.3/1
64035 {8652/00428652/0042} {AI95-00130-01AI95-00130-01} For the purpose of
64036 checking whether a partition contains constructs that violate any
64037 restriction (unless specified otherwise for a particular restriction):
64038
64039 8.4/1
64040 * {8652/00428652/0042} {AI95-00130-01AI95-00130-01} Generic instances
64041 are logically expanded at the point of instantiation;
64042
64043 8.5/1
64044 * {8652/00428652/0042} {AI95-00130-01AI95-00130-01} If an object of a
64045 type is declared or allocated and not explicitly initialized, then
64046 all expressions appearing in the definition for the type and any of
64047 its ancestors are presumed to be used;
64048
64049 8.6/1
64050 * {8652/00428652/0042} {AI95-00130-01AI95-00130-01} A
64051 default_expression for a formal parameter or a generic formal
64052 object is considered to be used if and only if the corresponding
64053 actual parameter is not provided in a given call or instantiation.
64054
64055 _Implementation Permissions_
64056
64057 8.7/3
64058 {AI05-0269-1AI05-0269-1} An implementation may provide
64059 implementation-defined restrictions; the identifier for an
64060 implementation-defined restriction shall differ from those of the
64061 language-defined restrictions.
64062
64063 8.a.2/3
64064 Implementation defined: Implementation-defined restrictions
64065 allowed in a pragma Restrictions.
64066
64067 9
64068 An implementation may place limitations on the values of the expression
64069 that are supported, and limitations on the supported combinations of
64070 restrictions. The consequences of violating such limitations are
64071 implementation defined.
64072
64073 9.a
64074 Implementation defined: The consequences of violating
64075 limitations on Restrictions pragmas.
64076
64077 9.b
64078 Ramification: Such limitations may be enforced at compile time
64079 or at run time. Alternatively, the implementation is allowed
64080 to declare violations of the restrictions to be erroneous, and
64081 not enforce them at all.
64082
64083 9.1/1
64084 {8652/00428652/0042} {AI95-00130-01AI95-00130-01} An implementation is
64085 permitted to omit restriction checks for code that is recognized at
64086 compile time to be unreachable and for which no code is generated.
64087
64088 9.2/1
64089 {8652/00438652/0043} {AI95-00190-01AI95-00190-01} Whenever enforcement
64090 of a restriction is not required prior to execution, an implementation
64091 may nevertheless enforce the restriction prior to execution of a
64092 partition to which the restriction applies, provided that every
64093 execution of the partition would violate the restriction.
64094
64095 _Syntax_
64096
64097 10/3
64098 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The form of a
64099 pragma Profile is as follows:
64100
64101 11/3
64102 pragma Profile (profile_identifier {, profile_
64103 pragma_argument_association});
64104
64105 _Legality Rules_
64106
64107 12/3
64108 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The
64109 profile_identifier shall be the name of a usage profile. The semantics
64110 of any profile_pragma_argument_association (*note 2.8: S0020.)s are
64111 defined by the usage profile specified by the profile_identifier.
64112
64113 _Static Semantics_
64114
64115 13/3
64116 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} A profile is
64117 equivalent to the set of configuration pragmas that is defined for each
64118 usage profile.
64119
64120 _Post-Compilation Rules_
64121
64122 14/3
64123 {AI95-00249-01AI95-00249-01} A pragma Profile is a configuration pragma.
64124 There may be more than one pragma Profile for a partition.
64125
64126 _Implementation Permissions_
64127
64128 15/3
64129 {AI05-0269-1AI05-0269-1} An implementation may provide
64130 implementation-defined usage profiles; the identifier for an
64131 implementation-defined usage profile shall differ from those of the
64132 language-defined usage profiles.
64133
64134 15.a.1/3
64135 Implementation defined: Implementation-defined usage profiles
64136 allowed in a pragma Profile.
64137
64138 NOTES
64139
64140 16/2
64141 36 {AI95-00347-01AI95-00347-01} Restrictions intended to
64142 facilitate the construction of efficient tasking run-time systems
64143 are defined in *note D.7::. Restrictions intended for use when
64144 constructing high integrity systems are defined in *note H.4::.
64145
64146 17
64147 37 An implementation has to enforce the restrictions in cases
64148 where enforcement is required, even if it chooses not to take
64149 advantage of the restrictions in terms of efficiency.
64150
64151 17.a
64152 Discussion: It is not the intent that an implementation will
64153 support a different run-time system for every possible
64154 combination of restrictions. An implementation might support
64155 only two run-time systems, and document a set of restrictions
64156 that is sufficient to allow use of the more efficient and safe
64157 one.
64158
64159 _Extensions to Ada 83_
64160
64161 17.b
64162 Pragma Restrictions is new to Ada 95.
64163
64164 _Extensions to Ada 95_
64165
64166 17.c/3
64167 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} Pragma
64168 Profile is new; it was moved here by Ada 2012 and renamed to a
64169 "usage profile" but was otherwise unchanged.
64170
64171 _Wording Changes from Ada 95_
64172
64173 17.d/2
64174 {8652/00428652/0042} {AI95-00130-01AI95-00130-01} Corrigendum:
64175 Corrected the wording so that restrictions are checked inside
64176 of generic instantiations and in default expressions. Since
64177 not making these checks would violate the purpose of
64178 restrictions, we are not documenting this as an
64179 incompatibility.
64180
64181 17.e/2
64182 {8652/00438652/0043} {AI95-00190-01AI95-00190-01} Corrigendum:
64183 Added a permission that restrictions can be enforced at
64184 compile-time. While this is technically incompatible,
64185 documenting it as such would be unnecessarily alarming - there
64186 should not be any programs depending on the runtime failure of
64187 restrictions.
64188
64189 17.f/2
64190 {AI95-00381-01AI95-00381-01} The syntax of a
64191 restriction_parameter_argument has been defined to better
64192 support restriction No_Dependence (see *note 13.12.1::).
64193
64194 _Wording Changes from Ada 2005_
64195
64196 17.g/3
64197 {AI05-0013-1AI05-0013-1} Correction: When restrictions are
64198 checked has been clarified.
64199
64200 * Menu:
64201
64202 * 13.12.1 :: Language-Defined Restrictions and Profiles
64203
64204 \1f
64205 File: aarm2012.info, Node: 13.12.1, Up: 13.12
64206
64207 13.12.1 Language-Defined Restrictions and Profiles
64208 --------------------------------------------------
64209
64210 _Static Semantics_
64211
64212 1/2
64213 {AI95-00257-01AI95-00257-01} The following restriction_identifiers are
64214 language defined (additional restrictions are defined in the Specialized
64215 Needs Annexes):
64216
64217 1.1/3
64218 {AI05-0241-1AI05-0241-1} No_Implementation_Aspect_Specifications
64219 There are no implementation-defined aspects specified by
64220 an aspect_specification. This restriction applies only
64221 to the current compilation or environment, not the entire
64222 partition.
64223
64224 1.a/3
64225 Discussion: {AI05-0241-1AI05-0241-1} This restriction (as well
64226 as others below) applies only to the current compilation,
64227 because it is likely that the runtime (and possibly
64228 user-written low-level code) will need to use
64229 implementation-defined aspects. But a partition-wide
64230 restriction applies everywhere, including the runtime.
64231
64232 2/2
64233 {AI95-00257-01AI95-00257-01} No_Implementation_Attributes
64234 There are no implementation-defined attributes. This
64235 restriction applies only to the current compilation or
64236 environment, not the entire partition.
64237
64238 2.1/3
64239 {AI05-0246-1AI05-0246-1} {AI05-0269-1AI05-0269-1}
64240 No_Implementation_Identifiers
64241 There are no usage names that denote declarations with
64242 implementation-defined identifiers that occur within
64243 language-defined packages or instances of
64244 language-defined generic packages. Such identifiers can
64245 arise as follows:
64246
64247 2.2/3
64248 * The following language-defined packages and generic
64249 packages allow implementation-defined identifiers:
64250
64251 2.3/3
64252 * package System (see *note 13.7::);
64253
64254 2.4/3
64255 * package Standard (see *note A.1::);
64256
64257 2.5/3
64258 * package Ada.Command_Line (see *note
64259 A.15::);
64260
64261 2.6/3
64262 * package Interfaces.C (see *note B.3::);
64263
64264 2.7/3
64265 * package Interfaces.C.Strings (see *note
64266 B.3.1::);
64267
64268 2.8/3
64269 * package Interfaces.C.Pointers (see *note
64270 B.3.2::);
64271
64272 2.9/3
64273 * package Interfaces.COBOL (see *note
64274 B.4::);
64275
64276 2.10/3
64277 * package Interfaces.Fortran (see *note
64278 B.5::);
64279
64280 2.11/3
64281 * The following language-defined packages contain only
64282 implementation-defined identifiers:
64283
64284 2.12/3
64285 * package System.Machine_Code (see *note
64286 13.8::);
64287
64288 2.13/3
64289 * package Ada.Directories.Information (see
64290 *note A.16::);
64291
64292 2.14/3
64293 * nested Implementation packages of the
64294 Queue containers (see *note A.18.28::-31);
64295
64296 2.15/3
64297 * package Interfaces (see *note B.2::);
64298
64299 2.16/3
64300 * package Ada.Interrupts.Names (see *note
64301 C.3.2::).
64302
64303 2.17/3
64304 For package Standard, Standard.Long_Integer and
64305 Standard.Long_Float are considered language-defined
64306 identifiers, but identifiers such as
64307 Standard.Short_Short_Integer are considered
64308 implementation-defined.
64309
64310 2.18/3
64311 This restriction applies only to the current compilation
64312 or environment, not the entire partition.
64313
64314 3/2
64315 {AI95-00257-01AI95-00257-01} No_Implementation_Pragmas
64316 There are no implementation-defined pragmas or pragma
64317 arguments. This restriction applies only to the current
64318 compilation or environment, not the entire partition.
64319
64320 3.1/3
64321 {AI05-0242-1AI05-0242-1} No_Implementation_Units
64322 There is no mention in the context_clause of any
64323 implementation-defined descendants of packages Ada,
64324 Interfaces, or System. This restriction applies only to
64325 the current compilation or environment, not the entire
64326 partition.
64327
64328 4/3
64329 {AI95-00368-01AI95-00368-01} {AI05-0229-1AI05-0229-1}
64330 No_Obsolescent_Features
64331 There is no use of language features defined in Annex J.
64332 It is implementation defined whether uses of the
64333 renamings of *note J.1:: and of the pragmas of *note
64334 J.15:: are detected by this restriction. This
64335 restriction applies only to the current compilation or
64336 environment, not the entire partition.
64337
64338 4.a/2
64339 Reason: A user could compile a rename like
64340
64341 4.b/2
64342 with Ada.Text_IO;
64343 package Text_IO renames Ada.Text_IO;
64344
64345 4.c/2
64346 Such a rename must not be disallowed by this restriction, nor
64347 should the compilation of such a rename be restricted by an
64348 implementation. Many implementations implement the renames of
64349 *note J.1:: by compiling them normally; we do not want to
64350 require implementations to use a special mechanism to
64351 implement these renames.
64352
64353 4.d/3
64354 {AI05-0229-1AI05-0229-1} The pragmas have the same
64355 functionality as the corresponding aspect (unlike the typical
64356 obsolescent feature), and rejecting them could be a
64357 significant portability problem for existing code.
64358
64359 5/3
64360 {AI95-00381-01AI95-00381-01} {AI05-0241-1AI05-0241-1} The following
64361 restriction_parameter_identifiers are language defined:
64362
64363 6/2
64364 {AI95-00381-01AI95-00381-01} No_Dependence
64365 Specifies a library unit on which there are no semantic
64366 dependences.
64367
64368 6.1/3
64369 {AI05-0241-1AI05-0241-1} No_Specification_of_Aspect
64370 Identifies an aspect for which no aspect_specification,
64371 attribute_definition_clause, or pragma is given.
64372
64373 6.2/3
64374 {AI05-0272-1AI05-0272-1} No_Use_Of_Attribute
64375 Identifies an attribute for which no attribute_reference
64376 or attribute_definition_clause is given.
64377
64378 6.3/3
64379 {AI05-0272-1AI05-0272-1} No_Use_Of_Pragma
64380 Identifies a pragma which is not to be used.
64381
64382 _Legality Rules_
64383
64384 7/2
64385 {AI95-00381-01AI95-00381-01} The restriction_parameter_argument of a
64386 No_Dependence restriction shall be a name; the name shall have the form
64387 of a full expanded name of a library unit, but need not denote a unit
64388 present in the environment.
64389
64390 7.a/2
64391 Ramification: This name is not resolved.
64392
64393 7.1/3
64394 {AI05-0241-1AI05-0241-1} The restriction_parameter_argument of a
64395 No_Specification_of_Aspect restriction shall be an identifier; this is
64396 an identifier specific to a pragma (see *note 2.8::) and does not denote
64397 any declaration.
64398
64399 7.b/3
64400 Ramification: This restriction_parameter_argument is not
64401 resolved as it is an identifier specific to a pragma. As for
64402 No_Dependence, there is no check that the aspect identifier is
64403 meaningful; it might refer to an implementation-defined aspect
64404 on one implementation, but nothing at all on another
64405 implementation.
64406
64407 7.2/3
64408 {AI05-0272-1AI05-0272-1} The restriction_parameter_argument of a
64409 No_Use_Of_Attribute restriction shall be an identifier or one of the
64410 reserved words Access, Delta, Digits, Mod, or Range; this is an
64411 identifier specific to a pragma.
64412
64413 7.c/3
64414 Ramification: This restriction_parameter_argument is not
64415 resolved as it is an identifier specific to a pragma. There
64416 is no check that the attribute identifier refers to a known
64417 attribute_designator; it might refer to an
64418 implementation-defined attribute on one implementation, but
64419 nothing at all on another implementation.
64420
64421 7.3/3
64422 {AI05-0272-1AI05-0272-1} The restriction_parameter_argument of a
64423 No_Use_Of_Pragma restriction shall be an identifier or the reserved word
64424 Interface; this is an identifier specific to a pragma.
64425
64426 7.d/3
64427 Ramification: This restriction_parameter_argument is not
64428 resolved as it is an identifier specific to a pragma. There
64429 is no check that the pragma identifier refers to a known
64430 pragma; it might refer to an implementation-defined pragma on
64431 one implementation, but nothing at all on another
64432 implementation.
64433
64434 _Post-Compilation Rules_
64435
64436 8/3
64437 {AI95-00381-01AI95-00381-01} {AI05-0241-1AI05-0241-1} No compilation
64438 unit included in the partition shall depend semantically on the library
64439 unit identified by the name of a No_Dependence restriction.
64440
64441 8.a/2
64442 Ramification: There is no requirement that the library unit
64443 actually exist. One possible use of the pragma is to prevent
64444 the use of implementation-defined units; when the program is
64445 ported to a different compiler, it is perfectly reasonable
64446 that no unit with the name exist.
64447
64448 _Static Semantics_
64449
64450 9/3
64451 {AI05-0246-1AI05-0246-1} The following profile_identifier is language
64452 defined:
64453
64454 10/3
64455 {AI05-0246-1AI05-0246-1} No_Implementation_Extensions
64456
64457 11/3
64458 {AI05-0246-1AI05-0246-1} For usage profile No_Implementation_Extensions,
64459 there shall be no profile_pragma_argument_associations.
64460
64461 12/3
64462 {AI05-0246-1AI05-0246-1} The No_Implementation_Extensions usage profile
64463 is equivalent to the following restrictions:
64464
64465 13/3
64466 No_Implementation_Aspect_Specifications,
64467 No_Implementation_Attributes,
64468 No_Implementation_Identifiers,
64469 No_Implementation_Pragmas,
64470 No_Implementation_Units.
64471
64472 _Extensions to Ada 95_
64473
64474 13.a/2
64475 {AI95-00257-01AI95-00257-01} {AI95-00368-01AI95-00368-01}
64476 Restrictions No_Implementation_Attributes,
64477 No_Implementation_Pragmas, and No_Obsolescent_Features are
64478 new.
64479
64480 13.b/2
64481 {AI95-00381-01AI95-00381-01} Restriction No_Dependence is new.
64482
64483 _Extensions to Ada 2005_
64484
64485 13.c/3
64486 {AI05-0241-1AI05-0241-1} {AI05-0242-1AI05-0242-1}
64487 {AI05-0246-1AI05-0246-1} {AI05-0272-1AI05-0272-1} Restrictions
64488 No_Implementation_Aspect_Specifications,
64489 No_Implementation_Identifiers, No_Implementation_Units,
64490 No_Specification_of_Aspect, No_Use_of_Attribute, and
64491 No_Use_of_Pragma are new.
64492
64493 13.d/3
64494 {AI05-0246-1AI05-0246-1} Profile No_Implementation_Extensions
64495 is new.
64496
64497 \1f
64498 File: aarm2012.info, Node: 13.13, Next: 13.14, Prev: 13.12, Up: 13
64499
64500 13.13 Streams
64501 =============
64502
64503 1
64504 A stream is a sequence of elements comprising values from possibly
64505 different types and allowing sequential access to these values. A
64506 stream type is a type in the class whose root type is
64507 Streams.Root_Stream_Type. A stream type may be implemented in various
64508 ways, such as an external sequential file, an internal buffer, or a
64509 network channel.
64510
64511 1.a
64512 Discussion: A stream element will often be the same size as a
64513 storage element, but that is not required.
64514
64515 1.a.1/3
64516 Glossary entry: A stream is a sequence of elements that can be
64517 used, along with the stream-oriented attributes, to support
64518 marshalling and unmarshalling of values of most types.
64519
64520 _Extensions to Ada 83_
64521
64522 1.b
64523 Streams are new in Ada 95.
64524
64525 * Menu:
64526
64527 * 13.13.1 :: The Package Streams
64528 * 13.13.2 :: Stream-Oriented Attributes
64529
64530 \1f
64531 File: aarm2012.info, Node: 13.13.1, Next: 13.13.2, Up: 13.13
64532
64533 13.13.1 The Package Streams
64534 ---------------------------
64535
64536 _Static Semantics_
64537
64538 1
64539 The abstract type Root_Stream_Type is the root type of the class of
64540 stream types. The types in this class represent different kinds of
64541 streams. A new stream type is defined by extending the root type (or
64542 some other stream type), overriding the Read and Write operations, and
64543 optionally defining additional primitive subprograms, according to the
64544 requirements of the particular kind of stream. The predefined
64545 stream-oriented attributes like T'Read and T'Write make dispatching
64546 calls on the Read and Write procedures of the Root_Stream_Type.
64547 (User-defined T'Read and T'Write attributes can also make such calls, or
64548 can call the Read and Write attributes of other types.)
64549
64550 2
64551 package Ada.Streams is
64552 pragma Pure(Streams);
64553
64554 3/2
64555 {AI95-00161-01AI95-00161-01} type Root_Stream_Type is abstract tagged limited private;
64556 pragma Preelaborable_Initialization(Root_Stream_Type);
64557
64558 4/1
64559 {8652/00448652/0044} {AI95-00181-01AI95-00181-01} type Stream_Element is mod implementation-defined;
64560 type Stream_Element_Offset is range implementation-defined;
64561 subtype Stream_Element_Count is
64562 Stream_Element_Offset range 0..Stream_Element_Offset'Last;
64563 type Stream_Element_Array is
64564 array(Stream_Element_Offset range <>) of aliased Stream_Element;
64565
64566 5
64567 procedure Read(
64568 Stream : in out Root_Stream_Type;
64569 Item : out Stream_Element_Array;
64570 Last : out Stream_Element_Offset) is abstract;
64571
64572 6
64573 procedure Write(
64574 Stream : in out Root_Stream_Type;
64575 Item : in Stream_Element_Array) is abstract;
64576
64577 7
64578 private
64579 ... -- not specified by the language
64580 end Ada.Streams;
64581
64582 8/2
64583 {AI95-00227-01AI95-00227-01} The Read operation transfers stream
64584 elements from the specified stream to fill the array Item. Elements are
64585 transferred until Item'Length elements have been transferred, or until
64586 the end of the stream is reached. If any elements are transferred, the
64587 index of the last stream element transferred is returned in Last.
64588 Otherwise, Item'First - 1 is returned in Last. Last is less than
64589 Item'Last only if the end of the stream is reached.
64590
64591 9
64592 The Write operation appends Item to the specified stream.
64593
64594 9.a/2
64595 Discussion: {AI95-00114-01AI95-00114-01} The index subtype of
64596 Stream_Element_Array is Stream_Element_Offset because we wish
64597 to allow maximum flexibility. Most Stream_Element_Arrays will
64598 probably have a lower bound of 0 or 1, but other lower bounds,
64599 including negative ones, make sense in some situations.
64600
64601 9.b/3
64602 {AI95-00114-01AI95-00114-01} {AI05-0005-1AI05-0005-1} Note
64603 that there are some language-defined subprograms that fill
64604 part of a Stream_Element_Array, and return the index of the
64605 last element filled as a Stream_Element_Offset. The Read
64606 procedures declared here, Streams.Stream_IO (see *note
64607 A.12.1::), and System.RPC (see *note E.5::) behave in this
64608 manner. These will raise Constraint_Error if the resulting
64609 Last value is not in Stream_Element_Offset. This implies that
64610 the Stream_Element_Array passed to these subprograms should
64611 not have a lower bound of Stream_Element_Offset'First, because
64612 then a read of 0 elements would always raise Constraint_Error.
64613 A better choice of lower bound is 0 or 1.
64614
64615 _Implementation Permissions_
64616
64617 9.1/1
64618 {8652/00448652/0044} {AI95-00181-01AI95-00181-01} If Stream_Element'Size
64619 is not a multiple of System.Storage_Unit, then the components of
64620 Stream_Element_Array need not be aliased.
64621
64622 9.b.1/2
64623 Ramification: {AI95-00114-01AI95-00114-01} If the
64624 Stream_Element'Size is less than the size of
64625 System.Storage_Unit, then components of Stream_Element_Array
64626 need not be aliased. This is necessary as the components of
64627 type Stream_Element size might not be addressable on the
64628 target architecture.
64629
64630 NOTES
64631
64632 10
64633 38 See *note A.12.1::, "*note A.12.1:: The Package
64634 Streams.Stream_IO" for an example of extending type
64635 Root_Stream_Type.
64636
64637 11/2
64638 39 {AI95-00227-01AI95-00227-01} If the end of stream has been
64639 reached, and Item'First is Stream_Element_Offset'First, Read will
64640 raise Constraint_Error.
64641
64642 11.a/2
64643 Ramification: Thus, Stream_Element_Arrays should start at 0 or
64644 1, not Stream_Element_Offset'First.
64645
64646 _Extensions to Ada 95_
64647
64648 11.b/2
64649 {AI95-00161-01AI95-00161-01} Amendment Correction: Added
64650 pragma Preelaborable_Initialization to type Root_Stream_Type.
64651
64652 _Wording Changes from Ada 95_
64653
64654 11.c/2
64655 {8652/00448652/0044} {AI95-00181-01AI95-00181-01} Corrigendum:
64656 Stream elements are aliased presuming that makes sense.
64657
64658 11.d/2
64659 {AI95-00227-01AI95-00227-01} Fixed the wording for Read to
64660 properly define the result in Last when no stream elements are
64661 transfered.
64662
64663 \1f
64664 File: aarm2012.info, Node: 13.13.2, Prev: 13.13.1, Up: 13.13
64665
64666 13.13.2 Stream-Oriented Attributes
64667 ----------------------------------
64668
64669 1/3
64670 {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
64671 {AI05-0183-1AI05-0183-1} The type-related operational attributes Write,
64672 Read, Output, and Input convert values to a stream of elements and
64673 reconstruct values from a stream.
64674
64675 _Static Semantics_
64676
64677 1.1/2
64678 {AI95-00270-01AI95-00270-01} For every subtype S of an elementary type
64679 T, the following representation attribute is defined:
64680
64681 1.2/3
64682 S'Stream_Size
64683 {AI95-00270-01AI95-00270-01} {AI05-0194-1AI05-0194-1}
64684 Denotes the number of bits read from or written to a
64685 stream by the default implementations of S'Read and
64686 S'Write. Hence, the number of stream elements required
64687 per item of elementary type T is:
64688
64689 1.3/2
64690 T'Stream_Size / Ada.Streams.Stream_Element'Size
64691
64692 1.4/2
64693 The value of this attribute is of type universal_integer
64694 and is a multiple of Stream_Element'Size.
64695
64696 1.5/2
64697 Stream_Size may be specified for first subtypes via an
64698 attribute_definition_clause; the expression of such a
64699 clause shall be static, nonnegative, and a multiple of
64700 Stream_Element'Size.
64701
64702 1.a/3
64703 Aspect Description for Stream_Size: Size in bits used to
64704 represent elementary objects in a stream.
64705
64706 1.b/2
64707 Discussion: Stream_Size is a type-related attribute (see *note
64708 13.1::).
64709
64710 1.c/3
64711 Ramification: {AI05-0194-1AI05-0194-1} The value of
64712 S'Stream_Size is unaffected by the presence or absence of any
64713 attribute_definition_clauses or aspect_specifications
64714 specifying the Read or Write attributes of any ancestor of S.
64715 S'Stream_Size is defined in terms of the behavior of the
64716 default implementations of S'Read and S'Write even if those
64717 default implementations are overridden.
64718
64719 _Implementation Advice_
64720
64721 1.6/2
64722 {AI95-00270-01AI95-00270-01} If not specified, the value of Stream_Size
64723 for an elementary type should be the number of bits that corresponds to
64724 the minimum number of stream elements required by the first subtype of
64725 the type, rounded up to the nearest factor or multiple of the word size
64726 that is also a multiple of the stream element size.
64727
64728 1.d/2
64729 Implementation Advice: If not specified, the value of
64730 Stream_Size for an elementary type should be the number of
64731 bits that corresponds to the minimum number of stream elements
64732 required by the first subtype of the type, rounded up to the
64733 nearest factor or multiple of the word size that is also a
64734 multiple of the stream element size.
64735
64736 1.e/2
64737 Reason: {AI95-00270-01AI95-00270-01} This is Implementation
64738 Advice because we want to allow implementations to remain
64739 compatible with their Ada 95 implementations, which may have a
64740 different handling of the number of stream elements. Users
64741 can always specify Stream_Size if they need a specific number
64742 of stream elements.
64743
64744 1.7/2
64745 {AI95-00270-01AI95-00270-01} The recommended level of support for the
64746 Stream_Size attribute is:
64747
64748 1.8/2
64749 * {AI95-00270-01AI95-00270-01} A Stream_Size clause should be
64750 supported for a discrete or fixed point type T if the specified
64751 Stream_Size is a multiple of Stream_Element'Size and is no less
64752 than the size of the first subtype of T, and no greater than the
64753 size of the largest type of the same elementary class (signed
64754 integer, modular integer, enumeration, ordinary fixed point, or
64755 decimal fixed point).
64756
64757 1.f/2
64758 Implementation Advice: The recommended level of support for
64759 the Stream_Size attribute should be followed.
64760
64761 1.g/2
64762 Ramification: There are no requirements beyond supporting
64763 confirming Stream_Size clauses for floating point and access
64764 types. Floating point and access types usually only have a
64765 handful of defined formats, streaming anything else makes no
64766 sense for them.
64767
64768 1.h/2
64769 For discrete and fixed point types, this may require support
64770 for sizes other than the "natural" ones. For instance, on a
64771 typical machine with 32-bit integers and a Stream_Element'Size
64772 of 8, setting Stream_Size to 24 must be supported. This is
64773 required as such formats can be useful for interoperability
64774 with unusual machines, and there is no difficulty with the
64775 implementation (drop extra bits on output, sign extend on
64776 input).
64777
64778 _Static Semantics_
64779
64780 2
64781 For every subtype S of a specific type T, the following attributes are
64782 defined.
64783
64784 3
64785 S'Write
64786 S'Write denotes a procedure with the following
64787 specification:
64788
64789 4/2
64790 {AI95-00441-01AI95-00441-01} procedure S'Write(
64791 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
64792 Item : in T)
64793
64794 5
64795 S'Write writes the value of Item to Stream.
64796
64797 6
64798 S'Read
64799 S'Read denotes a procedure with the following
64800 specification:
64801
64802 7/2
64803 {AI95-00441-01AI95-00441-01} procedure S'Read(
64804 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
64805 Item : out T)
64806
64807 8
64808 S'Read reads the value of Item from Stream.
64809
64810 8.1/3
64811 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
64812 {AI95-00444-01AI95-00444-01} {AI05-0192-1AI05-0192-1} For an untagged
64813 derived type, the Write (resp. Read) attribute is inherited according
64814 to the rules given in *note 13.1:: if the attribute is [specified and]
64815 available for the parent type at the point where T is declared. For a
64816 tagged derived type, these attributes are not inherited, but rather the
64817 default implementations are used.
64818
64819 8.a.1/3
64820 Proof: {AI05-0192-1AI05-0192-1} The inheritance rules of *note
64821 13.1:: say that only specified or inherited aspects are
64822 inherited; we mention it again here as a clarification.
64823
64824 8.2/2
64825 {AI95-00444-01AI95-00444-01} The default implementations of the Write
64826 and Read attributes, where available, execute as follows:
64827
64828 9/3
64829 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
64830 {AI95-00195-01AI95-00195-01} {AI95-00251-01AI95-00251-01}
64831 {AI95-00270-01AI95-00270-01} {AI05-0139-2AI05-0139-2} For elementary
64832 types, Read reads (and Write writes) the number of stream elements
64833 implied by the Stream_Size for the type T; the representation of those
64834 stream elements is implementation defined. For composite types, the
64835 Write or Read attribute for each component is called in canonical order,
64836 which is last dimension varying fastest for an array (unless the
64837 convention of the array is Fortran, in which case it is first dimension
64838 varying fastest), and positional aggregate order for a record. Bounds
64839 are not included in the stream if T is an array type. If T is a
64840 discriminated type, discriminants are included only if they have
64841 defaults. If T is a tagged type, the tag is not included. For type
64842 extensions, the Write or Read attribute for the parent type is called,
64843 followed by the Write or Read attribute of each component of the
64844 extension part, in canonical order. For a limited type extension, if
64845 the attribute of the parent type or any progenitor type of T is
64846 available anywhere within the immediate scope of T, and the attribute of
64847 the parent type or the type of any of the extension components is not
64848 available at the freezing point of T, then the attribute of T shall be
64849 directly specified.
64850
64851 9.a/2
64852 Implementation defined: The contents of the stream elements
64853 read and written by the Read and Write attributes of
64854 elementary types.
64855
64856 9.1/3
64857 {AI05-0023-1AI05-0023-1} {AI05-0264-1AI05-0264-1} If T is a
64858 discriminated type and its discriminants have defaults, then S'Read
64859 first reads the discriminants from the stream without modifying Item.
64860 S'Read then creates an object of type T constrained by these
64861 discriminants. The value of this object is then converted to the
64862 subtype of Item and is assigned to Item. Finally, the Read attribute
64863 for each nondiscriminant component of Item is called in canonical order
64864 as described above. Normal default initialization and finalization take
64865 place for the created object.
64866
64867 9.b
64868 Reason: A discriminant with a default value is treated simply
64869 as a component of the object. On the other hand, an array
64870 bound or a discriminant without a default value, is treated as
64871 "descriptor" or "dope" that must be provided in order to
64872 create the object and thus is logically separate from the
64873 regular components. Such "descriptor" data are written by
64874 'Output and produced as part of the delivered result by the
64875 'Input function, but they are not written by 'Write nor read
64876 by 'Read. A tag is like a discriminant without a default.
64877
64878 9.b.1/1
64879 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} For limited
64880 type extensions, we must have a definition of 'Read and 'Write
64881 if the parent type has one, as it is possible to make a
64882 dispatching call through the attributes. The rule is designed
64883 to automatically do the right thing in as many cases as
64884 possible.
64885
64886 9.b.2/1
64887 {AI95-00251-01AI95-00251-01} Similarly, a type that has a
64888 progenitor with an available attribute must also have that
64889 attribute, for the same reason.
64890
64891 9.b.3/3
64892 {AI05-0023-1AI05-0023-1} The semantics of S'Read for a
64893 discriminated type with defaults involves an anonymous object
64894 so that the point of required initialization and finalization
64895 is well-defined, especially for objects that change shape and
64896 have controlled components. The creation of this anonymous
64897 object often can be omitted (see the Implementation
64898 Permissions below).
64899
64900 9.c/2
64901 Ramification: {AI95-00195-01AI95-00195-01} For a composite
64902 object, the subprogram denoted by the Write or Read attribute
64903 of each component is called, whether it is the default or is
64904 user-specified. Implementations are allowed to optimize these
64905 calls (see below), presuming the properties of the attributes
64906 are preserved.
64907
64908 9.2/3
64909 {AI95-00270-01AI95-00270-01} {AI05-0264-1AI05-0264-1} Constraint_Error
64910 is raised by the predefined Write attribute if the value of the
64911 elementary item is outside the range of values representable using
64912 Stream_Size bits. For a signed integer type, an enumeration type, or a
64913 fixed point type, the range is unsigned only if the integer code for the
64914 lower bound of the first subtype is nonnegative, and a (symmetric)
64915 signed range that covers all values of the first subtype would require
64916 more than Stream_Size bits; otherwise, the range is signed.
64917
64918 10
64919 For every subtype S'Class of a class-wide type T'Class:
64920
64921 11
64922 S'Class'Write
64923 S'Class'Write denotes a procedure with the following
64924 specification:
64925
64926 12/2
64927 {AI95-00441-01AI95-00441-01} procedure S'Class'Write(
64928 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
64929 Item : in T'Class)
64930
64931 13
64932 Dispatches to the subprogram denoted by the Write
64933 attribute of the specific type identified by the tag of
64934 Item.
64935
64936 14
64937 S'Class'Read
64938 S'Class'Read denotes a procedure with the following
64939 specification:
64940
64941 15/2
64942 {AI95-00441-01AI95-00441-01} procedure S'Class'Read(
64943 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
64944 Item : out T'Class)
64945
64946 16
64947 Dispatches to the subprogram denoted by the Read
64948 attribute of the specific type identified by the tag of
64949 Item.
64950
64951 16.a
64952 Reason: It is necessary to have class-wide versions of Read
64953 and Write in order to avoid generic contract model violations;
64954 in a generic, we don't necessarily know at compile time
64955 whether a given type is specific or class-wide.
64956
64957 Paragraph 17 was deleted.
64958
64959 _Static Semantics_
64960
64961 18
64962 For every subtype S of a specific type T, the following attributes are
64963 defined.
64964
64965 19
64966 S'Output
64967 S'Output denotes a procedure with the following
64968 specification:
64969
64970 20/2
64971 {AI95-00441-01AI95-00441-01} procedure S'Output(
64972 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
64973 Item : in T)
64974
64975 21
64976 S'Output writes the value of Item to Stream, including
64977 any bounds or discriminants.
64978
64979 21.a
64980 Ramification: Note that the bounds are included even for an
64981 array type whose first subtype is constrained.
64982
64983 22
64984 S'Input
64985 S'Input denotes a function with the following
64986 specification:
64987
64988 23/2
64989 {AI95-00441-01AI95-00441-01} function S'Input(
64990 Stream : not null access Ada.Streams.Root_Stream_Type'Class)
64991 return T
64992
64993 24
64994 S'Input reads and returns one value from Stream, using
64995 any bounds or discriminants written by a corresponding
64996 S'Output to determine how much to read.
64997
64998 25/3
64999 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
65000 {AI95-00444-01AI95-00444-01} {AI05-0192-1AI05-0192-1} For an untagged
65001 derived type, the Output (resp. Input) attribute is inherited according
65002 to the rules given in *note 13.1:: if the attribute is [specified and]
65003 available for the parent type at the point where T is declared. For a
65004 tagged derived type, these attributes are not inherited, but rather the
65005 default implementations are used.
65006
65007 25.a/3
65008 Proof: {AI05-0192-1AI05-0192-1} See the note following the
65009 inheritance rules for the Write attribute, above.
65010
65011 25.1/2
65012 {AI95-00444-01AI95-00444-01} The default implementations of the Output
65013 and Input attributes, where available, execute as follows:
65014
65015 26/3
65016 * {AI05-0269-1AI05-0269-1} If T is an array type, S'Output first
65017 writes the bounds, and S'Input first reads the bounds. If T has
65018 discriminants without defaults, S'Output first writes the
65019 discriminants (using the Write attribute of the discriminant type
65020 for each), and S'Input first reads the discriminants (using the
65021 Read attribute of the discriminant type for each).
65022
65023 27/3
65024 * {AI95-00195-01AI95-00195-01} {AI05-0023-1AI05-0023-1} S'Output then
65025 calls S'Write to write the value of Item to the stream. S'Input
65026 then creates an object of type T, with the bounds or (when without
65027 defaults) the discriminants, if any, taken from the stream, passes
65028 it to S'Read, and returns the value of the object. If T has
65029 discriminants, then this object is unconstrained if and only the
65030 discriminants have defaults. Normal default initialization and
65031 finalization take place for this object (see *note 3.3.1::, *note
65032 7.6::, and *note 7.6.1::).
65033
65034 27.1/2
65035 {AI95-00251-01AI95-00251-01} If T is an abstract type, then S'Input is
65036 an abstract function.
65037
65038 27.a/2
65039 Ramification: For an abstract type T, S'Input can be called in
65040 a dispatching call, or passed to an abstract formal
65041 subprogram. But it cannot be used in nondispatching contexts,
65042 because we don't allow objects of abstract types to exist.
65043 The designation of this function as abstract has no impact on
65044 descendants of T, as T'Input is not inherited for tagged
65045 types, but rather recreated (and the default implementation of
65046 T'Input calls T'Read, not the parent type's T'Input). Note
65047 that T'Input cannot be specified in this case, as any function
65048 with the proper profile is necessarily abstract, and
65049 specifying abstract subprograms in an
65050 attribute_definition_clause is illegal.
65051
65052 28
65053 For every subtype S'Class of a class-wide type T'Class:
65054
65055 29
65056 S'Class'Output
65057 S'Class'Output denotes a procedure with the following
65058 specification:
65059
65060 30/2
65061 {AI95-00441-01AI95-00441-01} procedure S'Class'Output(
65062 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
65063 Item : in T'Class)
65064
65065 31/2
65066 {AI95-00344-01AI95-00344-01} First writes the external
65067 tag of Item to Stream (by calling String'Output(Stream,
65068 Tags.External_Tag(Item'Tag)) -- see *note 3.9::) and then
65069 dispatches to the subprogram denoted by the Output
65070 attribute of the specific type identified by the tag.
65071 Tag_Error is raised if the tag of Item identifies a type
65072 declared at an accessibility level deeper than that of S.
65073
65074 31.a/2
65075 Reason: {AI95-00344-01AI95-00344-01} We raise Tag_Error here
65076 for nested types as such a type cannot be successfully read
65077 with S'Class'Input, and it doesn't make sense to allow writing
65078 a value that cannot be read.
65079
65080 32
65081 S'Class'Input
65082 S'Class'Input denotes a function with the following
65083 specification:
65084
65085 33/2
65086 {AI95-00441-01AI95-00441-01} function S'Class'Input(
65087 Stream : not null access Ada.Streams.Root_Stream_Type'Class)
65088 return T'Class
65089
65090 34/3
65091 {AI95-00279-01AI95-00279-01} {AI95-00344-01AI95-00344-01}
65092 {AI05-0109-1AI05-0109-1} First reads the external tag
65093 from Stream and determines the corresponding internal tag
65094 (by calling Tags.Descendant_Tag(String'Input(Stream),
65095 S'Tag) which might raise Tag_Error -- see *note 3.9::)
65096 and then dispatches to the subprogram denoted by the
65097 Input attribute of the specific type identified by the
65098 internal tag; returns that result. If the specific type
65099 identified by the internal tag is abstract,
65100 Constraint_Error is raised.
65101
65102 34.a/3
65103 Ramification: {AI05-0109-1AI05-0109-1} Descendant_Tag will
65104 ensure that the tag it returns is covered by T'Class;
65105 Tag_Error will be raised if it would not cover T'Class.
65106
65107 35/3
65108 {AI95-00195-01AI95-00195-01} {AI05-0228-1AI05-0228-1} In the default
65109 implementation of Read and Input for a composite type, for each scalar
65110 component that is a discriminant or that has an implicit initial value,
65111 a check is made that the value returned by Read for the component
65112 belongs to its subtype. Constraint_Error is raised if this check fails.
65113 For other scalar components, no check is made. For each component that
65114 is of an access type, if the implementation can detect that the value
65115 returned by Read for the component is not a value of its subtype,
65116 Constraint_Error is raised. If the value is not a value of its subtype
65117 and this error is not detected, the component has an abnormal value, and
65118 erroneous execution can result (see *note 13.9.1::). In the default
65119 implementation of Read for a composite type with defaulted
65120 discriminants, if the actual parameter of Read is constrained, a check
65121 is made that the discriminants read from the stream are equal to those
65122 of the actual parameter. Constraint_Error is raised if this check
65123 fails.
65124
65125 35.a/3
65126 Reason: {AI05-0228-1AI05-0228-1} The check for scalar
65127 components that have an implicit initial value is to preserve
65128 our Language Design Principle that all objects that have an
65129 implicit initial value do not become "deinitialized".
65130
65131 35.b/3
65132 Ramification: {AI05-0228-1AI05-0228-1} A scalar component can
65133 have an implicit initial value if it has a default_expression,
65134 if the component's type has the Default_Value aspect
65135 specified, or if the component is that of an array type that
65136 has the Default_Component_Value aspect specified.
65137
65138 35.c/3
65139 To be honest: {AI05-0228-1AI05-0228-1} An implementation
65140 should always be able to detect the error for a null value
65141 read into a component of an access subtype with a null
65142 exclusion; the "if the implementation can detect" is intended
65143 to cover nonnull access values.
65144
65145 36/2
65146 {AI95-00195-01AI95-00195-01} It is unspecified at which point and in
65147 which order these checks are performed. In particular, if
65148 Constraint_Error is raised due to the failure of one of these checks, it
65149 is unspecified how many stream elements have been read from the stream.
65150
65151 37/1
65152 {8652/00458652/0045} {AI95-00132-01AI95-00132-01} In the default
65153 implementation of Read and Input for a type, End_Error is raised if the
65154 end of the stream is reached before the reading of a value of the type
65155 is completed.
65156
65157 38/3
65158 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
65159 {AI95-00195-01AI95-00195-01} {AI95-00251-01AI95-00251-01}
65160 {AI05-0039-1AI05-0039-1} The stream-oriented attributes may be specified
65161 for any type via an attribute_definition_clause. The subprogram name
65162 given in such a clause shall statically denote a subprogram that is not
65163 an abstract subprogram. Furthermore, if a stream-oriented attribute is
65164 specified for an interface type by an attribute_definition_clause, the
65165 subprogram name given in the clause shall statically denote a null
65166 procedure.
65167
65168 38.a/2
65169 This paragraph was deleted.{AI95-00195-01AI95-00195-01}
65170
65171 38.a.1/2
65172 This paragraph was deleted.{8652/00408652/0040}
65173 {AI95-00108-01AI95-00108-01} {AI95-00195-01AI95-00195-01}
65174
65175 38.b/2
65176 Discussion: {AI95-00251-01AI95-00251-01} Stream attributes
65177 (other than Input) are always null procedures for interface
65178 types (they have no components). We need to allow explicit
65179 setting of the Read and Write attributes in order that the
65180 class-wide attributes like LI'Class'Input can be made
65181 available. (In that case, any descendant of the interface
65182 type would require available attributes.) But we don't allow
65183 any concrete implementation because these don't participate in
65184 extensions (unless the interface is the parent type). If we
65185 didn't ban concrete implementations, the order of declaration
65186 of a pair of interfaces would become significant. For
65187 example, if Int1 and Int2 are interfaces with concrete
65188 implementations of 'Read, then the following declarations
65189 would have different implementations for 'Read:
65190
65191 38.c/2
65192 type Con1 is new Int1 and Int2 with null record;
65193 type Con2 is new Int2 and Int1 with null record;
65194
65195 38.d/2
65196 This would violate our design principle that the order of the
65197 specification of the interfaces in a derived_type_definition
65198 doesn't matter.
65199
65200 38.e/2
65201 Ramification: The Input attribute cannot be specified for an
65202 interface. As it is a function, a null procedure is
65203 impossible; a concrete function is not possible anyway as any
65204 function returning an abstract type must be abstract. And we
65205 don't allow specifying stream attributes to be abstract
65206 subprograms. This has no impact, as the availability of
65207 Int'Class'Input (where Int is a limited interface) depends on
65208 whether Int'Read (not Int'Input) is specified. There is no
65209 reason to allow Int'Output to be specified, either, but there
65210 is equally no reason to disallow it, so we don't have a
65211 special rule for that.
65212
65213 38.f/2
65214 Discussion: {AI95-00195-01AI95-00195-01} Limited types
65215 generally do not have default implementations of the
65216 stream-oriented attributes. The rules defining when a
65217 stream-oriented attribute is available (see below) determine
65218 when an attribute of a limited type is in fact well defined
65219 and usable. The rules are designed to maximize the number of
65220 cases in which the attributes are usable. For instance, when
65221 the language provides a default implementation of an attribute
65222 for a limited type based on a specified attribute for the
65223 parent type, we want to be able to call that attribute.
65224
65225 38.g/3
65226 Aspect Description for Read: Procedure to read a value from a
65227 stream for a given type.
65228
65229 38.h/3
65230 Aspect Description for Write: Procedure to write a value to a
65231 stream for a given type.
65232
65233 38.i/3
65234 Aspect Description for Input: Function to read a value from a
65235 stream for a given type, including any bounds and
65236 discriminants.
65237
65238 38.j/3
65239 Aspect Description for Output: Procedure to write a value to a
65240 stream for a given type, including any bounds and
65241 discriminants.
65242
65243 39/2
65244 {AI95-00195-01AI95-00195-01} A stream-oriented attribute for a subtype
65245 of a specific type T is available at places where one of the following
65246 conditions is true:
65247
65248 40/2
65249 * T is nonlimited.
65250
65251 41/2
65252 * The attribute_designator is Read (resp. Write) and T is a limited
65253 record extension, and the attribute Read (resp. Write) is
65254 available for the parent type of T and for the types of all of the
65255 extension components.
65256
65257 41.a/2
65258 Reason: In this case, the language provides a well-defined
65259 default implementation, which we want to be able to call.
65260
65261 42/2
65262 * T is a limited untagged derived type, and the attribute was
65263 inherited for the type.
65264
65265 42.a/2
65266 Reason: Attributes are only inherited for untagged derived
65267 types, and surely we want to be able to call inherited
65268 attributes.
65269
65270 43/2
65271 * The attribute_designator is Input (resp. Output), and T is a
65272 limited type, and the attribute Read (resp. Write) is available
65273 for T.
65274
65275 43.a/2
65276 Reason: The default implementation of Input and Output are
65277 based on Read and Write; so if the implementation of Read or
65278 Write is good, so is the matching implementation of Input or
65279 Output.
65280
65281 44/2
65282 * The attribute has been specified via an
65283 attribute_definition_clause, and the attribute_definition_clause is
65284 visible.
65285
65286 44.a/2
65287 Reason: We always want to allow calling a specified attribute.
65288 But we don't want availability to break privacy. Therefore,
65289 only attributes whose specification can be seen count. Yes,
65290 we defined the visibility of an attribute_definition_clause
65291 (see *note 8.3::).
65292
65293 45/2
65294 {AI95-00195-01AI95-00195-01} A stream-oriented attribute for a subtype
65295 of a class-wide type T'Class is available at places where one of the
65296 following conditions is true:
65297
65298 46/2
65299 * T is nonlimited;
65300
65301 47/2
65302 * the attribute has been specified via an
65303 attribute_definition_clause, and the attribute_definition_clause is
65304 visible; or
65305
65306 48/2
65307 * the corresponding attribute of T is available, provided that if T
65308 has a partial view, the corresponding attribute is available at the
65309 end of the visible part where T is declared.
65310
65311 48.a/2
65312 Reason: The rules are stricter for class-wide attributes
65313 because (for the default implementation) we must ensure that
65314 any specific attribute that might ever be dispatched to is
65315 available. Because we require specification of attributes for
65316 extensions of limited parent types with available attributes,
65317 we can in fact know this. Otherwise, we would not be able to
65318 use default class-wide attributes with limited types, a
65319 significant limitation.
65320
65321 49/2
65322 {AI95-00195-01AI95-00195-01} An attribute_reference for one of the
65323 stream-oriented attributes is illegal unless the attribute is available
65324 at the place of the attribute_reference. Furthermore, an
65325 attribute_reference for T'Input is illegal if T is an abstract type.
65326
65327 49.a/2
65328 Discussion: Stream attributes always exist. It is illegal to
65329 call them in some cases. Having the attributes not be defined
65330 for some limited types would seem to be a cleaner solution,
65331 but it would lead to contract model problems for limited
65332 private types.
65333
65334 49.b/2
65335 T'Input is available for abstract types so that T'Class'Input
65336 is available. But we certainly don't want to allow calls that
65337 could create an object of an abstract type. Remember that
65338 T'Class is never abstract, so the above legality rule doesn't
65339 apply to it. We don't have to discuss whether the attribute
65340 is specified, as it cannot be: any function returning the type
65341 would have to be abstract, and we do not allow specifying an
65342 attribute with an abstract subprogram.
65343
65344 50/3
65345 {AI95-00195-01AI95-00195-01} {AI05-0192-1AI05-0192-1} In the
65346 parameter_and_result_profiles for the default implementations of the
65347 stream-oriented attributes, the subtype of the Item parameter is the
65348 base subtype of T if T is a scalar type, and the first subtype
65349 otherwise. The same rule applies to the result of the Input attribute.
65350
65351 50.a/3
65352 Discussion: {AI05-0192-1AI05-0192-1} An inherited stream
65353 attribute has a profile as determined by the rules for
65354 inheriting primitive subprograms (see *note 13.1:: and *note
65355 3.4::).
65356
65357 51/3
65358 {AI95-00195-01AI95-00195-01} {AI05-0007-1AI05-0007-1} For an
65359 attribute_definition_clause specifying one of these attributes, the
65360 subtype of the Item parameter shall be the first subtype or the base
65361 subtype if scalar, and the first subtype if not scalar. The same rule
65362 applies to the result of the Input function.
65363
65364 51.a/2
65365 Reason: This is to simplify implementation.
65366
65367 51.b/3
65368 Ramification: The view of the type at the point of the
65369 attribute_definition_clause determines whether the base
65370 subtype is allowed. Thus, for a scalar type with a partial
65371 view (which is never scalar), whether the base subtype is
65372 allowed is determined by whether the
65373 attribute_definition_clause occurs before or after the full
65374 definition of the scalar type.
65375
65376 52/3
65377 {AI95-00366-01AI95-00366-01} {AI05-0065-1AI05-0065-1} [A type is said to
65378 support external streaming if Read and Write attributes are provided for
65379 sending values of such a type between active partitions, with Write
65380 marshalling the representation, and Read unmarshalling the
65381 representation.] A limited type supports external streaming only if it
65382 has available Read and Write attributes. A type with a part that is of
65383 a nonremote access type supports external streaming only if that access
65384 type or the type of some part that includes the access type component,
65385 has Read and Write attributes that have been specified via an
65386 attribute_definition_clause, and that attribute_definition_clause is
65387 visible. [An anonymous access type does not support external streaming.
65388 ]All other types (including remote access types, see *note E.2.2::)
65389 support external streaming.
65390
65391 52.a/3
65392 Ramification: A limited type with a part that is of a
65393 nonremote access type needs to satisfy both rules.
65394
65395 _Erroneous Execution_
65396
65397 53/2
65398 {AI95-00279-01AI95-00279-01} {AI95-00344-01AI95-00344-01} If the
65399 internal tag returned by Descendant_Tag to T'Class'Input identifies a
65400 type that is not library-level and whose tag has not been created, or
65401 does not exist in the partition at the time of the call, execution is
65402 erroneous.
65403
65404 53.a/2
65405 Ramification: The definition of Descendant_Tag prevents such a
65406 tag from being provided to T'Class'Input if T is a
65407 library-level type. However, this rule is needed for nested
65408 tagged types.
65409
65410 _Implementation Requirements_
65411
65412 54/1
65413 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} For every subtype S of
65414 a language-defined nonlimited specific type T, the output generated by
65415 S'Output or S'Write shall be readable by S'Input or S'Read,
65416 respectively. This rule applies across partitions if the implementation
65417 conforms to the Distributed Systems Annex.
65418
65419 55/3
65420 {AI95-00195-01AI95-00195-01} {AI05-0092-1AI05-0092-1} If
65421 Constraint_Error is raised during a call to Read because of failure of
65422 one the above checks, the implementation shall ensure that the
65423 discriminants of the actual parameter of Read are not modified.
65424
65425 _Implementation Permissions_
65426
65427 56/3
65428 {AI95-00195-01AI95-00195-01} {AI05-0092-1AI05-0092-1} The number of
65429 calls performed by the predefined implementation of the stream-oriented
65430 attributes on the Read and Write operations of the stream type is
65431 unspecified. An implementation may take advantage of this permission to
65432 perform internal buffering. However, all the calls on the Read and
65433 Write operations of the stream type needed to implement an explicit
65434 invocation of a stream-oriented attribute shall take place before this
65435 invocation returns. An explicit invocation is one appearing explicitly
65436 in the program text, possibly through a generic instantiation (see *note
65437 12.3::).
65438
65439 56.1/3
65440 {AI05-0023-1AI05-0023-1} {AI05-0264-1AI05-0264-1} If T is a
65441 discriminated type and its discriminants have defaults, then in two
65442 cases an execution of the default implementation of S'Read is not
65443 required to create an anonymous object of type T: If the discriminant
65444 values that are read in are equal to the corresponding discriminant
65445 values of Item, then no object of type T need be created and Item may be
65446 used instead. If they are not equal and Item is a constrained variable,
65447 then Constraint_Error may be raised at that point, before any further
65448 values are read from the stream and before the object of type T is
65449 created.
65450
65451 56.2/3
65452 {AI05-0023-1AI05-0023-1} A default implementation of S'Input that calls
65453 the default implementation of S'Read may create a constrained anonymous
65454 object with discriminants that match those in the stream.
65455
65456 56.a/3
65457 Implementation Note: This allows the combined executions of
65458 S'Input and S'Read to create one object of type T instead of
65459 two. If this option is exercised, then:
65460
65461 56.b/3
65462 * The discriminants are read from the stream by S'Input,
65463 not S'Read.
65464
65465 56.c/3
65466 * S'Input declares an object of type T constrained by the
65467 discriminants read from the stream, not an unconstrained
65468 object.
65469
65470 56.d/3
65471 * The discriminant values that S'Read would normally have
65472 read from the stream are read from Item instead.
65473
65474 56.e/3
65475 * The permissions of the preceding paragraph then apply and
65476 no object of type T need be created by the execution of
65477 S'Read.
65478
65479 NOTES
65480
65481 57
65482 40 For a definite subtype S of a type T, only T'Write and T'Read
65483 are needed to pass an arbitrary value of the subtype through a
65484 stream. For an indefinite subtype S of a type T, T'Output and
65485 T'Input will normally be needed, since T'Write and T'Read do not
65486 pass bounds, discriminants, or tags.
65487
65488 58
65489 41 User-specified attributes of S'Class are not inherited by other
65490 class-wide types descended from S.
65491
65492 _Examples_
65493
65494 59
65495 Example of user-defined Write attribute:
65496
65497 60/2
65498 {AI95-00441-01AI95-00441-01} procedure My_Write(
65499 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
65500 Item : My_Integer'Base);
65501 for My_Integer'Write use My_Write;
65502
65503 60.a
65504 Discussion: Example of network input/output using input output
65505 attributes:
65506
65507 60.b
65508 with Ada.Streams; use Ada.Streams;
65509 generic
65510 type Msg_Type(<>) is private;
65511 package Network_IO is
65512 -- Connect/Disconnect are used to establish the stream
65513 procedure Connect(...);
65514 procedure Disconnect(...);
65515
65516 60.c
65517 -- Send/Receive transfer messages across the network
65518 procedure Send(X : in Msg_Type);
65519 function Receive return Msg_Type;
65520 private
65521 type Network_Stream is new Root_Stream_Type with ...
65522 procedure Read(...); -- define Read/Write for Network_Stream
65523 procedure Write(...);
65524 end Network_IO;
65525
65526 60.d
65527 with Ada.Streams; use Ada.Streams;
65528 package body Network_IO is
65529 Current_Stream : aliased Network_Stream;
65530 . . .
65531 procedure Connect(...) is ...;
65532 procedure Disconnect(...) is ...;
65533
65534 60.e
65535 procedure Send(X : in Msg_Type) is
65536 begin
65537 Msg_Type'Output(Current_Stream'Access, X);
65538 end Send;
65539
65540 60.f
65541 function Receive return Msg_Type is
65542 begin
65543 return Msg_Type'Input(Current_Stream'Access);
65544 end Receive;
65545 end Network_IO;
65546
65547 _Inconsistencies With Ada 95_
65548
65549 60.g/2
65550 {8652/00408652/0040} {AI95-00108-01AI95-00108-01} Corrigendum:
65551 Clarified how the default implementation for stream attributes
65552 is determined (eliminating conflicting language). The new
65553 wording provides that attributes for type extensions are
65554 created by composing the parent's attribute with those for the
65555 extension components if any. If a program was written
65556 assuming that the extension components were not included in
65557 the stream (as in original Ada 95), it would fail to work in
65558 the language as corrected by the Corrigendum.
65559
65560 60.h/2
65561 {AI95-00195-01AI95-00195-01} Amendment Correction: Explicitly
65562 provided a permission that the number of calls to the
65563 underlying stream Read and Write operations may differ from
65564 the number determined by the canonical operations. If Ada 95
65565 code somehow depended on the number of calls to Read or Write,
65566 it could fail with an Ada 2005 implementation. Such code is
65567 likely to be very rare; moreover, such code is really wrong,
65568 as the permission applies to Ada 95 as well.
65569
65570 _Extensions to Ada 95_
65571
65572 60.i/2
65573 {AI95-00270-01AI95-00270-01} The Stream_Size attribute is new.
65574 It allows specifying the number of bits that will be streamed
65575 for a type. The Implementation Advice involving this also was
65576 changed; this is not incompatible because Implementation
65577 Advice does not have to be followed.
65578
65579 60.j/2
65580 {8652/00408652/0040} {AI95-00108-01AI95-00108-01}
65581 {AI95-00195-01AI95-00195-01} {AI95-00444-01AI95-00444-01}
65582 Corrigendum: Limited types may have default constructed
65583 attributes if all of the parent and (for extensions) extension
65584 components have available attributes. Ada 2005 adds the
65585 notion of availability to patch up some holes in the
65586 Corrigendum model.
65587
65588 _Wording Changes from Ada 95_
65589
65590 60.k/2
65591 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
65592 Added wording to specify that these are operational
65593 attributes.
65594
65595 60.l/2
65596 {8652/00458652/0045} {AI95-00132-01AI95-00132-01} Corrigendum:
65597 Clarified that End_Error is raised by the default
65598 implementation of Read and Input if the end of the stream is
65599 reached. (The result could have been abnormal without this
65600 clarification, thus this is not an inconsistency, as the
65601 programmer could not have depended on the previous behavior.)
65602
65603 60.m/2
65604 {AI95-00195-01AI95-00195-01} Clarified that the default
65605 implementation of S'Input does normal initialization on the
65606 object that it passes to S'Read.
65607
65608 60.n/2
65609 {AI95-00195-01AI95-00195-01} Explicitly stated that what is
65610 read from a stream when a required check fails is unspecified.
65611
65612 60.o/2
65613 {AI95-00251-01AI95-00251-01} Defined availability and default
65614 implementations for types with progenitors.
65615
65616 60.p/2
65617 {AI95-00279-01AI95-00279-01} Specified that Constraint_Error
65618 is raised if the internal tag retrieved for S'Class'Input is
65619 for some type not covered by S'Class or is abstract. We also
65620 explicitly state that the program is erroneous if the tag has
65621 not been created or does not currently exist in the partition.
65622 (Ada 95 did not specify what happened in these cases; it's
65623 very unlikely to have provided some useful result, so this is
65624 not considered an inconsistency.)
65625
65626 60.q/2
65627 {AI95-00344-01AI95-00344-01} Added wording to support nested
65628 type extensions. S'Input and S'Output always raise Tag_Error
65629 for such extensions, and such extensions were not permitted in
65630 Ada 95, so this is neither an extension nor an
65631 incompatibility.
65632
65633 60.r/2
65634 {AI95-00366-01AI95-00366-01} Defined supports external
65635 streaming to put all of the rules about "good" stream
65636 attributes in one place. This is used for distribution and
65637 for defining pragma Pure.
65638
65639 60.s/2
65640 {AI95-00441-01AI95-00441-01} Added the not null qualifier to
65641 the first parameter of all of the stream attributes, so that
65642 the semantics doesn't change between Ada 95 and Ada 2005.
65643 This change is compatible, because mode conformance is
65644 required for subprograms specified as stream attributes, and
65645 null_exclusions are not considered for mode conformance.
65646
65647 60.t/2
65648 {AI95-00444-01AI95-00444-01} Improved the wording to make it
65649 clear that we don't define the default implementations of
65650 attributes that cannot be called (that is, aren't
65651 "available"). Also clarified when inheritance takes place.
65652
65653 _Incompatibilities With Ada 2005_
65654
65655 60.u/3
65656 {AI05-0039-1AI05-0039-1} Correction: Added a requirement that
65657 stream attributes be specified by a static subprogram name
65658 rather than a dynamic expression. Expressions cannot provide
65659 any useful functionality because of the freezing rules, and
65660 the possibility of them complicates implementations. Only
65661 pathological programs should be affected.
65662
65663 _Extensions to Ada 2005_
65664
65665 60.v/3
65666 {AI05-0007-1AI05-0007-1} Correction: Stream attributes for
65667 scalar types can be specified with subprograms that take the
65668 first subtype as well as the base type. This eliminates
65669 confusion about which subtype is appropriate for attributes
65670 specified for partial views whose full type is a scalar type.
65671 It also eliminates a common user error (forgetting 'Base).
65672
65673 _Wording Changes from Ada 2005_
65674
65675 60.w/3
65676 {AI05-0023-1AI05-0023-1} Correction: Corrected the definition
65677 of the default version S'Read and S'Input to be well-defined
65678 if S is a discriminated type with defaulted discriminants and
65679 some components require initialization and/or finalizations.
65680
65681 60.x/3
65682 {AI05-0065-1AI05-0065-1} Correction: Defined remote access
65683 types to support external streaming, since that is their
65684 purpose.
65685
65686 60.y/3
65687 {AI05-0109-1AI05-0109-1} Correction: Removed a misleading
65688 phrase which implies that Constraint_Error is raised for
65689 internal tags of the wrong type, when Tag_Error should be
65690 raised for such tags.
65691
65692 60.z/3
65693 {AI05-0139-2AI05-0139-2} Clarified that arrays with convention
65694 Fortran are written in column-major order, rather then
65695 row-major order. This is necessary in order that streaming of
65696 Fortran arrays is efficient.
65697
65698 60.aa/3
65699 {AI05-0192-1AI05-0192-1} Correction: Clarified that the
65700 profile of an inherited stream attribute is as defined for an
65701 inherited primitive subprogram, while the default
65702 implementation of the same attribute might have a different
65703 profile.
65704
65705 60.bb/3
65706 {AI05-0194-1AI05-0194-1} Correction: Clarified that
65707 Stream_Size has no effect on and is not effected by
65708 user-defined stream attributes.
65709
65710 \1f
65711 File: aarm2012.info, Node: 13.14, Prev: 13.13, Up: 13
65712
65713 13.14 Freezing Rules
65714 ====================
65715
65716 1/3
65717 {AI05-0299-1AI05-0299-1} [This subclause defines a place in the program
65718 text where each declared entity becomes "frozen." A use of an entity,
65719 such as a reference to it by name, or (for a type) an expression of the
65720 type, causes freezing of the entity in some contexts, as described
65721 below. The Legality Rules forbid certain kinds of uses of an entity in
65722 the region of text where it is frozen.]
65723
65724 1.a
65725 Reason: This concept has two purposes: a compile-time one and
65726 a run-time one.
65727
65728 1.b
65729 The compile-time purpose of the freezing rules comes from the
65730 fact that the evaluation of static expressions depends on
65731 overload resolution, and overload resolution sometimes depends
65732 on the value of a static expression. (The dependence of
65733 static evaluation upon overload resolution is obvious. The
65734 dependence in the other direction is more subtle. There are
65735 three rules that require static expressions in contexts that
65736 can appear in declarative places: The expression in an
65737 attribute_designator shall be static. In a record aggregate,
65738 variant-controlling discriminants shall be static. In an
65739 array aggregate with more than one named association, the
65740 choices shall be static. The compiler needs to know the value
65741 of these expressions in order to perform overload resolution
65742 and legality checking.) We wish to allow a compiler to
65743 evaluate static expressions when it sees them in a single pass
65744 over the compilation_unit. The freezing rules ensure that.
65745
65746 1.c
65747 The run-time purpose of the freezing rules is called the
65748 "linear elaboration model." This means that declarations are
65749 elaborated in the order in which they appear in the program
65750 text, and later elaborations can depend on the results of
65751 earlier ones. The elaboration of the declarations of certain
65752 entities requires run-time information about the
65753 implementation details of other entities. The freezing rules
65754 ensure that this information has been calculated by the time
65755 it is used. For example, suppose the initial value of a
65756 constant is the result of a function call that takes a
65757 parameter of type T. In order to pass that parameter, the size
65758 of type T has to be known. If T is composite, that size might
65759 be known only at run time.
65760
65761 1.d
65762 (Note that in these discussions, words like "before" and
65763 "after" generally refer to places in the program text, as
65764 opposed to times at run time.)
65765
65766 1.e
65767 Discussion: The "implementation details" we're talking about
65768 above are:
65769
65770 1.f
65771 * For a tagged type, the implementations of all the
65772 primitive subprograms of the type -- that is (in the
65773 canonical implementation model), the contents of the type
65774 descriptor, which contains pointers to the code for each
65775 primitive subprogram.
65776
65777 1.g
65778 * For a type, the full type declaration of any parts
65779 (including the type itself) that are private.
65780
65781 1.h
65782 * For a deferred constant, the full constant declaration,
65783 which gives the constant's value. (Since this
65784 information necessarily comes after the constant's type
65785 and subtype are fully known, there's no need to worry
65786 about its type or subtype.)
65787
65788 1.i
65789 * For any entity, representation information specified by
65790 the user via representation items. Most representation
65791 items are for types or subtypes; however, various other
65792 kinds of entities, such as objects and subprograms, are
65793 possible.
65794
65795 1.j/3
65796 {AI05-0005-1AI05-0005-1} Similar issues arise for incomplete
65797 types. However, we do not use freezing to prevent premature
65798 access; incomplete types have different, more severe,
65799 restrictions. Similar issues also arise for subprograms,
65800 protected operations, tasks and generic units. However, we do
65801 not use freezing to prevent premature access for those,
65802 either; *note 3.11:: prevents problems with run-time
65803 Elaboration_Checks. Even so, freezing is used for these
65804 entities to prevent giving representation items too late (that
65805 is, after uses that require representation information, such
65806 as calls).
65807
65808 _Language Design Principles_
65809
65810 1.k
65811 An evaluable construct should freeze anything that's needed to
65812 evaluate it.
65813
65814 1.l
65815 However, if the construct is not evaluated where it appears,
65816 let it cause freezing later, when it is evaluated. This is
65817 the case for default_expressions and default_names. (Formal
65818 parameters, generic formal parameters, and components can have
65819 default_expressions or default_names.)
65820
65821 1.m
65822 The compiler should be allowed to evaluate static expressions
65823 without knowledge of their context. (I.e. there should not
65824 be any special rules for static expressions that happen to
65825 occur in a context that requires a static expression.)
65826
65827 1.n
65828 Compilers should be allowed to evaluate static expressions
65829 (and record the results) using the run-time representation of
65830 the type. For example, suppose Color'Pos(Red) = 1, but the
65831 internal code for Red is 37. If the value of a static
65832 expression is Red, some compilers might store 1 in their
65833 symbol table, and other compilers might store 37. Either
65834 compiler design should be feasible.
65835
65836 1.o
65837 Compilers should never be required to detect erroneousness or
65838 exceptions at compile time (although it's very nice if they
65839 do). This implies that we should not require code-generation
65840 for a nonstatic expression of type T too early, even if we can
65841 prove that that expression will be erroneous, or will raise an
65842 exception.
65843
65844 1.p
65845 Here's an example (modified from AI83-00039, Example 3):
65846
65847 1.q
65848 type T is
65849 record
65850 ...
65851 end record;
65852 function F return T;
65853 function G(X : T) return Boolean;
65854 Y : Boolean := G(F); -- doesn't force T in Ada 83
65855 for T use
65856 record
65857 ...
65858 end record;
65859
65860 1.r
65861 AI83-00039 says this is legal. Of course, it raises
65862 Program_Error because the function bodies aren't elaborated
65863 yet. A one-pass compiler has to generate code for an
65864 expression of type T before it knows the representation of T.
65865 Here's a similar example, which AI83-00039 also says is legal:
65866
65867 1.s
65868 package P is
65869 type T is private;
65870 function F return T;
65871 function G(X : T) return Boolean;
65872 Y : Boolean := G(F); -- doesn't force T in Ada 83
65873 private
65874 type T is
65875 record
65876 ...
65877 end record;
65878 end P;
65879
65880 1.t
65881 If T's size were dynamic, that size would be stored in some
65882 compiler-generated dope; this dope would be initialized at the
65883 place of the full type declaration. However, the generated
65884 code for the function calls would most likely allocate a temp
65885 of the size specified by the dope before checking for
65886 Program_Error. That dope would contain uninitialized junk,
65887 resulting in disaster. To avoid doing that, the compiler
65888 would have to determine, at compile time, that the expression
65889 will raise Program_Error.
65890
65891 1.u
65892 This is silly. If we're going to require compilers to detect
65893 the exception at compile time, we might as well formulate the
65894 rule as a legality rule.
65895
65896 1.v
65897 Compilers should not be required to generate code to load the
65898 value of a variable before the address of the variable has
65899 been determined.
65900
65901 1.w
65902 After an entity has been frozen, no further requirements may
65903 be placed on its representation (such as by a representation
65904 item or a full_type_declaration).
65905
65906 2
65907 The freezing of an entity occurs at one or more places (freezing points)
65908 in the program text where the representation for the entity has to be
65909 fully determined. Each entity is frozen from its first freezing point
65910 to the end of the program text (given the ordering of compilation units
65911 defined in *note 10.1.4::).
65912
65913 2.a
65914 Ramification: The "representation" for a subprogram includes
65915 its calling convention and means for referencing the
65916 subprogram body, either a "link-name" or specified address.
65917 It does not include the code for the subprogram body itself,
65918 nor its address if a link-name is used to reference the body.
65919
65920 2.1/3
65921 {AI05-0019-1AI05-0019-1} {AI05-0299-1AI05-0299-1} This subclause also
65922 defines a place in the program text where the profile of each declared
65923 callable entity becomes frozen. A use of a callable entity causes
65924 freezing of its profile in some contexts, as described below. At the
65925 place where the profile of a callable entity becomes frozen, the entity
65926 itself becomes frozen.
65927
65928 3/3
65929 {8652/00148652/0014} {AI05-0017-1AI05-0017-1} {AI05-0019-1AI05-0019-1}
65930 The end of a declarative_part, protected_body, or a declaration of a
65931 library package or generic library package, causes freezing of each
65932 entity and profile declared within it, except for incomplete types. A
65933 noninstance body other than a renames-as-body causes freezing of each
65934 entity and profile declared before it within the same declarative_part
65935 that is not an incomplete type; it only causes freezing of an incomplete
65936 type if the body is within the immediate scope of the incomplete type.
65937
65938 3.a
65939 Discussion: This is worded carefully to handle nested packages
65940 and private types. Entities declared in a nested
65941 package_specification will be frozen by some containing
65942 construct.
65943
65944 3.b/3
65945 {AI05-0017-1AI05-0017-1} An incomplete type declared in the
65946 private part of a library package_specification can be
65947 completed in the body. For other incomplete types (and in the
65948 bodies of library packages), the completion of the type will
65949 be frozen at the end of the package or declarative_part, and
65950 that will freeze the incomplete view as well.
65951
65952 3.b.1/3
65953 {AI05-0017-1AI05-0017-1} The reason we have to worry about
65954 freezing of incomplete types is to prevent premature uses of
65955 the types in dispatching calls. Such uses may need access to
65956 the tag of the type, and the type has to be frozen to know
65957 where the tag is stored.
65958
65959 3.c/3
65960 Ramification: {AI05-0229-1AI05-0229-1} The part about bodies
65961 does not say immediately within. A renaming-as-body does not
65962 have this property. Nor does an imported body
65963
65964 3.d
65965 Reason: The reason bodies cause freezing is because we want
65966 proper_bodies and body_stubs to be interchangeable -- one
65967 should be able to move a proper_body to a subunit, and
65968 vice-versa, without changing the semantics. Clearly, anything
65969 that should cause freezing should do so even if it's inside a
65970 proper_body. However, if we make it a body_stub, then the
65971 compiler can't see that thing that should cause freezing. So
65972 we make body_stubs cause freezing, just in case they contain
65973 something that should cause freezing. But that means we need
65974 to do the same for proper_bodies.
65975
65976 3.e
65977 Another reason for bodies to cause freezing, there could be an
65978 added implementation burden if an entity declared in an
65979 enclosing declarative_part is frozen within a nested body,
65980 since some compilers look at bodies after looking at the
65981 containing declarative_part.
65982
65983 3.f/3
65984 {AI05-0177-1AI05-0177-1} Note that "body" includes
65985 null_procedure_declarations and
65986 expression_function_declarations when those are used as
65987 completions, as well as entry_bodys (see *note 3.11.1::).
65988 These all cause freezing, along with proper_bodys and
65989 body_stubs.
65990
65991 4/1
65992 {8652/00468652/0046} {AI95-00106-01AI95-00106-01} A construct that
65993 (explicitly or implicitly) references an entity can cause the freezing
65994 of the entity, as defined by subsequent paragraphs. At the place where
65995 a construct causes freezing, each name, expression,
65996 implicit_dereference[, or range] within the construct causes freezing:
65997
65998 4.a
65999 Ramification: Note that in the sense of this paragraph, a
66000 subtype_mark "references" the denoted subtype, but not the
66001 type.
66002
66003 5/3
66004 * {AI05-0213-1AI05-0213-1} The occurrence of a generic_instantiation
66005 causes freezing, except that a name which is a generic actual
66006 parameter whose corresponding generic formal parameter is a formal
66007 incomplete type (see *note 12.5.1::) does not cause freezing. In
66008 addition, if a parameter of the instantiation is defaulted, the
66009 default_expression or default_name for that parameter causes
66010 freezing.
66011
66012 5.a/3
66013 Ramification: {AI05-0213-1AI05-0213-1} Thus, an actual
66014 parameter corresponding to a formal incomplete type parameter
66015 may denote an incomplete or private type which is not
66016 completely defined at the point of the generic_instantiation.
66017
66018 6
66019 * The occurrence of an object_declaration that has no corresponding
66020 completion causes freezing.
66021
66022 6.a
66023 Ramification: Note that this does not include a
66024 formal_object_declaration.
66025
66026 7
66027 * The declaration of a record extension causes freezing of the parent
66028 subtype.
66029
66030 7.a
66031 Ramification: This combined with another rule specifying that
66032 primitive subprogram declarations shall precede freezing
66033 ensures that all descendants of a tagged type implement all of
66034 its dispatching operations.
66035
66036 7.b/2
66037 {AI95-00251-01AI95-00251-01} The declaration of a private
66038 extension does not cause freezing. The freezing is deferred
66039 until the full type declaration, which will necessarily be for
66040 a record extension, task, or protected type (the latter only
66041 for a limited private extension derived from an interface).
66042
66043 7.1/2
66044 * {AI95-00251-01AI95-00251-01} The declaration of a record extension,
66045 interface type, task unit, or protected unit causes freezing of any
66046 progenitor types specified in the declaration.
66047
66048 7.b.1/2
66049 Reason: This rule has the same purpose as the one above:
66050 ensuring that all descendants of an interface tagged type
66051 implement all of its dispatching operations. As with the
66052 previous rule, a private extension does not freeze its
66053 progenitors; the full type declaration (which must have the
66054 same progenitors) will do that.
66055
66056 7.b.2/2
66057 Ramification: An interface type can be a parent as well as a
66058 progenitor; these rules are similar so that the location of an
66059 interface in a record extension does not have an effect on the
66060 freezing of the interface type.
66061
66062 7.2/3
66063 * {AI05-0183-1AI05-0183-1} At the freezing point of the entity
66064 associated with an aspect_specification, any expressions or names
66065 within the aspect_specification cause freezing. Any static
66066 expressions within an aspect_specification also cause freezing at
66067 the end of the immediately enclosing declaration list.
66068
66069 8/3
66070 {8652/00468652/0046} {AI95-00106-01AI95-00106-01}
66071 {AI05-0177-1AI05-0177-1} {AI05-0183-1AI05-0183-1} A static expression
66072 (other than within an aspect_specification) causes freezing where it
66073 occurs. An object name or nonstatic expression causes freezing where it
66074 occurs, unless the name or expression is part of a default_expression, a
66075 default_name, the expression of an expression function, an
66076 aspect_specification, or a per-object expression of a component's
66077 constraint, in which case, the freezing occurs later as part of another
66078 construct or at the freezing point of an associated entity.
66079
66080 8.1/3
66081 {8652/00468652/0046} {AI95-00106-01AI95-00106-01}
66082 {AI05-0019-1AI05-0019-1} An implicit call freezes the same entities and
66083 profiles that would be frozen by an explicit call. This is true even if
66084 the implicit call is removed via implementation permissions.
66085
66086 8.2/1
66087 {8652/00468652/0046} {AI95-00106-01AI95-00106-01} If an expression is
66088 implicitly converted to a type or subtype T, then at the place where the
66089 expression causes freezing, T is frozen.
66090
66091 9
66092 The following rules define which entities are frozen at the place where
66093 a construct causes freezing:
66094
66095 10
66096 * At the place where an expression causes freezing, the type of the
66097 expression is frozen, unless the expression is an enumeration
66098 literal used as a discrete_choice of the array_aggregate (*note
66099 4.3.3: S0113.) of an enumeration_representation_clause (*note 13.4:
66100 S0310.).
66101
66102 10.a
66103 Reason: We considered making enumeration literals never cause
66104 freezing, which would be more upward compatible, but examples
66105 like the variant record aggregate (Discrim => Red, ...)
66106 caused us to change our mind. Furthermore, an enumeration
66107 literal is a static expression, so the implementation should
66108 be allowed to represent it using its representation.
66109
66110 10.b
66111 Ramification: The following pathological example was legal in
66112 Ada 83, but is illegal in Ada 95:
66113
66114 10.c
66115 package P1 is
66116 type T is private;
66117 package P2 is
66118 type Composite(D : Boolean) is
66119 record
66120 case D is
66121 when False => Cf : Integer;
66122 when True => Ct : T;
66123 end case;
66124 end record;
66125 end P2;
66126 X : Boolean := P2."="( (False,1), (False,1) );
66127 private
66128 type T is array(1..Func_Call) of Integer;
66129 end;
66130
66131 10.d
66132 In Ada 95, the declaration of X freezes Composite (because it
66133 contains an expression of that type), which in turn freezes T
66134 (even though Ct does not exist in this particular case). But
66135 type T is not completely defined at that point, violating the
66136 rule that a type shall be completely defined before it is
66137 frozen. In Ada 83, on the other hand, there is no occurrence
66138 of the name T, hence no forcing occurrence of T.
66139
66140 10.1/3
66141 * {AI05-0019-1AI05-0019-1} {AI05-0177-1AI05-0177-1} At the place
66142 where a function call causes freezing, the profile of the function
66143 is frozen. Furthermore, if a parameter of the call is defaulted,
66144 the default_expression for that parameter causes freezing. If the
66145 function call is to an expression function, the expression of the
66146 expression function causes freezing.
66147
66148 10.e/3
66149 Reason: {AI05-0019-1AI05-0019-1} This is the important rule
66150 for profile freezing: a call freezes the profile. That's
66151 because generating the call will need to know how the
66152 parameters are passed, and that will require knowing details
66153 of the types. Other uses of subprograms do not need to know
66154 about the parameters, and thus only freeze the subprogram, and
66155 not the profile.
66156
66157 10.f/3
66158 Note that we don't need to consider procedure or entry calls,
66159 since a body freezes everything that precedes it, and the end
66160 of a declarative part freezes everything in the declarative
66161 part.
66162
66163 10.g/3
66164 Ramification: {AI05-0177-1AI05-0177-1} Freezing of the
66165 expression of an expression function only needs to be
66166 considered when the expression function is in the same
66167 compilation unit and there are no intervening bodies; the end
66168 of a declarative_part or library package freezes everything in
66169 it, and a body freezes everything declared before it.
66170
66171 10.2/3
66172 * {AI05-0019-1AI05-0019-1} {AI05-0177-1AI05-0177-1}
66173 {AI05-0296-1AI05-0296-1} At the place where a generic_instantiation
66174 causes freezing of a callable entity, the profile of that entity is
66175 frozen unless the formal subprogram corresponding to the callable
66176 entity has a parameter or result of a formal untagged incomplete
66177 type; if the callable entity is an expression function, the
66178 expression of the expression function causes freezing.
66179
66180 10.h/3
66181 Reason: Elaboration of the generic might call the actual for
66182 one of its formal subprograms, so we need to know the profile
66183 and (for an expression function) expression.
66184
66185 10.3/3
66186 * {AI05-0177-1AI05-0177-1} At the place where a use of the Access or
66187 Unchecked_Access attribute whose prefix denotes an expression
66188 function causes freezing, the expression of the expression function
66189 causes freezing.
66190
66191 10.i/3
66192 Reason: This is needed to avoid calls to unfrozen expressions.
66193 Consider:
66194
66195 10.j/3
66196 package Pack is
66197
66198 10.k/3
66199 type Flub is range 0 .. 100;
66200
66201 10.l/3
66202 function Foo (A : in Natural) return Natural is
66203 (A + Flub'Size); -- The expression is not frozen here.
66204
66205 10.m/3
66206 type Bar is access function Foo (A : in Natural) return Natural;
66207
66208 10.n/3
66209 P : Bar := Foo'Access; -- (A)
66210
66211 10.o/3
66212 Val : Natural := P.all(5); -- (B)
66213
66214 10.p/3
66215 end Pack;
66216
66217 10.q/3
66218 If point (A) did not freeze the expression of Foo (which
66219 freezes Flub), then the call at point (B) would be depending
66220 on the aspects of the unfrozen type Flub. That would be bad.
66221
66222 11
66223 * At the place where a name causes freezing, the entity denoted by
66224 the name is frozen, unless the name is a prefix of an expanded
66225 name; at the place where an object name causes freezing, the
66226 nominal subtype associated with the name is frozen.
66227
66228 11.a/2
66229 Ramification: {AI95-00114-01AI95-00114-01} This only matters
66230 in the presence of deferred constants or access types; an
66231 object_declaration other than a deferred constant declaration
66232 causes freezing of the nominal subtype, plus all component
66233 junk.
66234
66235 11.b/1
66236 This paragraph was deleted.{8652/00468652/0046}
66237 {AI95-00106-01AI95-00106-01}
66238
66239 11.1/1
66240 * {8652/00468652/0046} {AI95-00106-01AI95-00106-01} At the place
66241 where an implicit_dereference causes freezing, the nominal subtype
66242 associated with the implicit_dereference is frozen.
66243
66244 11.c/2
66245 Discussion: This rule ensures that X.D freezes the same
66246 entities that X.all.D does. Note that an implicit_dereference
66247 is neither a name nor expression by itself, so it isn't
66248 covered by other rules.
66249
66250 12
66251 * [ At the place where a range causes freezing, the type of the range
66252 is frozen.]
66253
66254 12.a
66255 Proof: This is consequence of the facts that expressions
66256 freeze their type, and the Range attribute is defined to be
66257 equivalent to a pair of expressions separated by "..".}
66258
66259 13
66260 * At the place where an allocator causes freezing, the designated
66261 subtype of its type is frozen. If the type of the allocator is a
66262 derived type, then all ancestor types are also frozen.
66263
66264 13.a
66265 Ramification: Allocators also freeze the named subtype, as a
66266 consequence of other rules.
66267
66268 13.b
66269 The ancestor types are frozen to prevent things like this:
66270
66271 13.c
66272 type Pool_Ptr is access System.Storage_Pools.Root_Storage_Pool'Class;
66273 function F return Pool_Ptr;
66274
66275 13.d
66276 package P is
66277 type A1 is access Boolean;
66278 type A2 is new A1;
66279 type A3 is new A2;
66280 X : A3 := new Boolean; -- Don't know what pool yet!
66281 for A1'Storage_Pool use F.all;
66282 end P;
66283
66284 13.e
66285 This is necessary because derived access types share their
66286 parent's pool.
66287
66288 14/3
66289 * {AI05-0019-1AI05-0019-1} At the place where a profile is frozen,
66290 each subtype of the profile is frozen. If the corresponding
66291 callable entity is a member of an entry family, the index subtype
66292 of the family is frozen.
66293
66294 14.a/3
66295 This paragraph was deleted.
66296
66297 15
66298 * At the place where a subtype is frozen, its type is frozen. At the
66299 place where a type is frozen, any expressions or names within the
66300 full type definition cause freezing; the first subtype, and any
66301 component subtypes, index subtypes, and parent subtype of the type
66302 are frozen as well. For a specific tagged type, the corresponding
66303 class-wide type is frozen as well. For a class-wide type, the
66304 corresponding specific type is frozen as well.
66305
66306 15.a
66307 Ramification: Freezing a type needs to freeze its first
66308 subtype in order to preserve the property that the
66309 subtype-specific aspects of statically matching subtypes are
66310 the same.
66311
66312 15.b
66313 Freezing an access type does not freeze its designated
66314 subtype.
66315
66316 15.1/3
66317 * {AI95-00341-01AI95-00341-01} {AI05-0019-1AI05-0019-1} At the place
66318 where a specific tagged type is frozen, the primitive subprograms
66319 of the type are frozen. At the place where a type is frozen, any
66320 subprogram named in an attribute_definition_clause for the type is
66321 frozen.
66322
66323 15.c/2
66324 Reason: We have a language design principle that all of the
66325 details of a specific tagged type are known at its freezing
66326 point. But that is only true if the primitive subprograms are
66327 frozen at this point as well. Late changes of Import and
66328 address clauses violate the principle.
66329
66330 15.d/2
66331 Implementation Note: This rule means that no implicit call to
66332 Initialize or Adjust can freeze a subprogram (the type and
66333 thus subprograms would have been frozen at worst at the same
66334 point).
66335
66336 15.e/3
66337 Discussion: {AI05-0019-1AI05-0019-1} The second sentence is
66338 the rule that makes it possible to check that only subprograms
66339 with convention Ada are specified in
66340 attribute_definition_clauses without jumping through hoops.
66341
66342 _Legality Rules_
66343
66344 16
66345 [The explicit declaration of a primitive subprogram of a tagged type
66346 shall occur before the type is frozen (see *note 3.9.2::).]
66347
66348 16.a
66349 Reason: This rule is needed because (1) we don't want people
66350 dispatching to things that haven't been declared yet, and (2)
66351 we want to allow tagged type descriptors to be static
66352 (allocated statically, and initialized to link-time-known
66353 symbols). Suppose T2 inherits primitive P from T1, and then
66354 overrides P. Suppose P is called before the declaration of the
66355 overriding P. What should it dispatch to? If the answer is
66356 the new P, we've violated the first principle above. If the
66357 answer is the old P, we've violated the second principle. (A
66358 call to the new one necessarily raises Program_Error, but
66359 that's beside the point.)
66360
66361 16.b
66362 Note that a call upon a dispatching operation of type T will
66363 freeze T.
66364
66365 16.c
66366 We considered applying this rule to all derived types, for
66367 uniformity. However, that would be upward incompatible, so we
66368 rejected the idea. As in Ada 83, for an untagged type, the
66369 above call upon P will call the old P (which is arguably
66370 confusing).
66371
66372 16.d/3
66373 To be honest: {AI05-0222-1AI05-0222-1} This rule only applies
66374 to "original" declarations and not to the completion of a
66375 primitive subprogram, even though a completion is technically
66376 an explicit declaration, and it may declare a primitive
66377 subprogram.
66378
66379 17
66380 [A type shall be completely defined before it is frozen (see *note
66381 3.11.1:: and *note 7.3::).]
66382
66383 18
66384 [The completion of a deferred constant declaration shall occur before
66385 the constant is frozen (see *note 7.4::).]
66386
66387 18.a/3
66388 Proof: {AI95-00114-01AI95-00114-01} {AI05-0299-1AI05-0299-1}
66389 The above Legality Rules are stated "officially" in the
66390 referenced subclauses.
66391
66392 19/1
66393 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} An operational or
66394 representation item that directly specifies an aspect of an entity shall
66395 appear before the entity is frozen (see *note 13.1::).
66396
66397 19.a/1
66398 Discussion: {8652/00098652/0009} {AI95-00137-01AI95-00137-01}
66399 From RM83-13.1(7). The wording here forbids freezing within
66400 the aspect_clause itself, which was not true of the Ada 83
66401 wording. The wording of this rule is carefully written to
66402 work properly for type-related representation items. For
66403 example, an enumeration_representation_clause (*note 13.4:
66404 S0310.) is illegal after the type is frozen, even though the
66405 _clause refers to the first subtype.
66406
66407 19.a.1/2
66408 {AI95-00114-01AI95-00114-01} The above Legality Rule is stated
66409 for types and subtypes in *note 13.1::, but the rule here
66410 covers all other entities as well.
66411
66412 19.b/2
66413 This paragraph was deleted.{AI95-00114-01AI95-00114-01}
66414
66415 19.c
66416 Discussion: Here's an example that illustrates when freezing
66417 occurs in the presence of defaults:
66418
66419 19.d
66420 type T is ...;
66421 function F return T;
66422 type R is
66423 record
66424 C : T := F;
66425 D : Boolean := F = F;
66426 end record;
66427 X : R;
66428
66429 19.e
66430 Since the elaboration of R's declaration does not allocate
66431 component C, there is no need to freeze C's subtype at that
66432 place. Similarly, since the elaboration of R does not
66433 evaluate the default_expression "F = F", there is no need to
66434 freeze the types involved at that point. However, the
66435 declaration of X does need to freeze these things. Note that
66436 even if component C did not exist, the elaboration of the
66437 declaration of X would still need information about T -- even
66438 though D is not of type T, its default_expression requires
66439 that information.
66440
66441 19.f/3
66442 Ramification: {AI05-0299-1AI05-0299-1} Although we define
66443 freezing in terms of the program text as a whole (i.e. after
66444 applying the rules of Clause *note 10::), the freezing rules
66445 actually have no effect beyond compilation unit boundaries.
66446
66447 19.g/3
66448 Reason: {AI05-0299-1AI05-0299-1} That is important, because
66449 Clause *note 10:: allows some implementation definedness in
66450 the order of things, and we don't want the freezing rules to
66451 be implementation defined.
66452
66453 19.h
66454 Ramification: These rules also have no effect in statements --
66455 they only apply within a single declarative_part,
66456 package_specification, task_definition, protected_definition,
66457 or protected_body.
66458
66459 19.i
66460 Implementation Note: An implementation may choose to generate
66461 code for default_expressions and default_names in line at the
66462 place of use. Alternatively, an implementation may choose to
66463 generate thunks (subprograms implicitly generated by the
66464 compiler) for evaluation of defaults. Thunk generation
66465 cannot, in general, be done at the place of the declaration
66466 that includes the default. Instead, they can be generated at
66467 the first freezing point of the type(s) involved. (It is
66468 impossible to write a purely one-pass Ada compiler, for
66469 various reasons. This is one of them -- the compiler needs to
66470 store a representation of defaults in its symbol table, and
66471 then walk that representation later, no earlier than the first
66472 freezing point.)
66473
66474 19.j
66475 In implementation terms, the linear elaboration model can be
66476 thought of as preventing uninitialized dope. For example, the
66477 implementation might generate dope to contain the size of a
66478 private type. This dope is initialized at the place where the
66479 type becomes completely defined. It cannot be initialized
66480 earlier, because of the order-of-elaboration rules. The
66481 freezing rules prevent elaboration of earlier declarations
66482 from accessing the size dope for a private type before it is
66483 initialized.
66484
66485 19.k
66486 *note 2.8:: overrides the freezing rules in the case of
66487 unrecognized pragmas.
66488
66489 19.l/1
66490 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} An
66491 aspect_clause for an entity should most certainly not be a
66492 freezing point for the entity.
66493
66494 _Dynamic Semantics_
66495
66496 20/2
66497 {AI95-00279-01AI95-00279-01} The tag (see *note 3.9::) of a tagged type
66498 T is created at the point where T is frozen.
66499
66500 _Incompatibilities With Ada 83_
66501
66502 20.a
66503 RM83 defines a forcing occurrence of a type as follows: "A
66504 forcing occurrence is any occurrence [of the name of the type,
66505 subtypes of the type, or types or subtypes with subcomponents
66506 of the type] other than in a type or subtype declaration, a
66507 subprogram specification, an entry declaration, a deferred
66508 constant declaration, a pragma, or a representation_clause for
66509 the type itself. In any case, an occurrence within an
66510 expression is always forcing."
66511
66512 20.b
66513 It seems like the wording allows things like this:
66514
66515 20.c
66516 type A is array(Integer range 1..10) of Boolean;
66517 subtype S is Integer range A'Range;
66518 -- not forcing for A
66519
66520 20.d
66521 Occurrences within pragmas can cause freezing in Ada 95.
66522 (Since such pragmas are ignored in Ada 83, this will probably
66523 fix more bugs than it causes.)
66524
66525 _Extensions to Ada 83_
66526
66527 20.e
66528 In Ada 95, generic_formal_parameter_declarations do not
66529 normally freeze the entities from which they are defined. For
66530 example:
66531
66532 20.f
66533 package Outer is
66534 type T is tagged limited private;
66535 generic
66536 type T2 is
66537 new T with private; -- Does not freeze T
66538 -- in Ada 95.
66539 package Inner is
66540 ...
66541 end Inner;
66542 private
66543 type T is ...;
66544 end Outer;
66545
66546 20.g
66547 This is important for the usability of generics. The above
66548 example uses the Ada 95 feature of formal derived types.
66549 Examples using the kinds of formal parameters already allowed
66550 in Ada 83 are well known. See, for example, comments 83-00627
66551 and 83-00688. The extensive use expected for formal derived
66552 types makes this issue even more compelling than described by
66553 those comments. Unfortunately, we are unable to solve the
66554 problem that explicit_generic_actual_parameters cause
66555 freezing, even though a package equivalent to the instance
66556 would not cause freezing. This is primarily because such an
66557 equivalent package would have its body in the body of the
66558 containing program unit, whereas an instance has its body
66559 right there.
66560
66561 _Wording Changes from Ada 83_
66562
66563 20.h
66564 The concept of freezing is based on Ada 83's concept of
66565 "forcing occurrences." The first freezing point of an entity
66566 corresponds roughly to the place of the first forcing
66567 occurrence, in Ada 83 terms. The reason for changing the
66568 terminology is that the new rules do not refer to any
66569 particular "occurrence" of a name of an entity. Instead, we
66570 refer to "uses" of an entity, which are sometimes implicit.
66571
66572 20.i
66573 In Ada 83, forcing occurrences were used only in rules about
66574 representation_clauses. We have expanded the concept to cover
66575 private types, because the rules stated in RM83-7.4.1(4) are
66576 almost identical to the forcing occurrence rules.
66577
66578 20.j
66579 The Ada 83 rules are changed in Ada 95 for the following
66580 reasons:
66581
66582 20.k
66583 * The Ada 83 rules do not work right for subtype-specific
66584 aspects. In an earlier version of Ada 9X, we considered
66585 allowing representation items to apply to subtypes other
66586 than the first subtype. This was part of the reason for
66587 changing the Ada 83 rules. However, now that we have
66588 dropped that functionality, we still need the rules to be
66589 different from the Ada 83 rules.
66590
66591 20.l
66592 * The Ada 83 rules do not achieve the intended effect. In
66593 Ada 83, either with or without the AIs, it is possible to
66594 force the compiler to generate code that references
66595 uninitialized dope, or force it to detect erroneousness
66596 and exception raising at compile time.
66597
66598 20.m
66599 * It was a goal of Ada 83 to avoid uninitialized access
66600 values. However, in the case of deferred constants, this
66601 goal was not achieved.
66602
66603 20.n
66604 * The Ada 83 rules are not only too weak -- they are also
66605 too strong. They allow loopholes (as described above),
66606 but they also prevent certain kinds of
66607 default_expressions that are harmless, and certain kinds
66608 of generic_declarations that are both harmless and very
66609 useful.
66610
66611 20.o/2
66612 * {AI95-00114-01AI95-00114-01} Ada 83 had a case where an
66613 aspect_clause had a strong effect on the semantics of the
66614 program -- 'Small. This caused certain semantic
66615 anomalies. There are more cases in Ada 95, because the
66616 attribute_definition_clause has been generalized.
66617
66618 _Incompatibilities With Ada 95_
66619
66620 20.p/2
66621 {8652/00468652/0046} {AI95-00106-01AI95-00106-01}
66622 {AI95-00341-01AI95-00341-01} Corrigendum: Various freezing
66623 rules were added to fix holes in the rules. Most importantly,
66624 implicit calls are now freezing, which make some
66625 representation clauses illegal in Ada 2005 that were legal
66626 (but dubious) in Ada 95. Amendment Correction: Similarly, the
66627 primitive subprograms of a specific tagged type are frozen
66628 when the type is frozen, preventing dubious convention changes
66629 (and address clauses) after the freezing point. In both
66630 cases, the code is dubious and the workaround is easy.
66631
66632 _Wording Changes from Ada 95_
66633
66634 20.q/2
66635 {8652/00098652/0009} {AI95-00137-01AI95-00137-01} Corrigendum:
66636 Added wording to specify that both operational and
66637 representation attributes must be specified before the type is
66638 frozen.
66639
66640 20.r/2
66641 {AI95-00251-01AI95-00251-01} Added wording that declaring a
66642 specific descendant of an interface type freezes the interface
66643 type.
66644
66645 20.s/2
66646 {AI95-00279-01AI95-00279-01} Added wording that defines when a
66647 tag is created for a type (at the freezing point of the type).
66648 This is used to specify checking for uncreated tags (see *note
66649 3.9::).
66650
66651 _Incompatibilities With Ada 2005_
66652
66653 20.t/3
66654 {AI05-0019-1AI05-0019-1} Correction: Separated the freezing of
66655 the profile from the rest of a subprogram, in order to reduce
66656 the impact of the Ada 95 incompatibility noted above. (The
66657 effects were much more limiting than expected.)
66658
66659 _Wording Changes from Ada 2005_
66660
66661 20.u/3
66662 {AI05-0017-1AI05-0017-1} Correction: Reworded so that
66663 incomplete types with a deferred completion aren't prematurely
66664 frozen.
66665
66666 20.v/3
66667 {AI05-0177-1AI05-0177-1} Added freezing rules for expression
66668 functions; these are frozen at the point of call, not the
66669 point of declaration, like default expressions.
66670
66671 20.w/3
66672 {AI05-0183-1AI05-0183-1} Added freezing rules for
66673 aspect_specifications; these are frozen at the freezing point
66674 of the associated entity, not the point of declaration.
66675
66676 20.x/3
66677 {AI05-0213-1AI05-0213-1} Added freezing rules for formal
66678 incomplete types; the corresponding actual is not frozen.
66679
66680 \1f
66681 File: aarm2012.info, Node: Annex A, Next: Annex B, Prev: 13, Up: Top
66682
66683 Annex A Predefined Language Environment
66684 ***************************************
66685
66686 1
66687 [ This Annex contains the specifications of library units that shall be
66688 provided by every implementation. There are three root library units:
66689 Ada, Interfaces, and System; other library units are children of these:]
66690
66691 2/3
66692 {8652/00478652/0047} {AI95-00081-01AI95-00081-01}
66693 {AI95-00424-01AI95-00424-01} {AI05-0001-1AI05-0001-1}
66694 {AI05-0049-1AI05-0049-1} {AI05-0069-1AI05-0069-1}
66695 {AI05-0111-3AI05-0111-3} {AI05-0136-1AI05-0136-1}
66696 {AI05-0137-1AI05-0137-1} {AI05-0166-1AI05-0166-1}
66697 {AI05-0168-1AI05-0168-1}
66698
66699
66700 [Standard -- *note A.1::
66701 Ada -- *note A.2::
66702 Assertions -- *note 11.4.2::
66703 Asynchronous_Task_Control -- *note D.11::
66704 Calendar -- *note 9.6::
66705 Arithmetic -- *note 9.6.1::
66706 Formatting -- *note 9.6.1::
66707 Time_Zones -- *note 9.6.1::
66708 Characters -- *note A.3.1::
66709 Conversions -- *note A.3.4::
66710 Handling -- *note A.3.2::
66711 Latin_1 -- *note A.3.3::
66712 Command_Line -- *note A.15::
66713 Complex_Text_IO -- *note G.1.3::
66714 Containers -- *note A.18.1::
66715 Bounded_Doubly_Linked_Lists
66716 -- *note A.18.20::
66717 Bounded_Hashed_Maps -- *note A.18.21::
66718 Bounded_Hashed_Sets -- *note A.18.23::
66719 Bounded_Multiway_Trees -- *note A.18.25::
66720 Bounded_Ordered_Maps -- *note A.18.22::
66721 Bounded_Ordered_Sets -- *note A.18.24::
66722 Bounded_Priority_Queues -- *note A.18.31::
66723 Bounded_Synchronized_Queues
66724 -- *note A.18.29::
66725 Bounded_Vectors -- *note A.18.19::
66726 Doubly_Linked_Lists -- *note A.18.3::
66727 Generic_Array_Sort -- *note A.18.26::
66728 Generic_Constrained_Array_Sort
66729 -- *note A.18.26::
66730 Generic_Sort -- *note A.18.26::
66731 Hashed_Maps -- *note A.18.5::
66732 Hashed_Sets -- *note A.18.8::
66733 Indefinite_Doubly_Linked_Lists
66734 -- *note A.18.12::
66735 Indefinite_Hashed_Maps -- *note A.18.13::
66736 Indefinite_Hashed_Sets -- *note A.18.15::
66737 Indefinite_Holders -- *note A.18.18::
66738 Indefinite_Multiway_Trees -- *note A.18.17::
66739 Indefinite_Ordered_Maps -- *note A.18.14::
66740 Indefinite_Ordered_Sets -- *note A.18.16::
66741 Indefinite_Vectors -- *note A.18.11::
66742
66743 Standard (...continued)
66744 Ada (...continued)
66745 Containers (...continued)
66746 Multiway_Trees -- *note A.18.10::
66747 Ordered_Maps -- *note A.18.6::
66748 Ordered_Sets -- *note A.18.9::
66749 Synchronized_Queue_Interfaces
66750 -- *note A.18.27::
66751 Unbounded_Priority_Queues
66752 -- *note A.18.30::
66753 Unbounded_Synchronized_Queues
66754 -- *note A.18.28::
66755 Vectors -- *note A.18.2::
66756 Decimal -- *note F.2::
66757 Direct_IO -- *note A.8.4::
66758 Directories -- *note A.16::
66759 Hierarchical_File_Names -- *note A.16.1::
66760 Information -- *note A.16::
66761 Dispatching -- *note D.2.1::
66762 EDF -- *note D.2.6::
66763 Non_Preemptive -- *note D.2.4::
66764 Round_Robin -- *note D.2.5::
66765 Dynamic_Priorities -- *note D.5.1::
66766 Environment_Variables -- *note A.17::
66767 Exceptions -- *note 11.4.1::
66768 Execution_Time -- *note D.14::
66769 Group_Budgets -- *note D.14.2::
66770 Interrupts -- *note D.14.3::
66771 Timers -- *note D.14.1::
66772 Finalization -- *note 7.6::
66773 Float_Text_IO -- *note A.10.9::
66774 Float_Wide_Text_IO -- *note A.11::
66775 Float_Wide_Wide_Text_IO -- *note A.11::
66776 Integer_Text_IO -- *note A.10.8::
66777 Integer_Wide_Text_IO -- *note A.11::
66778 Integer_Wide_Wide_Text_IO -- *note A.11::
66779 Interrupts -- *note C.3.2::
66780 Names -- *note C.3.2::
66781 IO_Exceptions -- *note A.13::
66782 Iterator_Interfaces -- *note 5.5.1::
66783 Locales -- *note A.19::
66784
66785 Standard (...continued)
66786 Ada (...continued)
66787 Numerics -- *note A.5::
66788 Complex_Arrays -- *note G.3.2::
66789 Complex_Elementary_Functions -- *note G.1.2::
66790 Complex_Types -- *note G.1.1::
66791 Discrete_Random -- *note A.5.2::
66792 Elementary_Functions -- *note A.5.1::
66793 Float_Random -- *note A.5.2::
66794 Generic_Complex_Arrays -- *note G.3.2::
66795 Generic_Complex_Elementary_Functions
66796 -- *note G.1.2::
66797 Generic_Complex_Types -- *note G.1.1::
66798 Generic_Elementary_Functions -- *note A.5.1::
66799 Generic_Real_Arrays -- *note G.3.1::
66800 Real_Arrays -- *note G.3.1::
66801 Real_Time -- *note D.8::
66802 Timing_Events -- *note D.15::
66803 Sequential_IO -- *note A.8.1::
66804 Storage_IO -- *note A.9::
66805 Streams -- *note 13.13.1::
66806 Stream_IO -- *note A.12.1::
66807 Strings -- *note A.4.1::
66808 Bounded -- *note A.4.4::
66809 Equal_Case_Insensitive -- *note A.4.10::
66810 Hash -- *note A.4.9::
66811 Hash_Case_Insensitive -- *note A.4.9::
66812 Less_Case_Insensitive -- *note A.4.10::
66813 Fixed -- *note A.4.3::
66814 Equal_Case_Insensitive -- *note A.4.10::
66815 Hash -- *note A.4.9::
66816 Hash_Case_Insensitive -- *note A.4.9::
66817 Less_Case_Insensitive -- *note A.4.10::
66818 Equal_Case_Insensitive -- *note A.4.10::
66819 Hash -- *note A.4.9::
66820 Hash_Case_Insensitive -- *note A.4.9::
66821 Less_Case_Insensitive -- *note A.4.10::
66822 Maps -- *note A.4.2::
66823 Constants -- *note A.4.6::
66824 Unbounded -- *note A.4.5::
66825 Equal_Case_Insensitive -- *note A.4.10::
66826 Hash -- *note A.4.9::
66827 Hash_Case_Insensitive -- *note A.4.9::
66828 Less_Case_Insensitive -- *note A.4.10::
66829 UTF_Encoding -- *note A.4.11::
66830 Conversions -- *note A.4.11::
66831 Strings -- *note A.4.11::
66832 Wide_Strings -- *note A.4.11::
66833 Wide_Wide_Strings -- *note A.4.11::
66834
66835 Standard (...continued)
66836 Ada (...continued)
66837 Strings (...continued)
66838 Wide_Bounded -- *note A.4.7::
66839 Wide_Equal_Case_Insensitive
66840 -- *note A.4.7::
66841 Wide_Hash -- *note A.4.7::
66842 Wide_Hash_Case_Insensitive -- *note A.4.7::
66843 Wide_Equal_Case_Insensitive -- *note A.4.7::
66844 Wide_Fixed -- *note A.4.7::
66845 Wide_Equal_Case_Insensitive
66846 -- *note A.4.7::
66847 Wide_Hash -- *note A.4.7::
66848 Wide_Hash_Case_Insensitive -- *note A.4.7::
66849 Wide_Hash -- *note A.4.7::
66850 Wide_Hash_Case_Insensitive -- *note A.4.7::
66851 Wide_Maps -- *note A.4.7::
66852 Wide_Constants -- *note A.4.7::
66853 Wide_Unbounded -- *note A.4.7::
66854 Wide_Equal_Case_Insensitive
66855 -- *note A.4.7::
66856 Wide_Hash -- *note A.4.7::
66857 Wide_Hash_Case_Insensitive -- *note A.4.7::
66858 Wide_Wide_Bounded -- *note A.4.8::
66859 Wide_Wide_Equal_Case_Insensitive
66860 -- *note A.4.8::
66861 Wide_Wide_Hash -- *note A.4.8::
66862 Wide_Wide_Hash_Case_Insensitive
66863 -- *note A.4.8::
66864 Wide_Wide_Equal_Case_Insensitive
66865 -- *note A.4.8::
66866 Wide_Wide_Fixed -- *note A.4.8::
66867 Wide_Wide_Equal_Case_Insensitive
66868 -- *note A.4.8::
66869 Wide_Wide_Hash -- *note A.4.8::
66870 Wide_Wide_Hash_Case_Insensitive
66871 -- *note A.4.8::
66872 Wide_Wide_Hash -- *note A.4.8::
66873 Wide_Wide_Hash_Case_Insensitive
66874 -- *note A.4.8::
66875 Wide_Wide_Maps -- *note A.4.8::
66876 Wide_Wide_Constants -- *note A.4.8::
66877 Wide_Wide_Unbounded -- *note A.4.8::
66878 Wide_Wide_Equal_Case_Insensitive
66879 -- *note A.4.8::
66880 Wide_Wide_Hash -- *note A.4.8::
66881 Wide_Wide_Hash_Case_Insensitive
66882 -- *note A.4.8::
66883 Synchronous_Barriers -- *note D.10.1::
66884 Synchronous_Task_Control -- *note D.10::
66885 EDF -- *note D.10::
66886
66887 Standard (...continued)
66888 Ada (...continued)
66889 Tags -- *note 3.9::
66890 Generic_Dispatching_Constructor -- *note 3.9::
66891 Task_Attributes -- *note C.7.2::
66892 Task_Identification -- *note C.7.1::
66893 Task_Termination -- *note C.7.3::
66894 Text_IO -- *note A.10.1::
66895 Bounded_IO -- *note A.10.11::
66896 Complex_IO -- *note G.1.3::
66897 Editing -- *note F.3.3::
66898 Text_Streams -- *note A.12.2::
66899 Unbounded_IO -- *note A.10.12::
66900 Unchecked_Conversion -- *note 13.9::
66901 Unchecked_Deallocate_Subpool -- *note 13.11.5::
66902 Unchecked_Deallocation -- *note 13.11.2::
66903 Wide_Characters -- *note A.3.1::
66904 Handling -- *note A.3.5::
66905 Wide_Text_IO -- *note A.11::
66906 Complex_IO -- *note G.1.4::
66907 Editing -- *note F.3.4::
66908 Text_Streams -- *note A.12.3::
66909 Wide_Bounded_IO -- *note A.11::
66910 Wide_Unbounded_IO -- *note A.11::
66911 Wide_Wide_Characters -- *note A.3.1::
66912 Handling -- *note A.3.6::
66913 Wide_Wide_Text_IO -- *note A.11::
66914 Complex_IO -- *note G.1.5::
66915 Editing -- *note F.3.5::
66916 Text_Streams -- *note A.12.4::
66917 Wide_Wide_Bounded_IO -- *note A.11::
66918 Wide_Wide_Unbounded_IO -- *note A.11::
66919
66920 Interfaces -- *note B.2::
66921 C -- *note B.3::
66922 Pointers -- *note B.3.2::
66923 Strings -- *note B.3.1::
66924 COBOL -- *note B.4::
66925 Fortran -- *note B.5::
66926
66927 System -- *note 13.7::
66928 Address_To_Access_Conversions -- *note 13.7.2::
66929 Machine_Code -- *note 13.8::
66930 Multiprocessors -- *note D.16::
66931 Dispatching_Domains -- *note D.16.1::
66932 RPC -- *note E.5::
66933 Storage_Elements -- *note 13.7.1::
66934 Storage_Pools -- *note 13.11::
66935 Subpools -- *note 13.11.4::]
66936
66937 2.a
66938 Discussion: In running text, we generally leave out the "Ada."
66939 when referring to a child of Ada.
66940
66941 2.b
66942 Reason: We had no strict rule for which of Ada, Interfaces, or
66943 System should be the parent of a given library unit. However,
66944 we have tried to place as many things as possible under Ada,
66945 except that interfacing is a separate category, and we have
66946 tried to place library units whose use is highly nonportable
66947 under System.
66948
66949 _Implementation Requirements_
66950
66951 3/2
66952 {AI95-00434-01AI95-00434-01} The implementation shall ensure that each
66953 language-defined subprogram is reentrant in the sense that concurrent
66954 calls on the same subprogram perform as specified, so long as all
66955 parameters that could be passed by reference denote nonoverlapping
66956 objects.
66957
66958 3.a
66959 Ramification: For example, simultaneous calls to Text_IO.Put
66960 will work properly, so long as they are going to two different
66961 files. On the other hand, simultaneous output to the same
66962 file constitutes erroneous use of shared variables.
66963
66964 3.b
66965 To be honest: Here, "language defined subprogram" means a
66966 language defined library subprogram, a subprogram declared in
66967 the visible part of a language defined library package, an
66968 instance of a language defined generic library subprogram, or
66969 a subprogram declared in the visible part of an instance of a
66970 language defined generic library package.
66971
66972 3.c
66973 Ramification: The rule implies that any data local to the
66974 private part or body of the package has to be somehow
66975 protected against simultaneous access.
66976
66977 3.1/3
66978 {AI05-0048-1AI05-0048-1} If a descendant of a language-defined tagged
66979 type is declared, the implementation shall ensure that each inherited
66980 language-defined subprogram behaves as described in this International
66981 Standard. In particular, overriding a language-defined subprogram shall
66982 not alter the effect of any inherited language-defined subprogram.
66983
66984 3.d/3
66985 Reason: This means that internally the implementation must not
66986 do redispatching unless it is required by the Standard. So
66987 when we say that some subprogram Bar is equivalent to Foo,
66988 overriding Foo for a derived type doesn't change the semantics
66989 of Bar, and in particular it means that Bar may no longer be
66990 equivalent to Foo. The word "equivalent" is always a bit of a
66991 lie anyway.
66992
66993 _Implementation Permissions_
66994
66995 4
66996 The implementation may restrict the replacement of language-defined
66997 compilation units. The implementation may restrict children of
66998 language-defined library units (other than Standard).
66999
67000 4.a
67001 Ramification: For example, the implementation may say, "you
67002 cannot compile a library unit called System" or "you cannot
67003 compile a child of package System" or "if you compile a
67004 library unit called System, it has to be a package, and it has
67005 to contain at least the following declarations: ...".
67006
67007 _Wording Changes from Ada 83_
67008
67009 4.b
67010 Many of Ada 83's language-defined library units are now
67011 children of Ada or System. For upward compatibility, these
67012 are renamed as root library units (see *note J.1::).
67013
67014 4.c
67015 The order and lettering of the annexes has been changed.
67016
67017 _Wording Changes from Ada 95_
67018
67019 4.d/2
67020 {8652/00478652/0047} {AI95-00081-01AI95-00081-01} Corrigendum:
67021 Units missing from the list of predefined units were added.
67022
67023 4.e/2
67024 {AI95-00424-01AI95-00424-01} Added new units to the list of
67025 predefined units.
67026
67027 _Wording Changes from Ada 2005_
67028
67029 4.f/3
67030 {AI05-0048-1AI05-0048-1} Correction: Added wording to ban
67031 redispatching unless it is explicitly required, in order to
67032 safeguard portability when overriding language-defined
67033 routines.
67034
67035 4.g/3
67036 {AI05-0060-1AI05-0060-1} {AI05-0206-1AI05-0206-1} Correction:
67037 Added a permission to omit pragma Remote_Types from
67038 language-defined units if Annex E is not supported. This was
67039 later removed, as a better method of supporting the reason is
67040 now available. Note that this requires all implementations to
67041 provide minimal support for the Remote_Types categorization
67042 even if Annex E is not supported; being unable to compile
67043 language-defined units is not allowed.
67044
67045 4.h/3
67046 {AI05-0001-1AI05-0001-1} {AI05-0049-1AI05-0049-1}
67047 {AI05-0069-1AI05-0069-1} {AI05-0111-3AI05-0111-3}
67048 {AI05-0136-1AI05-0136-1} {AI05-0137-1AI05-0137-1}
67049 {AI05-0166-1AI05-0166-1} {AI05-0168-1AI05-0168-1} Added
67050 various new units to the list of predefined units.
67051
67052 * Menu:
67053
67054 * A.1 :: The Package Standard
67055 * A.2 :: The Package Ada
67056 * A.3 :: Character Handling
67057 * A.4 :: String Handling
67058 * A.5 :: The Numerics Packages
67059 * A.6 :: Input-Output
67060 * A.7 :: External Files and File Objects
67061 * A.8 :: Sequential and Direct Files
67062 * A.9 :: The Generic Package Storage_IO
67063 * A.10 :: Text Input-Output
67064 * A.11 :: Wide Text Input-Output and Wide Wide Text Input-Output
67065 * A.12 :: Stream Input-Output
67066 * A.13 :: Exceptions in Input-Output
67067 * A.14 :: File Sharing
67068 * A.15 :: The Package Command_Line
67069 * A.16 :: The Package Directories
67070 * A.17 :: The Package Environment_Variables
67071 * A.18 :: Containers
67072 * A.19 :: The Package Locales
67073
67074 \1f
67075 File: aarm2012.info, Node: A.1, Next: A.2, Up: Annex A
67076
67077 A.1 The Package Standard
67078 ========================
67079
67080 1/3
67081 {AI05-0299-1AI05-0299-1} This subclause outlines the specification of
67082 the package Standard containing all predefined identifiers in the
67083 language. The corresponding package body is not specified by the
67084 language.
67085
67086 2
67087 The operators that are predefined for the types declared in the package
67088 Standard are given in comments since they are implicitly declared.
67089 Italics are used for pseudo-names of anonymous types (such as root_real)
67090 and for undefined information (such as implementation-defined).
67091
67092 2.a
67093 Ramification: All of the predefined operators are of
67094 convention Intrinsic.
67095
67096 _Static Semantics_
67097
67098 3
67099 The library package Standard has the following declaration:
67100
67101 3.a
67102 Implementation defined: The names and characteristics of the
67103 numeric subtypes declared in the visible part of package
67104 Standard.
67105
67106 4
67107 package Standard is
67108 pragma Pure(Standard);
67109
67110 5
67111 type Boolean is (False, True);
67112
67113 6
67114 -- The predefined relational operators for this type are as follows:
67115
67116 7/1
67117 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} -- function "=" (Left, Right : Boolean'Base) return Boolean;
67118 -- function "/=" (Left, Right : Boolean'Base) return Boolean;
67119 -- function "<" (Left, Right : Boolean'Base) return Boolean;
67120 -- function "<=" (Left, Right : Boolean'Base) return Boolean;
67121 -- function ">" (Left, Right : Boolean'Base) return Boolean;
67122 -- function ">=" (Left, Right : Boolean'Base) return Boolean;
67123
67124 8
67125 -- The predefined logical operators and the predefined logical
67126 -- negation operator are as follows:
67127
67128 9/1
67129 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} -- function "and" (Left, Right : Boolean'Base) return Boolean'Base;
67130 -- function "or" (Left, Right : Boolean'Base) return Boolean'Base;
67131 -- function "xor" (Left, Right : Boolean'Base) return Boolean'Base;
67132
67133 10/1
67134 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} -- function "not" (Right : Boolean'Base) return Boolean'Base;
67135
67136 11/2
67137 {AI95-00434-01AI95-00434-01} -- The integer type root_integer and the
67138 -- corresponding universal type universal_integer are predefined.
67139
67140 12
67141 type Integer is range implementation-defined;
67142
67143 13
67144 subtype Natural is Integer range 0 .. Integer'Last;
67145 subtype Positive is Integer range 1 .. Integer'Last;
67146
67147 14
67148 -- The predefined operators for type Integer are as follows:
67149
67150 15
67151 -- function "=" (Left, Right : Integer'Base) return Boolean;
67152 -- function "/=" (Left, Right : Integer'Base) return Boolean;
67153 -- function "<" (Left, Right : Integer'Base) return Boolean;
67154 -- function "<=" (Left, Right : Integer'Base) return Boolean;
67155 -- function ">" (Left, Right : Integer'Base) return Boolean;
67156 -- function ">=" (Left, Right : Integer'Base) return Boolean;
67157
67158 16
67159 -- function "+" (Right : Integer'Base) return Integer'Base;
67160 -- function "-" (Right : Integer'Base) return Integer'Base;
67161 -- function "abs" (Right : Integer'Base) return Integer'Base;
67162
67163 17
67164 -- function "+" (Left, Right : Integer'Base) return Integer'Base;
67165 -- function "-" (Left, Right : Integer'Base) return Integer'Base;
67166 -- function "*" (Left, Right : Integer'Base) return Integer'Base;
67167 -- function "/" (Left, Right : Integer'Base) return Integer'Base;
67168 -- function "rem" (Left, Right : Integer'Base) return Integer'Base;
67169 -- function "mod" (Left, Right : Integer'Base) return Integer'Base;
67170
67171 18
67172 -- function "**" (Left : Integer'Base; Right : Natural)
67173 -- return Integer'Base;
67174
67175 19
67176 -- The specification of each operator for the type
67177 -- root_integer, or for any additional predefined integer
67178 -- type, is obtained by replacing Integer by the name of the type
67179 -- in the specification of the corresponding operator of the type
67180 -- Integer. The right operand of the exponentiation operator
67181 -- remains as subtype Natural.
67182
67183 20/2
67184 {AI95-00434-01AI95-00434-01} -- The floating point type root_real and the
67185 -- corresponding universal type universal_real are predefined.
67186
67187 21
67188 type Float is digits implementation-defined;
67189
67190 22
67191 -- The predefined operators for this type are as follows:
67192
67193 23
67194 -- function "=" (Left, Right : Float) return Boolean;
67195 -- function "/=" (Left, Right : Float) return Boolean;
67196 -- function "<" (Left, Right : Float) return Boolean;
67197 -- function "<=" (Left, Right : Float) return Boolean;
67198 -- function ">" (Left, Right : Float) return Boolean;
67199 -- function ">=" (Left, Right : Float) return Boolean;
67200
67201 24
67202 -- function "+" (Right : Float) return Float;
67203 -- function "-" (Right : Float) return Float;
67204 -- function "abs" (Right : Float) return Float;
67205
67206 25
67207 -- function "+" (Left, Right : Float) return Float;
67208 -- function "-" (Left, Right : Float) return Float;
67209 -- function "*" (Left, Right : Float) return Float;
67210 -- function "/" (Left, Right : Float) return Float;
67211
67212 26
67213 -- function "**" (Left : Float; Right : Integer'Base) return Float;
67214
67215 27
67216 -- The specification of each operator for the type root_real, or for
67217 -- any additional predefined floating point type, is obtained by
67218 -- replacing Float by the name of the type in the specification of the
67219 -- corresponding operator of the type Float.
67220
67221 28
67222 -- In addition, the following operators are predefined for the root
67223 -- numeric types:
67224
67225 29
67226 function "*" (Left : root_integer; Right : root_real)
67227 return root_real;
67228
67229 30
67230 function "*" (Left : root_real; Right : root_integer)
67231 return root_real;
67232
67233 31
67234 function "/" (Left : root_real; Right : root_integer)
67235 return root_real;
67236
67237 32
67238 -- The type universal_fixed is predefined.
67239 -- The only multiplying operators defined between
67240 -- fixed point types are
67241
67242 33
67243 function "*" (Left : universal_fixed; Right : universal_fixed)
67244 return universal_fixed;
67245
67246 34
67247 function "/" (Left : universal_fixed; Right : universal_fixed)
67248 return universal_fixed;
67249
67250 34.1/2
67251 {AI95-00230-01AI95-00230-01} -- The type universal_access is predefined.
67252 -- The following equality operators are predefined:
67253
67254 34.2/2
67255 {AI95-00230-01AI95-00230-01} function "=" (Left, Right: universal_access) return Boolean;
67256 function "/=" (Left, Right: universal_access) return Boolean;
67257
67258 35/3
67259 {AI95-00415-01AI95-00415-01} {AI05-0181-1AI05-0181-1} {AI05-0248-1AI05-0248-1} -- The declaration of type Character is based on the standard ISO 8859-1 character set.
67260
67261 -- There are no character literals corresponding to the positions for control characters.
67262 -- They are indicated in italics in this definition. See *note 3.5.2::.
67263
67264 type Character is
67265 (nul, soh, stx, etx, eot, enq, ack, bel, --0 (16#00#) .. 7 (16#07#)
67266 bs, ht, lf, vt, ff, cr, so, si, --8 (16#08#) .. 15 (16#0F#)
67267
67268 dle, dc1, dc2, dc3, dc4, nak, syn, etb, --16 (16#10#) .. 23 (16#17#)
67269 can, em, sub, esc, fs, gs, rs, us, --24 (16#18#) .. 31 (16#1F#)
67270
67271 ' ', '!', '"', '#', '$', '%', '&', ''', --32 (16#20#) .. 39 (16#27#)
67272 '(', ')', '*', '+', ',', '-', '.', '/', --40 (16#28#) .. 47 (16#2F#)
67273
67274 '0', '1', '2', '3', '4', '5', '6', '7', --48 (16#30#) .. 55 (16#37#)
67275 '8', '9', ':', ';', '<', '=', '>', '?', --56 (16#38#) .. 63 (16#3F#)
67276
67277 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', --64 (16#40#) .. 71 (16#47#)
67278 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', --72 (16#48#) .. 79 (16#4F#)
67279
67280 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', --80 (16#50#) .. 87 (16#57#)
67281 'X', 'Y', 'Z', '[', '\', ']', '^', '_', --88 (16#58#) .. 95 (16#5F#)
67282
67283 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', --96 (16#60#) .. 103 (16#67#)
67284 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', --104 (16#68#) .. 111 (16#6F#)
67285
67286 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', --112 (16#70#) .. 119 (16#77#)
67287 'x', 'y', 'z', '{', '|', '}', '~', del, --120 (16#78#) .. 127 (16#7F#)
67288
67289 reserved_128, reserved_129, bph, nbh, --128 (16#80#) .. 131 (16#83#)
67290 reserved_132, nel, ssa, esa, --132 (16#84#) .. 135 (16#87#)
67291 hts, htj, vts, pld, plu, ri, ss2, ss3, --136 (16#88#) .. 143 (16#8F#)
67292
67293 dcs, pu1, pu2, sts, cch, mw, spa, epa, --144 (16#90#) .. 151 (16#97#)
67294 sos, reserved_153, sci, csi, --152 (16#98#) .. 155 (16#9B#)
67295 st, osc, pm, apc, --156 (16#9C#) .. 159 (16#9F#)
67296
67297 ' ', '¡', '¢', '£', '¤', '¥', '¦', '§', --160 (16#A0#) .. 167 (16#A7#)
67298 '¨', '©', 'ª', '«', --168 (16#A8#) .. 171 (16#AB#)
67299 ¬', soft_hyphen, '®', '¯', --172 (16#AC#) .. 175 (16#AF#)
67300
67301 '°', '±', '²', '³', '´', 'µ', '¶', '·', --176 (16#B0#) .. 183 (16#B7#)
67302 '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', --184 (16#B8#) .. 191 (16#BF#)
67303
67304 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', --192 (16#C0#) .. 199 (16#C7#)
67305 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', --200 (16#C8#) .. 207 (16#CF#)
67306
67307 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', --208 (16#D0#) .. 215 (16#D7#)
67308 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', --216 (16#D8#) .. 223 (16#DF#)
67309
67310 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', --224 (16#E0#) .. 231 (16#E7#)
67311 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', --232 (16#E8#) .. 239 (16#EF#)
67312
67313 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', --240 (16#F0#) .. 247 (16#F7#)
67314 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ');--248 (16#F8#) .. 255 (16#FF#)
67315
67316 36
67317 -- The predefined operators for the type Character are the same as for
67318 -- any enumeration type.
67319
67320
67321 36.1/3
67322 {AI95-00395-01AI95-00395-01} {AI05-0266-1AI05-0266-1} -- The declaration of type Wide_Character is based on the standard ISO/IEC 10646:2011 BMP character
67323 -- set. The first 256 positions have the same contents as type Character. See *note 3.5.2::.
67324
67325 type Wide_Character is (nul, soh ... Hex_0000FFFE, Hex_0000FFFF);
67326
67327 36.2/3
67328 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} {AI05-0266-1AI05-0266-1} -- The declaration of type Wide_Wide_Character is based on the full
67329 -- ISO/IEC 10646:2011 character set. The first 65536 positions have the
67330 -- same contents as type Wide_Character. See *note 3.5.2::.
67331
67332 type Wide_Wide_Character is (nul, soh ... Hex_7FFFFFFE, Hex_7FFFFFFF);
67333 for Wide_Wide_Character'Size use 32;
67334
67335 36.3/2
67336 package ASCII is ... end ASCII; --Obsolescent; see *note J.5::
67337
67338
67339
67340 37/3
67341 {AI05-0229-1AI05-0229-1} -- Predefined string types:
67342
67343 type String is array(Positive range <>) of Character
67344 with Pack;
67345
67346 38
67347 -- The predefined operators for this type are as follows:
67348
67349 39
67350 -- function "=" (Left, Right: String) return Boolean;
67351 -- function "/=" (Left, Right: String) return Boolean;
67352 -- function "<" (Left, Right: String) return Boolean;
67353 -- function "<=" (Left, Right: String) return Boolean;
67354 -- function ">" (Left, Right: String) return Boolean;
67355 -- function ">=" (Left, Right: String) return Boolean;
67356
67357 40
67358 -- function "&" (Left: String; Right: String) return String;
67359 -- function "&" (Left: Character; Right: String) return String;
67360 -- function "&" (Left: String; Right: Character) return String;
67361 -- function "&" (Left: Character; Right: Character) return String;
67362
67363 41/3
67364 {AI05-0229-1AI05-0229-1} type Wide_String is array(Positive range <>) of Wide_Character
67365 with Pack;
67366
67367 42
67368 -- The predefined operators for this type correspond to those for String.
67369
67370 42.1/3
67371 {AI95-00285-01AI95-00285-01} {AI05-0229-1AI05-0229-1} type Wide_Wide_String is array (Positive range <>)
67372 of Wide_Wide_Character
67373 with Pack;
67374
67375 42.2/2
67376 {AI95-00285-01AI95-00285-01} -- The predefined operators for this type correspond to those for String.
67377
67378 43
67379 type Duration is delta implementation-defined range implementation-defined;
67380
67381 44
67382 -- The predefined operators for the type Duration are the same as for
67383 -- any fixed point type.
67384
67385 45
67386 -- The predefined exceptions:
67387
67388 46
67389 Constraint_Error: exception;
67390 Program_Error : exception;
67391 Storage_Error : exception;
67392 Tasking_Error : exception;
67393
67394 47
67395 end Standard;
67396
67397 48
67398 Standard has no private part.
67399
67400 48.a
67401 Reason: This is important for portability. All library
67402 packages are children of Standard, and if Standard had a
67403 private part then it would be visible to all of them.
67404
67405 49/2
67406 {AI95-00285-01AI95-00285-01} In each of the types Character,
67407 Wide_Character, and Wide_Wide_Character, the character literals for the
67408 space character (position 32) and the non-breaking space character
67409 (position 160) correspond to different values. Unless indicated
67410 otherwise, each occurrence of the character literal ' ' in this
67411 International Standard refers to the space character. Similarly, the
67412 character literals for hyphen (position 45) and soft hyphen (position
67413 173) correspond to different values. Unless indicated otherwise, each
67414 occurrence of the character literal '-' in this International Standard
67415 refers to the hyphen character.
67416
67417 _Dynamic Semantics_
67418
67419 50
67420 Elaboration of the body of Standard has no effect.
67421
67422 50.a
67423 Discussion: Note that the language does not define where this
67424 body appears in the environment declarative_part -- see *note
67425 10::, "*note 10:: Program Structure and Compilation Issues".
67426
67427 _Implementation Permissions_
67428
67429 51
67430 An implementation may provide additional predefined integer types and
67431 additional predefined floating point types. Not all of these types need
67432 have names.
67433
67434 51.a
67435 To be honest: An implementation may add representation items
67436 to package Standard, for example to specify the internal codes
67437 of type Boolean, or the Small of type Duration.
67438
67439 _Implementation Advice_
67440
67441 52
67442 If an implementation provides additional named predefined integer types,
67443 then the names should end with "Integer" as in "Long_Integer". If an
67444 implementation provides additional named predefined floating point
67445 types, then the names should end with "Float" as in "Long_Float".
67446
67447 52.a/2
67448 Implementation Advice: If an implementation provides
67449 additional named predefined integer types, then the names
67450 should end with "Integer". If an implementation provides
67451 additional named predefined floating point types, then the
67452 names should end with "Float".
67453
67454 NOTES
67455
67456 53
67457 1 Certain aspects of the predefined entities cannot be completely
67458 described in the language itself. For example, although the
67459 enumeration type Boolean can be written showing the two enumeration
67460 literals False and True, the short-circuit control forms cannot be
67461 expressed in the language.
67462
67463 54
67464 2 As explained in *note 8.1::, "*note 8.1:: Declarative Region"
67465 and *note 10.1.4::, "*note 10.1.4:: The Compilation Process", the
67466 declarative region of the package Standard encloses every library
67467 unit and consequently the main subprogram; the declaration of every
67468 library unit is assumed to occur within this declarative region.
67469 Library_items are assumed to be ordered in such a way that there
67470 are no forward semantic dependences. However, as explained in
67471 *note 8.3::, "*note 8.3:: Visibility", the only library units that
67472 are visible within a given compilation unit are the library units
67473 named by all with_clauses that apply to the given unit, and
67474 moreover, within the declarative region of a given library unit,
67475 that library unit itself.
67476
67477 55
67478 3 If all block_statements of a program are named, then the name of
67479 each program unit can always be written as an expanded name
67480 starting with Standard (unless Standard is itself hidden). The
67481 name of a library unit cannot be a homograph of a name (such as
67482 Integer) that is already declared in Standard.
67483
67484 56
67485 4 The exception Standard.Numeric_Error is defined in *note J.6::.
67486
67487 56.a
67488 Discussion: The declaration of Natural needs to appear between
67489 the declaration of Integer and the (implicit) declaration of
67490 the "**" operator for Integer, because a formal parameter of
67491 "**" is of subtype Natural. This would be impossible in
67492 normal code, because the implicit declarations for a type
67493 occur immediately after the type declaration, with no
67494 possibility of intervening explicit declarations. But we're
67495 in Standard, and Standard is somewhat magic anyway.
67496
67497 56.b
67498 Using Natural as the subtype of the formal of "**" seems
67499 natural; it would be silly to have a textual rule about
67500 Constraint_Error being raised when there is a perfectly good
67501 subtype that means just that. Furthermore, by not using
67502 Integer for that formal, it helps remind the reader that the
67503 exponent remains Natural even when the left operand is
67504 replaced with the derivative of Integer. It doesn't logically
67505 imply that, but it's still useful as a reminder.
67506
67507 56.c
67508 In any case, declaring these general-purpose subtypes of
67509 Integer close to Integer seems more readable than declaring
67510 them much later.
67511
67512 _Extensions to Ada 83_
67513
67514 56.d
67515 Package Standard is declared to be pure.
67516
67517 56.e
67518 Discussion: The introduction of the types Wide_Character and
67519 Wide_String is not an Ada 95 extension to Ada 83, since ISO
67520 WG9 has approved these as an authorized extension of the
67521 original Ada 83 standard that is part of that standard.
67522
67523 _Wording Changes from Ada 83_
67524
67525 56.f
67526 Numeric_Error is made obsolescent.
67527
67528 56.g
67529 The declarations of Natural and Positive are moved to just
67530 after the declaration of Integer, so that "**" can refer to
67531 Natural without a forward reference. There's no real need to
67532 move Positive, too -- it just came along for the ride.
67533
67534 _Extensions to Ada 95_
67535
67536 56.h/2
67537 {AI95-00285-01AI95-00285-01} Types Wide_Wide_Character and
67538 Wide_Wide_String are new.
67539
67540 56.i/2
67541 Discussion: The inconsistencies associated with these types
67542 are documented in *note 3.5.2:: and *note 3.6.3::.
67543
67544 56.j/2
67545 {AI95-00230-01AI95-00230-01} Type universal_access and the
67546 equality operations for it are new.
67547
67548 _Wording Changes from Ada 95_
67549
67550 56.k/2
67551 {8652/00288652/0028} {AI95-00145-01AI95-00145-01} Corrigendum:
67552 Corrected the parameter type for the Boolean operators
67553 declared in Standard..
67554
67555 _Wording Changes from Ada 2005_
67556
67557 56.l/3
67558 {AI05-0181-1AI05-0181-1} Correction: Since soft_hyphen
67559 (position 173) is defined to be nongraphic, gave it a name.
67560
67561 56.m/3
67562 Discussion: The inconsistencies associated with this change
67563 are documented in *note 3.5::.
67564
67565 \1f
67566 File: aarm2012.info, Node: A.2, Next: A.3, Prev: A.1, Up: Annex A
67567
67568 A.2 The Package Ada
67569 ===================
67570
67571 _Static Semantics_
67572
67573 1
67574 The following language-defined library package exists:
67575
67576 2
67577 package Ada is
67578 pragma Pure(Ada);
67579 end Ada;
67580
67581 3
67582 Ada serves as the parent of most of the other language-defined library
67583 units; its declaration is empty (except for the pragma Pure).
67584
67585 _Legality Rules_
67586
67587 4
67588 In the standard mode, it is illegal to compile a child of package Ada.
67589
67590 4.a
67591 Reason: The intention is that mentioning, say, Ada.Text_IO in
67592 a with_clause is guaranteed (at least in the standard mode) to
67593 refer to the standard version of Ada.Text_IO. The user can
67594 compile a root library unit Text_IO that has no relation to
67595 the standard version of Text_IO.
67596
67597 4.b
67598 Ramification: Note that Ada can have non-language-defined
67599 grandchildren, assuming the implementation allows it. Also,
67600 packages System and Interfaces can have children, assuming the
67601 implementation allows it.
67602
67603 4.c
67604 Implementation Note: An implementation will typically support
67605 a nonstandard mode in which compiling the language defined
67606 library units is allowed. Whether or not this mode is made
67607 available to users is up to the implementer.
67608
67609 4.d
67610 An implementation could theoretically have private children of
67611 Ada, since that would be semantically neutral. However, a
67612 programmer cannot compile such a library unit.
67613
67614 _Extensions to Ada 83_
67615
67616 4.e/3
67617 {AI05-0299-1AI05-0299-1} This subclause is new to Ada 95.
67618
67619 \1f
67620 File: aarm2012.info, Node: A.3, Next: A.4, Prev: A.2, Up: Annex A
67621
67622 A.3 Character Handling
67623 ======================
67624
67625 1/3
67626 {AI95-00285-01AI95-00285-01} {AI05-0243-1AI05-0243-1}
67627 {AI05-0299-1AI05-0299-1} This subclause presents the packages related to
67628 character processing: an empty declared pure package Characters and
67629 child packages Characters.Handling and Characters.Latin_1. The package
67630 Characters.Handling provides classification and conversion functions for
67631 Character data, and some simple functions for dealing with
67632 Wide_Character and Wide_Wide_Character data. The child package
67633 Characters.Latin_1 declares a set of constants initialized to values of
67634 type Character.
67635
67636 _Extensions to Ada 83_
67637
67638 1.a/3
67639 {AI05-0299-1AI05-0299-1} This subclause is new to Ada 95.
67640
67641 _Wording Changes from Ada 95_
67642
67643 1.b/2
67644 {AI95-00285-01AI95-00285-01} Included Wide_Wide_Character in
67645 this description; the individual changes are documented as
67646 extensions as needed.
67647
67648 * Menu:
67649
67650 * A.3.1 :: The Packages Characters, Wide_Characters, and Wide_Wide_Characters
67651 * A.3.2 :: The Package Characters.Handling
67652 * A.3.3 :: The Package Characters.Latin_1
67653 * A.3.4 :: The Package Characters.Conversions
67654 * A.3.5 :: The Package Wide_Characters.Handling
67655 * A.3.6 :: The Package Wide_Wide_Characters.Handling
67656
67657 \1f
67658 File: aarm2012.info, Node: A.3.1, Next: A.3.2, Up: A.3
67659
67660 A.3.1 The Packages Characters, Wide_Characters, and Wide_Wide_Characters
67661 ------------------------------------------------------------------------
67662
67663 _Static Semantics_
67664
67665 1
67666 The library package Characters has the following declaration:
67667
67668 2
67669 package Ada.Characters is
67670 pragma Pure(Characters);
67671 end Ada.Characters;
67672
67673 3/2
67674 {AI95-00395-01AI95-00395-01} The library package Wide_Characters has the
67675 following declaration:
67676
67677 4/2
67678 package Ada.Wide_Characters is
67679 pragma Pure(Wide_Characters);
67680 end Ada.Wide_Characters;
67681
67682 5/2
67683 {AI95-00395-01AI95-00395-01} The library package Wide_Wide_Characters
67684 has the following declaration:
67685
67686 6/2
67687 package Ada.Wide_Wide_Characters is
67688 pragma Pure(Wide_Wide_Characters);
67689 end Ada.Wide_Wide_Characters;
67690
67691 _Implementation Advice_
67692
67693 7/3
67694 {AI95-00395-01AI95-00395-01} {AI05-0185-1AI05-0185-1} If an
67695 implementation chooses to provide implementation-defined operations on
67696 Wide_Character or Wide_String (such as collating and sorting, etc.) it
67697 should do so by providing child units of Wide_Characters. Similarly if
67698 it chooses to provide implementation-defined operations on
67699 Wide_Wide_Character or Wide_Wide_String it should do so by providing
67700 child units of Wide_Wide_Characters.
67701
67702 7.a/2
67703 Implementation Advice: Implementation-defined operations on
67704 Wide_Character, Wide_String, Wide_Wide_Character, and
67705 Wide_Wide_String should be child units of Wide_Characters or
67706 Wide_Wide_Characters.
67707
67708 _Extensions to Ada 95_
67709
67710 7.b/2
67711 {AI95-00395-01AI95-00395-01} The packages Wide_Characters and
67712 Wide_Wide_Characters are new.
67713
67714 \1f
67715 File: aarm2012.info, Node: A.3.2, Next: A.3.3, Prev: A.3.1, Up: A.3
67716
67717 A.3.2 The Package Characters.Handling
67718 -------------------------------------
67719
67720 _Static Semantics_
67721
67722 1
67723 The library package Characters.Handling has the following declaration:
67724
67725 2/2
67726 {AI95-00362-01AI95-00362-01} {AI95-00395-01AI95-00395-01} with Ada.Characters.Conversions;
67727 package Ada.Characters.Handling is
67728 pragma Pure(Handling);
67729
67730 3
67731 --Character classification functions
67732
67733 4/3
67734 {AI05-0185-1AI05-0185-1} function Is_Control (Item : in Character) return Boolean;
67735 function Is_Graphic (Item : in Character) return Boolean;
67736 function Is_Letter (Item : in Character) return Boolean;
67737 function Is_Lower (Item : in Character) return Boolean;
67738 function Is_Upper (Item : in Character) return Boolean;
67739 function Is_Basic (Item : in Character) return Boolean;
67740 function Is_Digit (Item : in Character) return Boolean;
67741 function Is_Decimal_Digit (Item : in Character) return Boolean
67742 renames Is_Digit;
67743 function Is_Hexadecimal_Digit (Item : in Character) return Boolean;
67744 function Is_Alphanumeric (Item : in Character) return Boolean;
67745 function Is_Special (Item : in Character) return Boolean;
67746 function Is_Line_Terminator (Item : in Character) return Boolean;
67747 function Is_Mark (Item : in Character) return Boolean;
67748 function Is_Other_Format (Item : in Character) return Boolean;
67749 function Is_Punctuation_Connector (Item : in Character) return Boolean;
67750 function Is_Space (Item : in Character) return Boolean;
67751
67752 5
67753 --Conversion functions for Character and String
67754
67755 6
67756 function To_Lower (Item : in Character) return Character;
67757 function To_Upper (Item : in Character) return Character;
67758 function To_Basic (Item : in Character) return Character;
67759
67760 7
67761 function To_Lower (Item : in String) return String;
67762 function To_Upper (Item : in String) return String;
67763 function To_Basic (Item : in String) return String;
67764
67765 8
67766 --Classifications of and conversions between Character and ISO 646
67767
67768 9
67769 subtype ISO_646 is
67770 Character range Character'Val(0) .. Character'Val(127);
67771
67772 10
67773 function Is_ISO_646 (Item : in Character) return Boolean;
67774 function Is_ISO_646 (Item : in String) return Boolean;
67775
67776 11
67777 function To_ISO_646 (Item : in Character;
67778 Substitute : in ISO_646 := ' ')
67779 return ISO_646;
67780
67781 12
67782 function To_ISO_646 (Item : in String;
67783 Substitute : in ISO_646 := ' ')
67784 return String;
67785
67786 13/2
67787 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} -- The functions Is_Character, Is_String, To_Character, To_String, To_Wide_Character,
67788 -- and To_Wide_String are obsolescent; see *note J.14::.
67789
67790 Paragraphs 14 through 18 were deleted.
67791
67792 19
67793 end Ada.Characters.Handling;
67794
67795 19.a/2
67796 Discussion: {AI95-00395-01AI95-00395-01} The with_clause for
67797 Ada.Characters.Conversions is needed for the definition of the
67798 obsolescent functions (see *note J.14::). It would be odd to
67799 put this clause into *note J.14:: as it was not present in Ada
67800 95, and with_clauses are semantically neutral to clients
67801 anyway.
67802
67803 20
67804 In the description below for each function that returns a Boolean
67805 result, the effect is described in terms of the conditions under which
67806 the value True is returned. If these conditions are not met, then the
67807 function returns False.
67808
67809 21
67810 Each of the following classification functions has a formal Character
67811 parameter, Item, and returns a Boolean result.
67812
67813 22
67814 Is_Control
67815 True if Item is a control character. A control character
67816 is a character whose position is in one of the ranges
67817 0..31 or 127..159.
67818
67819 23
67820 Is_Graphic
67821 True if Item is a graphic character. A graphic character
67822 is a character whose position is in one of the ranges
67823 32..126 or 160..255.
67824
67825 24
67826 Is_Letter
67827 True if Item is a letter. A letter is a character that
67828 is in one of the ranges 'A'..'Z' or 'a'..'z', or whose
67829 position is in one of the ranges 192..214, 216..246, or
67830 248..255.
67831
67832 25
67833 Is_Lower
67834 True if Item is a lower-case letter. A lower-case letter
67835 is a character that is in the range 'a'..'z', or whose
67836 position is in one of the ranges 223..246 or 248..255.
67837
67838 26
67839 Is_Upper
67840 True if Item is an upper-case letter. An upper-case
67841 letter is a character that is in the range 'A'..'Z' or
67842 whose position is in one of the ranges 192..214 or 216..
67843 222.
67844
67845 27
67846 Is_Basic
67847 True if Item is a basic letter. A basic letter is a
67848 character that is in one of the ranges 'A'..'Z' and
67849 'a'..'z', or that is one of the following: 'Æ', 'æ', 'Ð',
67850 'ð', 'Þ', 'þ', or 'ß'.
67851
67852 28
67853 Is_Digit
67854 True if Item is a decimal digit. A decimal digit is a
67855 character in the range '0'..'9'.
67856
67857 29
67858 Is_Decimal_Digit
67859 A renaming of Is_Digit.
67860
67861 30
67862 Is_Hexadecimal_Digit
67863 True if Item is a hexadecimal digit. A hexadecimal digit
67864 is a character that is either a decimal digit or that is
67865 in one of the ranges 'A' .. 'F' or 'a' .. 'f'.
67866
67867 31
67868 Is_Alphanumeric
67869 True if Item is an alphanumeric character. An
67870 alphanumeric character is a character that is either a
67871 letter or a decimal digit.
67872
67873 32
67874 Is_Special
67875 True if Item is a special graphic character. A special
67876 graphic character is a graphic character that is not
67877 alphanumeric.
67878
67879 32.1/3
67880 {AI05-0185-1AI05-0185-1} Is_Line_Terminator
67881 True if Item is a character with position 10 .. 13
67882 (Line_Feed, Line_Tabulation, Form_Feed, Carriage_Return)
67883 or 133 (Next_Line).
67884
67885 32.2/3
67886 {AI05-0185-1AI05-0185-1} Is_Mark
67887 Never True (no value of type Character has categories
67888 Mark, Non-Spacing or Mark, Spacing Combining).
67889
67890 32.3/3
67891 {AI05-0185-1AI05-0185-1} Is_Other_Format
67892 True if Item is a character with position 173
67893 (Soft_Hyphen).
67894
67895 32.4/3
67896 {AI05-0185-1AI05-0185-1} Is_Punctuation_Connector
67897 True if Item is a character with position 95 ('_', known
67898 as Low_Line or Underscore).
67899
67900 32.5/3
67901 {AI05-0185-1AI05-0185-1} Is_Space
67902 True if Item is a character with position 32 (' ') or 160
67903 (No_Break_Space).
67904
67905 33
67906 Each of the names To_Lower, To_Upper, and To_Basic refers to two
67907 functions: one that converts from Character to Character, and the other
67908 that converts from String to String. The result of each
67909 Character-to-Character function is described below, in terms of the
67910 conversion applied to Item, its formal Character parameter. The result
67911 of each String-to-String conversion is obtained by applying to each
67912 element of the function's String parameter the corresponding
67913 Character-to-Character conversion; the result is the null String if the
67914 value of the formal parameter is the null String. The lower bound of
67915 the result String is 1.
67916
67917 34
67918 To_Lower
67919 Returns the corresponding lower-case value for Item if
67920 Is_Upper(Item), and returns Item otherwise.
67921
67922 35
67923 To_Upper
67924 Returns the corresponding upper-case value for Item if
67925 Is_Lower(Item) and Item has an upper-case form, and
67926 returns Item otherwise. The lower case letters 'ß' and
67927 'ÿ' do not have upper case forms.
67928
67929 36
67930 To_Basic
67931 Returns the letter corresponding to Item but with no
67932 diacritical mark, if Item is a letter but not a basic
67933 letter; returns Item otherwise.
67934
67935 37
67936 The following set of functions test for membership in the ISO 646
67937 character range, or convert between ISO 646 and Character.
67938
67939 38
67940 Is_ISO_646
67941 The function whose formal parameter, Item, is of type
67942 Character returns True if Item is in the subtype ISO_646.
67943
67944 39
67945 Is_ISO_646
67946 The function whose formal parameter, Item, is of type
67947 String returns True if Is_ISO_646(Item(I)) is True for
67948 each I in Item'Range.
67949
67950 40
67951 To_ISO_646
67952 The function whose first formal parameter, Item, is of
67953 type Character returns Item if Is_ISO_646(Item), and
67954 returns the Substitute ISO_646 character otherwise.
67955
67956 41
67957 To_ISO_646
67958 The function whose first formal parameter, Item, is of
67959 type String returns the String whose Range is
67960 1..Item'Length and each of whose elements is given by
67961 To_ISO_646 of the corresponding element in Item.
67962
67963 Paragraphs 42 through 49 were deleted.
67964
67965 NOTES
67966
67967 50
67968 5 A basic letter is a letter without a diacritical mark.
67969
67970 51
67971 6 Except for the hexadecimal digits, basic letters, and ISO_646
67972 characters, the categories identified in the classification
67973 functions form a strict hierarchy:
67974
67975 52
67976 -- Control characters
67977
67978 53
67979 -- Graphic characters
67980
67981 54
67982 -- Alphanumeric characters
67983
67984 55
67985 -- Letters
67986
67987 56
67988 -- Upper-case letters
67989
67990 57
67991 -- Lower-case letters
67992
67993 58
67994 -- Decimal digits
67995
67996 59
67997 -- Special graphic characters
67998
67999 59.a
68000 Ramification: Thus each Character value is either a control
68001 character or a graphic character but not both; each graphic
68002 character is either an alphanumeric or special graphic but not
68003 both; each alphanumeric is either a letter or decimal digit
68004 but not both; each letter is either upper case or lower case
68005 but not both.
68006
68007 60/3
68008 7 {AI05-0114-1AI05-0114-1} There are certain characters which are
68009 defined to be lower case letters by ISO 10646 and are therefore
68010 allowed in identifiers, but are not considered lower case letters
68011 by Ada.Characters.Handling.
68012
68013 60.a/3
68014 Reason: This is to maintain runtime compatibility with the Ada
68015 95 definitions of these functions. We don't list the exact
68016 characters involved because they're likely to change in future
68017 character set standards; the list for ISO 10646:2011 can be
68018 found in AI05-0114-1AI05-0114-1.
68019
68020 60.b/3
68021 Ramification: No version of Characters.Handling is intended to
68022 do portable (Ada-version independent) manipulation of Ada
68023 identifiers. The classification given by
68024 Wide_Characters.Handling will be correct for the current
68025 implementation for Ada 2012 identifiers, but it might not be
68026 correct for a different implementation or version of Ada.
68027
68028 _Extensions to Ada 95_
68029
68030 60.c/2
68031 {AI95-00362-01AI95-00362-01} Characters.Handling is now Pure,
68032 so it can be used in pure units.
68033
68034 _Incompatibilities With Ada 2005_
68035
68036 60.d/3
68037 {AI05-0185-1AI05-0185-1} Added additional classification
68038 routines so that Characters.Handling has all of the routines
68039 available in Wide_Characters.Handling. If Characters.Handling
68040 is referenced in a use_clause, and an entity E with a
68041 defining_identifier that is the same as one of the new
68042 functions is defined in a package that is also referenced in a
68043 use_clause, the entity E may no longer be use-visible,
68044 resulting in errors. This should be rare and is easily fixed
68045 if it does occur.
68046
68047 _Wording Changes from Ada 95_
68048
68049 60.e/2
68050 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} The
68051 conversion functions are made obsolescent; a more complete set
68052 is available in Characters.Conversions -- see *note A.3.4::.
68053
68054 60.f/3
68055 {AI95-00285-01AI95-00285-01} {AI05-0248-1AI05-0248-1} We no
68056 longer talk about localized character sets; these are a
68057 nonstandard mode, which is none of our business.
68058
68059 _Wording Changes from Ada 2005_
68060
68061 60.g/3
68062 {AI05-0114-1AI05-0114-1} Correction: Added a note to clarify
68063 that these functions don't have any relationship to the
68064 characters allowed in identifiers.
68065
68066 \1f
68067 File: aarm2012.info, Node: A.3.3, Next: A.3.4, Prev: A.3.2, Up: A.3
68068
68069 A.3.3 The Package Characters.Latin_1
68070 ------------------------------------
68071
68072 1
68073 The package Characters.Latin_1 declares constants for characters in ISO
68074 8859-1.
68075
68076 1.a
68077 Reason: The constants for the ISO 646 characters could have
68078 been declared as renamings of objects declared in package
68079 ASCII, as opposed to explicit constants. The main reason for
68080 explicit constants was for consistency of style with the
68081 upper-half constants, and to avoid emphasizing the package
68082 ASCII.
68083
68084 _Static Semantics_
68085
68086 2
68087 The library package Characters.Latin_1 has the following declaration:
68088
68089 3
68090 package Ada.Characters.Latin_1 is
68091 pragma Pure(Latin_1);
68092
68093 4
68094 -- Control characters:
68095
68096 5
68097 NUL : constant Character := Character'Val(0);
68098 SOH : constant Character := Character'Val(1);
68099 STX : constant Character := Character'Val(2);
68100 ETX : constant Character := Character'Val(3);
68101 EOT : constant Character := Character'Val(4);
68102 ENQ : constant Character := Character'Val(5);
68103 ACK : constant Character := Character'Val(6);
68104 BEL : constant Character := Character'Val(7);
68105 BS : constant Character := Character'Val(8);
68106 HT : constant Character := Character'Val(9);
68107 LF : constant Character := Character'Val(10);
68108 VT : constant Character := Character'Val(11);
68109 FF : constant Character := Character'Val(12);
68110 CR : constant Character := Character'Val(13);
68111 SO : constant Character := Character'Val(14);
68112 SI : constant Character := Character'Val(15);
68113
68114 6
68115 DLE : constant Character := Character'Val(16);
68116 DC1 : constant Character := Character'Val(17);
68117 DC2 : constant Character := Character'Val(18);
68118 DC3 : constant Character := Character'Val(19);
68119 DC4 : constant Character := Character'Val(20);
68120 NAK : constant Character := Character'Val(21);
68121 SYN : constant Character := Character'Val(22);
68122 ETB : constant Character := Character'Val(23);
68123 CAN : constant Character := Character'Val(24);
68124 EM : constant Character := Character'Val(25);
68125 SUB : constant Character := Character'Val(26);
68126 ESC : constant Character := Character'Val(27);
68127 FS : constant Character := Character'Val(28);
68128 GS : constant Character := Character'Val(29);
68129 RS : constant Character := Character'Val(30);
68130 US : constant Character := Character'Val(31);
68131
68132 7
68133 -- ISO 646 graphic characters:
68134
68135 8
68136 Space : constant Character := ' '; -- Character'Val(32)
68137 Exclamation : constant Character := '!'; -- Character'Val(33)
68138 Quotation : constant Character := '"'; -- Character'Val(34)
68139 Number_Sign : constant Character := '#'; -- Character'Val(35)
68140 Dollar_Sign : constant Character := '$'; -- Character'Val(36)
68141 Percent_Sign : constant Character := '%'; -- Character'Val(37)
68142 Ampersand : constant Character := '&'; -- Character'Val(38)
68143 Apostrophe : constant Character := '''; -- Character'Val(39)
68144 Left_Parenthesis : constant Character := '('; -- Character'Val(40)
68145 Right_Parenthesis : constant Character := ')'; -- Character'Val(41)
68146 Asterisk : constant Character := '*'; -- Character'Val(42)
68147 Plus_Sign : constant Character := '+'; -- Character'Val(43)
68148 Comma : constant Character := ','; -- Character'Val(44)
68149 Hyphen : constant Character := '-'; -- Character'Val(45)
68150 Minus_Sign : Character renames Hyphen;
68151 Full_Stop : constant Character := '.'; -- Character'Val(46)
68152 Solidus : constant Character := '/'; -- Character'Val(47)
68153
68154 9
68155 -- Decimal digits '0' though '9' are at positions 48 through 57
68156
68157 10
68158 Colon : constant Character := ':'; -- Character'Val(58)
68159 Semicolon : constant Character := ';'; -- Character'Val(59)
68160 Less_Than_Sign : constant Character := '<'; -- Character'Val(60)
68161 Equals_Sign : constant Character := '='; -- Character'Val(61)
68162 Greater_Than_Sign : constant Character := '>'; -- Character'Val(62)
68163 Question : constant Character := '?'; -- Character'Val(63)
68164 Commercial_At : constant Character := '@'; -- Character'Val(64)
68165
68166 11
68167 -- Letters 'A' through 'Z' are at positions 65 through 90
68168
68169 12
68170 Left_Square_Bracket : constant Character := '['; -- Character'Val(91)
68171 Reverse_Solidus : constant Character := '\'; -- Character'Val(92)
68172 Right_Square_Bracket : constant Character := ']'; -- Character'Val(93)
68173 Circumflex : constant Character := '^'; -- Character'Val(94)
68174 Low_Line : constant Character := '_'; -- Character'Val(95)
68175
68176 13
68177 Grave : constant Character := '`'; -- Character'Val(96)
68178 LC_A : constant Character := 'a'; -- Character'Val(97)
68179 LC_B : constant Character := 'b'; -- Character'Val(98)
68180 LC_C : constant Character := 'c'; -- Character'Val(99)
68181 LC_D : constant Character := 'd'; -- Character'Val(100)
68182 LC_E : constant Character := 'e'; -- Character'Val(101)
68183 LC_F : constant Character := 'f'; -- Character'Val(102)
68184 LC_G : constant Character := 'g'; -- Character'Val(103)
68185 LC_H : constant Character := 'h'; -- Character'Val(104)
68186 LC_I : constant Character := 'i'; -- Character'Val(105)
68187 LC_J : constant Character := 'j'; -- Character'Val(106)
68188 LC_K : constant Character := 'k'; -- Character'Val(107)
68189 LC_L : constant Character := 'l'; -- Character'Val(108)
68190 LC_M : constant Character := 'm'; -- Character'Val(109)
68191 LC_N : constant Character := 'n'; -- Character'Val(110)
68192 LC_O : constant Character := 'o'; -- Character'Val(111)
68193
68194 14
68195 LC_P : constant Character := 'p'; -- Character'Val(112)
68196 LC_Q : constant Character := 'q'; -- Character'Val(113)
68197 LC_R : constant Character := 'r'; -- Character'Val(114)
68198 LC_S : constant Character := 's'; -- Character'Val(115)
68199 LC_T : constant Character := 't'; -- Character'Val(116)
68200 LC_U : constant Character := 'u'; -- Character'Val(117)
68201 LC_V : constant Character := 'v'; -- Character'Val(118)
68202 LC_W : constant Character := 'w'; -- Character'Val(119)
68203 LC_X : constant Character := 'x'; -- Character'Val(120)
68204 LC_Y : constant Character := 'y'; -- Character'Val(121)
68205 LC_Z : constant Character := 'z'; -- Character'Val(122)
68206 Left_Curly_Bracket : constant Character := '{'; -- Character'Val(123)
68207 Vertical_Line : constant Character := '|'; -- Character'Val(124)
68208 Right_Curly_Bracket : constant Character := '}'; -- Character'Val(125)
68209 Tilde : constant Character := '~'; -- Character'Val(126)
68210 DEL : constant Character := Character'Val(127);
68211
68212 15
68213 -- ISO 6429 control characters:
68214
68215 16
68216 IS4 : Character renames FS;
68217 IS3 : Character renames GS;
68218 IS2 : Character renames RS;
68219 IS1 : Character renames US;
68220
68221 17
68222 Reserved_128 : constant Character := Character'Val(128);
68223 Reserved_129 : constant Character := Character'Val(129);
68224 BPH : constant Character := Character'Val(130);
68225 NBH : constant Character := Character'Val(131);
68226 Reserved_132 : constant Character := Character'Val(132);
68227 NEL : constant Character := Character'Val(133);
68228 SSA : constant Character := Character'Val(134);
68229 ESA : constant Character := Character'Val(135);
68230 HTS : constant Character := Character'Val(136);
68231 HTJ : constant Character := Character'Val(137);
68232 VTS : constant Character := Character'Val(138);
68233 PLD : constant Character := Character'Val(139);
68234 PLU : constant Character := Character'Val(140);
68235 RI : constant Character := Character'Val(141);
68236 SS2 : constant Character := Character'Val(142);
68237 SS3 : constant Character := Character'Val(143);
68238
68239 18
68240 DCS : constant Character := Character'Val(144);
68241 PU1 : constant Character := Character'Val(145);
68242 PU2 : constant Character := Character'Val(146);
68243 STS : constant Character := Character'Val(147);
68244 CCH : constant Character := Character'Val(148);
68245 MW : constant Character := Character'Val(149);
68246 SPA : constant Character := Character'Val(150);
68247 EPA : constant Character := Character'Val(151);
68248
68249 19
68250 SOS : constant Character := Character'Val(152);
68251 Reserved_153 : constant Character := Character'Val(153);
68252 SCI : constant Character := Character'Val(154);
68253 CSI : constant Character := Character'Val(155);
68254 ST : constant Character := Character'Val(156);
68255 OSC : constant Character := Character'Val(157);
68256 PM : constant Character := Character'Val(158);
68257 APC : constant Character := Character'Val(159);
68258
68259 20
68260 -- Other graphic characters:
68261
68262 21/3
68263 {AI05-0181-1AI05-0181-1} -- Character positions 160 (16#A0#) .. 175 (16#AF#):
68264 No_Break_Space : constant Character := ' '; --Character'Val(160)
68265 NBSP : Character renames No_Break_Space;
68266 Inverted_Exclamation : constant Character := '¡'; --Character'Val(161)
68267 Cent_Sign : constant Character := '¢'; --Character'Val(162)
68268 Pound_Sign : constant Character := '£'; --Character'Val(163)
68269 Currency_Sign : constant Character := '¤'; --Character'Val(164)
68270 Yen_Sign : constant Character := '¥'; --Character'Val(165)
68271 Broken_Bar : constant Character := '¦'; --Character'Val(166)
68272 Section_Sign : constant Character := '§'; --Character'Val(167)
68273 Diaeresis : constant Character := '¨'; --Character'Val(168)
68274 Copyright_Sign : constant Character := '©'; --Character'Val(169)
68275 Feminine_Ordinal_Indicator : constant Character := 'ª'; --Character'Val(170)
68276 Left_Angle_Quotation : constant Character := '«'; --Character'Val(171)
68277 Not_Sign : constant Character := '¬'; --Character'Val(172)
68278 Soft_Hyphen : constant Character := Character'Val(173);
68279 Registered_Trade_Mark_Sign : constant Character := '®'; --Character'Val(174)
68280 Macron : constant Character := '¯'; --Character'Val(175)
68281
68282 22
68283 -- Character positions 176 (16#B0#) .. 191 (16#BF#):
68284 Degree_Sign : constant Character := '°'; --Character'Val(176)
68285 Ring_Above : Character renames Degree_Sign;
68286 Plus_Minus_Sign : constant Character := '±'; --Character'Val(177)
68287 Superscript_Two : constant Character := '²'; --Character'Val(178)
68288 Superscript_Three : constant Character := '³'; --Character'Val(179)
68289 Acute : constant Character := '´'; --Character'Val(180)
68290 Micro_Sign : constant Character := 'µ'; --Character'Val(181)
68291 Pilcrow_Sign : constant Character := '¶'; --Character'Val(182)
68292 Paragraph_Sign : Character renames Pilcrow_Sign;
68293 Middle_Dot : constant Character := '·'; --Character'Val(183)
68294 Cedilla : constant Character := '¸'; --Character'Val(184)
68295 Superscript_One : constant Character := '¹'; --Character'Val(185)
68296 Masculine_Ordinal_Indicator: constant Character := 'º'; --Character'Val(186)
68297 Right_Angle_Quotation : constant Character := '»'; --Character'Val(187)
68298 Fraction_One_Quarter : constant Character := '¼'; --Character'Val(188)
68299 Fraction_One_Half : constant Character := '½'; --Character'Val(189)
68300 Fraction_Three_Quarters : constant Character := '¾'; --Character'Val(190)
68301 Inverted_Question : constant Character := '¿'; --Character'Val(191)
68302
68303 23
68304 -- Character positions 192 (16#C0#) .. 207 (16#CF#):
68305 UC_A_Grave : constant Character := 'À'; --Character'Val(192)
68306 UC_A_Acute : constant Character := 'Á'; --Character'Val(193)
68307 UC_A_Circumflex : constant Character := 'Â'; --Character'Val(194)
68308 UC_A_Tilde : constant Character := 'Ã'; --Character'Val(195)
68309 UC_A_Diaeresis : constant Character := 'Ä'; --Character'Val(196)
68310 UC_A_Ring : constant Character := 'Å'; --Character'Val(197)
68311 UC_AE_Diphthong : constant Character := 'Æ'; --Character'Val(198)
68312 UC_C_Cedilla : constant Character := 'Ç'; --Character'Val(199)
68313 UC_E_Grave : constant Character := 'È'; --Character'Val(200)
68314 UC_E_Acute : constant Character := 'É'; --Character'Val(201)
68315 UC_E_Circumflex : constant Character := 'Ê'; --Character'Val(202)
68316 UC_E_Diaeresis : constant Character := 'Ë'; --Character'Val(203)
68317 UC_I_Grave : constant Character := 'Ì'; --Character'Val(204)
68318 UC_I_Acute : constant Character := 'Í'; --Character'Val(205)
68319 UC_I_Circumflex : constant Character := 'Î'; --Character'Val(206)
68320 UC_I_Diaeresis : constant Character := 'Ï'; --Character'Val(207)
68321
68322 24
68323 -- Character positions 208 (16#D0#) .. 223 (16#DF#):
68324 UC_Icelandic_Eth : constant Character := 'Ð'; --Character'Val(208)
68325 UC_N_Tilde : constant Character := 'Ñ'; --Character'Val(209)
68326 UC_O_Grave : constant Character := 'Ò'; --Character'Val(210)
68327 UC_O_Acute : constant Character := 'Ó'; --Character'Val(211)
68328 UC_O_Circumflex : constant Character := 'Ô'; --Character'Val(212)
68329 UC_O_Tilde : constant Character := 'Õ'; --Character'Val(213)
68330 UC_O_Diaeresis : constant Character := 'Ö'; --Character'Val(214)
68331 Multiplication_Sign : constant Character := '×'; --Character'Val(215)
68332 UC_O_Oblique_Stroke : constant Character := 'Ø'; --Character'Val(216)
68333 UC_U_Grave : constant Character := 'Ù'; --Character'Val(217)
68334 UC_U_Acute : constant Character := 'Ú'; --Character'Val(218)
68335 UC_U_Circumflex : constant Character := 'Û'; --Character'Val(219)
68336 UC_U_Diaeresis : constant Character := 'Ü'; --Character'Val(220)
68337 UC_Y_Acute : constant Character := 'Ý'; --Character'Val(221)
68338 UC_Icelandic_Thorn : constant Character := 'Þ'; --Character'Val(222)
68339 LC_German_Sharp_S : constant Character := 'ß'; --Character'Val(223)
68340
68341 25
68342 -- Character positions 224 (16#E0#) .. 239 (16#EF#):
68343 LC_A_Grave : constant Character := 'à'; --Character'Val(224)
68344 LC_A_Acute : constant Character := 'á'; --Character'Val(225)
68345 LC_A_Circumflex : constant Character := 'â'; --Character'Val(226)
68346 LC_A_Tilde : constant Character := 'ã'; --Character'Val(227)
68347 LC_A_Diaeresis : constant Character := 'ä'; --Character'Val(228)
68348 LC_A_Ring : constant Character := 'å'; --Character'Val(229)
68349 LC_AE_Diphthong : constant Character := 'æ'; --Character'Val(230)
68350 LC_C_Cedilla : constant Character := 'ç'; --Character'Val(231)
68351 LC_E_Grave : constant Character := 'è'; --Character'Val(232)
68352 LC_E_Acute : constant Character := 'é'; --Character'Val(233)
68353 LC_E_Circumflex : constant Character := 'ê'; --Character'Val(234)
68354 LC_E_Diaeresis : constant Character := 'ë'; --Character'Val(235)
68355 LC_I_Grave : constant Character := 'ì'; --Character'Val(236)
68356 LC_I_Acute : constant Character := 'í'; --Character'Val(237)
68357 LC_I_Circumflex : constant Character := 'î'; --Character'Val(238)
68358 LC_I_Diaeresis : constant Character := 'ï'; --Character'Val(239)
68359
68360 26
68361 -- Character positions 240 (16#F0#) .. 255 (16#FF#):
68362 LC_Icelandic_Eth : constant Character := 'ð'; --Character'Val(240)
68363 LC_N_Tilde : constant Character := 'ñ'; --Character'Val(241)
68364 LC_O_Grave : constant Character := 'ò'; --Character'Val(242)
68365 LC_O_Acute : constant Character := 'ó'; --Character'Val(243)
68366 LC_O_Circumflex : constant Character := 'ô'; --Character'Val(244)
68367 LC_O_Tilde : constant Character := 'õ'; --Character'Val(245)
68368 LC_O_Diaeresis : constant Character := 'ö'; --Character'Val(246)
68369 Division_Sign : constant Character := '÷'; --Character'Val(247)
68370 LC_O_Oblique_Stroke : constant Character := 'ø'; --Character'Val(248)
68371 LC_U_Grave : constant Character := 'ù'; --Character'Val(249)
68372 LC_U_Acute : constant Character := 'ú'; --Character'Val(250)
68373 LC_U_Circumflex : constant Character := 'û'; --Character'Val(251)
68374 LC_U_Diaeresis : constant Character := 'ü'; --Character'Val(252)
68375 LC_Y_Acute : constant Character := 'ý'; --Character'Val(253)
68376 LC_Icelandic_Thorn : constant Character := 'þ'; --Character'Val(254)
68377 LC_Y_Diaeresis : constant Character := 'ÿ'; --Character'Val(255)
68378 end Ada.Characters.Latin_1;
68379
68380 _Implementation Permissions_
68381
68382 27
68383 An implementation may provide additional packages as children of
68384 Ada.Characters, to declare names for the symbols of the local character
68385 set or other character sets.
68386
68387 _Wording Changes from Ada 2005_
68388
68389 27.a/3
68390 {AI05-0181-1AI05-0181-1} Correction: Soft_Hyphen is not a
68391 graphic character, and thus a character literal for it is
68392 illegal. So we have to use the position value. This makes no
68393 semantic change to users of the constant.
68394
68395 \1f
68396 File: aarm2012.info, Node: A.3.4, Next: A.3.5, Prev: A.3.3, Up: A.3
68397
68398 A.3.4 The Package Characters.Conversions
68399 ----------------------------------------
68400
68401 _Static Semantics_
68402
68403 1/2
68404 {AI95-00395-01AI95-00395-01} The library package Characters.Conversions
68405 has the following declaration:
68406
68407 2/2
68408 package Ada.Characters.Conversions is
68409 pragma Pure(Conversions);
68410
68411 3/2
68412 function Is_Character (Item : in Wide_Character) return Boolean;
68413 function Is_String (Item : in Wide_String) return Boolean;
68414 function Is_Character (Item : in Wide_Wide_Character) return Boolean;
68415 function Is_String (Item : in Wide_Wide_String) return Boolean;
68416 function Is_Wide_Character (Item : in Wide_Wide_Character)
68417 return Boolean;
68418 function Is_Wide_String (Item : in Wide_Wide_String)
68419 return Boolean;
68420
68421 4/2
68422 function To_Wide_Character (Item : in Character) return Wide_Character;
68423 function To_Wide_String (Item : in String) return Wide_String;
68424 function To_Wide_Wide_Character (Item : in Character)
68425 return Wide_Wide_Character;
68426 function To_Wide_Wide_String (Item : in String)
68427 return Wide_Wide_String;
68428 function To_Wide_Wide_Character (Item : in Wide_Character)
68429 return Wide_Wide_Character;
68430 function To_Wide_Wide_String (Item : in Wide_String)
68431 return Wide_Wide_String;
68432
68433 5/2
68434 function To_Character (Item : in Wide_Character;
68435 Substitute : in Character := ' ')
68436 return Character;
68437 function To_String (Item : in Wide_String;
68438 Substitute : in Character := ' ')
68439 return String;
68440 function To_Character (Item : in Wide_Wide_Character;
68441 Substitute : in Character := ' ')
68442 return Character;
68443 function To_String (Item : in Wide_Wide_String;
68444 Substitute : in Character := ' ')
68445 return String;
68446 function To_Wide_Character (Item : in Wide_Wide_Character;
68447 Substitute : in Wide_Character := ' ')
68448 return Wide_Character;
68449 function To_Wide_String (Item : in Wide_Wide_String;
68450 Substitute : in Wide_Character := ' ')
68451 return Wide_String;
68452
68453 6/2
68454 end Ada.Characters.Conversions;
68455
68456 7/2
68457 {AI95-00395-01AI95-00395-01} The functions in package
68458 Characters.Conversions test Wide_Wide_Character or Wide_Character values
68459 for membership in Wide_Character or Character, or convert between
68460 corresponding characters of Wide_Wide_Character, Wide_Character, and
68461 Character.
68462
68463 8/2
68464 function Is_Character (Item : in Wide_Character) return Boolean;
68465
68466 9/2
68467 {AI95-00395-01AI95-00395-01} Returns True if
68468 Wide_Character'Pos(Item) <= Character'Pos(Character'Last).
68469
68470 10/2
68471 function Is_Character (Item : in Wide_Wide_Character) return Boolean;
68472
68473 11/2
68474 {AI95-00395-01AI95-00395-01} Returns True if
68475 Wide_Wide_Character'Pos(Item) <=
68476 Character'Pos(Character'Last).
68477
68478 12/2
68479 function Is_Wide_Character (Item : in Wide_Wide_Character) return Boolean;
68480
68481 13/2
68482 {AI95-00395-01AI95-00395-01} Returns True if
68483 Wide_Wide_Character'Pos(Item) <=
68484 Wide_Character'Pos(Wide_Character'Last).
68485
68486 14/2
68487 function Is_String (Item : in Wide_String) return Boolean;
68488 function Is_String (Item : in Wide_Wide_String) return Boolean;
68489
68490 15/2
68491 {AI95-00395-01AI95-00395-01} Returns True if
68492 Is_Character(Item(I)) is True for each I in Item'Range.
68493
68494 16/2
68495 function Is_Wide_String (Item : in Wide_Wide_String) return Boolean;
68496
68497 17/2
68498 {AI95-00395-01AI95-00395-01} Returns True if
68499 Is_Wide_Character(Item(I)) is True for each I in Item'Range.
68500
68501 18/2
68502 function To_Character (Item : in Wide_Character;
68503 Substitute : in Character := ' ') return Character;
68504 function To_Character (Item : in Wide_Wide_Character;
68505 Substitute : in Character := ' ') return Character;
68506
68507 19/2
68508 {AI95-00395-01AI95-00395-01} Returns the Character
68509 corresponding to Item if Is_Character(Item), and returns the
68510 Substitute Character otherwise.
68511
68512 20/2
68513 function To_Wide_Character (Item : in Character) return Wide_Character;
68514
68515 21/2
68516 {AI95-00395-01AI95-00395-01} Returns the Wide_Character X such
68517 that Character'Pos(Item) = Wide_Character'Pos (X).
68518
68519 22/2
68520 function To_Wide_Character (Item : in Wide_Wide_Character;
68521 Substitute : in Wide_Character := ' ')
68522 return Wide_Character;
68523
68524 23/2
68525 {AI95-00395-01AI95-00395-01} Returns the Wide_Character
68526 corresponding to Item if Is_Wide_Character(Item), and returns
68527 the Substitute Wide_Character otherwise.
68528
68529 24/2
68530 function To_Wide_Wide_Character (Item : in Character)
68531 return Wide_Wide_Character;
68532
68533 25/2
68534 {AI95-00395-01AI95-00395-01} Returns the Wide_Wide_Character X
68535 such that Character'Pos(Item) = Wide_Wide_Character'Pos (X).
68536
68537 26/2
68538 function To_Wide_Wide_Character (Item : in Wide_Character)
68539 return Wide_Wide_Character;
68540
68541 27/2
68542 {AI95-00395-01AI95-00395-01} Returns the Wide_Wide_Character X
68543 such that Wide_Character'Pos(Item) = Wide_Wide_Character'Pos
68544 (X).
68545
68546 28/2
68547 function To_String (Item : in Wide_String;
68548 Substitute : in Character := ' ') return String;
68549 function To_String (Item : in Wide_Wide_String;
68550 Substitute : in Character := ' ') return String;
68551
68552 29/2
68553 {AI95-00395-01AI95-00395-01} Returns the String whose range is
68554 1..Item'Length and each of whose elements is given by
68555 To_Character of the corresponding element in Item.
68556
68557 30/2
68558 function To_Wide_String (Item : in String) return Wide_String;
68559
68560 31/2
68561 {AI95-00395-01AI95-00395-01} Returns the Wide_String whose
68562 range is 1..Item'Length and each of whose elements is given by
68563 To_Wide_Character of the corresponding element in Item.
68564
68565 32/2
68566 function To_Wide_String (Item : in Wide_Wide_String;
68567 Substitute : in Wide_Character := ' ')
68568 return Wide_String;
68569
68570 33/2
68571 {AI95-00395-01AI95-00395-01} Returns the Wide_String whose
68572 range is 1..Item'Length and each of whose elements is given by
68573 To_Wide_Character of the corresponding element in Item with
68574 the given Substitute Wide_Character.
68575
68576 34/2
68577 function To_Wide_Wide_String (Item : in String) return Wide_Wide_String;
68578 function To_Wide_Wide_String (Item : in Wide_String)
68579 return Wide_Wide_String;
68580
68581 35/2
68582 {AI95-00395-01AI95-00395-01} Returns the Wide_Wide_String
68583 whose range is 1..Item'Length and each of whose elements is
68584 given by To_Wide_Wide_Character of the corresponding element
68585 in Item.
68586
68587 _Extensions to Ada 95_
68588
68589 35.a/2
68590 {AI95-00395-01AI95-00395-01} The package
68591 Characters.Conversions is new, replacing functions previously
68592 found in Characters.Handling.
68593
68594 \1f
68595 File: aarm2012.info, Node: A.3.5, Next: A.3.6, Prev: A.3.4, Up: A.3
68596
68597 A.3.5 The Package Wide_Characters.Handling
68598 ------------------------------------------
68599
68600 1/3
68601 {AI05-0185-1AI05-0185-1} The package Wide_Characters.Handling provides
68602 operations for classifying Wide_Characters and case folding for
68603 Wide_Characters.
68604
68605 _Static Semantics_
68606
68607 2/3
68608 {AI05-0185-1AI05-0185-1} The library package Wide_Characters.Handling
68609 has the following declaration:
68610
68611 3/3
68612 {AI05-0185-1AI05-0185-1} {AI05-0266-1AI05-0266-1} package Ada.Wide_Characters.Handling is
68613 pragma Pure(Handling);
68614
68615 4/3
68616 {AI05-0266-1AI05-0266-1} function Character_Set_Version return String;
68617
68618 5/3
68619 function Is_Control (Item : Wide_Character) return Boolean;
68620
68621 6/3
68622 function Is_Letter (Item : Wide_Character) return Boolean;
68623
68624 7/3
68625 function Is_Lower (Item : Wide_Character) return Boolean;
68626
68627 8/3
68628 function Is_Upper (Item : Wide_Character) return Boolean;
68629
68630 9/3
68631 function Is_Digit (Item : Wide_Character) return Boolean;
68632
68633 10/3
68634 function Is_Decimal_Digit (Item : Wide_Character) return Boolean
68635 renames Is_Digit;
68636
68637 11/3
68638 function Is_Hexadecimal_Digit (Item : Wide_Character) return Boolean;
68639
68640 12/3
68641 function Is_Alphanumeric (Item : Wide_Character) return Boolean;
68642
68643 13/3
68644 function Is_Special (Item : Wide_Character) return Boolean;
68645
68646 14/3
68647 function Is_Line_Terminator (Item : Wide_Character) return Boolean;
68648
68649 15/3
68650 function Is_Mark (Item : Wide_Character) return Boolean;
68651
68652 16/3
68653 function Is_Other_Format (Item : Wide_Character) return Boolean;
68654
68655 17/3
68656 function Is_Punctuation_Connector (Item : Wide_Character) return Boolean;
68657
68658 18/3
68659 function Is_Space (Item : Wide_Character) return Boolean;
68660
68661 19/3
68662 function Is_Graphic (Item : Wide_Character) return Boolean;
68663
68664 20/3
68665 function To_Lower (Item : Wide_Character) return Wide_Character;
68666 function To_Upper (Item : Wide_Character) return Wide_Character;
68667
68668 21/3
68669 function To_Lower (Item : Wide_String) return Wide_String;
68670 function To_Upper (Item : Wide_String) return Wide_String;
68671
68672 22/3
68673 end Ada.Wide_Characters.Handling;
68674
68675 23/3
68676 {AI05-0185-1AI05-0185-1} The subprograms defined in
68677 Wide_Characters.Handling are locale independent.
68678
68679 24/3
68680 function Character_Set_Version return String;
68681
68682 25/3
68683 {AI05-0266-1AI05-0266-1} Returns an implementation-defined
68684 identifier that identifies the version of the character set
68685 standard that is used for categorizing characters by the
68686 implementation.
68687
68688 26/3
68689 function Is_Control (Item : Wide_Character) return Boolean;
68690
68691 27/3
68692 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68693 designated by Item is categorized as other_control; otherwise
68694 returns False.
68695
68696 28/3
68697 function Is_Letter (Item : Wide_Character) return Boolean;
68698
68699 29/3
68700 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68701 designated by Item is categorized as letter_uppercase,
68702 letter_lowercase, letter_titlecase, letter_modifier,
68703 letter_other, or number_letter; otherwise returns False.
68704
68705 30/3
68706 function Is_Lower (Item : Wide_Character) return Boolean;
68707
68708 31/3
68709 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68710 designated by Item is categorized as letter_lowercase;
68711 otherwise returns False.
68712
68713 32/3
68714 function Is_Upper (Item : Wide_Character) return Boolean;
68715
68716 33/3
68717 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68718 designated by Item is categorized as letter_uppercase;
68719 otherwise returns False.
68720
68721 34/3
68722 function Is_Digit (Item : Wide_Character) return Boolean;
68723
68724 35/3
68725 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68726 designated by Item is categorized as number_decimal; otherwise
68727 returns False.
68728
68729 36/3
68730 function Is_Hexadecimal_Digit (Item : Wide_Character) return Boolean;
68731
68732 37/3
68733 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68734 designated by Item is categorized as number_decimal, or is in
68735 the range 'A' .. 'F' or 'a' .. 'f'; otherwise returns False.
68736
68737 38/3
68738 function Is_Alphanumeric (Item : Wide_Character) return Boolean;
68739
68740 39/3
68741 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68742 designated by Item is categorized as letter_uppercase,
68743 letter_lowercase, letter_titlecase, letter_modifier,
68744 letter_other, number_letter, or number_decimal; otherwise
68745 returns False.
68746
68747 40/3
68748 function Is_Special (Item : Wide_Character) return Boolean;
68749
68750 41/3
68751 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68752 designated by Item is categorized as graphic_character, but
68753 not categorized as letter_uppercase, letter_lowercase,
68754 letter_titlecase, letter_modifier, letter_other,
68755 number_letter, or number_decimal; otherwise returns False.
68756
68757 42/3
68758 function Is_Line_Terminator (Item : Wide_Character) return Boolean;
68759
68760 43/3
68761 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68762 designated by Item is categorized as separator_line or
68763 separator_paragraph, or if Item is a conventional line
68764 terminator character (Line_Feed, Line_Tabulation, Form_Feed,
68765 Carriage_Return, Next_Line); otherwise returns False.
68766
68767 44/3
68768 function Is_Mark (Item : Wide_Character) return Boolean;
68769
68770 45/3
68771 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68772 designated by Item is categorized as mark_non_spacing or
68773 mark_spacing_combining; otherwise returns False.
68774
68775 46/3
68776 function Is_Other_Format (Item : Wide_Character) return Boolean;
68777
68778 47/3
68779 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68780 designated by Item is categorized as other_format; otherwise
68781 returns False.
68782
68783 48/3
68784 function Is_Punctuation_Connector (Item : Wide_Character) return Boolean;
68785
68786 49/3
68787 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68788 designated by Item is categorized as punctuation_connector;
68789 otherwise returns False.
68790
68791 50/3
68792 function Is_Space (Item : Wide_Character) return Boolean;
68793
68794 51/3
68795 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68796 designated by Item is categorized as separator_space;
68797 otherwise returns False.
68798
68799 52/3
68800 function Is_Graphic (Item : Wide_Character) return Boolean;
68801
68802 53/3
68803 {AI05-0185-1AI05-0185-1} Returns True if the Wide_Character
68804 designated by Item is categorized as graphic_character;
68805 otherwise returns False.
68806
68807 54/3
68808 function To_Lower (Item : Wide_Character) return Wide_Character;
68809
68810 55/3
68811 {AI05-0185-1AI05-0185-1} {AI05-0266-1AI05-0266-1}
68812 {AI05-0299-1AI05-0299-1} Returns the Simple Lowercase Mapping
68813 as defined by documents referenced in the note in Clause 1 of
68814 ISO/IEC 10646:2011 of the Wide_Character designated by Item.
68815 If the Simple Lowercase Mapping does not exist for the
68816 Wide_Character designated by Item, then the value of Item is
68817 returned.
68818
68819 55.a/3
68820 Discussion: The case mappings come from Unicode as ISO/IEC
68821 10646:2011 does not include case mappings (but rather
68822 references the Unicode ones as above).
68823
68824 56/3
68825 function To_Lower (Item : Wide_String) return Wide_String;
68826
68827 57/3
68828 {AI05-0185-1AI05-0185-1} Returns the result of applying the
68829 To_Lower conversion to each Wide_Character element of the
68830 Wide_String designated by Item. The result is the null
68831 Wide_String if the value of the formal parameter is the null
68832 Wide_String. The lower bound of the result Wide_String is 1.
68833
68834 58/3
68835 function To_Upper (Item : Wide_Character) return Wide_Character;
68836
68837 59/3
68838 {AI05-0185-1AI05-0185-1} {AI05-0266-1AI05-0266-1}
68839 {AI05-0299-1AI05-0299-1} Returns the Simple Uppercase Mapping
68840 as defined by documents referenced in the note in Clause 1 of
68841 ISO/IEC 10646:2011 of the Wide_Character designated by Item.
68842 If the Simple Uppercase Mapping does not exist for the
68843 Wide_Character designated by Item, then the value of Item is
68844 returned.
68845
68846 60/3
68847 function To_Upper (Item : Wide_String) return Wide_String;
68848
68849 61/3
68850 {AI05-0185-1AI05-0185-1} Returns the result of applying the
68851 To_Upper conversion to each Wide_Character element of the
68852 Wide_String designated by Item. The result is the null
68853 Wide_String if the value of the formal parameter is the null
68854 Wide_String. The lower bound of the result Wide_String is 1.
68855
68856 _Implementation Advice_
68857
68858 62/3
68859 {AI05-0266-1AI05-0266-1} The string returned by Character_Set_Version
68860 should include either "10646:" or "Unicode".
68861
68862 62.a.1/3
68863 Implementation Advice: The string returned by
68864 Wide_Characters.Handling.Character_Set_Version should include
68865 either "10646:" or "Unicode".
68866
68867 62.a/3
68868 Discussion: The intent is that the returned string include the
68869 year for 10646 (as in "10646:2011"), and the version number
68870 for Unicode (as in "Unicode 6.0"). We don't try to specify
68871 that further so we don't need to decide how to represent
68872 Corrigenda for 10646, nor which of these is preferred.
68873 (Giving a Unicode version is more accurate, as the case
68874 folding and mapping rules always come from a Unicode version
68875 [10646 just tells one to look at Unicode to get those], and
68876 the character classifications ought to be the same for
68877 equivalent versions, but we don't want to talk about non-ISO
68878 standards in an ISO standard.)
68879
68880 NOTES
68881
68882 63/3
68883 8 {AI05-0266-1AI05-0266-1} The results returned by these functions
68884 may depend on which particular version of the 10646 standard is
68885 supported by the implementation (see *note 2.1::).
68886
68887 64/3
68888 9 {AI05-0286-1AI05-0286-1} The case insensitive equality
68889 comparison routines provided in *note A.4.10::, "*note A.4.10::
68890 String Comparison" are also available for wide strings (see *note
68891 A.4.7::).
68892
68893 _Extensions to Ada 2005_
68894
68895 64.a/3
68896 {AI05-0185-1AI05-0185-1} {AI05-0266-1AI05-0266-1} The package
68897 Wide_Characters.Handling is new.
68898
68899 \1f
68900 File: aarm2012.info, Node: A.3.6, Prev: A.3.5, Up: A.3
68901
68902 A.3.6 The Package Wide_Wide_Characters.Handling
68903 -----------------------------------------------
68904
68905 1/3
68906 {AI05-0185-1AI05-0185-1} The package Wide_Wide_Characters.Handling has
68907 the same contents as Wide_Characters.Handling except that each
68908 occurrence of Wide_Character is replaced by Wide_Wide_Character, and
68909 each occurrence of Wide_String is replaced by Wide_Wide_String.
68910
68911 _Extensions to Ada 2005_
68912
68913 1.a/3
68914 {AI05-0185-1AI05-0185-1} The package
68915 Wide_Wide_Characters.Handling is new.
68916
68917 \1f
68918 File: aarm2012.info, Node: A.4, Next: A.5, Prev: A.3, Up: Annex A
68919
68920 A.4 String Handling
68921 ===================
68922
68923 1/3
68924 {AI95-00285-01AI95-00285-01} {AI05-0299-1AI05-0299-1} This subclause
68925 presents the specifications of the package Strings and several child
68926 packages, which provide facilities for dealing with string data.
68927 Fixed-length, bounded-length, and unbounded-length strings are
68928 supported, for String, Wide_String, and Wide_Wide_String. The
68929 string-handling subprograms include searches for pattern strings and for
68930 characters in program-specified sets, translation (via a
68931 character-to-character mapping), and transformation (replacing,
68932 inserting, overwriting, and deleting of substrings).
68933
68934 _Extensions to Ada 83_
68935
68936 1.a/3
68937 {AI05-0299-1AI05-0299-1} This subclause is new to Ada 95.
68938
68939 _Wording Changes from Ada 95_
68940
68941 1.b/2
68942 {AI95-00285-01AI95-00285-01} Included Wide_Wide_String in this
68943 description; the individual changes are documented as
68944 extensions as needed.
68945
68946 * Menu:
68947
68948 * A.4.1 :: The Package Strings
68949 * A.4.2 :: The Package Strings.Maps
68950 * A.4.3 :: Fixed-Length String Handling
68951 * A.4.4 :: Bounded-Length String Handling
68952 * A.4.5 :: Unbounded-Length String Handling
68953 * A.4.6 :: String-Handling Sets and Mappings
68954 * A.4.7 :: Wide_String Handling
68955 * A.4.8 :: Wide_Wide_String Handling
68956 * A.4.9 :: String Hashing
68957 * A.4.10 :: String Comparison
68958 * A.4.11 :: String Encoding
68959
68960 \1f
68961 File: aarm2012.info, Node: A.4.1, Next: A.4.2, Up: A.4
68962
68963 A.4.1 The Package Strings
68964 -------------------------
68965
68966 1
68967 The package Strings provides declarations common to the string handling
68968 packages.
68969
68970 _Static Semantics_
68971
68972 2
68973 The library package Strings has the following declaration:
68974
68975 3
68976 package Ada.Strings is
68977 pragma Pure(Strings);
68978
68979 4/2
68980 {AI95-00285-01AI95-00285-01} Space : constant Character := ' ';
68981 Wide_Space : constant Wide_Character := ' ';
68982 Wide_Wide_Space : constant Wide_Wide_Character := ' ';
68983
68984 5
68985 Length_Error, Pattern_Error, Index_Error, Translation_Error : exception;
68986
68987 6
68988 type Alignment is (Left, Right, Center);
68989 type Truncation is (Left, Right, Error);
68990 type Membership is (Inside, Outside);
68991 type Direction is (Forward, Backward);
68992 type Trim_End is (Left, Right, Both);
68993 end Ada.Strings;
68994
68995 _Incompatibilities With Ada 95_
68996
68997 6.a/3
68998 {AI95-00285-01AI95-00285-01} {AI05-0005-1AI05-0005-1} Constant
68999 Wide_Wide_Space is added to Ada.Strings. If Ada.Strings is
69000 referenced in a use_clause, and an entity E with a
69001 defining_identifier of Wide_Wide_Space is defined in a package
69002 that is also referenced in a use_clause, the entity E may no
69003 longer be use-visible, resulting in errors. This should be
69004 rare and is easily fixed if it does occur.
69005
69006 \1f
69007 File: aarm2012.info, Node: A.4.2, Next: A.4.3, Prev: A.4.1, Up: A.4
69008
69009 A.4.2 The Package Strings.Maps
69010 ------------------------------
69011
69012 1
69013 The package Strings.Maps defines the types, operations, and other
69014 entities needed for character sets and character-to-character mappings.
69015
69016 _Static Semantics_
69017
69018 2
69019 The library package Strings.Maps has the following declaration:
69020
69021 3/2
69022 {AI95-00362-01AI95-00362-01} package Ada.Strings.Maps is
69023 pragma Pure(Maps);
69024
69025 4/2
69026 {AI95-00161-01AI95-00161-01} -- Representation for a set of character values:
69027 type Character_Set is private;
69028 pragma Preelaborable_Initialization(Character_Set);
69029
69030 5
69031 Null_Set : constant Character_Set;
69032
69033 6
69034 type Character_Range is
69035 record
69036 Low : Character;
69037 High : Character;
69038 end record;
69039 -- Represents Character range Low..High
69040
69041 7
69042 type Character_Ranges is array (Positive range <>) of Character_Range;
69043
69044 8
69045 function To_Set (Ranges : in Character_Ranges)return Character_Set;
69046
69047 9
69048 function To_Set (Span : in Character_Range)return Character_Set;
69049
69050 10
69051 function To_Ranges (Set : in Character_Set) return Character_Ranges;
69052
69053 11
69054 function "=" (Left, Right : in Character_Set) return Boolean;
69055
69056 12
69057 function "not" (Right : in Character_Set) return Character_Set;
69058 function "and" (Left, Right : in Character_Set) return Character_Set;
69059 function "or" (Left, Right : in Character_Set) return Character_Set;
69060 function "xor" (Left, Right : in Character_Set) return Character_Set;
69061 function "-" (Left, Right : in Character_Set) return Character_Set;
69062
69063 13
69064 function Is_In (Element : in Character;
69065 Set : in Character_Set)
69066 return Boolean;
69067
69068 14
69069 function Is_Subset (Elements : in Character_Set;
69070 Set : in Character_Set)
69071 return Boolean;
69072
69073 15
69074 function "<=" (Left : in Character_Set;
69075 Right : in Character_Set)
69076 return Boolean renames Is_Subset;
69077
69078 16
69079 -- Alternative representation for a set of character values:
69080 subtype Character_Sequence is String;
69081
69082 17
69083 function To_Set (Sequence : in Character_Sequence)return Character_Set;
69084
69085 18
69086 function To_Set (Singleton : in Character) return Character_Set;
69087
69088 19
69089 function To_Sequence (Set : in Character_Set) return Character_Sequence;
69090
69091 20/2
69092 {AI95-00161-01AI95-00161-01} -- Representation for a character to character mapping:
69093 type Character_Mapping is private;
69094 pragma Preelaborable_Initialization(Character_Mapping);
69095
69096 21
69097 function Value (Map : in Character_Mapping;
69098 Element : in Character)
69099 return Character;
69100
69101 22
69102 Identity : constant Character_Mapping;
69103
69104 23
69105 function To_Mapping (From, To : in Character_Sequence)
69106 return Character_Mapping;
69107
69108 24
69109 function To_Domain (Map : in Character_Mapping)
69110 return Character_Sequence;
69111 function To_Range (Map : in Character_Mapping)
69112 return Character_Sequence;
69113
69114 25
69115 type Character_Mapping_Function is
69116 access function (From : in Character) return Character;
69117
69118 26
69119 private
69120 ... -- not specified by the language
69121 end Ada.Strings.Maps;
69122
69123 27
69124 An object of type Character_Set represents a set of characters.
69125
69126 28
69127 Null_Set represents the set containing no characters.
69128
69129 29
69130 An object Obj of type Character_Range represents the set of characters
69131 in the range Obj.Low .. Obj.High.
69132
69133 30
69134 An object Obj of type Character_Ranges represents the union of the sets
69135 corresponding to Obj(I) for I in Obj'Range.
69136
69137 31
69138 function To_Set (Ranges : in Character_Ranges) return Character_Set;
69139
69140 32/3
69141 {AI05-0264-1AI05-0264-1} If Ranges'Length=0 then Null_Set is
69142 returned; otherwise, the returned value represents the set
69143 corresponding to Ranges.
69144
69145 33
69146 function To_Set (Span : in Character_Range) return Character_Set;
69147
69148 34
69149 The returned value represents the set containing each
69150 character in Span.
69151
69152 35
69153 function To_Ranges (Set : in Character_Set) return Character_Ranges;
69154
69155 36/3
69156 {AI05-0264-1AI05-0264-1} If Set = Null_Set, then an empty
69157 Character_Ranges array is returned; otherwise, the shortest
69158 array of contiguous ranges of Character values in Set, in
69159 increasing order of Low, is returned.
69160
69161 37
69162 function "=" (Left, Right : in Character_Set) return Boolean;
69163
69164 38
69165 The function "=" returns True if Left and Right represent
69166 identical sets, and False otherwise.
69167
69168 39
69169 Each of the logical operators "not", "and", "or", and "xor" returns a
69170 Character_Set value that represents the set obtained by applying the
69171 corresponding operation to the set(s) represented by the parameter(s) of
69172 the operator. "-"(Left, Right) is equivalent to "and"(Left,
69173 "not"(Right)).
69174
69175 39.a
69176 Reason: The set minus operator is provided for efficiency.
69177
69178 40
69179 function Is_In (Element : in Character;
69180 Set : in Character_Set);
69181 return Boolean;
69182
69183 41
69184 Is_In returns True if Element is in Set, and False otherwise.
69185
69186 42
69187 function Is_Subset (Elements : in Character_Set;
69188 Set : in Character_Set)
69189 return Boolean;
69190
69191 43
69192 Is_Subset returns True if Elements is a subset of Set, and
69193 False otherwise.
69194
69195 44
69196 subtype Character_Sequence is String;
69197
69198 45
69199 The Character_Sequence subtype is used to portray a set of
69200 character values and also to identify the domain and range of
69201 a character mapping.
69202
69203 45.a
69204 Reason: Although a named subtype is redundant -- the
69205 predefined type String could have been used for the parameter
69206 to To_Set and To_Mapping below -- the use of a differently
69207 named subtype identifies the intended purpose of the
69208 parameter.
69209
69210 46
69211 function To_Set (Sequence : in Character_Sequence) return Character_Set;
69212
69213 function To_Set (Singleton : in Character) return Character_Set;
69214
69215 47
69216 Sequence portrays the set of character values that it
69217 explicitly contains (ignoring duplicates). Singleton portrays
69218 the set comprising a single Character. Each of the To_Set
69219 functions returns a Character_Set value that represents the
69220 set portrayed by Sequence or Singleton.
69221
69222 48
69223 function To_Sequence (Set : in Character_Set) return Character_Sequence;
69224
69225 49
69226 The function To_Sequence returns a Character_Sequence value
69227 containing each of the characters in the set represented by
69228 Set, in ascending order with no duplicates.
69229
69230 50
69231 type Character_Mapping is private;
69232
69233 51
69234 An object of type Character_Mapping represents a
69235 Character-to-Character mapping.
69236
69237 52
69238 function Value (Map : in Character_Mapping;
69239 Element : in Character)
69240 return Character;
69241
69242 53
69243 The function Value returns the Character value to which
69244 Element maps with respect to the mapping represented by Map.
69245
69246 54
69247 A character C matches a pattern character P with respect to a given
69248 Character_Mapping value Map if Value(Map, C) = P. A string S matches a
69249 pattern string P with respect to a given Character_Mapping if their
69250 lengths are the same and if each character in S matches its
69251 corresponding character in the pattern string P.
69252
69253 54.a
69254 Discussion: In an earlier version of the string handling
69255 packages, the definition of matching was symmetrical, namely C
69256 matches P if Value(Map,C) = Value(Map,P). However, applying
69257 the mapping to the pattern was confusing according to some
69258 reviewers. Furthermore, if the symmetrical version is needed,
69259 it can be achieved by applying the mapping to the pattern (via
69260 translation) prior to passing it as a parameter.
69261
69262 55
69263 String handling subprograms that deal with character mappings have
69264 parameters whose type is Character_Mapping.
69265
69266 56
69267 Identity : constant Character_Mapping;
69268
69269 57
69270 Identity maps each Character to itself.
69271
69272 58
69273 function To_Mapping (From, To : in Character_Sequence)
69274 return Character_Mapping;
69275
69276 59
69277 To_Mapping produces a Character_Mapping such that each element
69278 of From maps to the corresponding element of To, and each
69279 other character maps to itself. If From'Length /= To'Length,
69280 or if some character is repeated in From, then
69281 Translation_Error is propagated.
69282
69283 60
69284 function To_Domain (Map : in Character_Mapping) return Character_Sequence;
69285
69286 61
69287 To_Domain returns the shortest Character_Sequence value D such
69288 that each character not in D maps to itself, and such that the
69289 characters in D are in ascending order. The lower bound of D
69290 is 1.
69291
69292 62
69293 function To_Range (Map : in Character_Mapping) return Character_Sequence;
69294
69295 63/1
69296 {8652/00488652/0048} {AI95-00151-01AI95-00151-01} To_Range
69297 returns the Character_Sequence value R, such that if D =
69298 To_Domain(Map), then R has the same bounds as D, and D(I) maps
69299 to R(I) for each I in D'Range.
69300
69301 64
69302 An object F of type Character_Mapping_Function maps a Character value C
69303 to the Character value F.all(C), which is said to match C with respect
69304 to mapping function F.
69305
69306 NOTES
69307
69308 65
69309 10 Character_Mapping and Character_Mapping_Function are used both
69310 for character equivalence mappings in the search subprograms (such
69311 as for case insensitivity) and as transformational mappings in the
69312 Translate subprograms.
69313
69314 66
69315 11 To_Domain(Identity) and To_Range(Identity) each returns the
69316 null string.
69317
69318 66.a
69319 Reason: Package Strings.Maps is not pure, since it declares an
69320 access-to-subprogram type.
69321
69322 _Examples_
69323
69324 67
69325 To_Mapping("ABCD", "ZZAB") returns a Character_Mapping that maps 'A' and
69326 'B' to 'Z', 'C' to 'A', 'D' to 'B', and each other Character to itself.
69327
69328 _Extensions to Ada 95_
69329
69330 67.a/2
69331 {AI95-00161-01AI95-00161-01} Amendment Correction: Added
69332 pragma Preelaborable_Initialization to types Character_Set and
69333 Character_Mapping, so that they can be used to declare
69334 default-initialized objects in preelaborated units.
69335
69336 67.b/2
69337 {AI95-00362-01AI95-00362-01} Strings.Maps is now Pure, so it
69338 can be used in pure units.
69339
69340 _Wording Changes from Ada 95_
69341
69342 67.c/2
69343 {8652/00488652/0048} {AI95-00151-01AI95-00151-01} Corrigendum:
69344 Corrected the definition of the range of the result of
69345 To_Range, since the Ada 95 definition makes no sense.
69346
69347 \1f
69348 File: aarm2012.info, Node: A.4.3, Next: A.4.4, Prev: A.4.2, Up: A.4
69349
69350 A.4.3 Fixed-Length String Handling
69351 ----------------------------------
69352
69353 1
69354 The language-defined package Strings.Fixed provides string-handling
69355 subprograms for fixed-length strings; that is, for values of type
69356 Standard.String. Several of these subprograms are procedures that
69357 modify the contents of a String that is passed as an out or an in out
69358 parameter; each has additional parameters to control the effect when the
69359 logical length of the result differs from the parameter's length.
69360
69361 2
69362 For each function that returns a String, the lower bound of the returned
69363 value is 1.
69364
69365 2.a/2
69366 Discussion: {AI95-00114-01AI95-00114-01} Most operations that
69367 yield a String are provided both as a function and as a
69368 procedure. The functional form is possibly a more aesthetic
69369 style but may introduce overhead due to extra copying or
69370 dynamic memory usage in some implementations. Thus a
69371 procedural form, with an in out parameter so that all copying
69372 is done 'in place', is also supplied.
69373
69374 3
69375 The basic model embodied in the package is that a fixed-length string
69376 comprises significant characters and possibly padding (with space
69377 characters) on either or both ends. When a shorter string is copied to
69378 a longer string, padding is inserted, and when a longer string is copied
69379 to a shorter one, padding is stripped. The Move procedure in
69380 Strings.Fixed, which takes a String as an out parameter, allows the
69381 programmer to control these effects. Similar control is provided by the
69382 string transformation procedures.
69383
69384 _Static Semantics_
69385
69386 4
69387 The library package Strings.Fixed has the following declaration:
69388
69389 5
69390 with Ada.Strings.Maps;
69391 package Ada.Strings.Fixed is
69392 pragma Preelaborate(Fixed);
69393
69394 6
69395 -- "Copy" procedure for strings of possibly different lengths
69396
69397 7
69398 procedure Move (Source : in String;
69399 Target : out String;
69400 Drop : in Truncation := Error;
69401 Justify : in Alignment := Left;
69402 Pad : in Character := Space);
69403
69404 8
69405 -- Search subprograms
69406
69407 8.1/2
69408 {AI95-00301-01AI95-00301-01} function Index (Source : in String;
69409 Pattern : in String;
69410 From : in Positive;
69411 Going : in Direction := Forward;
69412 Mapping : in Maps.Character_Mapping := Maps.Identity)
69413 return Natural;
69414
69415 8.2/2
69416 {AI95-00301-01AI95-00301-01} function Index (Source : in String;
69417 Pattern : in String;
69418 From : in Positive;
69419 Going : in Direction := Forward;
69420 Mapping : in Maps.Character_Mapping_Function)
69421 return Natural;
69422
69423 9
69424 function Index (Source : in String;
69425 Pattern : in String;
69426 Going : in Direction := Forward;
69427 Mapping : in Maps.Character_Mapping
69428 := Maps.Identity)
69429 return Natural;
69430
69431 10
69432 function Index (Source : in String;
69433 Pattern : in String;
69434 Going : in Direction := Forward;
69435 Mapping : in Maps.Character_Mapping_Function)
69436 return Natural;
69437
69438 10.1/2
69439 {AI95-00301-01AI95-00301-01} function Index (Source : in String;
69440 Set : in Maps.Character_Set;
69441 From : in Positive;
69442 Test : in Membership := Inside;
69443 Going : in Direction := Forward)
69444 return Natural;
69445
69446 11
69447 function Index (Source : in String;
69448 Set : in Maps.Character_Set;
69449 Test : in Membership := Inside;
69450 Going : in Direction := Forward)
69451 return Natural;
69452
69453 11.1/2
69454 {AI95-00301-01AI95-00301-01} function Index_Non_Blank (Source : in String;
69455 From : in Positive;
69456 Going : in Direction := Forward)
69457 return Natural;
69458
69459 12
69460 function Index_Non_Blank (Source : in String;
69461 Going : in Direction := Forward)
69462 return Natural;
69463
69464 13
69465 function Count (Source : in String;
69466 Pattern : in String;
69467 Mapping : in Maps.Character_Mapping
69468 := Maps.Identity)
69469 return Natural;
69470
69471 14
69472 function Count (Source : in String;
69473 Pattern : in String;
69474 Mapping : in Maps.Character_Mapping_Function)
69475 return Natural;
69476
69477 15
69478 function Count (Source : in String;
69479 Set : in Maps.Character_Set)
69480 return Natural;
69481
69482 15.1/3
69483 {AI05-0031-1AI05-0031-1} procedure Find_Token (Source : in String;
69484 Set : in Maps.Character_Set;
69485 From : in Positive;
69486 Test : in Membership;
69487 First : out Positive;
69488 Last : out Natural);
69489
69490 16
69491 procedure Find_Token (Source : in String;
69492 Set : in Maps.Character_Set;
69493 Test : in Membership;
69494 First : out Positive;
69495 Last : out Natural);
69496
69497 17
69498 -- String translation subprograms
69499
69500 18
69501 function Translate (Source : in String;
69502 Mapping : in Maps.Character_Mapping)
69503 return String;
69504
69505 19
69506 procedure Translate (Source : in out String;
69507 Mapping : in Maps.Character_Mapping);
69508
69509 20
69510 function Translate (Source : in String;
69511 Mapping : in Maps.Character_Mapping_Function)
69512 return String;
69513
69514 21
69515 procedure Translate (Source : in out String;
69516 Mapping : in Maps.Character_Mapping_Function);
69517
69518 22
69519 -- String transformation subprograms
69520
69521 23
69522 function Replace_Slice (Source : in String;
69523 Low : in Positive;
69524 High : in Natural;
69525 By : in String)
69526 return String;
69527
69528 24
69529 procedure Replace_Slice (Source : in out String;
69530 Low : in Positive;
69531 High : in Natural;
69532 By : in String;
69533 Drop : in Truncation := Error;
69534 Justify : in Alignment := Left;
69535 Pad : in Character := Space);
69536
69537 25
69538 function Insert (Source : in String;
69539 Before : in Positive;
69540 New_Item : in String)
69541 return String;
69542
69543 26
69544 procedure Insert (Source : in out String;
69545 Before : in Positive;
69546 New_Item : in String;
69547 Drop : in Truncation := Error);
69548
69549 27
69550 function Overwrite (Source : in String;
69551 Position : in Positive;
69552 New_Item : in String)
69553 return String;
69554
69555 28
69556 procedure Overwrite (Source : in out String;
69557 Position : in Positive;
69558 New_Item : in String;
69559 Drop : in Truncation := Right);
69560
69561 29
69562 function Delete (Source : in String;
69563 From : in Positive;
69564 Through : in Natural)
69565 return String;
69566
69567 30
69568 procedure Delete (Source : in out String;
69569 From : in Positive;
69570 Through : in Natural;
69571 Justify : in Alignment := Left;
69572 Pad : in Character := Space);
69573
69574 31
69575 --String selector subprograms
69576 function Trim (Source : in String;
69577 Side : in Trim_End)
69578 return String;
69579
69580 32
69581 procedure Trim (Source : in out String;
69582 Side : in Trim_End;
69583 Justify : in Alignment := Left;
69584 Pad : in Character := Space);
69585
69586 33
69587 function Trim (Source : in String;
69588 Left : in Maps.Character_Set;
69589 Right : in Maps.Character_Set)
69590 return String;
69591
69592 34
69593 procedure Trim (Source : in out String;
69594 Left : in Maps.Character_Set;
69595 Right : in Maps.Character_Set;
69596 Justify : in Alignment := Strings.Left;
69597 Pad : in Character := Space);
69598
69599 35
69600 function Head (Source : in String;
69601 Count : in Natural;
69602 Pad : in Character := Space)
69603 return String;
69604
69605 36
69606 procedure Head (Source : in out String;
69607 Count : in Natural;
69608 Justify : in Alignment := Left;
69609 Pad : in Character := Space);
69610
69611 37
69612 function Tail (Source : in String;
69613 Count : in Natural;
69614 Pad : in Character := Space)
69615 return String;
69616
69617 38
69618 procedure Tail (Source : in out String;
69619 Count : in Natural;
69620 Justify : in Alignment := Left;
69621 Pad : in Character := Space);
69622
69623 39
69624 --String constructor functions
69625
69626 40
69627 function "*" (Left : in Natural;
69628 Right : in Character) return String;
69629
69630 41
69631 function "*" (Left : in Natural;
69632 Right : in String) return String;
69633
69634 42
69635 end Ada.Strings.Fixed;
69636
69637 43
69638 The effects of the above subprograms are as follows.
69639
69640 44
69641 procedure Move (Source : in String;
69642 Target : out String;
69643 Drop : in Truncation := Error;
69644 Justify : in Alignment := Left;
69645 Pad : in Character := Space);
69646
69647 45/3
69648 {AI05-0264-1AI05-0264-1} The Move procedure copies characters
69649 from Source to Target. If Source has the same length as
69650 Target, then the effect is to assign Source to Target. If
69651 Source is shorter than Target, then:
69652
69653 46
69654 * If Justify=Left, then Source is copied into the first
69655 Source'Length characters of Target.
69656
69657 47
69658 * If Justify=Right, then Source is copied into the last
69659 Source'Length characters of Target.
69660
69661 48
69662 * If Justify=Center, then Source is copied into the middle
69663 Source'Length characters of Target. In this case, if the
69664 difference in length between Target and Source is odd,
69665 then the extra Pad character is on the right.
69666
69667 49
69668 * Pad is copied to each Target character not otherwise
69669 assigned.
69670
69671 50
69672 If Source is longer than Target, then the effect is based on
69673 Drop.
69674
69675 51
69676 * If Drop=Left, then the rightmost Target'Length characters
69677 of Source are copied into Target.
69678
69679 52
69680 * If Drop=Right, then the leftmost Target'Length characters
69681 of Source are copied into Target.
69682
69683 53
69684 * If Drop=Error, then the effect depends on the value of
69685 the Justify parameter and also on whether any characters
69686 in Source other than Pad would fail to be copied:
69687
69688 54
69689 * If Justify=Left, and if each of the rightmost
69690 Source'Length-Target'Length characters in
69691 Source is Pad, then the leftmost Target'Length
69692 characters of Source are copied to Target.
69693
69694 55
69695 * If Justify=Right, and if each of the leftmost
69696 Source'Length-Target'Length characters in
69697 Source is Pad, then the rightmost Target'Length
69698 characters of Source are copied to Target.
69699
69700 56
69701 * Otherwise, Length_Error is propagated.
69702
69703 56.a
69704 Ramification: The Move procedure will work even if Source and
69705 Target overlap.
69706
69707 56.b
69708 Reason: The order of parameters (Source before Target)
69709 corresponds to the order in COBOL's MOVE verb.
69710
69711 56.1/2
69712 function Index (Source : in String;
69713 Pattern : in String;
69714 From : in Positive;
69715 Going : in Direction := Forward;
69716 Mapping : in Maps.Character_Mapping := Maps.Identity)
69717 return Natural;
69718
69719 function Index (Source : in String;
69720 Pattern : in String;
69721 From : in Positive;
69722 Going : in Direction := Forward;
69723 Mapping : in Maps.Character_Mapping_Function)
69724 return Natural;
69725
69726 56.2/3
69727 {AI95-00301-01AI95-00301-01} {AI05-0056-1AI05-0056-1} Each
69728 Index function searches, starting from From, for a slice of
69729 Source, with length Pattern'Length, that matches Pattern with
69730 respect to Mapping; the parameter Going indicates the
69731 direction of the lookup. If Source is the null string, Index
69732 returns 0; otherwise, if From is not in Source'Range, then
69733 Index_Error is propagated. If Going = Forward, then Index
69734 returns the smallest index I which is greater than or equal to
69735 From such that the slice of Source starting at I matches
69736 Pattern. If Going = Backward, then Index returns the largest
69737 index I such that the slice of Source starting at I matches
69738 Pattern and has an upper bound less than or equal to From. If
69739 there is no such slice, then 0 is returned. If Pattern is the
69740 null string, then Pattern_Error is propagated.
69741
69742 56.c/2
69743 Discussion: There is no default parameter for From; the
69744 default value would need to depend on other parameters (the
69745 bounds of Source and the direction Going). It is better to
69746 use overloaded functions rather than a special value to
69747 represent the default.
69748
69749 56.d/2
69750 There is no default value for the Mapping parameter that is a
69751 Character_Mapping_Function; if there were, a call would be
69752 ambiguous since there is also a default for the Mapping
69753 parameter that is a Character_Mapping.
69754
69755 56.e/3
69756 {AI05-0056-1AI05-0056-1} The language does not define when the
69757 Pattern_Error check is made. (That's because many common
69758 searching implementations require a nonempty pattern) That
69759 means that the result for a call like Index ("", "") could be
69760 0 or could raise Pattern_Error. Similarly, in the call Index
69761 ("", "", From => 2), the language does not define whether
69762 Pattern_Error or Index_Error is raised.
69763
69764 57
69765 function Index (Source : in String;
69766 Pattern : in String;
69767 Going : in Direction := Forward;
69768 Mapping : in Maps.Character_Mapping
69769 := Maps.Identity)
69770 return Natural;
69771
69772 function Index (Source : in String;
69773 Pattern : in String;
69774 Going : in Direction := Forward;
69775 Mapping : in Maps.Character_Mapping_Function)
69776 return Natural;
69777
69778 58/2
69779 {AI95-00301-01AI95-00301-01} If Going = Forward, returns
69780
69781 58.1/2
69782 Index (Source, Pattern, Source'First, Forward, Mapping);
69783
69784 58.2/3
69785 {AI05-0264-1AI05-0264-1} otherwise, returns
69786
69787 58.3/2
69788 Index (Source, Pattern, Source'Last, Backward, Mapping);
69789
69790 58.a/2
69791 This paragraph was deleted.There is no default value for the
69792 Mapping parameter that is a Character_Mapping_Function; if
69793 there were, a call would be ambiguous since there is also a
69794 default for the Mapping parameter that is a Character_Mapping.
69795
69796 58.4/2
69797 function Index (Source : in String;
69798 Set : in Maps.Character_Set;
69799 From : in Positive;
69800 Test : in Membership := Inside;
69801 Going : in Direction := Forward)
69802 return Natural;
69803
69804 58.5/3
69805 {AI95-00301-01AI95-00301-01} {AI05-0056-1AI05-0056-1} Index
69806 searches for the first or last occurrence of any of a set of
69807 characters (when Test=Inside), or any of the complement of a
69808 set of characters (when Test=Outside). If Source is the null
69809 string, Index returns 0; otherwise, if From is not in
69810 Source'Range, then Index_Error is propagated. Otherwise, it
69811 returns the smallest index I >= From (if Going=Forward) or the
69812 largest index I <= From (if Going=Backward) such that
69813 Source(I) satisfies the Test condition with respect to Set; it
69814 returns 0 if there is no such Character in Source.
69815
69816 59
69817 function Index (Source : in String;
69818 Set : in Maps.Character_Set;
69819 Test : in Membership := Inside;
69820 Going : in Direction := Forward)
69821 return Natural;
69822
69823 60/2
69824 {AI95-00301-01AI95-00301-01} If Going = Forward, returns
69825
69826 60.1/2
69827 Index (Source, Set, Source'First, Test, Forward);
69828
69829 60.2/3
69830 {AI05-0264-1AI05-0264-1} otherwise, returns
69831
69832 60.3/2
69833 Index (Source, Set, Source'Last, Test, Backward);
69834
69835 60.4/2
69836 function Index_Non_Blank (Source : in String;
69837 From : in Positive;
69838 Going : in Direction := Forward)
69839 return Natural;
69840
69841 60.5/2
69842 {AI95-00301-01AI95-00301-01} Returns Index (Source,
69843 Maps.To_Set(Space), From, Outside, Going);
69844
69845 61
69846 function Index_Non_Blank (Source : in String;
69847 Going : in Direction := Forward)
69848 return Natural;
69849
69850 62
69851 Returns Index(Source, Maps.To_Set(Space), Outside, Going)
69852
69853 63
69854 function Count (Source : in String;
69855 Pattern : in String;
69856 Mapping : in Maps.Character_Mapping
69857 := Maps.Identity)
69858 return Natural;
69859
69860 function Count (Source : in String;
69861 Pattern : in String;
69862 Mapping : in Maps.Character_Mapping_Function)
69863 return Natural;
69864
69865 64
69866 Returns the maximum number of nonoverlapping slices of Source
69867 that match Pattern with respect to Mapping. If Pattern is the
69868 null string then Pattern_Error is propagated.
69869
69870 64.a
69871 Reason: We say 'maximum number' because it is possible to
69872 slice a source string in different ways yielding different
69873 numbers of matches. For example if Source is "ABABABA" and
69874 Pattern is "ABA", then Count yields 2, although there is a
69875 partitioning of Source that yields just 1 match, for the
69876 middle slice. Saying 'maximum number' is equivalent to saying
69877 that the pattern match starts either at the low index or the
69878 high index position.
69879
69880 65
69881 function Count (Source : in String;
69882 Set : in Maps.Character_Set)
69883 return Natural;
69884
69885 66
69886 Returns the number of occurrences in Source of characters that
69887 are in Set.
69888
69889 66.1/3
69890 procedure Find_Token (Source : in String;
69891 Set : in Maps.Character_Set;
69892 From : in Positive;
69893 Test : in Membership;
69894 First : out Positive;
69895 Last : out Natural);
69896
69897 66.2/3
69898 {AI05-0031-1AI05-0031-1} If Source is not the null string and
69899 From is not in Source'Range, then Index_Error is raised.
69900 Otherwise, First is set to the index of the first character in
69901 Source(From .. Source'Last) that satisfies the Test
69902 condition. Last is set to the largest index such that all
69903 characters in Source(First .. Last) satisfy the Test
69904 condition. If no characters in Source(From .. Source'Last)
69905 satisfy the Test condition, First is set to From, and Last is
69906 set to 0.
69907
69908 67
69909 procedure Find_Token (Source : in String;
69910 Set : in Maps.Character_Set;
69911 Test : in Membership;
69912 First : out Positive;
69913 Last : out Natural);
69914
69915 68/3
69916 {8652/00498652/0049} {AI95-00128-01AI95-00128-01}
69917 {AI05-0031-1AI05-0031-1} Equivalent to Find_Token (Source,
69918 Set, Source'First, Test, First, Last).
69919
69920 68.a/3
69921 Ramification: {AI05-0031-1AI05-0031-1} If Source'First is not
69922 in Positive, which can only happen for an empty string, this
69923 will raise Constraint_Error.
69924
69925 69
69926 function Translate (Source : in String;
69927 Mapping : in Maps.Character_Mapping)
69928 return String;
69929
69930 function Translate (Source : in String;
69931 Mapping : in Maps.Character_Mapping_Function)
69932 return String;
69933
69934 70
69935 Returns the string S whose length is Source'Length and such
69936 that S(I) is the character to which Mapping maps the
69937 corresponding element of Source, for I in 1..Source'Length.
69938
69939 71
69940 procedure Translate (Source : in out String;
69941 Mapping : in Maps.Character_Mapping);
69942
69943 procedure Translate (Source : in out String;
69944 Mapping : in Maps.Character_Mapping_Function);
69945
69946 72
69947 Equivalent to Source := Translate(Source, Mapping).
69948
69949 73
69950 function Replace_Slice (Source : in String;
69951 Low : in Positive;
69952 High : in Natural;
69953 By : in String)
69954 return String;
69955
69956 74/1
69957 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} If Low >
69958 Source'Last+1, or High < Source'First-1, then Index_Error is
69959 propagated. Otherwise:
69960
69961 74.1/1
69962 * {8652/00498652/0049} {AI95-00128-01AI95-00128-01} If High
69963 >= Low, then the returned string comprises
69964 Source(Source'First..Low-1) & By &
69965 Source(High+1..Source'Last), but with lower bound 1.
69966
69967 74.2/1
69968 * {8652/00498652/0049} {AI95-00128-01AI95-00128-01} If High
69969 < Low, then the returned string is Insert(Source,
69970 Before=>Low, New_Item=>By).
69971
69972 75
69973 procedure Replace_Slice (Source : in out String;
69974 Low : in Positive;
69975 High : in Natural;
69976 By : in String;
69977 Drop : in Truncation := Error;
69978 Justify : in Alignment := Left;
69979 Pad : in Character := Space);
69980
69981 76
69982 Equivalent to Move(Replace_Slice(Source, Low, High, By),
69983 Source, Drop, Justify, Pad).
69984
69985 77
69986 function Insert (Source : in String;
69987 Before : in Positive;
69988 New_Item : in String)
69989 return String;
69990
69991 78/3
69992 {AI05-0264-1AI05-0264-1} Propagates Index_Error if Before is
69993 not in Source'First .. Source'Last+1; otherwise, returns
69994 Source(Source'First..Before-1) & New_Item &
69995 Source(Before..Source'Last), but with lower bound 1.
69996
69997 79
69998 procedure Insert (Source : in out String;
69999 Before : in Positive;
70000 New_Item : in String;
70001 Drop : in Truncation := Error);
70002
70003 80
70004 Equivalent to Move(Insert(Source, Before, New_Item), Source,
70005 Drop).
70006
70007 81
70008 function Overwrite (Source : in String;
70009 Position : in Positive;
70010 New_Item : in String)
70011 return String;
70012
70013 82/3
70014 {AI05-0264-1AI05-0264-1} Propagates Index_Error if Position is
70015 not in Source'First .. Source'Last+1; otherwise, returns the
70016 string obtained from Source by consecutively replacing
70017 characters starting at Position with corresponding characters
70018 from New_Item. If the end of Source is reached before the
70019 characters in New_Item are exhausted, the remaining characters
70020 from New_Item are appended to the string.
70021
70022 83
70023 procedure Overwrite (Source : in out String;
70024 Position : in Positive;
70025 New_Item : in String;
70026 Drop : in Truncation := Right);
70027
70028 84
70029 Equivalent to Move(Overwrite(Source, Position, New_Item),
70030 Source, Drop).
70031
70032 85
70033 function Delete (Source : in String;
70034 From : in Positive;
70035 Through : in Natural)
70036 return String;
70037
70038 86/3
70039 {8652/00498652/0049} {AI95-00128-01AI95-00128-01}
70040 {AI05-0264-1AI05-0264-1} If From <= Through, the returned
70041 string is Replace_Slice(Source, From, Through, ""); otherwise,
70042 it is Source with lower bound 1.
70043
70044 87
70045 procedure Delete (Source : in out String;
70046 From : in Positive;
70047 Through : in Natural;
70048 Justify : in Alignment := Left;
70049 Pad : in Character := Space);
70050
70051 88
70052 Equivalent to Move(Delete(Source, From, Through), Source,
70053 Justify => Justify, Pad => Pad).
70054
70055 89
70056 function Trim (Source : in String;
70057 Side : in Trim_End)
70058 return String;
70059
70060 90
70061 Returns the string obtained by removing from Source all
70062 leading Space characters (if Side = Left), all trailing Space
70063 characters (if Side = Right), or all leading and trailing
70064 Space characters (if Side = Both).
70065
70066 91
70067 procedure Trim (Source : in out String;
70068 Side : in Trim_End;
70069 Justify : in Alignment := Left;
70070 Pad : in Character := Space);
70071
70072 92
70073 Equivalent to Move(Trim(Source, Side), Source,
70074 Justify=>Justify, Pad=>Pad).
70075
70076 93
70077 function Trim (Source : in String;
70078 Left : in Maps.Character_Set;
70079 Right : in Maps.Character_Set)
70080 return String;
70081
70082 94
70083 Returns the string obtained by removing from Source all
70084 leading characters in Left and all trailing characters in
70085 Right.
70086
70087 95
70088 procedure Trim (Source : in out String;
70089 Left : in Maps.Character_Set;
70090 Right : in Maps.Character_Set;
70091 Justify : in Alignment := Strings.Left;
70092 Pad : in Character := Space);
70093
70094 96
70095 Equivalent to Move(Trim(Source, Left, Right), Source, Justify
70096 => Justify, Pad=>Pad).
70097
70098 97
70099 function Head (Source : in String;
70100 Count : in Natural;
70101 Pad : in Character := Space)
70102 return String;
70103
70104 98/3
70105 {AI05-0264-1AI05-0264-1} Returns a string of length Count. If
70106 Count <= Source'Length, the string comprises the first Count
70107 characters of Source. Otherwise, its contents are Source
70108 concatenated with Count-Source'Length Pad characters.
70109
70110 99
70111 procedure Head (Source : in out String;
70112 Count : in Natural;
70113 Justify : in Alignment := Left;
70114 Pad : in Character := Space);
70115
70116 100
70117 Equivalent to Move(Head(Source, Count, Pad), Source,
70118 Drop=>Error, Justify=>Justify, Pad=>Pad).
70119
70120 101
70121 function Tail (Source : in String;
70122 Count : in Natural;
70123 Pad : in Character := Space)
70124 return String;
70125
70126 102/3
70127 {AI05-0264-1AI05-0264-1} Returns a string of length Count. If
70128 Count <= Source'Length, the string comprises the last Count
70129 characters of Source. Otherwise, its contents are
70130 Count-Source'Length Pad characters concatenated with Source.
70131
70132 103
70133 procedure Tail (Source : in out String;
70134 Count : in Natural;
70135 Justify : in Alignment := Left;
70136 Pad : in Character := Space);
70137
70138 104
70139 Equivalent to Move(Tail(Source, Count, Pad), Source,
70140 Drop=>Error, Justify=>Justify, Pad=>Pad).
70141
70142 105
70143 function "*" (Left : in Natural;
70144 Right : in Character) return String;
70145
70146 function "*" (Left : in Natural;
70147 Right : in String) return String;
70148
70149 106/1
70150 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} These
70151 functions replicate a character or string a specified number
70152 of times. The first function returns a string whose length is
70153 Left and each of whose elements is Right. The second function
70154 returns a string whose length is Left*Right'Length and whose
70155 value is the null string if Left = 0 and otherwise is
70156 (Left-1)*Right & Right with lower bound 1.
70157
70158 NOTES
70159
70160 107/3
70161 12 {AI05-0264-1AI05-0264-1} In the Index and Count functions
70162 taking Pattern and Mapping parameters, the actual String parameter
70163 passed to Pattern should comprise characters occurring as target
70164 characters of the mapping. Otherwise, the pattern will not match.
70165
70166 108
70167 13 In the Insert subprograms, inserting at the end of a string is
70168 obtained by passing Source'Last+1 as the Before parameter.
70169
70170 109
70171 14 If a null Character_Mapping_Function is passed to any of the
70172 string handling subprograms, Constraint_Error is propagated.
70173
70174 _Incompatibilities With Ada 95_
70175
70176 109.a/3
70177 {AI95-00301-01AI95-00301-01} {AI05-0005-1AI05-0005-1}
70178 Overloaded versions of Index and Index_Non_Blank are added to
70179 Strings.Fixed. If Strings.Fixed is referenced in a
70180 use_clause, and an entity E with a defining_identifier of
70181 Index or Index_Non_Blank is defined in a package that is also
70182 referenced in a use_clause, the entity E may no longer be
70183 use-visible, resulting in errors. This should be rare and is
70184 easily fixed if it does occur.
70185
70186 _Wording Changes from Ada 95_
70187
70188 109.b/2
70189 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} Corrigendum:
70190 Clarified that Find_Token may raise Constraint_Error if
70191 Source'First is not in Positive (which is only possible for a
70192 null string).
70193
70194 109.c/2
70195 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} Corrigendum:
70196 Clarified that Replace_Slice, Delete, and "*" always return a
70197 string with lower bound 1.
70198
70199 _Incompatibilities With Ada 2005_
70200
70201 109.d/3
70202 {AI05-0031-1AI05-0031-1} An overloaded version of Find_Token
70203 is added to Strings.Fixed. If Strings.Fixed is referenced in
70204 a use_clause, and an entity E with a defining_identifier of
70205 Find_Token is defined in a package that is also referenced in
70206 a use_clause, the entity E may no longer be use-visible,
70207 resulting in errors. This should be rare and is easily fixed
70208 if it does occur.
70209
70210 _Wording Changes from Ada 2005_
70211
70212 109.e/3
70213 {AI05-0056-1AI05-0056-1} Correction: Clarified that Index
70214 never raises Index_Error if the source string is null.
70215
70216 \1f
70217 File: aarm2012.info, Node: A.4.4, Next: A.4.5, Prev: A.4.3, Up: A.4
70218
70219 A.4.4 Bounded-Length String Handling
70220 ------------------------------------
70221
70222 1
70223 The language-defined package Strings.Bounded provides a generic package
70224 each of whose instances yields a private type Bounded_String and a set
70225 of operations. An object of a particular Bounded_String type represents
70226 a String whose low bound is 1 and whose length can vary conceptually
70227 between 0 and a maximum size established at the generic instantiation.
70228 The subprograms for fixed-length string handling are either overloaded
70229 directly for Bounded_String, or are modified as needed to reflect the
70230 variability in length. Additionally, since the Bounded_String type is
70231 private, appropriate constructor and selector operations are provided.
70232
70233 1.a
70234 Reason: Strings.Bounded declares an inner generic package,
70235 versus itself being directly a generic child of Strings, in
70236 order to retain compatibility with a version of the
70237 string-handling packages that is generic with respect to the
70238 character and string types.
70239
70240 1.b
70241 Reason: The bound of a bounded-length string is specified as a
70242 parameter to a generic, versus as the value for a
70243 discriminant, because of the inappropriateness of assignment
70244 and equality of discriminated types for the copying and
70245 comparison of bounded strings.
70246
70247 _Static Semantics_
70248
70249 2
70250 The library package Strings.Bounded has the following declaration:
70251
70252 3
70253 with Ada.Strings.Maps;
70254 package Ada.Strings.Bounded is
70255 pragma Preelaborate(Bounded);
70256
70257 4
70258 generic
70259 Max : Positive; -- Maximum length of a Bounded_String
70260 package Generic_Bounded_Length is
70261
70262 5
70263 Max_Length : constant Positive := Max;
70264
70265 6
70266 type Bounded_String is private;
70267
70268 7
70269 Null_Bounded_String : constant Bounded_String;
70270
70271 8
70272 subtype Length_Range is Natural range 0 .. Max_Length;
70273
70274 9
70275 function Length (Source : in Bounded_String) return Length_Range;
70276
70277 10
70278 -- Conversion, Concatenation, and Selection functions
70279
70280 11
70281 function To_Bounded_String (Source : in String;
70282 Drop : in Truncation := Error)
70283 return Bounded_String;
70284
70285 12
70286 function To_String (Source : in Bounded_String) return String;
70287
70288 12.1/2
70289 {AI95-00301-01AI95-00301-01} procedure Set_Bounded_String
70290 (Target : out Bounded_String;
70291 Source : in String;
70292 Drop : in Truncation := Error);
70293
70294 13
70295 function Append (Left, Right : in Bounded_String;
70296 Drop : in Truncation := Error)
70297 return Bounded_String;
70298
70299 14
70300 function Append (Left : in Bounded_String;
70301 Right : in String;
70302 Drop : in Truncation := Error)
70303 return Bounded_String;
70304
70305 15
70306 function Append (Left : in String;
70307 Right : in Bounded_String;
70308 Drop : in Truncation := Error)
70309 return Bounded_String;
70310
70311 16
70312 function Append (Left : in Bounded_String;
70313 Right : in Character;
70314 Drop : in Truncation := Error)
70315 return Bounded_String;
70316
70317 17
70318 function Append (Left : in Character;
70319 Right : in Bounded_String;
70320 Drop : in Truncation := Error)
70321 return Bounded_String;
70322
70323 18
70324 procedure Append (Source : in out Bounded_String;
70325 New_Item : in Bounded_String;
70326 Drop : in Truncation := Error);
70327
70328 19
70329 procedure Append (Source : in out Bounded_String;
70330 New_Item : in String;
70331 Drop : in Truncation := Error);
70332
70333 20
70334 procedure Append (Source : in out Bounded_String;
70335 New_Item : in Character;
70336 Drop : in Truncation := Error);
70337
70338 21
70339 function "&" (Left, Right : in Bounded_String)
70340 return Bounded_String;
70341
70342 22
70343 function "&" (Left : in Bounded_String; Right : in String)
70344 return Bounded_String;
70345
70346 23
70347 function "&" (Left : in String; Right : in Bounded_String)
70348 return Bounded_String;
70349
70350 24
70351 function "&" (Left : in Bounded_String; Right : in Character)
70352 return Bounded_String;
70353
70354 25
70355 function "&" (Left : in Character; Right : in Bounded_String)
70356 return Bounded_String;
70357
70358 26
70359 function Element (Source : in Bounded_String;
70360 Index : in Positive)
70361 return Character;
70362
70363 27
70364 procedure Replace_Element (Source : in out Bounded_String;
70365 Index : in Positive;
70366 By : in Character);
70367
70368 28
70369 function Slice (Source : in Bounded_String;
70370 Low : in Positive;
70371 High : in Natural)
70372 return String;
70373
70374 28.1/2
70375 {AI95-00301-01AI95-00301-01} function Bounded_Slice
70376 (Source : in Bounded_String;
70377 Low : in Positive;
70378 High : in Natural)
70379 return Bounded_String;
70380
70381 28.2/2
70382 {AI95-00301-01AI95-00301-01} procedure Bounded_Slice
70383 (Source : in Bounded_String;
70384 Target : out Bounded_String;
70385 Low : in Positive;
70386 High : in Natural);
70387
70388 29
70389 function "=" (Left, Right : in Bounded_String) return Boolean;
70390 function "=" (Left : in Bounded_String; Right : in String)
70391 return Boolean;
70392
70393 30
70394 function "=" (Left : in String; Right : in Bounded_String)
70395 return Boolean;
70396
70397 31
70398 function "<" (Left, Right : in Bounded_String) return Boolean;
70399
70400 32
70401 function "<" (Left : in Bounded_String; Right : in String)
70402 return Boolean;
70403
70404 33
70405 function "<" (Left : in String; Right : in Bounded_String)
70406 return Boolean;
70407
70408 34
70409 function "<=" (Left, Right : in Bounded_String) return Boolean;
70410
70411 35
70412 function "<=" (Left : in Bounded_String; Right : in String)
70413 return Boolean;
70414
70415 36
70416 function "<=" (Left : in String; Right : in Bounded_String)
70417 return Boolean;
70418
70419 37
70420 function ">" (Left, Right : in Bounded_String) return Boolean;
70421
70422 38
70423 function ">" (Left : in Bounded_String; Right : in String)
70424 return Boolean;
70425
70426 39
70427 function ">" (Left : in String; Right : in Bounded_String)
70428 return Boolean;
70429
70430 40
70431 function ">=" (Left, Right : in Bounded_String) return Boolean;
70432
70433 41
70434 function ">=" (Left : in Bounded_String; Right : in String)
70435 return Boolean;
70436
70437 42
70438 function ">=" (Left : in String; Right : in Bounded_String)
70439 return Boolean;
70440
70441 43/2
70442 {AI95-00301-01AI95-00301-01} -- Search subprograms
70443
70444 43.1/2
70445 {AI95-00301-01AI95-00301-01} function Index (Source : in Bounded_String;
70446 Pattern : in String;
70447 From : in Positive;
70448 Going : in Direction := Forward;
70449 Mapping : in Maps.Character_Mapping := Maps.Identity)
70450 return Natural;
70451
70452 43.2/2
70453 {AI95-00301-01AI95-00301-01} function Index (Source : in Bounded_String;
70454 Pattern : in String;
70455 From : in Positive;
70456 Going : in Direction := Forward;
70457 Mapping : in Maps.Character_Mapping_Function)
70458 return Natural;
70459
70460 44
70461 function Index (Source : in Bounded_String;
70462 Pattern : in String;
70463 Going : in Direction := Forward;
70464 Mapping : in Maps.Character_Mapping
70465 := Maps.Identity)
70466 return Natural;
70467
70468 45
70469 function Index (Source : in Bounded_String;
70470 Pattern : in String;
70471 Going : in Direction := Forward;
70472 Mapping : in Maps.Character_Mapping_Function)
70473 return Natural;
70474
70475 45.1/2
70476 {AI95-00301-01AI95-00301-01} function Index (Source : in Bounded_String;
70477 Set : in Maps.Character_Set;
70478 From : in Positive;
70479 Test : in Membership := Inside;
70480 Going : in Direction := Forward)
70481 return Natural;
70482
70483 46
70484 function Index (Source : in Bounded_String;
70485 Set : in Maps.Character_Set;
70486 Test : in Membership := Inside;
70487 Going : in Direction := Forward)
70488 return Natural;
70489
70490 46.1/2
70491 {AI95-00301-01AI95-00301-01} function Index_Non_Blank (Source : in Bounded_String;
70492 From : in Positive;
70493 Going : in Direction := Forward)
70494 return Natural;
70495
70496 47
70497 function Index_Non_Blank (Source : in Bounded_String;
70498 Going : in Direction := Forward)
70499 return Natural;
70500
70501 48
70502 function Count (Source : in Bounded_String;
70503 Pattern : in String;
70504 Mapping : in Maps.Character_Mapping
70505 := Maps.Identity)
70506 return Natural;
70507
70508 49
70509 function Count (Source : in Bounded_String;
70510 Pattern : in String;
70511 Mapping : in Maps.Character_Mapping_Function)
70512 return Natural;
70513
70514 50
70515 function Count (Source : in Bounded_String;
70516 Set : in Maps.Character_Set)
70517 return Natural;
70518
70519 50.1/3
70520 {AI05-0031-1AI05-0031-1} procedure Find_Token (Source : in Bounded_String;
70521 Set : in Maps.Character_Set;
70522 From : in Positive;
70523 Test : in Membership;
70524 First : out Positive;
70525 Last : out Natural);
70526
70527 51
70528 procedure Find_Token (Source : in Bounded_String;
70529 Set : in Maps.Character_Set;
70530 Test : in Membership;
70531 First : out Positive;
70532 Last : out Natural);
70533
70534 52
70535 -- String translation subprograms
70536
70537 53
70538 function Translate (Source : in Bounded_String;
70539 Mapping : in Maps.Character_Mapping)
70540 return Bounded_String;
70541
70542 54
70543 procedure Translate (Source : in out Bounded_String;
70544 Mapping : in Maps.Character_Mapping);
70545
70546 55
70547 function Translate (Source : in Bounded_String;
70548 Mapping : in Maps.Character_Mapping_Function)
70549 return Bounded_String;
70550
70551 56
70552 procedure Translate (Source : in out Bounded_String;
70553 Mapping : in Maps.Character_Mapping_Function);
70554
70555 57
70556 -- String transformation subprograms
70557
70558 58
70559 function Replace_Slice (Source : in Bounded_String;
70560 Low : in Positive;
70561 High : in Natural;
70562 By : in String;
70563 Drop : in Truncation := Error)
70564 return Bounded_String;
70565
70566 59
70567 procedure Replace_Slice (Source : in out Bounded_String;
70568 Low : in Positive;
70569 High : in Natural;
70570 By : in String;
70571 Drop : in Truncation := Error);
70572
70573 60
70574 function Insert (Source : in Bounded_String;
70575 Before : in Positive;
70576 New_Item : in String;
70577 Drop : in Truncation := Error)
70578 return Bounded_String;
70579
70580 61
70581 procedure Insert (Source : in out Bounded_String;
70582 Before : in Positive;
70583 New_Item : in String;
70584 Drop : in Truncation := Error);
70585
70586 62
70587 function Overwrite (Source : in Bounded_String;
70588 Position : in Positive;
70589 New_Item : in String;
70590 Drop : in Truncation := Error)
70591 return Bounded_String;
70592
70593 63
70594 procedure Overwrite (Source : in out Bounded_String;
70595 Position : in Positive;
70596 New_Item : in String;
70597 Drop : in Truncation := Error);
70598
70599 64
70600 function Delete (Source : in Bounded_String;
70601 From : in Positive;
70602 Through : in Natural)
70603 return Bounded_String;
70604
70605 65
70606 procedure Delete (Source : in out Bounded_String;
70607 From : in Positive;
70608 Through : in Natural);
70609
70610 66
70611 --String selector subprograms
70612
70613 67
70614 function Trim (Source : in Bounded_String;
70615 Side : in Trim_End)
70616 return Bounded_String;
70617 procedure Trim (Source : in out Bounded_String;
70618 Side : in Trim_End);
70619
70620 68
70621 function Trim (Source : in Bounded_String;
70622 Left : in Maps.Character_Set;
70623 Right : in Maps.Character_Set)
70624 return Bounded_String;
70625
70626 69
70627 procedure Trim (Source : in out Bounded_String;
70628 Left : in Maps.Character_Set;
70629 Right : in Maps.Character_Set);
70630
70631 70
70632 function Head (Source : in Bounded_String;
70633 Count : in Natural;
70634 Pad : in Character := Space;
70635 Drop : in Truncation := Error)
70636 return Bounded_String;
70637
70638 71
70639 procedure Head (Source : in out Bounded_String;
70640 Count : in Natural;
70641 Pad : in Character := Space;
70642 Drop : in Truncation := Error);
70643
70644 72
70645 function Tail (Source : in Bounded_String;
70646 Count : in Natural;
70647 Pad : in Character := Space;
70648 Drop : in Truncation := Error)
70649 return Bounded_String;
70650
70651 73
70652 procedure Tail (Source : in out Bounded_String;
70653 Count : in Natural;
70654 Pad : in Character := Space;
70655 Drop : in Truncation := Error);
70656
70657 74
70658 --String constructor subprograms
70659
70660 75
70661 function "*" (Left : in Natural;
70662 Right : in Character)
70663 return Bounded_String;
70664
70665 76
70666 function "*" (Left : in Natural;
70667 Right : in String)
70668 return Bounded_String;
70669
70670 77
70671 function "*" (Left : in Natural;
70672 Right : in Bounded_String)
70673 return Bounded_String;
70674
70675 78
70676 function Replicate (Count : in Natural;
70677 Item : in Character;
70678 Drop : in Truncation := Error)
70679 return Bounded_String;
70680
70681 79
70682 function Replicate (Count : in Natural;
70683 Item : in String;
70684 Drop : in Truncation := Error)
70685 return Bounded_String;
70686
70687 80
70688 function Replicate (Count : in Natural;
70689 Item : in Bounded_String;
70690 Drop : in Truncation := Error)
70691 return Bounded_String;
70692
70693 81
70694 private
70695 ... -- not specified by the language
70696 end Generic_Bounded_Length;
70697
70698 82
70699 end Ada.Strings.Bounded;
70700
70701 82.a.1/2
70702 This paragraph was deleted.{8652/00978652/0097}
70703 {AI95-00115-01AI95-00115-01} {AI95-00344-01AI95-00344-01}
70704
70705 83
70706 Null_Bounded_String represents the null string. If an object of type
70707 Bounded_String is not otherwise initialized, it will be initialized to
70708 the same value as Null_Bounded_String.
70709
70710 84
70711 function Length (Source : in Bounded_String) return Length_Range;
70712
70713 85
70714 The Length function returns the length of the string
70715 represented by Source.
70716
70717 86
70718 function To_Bounded_String (Source : in String;
70719 Drop : in Truncation := Error)
70720 return Bounded_String;
70721
70722 87/3
70723 {AI05-0264-1AI05-0264-1} If Source'Length <= Max_Length, then
70724 this function returns a Bounded_String that represents Source.
70725 Otherwise, the effect depends on the value of Drop:
70726
70727 88
70728 * If Drop=Left, then the result is a Bounded_String that
70729 represents the string comprising the rightmost Max_Length
70730 characters of Source.
70731
70732 89
70733 * If Drop=Right, then the result is a Bounded_String that
70734 represents the string comprising the leftmost Max_Length
70735 characters of Source.
70736
70737 90
70738 * If Drop=Error, then Strings.Length_Error is propagated.
70739
70740 91
70741 function To_String (Source : in Bounded_String) return String;
70742
70743 92
70744 To_String returns the String value with lower bound 1
70745 represented by Source. If B is a Bounded_String, then B =
70746 To_Bounded_String(To_String(B)).
70747
70748 92.1/2
70749 procedure Set_Bounded_String
70750 (Target : out Bounded_String;
70751 Source : in String;
70752 Drop : in Truncation := Error);
70753
70754 92.2/2
70755 {AI95-00301-01AI95-00301-01} Equivalent to Target :=
70756 To_Bounded_String (Source, Drop);
70757
70758 93
70759 Each of the Append functions returns a Bounded_String obtained by
70760 concatenating the string or character given or represented by one of the
70761 parameters, with the string or character given or represented by the
70762 other parameter, and applying To_Bounded_String to the concatenation
70763 result string, with Drop as provided to the Append function.
70764
70765 94
70766 Each of the procedures Append(Source, New_Item, Drop) has the same
70767 effect as the corresponding assignment Source := Append(Source,
70768 New_Item, Drop).
70769
70770 95
70771 Each of the "&" functions has the same effect as the corresponding
70772 Append function, with Error as the Drop parameter.
70773
70774 96
70775 function Element (Source : in Bounded_String;
70776 Index : in Positive)
70777 return Character;
70778
70779 97
70780 Returns the character at position Index in the string
70781 represented by Source; propagates Index_Error if Index >
70782 Length(Source).
70783
70784 98
70785 procedure Replace_Element (Source : in out Bounded_String;
70786 Index : in Positive;
70787 By : in Character);
70788
70789 99
70790 Updates Source such that the character at position Index in
70791 the string represented by Source is By; propagates Index_Error
70792 if Index > Length(Source).
70793
70794 100
70795 function Slice (Source : in Bounded_String;
70796 Low : in Positive;
70797 High : in Natural)
70798 return String;
70799
70800 101/1
70801 {8652/00498652/0049} {AI95-00128-01AI95-00128-01}
70802 {AI95-00238-01AI95-00238-01} Returns the slice at positions
70803 Low through High in the string represented by Source;
70804 propagates Index_Error if Low > Length(Source)+1 or High >
70805 Length(Source). The bounds of the returned string are Low and
70806 High..
70807
70808 101.1/2
70809 function Bounded_Slice
70810 (Source : in Bounded_String;
70811 Low : in Positive;
70812 High : in Natural)
70813 return Bounded_String;
70814
70815 101.2/2
70816 {AI95-00301-01AI95-00301-01} Returns the slice at positions
70817 Low through High in the string represented by Source as a
70818 bounded string; propagates Index_Error if Low >
70819 Length(Source)+1 or High > Length(Source).
70820
70821 101.3/2
70822 procedure Bounded_Slice
70823 (Source : in Bounded_String;
70824 Target : out Bounded_String;
70825 Low : in Positive;
70826 High : in Natural);
70827
70828 101.4/2
70829 {AI95-00301-01AI95-00301-01} Equivalent to Target :=
70830 Bounded_Slice (Source, Low, High);
70831
70832 102
70833 Each of the functions "=", "<", ">", "<=", and ">=" returns the same
70834 result as the corresponding String operation applied to the String
70835 values given or represented by the two parameters.
70836
70837 103
70838 Each of the search subprograms (Index, Index_Non_Blank, Count,
70839 Find_Token) has the same effect as the corresponding subprogram in
70840 Strings.Fixed applied to the string represented by the Bounded_String
70841 parameter.
70842
70843 104
70844 Each of the Translate subprograms, when applied to a Bounded_String, has
70845 an analogous effect to the corresponding subprogram in Strings.Fixed.
70846 For the Translate function, the translation is applied to the string
70847 represented by the Bounded_String parameter, and the result is converted
70848 (via To_Bounded_String) to a Bounded_String. For the Translate
70849 procedure, the string represented by the Bounded_String parameter after
70850 the translation is given by the Translate function for fixed-length
70851 strings applied to the string represented by the original value of the
70852 parameter.
70853
70854 105/1
70855 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} Each of the
70856 transformation subprograms (Replace_Slice, Insert, Overwrite, Delete),
70857 selector subprograms (Trim, Head, Tail), and constructor functions ("*")
70858 has an effect based on its corresponding subprogram in Strings.Fixed,
70859 and Replicate is based on Fixed."*". In the case of a function, the
70860 corresponding fixed-length string subprogram is applied to the string
70861 represented by the Bounded_String parameter. To_Bounded_String is
70862 applied the result string, with Drop (or Error in the case of
70863 Generic_Bounded_Length."*") determining the effect when the string
70864 length exceeds Max_Length. In the case of a procedure, the
70865 corresponding function in Strings.Bounded.Generic_Bounded_Length is
70866 applied, with the result assigned into the Source parameter.
70867
70868 105.a/2
70869 Ramification: {AI95-00114-01AI95-00114-01} The "/=" operations
70870 between Bounded_String and String, and between String and
70871 Bounded_String, are automatically defined based on the
70872 corresponding "=" operations.
70873
70874 _Implementation Advice_
70875
70876 106
70877 Bounded string objects should not be implemented by implicit pointers
70878 and dynamic allocation.
70879
70880 106.a.1/2
70881 Implementation Advice: Bounded string objects should not be
70882 implemented by implicit pointers and dynamic allocation.
70883
70884 106.a
70885 Implementation Note: The following is a possible
70886 implementation of the private part of the package:
70887
70888 106.b
70889 type Bounded_String_Internals (Length : Length_Range := 0) is
70890 record
70891 Data : String(1..Length);
70892 end record;
70893
70894 106.c
70895 type Bounded_String is
70896 record
70897 Data : Bounded_String_Internals; -- Unconstrained
70898 end record;
70899
70900 106.d
70901 Null_Bounded_String : constant Bounded_String :=
70902 (Data => (Length => 0,
70903 Data => (1..0 => ' ')));
70904
70905 _Inconsistencies With Ada 95_
70906
70907 106.e/2
70908 {AI95-00238-01AI95-00238-01} Amendment Correction: The bounds
70909 of the string returned from Slice are now defined. This is
70910 technically an inconsistency; if a program depended on some
70911 other lower bound for the string returned from Slice, it could
70912 fail when compiled with Ada 2005. Such code is not portable
70913 even between Ada 95 implementations, so it should be very
70914 rare.
70915
70916 _Incompatibilities With Ada 95_
70917
70918 106.f/3
70919 {AI95-00301-01AI95-00301-01} {AI05-0005-1AI05-0005-1}
70920 Procedure Set_Bounded_String, two Bounded_Slice subprograms,
70921 and overloaded versions of Index and Index_Non_Blank are added
70922 to Strings.Bounded.Generic_Bounded_Length. If an instance of
70923 Generic_Bounded_Length is referenced in a use_clause, and an
70924 entity E with the defining_identifier as a new entity in
70925 Generic_Bounded_Length is defined in a package that is also
70926 referenced in a use_clause, the entity E may no longer be
70927 use-visible, resulting in errors. This should be rare and is
70928 easily fixed if it does occur.
70929
70930 _Wording Changes from Ada 95_
70931
70932 106.g/2
70933 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} Corrigendum:
70934 Corrected the conditions for which Slice raises Index_Error.
70935
70936 106.h/2
70937 {8652/00498652/0049} {AI95-00128-01AI95-00128-01} Corrigendum:
70938 Clarified the meaning of transformation, selector, and
70939 constructor subprograms by describing the effects of
70940 procedures and functions separately.
70941
70942 _Incompatibilities With Ada 2005_
70943
70944 106.i/3
70945 {AI05-0031-1AI05-0031-1} An overloaded version of Find_Token
70946 is added to Strings.Bounded.Generic_Bounded_Length. If an
70947 instance of Generic_Bounded_Length is referenced in a
70948 use_clause, and an entity E with a defining_identifier of
70949 Find_Token is defined in a package that is also referenced in
70950 a use_clause, the entity E may no longer be use-visible,
70951 resulting in errors. This should be rare and is easily fixed
70952 if it does occur.
70953
70954 \1f
70955 File: aarm2012.info, Node: A.4.5, Next: A.4.6, Prev: A.4.4, Up: A.4
70956
70957 A.4.5 Unbounded-Length String Handling
70958 --------------------------------------
70959
70960 1
70961 The language-defined package Strings.Unbounded provides a private type
70962 Unbounded_String and a set of operations. An object of type
70963 Unbounded_String represents a String whose low bound is 1 and whose
70964 length can vary conceptually between 0 and Natural'Last. The
70965 subprograms for fixed-length string handling are either overloaded
70966 directly for Unbounded_String, or are modified as needed to reflect the
70967 flexibility in length. Since the Unbounded_String type is private,
70968 relevant constructor and selector operations are provided.
70969
70970 1.a
70971 Reason: The transformation operations for fixed- and
70972 bounded-length strings that are not necessarily length
70973 preserving are supplied for Unbounded_String as procedures as
70974 well as functions. This allows an implementation to do an
70975 initial allocation for an unbounded string and to avoid
70976 further allocations as long as the length does not exceed the
70977 allocated length.
70978
70979 _Static Semantics_
70980
70981 2
70982 The library package Strings.Unbounded has the following declaration:
70983
70984 3
70985 with Ada.Strings.Maps;
70986 package Ada.Strings.Unbounded is
70987 pragma Preelaborate(Unbounded);
70988
70989 4/2
70990 {AI95-00161-01AI95-00161-01} type Unbounded_String is private;
70991 pragma Preelaborable_Initialization(Unbounded_String);
70992
70993 5
70994 Null_Unbounded_String : constant Unbounded_String;
70995
70996 6
70997 function Length (Source : in Unbounded_String) return Natural;
70998
70999 7
71000 type String_Access is access all String;
71001 procedure Free (X : in out String_Access);
71002
71003 8
71004 -- Conversion, Concatenation, and Selection functions
71005
71006 9
71007 function To_Unbounded_String (Source : in String)
71008 return Unbounded_String;
71009
71010 10
71011 function To_Unbounded_String (Length : in Natural)
71012 return Unbounded_String;
71013
71014 11
71015 function To_String (Source : in Unbounded_String) return String;
71016
71017 11.1/2
71018 {AI95-00301-01AI95-00301-01} procedure Set_Unbounded_String
71019 (Target : out Unbounded_String;
71020 Source : in String);
71021
71022 12
71023 procedure Append (Source : in out Unbounded_String;
71024 New_Item : in Unbounded_String);
71025
71026 13
71027 procedure Append (Source : in out Unbounded_String;
71028 New_Item : in String);
71029
71030 14
71031 procedure Append (Source : in out Unbounded_String;
71032 New_Item : in Character);
71033
71034 15
71035 function "&" (Left, Right : in Unbounded_String)
71036 return Unbounded_String;
71037
71038 16
71039 function "&" (Left : in Unbounded_String; Right : in String)
71040 return Unbounded_String;
71041
71042 17
71043 function "&" (Left : in String; Right : in Unbounded_String)
71044 return Unbounded_String;
71045
71046 18
71047 function "&" (Left : in Unbounded_String; Right : in Character)
71048 return Unbounded_String;
71049
71050 19
71051 function "&" (Left : in Character; Right : in Unbounded_String)
71052 return Unbounded_String;
71053
71054 20
71055 function Element (Source : in Unbounded_String;
71056 Index : in Positive)
71057 return Character;
71058
71059 21
71060 procedure Replace_Element (Source : in out Unbounded_String;
71061 Index : in Positive;
71062 By : in Character);
71063
71064 22
71065 function Slice (Source : in Unbounded_String;
71066 Low : in Positive;
71067 High : in Natural)
71068 return String;
71069
71070 22.1/2
71071 {AI95-00301-01AI95-00301-01} function Unbounded_Slice
71072 (Source : in Unbounded_String;
71073 Low : in Positive;
71074 High : in Natural)
71075 return Unbounded_String;
71076
71077 22.2/2
71078 {AI95-00301-01AI95-00301-01} procedure Unbounded_Slice
71079 (Source : in Unbounded_String;
71080 Target : out Unbounded_String;
71081 Low : in Positive;
71082 High : in Natural);
71083
71084 23
71085 function "=" (Left, Right : in Unbounded_String) return Boolean;
71086
71087 24
71088 function "=" (Left : in Unbounded_String; Right : in String)
71089 return Boolean;
71090
71091 25
71092 function "=" (Left : in String; Right : in Unbounded_String)
71093 return Boolean;
71094
71095 26
71096 function "<" (Left, Right : in Unbounded_String) return Boolean;
71097
71098 27
71099 function "<" (Left : in Unbounded_String; Right : in String)
71100 return Boolean;
71101
71102 28
71103 function "<" (Left : in String; Right : in Unbounded_String)
71104 return Boolean;
71105
71106 29
71107 function "<=" (Left, Right : in Unbounded_String) return Boolean;
71108
71109 30
71110 function "<=" (Left : in Unbounded_String; Right : in String)
71111 return Boolean;
71112
71113 31
71114 function "<=" (Left : in String; Right : in Unbounded_String)
71115 return Boolean;
71116
71117 32
71118 function ">" (Left, Right : in Unbounded_String) return Boolean;
71119
71120 33
71121 function ">" (Left : in Unbounded_String; Right : in String)
71122 return Boolean;
71123
71124 34
71125 function ">" (Left : in String; Right : in Unbounded_String)
71126 return Boolean;
71127
71128 35
71129 function ">=" (Left, Right : in Unbounded_String) return Boolean;
71130
71131 36
71132 function ">=" (Left : in Unbounded_String; Right : in String)
71133 return Boolean;
71134
71135 37
71136 function ">=" (Left : in String; Right : in Unbounded_String)
71137 return Boolean;
71138
71139 38
71140 -- Search subprograms
71141
71142 38.1/2
71143 {AI95-00301-01AI95-00301-01} function Index (Source : in Unbounded_String;
71144 Pattern : in String;
71145 From : in Positive;
71146 Going : in Direction := Forward;
71147 Mapping : in Maps.Character_Mapping := Maps.Identity)
71148 return Natural;
71149
71150 38.2/2
71151 {AI95-00301-01AI95-00301-01} function Index (Source : in Unbounded_String;
71152 Pattern : in String;
71153 From : in Positive;
71154 Going : in Direction := Forward;
71155 Mapping : in Maps.Character_Mapping_Function)
71156 return Natural;
71157
71158 39
71159 function Index (Source : in Unbounded_String;
71160 Pattern : in String;
71161 Going : in Direction := Forward;
71162 Mapping : in Maps.Character_Mapping
71163 := Maps.Identity)
71164 return Natural;
71165
71166 40
71167 function Index (Source : in Unbounded_String;
71168 Pattern : in String;
71169 Going : in Direction := Forward;
71170 Mapping : in Maps.Character_Mapping_Function)
71171 return Natural;
71172
71173 40.1/2
71174 {AI95-00301-01AI95-00301-01} function Index (Source : in Unbounded_String;
71175 Set : in Maps.Character_Set;
71176 From : in Positive;
71177 Test : in Membership := Inside;
71178 Going : in Direction := Forward)
71179 return Natural;
71180
71181 41
71182 function Index (Source : in Unbounded_String;
71183 Set : in Maps.Character_Set;
71184 Test : in Membership := Inside;
71185 Going : in Direction := Forward) return Natural;
71186
71187 41.1/2
71188 {AI95-00301-01AI95-00301-01} function Index_Non_Blank (Source : in Unbounded_String;
71189 From : in Positive;
71190 Going : in Direction := Forward)
71191 return Natural;
71192
71193 42
71194 function Index_Non_Blank (Source : in Unbounded_String;
71195 Going : in Direction := Forward)
71196 return Natural;
71197
71198 43
71199 function Count (Source : in Unbounded_String;
71200 Pattern : in String;
71201 Mapping : in Maps.Character_Mapping
71202 := Maps.Identity)
71203 return Natural;
71204
71205 44
71206 function Count (Source : in Unbounded_String;
71207 Pattern : in String;
71208 Mapping : in Maps.Character_Mapping_Function)
71209 return Natural;
71210
71211 45
71212 function Count (Source : in Unbounded_String;
71213 Set : in Maps.Character_Set)
71214 return Natural;
71215
71216 45.1/3
71217 {AI05-0031-1AI05-0031-1} procedure Find_Token (Source : in Unbounded_String;
71218 Set : in Maps.Character_Set;
71219 From : in Positive;
71220 Test : in Membership;
71221 First : out Positive;
71222 Last : out Natural);
71223
71224 46
71225 procedure Find_Token (Source : in Unbounded_String;
71226 Set : in Maps.Character_Set;
71227 Test : in Membership;
71228 First : out Positive;
71229 Last : out Natural);
71230
71231 47
71232 -- String translation subprograms
71233
71234 48
71235 function Translate (Source : in Unbounded_String;
71236 Mapping : in Maps.Character_Mapping)
71237 return Unbounded_String;
71238
71239 49
71240 procedure Translate (Source : in out Unbounded_String;
71241 Mapping : in Maps.Character_Mapping);
71242
71243 50
71244 function Translate (Source : in Unbounded_String;
71245 Mapping : in Maps.Character_Mapping_Function)
71246 return Unbounded_String;
71247
71248 51
71249 procedure Translate (Source : in out Unbounded_String;
71250 Mapping : in Maps.Character_Mapping_Function);
71251
71252 52
71253 -- String transformation subprograms
71254
71255 53
71256 function Replace_Slice (Source : in Unbounded_String;
71257 Low : in Positive;
71258 High : in Natural;
71259 By : in String)
71260 return Unbounded_String;
71261
71262 54
71263 procedure Replace_Slice (Source : in out Unbounded_String;
71264 Low : in Positive;
71265 High : in Natural;
71266 By : in String);
71267
71268 55
71269 function Insert (Source : in Unbounded_String;
71270 Before : in Positive;
71271 New_Item : in String)
71272 return Unbounded_String;
71273
71274 56
71275 procedure Insert (Source : in out Unbounded_String;
71276 Before : in Positive;
71277 New_Item : in String);
71278
71279 57
71280 function Overwrite (Source : in Unbounded_String;
71281 Position : in Positive;
71282 New_Item : in String)
71283 return Unbounded_String;
71284
71285 58
71286 procedure Overwrite (Source : in out Unbounded_String;
71287 Position : in Positive;
71288 New_Item : in String);
71289
71290 59
71291 function Delete (Source : in Unbounded_String;
71292 From : in Positive;
71293 Through : in Natural)
71294 return Unbounded_String;
71295
71296 60
71297 procedure Delete (Source : in out Unbounded_String;
71298 From : in Positive;
71299 Through : in Natural);
71300
71301 61
71302 function Trim (Source : in Unbounded_String;
71303 Side : in Trim_End)
71304 return Unbounded_String;
71305
71306 62
71307 procedure Trim (Source : in out Unbounded_String;
71308 Side : in Trim_End);
71309
71310 63
71311 function Trim (Source : in Unbounded_String;
71312 Left : in Maps.Character_Set;
71313 Right : in Maps.Character_Set)
71314 return Unbounded_String;
71315
71316 64
71317 procedure Trim (Source : in out Unbounded_String;
71318 Left : in Maps.Character_Set;
71319 Right : in Maps.Character_Set);
71320
71321 65
71322 function Head (Source : in Unbounded_String;
71323 Count : in Natural;
71324 Pad : in Character := Space)
71325 return Unbounded_String;
71326
71327 66
71328 procedure Head (Source : in out Unbounded_String;
71329 Count : in Natural;
71330 Pad : in Character := Space);
71331
71332 67
71333 function Tail (Source : in Unbounded_String;
71334 Count : in Natural;
71335 Pad : in Character := Space)
71336 return Unbounded_String;
71337
71338 68
71339 procedure Tail (Source : in out Unbounded_String;
71340 Count : in Natural;
71341 Pad : in Character := Space);
71342
71343 69
71344 function "*" (Left : in Natural;
71345 Right : in Character)
71346 return Unbounded_String;
71347
71348 70
71349 function "*" (Left : in Natural;
71350 Right : in String)
71351 return Unbounded_String;
71352
71353 71
71354 function "*" (Left : in Natural;
71355 Right : in Unbounded_String)
71356 return Unbounded_String;
71357
71358 72
71359 private
71360 ... -- not specified by the language
71361 end Ada.Strings.Unbounded;
71362
71363 72.1/2
71364 {AI95-00360-01AI95-00360-01} The type Unbounded_String needs
71365 finalization (see *note 7.6::).
71366
71367 73
71368 Null_Unbounded_String represents the null String. If an object of type
71369 Unbounded_String is not otherwise initialized, it will be initialized to
71370 the same value as Null_Unbounded_String.
71371
71372 74
71373 The function Length returns the length of the String represented by
71374 Source.
71375
71376 75
71377 The type String_Access provides a (nonprivate) access type for explicit
71378 processing of unbounded-length strings. The procedure Free performs an
71379 unchecked deallocation of an object of type String_Access.
71380
71381 76
71382 The function To_Unbounded_String(Source : in String) returns an
71383 Unbounded_String that represents Source. The function
71384 To_Unbounded_String(Length : in Natural) returns an Unbounded_String
71385 that represents an uninitialized String whose length is Length.
71386
71387 77
71388 The function To_String returns the String with lower bound 1 represented
71389 by Source. To_String and To_Unbounded_String are related as follows:
71390
71391 78
71392 * If S is a String, then To_String(To_Unbounded_String(S)) = S.
71393
71394 79
71395 * If U is an Unbounded_String, then To_Unbounded_String(To_String(U))
71396 = U.
71397
71398 79.1/2
71399 {AI95-00301-01AI95-00301-01} The procedure Set_Unbounded_String sets
71400 Target to an Unbounded_String that represents Source.
71401
71402 80
71403 For each of the Append procedures, the resulting string represented by
71404 the Source parameter is given by the concatenation of the original value
71405 of Source and the value of New_Item.
71406
71407 81
71408 Each of the "&" functions returns an Unbounded_String obtained by
71409 concatenating the string or character given or represented by one of the
71410 parameters, with the string or character given or represented by the
71411 other parameter, and applying To_Unbounded_String to the concatenation
71412 result string.
71413
71414 82
71415 The Element, Replace_Element, and Slice subprograms have the same effect
71416 as the corresponding bounded-length string subprograms.
71417
71418 82.1/3
71419 {AI95-00301-01AI95-00301-01} {AI05-0262-1AI05-0262-1} The function
71420 Unbounded_Slice returns the slice at positions Low through High in the
71421 string represented by Source as an Unbounded_String. The procedure
71422 Unbounded_Slice sets Target to the Unbounded_String representing the
71423 slice at positions Low through High in the string represented by Source.
71424 Both subprograms propagate Index_Error if Low > Length(Source)+1 or High
71425 > Length(Source).
71426
71427 83
71428 Each of the functions "=", "<", ">", "<=", and ">=" returns the same
71429 result as the corresponding String operation applied to the String
71430 values given or represented by Left and Right.
71431
71432 84
71433 Each of the search subprograms (Index, Index_Non_Blank, Count,
71434 Find_Token) has the same effect as the corresponding subprogram in
71435 Strings.Fixed applied to the string represented by the Unbounded_String
71436 parameter.
71437
71438 85
71439 The Translate function has an analogous effect to the corresponding
71440 subprogram in Strings.Fixed. The translation is applied to the string
71441 represented by the Unbounded_String parameter, and the result is
71442 converted (via To_Unbounded_String) to an Unbounded_String.
71443
71444 86
71445 Each of the transformation functions (Replace_Slice, Insert, Overwrite,
71446 Delete), selector functions (Trim, Head, Tail), and constructor
71447 functions ("*") is likewise analogous to its corresponding subprogram in
71448 Strings.Fixed. For each of the subprograms, the corresponding
71449 fixed-length string subprogram is applied to the string represented by
71450 the Unbounded_String parameter, and To_Unbounded_String is applied the
71451 result string.
71452
71453 87
71454 For each of the procedures Translate, Replace_Slice, Insert, Overwrite,
71455 Delete, Trim, Head, and Tail, the resulting string represented by the
71456 Source parameter is given by the corresponding function for fixed-length
71457 strings applied to the string represented by Source's original value.
71458
71459 _Implementation Requirements_
71460
71461 88
71462 No storage associated with an Unbounded_String object shall be lost upon
71463 assignment or scope exit.
71464
71465 88.a/2
71466 Implementation Note: {AI95-00301-01AI95-00301-01} A sample
71467 implementation of the private part of the package and several
71468 of the subprograms appears in the Ada 95 Rationale.
71469
71470 _Incompatibilities With Ada 95_
71471
71472 88.b/2
71473 {AI95-00360-01AI95-00360-01} Amendment Correction: Type
71474 Unbounded_String is defined to need finalization. If the
71475 restriction No_Nested_Finalization (see *note D.7::) applies
71476 to the partition, and Unbounded_String does not have a
71477 controlled part, it will not be allowed in local objects in
71478 Ada 2005 whereas it would be allowed in original Ada 95. Such
71479 code is not portable, as most Ada compilers have a controlled
71480 part in Unbounded_String, and thus would be illegal.
71481
71482 88.c/3
71483 {AI95-00301-01AI95-00301-01} {AI05-0005-1AI05-0005-1}
71484 Procedure Set_Unbounded_String, two Unbounded_Slice
71485 subprograms, and overloaded versions of Index and
71486 Index_Non_Blank are added to Strings.Unbounded. If
71487 Strings.Unbounded is referenced in a use_clause, and an entity
71488 E with the same defining_identifier as a new entity in
71489 Strings.Unbounded is defined in a package that is also
71490 referenced in a use_clause, the entity E may no longer be
71491 use-visible, resulting in errors. This should be rare and is
71492 easily fixed if it does occur.
71493
71494 _Extensions to Ada 95_
71495
71496 88.d/2
71497 {AI95-00161-01AI95-00161-01} Amendment Correction: Added a
71498 pragma Preelaborable_Initialization to type Unbounded_String,
71499 so that it can be used to declare default-initialized objects
71500 in preelaborated units.
71501
71502 _Incompatibilities With Ada 2005_
71503
71504 88.e/3
71505 {AI05-0031-1AI05-0031-1} An overloaded version of Find_Token
71506 is added to Strings.Unbounded. If Strings.Unbounded is
71507 referenced in a use_clause, and an entity E with a
71508 defining_identifier of Find_Token is defined in a package that
71509 is also referenced in a use_clause, the entity E may no longer
71510 be use-visible, resulting in errors. This should be rare and
71511 is easily fixed if it does occur.
71512
71513 \1f
71514 File: aarm2012.info, Node: A.4.6, Next: A.4.7, Prev: A.4.5, Up: A.4
71515
71516 A.4.6 String-Handling Sets and Mappings
71517 ---------------------------------------
71518
71519 1
71520 The language-defined package Strings.Maps.Constants declares
71521 Character_Set and Character_Mapping constants corresponding to
71522 classification and conversion functions in package Characters.Handling.
71523
71524 1.a
71525 Discussion: The Constants package is a child of Strings.Maps
71526 since it needs visibility of the private part of Strings.Maps
71527 in order to initialize the constants in a preelaborable way
71528 (i.e. via aggregates versus function calls).
71529
71530 _Static Semantics_
71531
71532 2
71533 The library package Strings.Maps.Constants has the following
71534 declaration:
71535
71536 3/2
71537 {AI95-00362-01AI95-00362-01} package Ada.Strings.Maps.Constants is
71538 pragma Pure(Constants);
71539
71540 4
71541 Control_Set : constant Character_Set;
71542 Graphic_Set : constant Character_Set;
71543 Letter_Set : constant Character_Set;
71544 Lower_Set : constant Character_Set;
71545 Upper_Set : constant Character_Set;
71546 Basic_Set : constant Character_Set;
71547 Decimal_Digit_Set : constant Character_Set;
71548 Hexadecimal_Digit_Set : constant Character_Set;
71549 Alphanumeric_Set : constant Character_Set;
71550 Special_Set : constant Character_Set;
71551 ISO_646_Set : constant Character_Set;
71552
71553 5
71554 Lower_Case_Map : constant Character_Mapping;
71555 --Maps to lower case for letters, else identity
71556 Upper_Case_Map : constant Character_Mapping;
71557 --Maps to upper case for letters, else identity
71558 Basic_Map : constant Character_Mapping;
71559 --Maps to basic letter for letters, else identity
71560
71561 6
71562 private
71563 ... -- not specified by the language
71564 end Ada.Strings.Maps.Constants;
71565
71566 7
71567 Each of these constants represents a correspondingly named set of
71568 characters or character mapping in Characters.Handling (see *note
71569 A.3.2::).
71570
71571 NOTES
71572
71573 8/3
71574 15 {AI05-0114-1AI05-0114-1} There are certain characters which are
71575 defined to be lower case letters by ISO 10646 and are therefore
71576 allowed in identifiers, but are not considered lower case letters
71577 by Ada.Strings.Maps.Constants.
71578
71579 8.a/3
71580 Reason: This is to maintain runtime compatibility with the Ada
71581 95 definitions of these constants; existing correct programs
71582 could break if the definitions were changed in a way the
71583 programs did not anticipate.
71584
71585 _Extensions to Ada 95_
71586
71587 8.b/2
71588 {AI95-00362-01AI95-00362-01} Strings.Maps.Constants is now
71589 Pure, so it can be used in pure units.
71590
71591 _Wording Changes from Ada 2005_
71592
71593 8.c/3
71594 {AI05-0114-1AI05-0114-1} Correction: Added a note to clarify
71595 that these constants don't have any relationship to the
71596 characters allowed in identifiers.
71597
71598 \1f
71599 File: aarm2012.info, Node: A.4.7, Next: A.4.8, Prev: A.4.6, Up: A.4
71600
71601 A.4.7 Wide_String Handling
71602 --------------------------
71603
71604 1/3
71605 {AI95-00302-03AI95-00302-03} {AI05-0286-1AI05-0286-1} Facilities for
71606 handling strings of Wide_Character elements are found in the packages
71607 Strings.Wide_Maps, Strings.Wide_Fixed, Strings.Wide_Bounded,
71608 Strings.Wide_Unbounded, and Strings.Wide_Maps.Wide_Constants, and in the
71609 library functions Strings.Wide_Hash, Strings.Wide_Fixed.Wide_Hash,
71610 Strings.Wide_Bounded.Wide_Hash, Strings.Wide_Unbounded.Wide_Hash,
71611 Strings.Wide_Hash_Case_Insensitive,
71612 Strings.Wide_Fixed.Wide_Hash_Case_Insensitive,
71613 Strings.Wide_Bounded.Wide_Hash_Case_Insensitive,
71614 Strings.Wide_Unbounded.Wide_Hash_Case_Insensitive,
71615 Strings.Wide_Equal_Case_Insensitive,
71616 Strings.Wide_Fixed.Wide_Equal_Case_Insensitive,
71617 Strings.Wide_Bounded.Wide_Equal_Case_Insensitive, and
71618 Strings.Wide_Unbounded.Wide_Equal_Case_Insensitive. They provide the
71619 same string-handling operations as the corresponding packages and
71620 functions for strings of Character elements.
71621
71622 _Static Semantics_
71623
71624 2
71625 The package Strings.Wide_Maps has the following declaration.
71626
71627 3
71628 package Ada.Strings.Wide_Maps is
71629 pragma Preelaborate(Wide_Maps);
71630
71631 4/2
71632 {AI95-00161-01AI95-00161-01} -- Representation for a set of Wide_Character values:
71633 type Wide_Character_Set is private;
71634 pragma Preelaborable_Initialization(Wide_Character_Set);
71635
71636 5
71637 Null_Set : constant Wide_Character_Set;
71638
71639 6
71640 type Wide_Character_Range is
71641 record
71642 Low : Wide_Character;
71643 High : Wide_Character;
71644 end record;
71645 -- Represents Wide_Character range Low..High
71646
71647 7
71648 type Wide_Character_Ranges is array (Positive range <>)
71649 of Wide_Character_Range;
71650
71651 8
71652 function To_Set (Ranges : in Wide_Character_Ranges)
71653 return Wide_Character_Set;
71654
71655 9
71656 function To_Set (Span : in Wide_Character_Range)
71657 return Wide_Character_Set;
71658
71659 10
71660 function To_Ranges (Set : in Wide_Character_Set)
71661 return Wide_Character_Ranges;
71662
71663 11
71664 function "=" (Left, Right : in Wide_Character_Set) return Boolean;
71665
71666 12
71667 function "not" (Right : in Wide_Character_Set)
71668 return Wide_Character_Set;
71669 function "and" (Left, Right : in Wide_Character_Set)
71670 return Wide_Character_Set;
71671 function "or" (Left, Right : in Wide_Character_Set)
71672 return Wide_Character_Set;
71673 function "xor" (Left, Right : in Wide_Character_Set)
71674 return Wide_Character_Set;
71675 function "-" (Left, Right : in Wide_Character_Set)
71676 return Wide_Character_Set;
71677
71678 13
71679 function Is_In (Element : in Wide_Character;
71680 Set : in Wide_Character_Set)
71681 return Boolean;
71682
71683 14
71684 function Is_Subset (Elements : in Wide_Character_Set;
71685 Set : in Wide_Character_Set)
71686 return Boolean;
71687
71688 15
71689 function "<=" (Left : in Wide_Character_Set;
71690 Right : in Wide_Character_Set)
71691 return Boolean renames Is_Subset;
71692
71693 16
71694 -- Alternative representation for a set of Wide_Character values:
71695 subtype Wide_Character_Sequence is Wide_String;
71696
71697 17
71698 function To_Set (Sequence : in Wide_Character_Sequence)
71699 return Wide_Character_Set;
71700
71701 18
71702 function To_Set (Singleton : in Wide_Character)
71703 return Wide_Character_Set;
71704
71705 19
71706 function To_Sequence (Set : in Wide_Character_Set)
71707 return Wide_Character_Sequence;
71708
71709 20/2
71710 {AI95-00161-01AI95-00161-01} -- Representation for a Wide_Character to Wide_Character mapping:
71711 type Wide_Character_Mapping is private;
71712 pragma Preelaborable_Initialization(Wide_Character_Mapping);
71713
71714 21
71715 function Value (Map : in Wide_Character_Mapping;
71716 Element : in Wide_Character)
71717 return Wide_Character;
71718
71719 22
71720 Identity : constant Wide_Character_Mapping;
71721
71722 23
71723 function To_Mapping (From, To : in Wide_Character_Sequence)
71724 return Wide_Character_Mapping;
71725
71726 24
71727 function To_Domain (Map : in Wide_Character_Mapping)
71728 return Wide_Character_Sequence;
71729
71730 25
71731 function To_Range (Map : in Wide_Character_Mapping)
71732 return Wide_Character_Sequence;
71733
71734 26
71735 type Wide_Character_Mapping_Function is
71736 access function (From : in Wide_Character) return Wide_Character;
71737
71738 27
71739 private
71740 ... -- not specified by the language
71741 end Ada.Strings.Wide_Maps;
71742
71743 28
71744 The context clause for each of the packages Strings.Wide_Fixed,
71745 Strings.Wide_Bounded, and Strings.Wide_Unbounded identifies
71746 Strings.Wide_Maps instead of Strings.Maps.
71747
71748 28.1/3
71749 {AI05-0223-1AI05-0223-1} Types Wide_Character_Set and
71750 Wide_Character_Mapping need finalization.
71751
71752 29/3
71753 {AI95-00302-03AI95-00302-03} {AI05-0286-1AI05-0286-1} For each of the
71754 packages Strings.Fixed, Strings.Bounded, Strings.Unbounded, and
71755 Strings.Maps.Constants, and for library functions Strings.Hash,
71756 Strings.Fixed.Hash, Strings.Bounded.Hash, Strings.Unbounded.Hash,
71757 Strings.Hash_Case_Insensitive, Strings.Fixed.Hash_Case_Insensitive,
71758 Strings.Bounded.Hash_Case_Insensitive,
71759 Strings.Unbounded.Hash_Case_Insensitive, Strings.Equal_Case_Insensitive,
71760 Strings.Fixed.Equal_Case_Insensitive,
71761 Strings.Bounded.Equal_Case_Insensitive, and
71762 Strings.Unbounded.Equal_Case_Insensitive, the corresponding wide string
71763 package or function has the same contents except that
71764
71765 30
71766 * Wide_Space replaces Space
71767
71768 31
71769 * Wide_Character replaces Character
71770
71771 32
71772 * Wide_String replaces String
71773
71774 33
71775 * Wide_Character_Set replaces Character_Set
71776
71777 34
71778 * Wide_Character_Mapping replaces Character_Mapping
71779
71780 35
71781 * Wide_Character_Mapping_Function replaces Character_Mapping_Function
71782
71783 36
71784 * Wide_Maps replaces Maps
71785
71786 37
71787 * Bounded_Wide_String replaces Bounded_String
71788
71789 38
71790 * Null_Bounded_Wide_String replaces Null_Bounded_String
71791
71792 39
71793 * To_Bounded_Wide_String replaces To_Bounded_String
71794
71795 40
71796 * To_Wide_String replaces To_String
71797
71798 40.1/2
71799 * {AI95-00301-01AI95-00301-01} Set_Bounded_Wide_String replaces
71800 Set_Bounded_String
71801
71802 41
71803 * Unbounded_Wide_String replaces Unbounded_String
71804
71805 42
71806 * Null_Unbounded_Wide_String replaces Null_Unbounded_String
71807
71808 43
71809 * Wide_String_Access replaces String_Access
71810
71811 44
71812 * To_Unbounded_Wide_String replaces To_Unbounded_String
71813
71814 44.1/2
71815 * {AI95-00301-01AI95-00301-01} Set_Unbounded_Wide_String replaces
71816 Set_Unbounded_String
71817
71818 45
71819 The following additional declaration is present in
71820 Strings.Wide_Maps.Wide_Constants:
71821
71822 46/2
71823 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} Character_Set : constant Wide_Maps.Wide_Character_Set;
71824 --Contains each Wide_Character value WC such that
71825 --Characters.Conversions.Is_Character(WC) is True
71826
71827 46.1/2
71828 {AI95-00395-01AI95-00395-01} Each Wide_Character_Set constant in the
71829 package Strings.Wide_Maps.Wide_Constants contains no values outside the
71830 Character portion of Wide_Character. Similarly, each
71831 Wide_Character_Mapping constant in this package is the identity mapping
71832 when applied to any element outside the Character portion of
71833 Wide_Character.
71834
71835 46.2/2
71836 {AI95-00362-01AI95-00362-01} Pragma Pure is replaced by pragma
71837 Preelaborate in Strings.Wide_Maps.Wide_Constants.
71838
71839 NOTES
71840
71841 47
71842 16 If a null Wide_Character_Mapping_Function is passed to any of
71843 the Wide_String handling subprograms, Constraint_Error is
71844 propagated.
71845
71846 _Incompatibilities With Ada 95_
71847
71848 48.a/2
71849 {AI95-00301-01AI95-00301-01} Various new operations are added
71850 to Strings.Wide_Fixed, Strings.Wide_Bounded, and
71851 Strings.Wide_Unbounded. If one of these packages is
71852 referenced in a use_clause, and an entity E with the same
71853 defining_identifier as a new entity is defined in a package
71854 that is also referenced in a use_clause, the entity E may no
71855 longer be use-visible, resulting in errors. This should be
71856 rare and is easily fixed if it does occur.
71857
71858 _Extensions to Ada 95_
71859
71860 48.b/2
71861 {AI95-00161-01AI95-00161-01} Amendment Correction: Added
71862 pragma Preelaborable_Initialization to types
71863 Wide_Character_Set and Wide_Character_Mapping, so that they
71864 can be used to declare default-initialized objects in
71865 preelaborated units.
71866
71867 _Wording Changes from Ada 95_
71868
71869 48.c/2
71870 {AI95-00285-01AI95-00285-01} Corrected the description of
71871 Character_Set.
71872
71873 48.d/2
71874 {AI95-00302-03AI95-00302-03} Added wide versions of
71875 Strings.Hash and Strings.Unbounded.Hash.
71876
71877 48.e/2
71878 {AI95-00362-01AI95-00362-01} Added wording so that
71879 Strings.Wide_Maps.Wide_Constants does not change to Pure.
71880
71881 48.f/2
71882 {AI95-00395-01AI95-00395-01} The second Note is now normative
71883 text, since there is no way to derive it from the other rules.
71884 It's a little weird given the use of Unicode character
71885 classifications in Ada 2005; but changing it would be
71886 inconsistent with Ada 95 and a one-to-one mapping isn't
71887 necessarily correct anyway.
71888
71889 _Extensions to Ada 2005_
71890
71891 48.g/3
71892 {AI05-0286-1AI05-0286-1} The case insenstive library functions
71893 (Strings.Wide_Equal_Case_Insensitive,
71894 Strings.Wide_Fixed.Wide_Equal_Case_Insensitive,
71895 Strings.Wide_Bounded.Wide_Equal_Case_Insensitive,
71896 Strings.Wide_Unbounded.Wide_Equal_Case_Insensitive,
71897 Strings.Wide_Hash_Case_Insensitive,
71898 Strings.Wide_Fixed.Wide_Hash_Case_Insensitive,
71899 Strings.Wide_Bounded.Wide_Hash_Case_Insensitive, and
71900 Strings.Wide_Unbounded.Wide_Hash_Case_Insensitive) are new.
71901
71902 _Wording Changes from Ada 2005_
71903
71904 48.h/3
71905 {AI05-0223-1AI05-0223-1} Correction: Identified
71906 Wide_Character_Set and Wide_Character_Mapping as needing
71907 finalization. It is likely that they are implemented with a
71908 controlled type, so this change is unlikely to make any
71909 difference in practice.
71910
71911 \1f
71912 File: aarm2012.info, Node: A.4.8, Next: A.4.9, Prev: A.4.7, Up: A.4
71913
71914 A.4.8 Wide_Wide_String Handling
71915 -------------------------------
71916
71917 1/3
71918 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01}
71919 {AI05-0286-1AI05-0286-1} Facilities for handling strings of
71920 Wide_Wide_Character elements are found in the packages
71921 Strings.Wide_Wide_Maps, Strings.Wide_Wide_Fixed,
71922 Strings.Wide_Wide_Bounded, Strings.Wide_Wide_Unbounded, and
71923 Strings.Wide_Wide_Maps.Wide_Wide_Constants, and in the library functions
71924 Strings.Wide_Wide_Hash, Strings.Wide_Wide_Fixed.Wide_Wide_Hash,
71925 Strings.Wide_Wide_Bounded.Wide_Wide_Hash,
71926 Strings.Wide_Wide_Unbounded.Wide_Wide_Hash,
71927 Strings.Wide_Wide_Hash_Case_Insensitive,
71928 Strings.Wide_Wide_Fixed.Wide_Wide_Hash_Case_Insensitive,
71929 Strings.Wide_Wide_Bounded.Wide_Wide_Hash_Case_Insensitive,
71930 Strings.Wide_Wide_Unbounded.Wide_Wide_Hash_Case_Insensitive,
71931 Strings.Wide_Wide_Equal_Case_Insensitive,
71932 Strings.Wide_Wide_Fixed.Wide_Wide_Equal_Case_Insensitive,
71933 Strings.Wide_Wide_Bounded.Wide_Wide_Equal_Case_Insensitive, and
71934 Strings.Wide_Wide_Unbounded.Wide_Wide_Equal_Case_Insensitive. They
71935 provide the same string-handling operations as the corresponding
71936 packages and functions for strings of Character elements.
71937
71938 _Static Semantics_
71939
71940 2/2
71941 {AI95-00285-01AI95-00285-01} The library package Strings.Wide_Wide_Maps
71942 has the following declaration.
71943
71944 3/2
71945 package Ada.Strings.Wide_Wide_Maps is
71946 pragma Preelaborate(Wide_Wide_Maps);
71947
71948 4/2
71949 -- Representation for a set of Wide_Wide_Character values:
71950 type Wide_Wide_Character_Set is private;
71951 pragma Preelaborable_Initialization(Wide_Wide_Character_Set);
71952
71953 5/2
71954 Null_Set : constant Wide_Wide_Character_Set;
71955
71956 6/2
71957 type Wide_Wide_Character_Range is
71958 record
71959 Low : Wide_Wide_Character;
71960 High : Wide_Wide_Character;
71961 end record;
71962 -- Represents Wide_Wide_Character range Low..High
71963
71964 7/2
71965 type Wide_Wide_Character_Ranges is array (Positive range <>)
71966 of Wide_Wide_Character_Range;
71967
71968 8/2
71969 function To_Set (Ranges : in Wide_Wide_Character_Ranges)
71970 return Wide_Wide_Character_Set;
71971
71972 9/2
71973 function To_Set (Span : in Wide_Wide_Character_Range)
71974 return Wide_Wide_Character_Set;
71975
71976 10/2
71977 function To_Ranges (Set : in Wide_Wide_Character_Set)
71978 return Wide_Wide_Character_Ranges;
71979
71980 11/2
71981 function "=" (Left, Right : in Wide_Wide_Character_Set) return Boolean;
71982
71983 12/2
71984 function "not" (Right : in Wide_Wide_Character_Set)
71985 return Wide_Wide_Character_Set;
71986 function "and" (Left, Right : in Wide_Wide_Character_Set)
71987 return Wide_Wide_Character_Set;
71988 function "or" (Left, Right : in Wide_Wide_Character_Set)
71989 return Wide_Wide_Character_Set;
71990 function "xor" (Left, Right : in Wide_Wide_Character_Set)
71991 return Wide_Wide_Character_Set;
71992 function "-" (Left, Right : in Wide_Wide_Character_Set)
71993 return Wide_Wide_Character_Set;
71994
71995 13/2
71996 function Is_In (Element : in Wide_Wide_Character;
71997 Set : in Wide_Wide_Character_Set)
71998 return Boolean;
71999
72000 14/2
72001 function Is_Subset (Elements : in Wide_Wide_Character_Set;
72002 Set : in Wide_Wide_Character_Set)
72003 return Boolean;
72004
72005 15/2
72006 function "<=" (Left : in Wide_Wide_Character_Set;
72007 Right : in Wide_Wide_Character_Set)
72008 return Boolean renames Is_Subset;
72009
72010 16/2
72011 -- Alternative representation for a set of Wide_Wide_Character values:
72012 subtype Wide_Wide_Character_Sequence is Wide_Wide_String;
72013
72014 17/2
72015 function To_Set (Sequence : in Wide_Wide_Character_Sequence)
72016 return Wide_Wide_Character_Set;
72017
72018 18/2
72019 function To_Set (Singleton : in Wide_Wide_Character)
72020 return Wide_Wide_Character_Set;
72021
72022 19/2
72023 function To_Sequence (Set : in Wide_Wide_Character_Set)
72024 return Wide_Wide_Character_Sequence;
72025
72026 20/2
72027 -- Representation for a Wide_Wide_Character to Wide_Wide_Character
72028 -- mapping:
72029 type Wide_Wide_Character_Mapping is private;
72030 pragma Preelaborable_Initialization(Wide_Wide_Character_Mapping);
72031
72032 21/2
72033 function Value (Map : in Wide_Wide_Character_Mapping;
72034 Element : in Wide_Wide_Character)
72035 return Wide_Wide_Character;
72036
72037 22/2
72038 Identity : constant Wide_Wide_Character_Mapping;
72039
72040 23/2
72041 function To_Mapping (From, To : in Wide_Wide_Character_Sequence)
72042 return Wide_Wide_Character_Mapping;
72043
72044 24/2
72045 function To_Domain (Map : in Wide_Wide_Character_Mapping)
72046 return Wide_Wide_Character_Sequence;
72047
72048 25/2
72049 function To_Range (Map : in Wide_Wide_Character_Mapping)
72050 return Wide_Wide_Character_Sequence;
72051
72052 26/2
72053 type Wide_Wide_Character_Mapping_Function is
72054 access function (From : in Wide_Wide_Character)
72055 return Wide_Wide_Character;
72056
72057 27/2
72058 private
72059 ... -- not specified by the language
72060 end Ada.Strings.Wide_Wide_Maps;
72061
72062 28/2
72063 {AI95-00285-01AI95-00285-01} The context clause for each of the packages
72064 Strings.Wide_Wide_Fixed, Strings.Wide_Wide_Bounded, and
72065 Strings.Wide_Wide_Unbounded identifies Strings.Wide_Wide_Maps instead of
72066 Strings.Maps.
72067
72068 28.1/3
72069 {AI05-0223-1AI05-0223-1} Types Wide_Wide_Character_Set and
72070 Wide_Wide_Character_Mapping need finalization.
72071
72072 29/3
72073 {AI95-00285-01AI95-00285-01} {AI05-0286-1AI05-0286-1} For each of the
72074 packages Strings.Fixed, Strings.Bounded, Strings.Unbounded, and
72075 Strings.Maps.Constants, and for library functions Strings.Hash,
72076 Strings.Fixed.Hash, Strings.Bounded.Hash, Strings.Unbounded.Hash,
72077 Strings.Hash_Case_Insensitive, Strings.Fixed.Hash_Case_Insensitive,
72078 Strings.Bounded.Hash_Case_Insensitive,
72079 Strings.Unbounded.Hash_Case_Insensitive, Strings.Equal_Case_Insensitive,
72080 Strings.Fixed.Equal_Case_Insensitive,
72081 Strings.Bounded.Equal_Case_Insensitive, and
72082 Strings.Unbounded.Equal_Case_Insensitive, the corresponding wide wide
72083 string package or function has the same contents except that
72084
72085 30/2
72086 * Wide_Wide_Space replaces Space
72087
72088 31/2
72089 * Wide_Wide_Character replaces Character
72090
72091 32/2
72092 * Wide_Wide_String replaces String
72093
72094 33/2
72095 * Wide_Wide_Character_Set replaces Character_Set
72096
72097 34/2
72098 * Wide_Wide_Character_Mapping replaces Character_Mapping
72099
72100 35/2
72101 * Wide_Wide_Character_Mapping_Function replaces
72102 Character_Mapping_Function
72103
72104 36/2
72105 * Wide_Wide_Maps replaces Maps
72106
72107 37/2
72108 * Bounded_Wide_Wide_String replaces Bounded_String
72109
72110 38/2
72111 * Null_Bounded_Wide_Wide_String replaces Null_Bounded_String
72112
72113 39/2
72114 * To_Bounded_Wide_Wide_String replaces To_Bounded_String
72115
72116 40/2
72117 * To_Wide_Wide_String replaces To_String
72118
72119 41/2
72120 * {AI95-00301-01AI95-00301-01} Set_Bounded_Wide_Wide_String replaces
72121 Set_Bounded_String
72122
72123 42/2
72124 * Unbounded_Wide_Wide_String replaces Unbounded_String
72125
72126 43/2
72127 * Null_Unbounded_Wide_Wide_String replaces Null_Unbounded_String
72128
72129 44/2
72130 * Wide_Wide_String_Access replaces String_Access
72131
72132 45/2
72133 * To_Unbounded_Wide_Wide_String replaces To_Unbounded_String
72134
72135 46/2
72136 * {AI95-00301-01AI95-00301-01} Set_Unbounded_Wide_Wide_String
72137 replaces Set_Unbounded_String
72138
72139 47/2
72140 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} The following
72141 additional declarations are present in
72142 Strings.Wide_Wide_Maps.Wide_Wide_Constants:
72143
72144 48/2
72145 Character_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
72146 -- Contains each Wide_Wide_Character value WWC such that
72147 -- Characters.Conversions.Is_Character(WWC) is True
72148 Wide_Character_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
72149 -- Contains each Wide_Wide_Character value WWC such that
72150 -- Characters.Conversions.Is_Wide_Character(WWC) is True
72151
72152 49/2
72153 {AI95-00395-01AI95-00395-01} Each Wide_Wide_Character_Set constant in
72154 the package Strings.Wide_Wide_Maps.Wide_Wide_Constants contains no
72155 values outside the Character portion of Wide_Wide_Character. Similarly,
72156 each Wide_Wide_Character_Mapping constant in this package is the
72157 identity mapping when applied to any element outside the Character
72158 portion of Wide_Wide_Character.
72159
72160 50/2
72161 {AI95-00395-01AI95-00395-01} Pragma Pure is replaced by pragma
72162 Preelaborate in Strings.Wide_Wide_Maps.Wide_Wide_Constants.
72163
72164 NOTES
72165
72166 51/2
72167 17 {AI95-00285-01AI95-00285-01} If a null
72168 Wide_Wide_Character_Mapping_Function is passed to any of the
72169 Wide_Wide_String handling subprograms, Constraint_Error is
72170 propagated.
72171
72172 _Extensions to Ada 95_
72173
72174 51.a/2
72175 {AI95-00285-01AI95-00285-01} {AI95-00395-01AI95-00395-01} The
72176 double-wide string-handling packages (Strings.Wide_Wide_Maps,
72177 Strings.Wide_Wide_Fixed, Strings.Wide_Wide_Bounded,
72178 Strings.Wide_Wide_Unbounded, and
72179 Strings.Wide_Wide_Maps.Wide_Wide_Constants), and functions
72180 Strings.Wide_Wide_Hash and
72181 Strings.Wide_Wide_Unbounded.Wide_Wide_Hash are new.
72182
72183 _Extensions to Ada 2005_
72184
72185 51.b/3
72186 {AI05-0286-1AI05-0286-1} The case insenstive library functions
72187 (Strings.Wide_Wide_Equal_Case_Insensitive,
72188 Strings.Wide_Wide_Fixed.Wide_Wide_Equal_Case_Insensitive,
72189 Strings.Wide_Wide_Bounded.Wide_Wide_Equal_Case_Insensitive,
72190 Strings.Wide_Wide_Unbounded.Wide_Wide_Equal_Case_Insensitive,
72191 Strings.Wide_Wide_Hash_Case_Insensitive,
72192 Strings.Wide_Wide_Fixed.Wide_Wide_Hash_Case_Insensitive,
72193 Strings.Wide_Wide_Bounded.Wide_Wide_Hash_Case_Insensitive, and
72194 Strings.Wide_Wide_Unbounded.Wide_Wide_Hash_Case_Insensitive)
72195 are new.
72196
72197 _Wording Changes from Ada 2005_
72198
72199 51.c/3
72200 {AI05-0223-1AI05-0223-1} Correction: Identified
72201 Wide_Wide_Character_Set and Wide_Wide_Character_Mapping as
72202 needing finalization. It is likely that they are implemented
72203 with a controlled type, so this change is unlikely to make any
72204 difference in practice.
72205
72206 \1f
72207 File: aarm2012.info, Node: A.4.9, Next: A.4.10, Prev: A.4.8, Up: A.4
72208
72209 A.4.9 String Hashing
72210 --------------------
72211
72212 _Static Semantics_
72213
72214 1/2
72215 {AI95-00302-03AI95-00302-03} The library function Strings.Hash has the
72216 following declaration:
72217
72218 2/3
72219 {AI05-0298-1AI05-0298-1} with Ada.Containers;
72220 function Ada.Strings.Hash (Key : String) return Containers.Hash_Type;
72221 pragma Pure(Ada.Strings.Hash);
72222
72223 3/2
72224 Returns an implementation-defined value which is a function of
72225 the value of Key. If A and B are strings such that A equals
72226 B, Hash(A) equals Hash(B).
72227
72228 3.a/2
72229 Implementation defined: The values returned by Strings.Hash.
72230
72231 4/2
72232 {AI95-00302-03AI95-00302-03} The library function Strings.Fixed.Hash has
72233 the following declaration:
72234
72235 5/3
72236 {AI05-0298-1AI05-0298-1} with Ada.Containers, Ada.Strings.Hash;
72237 function Ada.Strings.Fixed.Hash (Key : String) return Containers.Hash_Type
72238 renames Ada.Strings.Hash;
72239
72240 6/2
72241 {AI95-00302-03AI95-00302-03} The generic library function
72242 Strings.Bounded.Hash has the following declaration:
72243
72244 7/3
72245 {AI05-0298-1AI05-0298-1} with Ada.Containers;
72246 generic
72247 with package Bounded is
72248 new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
72249 function Ada.Strings.Bounded.Hash (Key : Bounded.Bounded_String)
72250 return Containers.Hash_Type;
72251 pragma Preelaborate(Ada.Strings.Bounded.Hash);
72252
72253 8/3
72254 {AI05-0001-1AI05-0001-1} Equivalent to Strings.Hash
72255 (Bounded.To_String (Key));
72256
72257 9/2
72258 {AI95-00302-03AI95-00302-03} The library function Strings.Unbounded.Hash
72259 has the following declaration:
72260
72261 10/3
72262 {AI05-0298-1AI05-0298-1} with Ada.Containers;
72263 function Ada.Strings.Unbounded.Hash (Key : Unbounded_String)
72264 return Containers.Hash_Type;
72265 pragma Preelaborate(Ada.Strings.Unbounded.Hash);
72266
72267 11/3
72268 {AI05-0001-1AI05-0001-1} Equivalent to Strings.Hash (To_String
72269 (Key));
72270
72271 11.1/3
72272 {AI05-0001-1AI05-0001-1} {AI05-0298-1AI05-0298-1} The library function
72273 Strings.Hash_Case_Insensitive has the following declaration:
72274
72275 11.2/3
72276 with Ada.Containers;
72277 function Ada.Strings.Hash_Case_Insensitive (Key : String)
72278 return Containers.Hash_Type;
72279 pragma Pure(Ada.Strings.Hash_Case_Insensitive);
72280
72281 11.3/3
72282 Returns an implementation-defined value which is a function of
72283 the value of Key, converted to lower case. If A and B are
72284 strings such that Strings.Equal_Case_Insensitive (A, B) (see
72285 *note A.4.10::) is True, then Hash_Case_Insensitive(A) equals
72286 Hash_Case_Insensitive(B).
72287
72288 11.4/3
72289 {AI05-0001-1AI05-0001-1} {AI05-0298-1AI05-0298-1} The library function
72290 Strings.Fixed.Hash_Case_Insensitive has the following declaration:
72291
72292 11.5/3
72293 with Ada.Containers, Ada.Strings.Hash_Case_Insensitive;
72294 function Ada.Strings.Fixed.Hash_Case_Insensitive (Key : String)
72295 return Containers.Hash_Type renames Ada.Strings.Hash_Case_Insensitive;
72296
72297 11.6/3
72298 {AI05-0001-1AI05-0001-1} {AI05-0298-1AI05-0298-1} The generic library
72299 function Strings.Bounded.Hash_Case_Insensitive has the following
72300 declaration:
72301
72302 11.7/3
72303 with Ada.Containers;
72304 generic
72305 with package Bounded is
72306 new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
72307 function Ada.Strings.Bounded.Hash_Case_Insensitive
72308 (Key : Bounded.Bounded_String) return Containers.Hash_Type;
72309 pragma Preelaborate(Ada.Strings.Bounded.Hash_Case_Insensitive);
72310
72311 11.8/3
72312 Equivalent to Strings.Hash_Case_Insensitive (Bounded.To_String
72313 (Key));
72314
72315 11.9/3
72316 {AI05-0001-1AI05-0001-1} {AI05-0298-1AI05-0298-1} The library function
72317 Strings.Unbounded.Hash_Case_Insensitive has the following declaration:
72318
72319 11.10/3
72320 with Ada.Containers;
72321 function Ada.Strings.Unbounded.Hash_Case_Insensitive
72322 (Key : Unbounded_String) return Containers.Hash_Type;
72323 pragma Preelaborate(Ada.Strings.Unbounded.Hash_Case_Insensitive);
72324
72325 11.11/3
72326 Equivalent to Strings.Hash_Case_Insensitive (To_String (Key));
72327
72328 _Implementation Advice_
72329
72330 12/2
72331 {AI95-00302-03AI95-00302-03} The Hash functions should be good hash
72332 functions, returning a wide spread of values for different string
72333 values. It should be unlikely for similar strings to return the same
72334 value.
72335
72336 12.a/2
72337 Implementation Advice: Strings.Hash should be good a hash
72338 function, returning a wide spread of values for different
72339 string values, and similar strings should rarely return the
72340 same value.
72341
72342 12.b/2
72343 Ramification: The other functions are defined in terms of
72344 Strings.Hash, so they don't need separate advice in the Annex.
72345
72346 _Extensions to Ada 95_
72347
72348 12.c/2
72349 {AI95-00302-03AI95-00302-03} The Strings.Hash,
72350 Strings.Fixed.Hash, Strings.Bounded.Hash, and
72351 Strings.Unbounded.Hash functions are new.
72352
72353 _Extensions to Ada 2005_
72354
72355 12.d/3
72356 {AI05-0001-1AI05-0001-1} The Strings.Hash_Case_Insensitive,
72357 Strings.Fixed.Hash_Case_Insensitive,
72358 Strings.Bounded.Hash_Case_Insensitive, and
72359 Strings.Unbounded.Hash_Case_Insensitive functions are new.
72360
72361 \1f
72362 File: aarm2012.info, Node: A.4.10, Next: A.4.11, Prev: A.4.9, Up: A.4
72363
72364 A.4.10 String Comparison
72365 ------------------------
72366
72367 _Static Semantics_
72368
72369 1/3
72370 {AI05-0001-1AI05-0001-1} {AI05-0286-1AI05-0286-1}
72371 {AI05-0298-1AI05-0298-1} The library function
72372 Strings.Equal_Case_Insensitive has the following declaration:
72373
72374 2/3
72375 function Ada.Strings.Equal_Case_Insensitive (Left, Right : String)
72376 return Boolean;
72377 pragma Pure(Ada.Strings.Equal_Case_Insensitive);
72378
72379 3/3
72380 Returns True if the strings consist of the same sequence of
72381 characters after applying locale-independent simple case
72382 folding, as defined by documents referenced in the note in
72383 Clause 1 of ISO/IEC 10646:2011. Otherwise, returns False.
72384 This function uses the same method as is used to determine
72385 whether two identifiers are the same.
72386
72387 3.a/3
72388 Discussion: {AI05-0286-1AI05-0286-1} For String, this is
72389 equivalent to converting to lower case and comparing. Not so
72390 for other string types. For Wide_Strings and
72391 Wide_Wide_Strings, note that this result is a more accurate
72392 comparison than converting the strings to lower case and
72393 comparing the results; it is possible that the lower case
72394 conversions are the same but this routine will report the
72395 strings as different. Additionally, Unicode says that the
72396 result of this function will never change for strings made up
72397 solely of defined code points; there is no such guarantee for
72398 case conversion to lower case.
72399
72400 4/3
72401 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72402 {AI05-0298-1AI05-0298-1} The library function
72403 Strings.Fixed.Equal_Case_Insensitive has the following declaration:
72404
72405 5/3
72406 with Ada.Strings.Equal_Case_Insensitive;
72407 function Ada.Strings.Fixed.Equal_Case_Insensitive
72408 (Left, Right : String) return Boolean
72409 renames Ada.Strings.Equal_Case_Insensitive;
72410
72411 6/3
72412 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72413 {AI05-0298-1AI05-0298-1} The generic library function
72414 Strings.Bounded.Equal_Case_Insensitive has the following declaration:
72415
72416 7/3
72417 generic
72418 with package Bounded is
72419 new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
72420 function Ada.Strings.Bounded.Equal_Case_Insensitive
72421 (Left, Right : Bounded.Bounded_String) return Boolean;
72422 pragma Preelaborate(Ada.Strings.Bounded.Equal_Case_Insensitive);
72423
72424 8/3
72425 Equivalent to Strings.Equal_Case_Insensitive
72426 (Bounded.To_String (Left), Bounded.To_String (Right));
72427
72428 9/3
72429 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72430 {AI05-0298-1AI05-0298-1} The library function
72431 Strings.Unbounded.Equal_Case_Insensitive has the following declaration:
72432
72433 10/3
72434 function Ada.Strings.Unbounded.Equal_Case_Insensitive
72435 (Left, Right : Unbounded_String) return Boolean;
72436 pragma Preelaborate(Ada.Strings.Unbounded.Equal_Case_Insensitive);
72437
72438 11/3
72439 Equivalent to Strings.Equal_Case_Insensitive (To_String
72440 (Left), To_String (Right));
72441
72442 12/3
72443 {AI05-0001-1AI05-0001-1} {AI05-0298-1AI05-0298-1} The library function
72444 Strings.Less_Case_Insensitive has the following declaration:
72445
72446 13/3
72447 function Ada.Strings.Less_Case_Insensitive (Left, Right : String)
72448 return Boolean;
72449 pragma Pure(Ada.Strings.Less_Case_Insensitive);
72450
72451 14/3
72452 Performs a lexicographic comparison of strings Left and Right,
72453 converted to lower case.
72454
72455 15/3
72456 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72457 {AI05-0298-1AI05-0298-1} The library function
72458 Strings.Fixed.Less_Case_Insensitive has the following declaration:
72459
72460 16/3
72461 with Ada.Strings.Less_Case_Insensitive;
72462 function Ada.Strings.Fixed.Less_Case_Insensitive
72463 (Left, Right : String) return Boolean
72464 renames Ada.Strings.Less_Case_Insensitive;
72465
72466 17/3
72467 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72468 {AI05-0298-1AI05-0298-1} The generic library function
72469 Strings.Bounded.Less_Case_Insensitive has the following declaration:
72470
72471 18/3
72472 generic
72473 with package Bounded is
72474 new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
72475 function Ada.Strings.Bounded.Less_Case_Insensitive
72476 (Left, Right : Bounded.Bounded_String) return Boolean;
72477 pragma Preelaborate(Ada.Strings.Bounded.Less_Case_Insensitive);
72478
72479 19/3
72480 Equivalent to Strings.Less_Case_Insensitive (Bounded.To_String
72481 (Left), Bounded.To_String (Right));
72482
72483 20/3
72484 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
72485 {AI05-0298-1AI05-0298-1} The library function
72486 Strings.Unbounded.Less_Case_Insensitive has the following declaration:
72487
72488 21/3
72489 function Ada.Strings.Unbounded.Less_Case_Insensitive
72490 (Left, Right : Unbounded_String) return Boolean;
72491 pragma Preelaborate(Ada.Strings.Unbounded.Less_Case_Insensitive);
72492
72493 22/3
72494 Equivalent to Strings.Less_Case_Insensitive (To_String (Left),
72495 To_String (Right));
72496
72497 _Extensions to Ada 2005_
72498
72499 22.a/3
72500 {AI05-0001-1AI05-0001-1} {AI05-0286-1AI05-0286-1} The
72501 Strings.Equal_Case_Insensitive,
72502 Strings.Fixed.Equal_Case_Insensitive,
72503 Strings.Bounded.Equal_Case_Insensitive,
72504 Strings.Unbounded.Equal_Case_Insensitive,
72505 Strings.Less_Case_Insensitive,
72506 Strings.Fixed.Less_Case_Insensitive,
72507 Strings.Bounded.Less_Case_Insensitive,
72508 Strings.Unbounded.Less_Case_Insensitive functions are new.
72509
72510 \1f
72511 File: aarm2012.info, Node: A.4.11, Prev: A.4.10, Up: A.4
72512
72513 A.4.11 String Encoding
72514 ----------------------
72515
72516 1/3
72517 {AI05-0137-2AI05-0137-2} Facilities for encoding, decoding, and
72518 converting strings in various character encoding schemes are provided by
72519 packages Strings.UTF_Encoding, Strings.UTF_Encoding.Conversions,
72520 Strings.UTF_Encoding.Strings, Strings.UTF_Encoding.Wide_Strings, and
72521 Strings.UTF_Encoding.Wide_Wide_Strings.
72522
72523 _Static Semantics_
72524
72525 2/3
72526 {AI05-0137-2AI05-0137-2} The encoding library packages have the
72527 following declarations:
72528
72529 3/3
72530 {AI05-0137-2AI05-0137-2} package Ada.Strings.UTF_Encoding is
72531 pragma Pure (UTF_Encoding);
72532
72533 4/3
72534 -- Declarations common to the string encoding packages
72535 type Encoding_Scheme is (UTF_8, UTF_16BE, UTF_16LE);
72536
72537 5/3
72538 subtype UTF_String is String;
72539
72540 6/3
72541 subtype UTF_8_String is String;
72542
72543 7/3
72544 subtype UTF_16_Wide_String is Wide_String;
72545
72546 8/3
72547 Encoding_Error : exception;
72548
72549 9/3
72550 BOM_8 : constant UTF_8_String :=
72551 Character'Val(16#EF#) &
72552 Character'Val(16#BB#) &
72553 Character'Val(16#BF#);
72554
72555 10/3
72556 BOM_16BE : constant UTF_String :=
72557 Character'Val(16#FE#) &
72558 Character'Val(16#FF#);
72559
72560 11/3
72561 BOM_16LE : constant UTF_String :=
72562 Character'Val(16#FF#) &
72563 Character'Val(16#FE#);
72564
72565 12/3
72566 BOM_16 : constant UTF_16_Wide_String :=
72567 (1 => Wide_Character'Val(16#FEFF#));
72568
72569 13/3
72570 function Encoding (Item : UTF_String;
72571 Default : Encoding_Scheme := UTF_8)
72572 return Encoding_Scheme;
72573
72574 14/3
72575 end Ada.Strings.UTF_Encoding;
72576
72577 15/3
72578 {AI05-0137-2AI05-0137-2} package Ada.Strings.UTF_Encoding.Conversions is
72579 pragma Pure (Conversions);
72580
72581 16/3
72582 -- Conversions between various encoding schemes
72583 function Convert (Item : UTF_String;
72584 Input_Scheme : Encoding_Scheme;
72585 Output_Scheme : Encoding_Scheme;
72586 Output_BOM : Boolean := False) return UTF_String;
72587
72588 17/3
72589 function Convert (Item : UTF_String;
72590 Input_Scheme : Encoding_Scheme;
72591 Output_BOM : Boolean := False)
72592 return UTF_16_Wide_String;
72593
72594 18/3
72595 function Convert (Item : UTF_8_String;
72596 Output_BOM : Boolean := False)
72597 return UTF_16_Wide_String;
72598
72599 19/3
72600 function Convert (Item : UTF_16_Wide_String;
72601 Output_Scheme : Encoding_Scheme;
72602 Output_BOM : Boolean := False) return UTF_String;
72603
72604 20/3
72605 function Convert (Item : UTF_16_Wide_String;
72606 Output_BOM : Boolean := False) return UTF_8_String;
72607
72608 21/3
72609 end Ada.Strings.UTF_Encoding.Conversions;
72610
72611 22/3
72612 {AI05-0137-2AI05-0137-2} package Ada.Strings.UTF_Encoding.Strings is
72613 pragma Pure (Strings);
72614
72615 23/3
72616 -- Encoding / decoding between String and various encoding schemes
72617 function Encode (Item : String;
72618 Output_Scheme : Encoding_Scheme;
72619 Output_BOM : Boolean := False) return UTF_String;
72620
72621 24/3
72622 function Encode (Item : String;
72623 Output_BOM : Boolean := False) return UTF_8_String;
72624
72625 25/3
72626 function Encode (Item : String;
72627 Output_BOM : Boolean := False)
72628 return UTF_16_Wide_String;
72629
72630 26/3
72631 function Decode (Item : UTF_String;
72632 Input_Scheme : Encoding_Scheme) return String;
72633
72634 27/3
72635 function Decode (Item : UTF_8_String) return String;
72636
72637 28/3
72638 function Decode (Item : UTF_16_Wide_String) return String;
72639
72640 29/3
72641 end Ada.Strings.UTF_Encoding.Strings;
72642
72643 30/3
72644 {AI05-0137-2AI05-0137-2} package Ada.Strings.UTF_Encoding.Wide_Strings is
72645 pragma Pure (Wide_Strings);
72646
72647 31/3
72648 -- Encoding / decoding between Wide_String and various encoding schemes
72649 function Encode (Item : Wide_String;
72650 Output_Scheme : Encoding_Scheme;
72651 Output_BOM : Boolean := False) return UTF_String;
72652
72653 32/3
72654 function Encode (Item : Wide_String;
72655 Output_BOM : Boolean := False) return UTF_8_String;
72656
72657 33/3
72658 function Encode (Item : Wide_String;
72659 Output_BOM : Boolean := False)
72660 return UTF_16_Wide_String;
72661
72662 34/3
72663 function Decode (Item : UTF_String;
72664 Input_Scheme : Encoding_Scheme) return Wide_String;
72665
72666 35/3
72667 function Decode (Item : UTF_8_String) return Wide_String;
72668
72669 36/3
72670 function Decode (Item : UTF_16_Wide_String) return Wide_String;
72671
72672 37/3
72673 end Ada.Strings.UTF_Encoding.Wide_Strings;
72674
72675 38/3
72676 {AI05-0137-2AI05-0137-2} package Ada.Strings.UTF_Encoding.Wide_Wide_Strings is
72677 pragma Pure (Wide_Wide_Strings);
72678
72679 39/3
72680 -- Encoding / decoding between Wide_Wide_String and various encoding schemes
72681 function Encode (Item : Wide_Wide_String;
72682 Output_Scheme : Encoding_Scheme;
72683 Output_BOM : Boolean := False) return UTF_String;
72684
72685 40/3
72686 function Encode (Item : Wide_Wide_String;
72687 Output_BOM : Boolean := False) return UTF_8_String;
72688
72689 41/3
72690 function Encode (Item : Wide_Wide_String;
72691 Output_BOM : Boolean := False)
72692 return UTF_16_Wide_String;
72693
72694 42/3
72695 function Decode (Item : UTF_String;
72696 Input_Scheme : Encoding_Scheme) return Wide_Wide_String;
72697
72698 43/3
72699 function Decode (Item : UTF_8_String) return Wide_Wide_String;
72700
72701 44/3
72702 function Decode (Item : UTF_16_Wide_String) return Wide_Wide_String;
72703
72704 45/3
72705 end Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
72706
72707 46/3
72708 {AI05-0137-2AI05-0137-2} {AI05-0262-1AI05-0262-1} The type
72709 Encoding_Scheme defines encoding schemes. UTF_8 corresponds to the
72710 UTF-8 encoding scheme defined by Annex D of ISO/IEC 10646. UTF_16BE
72711 corresponds to the UTF-16 encoding scheme defined by Annex C of ISO/IEC
72712 10646 in 8 bit, big-endian order; and UTF_16LE corresponds to the UTF-16
72713 encoding scheme in 8 bit, little-endian order.
72714
72715 47/3
72716 {AI05-0137-2AI05-0137-2} The subtype UTF_String is used to represent a
72717 String of 8-bit values containing a sequence of values encoded in one of
72718 three ways (UTF-8, UTF-16BE, or UTF-16LE). The subtype UTF_8_String is
72719 used to represent a String of 8-bit values containing a sequence of
72720 values encoded in UTF-8. The subtype UTF_16_Wide_String is used to
72721 represent a Wide_String of 16-bit values containing a sequence of values
72722 encoded in UTF-16.
72723
72724 48/3
72725 {AI05-0137-2AI05-0137-2} {AI05-0262-1AI05-0262-1} The BOM_8, BOM_16BE,
72726 BOM_16LE, and BOM_16 constants correspond to values used at the start of
72727 a string to indicate the encoding.
72728
72729 49/3
72730 {AI05-0262-1AI05-0262-1} {AI05-0269-1AI05-0269-1} Each of the Encode
72731 functions takes a String, Wide_String, or Wide_Wide_String Item
72732 parameter that is assumed to be an array of unencoded characters. Each
72733 of the Convert functions takes a UTF_String, UTF_8_String, or
72734 UTF_16_String Item parameter that is assumed to contain characters whose
72735 position values correspond to a valid encoding sequence according to the
72736 encoding scheme required by the function or specified by its
72737 Input_Scheme parameter.
72738
72739 50/3
72740 {AI05-0137-2AI05-0137-2} {AI05-0262-1AI05-0262-1}
72741 {AI05-0269-1AI05-0269-1} Each of the Convert and Encode functions
72742 returns a UTF_String, UTF_8_String, or UTF_16_String value whose
72743 characters have position values that correspond to the encoding of the
72744 Item parameter according to the encoding scheme required by the function
72745 or specified by its Output_Scheme parameter. For UTF_8, no overlong
72746 encoding is returned. A BOM is included at the start of the returned
72747 string if the Output_BOM parameter is set to True. The lower bound of
72748 the returned string is 1.
72749
72750 51/3
72751 {AI05-0137-2AI05-0137-2} {AI05-0262-1AI05-0262-1} Each of the Decode
72752 functions takes a UTF_String, UTF_8_String, or UTF_16_String Item
72753 parameter which is assumed to contain characters whose position values
72754 correspond to a valid encoding sequence according to the encoding scheme
72755 required by the function or specified by its Input_Scheme parameter, and
72756 returns the corresponding String, Wide_String, or Wide_Wide_String
72757 value. The lower bound of the returned string is 1.
72758
72759 52/3
72760 {AI05-0137-2AI05-0137-2} {AI05-0262-1AI05-0262-1} For each of the
72761 Convert and Decode functions, an initial BOM in the input that matches
72762 the expected encoding scheme is ignored, and a different initial BOM
72763 causes Encoding_Error to be propagated.
72764
72765 53/3
72766 {AI05-0137-2AI05-0137-2} The exception Encoding_Error is also propagated
72767 in the following situations:
72768
72769 54/3
72770 * By a Decode function when a UTF encoded string contains an invalid
72771 encoding sequence.
72772
72773 55/3
72774 * By a Decode function when the expected encoding is UTF-16BE or
72775 UTF-16LE and the input string has an odd length.
72776
72777 56/3
72778 * {AI05-0262-1AI05-0262-1} By a Decode function yielding a String
72779 when the decoding of a sequence results in a code point whose value
72780 exceeds 16#FF#.
72781
72782 57/3
72783 * By a Decode function yielding a Wide_String when the decoding of a
72784 sequence results in a code point whose value exceeds 16#FFFF#.
72785
72786 58/3
72787 * {AI05-0262-1AI05-0262-1} By an Encode function taking a Wide_String
72788 as input when an invalid character appears in the input. In
72789 particular, the characters whose position is in the range 16#D800#
72790 .. 16#DFFF# are invalid because they conflict with UTF-16
72791 surrogate encodings, and the characters whose position is 16#FFFE#
72792 or 16#FFFF# are also invalid because they conflict with BOM codes.
72793
72794 59/3
72795 {AI05-0137-2AI05-0137-2} function Encoding (Item : UTF_String;
72796 Default : Encoding_Scheme := UTF_8)
72797 return Encoding_Scheme;
72798
72799 60/3
72800 {AI05-0137-2AI05-0137-2} {AI05-0269-1AI05-0269-1} Inspects a
72801 UTF_String value to determine whether it starts with a BOM for
72802 UTF-8, UTF-16BE, or UTF_16LE. If so, returns the scheme
72803 corresponding to the BOM; otherwise, returns the value of
72804 Default.
72805
72806 61/3
72807 {AI05-0137-2AI05-0137-2} function Convert (Item : UTF_String;
72808 Input_Scheme : Encoding_Scheme;
72809 Output_Scheme : Encoding_Scheme;
72810 Output_BOM : Boolean := False) return UTF_String;
72811
72812 62/3
72813 Returns the value of Item (originally encoded in UTF-8,
72814 UTF-16LE, or UTF-16BE as specified by Input_Scheme) encoded in
72815 one of these three schemes as specified by Output_Scheme.
72816
72817 63/3
72818 {AI05-0137-2AI05-0137-2} function Convert (Item : UTF_String;
72819 Input_Scheme : Encoding_Scheme;
72820 Output_BOM : Boolean := False)
72821 return UTF_16_Wide_String;
72822
72823 64/3
72824 Returns the value of Item (originally encoded in UTF-8,
72825 UTF-16LE, or UTF-16BE as specified by Input_Scheme) encoded in
72826 UTF-16.
72827
72828 65/3
72829 {AI05-0137-2AI05-0137-2} function Convert (Item : UTF_8_String;
72830 Output_BOM : Boolean := False)
72831 return UTF_16_Wide_String;
72832
72833 66/3
72834 Returns the value of Item (originally encoded in UTF-8)
72835 encoded in UTF-16.
72836
72837 67/3
72838 {AI05-0137-2AI05-0137-2} function Convert (Item : UTF_16_Wide_String;
72839 Output_Scheme : Encoding_Scheme;
72840 Output_BOM : Boolean := False) return UTF_String;
72841
72842 68/3
72843 Returns the value of Item (originally encoded in UTF-16)
72844 encoded in UTF-8, UTF-16LE, or UTF-16BE as specified by
72845 Output_Scheme.
72846
72847 69/3
72848 {AI05-0137-2AI05-0137-2} function Convert (Item : UTF_16_Wide_String;
72849 Output_BOM : Boolean := False) return UTF_8_String;
72850
72851 70/3
72852 Returns the value of Item (originally encoded in UTF-16)
72853 encoded in UTF-8.
72854
72855 71/3
72856 {AI05-0137-2AI05-0137-2} function Encode (Item : String;
72857 Output_Scheme : Encoding_Scheme;
72858 Output_BOM : Boolean := False) return UTF_String;
72859
72860 72/3
72861 {AI05-0262-1AI05-0262-1} Returns the value of Item encoded in
72862 UTF-8, UTF-16LE, or UTF-16BE as specified by Output_Scheme.
72863
72864 73/3
72865 {AI05-0137-2AI05-0137-2} function Encode (Item : String;
72866 Output_BOM : Boolean := False) return UTF_8_String;
72867
72868 74/3
72869 Returns the value of Item encoded in UTF-8.
72870
72871 75/3
72872 {AI05-0137-2AI05-0137-2} function Encode (Item : String;
72873 Output_BOM : Boolean := False) return UTF_16_Wide_String;
72874
72875 76/3
72876 Returns the value of Item encoded in UTF_16.
72877
72878 77/3
72879 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_String;
72880 Input_Scheme : Encoding_Scheme) return String;
72881
72882 78/3
72883 Returns the result of decoding Item, which is encoded in
72884 UTF-8, UTF-16LE, or UTF-16BE as specified by Input_Scheme.
72885
72886 79/3
72887 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_8_String) return String;
72888
72889 80/3
72890 Returns the result of decoding Item, which is encoded in
72891 UTF-8.
72892
72893 81/3
72894 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_16_Wide_String) return String;
72895
72896 82/3
72897 Returns the result of decoding Item, which is encoded in
72898 UTF-16.
72899
72900 83/3
72901 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_String;
72902 Output_Scheme : Encoding_Scheme;
72903 Output_BOM : Boolean := False) return UTF_String;
72904
72905 84/3
72906 {AI05-0262-1AI05-0262-1} Returns the value of Item encoded in
72907 UTF-8, UTF-16LE, or UTF-16BE as specified by Output_Scheme.
72908
72909 85/3
72910 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_String;
72911 Output_BOM : Boolean := False) return UTF_8_String;
72912
72913 86/3
72914 Returns the value of Item encoded in UTF-8.
72915
72916 87/3
72917 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_String;
72918 Output_BOM : Boolean := False) return UTF_16_Wide_String;
72919
72920 88/3
72921 Returns the value of Item encoded in UTF_16.
72922
72923 89/3
72924 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_String;
72925 Input_Scheme : Encoding_Scheme) return Wide_String;
72926
72927 90/3
72928 Returns the result of decoding Item, which is encoded in
72929 UTF-8, UTF-16LE, or UTF-16BE as specified by Input_Scheme.
72930
72931 91/3
72932 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_8_String) return Wide_String;
72933
72934 92/3
72935 Returns the result of decoding Item, which is encoded in
72936 UTF-8.
72937
72938 93/3
72939 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_16_Wide_String) return Wide_String;
72940
72941 94/3
72942 Returns the result of decoding Item, which is encoded in
72943 UTF-16.
72944
72945 95/3
72946 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_Wide_String;
72947 Output_Scheme : Encoding_Scheme;
72948 Output_BOM : Boolean := False) return UTF_String;
72949
72950 96/3
72951 {AI05-0262-1AI05-0262-1} Returns the value of Item encoded in
72952 UTF-8, UTF-16LE, or UTF-16BE as specified by Output_Scheme.
72953
72954 97/3
72955 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_Wide_String;
72956 Output_BOM : Boolean := False) return UTF_8_String;
72957
72958 98/3
72959 Returns the value of Item encoded in UTF-8.
72960
72961 99/3
72962 {AI05-0137-2AI05-0137-2} function Encode (Item : Wide_Wide_String;
72963 Output_BOM : Boolean := False) return UTF_16_Wide_String;
72964
72965 100/3
72966 Returns the value of Item encoded in UTF_16.
72967
72968 101/3
72969 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_String;
72970 Input_Scheme : Encoding_Scheme) return Wide_Wide_String;
72971
72972 102/3
72973 Returns the result of decoding Item, which is encoded in
72974 UTF-8, UTF-16LE, or UTF-16BE as specified by Input_Scheme.
72975
72976 103/3
72977 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_8_String) return Wide_Wide_String;
72978
72979 104/3
72980 Returns the result of decoding Item, which is encoded in
72981 UTF-8.
72982
72983 105/3
72984 {AI05-0137-2AI05-0137-2} function Decode (Item : UTF_16_Wide_String) return Wide_Wide_String;
72985
72986 106/3
72987 Returns the result of decoding Item, which is encoded in
72988 UTF-16.
72989
72990 _Implementation Advice_
72991
72992 107/3
72993 {AI05-0137-2AI05-0137-2} If an implementation supports other encoding
72994 schemes, another similar child of Ada.Strings should be defined.
72995
72996 107.a.1/3
72997 Implementation Advice: If an implementation supports other
72998 string encoding schemes, a child of Ada.Strings similar to
72999 UTF_Encoding should be defined.
73000
73001 NOTES
73002
73003 108/3
73004 18 {AI05-0137-2AI05-0137-2} A BOM (Byte-Order Mark, code position
73005 16#FEFF#) can be included in a file or other entity to indicate the
73006 encoding; it is skipped when decoding. Typically, only the first
73007 line of a file or other entity contains a BOM. When decoding, the
73008 Encoding function can be called on the first line to determine the
73009 encoding; this encoding will then be used in subsequent calls to
73010 Decode to convert all of the lines to an internal format.
73011
73012 _Extensions to Ada 2005_
73013
73014 108.a/3
73015 {AI05-0137-2AI05-0137-2} The packages Strings.UTF_Encoding,
73016 Strings.UTF_Encoding.Conversions,
73017 Strings.UTF_Encoding.Strings,
73018 Strings.UTF_Encoding.Wide_Strings, and
73019 Strings.UTF_Encoding.Wide_Wide_Strings are new.
73020
73021 \1f
73022 File: aarm2012.info, Node: A.5, Next: A.6, Prev: A.4, Up: Annex A
73023
73024 A.5 The Numerics Packages
73025 =========================
73026
73027 1
73028 The library package Numerics is the parent of several child units that
73029 provide facilities for mathematical computation. One child, the generic
73030 package Generic_Elementary_Functions, is defined in *note A.5.1::,
73031 together with nongeneric equivalents; two others, the package
73032 Float_Random and the generic package Discrete_Random, are defined in
73033 *note A.5.2::. Additional (optional) children are defined in *note
73034 Annex G::, "*note Annex G:: Numerics".
73035
73036 _Static Semantics_
73037
73038 2/1
73039 This paragraph was deleted.
73040
73041 3/2
73042 {AI95-00388-01AI95-00388-01} package Ada.Numerics is
73043 pragma Pure(Numerics);
73044 Argument_Error : exception;
73045 Pi : constant :=
73046 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511;
73047 PI : constant := Pi;
73048 e : constant :=
73049 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996;
73050 end Ada.Numerics;
73051
73052 4
73053 The Argument_Error exception is raised by a subprogram in a child unit
73054 of Numerics to signal that one or more of the actual subprogram
73055 parameters are outside the domain of the corresponding mathematical
73056 function.
73057
73058 _Implementation Permissions_
73059
73060 5
73061 The implementation may specify the values of Pi and e to a larger number
73062 of significant digits.
73063
73064 5.a
73065 Reason: 51 digits seem more than adequate for all present
73066 computers; converted to binary, the values given above are
73067 accurate to more than 160 bits. Nevertheless, the permission
73068 allows implementations to accommodate unforeseen hardware
73069 advances.
73070
73071 _Extensions to Ada 83_
73072
73073 5.b
73074 Numerics and its children were not predefined in Ada 83.
73075
73076 _Extensions to Ada 95_
73077
73078 5.c/2
73079 {AI95-00388-01AI95-00388-01} The alternative declaration of PI
73080 is new.
73081
73082 * Menu:
73083
73084 * A.5.1 :: Elementary Functions
73085 * A.5.2 :: Random Number Generation
73086 * A.5.3 :: Attributes of Floating Point Types
73087 * A.5.4 :: Attributes of Fixed Point Types
73088
73089 \1f
73090 File: aarm2012.info, Node: A.5.1, Next: A.5.2, Up: A.5
73091
73092 A.5.1 Elementary Functions
73093 --------------------------
73094
73095 1
73096 Implementation-defined approximations to the mathematical functions
73097 known as the "elementary functions" are provided by the subprograms in
73098 Numerics.Generic_Elementary_Functions. Nongeneric equivalents of this
73099 generic package for each of the predefined floating point types are also
73100 provided as children of Numerics.
73101
73102 1.a
73103 Implementation defined: The accuracy actually achieved by the
73104 elementary functions.
73105
73106 _Static Semantics_
73107
73108 2
73109 The generic library package Numerics.Generic_Elementary_Functions has
73110 the following declaration:
73111
73112 3
73113 generic
73114 type Float_Type is digits <>;
73115
73116 package Ada.Numerics.Generic_Elementary_Functions is
73117 pragma Pure(Generic_Elementary_Functions);
73118
73119 4
73120 function Sqrt (X : Float_Type'Base) return Float_Type'Base;
73121 function Log (X : Float_Type'Base) return Float_Type'Base;
73122 function Log (X, Base : Float_Type'Base) return Float_Type'Base;
73123 function Exp (X : Float_Type'Base) return Float_Type'Base;
73124 function "**" (Left, Right : Float_Type'Base) return Float_Type'Base;
73125
73126 5
73127 function Sin (X : Float_Type'Base) return Float_Type'Base;
73128 function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base;
73129 function Cos (X : Float_Type'Base) return Float_Type'Base;
73130 function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base;
73131 function Tan (X : Float_Type'Base) return Float_Type'Base;
73132 function Tan (X, Cycle : Float_Type'Base) return Float_Type'Base;
73133 function Cot (X : Float_Type'Base) return Float_Type'Base;
73134 function Cot (X, Cycle : Float_Type'Base) return Float_Type'Base;
73135
73136 6
73137 function Arcsin (X : Float_Type'Base) return Float_Type'Base;
73138 function Arcsin (X, Cycle : Float_Type'Base) return Float_Type'Base;
73139 function Arccos (X : Float_Type'Base) return Float_Type'Base;
73140 function Arccos (X, Cycle : Float_Type'Base) return Float_Type'Base;
73141 function Arctan (Y : Float_Type'Base;
73142 X : Float_Type'Base := 1.0)
73143 return Float_Type'Base;
73144 function Arctan (Y : Float_Type'Base;
73145 X : Float_Type'Base := 1.0;
73146 Cycle : Float_Type'Base) return Float_Type'Base;
73147 function Arccot (X : Float_Type'Base;
73148 Y : Float_Type'Base := 1.0)
73149 return Float_Type'Base;
73150 function Arccot (X : Float_Type'Base;
73151 Y : Float_Type'Base := 1.0;
73152 Cycle : Float_Type'Base) return Float_Type'Base;
73153
73154 7
73155 function Sinh (X : Float_Type'Base) return Float_Type'Base;
73156 function Cosh (X : Float_Type'Base) return Float_Type'Base;
73157 function Tanh (X : Float_Type'Base) return Float_Type'Base;
73158 function Coth (X : Float_Type'Base) return Float_Type'Base;
73159 function Arcsinh (X : Float_Type'Base) return Float_Type'Base;
73160 function Arccosh (X : Float_Type'Base) return Float_Type'Base;
73161 function Arctanh (X : Float_Type'Base) return Float_Type'Base;
73162 function Arccoth (X : Float_Type'Base) return Float_Type'Base;
73163
73164 8
73165 end Ada.Numerics.Generic_Elementary_Functions;
73166
73167 9/1
73168 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} The library package
73169 Numerics.Elementary_Functions is declared pure and defines the same
73170 subprograms as Numerics.Generic_Elementary_Functions, except that the
73171 predefined type Float is systematically substituted for Float_Type'Base
73172 throughout. Nongeneric equivalents of
73173 Numerics.Generic_Elementary_Functions for each of the other predefined
73174 floating point types are defined similarly, with the names
73175 Numerics.Short_Elementary_Functions, Numerics.Long_Elementary_Functions,
73176 etc.
73177
73178 9.a
73179 Reason: The nongeneric equivalents are provided to allow the
73180 programmer to construct simple mathematical applications
73181 without being required to understand and use generics.
73182
73183 10
73184 The functions have their usual mathematical meanings. When the Base
73185 parameter is specified, the Log function computes the logarithm to the
73186 given base; otherwise, it computes the natural logarithm. When the
73187 Cycle parameter is specified, the parameter X of the forward
73188 trigonometric functions (Sin, Cos, Tan, and Cot) and the results of the
73189 inverse trigonometric functions (Arcsin, Arccos, Arctan, and Arccot) are
73190 measured in units such that a full cycle of revolution has the given
73191 value; otherwise, they are measured in radians.
73192
73193 11
73194 The computed results of the mathematically multivalued functions are
73195 rendered single-valued by the following conventions, which are meant to
73196 imply the principal branch:
73197
73198 12
73199 * The results of the Sqrt and Arccosh functions and that of the
73200 exponentiation operator are nonnegative.
73201
73202 13
73203 * The result of the Arcsin function is in the quadrant containing the
73204 point (1.0, x), where x is the value of the parameter X. This
73205 quadrant is I or IV; thus, the range of the Arcsin function is
73206 approximately -PI/2.0 to PI/2.0 (-Cycle/4.0 to Cycle/4.0, if the
73207 parameter Cycle is specified).
73208
73209 14
73210 * The result of the Arccos function is in the quadrant containing the
73211 point (x, 1.0), where x is the value of the parameter X. This
73212 quadrant is I or II; thus, the Arccos function ranges from 0.0 to
73213 approximately PI (Cycle/2.0, if the parameter Cycle is specified).
73214
73215 15
73216 * The results of the Arctan and Arccot functions are in the quadrant
73217 containing the point (x, y), where x and y are the values of the
73218 parameters X and Y, respectively. This may be any quadrant (I
73219 through IV) when the parameter X (resp., Y) of Arctan (resp.,
73220 Arccot) is specified, but it is restricted to quadrants I and IV
73221 (resp., I and II) when that parameter is omitted. Thus, the range
73222 when that parameter is specified is approximately -PI to PI
73223 (-Cycle/2.0 to Cycle/2.0, if the parameter Cycle is specified);
73224 when omitted, the range of Arctan (resp., Arccot) is that of Arcsin
73225 (resp., Arccos), as given above. When the point (x, y) lies on the
73226 negative x-axis, the result approximates
73227
73228 16
73229 * PI (resp., -PI) when the sign of the parameter Y is positive
73230 (resp., negative), if Float_Type'Signed_Zeros is True;
73231
73232 17
73233 * PI, if Float_Type'Signed_Zeros is False.
73234
73235 18
73236 (In the case of the inverse trigonometric functions, in which a result
73237 lying on or near one of the axes may not be exactly representable, the
73238 approximation inherent in computing the result may place it in an
73239 adjacent quadrant, close to but on the wrong side of the axis.)
73240
73241 _Dynamic Semantics_
73242
73243 19
73244 The exception Numerics.Argument_Error is raised, signaling a parameter
73245 value outside the domain of the corresponding mathematical function, in
73246 the following cases:
73247
73248 20
73249 * by any forward or inverse trigonometric function with specified
73250 cycle, when the value of the parameter Cycle is zero or negative;
73251
73252 21
73253 * by the Log function with specified base, when the value of the
73254 parameter Base is zero, one, or negative;
73255
73256 22
73257 * by the Sqrt and Log functions, when the value of the parameter X is
73258 negative;
73259
73260 23
73261 * by the exponentiation operator, when the value of the left operand
73262 is negative or when both operands have the value zero;
73263
73264 24
73265 * by the Arcsin, Arccos, and Arctanh functions, when the absolute
73266 value of the parameter X exceeds one;
73267
73268 25
73269 * by the Arctan and Arccot functions, when the parameters X and Y
73270 both have the value zero;
73271
73272 26
73273 * by the Arccosh function, when the value of the parameter X is less
73274 than one; and
73275
73276 27
73277 * by the Arccoth function, when the absolute value of the parameter X
73278 is less than one.
73279
73280 28
73281 The exception Constraint_Error is raised, signaling a pole of the
73282 mathematical function (analogous to dividing by zero), in the following
73283 cases, provided that Float_Type'Machine_Overflows is True:
73284
73285 29
73286 * by the Log, Cot, and Coth functions, when the value of the
73287 parameter X is zero;
73288
73289 30
73290 * by the exponentiation operator, when the value of the left operand
73291 is zero and the value of the exponent is negative;
73292
73293 31
73294 * by the Tan function with specified cycle, when the value of the
73295 parameter X is an odd multiple of the quarter cycle;
73296
73297 32
73298 * by the Cot function with specified cycle, when the value of the
73299 parameter X is zero or a multiple of the half cycle; and
73300
73301 33
73302 * by the Arctanh and Arccoth functions, when the absolute value of
73303 the parameter X is one.
73304
73305 34
73306 [Constraint_Error can also be raised when a finite result overflows (see
73307 *note G.2.4::); this may occur for parameter values sufficiently near
73308 poles, and, in the case of some of the functions, for parameter values
73309 with sufficiently large magnitudes.] When Float_Type'Machine_Overflows
73310 is False, the result at poles is unspecified.
73311
73312 34.a
73313 Reason: The purpose of raising Constraint_Error (rather than
73314 Numerics.Argument_Error) at the poles of a function, when
73315 Float_Type'Machine_Overflows is True, is to provide continuous
73316 behavior as the actual parameters of the function approach the
73317 pole and finally reach it.
73318
73319 34.b
73320 Discussion: It is anticipated that an Ada binding to IEC
73321 559:1989 will be developed in the future. As part of such a
73322 binding, the Machine_Overflows attribute of a conformant
73323 floating point type will be specified to yield False, which
73324 will permit both the predefined arithmetic operations and
73325 implementations of the elementary functions to deliver signed
73326 infinities (and set the overflow flag defined by the binding)
73327 instead of raising Constraint_Error in overflow situations,
73328 when traps are disabled. Similarly, it is appropriate for the
73329 elementary functions to deliver signed infinities (and set the
73330 zero-divide flag defined by the binding) instead of raising
73331 Constraint_Error at poles, when traps are disabled. Finally,
73332 such a binding should also specify the behavior of the
73333 elementary functions, when sensible, given parameters with
73334 infinite values.
73335
73336 35
73337 When one parameter of a function with multiple parameters represents a
73338 pole and another is outside the function's domain, the latter takes
73339 precedence (i.e., Numerics.Argument_Error is raised).
73340
73341 _Implementation Requirements_
73342
73343 36
73344 In the implementation of Numerics.Generic_Elementary_Functions, the
73345 range of intermediate values allowed during the calculation of a final
73346 result shall not be affected by any range constraint of the subtype
73347 Float_Type.
73348
73349 36.a
73350 Implementation Note: Implementations of
73351 Numerics.Generic_Elementary_Functions written in Ada should
73352 therefore avoid declaring local variables of subtype
73353 Float_Type; the subtype Float_Type'Base should be used
73354 instead.
73355
73356 37
73357 In the following cases, evaluation of an elementary function shall yield
73358 the prescribed result, provided that the preceding rules do not call for
73359 an exception to be raised:
73360
73361 38
73362 * When the parameter X has the value zero, the Sqrt, Sin, Arcsin,
73363 Tan, Sinh, Arcsinh, Tanh, and Arctanh functions yield a result of
73364 zero, and the Exp, Cos, and Cosh functions yield a result of one.
73365
73366 39
73367 * When the parameter X has the value one, the Sqrt function yields a
73368 result of one, and the Log, Arccos, and Arccosh functions yield a
73369 result of zero.
73370
73371 40
73372 * When the parameter Y has the value zero and the parameter X has a
73373 positive value, the Arctan and Arccot functions yield a result of
73374 zero.
73375
73376 41
73377 * The results of the Sin, Cos, Tan, and Cot functions with specified
73378 cycle are exact when the mathematical result is zero; those of the
73379 first two are also exact when the mathematical result is ± 1.0.
73380
73381 42
73382 * Exponentiation by a zero exponent yields the value one.
73383 Exponentiation by a unit exponent yields the value of the left
73384 operand. Exponentiation of the value one yields the value one.
73385 Exponentiation of the value zero yields the value zero.
73386
73387 43
73388 Other accuracy requirements for the elementary functions, which apply
73389 only in implementations conforming to the Numerics Annex, and then only
73390 in the "strict" mode defined there (see *note G.2::), are given in *note
73391 G.2.4::.
73392
73393 44
73394 When Float_Type'Signed_Zeros is True, the sign of a zero result shall be
73395 as follows:
73396
73397 45
73398 * A prescribed zero result delivered at the origin by one of the odd
73399 functions (Sin, Arcsin, Sinh, Arcsinh, Tan, Arctan or Arccot as a
73400 function of Y when X is fixed and positive, Tanh, and Arctanh) has
73401 the sign of the parameter X (Y, in the case of Arctan or Arccot).
73402
73403 46
73404 * A prescribed zero result delivered by one of the odd functions away
73405 from the origin, or by some other elementary function, has an
73406 implementation-defined sign.
73407
73408 46.a
73409 Implementation defined: The sign of a zero result from some of
73410 the operators or functions in
73411 Numerics.Generic_Elementary_Functions, when
73412 Float_Type'Signed_Zeros is True.
73413
73414 47
73415 * [A zero result that is not a prescribed result (i.e., one that
73416 results from rounding or underflow) has the correct mathematical
73417 sign.]
73418
73419 47.a
73420 Reason: This is a consequence of the rules specified in IEC
73421 559:1989 as they apply to underflow situations with traps
73422 disabled.
73423
73424 _Implementation Permissions_
73425
73426 48
73427 The nongeneric equivalent packages may, but need not, be actual
73428 instantiations of the generic package for the appropriate predefined
73429 type.
73430
73431 _Wording Changes from Ada 83_
73432
73433 48.a
73434 The semantics of Numerics.Generic_Elementary_Functions differs
73435 from Generic_Elementary_Functions as defined in ISO/IEC DIS
73436 11430 (for Ada 83) in the following ways:
73437
73438 48.b
73439 * The generic package is a child unit of the package
73440 defining the Argument_Error exception.
73441
73442 48.c
73443 * DIS 11430 specified names for the nongeneric equivalents,
73444 if provided. Here, those nongeneric equivalents are
73445 required.
73446
73447 48.d
73448 * Implementations are not allowed to impose an optional
73449 restriction that the generic actual parameter associated
73450 with Float_Type be unconstrained. (In view of the
73451 ability to declare variables of subtype Float_Type'Base
73452 in implementations of
73453 Numerics.Generic_Elementary_Functions, this flexibility
73454 is no longer needed.)
73455
73456 48.e
73457 * The sign of a prescribed zero result at the origin of the
73458 odd functions is specified, when Float_Type'Signed_Zeros
73459 is True. This conforms with recommendations of Kahan and
73460 other numerical analysts.
73461
73462 48.f
73463 * The dependence of Arctan and Arccot on the sign of a
73464 parameter value of zero is tied to the value of
73465 Float_Type'Signed_Zeros.
73466
73467 48.g
73468 * Sqrt is prescribed to yield a result of one when its
73469 parameter has the value one. This guarantee makes it
73470 easier to achieve certain prescribed results of the
73471 complex elementary functions (see *note G.1.2::, "*note
73472 G.1.2:: Complex Elementary Functions").
73473
73474 48.h
73475 * Conformance to accuracy requirements is conditional.
73476
73477 _Wording Changes from Ada 95_
73478
73479 48.i/2
73480 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} Corrigendum:
73481 Explicitly stated that the nongeneric equivalents of
73482 Generic_Elementary_Functions are pure.
73483
73484 \1f
73485 File: aarm2012.info, Node: A.5.2, Next: A.5.3, Prev: A.5.1, Up: A.5
73486
73487 A.5.2 Random Number Generation
73488 ------------------------------
73489
73490 1
73491 [Facilities for the generation of pseudo-random floating point numbers
73492 are provided in the package Numerics.Float_Random; the generic package
73493 Numerics.Discrete_Random provides similar facilities for the generation
73494 of pseudo-random integers and pseudo-random values of enumeration types.
73495 For brevity, pseudo-random values of any of these types are called
73496 random numbers.
73497
73498 2
73499 Some of the facilities provided are basic to all applications of random
73500 numbers. These include a limited private type each of whose objects
73501 serves as the generator of a (possibly distinct) sequence of random
73502 numbers; a function to obtain the "next" random number from a given
73503 sequence of random numbers (that is, from its generator); and
73504 subprograms to initialize or reinitialize a given generator to a
73505 time-dependent state or a state denoted by a single integer.
73506
73507 3
73508 Other facilities are provided specifically for advanced applications.
73509 These include subprograms to save and restore the state of a given
73510 generator; a private type whose objects can be used to hold the saved
73511 state of a generator; and subprograms to obtain a string representation
73512 of a given generator state, or, given such a string representation, the
73513 corresponding state.]
73514
73515 3.a
73516 Discussion: These facilities support a variety of requirements
73517 ranging from repeatable sequences (for debugging) to unique
73518 sequences in each execution of a program.
73519
73520 _Static Semantics_
73521
73522 4
73523 The library package Numerics.Float_Random has the following declaration:
73524
73525 5
73526 package Ada.Numerics.Float_Random is
73527
73528 6
73529 -- Basic facilities
73530
73531 7
73532 type Generator is limited private;
73533
73534 8
73535 subtype Uniformly_Distributed is Float range 0.0 .. 1.0;
73536 function Random (Gen : Generator) return Uniformly_Distributed;
73537
73538 9
73539 procedure Reset (Gen : in Generator;
73540 Initiator : in Integer);
73541 procedure Reset (Gen : in Generator);
73542
73543 10
73544 -- Advanced facilities
73545
73546 11
73547 type State is private;
73548
73549 12
73550 procedure Save (Gen : in Generator;
73551 To_State : out State);
73552 procedure Reset (Gen : in Generator;
73553 From_State : in State);
73554
73555 13
73556 Max_Image_Width : constant := implementation-defined integer value;
73557
73558 14
73559 function Image (Of_State : State) return String;
73560 function Value (Coded_State : String) return State;
73561
73562 15
73563 private
73564 ... -- not specified by the language
73565 end Ada.Numerics.Float_Random;
73566
73567 15.1/2
73568 {AI95-00360-01AI95-00360-01} The type Generator needs finalization (see
73569 *note 7.6::).
73570
73571 16
73572 The generic library package Numerics.Discrete_Random has the following
73573 declaration:
73574
73575 17
73576
73577 generic
73578 type Result_Subtype is (<>);
73579 package Ada.Numerics.Discrete_Random is
73580
73581 18
73582 -- Basic facilities
73583
73584 19
73585 type Generator is limited private;
73586
73587 20
73588 function Random (Gen : Generator) return Result_Subtype;
73589
73590 21
73591 procedure Reset (Gen : in Generator;
73592 Initiator : in Integer);
73593 procedure Reset (Gen : in Generator);
73594
73595 22
73596 -- Advanced facilities
73597
73598 23
73599 type State is private;
73600
73601 24
73602 procedure Save (Gen : in Generator;
73603 To_State : out State);
73604 procedure Reset (Gen : in Generator;
73605 From_State : in State);
73606
73607 25
73608 Max_Image_Width : constant := implementation-defined integer value;
73609
73610 26
73611 function Image (Of_State : State) return String;
73612 function Value (Coded_State : String) return State;
73613
73614 27
73615 private
73616 ... -- not specified by the language
73617 end Ada.Numerics.Discrete_Random;
73618
73619 27.a
73620 Implementation defined: The value of
73621 Numerics.Float_Random.Max_Image_Width.
73622
73623 27.b
73624 Implementation defined: The value of
73625 Numerics.Discrete_Random.Max_Image_Width.
73626
73627 27.c/1
73628 Implementation Note: {8652/00978652/0097}
73629 {AI95-00115-01AI95-00115-01} The following is a possible
73630 implementation of the private part of Numerics.Float_Random
73631 (assuming the presence of "with Ada.Finalization;" as a
73632 context clause):
73633
73634 27.d
73635 type State is ...;
73636 type Access_State is access State;
73637 type Generator is new Finalization.Limited_Controlled with
73638 record
73639 S : Access_State := new State'(...);
73640 end record;
73641 procedure Finalize (G : in out Generator);
73642
73643 27.d.1/2
73644 {8652/00978652/0097} {AI95-00115-01AI95-00115-01}
73645 {AI95-00344-01AI95-00344-01}
73646 Numerics.Discrete_Random.Generator also can be implemented
73647 this way.
73648
73649 27.e
73650 Clearly some level of indirection is required in the
73651 implementation of a Generator, since the parameter mode is in
73652 for all operations on a Generator. For this reason,
73653 Numerics.Float_Random and Numerics.Discrete_Random cannot be
73654 declared pure.
73655
73656 27.1/2
73657 {AI95-00360-01AI95-00360-01} The type Generator needs finalization (see
73658 *note 7.6::) in every instantiation of Numerics.Discrete_Random.
73659
73660 28
73661 An object of the limited private type Generator is associated with a
73662 sequence of random numbers. Each generator has a hidden (internal)
73663 state, which the operations on generators use to determine the position
73664 in the associated sequence. All generators are implicitly initialized
73665 to an unspecified state that does not vary from one program execution to
73666 another; they may also be explicitly initialized, or reinitialized, to a
73667 time-dependent state, to a previously saved state, or to a state
73668 uniquely denoted by an integer value.
73669
73670 28.a
73671 Discussion: The repeatability provided by the implicit
73672 initialization may be exploited for testing or debugging
73673 purposes.
73674
73675 29/3
73676 {AI05-0280-1AI05-0280-1} An object of the private type State can be used
73677 to hold the internal state of a generator. Such objects are only needed
73678 if the application is designed to save and restore generator states or
73679 to examine or manufacture them. The implicit initial value of type
73680 State corresponds to the implicit initial value of all generators.
73681
73682 29.a/3
73683 Discussion: {AI05-0280-1AI05-0280-1} All generators are
73684 implicitly initialized to the same unchanging value, and using
73685 Reset on a default initialized object of type State will
73686 produce a generator with that same value.
73687
73688 30
73689 The operations on generators affect the state and therefore the future
73690 values of the associated sequence. The semantics of the operations on
73691 generators and states are defined below.
73692
73693 31
73694 function Random (Gen : Generator) return Uniformly_Distributed;
73695 function Random (Gen : Generator) return Result_Subtype;
73696
73697 32
73698 Obtains the "next" random number from the given generator,
73699 relative to its current state, according to an
73700 implementation-defined algorithm. The result of the function
73701 in Numerics.Float_Random is delivered as a value of the
73702 subtype Uniformly_Distributed, which is a subtype of the
73703 predefined type Float having a range of 0.0 .. 1.0. The
73704 result of the function in an instantiation of
73705 Numerics.Discrete_Random is delivered as a value of the
73706 generic formal subtype Result_Subtype.
73707
73708 32.a/2
73709 This paragraph was deleted.
73710
73711 32.a.1/2
73712 Discussion: The algorithm is the subject of a Documentation
73713 Requirement, so we don't separately summarize this
73714 implementation-defined item.
73715
73716 32.b
73717 Reason: The requirement for a level of indirection in
73718 accessing the internal state of a generator arises from the
73719 desire to make Random a function, rather than a procedure.
73720
73721 33
73722 procedure Reset (Gen : in Generator;
73723 Initiator : in Integer);
73724 procedure Reset (Gen : in Generator);
73725
73726 34
73727 Sets the state of the specified generator to one that is an
73728 unspecified function of the value of the parameter Initiator
73729 (or to a time-dependent state, if only a generator parameter
73730 is specified). The latter form of the procedure is known as
73731 the time-dependent Reset procedure.
73732
73733 34.a
73734 Implementation Note: The time-dependent Reset procedure can be
73735 implemented by mapping the current time and date as determined
73736 by the system clock into a state, but other implementations
73737 are possible. For example, a white-noise generator or a
73738 radioactive source can be used to generate time-dependent
73739 states.
73740
73741 35
73742 procedure Save (Gen : in Generator;
73743 To_State : out State);
73744 procedure Reset (Gen : in Generator;
73745 From_State : in State);
73746
73747 36
73748 Save obtains the current state of a generator. Reset gives a
73749 generator the specified state. A generator that is reset to a
73750 state previously obtained by invoking Save is restored to the
73751 state it had when Save was invoked.
73752
73753 37
73754 function Image (Of_State : State) return String;
73755 function Value (Coded_State : String) return State;
73756
73757 38
73758 Image provides a representation of a state coded (in an
73759 implementation-defined way) as a string whose length is
73760 bounded by the value of Max_Image_Width. Value is the inverse
73761 of Image: Value(Image(S)) = S for each state S that can be
73762 obtained from a generator by invoking Save.
73763
73764 38.a
73765 Implementation defined: The string representation of a random
73766 number generator's state.
73767
73768 _Dynamic Semantics_
73769
73770 39
73771 Instantiation of Numerics.Discrete_Random with a subtype having a null
73772 range raises Constraint_Error.
73773
73774 40/1
73775 This paragraph was deleted.{8652/00508652/0050} {AI95-00089AI95-00089}
73776
73777 _Bounded (Run-Time) Errors_
73778
73779 40.1/1
73780 {8652/00508652/0050} {AI95-00089AI95-00089} It is a bounded error to
73781 invoke Value with a string that is not the image of any generator state.
73782 If the error is detected, Constraint_Error or Program_Error is raised.
73783 Otherwise, a call to Reset with the resulting state will produce a
73784 generator such that calls to Random with this generator will produce a
73785 sequence of values of the appropriate subtype, but which might not be
73786 random in character. That is, the sequence of values might not fulfill
73787 the implementation requirements of this subclause.
73788
73789 _Implementation Requirements_
73790
73791 41
73792 A sufficiently long sequence of random numbers obtained by successive
73793 calls to Random is approximately uniformly distributed over the range of
73794 the result subtype.
73795
73796 42
73797 The Random function in an instantiation of Numerics.Discrete_Random is
73798 guaranteed to yield each value in its result subtype in a finite number
73799 of calls, provided that the number of such values does not exceed 2 15.
73800
73801 43
73802 Other performance requirements for the random number generator, which
73803 apply only in implementations conforming to the Numerics Annex, and then
73804 only in the "strict" mode defined there (see *note G.2::), are given in
73805 *note G.2.5::.
73806
73807 _Documentation Requirements_
73808
73809 44
73810 No one algorithm for random number generation is best for all
73811 applications. To enable the user to determine the suitability of the
73812 random number generators for the intended application, the
73813 implementation shall describe the algorithm used and shall give its
73814 period, if known exactly, or a lower bound on the period, if the exact
73815 period is unknown. Periods that are so long that the periodicity is
73816 unobservable in practice can be described in such terms, without giving
73817 a numerical bound.
73818
73819 44.a/2
73820 Documentation Requirement: The algorithm used for random
73821 number generation, including a description of its period.
73822
73823 45
73824 The implementation also shall document the minimum time interval between
73825 calls to the time-dependent Reset procedure that are guaranteed to
73826 initiate different sequences, and it shall document the nature of the
73827 strings that Value will accept without raising Constraint_Error.
73828
73829 45.a/2
73830 This paragraph was deleted.
73831
73832 45.b/2
73833 Documentation Requirement: The minimum time interval between
73834 calls to the time-dependent Reset procedure that is guaranteed
73835 to initiate different random number sequences.
73836
73837 _Implementation Advice_
73838
73839 46
73840 Any storage associated with an object of type Generator should be
73841 reclaimed on exit from the scope of the object.
73842
73843 46.a.1/2
73844 Implementation Advice: Any storage associated with an object
73845 of type Generator of the random number packages should be
73846 reclaimed on exit from the scope of the object.
73847
73848 46.a
73849 Ramification: A level of indirection is implicit in the
73850 semantics of the operations, given that they all take
73851 parameters of mode in. This implies that the full type of
73852 Generator probably should be a controlled type, with
73853 appropriate finalization to reclaim any heap-allocated
73854 storage.
73855
73856 47
73857 If the generator period is sufficiently long in relation to the number
73858 of distinct initiator values, then each possible value of Initiator
73859 passed to Reset should initiate a sequence of random numbers that does
73860 not, in a practical sense, overlap the sequence initiated by any other
73861 value. If this is not possible, then the mapping between initiator
73862 values and generator states should be a rapidly varying function of the
73863 initiator value.
73864
73865 47.a/2
73866 Implementation Advice: Each value of Initiator passed to Reset
73867 for the random number packages should initiate a distinct
73868 sequence of random numbers, or, if that is not possible, be at
73869 least a rapidly varying function of the initiator value.
73870
73871 NOTES
73872
73873 48
73874 19 If two or more tasks are to share the same generator, then the
73875 tasks have to synchronize their access to the generator as for any
73876 shared variable (see *note 9.10::).
73877
73878 49
73879 20 Within a given implementation, a repeatable random number
73880 sequence can be obtained by relying on the implicit initialization
73881 of generators or by explicitly initializing a generator with a
73882 repeatable initiator value. Different sequences of random numbers
73883 can be obtained from a given generator in different program
73884 executions by explicitly initializing the generator to a
73885 time-dependent state.
73886
73887 50
73888 21 A given implementation of the Random function in
73889 Numerics.Float_Random may or may not be capable of delivering the
73890 values 0.0 or 1.0. Portable applications should assume that these
73891 values, or values sufficiently close to them to behave
73892 indistinguishably from them, can occur. If a sequence of random
73893 integers from some fixed range is needed, the application should
73894 use the Random function in an appropriate instantiation of
73895 Numerics.Discrete_Random, rather than transforming the result of
73896 the Random function in Numerics.Float_Random. However, some
73897 applications with unusual requirements, such as for a sequence of
73898 random integers each drawn from a different range, will find it
73899 more convenient to transform the result of the floating point
73900 Random function. For M >= 1, the expression
73901
73902 51
73903 Integer(Float(M) * Random(G)) mod M
73904
73905 52
73906 transforms the result of Random(G) to an integer uniformly
73907 distributed over the range 0 .. M-1; it is valid even if Random
73908 delivers 0.0 or 1.0. Each value of the result range is possible,
73909 provided that M is not too large. Exponentially distributed
73910 (floating point) random numbers with mean and standard deviation
73911 1.0 can be obtained by the transformation
73912
73913 53/2
73914 {AI95-00434-01AI95-00434-01} -Log(Random(G) + Float'Model_Small)
73915
73916 54
73917 where Log comes from Numerics.Elementary_Functions (see *note
73918 A.5.1::); in this expression, the addition of Float'Model_Small
73919 avoids the exception that would be raised were Log to be given the
73920 value zero, without affecting the result (in most implementations)
73921 when Random returns a nonzero value.
73922
73923 _Examples_
73924
73925 55
73926 Example of a program that plays a simulated dice game:
73927
73928 56
73929 with Ada.Numerics.Discrete_Random;
73930 procedure Dice_Game is
73931 subtype Die is Integer range 1 .. 6;
73932 subtype Dice is Integer range 2*Die'First .. 2*Die'Last;
73933 package Random_Die is new Ada.Numerics.Discrete_Random (Die);
73934 use Random_Die;
73935 G : Generator;
73936 D : Dice;
73937 begin
73938 Reset (G); -- Start the generator in a unique state in each run
73939 loop
73940 -- Roll a pair of dice; sum and process the results
73941 D := Random(G) + Random(G);
73942 ...
73943 end loop;
73944 end Dice_Game;
73945
73946 57
73947 Example of a program that simulates coin tosses:
73948
73949 58
73950 with Ada.Numerics.Discrete_Random;
73951 procedure Flip_A_Coin is
73952 type Coin is (Heads, Tails);
73953 package Random_Coin is new Ada.Numerics.Discrete_Random (Coin);
73954 use Random_Coin;
73955 G : Generator;
73956 begin
73957 Reset (G); -- Start the generator in a unique state in each run
73958 loop
73959 -- Toss a coin and process the result
73960 case Random(G) is
73961 when Heads =>
73962 ...
73963 when Tails =>
73964 ...
73965 end case;
73966 ...
73967 end loop;
73968 end Flip_A_Coin;
73969
73970 59
73971 Example of a parallel simulation of a physical system, with a separate
73972 generator of event probabilities in each task:
73973
73974 60
73975 with Ada.Numerics.Float_Random;
73976 procedure Parallel_Simulation is
73977 use Ada.Numerics.Float_Random;
73978 task type Worker is
73979 entry Initialize_Generator (Initiator : in Integer);
73980 ...
73981 end Worker;
73982 W : array (1 .. 10) of Worker;
73983 task body Worker is
73984 G : Generator;
73985 Probability_Of_Event : Uniformly_Distributed;
73986 begin
73987 accept Initialize_Generator (Initiator : in Integer) do
73988 Reset (G, Initiator);
73989 end Initialize_Generator;
73990 loop
73991 ...
73992 Probability_Of_Event := Random(G);
73993 ...
73994 end loop;
73995 end Worker;
73996 begin
73997 -- Initialize the generators in the Worker tasks to different states
73998 for I in W'Range loop
73999 W(I).Initialize_Generator (I);
74000 end loop;
74001 ... -- Wait for the Worker tasks to terminate
74002 end Parallel_Simulation;
74003
74004 NOTES
74005
74006 61
74007 22 Notes on the last example: Although each Worker task
74008 initializes its generator to a different state, those states will
74009 be the same in every execution of the program. The generator
74010 states can be initialized uniquely in each program execution by
74011 instantiating Ada.Numerics.Discrete_Random for the type Integer in
74012 the main procedure, resetting the generator obtained from that
74013 instance to a time-dependent state, and then using random integers
74014 obtained from that generator to initialize the generators in each
74015 Worker task.
74016
74017 _Incompatibilities With Ada 95_
74018
74019 61.a/2
74020 {AI95-00360-01AI95-00360-01} Amendment Correction: Type
74021 Generator in Numerics.Float_Random and in an instance of
74022 Numerics.Discrete_Random is defined to need finalization. If
74023 the restriction No_Nested_Finalization (see *note D.7::)
74024 applies to the partition, and Generator does not have a
74025 controlled part, it will not be allowed in local objects in
74026 Ada 2005 whereas it would be allowed in original Ada 95. Such
74027 code is not portable, as another Ada compiler may have a
74028 controlled part in Generator, and thus would be illegal.
74029
74030 _Wording Changes from Ada 95_
74031
74032 61.b/3
74033 {8652/00508652/0050} {AI95-00089-01AI95-00089-01}
74034 {AI05-0005-1AI05-0005-1} Corrigendum: Made the passing of an
74035 incorrect Image of a generator a bounded error, as it might
74036 not be practical to check for problems (if a generator
74037 consists of several related values).
74038
74039 _Wording Changes from Ada 2005_
74040
74041 61.c/3
74042 {AI05-0280-1AI05-0280-1} Correction: Specified the implicit
74043 initial value for (sub)type State. This was unspecified in
74044 Ada 95 and Ada 2005, so a program depending on some other
74045 initial value is very unlikely and certainly was not portable.
74046 An implementation can use default expressions, aspect
74047 Default_Value, or aspect Default_Component_Value to keep the
74048 representation of the type unchanged while meeting this new
74049 requirement.
74050
74051 \1f
74052 File: aarm2012.info, Node: A.5.3, Next: A.5.4, Prev: A.5.2, Up: A.5
74053
74054 A.5.3 Attributes of Floating Point Types
74055 ----------------------------------------
74056
74057 _Static Semantics_
74058
74059 1
74060 The following representation-oriented attributes are defined for every
74061 subtype S of a floating point type T.
74062
74063 2
74064 S'Machine_Radix
74065 Yields the radix of the hardware representation of the
74066 type T. The value of this attribute is of the type
74067 universal_integer.
74068
74069 3
74070 The values of other representation-oriented attributes of a floating
74071 point subtype, and of the "primitive function" attributes of a floating
74072 point subtype described later, are defined in terms of a particular
74073 representation of nonzero values called the canonical form. The
74074 canonical form (for the type T) is the form
74075 ± mantissa · T'Machine_Radixexponent
74076 where
74077
74078 4
74079 * mantissa is a fraction in the number base T'Machine_Radix, the
74080 first digit of which is nonzero, and
74081
74082 5
74083 * exponent is an integer.
74084
74085 6
74086 S'Machine_Mantissa
74087 Yields the largest value of p such that every value
74088 expressible in the canonical form (for the type T),
74089 having a p-digit mantissa and an exponent between
74090 T'Machine_Emin and T'Machine_Emax, is a machine number
74091 (see *note 3.5.7::) of the type T. This attribute yields
74092 a value of the type universal_integer.
74093
74094 6.a
74095 Ramification: Values of a type held in an extended register
74096 are, in general, not machine numbers of the type, since they
74097 cannot be expressed in the canonical form with a sufficiently
74098 short mantissa.
74099
74100 7
74101 S'Machine_Emin
74102 Yields the smallest (most negative) value of exponent
74103 such that every value expressible in the canonical form
74104 (for the type T), having a mantissa of T'Machine_Mantissa
74105 digits, is a machine number (see *note 3.5.7::) of the
74106 type T. This attribute yields a value of the type
74107 universal_integer.
74108
74109 8
74110 S'Machine_Emax
74111 Yields the largest (most positive) value of exponent such
74112 that every value expressible in the canonical form (for
74113 the type T), having a mantissa of T'Machine_Mantissa
74114 digits, is a machine number (see *note 3.5.7::) of the
74115 type T. This attribute yields a value of the type
74116 universal_integer.
74117
74118 8.a
74119 Ramification: Note that the above definitions do not determine
74120 unique values for the representation-oriented attributes of
74121 floating point types. The implementation may choose any set
74122 of values that collectively satisfies the definitions.
74123
74124 9
74125 S'Denorm
74126 Yields the value True if every value expressible in the
74127 form
74128 ± mantissa · T'Machine_RadixT'Machine_Emin
74129 where mantissa is a nonzero T'Machine_Mantissa-digit
74130 fraction in the number base T'Machine_Radix, the first
74131 digit of which is zero, is a machine number (see *note
74132 3.5.7::) of the type T; yields the value False otherwise.
74133 The value of this attribute is of the predefined type
74134 Boolean.
74135
74136 10
74137 The values described by the formula in the definition of S'Denorm are
74138 called denormalized numbers. A nonzero machine number that is not a
74139 denormalized number is a normalized number. A normalized number x of a
74140 given type T is said to be represented in canonical form when it is
74141 expressed in the canonical form (for the type T) with a mantissa having
74142 T'Machine_Mantissa digits; the resulting form is the canonical-form
74143 representation of x.
74144
74145 10.a
74146 Discussion: The intent is that S'Denorm be True when such
74147 denormalized numbers exist and are generated in the
74148 circumstances defined by IEC 559:1989, though the latter
74149 requirement is not formalized here.
74150
74151 11
74152 S'Machine_Rounds
74153 Yields the value True if rounding is performed on inexact
74154 results of every predefined operation that yields a
74155 result of the type T; yields the value False otherwise.
74156 The value of this attribute is of the predefined type
74157 Boolean.
74158
74159 11.a
74160 Discussion: It is difficult to be more precise about what it
74161 means to round the result of a predefined operation. If the
74162 implementation does not use extended registers, so that every
74163 arithmetic result is necessarily a machine number, then
74164 rounding seems to imply two things:
74165
74166 11.b
74167 * S'Model_Mantissa = S'Machine_Mantissa, so that operand
74168 preperturbation never occurs;
74169
74170 11.c
74171 * when the exact mathematical result is not a machine
74172 number, the result of a predefined operation must be the
74173 nearer of the two adjacent machine numbers.
74174
74175 11.d
74176 Technically, this attribute should yield False when extended
74177 registers are used, since a few computed results will cross
74178 over the half-way point as a result of double rounding, if and
74179 when a value held in an extended register has to be reduced in
74180 precision to that of the machine numbers. It does not seem
74181 desirable to preclude the use of extended registers when
74182 S'Machine_Rounds could otherwise be True.
74183
74184 12
74185 S'Machine_Overflows
74186 Yields the value True if overflow and divide-by-zero are
74187 detected and reported by raising Constraint_Error for
74188 every predefined operation that yields a result of the
74189 type T; yields the value False otherwise. The value of
74190 this attribute is of the predefined type Boolean.
74191
74192 13
74193 S'Signed_Zeros
74194 Yields the value True if the hardware representation for
74195 the type T has the capability of representing both
74196 positively and negatively signed zeros, these being
74197 generated and used by the predefined operations of the
74198 type T as specified in IEC 559:1989; yields the value
74199 False otherwise. The value of this attribute is of the
74200 predefined type Boolean.
74201
74202 14
74203 For every value x of a floating point type T, the normalized exponent of
74204 x is defined as follows:
74205
74206 15
74207 * the normalized exponent of zero is (by convention) zero;
74208
74209 16
74210 * for nonzero x, the normalized exponent of x is the unique integer k
74211 such that T'Machine_Radixk-1 <= |x| < T'Machine_Radixk.
74212
74213 16.a
74214 Ramification: The normalized exponent of a normalized number x
74215 is the value of exponent in the canonical-form representation
74216 of x.
74217
74218 16.b
74219 The normalized exponent of a denormalized number is less than
74220 the value of T'Machine_Emin.
74221
74222 17
74223 The following primitive function attributes are defined for any subtype
74224 S of a floating point type T.
74225
74226 18
74227 S'Exponent
74228 S'Exponent denotes a function with the following
74229 specification:
74230
74231 19
74232 function S'Exponent (X : T)
74233 return universal_integer
74234
74235 20
74236 The function yields the normalized exponent of X.
74237
74238 21
74239 S'Fraction
74240 S'Fraction denotes a function with the following
74241 specification:
74242
74243 22
74244 function S'Fraction (X : T)
74245 return T
74246
74247 23
74248 The function yields the value X · T'Machine_Radix-k,
74249 where k is the normalized exponent of X. A zero result[,
74250 which can only occur when X is zero,] has the sign of X.
74251
74252 23.a
74253 Discussion: Informally, when X is a normalized number, the
74254 result is the value obtained by replacing the exponent by zero
74255 in the canonical-form representation of X.
74256
74257 23.b
74258 Ramification: Except when X is zero, the magnitude of the
74259 result is greater than or equal to the reciprocal of
74260 T'Machine_Radix and less than one; consequently, the result is
74261 always a normalized number, even when X is a denormalized
74262 number.
74263
74264 23.c
74265 Implementation Note: When X is a denormalized number, the
74266 result is the value obtained by replacing the exponent by zero
74267 in the canonical-form representation of the result of scaling
74268 X up sufficiently to normalize it.
74269
74270 24
74271 S'Compose
74272 S'Compose denotes a function with the following
74273 specification:
74274
74275 25
74276 function S'Compose (Fraction : T;
74277 Exponent : universal_integer)
74278 return T
74279
74280 26
74281 Let v be the value Fraction · T'Machine_RadixExponent-k,
74282 where k is the normalized exponent of Fraction. If v is
74283 a machine number of the type T, or if |v| >=
74284 T'Model_Small, the function yields v; otherwise, it
74285 yields either one of the machine numbers of the type T
74286 adjacent to v. Constraint_Error is optionally raised if
74287 v is outside the base range of S. A zero result has the
74288 sign of Fraction when S'Signed_Zeros is True.
74289
74290 26.a
74291 Discussion: Informally, when Fraction and v are both
74292 normalized numbers, the result is the value obtained by
74293 replacing the exponent by Exponent in the canonical-form
74294 representation of Fraction.
74295
74296 26.b
74297 Ramification: If Exponent is less than T'Machine_Emin and
74298 Fraction is nonzero, the result is either zero, T'Model_Small,
74299 or (if T'Denorm is True) a denormalized number.
74300
74301 27
74302 S'Scaling
74303 S'Scaling denotes a function with the following
74304 specification:
74305
74306 28
74307 function S'Scaling (X : T;
74308 Adjustment : universal_integer)
74309 return T
74310
74311 29
74312 Let v be the value X · T'Machine_RadixAdjustment. If v
74313 is a machine number of the type T, or if |v| >=
74314 T'Model_Small, the function yields v; otherwise, it
74315 yields either one of the machine numbers of the type T
74316 adjacent to v. Constraint_Error is optionally raised if
74317 v is outside the base range of S. A zero result has the
74318 sign of X when S'Signed_Zeros is True.
74319
74320 29.a
74321 Discussion: Informally, when X and v are both normalized
74322 numbers, the result is the value obtained by increasing the
74323 exponent by Adjustment in the canonical-form representation of
74324 X.
74325
74326 29.b
74327 Ramification: If Adjustment is sufficiently small (i.e.,
74328 sufficiently negative), the result is either zero,
74329 T'Model_Small, or (if T'Denorm is True) a denormalized number.
74330
74331 30
74332 S'Floor
74333 S'Floor denotes a function with the following
74334 specification:
74335
74336 31
74337 function S'Floor (X : T)
74338 return T
74339
74340 32
74341 The function yields the value 'floor(X)', i.e., the
74342 largest (most positive) integral value less than or equal
74343 to X. When X is zero, the result has the sign of X; a
74344 zero result otherwise has a positive sign.
74345
74346 33
74347 S'Ceiling
74348 S'Ceiling denotes a function with the following
74349 specification:
74350
74351 34
74352 function S'Ceiling (X : T)
74353 return T
74354
74355 35
74356 The function yields the value 'ceiling(X)', i.e., the
74357 smallest (most negative) integral value greater than or
74358 equal to X. When X is zero, the result has the sign of X;
74359 a zero result otherwise has a negative sign when
74360 S'Signed_Zeros is True.
74361
74362 36
74363 S'Rounding
74364 S'Rounding denotes a function with the following
74365 specification:
74366
74367 37
74368 function S'Rounding (X : T)
74369 return T
74370
74371 38
74372 The function yields the integral value nearest to X,
74373 rounding away from zero if X lies exactly halfway between
74374 two integers. A zero result has the sign of X when
74375 S'Signed_Zeros is True.
74376
74377 39
74378 S'Unbiased_Rounding
74379 S'Unbiased_Rounding denotes a function with the following
74380 specification:
74381
74382 40
74383 function S'Unbiased_Rounding (X : T)
74384 return T
74385
74386 41
74387 The function yields the integral value nearest to X,
74388 rounding toward the even integer if X lies exactly
74389 halfway between two integers. A zero result has the sign
74390 of X when S'Signed_Zeros is True.
74391
74392 41.1/2
74393 S'Machine_Rounding
74394 {AI95-00267-01AI95-00267-01} S'Machine_Rounding denotes a
74395 function with the following specification:
74396
74397 41.2/2
74398 function S'Machine_Rounding (X : T)
74399 return T
74400
74401 41.3/2
74402 The function yields the integral value nearest to X. If X
74403 lies exactly halfway between two integers, one of those
74404 integers is returned, but which of them is returned is
74405 unspecified. A zero result has the sign of X when
74406 S'Signed_Zeros is True. This function provides access to
74407 the rounding behavior which is most efficient on the
74408 target processor.
74409
74410 41.a.1/2
74411 Discussion: We leave the rounding unspecified, so that users
74412 cannot depend on a particular rounding. This attribute is
74413 intended for use in cases where the particular rounding chosen
74414 is irrelevant. If there is a need to know which way values
74415 halfway between two integers are rounded, one of the other
74416 rounding attributes should be used.
74417
74418 42
74419 S'Truncation
74420 S'Truncation denotes a function with the following
74421 specification:
74422
74423 43
74424 function S'Truncation (X : T)
74425 return T
74426
74427 44
74428 The function yields the value 'ceiling(X)' when X is
74429 negative, and 'floor(X)' otherwise. A zero result has
74430 the sign of X when S'Signed_Zeros is True.
74431
74432 45
74433 S'Remainder
74434 S'Remainder denotes a function with the following
74435 specification:
74436
74437 46
74438 function S'Remainder (X, Y : T)
74439 return T
74440
74441 47
74442 For nonzero Y, let v be the value X - n · Y, where n is
74443 the integer nearest to the exact value of X/Y; if |n -
74444 X/Y| = 1/2, then n is chosen to be even. If v is a
74445 machine number of the type T, the function yields v;
74446 otherwise, it yields zero. Constraint_Error is raised if
74447 Y is zero. A zero result has the sign of X when
74448 S'Signed_Zeros is True.
74449
74450 47.a
74451 Ramification: The magnitude of the result is less than or
74452 equal to one-half the magnitude of Y.
74453
74454 47.b
74455 Discussion: Given machine numbers X and Y of the type T, v is
74456 necessarily a machine number of the type T, except when Y is
74457 in the neighborhood of zero, X is sufficiently close to a
74458 multiple of Y, and T'Denorm is False.
74459
74460 48
74461 S'Adjacent
74462 S'Adjacent denotes a function with the following
74463 specification:
74464
74465 49
74466 function S'Adjacent (X, Towards : T)
74467 return T
74468
74469 50
74470 If Towards = X, the function yields X; otherwise, it
74471 yields the machine number of the type T adjacent to X in
74472 the direction of Towards, if that machine number exists.
74473 If the result would be outside the base range of S,
74474 Constraint_Error is raised. When T'Signed_Zeros is True,
74475 a zero result has the sign of X. When Towards is zero,
74476 its sign has no bearing on the result.
74477
74478 50.a
74479 Ramification: The value of S'Adjacent(0.0, 1.0) is the
74480 smallest normalized positive number of the type T when
74481 T'Denorm is False and the smallest denormalized positive
74482 number of the type T when T'Denorm is True.
74483
74484 51
74485 S'Copy_Sign
74486 S'Copy_Sign denotes a function with the following
74487 specification:
74488
74489 52
74490 function S'Copy_Sign (Value, Sign : T)
74491 return T
74492
74493 53
74494 If the value of Value is nonzero, the function yields a
74495 result whose magnitude is that of Value and whose sign is
74496 that of Sign; otherwise, it yields the value zero.
74497 Constraint_Error is optionally raised if the result is
74498 outside the base range of S. A zero result has the sign
74499 of Sign when S'Signed_Zeros is True.
74500
74501 53.a
74502 Discussion: S'Copy_Sign is provided for convenience in
74503 restoring the sign to a quantity from which it has been
74504 temporarily removed, or to a related quantity. When
74505 S'Signed_Zeros is True, it is also instrumental in determining
74506 the sign of a zero quantity, when required. (Because negative
74507 and positive zeros compare equal in systems conforming to IEC
74508 559:1989, a negative zero does not appear to be negative when
74509 compared to zero.) The sign determination is accomplished by
74510 transferring the sign of the zero quantity to a nonzero
74511 quantity and then testing for a negative result.
74512
74513 54
74514 S'Leading_Part
74515 S'Leading_Part denotes a function with the following
74516 specification:
74517
74518 55
74519 function S'Leading_Part (X : T;
74520 Radix_Digits : universal_integer)
74521 return T
74522
74523 56
74524 Let v be the value T'Machine_Radixk-Radix_Digits, where k
74525 is the normalized exponent of X. The function yields the
74526 value
74527
74528 57
74529 * 'floor(X/v)' · v, when X is nonnegative and
74530 Radix_Digits is positive;
74531
74532 58
74533 * 'ceiling(X/v)' · v, when X is negative and
74534 Radix_Digits is positive.
74535
74536 59
74537 Constraint_Error is raised when Radix_Digits is zero or
74538 negative. A zero result[, which can only occur when X is
74539 zero,] has the sign of X.
74540
74541 59.a
74542 Discussion: Informally, if X is nonzero, the result is the
74543 value obtained by retaining only the specified number of
74544 (leading) significant digits of X (in the machine radix),
74545 setting all other digits to zero.
74546
74547 59.b
74548 Implementation Note: The result can be obtained by first
74549 scaling X up, if necessary to normalize it, then masking the
74550 mantissa so as to retain only the specified number of leading
74551 digits, then scaling the result back down if X was scaled up.
74552
74553 60
74554 S'Machine
74555 S'Machine denotes a function with the following
74556 specification:
74557
74558 61
74559 function S'Machine (X : T)
74560 return T
74561
74562 62
74563 If X is a machine number of the type T, the function
74564 yields X; otherwise, it yields the value obtained by
74565 rounding or truncating X to either one of the adjacent
74566 machine numbers of the type T. Constraint_Error is raised
74567 if rounding or truncating X to the precision of the
74568 machine numbers results in a value outside the base range
74569 of S. A zero result has the sign of X when S'Signed_Zeros
74570 is True.
74571
74572 62.a/3
74573 Discussion: {AI05-0005-1AI05-0005-1} All of the primitive
74574 function attributes except Rounding and Machine correspond to
74575 subprograms in the Generic_Primitive_Functions generic package
74576 that was proposed as a separate ISO standard (ISO/IEC DIS
74577 11729) for Ada 83. The Scaling, Unbiased_Rounding, and
74578 Truncation attributes correspond to the Scale, Round, and
74579 Truncate functions, respectively, in
74580 Generic_Primitive_Functions. The Rounding attribute rounds
74581 away from zero; this functionality was not provided in
74582 Generic_Primitive_Functions. The name Round was not available
74583 for either of the primitive function attributes that perform
74584 rounding, since an attribute of that name is used for a
74585 different purpose for decimal fixed point types. Likewise,
74586 the name Scale was not available, since an attribute of that
74587 name is also used for a different purpose for decimal fixed
74588 point types. The functionality of the Machine attribute was
74589 also not provided in Generic_Primitive_Functions. The
74590 functionality of the Decompose procedure of
74591 Generic_Primitive_Functions is only provided in the form of
74592 the separate attributes Exponent and Fraction. The
74593 functionality of the Successor and Predecessor functions of
74594 Generic_Primitive_Functions is provided by the extension of
74595 the existing Succ and Pred attributes.
74596
74597 62.b
74598 Implementation Note: The primitive function attributes may be
74599 implemented either with appropriate floating point arithmetic
74600 operations or with integer and logical operations that act on
74601 parts of the representation directly. The latter is strongly
74602 encouraged when it is more efficient than the former; it is
74603 mandatory when the former cannot deliver the required accuracy
74604 due to limitations of the implementation's arithmetic
74605 operations.
74606
74607 63
74608 The following model-oriented attributes are defined for any subtype S of
74609 a floating point type T.
74610
74611 64
74612 S'Model_Mantissa
74613 If the Numerics Annex is not supported, this attribute
74614 yields an implementation defined value that is greater
74615 than or equal to 'ceiling(d · log(10) /
74616 log(T'Machine_Radix))' + 1, where d is the requested
74617 decimal precision of T, and less than or equal to the
74618 value of T'Machine_Mantissa. See *note G.2.2:: for
74619 further requirements that apply to implementations
74620 supporting the Numerics Annex. The value of this
74621 attribute is of the type universal_integer.
74622
74623 65
74624 S'Model_Emin
74625 If the Numerics Annex is not supported, this attribute
74626 yields an implementation defined value that is greater
74627 than or equal to the value of T'Machine_Emin. See *note
74628 G.2.2:: for further requirements that apply to
74629 implementations supporting the Numerics Annex. The value
74630 of this attribute is of the type universal_integer.
74631
74632 66
74633 S'Model_Epsilon
74634 Yields the value T'Machine_Radix1 - T'Model_Mantissa.
74635 The value of this attribute is of the type
74636 universal_real.
74637
74638 66.a
74639 Discussion: In most implementations, this attribute yields the
74640 absolute value of the difference between one and the smallest
74641 machine number of the type T above one which, when added to
74642 one, yields a machine number different from one. Further
74643 discussion can be found in *note G.2.2::.
74644
74645 67
74646 S'Model_Small
74647 Yields the value T'Machine_RadixT'Model_Emin - 1. The
74648 value of this attribute is of the type universal_real.
74649
74650 67.a
74651 Discussion: In most implementations, this attribute yields the
74652 smallest positive normalized number of the type T, i.e. the
74653 number corresponding to the positive underflow threshold. In
74654 some implementations employing a radix-complement
74655 representation for the type T, the positive underflow
74656 threshold is closer to zero than is the negative underflow
74657 threshold, with the consequence that the smallest positive
74658 normalized number does not coincide with the positive
74659 underflow threshold (i.e., it exceeds the latter). Further
74660 discussion can be found in *note G.2.2::.
74661
74662 68
74663 S'Model
74664 S'Model denotes a function with the following
74665 specification:
74666
74667 69
74668 function S'Model (X : T)
74669 return T
74670
74671 70
74672 If the Numerics Annex is not supported, the meaning of
74673 this attribute is implementation defined; see *note
74674 G.2.2:: for the definition that applies to
74675 implementations supporting the Numerics Annex.
74676
74677 71
74678 S'Safe_First
74679 Yields the lower bound of the safe range (see *note
74680 3.5.7::) of the type T. If the Numerics Annex is not
74681 supported, the value of this attribute is implementation
74682 defined; see *note G.2.2:: for the definition that
74683 applies to implementations supporting the Numerics Annex.
74684 The value of this attribute is of the type
74685 universal_real.
74686
74687 72
74688 S'Safe_Last
74689 Yields the upper bound of the safe range (see *note
74690 3.5.7::) of the type T. If the Numerics Annex is not
74691 supported, the value of this attribute is implementation
74692 defined; see *note G.2.2:: for the definition that
74693 applies to implementations supporting the Numerics Annex.
74694 The value of this attribute is of the type
74695 universal_real.
74696
74697 72.a
74698 Discussion: A predefined floating point arithmetic operation
74699 that yields a value in the safe range of its result type is
74700 guaranteed not to overflow.
74701
74702 72.b
74703 To be honest: An exception is made for exponentiation by a
74704 negative exponent in *note 4.5.6::.
74705
74706 72.c
74707 Implementation defined: The values of the Model_Mantissa,
74708 Model_Emin, Model_Epsilon, Model, Safe_First, and Safe_Last
74709 attributes, if the Numerics Annex is not supported.
74710
74711 _Incompatibilities With Ada 83_
74712
74713 72.d
74714 The Epsilon and Mantissa attributes of floating point types
74715 are removed from the language and replaced by Model_Epsilon
74716 and Model_Mantissa, which may have different values (as a
74717 result of changes in the definition of model numbers); the
74718 replacement of one set of attributes by another is intended to
74719 convert what would be an inconsistent change into an
74720 incompatible change.
74721
74722 72.e
74723 The Emax, Small, Large, Safe_Emax, Safe_Small, and Safe_Large
74724 attributes of floating point types are removed from the
74725 language. Small and Safe_Small are collectively replaced by
74726 Model_Small, which is functionally equivalent to Safe_Small,
74727 though it may have a slightly different value. The others are
74728 collectively replaced by Safe_First and Safe_Last. Safe_Last
74729 is functionally equivalent to Safe_Large, though it may have a
74730 different value; Safe_First is comparable to the negation of
74731 Safe_Large but may differ slightly from it as well as from the
74732 negation of Safe_Last. Emax and Safe_Emax had relatively few
74733 uses in Ada 83; T'Safe_Emax can be computed in the revised
74734 language as Integer'Min(T'Exponent(T'Safe_First),
74735 T'Exponent(T'Safe_Last)).
74736
74737 72.f
74738 Implementations are encouraged to eliminate the
74739 incompatibilities discussed here by retaining the old
74740 attributes, during a transition period, in the form of
74741 implementation-defined attributes with their former values.
74742
74743 _Extensions to Ada 83_
74744
74745 72.g
74746 The Model_Emin attribute is new. It is conceptually similar
74747 to the negation of Safe_Emax attribute of Ada 83, adjusted for
74748 the fact that the model numbers now have the hardware radix.
74749 It is a fundamental determinant, along with Model_Mantissa, of
74750 the set of model numbers of a type (see *note G.2.1::).
74751
74752 72.h
74753 The Denorm and Signed_Zeros attributes are new, as are all of
74754 the primitive function attributes.
74755
74756 _Extensions to Ada 95_
74757
74758 72.i/2
74759 {AI95-00388-01AI95-00388-01} The Machine_Rounding attribute is
74760 new.
74761
74762 \1f
74763 File: aarm2012.info, Node: A.5.4, Prev: A.5.3, Up: A.5
74764
74765 A.5.4 Attributes of Fixed Point Types
74766 -------------------------------------
74767
74768 _Static Semantics_
74769
74770 1
74771 The following representation-oriented attributes are defined for every
74772 subtype S of a fixed point type T.
74773
74774 2
74775 S'Machine_Radix
74776 Yields the radix of the hardware representation of the
74777 type T. The value of this attribute is of the type
74778 universal_integer.
74779
74780 3
74781 S'Machine_Rounds
74782 Yields the value True if rounding is performed on inexact
74783 results of every predefined operation that yields a
74784 result of the type T; yields the value False otherwise.
74785 The value of this attribute is of the predefined type
74786 Boolean.
74787
74788 4
74789 S'Machine_Overflows
74790 Yields the value True if overflow and divide-by-zero are
74791 detected and reported by raising Constraint_Error for
74792 every predefined operation that yields a result of the
74793 type T; yields the value False otherwise. The value of
74794 this attribute is of the predefined type Boolean.
74795
74796 _Incompatibilities With Ada 83_
74797
74798 4.a
74799 The Mantissa, Large, Safe_Small, and Safe_Large attributes of
74800 fixed point types are removed from the language.
74801
74802 4.b
74803 Implementations are encouraged to eliminate the resulting
74804 incompatibility by retaining these attributes, during a
74805 transition period, in the form of implementation-defined
74806 attributes with their former values.
74807
74808 _Extensions to Ada 83_
74809
74810 4.c
74811 The Machine_Radix attribute is now allowed for fixed point
74812 types. It is also specifiable in an attribute definition
74813 clause (see *note F.1::).
74814
74815 \1f
74816 File: aarm2012.info, Node: A.6, Next: A.7, Prev: A.5, Up: Annex A
74817
74818 A.6 Input-Output
74819 ================
74820
74821 1/2
74822 {AI95-00285-01AI95-00285-01} [ Input-output is provided through
74823 language-defined packages, each of which is a child of the root package
74824 Ada. The generic packages Sequential_IO and Direct_IO define
74825 input-output operations applicable to files containing elements of a
74826 given type. The generic package Storage_IO supports reading from and
74827 writing to an in-memory buffer. Additional operations for text
74828 input-output are supplied in the packages Text_IO, Wide_Text_IO, and
74829 Wide_Wide_Text_IO. Heterogeneous input-output is provided through the
74830 child packages Streams.Stream_IO and Text_IO.Text_Streams (see also
74831 *note 13.13::). The package IO_Exceptions defines the exceptions needed
74832 by the predefined input-output packages.]
74833
74834 _Inconsistencies With Ada 83_
74835
74836 1.a
74837 The introduction of Append_File as a new element of the
74838 enumeration type File_Mode in Sequential_IO and Text_IO, and
74839 the introduction of several new declarations in Text_IO, may
74840 result in name clashes in the presence of use clauses.
74841
74842 _Extensions to Ada 83_
74843
74844 1.b
74845 Text_IO enhancements (Get_Immediate, Look_Ahead,
74846 Standard_Error, Modular_IO, Decimal_IO), Wide_Text_IO, and the
74847 stream input-output facilities are new in Ada 95.
74848
74849 _Wording Changes from Ada 83_
74850
74851 1.c
74852 RM83-14.6, "Low Level Input-Output," is removed. This has no
74853 semantic effect, since the package was entirely implementation
74854 defined, nobody actually implemented it, and if they did, they
74855 can always provide it as a vendor-supplied package.
74856
74857 _Wording Changes from Ada 95_
74858
74859 1.d/2
74860 {AI95-00285-01AI95-00285-01} Included package
74861 Wide_Wide_Text_IO in this description.
74862
74863 \1f
74864 File: aarm2012.info, Node: A.7, Next: A.8, Prev: A.6, Up: Annex A
74865
74866 A.7 External Files and File Objects
74867 ===================================
74868
74869 _Static Semantics_
74870
74871 1
74872 Values input from the external environment of the program, or output to
74873 the external environment, are considered to occupy external files. An
74874 external file can be anything external to the program that can produce a
74875 value to be read or receive a value to be written. An external file is
74876 identified by a string (the name). A second string (the form) gives
74877 further system-dependent characteristics that may be associated with the
74878 file, such as the physical organization or access rights. The
74879 conventions governing the interpretation of such strings shall be
74880 documented.
74881
74882 2/3
74883 {AI05-0299-1AI05-0299-1} Input and output operations are expressed as
74884 operations on objects of some file type, rather than directly in terms
74885 of the external files. In the remainder of this clause, the term file
74886 is always used to refer to a file object; the term external file is used
74887 otherwise.
74888
74889 3
74890 Input-output for sequential files of values of a single element type is
74891 defined by means of the generic package Sequential_IO. In order to
74892 define sequential input-output for a given element type, an
74893 instantiation of this generic unit, with the given type as actual
74894 parameter, has to be declared. The resulting package contains the
74895 declaration of a file type (called File_Type) for files of such
74896 elements, as well as the operations applicable to these files, such as
74897 the Open, Read, and Write procedures.
74898
74899 4/2
74900 {AI95-00285-01AI95-00285-01} Input-output for direct access files is
74901 likewise defined by a generic package called Direct_IO. Input-output in
74902 human-readable form is defined by the (nongeneric) packages Text_IO for
74903 Character and String data, Wide_Text_IO for Wide_Character and
74904 Wide_String data, and Wide_Wide_Text_IO for Wide_Wide_Character and
74905 Wide_Wide_String data. Input-output for files containing streams of
74906 elements representing values of possibly different types is defined by
74907 means of the (nongeneric) package Streams.Stream_IO.
74908
74909 5
74910 Before input or output operations can be performed on a file, the file
74911 first has to be associated with an external file. While such an
74912 association is in effect, the file is said to be open, and otherwise the
74913 file is said to be closed.
74914
74915 6
74916 The language does not define what happens to external files after the
74917 completion of the main program and all the library tasks (in particular,
74918 if corresponding files have not been closed). The effect of
74919 input-output for access types is unspecified.
74920
74921 7
74922 An open file has a current mode, which is a value of one of the
74923 following enumeration types:
74924
74925 8
74926 type File_Mode is (In_File, Inout_File, Out_File); -- for Direct_IO
74927
74928 9
74929 These values correspond respectively to the cases where only
74930 reading, both reading and writing, or only writing are to be
74931 performed.
74932
74933 10/2
74934 {AI95-00285-01AI95-00285-01} type File_Mode is (In_File, Out_File, Append_File);
74935 -- for Sequential_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, and Stream_IO
74936
74937 11
74938 These values correspond respectively to the cases where only
74939 reading, only writing, or only appending are to be performed.
74940
74941 12
74942 The mode of a file can be changed.
74943
74944 13/2
74945 {AI95-00285-01AI95-00285-01} Several file management operations are
74946 common to Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, and
74947 Wide_Wide_Text_IO. These operations are described in subclause *note
74948 A.8.2:: for sequential and direct files. Any additional effects
74949 concerning text input-output are described in subclause *note A.10.2::.
74950
74951 14/3
74952 {AI05-0299-1AI05-0299-1} The exceptions that can be propagated by the
74953 execution of an input-output subprogram are defined in the package
74954 IO_Exceptions; the situations in which they can be propagated are
74955 described following the description of the subprogram (and in subclause
74956 *note A.13::). The exceptions Storage_Error and Program_Error may be
74957 propagated. (Program_Error can only be propagated due to errors made by
74958 the caller of the subprogram.) Finally, exceptions can be propagated in
74959 certain implementation-defined situations.
74960
74961 14.a/2
74962 This paragraph was deleted.
74963
74964 14.b/2
74965 Discussion: The last sentence here is referring to the
74966 documentation requirements in *note A.13::, "*note A.13::
74967 Exceptions in Input-Output", and the documentation summary
74968 item is provided there.
74969
74970 NOTES
74971
74972 15/2
74973 23 {AI95-00285-01AI95-00285-01} Each instantiation of the generic
74974 packages Sequential_IO and Direct_IO declares a different type
74975 File_Type. In the case of Text_IO, Wide_Text_IO,
74976 Wide_Wide_Text_IO, and Streams.Stream_IO, the corresponding type
74977 File_Type is unique.
74978
74979 16
74980 24 A bidirectional device can often be modeled as two sequential
74981 files associated with the device, one of mode In_File, and one of
74982 mode Out_File. An implementation may restrict the number of files
74983 that may be associated with a given external file.
74984
74985 _Wording Changes from Ada 95_
74986
74987 16.a/2
74988 {AI95-00285-01AI95-00285-01} Included package
74989 Wide_Wide_Text_IO in this description.
74990
74991 \1f
74992 File: aarm2012.info, Node: A.8, Next: A.9, Prev: A.7, Up: Annex A
74993
74994 A.8 Sequential and Direct Files
74995 ===============================
74996
74997 _Static Semantics_
74998
74999 1/2
75000 {AI95-00283-01AI95-00283-01} Two kinds of access to external files are
75001 defined in this subclause: sequential access and direct access. The
75002 corresponding file types and the associated operations are provided by
75003 the generic packages Sequential_IO and Direct_IO. A file object to be
75004 used for sequential access is called a sequential file, and one to be
75005 used for direct access is called a direct file. Access to stream files
75006 is described in *note A.12.1::.
75007
75008 2
75009 For sequential access, the file is viewed as a sequence of values that
75010 are transferred in the order of their appearance (as produced by the
75011 program or by the external environment). When the file is opened with
75012 mode In_File or Out_File, transfer starts respectively from or to the
75013 beginning of the file. When the file is opened with mode Append_File,
75014 transfer to the file starts after the last element of the file.
75015
75016 2.a
75017 Discussion: Adding stream I/O necessitates a review of the
75018 terminology. In Ada 83, 'sequential' implies both the access
75019 method (purely sequential -- that is, no indexing or
75020 positional access) and homogeneity. Direct access includes
75021 purely sequential access and indexed access, as well as
75022 homogeneity. In Ada 95, streams allow purely sequential
75023 access but also positional access to an individual element,
75024 and are heterogeneous. We considered generalizing the notion
75025 of 'sequential file' to include both Sequential_IO and
75026 Stream_IO files, but since streams allow positional access it
75027 seems misleading to call them sequential files. Or, looked at
75028 differently, if the criterion for calling something a
75029 sequential file is whether it permits (versus requires) purely
75030 sequential access, then one could just as soon regard a
75031 Direct_IO file as a sequential file.
75032
75033 2.b
75034 It seems better to regard 'sequential file' as meaning 'only
75035 permitting purely sequential access'; hence we have decided to
75036 supplement 'sequential access' and 'direct access' with a
75037 third category, informally called 'access to streams'. (We
75038 decided against the term 'stream access' because of possible
75039 confusion with the Stream_Access type declared in one of the
75040 stream packages.)
75041
75042 3
75043 For direct access, the file is viewed as a set of elements occupying
75044 consecutive positions in linear order; a value can be transferred to or
75045 from an element of the file at any selected position. The position of
75046 an element is specified by its index, which is a number, greater than
75047 zero, of the implementation-defined integer type Count. The first
75048 element, if any, has index one; the index of the last element, if any,
75049 is called the current size; the current size is zero if there are no
75050 elements. The current size is a property of the external file.
75051
75052 4
75053 An open direct file has a current index, which is the index that will be
75054 used by the next read or write operation. When a direct file is opened,
75055 the current index is set to one. The current index of a direct file is
75056 a property of a file object, not of an external file.
75057
75058 _Wording Changes from Ada 95_
75059
75060 4.a/2
75061 {AI95-00283-01AI95-00283-01} Italicized "stream file" to
75062 clarify that this is another kind of file.
75063
75064 * Menu:
75065
75066 * A.8.1 :: The Generic Package Sequential_IO
75067 * A.8.2 :: File Management
75068 * A.8.3 :: Sequential Input-Output Operations
75069 * A.8.4 :: The Generic Package Direct_IO
75070 * A.8.5 :: Direct Input-Output Operations
75071
75072 \1f
75073 File: aarm2012.info, Node: A.8.1, Next: A.8.2, Up: A.8
75074
75075 A.8.1 The Generic Package Sequential_IO
75076 ---------------------------------------
75077
75078 _Static Semantics_
75079
75080 1
75081 The generic library package Sequential_IO has the following declaration:
75082
75083 2
75084 with Ada.IO_Exceptions;
75085 generic
75086 type Element_Type(<>) is private;
75087 package Ada.Sequential_IO is
75088
75089 3
75090 type File_Type is limited private;
75091
75092 4
75093 type File_Mode is (In_File, Out_File, Append_File);
75094
75095 5
75096 -- File management
75097
75098 6
75099 procedure Create(File : in out File_Type;
75100 Mode : in File_Mode := Out_File;
75101 Name : in String := "";
75102 Form : in String := "");
75103
75104 7
75105 procedure Open (File : in out File_Type;
75106 Mode : in File_Mode;
75107 Name : in String;
75108 Form : in String := "");
75109
75110 8
75111 procedure Close (File : in out File_Type);
75112 procedure Delete(File : in out File_Type);
75113 procedure Reset (File : in out File_Type; Mode : in File_Mode);
75114 procedure Reset (File : in out File_Type);
75115
75116 9
75117 function Mode (File : in File_Type) return File_Mode;
75118 function Name (File : in File_Type) return String;
75119 function Form (File : in File_Type) return String;
75120
75121 10
75122 function Is_Open(File : in File_Type) return Boolean;
75123
75124 11
75125 -- Input and output operations
75126
75127 12
75128 procedure Read (File : in File_Type; Item : out Element_Type);
75129 procedure Write (File : in File_Type; Item : in Element_Type);
75130
75131 13
75132 function End_Of_File(File : in File_Type) return Boolean;
75133
75134 14
75135 -- Exceptions
75136
75137 15
75138 Status_Error : exception renames IO_Exceptions.Status_Error;
75139 Mode_Error : exception renames IO_Exceptions.Mode_Error;
75140 Name_Error : exception renames IO_Exceptions.Name_Error;
75141 Use_Error : exception renames IO_Exceptions.Use_Error;
75142 Device_Error : exception renames IO_Exceptions.Device_Error;
75143 End_Error : exception renames IO_Exceptions.End_Error;
75144 Data_Error : exception renames IO_Exceptions.Data_Error;
75145
75146 16
75147 private
75148 ... -- not specified by the language
75149 end Ada.Sequential_IO;
75150
75151 17/2
75152 {AI95-00360-01AI95-00360-01} The type File_Type needs finalization (see
75153 *note 7.6::) in every instantiation of Sequential_IO.
75154
75155 _Incompatibilities With Ada 83_
75156
75157 17.a
75158 The new enumeration element Append_File may introduce upward
75159 incompatibilities. It is possible that a program based on the
75160 assumption that File_Mode'Last = Out_File will be illegal
75161 (e.g., case statement choice coverage) or execute with a
75162 different effect in Ada 95.
75163
75164 17.a.1/2
75165 This paragraph was deleted.{8652/00978652/0097}
75166 {AI95-00115-01AI95-00115-01} {AI95-00344-01AI95-00344-01}
75167
75168 _Incompatibilities With Ada 95_
75169
75170 17.b/2
75171 {AI95-00360-01AI95-00360-01} Amendment Correction: File_Type
75172 in an instance of Sequential_IO is defined to need
75173 finalization. If the restriction No_Nested_Finalization (see
75174 *note D.7::) applies to the partition, and File_Type does not
75175 have a controlled part, it will not be allowed in local
75176 objects in Ada 2005 whereas it would be allowed in original
75177 Ada 95. Such code is not portable, as another Ada compiler
75178 may have a controlled part in File_Type, and thus would be
75179 illegal.
75180
75181 \1f
75182 File: aarm2012.info, Node: A.8.2, Next: A.8.3, Prev: A.8.1, Up: A.8
75183
75184 A.8.2 File Management
75185 ---------------------
75186
75187 _Static Semantics_
75188
75189 1
75190 The procedures and functions described in this subclause provide for the
75191 control of external files; their declarations are repeated in each of
75192 the packages for sequential, direct, text, and stream input-output. For
75193 text input-output, the procedures Create, Open, and Reset have
75194 additional effects described in subclause *note A.10.2::.
75195
75196 2
75197 procedure Create(File : in out File_Type;
75198 Mode : in File_Mode := default_mode;
75199 Name : in String := "";
75200 Form : in String := "");
75201
75202 3/2
75203 {AI95-00283-01AI95-00283-01} Establishes a new external file,
75204 with the given name and form, and associates this external
75205 file with the given file. The given file is left open. The
75206 current mode of the given file is set to the given access
75207 mode. The default access mode is the mode Out_File for
75208 sequential, stream, and text input-output; it is the mode
75209 Inout_File for direct input-output. For direct access, the
75210 size of the created file is implementation defined.
75211
75212 4
75213 A null string for Name specifies an external file that is not
75214 accessible after the completion of the main program (a
75215 temporary file). A null string for Form specifies the use of
75216 the default options of the implementation for the external
75217 file.
75218
75219 5
75220 The exception Status_Error is propagated if the given file is
75221 already open. The exception Name_Error is propagated if the
75222 string given as Name does not allow the identification of an
75223 external file. The exception Use_Error is propagated if, for
75224 the specified mode, the external environment does not support
75225 creation of an external file with the given name (in the
75226 absence of Name_Error) and form.
75227
75228 6
75229 procedure Open(File : in out File_Type;
75230 Mode : in File_Mode;
75231 Name : in String;
75232 Form : in String := "");
75233
75234 7
75235 Associates the given file with an existing external file
75236 having the given name and form, and sets the current mode of
75237 the given file to the given mode. The given file is left
75238 open.
75239
75240 8
75241 The exception Status_Error is propagated if the given file is
75242 already open. The exception Name_Error is propagated if the
75243 string given as Name does not allow the identification of an
75244 external file; in particular, this exception is propagated if
75245 no external file with the given name exists. The exception
75246 Use_Error is propagated if, for the specified mode, the
75247 external environment does not support opening for an external
75248 file with the given name (in the absence of Name_Error) and
75249 form.
75250
75251 9
75252 procedure Close(File : in out File_Type);
75253
75254 10
75255 Severs the association between the given file and its
75256 associated external file. The given file is left closed. In
75257 addition, for sequential files, if the file being closed has
75258 mode Out_File or Append_File, then the last element written
75259 since the most recent open or reset is the last element that
75260 can be read from the file. If no elements have been written
75261 and the file mode is Out_File, then the closed file is empty.
75262 If no elements have been written and the file mode is
75263 Append_File, then the closed file is unchanged.
75264
75265 11
75266 The exception Status_Error is propagated if the given file is
75267 not open.
75268
75269 12
75270 procedure Delete(File : in out File_Type);
75271
75272 13
75273 Deletes the external file associated with the given file. The
75274 given file is closed, and the external file ceases to exist.
75275
75276 14
75277 The exception Status_Error is propagated if the given file is
75278 not open. The exception Use_Error is propagated if deletion
75279 of the external file is not supported by the external
75280 environment.
75281
75282 15
75283 procedure Reset(File : in out File_Type; Mode : in File_Mode);
75284 procedure Reset(File : in out File_Type);
75285
75286 16/2
75287 {AI95-00085-01AI95-00085-01} Resets the given file so that
75288 reading from its elements can be restarted from the beginning
75289 of the external file (for modes In_File and Inout_File), and
75290 so that writing to its elements can be restarted at the
75291 beginning of the external file (for modes Out_File and
75292 Inout_File) or after the last element of the external file
75293 (for mode Append_File). In particular, for direct access this
75294 means that the current index is set to one. If a Mode
75295 parameter is supplied, the current mode of the given file is
75296 set to the given mode. In addition, for sequential files, if
75297 the given file has mode Out_File or Append_File when Reset is
75298 called, the last element written since the most recent open or
75299 reset is the last element that can be read from the external
75300 file. If no elements have been written and the file mode is
75301 Out_File, the reset file is empty. If no elements have been
75302 written and the file mode is Append_File, then the reset file
75303 is unchanged.
75304
75305 17
75306 The exception Status_Error is propagated if the file is not
75307 open. The exception Use_Error is propagated if the external
75308 environment does not support resetting for the external file
75309 and, also, if the external environment does not support
75310 resetting to the specified mode for the external file.
75311
75312 18
75313 function Mode(File : in File_Type) return File_Mode;
75314
75315 19
75316 Returns the current mode of the given file.
75317
75318 20
75319 The exception Status_Error is propagated if the file is not
75320 open.
75321
75322 21
75323 function Name(File : in File_Type) return String;
75324
75325 22/2
75326 {AI95-00248-01AI95-00248-01} Returns a string which uniquely
75327 identifies the external file currently associated with the
75328 given file (and may thus be used in an Open operation).
75329
75330 22.a/2
75331 Discussion: {AI95-00248-01AI95-00248-01} Retrieving the full
75332 path can be accomplished by passing the result of Name to
75333 Directories.Full_Name (see *note A.16::). It is important to
75334 drop the requirement on Name, as the only way to accomplish
75335 this requirement given that the current directory can be
75336 changed with package Directories is to store the full path
75337 when the file is opened. That's expensive, and it's better
75338 for users that need the full path to explicitly request it.
75339
75340 23
75341 The exception Status_Error is propagated if the given file is
75342 not open. The exception Use_Error is propagated if the
75343 associated external file is a temporary file that cannot be
75344 opened by any name.
75345
75346 24
75347 function Form(File : in File_Type) return String;
75348
75349 25
75350 Returns the form string for the external file currently
75351 associated with the given file. If an external environment
75352 allows alternative specifications of the form (for example,
75353 abbreviations using default options), the string returned by
75354 the function should correspond to a full specification (that
75355 is, it should indicate explicitly all options selected,
75356 including default options).
75357
75358 26
75359 The exception Status_Error is propagated if the given file is
75360 not open.
75361
75362 27
75363 function Is_Open(File : in File_Type) return Boolean;
75364
75365 28/3
75366 {AI05-0264-1AI05-0264-1} Returns True if the file is open
75367 (that is, if it is associated with an external file);
75368 otherwise, returns False.
75369
75370 _Implementation Permissions_
75371
75372 29
75373 An implementation may propagate Name_Error or Use_Error if an attempt is
75374 made to use an I/O feature that cannot be supported by the
75375 implementation due to limitations in the external environment. Any such
75376 restriction should be documented.
75377
75378 _Wording Changes from Ada 95_
75379
75380 29.a/2
75381 {AI95-00085-01AI95-00085-01} Clarified that Reset affects and
75382 depends on the external file.
75383
75384 29.b/2
75385 {AI95-00248-01AI95-00248-01} Removed the requirement for Name
75386 to return a full path; this is now accomplished by
75387 Directories.Full_Name(Name(File)) (see *note A.16::). This is
75388 not documented as an inconsistency, because there is no
75389 requirement for implementations to change -- the Ada 95
75390 behavior is still allowed, it just is no longer required.
75391
75392 29.c/2
75393 {AI95-00283-01AI95-00283-01} Added text to specify the default
75394 mode for a stream file.
75395
75396 \1f
75397 File: aarm2012.info, Node: A.8.3, Next: A.8.4, Prev: A.8.2, Up: A.8
75398
75399 A.8.3 Sequential Input-Output Operations
75400 ----------------------------------------
75401
75402 _Static Semantics_
75403
75404 1
75405 The operations available for sequential input and output are described
75406 in this subclause. The exception Status_Error is propagated if any of
75407 these operations is attempted for a file that is not open.
75408
75409 2
75410 procedure Read(File : in File_Type; Item : out Element_Type);
75411
75412 3
75413 Operates on a file of mode In_File. Reads an element from the
75414 given file, and returns the value of this element in the Item
75415 parameter.
75416
75417 3.a
75418 Discussion: We considered basing Sequential_IO.Read on
75419 Element_Type'Read from an implicit stream associated with the
75420 sequential file. However, Element_Type'Read is a type-related
75421 attribute, whereas Sequential_IO should take advantage of the
75422 particular constraints of the actual subtype corresponding to
75423 Element_Type to minimize the size of the external file.
75424 Furthermore, forcing the implementation of Sequential_IO to be
75425 based on Element_Type'Read would create an upward
75426 incompatibility since existing data files written by an Ada 83
75427 program using Sequential_IO might not be readable by the
75428 identical program built with an Ada 95 implementation of
75429 Sequential_IO.
75430
75431 3.b
75432 An Ada 95 implementation might still use an
75433 implementation-defined attribute analogous to 'Read to
75434 implement the procedure Read, but that attribute will likely
75435 have to be subtype-specific rather than type-related, and it
75436 need not be user-specifiable. Such an attribute will
75437 presumably be needed to implement the generic package
75438 Storage_IO (see *note A.9::).
75439
75440 4
75441 The exception Mode_Error is propagated if the mode is not
75442 In_File. The exception End_Error is propagated if no more
75443 elements can be read from the given file. The exception
75444 Data_Error can be propagated if the element read cannot be
75445 interpreted as a value of the subtype Element_Type (see *note
75446 A.13::, "*note A.13:: Exceptions in Input-Output").
75447
75448 4.a
75449 Discussion: Data_Error need not be propagated if the check is
75450 too complex. See *note A.13::, "*note A.13:: Exceptions in
75451 Input-Output".
75452
75453 5
75454 procedure Write(File : in File_Type; Item : in Element_Type);
75455
75456 6
75457 Operates on a file of mode Out_File or Append_File. Writes
75458 the value of Item to the given file.
75459
75460 7
75461 The exception Mode_Error is propagated if the mode is not
75462 Out_File or Append_File. The exception Use_Error is
75463 propagated if the capacity of the external file is exceeded.
75464
75465 8
75466 function End_Of_File(File : in File_Type) return Boolean;
75467
75468 9/3
75469 {AI05-0264-1AI05-0264-1} Operates on a file of mode In_File.
75470 Returns True if no more elements can be read from the given
75471 file; otherwise, returns False.
75472
75473 10
75474 The exception Mode_Error is propagated if the mode is not
75475 In_File.
75476
75477 \1f
75478 File: aarm2012.info, Node: A.8.4, Next: A.8.5, Prev: A.8.3, Up: A.8
75479
75480 A.8.4 The Generic Package Direct_IO
75481 -----------------------------------
75482
75483 _Static Semantics_
75484
75485 1
75486 The generic library package Direct_IO has the following declaration:
75487
75488 2
75489 with Ada.IO_Exceptions;
75490 generic
75491 type Element_Type is private;
75492 package Ada.Direct_IO is
75493
75494 3
75495 type File_Type is limited private;
75496
75497 4
75498 type File_Mode is (In_File, Inout_File, Out_File);
75499 type Count is range 0 .. implementation-defined;
75500 subtype Positive_Count is Count range 1 .. Count'Last;
75501
75502 5
75503 -- File management
75504
75505 6
75506 procedure Create(File : in out File_Type;
75507 Mode : in File_Mode := Inout_File;
75508 Name : in String := "";
75509 Form : in String := "");
75510
75511 7
75512 procedure Open (File : in out File_Type;
75513 Mode : in File_Mode;
75514 Name : in String;
75515 Form : in String := "");
75516
75517 8
75518 procedure Close (File : in out File_Type);
75519 procedure Delete(File : in out File_Type);
75520 procedure Reset (File : in out File_Type; Mode : in File_Mode);
75521 procedure Reset (File : in out File_Type);
75522
75523 9
75524 function Mode (File : in File_Type) return File_Mode;
75525 function Name (File : in File_Type) return String;
75526 function Form (File : in File_Type) return String;
75527
75528 10
75529 function Is_Open(File : in File_Type) return Boolean;
75530
75531 11
75532 -- Input and output operations
75533
75534 12
75535 procedure Read (File : in File_Type; Item : out Element_Type;
75536 From : in Positive_Count);
75537 procedure Read (File : in File_Type; Item : out Element_Type);
75538
75539 13
75540 procedure Write(File : in File_Type; Item : in Element_Type;
75541 To : in Positive_Count);
75542 procedure Write(File : in File_Type; Item : in Element_Type);
75543
75544 14
75545 procedure Set_Index(File : in File_Type; To : in Positive_Count);
75546
75547 15
75548 function Index(File : in File_Type) return Positive_Count;
75549 function Size (File : in File_Type) return Count;
75550
75551 16
75552 function End_Of_File(File : in File_Type) return Boolean;
75553
75554 17
75555 -- Exceptions
75556
75557 18
75558 Status_Error : exception renames IO_Exceptions.Status_Error;
75559 Mode_Error : exception renames IO_Exceptions.Mode_Error;
75560 Name_Error : exception renames IO_Exceptions.Name_Error;
75561 Use_Error : exception renames IO_Exceptions.Use_Error;
75562 Device_Error : exception renames IO_Exceptions.Device_Error;
75563 End_Error : exception renames IO_Exceptions.End_Error;
75564 Data_Error : exception renames IO_Exceptions.Data_Error;
75565
75566 19
75567 private
75568 ... -- not specified by the language
75569 end Ada.Direct_IO;
75570
75571 19.a
75572 Reason: The Element_Type formal of Direct_IO does not have an
75573 unknown_discriminant_part (unlike Sequential_IO) so that the
75574 implementation can make use of the ability to declare
75575 uninitialized variables of the type.
75576
75577 20/2
75578 {AI95-00360-01AI95-00360-01} The type File_Type needs finalization (see
75579 *note 7.6::) in every instantiation of Direct_IO.
75580
75581 20.a.1/2
75582 This paragraph was deleted.{8652/00978652/0097}
75583 {AI95-00115-01AI95-00115-01} {AI95-00344-01AI95-00344-01}
75584
75585 _Incompatibilities With Ada 95_
75586
75587 20.a/2
75588 {AI95-00360-01AI95-00360-01} Amendment Correction: File_Type
75589 in an instance of Direct_IO is defined to need finalization.
75590 If the restriction No_Nested_Finalization (see *note D.7::)
75591 applies to the partition, and File_Type does not have a
75592 controlled part, it will not be allowed in local objects in
75593 Ada 2005 whereas it would be allowed in original Ada 95. Such
75594 code is not portable, as another Ada compiler may have a
75595 controlled part in File_Type, and thus would be illegal.
75596
75597 \1f
75598 File: aarm2012.info, Node: A.8.5, Prev: A.8.4, Up: A.8
75599
75600 A.8.5 Direct Input-Output Operations
75601 ------------------------------------
75602
75603 _Static Semantics_
75604
75605 1
75606 The operations available for direct input and output are described in
75607 this subclause. The exception Status_Error is propagated if any of
75608 these operations is attempted for a file that is not open.
75609
75610 2
75611 procedure Read(File : in File_Type; Item : out Element_Type;
75612 From : in Positive_Count);
75613 procedure Read(File : in File_Type; Item : out Element_Type);
75614
75615 3
75616 Operates on a file of mode In_File or Inout_File. In the case
75617 of the first form, sets the current index of the given file to
75618 the index value given by the parameter From. Then (for both
75619 forms) returns, in the parameter Item, the value of the
75620 element whose position in the given file is specified by the
75621 current index of the file; finally, increases the current
75622 index by one.
75623
75624 4
75625 The exception Mode_Error is propagated if the mode of the
75626 given file is Out_File. The exception End_Error is propagated
75627 if the index to be used exceeds the size of the external file.
75628 The exception Data_Error can be propagated if the element read
75629 cannot be interpreted as a value of the subtype Element_Type
75630 (see *note A.13::).
75631
75632 5
75633 procedure Write(File : in File_Type; Item : in Element_Type;
75634 To : in Positive_Count);
75635 procedure Write(File : in File_Type; Item : in Element_Type);
75636
75637 6
75638 Operates on a file of mode Inout_File or Out_File. In the
75639 case of the first form, sets the index of the given file to
75640 the index value given by the parameter To. Then (for both
75641 forms) gives the value of the parameter Item to the element
75642 whose position in the given file is specified by the current
75643 index of the file; finally, increases the current index by
75644 one.
75645
75646 7
75647 The exception Mode_Error is propagated if the mode of the
75648 given file is In_File. The exception Use_Error is propagated
75649 if the capacity of the external file is exceeded.
75650
75651 8
75652 procedure Set_Index(File : in File_Type; To : in Positive_Count);
75653
75654 9
75655 Operates on a file of any mode. Sets the current index of the
75656 given file to the given index value (which may exceed the
75657 current size of the file).
75658
75659 10
75660 function Index(File : in File_Type) return Positive_Count;
75661
75662 11
75663 Operates on a file of any mode. Returns the current index of
75664 the given file.
75665
75666 12
75667 function Size(File : in File_Type) return Count;
75668
75669 13
75670 Operates on a file of any mode. Returns the current size of
75671 the external file that is associated with the given file.
75672
75673 14
75674 function End_Of_File(File : in File_Type) return Boolean;
75675
75676 15/3
75677 {AI05-0264-1AI05-0264-1} Operates on a file of mode In_File or
75678 Inout_File. Returns True if the current index exceeds the
75679 size of the external file; otherwise, returns False.
75680
75681 16
75682 The exception Mode_Error is propagated if the mode of the
75683 given file is Out_File.
75684
75685 NOTES
75686
75687 17
75688 25 Append_File mode is not supported for the generic package
75689 Direct_IO.
75690
75691 \1f
75692 File: aarm2012.info, Node: A.9, Next: A.10, Prev: A.8, Up: Annex A
75693
75694 A.9 The Generic Package Storage_IO
75695 ==================================
75696
75697 1
75698 The generic package Storage_IO provides for reading from and writing to
75699 an in-memory buffer. This generic package supports the construction of
75700 user-defined input-output packages.
75701
75702 1.a
75703 Reason: This package exists to allow the portable construction
75704 of user-defined direct-access-oriented input-output packages.
75705 The Write procedure writes a value of type Element_Type into a
75706 Storage_Array of size Buffer_Size, flattening out any implicit
75707 levels of indirection used in the representation of the type.
75708 The Read procedure reads a value of type Element_Type from the
75709 buffer, reconstructing any implicit levels of indirection used
75710 in the representation of the type. It also properly
75711 initializes any type tags that appear within the value,
75712 presuming that the buffer was written by a different program
75713 and that tag values for the"same" type might vary from one
75714 executable to another.
75715
75716 _Static Semantics_
75717
75718 2
75719 The generic library package Storage_IO has the following declaration:
75720
75721 3
75722 with Ada.IO_Exceptions;
75723 with System.Storage_Elements;
75724 generic
75725 type Element_Type is private;
75726 package Ada.Storage_IO is
75727 pragma Preelaborate(Storage_IO);
75728
75729 4
75730 Buffer_Size : constant System.Storage_Elements.Storage_Count :=
75731 implementation-defined;
75732 subtype Buffer_Type is
75733 System.Storage_Elements.Storage_Array(1..Buffer_Size);
75734
75735 5
75736 -- Input and output operations
75737
75738 6
75739 procedure Read (Buffer : in Buffer_Type; Item : out Element_Type);
75740
75741 7
75742 procedure Write(Buffer : out Buffer_Type; Item : in Element_Type);
75743
75744 8
75745 -- Exceptions
75746
75747 9
75748 Data_Error : exception renames IO_Exceptions.Data_Error;
75749 end Ada.Storage_IO;
75750
75751 10
75752 In each instance, the constant Buffer_Size has a value that is the size
75753 (in storage elements) of the buffer required to represent the content of
75754 an object of subtype Element_Type, including any implicit levels of
75755 indirection used by the implementation. The Read and Write procedures
75756 of Storage_IO correspond to the Read and Write procedures of Direct_IO
75757 (see *note A.8.4::), but with the content of the Item parameter being
75758 read from or written into the specified Buffer, rather than an external
75759 file.
75760
75761 10.a
75762 Reason: As with Direct_IO, the Element_Type formal of
75763 Storage_IO does not have an unknown_discriminant_part so that
75764 there is a well-defined upper bound on the size of the buffer
75765 needed to hold the content of an object of the formal subtype
75766 (i.e. Buffer_Size). If there are no implicit levels of
75767 indirection, Buffer_Size will typically equal:
75768
75769 10.b
75770 (Element_Type'Size + System.Storage_Unit - 1) / System.Storage_Unit
75771
75772 10.c
75773 Implementation defined: The value of Buffer_Size in
75774 Storage_IO.
75775
75776 NOTES
75777
75778 11
75779 26 A buffer used for Storage_IO holds only one element at a time;
75780 an external file used for Direct_IO holds a sequence of elements.
75781
75782 _Extensions to Ada 83_
75783
75784 11.a/3
75785 {AI05-0005-1AI05-0005-1} Storage_IO is new in Ada 95.
75786
75787 \1f
75788 File: aarm2012.info, Node: A.10, Next: A.11, Prev: A.9, Up: Annex A
75789
75790 A.10 Text Input-Output
75791 ======================
75792
75793 _Static Semantics_
75794
75795 1/3
75796 {AI05-0299-1AI05-0299-1} This subclause describes the package Text_IO,
75797 which provides facilities for input and output in human-readable form.
75798 Each file is read or written sequentially, as a sequence of characters
75799 grouped into lines, and as a sequence of lines grouped into pages. The
75800 specification of the package is given below in subclause *note A.10.1::.
75801
75802 2/3
75803 {AI05-0299-1AI05-0299-1} The facilities for file management given above,
75804 in subclauses *note A.8.2:: and *note A.8.3::, are available for text
75805 input-output. In place of Read and Write, however, there are procedures
75806 Get and Put that input values of suitable types from text files, and
75807 output values to them. These values are provided to the Put procedures,
75808 and returned by the Get procedures, in a parameter Item. Several
75809 overloaded procedures of these names exist, for different types of Item.
75810 These Get procedures analyze the input sequences of characters based on
75811 lexical elements (see Clause *note 2::) and return the corresponding
75812 values; the Put procedures output the given values as appropriate
75813 lexical elements. Procedures Get and Put are also available that input
75814 and output individual characters treated as character values rather than
75815 as lexical elements. Related to character input are procedures to look
75816 ahead at the next character without reading it, and to read a character
75817 "immediately" without waiting for an end-of-line to signal availability.
75818
75819 3
75820 In addition to the procedures Get and Put for numeric and enumeration
75821 types of Item that operate on text files, analogous procedures are
75822 provided that read from and write to a parameter of type String. These
75823 procedures perform the same analysis and composition of character
75824 sequences as their counterparts which have a file parameter.
75825
75826 4
75827 For all Get and Put procedures that operate on text files, and for many
75828 other subprograms, there are forms with and without a file parameter.
75829 Each such Get procedure operates on an input file, and each such Put
75830 procedure operates on an output file. If no file is specified, a
75831 default input file or a default output file is used.
75832
75833 5
75834 At the beginning of program execution the default input and output files
75835 are the so-called standard input file and standard output file. These
75836 files are open, have respectively the current modes In_File and
75837 Out_File, and are associated with two implementation-defined external
75838 files. Procedures are provided to change the current default input file
75839 and the current default output file.
75840
75841 5.a/2
75842 Implementation defined: The external files associated with the
75843 standard input, standard output, and standard error files.
75844
75845 5.a.1/1
75846 Implementation Note: {8652/01138652/0113}
75847 {AI95-00087-01AI95-00087-01} The default input file and
75848 default output file are not the names of distinct file
75849 objects, but rather the role played by one or more (other)
75850 file object(s). Thus, they generally will be implemented as
75851 accesses to another file object. An implementation that
75852 implements them by copying them is incorrect.
75853
75854 6
75855 At the beginning of program execution a default file for
75856 program-dependent error-related text output is the so-called standard
75857 error file. This file is open, has the current mode Out_File, and is
75858 associated with an implementation-defined external file. A procedure is
75859 provided to change the current default error file.
75860
75861 7
75862 From a logical point of view, a text file is a sequence of pages, a page
75863 is a sequence of lines, and a line is a sequence of characters; the end
75864 of a line is marked by a line terminator; the end of a page is marked by
75865 the combination of a line terminator immediately followed by a page
75866 terminator; and the end of a file is marked by the combination of a line
75867 terminator immediately followed by a page terminator and then a file
75868 terminator. Terminators are generated during output; either by calls of
75869 procedures provided expressly for that purpose; or implicitly as part of
75870 other operations, for example, when a bounded line length, a bounded
75871 page length, or both, have been specified for a file.
75872
75873 8
75874 The actual nature of terminators is not defined by the language and
75875 hence depends on the implementation. Although terminators are
75876 recognized or generated by certain of the procedures that follow, they
75877 are not necessarily implemented as characters or as sequences of
75878 characters. Whether they are characters (and if so which ones) in any
75879 particular implementation need not concern a user who neither explicitly
75880 outputs nor explicitly inputs control characters. The effect of input
75881 (Get) or output (Put) of control characters (other than horizontal
75882 tabulation) is not specified by the language.
75883
75884 9
75885 The characters of a line are numbered, starting from one; the number of
75886 a character is called its column number. For a line terminator, a
75887 column number is also defined: it is one more than the number of
75888 characters in the line. The lines of a page, and the pages of a file,
75889 are similarly numbered. The current column number is the column number
75890 of the next character or line terminator to be transferred. The current
75891 line number is the number of the current line. The current page number
75892 is the number of the current page. These numbers are values of the
75893 subtype Positive_Count of the type Count (by convention, the value zero
75894 of the type Count is used to indicate special conditions).
75895
75896 10
75897 type Count is range 0 .. implementation-defined;
75898 subtype Positive_Count is Count range 1 .. Count'Last;
75899
75900 11
75901 For an output file or an append file, a maximum line length can be
75902 specified and a maximum page length can be specified. If a value to be
75903 output cannot fit on the current line, for a specified maximum line
75904 length, then a new line is automatically started before the value is
75905 output; if, further, this new line cannot fit on the current page, for a
75906 specified maximum page length, then a new page is automatically started
75907 before the value is output. Functions are provided to determine the
75908 maximum line length and the maximum page length. When a file is opened
75909 with mode Out_File or Append_File, both values are zero: by convention,
75910 this means that the line lengths and page lengths are unbounded.
75911 (Consequently, output consists of a single line if the subprograms for
75912 explicit control of line and page structure are not used.) The constant
75913 Unbounded is provided for this purpose.
75914
75915 _Extensions to Ada 83_
75916
75917 11.a
75918 Append_File is new in Ada 95.
75919
75920 * Menu:
75921
75922 * A.10.1 :: The Package Text_IO
75923 * A.10.2 :: Text File Management
75924 * A.10.3 :: Default Input, Output, and Error Files
75925 * A.10.4 :: Specification of Line and Page Lengths
75926 * A.10.5 :: Operations on Columns, Lines, and Pages
75927 * A.10.6 :: Get and Put Procedures
75928 * A.10.7 :: Input-Output of Characters and Strings
75929 * A.10.8 :: Input-Output for Integer Types
75930 * A.10.9 :: Input-Output for Real Types
75931 * A.10.10 :: Input-Output for Enumeration Types
75932 * A.10.11 :: Input-Output for Bounded Strings
75933 * A.10.12 :: Input-Output for Unbounded Strings
75934
75935 \1f
75936 File: aarm2012.info, Node: A.10.1, Next: A.10.2, Up: A.10
75937
75938 A.10.1 The Package Text_IO
75939 --------------------------
75940
75941 _Static Semantics_
75942
75943 1
75944 The library package Text_IO has the following declaration:
75945
75946 2
75947 with Ada.IO_Exceptions;
75948 package Ada.Text_IO is
75949
75950 3
75951 type File_Type is limited private;
75952
75953 4
75954 type File_Mode is (In_File, Out_File, Append_File);
75955
75956 5
75957 type Count is range 0 .. implementation-defined;
75958 subtype Positive_Count is Count range 1 .. Count'Last;
75959 Unbounded : constant Count := 0; -- line and page length
75960
75961 6
75962 subtype Field is Integer range 0 .. implementation-defined;
75963 subtype Number_Base is Integer range 2 .. 16;
75964
75965 7
75966 type Type_Set is (Lower_Case, Upper_Case);
75967
75968 8
75969 -- File Management
75970
75971 9
75972 procedure Create (File : in out File_Type;
75973 Mode : in File_Mode := Out_File;
75974 Name : in String := "";
75975 Form : in String := "");
75976
75977 10
75978 procedure Open (File : in out File_Type;
75979 Mode : in File_Mode;
75980 Name : in String;
75981 Form : in String := "");
75982
75983 11
75984 procedure Close (File : in out File_Type);
75985 procedure Delete (File : in out File_Type);
75986 procedure Reset (File : in out File_Type; Mode : in File_Mode);
75987 procedure Reset (File : in out File_Type);
75988
75989 12
75990 function Mode (File : in File_Type) return File_Mode;
75991 function Name (File : in File_Type) return String;
75992 function Form (File : in File_Type) return String;
75993
75994 13
75995 function Is_Open(File : in File_Type) return Boolean;
75996
75997 14
75998 -- Control of default input and output files
75999
76000 15
76001 procedure Set_Input (File : in File_Type);
76002 procedure Set_Output(File : in File_Type);
76003 procedure Set_Error (File : in File_Type);
76004
76005 16
76006 function Standard_Input return File_Type;
76007 function Standard_Output return File_Type;
76008 function Standard_Error return File_Type;
76009
76010 17
76011 function Current_Input return File_Type;
76012 function Current_Output return File_Type;
76013 function Current_Error return File_Type;
76014
76015 18
76016 type File_Access is access constant File_Type;
76017
76018 19
76019 function Standard_Input return File_Access;
76020 function Standard_Output return File_Access;
76021 function Standard_Error return File_Access;
76022
76023 20
76024 function Current_Input return File_Access;
76025 function Current_Output return File_Access;
76026 function Current_Error return File_Access;
76027
76028 21/1
76029 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} --Buffer control
76030 procedure Flush (File : in File_Type);
76031 procedure Flush;
76032
76033 22
76034 -- Specification of line and page lengths
76035
76036 23
76037 procedure Set_Line_Length(File : in File_Type; To : in Count);
76038 procedure Set_Line_Length(To : in Count);
76039
76040 24
76041 procedure Set_Page_Length(File : in File_Type; To : in Count);
76042 procedure Set_Page_Length(To : in Count);
76043
76044 25
76045 function Line_Length(File : in File_Type) return Count;
76046 function Line_Length return Count;
76047
76048 26
76049 function Page_Length(File : in File_Type) return Count;
76050 function Page_Length return Count;
76051
76052 27
76053 -- Column, Line, and Page Control
76054
76055 28
76056 procedure New_Line (File : in File_Type;
76057 Spacing : in Positive_Count := 1);
76058 procedure New_Line (Spacing : in Positive_Count := 1);
76059
76060 29
76061 procedure Skip_Line (File : in File_Type;
76062 Spacing : in Positive_Count := 1);
76063 procedure Skip_Line (Spacing : in Positive_Count := 1);
76064
76065 30
76066 function End_Of_Line(File : in File_Type) return Boolean;
76067 function End_Of_Line return Boolean;
76068
76069 31
76070 procedure New_Page (File : in File_Type);
76071 procedure New_Page;
76072
76073 32
76074 procedure Skip_Page (File : in File_Type);
76075 procedure Skip_Page;
76076
76077 33
76078 function End_Of_Page(File : in File_Type) return Boolean;
76079 function End_Of_Page return Boolean;
76080
76081 34
76082 function End_Of_File(File : in File_Type) return Boolean;
76083 function End_Of_File return Boolean;
76084
76085 35
76086 procedure Set_Col (File : in File_Type; To : in Positive_Count);
76087 procedure Set_Col (To : in Positive_Count);
76088
76089 36
76090 procedure Set_Line(File : in File_Type; To : in Positive_Count);
76091 procedure Set_Line(To : in Positive_Count);
76092
76093 37
76094 function Col (File : in File_Type) return Positive_Count;
76095 function Col return Positive_Count;
76096
76097 38
76098 function Line(File : in File_Type) return Positive_Count;
76099 function Line return Positive_Count;
76100
76101 39
76102 function Page(File : in File_Type) return Positive_Count;
76103 function Page return Positive_Count;
76104
76105 40
76106 -- Character Input-Output
76107
76108 41
76109 procedure Get(File : in File_Type; Item : out Character);
76110 procedure Get(Item : out Character);
76111
76112 42
76113 procedure Put(File : in File_Type; Item : in Character);
76114 procedure Put(Item : in Character);
76115
76116 43
76117 procedure Look_Ahead (File : in File_Type;
76118 Item : out Character;
76119 End_Of_Line : out Boolean);
76120 procedure Look_Ahead (Item : out Character;
76121 End_Of_Line : out Boolean);
76122
76123 44
76124 procedure Get_Immediate(File : in File_Type;
76125 Item : out Character);
76126 procedure Get_Immediate(Item : out Character);
76127
76128 45
76129 procedure Get_Immediate(File : in File_Type;
76130 Item : out Character;
76131 Available : out Boolean);
76132 procedure Get_Immediate(Item : out Character;
76133 Available : out Boolean);
76134
76135 46
76136 -- String Input-Output
76137
76138 47
76139 procedure Get(File : in File_Type; Item : out String);
76140 procedure Get(Item : out String);
76141
76142 48
76143 procedure Put(File : in File_Type; Item : in String);
76144 procedure Put(Item : in String);
76145
76146 49
76147 procedure Get_Line(File : in File_Type;
76148 Item : out String;
76149 Last : out Natural);
76150 procedure Get_Line(Item : out String; Last : out Natural);
76151
76152 49.1/2
76153 {AI95-00301-01AI95-00301-01} function Get_Line(File : in File_Type) return String;
76154 function Get_Line return String;
76155
76156 50
76157 procedure Put_Line(File : in File_Type; Item : in String);
76158 procedure Put_Line(Item : in String);
76159
76160 51
76161 -- Generic packages for Input-Output of Integer Types
76162
76163 52
76164 generic
76165 type Num is range <>;
76166 package Integer_IO is
76167
76168 53
76169 Default_Width : Field := Num'Width;
76170 Default_Base : Number_Base := 10;
76171
76172 54
76173 procedure Get(File : in File_Type;
76174 Item : out Num;
76175 Width : in Field := 0);
76176 procedure Get(Item : out Num;
76177 Width : in Field := 0);
76178
76179 55
76180 procedure Put(File : in File_Type;
76181 Item : in Num;
76182 Width : in Field := Default_Width;
76183 Base : in Number_Base := Default_Base);
76184 procedure Put(Item : in Num;
76185 Width : in Field := Default_Width;
76186 Base : in Number_Base := Default_Base);
76187 procedure Get(From : in String;
76188 Item : out Num;
76189 Last : out Positive);
76190 procedure Put(To : out String;
76191 Item : in Num;
76192 Base : in Number_Base := Default_Base);
76193
76194 56
76195 end Integer_IO;
76196
76197 57
76198 generic
76199 type Num is mod <>;
76200 package Modular_IO is
76201
76202 58
76203 Default_Width : Field := Num'Width;
76204 Default_Base : Number_Base := 10;
76205
76206 59
76207 procedure Get(File : in File_Type;
76208 Item : out Num;
76209 Width : in Field := 0);
76210 procedure Get(Item : out Num;
76211 Width : in Field := 0);
76212
76213 60
76214 procedure Put(File : in File_Type;
76215 Item : in Num;
76216 Width : in Field := Default_Width;
76217 Base : in Number_Base := Default_Base);
76218 procedure Put(Item : in Num;
76219 Width : in Field := Default_Width;
76220 Base : in Number_Base := Default_Base);
76221 procedure Get(From : in String;
76222 Item : out Num;
76223 Last : out Positive);
76224 procedure Put(To : out String;
76225 Item : in Num;
76226 Base : in Number_Base := Default_Base);
76227
76228 61
76229 end Modular_IO;
76230
76231 62
76232 -- Generic packages for Input-Output of Real Types
76233
76234 63
76235 generic
76236 type Num is digits <>;
76237 package Float_IO is
76238
76239 64
76240 Default_Fore : Field := 2;
76241 Default_Aft : Field := Num'Digits-1;
76242 Default_Exp : Field := 3;
76243
76244 65
76245 procedure Get(File : in File_Type;
76246 Item : out Num;
76247 Width : in Field := 0);
76248 procedure Get(Item : out Num;
76249 Width : in Field := 0);
76250
76251 66
76252 procedure Put(File : in File_Type;
76253 Item : in Num;
76254 Fore : in Field := Default_Fore;
76255 Aft : in Field := Default_Aft;
76256 Exp : in Field := Default_Exp);
76257 procedure Put(Item : in Num;
76258 Fore : in Field := Default_Fore;
76259 Aft : in Field := Default_Aft;
76260 Exp : in Field := Default_Exp);
76261
76262 67
76263 procedure Get(From : in String;
76264 Item : out Num;
76265 Last : out Positive);
76266 procedure Put(To : out String;
76267 Item : in Num;
76268 Aft : in Field := Default_Aft;
76269 Exp : in Field := Default_Exp);
76270 end Float_IO;
76271
76272 68
76273 generic
76274 type Num is delta <>;
76275 package Fixed_IO is
76276
76277 69
76278 Default_Fore : Field := Num'Fore;
76279 Default_Aft : Field := Num'Aft;
76280 Default_Exp : Field := 0;
76281
76282 70
76283 procedure Get(File : in File_Type;
76284 Item : out Num;
76285 Width : in Field := 0);
76286 procedure Get(Item : out Num;
76287 Width : in Field := 0);
76288
76289 71
76290 procedure Put(File : in File_Type;
76291 Item : in Num;
76292 Fore : in Field := Default_Fore;
76293 Aft : in Field := Default_Aft;
76294 Exp : in Field := Default_Exp);
76295 procedure Put(Item : in Num;
76296 Fore : in Field := Default_Fore;
76297 Aft : in Field := Default_Aft;
76298 Exp : in Field := Default_Exp);
76299
76300 72
76301 procedure Get(From : in String;
76302 Item : out Num;
76303 Last : out Positive);
76304 procedure Put(To : out String;
76305 Item : in Num;
76306 Aft : in Field := Default_Aft;
76307 Exp : in Field := Default_Exp);
76308 end Fixed_IO;
76309
76310 73
76311 generic
76312 type Num is delta <> digits <>;
76313 package Decimal_IO is
76314
76315 74
76316 Default_Fore : Field := Num'Fore;
76317 Default_Aft : Field := Num'Aft;
76318 Default_Exp : Field := 0;
76319
76320 75
76321 procedure Get(File : in File_Type;
76322 Item : out Num;
76323 Width : in Field := 0);
76324 procedure Get(Item : out Num;
76325 Width : in Field := 0);
76326
76327 76
76328 procedure Put(File : in File_Type;
76329 Item : in Num;
76330 Fore : in Field := Default_Fore;
76331 Aft : in Field := Default_Aft;
76332 Exp : in Field := Default_Exp);
76333 procedure Put(Item : in Num;
76334 Fore : in Field := Default_Fore;
76335 Aft : in Field := Default_Aft;
76336 Exp : in Field := Default_Exp);
76337
76338 77
76339 procedure Get(From : in String;
76340 Item : out Num;
76341 Last : out Positive);
76342 procedure Put(To : out String;
76343 Item : in Num;
76344 Aft : in Field := Default_Aft;
76345 Exp : in Field := Default_Exp);
76346 end Decimal_IO;
76347
76348 78
76349 -- Generic package for Input-Output of Enumeration Types
76350
76351 79
76352 generic
76353 type Enum is (<>);
76354 package Enumeration_IO is
76355
76356 80
76357 Default_Width : Field := 0;
76358 Default_Setting : Type_Set := Upper_Case;
76359
76360 81
76361 procedure Get(File : in File_Type;
76362 Item : out Enum);
76363 procedure Get(Item : out Enum);
76364
76365 82
76366 procedure Put(File : in File_Type;
76367 Item : in Enum;
76368 Width : in Field := Default_Width;
76369 Set : in Type_Set := Default_Setting);
76370 procedure Put(Item : in Enum;
76371 Width : in Field := Default_Width;
76372 Set : in Type_Set := Default_Setting);
76373
76374 83
76375 procedure Get(From : in String;
76376 Item : out Enum;
76377 Last : out Positive);
76378 procedure Put(To : out String;
76379 Item : in Enum;
76380 Set : in Type_Set := Default_Setting);
76381 end Enumeration_IO;
76382
76383 84
76384 -- Exceptions
76385
76386 85
76387 Status_Error : exception renames IO_Exceptions.Status_Error;
76388 Mode_Error : exception renames IO_Exceptions.Mode_Error;
76389 Name_Error : exception renames IO_Exceptions.Name_Error;
76390 Use_Error : exception renames IO_Exceptions.Use_Error;
76391 Device_Error : exception renames IO_Exceptions.Device_Error;
76392 End_Error : exception renames IO_Exceptions.End_Error;
76393 Data_Error : exception renames IO_Exceptions.Data_Error;
76394 Layout_Error : exception renames IO_Exceptions.Layout_Error;
76395 private
76396 ... -- not specified by the language
76397 end Ada.Text_IO;
76398
76399 86/2
76400 {AI95-00360-01AI95-00360-01} The type File_Type needs finalization (see
76401 *note 7.6::).
76402
76403 _Incompatibilities With Ada 83_
76404
76405 86.a
76406 Append_File is a new element of enumeration type File_Mode.
76407
76408 _Extensions to Ada 83_
76409
76410 86.b
76411 Get_Immediate, Look_Ahead, the subprograms for dealing with
76412 standard error, the type File_Access and its associated
76413 subprograms, and the generic packages Modular_IO and
76414 Decimal_IO are new in Ada 95.
76415
76416 _Incompatibilities With Ada 95_
76417
76418 86.c/2
76419 {AI95-00360-01AI95-00360-01} Amendment Correction:
76420 Text_IO.File_Type is defined to need finalization. If the
76421 restriction No_Nested_Finalization (see *note D.7::) applies
76422 to the partition, and File_Type does not have a controlled
76423 part, it will not be allowed in local objects in Ada 2005
76424 whereas it would be allowed in original Ada 95. Such code is
76425 not portable, as another Ada compiler may have a controlled
76426 part in File_Type, and thus would be illegal.
76427
76428 _Wording Changes from Ada 95_
76429
76430 86.d/2
76431 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} Corrigendum:
76432 Corrected the parameter mode of Flush; otherwise it could not
76433 be used on Standard_Output.
76434
76435 86.e/2
76436 {AI95-00301-01AI95-00301-01} The Text_IO.Get_Line functions
76437 are new; they are described in *note A.10.7::, "*note A.10.7::
76438 Input-Output of Characters and Strings".
76439
76440 \1f
76441 File: aarm2012.info, Node: A.10.2, Next: A.10.3, Prev: A.10.1, Up: A.10
76442
76443 A.10.2 Text File Management
76444 ---------------------------
76445
76446 _Static Semantics_
76447
76448 1
76449 The only allowed file modes for text files are the modes In_File,
76450 Out_File, and Append_File. The subprograms given in subclause *note
76451 A.8.2:: for the control of external files, and the function End_Of_File
76452 given in subclause *note A.8.3:: for sequential input-output, are also
76453 available for text files. There is also a version of End_Of_File that
76454 refers to the current default input file. For text files, the
76455 procedures have the following additional effects:
76456
76457 2
76458 * For the procedures Create and Open: After a file with mode Out_File
76459 or Append_File is opened, the page length and line length are
76460 unbounded (both have the conventional value zero). After a file
76461 (of any mode) is opened, the current column, current line, and
76462 current page numbers are set to one. If the mode is Append_File,
76463 it is implementation defined whether a page terminator will
76464 separate preexisting text in the file from the new text to be
76465 written.
76466
76467 2.a
76468 Reason: For a file with mode Append_File, although it may seem
76469 more sensible for Open to set the current column, line, and
76470 page number based on the number of pages in the file, the
76471 number of lines on the last page, and the number of columns in
76472 the last line, we rejected this approach because of
76473 implementation costs; it would require the implementation to
76474 scan the file before doing the append, or to do processing
76475 that would be equivalent in effect.
76476
76477 2.b
76478 For similar reasons, there is no requirement to erase the last
76479 page terminator of the file, nor to insert an explicit page
76480 terminator in the case when the final page terminator of a
76481 file is represented implicitly by the implementation.
76482
76483 3
76484 * For the procedure Close: If the file has the current mode Out_File
76485 or Append_File, has the effect of calling New_Page, unless the
76486 current page is already terminated; then outputs a file terminator.
76487
76488 4
76489 * For the procedure Reset: If the file has the current mode Out_File
76490 or Append_File, has the effect of calling New_Page, unless the
76491 current page is already terminated; then outputs a file terminator.
76492 The current column, line, and page numbers are set to one, and the
76493 line and page lengths to Unbounded. If the new mode is
76494 Append_File, it is implementation defined whether a page terminator
76495 will separate preexisting text in the file from the new text to be
76496 written.
76497
76498 4.a
76499 Reason: The behavior of Reset should be similar to closing a
76500 file and reopening it with the given mode
76501
76502 5
76503 The exception Mode_Error is propagated by the procedure Reset upon an
76504 attempt to change the mode of a file that is the current default input
76505 file, the current default output file, or the current default error
76506 file.
76507
76508 NOTES
76509
76510 6
76511 27 An implementation can define the Form parameter of Create and
76512 Open to control effects including the following:
76513
76514 7
76515 * the interpretation of line and column numbers for an
76516 interactive file, and
76517
76518 8
76519 * the interpretation of text formats in a file created by a
76520 foreign program.
76521
76522 \1f
76523 File: aarm2012.info, Node: A.10.3, Next: A.10.4, Prev: A.10.2, Up: A.10
76524
76525 A.10.3 Default Input, Output, and Error Files
76526 ---------------------------------------------
76527
76528 _Static Semantics_
76529
76530 1
76531 The following subprograms provide for the control of the particular
76532 default files that are used when a file parameter is omitted from a Get,
76533 Put, or other operation of text input-output described below, or when
76534 application-dependent error-related text is to be output.
76535
76536 2
76537 procedure Set_Input(File : in File_Type);
76538
76539 3
76540 Operates on a file of mode In_File. Sets the current default
76541 input file to File.
76542
76543 4
76544 The exception Status_Error is propagated if the given file is
76545 not open. The exception Mode_Error is propagated if the mode
76546 of the given file is not In_File.
76547
76548 5
76549 procedure Set_Output(File : in File_Type);
76550 procedure Set_Error (File : in File_Type);
76551
76552 6
76553 Each operates on a file of mode Out_File or Append_File.
76554 Set_Output sets the current default output file to File.
76555 Set_Error sets the current default error file to File. The
76556 exception Status_Error is propagated if the given file is not
76557 open. The exception Mode_Error is propagated if the mode of
76558 the given file is not Out_File or Append_File.
76559
76560 7
76561 function Standard_Input return File_Type;
76562 function Standard_Input return File_Access;
76563
76564 8
76565 Returns the standard input file (see *note A.10::), or an
76566 access value designating the standard input file,
76567 respectively.
76568
76569 9
76570 function Standard_Output return File_Type;
76571 function Standard_Output return File_Access;
76572
76573 10
76574 Returns the standard output file (see *note A.10::) or an
76575 access value designating the standard output file,
76576 respectively.
76577
76578 11
76579 function Standard_Error return File_Type;
76580 function Standard_Error return File_Access;
76581
76582 12/1
76583 {8652/00528652/0052} {AI95-00194-01AI95-00194-01} Returns the
76584 standard error file (see *note A.10::), or an access value
76585 designating the standard error file, respectively.
76586
76587 13
76588 The Form strings implicitly associated with the opening of
76589 Standard_Input, Standard_Output, and Standard_Error at the start of
76590 program execution are implementation defined.
76591
76592 14
76593 function Current_Input return File_Type;
76594 function Current_Input return File_Access;
76595
76596 15
76597 Returns the current default input file, or an access value
76598 designating the current default input file, respectively.
76599
76600 16
76601 function Current_Output return File_Type;
76602 function Current_Output return File_Access;
76603
76604 17
76605 Returns the current default output file, or an access value
76606 designating the current default output file, respectively.
76607
76608 18
76609 function Current_Error return File_Type;
76610 function Current_Error return File_Access;
76611
76612 19
76613 Returns the current default error file, or an access value
76614 designating the current default error file, respectively.
76615
76616 20/1
76617 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} procedure Flush (File : in File_Type);
76618 procedure Flush;
76619
76620 21
76621 The effect of Flush is the same as the corresponding
76622 subprogram in Streams.Stream_IO (see *note A.12.1::). If File
76623 is not explicitly specified, Current_Output is used.
76624
76625 _Erroneous Execution_
76626
76627 22/1
76628 {8652/00538652/0053} {AI95-00063-01AI95-00063-01} The execution of a
76629 program is erroneous if it invokes an operation on a current default
76630 input, default output, or default error file, and if the corresponding
76631 file object is closed or no longer exists.
76632
76633 22.a.1/1
76634 Ramification: {8652/00538652/0053}
76635 {AI95-00063-01AI95-00063-01} Closing a default file, then
76636 setting the default file to another open file before accessing
76637 it is not erroneous.
76638
76639 23/1
76640 This paragraph was deleted.{8652/00538652/0053}
76641 {AI95-00063-01AI95-00063-01}
76642
76643 NOTES
76644
76645 24
76646 28 The standard input, standard output, and standard error files
76647 cannot be opened, closed, reset, or deleted, because the parameter
76648 File of the corresponding procedures has the mode in out.
76649
76650 25
76651 29 The standard input, standard output, and standard error files
76652 are different file objects, but not necessarily different external
76653 files.
76654
76655 _Wording Changes from Ada 95_
76656
76657 25.a/2
76658 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} Corrigendum:
76659 Corrected the parameter mode of Flush; otherwise it could not
76660 be used on Standard_Output.
76661
76662 25.b/2
76663 {8652/00528652/0052} {AI95-00194-01AI95-00194-01} Corrigendum:
76664 Corrected Standard_Error so it refers to the correct file.
76665
76666 25.c/2
76667 {8652/00538652/0053} {AI95-00063-01AI95-00063-01} Corrigendum:
76668 Clarified that execution is erroneous only when a closed
76669 default file is accessed.
76670
76671 \1f
76672 File: aarm2012.info, Node: A.10.4, Next: A.10.5, Prev: A.10.3, Up: A.10
76673
76674 A.10.4 Specification of Line and Page Lengths
76675 ---------------------------------------------
76676
76677 _Static Semantics_
76678
76679 1
76680 The subprograms described in this subclause are concerned with the line
76681 and page structure of a file of mode Out_File or Append_File. They
76682 operate either on the file given as the first parameter, or, in the
76683 absence of such a file parameter, on the current default output file.
76684 They provide for output of text with a specified maximum line length or
76685 page length. In these cases, line and page terminators are output
76686 implicitly and automatically when needed. When line and page lengths
76687 are unbounded (that is, when they have the conventional value zero), as
76688 in the case of a newly opened file, new lines and new pages are only
76689 started when explicitly called for.
76690
76691 2
76692 In all cases, the exception Status_Error is propagated if the file to be
76693 used is not open; the exception Mode_Error is propagated if the mode of
76694 the file is not Out_File or Append_File.
76695
76696 3
76697 procedure Set_Line_Length(File : in File_Type; To : in Count);
76698 procedure Set_Line_Length(To : in Count);
76699
76700 4
76701 Sets the maximum line length of the specified output or append
76702 file to the number of characters specified by To. The value
76703 zero for To specifies an unbounded line length.
76704
76705 4.a
76706 Ramification: The setting does not affect the lengths of lines
76707 in the existing file, rather it only influences subsequent
76708 output operations.
76709
76710 5
76711 The exception Use_Error is propagated if the specified line
76712 length is inappropriate for the associated external file.
76713
76714 6
76715 procedure Set_Page_Length(File : in File_Type; To : in Count);
76716 procedure Set_Page_Length(To : in Count);
76717
76718 7
76719 Sets the maximum page length of the specified output or append
76720 file to the number of lines specified by To. The value zero
76721 for To specifies an unbounded page length.
76722
76723 8
76724 The exception Use_Error is propagated if the specified page
76725 length is inappropriate for the associated external file.
76726
76727 9
76728 function Line_Length(File : in File_Type) return Count;
76729 function Line_Length return Count;
76730
76731 10
76732 Returns the maximum line length currently set for the
76733 specified output or append file, or zero if the line length is
76734 unbounded.
76735
76736 11
76737 function Page_Length(File : in File_Type) return Count;
76738 function Page_Length return Count;
76739
76740 12
76741 Returns the maximum page length currently set for the
76742 specified output or append file, or zero if the page length is
76743 unbounded.
76744
76745 \1f
76746 File: aarm2012.info, Node: A.10.5, Next: A.10.6, Prev: A.10.4, Up: A.10
76747
76748 A.10.5 Operations on Columns, Lines, and Pages
76749 ----------------------------------------------
76750
76751 _Static Semantics_
76752
76753 1
76754 The subprograms described in this subclause provide for explicit control
76755 of line and page structure; they operate either on the file given as the
76756 first parameter, or, in the absence of such a file parameter, on the
76757 appropriate (input or output) current default file. The exception
76758 Status_Error is propagated by any of these subprograms if the file to be
76759 used is not open.
76760
76761 2
76762 procedure New_Line(File : in File_Type; Spacing : in Positive_Count := 1);
76763 procedure New_Line(Spacing : in Positive_Count := 1);
76764
76765 3
76766 Operates on a file of mode Out_File or Append_File.
76767
76768 4
76769 For a Spacing of one: Outputs a line terminator and sets the
76770 current column number to one. Then increments the current
76771 line number by one, except in the case that the current line
76772 number is already greater than or equal to the maximum page
76773 length, for a bounded page length; in that case a page
76774 terminator is output, the current page number is incremented
76775 by one, and the current line number is set to one.
76776
76777 5
76778 For a Spacing greater than one, the above actions are
76779 performed Spacing times.
76780
76781 6
76782 The exception Mode_Error is propagated if the mode is not
76783 Out_File or Append_File.
76784
76785 7
76786 procedure Skip_Line(File : in File_Type; Spacing : in Positive_Count := 1);
76787 procedure Skip_Line(Spacing : in Positive_Count := 1);
76788
76789 8
76790 Operates on a file of mode In_File.
76791
76792 9
76793 For a Spacing of one: Reads and discards all characters until
76794 a line terminator has been read, and then sets the current
76795 column number to one. If the line terminator is not
76796 immediately followed by a page terminator, the current line
76797 number is incremented by one. Otherwise, if the line
76798 terminator is immediately followed by a page terminator, then
76799 the page terminator is skipped, the current page number is
76800 incremented by one, and the current line number is set to one.
76801
76802 10
76803 For a Spacing greater than one, the above actions are
76804 performed Spacing times.
76805
76806 11
76807 The exception Mode_Error is propagated if the mode is not
76808 In_File. The exception End_Error is propagated if an attempt
76809 is made to read a file terminator.
76810
76811 12
76812 function End_Of_Line(File : in File_Type) return Boolean;
76813 function End_Of_Line return Boolean;
76814
76815 13/3
76816 {AI05-0264-1AI05-0264-1} Operates on a file of mode In_File.
76817 Returns True if a line terminator or a file terminator is
76818 next; otherwise, returns False.
76819
76820 14
76821 The exception Mode_Error is propagated if the mode is not
76822 In_File.
76823
76824 15
76825 procedure New_Page(File : in File_Type);
76826 procedure New_Page;
76827
76828 16
76829 Operates on a file of mode Out_File or Append_File. Outputs a
76830 line terminator if the current line is not terminated, or if
76831 the current page is empty (that is, if the current column and
76832 line numbers are both equal to one). Then outputs a page
76833 terminator, which terminates the current page. Adds one to
76834 the current page number and sets the current column and line
76835 numbers to one.
76836
76837 17
76838 The exception Mode_Error is propagated if the mode is not
76839 Out_File or Append_File.
76840
76841 18
76842 procedure Skip_Page(File : in File_Type);
76843 procedure Skip_Page;
76844
76845 19
76846 Operates on a file of mode In_File. Reads and discards all
76847 characters and line terminators until a page terminator has
76848 been read. Then adds one to the current page number, and sets
76849 the current column and line numbers to one.
76850
76851 20
76852 The exception Mode_Error is propagated if the mode is not
76853 In_File. The exception End_Error is propagated if an attempt
76854 is made to read a file terminator.
76855
76856 21
76857 function End_Of_Page(File : in File_Type) return Boolean;
76858 function End_Of_Page return Boolean;
76859
76860 22/3
76861 {AI05-0264-1AI05-0264-1} Operates on a file of mode In_File.
76862 Returns True if the combination of a line terminator and a
76863 page terminator is next, or if a file terminator is next;
76864 otherwise, returns False.
76865
76866 23
76867 The exception Mode_Error is propagated if the mode is not
76868 In_File.
76869
76870 24
76871 function End_Of_File(File : in File_Type) return Boolean;
76872 function End_Of_File return Boolean;
76873
76874 25/3
76875 {AI05-0264-1AI05-0264-1} Operates on a file of mode In_File.
76876 Returns True if a file terminator is next, or if the
76877 combination of a line, a page, and a file terminator is next;
76878 otherwise, returns False.
76879
76880 26
76881 The exception Mode_Error is propagated if the mode is not
76882 In_File.
76883
76884 27
76885 The following subprograms provide for the control of the current
76886 position of reading or writing in a file. In all cases, the default
76887 file is the current output file.
76888
76889 28
76890 procedure Set_Col(File : in File_Type; To : in Positive_Count);
76891 procedure Set_Col(To : in Positive_Count);
76892
76893 29
76894 If the file mode is Out_File or Append_File:
76895
76896 30
76897 * If the value specified by To is greater than the current
76898 column number, outputs spaces, adding one to the current
76899 column number after each space, until the current column
76900 number equals the specified value. If the value
76901 specified by To is equal to the current column number,
76902 there is no effect. If the value specified by To is less
76903 than the current column number, has the effect of calling
76904 New_Line (with a spacing of one), then outputs (To - 1)
76905 spaces, and sets the current column number to the
76906 specified value.
76907
76908 31
76909 * The exception Layout_Error is propagated if the value
76910 specified by To exceeds Line_Length when the line length
76911 is bounded (that is, when it does not have the
76912 conventional value zero).
76913
76914 32
76915 If the file mode is In_File:
76916
76917 33
76918 * Reads (and discards) individual characters, line
76919 terminators, and page terminators, until the next
76920 character to be read has a column number that equals the
76921 value specified by To; there is no effect if the current
76922 column number already equals this value. Each transfer
76923 of a character or terminator maintains the current
76924 column, line, and page numbers in the same way as a Get
76925 procedure (see *note A.10.6::). (Short lines will be
76926 skipped until a line is reached that has a character at
76927 the specified column position.)
76928
76929 34
76930 * The exception End_Error is propagated if an attempt is
76931 made to read a file terminator.
76932
76933 35
76934 procedure Set_Line(File : in File_Type; To : in Positive_Count);
76935 procedure Set_Line(To : in Positive_Count);
76936
76937 36
76938 If the file mode is Out_File or Append_File:
76939
76940 37/3
76941 * {AI05-0038-1AI05-0038-1} If the value specified by To is
76942 greater than the current line number, has the effect of
76943 repeatedly calling New_Line (with a spacing of one),
76944 until the current line number equals the specified value.
76945 If the value specified by To is equal to the current line
76946 number, there is no effect. If the value specified by To
76947 is less than the current line number, has the effect of
76948 calling New_Page followed, if To is greater than 1, by a
76949 call of New_Line with a spacing equal to (To - 1).
76950
76951 38
76952 * The exception Layout_Error is propagated if the value
76953 specified by To exceeds Page_Length when the page length
76954 is bounded (that is, when it does not have the
76955 conventional value zero).
76956
76957 39
76958 If the mode is In_File:
76959
76960 40
76961 * Has the effect of repeatedly calling Skip_Line (with a
76962 spacing of one), until the current line number equals the
76963 value specified by To; there is no effect if the current
76964 line number already equals this value. (Short pages will
76965 be skipped until a page is reached that has a line at the
76966 specified line position.)
76967
76968 41
76969 * The exception End_Error is propagated if an attempt is
76970 made to read a file terminator.
76971
76972 42
76973 function Col(File : in File_Type) return Positive_Count;
76974 function Col return Positive_Count;
76975
76976 43
76977 Returns the current column number.
76978
76979 44
76980 The exception Layout_Error is propagated if this number
76981 exceeds Count'Last.
76982
76983 45
76984 function Line(File : in File_Type) return Positive_Count;
76985 function Line return Positive_Count;
76986
76987 46
76988 Returns the current line number.
76989
76990 47
76991 The exception Layout_Error is propagated if this number
76992 exceeds Count'Last.
76993
76994 48
76995 function Page(File : in File_Type) return Positive_Count;
76996 function Page return Positive_Count;
76997
76998 49
76999 Returns the current page number.
77000
77001 50
77002 The exception Layout_Error is propagated if this number
77003 exceeds Count'Last.
77004
77005 51
77006 The column number, line number, or page number are allowed to exceed
77007 Count'Last (as a consequence of the input or output of sufficiently many
77008 characters, lines, or pages). These events do not cause any exception
77009 to be propagated. However, a call of Col, Line, or Page propagates the
77010 exception Layout_Error if the corresponding number exceeds Count'Last.
77011
77012 NOTES
77013
77014 52
77015 30 A page terminator is always skipped whenever the preceding line
77016 terminator is skipped. An implementation may represent the
77017 combination of these terminators by a single character, provided
77018 that it is properly recognized on input.
77019
77020 _Inconsistencies With Ada 2005_
77021
77022 52.a/3
77023 {AI05-0038-1AI05-0038-1} Correction: Fixed a glitch in
77024 Set_Line such that we could have called New_Line(0), which
77025 would have to raise Constraint_Error. It's now defined to
77026 work. The bug occurred in Ada 95 and Ada 2005. It's very
77027 unlikely that any real programs depend on this exception being
77028 raised.
77029
77030 \1f
77031 File: aarm2012.info, Node: A.10.6, Next: A.10.7, Prev: A.10.5, Up: A.10
77032
77033 A.10.6 Get and Put Procedures
77034 -----------------------------
77035
77036 _Static Semantics_
77037
77038 1
77039 The procedures Get and Put for items of the type Character, String,
77040 numeric types, and enumeration types are described in subsequent
77041 subclauses. Features of these procedures that are common to most of
77042 these types are described in this subclause. The Get and Put procedures
77043 for items of type Character and String deal with individual character
77044 values; the Get and Put procedures for numeric and enumeration types
77045 treat the items as lexical elements.
77046
77047 2
77048 All procedures Get and Put have forms with a file parameter, written
77049 first. Where this parameter is omitted, the appropriate (input or
77050 output) current default file is understood to be specified. Each
77051 procedure Get operates on a file of mode In_File. Each procedure Put
77052 operates on a file of mode Out_File or Append_File.
77053
77054 3
77055 All procedures Get and Put maintain the current column, line, and page
77056 numbers of the specified file: the effect of each of these procedures
77057 upon these numbers is the result of the effects of individual transfers
77058 of characters and of individual output or skipping of terminators. Each
77059 transfer of a character adds one to the current column number. Each
77060 output of a line terminator sets the current column number to one and
77061 adds one to the current line number. Each output of a page terminator
77062 sets the current column and line numbers to one and adds one to the
77063 current page number. For input, each skipping of a line terminator sets
77064 the current column number to one and adds one to the current line
77065 number; each skipping of a page terminator sets the current column and
77066 line numbers to one and adds one to the current page number. Similar
77067 considerations apply to the procedures Get_Line, Put_Line, and Set_Col.
77068
77069 4
77070 Several Get and Put procedures, for numeric and enumeration types, have
77071 format parameters which specify field lengths; these parameters are of
77072 the nonnegative subtype Field of the type Integer.
77073
77074 5/2
77075 {AI95-00223-01AI95-00223-01} Input-output of enumeration values uses the
77076 syntax of the corresponding lexical elements. Any Get procedure for an
77077 enumeration type begins by skipping any leading blanks, or line or page
77078 terminators. A blank is defined as a space or a horizontal tabulation
77079 character. Next, characters are input only so long as the sequence
77080 input is an initial sequence of an identifier or of a character literal
77081 (in particular, input ceases when a line terminator is encountered).
77082 The character or line terminator that causes input to cease remains
77083 available for subsequent input.
77084
77085 6
77086 For a numeric type, the Get procedures have a format parameter called
77087 Width. If the value given for this parameter is zero, the Get procedure
77088 proceeds in the same manner as for enumeration types, but using the
77089 syntax of numeric literals instead of that of enumeration literals. If
77090 a nonzero value is given, then exactly Width characters are input, or
77091 the characters up to a line terminator, whichever comes first; any
77092 skipped leading blanks are included in the count. The syntax used for
77093 numeric literals is an extended syntax that allows a leading sign (but
77094 no intervening blanks, or line or page terminators) and that also allows
77095 (for real types) an integer literal as well as forms that have digits
77096 only before the point or only after the point.
77097
77098 7
77099 Any Put procedure, for an item of a numeric or an enumeration type,
77100 outputs the value of the item as a numeric literal, identifier, or
77101 character literal, as appropriate. This is preceded by leading spaces
77102 if required by the format parameters Width or Fore (as described in
77103 later subclauses), and then a minus sign for a negative value; for an
77104 enumeration type, the spaces follow instead of leading. The format
77105 given for a Put procedure is overridden if it is insufficiently wide, by
77106 using the minimum needed width.
77107
77108 8
77109 Two further cases arise for Put procedures for numeric and enumeration
77110 types, if the line length of the specified output file is bounded (that
77111 is, if it does not have the conventional value zero). If the number of
77112 characters to be output does not exceed the maximum line length, but is
77113 such that they cannot fit on the current line, starting from the current
77114 column, then (in effect) New_Line is called (with a spacing of one)
77115 before output of the item. Otherwise, if the number of characters
77116 exceeds the maximum line length, then the exception Layout_Error is
77117 propagated and nothing is output.
77118
77119 9
77120 The exception Status_Error is propagated by any of the procedures Get,
77121 Get_Line, Put, and Put_Line if the file to be used is not open. The
77122 exception Mode_Error is propagated by the procedures Get and Get_Line if
77123 the mode of the file to be used is not In_File; and by the procedures
77124 Put and Put_Line, if the mode is not Out_File or Append_File.
77125
77126 10
77127 The exception End_Error is propagated by a Get procedure if an attempt
77128 is made to skip a file terminator. The exception Data_Error is
77129 propagated by a Get procedure if the sequence finally input is not a
77130 lexical element corresponding to the type, in particular if no
77131 characters were input; for this test, leading blanks are ignored; for an
77132 item of a numeric type, when a sign is input, this rule applies to the
77133 succeeding numeric literal. The exception Layout_Error is propagated by
77134 a Put procedure that outputs to a parameter of type String, if the
77135 length of the actual string is insufficient for the output of the item.
77136
77137 _Examples_
77138
77139 11
77140 In the examples, here and in subclauses *note A.10.8:: and *note
77141 A.10.9::, the string quotes and the lower case letter b are not
77142 transferred: they are shown only to reveal the layout and spaces.
77143
77144 12
77145 N : Integer;
77146 ...
77147 Get(N);
77148
77149 13
77150 -- Characters at input Sequence input Value of N
77151
77152 -- bb-12535b -12535 -12535
77153 -- bb12_535e1b 12_535e1 125350
77154 -- bb12_535e; 12_535e (none) Data_Error raised
77155
77156 14
77157 Example of overridden width parameter:
77158
77159 15
77160 Put(Item => -23, Width => 2); -- "-23"
77161
77162 _Wording Changes from Ada 95_
77163
77164 15.a/2
77165 {AI95-00223-01AI95-00223-01} Removed conflicting text
77166 describing the skipping of blanks for a Get procedure.
77167
77168 \1f
77169 File: aarm2012.info, Node: A.10.7, Next: A.10.8, Prev: A.10.6, Up: A.10
77170
77171 A.10.7 Input-Output of Characters and Strings
77172 ---------------------------------------------
77173
77174 _Static Semantics_
77175
77176 1
77177 For an item of type Character the following procedures are provided:
77178
77179 2
77180 procedure Get(File : in File_Type; Item : out Character);
77181 procedure Get(Item : out Character);
77182
77183 3
77184 After skipping any line terminators and any page terminators,
77185 reads the next character from the specified input file and
77186 returns the value of this character in the out parameter Item.
77187
77188 4
77189 The exception End_Error is propagated if an attempt is made to
77190 skip a file terminator.
77191
77192 5
77193 procedure Put(File : in File_Type; Item : in Character);
77194 procedure Put(Item : in Character);
77195
77196 6
77197 If the line length of the specified output file is bounded
77198 (that is, does not have the conventional value zero), and the
77199 current column number exceeds it, has the effect of calling
77200 New_Line with a spacing of one. Then, or otherwise, outputs
77201 the given character to the file.
77202
77203 7
77204 procedure Look_Ahead (File : in File_Type;
77205 Item : out Character;
77206 End_Of_Line : out Boolean);
77207 procedure Look_Ahead (Item : out Character;
77208 End_Of_Line : out Boolean);
77209
77210 8/3
77211 {AI05-0038-1AI05-0038-1} {AI05-0264-1AI05-0264-1} Status_Error
77212 is propagated if the file is not open. Mode_Error is
77213 propagated if the mode of the file is not In_File. Sets
77214 End_Of_Line to True if at end of line, including if at end of
77215 page or at end of file; in each of these cases the value of
77216 Item is not specified. Otherwise, End_Of_Line is set to False
77217 and Item is set to the next character (without consuming it)
77218 from the file.
77219
77220 9
77221 procedure Get_Immediate(File : in File_Type;
77222 Item : out Character);
77223 procedure Get_Immediate(Item : out Character);
77224
77225 10/3
77226 {AI05-0038-1AI05-0038-1} Reads the next character, either
77227 control or graphic, from the specified File or the default
77228 input file. Status_Error is propagated if the file is not
77229 open. Mode_Error is propagated if the mode of the file is not
77230 In_File. End_Error is propagated if at the end of the file.
77231 The current column, line and page numbers for the file are not
77232 affected.
77233
77234 11
77235 procedure Get_Immediate(File : in File_Type;
77236 Item : out Character;
77237 Available : out Boolean);
77238 procedure Get_Immediate(Item : out Character;
77239 Available : out Boolean);
77240
77241 12/3
77242 {AI05-0038-1AI05-0038-1} If a character, either control or
77243 graphic, is available from the specified File or the default
77244 input file, then the character is read; Available is True and
77245 Item contains the value of this character. If a character is
77246 not available, then Available is False and the value of Item
77247 is not specified. Status_Error is propagated if the file is
77248 not open. Mode_Error is propagated if the mode of the file is
77249 not In_File. End_Error is propagated if at the end of the
77250 file. The current column, line and page numbers for the file
77251 are not affected.
77252
77253 13/2
77254 {AI95-00301-01AI95-00301-01} For an item of type String the following
77255 subprograms are provided:
77256
77257 14
77258 procedure Get(File : in File_Type; Item : out String);
77259 procedure Get(Item : out String);
77260
77261 15
77262 Determines the length of the given string and attempts that
77263 number of Get operations for successive characters of the
77264 string (in particular, no operation is performed if the string
77265 is null).
77266
77267 16
77268 procedure Put(File : in File_Type; Item : in String);
77269 procedure Put(Item : in String);
77270
77271 17
77272 Determines the length of the given string and attempts that
77273 number of Put operations for successive characters of the
77274 string (in particular, no operation is performed if the string
77275 is null).
77276
77277 17.1/2
77278 function Get_Line(File : in File_Type) return String;
77279 function Get_Line return String;
77280
77281 17.2/2
77282 {AI95-00301-01AI95-00301-01} Returns a result string
77283 constructed by reading successive characters from the
77284 specified input file, and assigning them to successive
77285 characters of the result string. The result string has a
77286 lower bound of 1 and an upper bound of the number of
77287 characters read. Reading stops when the end of the line is
77288 met; Skip_Line is then (in effect) called with a spacing of 1.
77289
77290 17.3/2
77291 {AI95-00301-01AI95-00301-01} Constraint_Error is raised if the
77292 length of the line exceeds Positive'Last; in this case, the
77293 line number and page number are unchanged, and the column
77294 number is unspecified but no less than it was before the call.
77295 The exception End_Error is propagated if an attempt is made to
77296 skip a file terminator.
77297
77298 17.a/2
77299 Ramification: {AI95-00301-01AI95-00301-01} Precisely what is
77300 left in the file is unspecified if Constraint_Error is raised
77301 because the line doesn't fit in a String; it should be
77302 consistent with column number. This allows implementers to
77303 use whatever buffering scheme makes sense. But the line
77304 terminator is not skipped in this case.
77305
77306 18
77307 procedure Get_Line(File : in File_Type;
77308 Item : out String;
77309 Last : out Natural);
77310 procedure Get_Line(Item : out String;
77311 Last : out Natural);
77312
77313 19
77314 Reads successive characters from the specified input file and
77315 assigns them to successive characters of the specified string.
77316 Reading stops if the end of the string is met. Reading also
77317 stops if the end of the line is met before meeting the end of
77318 the string; in this case Skip_Line is (in effect) called with
77319 a spacing of 1. The values of characters not assigned are not
77320 specified.
77321
77322 20
77323 If characters are read, returns in Last the index value such
77324 that Item(Last) is the last character assigned (the index of
77325 the first character assigned is Item'First). If no characters
77326 are read, returns in Last an index value that is one less than
77327 Item'First. The exception End_Error is propagated if an
77328 attempt is made to skip a file terminator.
77329
77330 21
77331 procedure Put_Line(File : in File_Type; Item : in String);
77332 procedure Put_Line(Item : in String);
77333
77334 22
77335 Calls the procedure Put for the given string, and then the
77336 procedure New_Line with a spacing of one.
77337
77338 _Implementation Advice_
77339
77340 23
77341 The Get_Immediate procedures should be implemented with unbuffered
77342 input. For a device such as a keyboard, input should be "available" if
77343 a key has already been typed, whereas for a disk file, input should
77344 always be available except at end of file. For a file associated with a
77345 keyboard-like device, any line-editing features of the underlying
77346 operating system should be disabled during the execution of
77347 Get_Immediate.
77348
77349 23.a/2
77350 Implementation Advice: Get_Immediate should be implemented
77351 with unbuffered input; input should be available immediately;
77352 line-editing should be disabled.
77353
77354 NOTES
77355
77356 24
77357 31 Get_Immediate can be used to read a single key from the
77358 keyboard "immediately"; that is, without waiting for an end of
77359 line. In a call of Get_Immediate without the parameter Available,
77360 the caller will wait until a character is available.
77361
77362 25
77363 32 In a literal string parameter of Put, the enclosing string
77364 bracket characters are not output. Each doubled string bracket
77365 character in the enclosed string is output as a single string
77366 bracket character, as a consequence of the rule for string literals
77367 (see *note 2.6::).
77368
77369 26
77370 33 A string read by Get or written by Put can extend over several
77371 lines. An implementation is allowed to assume that certain
77372 external files do not contain page terminators, in which case
77373 Get_Line and Skip_Line can return as soon as a line terminator is
77374 read.
77375
77376 _Incompatibilities With Ada 95_
77377
77378 26.a/3
77379 {AI95-00301-01AI95-00301-01} {AI05-0005-1AI05-0005-1} The
77380 Get_Line functions are added to Ada.Text_IO. If Ada.Text_IO is
77381 referenced in a use_clause, and a function Get_Line is defined
77382 in a package that is also referenced in a use_clause, the
77383 user-defined Get_Line may no longer be use-visible, resulting
77384 in errors. This should be rare and is easily fixed if it does
77385 occur.
77386
77387 _Extensions to Ada 95_
77388
77389 26.b/2
77390 {AI95-00301-01AI95-00301-01} The Text_IO.Get_Line functions
77391 are new.
77392
77393 _Wording Changes from Ada 2005_
77394
77395 26.c/3
77396 {AI05-0038-1AI05-0038-1} Correction: Added missing wording
77397 about raising Status_Error to Look_Ahead and Get_Immediate.
77398
77399 \1f
77400 File: aarm2012.info, Node: A.10.8, Next: A.10.9, Prev: A.10.7, Up: A.10
77401
77402 A.10.8 Input-Output for Integer Types
77403 -------------------------------------
77404
77405 _Static Semantics_
77406
77407 1
77408 The following procedures are defined in the generic packages Integer_IO
77409 and Modular_IO, which have to be instantiated for the appropriate signed
77410 integer or modular type respectively (indicated by Num in the
77411 specifications).
77412
77413 2
77414 Values are output as decimal or based literals, without low line
77415 characters or exponent, and, for Integer_IO, preceded by a minus sign if
77416 negative. The format (which includes any leading spaces and minus sign)
77417 can be specified by an optional field width parameter. Values of widths
77418 of fields in output formats are of the nonnegative integer subtype
77419 Field. Values of bases are of the integer subtype Number_Base.
77420
77421 3
77422 subtype Number_Base is Integer range 2 .. 16;
77423
77424 4
77425 The default field width and base to be used by output procedures are
77426 defined by the following variables that are declared in the generic
77427 packages Integer_IO and Modular_IO:
77428
77429 5
77430 Default_Width : Field := Num'Width;
77431 Default_Base : Number_Base := 10;
77432
77433 6
77434 The following procedures are provided:
77435
77436 7
77437 procedure Get(File : in File_Type; Item : out Num; Width : in Field := 0);
77438 procedure Get(Item : out Num; Width : in Field := 0);
77439
77440 8
77441 If the value of the parameter Width is zero, skips any leading
77442 blanks, line terminators, or page terminators, then reads a
77443 plus sign if present or (for a signed type only) a minus sign
77444 if present, then reads the longest possible sequence of
77445 characters matching the syntax of a numeric literal without a
77446 point. If a nonzero value of Width is supplied, then exactly
77447 Width characters are input, or the characters (possibly none)
77448 up to a line terminator, whichever comes first; any skipped
77449 leading blanks are included in the count.
77450
77451 9
77452 Returns, in the parameter Item, the value of type Num that
77453 corresponds to the sequence input.
77454
77455 10/3
77456 {AI05-0038-1AI05-0038-1} The exception Data_Error is
77457 propagated if the sequence of characters read does not form a
77458 legal integer literal or if the value obtained is not of the
77459 subtype Num.
77460
77461 11
77462 procedure Put(File : in File_Type;
77463 Item : in Num;
77464 Width : in Field := Default_Width;
77465 Base : in Number_Base := Default_Base);
77466
77467 procedure Put(Item : in Num;
77468 Width : in Field := Default_Width;
77469 Base : in Number_Base := Default_Base);
77470
77471 12
77472 Outputs the value of the parameter Item as an integer literal,
77473 with no low lines, no exponent, and no leading zeros (but a
77474 single zero for the value zero), and a preceding minus sign
77475 for a negative value.
77476
77477 13
77478 If the resulting sequence of characters to be output has fewer
77479 than Width characters, then leading spaces are first output to
77480 make up the difference.
77481
77482 14
77483 Uses the syntax for decimal literal if the parameter Base has
77484 the value ten (either explicitly or through Default_Base);
77485 otherwise, uses the syntax for based literal, with any letters
77486 in upper case.
77487
77488 15
77489 procedure Get(From : in String; Item : out Num; Last : out Positive);
77490
77491 16
77492 Reads an integer value from the beginning of the given string,
77493 following the same rules as the Get procedure that reads an
77494 integer value from a file, but treating the end of the string
77495 as a file terminator. Returns, in the parameter Item, the
77496 value of type Num that corresponds to the sequence input.
77497 Returns in Last the index value such that From(Last) is the
77498 last character read.
77499
77500 17
77501 The exception Data_Error is propagated if the sequence input
77502 does not have the required syntax or if the value obtained is
77503 not of the subtype Num.
77504
77505 18
77506 procedure Put(To : out String;
77507 Item : in Num;
77508 Base : in Number_Base := Default_Base);
77509
77510 19
77511 Outputs the value of the parameter Item to the given string,
77512 following the same rule as for output to a file, using the
77513 length of the given string as the value for Width.
77514
77515 20
77516 Integer_Text_IO is a library package that is a nongeneric equivalent to
77517 Text_IO.Integer_IO for the predefined type Integer:
77518
77519 21
77520 with Ada.Text_IO;
77521 package Ada.Integer_Text_IO is new Ada.Text_IO.Integer_IO(Integer);
77522
77523 22
77524 For each predefined signed integer type, a nongeneric equivalent to
77525 Text_IO.Integer_IO is provided, with names such as
77526 Ada.Long_Integer_Text_IO.
77527
77528 _Implementation Permissions_
77529
77530 23
77531 The nongeneric equivalent packages may, but need not, be actual
77532 instantiations of the generic package for the appropriate predefined
77533 type.
77534
77535 Paragraphs 24 and 25 were deleted.
77536
77537 _Examples_
77538
77539 26/3
77540 {AI05-0298-1AI05-0298-1} subtype Byte_Int is Integer range -127 .. 127;
77541 package Int_IO is new Integer_IO(Byte_Int); use Int_IO;
77542 -- default format used at instantiation,
77543 -- Default_Width = 4, Default_Base = 10
77544
77545 27
77546 Put(126); -- "b126"
77547 Put(-126, 7); -- "bbb-126"
77548 Put(126, Width => 13, Base => 2); -- "bbb2#1111110#"
77549
77550 _Inconsistencies With Ada 2005_
77551
77552 27.a/3
77553 {AI05-0038-1AI05-0038-1} Correction: Changed wording to make
77554 Integer_IO and Modular_IO raise Data_Error in the same way
77555 when the bounds of the subtype are exceeded. There is no
77556 value to different behavior, and all surveyed compilers
77557 already treat integer and modular values the same way. This
77558 could only cause a problem if a program was compiled with some
77559 unsurveyed compiler, and the Ada 95-defined behavior is
77560 expected for Modular_IO. But note that such code is not
77561 portable anyway, as most widely used compilers behave
77562 consistently with the new wording, so it is unlikely that such
77563 code exists.
77564
77565 \1f
77566 File: aarm2012.info, Node: A.10.9, Next: A.10.10, Prev: A.10.8, Up: A.10
77567
77568 A.10.9 Input-Output for Real Types
77569 ----------------------------------
77570
77571 _Static Semantics_
77572
77573 1
77574 The following procedures are defined in the generic packages Float_IO,
77575 Fixed_IO, and Decimal_IO, which have to be instantiated for the
77576 appropriate floating point, ordinary fixed point, or decimal fixed point
77577 type respectively (indicated by Num in the specifications).
77578
77579 2
77580 Values are output as decimal literals without low line characters. The
77581 format of each value output consists of a Fore field, a decimal point,
77582 an Aft field, and (if a nonzero Exp parameter is supplied) the letter E
77583 and an Exp field. The two possible formats thus correspond to:
77584
77585 3
77586 Fore . Aft
77587
77588 4
77589 and to:
77590
77591 5
77592 Fore . Aft E Exp
77593
77594 6
77595 without any spaces between these fields. The Fore field may include
77596 leading spaces, and a minus sign for negative values. The Aft field
77597 includes only decimal digits (possibly with trailing zeros). The Exp
77598 field includes the sign (plus or minus) and the exponent (possibly with
77599 leading zeros).
77600
77601 7
77602 For floating point types, the default lengths of these fields are
77603 defined by the following variables that are declared in the generic
77604 package Float_IO:
77605
77606 8
77607 Default_Fore : Field := 2;
77608 Default_Aft : Field := Num'Digits-1;
77609 Default_Exp : Field := 3;
77610
77611 9
77612 For ordinary or decimal fixed point types, the default lengths of these
77613 fields are defined by the following variables that are declared in the
77614 generic packages Fixed_IO and Decimal_IO, respectively:
77615
77616 10
77617 Default_Fore : Field := Num'Fore;
77618 Default_Aft : Field := Num'Aft;
77619 Default_Exp : Field := 0;
77620
77621 11
77622 The following procedures are provided:
77623
77624 12
77625 procedure Get(File : in File_Type; Item : out Num; Width : in Field := 0);
77626 procedure Get(Item : out Num; Width : in Field := 0);
77627
77628 13
77629 If the value of the parameter Width is zero, skips any leading
77630 blanks, line terminators, or page terminators, then reads the
77631 longest possible sequence of characters matching the syntax of
77632 any of the following (see *note 2.4::):
77633
77634 14
77635 * [+|-]numeric_literal
77636
77637 15
77638 * [+|-]numeral.[exponent]
77639
77640 16
77641 * [+|-].numeral[exponent]
77642
77643 17
77644 * [+|-]base#based_numeral.#[exponent]
77645
77646 18
77647 * [+|-]base#.based_numeral#[exponent]
77648
77649 19
77650 If a nonzero value of Width is supplied, then exactly Width
77651 characters are input, or the characters (possibly none) up to
77652 a line terminator, whichever comes first; any skipped leading
77653 blanks are included in the count.
77654
77655 20
77656 Returns in the parameter Item the value of type Num that
77657 corresponds to the sequence input, preserving the sign
77658 (positive if none has been specified) of a zero value if Num
77659 is a floating point type and Num'Signed_Zeros is True.
77660
77661 21
77662 The exception Data_Error is propagated if the sequence input
77663 does not have the required syntax or if the value obtained is
77664 not of the subtype Num.
77665
77666 22
77667 procedure Put(File : in File_Type;
77668 Item : in Num;
77669 Fore : in Field := Default_Fore;
77670 Aft : in Field := Default_Aft;
77671 Exp : in Field := Default_Exp);
77672
77673 procedure Put(Item : in Num;
77674 Fore : in Field := Default_Fore;
77675 Aft : in Field := Default_Aft;
77676 Exp : in Field := Default_Exp);
77677
77678 23
77679 Outputs the value of the parameter Item as a decimal literal
77680 with the format defined by Fore, Aft and Exp. If the value is
77681 negative, or if Num is a floating point type where
77682 Num'Signed_Zeros is True and the value is a negatively signed
77683 zero, then a minus sign is included in the integer part. If
77684 Exp has the value zero, then the integer part to be output has
77685 as many digits as are needed to represent the integer part of
77686 the value of Item, overriding Fore if necessary, or consists
77687 of the digit zero if the value of Item has no integer part.
77688
77689 24
77690 If Exp has a value greater than zero, then the integer part to
77691 be output has a single digit, which is nonzero except for the
77692 value 0.0 of Item.
77693
77694 25
77695 In both cases, however, if the integer part to be output has
77696 fewer than Fore characters, including any minus sign, then
77697 leading spaces are first output to make up the difference.
77698 The number of digits of the fractional part is given by Aft,
77699 or is one if Aft equals zero. The value is rounded; a value
77700 of exactly one half in the last place is rounded away from
77701 zero.
77702
77703 26
77704 If Exp has the value zero, there is no exponent part. If Exp
77705 has a value greater than zero, then the exponent part to be
77706 output has as many digits as are needed to represent the
77707 exponent part of the value of Item (for which a single digit
77708 integer part is used), and includes an initial sign (plus or
77709 minus). If the exponent part to be output has fewer than Exp
77710 characters, including the sign, then leading zeros precede the
77711 digits, to make up the difference. For the value 0.0 of Item,
77712 the exponent has the value zero.
77713
77714 27
77715 procedure Get(From : in String; Item : out Num; Last : out Positive);
77716
77717 28
77718 Reads a real value from the beginning of the given string,
77719 following the same rule as the Get procedure that reads a real
77720 value from a file, but treating the end of the string as a
77721 file terminator. Returns, in the parameter Item, the value of
77722 type Num that corresponds to the sequence input. Returns in
77723 Last the index value such that From(Last) is the last
77724 character read.
77725
77726 29
77727 The exception Data_Error is propagated if the sequence input
77728 does not have the required syntax, or if the value obtained is
77729 not of the subtype Num.
77730
77731 30
77732 procedure Put(To : out String;
77733 Item : in Num;
77734 Aft : in Field := Default_Aft;
77735 Exp : in Field := Default_Exp);
77736
77737 31
77738 Outputs the value of the parameter Item to the given string,
77739 following the same rule as for output to a file, using a value
77740 for Fore such that the sequence of characters output exactly
77741 fills the string, including any leading spaces.
77742
77743 32
77744 Float_Text_IO is a library package that is a nongeneric equivalent to
77745 Text_IO.Float_IO for the predefined type Float:
77746
77747 33
77748 with Ada.Text_IO;
77749 package Ada.Float_Text_IO is new Ada.Text_IO.Float_IO(Float);
77750
77751 34
77752 For each predefined floating point type, a nongeneric equivalent to
77753 Text_IO.Float_IO is provided, with names such as Ada.Long_Float_Text_IO.
77754
77755 _Implementation Permissions_
77756
77757 35
77758 An implementation may extend Get [and Put] for floating point types to
77759 support special values such as infinities and NaNs.
77760
77761 35.a/3
77762 Discussion: {AI05-0005-1AI05-0005-1} See also the similar
77763 permission for the Wide_Wide_Value, Wide_Value, and Value
77764 attributes in *note 3.5::.
77765
77766 36
77767 The implementation of Put need not produce an output value with greater
77768 accuracy than is supported for the base subtype. The additional
77769 accuracy, if any, of the value produced by Put when the number of
77770 requested digits in the integer and fractional parts exceeds the
77771 required accuracy is implementation defined.
77772
77773 36.a
77774 Discussion: The required accuracy is thus Num'Base'Digits
77775 digits if Num is a floating point subtype. For a fixed point
77776 subtype the required accuracy is a function of the subtype's
77777 Fore, Aft, and Delta attributes.
77778
77779 36.b
77780 Implementation defined: The accuracy of the value produced by
77781 Put.
77782
77783 37
77784 The nongeneric equivalent packages may, but need not, be actual
77785 instantiations of the generic package for the appropriate predefined
77786 type.
77787
77788 NOTES
77789
77790 38
77791 34 For an item with a positive value, if output to a string
77792 exactly fills the string without leading spaces, then output of the
77793 corresponding negative value will propagate Layout_Error.
77794
77795 39
77796 35 The rules for the Value attribute (see *note 3.5::) and the
77797 rules for Get are based on the same set of formats.
77798
77799 _Examples_
77800
77801 40/1
77802 This paragraph was deleted.
77803
77804 41
77805 package Real_IO is new Float_IO(Real); use Real_IO;
77806 -- default format used at instantiation, Default_Exp = 3
77807
77808 42
77809 X : Real := -123.4567; -- digits 8 (see *note 3.5.7::)
77810
77811 43
77812 Put(X); -- default format "-1.2345670E+02"
77813 Put(X, Fore => 5, Aft => 3, Exp => 2); -- "bbb-1.235E+2"
77814 Put(X, 5, 3, 0); -- "b-123.457"
77815
77816 \1f
77817 File: aarm2012.info, Node: A.10.10, Next: A.10.11, Prev: A.10.9, Up: A.10
77818
77819 A.10.10 Input-Output for Enumeration Types
77820 ------------------------------------------
77821
77822 _Static Semantics_
77823
77824 1
77825 The following procedures are defined in the generic package
77826 Enumeration_IO, which has to be instantiated for the appropriate
77827 enumeration type (indicated by Enum in the specification).
77828
77829 2
77830 Values are output using either upper or lower case letters for
77831 identifiers. This is specified by the parameter Set, which is of the
77832 enumeration type Type_Set.
77833
77834 3
77835 type Type_Set is (Lower_Case, Upper_Case);
77836
77837 4
77838 The format (which includes any trailing spaces) can be specified by an
77839 optional field width parameter. The default field width and letter case
77840 are defined by the following variables that are declared in the generic
77841 package Enumeration_IO:
77842
77843 5
77844 Default_Width : Field := 0;
77845 Default_Setting : Type_Set := Upper_Case;
77846
77847 6
77848 The following procedures are provided:
77849
77850 7
77851 procedure Get(File : in File_Type; Item : out Enum);
77852 procedure Get(Item : out Enum);
77853
77854 8
77855 After skipping any leading blanks, line terminators, or page
77856 terminators, reads an identifier according to the syntax of
77857 this lexical element (lower and upper case being considered
77858 equivalent), or a character literal according to the syntax of
77859 this lexical element (including the apostrophes). Returns, in
77860 the parameter Item, the value of type Enum that corresponds to
77861 the sequence input.
77862
77863 9
77864 The exception Data_Error is propagated if the sequence input
77865 does not have the required syntax, or if the identifier or
77866 character literal does not correspond to a value of the
77867 subtype Enum.
77868
77869 10
77870 procedure Put(File : in File_Type;
77871 Item : in Enum;
77872 Width : in Field := Default_Width;
77873 Set : in Type_Set := Default_Setting);
77874
77875 procedure Put(Item : in Enum;
77876 Width : in Field := Default_Width;
77877 Set : in Type_Set := Default_Setting);
77878
77879 11
77880 Outputs the value of the parameter Item as an enumeration
77881 literal (either an identifier or a character literal). The
77882 optional parameter Set indicates whether lower case or upper
77883 case is used for identifiers; it has no effect for character
77884 literals. If the sequence of characters produced has fewer
77885 than Width characters, then trailing spaces are finally output
77886 to make up the difference. If Enum is a character type, the
77887 sequence of characters produced is as for Enum'Image(Item), as
77888 modified by the Width and Set parameters.
77889
77890 11.a/3
77891 Discussion: {AI05-0005-1AI05-0005-1} For a character type, the
77892 literal might be a Wide_Wide_Character, Wide_Character, or a
77893 control character. Whatever Image does for these things is
77894 appropriate here, too.
77895
77896 11.b/3
77897 {AI05-0036-1AI05-0036-1} The "characters produced" defines the
77898 "characters to be output" in the sense of *note A.10.6::, so a
77899 result that cannot fit on any bounded line will raise
77900 Layout_Error.
77901
77902 12
77903 procedure Get(From : in String; Item : out Enum; Last : out Positive);
77904
77905 13
77906 Reads an enumeration value from the beginning of the given
77907 string, following the same rule as the Get procedure that
77908 reads an enumeration value from a file, but treating the end
77909 of the string as a file terminator. Returns, in the parameter
77910 Item, the value of type Enum that corresponds to the sequence
77911 input. Returns in Last the index value such that From(Last)
77912 is the last character read.
77913
77914 14
77915 The exception Data_Error is propagated if the sequence input
77916 does not have the required syntax, or if the identifier or
77917 character literal does not correspond to a value of the
77918 subtype Enum.
77919
77920 14.a/3
77921 To be honest: {AI05-0005-1AI05-0005-1} For a character type,
77922 it is permissible for the implementation to make Get do the
77923 inverse of what Put does, in the case of wide and wide_wide
77924 character_literals and control characters.
77925
77926 15
77927 procedure Put(To : out String;
77928 Item : in Enum;
77929 Set : in Type_Set := Default_Setting);
77930
77931 16
77932 Outputs the value of the parameter Item to the given string,
77933 following the same rule as for output to a file, using the
77934 length of the given string as the value for Width.
77935
77936 17/1
77937 {8652/00548652/0054} {AI95-00007-01AI95-00007-01} Although the
77938 specification of the generic package Enumeration_IO would allow
77939 instantiation for an integer type, this is not the intended purpose of
77940 this generic package, and the effect of such instantiations is not
77941 defined by the language.
77942
77943 NOTES
77944
77945 18
77946 36 There is a difference between Put defined for characters, and
77947 for enumeration values. Thus
77948
77949 19
77950 Ada.Text_IO.Put('A'); -- outputs the character A
77951
77952 20
77953 package Char_IO is new Ada.Text_IO.Enumeration_IO(Character);
77954 Char_IO.Put('A'); -- outputs the character 'A', between apostrophes
77955
77956 21
77957 37 The type Boolean is an enumeration type, hence Enumeration_IO
77958 can be instantiated for this type.
77959
77960 _Wording Changes from Ada 95_
77961
77962 21.a/2
77963 {8652/00548652/0054} {AI95-00007-01AI95-00007-01} Corrigendum:
77964 Corrected the wording to say Enumeration_IO can be
77965 instantiated with an integer type, not a float type.
77966
77967 \1f
77968 File: aarm2012.info, Node: A.10.11, Next: A.10.12, Prev: A.10.10, Up: A.10
77969
77970 A.10.11 Input-Output for Bounded Strings
77971 ----------------------------------------
77972
77973 1/2
77974 {AI95-00428-01AI95-00428-01} The package Text_IO.Bounded_IO provides
77975 input-output in human-readable form for Bounded_Strings.
77976
77977 _Static Semantics_
77978
77979 2/2
77980 {AI95-00428-01AI95-00428-01} The generic library package
77981 Text_IO.Bounded_IO has the following declaration:
77982
77983 3/2
77984 with Ada.Strings.Bounded;
77985 generic
77986 with package Bounded is
77987 new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
77988 package Ada.Text_IO.Bounded_IO is
77989
77990 4/2
77991 procedure Put
77992 (File : in File_Type;
77993 Item : in Bounded.Bounded_String);
77994
77995 5/2
77996 procedure Put
77997 (Item : in Bounded.Bounded_String);
77998
77999 6/2
78000 procedure Put_Line
78001 (File : in File_Type;
78002 Item : in Bounded.Bounded_String);
78003
78004 7/2
78005 procedure Put_Line
78006 (Item : in Bounded.Bounded_String);
78007
78008 8/2
78009 function Get_Line
78010 (File : in File_Type)
78011 return Bounded.Bounded_String;
78012
78013 9/2
78014 function Get_Line
78015 return Bounded.Bounded_String;
78016
78017 10/2
78018 procedure Get_Line
78019 (File : in File_Type; Item : out Bounded.Bounded_String);
78020
78021 11/2
78022 procedure Get_Line
78023 (Item : out Bounded.Bounded_String);
78024
78025 12/2
78026 end Ada.Text_IO.Bounded_IO;
78027
78028 13/2
78029 {AI95-00428-01AI95-00428-01} For an item of type Bounded_String, the
78030 following subprograms are provided:
78031
78032 14/2
78033 procedure Put
78034 (File : in File_Type;
78035 Item : in Bounded.Bounded_String);
78036
78037 15/2
78038 {AI95-00428-01AI95-00428-01} Equivalent to Text_IO.Put (File,
78039 Bounded.To_String(Item));
78040
78041 16/2
78042 procedure Put
78043 (Item : in Bounded.Bounded_String);
78044
78045 17/2
78046 {AI95-00428-01AI95-00428-01} Equivalent to Text_IO.Put
78047 (Bounded.To_String(Item));
78048
78049 18/2
78050 procedure Put_Line
78051 (File : in File_Type;
78052 Item : in Bounded.Bounded_String);
78053
78054 19/2
78055 {AI95-00428-01AI95-00428-01} Equivalent to Text_IO.Put_Line
78056 (File, Bounded.To_String(Item));
78057
78058 20/2
78059 procedure Put_Line
78060 (Item : in Bounded.Bounded_String);
78061
78062 21/2
78063 {AI95-00428-01AI95-00428-01} Equivalent to Text_IO.Put_Line
78064 (Bounded.To_String(Item));
78065
78066 22/2
78067 function Get_Line
78068 (File : in File_Type)
78069 return Bounded.Bounded_String;
78070
78071 23/2
78072 {AI95-00428-01AI95-00428-01} Returns
78073 Bounded.To_Bounded_String(Text_IO.Get_Line(File));
78074
78075 24/2
78076 function Get_Line
78077 return Bounded.Bounded_String;
78078
78079 25/2
78080 {AI95-00428-01AI95-00428-01} Returns
78081 Bounded.To_Bounded_String(Text_IO.Get_Line);
78082
78083 26/2
78084 procedure Get_Line
78085 (File : in File_Type; Item : out Bounded.Bounded_String);
78086
78087 27/2
78088 {AI95-00428-01AI95-00428-01} Equivalent to Item := Get_Line
78089 (File);
78090
78091 28/2
78092 procedure Get_Line
78093 (Item : out Bounded.Bounded_String);
78094
78095 29/2
78096 {AI95-00428-01AI95-00428-01} Equivalent to Item := Get_Line;
78097
78098 _Extensions to Ada 95_
78099
78100 29.a/2
78101 {AI95-00428-01AI95-00428-01} Package Text_IO.Bounded_IO is
78102 new.
78103
78104 \1f
78105 File: aarm2012.info, Node: A.10.12, Prev: A.10.11, Up: A.10
78106
78107 A.10.12 Input-Output for Unbounded Strings
78108 ------------------------------------------
78109
78110 1/2
78111 {AI95-00301-01AI95-00301-01} The package Text_IO.Unbounded_IO provides
78112 input-output in human-readable form for Unbounded_Strings.
78113
78114 _Static Semantics_
78115
78116 2/2
78117 {AI95-00301-01AI95-00301-01} The library package Text_IO.Unbounded_IO
78118 has the following declaration:
78119
78120 3/2
78121 with Ada.Strings.Unbounded;
78122 package Ada.Text_IO.Unbounded_IO is
78123
78124 4/2
78125 procedure Put
78126 (File : in File_Type;
78127 Item : in Strings.Unbounded.Unbounded_String);
78128
78129 5/2
78130 procedure Put
78131 (Item : in Strings.Unbounded.Unbounded_String);
78132
78133 6/2
78134 procedure Put_Line
78135 (File : in File_Type;
78136 Item : in Strings.Unbounded.Unbounded_String);
78137
78138 7/2
78139 procedure Put_Line
78140 (Item : in Strings.Unbounded.Unbounded_String);
78141
78142 8/2
78143 function Get_Line
78144 (File : in File_Type)
78145 return Strings.Unbounded.Unbounded_String;
78146
78147 9/2
78148 function Get_Line
78149 return Strings.Unbounded.Unbounded_String;
78150
78151 10/2
78152 procedure Get_Line
78153 (File : in File_Type; Item : out Strings.Unbounded.Unbounded_String);
78154
78155 11/2
78156 procedure Get_Line
78157 (Item : out Strings.Unbounded.Unbounded_String);
78158
78159 12/2
78160 end Ada.Text_IO.Unbounded_IO;
78161
78162 13/2
78163 {AI95-00301-01AI95-00301-01} For an item of type Unbounded_String, the
78164 following subprograms are provided:
78165
78166 14/2
78167 procedure Put
78168 (File : in File_Type;
78169 Item : in Strings.Unbounded.Unbounded_String);
78170
78171 15/2
78172 {AI95-00301-01AI95-00301-01} Equivalent to Text_IO.Put (File,
78173 Strings.Unbounded.To_String(Item));
78174
78175 16/2
78176 procedure Put
78177 (Item : in Strings.Unbounded.Unbounded_String);
78178
78179 17/2
78180 {AI95-00301-01AI95-00301-01} Equivalent to Text_IO.Put
78181 (Strings.Unbounded.To_String(Item));
78182
78183 18/2
78184 procedure Put_Line
78185 (File : in File_Type;
78186 Item : in Strings.Unbounded.Unbounded_String);
78187
78188 19/2
78189 {AI95-00301-01AI95-00301-01} Equivalent to Text_IO.Put_Line
78190 (File, Strings.Unbounded.To_String(Item));
78191
78192 20/2
78193 procedure Put_Line
78194 (Item : in Strings.Unbounded.Unbounded_String);
78195
78196 21/2
78197 {AI95-00301-01AI95-00301-01} Equivalent to Text_IO.Put_Line
78198 (Strings.Unbounded.To_String(Item));
78199
78200 22/2
78201 function Get_Line
78202 (File : in File_Type)
78203 return Strings.Unbounded.Unbounded_String;
78204
78205 23/2
78206 {AI95-00301-01AI95-00301-01} Returns
78207 Strings.Unbounded.To_Unbounded_String(Text_IO.Get_Line(File));
78208
78209 24/2
78210 function Get_Line
78211 return Strings.Unbounded.Unbounded_String;
78212
78213 25/2
78214 {AI95-00301-01AI95-00301-01} Returns
78215 Strings.Unbounded.To_Unbounded_String(Text_IO.Get_Line);
78216
78217 26/2
78218 procedure Get_Line
78219 (File : in File_Type; Item : out Strings.Unbounded.Unbounded_String);
78220
78221 27/2
78222 {AI95-00301-01AI95-00301-01} Equivalent to Item := Get_Line
78223 (File);
78224
78225 28/2
78226 procedure Get_Line
78227 (Item : out Strings.Unbounded.Unbounded_String);
78228
78229 29/2
78230 {AI95-00301-01AI95-00301-01} Equivalent to Item := Get_Line;
78231
78232 _Extensions to Ada 95_
78233
78234 29.a/2
78235 {AI95-00301-01AI95-00301-01} Package Text_IO.Unbounded_IO is
78236 new.
78237
78238 \1f
78239 File: aarm2012.info, Node: A.11, Next: A.12, Prev: A.10, Up: Annex A
78240
78241 A.11 Wide Text Input-Output and Wide Wide Text Input-Output
78242 ===========================================================
78243
78244 1/2
78245 {AI95-00285-01AI95-00285-01} The packages Wide_Text_IO and
78246 Wide_Wide_Text_IO provide facilities for input and output in
78247 human-readable form. Each file is read or written sequentially, as a
78248 sequence of wide characters (or wide wide characters) grouped into
78249 lines, and as a sequence of lines grouped into pages.
78250
78251 _Static Semantics_
78252
78253 2/2
78254 {AI95-00285-01AI95-00285-01} {AI95-00301-01AI95-00301-01} The
78255 specification of package Wide_Text_IO is the same as that for Text_IO,
78256 except that in each Get, Look_Ahead, Get_Immediate, Get_Line, Put, and
78257 Put_Line subprogram, any occurrence of Character is replaced by
78258 Wide_Character, and any occurrence of String is replaced by Wide_String.
78259 Nongeneric equivalents of Wide_Text_IO.Integer_IO and
78260 Wide_Text_IO.Float_IO are provided (as for Text_IO) for each predefined
78261 numeric type, with names such as Ada.Integer_Wide_Text_IO,
78262 Ada.Long_Integer_Wide_Text_IO, Ada.Float_Wide_Text_IO,
78263 Ada.Long_Float_Wide_Text_IO.
78264
78265 3/2
78266 {AI95-00285-01AI95-00285-01} {AI95-00301-01AI95-00301-01} The
78267 specification of package Wide_Wide_Text_IO is the same as that for
78268 Text_IO, except that in each Get, Look_Ahead, Get_Immediate, Get_Line,
78269 Put, and Put_Line subprogram, any occurrence of Character is replaced by
78270 Wide_Wide_Character, and any occurrence of String is replaced by
78271 Wide_Wide_String. Nongeneric equivalents of
78272 Wide_Wide_Text_IO.Integer_IO and Wide_Wide_Text_IO.Float_IO are provided
78273 (as for Text_IO) for each predefined numeric type, with names such as
78274 Ada.Integer_Wide_Wide_Text_IO, Ada.Long_Integer_Wide_Wide_Text_IO,
78275 Ada.Float_Wide_Wide_Text_IO, Ada.Long_Float_Wide_Wide_Text_IO.
78276
78277 4/3
78278 {AI95-00285-01AI95-00285-01} {AI95-00428-01AI95-00428-01}
78279 {AI05-0004-1AI05-0004-1} {AI05-0092-1AI05-0092-1} The specification of
78280 package Wide_Text_IO.Wide_Bounded_IO is the same as that for
78281 Text_IO.Bounded_IO, except that any occurrence of Bounded_String is
78282 replaced by Bounded_Wide_String, and any occurrence of package Bounded
78283 is replaced by Wide_Bounded. The specification of package
78284 Wide_Wide_Text_IO.Wide_Wide_Bounded_IO is the same as that for
78285 Text_IO.Bounded_IO, except that any occurrence of Bounded_String is
78286 replaced by Bounded_Wide_Wide_String, and any occurrence of package
78287 Bounded is replaced by Wide_Wide_Bounded.
78288
78289 4.a/3
78290 To be honest: {AI05-0005-1AI05-0005-1} "package Bounded"
78291 refers to both the package Ada.Strings.Bounded and the formal
78292 package parameter named Bounded.
78293
78294 5/3
78295 {AI95-00285-01AI95-00285-01} {AI95-00301-01AI95-00301-01}
78296 {AI05-0092-1AI05-0092-1} The specification of package
78297 Wide_Text_IO.Wide_Unbounded_IO is the same as that for
78298 Text_IO.Unbounded_IO, except that any occurrence of Unbounded_String is
78299 replaced by Unbounded_Wide_String, and any occurrence of package
78300 Unbounded is replaced by Wide_Unbounded. The specification of package
78301 Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO is the same as that for
78302 Text_IO.Unbounded_IO, except that any occurrence of Unbounded_String is
78303 replaced by Unbounded_Wide_Wide_String, and any occurrence of package
78304 Unbounded is replaced by Wide_Wide_Unbounded.
78305
78306 _Extensions to Ada 83_
78307
78308 5.a
78309 Support for Wide_Character and Wide_String I/O is new in Ada
78310 95.
78311
78312 _Extensions to Ada 95_
78313
78314 5.b/2
78315 {AI95-00285-01AI95-00285-01} Package Wide_Wide_Text_IO is new.
78316 Be glad it wasn't called Double_Wide_Text_IO (for use in
78317 trailer parks) or Really_Wide_Text_IO.
78318
78319 5.c/2
78320 {AI95-00301-01AI95-00301-01} Packages
78321 Wide_Text_IO.Wide_Unbounded_IO and
78322 Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO are also new.
78323
78324 5.d/2
78325 {AI95-00428-01AI95-00428-01} Packages
78326 Wide_Text_IO.Wide_Bounded_IO and
78327 Wide_Wide_Text_IO.Wide_Wide_Bounded_IO are new as well.
78328
78329 _Wording Changes from Ada 2005_
78330
78331 5.e/3
78332 {AI05-0092-1AI05-0092-1} Correction: Corrected the names of
78333 various entities in the above description. Since the
78334 previously named entities don't exist and the intent is
78335 obvious, this is just considered a presentation change.
78336
78337 \1f
78338 File: aarm2012.info, Node: A.12, Next: A.13, Prev: A.11, Up: Annex A
78339
78340 A.12 Stream Input-Output
78341 ========================
78342
78343 1/2
78344 {AI95-00285-01AI95-00285-01} The packages Streams.Stream_IO,
78345 Text_IO.Text_Streams, Wide_Text_IO.Text_Streams, and
78346 Wide_Wide_Text_IO.Text_Streams provide stream-oriented operations on
78347 files.
78348
78349 _Wording Changes from Ada 95_
78350
78351 1.a/2
78352 {AI95-00285-01AI95-00285-01} Included package
78353 Wide_Wide_Text_IO.Text_Streams in this description.
78354
78355 * Menu:
78356
78357 * A.12.1 :: The Package Streams.Stream_IO
78358 * A.12.2 :: The Package Text_IO.Text_Streams
78359 * A.12.3 :: The Package Wide_Text_IO.Text_Streams
78360 * A.12.4 :: The Package Wide_Wide_Text_IO.Text_Streams
78361
78362 \1f
78363 File: aarm2012.info, Node: A.12.1, Next: A.12.2, Up: A.12
78364
78365 A.12.1 The Package Streams.Stream_IO
78366 ------------------------------------
78367
78368 1
78369 [The subprograms in the child package Streams.Stream_IO provide control
78370 over stream files. Access to a stream file is either sequential, via a
78371 call on Read or Write to transfer an array of stream elements, or
78372 positional (if supported by the implementation for the given file), by
78373 specifying a relative index for an element. Since a stream file can be
78374 converted to a Stream_Access value, calling stream-oriented attribute
78375 subprograms of different element types with the same Stream_Access value
78376 provides heterogeneous input-output.] See *note 13.13:: for a general
78377 discussion of streams.
78378
78379 _Static Semantics_
78380
78381 1.1/1
78382 {8652/00558652/0055} {AI95-00026-01AI95-00026-01} The elements of a
78383 stream file are stream elements. If positioning is supported for the
78384 specified external file, a current index and current size are maintained
78385 for the file as described in *note A.8::. If positioning is not
78386 supported, a current index is not maintained, and the current size is
78387 implementation defined.
78388
78389 1.a.1/1
78390 Implementation defined: Current size for a stream file for
78391 which positioning is not supported.
78392
78393 2
78394 The library package Streams.Stream_IO has the following declaration:
78395
78396 3/3
78397 {AI05-0283-1AI05-0283-1} with Ada.IO_Exceptions;
78398 package Ada.Streams.Stream_IO is
78399 pragma Preelaborate(Stream_IO);
78400
78401 4
78402 type Stream_Access is access all Root_Stream_Type'Class;
78403
78404 5
78405 type File_Type is limited private;
78406
78407 6
78408 type File_Mode is (In_File, Out_File, Append_File);
78409
78410 7
78411 type Count is range 0 .. implementation-defined;
78412 subtype Positive_Count is Count range 1 .. Count'Last;
78413 -- Index into file, in stream elements.
78414
78415 8
78416 procedure Create (File : in out File_Type;
78417 Mode : in File_Mode := Out_File;
78418 Name : in String := "";
78419 Form : in String := "");
78420
78421 9
78422 procedure Open (File : in out File_Type;
78423 Mode : in File_Mode;
78424 Name : in String;
78425 Form : in String := "");
78426
78427 10
78428 procedure Close (File : in out File_Type);
78429 procedure Delete (File : in out File_Type);
78430 procedure Reset (File : in out File_Type; Mode : in File_Mode);
78431 procedure Reset (File : in out File_Type);
78432
78433 11
78434 function Mode (File : in File_Type) return File_Mode;
78435 function Name (File : in File_Type) return String;
78436 function Form (File : in File_Type) return String;
78437
78438 12
78439 function Is_Open (File : in File_Type) return Boolean;
78440 function End_Of_File (File : in File_Type) return Boolean;
78441
78442 13
78443 function Stream (File : in File_Type) return Stream_Access;
78444 -- Return stream access for use with T'Input and T'Output
78445
78446 14/1
78447 This paragraph was deleted.
78448
78449 15
78450 -- Read array of stream elements from file
78451 procedure Read (File : in File_Type;
78452 Item : out Stream_Element_Array;
78453 Last : out Stream_Element_Offset;
78454 From : in Positive_Count);
78455
78456 16
78457 procedure Read (File : in File_Type;
78458 Item : out Stream_Element_Array;
78459 Last : out Stream_Element_Offset);
78460
78461 17/1
78462 This paragraph was deleted.
78463
78464 18
78465 -- Write array of stream elements into file
78466 procedure Write (File : in File_Type;
78467 Item : in Stream_Element_Array;
78468 To : in Positive_Count);
78469
78470 19
78471 procedure Write (File : in File_Type;
78472 Item : in Stream_Element_Array);
78473
78474 20/1
78475 This paragraph was deleted.
78476
78477 21
78478 -- Operations on position within file
78479
78480 22
78481 procedure Set_Index(File : in File_Type; To : in Positive_Count);
78482
78483 23
78484 function Index(File : in File_Type) return Positive_Count;
78485 function Size (File : in File_Type) return Count;
78486
78487 24
78488 procedure Set_Mode(File : in out File_Type; Mode : in File_Mode);
78489
78490 25/1
78491 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} procedure Flush(File : in File_Type);
78492
78493 26
78494 -- exceptions
78495 Status_Error : exception renames IO_Exceptions.Status_Error;
78496 Mode_Error : exception renames IO_Exceptions.Mode_Error;
78497 Name_Error : exception renames IO_Exceptions.Name_Error;
78498 Use_Error : exception renames IO_Exceptions.Use_Error;
78499 Device_Error : exception renames IO_Exceptions.Device_Error;
78500 End_Error : exception renames IO_Exceptions.End_Error;
78501 Data_Error : exception renames IO_Exceptions.Data_Error;
78502
78503 27
78504 private
78505 ... -- not specified by the language
78506 end Ada.Streams.Stream_IO;
78507
78508 27.1/2
78509 {AI95-00360-01AI95-00360-01} The type File_Type needs finalization (see
78510 *note 7.6::).
78511
78512 28/2
78513 {AI95-00283-01AI95-00283-01} The subprograms given in subclause *note
78514 A.8.2:: for the control of external files (Create, Open, Close, Delete,
78515 Reset, Mode, Name, Form, and Is_Open) are available for stream files.
78516
78517 28.1/2
78518 {AI95-00283-01AI95-00283-01} The End_Of_File function:
78519
78520 28.2/2
78521 * Propagates Mode_Error if the mode of the file is not In_File;
78522
78523 28.3/3
78524 * {AI05-0264-1AI05-0264-1} If positioning is supported for the given
78525 external file, the function returns True if the current index
78526 exceeds the size of the external file; otherwise, it returns False;
78527
78528 28.4/3
78529 * {AI05-0264-1AI05-0264-1} If positioning is not supported for the
78530 given external file, the function returns True if no more elements
78531 can be read from the given file; otherwise, it returns False.
78532
78533 28.5/2
78534 {8652/00558652/0055} {AI95-00026-01AI95-00026-01}
78535 {AI95-00085-01AI95-00085-01} The Set_Mode procedure sets the mode of the
78536 file. If the new mode is Append_File, the file is positioned to its
78537 end; otherwise, the position in the file is unchanged.
78538
78539 28.6/1
78540 {8652/00558652/0055} {AI95-00026-01AI95-00026-01} The Flush procedure
78541 synchronizes the external file with the internal file (by flushing any
78542 internal buffers) without closing the file or changing the position.
78543 Mode_Error is propagated if the mode of the file is In_File.
78544
78545 29/1
78546 {8652/00568652/0056} {AI95-00001-01AI95-00001-01} The Stream function
78547 returns a Stream_Access result from a File_Type object, thus allowing
78548 the stream-oriented attributes Read, Write, Input, and Output to be used
78549 on the same file for multiple types. Stream propagates Status_Error if
78550 File is not open.
78551
78552 30/2
78553 {AI95-00256-01AI95-00256-01} The procedures Read and Write are
78554 equivalent to the corresponding operations in the package Streams. Read
78555 propagates Mode_Error if the mode of File is not In_File. Write
78556 propagates Mode_Error if the mode of File is not Out_File or
78557 Append_File. The Read procedure with a Positive_Count parameter starts
78558 reading at the specified index. The Write procedure with a
78559 Positive_Count parameter starts writing at the specified index. For a
78560 file that supports positioning, Read without a Positive_Count parameter
78561 starts reading at the current index, and Write without a Positive_Count
78562 parameter starts writing at the current index.
78563
78564 30.1/1
78565 {8652/00558652/0055} {AI95-00026-01AI95-00026-01} The Size function
78566 returns the current size of the file.
78567
78568 31/1
78569 {8652/00558652/0055} {AI95-00026-01AI95-00026-01} The Index function
78570 returns the current index.
78571
78572 31.a/1
78573 This paragraph was deleted.
78574
78575 32
78576 The Set_Index procedure sets the current index to the specified value.
78577
78578 32.1/1
78579 {8652/00558652/0055} {AI95-00026-01AI95-00026-01} If positioning is
78580 supported for the external file, the current index is maintained as
78581 follows:
78582
78583 32.2/1
78584 * {8652/00558652/0055} {AI95-00026-01AI95-00026-01} For Open and
78585 Create, if the Mode parameter is Append_File, the current index is
78586 set to the current size of the file plus one; otherwise, the
78587 current index is set to one.
78588
78589 32.3/1
78590 * {8652/00558652/0055} {AI95-00026-01AI95-00026-01} For Reset, if the
78591 Mode parameter is Append_File, or no Mode parameter is given and
78592 the current mode is Append_File, the current index is set to the
78593 current size of the file plus one; otherwise, the current index is
78594 set to one.
78595
78596 32.4/1
78597 * {8652/00558652/0055} {AI95-00026-01AI95-00026-01} For Set_Mode, if
78598 the new mode is Append_File, the current index is set to current
78599 size plus one; otherwise, the current index is unchanged.
78600
78601 32.5/1
78602 * {8652/00558652/0055} {AI95-00026-01AI95-00026-01} For Read and
78603 Write without a Positive_Count parameter, the current index is
78604 incremented by the number of stream elements read or written.
78605
78606 32.6/1
78607 * {8652/00558652/0055} {AI95-00026-01AI95-00026-01} For Read and
78608 Write with a Positive_Count parameter, the value of the current
78609 index is set to the value of the Positive_Count parameter plus the
78610 number of stream elements read or written.
78611
78612 33
78613 If positioning is not supported for the given file, then a call of Index
78614 or Set_Index propagates Use_Error. Similarly, a call of Read or Write
78615 with a Positive_Count parameter propagates Use_Error.
78616
78617 33.a/2
78618 Implementation Note: {AI95-00085-01AI95-00085-01} It is
78619 permissible for an implementation to implement mode
78620 Append_File using the Unix append mode (the O_APPEND bit).
78621 Such an implementation does not support positioning when the
78622 mode is Append_File, and therefore the operations listed above
78623 must raise Use_Error. This is acceptable as there is no
78624 requirement that any particular file support positioning;
78625 therefore it is acceptable that a file support positioning
78626 when opened with mode Out_File, and the same file not support
78627 positioning when opened with mode Append_File. But it is not
78628 acceptable for a file to support positioning (by allowing the
78629 above operations), but to do something other than the defined
78630 semantics (that is, always write at the end, even when
78631 explicitly commanded to write somewhere else).
78632
78633 Paragraphs 34 through 36 were deleted.
78634
78635 _Erroneous Execution_
78636
78637 36.1/1
78638 {8652/00568652/0056} {AI95-00001-01AI95-00001-01} If the File_Type
78639 object passed to the Stream function is later closed or finalized, and
78640 the stream-oriented attributes are subsequently called (explicitly or
78641 implicitly) on the Stream_Access value returned by Stream, execution is
78642 erroneous. This rule applies even if the File_Type object was opened
78643 again after it had been closed.
78644
78645 36.a.1/1
78646 Reason: These rules are analogous to the rule for the result
78647 of the Current_Input, Current_Output, and Current_Error
78648 functions. These rules make it possible to represent a value
78649 of (some descendant of) Root_Stream_Type which represents a
78650 file as an access value, with a null value corresponding to a
78651 closed file.
78652
78653 _Inconsistencies With Ada 95_
78654
78655 36.a/3
78656 {AI95-00283-01AI95-00283-01} {AI05-0005-1AI05-0005-1}
78657 Amendment Correction: The description of the subprograms for
78658 managing files was corrected so that they do not require
78659 truncation of the external file -- a stream file is not a
78660 sequential file. An Ada 95 program that expects truncation of
78661 the stream file might not work under Ada 2005. Note that the
78662 Ada 95 standard was ambiguous on this point (the normative
78663 wording seemed to require truncation, but didn't explain
78664 where; the AARM notes seemed to expect behavior like
78665 Direct_IO), and implementations varied widely. Therefore, as
78666 a practical matter, code that depends on stream truncation
78667 might not work even in Ada 95; deleting the file before
78668 opening it provides truncation that works in both Ada 95 and
78669 Ada 2005.
78670
78671 _Incompatibilities With Ada 95_
78672
78673 36.b/2
78674 {AI95-00360-01AI95-00360-01} Amendment Correction:
78675 Stream_IO.File_Type is defined to need finalization. If the
78676 restriction No_Nested_Finalization (see *note D.7::) applies
78677 to the partition, and File_Type does not have a controlled
78678 part, it will not be allowed in local objects in Ada 2005
78679 whereas it would be allowed in original Ada 95. Such code is
78680 not portable, as another Ada compiler may have a controlled
78681 part in File_Type, and thus would be illegal.
78682
78683 _Wording Changes from Ada 95_
78684
78685 36.c/2
78686 {8652/00518652/0051} {AI95-00057-01AI95-00057-01} Corrigendum:
78687 Corrected the parameter mode of Flush; otherwise it could not
78688 be used on Standard_Output.
78689
78690 36.d/2
78691 {8652/00558652/0055} {AI95-00026-01AI95-00026-01}
78692 {AI95-00256-01AI95-00256-01} Corrigendum: Added wording to
78693 describe the effects of the various operations on the current
78694 index. The Amendment adds an explanation of the use of
78695 current index for Read and Write.
78696
78697 36.e/2
78698 {8652/00568652/0056} {AI95-00001-01AI95-00001-01} Corrigendum:
78699 Clarified that Stream can raise Status_Error, and clarified
78700 that using a Stream_Access whose file has been closed is
78701 erroneous.
78702
78703 36.f/2
78704 {AI95-00085-01AI95-00085-01} Clarified that Set_Mode can be
78705 called with the current mode.
78706
78707 _Extensions to Ada 2005_
78708
78709 36.g/3
78710 {AI05-0283-1AI05-0283-1} Package Ada.Streams.Stream_IO is now
78711 preelaborated, allowing it to be used in more contexts
78712 (including in distributed systems). Note that is not a remote
78713 types package; File_Type objects cannot be passed between
78714 partitions.
78715
78716 \1f
78717 File: aarm2012.info, Node: A.12.2, Next: A.12.3, Prev: A.12.1, Up: A.12
78718
78719 A.12.2 The Package Text_IO.Text_Streams
78720 ---------------------------------------
78721
78722 1
78723 The package Text_IO.Text_Streams provides a function for treating a text
78724 file as a stream.
78725
78726 _Static Semantics_
78727
78728 2
78729 The library package Text_IO.Text_Streams has the following declaration:
78730
78731 3
78732 with Ada.Streams;
78733 package Ada.Text_IO.Text_Streams is
78734 type Stream_Access is access all Streams.Root_Stream_Type'Class;
78735
78736 4
78737 function Stream (File : in File_Type) return Stream_Access;
78738 end Ada.Text_IO.Text_Streams;
78739
78740 5
78741 The Stream function has the same effect as the corresponding function in
78742 Streams.Stream_IO.
78743
78744 NOTES
78745
78746 6
78747 38 The ability to obtain a stream for a text file allows
78748 Current_Input, Current_Output, and Current_Error to be processed
78749 with the functionality of streams, including the mixing of text and
78750 binary input-output, and the mixing of binary input-output for
78751 different types.
78752
78753 7
78754 39 Performing operations on the stream associated with a text file
78755 does not affect the column, line, or page counts.
78756
78757 \1f
78758 File: aarm2012.info, Node: A.12.3, Next: A.12.4, Prev: A.12.2, Up: A.12
78759
78760 A.12.3 The Package Wide_Text_IO.Text_Streams
78761 --------------------------------------------
78762
78763 1
78764 The package Wide_Text_IO.Text_Streams provides a function for treating a
78765 wide text file as a stream.
78766
78767 _Static Semantics_
78768
78769 2
78770 The library package Wide_Text_IO.Text_Streams has the following
78771 declaration:
78772
78773 3
78774 with Ada.Streams;
78775 package Ada.Wide_Text_IO.Text_Streams is
78776 type Stream_Access is access all Streams.Root_Stream_Type'Class;
78777
78778 4
78779 function Stream (File : in File_Type) return Stream_Access;
78780 end Ada.Wide_Text_IO.Text_Streams;
78781
78782 5
78783 The Stream function has the same effect as the corresponding function in
78784 Streams.Stream_IO.
78785
78786 \1f
78787 File: aarm2012.info, Node: A.12.4, Prev: A.12.3, Up: A.12
78788
78789 A.12.4 The Package Wide_Wide_Text_IO.Text_Streams
78790 -------------------------------------------------
78791
78792 1/2
78793 {AI95-00285-01AI95-00285-01} The package Wide_Wide_Text_IO.Text_Streams
78794 provides a function for treating a wide wide text file as a stream.
78795
78796 _Static Semantics_
78797
78798 2/2
78799 {AI95-00285-01AI95-00285-01} The library package
78800 Wide_Wide_Text_IO.Text_Streams has the following declaration:
78801
78802 3/2
78803 with Ada.Streams;
78804 package Ada.Wide_Wide_Text_IO.Text_Streams is
78805 type Stream_Access is access all Streams.Root_Stream_Type'Class;
78806
78807 4/2
78808 function Stream (File : in File_Type) return Stream_Access;
78809 end Ada.Wide_Wide_Text_IO.Text_Streams;
78810
78811 5/2
78812 {AI95-00285-01AI95-00285-01} The Stream function has the same effect as
78813 the corresponding function in Streams.Stream_IO.
78814
78815 _Extensions to Ada 95_
78816
78817 5.a/2
78818 {AI95-00285-01AI95-00285-01} Package
78819 Wide_Wide_Text_IO.Text_Streams is new.
78820
78821 \1f
78822 File: aarm2012.info, Node: A.13, Next: A.14, Prev: A.12, Up: Annex A
78823
78824 A.13 Exceptions in Input-Output
78825 ===============================
78826
78827 1
78828 The package IO_Exceptions defines the exceptions needed by the
78829 predefined input-output packages.
78830
78831 _Static Semantics_
78832
78833 2
78834 The library package IO_Exceptions has the following declaration:
78835
78836 3
78837 package Ada.IO_Exceptions is
78838 pragma Pure(IO_Exceptions);
78839
78840 4
78841 Status_Error : exception;
78842 Mode_Error : exception;
78843 Name_Error : exception;
78844 Use_Error : exception;
78845 Device_Error : exception;
78846 End_Error : exception;
78847 Data_Error : exception;
78848 Layout_Error : exception;
78849
78850 5
78851 end Ada.IO_Exceptions;
78852
78853 6
78854 If more than one error condition exists, the corresponding exception
78855 that appears earliest in the following list is the one that is
78856 propagated.
78857
78858 7
78859 The exception Status_Error is propagated by an attempt to operate upon a
78860 file that is not open, and by an attempt to open a file that is already
78861 open.
78862
78863 8
78864 The exception Mode_Error is propagated by an attempt to read from, or
78865 test for the end of, a file whose current mode is Out_File or
78866 Append_File, and also by an attempt to write to a file whose current
78867 mode is In_File. In the case of Text_IO, the exception Mode_Error is
78868 also propagated by specifying a file whose current mode is Out_File or
78869 Append_File in a call of Set_Input, Skip_Line, End_Of_Line, Skip_Page,
78870 or End_Of_Page; and by specifying a file whose current mode is In_File
78871 in a call of Set_Output, Set_Line_Length, Set_Page_Length, Line_Length,
78872 Page_Length, New_Line, or New_Page.
78873
78874 9
78875 The exception Name_Error is propagated by a call of Create or Open if
78876 the string given for the parameter Name does not allow the
78877 identification of an external file. For example, this exception is
78878 propagated if the string is improper, or, alternatively, if either none
78879 or more than one external file corresponds to the string.
78880
78881 10
78882 The exception Use_Error is propagated if an operation is attempted that
78883 is not possible for reasons that depend on characteristics of the
78884 external file. For example, this exception is propagated by the
78885 procedure Create, among other circumstances, if the given mode is
78886 Out_File but the form specifies an input only device, if the parameter
78887 Form specifies invalid access rights, or if an external file with the
78888 given name already exists and overwriting is not allowed.
78889
78890 11
78891 The exception Device_Error is propagated if an input-output operation
78892 cannot be completed because of a malfunction of the underlying system.
78893
78894 12
78895 The exception End_Error is propagated by an attempt to skip (read past)
78896 the end of a file.
78897
78898 13
78899 The exception Data_Error can be propagated by the procedure Read (or by
78900 the Read attribute) if the element read cannot be interpreted as a value
78901 of the required subtype. This exception is also propagated by a
78902 procedure Get (defined in the package Text_IO) if the input character
78903 sequence fails to satisfy the required syntax, or if the value input
78904 does not belong to the range of the required subtype.
78905
78906 14
78907 The exception Layout_Error is propagated (in text input-output) by Col,
78908 Line, or Page if the value returned exceeds Count'Last. The exception
78909 Layout_Error is also propagated on output by an attempt to set column or
78910 line numbers in excess of specified maximum line or page lengths,
78911 respectively (excluding the unbounded cases). It is also propagated by
78912 an attempt to Put too many characters to a string.
78913
78914 14.1/3
78915 {AI05-0262-1AI05-0262-1} These exceptions are also propagated by various
78916 other language-defined packages and operations, see the definition of
78917 those entities for other reasons that these exceptions are propagated.
78918
78919 14.a/3
78920 Reason: {AI05-0299-1AI05-0299-1} This subclause is based in
78921 Ada 95. Later versions of Ada (starting with Technical
78922 Corrigendum 1) have added a number of additional places and
78923 reasons that cause these exceptions. In particular, TC1 says
78924 that stream attributes need to raise End_Error in some
78925 circumstances; Amendment 1 adds Ada.Directories and a number
78926 of new places and reasons that Name_Error and Use_Error are
78927 raised. There are more. We don't want to try to update this
78928 text (or even this note!) for every possible reason and place
78929 that might raise one of these exceptions, so we add this
78930 blanket statement.
78931
78932 _Documentation Requirements_
78933
78934 15
78935 The implementation shall document the conditions under which Name_Error,
78936 Use_Error and Device_Error are propagated.
78937
78938 15.a/2
78939 Documentation Requirement: The conditions under which
78940 Io_Exceptions.Name_Error, Io_Exceptions.Use_Error, and
78941 Io_Exceptions.Device_Error are propagated.
78942
78943 _Implementation Permissions_
78944
78945 16
78946 If the associated check is too complex, an implementation need not
78947 propagate Data_Error as part of a procedure Read (or the Read attribute)
78948 if the value read cannot be interpreted as a value of the required
78949 subtype.
78950
78951 16.a
78952 Ramification: An example where the implementation may choose
78953 not to perform the check is an enumeration type with a
78954 representation clause with "holes" in the range of internal
78955 codes.
78956
78957 _Erroneous Execution_
78958
78959 17
78960 [If the element read by the procedure Read (or by the Read attribute)
78961 cannot be interpreted as a value of the required subtype, but this is
78962 not detected and Data_Error is not propagated, then the resulting value
78963 can be abnormal, and subsequent references to the value can lead to
78964 erroneous execution, as explained in *note 13.9.1::. ]
78965
78966 \1f
78967 File: aarm2012.info, Node: A.14, Next: A.15, Prev: A.13, Up: Annex A
78968
78969 A.14 File Sharing
78970 =================
78971
78972 _Dynamic Semantics_
78973
78974 1
78975 It is not specified by the language whether the same external file can
78976 be associated with more than one file object. If such sharing is
78977 supported by the implementation, the following effects are defined:
78978
78979 2
78980 * Operations on one text file object do not affect the column, line,
78981 and page numbers of any other file object.
78982
78983 3/1
78984 * This paragraph was deleted.{8652/00578652/0057}
78985 {AI95-00050-01AI95-00050-01}
78986
78987 4
78988 * For direct and stream files, the current index is a property of
78989 each file object; an operation on one file object does not affect
78990 the current index of any other file object.
78991
78992 5
78993 * For direct and stream files, the current size of the file is a
78994 property of the external file.
78995
78996 6
78997 All other effects are identical.
78998
78999 _Wording Changes from Ada 95_
79000
79001 6.a/2
79002 {8652/00578652/0057} {AI95-00050-01AI95-00050-01} Corrigendum:
79003 Removed the incorrect statement that the external files
79004 associated with the standard input, standard output, and
79005 standard error files are distinct.
79006
79007 \1f
79008 File: aarm2012.info, Node: A.15, Next: A.16, Prev: A.14, Up: Annex A
79009
79010 A.15 The Package Command_Line
79011 =============================
79012
79013 1
79014 The package Command_Line allows a program to obtain the values of its
79015 arguments and to set the exit status code to be returned on normal
79016 termination.
79017
79018 1.a/2
79019 Implementation defined: The meaning of Argument_Count,
79020 Argument, and Command_Name for package Command_Line. The
79021 bounds of type Command_Line.Exit_Status.
79022
79023 _Static Semantics_
79024
79025 2
79026 The library package Ada.Command_Line has the following declaration:
79027
79028 3
79029 package Ada.Command_Line is
79030 pragma Preelaborate(Command_Line);
79031
79032 4
79033 function Argument_Count return Natural;
79034
79035 5
79036 function Argument (Number : in Positive) return String;
79037
79038 6
79039 function Command_Name return String;
79040
79041 7
79042 type Exit_Status is implementation-defined integer type;
79043
79044 8
79045 Success : constant Exit_Status;
79046 Failure : constant Exit_Status;
79047
79048 9
79049 procedure Set_Exit_Status (Code : in Exit_Status);
79050
79051 10
79052 private
79053 ... -- not specified by the language
79054 end Ada.Command_Line;
79055
79056
79057 11
79058 function Argument_Count return Natural;
79059
79060 12/3
79061 {AI05-0264-1AI05-0264-1} If the external execution environment
79062 supports passing arguments to a program, then Argument_Count
79063 returns the number of arguments passed to the program invoking
79064 the function. Otherwise, it returns 0. The meaning of
79065 "number of arguments" is implementation defined.
79066
79067 13
79068 function Argument (Number : in Positive) return String;
79069
79070 14
79071 If the external execution environment supports passing
79072 arguments to a program, then Argument returns an
79073 implementation-defined value corresponding to the argument at
79074 relative position Number. If Number is outside the range
79075 1..Argument_Count, then Constraint_Error is propagated.
79076
79077 14.a
79078 Ramification: If the external execution environment does not
79079 support passing arguments to a program, then Argument(N) for
79080 any N will raise Constraint_Error, since Argument_Count is 0.
79081
79082 15
79083 function Command_Name return String;
79084
79085 16/3
79086 {AI05-0264-1AI05-0264-1} If the external execution environment
79087 supports passing arguments to a program, then Command_Name
79088 returns an implementation-defined value corresponding to the
79089 name of the command invoking the program; otherwise,
79090 Command_Name returns the null string.
79091
79092 16.1/1
79093 type Exit_Status is implementation-defined integer type;
79094
79095 17
79096 The type Exit_Status represents the range of exit status
79097 values supported by the external execution environment. The
79098 constants Success and Failure correspond to success and
79099 failure, respectively.
79100
79101 18
79102 procedure Set_Exit_Status (Code : in Exit_Status);
79103
79104 19
79105 If the external execution environment supports returning an
79106 exit status from a program, then Set_Exit_Status sets Code as
79107 the status. Normal termination of a program returns as the
79108 exit status the value most recently set by Set_Exit_Status,
79109 or, if no such value has been set, then the value Success. If
79110 a program terminates abnormally, the status set by
79111 Set_Exit_Status is ignored, and an implementation-defined exit
79112 status value is set.
79113
79114 20
79115 If the external execution environment does not support
79116 returning an exit value from a program, then Set_Exit_Status
79117 does nothing.
79118
79119 _Implementation Permissions_
79120
79121 21
79122 An alternative declaration is allowed for package Command_Line if
79123 different functionality is appropriate for the external execution
79124 environment.
79125
79126 NOTES
79127
79128 22
79129 40 Argument_Count, Argument, and Command_Name correspond to the C
79130 language's argc, argv[n] (for n>0) and argv[0], respectively.
79131
79132 22.a
79133 To be honest: The correspondence of Argument_Count to argc is
79134 not direct -- argc would be one more than Argument_Count,
79135 since the argc count includes the command name, whereas
79136 Argument_Count does not.
79137
79138 _Extensions to Ada 83_
79139
79140 22.b/3
79141 {AI05-0299-1AI05-0299-1} This subclause is new in Ada 95.
79142
79143 \1f
79144 File: aarm2012.info, Node: A.16, Next: A.17, Prev: A.15, Up: Annex A
79145
79146 A.16 The Package Directories
79147 ============================
79148
79149 1/2
79150 {AI95-00248-01AI95-00248-01} The package Directories provides operations
79151 for manipulating files and directories, and their names.
79152
79153 1.a/3
79154 Discussion: {AI05-0299-1AI05-0299-1} The notes for this
79155 subclause contain the expected interpretations of some of the
79156 operations on various target systems. "Unix" refers to the
79157 UNIX® operating system, and in most cases also covers
79158 Unix-like systems such as Linux and POSIX. "Windows®" refers
79159 to the Microsoft® Windows® 2000 operating system and usually
79160 also covers most other versions that use the Win32 API.
79161
79162 _Static Semantics_
79163
79164 2/2
79165 {AI95-00248-01AI95-00248-01} The library package Directories has the
79166 following declaration:
79167
79168 3/2
79169 with Ada.IO_Exceptions;
79170 with Ada.Calendar;
79171 package Ada.Directories is
79172
79173 4/2
79174 -- Directory and file operations:
79175
79176 5/2
79177 function Current_Directory return String;
79178
79179 6/2
79180 procedure Set_Directory (Directory : in String);
79181
79182 7/2
79183 procedure Create_Directory (New_Directory : in String;
79184 Form : in String := "");
79185
79186 8/2
79187 procedure Delete_Directory (Directory : in String);
79188
79189 9/2
79190 procedure Create_Path (New_Directory : in String;
79191 Form : in String := "");
79192
79193 10/2
79194 procedure Delete_Tree (Directory : in String);
79195
79196 11/2
79197 procedure Delete_File (Name : in String);
79198
79199 12/2
79200 procedure Rename (Old_Name, New_Name : in String);
79201
79202 13/2
79203 procedure Copy_File (Source_Name,
79204 Target_Name : in String;
79205 Form : in String := "");
79206
79207 14/2
79208 -- File and directory name operations:
79209
79210 15/2
79211 function Full_Name (Name : in String) return String;
79212
79213 16/2
79214 function Simple_Name (Name : in String) return String;
79215
79216 17/2
79217 function Containing_Directory (Name : in String) return String;
79218
79219 18/2
79220 function Extension (Name : in String) return String;
79221
79222 19/2
79223 function Base_Name (Name : in String) return String;
79224
79225 20/2
79226 function Compose (Containing_Directory : in String := "";
79227 Name : in String;
79228 Extension : in String := "") return String;
79229
79230 20.1/3
79231 {AI05-0049-1AI05-0049-1} type Name_Case_Kind is
79232 (Unknown, Case_Sensitive, Case_Insensitive, Case_Preserving);
79233
79234 20.2/3
79235 {AI05-0049-1AI05-0049-1} function Name_Case_Equivalence (Name : in String) return Name_Case_Kind;
79236
79237 21/2
79238 -- File and directory queries:
79239
79240 22/2
79241 type File_Kind is (Directory, Ordinary_File, Special_File);
79242
79243 23/2
79244 type File_Size is range 0 .. implementation-defined;
79245
79246 24/2
79247 function Exists (Name : in String) return Boolean;
79248
79249 25/2
79250 function Kind (Name : in String) return File_Kind;
79251
79252 26/2
79253 function Size (Name : in String) return File_Size;
79254
79255 27/2
79256 function Modification_Time (Name : in String) return Ada.Calendar.Time;
79257
79258 28/2
79259 -- Directory searching:
79260
79261 29/2
79262 type Directory_Entry_Type is limited private;
79263
79264 30/2
79265 type Filter_Type is array (File_Kind) of Boolean;
79266
79267 31/2
79268 type Search_Type is limited private;
79269
79270 32/2
79271 procedure Start_Search (Search : in out Search_Type;
79272 Directory : in String;
79273 Pattern : in String;
79274 Filter : in Filter_Type := (others => True));
79275
79276 33/2
79277 procedure End_Search (Search : in out Search_Type);
79278
79279 34/2
79280 function More_Entries (Search : in Search_Type) return Boolean;
79281
79282 35/2
79283 procedure Get_Next_Entry (Search : in out Search_Type;
79284 Directory_Entry : out Directory_Entry_Type);
79285
79286 36/2
79287 procedure Search (
79288 Directory : in String;
79289 Pattern : in String;
79290 Filter : in Filter_Type := (others => True);
79291 Process : not null access procedure (
79292 Directory_Entry : in Directory_Entry_Type));
79293
79294 37/2
79295 -- Operations on Directory Entries:
79296
79297 38/2
79298 function Simple_Name (Directory_Entry : in Directory_Entry_Type)
79299 return String;
79300
79301 39/2
79302 function Full_Name (Directory_Entry : in Directory_Entry_Type)
79303 return String;
79304
79305 40/2
79306 function Kind (Directory_Entry : in Directory_Entry_Type)
79307 return File_Kind;
79308
79309 41/2
79310 function Size (Directory_Entry : in Directory_Entry_Type)
79311 return File_Size;
79312
79313 42/2
79314 function Modification_Time (Directory_Entry : in Directory_Entry_Type)
79315 return Ada.Calendar.Time;
79316
79317 43/2
79318 Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
79319 Name_Error : exception renames Ada.IO_Exceptions.Name_Error;
79320 Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
79321 Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
79322
79323 44/3
79324 {AI05-0092-1AI05-0092-1} private
79325 ... -- not specified by the language
79326 end Ada.Directories;
79327
79328 45/2
79329 {AI95-00248-01AI95-00248-01} External files may be classified as
79330 directories, special files, or ordinary files. A directory is an
79331 external file that is a container for files on the target system. A
79332 special file is an external file that cannot be created or read by a
79333 predefined Ada input-output package. External files that are not
79334 special files or directories are called ordinary files.
79335
79336 45.a/2
79337 Ramification: A directory is an external file, although it may
79338 not have a name on some targets. A directory is not a special
79339 file, as it can be created and read by Directories.
79340
79341 45.b/2
79342 Discussion: Devices and soft links are examples of special
79343 files on Windows® and Unix.
79344
79345 45.c/2
79346 Even if an implementation provides a package to create and
79347 read soft links, such links are still special files.
79348
79349 46/2
79350 {AI95-00248-01AI95-00248-01} A file name is a string identifying an
79351 external file. Similarly, a directory name is a string identifying a
79352 directory. The interpretation of file names and directory names is
79353 implementation-defined.
79354
79355 46.a/2
79356 Implementation defined: The interpretation of file names and
79357 directory names.
79358
79359 47/2
79360 {AI95-00248-01AI95-00248-01} The full name of an external file is a full
79361 specification of the name of the file. If the external environment
79362 allows alternative specifications of the name (for example,
79363 abbreviations), the full name should not use such alternatives. A full
79364 name typically will include the names of all of the directories that
79365 contain the item. The simple name of an external file is the name of
79366 the item, not including any containing directory names. Unless
79367 otherwise specified, a file name or directory name parameter in a call
79368 to a predefined Ada input-output subprogram can be a full name, a simple
79369 name, or any other form of name supported by the implementation.
79370
79371 47.a/2
79372 Discussion: The full name on Unix is a complete path to the
79373 root. For Windows®, the full name includes a complete path,
79374 as well as a disk name ("C:") or network share name. For both
79375 systems, the simple name is the part of the name following the
79376 last '/' (or ''\'' for Windows®). For example, in the name
79377 "/usr/randy/ada-directories.ads", "ada-directories.ads" is the
79378 simple name.
79379
79380 47.b/2
79381 Ramification: It is possible for a file or directory name to
79382 be neither a full name nor a simple name. For instance, the
79383 Unix name "../parent/myfile" is neither a full name nor a
79384 simple name.
79385
79386 48/2
79387 {AI95-00248-01AI95-00248-01} The default directory is the directory that
79388 is used if a directory or file name is not a full name (that is, when
79389 the name does not fully identify all of the containing directories).
79390
79391 48.a/2
79392 Discussion: The default directory is the one maintained by the
79393 familiar "cd" command on Unix and Windows®. Note that
79394 Windows® maintains separate default directories for each disk
79395 drive; implementations should use the natural implementation.
79396
79397 49/2
79398 {AI95-00248-01AI95-00248-01} A directory entry is a single item in a
79399 directory, identifying a single external file (including directories and
79400 special files).
79401
79402 50/2
79403 {AI95-00248-01AI95-00248-01} For each function that returns a string,
79404 the lower bound of the returned value is 1.
79405
79406 51/2
79407 {AI95-00248-01AI95-00248-01} The following file and directory operations
79408 are provided:
79409
79410 52/2
79411 function Current_Directory return String;
79412
79413 53/2
79414 Returns the full directory name for the current default
79415 directory. The name returned shall be suitable for a future
79416 call to Set_Directory. The exception Use_Error is propagated
79417 if a default directory is not supported by the external
79418 environment.
79419
79420 54/2
79421 procedure Set_Directory (Directory : in String);
79422
79423 55/2
79424 Sets the current default directory. The exception Name_Error
79425 is propagated if the string given as Directory does not
79426 identify an existing directory. The exception Use_Error is
79427 propagated if the external environment does not support making
79428 Directory (in the absence of Name_Error) a default directory.
79429
79430 56/2
79431 procedure Create_Directory (New_Directory : in String;
79432 Form : in String := "");
79433
79434 57/2
79435 Creates a directory with name New_Directory. The Form
79436 parameter can be used to give system-dependent characteristics
79437 of the directory; the interpretation of the Form parameter is
79438 implementation-defined. A null string for Form specifies the
79439 use of the default options of the implementation of the new
79440 directory. The exception Name_Error is propagated if the
79441 string given as New_Directory does not allow the
79442 identification of a directory. The exception Use_Error is
79443 propagated if the external environment does not support the
79444 creation of a directory with the given name (in the absence of
79445 Name_Error) and form.
79446
79447 58/2
79448 procedure Delete_Directory (Directory : in String);
79449
79450 59/3
79451 {AI05-0231-1AI05-0231-1} Deletes an existing empty directory
79452 with name Directory. The exception Name_Error is propagated
79453 if the string given as Directory does not identify an existing
79454 directory. The exception Use_Error is propagated if the
79455 directory is not empty or the external environment does not
79456 support the deletion of the directory with the given name (in
79457 the absence of Name_Error).
79458
79459 60/2
79460 procedure Create_Path (New_Directory : in String;
79461 Form : in String := "");
79462
79463 61/3
79464 {AI05-0271-1AI05-0271-1} Creates zero or more directories with
79465 name New_Directory. Each nonexistent directory named by
79466 New_Directory is created.[ For example, on a typical Unix
79467 system, Create_Path ("/usr/me/my"); would create directory
79468 "me" in directory "usr", then create directory "my" in
79469 directory "me".] The Form parameter can be used to give
79470 system-dependent characteristics of the directory; the
79471 interpretation of the Form parameter is
79472 implementation-defined. A null string for Form specifies the
79473 use of the default options of the implementation of the new
79474 directory. The exception Name_Error is propagated if the
79475 string given as New_Directory does not allow the
79476 identification of any directory. The exception Use_Error is
79477 propagated if the external environment does not support the
79478 creation of any directories with the given name (in the
79479 absence of Name_Error) and form. If Use_Error is propagated,
79480 it is unspecified whether a portion of the directory path is
79481 created.
79482
79483 62/2
79484 procedure Delete_Tree (Directory : in String);
79485
79486 63/2
79487 Deletes an existing directory with name Directory. The
79488 directory and all of its contents (possibly including other
79489 directories) are deleted. The exception Name_Error is
79490 propagated if the string given as Directory does not identify
79491 an existing directory. The exception Use_Error is propagated
79492 if the external environment does not support the deletion of
79493 the directory or some portion of its contents with the given
79494 name (in the absence of Name_Error). If Use_Error is
79495 propagated, it is unspecified whether a portion of the
79496 contents of the directory is deleted.
79497
79498 64/2
79499 procedure Delete_File (Name : in String);
79500
79501 65/2
79502 Deletes an existing ordinary or special file with name Name.
79503 The exception Name_Error is propagated if the string given as
79504 Name does not identify an existing ordinary or special
79505 external file. The exception Use_Error is propagated if the
79506 external environment does not support the deletion of the file
79507 with the given name (in the absence of Name_Error).
79508
79509 66/2
79510 procedure Rename (Old_Name, New_Name : in String);
79511
79512 67/3
79513 {AI05-0231-1AI05-0231-1} Renames an existing external file
79514 (including directories) with name Old_Name to New_Name. The
79515 exception Name_Error is propagated if the string given as
79516 Old_Name does not identify an existing external file or if the
79517 string given as New_Name does not allow the identification of
79518 an external file. The exception Use_Error is propagated if
79519 the external environment does not support the renaming of the
79520 file with the given name (in the absence of Name_Error). In
79521 particular, Use_Error is propagated if a file or directory
79522 already exists with name New_Name.
79523
79524 67.a/2
79525 Implementation Note: This operation is expected to work within
79526 a single directory, and implementers are encouraged to support
79527 it across directories on a single device. Copying files from
79528 one device to another is discouraged (that's what Copy_File is
79529 for). However, there is no requirement to detect file copying
79530 by the target system. If the target system has an API that
79531 gives that for "free", it can be used. For Windows®, for
79532 instance, MoveFile can be used to implement Rename.
79533
79534 68/3
79535 {AI05-0092-1AI05-0092-1} procedure Copy_File (Source_Name,
79536 Target_Name : in String;
79537 Form : in String := "");
79538
79539 69/3
79540 {AI05-0271-1AI05-0271-1} Copies the contents of the existing
79541 external file with name Source_Name to an external file with
79542 name Target_Name. The resulting external file is a duplicate
79543 of the source external file. The Form parameter can be used
79544 to give system-dependent characteristics of the resulting
79545 external file; the interpretation of the Form parameter is
79546 implementation-defined. Exception Name_Error is propagated if
79547 the string given as Source_Name does not identify an existing
79548 external ordinary or special file, or if the string given as
79549 Target_Name does not allow the identification of an external
79550 file. The exception Use_Error is propagated if the external
79551 environment does not support creating the file with the name
79552 given by Target_Name and form given by Form, or copying of the
79553 file with the name given by Source_Name (in the absence of
79554 Name_Error). If Use_Error is propagated, it is unspecified
79555 whether a portion of the file is copied.
79556
79557 69.a/2
79558 Ramification: Name_Error is always raised if Source_Name
79559 identifies a directory. It is up to the implementation
79560 whether special files can be copied, or if Use_Error will be
79561 raised.
79562
79563 70/2
79564 {AI95-00248-01AI95-00248-01} The following file and directory name
79565 operations are provided:
79566
79567 71/2
79568 function Full_Name (Name : in String) return String;
79569
79570 72/2
79571 Returns the full name corresponding to the file name specified
79572 by Name. The exception Name_Error is propagated if the string
79573 given as Name does not allow the identification of an external
79574 file (including directories and special files).
79575
79576 72.a/2
79577 Discussion: Full name means that no abbreviations are used in
79578 the returned name, and that it is a full specification of the
79579 name. Thus, for Unix and Windows®, the result should be a
79580 full path that does not contain any "." or ".." directories.
79581 Typically, the default directory is used to fill in any
79582 missing information.
79583
79584 73/2
79585 function Simple_Name (Name : in String) return String;
79586
79587 74/2
79588 Returns the simple name portion of the file name specified by
79589 Name. The exception Name_Error is propagated if the string
79590 given as Name does not allow the identification of an external
79591 file (including directories and special files).
79592
79593 75/2
79594 function Containing_Directory (Name : in String) return String;
79595
79596 76/2
79597 Returns the name of the containing directory of the external
79598 file (including directories) identified by Name. (If more
79599 than one directory can contain Name, the directory name
79600 returned is implementation-defined.) The exception Name_Error
79601 is propagated if the string given as Name does not allow the
79602 identification of an external file. The exception Use_Error
79603 is propagated if the external file does not have a containing
79604 directory.
79605
79606 76.a/2
79607 Discussion: This is purely a string manipulation function. If
79608 Name is not given as a full name, the containing directory
79609 probably won't be one, either. For example, if
79610 Containing_Directory ("..'\'AARM'\'RM-A-8") is called on
79611 Windows®, the result should be "..'\'AARM". If there is no
79612 path at all on the name, the result should be "." (which
79613 represents the current directory). Use Full_Name on the
79614 result of Containing_Directory if the full name is needed.
79615
79616 77/2
79617 function Extension (Name : in String) return String;
79618
79619 78/2
79620 Returns the extension name corresponding to Name. The
79621 extension name is a portion of a simple name (not including
79622 any separator characters), typically used to identify the file
79623 class. If the external environment does not have extension
79624 names, then the null string is returned. The exception
79625 Name_Error is propagated if the string given as Name does not
79626 allow the identification of an external file.
79627
79628 78.a/2
79629 Discussion: For Unix and Windows®, the extension is the
79630 portion of the simple name following the rightmost period.
79631 For example, in the simple name "RM-A-8.html", the extension
79632 is "html".
79633
79634 79/2
79635 function Base_Name (Name : in String) return String;
79636
79637 80/2
79638 Returns the base name corresponding to Name. The base name is
79639 the remainder of a simple name after removing any extension
79640 and extension separators. The exception Name_Error is
79641 propagated if the string given as Name does not allow the
79642 identification of an external file (including directories and
79643 special files).
79644
79645 80.a/2
79646 Discussion: For Unix and Windows®, the base name is the
79647 portion of the simple name preceding the rightmost period
79648 (except for the special directory names "." and "..", whose
79649 Base_Name is "." and ".."). For example, in the simple name
79650 "RM-A-8.html", the base name is "RM-A-8".
79651
79652 81/2
79653 function Compose (Containing_Directory : in String := "";
79654 Name : in String;
79655 Extension : in String := "") return String;
79656
79657 82/3
79658 {AI05-0264-1AI05-0264-1} Returns the name of the external file
79659 with the specified Containing_Directory, Name, and Extension.
79660 If Extension is the null string, then Name is interpreted as a
79661 simple name; otherwise, Name is interpreted as a base name.
79662 The exception Name_Error is propagated if the string given as
79663 Containing_Directory is not null and does not allow the
79664 identification of a directory, or if the string given as
79665 Extension is not null and is not a possible extension, or if
79666 the string given as Name is not a possible simple name (if
79667 Extension is null) or base name (if Extension is nonnull).
79668
79669 82.a/2
79670 Ramification: The above definition implies that if the
79671 Extension is null, for Unix and Windows® no '.' is added to
79672 Name.
79673
79674 82.b/2
79675 Discussion: If Name is null, Name_Error should be raised, as
79676 nothing is not a possible simple name or base name.
79677
79678 82.c/2
79679 Generally, Compose(Containing_Directory(F),
79680 Base_Name(F),Extension(F)) = F. However, this is not true on
79681 Unix or Windows® for file names that end with a '.';
79682 Compose(Base_Name("Fooey."),Extension("Fooey.")) = "Fooey".
79683 This is not a problem for Windows®, as the names have the same
79684 meaning with or without the '.', but these are different names
79685 for Unix. Thus, care needs to be taken on Unix; if Extension
79686 is null, Base_Name should be avoided. (That's not usually a
79687 problem with file names generated by a program.)
79688
79689 82.1/3
79690 {AI05-0049-1AI05-0049-1} function Name_Case_Equivalence (Name : in String) return Name_Case_Kind;
79691
79692 82.2/3
79693 {AI05-0049-1AI05-0049-1} {AI05-0248-1AI05-0248-1} Returns the
79694 file name equivalence rule for the directory containing Name.
79695 Raises Name_Error if Name is not a full name. Returns
79696 Case_Sensitive if file names that differ only in the case of
79697 letters are considered different names. If file names that
79698 differ only in the case of letters are considered the same
79699 name, then Case_Preserving is returned if names have the case
79700 of the file name used when a file is created; and
79701 Case_Insensitive is returned otherwise. Returns Unknown if
79702 the file name equivalence is not known.
79703
79704 82.c.1/3
79705 Implementation Note: Unix, Linux, and their relatives are
79706 Case_Sensitive systems. Microsoft® Windows® is a
79707 Case_Preserving system (unless the rarely used POSIX mode is
79708 used). Ancient systems like CP/M and early MS-DOS were
79709 Case_Insensitive systems (file names were always in UPPER
79710 CASE). Unknown is provided in case it is impossible to tell
79711 (such as could be the case for network files).
79712
79713 83/2
79714 {AI95-00248-01AI95-00248-01} The following file and directory queries
79715 and types are provided:
79716
79717 84/2
79718 type File_Kind is (Directory, Ordinary_File, Special_File);
79719
79720 85/2
79721 The type File_Kind represents the kind of file represented by
79722 an external file or directory.
79723
79724 86/2
79725 type File_Size is range 0 .. implementation-defined;
79726
79727 87/2
79728 The type File_Size represents the size of an external file.
79729
79730 87.a/2
79731 Implementation defined: The maximum value for a file size in
79732 Directories.
79733
79734 88/2
79735 function Exists (Name : in String) return Boolean;
79736
79737 89/2
79738 Returns True if an external file represented by Name exists,
79739 and False otherwise. The exception Name_Error is propagated
79740 if the string given as Name does not allow the identification
79741 of an external file (including directories and special files).
79742
79743 90/2
79744 function Kind (Name : in String) return File_Kind;
79745
79746 91/2
79747 Returns the kind of external file represented by Name. The
79748 exception Name_Error is propagated if the string given as Name
79749 does not allow the identification of an existing external
79750 file.
79751
79752 92/2
79753 function Size (Name : in String) return File_Size;
79754
79755 93/2
79756 Returns the size of the external file represented by Name.
79757 The size of an external file is the number of stream elements
79758 contained in the file. If the external file is not an
79759 ordinary file, the result is implementation-defined. The
79760 exception Name_Error is propagated if the string given as Name
79761 does not allow the identification of an existing external
79762 file. The exception Constraint_Error is propagated if the
79763 file size is not a value of type File_Size.
79764
79765 93.a/2
79766 Implementation defined: The result for Directories.Size for a
79767 directory or special file
79768
79769 93.b/2
79770 Discussion: We allow raising Constraint_Error, so that an
79771 implementation for a system with 64-bit file sizes does not
79772 need to support full numerics on 64-bit integers just to
79773 implement this package. Of course, if 64-bit integers are
79774 available on such a system, they should be used when defining
79775 type File_Size.
79776
79777 94/2
79778 function Modification_Time (Name : in String) return Ada.Calendar.Time;
79779
79780 95/2
79781 Returns the time that the external file represented by Name
79782 was most recently modified. If the external file is not an
79783 ordinary file, the result is implementation-defined. The
79784 exception Name_Error is propagated if the string given as Name
79785 does not allow the identification of an existing external
79786 file. The exception Use_Error is propagated if the external
79787 environment does not support reading the modification time of
79788 the file with the name given by Name (in the absence of
79789 Name_Error).
79790
79791 95.a/2
79792 Implementation defined: The result for
79793 Directories.Modification_Time for a directory or special file.
79794
79795 96/2
79796 {AI95-00248-01AI95-00248-01} The following directory searching
79797 operations and types are provided:
79798
79799 97/2
79800 type Directory_Entry_Type is limited private;
79801
79802 98/2
79803 The type Directory_Entry_Type represents a single item in a
79804 directory. These items can only be created by the
79805 Get_Next_Entry procedure in this package. Information about
79806 the item can be obtained from the functions declared in this
79807 package. A default-initialized object of this type is
79808 invalid; objects returned from Get_Next_Entry are valid.
79809
79810 99/2
79811 type Filter_Type is array (File_Kind) of Boolean;
79812
79813 100/2
79814 The type Filter_Type specifies which directory entries are
79815 provided from a search operation. If the Directory component
79816 is True, directory entries representing directories are
79817 provided. If the Ordinary_File component is True, directory
79818 entries representing ordinary files are provided. If the
79819 Special_File component is True, directory entries representing
79820 special files are provided.
79821
79822 101/2
79823 type Search_Type is limited private;
79824
79825 102/2
79826 The type Search_Type contains the state of a directory search.
79827 A default-initialized Search_Type object has no entries
79828 available (function More_Entries returns False). Type
79829 Search_Type needs finalization (see *note 7.6::).
79830
79831 103/2
79832 procedure Start_Search (Search : in out Search_Type;
79833 Directory : in String;
79834 Pattern : in String;
79835 Filter : in Filter_Type := (others => True));
79836
79837 104/3
79838 {AI05-0092-1AI05-0092-1} {AI05-0262-1AI05-0262-1} Starts a
79839 search in the directory named by Directory for entries
79840 matching Pattern and Filter. Pattern represents a pattern for
79841 matching file names. If Pattern is the null string, all items
79842 in the directory are matched; otherwise, the interpretation of
79843 Pattern is implementation-defined. Only items that match
79844 Filter will be returned. After a successful call on
79845 Start_Search, the object Search may have entries available,
79846 but it may have no entries available if no files or
79847 directories match Pattern and Filter. The exception
79848 Name_Error is propagated if the string given by Directory does
79849 not identify an existing directory, or if Pattern does not
79850 allow the identification of any possible external file or
79851 directory. The exception Use_Error is propagated if the
79852 external environment does not support the searching of the
79853 directory with the given name (in the absence of Name_Error).
79854 When Start_Search propagates Name_Error or Use_Error, the
79855 object Search will have no entries available.
79856
79857 104.a/2
79858 Implementation defined: The interpretation of a nonnull search
79859 pattern in Directories.
79860
79861 105/2
79862 procedure End_Search (Search : in out Search_Type);
79863
79864 106/2
79865 Ends the search represented by Search. After a successful
79866 call on End_Search, the object Search will have no entries
79867 available.
79868
79869 106.a/2
79870 Ramification: The only way that a call to End_Search could be
79871 unsuccessful if Device_Error (see *note A.13::) is raised
79872 because of an underlying failure (or bug).
79873
79874 107/2
79875 function More_Entries (Search : in Search_Type) return Boolean;
79876
79877 108/2
79878 Returns True if more entries are available to be returned by a
79879 call to Get_Next_Entry for the specified search object, and
79880 False otherwise.
79881
79882 109/2
79883 procedure Get_Next_Entry (Search : in out Search_Type;
79884 Directory_Entry : out Directory_Entry_Type);
79885
79886 110/3
79887 {AI05-0262-1AI05-0262-1} Returns the next Directory_Entry for
79888 the search described by Search that matches the pattern and
79889 filter. If no further matches are available, Status_Error is
79890 raised. It is implementation-defined as to whether the
79891 results returned by this subprogram are altered if the
79892 contents of the directory are altered while the Search object
79893 is valid (for example, by another program). The exception
79894 Use_Error is propagated if the external environment does not
79895 support continued searching of the directory represented by
79896 Search.
79897
79898 110.a/2
79899 Implementation defined: The results of a Directories search if
79900 the contents of the directory are altered while a search is in
79901 progress.
79902
79903 111/2
79904 procedure Search (
79905 Directory : in String;
79906 Pattern : in String;
79907 Filter : in Filter_Type := (others => True);
79908 Process : not null access procedure (
79909 Directory_Entry : in Directory_Entry_Type));
79910
79911 112/3
79912 {AI05-0092-1AI05-0092-1} {AI05-0262-1AI05-0262-1} Searches in
79913 the directory named by Directory for entries matching Pattern
79914 and Filter. The subprogram designated by Process is called
79915 with each matching entry in turn. Pattern represents a
79916 pattern for matching file names. If Pattern is the null
79917 string, all items in the directory are matched; otherwise, the
79918 interpretation of Pattern is implementation-defined. Only
79919 items that match Filter will be returned. The exception
79920 Name_Error is propagated if the string given by Directory does
79921 not identify an existing directory, or if Pattern does not
79922 allow the identification of any possible external file or
79923 directory. The exception Use_Error is propagated if the
79924 external environment does not support the searching of the
79925 directory with the given name (in the absence of Name_Error).
79926
79927 112.a/2
79928 Discussion: "In turn" means that the calls to the subprogram
79929 designated by Process are not made in parallel; they can be
79930 made in any order but must be in sequence.
79931
79932 113/2
79933 function Simple_Name (Directory_Entry : in Directory_Entry_Type)
79934 return String;
79935
79936 114/2
79937 Returns the simple external name of the external file
79938 (including directories) represented by Directory_Entry. The
79939 format of the name returned is implementation-defined. The
79940 exception Status_Error is propagated if Directory_Entry is
79941 invalid.
79942
79943 115/2
79944 function Full_Name (Directory_Entry : in Directory_Entry_Type)
79945 return String;
79946
79947 116/2
79948 Returns the full external name of the external file (including
79949 directories) represented by Directory_Entry. The format of
79950 the name returned is implementation-defined. The exception
79951 Status_Error is propagated if Directory_Entry is invalid.
79952
79953 117/2
79954 function Kind (Directory_Entry : in Directory_Entry_Type)
79955 return File_Kind;
79956
79957 118/2
79958 Returns the kind of external file represented by
79959 Directory_Entry. The exception Status_Error is propagated if
79960 Directory_Entry is invalid.
79961
79962 119/2
79963 function Size (Directory_Entry : in Directory_Entry_Type)
79964 return File_Size;
79965
79966 120/2
79967 Returns the size of the external file represented by
79968 Directory_Entry. The size of an external file is the number
79969 of stream elements contained in the file. If the external
79970 file represented by Directory_Entry is not an ordinary file,
79971 the result is implementation-defined. The exception
79972 Status_Error is propagated if Directory_Entry is invalid. The
79973 exception Constraint_Error is propagated if the file size is
79974 not a value of type File_Size.
79975
79976 121/2
79977 function Modification_Time (Directory_Entry : in Directory_Entry_Type)
79978 return Ada.Calendar.Time;
79979
79980 122/2
79981 Returns the time that the external file represented by
79982 Directory_Entry was most recently modified. If the external
79983 file represented by Directory_Entry is not an ordinary file,
79984 the result is implementation-defined. The exception
79985 Status_Error is propagated if Directory_Entry is invalid. The
79986 exception Use_Error is propagated if the external environment
79987 does not support reading the modification time of the file
79988 represented by Directory_Entry.
79989
79990 _Implementation Requirements_
79991
79992 123/2
79993 For Copy_File, if Source_Name identifies an existing external ordinary
79994 file created by a predefined Ada input-output package, and Target_Name
79995 and Form can be used in the Create operation of that input-output
79996 package with mode Out_File without raising an exception, then Copy_File
79997 shall not propagate Use_Error.
79998
79999 123.a/2
80000 Discussion: This means that Copy_File will copy any file that
80001 the Ada programmer could copy (by writing some possibly
80002 complicated Ada code).
80003
80004 _Implementation Advice_
80005
80006 124/2
80007 If other information about a file (such as the owner or creation date)
80008 is available in a directory entry, the implementation should provide
80009 functions in a child package Directories.Information to retrieve it.
80010
80011 124.a/2
80012 Implementation Advice: Package Directories.Information should
80013 be provided to retrieve other information about a file.
80014
80015 124.b/2
80016 Implementation Note: For Windows®, Directories.Information
80017 should contain at least the following routines:
80018
80019 124.c/2
80020 package Ada.Directories.Information is
80021 -- System-specific directory information.
80022 -- Version for the Microsoft® Windows® operating system.
80023
80024 124.d/2
80025 function Creation_Time (Name : in String) return Ada.Calendar.Time;
80026
80027 124.e/2
80028 function Last_Access_Time (Name : in String) return Ada.Calendar.Time;
80029
80030 124.f/2
80031 function Is_Read_Only (Name : in String) return Boolean;
80032
80033 124.g/2
80034 function Needs_Archiving (Name : in String) return Boolean;
80035 -- This generally means that the file needs to be backed up.
80036 -- The flag is only cleared by backup programs.
80037
80038 124.h/2
80039 function Is_Compressed (Name : in String) return Boolean;
80040
80041 124.i/2
80042 function Is_Encrypted (Name : in String) return Boolean;
80043
80044 124.j/2
80045 function Is_Hidden (Name : in String) return Boolean;
80046
80047 124.k/2
80048 function Is_System (Name : in String) return Boolean;
80049
80050 124.l/2
80051 function Is_Offline (Name : in String) return Boolean;
80052
80053 124.m/2
80054 function Is_Temporary (Name : in String) return Boolean;
80055
80056 124.n/2
80057 function Is_Sparse (Name : in String) return Boolean;
80058
80059 124.o/2
80060 function Is_Not_Indexed (Name : in String) return Boolean;
80061
80062 124.p/2
80063 function Creation_Time (Directory_Entry : in Directory_Entry_Type)
80064 return Ada.Calendar.Time;
80065
80066 124.q/2
80067 function Last_Access_Time (Directory_Entry : in Directory_Entry_Type)
80068 return Ada.Calendar.Time;
80069
80070 124.r/2
80071 function Is_Read_Only (Directory_Entry : in Directory_Entry_Type) return Boolean;
80072
80073 124.s/2
80074 function Needs_Archiving (Directory_Entry : in Directory_Entry_Type) return Boolean;
80075 -- This generally means that the file needs to be backed up.
80076 -- The flag is only cleared by backup programs.
80077
80078 124.t/2
80079 function Is_Compressed (Directory_Entry : in Directory_Entry_Type) return Boolean;
80080
80081 124.u/2
80082 function Is_Encrypted (Directory_Entry : in Directory_Entry_Type) return Boolean;
80083
80084 124.v/2
80085 function Is_Hidden (Directory_Entry : in Directory_Entry_Type) return Boolean;
80086
80087 124.w/2
80088 function Is_System (Directory_Entry : in Directory_Entry_Type) return Boolean;
80089
80090 124.x/2
80091 function Is_Offline (Directory_Entry : in Directory_Entry_Type) return Boolean;
80092
80093 124.y/2
80094 function Is_Temporary (Directory_Entry : in Directory_Entry_Type) return Boolean;
80095
80096 124.z/2
80097 function Is_Sparse (Directory_Entry : in Directory_Entry_Type) return Boolean;
80098
80099 124.aa/2
80100 function Is_Not_Indexed (Directory_Entry : in Directory_Entry_Type) return Boolean;
80101
80102 124.bb/2
80103 -- Additional implementation-defined subprograms allowed here.
80104 end Ada.Directories.Information;
80105
80106 124.cc/2
80107 For Unix-like systems (Unix, POSIX, Linux, etc.),
80108 Directories.Information should contain at least the following
80109 routines:
80110
80111 124.dd/2
80112 package Ada.Directories.Information is
80113 -- System-specific directory information.
80114 -- Unix and similar systems version.
80115
80116 124.ee/2
80117 function Last_Access_Time (Name : in String) return Ada.Calendar.Time;
80118
80119 124.ff/2
80120 function Last_Status_Change_Time (Name : in String) return Ada.Calendar.Time;
80121
80122 124.gg/2
80123 type Permission is
80124 (Others_Execute, Others_Write, Others_Read,
80125 Group_Execute, Group_Write, Group_Read,
80126 Owner_Execute, Owner_Write, Owner_Read,
80127 Set_Group_ID, Set_User_ID);
80128
80129 124.hh/2
80130 type Permission_Set_Type is array (Permission) of Boolean;
80131
80132 124.ii/2
80133 function Permission_Set (Name : in String) return Permission_Set_Type;
80134
80135 124.jj/2
80136 function Owner (Name : in String) return String;
80137 -- Returns the image of the User_Id. If a definition of User_Id
80138 -- is available, an implementation-defined version of Owner
80139 -- returning User_Id should also be defined.
80140
80141 124.kk/3
80142 {AI05-0005-1AI05-0005-1} function Group (Name : in String) return String;
80143 -- Returns the image of the Group_Id. If a definition of Group_Id
80144 -- is available, an implementation-defined version of Group
80145 -- returning Group_Id should also be defined.
80146
80147 124.ll/2
80148 function Is_Block_Special_File (Name : in String) return Boolean;
80149
80150 124.mm/2
80151 function Is_Character_Special_File (Name : in String) return Boolean;
80152
80153 124.nn/2
80154 function Is_FIFO (Name : in String) return Boolean;
80155
80156 124.oo/2
80157 function Is_Symbolic_Link (Name : in String) return Boolean;
80158
80159 124.pp/2
80160 function Is_Socket (Name : in String) return Boolean;
80161
80162 124.qq/2
80163 function Last_Access_Time (Directory_Entry : in Directory_Entry_Type)
80164 return Ada.Calendar.Time;
80165
80166 124.rr/2
80167 function Last_Status_Change_Time (Directory_Entry : in Directory_Entry_Type)
80168 return Ada.Calendar.Time;
80169
80170 124.ss/2
80171 function Permission_Set (Directory_Entry : in Directory_Entry_Type)
80172 return Permission_Set_Type;
80173
80174 124.tt/2
80175 function Owner (Directory_Entry : in Directory_Entry_Type) return String;
80176 -- See Owner above.
80177
80178 124.uu/2
80179 function Group (Directory_Entry : in Directory_Entry_Type) return String;
80180 -- See Group above.
80181
80182 124.vv/2
80183 function Is_Block_Special_File (Directory_Entry : in Directory_Entry_Type)
80184 return Boolean;
80185
80186 124.ww/2
80187 function Is_Character_Special_File (Directory_Entry : in Directory_Entry_Type)
80188 return Boolean;
80189
80190 124.xx/2
80191 function Is_FIFO (Directory_Entry : in Directory_Entry_Type) return Boolean;
80192
80193 124.yy/2
80194 function Is_Symbolic_Link (Directory_Entry : in Directory_Entry_Type)
80195 return Boolean;
80196
80197 124.zz/2
80198 function Is_Socket (Directory_Entry : in Directory_Entry_Type) return Boolean;
80199
80200 124.aaa/2
80201 -- Additional implementation-defined subprograms allowed here.
80202 end Ada.Directories.Information;
80203
80204 124.bbb/2
80205 We give these definitions to give guidance so that every
80206 implementation for a given target is not unnecessarily
80207 different. Implementers are encouraged to make packages for
80208 other targets as similar to these as possible.
80209
80210 125/3
80211 {AI05-0231-1AI05-0231-1} Start_Search and Search should raise Name_Error
80212 if Pattern is malformed, but not if it could represent a file in the
80213 directory but does not actually do so.
80214
80215 125.a/3
80216 Implementation Advice: Directories.Start_Search and
80217 Directories.Search should raise Name_Error for malformed
80218 patterns.
80219
80220 126/2
80221 Rename should be supported at least when both New_Name and Old_Name are
80222 simple names and New_Name does not identify an existing external file.
80223
80224 126.a/2
80225 Implementation Advice: Directories.Rename should be supported
80226 at least when both New_Name and Old_Name are simple names and
80227 New_Name does not identify an existing external file.
80228
80229 126.b/2
80230 Discussion: "Supported" includes raising an exception if
80231 either name is malformed, the file to rename doesn't exist,
80232 insufficient permission for the operation exists, or similar
80233 problems. But this advice requires implementations to
80234 document what they do, and tells implementers that simply
80235 raising Use_Error isn't acceptable.
80236
80237 NOTES
80238
80239 127/2
80240 41 The operations Containing_Directory, Full_Name, Simple_Name,
80241 Base_Name, Extension, and Compose operate on file names, not
80242 external files. The files identified by these operations do not
80243 need to exist. Name_Error is raised only if the file name is
80244 malformed and cannot possibly identify a file. Of these
80245 operations, only the result of Full_Name depends on the current
80246 default directory; the result of the others depends only on their
80247 parameters.
80248
80249 128/2
80250 42 Using access types, values of Search_Type and
80251 Directory_Entry_Type can be saved and queried later. However,
80252 another task or application can modify or delete the file
80253 represented by a Directory_Entry_Type value or the directory
80254 represented by a Search_Type value; such a value can only give the
80255 information valid at the time it is created. Therefore, long-term
80256 storage of these values is not recommended.
80257
80258 129/2
80259 43 If the target system does not support directories inside of
80260 directories, then Kind will never return Directory and
80261 Containing_Directory will always raise Use_Error.
80262
80263 130/2
80264 44 If the target system does not support creation or deletion of
80265 directories, then Create_Directory, Create_Path, Delete_Directory,
80266 and Delete_Tree will always propagate Use_Error.
80267
80268 131/2
80269 45 To move a file or directory to a different location, use
80270 Rename. Most target systems will allow renaming of files from one
80271 directory to another. If the target file or directory might
80272 already exist, it should be deleted first.
80273
80274 131.a/2
80275 Discussion: While Rename is only guaranteed to work for name
80276 changes within a single directory, its unlikely that
80277 implementers would purposely prevent functionality present in
80278 the underlying system from working. To move a file totally
80279 portably, it's necessary to handle failure of the Rename and
80280 fall back to Copy_File and Delete:
80281
80282 131.b
80283 begin
80284 Rename (Source, Target);
80285 exception
80286 when Use_Error =>
80287 Copy_File (Source, Target);
80288 Delete (Source);
80289 end;
80290
80291 _Extensions to Ada 95_
80292
80293 131.c/2
80294 {AI95-00248-01AI95-00248-01} Package Ada.Directories is new.
80295
80296 _Inconsistencies With Ada 2005_
80297
80298 131.d/3
80299 {AI05-0231-1AI05-0231-1} Correction: Clarified when and which
80300 exceptions are raised for Start_Search, Search,
80301 Delete_Directory, and Rename. If an implementation followed
80302 the original incorrect wording, it might raise Use_Error
80303 instead of Name_Error for Start_Search and Search, Name_Error
80304 instead of Use_Error for Rename, and might have deleted a
80305 nonempty directory instead of raising Use_Error for
80306 Delete_Directory. The first two cases are very unlikely to
80307 matter in practice, and it unlikely that an implementation
80308 would have followed the latter implementation strategy, as it
80309 would be more work and would make Delete_Directory identical
80310 to Delete_Tree (which is obvious nonsense).
80311
80312 _Incompatibilities With Ada 2005_
80313
80314 131.e/3
80315 {AI05-0049-1AI05-0049-1} A new enumeration type Name_Case_Kind
80316 and a new function Name_Case_Equivalence is added to
80317 Directories. If Directories is referenced in a use_clause,
80318 and an entity E with a defining_identifier of one of the new
80319 entities is defined in a package that is also referenced in a
80320 use_clause, the entity E may no longer be use-visible,
80321 resulting in errors. This should be rare and is easily fixed
80322 if it does occur.
80323
80324 _Wording Changes from Ada 2005_
80325
80326 131.f/3
80327 {AI05-0271-1AI05-0271-1} Correction: We now explicitly say
80328 that the behavior of Create_Path and Copy_File is unspecified
80329 when Use_Error is raised. Nothing has changed here, as the
80330 behavior was (implicitly) unspecified in the 2007 Amendment.
80331
80332 * Menu:
80333
80334 * A.16.1 :: The Package Directories.Hierarchical_File_Names
80335
80336 \1f
80337 File: aarm2012.info, Node: A.16.1, Up: A.16
80338
80339 A.16.1 The Package Directories.Hierarchical_File_Names
80340 ------------------------------------------------------
80341
80342 1/3
80343 {AI05-0049-1AI05-0049-1} The library package
80344 Directories.Hierarchical_File_Names is an optional package providing
80345 operations for file name construction and decomposition for targets with
80346 hierarchical file naming.
80347
80348 _Static Semantics_
80349
80350 2/3
80351 {AI05-0049-1AI05-0049-1} If provided, the library package
80352 Directories.Hierarchical_File_Names has the following declaration:
80353
80354 3/3
80355 package Ada.Directories.Hierarchical_File_Names is
80356
80357 4/3
80358 function Is_Simple_Name (Name : in String) return Boolean;
80359
80360 5/3
80361 function Is_Root_Directory_Name (Name : in String) return Boolean;
80362
80363 6/3
80364 function Is_Parent_Directory_Name (Name : in String) return Boolean;
80365
80366 7/3
80367 function Is_Current_Directory_Name (Name : in String) return Boolean;
80368
80369 8/3
80370 function Is_Full_Name (Name : in String) return Boolean;
80371
80372 9/3
80373 function Is_Relative_Name (Name : in String) return Boolean;
80374
80375 10/3
80376 function Simple_Name (Name : in String) return String
80377 renames Ada.Directories.Simple_Name;
80378
80379 11/3
80380 function Containing_Directory (Name : in String) return String
80381 renames Ada.Directories.Containing_Directory;
80382
80383 12/3
80384 function Initial_Directory (Name : in String) return String;
80385
80386 13/3
80387 function Relative_Name (Name : in String) return String;
80388
80389 14/3
80390 function Compose (Directory : in String := "";
80391 Relative_Name : in String;
80392 Extension : in String := "") return String;
80393
80394 15/3
80395 end Ada.Directories.Hierarchical_File_Names;
80396
80397 16/3
80398 {AI05-0049-1AI05-0049-1} {AI05-0269-1AI05-0269-1} In addition to the
80399 operations provided in package Directories.Hierarchical_File_Names, the
80400 operations in package Directories can be used with hierarchical file
80401 names. In particular, functions Full_Name, Base_Name, and Extension
80402 provide additional capabilities for hierarchical file names.
80403
80404 17/3
80405 function Is_Simple_Name (Name : in String) return Boolean;
80406
80407 18/3
80408 Returns True if Name is a simple name, and returns False
80409 otherwise.
80410
80411 19/3
80412 function Is_Root_Directory_Name (Name : in String) return Boolean;
80413
80414 20/3
80415 Returns True if Name is syntactically a root (a directory that
80416 cannot be decomposed further), and returns False otherwise.
80417
80418 20.a/3
80419 Implementation Note: For Unix and Unix-like systems, "/" is
80420 the root. For Windows, "C:'\'" and "'\''\'Computer'\'Share"
80421 are roots.
80422
80423 21/3
80424 function Is_Parent_Directory_Name (Name : in String) return Boolean;
80425
80426 22/3
80427 Returns True if Name can be used to indicate symbolically the
80428 parent directory of any directory, and returns False
80429 otherwise.
80430
80431 22.a/3
80432 Implementation Note: Is_Parent_Directory_Name returns True if
80433 and only if Name is ".." for both Unix and Windows.
80434
80435 23/3
80436 function Is_Current_Directory_Name (Name : in String) return Boolean;
80437
80438 24/3
80439 Returns True if Name can be used to indicate symbolically the
80440 directory itself for any directory, and returns False
80441 otherwise.
80442
80443 24.a/3
80444 Implementation Note: Is_Current_Directory_Name returns True if
80445 and only if Name is "." for both Unix and Windows.
80446
80447 25/3
80448 function Is_Full_Name (Name : in String) return Boolean;
80449
80450 26/3
80451 Returns True if the leftmost directory part of Name is a root,
80452 and returns False otherwise.
80453
80454 27/3
80455 function Is_Relative_Name (Name : in String) return Boolean;
80456
80457 28/3
80458 {AI05-0049-1AI05-0049-1} {AI05-0269-1AI05-0269-1} Returns True
80459 if Name allows the identification of an external file
80460 (including directories and special files) but is not a full
80461 name, and returns False otherwise.
80462
80463 28.a/3
80464 Ramification: Relative names include simple names as a special
80465 case. This function returns False if the syntax of the name
80466 is incorrect.
80467
80468 29/3
80469 function Initial_Directory (Name : in String) return String;
80470
80471 30/3
80472 {AI05-0049-1AI05-0049-1} {AI05-0248-1AI05-0248-1} Returns the
80473 leftmost directory part in Name. [That is, it returns a root
80474 directory name (for a full name), or one of a parent directory
80475 name, a current directory name, or a simple name (for a
80476 relative name).] The exception Name_Error is propagated if
80477 the string given as Name does not allow the identification of
80478 an external file (including directories and special files).
80479
80480 31/3
80481 function Relative_Name (Name : in String) return String;
80482
80483 32/3
80484 Returns the entire file name except the Initial_Directory
80485 portion. The exception Name_Error is propagated if the string
80486 given as Name does not allow the identification of an external
80487 file (including directories and special files), or if Name has
80488 a single part (this includes if any of Is_Simple_Name,
80489 Is_Root_Directory_Name, Is_Parent_Directory_Name, or
80490 Is_Current_Directory_Name are True).
80491
80492 32.a/3
80493 Ramification: The result might be a simple name.
80494
80495 33/3
80496 function Compose (Directory : in String := "";
80497 Relative_Name : in String;
80498 Extension : in String := "") return String;
80499
80500 34/3
80501 Returns the name of the external file with the specified
80502 Directory, Relative_Name, and Extension. The exception
80503 Name_Error is propagated if the string given as Directory is
80504 not the null string and does not allow the identification of a
80505 directory, or if Is_Relative_Name (Relative_Name) is False, or
80506 if the string given as Extension is not the null string and is
80507 not a possible extension, or if Extension is not the null
80508 string and Simple_Name (Relative_Name) is not a base name.
80509
80510 35/3
80511 The result of Compose is a full name if Is_Full_Name
80512 (Directory) is True; result is a relative name otherwise.
80513
80514 35.a/3
80515 Ramification: Name_Error is raised by Compose if Directory is
80516 not the null string, and both Is_Full_Name and
80517 Is_Relative_Name return False.
80518
80519 35.b/3
80520 Discussion: A common security problem is to include a parent
80521 directory name in the middle of a file name; this is often
80522 used to navigate outside of an intended root directory. We
80523 considered attempting to prevent that case by having Compose
80524 detect it and raise an exception. But the extra rules
80525 necessary were more confusing than helpful.
80526
80527 35.c/3
80528 We can say more about the details of these operations by
80529 adopting the notation of a subscript to specify how many path
80530 fragments a particular result has. Then, we can abbreviate
80531 "Full Name" as "Full" and "Relative Name" as "Rel". In this
80532 notation, Unix file name "a/b" is a Rel(2), "../c/d" is a
80533 Rel(3), and "/a/b" is a Full(2). Rel(1) is equivalent to a
80534 simple name; thus we don't have to describe that separately.
80535
80536 35.d/3
80537 In this notation,
80538
80539 35.e/3
80540 For N>1,
80541 Containing_Directory(Rel(N)) = Leftmost Rel(N-1),
80542 Containing_Directory(Full(N)) = Leftmost Full(N-1),
80543 Else if N = 1, raise Name_Error.
80544
80545
80546 35.f/3
80547 Similarly,
80548
80549 35.g/3
80550 For N>1,
80551 Relative_Name(Rel(N)) = Rightmost Rel(N-1),
80552 Relative_Name(Full(N)) = Rightmost Full(N-1),
80553 Else if N = 1, raise Name_Error.
80554
80555
80556 35.h/3
80557 Finally, for Compose (ignoring the extension here):
80558
80559 35.i/3
80560 Compose (Directory => Full(N), Relative_Name => Rel(M)) => Full(N+M)
80561 Compose (Directory => Rel(N), Relative_Name => Rel(M)) => Rel(N+M)
80562 Name_Error if Relative_Name is a Full(M).
80563
80564
80565 35.j/3
80566 We didn't try to write wording to reflect these details of
80567 these functions.
80568
80569 _Implementation Advice_
80570
80571 36/3
80572 {AI05-0049-1AI05-0049-1} Directories.Hierarchical_File_Names should be
80573 provided for systems with hierarchical file naming, and should not be
80574 provided on other systems.
80575
80576 36.a/3
80577 Implementation Advice: Directories.Hierarchical_File_Names
80578 should be provided for systems with hierarchical file naming,
80579 and should not be provided on other systems.
80580
80581 36.b/3
80582 Implementation Note: This package should be provided when
80583 targeting Microsoft® Windows®, Unix, Linux, and most Unix-like
80584 systems.
80585
80586 NOTES
80587
80588 37/3
80589 46 {AI05-0049-1AI05-0049-1} These operations operate on file
80590 names, not external files. The files identified by these
80591 operations do not need to exist. Name_Error is raised only as
80592 specified or if the file name is malformed and cannot possibly
80593 identify a file. The result of these operations depends only on
80594 their parameters.
80595
80596 38/3
80597 47 {AI05-0049-1AI05-0049-1} Containing_Directory raises Use_Error
80598 if Name does not have a containing directory, including when any of
80599 Is_Simple_Name, Is_Root_Directory_Name, Is_Parent_Directory_Name,
80600 or Is_Current_Directory_Name are True.
80601
80602 38.a/3
80603 Ramification: In particular, the default directory is not used
80604 to find the containing directory either when
80605 Is_Parent_Directory_Name or Is_Current_Directory_Name is True.
80606 As noted above, these functions operate purely on the syntax
80607 of the file names and do not attempt to interpret them. If
80608 interpretation is needed, Directories.Full_Name can be to
80609 expand any shorthands used before calling
80610 Containing_Directory.
80611
80612 _Extensions to Ada 2005_
80613
80614 38.b/3
80615 {AI05-0049-1AI05-0049-1} Package
80616 Ada.Directories.Hierarchical_File_Names is new.
80617
80618 \1f
80619 File: aarm2012.info, Node: A.17, Next: A.18, Prev: A.16, Up: Annex A
80620
80621 A.17 The Package Environment_Variables
80622 ======================================
80623
80624 1/2
80625 {AI95-00370-01AI95-00370-01} The package Environment_Variables allows a
80626 program to read or modify environment variables. Environment variables
80627 are name-value pairs, where both the name and value are strings. The
80628 definition of what constitutes an environment variable, and the meaning
80629 of the name and value, are implementation defined.
80630
80631 1.a/2
80632 Implementation defined: The definition and meaning of an
80633 environment variable.
80634
80635 _Static Semantics_
80636
80637 2/2
80638 {AI95-00370-01AI95-00370-01} The library package Environment_Variables
80639 has the following declaration:
80640
80641 3/2
80642 package Ada.Environment_Variables is
80643 pragma Preelaborate(Environment_Variables);
80644
80645 4/2
80646 function Value (Name : in String) return String;
80647
80648 4.1/3
80649 {AI05-0285-1AI05-0285-1} function Value (Name : in String; Default : in String) return String;
80650
80651 5/2
80652 function Exists (Name : in String) return Boolean;
80653
80654 6/2
80655 procedure Set (Name : in String; Value : in String);
80656
80657 7/2
80658 procedure Clear (Name : in String);
80659 procedure Clear;
80660
80661 8/3
80662 {AI05-0248-1AI05-0248-1} procedure Iterate
80663 (Process : not null access procedure (Name, Value : in String));
80664
80665 9/2
80666 end Ada.Environment_Variables;
80667
80668 10/2
80669 function Value (Name : in String) return String;
80670
80671 11/2
80672 {AI95-00370-01AI95-00370-01} If the external execution
80673 environment supports environment variables, then Value returns
80674 the value of the environment variable with the given name. If
80675 no environment variable with the given name exists, then
80676 Constraint_Error is propagated. If the execution environment
80677 does not support environment variables, then Program_Error is
80678 propagated.
80679
80680 11.1/3
80681 function Value (Name : in String; Default : in String) return String;
80682
80683 11.2/3
80684 {AI05-0285-1AI05-0285-1} If the external execution environment
80685 supports environment variables and an environment variable
80686 with the given name currently exists, then Value returns its
80687 value; otherwise, it returns Default.
80688
80689 12/2
80690 function Exists (Name : in String) return Boolean;
80691
80692 13/3
80693 {AI95-00370-01AI95-00370-01} {AI05-0264-1AI05-0264-1} If the
80694 external execution environment supports environment variables
80695 and an environment variable with the given name currently
80696 exists, then Exists returns True; otherwise, it returns False.
80697
80698 14/2
80699 procedure Set (Name : in String; Value : in String);
80700
80701 15/3
80702 {AI95-00370-01AI95-00370-01} {AI05-0264-1AI05-0264-1} If the
80703 external execution environment supports environment variables,
80704 then Set first clears any existing environment variable with
80705 the given name, and then defines a single new environment
80706 variable with the given name and value. Otherwise,
80707 Program_Error is propagated.
80708
80709 16/2
80710 If implementation-defined circumstances prohibit the
80711 definition of an environment variable with the given name and
80712 value, then Constraint_Error is propagated.
80713
80714 16.a/2
80715 Implementation defined: The circumstances where an environment
80716 variable cannot be defined.
80717
80718 17/2
80719 It is implementation defined whether there exist values for
80720 which the call Set(Name, Value) has the same effect as Clear
80721 (Name).
80722
80723 17.a/2
80724 Implementation defined: Environment names for which Set has
80725 the effect of Clear.
80726
80727 18/2
80728 procedure Clear (Name : in String);
80729
80730 19/3
80731 {AI95-00370-01AI95-00370-01} {AI05-0264-1AI05-0264-1}
80732 {AI05-0269-1AI05-0269-1} If the external execution environment
80733 supports environment variables, then Clear deletes all
80734 existing environment variables with the given name.
80735 Otherwise, Program_Error is propagated.
80736
80737 20/2
80738 procedure Clear;
80739
80740 21/3
80741 {AI95-00370-01AI95-00370-01} {AI05-0264-1AI05-0264-1} If the
80742 external execution environment supports environment variables,
80743 then Clear deletes all existing environment variables.
80744 Otherwise, Program_Error is propagated.
80745
80746 22/3
80747 {AI05-0248-1AI05-0248-1} procedure Iterate
80748 (Process : not null access procedure (Name, Value : in String));
80749
80750 23/3
80751 {AI95-00370-01AI95-00370-01} {AI05-0264-1AI05-0264-1} If the
80752 external execution environment supports environment variables,
80753 then Iterate calls the subprogram designated by Process for
80754 each existing environment variable, passing the name and value
80755 of that environment variable. Otherwise, Program_Error is
80756 propagated.
80757
80758 24/2
80759 If several environment variables exist that have the same
80760 name, Process is called once for each such variable.
80761
80762 _Bounded (Run-Time) Errors_
80763
80764 25/2
80765 {AI95-00370-01AI95-00370-01} It is a bounded error to call Value if more
80766 than one environment variable exists with the given name; the possible
80767 outcomes are that:
80768
80769 26/2
80770 * one of the values is returned, and that same value is returned in
80771 subsequent calls in the absence of changes to the environment; or
80772
80773 27/2
80774 * Program_Error is propagated.
80775
80776 _Erroneous Execution_
80777
80778 28/2
80779 {AI95-00370-01AI95-00370-01} Making calls to the procedures Set or Clear
80780 concurrently with calls to any subprogram of package
80781 Environment_Variables, or to any instantiation of Iterate, results in
80782 erroneous execution.
80783
80784 29/2
80785 Making calls to the procedures Set or Clear in the actual subprogram
80786 corresponding to the Process parameter of Iterate results in erroneous
80787 execution.
80788
80789 _Documentation Requirements_
80790
80791 30/2
80792 {AI95-00370-01AI95-00370-01} An implementation shall document how the
80793 operations of this package behave if environment variables are changed
80794 by external mechanisms (for instance, calling operating system
80795 services).
80796
80797 30.a/2
80798 Documentation Requirement: The behavior of package
80799 Environment_Variables when environment variables are changed
80800 by external mechanisms.
80801
80802 _Implementation Permissions_
80803
80804 31/2
80805 {AI95-00370-01AI95-00370-01} An implementation running on a system that
80806 does not support environment variables is permitted to define the
80807 operations of package Environment_Variables with the semantics
80808 corresponding to the case where the external execution environment does
80809 support environment variables. In this case, it shall provide a
80810 mechanism to initialize a nonempty set of environment variables prior to
80811 the execution of a partition.
80812
80813 _Implementation Advice_
80814
80815 32/2
80816 {AI95-00370-01AI95-00370-01} If the execution environment supports
80817 subprocesses, the currently defined environment variables should be used
80818 to initialize the environment variables of a subprocess.
80819
80820 32.a/2
80821 Implementation Advice: If the execution environment supports
80822 subprocesses, the current environment variables should be used
80823 to initialize the environment variables of a subprocess.
80824
80825 33/2
80826 Changes to the environment variables made outside the control of this
80827 package should be reflected immediately in the effect of the operations
80828 of this package. Changes to the environment variables made using this
80829 package should be reflected immediately in the external execution
80830 environment. This package should not perform any buffering of the
80831 environment variables.
80832
80833 33.a/2
80834 Implementation Advice: Changes to the environment variables
80835 made outside the control of Environment_Variables should be
80836 reflected immediately.
80837
80838 _Extensions to Ada 95_
80839
80840 33.b/2
80841 {AI95-00370-01AI95-00370-01} Package Environment_Variables is
80842 new.
80843
80844 _Incompatibilities With Ada 2005_
80845
80846 33.c/3
80847 {AI05-0285-1AI05-0285-1} A new overloaded function Value is
80848 added to Environment_Variables. If Environment_Variables is
80849 referenced in a use_clause, and an entity E with the name
80850 Value is defined in a package that is also referenced in a
80851 use_clause, the entity E may no longer be use-visible,
80852 resulting in errors. This should be rare and is easily fixed
80853 if it does occur.
80854
80855 \1f
80856 File: aarm2012.info, Node: A.18, Next: A.19, Prev: A.17, Up: Annex A
80857
80858 A.18 Containers
80859 ===============
80860
80861 1/2
80862 {AI95-00302-03AI95-00302-03} This clause presents the specifications of
80863 the package Containers and several child packages, which provide
80864 facilities for storing collections of elements.
80865
80866 1.a.1/3
80867 Glossary entry: A container is an object that contain other
80868 objects all of the same type, which could be class-wide.
80869 Several predefined container types are provided by the
80870 children of package Ada.Containers (see *note A.18.1::).
80871
80872 2/2
80873 {AI95-00302-03AI95-00302-03} A variety of sequence and associative
80874 containers are provided. Each container includes a cursor type. A
80875 cursor is a reference to an element within a container. Many operations
80876 on cursors are common to all of the containers. A cursor referencing an
80877 element in a container is considered to be overlapping with the
80878 container object itself.
80879
80880 2.a/2
80881 Reason: The last sentence is intended to clarify that
80882 operations that just use a cursor are on the same footing as
80883 operations that use a container in terms of the reentrancy
80884 rules of Annex A.
80885
80886 3/2
80887 {AI95-00302-03AI95-00302-03} Within this clause we provide
80888 Implementation Advice for the desired average or worst case time
80889 complexity of certain operations on a container. This advice is
80890 expressed using the Landau symbol O(X). Presuming f is some function of
80891 a length parameter N and t(N) is the time the operation takes (on
80892 average or worst case, as specified) for the length N, a complexity of
80893 O(f(N)) means that there exists a finite A such that for any N,
80894 t(N)/f(N) < A.
80895
80896 3.a/2
80897 Discussion: Of course, an implementation can do better than a
80898 specified O(f(N)): for example, O(1) meets the requirements
80899 for O(log N).
80900
80901 3.b/2
80902 This concept seems to have as many names as there are authors.
80903 We used "Landau symbol" because that's what our reference
80904 does. But we'd also seen this referred as big-O notation
80905 (sometimes written as big-oh), and as Bachmann notation.
80906 Whatever the name, it always has the above definition.
80907
80908 4/2
80909 If the advice suggests that the complexity should be less than O(f(N)),
80910 then for any arbitrarily small positive real D, there should exist a
80911 positive integer M such that for all N > M, t(N)/f(N) < D.
80912
80913 5/3
80914 {AI05-0001-1AI05-0001-1} {AI05-0044-1AI05-0044-1} When a formal function
80915 is used to provide an ordering for a container, it is generally required
80916 to define a strict weak ordering. A function "<" defines a strict weak
80917 ordering if it is irreflexive, asymmetric, transitive, and in addition,
80918 if x < y for any values x and y, then for all other values z, (x < z) or
80919 (z < y).
80920
80921 _Language Design Principles_
80922
80923 5.a/3
80924 {AI95-00302-03AI95-00302-03} {AI05-0299-1AI05-0299-1} This
80925 subclause provides a number of useful containers for Ada.
80926 Only the most useful containers are provided. Ones that are
80927 relatively easy to code, redundant, or rarely used are omitted
80928 from this set, even if they are generally included in
80929 containers libraries.
80930
80931 5.b/2
80932 The containers packages are modeled on the Standard Template
80933 Library (STL), an algorithms and data structure library
80934 popularized by Alexander Stepanov, and included in the C++
80935 standard library. The structure and terminology differ from
80936 the STL where that better maps to common Ada usage. For
80937 instance, what the STL calls "iterators" are called "cursors"
80938 here.
80939
80940 5.c/2
80941 The following major nonlimited containers are provided:
80942
80943 5.d/2
80944 * (Expandable) Vectors of any nonlimited type;
80945
80946 5.e/2
80947 * Doubly-linked Lists of any nonlimited type;
80948
80949 5.f/2
80950 * Hashed Maps keyed by any nonlimited hashable type, and
80951 containing any nonlimited type;
80952
80953 5.g/2
80954 * Ordered Maps keyed by any nonlimited ordered type, and
80955 containing any nonlimited type;
80956
80957 5.h/3
80958 * {AI05-0136-1AI05-0136-1} Hashed Sets of any nonlimited
80959 hashable type;
80960
80961 5.i/3
80962 * {AI05-0136-1AI05-0136-1} Ordered Sets of any nonlimited
80963 ordered type;
80964
80965 5.i.1/3
80966 * {AI05-0136-1AI05-0136-1} Multiway Trees of any nonlimited
80967 type;
80968
80969 5.i.2/3
80970 * {AI05-0069-1AI05-0069-1} Holders of any (indefinite)
80971 nonlimited type;
80972
80973 5.i.3/3
80974 * {AI05-0159-1AI05-0159-1} Synchronized queues of any
80975 definite nonlimited type; and
80976
80977 5.i.4/3
80978 * {AI05-0159-1AI05-0159-1} Priority queues of any definite
80979 nonlimited type.
80980
80981 5.j/3
80982 {AI05-0001-1AI05-0001-1} Separate versions for definite and
80983 indefinite element types are provided, as those for definite
80984 types can be implemented more efficiently. Similarly, a
80985 separate bounded version is provided in order to give more
80986 predictable memory usage.
80987
80988 5.k/2
80989 Each container includes a cursor, which is a reference to an
80990 element within a container. Cursors generally remain valid as
80991 long as the container exists and the element referenced is not
80992 deleted. Many operations on cursors are common to all of the
80993 containers. This makes it possible to write generic
80994 algorithms that work on any kind of container.
80995
80996 5.l/2
80997 The containers packages are structured so that additional
80998 packages can be added in the future. Indeed, we hope that
80999 these packages provide the basis for a more extensive
81000 secondary standard for containers.
81001
81002 5.m/2
81003 If containers with similar functionality (but different
81004 performance characteristics) are provided (by the
81005 implementation or by a secondary standard), we suggest that a
81006 prefix be used to identify the class of the functionality:
81007 "Ada.Containers.Bounded_Sets" (for a set with a maximum number
81008 of elements); "Ada.Containers.Protected_Maps" (for a map which
81009 can be accessed by multiple tasks at one time);
81010 "Ada.Containers.Persistent_Vectors" (for a persistent vector
81011 which continues to exist between executions of a program) and
81012 so on.
81013
81014 5.n/2
81015 Note that the language already includes several requirements
81016 that are important to the use of containers. These include:
81017
81018 5.o/2
81019 * Library packages must be reentrant - multiple tasks can
81020 use the packages as long as they operate on separate
81021 containers. Thus, it is only necessary for a user to
81022 protect a container if a single container needs to be
81023 used by multiple tasks.
81024
81025 5.p/2
81026 * Language-defined types must stream "properly". That
81027 means that the stream attributes can be used to implement
81028 persistence of containers when necessary, and containers
81029 can be passed between partitions of a program.
81030
81031 5.q/2
81032 * Equality of language-defined types must compose
81033 "properly". This means that the version of "=" directly
81034 used by users is the same one that will be used in
81035 generics and in predefined equality operators of types
81036 with components of the containers and/or cursors. This
81037 prevents the abstraction from breaking unexpectedly.
81038
81039 5.q.1/3
81040 * {AI05-0048-1AI05-0048-1} Redispatching is not allowed
81041 (unless it is required). That means that overriding a
81042 container operation will not change the behavior of any
81043 other predefined container operation. This provides a
81044 stable base for extensions.
81045
81046 5.r/2
81047 If a container's element type is controlled, the point at
81048 which the element is finalized will depend on the
81049 implementation of the container. We do not specify precisely
81050 where this will happen (it will happen no later than the
81051 finalization of the container, of course) in order to give
81052 implementation's flexibility to cache, block, or split the
81053 nodes of the container. In particular, Delete does not
81054 necessarily finalize the element; the implementation may (or
81055 may not) hold the space for reuse.
81056
81057 5.s/2
81058 This is not likely to be a hardship, as the element type has
81059 to be nonlimited. Types used to manage scarce resources
81060 generally need to be limited. Otherwise, the amount of
81061 resources needed is hard to control, as the language allows a
81062 lot of variation in the number or order of
81063 adjusts/finalizations. For common uses of nonlimited
81064 controlled types such as managing storage, the types already
81065 have to manage arbitrary copies.
81066
81067 5.t/2
81068 The use of controlled types also brings up the possibility of
81069 failure of finalization (and thus deallocation) of an element.
81070 This is a "serious bug", as AI95-179 puts it, so we don't try
81071 to specify what happens in that case. The implementation
81072 should propagate the exception.
81073
81074 5.u/2
81075 Implementation Note: It is expected that exceptions propagated
81076 from these operations do not damage containers. That is, if
81077 Storage_Error is propagated because of an allocation failure,
81078 or Constraint_Error is propagated by the assignment of
81079 elements, the container can continue to be used without
81080 further exceptions. The intent is that it should be possible
81081 to recover from errors without losing data. We don't try to
81082 state this formally in most cases, because it is hard to
81083 define precisely what is and is not allowed behavior.
81084
81085 5.v/2
81086 Implementation Note: When this clause says that the behavior
81087 of something is unspecified, we really mean that any result of
81088 executing Ada code short of erroneous execution is allowed.
81089 We do not mean that memory not belonging to the parameters of
81090 the operation can be trashed. When we mean to allow erroneous
81091 behavior, we specifically say that execution is erroneous.
81092 All this means if the containers are written in Ada is that
81093 checks should not be suppressed or removed assuming some
81094 behavior of other code, and that the implementation should
81095 take care to avoid creating internal dangling accesses by
81096 assuming behavior from generic formals that can't be
81097 guaranteed. We don't try to say this normatively because it
81098 would be fairly complex, and implementers are unlikely to
81099 increase their support costs by fielding implementations that
81100 are unstable if given buggy hash functions, et al.
81101
81102 _Extensions to Ada 95_
81103
81104 5.w/3
81105 {AI95-00302-03AI95-00302-03} {AI05-0299-1AI05-0299-1} This
81106 subclause is new. It just provides an introduction to the
81107 following subclauses.
81108
81109 _Wording Changes from Ada 2005_
81110
81111 5.x/3
81112 {AI05-0044-1AI05-0044-1} Correction: Added a definition of
81113 strict weak ordering.
81114
81115 * Menu:
81116
81117 * A.18.1 :: The Package Containers
81118 * A.18.2 :: The Generic Package Containers.Vectors
81119 * A.18.3 :: The Generic Package Containers.Doubly_Linked_Lists
81120 * A.18.4 :: Maps
81121 * A.18.5 :: The Generic Package Containers.Hashed_Maps
81122 * A.18.6 :: The Generic Package Containers.Ordered_Maps
81123 * A.18.7 :: Sets
81124 * A.18.8 :: The Generic Package Containers.Hashed_Sets
81125 * A.18.9 :: The Generic Package Containers.Ordered_Sets
81126 * A.18.10 :: The Generic Package Containers.Multiway_Trees
81127 * A.18.11 :: The Generic Package Containers.Indefinite_Vectors
81128 * A.18.12 :: The Generic Package Containers.Indefinite_Doubly_Linked_Lists
81129 * A.18.13 :: The Generic Package Containers.Indefinite_Hashed_Maps
81130 * A.18.14 :: The Generic Package Containers.Indefinite_Ordered_Maps
81131 * A.18.15 :: The Generic Package Containers.Indefinite_Hashed_Sets
81132 * A.18.16 :: The Generic Package Containers.Indefinite_Ordered_Sets
81133 * A.18.17 :: The Generic Package Containers.Indefinite_Multiway_Trees
81134 * A.18.18 :: The Generic Package Containers.Indefinite_Holders
81135 * A.18.19 :: The Generic Package Containers.Bounded_Vectors
81136 * A.18.20 :: The Generic Package Containers.Bounded_Doubly_Linked_Lists
81137 * A.18.21 :: The Generic Package Containers.Bounded_Hashed_Maps
81138 * A.18.22 :: The Generic Package Containers.Bounded_Ordered_Maps
81139 * A.18.23 :: The Generic Package Containers.Bounded_Hashed_Sets
81140 * A.18.24 :: The Generic Package Containers.Bounded_Ordered_Sets
81141 * A.18.25 :: The Generic Package Containers.Bounded_Multiway_Trees
81142 * A.18.26 :: Array Sorting
81143 * A.18.27 :: The Generic Package Containers.Synchronized_Queue_Interfaces
81144 * A.18.28 :: The Generic Package Containers.Unbounded_Synchronized_Queues
81145 * A.18.29 :: The Generic Package Containers.Bounded_Synchronized_Queues
81146 * A.18.30 :: The Generic Package Containers.Unbounded_Priority_Queues
81147 * A.18.31 :: The Generic Package Containers.Bounded_Priority_Queues
81148 * A.18.32 :: Example of Container Use
81149
81150 \1f
81151 File: aarm2012.info, Node: A.18.1, Next: A.18.2, Up: A.18
81152
81153 A.18.1 The Package Containers
81154 -----------------------------
81155
81156 1/2
81157 {AI95-00302-03AI95-00302-03} The package Containers is the root of the
81158 containers subsystem.
81159
81160 _Static Semantics_
81161
81162 2/2
81163 {AI95-00302-03AI95-00302-03} The library package Containers has the
81164 following declaration:
81165
81166 3/2
81167 package Ada.Containers is
81168 pragma Pure(Containers);
81169
81170 4/2
81171 type Hash_Type is mod implementation-defined;
81172
81173 5/2
81174 type Count_Type is range 0 .. implementation-defined;
81175
81176 5.1/3
81177 {AI05-0001-1AI05-0001-1} Capacity_Error : exception;
81178
81179 6/2
81180 end Ada.Containers;
81181
81182 7/2
81183 {AI95-00302-03AI95-00302-03} Hash_Type represents the range of the
81184 result of a hash function. Count_Type represents the (potential or
81185 actual) number of elements of a container.
81186
81187 7.a/2
81188 Implementation defined: The value of
81189 Containers.Hash_Type'Modulus. The value of
81190 Containers.Count_Type'Last.
81191
81192 7.1/3
81193 {AI05-0262-1AI05-0262-1} Capacity_Error is raised when the capacity of a
81194 container is exceeded.
81195
81196 _Implementation Advice_
81197
81198 8/2
81199 {AI95-00302-03AI95-00302-03} Hash_Type'Modulus should be at least 2**32.
81200 Count_Type'Last should be at least 2**31-1.
81201
81202 8.a/2
81203 Implementation Advice: Containers.Hash_Type'Modulus should be
81204 at least 2**32. Containers.Count_Type'Last should be at least
81205 2**31-1.
81206
81207 8.b/2
81208 Discussion: This is not a requirement so that these types can
81209 be declared properly on machines with native sizes that are
81210 not 32 bits. For instance, a 24-bit target could use 2**24
81211 for Hash_Type'Modulus.
81212
81213 _Extensions to Ada 95_
81214
81215 8.c/2
81216 {AI95-00302-03AI95-00302-03} The package Containers is new.
81217
81218 _Incompatibilities With Ada 2005_
81219
81220 8.d/3
81221 {AI05-0001-1AI05-0001-1} Exception Capacity_Error is added to
81222 Containers. If Containers is referenced in a use_clause, and
81223 an entity with the name Capacity_Error is defined in a package
81224 that is also referenced in a use_clause, the entity
81225 Capacity_Error may no longer be use-visible, resulting in
81226 errors. This should be rare and is easily fixed if it does
81227 occur.
81228
81229 \1f
81230 File: aarm2012.info, Node: A.18.2, Next: A.18.3, Prev: A.18.1, Up: A.18
81231
81232 A.18.2 The Generic Package Containers.Vectors
81233 ---------------------------------------------
81234
81235 1/2
81236 The language-defined generic package Containers.Vectors provides private
81237 types Vector and Cursor, and a set of operations for each type. A
81238 vector container allows insertion and deletion at any position, but it
81239 is specifically optimized for insertion and deletion at the high end
81240 (the end with the higher index) of the container. A vector container
81241 also provides random access to its elements.
81242
81243 2/2
81244 A vector container behaves conceptually as an array that expands as
81245 necessary as items are inserted. The length of a vector is the number
81246 of elements that the vector contains. The capacity of a vector is the
81247 maximum number of elements that can be inserted into the vector prior to
81248 it being automatically expanded.
81249
81250 3/2
81251 Elements in a vector container can be referred to by an index value of a
81252 generic formal type. The first element of a vector always has its index
81253 value equal to the lower bound of the formal type.
81254
81255 4/2
81256 A vector container may contain empty elements. Empty elements do not
81257 have a specified value.
81258
81259 4.a/2
81260 Implementation Note: Vectors are not intended to be sparse
81261 (that is, there are elements at all defined positions). Users
81262 are expected to use other containers (like a Map) when they
81263 need sparse structures (there is a Note to this effect at the
81264 end of this subclause).
81265
81266 4.b/2
81267 The internal array is a conceptual model of a vector. There
81268 is no requirement for an implementation to be a single
81269 contiguous array.
81270
81271 _Static Semantics_
81272
81273 5/2
81274 {AI95-00302-03AI95-00302-03} The generic library package
81275 Containers.Vectors has the following declaration:
81276
81277 6/3
81278 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
81279 generic
81280 type Index_Type is range <>;
81281 type Element_Type is private;
81282 with function "=" (Left, Right : Element_Type)
81283 return Boolean is <>;
81284 package Ada.Containers.Vectors is
81285 pragma Preelaborate(Vectors);
81286 pragma Remote_Types(Vectors);
81287
81288 7/2
81289 subtype Extended_Index is
81290 Index_Type'Base range
81291 Index_Type'First-1 ..
81292 Index_Type'Min (Index_Type'Base'Last - 1, Index_Type'Last) + 1;
81293 No_Index : constant Extended_Index := Extended_Index'First;
81294
81295 8/3
81296 {AI05-0212-1AI05-0212-1} type Vector is tagged private
81297 with Constant_Indexing => Constant_Reference,
81298 Variable_Indexing => Reference,
81299 Default_Iterator => Iterate,
81300 Iterator_Element => Element_Type;
81301 pragma Preelaborable_Initialization(Vector);
81302
81303 9/2
81304 type Cursor is private;
81305 pragma Preelaborable_Initialization(Cursor);
81306
81307 10/2
81308 Empty_Vector : constant Vector;
81309
81310 11/2
81311 No_Element : constant Cursor;
81312
81313 11.1/3
81314 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
81315
81316 11.2/3
81317 {AI05-0212-1AI05-0212-1} package Vector_Iterator_Interfaces is new
81318 Ada.Iterator_Interfaces (Cursor, Has_Element);
81319
81320 12/2
81321 function "=" (Left, Right : Vector) return Boolean;
81322
81323 13/2
81324 function To_Vector (Length : Count_Type) return Vector;
81325
81326 14/2
81327 function To_Vector
81328 (New_Item : Element_Type;
81329 Length : Count_Type) return Vector;
81330
81331 15/2
81332 function "&" (Left, Right : Vector) return Vector;
81333
81334 16/2
81335 function "&" (Left : Vector;
81336 Right : Element_Type) return Vector;
81337
81338 17/2
81339 function "&" (Left : Element_Type;
81340 Right : Vector) return Vector;
81341
81342 18/2
81343 function "&" (Left, Right : Element_Type) return Vector;
81344
81345 19/2
81346 function Capacity (Container : Vector) return Count_Type;
81347
81348 20/2
81349 procedure Reserve_Capacity (Container : in out Vector;
81350 Capacity : in Count_Type);
81351
81352 21/2
81353 function Length (Container : Vector) return Count_Type;
81354
81355 22/2
81356 procedure Set_Length (Container : in out Vector;
81357 Length : in Count_Type);
81358
81359 23/2
81360 function Is_Empty (Container : Vector) return Boolean;
81361
81362 24/2
81363 procedure Clear (Container : in out Vector);
81364
81365 25/2
81366 function To_Cursor (Container : Vector;
81367 Index : Extended_Index) return Cursor;
81368
81369 26/2
81370 function To_Index (Position : Cursor) return Extended_Index;
81371
81372 27/2
81373 function Element (Container : Vector;
81374 Index : Index_Type)
81375 return Element_Type;
81376
81377 28/2
81378 function Element (Position : Cursor) return Element_Type;
81379
81380 29/2
81381 procedure Replace_Element (Container : in out Vector;
81382 Index : in Index_Type;
81383 New_Item : in Element_Type);
81384
81385 30/2
81386 procedure Replace_Element (Container : in out Vector;
81387 Position : in Cursor;
81388 New_item : in Element_Type);
81389
81390 31/2
81391 procedure Query_Element
81392 (Container : in Vector;
81393 Index : in Index_Type;
81394 Process : not null access procedure (Element : in Element_Type));
81395
81396 32/2
81397 procedure Query_Element
81398 (Position : in Cursor;
81399 Process : not null access procedure (Element : in Element_Type));
81400
81401 33/2
81402 procedure Update_Element
81403 (Container : in out Vector;
81404 Index : in Index_Type;
81405 Process : not null access procedure
81406 (Element : in out Element_Type));
81407
81408 34/2
81409 procedure Update_Element
81410 (Container : in out Vector;
81411 Position : in Cursor;
81412 Process : not null access procedure
81413 (Element : in out Element_Type));
81414
81415 34.1/3
81416 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
81417 (Element : not null access constant Element_Type) is private
81418 with Implicit_Dereference => Element;
81419
81420 34.2/3
81421 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
81422 with Implicit_Dereference => Element;
81423
81424 34.3/3
81425 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Vector;
81426 Index : in Index_Type)
81427 return Constant_Reference_Type;
81428
81429 34.4/3
81430 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Vector;
81431 Index : in Index_Type)
81432 return Reference_Type;
81433
81434 34.5/3
81435 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Vector;
81436 Position : in Cursor)
81437 return Constant_Reference_Type;
81438
81439 34.6/3
81440 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Vector;
81441 Position : in Cursor)
81442 return Reference_Type;
81443
81444 34.7/3
81445 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Vector; Source : in Vector);
81446
81447 34.8/3
81448 {AI05-0001-1AI05-0001-1} function Copy (Source : Vector; Capacity : Count_Type := 0)
81449 return Vector;
81450
81451 35/2
81452 procedure Move (Target : in out Vector;
81453 Source : in out Vector);
81454
81455 36/2
81456 procedure Insert (Container : in out Vector;
81457 Before : in Extended_Index;
81458 New_Item : in Vector);
81459
81460 37/2
81461 procedure Insert (Container : in out Vector;
81462 Before : in Cursor;
81463 New_Item : in Vector);
81464
81465 38/2
81466 procedure Insert (Container : in out Vector;
81467 Before : in Cursor;
81468 New_Item : in Vector;
81469 Position : out Cursor);
81470
81471 39/2
81472 procedure Insert (Container : in out Vector;
81473 Before : in Extended_Index;
81474 New_Item : in Element_Type;
81475 Count : in Count_Type := 1);
81476
81477 40/2
81478 procedure Insert (Container : in out Vector;
81479 Before : in Cursor;
81480 New_Item : in Element_Type;
81481 Count : in Count_Type := 1);
81482
81483 41/2
81484 procedure Insert (Container : in out Vector;
81485 Before : in Cursor;
81486 New_Item : in Element_Type;
81487 Position : out Cursor;
81488 Count : in Count_Type := 1);
81489
81490 42/2
81491 procedure Insert (Container : in out Vector;
81492 Before : in Extended_Index;
81493 Count : in Count_Type := 1);
81494
81495 43/2
81496 procedure Insert (Container : in out Vector;
81497 Before : in Cursor;
81498 Position : out Cursor;
81499 Count : in Count_Type := 1);
81500
81501 44/2
81502 procedure Prepend (Container : in out Vector;
81503 New_Item : in Vector);
81504
81505 45/2
81506 procedure Prepend (Container : in out Vector;
81507 New_Item : in Element_Type;
81508 Count : in Count_Type := 1);
81509
81510 46/2
81511 procedure Append (Container : in out Vector;
81512 New_Item : in Vector);
81513
81514 47/2
81515 procedure Append (Container : in out Vector;
81516 New_Item : in Element_Type;
81517 Count : in Count_Type := 1);
81518
81519 48/2
81520 procedure Insert_Space (Container : in out Vector;
81521 Before : in Extended_Index;
81522 Count : in Count_Type := 1);
81523
81524 49/2
81525 procedure Insert_Space (Container : in out Vector;
81526 Before : in Cursor;
81527 Position : out Cursor;
81528 Count : in Count_Type := 1);
81529
81530 50/2
81531 procedure Delete (Container : in out Vector;
81532 Index : in Extended_Index;
81533 Count : in Count_Type := 1);
81534
81535 51/2
81536 procedure Delete (Container : in out Vector;
81537 Position : in out Cursor;
81538 Count : in Count_Type := 1);
81539
81540 52/2
81541 procedure Delete_First (Container : in out Vector;
81542 Count : in Count_Type := 1);
81543
81544 53/2
81545 procedure Delete_Last (Container : in out Vector;
81546 Count : in Count_Type := 1);
81547
81548 54/2
81549 procedure Reverse_Elements (Container : in out Vector);
81550
81551 55/2
81552 procedure Swap (Container : in out Vector;
81553 I, J : in Index_Type);
81554
81555 56/2
81556 procedure Swap (Container : in out Vector;
81557 I, J : in Cursor);
81558
81559 57/2
81560 function First_Index (Container : Vector) return Index_Type;
81561
81562 58/2
81563 function First (Container : Vector) return Cursor;
81564
81565 59/2
81566 function First_Element (Container : Vector)
81567 return Element_Type;
81568
81569 60/2
81570 function Last_Index (Container : Vector) return Extended_Index;
81571
81572 61/2
81573 function Last (Container : Vector) return Cursor;
81574
81575 62/2
81576 function Last_Element (Container : Vector)
81577 return Element_Type;
81578
81579 63/2
81580 function Next (Position : Cursor) return Cursor;
81581
81582 64/2
81583 procedure Next (Position : in out Cursor);
81584
81585 65/2
81586 function Previous (Position : Cursor) return Cursor;
81587
81588 66/2
81589 procedure Previous (Position : in out Cursor);
81590
81591 67/2
81592 function Find_Index (Container : Vector;
81593 Item : Element_Type;
81594 Index : Index_Type := Index_Type'First)
81595 return Extended_Index;
81596
81597 68/2
81598 function Find (Container : Vector;
81599 Item : Element_Type;
81600 Position : Cursor := No_Element)
81601 return Cursor;
81602
81603 69/2
81604 function Reverse_Find_Index (Container : Vector;
81605 Item : Element_Type;
81606 Index : Index_Type := Index_Type'Last)
81607 return Extended_Index;
81608
81609 70/2
81610 function Reverse_Find (Container : Vector;
81611 Item : Element_Type;
81612 Position : Cursor := No_Element)
81613 return Cursor;
81614
81615 71/2
81616 function Contains (Container : Vector;
81617 Item : Element_Type) return Boolean;
81618
81619 72/3
81620 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
81621
81622 73/2
81623 procedure Iterate
81624 (Container : in Vector;
81625 Process : not null access procedure (Position : in Cursor));
81626
81627 74/2
81628 procedure Reverse_Iterate
81629 (Container : in Vector;
81630 Process : not null access procedure (Position : in Cursor));
81631
81632 74.1/3
81633 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Vector)
81634 return Vector_Iterator_Interfaces.Reversible_Iterator'Class;
81635
81636 74.2/3
81637 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Vector; Start : in Cursor)
81638 return Vector_Iterator_Interfaces.Reversible_Iterator'Class;
81639
81640 75/2
81641 generic
81642 with function "<" (Left, Right : Element_Type)
81643 return Boolean is <>;
81644 package Generic_Sorting is
81645
81646 76/2
81647 function Is_Sorted (Container : Vector) return Boolean;
81648
81649 77/2
81650 procedure Sort (Container : in out Vector);
81651
81652 78/2
81653 procedure Merge (Target : in out Vector;
81654 Source : in out Vector);
81655
81656 79/2
81657 end Generic_Sorting;
81658
81659 80/2
81660 private
81661
81662 81/2
81663 ... -- not specified by the language
81664
81665 82/2
81666 end Ada.Containers.Vectors;
81667
81668 83/2
81669 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
81670 function "=" on Element_Type values is expected to define a reflexive
81671 and symmetric relationship and return the same result value each time it
81672 is called with a particular pair of values. If it behaves in some other
81673 manner, the functions defined to use it return an unspecified value.
81674 The exact arguments and number of calls of this generic formal function
81675 by the functions defined to use it are unspecified.
81676
81677 83.a/2
81678 Ramification: The "functions defined to use it" are Find,
81679 Find_Index, Reverse_Find, Reverse_Find_Index, and "=" for
81680 Vectors. This list is a bit too long to give explicitly.
81681
81682 83.b/2
81683 If the actual function for "=" is not symmetric and
81684 consistent, the result returned by any of the functions
81685 defined to use "=" cannot be predicted. The implementation is
81686 not required to protect against "=" raising an exception, or
81687 returning random results, or any other "bad" behavior. And it
81688 can call "=" in whatever manner makes sense. But note that
81689 only the results of the functions defined to use "=" are
81690 unspecified; other subprograms are not allowed to break if "="
81691 is bad.
81692
81693 84/2
81694 {AI95-00302-03AI95-00302-03} The type Vector is used to represent
81695 vectors. The type Vector needs finalization (see *note 7.6::).
81696
81697 85/2
81698 {AI95-00302-03AI95-00302-03} Empty_Vector represents the empty vector
81699 object. It has a length of 0. If an object of type Vector is not
81700 otherwise initialized, it is initialized to the same value as
81701 Empty_Vector.
81702
81703 86/2
81704 {AI95-00302-03AI95-00302-03} No_Element represents a cursor that
81705 designates no element. If an object of type Cursor is not otherwise
81706 initialized, it is initialized to the same value as No_Element.
81707
81708 87/2
81709 {AI95-00302-03AI95-00302-03} The predefined "=" operator for type Cursor
81710 returns True if both cursors are No_Element, or designate the same
81711 element in the same container.
81712
81713 88/2
81714 {AI95-00302-03AI95-00302-03} Execution of the default implementation of
81715 the Input, Output, Read, or Write attribute of type Cursor raises
81716 Program_Error.
81717
81718 88.a/2
81719 Reason: A cursor will probably be implemented in terms of one
81720 or more access values, and the effects of streaming access
81721 values is unspecified. Rather than letting the user stream
81722 junk by accident, we mandate that streaming of cursors raise
81723 Program_Error by default. The attributes can always be
81724 specified if there is a need to support streaming.
81725
81726 88.1/3
81727 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Vector'Write for a
81728 Vector object V writes Length(V) elements of the vector to the stream.
81729 It also may write additional information about the vector.
81730
81731 88.2/3
81732 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Vector'Read reads the
81733 representation of a vector from the stream, and assigns to Item a vector
81734 with the same length and elements as was written by Vector'Write.
81735
81736 88.b/3
81737 Implementation Note: The Standard requires streaming of all
81738 language-defined nonlimited types (including containers) to
81739 "work" (see *note 13.13.2::). In addition, we do not want all
81740 of the elements that make up the capacity of the vector
81741 streamed, as those beyond the length of the container have
81742 undefined contents (and might cause bad things when read back
81743 in). This will require a custom stream attribute
81744 implementation; the language-defined default implementation
81745 will not work (even for a bounded form, as that would most
81746 likely stream the entire capacity of the vector). There is a
81747 separate requirement that the unbounded and Bounded form use
81748 the same streaming representation for the same element type,
81749 see *note A.18.19::.
81750
81751 89/2
81752 {AI95-00302-03AI95-00302-03} No_Index represents a position that does
81753 not correspond to any element. The subtype Extended_Index includes the
81754 indices covered by Index_Type plus the value No_Index and, if it exists,
81755 the successor to the Index_Type'Last.
81756
81757 89.a/2
81758 Discussion: We require the existence of Index_Type'First - 1,
81759 so that No_Index and Last_Index of an empty vector is
81760 well-defined. We don't require the existence of
81761 Index_Type'Last + 1, as it is only used as the position of
81762 insertions (and needs to be allowed only when inserting an
81763 empty vector).
81764
81765 89.1/3
81766 {AI05-0001-1AI05-0001-1} If an operation attempts to modify the vector
81767 such that the position of the last element would be greater than
81768 Index_Type'Last, then the operation propagates Constraint_Error.
81769
81770 89.b/3
81771 Reason: We don't want to require an implementation to go to
81772 heroic efforts to handle index values larger than the base
81773 type of the index subtype.
81774
81775 90/2
81776 {AI95-00302-03AI95-00302-03} [Some operations of this generic package
81777 have access-to-subprogram parameters. To ensure such operations are
81778 well-defined, they guard against certain actions by the designated
81779 subprogram. In particular, some operations check for "tampering with
81780 cursors" of a container because they depend on the set of elements of
81781 the container remaining constant, and others check for "tampering with
81782 elements" of a container because they depend on elements of the
81783 container not being replaced.]
81784
81785 91/2
81786 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with cursors
81787 of a vector object V if:
81788
81789 92/2
81790 * it inserts or deletes elements of V, that is, it calls the Insert,
81791 Insert_Space, Clear, Delete, or Set_Length procedures with V as a
81792 parameter; or
81793
81794 92.a/2
81795 To be honest: Operations which are defined to be equivalent to
81796 a call on one of these operations also are included.
81797 Similarly, operations which call one of these as part of their
81798 definition are included.
81799
81800 93/2
81801 * it finalizes V; or
81802
81803 93.1/3
81804 * {AI05-0001-1AI05-0001-1} it calls the Assign procedure with V as
81805 the Target parameter; or
81806
81807 93.a.1/3
81808 Ramification: We don't need to explicitly mention
81809 assignment_statement, because that finalizes the target object
81810 as part of the operation, and finalization of an object is
81811 already defined as tampering with cursors.
81812
81813 94/2
81814 * it calls the Move procedure with V as a parameter.
81815
81816 94.a/2
81817 Discussion: Swap, Sort, and Merge copy elements rather than
81818 reordering them, so they don't tamper with cursors.
81819
81820 95/2
81821 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with
81822 elements of a vector object V if:
81823
81824 96/2
81825 * it tampers with cursors of V; or
81826
81827 97/2
81828 * it replaces one or more elements of V, that is, it calls the
81829 Replace_Element, Reverse_Elements, or Swap procedures or the Sort
81830 or Merge procedures of an instance of Generic_Sorting with V as a
81831 parameter.
81832
81833 97.a/2
81834 Reason: Complete replacement of an element can cause its
81835 memory to be deallocated while another operation is holding
81836 onto a reference to it. That can't be allowed. However, a
81837 simple modification of (part of) an element is not a problem,
81838 so Update_Element does not cause a problem.
81839
81840 97.1/3
81841 {AI05-0265-1AI05-0265-1} When tampering with cursors is prohibited for a
81842 particular vector object V, Program_Error is propagated by a call of any
81843 language-defined subprogram that is defined to tamper with the cursors
81844 of V, leaving V unmodified. Similarly, when tampering with elements is
81845 prohibited for a particular vector object V, Program_Error is propagated
81846 by a call of any language-defined subprogram that is defined to tamper
81847 with the elements of V [(or tamper with the cursors of V)], leaving V
81848 unmodified.
81849
81850 97.b/3
81851 Proof: Tampering with elements includes tampering with
81852 cursors, so we mention it only from completeness in the second
81853 sentence.
81854
81855 97.2/3
81856 function Has_Element (Position : Cursor) return Boolean;
81857
81858 97.3/3
81859 {AI05-0212-1AI05-0212-1} Returns True if Position designates
81860 an element, and returns False otherwise.
81861
81862 97.c/3
81863 To be honest: {AI05-0005-1AI05-0005-1}
81864 {AI05-0212-1AI05-0212-1} This function might not detect
81865 cursors that designate deleted elements; such cursors are
81866 invalid (see below) and the result of calling Has_Element with
81867 an invalid cursor is unspecified (but not erroneous).
81868
81869 98/2
81870 function "=" (Left, Right : Vector) return Boolean;
81871
81872 99/3
81873 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If Left
81874 and Right denote the same vector object, then the function
81875 returns True. If Left and Right have different lengths, then
81876 the function returns False. Otherwise, it compares each
81877 element in Left to the corresponding element in Right using
81878 the generic formal equality operator. If any such comparison
81879 returns False, the function returns False; otherwise, it
81880 returns True. Any exception raised during evaluation of
81881 element equality is propagated.
81882
81883 99.a/2
81884 Implementation Note: This wording describes the canonical
81885 semantics. However, the order and number of calls on the
81886 formal equality function is unspecified for all of the
81887 operations that use it in this package, so an implementation
81888 can call it as many or as few times as it needs to get the
81889 correct answer. Specifically, there is no requirement to call
81890 the formal equality additional times once the answer has been
81891 determined.
81892
81893 100/2
81894 function To_Vector (Length : Count_Type) return Vector;
81895
81896 101/2
81897 {AI95-00302-03AI95-00302-03} Returns a vector with a length of
81898 Length, filled with empty elements.
81899
81900 102/2
81901 function To_Vector
81902 (New_Item : Element_Type;
81903 Length : Count_Type) return Vector;
81904
81905 103/2
81906 {AI95-00302-03AI95-00302-03} Returns a vector with a length of
81907 Length, filled with elements initialized to the value
81908 New_Item.
81909
81910 104/2
81911 function "&" (Left, Right : Vector) return Vector;
81912
81913 105/2
81914 {AI95-00302-03AI95-00302-03} Returns a vector comprising the
81915 elements of Left followed by the elements of Right.
81916
81917 106/2
81918 function "&" (Left : Vector;
81919 Right : Element_Type) return Vector;
81920
81921 107/2
81922 {AI95-00302-03AI95-00302-03} Returns a vector comprising the
81923 elements of Left followed by the element Right.
81924
81925 108/2
81926 function "&" (Left : Element_Type;
81927 Right : Vector) return Vector;
81928
81929 109/2
81930 {AI95-00302-03AI95-00302-03} Returns a vector comprising the
81931 element Left followed by the elements of Right.
81932
81933 110/2
81934 function "&" (Left, Right : Element_Type) return Vector;
81935
81936 111/2
81937 {AI95-00302-03AI95-00302-03} Returns a vector comprising the
81938 element Left followed by the element Right.
81939
81940 112/2
81941 function Capacity (Container : Vector) return Count_Type;
81942
81943 113/2
81944 {AI95-00302-03AI95-00302-03} Returns the capacity of
81945 Container.
81946
81947 114/2
81948 procedure Reserve_Capacity (Container : in out Vector;
81949 Capacity : in Count_Type);
81950
81951 115/3
81952 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1}
81953 {AI05-0264-1AI05-0264-1} If the capacity of Container is
81954 already greater than or equal to Capacity, then
81955 Reserve_Capacity has no effect. Otherwise, Reserve_Capacity
81956 allocates additional storage as necessary to ensure that the
81957 length of the resulting vector can become at least the value
81958 Capacity without requiring an additional call to
81959 Reserve_Capacity, and is large enough to hold the current
81960 length of Container. Reserve_Capacity then, as necessary,
81961 moves elements into the new storage and deallocates any
81962 storage no longer needed. Any exception raised during
81963 allocation is propagated and Container is not modified.
81964
81965 115.a/2
81966 Discussion: Expanding the internal array can be done by
81967 allocating a new, longer array, copying the elements, and
81968 deallocating the original array. This may raise
81969 Storage_Error, or cause an exception from a controlled
81970 subprogram. We require that a failed Reserve_Capacity does
81971 not lose any elements if an exception occurs, but we do not
81972 require a specific order of evaluations or copying.
81973
81974 115.b/2
81975 This routine is used to preallocate the internal array to the
81976 specified capacity such that future Inserts do not require
81977 memory allocation overhead. Therefore, the implementation
81978 should allocate the needed memory to make that true at this
81979 point, even though the visible semantics could be preserved by
81980 waiting until the memory is needed. This doesn't apply to the
81981 indefinite element container, because elements will have to be
81982 allocated individually.
81983
81984 115.c/2
81985 The implementation does not have to contract the internal
81986 array if the capacity is reduced, as any capacity greater than
81987 or equal to the specified capacity is allowed.
81988
81989 116/2
81990 function Length (Container : Vector) return Count_Type;
81991
81992 117/2
81993 {AI95-00302-03AI95-00302-03} Returns the number of elements in
81994 Container.
81995
81996 118/2
81997 procedure Set_Length (Container : in out Vector;
81998 Length : in Count_Type);
81999
82000 119/3
82001 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82002 Length is larger than the capacity of Container, Set_Length
82003 calls Reserve_Capacity (Container, Length), then sets the
82004 length of the Container to Length. If Length is greater than
82005 the original length of Container, empty elements are added to
82006 Container; otherwise, elements are removed from Container.
82007
82008 119.a/2
82009 Ramification: No elements are moved by this operation; any new
82010 empty elements are added at the end. This follows from the
82011 rules that a cursor continues to designate the same element
82012 unless the routine is defined to make the cursor ambiguous or
82013 invalid; this operation does not do that.
82014
82015 120/2
82016 function Is_Empty (Container : Vector) return Boolean;
82017
82018 121/2
82019 {AI95-00302-03AI95-00302-03} Equivalent to Length (Container)
82020 = 0.
82021
82022 122/2
82023 procedure Clear (Container : in out Vector);
82024
82025 123/2
82026 {AI95-00302-03AI95-00302-03} Removes all the elements from
82027 Container. The capacity of Container does not change.
82028
82029 124/2
82030 function To_Cursor (Container : Vector;
82031 Index : Extended_Index) return Cursor;
82032
82033 125/2
82034 {AI95-00302-03AI95-00302-03} If Index is not in the range
82035 First_Index (Container) .. Last_Index (Container), then
82036 No_Element is returned. Otherwise, a cursor designating the
82037 element at position Index in Container is returned.
82038
82039 126/2
82040 function To_Index (Position : Cursor) return Extended_Index;
82041
82042 127/2
82043 {AI95-00302-03AI95-00302-03} If Position is No_Element,
82044 No_Index is returned. Otherwise, the index (within its
82045 containing vector) of the element designated by Position is
82046 returned.
82047
82048 127.a/2
82049 Ramification: This implies that the index is determinable from
82050 a bare cursor alone. The basic model is that a vector cursor
82051 is implemented as a record containing an access to the vector
82052 container and an index value. This does constrain
82053 implementations, but it also allows all of the cursor
82054 operations to be defined in terms of the corresponding index
82055 operation (which should be primary for a vector).
82056
82057 128/2
82058 function Element (Container : Vector;
82059 Index : Index_Type)
82060 return Element_Type;
82061
82062 129/2
82063 {AI95-00302-03AI95-00302-03} If Index is not in the range
82064 First_Index (Container) .. Last_Index (Container), then
82065 Constraint_Error is propagated. Otherwise, Element returns
82066 the element at position Index.
82067
82068 130/2
82069 function Element (Position : Cursor) return Element_Type;
82070
82071 131/2
82072 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
82073 then Constraint_Error is propagated. Otherwise, Element
82074 returns the element designated by Position.
82075
82076 132/2
82077 procedure Replace_Element (Container : in out Vector;
82078 Index : in Index_Type;
82079 New_Item : in Element_Type);
82080
82081 133/3
82082 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If Index
82083 is not in the range First_Index (Container) .. Last_Index
82084 (Container), then Constraint_Error is propagated. Otherwise,
82085 Replace_Element assigns the value New_Item to the element at
82086 position Index. Any exception raised during the assignment is
82087 propagated. The element at position Index is not an empty
82088 element after successful call to Replace_Element.
82089
82090 134/2
82091 procedure Replace_Element (Container : in out Vector;
82092 Position : in Cursor;
82093 New_Item : in Element_Type);
82094
82095 135/3
82096 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82097 Position equals No_Element, then Constraint_Error is
82098 propagated; if Position does not designate an element in
82099 Container, then Program_Error is propagated. Otherwise,
82100 Replace_Element assigns New_Item to the element designated by
82101 Position. Any exception raised during the assignment is
82102 propagated. The element at Position is not an empty element
82103 after successful call to Replace_Element.
82104
82105 135.a/3
82106 Ramification: {AI05-0212-1AI05-0212-1} Replace_Element,
82107 Update_Element, and Reference are the only ways that an
82108 element can change from empty to nonempty. Also see the note
82109 following Update_Element.
82110
82111 136/2
82112 procedure Query_Element
82113 (Container : in Vector;
82114 Index : in Index_Type;
82115 Process : not null access procedure (Element : in Element_Type));
82116
82117 137/3
82118 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} If Index
82119 is not in the range First_Index (Container) .. Last_Index
82120 (Container), then Constraint_Error is propagated. Otherwise,
82121 Query_Element calls Process.all with the element at position
82122 Index as the argument. Tampering with the elements of
82123 Container is prohibited during the execution of the call on
82124 Process.all. Any exception raised by Process.all is
82125 propagated.
82126
82127 137.a/2
82128 Reason: {AI05-0005-1AI05-0005-1} The "tamper with the
82129 elements" check is intended to prevent the Element parameter
82130 of Process from being replaced or deleted outside of Process.
82131 The check prevents data loss (if Element_Type is passed by
82132 copy) or erroneous execution (if Element_Type is an
82133 unconstrained type in an indefinite container).
82134
82135 138/2
82136 procedure Query_Element
82137 (Position : in Cursor;
82138 Process : not null access procedure (Element : in Element_Type));
82139
82140 139/3
82141 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1}
82142 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
82143 Constraint_Error is propagated. Otherwise, Query_Element
82144 calls Process.all with the element designated by Position as
82145 the argument. Tampering with the elements of the vector that
82146 contains the element designated by Position is prohibited
82147 during the execution of the call on Process.all. Any
82148 exception raised by Process.all is propagated.
82149
82150 140/2
82151 procedure Update_Element
82152 (Container : in out Vector;
82153 Index : in Index_Type;
82154 Process : not null access procedure (Element : in out Element_Type));
82155
82156 141/3
82157 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} If Index
82158 is not in the range First_Index (Container) .. Last_Index
82159 (Container), then Constraint_Error is propagated. Otherwise,
82160 Update_Element calls Process.all with the element at position
82161 Index as the argument. Tampering with the elements of
82162 Container is prohibited during the execution of the call on
82163 Process.all. Any exception raised by Process.all is
82164 propagated.
82165
82166 142/2
82167 If Element_Type is unconstrained and definite, then the actual
82168 Element parameter of Process.all shall be unconstrained.
82169
82170 142.a/2
82171 Ramification: This means that the elements cannot be directly
82172 allocated from the heap; it must be possible to change the
82173 discriminants of the element in place.
82174
82175 143/2
82176 The element at position Index is not an empty element after
82177 successful completion of this operation.
82178
82179 143.a/2
82180 Ramification: Since reading an empty element is a bounded
82181 error, attempting to use this procedure to replace empty
82182 elements may fail. Use Replace_Element to do that reliably.
82183
82184 144/2
82185 procedure Update_Element
82186 (Container : in out Vector;
82187 Position : in Cursor;
82188 Process : not null access procedure (Element : in out Element_Type));
82189
82190 145/3
82191 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1}
82192 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
82193 Constraint_Error is propagated; if Position does not designate
82194 an element in Container, then Program_Error is propagated.
82195 Otherwise, Update_Element calls Process.all with the element
82196 designated by Position as the argument. Tampering with the
82197 elements of Container is prohibited during the execution of
82198 the call on Process.all. Any exception raised by Process.all
82199 is propagated.
82200
82201 146/2
82202 If Element_Type is unconstrained and definite, then the actual
82203 Element parameter of Process.all shall be unconstrained.
82204
82205 147/2
82206 The element designated by Position is not an empty element
82207 after successful completion of this operation.
82208
82209 147.1/3
82210 type Constant_Reference_Type
82211 (Element : not null access constant Element_Type) is private
82212 with Implicit_Dereference => Element;
82213
82214 147.2/3
82215 type Reference_Type (Element : not null access Element_Type) is private
82216 with Implicit_Dereference => Element;
82217
82218 147.3/3
82219 {AI05-0212-1AI05-0212-1} The types Constant_Reference_Type and
82220 Reference_Type need finalization.
82221
82222 147.4/3
82223 The default initialization of an object of type
82224 Constant_Reference_Type or Reference_Type propagates
82225 Program_Error.
82226
82227 147.a/3
82228 Reason: It is expected that Reference_Type (and
82229 Constant_Reference_Type) will be a controlled type, for which
82230 finalization will have some action to terminate the tampering
82231 check for the associated container. If the object is created
82232 by default, however, there is no associated container. Since
82233 this is useless, and supporting this case would take extra
82234 work, we define it to raise an exception.
82235
82236 147.5/3
82237 function Constant_Reference (Container : aliased in Vector;
82238 Index : in Index_Type)
82239 return Constant_Reference_Type;
82240
82241 147.6/3
82242 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
82243 function (combined with the Constant_Indexing and
82244 Implicit_Dereference aspects) provides a convenient way to
82245 gain read access to an individual element of a vector given an
82246 index value.
82247
82248 147.7/3
82249 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Index is
82250 not in the range First_Index (Container) .. Last_Index
82251 (Container), then Constraint_Error is propagated. Otherwise,
82252 Constant_Reference returns an object whose discriminant is an
82253 access value that designates the element at position Index.
82254 Tampering with the elements of Container is prohibited while
82255 the object returned by Constant_Reference exists and has not
82256 been finalized.
82257
82258 147.8/3
82259 function Reference (Container : aliased in out Vector;
82260 Index : in Index_Type)
82261 return Reference_Type;
82262
82263 147.9/3
82264 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
82265 function (combined with the Variable_Indexing and
82266 Implicit_Dereference aspects) provides a convenient way to
82267 gain read and write access to an individual element of a
82268 vector given an index value.
82269
82270 147.10/3
82271 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Index is
82272 not in the range First_Index (Container) .. Last_Index
82273 (Container), then Constraint_Error is propagated. Otherwise,
82274 Reference returns an object whose discriminant is an access
82275 value that designates the element at position Index.
82276 Tampering with the elements of Container is prohibited while
82277 the object returned by Reference exists and has not been
82278 finalized.
82279
82280 147.11/3
82281 The element at position Index is not an empty element after
82282 successful completion of this operation.
82283
82284 147.12/3
82285 function Constant_Reference (Container : aliased in Vector;
82286 Position : in Cursor)
82287 return Constant_Reference_Type;
82288
82289 147.13/3
82290 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
82291 function (combined with the Constant_Indexing and
82292 Implicit_Dereference aspects) provides a convenient way to
82293 gain read access to an individual element of a vector given a
82294 cursor.
82295
82296 147.14/3
82297 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
82298 equals No_Element, then Constraint_Error is propagated; if
82299 Position does not designate an element in Container, then
82300 Program_Error is propagated. Otherwise, Constant_Reference
82301 returns an object whose discriminant is an access value that
82302 designates the element designated by Position. Tampering with
82303 the elements of Container is prohibited while the object
82304 returned by Constant_Reference exists and has not been
82305 finalized.
82306
82307 147.15/3
82308 function Reference (Container : aliased in out Vector;
82309 Position : in Cursor)
82310 return Reference_Type;
82311
82312 147.16/3
82313 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
82314 function (combined with the Variable_Indexing and
82315 Implicit_Dereference aspects) provides a convenient way to
82316 gain read and write access to an individual element of a
82317 vector given a cursor.
82318
82319 147.17/3
82320 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
82321 equals No_Element, then Constraint_Error is propagated; if
82322 Position does not designate an element in Container, then
82323 Program_Error is propagated. Otherwise, Reference returns an
82324 object whose discriminant is an access value that designates
82325 the element designated by Position. Tampering with the
82326 elements of Container is prohibited while the object returned
82327 by Reference exists and has not been finalized.
82328
82329 147.18/3
82330 The element designated by Position is not an empty element
82331 after successful completion of this operation.
82332
82333 147.19/3
82334 procedure Assign (Target : in out Vector; Source : in Vector);
82335
82336 147.20/3
82337 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1}
82338 {AI05-0262-1AI05-0262-1} If Target denotes the same object as
82339 Source, the operation has no effect. If the length of Source
82340 is greater than the capacity of Target, Reserve_Capacity
82341 (Target, Length (Source)) is called. The elements of Source
82342 are then copied to Target as for an assignment_statement
82343 assigning Source to Target (this includes setting the length
82344 of Target to be that of Source).
82345
82346 147.b/3
82347 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
82348 compatibility with the bounded vector container. For an
82349 unbounded vector, Assign(A, B) and A := B behave identically.
82350 For a bounded vector, := will raise an exception if the
82351 container capacities are different, while Assign will not
82352 raise an exception if there is enough room in the target.
82353
82354 147.21/3
82355 function Copy (Source : Vector; Capacity : Count_Type := 0)
82356 return Vector;
82357
82358 147.22/3
82359 {AI05-0001-1AI05-0001-1} Returns a vector whose elements are
82360 initialized from the corresponding elements of Source. If
82361 Capacity is 0, then the vector capacity is the length of
82362 Source; if Capacity is equal to or greater than the length of
82363 Source, the vector capacity is at least the specified value.
82364 Otherwise, the operation propagates Capacity_Error.
82365
82366 148/2
82367 procedure Move (Target : in out Vector;
82368 Source : in out Vector);
82369
82370 149/3
82371 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1}
82372 {AI05-0248-1AI05-0248-1} If Target denotes the same object as
82373 Source, then the operation has no effect. Otherwise, Move
82374 first calls Reserve_Capacity (Target, Length (Source)) and
82375 then Clear (Target); then, each element from Source is removed
82376 from Source and inserted into Target in the original order.
82377 The length of Source is 0 after a successful call to Move.
82378
82379 149.a/2
82380 Discussion: The idea is that the internal array is removed
82381 from Source and moved to Target. (See the Implementation
82382 Advice for Move). If Capacity (Target) /= 0, the previous
82383 internal array may need to be deallocated. We don't mention
82384 this explicitly, because it is covered by the "no memory loss"
82385 Implementation Requirement.
82386
82387 150/2
82388 procedure Insert (Container : in out Vector;
82389 Before : in Extended_Index;
82390 New_Item : in Vector);
82391
82392 151/3
82393 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82394 Before is not in the range First_Index (Container) ..
82395 Last_Index (Container) + 1, then Constraint_Error is
82396 propagated. If Length(New_Item) is 0, then Insert does
82397 nothing. Otherwise, it computes the new length NL as the sum
82398 of the current length and Length (New_Item); if the value of
82399 Last appropriate for length NL would be greater than
82400 Index_Type'Last, then Constraint_Error is propagated.
82401
82402 152/2
82403 If the current vector capacity is less than NL,
82404 Reserve_Capacity (Container, NL) is called to increase the
82405 vector capacity. Then Insert slides the elements in the range
82406 Before .. Last_Index (Container) up by Length(New_Item)
82407 positions, and then copies the elements of New_Item to the
82408 positions starting at Before. Any exception raised during the
82409 copying is propagated.
82410
82411 152.a/2
82412 Ramification: Moving the elements does not necessarily involve
82413 copying. Similarly, since Reserve_Capacity does not require
82414 the copying of elements, it does not need to be explicitly
82415 called (the implementation can combine the operations if it
82416 wishes to).
82417
82418 153/2
82419 procedure Insert (Container : in out Vector;
82420 Before : in Cursor;
82421 New_Item : in Vector);
82422
82423 154/3
82424 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82425 Before is not No_Element, and does not designate an element in
82426 Container, then Program_Error is propagated. Otherwise, if
82427 Length(New_Item) is 0, then Insert does nothing. If Before is
82428 No_Element, then the call is equivalent to Insert (Container,
82429 Last_Index (Container) + 1, New_Item); otherwise, the call is
82430 equivalent to Insert (Container, To_Index (Before), New_Item);
82431
82432 154.a/2
82433 Ramification: The check on Before checks that the cursor does
82434 not belong to some other Container. This check implies that a
82435 reference to the container is included in the cursor value.
82436 This wording is not meant to require detection of dangling
82437 cursors; such cursors are defined to be invalid, which means
82438 that execution is erroneous, and any result is allowed
82439 (including not raising an exception).
82440
82441 155/2
82442 procedure Insert (Container : in out Vector;
82443 Before : in Cursor;
82444 New_Item : in Vector;
82445 Position : out Cursor);
82446
82447 156/2
82448 {AI95-00302-03AI95-00302-03} If Before is not No_Element, and
82449 does not designate an element in Container, then Program_Error
82450 is propagated. If Before equals No_Element, then let T be
82451 Last_Index (Container) + 1; otherwise, let T be To_Index
82452 (Before). Insert (Container, T, New_Item) is called, and then
82453 Position is set to To_Cursor (Container, T).
82454
82455 156.a/2
82456 Discussion: The messy wording is needed because Before is
82457 invalidated by Insert, and we don't want Position to be
82458 invalid after this call. An implementation probably only
82459 needs to copy Before to Position.
82460
82461 157/2
82462 procedure Insert (Container : in out Vector;
82463 Before : in Extended_Index;
82464 New_Item : in Element_Type;
82465 Count : in Count_Type := 1);
82466
82467 158/2
82468 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82469 Before, To_Vector (New_Item, Count));
82470
82471 159/2
82472 procedure Insert (Container : in out Vector;
82473 Before : in Cursor;
82474 New_Item : in Element_Type;
82475 Count : in Count_Type := 1);
82476
82477 160/2
82478 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82479 Before, To_Vector (New_Item, Count));
82480
82481 161/2
82482 procedure Insert (Container : in out Vector;
82483 Before : in Cursor;
82484 New_Item : in Element_Type;
82485 Position : out Cursor;
82486 Count : in Count_Type := 1);
82487
82488 162/2
82489 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82490 Before, To_Vector (New_Item, Count), Position);
82491
82492 162.a/3
82493 Ramification: {AI05-0257-1AI05-0257-1} If Count equals 0,
82494 Position will designate the element designated by Before,
82495 rather than a newly inserted element. Otherwise, Position
82496 will designate the first newly inserted element.
82497
82498 163/2
82499 procedure Insert (Container : in out Vector;
82500 Before : in Extended_Index;
82501 Count : in Count_Type := 1);
82502
82503 164/3
82504 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82505 Before is not in the range First_Index (Container) ..
82506 Last_Index (Container) + 1, then Constraint_Error is
82507 propagated. If Count is 0, then Insert does nothing.
82508 Otherwise, it computes the new length NL as the sum of the
82509 current length and Count; if the value of Last appropriate for
82510 length NL would be greater than Index_Type'Last, then
82511 Constraint_Error is propagated.
82512
82513 165/2
82514 If the current vector capacity is less than NL,
82515 Reserve_Capacity (Container, NL) is called to increase the
82516 vector capacity. Then Insert slides the elements in the range
82517 Before .. Last_Index (Container) up by Count positions, and
82518 then inserts elements that are initialized by default (see
82519 *note 3.3.1::) in the positions starting at Before.
82520
82521 166/2
82522 procedure Insert (Container : in out Vector;
82523 Before : in Cursor;
82524 Position : out Cursor;
82525 Count : in Count_Type := 1);
82526
82527 167/2
82528 {AI95-00302-03AI95-00302-03} If Before is not No_Element, and
82529 does not designate an element in Container, then Program_Error
82530 is propagated. If Before equals No_Element, then let T be
82531 Last_Index (Container) + 1; otherwise, let T be To_Index
82532 (Before). Insert (Container, T, Count) is called, and then
82533 Position is set to To_Cursor (Container, T).
82534
82535 167.a/2
82536 Reason: This routine exists mainly to ease conversion between
82537 Vector and List containers. Unlike Insert_Space, this routine
82538 default initializes the elements it inserts, which can be more
82539 expensive for some element types.
82540
82541 168/2
82542 procedure Prepend (Container : in out Vector;
82543 New_Item : in Vector;
82544 Count : in Count_Type := 1);
82545
82546 169/2
82547 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82548 First_Index (Container), New_Item).
82549
82550 170/2
82551 procedure Prepend (Container : in out Vector;
82552 New_Item : in Element_Type;
82553 Count : in Count_Type := 1);
82554
82555 171/2
82556 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82557 First_Index (Container), New_Item, Count).
82558
82559 172/2
82560 procedure Append (Container : in out Vector;
82561 New_Item : in Vector);
82562
82563 173/2
82564 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82565 Last_Index (Container) + 1, New_Item).
82566
82567 174/2
82568 procedure Append (Container : in out Vector;
82569 New_Item : in Element_Type;
82570 Count : in Count_Type := 1);
82571
82572 175/2
82573 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
82574 Last_Index (Container) + 1, New_Item, Count).
82575
82576 176/2
82577 procedure Insert_Space (Container : in out Vector;
82578 Before : in Extended_Index;
82579 Count : in Count_Type := 1);
82580
82581 177/3
82582 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82583 Before is not in the range First_Index (Container) ..
82584 Last_Index (Container) + 1, then Constraint_Error is
82585 propagated. If Count is 0, then Insert_Space does nothing.
82586 Otherwise, it computes the new length NL as the sum of the
82587 current length and Count; if the value of Last appropriate for
82588 length NL would be greater than Index_Type'Last, then
82589 Constraint_Error is propagated.
82590
82591 178/2
82592 If the current vector capacity is less than NL,
82593 Reserve_Capacity (Container, NL) is called to increase the
82594 vector capacity. Then Insert_Space slides the elements in the
82595 range Before .. Last_Index (Container) up by Count positions,
82596 and then inserts empty elements in the positions starting at
82597 Before.
82598
82599 179/2
82600 procedure Insert_Space (Container : in out Vector;
82601 Before : in Cursor;
82602 Position : out Cursor;
82603 Count : in Count_Type := 1);
82604
82605 180/2
82606 {AI95-00302-03AI95-00302-03} If Before is not No_Element, and
82607 does not designate an element in Container, then Program_Error
82608 is propagated. If Before equals No_Element, then let T be
82609 Last_Index (Container) + 1; otherwise, let T be To_Index
82610 (Before). Insert_Space (Container, T, Count) is called, and
82611 then Position is set to To_Cursor (Container, T).
82612
82613 181/2
82614 procedure Delete (Container : in out Vector;
82615 Index : in Extended_Index;
82616 Count : in Count_Type := 1);
82617
82618 182/3
82619 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If Index
82620 is not in the range First_Index (Container) .. Last_Index
82621 (Container) + 1, then Constraint_Error is propagated. If
82622 Count is 0, Delete has no effect. Otherwise, Delete slides
82623 the elements (if any) starting at position Index + Count down
82624 to Index. Any exception raised during element assignment is
82625 propagated.
82626
82627 182.a/2
82628 Ramification: If Index + Count >= Last_Index(Container), this
82629 effectively truncates the vector (setting Last_Index to Index
82630 - 1 and consequently sets Length to Index - Index_Type'First).
82631
82632 183/2
82633 procedure Delete (Container : in out Vector;
82634 Position : in out Cursor;
82635 Count : in Count_Type := 1);
82636
82637 184/2
82638 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
82639 then Constraint_Error is propagated. If Position does not
82640 designate an element in Container, then Program_Error is
82641 propagated. Otherwise, Delete (Container, To_Index
82642 (Position), Count) is called, and then Position is set to
82643 No_Element.
82644
82645 185/2
82646 procedure Delete_First (Container : in out Vector;
82647 Count : in Count_Type := 1);
82648
82649 186/2
82650 {AI95-00302-03AI95-00302-03} Equivalent to Delete (Container,
82651 First_Index (Container), Count).
82652
82653 187/2
82654 procedure Delete_Last (Container : in out Vector;
82655 Count : in Count_Type := 1);
82656
82657 188/3
82658 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82659 Length (Container) <= Count, then Delete_Last is equivalent to
82660 Clear (Container). Otherwise, it is equivalent to Delete
82661 (Container, Index_Type'Val(Index_Type'Pos(Last_Index
82662 (Container)) - Count + 1), Count).
82663
82664 189/2
82665 {AI05-0092-1AI05-0092-1} procedure Reverse_Elements (Container : in out Vector);
82666
82667 190/2
82668 {AI95-00302-03AI95-00302-03} Reorders the elements of
82669 Container in reverse order.
82670
82671 190.a/2
82672 Discussion: This can copy the elements of the vector -- all
82673 cursors referencing the vector are ambiguous afterwards and
82674 may designate different elements afterwards.
82675
82676 191/2
82677 procedure Swap (Container : in out Vector;
82678 I, J : in Index_Type);
82679
82680 192/2
82681 {AI95-00302-03AI95-00302-03} If either I or J is not in the
82682 range First_Index (Container) .. Last_Index (Container), then
82683 Constraint_Error is propagated. Otherwise, Swap exchanges the
82684 values of the elements at positions I and J.
82685
82686 192.a/2
82687 To be honest: The implementation is not required to actually
82688 copy the elements if it can do the swap some other way. But
82689 it is allowed to copy the elements if needed.
82690
82691 193/2
82692 procedure Swap (Container : in out Vector;
82693 I, J : in Cursor);
82694
82695 194/2
82696 {AI95-00302-03AI95-00302-03} If either I or J is No_Element,
82697 then Constraint_Error is propagated. If either I or J do not
82698 designate an element in Container, then Program_Error is
82699 propagated. Otherwise, Swap exchanges the values of the
82700 elements designated by I and J.
82701
82702 194.a/2
82703 Ramification: After a call to Swap, I designates the element
82704 value previously designated by J, and J designates the element
82705 value previously designated by I. The cursors do not become
82706 ambiguous from this operation.
82707
82708 194.b/2
82709 To be honest: The implementation is not required to actually
82710 copy the elements if it can do the swap some other way. But
82711 it is allowed to copy the elements if needed.
82712
82713 195/2
82714 function First_Index (Container : Vector) return Index_Type;
82715
82716 196/2
82717 {AI95-00302-03AI95-00302-03} Returns the value
82718 Index_Type'First.
82719
82720 196.a/2
82721 Discussion: We'd rather call this "First", but then calling
82722 most routines in here with First (Some_Vect) would be
82723 ambiguous.
82724
82725 197/2
82726 function First (Container : Vector) return Cursor;
82727
82728 198/2
82729 {AI95-00302-03AI95-00302-03} If Container is empty, First
82730 returns No_Element. Otherwise, it returns a cursor that
82731 designates the first element in Container.
82732
82733 199/2
82734 function First_Element (Container : Vector) return Element_Type;
82735
82736 200/2
82737 {AI95-00302-03AI95-00302-03} Equivalent to Element (Container,
82738 First_Index (Container)).
82739
82740 201/2
82741 function Last_Index (Container : Vector) return Extended_Index;
82742
82743 202/2
82744 {AI95-00302-03AI95-00302-03} If Container is empty, Last_Index
82745 returns No_Index. Otherwise, it returns the position of the
82746 last element in Container.
82747
82748 203/2
82749 function Last (Container : Vector) return Cursor;
82750
82751 204/2
82752 {AI95-00302-03AI95-00302-03} If Container is empty, Last
82753 returns No_Element. Otherwise, it returns a cursor that
82754 designates the last element in Container.
82755
82756 205/2
82757 function Last_Element (Container : Vector) return Element_Type;
82758
82759 206/2
82760 {AI95-00302-03AI95-00302-03} Equivalent to Element (Container,
82761 Last_Index (Container)).
82762
82763 207/2
82764 function Next (Position : Cursor) return Cursor;
82765
82766 208/2
82767 {AI95-00302-03AI95-00302-03} If Position equals No_Element or
82768 designates the last element of the container, then Next
82769 returns the value No_Element. Otherwise, it returns a cursor
82770 that designates the element with index To_Index (Position) + 1
82771 in the same vector as Position.
82772
82773 209/2
82774 procedure Next (Position : in out Cursor);
82775
82776 210/2
82777 {AI95-00302-03AI95-00302-03} Equivalent to Position := Next
82778 (Position).
82779
82780 211/2
82781 function Previous (Position : Cursor) return Cursor;
82782
82783 212/2
82784 {AI95-00302-03AI95-00302-03} If Position equals No_Element or
82785 designates the first element of the container, then Previous
82786 returns the value No_Element. Otherwise, it returns a cursor
82787 that designates the element with index To_Index (Position) - 1
82788 in the same vector as Position.
82789
82790 213/2
82791 procedure Previous (Position : in out Cursor);
82792
82793 214/2
82794 {AI95-00302-03AI95-00302-03} Equivalent to Position :=
82795 Previous (Position).
82796
82797 215/2
82798 function Find_Index (Container : Vector;
82799 Item : Element_Type;
82800 Index : Index_Type := Index_Type'First)
82801 return Extended_Index;
82802
82803 216/2
82804 {AI95-00302-03AI95-00302-03} Searches the elements of
82805 Container for an element equal to Item (using the generic
82806 formal equality operator). The search starts at position
82807 Index and proceeds towards Last_Index (Container). If no
82808 equal element is found, then Find_Index returns No_Index.
82809 Otherwise, it returns the index of the first equal element
82810 encountered.
82811
82812 217/2
82813 function Find (Container : Vector;
82814 Item : Element_Type;
82815 Position : Cursor := No_Element)
82816 return Cursor;
82817
82818 218/3
82819 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82820 Position is not No_Element, and does not designate an element
82821 in Container, then Program_Error is propagated. Otherwise,
82822 Find searches the elements of Container for an element equal
82823 to Item (using the generic formal equality operator). The
82824 search starts at the first element if Position equals
82825 No_Element, and at the element designated by Position
82826 otherwise. It proceeds towards the last element of Container.
82827 If no equal element is found, then Find returns No_Element.
82828 Otherwise, it returns a cursor designating the first equal
82829 element encountered.
82830
82831 219/2
82832 function Reverse_Find_Index (Container : Vector;
82833 Item : Element_Type;
82834 Index : Index_Type := Index_Type'Last)
82835 return Extended_Index;
82836
82837 220/2
82838 {AI95-00302-03AI95-00302-03} Searches the elements of
82839 Container for an element equal to Item (using the generic
82840 formal equality operator). The search starts at position
82841 Index or, if Index is greater than Last_Index (Container), at
82842 position Last_Index (Container). It proceeds towards
82843 First_Index (Container). If no equal element is found, then
82844 Reverse_Find_Index returns No_Index. Otherwise, it returns
82845 the index of the first equal element encountered.
82846
82847 221/2
82848 function Reverse_Find (Container : Vector;
82849 Item : Element_Type;
82850 Position : Cursor := No_Element)
82851 return Cursor;
82852
82853 222/3
82854 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
82855 Position is not No_Element, and does not designate an element
82856 in Container, then Program_Error is propagated. Otherwise,
82857 Reverse_Find searches the elements of Container for an element
82858 equal to Item (using the generic formal equality operator).
82859 The search starts at the last element if Position equals
82860 No_Element, and at the element designated by Position
82861 otherwise. It proceeds towards the first element of
82862 Container. If no equal element is found, then Reverse_Find
82863 returns No_Element. Otherwise, it returns a cursor
82864 designating the first equal element encountered.
82865
82866 223/2
82867 function Contains (Container : Vector;
82868 Item : Element_Type) return Boolean;
82869
82870 224/2
82871 {AI95-00302-03AI95-00302-03} Equivalent to Has_Element (Find
82872 (Container, Item)).
82873
82874 Paragraphs 225 and 226 were moved above.
82875
82876 227/2
82877 procedure Iterate
82878 (Container : in Vector;
82879 Process : not null access procedure (Position : in Cursor));
82880
82881 228/3
82882 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} Invokes
82883 Process.all with a cursor that designates each element in
82884 Container, in index order. Tampering with the cursors of
82885 Container is prohibited during the execution of a call on
82886 Process.all. Any exception raised by Process.all is
82887 propagated.
82888
82889 228.a/2
82890 Discussion: The purpose of the "tamper with the cursors" check
82891 is to prevent erroneous execution from the Position parameter
82892 of Process.all becoming invalid. This check takes place when
82893 the operations that tamper with the cursors of the container
82894 are called. The check cannot be made later (say in the body
82895 of Iterate), because that could cause the Position cursor to
82896 be invalid and potentially cause execution to become erroneous
82897 -- defeating the purpose of the check.
82898
82899 228.b/2
82900 There is no check needed if an attempt is made to insert or
82901 delete nothing (that is, Count = 0 or Length(Item) = 0).
82902
82903 228.c/2
82904 The check is easy to implement: each container needs a
82905 counter. The counter is incremented when Iterate is called,
82906 and decremented when Iterate completes. If the counter is
82907 nonzero when an operation that inserts or deletes is called,
82908 Finalize is called, or one of the other operations in the list
82909 occurs, Program_Error is raised.
82910
82911 229/2
82912 procedure Reverse_Iterate
82913 (Container : in Vector;
82914 Process : not null access procedure (Position : in Cursor));
82915
82916 230/3
82917 {AI95-00302-03AI95-00302-03} {AI05-0212-1AI05-0212-1} Iterates
82918 over the elements in Container as per procedure Iterate,
82919 except that elements are traversed in reverse index order.
82920
82921 230.1/3
82922 function Iterate (Container : in Vector)
82923 return Vector_Iterator_Interfaces.Reversible_Iterator'Class;
82924
82925 230.2/3
82926 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
82927 {AI05-0269-1AI05-0269-1} Iterate returns a reversible iterator
82928 object (see *note 5.5.1::) that will generate a value for a
82929 loop parameter (see *note 5.5.2::) designating each node in
82930 Container, starting with the first node and moving the cursor
82931 as per the Next function when used as a forward iterator, and
82932 starting with the last node and moving the cursor as per the
82933 Previous function when used as a reverse iterator. Tampering
82934 with the cursors of Container is prohibited while the iterator
82935 object exists (in particular, in the sequence_of_statements of
82936 the loop_statement whose iterator_specification denotes this
82937 object). The iterator object needs finalization.
82938
82939 230.3/3
82940 function Iterate (Container : in Vector; Start : in Cursor)
82941 return Vector_Iterator_Interfaces.Reversible_Iterator'Class;
82942
82943 230.4/3
82944 {AI05-0212-1AI05-0212-1} {AI05-0262-1AI05-0262-1}
82945 {AI05-0265-1AI05-0265-1} {AI05-0269-1AI05-0269-1} If Start is
82946 not No_Element and does not designate an item in Container,
82947 then Program_Error is propagated. If Start is No_Element,
82948 then Constraint_Error is propagated. Otherwise, Iterate
82949 returns a reversible iterator object (see *note 5.5.1::) that
82950 will generate a value for a loop parameter (see *note 5.5.2::)
82951 designating each node in Container, starting with the node
82952 designated by Start and moving the cursor as per the Next
82953 function when used as a forward iterator, or moving the cursor
82954 as per the Previous function when used as a reverse iterator.
82955 Tampering with the cursors of Container is prohibited while
82956 the iterator object exists (in particular, in the
82957 sequence_of_statements of the loop_statement whose
82958 iterator_specification denotes this object). The iterator
82959 object needs finalization.
82960
82961 230.a/3
82962 Discussion: Exits are allowed from the loops created using the
82963 iterator objects. In particular, to stop the iteration at a
82964 particular cursor, just add
82965
82966 230.b/3
82967 exit when Cur = Stop;
82968
82969 230.c/3
82970 in the body of the loop (assuming that Cur is the loop
82971 parameter and Stop is the cursor that you want to stop at).
82972
82973 231/3
82974 {AI05-0044-1AI05-0044-1} {AI05-0262-1AI05-0262-1} The actual function
82975 for the generic formal function "<" of Generic_Sorting is expected to
82976 return the same value each time it is called with a particular pair of
82977 element values. It should define a strict weak ordering relationship
82978 (see *note A.18::); it should not modify Container. If the actual for
82979 "<" behaves in some other manner, the behavior of the subprograms of
82980 Generic_Sorting are unspecified. The number of times the subprograms of
82981 Generic_Sorting call "<" is unspecified.
82982
82983 232/2
82984 function Is_Sorted (Container : Vector) return Boolean;
82985
82986 233/2
82987 {AI95-00302-03AI95-00302-03} Returns True if the elements are
82988 sorted smallest first as determined by the generic formal "<"
82989 operator; otherwise, Is_Sorted returns False. Any exception
82990 raised during evaluation of "<" is propagated.
82991
82992 234/2
82993 procedure Sort (Container : in out Vector);
82994
82995 235/2
82996 {AI95-00302-03AI95-00302-03} Reorders the elements of
82997 Container such that the elements are sorted smallest first as
82998 determined by the generic formal "<" operator provided. Any
82999 exception raised during evaluation of "<" is propagated.
83000
83001 235.a/2
83002 Ramification: This implies swapping the elements, usually
83003 including an intermediate copy. This means that the elements
83004 will usually be copied. (As with Swap, if the implementation
83005 can do this some other way, it is allowed to.) Since the
83006 elements are nonlimited, this usually will not be a problem.
83007 Note that there is Implementation Advice below that the
83008 implementation should use a sort that minimizes copying of
83009 elements.
83010
83011 235.b/2
83012 The sort is not required to be stable (and the fast algorithm
83013 required will not be stable). If a stable sort is needed, the
83014 user can include the original location of the element as an
83015 extra "sort key". We considered requiring the implementation
83016 to do that, but it is mostly extra overhead -- usually there
83017 is something already in the element that provides the needed
83018 stability.
83019
83020 236/2
83021 procedure Merge (Target : in out Vector;
83022 Source : in out Vector);
83023
83024 237/3
83025 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1} If
83026 Source is empty, then Merge does nothing. If Source and
83027 Target are the same nonempty container object, then
83028 Program_Error is propagated. Otherwise, Merge removes
83029 elements from Source and inserts them into Target; afterwards,
83030 Target contains the union of the elements that were initially
83031 in Source and Target; Source is left empty. If Target and
83032 Source are initially sorted smallest first, then Target is
83033 ordered smallest first as determined by the generic formal "<"
83034 operator; otherwise, the order of elements in Target is
83035 unspecified. Any exception raised during evaluation of "<" is
83036 propagated.
83037
83038 237.a/2
83039 Discussion: It is a bounded error if either of the vectors is
83040 unsorted, see below. The bounded error can be recovered by
83041 sorting Target after the merge call, or the vectors can be
83042 pretested with Is_Sorted.
83043
83044 237.b/2
83045 Implementation Note: The Merge operation will usually require
83046 copying almost all of the elements. One implementation
83047 strategy would be to extend Target to the appropriate length,
83048 then copying elements from the back of the vectors working
83049 towards the front. An alternative approach would be to
83050 allocate a new internal data array of the appropriate length,
83051 copy the elements into it in an appropriate order, and then
83052 replacing the data array in Target with the temporary.
83053
83054 _Bounded (Run-Time) Errors_
83055
83056 238/3
83057 {AI95-00302-03AI95-00302-03} {AI05-0212-1AI05-0212-1} Reading the value
83058 of an empty element by calling Element, Query_Element, Update_Element,
83059 Constant_Reference, Reference, Swap, Is_Sorted, Sort, Merge, "=", Find,
83060 or Reverse_Find is a bounded error. The implementation may treat the
83061 element as having any normal value (see *note 13.9.1::) of the element
83062 type, or raise Constraint_Error or Program_Error before modifying the
83063 vector.
83064
83065 238.a/2
83066 Ramification: For instance, a default initialized element
83067 could be returned. Or some previous value of an element. But
83068 returning random junk is not allowed if the type has default
83069 initial value(s).
83070
83071 238.b/2
83072 Assignment and streaming of empty elements are not bounded
83073 errors. This is consistent with regular composite types, for
83074 which assignment and streaming of uninitialized components do
83075 not cause a bounded error, but reading the uninitialized
83076 component does cause a bounded error.
83077
83078 238.c/2
83079 There are other operations which are defined in terms of the
83080 operations listed above.
83081
83082 239/2
83083 {AI95-00302-03AI95-00302-03} Calling Merge in an instance of
83084 Generic_Sorting with either Source or Target not ordered smallest first
83085 using the provided generic formal "<" operator is a bounded error.
83086 Either Program_Error is raised after Target is updated as described for
83087 Merge, or the operation works as defined.
83088
83089 239.1/3
83090 {AI05-0022-1AI05-0022-1} {AI05-0248-1AI05-0248-1} It is a bounded error
83091 for the actual function associated with a generic formal subprogram,
83092 when called as part of an operation of this package, to tamper with
83093 elements of any Vector parameter of the operation. Either Program_Error
83094 is raised, or the operation works as defined on the value of the Vector
83095 either prior to, or subsequent to, some or all of the modifications to
83096 the Vector.
83097
83098 239.2/3
83099 {AI05-0027-1AI05-0027-1} It is a bounded error to call any subprogram
83100 declared in the visible part of Containers.Vectors when the associated
83101 container has been finalized. If the operation takes Container as an in
83102 out parameter, then it raises Constraint_Error or Program_Error.
83103 Otherwise, the operation either proceeds as it would for an empty
83104 container, or it raises Constraint_Error or Program_Error.
83105
83106 240/2
83107 {AI95-00302-03AI95-00302-03} A Cursor value is ambiguous if any of the
83108 following have occurred since it was created:
83109
83110 241/2
83111 * Insert, Insert_Space, or Delete has been called on the vector that
83112 contains the element the cursor designates with an index value (or
83113 a cursor designating an element at such an index value) less than
83114 or equal to the index value of the element designated by the
83115 cursor; or
83116
83117 242/2
83118 * The vector that contains the element it designates has been passed
83119 to the Sort or Merge procedures of an instance of Generic_Sorting,
83120 or to the Reverse_Elements procedure.
83121
83122 243/2
83123 {AI95-00302-03AI95-00302-03} It is a bounded error to call any
83124 subprogram other than "=" or Has_Element declared in Containers.Vectors
83125 with an ambiguous (but not invalid, see below) cursor parameter.
83126 Possible results are:
83127
83128 244/2
83129 * The cursor may be treated as if it were No_Element;
83130
83131 245/2
83132 * The cursor may designate some element in the vector (but not
83133 necessarily the element that it originally designated);
83134
83135 246/2
83136 * Constraint_Error may be raised; or
83137
83138 247/2
83139 * Program_Error may be raised.
83140
83141 247.a/2
83142 Reason: Cursors are made ambiguous if an Insert or Delete
83143 occurs that moves the elements in the internal array including
83144 the designated ones. After such an operation, the cursor
83145 probably still designates an element (although it might not
83146 after a deletion), but it is a different element. That
83147 violates the definition of cursor -- it designates a
83148 particular element.
83149
83150 247.b/2
83151 For "=" or Has_Element, the cursor works normally (it would
83152 not be No_Element). We don't want to trigger an exception
83153 simply for comparing a bad cursor.
83154
83155 247.c/2
83156 While it is possible to check for these cases or ensure that
83157 cursors survive such operations, in many cases the overhead
83158 necessary to make the check (or ensure cursors continue to
83159 designate the same element) is substantial in time or space.
83160
83161 _Erroneous Execution_
83162
83163 248/2
83164 {AI95-00302-03AI95-00302-03} A Cursor value is invalid if any of the
83165 following have occurred since it was created:
83166
83167 249/2
83168 * The vector that contains the element it designates has been
83169 finalized;
83170
83171 249.1/3
83172 * {AI05-0160-1AI05-0160-1} The vector that contains the element it
83173 designates has been used as the Target of a call to Assign, or as
83174 the target of an assignment_statement;
83175
83176 250/2
83177 * [The vector that contains the element it designates has been used
83178 as the Source or Target of a call to Move;] or
83179
83180 250.a/3
83181 Proof: {AI05-0001-1AI05-0001-1} Move has been reworded in
83182 terms of Assign and Clear, which are covered by other bullets,
83183 so this text is redundant.
83184
83185 251/3
83186 * {AI05-0160-1AI05-0160-1} {AI05-0262-1AI05-0262-1} The element it
83187 designates has been deleted or removed from the vector that
83188 previously contained the element.
83189
83190 251.a/3
83191 Ramification: {AI05-0160-1AI05-0160-1} An element can be
83192 removed via calls to Set_Length, Clear, and Merge; and
83193 indirectly via calls to Assign and Move.
83194
83195 252/2
83196 {AI95-00302-03AI95-00302-03} The result of "=" or Has_Element is
83197 unspecified if it is called with an invalid cursor parameter. Execution
83198 is erroneous if any other subprogram declared in Containers.Vectors is
83199 called with an invalid cursor parameter.
83200
83201 252.a/2
83202 Discussion: The list above (combined with the bounded error
83203 cases) is intended to be exhaustive. In other cases, a cursor
83204 value continues to designate its original element. For
83205 instance, cursor values survive the appending of new elements.
83206
83207 252.1/3
83208 {AI05-0212-1AI05-0212-1} Execution is erroneous if the vector associated
83209 with the result of a call to Reference or Constant_Reference is
83210 finalized before the result object returned by the call to Reference or
83211 Constant_Reference is finalized.
83212
83213 252.b/3
83214 Reason: Each object of Reference_Type and
83215 Constant_Reference_Type probably contains some reference to
83216 the originating container. If that container is prematurely
83217 finalized (which is only possible via Unchecked_Deallocation,
83218 as accessibility checks prevent passing a container to
83219 Reference that will not live as long as the result), the
83220 finalization of the object of Reference_Type will try to
83221 access a nonexistent object. This is a normal case of a
83222 dangling pointer created by Unchecked_Deallocation; we have to
83223 explicitly mention it here as the pointer in question is not
83224 visible in the specification of the type. (This is the same
83225 reason we have to say this for invalid cursors.)
83226
83227 _Implementation Requirements_
83228
83229 253/2
83230 {AI95-00302-03AI95-00302-03} No storage associated with a vector object
83231 shall be lost upon assignment or scope exit.
83232
83233 254/3
83234 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The execution of
83235 an assignment_statement for a vector shall have the effect of copying
83236 the elements from the source vector object to the target vector object
83237 and changing the length of the target object to that of the source
83238 object.
83239
83240 254.a/3
83241 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
83242 a Vector is a "deep" copy; that is the elements are copied as
83243 well as the data structures. We say "effect of" in order to
83244 allow the implementation to avoid copying elements immediately
83245 if it wishes. For instance, an implementation that avoided
83246 copying until one of the containers is modified would be
83247 allowed. (Note that such an implementation would be require
83248 care, as Query_Element and Constant_Reference both could be
83249 used to access an element which later needs to be reallocated
83250 while the parameter or reference still exists, potentially
83251 leaving the parameter or reference pointing at the wrong
83252 element.)
83253
83254 _Implementation Advice_
83255
83256 255/2
83257 {AI95-00302-03AI95-00302-03} Containers.Vectors should be implemented
83258 similarly to an array. In particular, if the length of a vector is N,
83259 then
83260
83261 256/2
83262 * the worst-case time complexity of Element should be O(log N);
83263
83264 256.a/2
83265 Implementation Advice: The worst-case time complexity of
83266 Element for Containers.Vector should be O(log N).
83267
83268 257/2
83269 * the worst-case time complexity of Append with Count=1 when N is
83270 less than the capacity of the vector should be O(log N); and
83271
83272 257.a/2
83273 Implementation Advice: The worst-case time complexity of
83274 Append with Count = 1 when N is less than the capacity for
83275 Containers.Vector should be O(log N).
83276
83277 258/2
83278 * the worst-case time complexity of Prepend with Count=1 and
83279 Delete_First with Count=1 should be O(N log N).
83280
83281 258.a/2
83282 Implementation Advice: The worst-case time complexity of
83283 Prepend with Count = 1 and Delete_First with Count=1 for
83284 Containers.Vectors should be O(N log N).
83285
83286 258.b/2
83287 Reason: We do not mean to overly constrain implementation
83288 strategies here. However, it is important for portability
83289 that the performance of large containers has roughly the same
83290 factors on different implementations. If a program is moved
83291 to an implementation that takes O(N) time to access elements,
83292 that program could be unusable when the vectors are large. We
83293 allow O(log N) access because the proportionality constant and
83294 caching effects are likely to be larger than the log factor,
83295 and we don't want to discourage innovative implementations.
83296
83297 259/2
83298 {AI95-00302-03AI95-00302-03} The worst-case time complexity of a call on
83299 procedure Sort of an instance of Containers.Vectors.Generic_Sorting
83300 should be O(N**2), and the average time complexity should be better than
83301 O(N**2).
83302
83303 259.a/2
83304 Implementation Advice: The worst-case time complexity of a
83305 call on procedure Sort of an instance of
83306 Containers.Vectors.Generic_Sorting should be O(N**2), and the
83307 average time complexity should be better than O(N**2).
83308
83309 259.b/2
83310 Ramification: In other words, we're requiring the use of a
83311 better than O(N**2) sorting algorithm, such as Quicksort. No
83312 bubble sorts allowed!
83313
83314 260/2
83315 {AI95-00302-03AI95-00302-03} Containers.Vectors.Generic_Sorting.Sort and
83316 Containers.Vectors.Generic_Sorting.Merge should minimize copying of
83317 elements.
83318
83319 260.a/2
83320 Implementation Advice: Containers.Vectors.Generic_Sorting.Sort
83321 and Containers.Vectors.Generic_Sorting.Merge should minimize
83322 copying of elements.
83323
83324 260.b/2
83325 To be honest: We do not mean "absolutely minimize" here; we're
83326 not intending to require a single copy for each element.
83327 Rather, we want to suggest that the sorting algorithm chosen
83328 is one that does not copy items unnecessarily. Bubble sort
83329 would not meet this advice, for instance.
83330
83331 261/2
83332 {AI95-00302-03AI95-00302-03} Move should not copy elements, and should
83333 minimize copying of internal data structures.
83334
83335 261.a/2
83336 Implementation Advice: Containers.Vectors.Move should not copy
83337 elements, and should minimize copying of internal data
83338 structures.
83339
83340 261.b/2
83341 Implementation Note: Usually that can be accomplished simply
83342 by moving the pointer(s) to the internal data structures from
83343 the Source vector to the Target vector.
83344
83345 262/2
83346 {AI95-00302-03AI95-00302-03} If an exception is propagated from a vector
83347 operation, no storage should be lost, nor any elements removed from a
83348 vector unless specified by the operation.
83349
83350 262.a/2
83351 Implementation Advice: If an exception is propagated from a
83352 vector operation, no storage should be lost, nor any elements
83353 removed from a vector unless specified by the operation.
83354
83355 262.b/2
83356 Reason: This is important so that programs can recover from
83357 errors. But we don't want to require heroic efforts, so we
83358 just require documentation of cases where this can't be
83359 accomplished.
83360
83361 NOTES
83362
83363 263/2
83364 48 All elements of a vector occupy locations in the internal
83365 array. If a sparse container is required, a Hashed_Map should be
83366 used rather than a vector.
83367
83368 264/2
83369 49 If Index_Type'Base'First = Index_Type'First an instance of
83370 Ada.Containers.Vectors will raise Constraint_Error. A value below
83371 Index_Type'First is required so that an empty vector has a
83372 meaningful value of Last_Index.
83373
83374 264.a/2
83375 Discussion: This property is the main reason why only integer
83376 types (as opposed to any discrete type) are allowed as the
83377 index type of a vector. An enumeration or modular type would
83378 require a subtype in order to meet this requirement.
83379
83380 _Extensions to Ada 95_
83381
83382 264.b/2
83383 {AI95-00302-03AI95-00302-03} The package Containers.Vectors is
83384 new.
83385
83386 _Incompatibilities With Ada 2005_
83387
83388 264.c/3
83389 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
83390 to Containers.Vectors. If an instance of Containers.Vectors
83391 is referenced in a use_clause, and an entity E with the same
83392 defining_identifier as a new entity in Containers.Vectors is
83393 defined in a package that is also referenced in a use_clause,
83394 the entity E may no longer be use-visible, resulting in
83395 errors. This should be rare and is easily fixed if it does
83396 occur.
83397
83398 _Extensions to Ada 2005_
83399
83400 264.d/3
83401 {AI05-0212-1AI05-0212-1} Added iterator, reference, and
83402 indexing support to make vector containers more convenient to
83403 use.
83404
83405 _Wording Changes from Ada 2005_
83406
83407 264.e/3
83408 {AI05-0001-1AI05-0001-1} Generalized the definition of
83409 Reserve_Capacity and Move. Specified which elements are
83410 read/written by stream attributes.
83411
83412 264.f/3
83413 {AI05-0022-1AI05-0022-1} Correction: Added a Bounded
83414 (Run-Time) Error to cover tampering by generic actual
83415 subprograms.
83416
83417 264.g/3
83418 {AI05-0027-1AI05-0027-1} Correction: Added a Bounded
83419 (Run-Time) Error to cover access to finalized vector
83420 containers.
83421
83422 264.h/3
83423 {AI05-0044-1AI05-0044-1} Correction: Redefined "<" actuals to
83424 require a strict weak ordering; the old definition allowed
83425 indeterminant comparisons that would not have worked in a
83426 container.
83427
83428 264.i/3
83429 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
83430 Remote_Types so that containers can be used in distributed
83431 programs.
83432
83433 264.j/3
83434 {AI05-0160-1AI05-0160-1} Correction: Revised the definition of
83435 invalid cursors to cover missing (and new) cases.
83436
83437 264.k/3
83438 {AI05-0265-1AI05-0265-1} Correction: Defined when a container
83439 prohibits tampering in order to more clearly define where the
83440 check is made and the exception raised.
83441
83442 \1f
83443 File: aarm2012.info, Node: A.18.3, Next: A.18.4, Prev: A.18.2, Up: A.18
83444
83445 A.18.3 The Generic Package Containers.Doubly_Linked_Lists
83446 ---------------------------------------------------------
83447
83448 1/2
83449 {AI95-00302-03AI95-00302-03} The language-defined generic package
83450 Containers.Doubly_Linked_Lists provides private types List and Cursor,
83451 and a set of operations for each type. A list container is optimized
83452 for insertion and deletion at any position.
83453
83454 2/2
83455 {AI95-00302-03AI95-00302-03} A doubly-linked list container object
83456 manages a linked list of internal nodes, each of which contains an
83457 element and pointers to the next (successor) and previous (predecessor)
83458 internal nodes. A cursor designates a particular node within a list
83459 (and by extension the element contained in that node). A cursor keeps
83460 designating the same node (and element) as long as the node is part of
83461 the container, even if the node is moved in the container.
83462
83463 3/2
83464 {AI95-00302-03AI95-00302-03} The length of a list is the number of
83465 elements it contains.
83466
83467 _Static Semantics_
83468
83469 4/2
83470 {AI95-00302-03AI95-00302-03} The generic library package
83471 Containers.Doubly_Linked_Lists has the following declaration:
83472
83473 5/3
83474 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
83475 generic
83476 type Element_Type is private;
83477 with function "=" (Left, Right : Element_Type)
83478 return Boolean is <>;
83479 package Ada.Containers.Doubly_Linked_Lists is
83480 pragma Preelaborate(Doubly_Linked_Lists);
83481 pragma Remote_Types(Doubly_Linked_Lists);
83482
83483 6/3
83484 {AI05-0212-1AI05-0212-1} type List is tagged private
83485 with Constant_Indexing => Constant_Reference,
83486 Variable_Indexing => Reference,
83487 Default_Iterator => Iterate,
83488 Iterator_Element => Element_Type;
83489 pragma Preelaborable_Initialization(List);
83490
83491 7/2
83492 type Cursor is private;
83493 pragma Preelaborable_Initialization(Cursor);
83494
83495 8/2
83496 Empty_List : constant List;
83497
83498 9/2
83499 No_Element : constant Cursor;
83500
83501 9.1/3
83502 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
83503
83504 9.2/3
83505 {AI05-0212-1AI05-0212-1} package List_Iterator_Interfaces is new
83506 Ada.Iterator_Interfaces (Cursor, Has_Element);
83507
83508 10/2
83509 function "=" (Left, Right : List) return Boolean;
83510
83511 11/2
83512 function Length (Container : List) return Count_Type;
83513
83514 12/2
83515 function Is_Empty (Container : List) return Boolean;
83516
83517 13/2
83518 procedure Clear (Container : in out List);
83519
83520 14/2
83521 function Element (Position : Cursor)
83522 return Element_Type;
83523
83524 15/2
83525 procedure Replace_Element (Container : in out List;
83526 Position : in Cursor;
83527 New_Item : in Element_Type);
83528
83529 16/2
83530 procedure Query_Element
83531 (Position : in Cursor;
83532 Process : not null access procedure (Element : in Element_Type));
83533
83534 17/2
83535 procedure Update_Element
83536 (Container : in out List;
83537 Position : in Cursor;
83538 Process : not null access procedure
83539 (Element : in out Element_Type));
83540
83541 17.1/3
83542 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
83543 (Element : not null access constant Element_Type) is private
83544 with Implicit_Dereference => Element;
83545
83546 17.2/3
83547 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
83548 with Implicit_Dereference => Element;
83549
83550 17.3/3
83551 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in List;
83552 Position : in Cursor)
83553 return Constant_Reference_Type;
83554
83555 17.4/3
83556 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out List;
83557 Position : in Cursor)
83558 return Reference_Type;
83559
83560 17.5/3
83561 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out List; Source : in List);
83562
83563 17.6/3
83564 {AI05-0001-1AI05-0001-1} function Copy (Source : List) return List;
83565
83566 18/2
83567 procedure Move (Target : in out List;
83568 Source : in out List);
83569
83570 19/2
83571 procedure Insert (Container : in out List;
83572 Before : in Cursor;
83573 New_Item : in Element_Type;
83574 Count : in Count_Type := 1);
83575
83576 20/2
83577 procedure Insert (Container : in out List;
83578 Before : in Cursor;
83579 New_Item : in Element_Type;
83580 Position : out Cursor;
83581 Count : in Count_Type := 1);
83582
83583 21/2
83584 procedure Insert (Container : in out List;
83585 Before : in Cursor;
83586 Position : out Cursor;
83587 Count : in Count_Type := 1);
83588
83589 22/2
83590 procedure Prepend (Container : in out List;
83591 New_Item : in Element_Type;
83592 Count : in Count_Type := 1);
83593
83594 23/2
83595 procedure Append (Container : in out List;
83596 New_Item : in Element_Type;
83597 Count : in Count_Type := 1);
83598
83599 24/2
83600 procedure Delete (Container : in out List;
83601 Position : in out Cursor;
83602 Count : in Count_Type := 1);
83603
83604 25/2
83605 procedure Delete_First (Container : in out List;
83606 Count : in Count_Type := 1);
83607
83608 26/2
83609 procedure Delete_Last (Container : in out List;
83610 Count : in Count_Type := 1);
83611
83612 27/2
83613 procedure Reverse_Elements (Container : in out List);
83614
83615 28/2
83616 procedure Swap (Container : in out List;
83617 I, J : in Cursor);
83618
83619 29/2
83620 procedure Swap_Links (Container : in out List;
83621 I, J : in Cursor);
83622
83623 30/2
83624 procedure Splice (Target : in out List;
83625 Before : in Cursor;
83626 Source : in out List);
83627
83628 31/2
83629 procedure Splice (Target : in out List;
83630 Before : in Cursor;
83631 Source : in out List;
83632 Position : in out Cursor);
83633
83634 32/2
83635 procedure Splice (Container: in out List;
83636 Before : in Cursor;
83637 Position : in Cursor);
83638
83639 33/2
83640 function First (Container : List) return Cursor;
83641
83642 34/2
83643 function First_Element (Container : List)
83644 return Element_Type;
83645
83646 35/2
83647 function Last (Container : List) return Cursor;
83648
83649 36/2
83650 function Last_Element (Container : List)
83651 return Element_Type;
83652
83653 37/2
83654 function Next (Position : Cursor) return Cursor;
83655
83656 38/2
83657 function Previous (Position : Cursor) return Cursor;
83658
83659 39/2
83660 procedure Next (Position : in out Cursor);
83661
83662 40/2
83663 procedure Previous (Position : in out Cursor);
83664
83665 41/2
83666 function Find (Container : List;
83667 Item : Element_Type;
83668 Position : Cursor := No_Element)
83669 return Cursor;
83670
83671 42/2
83672 function Reverse_Find (Container : List;
83673 Item : Element_Type;
83674 Position : Cursor := No_Element)
83675 return Cursor;
83676
83677 43/2
83678 function Contains (Container : List;
83679 Item : Element_Type) return Boolean;
83680
83681 44/3
83682 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
83683
83684 45/2
83685 procedure Iterate
83686 (Container : in List;
83687 Process : not null access procedure (Position : in Cursor));
83688
83689 46/2
83690 procedure Reverse_Iterate
83691 (Container : in List;
83692 Process : not null access procedure (Position : in Cursor));
83693
83694 46.1/3
83695 {AI05-0212-1AI05-0212-1} function Iterate (Container : in List)
83696 return List_Iterator_Interfaces.Reversible_Iterator'Class;
83697
83698 46.2/3
83699 {AI05-0212-1AI05-0212-1} function Iterate (Container : in List; Start : in Cursor)
83700 return List_Iterator_Interfaces.Reversible_Iterator'Class;
83701
83702 47/2
83703 generic
83704 with function "<" (Left, Right : Element_Type)
83705 return Boolean is <>;
83706 package Generic_Sorting is
83707
83708 48/2
83709 function Is_Sorted (Container : List) return Boolean;
83710
83711 49/2
83712 procedure Sort (Container : in out List);
83713
83714 50/2
83715 procedure Merge (Target : in out List;
83716 Source : in out List);
83717
83718 51/2
83719 end Generic_Sorting;
83720
83721 52/2
83722 private
83723
83724 53/2
83725 ... -- not specified by the language
83726
83727 54/2
83728 end Ada.Containers.Doubly_Linked_Lists;
83729
83730 55/2
83731 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
83732 function "=" on Element_Type values is expected to define a reflexive
83733 and symmetric relationship and return the same result value each time it
83734 is called with a particular pair of values. If it behaves in some other
83735 manner, the functions Find, Reverse_Find, and "=" on list values return
83736 an unspecified value. The exact arguments and number of calls of this
83737 generic formal function by the functions Find, Reverse_Find, and "=" on
83738 list values are unspecified.
83739
83740 55.a/2
83741 Ramification: If the actual function for "=" is not symmetric
83742 and consistent, the result returned by the listed functions
83743 cannot be predicted. The implementation is not required to
83744 protect against "=" raising an exception, or returning random
83745 results, or any other "bad" behavior. And it can call "=" in
83746 whatever manner makes sense. But note that only the results
83747 of Find, Reverse_Find, and List "=" are unspecified; other
83748 subprograms are not allowed to break if "=" is bad (they
83749 aren't expected to use "=").
83750
83751 56/2
83752 {AI95-00302-03AI95-00302-03} The type List is used to represent lists.
83753 The type List needs finalization (see *note 7.6::).
83754
83755 57/2
83756 {AI95-00302-03AI95-00302-03} Empty_List represents the empty List
83757 object. It has a length of 0. If an object of type List is not
83758 otherwise initialized, it is initialized to the same value as
83759 Empty_List.
83760
83761 58/2
83762 {AI95-00302-03AI95-00302-03} No_Element represents a cursor that
83763 designates no element. If an object of type Cursor is not otherwise
83764 initialized, it is initialized to the same value as No_Element.
83765
83766 59/2
83767 {AI95-00302-03AI95-00302-03} The predefined "=" operator for type Cursor
83768 returns True if both cursors are No_Element, or designate the same
83769 element in the same container.
83770
83771 60/2
83772 {AI95-00302-03AI95-00302-03} Execution of the default implementation of
83773 the Input, Output, Read, or Write attribute of type Cursor raises
83774 Program_Error.
83775
83776 60.a/2
83777 Reason: A cursor will probably be implemented in terms of one
83778 or more access values, and the effects of streaming access
83779 values is unspecified. Rather than letting the user stream
83780 junk by accident, we mandate that streaming of cursors raise
83781 Program_Error by default. The attributes can always be
83782 specified if there is a need to support streaming.
83783
83784 60.1/3
83785 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} List'Write for a List
83786 object L writes Length(L) elements of the list to the stream. It also
83787 may write additional information about the list.
83788
83789 60.2/3
83790 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} List'Read reads the
83791 representation of a list from the stream, and assigns to Item a list
83792 with the same length and elements as was written by List'Write.
83793
83794 60.b/3
83795 Ramification: Streaming more elements than the container
83796 length is wrong. For implementation implications of this
83797 rule, see the Implementation Note in *note A.18.2::.
83798
83799 61/2
83800 {AI95-00302-03AI95-00302-03} [Some operations of this generic package
83801 have access-to-subprogram parameters. To ensure such operations are
83802 well-defined, they guard against certain actions by the designated
83803 subprogram. In particular, some operations check for "tampering with
83804 cursors" of a container because they depend on the set of elements of
83805 the container remaining constant, and others check for "tampering with
83806 elements" of a container because they depend on elements of the
83807 container not being replaced.]
83808
83809 62/2
83810 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with cursors
83811 of a list object L if:
83812
83813 63/2
83814 * it inserts or deletes elements of L, that is, it calls the Insert,
83815 Clear, Delete, or Delete_Last procedures with L as a parameter; or
83816
83817 63.a/2
83818 To be honest: Operations which are defined to be equivalent to
83819 a call on one of these operations also are included.
83820 Similarly, operations which call one of these as part of their
83821 definition are included.
83822
83823 64/2
83824 * it reorders the elements of L, that is, it calls the Splice,
83825 Swap_Links, or Reverse_Elements procedures or the Sort or Merge
83826 procedures of an instance of Generic_Sorting with L as a parameter;
83827 or
83828
83829 65/2
83830 * it finalizes L; or
83831
83832 65.1/3
83833 * {AI05-0001-1AI05-0001-1} it calls the Assign procedure with L as
83834 the Target parameter; or
83835
83836 65.a.1/3
83837 Ramification: We don't need to explicitly mention
83838 assignment_statement, because that finalizes the target object
83839 as part of the operation, and finalization of an object is
83840 already defined as tampering with cursors.
83841
83842 66/2
83843 * it calls the Move procedure with L as a parameter.
83844
83845 66.a/2
83846 Reason: Swap copies elements rather than reordering them, so
83847 it doesn't tamper with cursors.
83848
83849 67/2
83850 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with
83851 elements of a list object L if:
83852
83853 68/2
83854 * it tampers with cursors of L; or
83855
83856 69/2
83857 * it replaces one or more elements of L, that is, it calls the
83858 Replace_Element or Swap procedures with L as a parameter.
83859
83860 69.a/2
83861 Reason: Complete replacement of an element can cause its
83862 memory to be deallocated while another operation is holding
83863 onto a reference to it. That can't be allowed. However, a
83864 simple modification of (part of) an element is not a problem,
83865 so Update_Element does not cause a problem.
83866
83867 69.1/3
83868 {AI05-0265-1AI05-0265-1} When tampering with cursors is prohibited for a
83869 particular list object L, Program_Error is propagated by a call of any
83870 language-defined subprogram that is defined to tamper with the cursors
83871 of L, leaving L unmodified. Similarly, when tampering with elements is
83872 prohibited for a particular list object L, Program_Error is propagated
83873 by a call of any language-defined subprogram that is defined to tamper
83874 with the elements of L [(or tamper with the cursors of L)], leaving L
83875 unmodified.
83876
83877 69.b/3
83878 Proof: Tampering with elements includes tampering with
83879 cursors, so we mention it only from completeness in the second
83880 sentence.
83881
83882 69.2/3
83883 function Has_Element (Position : Cursor) return Boolean;
83884
83885 69.3/3
83886 {AI05-0212-1AI05-0212-1} Returns True if Position designates
83887 an element, and returns False otherwise.
83888
83889 69.c/3
83890 To be honest: {AI05-0005-1AI05-0005-1}
83891 {AI05-0212-1AI05-0212-1} This function might not detect
83892 cursors that designate deleted elements; such cursors are
83893 invalid (see below) and the result of calling Has_Element with
83894 an invalid cursor is unspecified (but not erroneous).
83895
83896 70/2
83897 function "=" (Left, Right : List) return Boolean;
83898
83899 71/3
83900 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If Left
83901 and Right denote the same list object, then the function
83902 returns True. If Left and Right have different lengths, then
83903 the function returns False. Otherwise, it compares each
83904 element in Left to the corresponding element in Right using
83905 the generic formal equality operator. If any such comparison
83906 returns False, the function returns False; otherwise, it
83907 returns True. Any exception raised during evaluation of
83908 element equality is propagated.
83909
83910 71.a/2
83911 Implementation Note: This wording describes the canonical
83912 semantics. However, the order and number of calls on the
83913 formal equality function is unspecified for all of the
83914 operations that use it in this package, so an implementation
83915 can call it as many or as few times as it needs to get the
83916 correct answer. Specifically, there is no requirement to call
83917 the formal equality additional times once the answer has been
83918 determined.
83919
83920 72/2
83921 function Length (Container : List) return Count_Type;
83922
83923 73/2
83924 {AI95-00302-03AI95-00302-03} Returns the number of elements in
83925 Container.
83926
83927 74/2
83928 function Is_Empty (Container : List) return Boolean;
83929
83930 75/2
83931 {AI95-00302-03AI95-00302-03} Equivalent to Length (Container)
83932 = 0.
83933
83934 76/2
83935 procedure Clear (Container : in out List);
83936
83937 77/2
83938 {AI95-00302-03AI95-00302-03} Removes all the elements from
83939 Container.
83940
83941 78/2
83942 function Element (Position : Cursor) return Element_Type;
83943
83944 79/2
83945 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
83946 then Constraint_Error is propagated. Otherwise, Element
83947 returns the element designated by Position.
83948
83949 80/2
83950 procedure Replace_Element (Container : in out List;
83951 Position : in Cursor;
83952 New_Item : in Element_Type);
83953
83954 81/3
83955 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
83956 Position equals No_Element, then Constraint_Error is
83957 propagated; if Position does not designate an element in
83958 Container, then Program_Error is propagated. Otherwise,
83959 Replace_Element assigns the value New_Item to the element
83960 designated by Position.
83961
83962 82/2
83963 procedure Query_Element
83964 (Position : in Cursor;
83965 Process : not null access procedure (Element : in Element_Type));
83966
83967 83/3
83968 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1}
83969 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
83970 Constraint_Error is propagated. Otherwise, Query_Element
83971 calls Process.all with the element designated by Position as
83972 the argument. Tampering with the elements of the list that
83973 contains the element designated by Position is prohibited
83974 during the execution of the call on Process.all. Any
83975 exception raised by Process.all is propagated.
83976
83977 84/2
83978 procedure Update_Element
83979 (Container : in out List;
83980 Position : in Cursor;
83981 Process : not null access procedure (Element : in out Element_Type));
83982
83983 85/3
83984 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1}
83985 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
83986 Constraint_Error is propagated; if Position does not designate
83987 an element in Container, then Program_Error is propagated.
83988 Otherwise, Update_Element calls Process.all with the element
83989 designated by Position as the argument. Tampering with the
83990 elements of Container is prohibited during the execution of
83991 the call on Process.all. Any exception raised by Process.all
83992 is propagated.
83993
83994 86/2
83995 If Element_Type is unconstrained and definite, then the actual
83996 Element parameter of Process.all shall be unconstrained.
83997
83998 86.a/2
83999 Ramification: This means that the elements cannot be directly
84000 allocated from the heap; it must be possible to change the
84001 discriminants of the element in place.
84002
84003 86.1/3
84004 type Constant_Reference_Type
84005 (Element : not null access constant Element_Type) is private
84006 with Implicit_Dereference => Element;
84007
84008 86.2/3
84009 type Reference_Type (Element : not null access Element_Type) is private
84010 with Implicit_Dereference => Element;
84011
84012 86.3/3
84013 {AI05-0212-1AI05-0212-1} The types Constant_Reference_Type and
84014 Reference_Type need finalization.
84015
84016 86.4/3
84017 The default initialization of an object of type
84018 Constant_Reference_Type or Reference_Type propagates
84019 Program_Error.
84020
84021 86.b/3
84022 Reason: It is expected that Reference_Type (and
84023 Constant_Reference_Type) will be a controlled type, for which
84024 finalization will have some action to terminate the tampering
84025 check for the associated container. If the object is created
84026 by default, however, there is no associated container. Since
84027 this is useless, and supporting this case would take extra
84028 work, we define it to raise an exception.
84029
84030 86.5/3
84031 function Constant_Reference (Container : aliased in List;
84032 Position : in Cursor)
84033 return Constant_Reference_Type;
84034
84035 86.6/3
84036 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
84037 function (combined with the Constant_Indexing and
84038 Implicit_Dereference aspects) provides a convenient way to
84039 gain read access to an individual element of a list given a
84040 cursor.
84041
84042 86.7/3
84043 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
84044 equals No_Element, then Constraint_Error is propagated; if
84045 Position does not designate an element in Container, then
84046 Program_Error is propagated. Otherwise, Constant_Reference
84047 returns an object whose discriminant is an access value that
84048 designates the element designated by Position. Tampering with
84049 the elements of Container is prohibited while the object
84050 returned by Constant_Reference exists and has not been
84051 finalized.
84052
84053 86.8/3
84054 function Reference (Container : aliased in out List;
84055 Position : in Cursor)
84056 return Reference_Type;
84057
84058 86.9/3
84059 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
84060 function (combined with the Variable_Indexing and
84061 Implicit_Dereference aspects) provides a convenient way to
84062 gain read and write access to an individual element of a list
84063 given a cursor.
84064
84065 86.10/3
84066 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
84067 equals No_Element, then Constraint_Error is propagated; if
84068 Position does not designate an element in Container, then
84069 Program_Error is propagated. Otherwise, Reference returns an
84070 object whose discriminant is an access value that designates
84071 the element designated by Position. Tampering with the
84072 elements of Container is prohibited while the object returned
84073 by Reference exists and has not been finalized.
84074
84075 86.11/3
84076 procedure Assign (Target : in out List; Source : in List);
84077
84078 86.12/3
84079 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} If Target
84080 denotes the same object as Source, the operation has no
84081 effect. Otherwise, the elements of Source are copied to
84082 Target as for an assignment_statement assigning Source to
84083 Target.
84084
84085 86.c/3
84086 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
84087 compatibility with the bounded list container. For an
84088 unbounded list, Assign(A, B) and A := B behave identically.
84089 For a bounded list, := will raise an exception if the
84090 container capacities are different, while Assign will not
84091 raise an exception if there is enough room in the target.
84092
84093 86.13/3
84094 function Copy (Source : List) return List;
84095
84096 86.14/3
84097 {AI05-0001-1AI05-0001-1} Returns a list whose elements match
84098 the elements of Source.
84099
84100 87/2
84101 procedure Move (Target : in out List;
84102 Source : in out List);
84103
84104 88/3
84105 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1}
84106 {AI05-0248-1AI05-0248-1} {AI05-0262-1AI05-0262-1} If Target
84107 denotes the same object as Source, then the operation has no
84108 effect. Otherwise, the operation is equivalent to Assign
84109 (Target, Source) followed by Clear (Source).
84110
84111 89/2
84112 procedure Insert (Container : in out List;
84113 Before : in Cursor;
84114 New_Item : in Element_Type;
84115 Count : in Count_Type := 1);
84116
84117 90/2
84118 {AI95-00302-03AI95-00302-03} If Before is not No_Element, and
84119 does not designate an element in Container, then Program_Error
84120 is propagated. Otherwise, Insert inserts Count copies of
84121 New_Item prior to the element designated by Before. If Before
84122 equals No_Element, the new elements are inserted after the
84123 last node (if any). Any exception raised during allocation of
84124 internal storage is propagated, and Container is not modified.
84125
84126 90.a/2
84127 Ramification: The check on Before checks that the cursor does
84128 not belong to some other Container. This check implies that a
84129 reference to the container is included in the cursor value.
84130 This wording is not meant to require detection of dangling
84131 cursors; such cursors are defined to be invalid, which means
84132 that execution is erroneous, and any result is allowed
84133 (including not raising an exception).
84134
84135 91/2
84136 procedure Insert (Container : in out List;
84137 Before : in Cursor;
84138 New_Item : in Element_Type;
84139 Position : out Cursor;
84140 Count : in Count_Type := 1);
84141
84142 92/3
84143 {AI95-00302-03AI95-00302-03} {AI05-0257-1AI05-0257-1} If
84144 Before is not No_Element, and does not designate an element in
84145 Container, then Program_Error is propagated. Otherwise,
84146 Insert allocates Count copies of New_Item, and inserts them
84147 prior to the element designated by Before. If Before equals
84148 No_Element, the new elements are inserted after the last
84149 element (if any). Position designates the first
84150 newly-inserted element, or if Count equals 0, then Position is
84151 assigned the value of Before. Any exception raised during
84152 allocation of internal storage is propagated, and Container is
84153 not modified.
84154
84155 93/2
84156 procedure Insert (Container : in out List;
84157 Before : in Cursor;
84158 Position : out Cursor;
84159 Count : in Count_Type := 1);
84160
84161 94/3
84162 {AI95-00302-03AI95-00302-03} {AI05-0257-1AI05-0257-1} If
84163 Before is not No_Element, and does not designate an element in
84164 Container, then Program_Error is propagated. Otherwise,
84165 Insert inserts Count new elements prior to the element
84166 designated by Before. If Before equals No_Element, the new
84167 elements are inserted after the last node (if any). The new
84168 elements are initialized by default (see *note 3.3.1::).
84169 Position designates the first newly-inserted element, or if
84170 Count equals 0, then Position is assigned the value of Before.
84171 Any exception raised during allocation of internal storage is
84172 propagated, and Container is not modified.
84173
84174 95/2
84175 procedure Prepend (Container : in out List;
84176 New_Item : in Element_Type;
84177 Count : in Count_Type := 1);
84178
84179 96/2
84180 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
84181 First (Container), New_Item, Count).
84182
84183 97/2
84184 procedure Append (Container : in out List;
84185 New_Item : in Element_Type;
84186 Count : in Count_Type := 1);
84187
84188 98/2
84189 {AI95-00302-03AI95-00302-03} Equivalent to Insert (Container,
84190 No_Element, New_Item, Count).
84191
84192 99/2
84193 procedure Delete (Container : in out List;
84194 Position : in out Cursor;
84195 Count : in Count_Type := 1);
84196
84197 100/3
84198 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84199 Position equals No_Element, then Constraint_Error is
84200 propagated. If Position does not designate an element in
84201 Container, then Program_Error is propagated. Otherwise,
84202 Delete removes (from Container) Count elements starting at the
84203 element designated by Position (or all of the elements
84204 starting at Position if there are fewer than Count elements
84205 starting at Position). Finally, Position is set to
84206 No_Element.
84207
84208 101/2
84209 procedure Delete_First (Container : in out List;
84210 Count : in Count_Type := 1);
84211
84212 102/3
84213 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1} If
84214 Length (Container) <= Count, then Delete_First is equivalent
84215 to Clear (Container). Otherwise, it removes the first Count
84216 nodes from Container.
84217
84218 103/2
84219 procedure Delete_Last (Container : in out List;
84220 Count : in Count_Type := 1);
84221
84222 104/3
84223 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84224 Length (Container) <= Count, then Delete_Last is equivalent to
84225 Clear (Container). Otherwise, it removes the last Count nodes
84226 from Container.
84227
84228 105/2
84229 procedure Reverse_Elements (Container : in out List);
84230
84231 106/2
84232 {AI95-00302-03AI95-00302-03} Reorders the elements of
84233 Container in reverse order.
84234
84235 106.a/2
84236 Discussion: Unlike the similar routine for a vector, elements
84237 should not be copied; rather, the nodes should be exchanged.
84238 Cursors are expected to reference the same elements
84239 afterwards.
84240
84241 107/2
84242 procedure Swap (Container : in out List;
84243 I, J : in Cursor);
84244
84245 108/2
84246 {AI95-00302-03AI95-00302-03} If either I or J is No_Element,
84247 then Constraint_Error is propagated. If either I or J do not
84248 designate an element in Container, then Program_Error is
84249 propagated. Otherwise, Swap exchanges the values of the
84250 elements designated by I and J.
84251
84252 108.a/2
84253 Ramification: After a call to Swap, I designates the element
84254 value previously designated by J, and J designates the element
84255 value previously designated by I. The cursors do not become
84256 ambiguous from this operation.
84257
84258 108.b/2
84259 To be honest: The implementation is not required to actually
84260 copy the elements if it can do the swap some other way. But
84261 it is allowed to copy the elements if needed.
84262
84263 109/2
84264 procedure Swap_Links (Container : in out List;
84265 I, J : in Cursor);
84266
84267 110/2
84268 {AI95-00302-03AI95-00302-03} If either I or J is No_Element,
84269 then Constraint_Error is propagated. If either I or J do not
84270 designate an element in Container, then Program_Error is
84271 propagated. Otherwise, Swap_Links exchanges the nodes
84272 designated by I and J.
84273
84274 110.a/2
84275 Ramification: Unlike Swap, this exchanges the nodes, not the
84276 elements. No copying is performed. I and J designate the
84277 same elements after this call as they did before it. This
84278 operation can provide better performance than Swap if the
84279 element size is large.
84280
84281 111/2
84282 procedure Splice (Target : in out List;
84283 Before : in Cursor;
84284 Source : in out List);
84285
84286 112/2
84287 {AI95-00302-03AI95-00302-03} If Before is not No_Element, and
84288 does not designate an element in Target, then Program_Error is
84289 propagated. Otherwise, if Source denotes the same object as
84290 Target, the operation has no effect. Otherwise, Splice
84291 reorders elements such that they are removed from Source and
84292 moved to Target, immediately prior to Before. If Before
84293 equals No_Element, the nodes of Source are spliced after the
84294 last node of Target. The length of Target is incremented by
84295 the number of nodes in Source, and the length of Source is set
84296 to 0.
84297
84298 113/2
84299 procedure Splice (Target : in out List;
84300 Before : in Cursor;
84301 Source : in out List;
84302 Position : in out Cursor);
84303
84304 114/3
84305 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84306 Position is No_Element, then Constraint_Error is propagated.
84307 If Before does not equal No_Element, and does not designate an
84308 element in Target, then Program_Error is propagated. If
84309 Position does not equal No_Element, and does not designate a
84310 node in Source, then Program_Error is propagated. If Source
84311 denotes the same object as Target, then there is no effect if
84312 Position equals Before, else the element designated by
84313 Position is moved immediately prior to Before, or, if Before
84314 equals No_Element, after the last element. In both cases,
84315 Position and the length of Target are unchanged. Otherwise,
84316 the element designated by Position is removed from Source and
84317 moved to Target, immediately prior to Before, or, if Before
84318 equals No_Element, after the last element of Target. The
84319 length of Target is incremented, the length of Source is
84320 decremented, and Position is updated to represent an element
84321 in Target.
84322
84323 114.a/2
84324 Ramification: If Source is the same as Target, and Position =
84325 Before, or Next(Position) = Before, Splice has no effect, as
84326 the element does not have to move to meet the postcondition.
84327
84328 115/2
84329 procedure Splice (Container: in out List;
84330 Before : in Cursor;
84331 Position : in Cursor);
84332
84333 116/3
84334 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84335 Position is No_Element, then Constraint_Error is propagated.
84336 If Before does not equal No_Element, and does not designate an
84337 element in Container, then Program_Error is propagated. If
84338 Position does not equal No_Element, and does not designate a
84339 node in Container, then Program_Error is propagated. If
84340 Position equals Before there is no effect. Otherwise, the
84341 element designated by Position is moved immediately prior to
84342 Before, or, if Before equals No_Element, after the last
84343 element. The length of Container is unchanged.
84344
84345 117/2
84346 function First (Container : List) return Cursor;
84347
84348 118/3
84349 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84350 Container is empty, First returns the value No_Element.
84351 Otherwise, it returns a cursor that designates the first node
84352 in Container.
84353
84354 119/2
84355 function First_Element (Container : List) return Element_Type;
84356
84357 120/2
84358 {AI95-00302-03AI95-00302-03} Equivalent to Element (First
84359 (Container)).
84360
84361 121/2
84362 function Last (Container : List) return Cursor;
84363
84364 122/3
84365 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
84366 Container is empty, Last returns the value No_Element.
84367 Otherwise, it returns a cursor that designates the last node
84368 in Container.
84369
84370 123/2
84371 function Last_Element (Container : List) return Element_Type;
84372
84373 124/2
84374 {AI95-00302-03AI95-00302-03} Equivalent to Element (Last
84375 (Container)).
84376
84377 125/2
84378 function Next (Position : Cursor) return Cursor;
84379
84380 126/2
84381 {AI95-00302-03AI95-00302-03} If Position equals No_Element or
84382 designates the last element of the container, then Next
84383 returns the value No_Element. Otherwise, it returns a cursor
84384 that designates the successor of the element designated by
84385 Position.
84386
84387 127/2
84388 function Previous (Position : Cursor) return Cursor;
84389
84390 128/2
84391 {AI95-00302-03AI95-00302-03} If Position equals No_Element or
84392 designates the first element of the container, then Previous
84393 returns the value No_Element. Otherwise, it returns a cursor
84394 that designates the predecessor of the element designated by
84395 Position.
84396
84397 129/2
84398 procedure Next (Position : in out Cursor);
84399
84400 130/2
84401 {AI95-00302-03AI95-00302-03} Equivalent to Position := Next
84402 (Position).
84403
84404 131/2
84405 procedure Previous (Position : in out Cursor);
84406
84407 132/2
84408 {AI95-00302-03AI95-00302-03} Equivalent to Position :=
84409 Previous (Position).
84410
84411 133/2
84412 function Find (Container : List;
84413 Item : Element_Type;
84414 Position : Cursor := No_Element)
84415 return Cursor;
84416
84417 134/2
84418 {AI95-00302-03AI95-00302-03} If Position is not No_Element,
84419 and does not designate an element in Container, then
84420 Program_Error is propagated. Find searches the elements of
84421 Container for an element equal to Item (using the generic
84422 formal equality operator). The search starts at the element
84423 designated by Position, or at the first element if Position
84424 equals No_Element. It proceeds towards Last (Container). If
84425 no equal element is found, then Find returns No_Element.
84426 Otherwise, it returns a cursor designating the first equal
84427 element encountered.
84428
84429 135/2
84430 function Reverse_Find (Container : List;
84431 Item : Element_Type;
84432 Position : Cursor := No_Element)
84433 return Cursor;
84434
84435 136/2
84436 {AI95-00302-03AI95-00302-03} If Position is not No_Element,
84437 and does not designate an element in Container, then
84438 Program_Error is propagated. Find searches the elements of
84439 Container for an element equal to Item (using the generic
84440 formal equality operator). The search starts at the element
84441 designated by Position, or at the last element if Position
84442 equals No_Element. It proceeds towards First (Container). If
84443 no equal element is found, then Reverse_Find returns
84444 No_Element. Otherwise, it returns a cursor designating the
84445 first equal element encountered.
84446
84447 137/2
84448 function Contains (Container : List;
84449 Item : Element_Type) return Boolean;
84450
84451 138/2
84452 {AI95-00302-03AI95-00302-03} Equivalent to Find (Container,
84453 Item) /= No_Element.
84454
84455 Paragraphs 139 and 140 were moved above.
84456
84457 141/2
84458 procedure Iterate
84459 (Container : in List;
84460 Process : not null access procedure (Position : in Cursor));
84461
84462 142/3
84463 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} Iterate
84464 calls Process.all with a cursor that designates each node in
84465 Container, starting with the first node and moving the cursor
84466 as per the Next function. Tampering with the cursors of
84467 Container is prohibited during the execution of a call on
84468 Process.all. Any exception raised by Process.all is
84469 propagated.
84470
84471 142.a/2
84472 Implementation Note: The purpose of the tamper with cursors
84473 check is to prevent erroneous execution from the Position
84474 parameter of Process.all becoming invalid. This check takes
84475 place when the operations that tamper with the cursors of the
84476 container are called. The check cannot be made later (say in
84477 the body of Iterate), because that could cause the Position
84478 cursor to be invalid and potentially cause execution to become
84479 erroneous -- defeating the purpose of the check.
84480
84481 142.b/2
84482 See Iterate for vectors (*note A.18.2::) for a suggested
84483 implementation of the check.
84484
84485 143/2
84486 procedure Reverse_Iterate
84487 (Container : in List;
84488 Process : not null access procedure (Position : in Cursor));
84489
84490 144/3
84491 {AI95-00302-03AI95-00302-03} {AI05-0212-1AI05-0212-1} Iterates
84492 over the nodes in Container as per procedure Iterate, except
84493 that elements are traversed in reverse order, starting with
84494 the last node and moving the cursor as per the Previous
84495 function.
84496
84497 144.1/3
84498 function Iterate (Container : in List)
84499 return List_Iterator_Interfaces.Reversible_Iterator'Class;
84500
84501 144.2/3
84502 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
84503 {AI05-0269-1AI05-0269-1} Iterate returns a reversible iterator
84504 object (see *note 5.5.1::) that will generate a value for a
84505 loop parameter (see *note 5.5.2::) designating each node in
84506 Container, starting with the first node and moving the cursor
84507 as per the Next function when used as a forward iterator, and
84508 starting with the last node and moving the cursor as per the
84509 Previous function when used as a reverse iterator. Tampering
84510 with the cursors of Container is prohibited while the iterator
84511 object exists (in particular, in the sequence_of_statements of
84512 the loop_statement whose iterator_specification denotes this
84513 object). The iterator object needs finalization.
84514
84515 144.3/3
84516 function Iterate (Container : in List; Start : in Cursor)
84517 return List_Iterator_Interfaces.Reversible_Iterator'Class;
84518
84519 144.4/3
84520 {AI05-0212-1AI05-0212-1} {AI05-0262-1AI05-0262-1}
84521 {AI05-0265-1AI05-0265-1} {AI05-0269-1AI05-0269-1} If Start is
84522 not No_Element and does not designate an item in Container,
84523 then Program_Error is propagated. If Start is No_Element,
84524 then Constraint_Error is propagated. Otherwise, Iterate
84525 returns a reversible iterator object (see *note 5.5.1::) that
84526 will generate a value for a loop parameter (see *note 5.5.2::)
84527 designating each node in Container, starting with the node
84528 designated by Start and moving the cursor as per the Next
84529 function when used as a forward iterator, or moving the cursor
84530 as per the Previous function when used as a reverse iterator.
84531 Tampering with the cursors of Container is prohibited while
84532 the iterator object exists (in particular, in the
84533 sequence_of_statements of the loop_statement whose
84534 iterator_specification denotes this object). The iterator
84535 object needs finalization.
84536
84537 144.a/3
84538 Discussion: Exits are allowed from the loops created using the
84539 iterator objects. In particular, to stop the iteration at a
84540 particular cursor, just add
84541
84542 144.b/3
84543 exit when Cur = Stop;
84544
84545 144.c/3
84546 in the body of the loop (assuming that Cur is the loop
84547 parameter and Stop is the cursor that you want to stop at).
84548
84549 145/3
84550 {AI05-0044-1AI05-0044-1} {AI05-0262-1AI05-0262-1} The actual function
84551 for the generic formal function "<" of Generic_Sorting is expected to
84552 return the same value each time it is called with a particular pair of
84553 element values. It should define a strict weak ordering relationship
84554 (see *note A.18::); it should not modify Container. If the actual for
84555 "<" behaves in some other manner, the behavior of the subprograms of
84556 Generic_Sorting are unspecified. The number of times the subprograms of
84557 Generic_Sorting call "<" is unspecified.
84558
84559 146/2
84560 function Is_Sorted (Container : List) return Boolean;
84561
84562 147/2
84563 {AI95-00302-03AI95-00302-03} Returns True if the elements are
84564 sorted smallest first as determined by the generic formal "<"
84565 operator; otherwise, Is_Sorted returns False. Any exception
84566 raised during evaluation of "<" is propagated.
84567
84568 148/2
84569 procedure Sort (Container : in out List);
84570
84571 149/2
84572 {AI95-00302-03AI95-00302-03} Reorders the nodes of Container
84573 such that the elements are sorted smallest first as determined
84574 by the generic formal "<" operator provided. The sort is
84575 stable. Any exception raised during evaluation of "<" is
84576 propagated.
84577
84578 149.a/2
84579 Ramification: Unlike array sorts, we do require stable sorts
84580 here. That's because algorithms in the merge sort family (as
84581 described by Knuth) can be both fast and stable. Such sorts
84582 use the extra memory as offered by the links to provide better
84583 performance.
84584
84585 149.b/2
84586 Note that list sorts never copy elements; it is the nodes, not
84587 the elements, that are reordered.
84588
84589 150/2
84590 procedure Merge (Target : in out List;
84591 Source : in out List);
84592
84593 151/3
84594 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1} If
84595 Source is empty, then Merge does nothing. If Source and
84596 Target are the same nonempty container object, then
84597 Program_Error is propagated. Otherwise, Merge removes
84598 elements from Source and inserts them into Target; afterwards,
84599 Target contains the union of the elements that were initially
84600 in Source and Target; Source is left empty. If Target and
84601 Source are initially sorted smallest first, then Target is
84602 ordered smallest first as determined by the generic formal "<"
84603 operator; otherwise, the order of elements in Target is
84604 unspecified. Any exception raised during evaluation of "<" is
84605 propagated.
84606
84607 151.a/2
84608 Ramification: It is a bounded error if either of the lists is
84609 unsorted, see below. The bounded error can be recovered by
84610 sorting Target after the merge call, or the lists can be
84611 pretested with Is_Sorted.
84612
84613 _Bounded (Run-Time) Errors_
84614
84615 152/2
84616 {AI95-00302-03AI95-00302-03} Calling Merge in an instance of
84617 Generic_Sorting with either Source or Target not ordered smallest first
84618 using the provided generic formal "<" operator is a bounded error.
84619 Either Program_Error is raised after Target is updated as described for
84620 Merge, or the operation works as defined.
84621
84622 152.1/3
84623 {AI05-0022-1AI05-0022-1} {AI05-0248-1AI05-0248-1} It is a bounded error
84624 for the actual function associated with a generic formal subprogram,
84625 when called as part of an operation of this package, to tamper with
84626 elements of any List parameter of the operation. Either Program_Error
84627 is raised, or the operation works as defined on the value of the List
84628 either prior to, or subsequent to, some or all of the modifications to
84629 the List.
84630
84631 152.2/3
84632 {AI05-0027-1AI05-0027-1} It is a bounded error to call any subprogram
84633 declared in the visible part of Containers.Doubly_Linked_Lists when the
84634 associated container has been finalized. If the operation takes
84635 Container as an in out parameter, then it raises Constraint_Error or
84636 Program_Error. Otherwise, the operation either proceeds as it would for
84637 an empty container, or it raises Constraint_Error or Program_Error.
84638
84639 _Erroneous Execution_
84640
84641 153/2
84642 {AI95-00302-03AI95-00302-03} A Cursor value is invalid if any of the
84643 following have occurred since it was created:
84644
84645 154/2
84646 * The list that contains the element it designates has been
84647 finalized;
84648
84649 154.1/3
84650 * {AI05-0160-1AI05-0160-1} The list that contains the element it
84651 designates has been used as the Target of a call to Assign, or as
84652 the target of an assignment_statement;
84653
84654 155/2
84655 * [The list that contains the element it designates has been used as
84656 the Source or Target of a call to Move;] or
84657
84658 155.a/3
84659 Proof: {AI05-0001-1AI05-0001-1} Move has been reworded in
84660 terms of Assign and Clear, which are covered by other bullets,
84661 so this text is redundant.
84662
84663 156/3
84664 * {AI05-0160-1AI05-0160-1} {AI05-0262-1AI05-0262-1} The element it
84665 designates has been removed from the list that previously contained
84666 the element.
84667
84668 156.a/3
84669 To be honest: {AI05-0160-1AI05-0160-1} The cursor modified by
84670 the four parameter Splice is not invalid, even though the
84671 element it designates has been removed from the source list,
84672 because that cursor has been modified to designate that
84673 element in the target list - the cursor no longer designates
84674 an element in the source list.
84675
84676 156.b/3
84677 Ramification: {AI05-0160-1AI05-0160-1} This can happen
84678 directly via calls to Delete, Delete_Last, Clear, Splice with
84679 a Source parameter, and Merge; and indirectly via calls to
84680 Delete_First, Assign, and Move.
84681
84682 157/2
84683 {AI95-00302-03AI95-00302-03} The result of "=" or Has_Element is
84684 unspecified if it is called with an invalid cursor parameter. Execution
84685 is erroneous if any other subprogram declared in
84686 Containers.Doubly_Linked_Lists is called with an invalid cursor
84687 parameter.
84688
84689 157.a/2
84690 Discussion: The list above is intended to be exhaustive. In
84691 other cases, a cursor value continues to designate its
84692 original element. For instance, cursor values survive the
84693 insertion and deletion of other nodes.
84694
84695 157.b/2
84696 While it is possible to check for these cases, in many cases
84697 the overhead necessary to make the check is substantial in
84698 time or space. Implementations are encouraged to check for as
84699 many of these cases as possible and raise Program_Error if
84700 detected.
84701
84702 157.1/3
84703 {AI05-0212-1AI05-0212-1} Execution is erroneous if the list associated
84704 with the result of a call to Reference or Constant_Reference is
84705 finalized before the result object returned by the call to Reference or
84706 Constant_Reference is finalized.
84707
84708 157.c/3
84709 Reason: Each object of Reference_Type and
84710 Constant_Reference_Type probably contains some reference to
84711 the originating container. If that container is prematurely
84712 finalized (which is only possible via Unchecked_Deallocation,
84713 as accessibility checks prevent passing a container to
84714 Reference that will not live as long as the result), the
84715 finalization of the object of Reference_Type will try to
84716 access a nonexistent object. This is a normal case of a
84717 dangling pointer created by Unchecked_Deallocation; we have to
84718 explicitly mention it here as the pointer in question is not
84719 visible in the specification of the type. (This is the same
84720 reason we have to say this for invalid cursors.)
84721
84722 _Implementation Requirements_
84723
84724 158/2
84725 {AI95-00302-03AI95-00302-03} No storage associated with a doubly-linked
84726 List object shall be lost upon assignment or scope exit.
84727
84728 159/3
84729 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The execution of
84730 an assignment_statement for a list shall have the effect of copying the
84731 elements from the source list object to the target list object and
84732 changing the length of the target object to that of the source object.
84733
84734 159.a/3
84735 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
84736 a List is a "deep" copy; that is the elements are copied as
84737 well as the data structures. We say "effect of" in order to
84738 allow the implementation to avoid copying elements immediately
84739 if it wishes. For instance, an implementation that avoided
84740 copying until one of the containers is modified would be
84741 allowed. (Note that this implementation would require care,
84742 see *note A.18.2:: for more.)
84743
84744 _Implementation Advice_
84745
84746 160/2
84747 {AI95-00302-03AI95-00302-03} Containers.Doubly_Linked_Lists should be
84748 implemented similarly to a linked list. In particular, if N is the
84749 length of a list, then the worst-case time complexity of Element, Insert
84750 with Count=1, and Delete with Count=1 should be O(log N).
84751
84752 160.a/2
84753 Implementation Advice: The worst-case time complexity of
84754 Element, Insert with Count=1, and Delete with Count=1 for
84755 Containers.Doubly_Linked_Lists should be O(log N).
84756
84757 160.b/2
84758 Reason: We do not mean to overly constrain implementation
84759 strategies here. However, it is important for portability
84760 that the performance of large containers has roughly the same
84761 factors on different implementations. If a program is moved
84762 to an implementation that takes O(N) time to access elements,
84763 that program could be unusable when the lists are large. We
84764 allow O(log N) access because the proportionality constant and
84765 caching effects are likely to be larger than the log factor,
84766 and we don't want to discourage innovative implementations.
84767
84768 161/2
84769 {AI95-00302-03AI95-00302-03} The worst-case time complexity of a call on
84770 procedure Sort of an instance of
84771 Containers.Doubly_Linked_Lists.Generic_Sorting should be O(N**2), and
84772 the average time complexity should be better than O(N**2).
84773
84774 161.a/2
84775 Implementation Advice: A call on procedure Sort of an instance
84776 of Containers.Doubly_Linked_Lists.Generic_Sorting should have
84777 an average time complexity better than O(N**2) and worst case
84778 no worse than O(N**2).
84779
84780 161.b/2
84781 Ramification: In other words, we're requiring the use of a
84782 better than O(N**2) sorting algorithm, such as Quicksort. No
84783 bubble sorts allowed!
84784
84785 162/2
84786 {AI95-00302-03AI95-00302-03} Move should not copy elements, and should
84787 minimize copying of internal data structures.
84788
84789 162.a/2
84790 Implementation Advice: Containers.Doubly_Linked_Lists.Move
84791 should not copy elements, and should minimize copying of
84792 internal data structures.
84793
84794 162.b/2
84795 Implementation Note: Usually that can be accomplished simply
84796 by moving the pointer(s) to the internal data structures from
84797 the Source container to the Target container.
84798
84799 163/2
84800 {AI95-00302-03AI95-00302-03} If an exception is propagated from a list
84801 operation, no storage should be lost, nor any elements removed from a
84802 list unless specified by the operation.
84803
84804 163.a/2
84805 Implementation Advice: If an exception is propagated from a
84806 list operation, no storage should be lost, nor any elements
84807 removed from a list unless specified by the operation.
84808
84809 163.b/2
84810 Reason: This is important so that programs can recover from
84811 errors. But we don't want to require heroic efforts, so we
84812 just require documentation of cases where this can't be
84813 accomplished.
84814
84815 NOTES
84816
84817 164/2
84818 50 {AI95-00302-03AI95-00302-03} Sorting a list never copies
84819 elements, and is a stable sort (equal elements remain in the
84820 original order). This is different than sorting an array or
84821 vector, which may need to copy elements, and is probably not a
84822 stable sort.
84823
84824 _Extensions to Ada 95_
84825
84826 164.a/2
84827 {AI95-00302-03AI95-00302-03} The generic package
84828 Containers.Doubly_Linked_Lists is new.
84829
84830 _Inconsistencies With Ada 2005_
84831
84832 164.b/3
84833 {AI05-0248-1AI05-0248-1} {AI05-0257-1AI05-0257-1} Correction:
84834 The Insert versions that return a Position parameter are now
84835 defined to return Position = Before if Count = 0. This was
84836 unspecified for Ada 2005; so this will only be inconsistent if
84837 an implementation did something else and a program depended on
84838 that something else -- this should be very rare.
84839
84840 _Incompatibilities With Ada 2005_
84841
84842 164.c/3
84843 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
84844 to Containers.Doubly_Linked_Lists. If an instance of
84845 Containers.Doubly_Linked_Lists is referenced in a use_clause,
84846 and an entity E with the same defining_identifier as a new
84847 entity in Containers.Doubly_Linked_Lists is defined in a
84848 package that is also referenced in a use_clause, the entity E
84849 may no longer be use-visible, resulting in errors. This
84850 should be rare and is easily fixed if it does occur.
84851
84852 _Extensions to Ada 2005_
84853
84854 164.d/3
84855 {AI05-0212-1AI05-0212-1} Added iterator, reference, and
84856 indexing support to make list containers more convenient to
84857 use.
84858
84859 _Wording Changes from Ada 2005_
84860
84861 164.e/3
84862 {AI05-0001-1AI05-0001-1} Generalized the definition of Move.
84863 Specified which elements are read/written by stream
84864 attributes.
84865
84866 164.f/3
84867 {AI05-0022-1AI05-0022-1} Correction: Added a Bounded
84868 (Run-Time) Error to cover tampering by generic actual
84869 subprograms.
84870
84871 164.g/3
84872 {AI05-0027-1AI05-0027-1} Correction: Added a Bounded
84873 (Run-Time) Error to cover access to finalized list containers.
84874
84875 164.h/3
84876 {AI05-0044-1AI05-0044-1} Correction: Redefined "<" actuals to
84877 require a strict weak ordering; the old definition allowed
84878 indeterminant comparisons that would not have worked in a
84879 container.
84880
84881 164.i/3
84882 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
84883 Remote_Types so that containers can be used in distributed
84884 programs.
84885
84886 164.j/3
84887 {AI05-0160-1AI05-0160-1} Correction: Revised the definition of
84888 invalid cursors to cover missing (and new) cases.
84889
84890 164.k/3
84891 {AI05-0257-1AI05-0257-1} Correction: Added missing wording to
84892 describe the Position after Inserting 0 elements.
84893
84894 164.l/3
84895 {AI05-0265-1AI05-0265-1} Correction: Defined when a container
84896 prohibits tampering in order to more clearly define where the
84897 check is made and the exception raised.
84898
84899 \1f
84900 File: aarm2012.info, Node: A.18.4, Next: A.18.5, Prev: A.18.3, Up: A.18
84901
84902 A.18.4 Maps
84903 -----------
84904
84905 1/2
84906 {AI95-00302-03AI95-00302-03} The language-defined generic packages
84907 Containers.Hashed_Maps and Containers.Ordered_Maps provide private types
84908 Map and Cursor, and a set of operations for each type. A map container
84909 allows an arbitrary type to be used as a key to find the element
84910 associated with that key. A hashed map uses a hash function to organize
84911 the keys, while an ordered map orders the keys per a specified relation.
84912
84913 2/3
84914 {AI95-00302-03AI95-00302-03} {AI05-0299-1AI05-0299-1} This subclause
84915 describes the declarations that are common to both kinds of maps. See
84916 *note A.18.5:: for a description of the semantics specific to
84917 Containers.Hashed_Maps and *note A.18.6:: for a description of the
84918 semantics specific to Containers.Ordered_Maps.
84919
84920 _Static Semantics_
84921
84922 3/2
84923 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
84924 function "=" on Element_Type values is expected to define a reflexive
84925 and symmetric relationship and return the same result value each time it
84926 is called with a particular pair of values. If it behaves in some other
84927 manner, the function "=" on map values returns an unspecified value.
84928 The exact arguments and number of calls of this generic formal function
84929 by the function "=" on map values are unspecified.
84930
84931 3.a/2
84932 Ramification: If the actual function for "=" is not symmetric
84933 and consistent, the result returned by "=" for Map objects
84934 cannot be predicted. The implementation is not required to
84935 protect against "=" raising an exception, or returning random
84936 results, or any other "bad" behavior. And it can call "=" in
84937 whatever manner makes sense. But note that only the result of
84938 "=" for Map objects is unspecified; other subprograms are not
84939 allowed to break if "=" is bad (they aren't expected to use
84940 "=").
84941
84942 4/2
84943 {AI95-00302-03AI95-00302-03} The type Map is used to represent maps.
84944 The type Map needs finalization (see *note 7.6::).
84945
84946 5/2
84947 {AI95-00302-03AI95-00302-03} A map contains pairs of keys and elements,
84948 called nodes. Map cursors designate nodes, but also can be thought of
84949 as designating an element (the element contained in the node) for
84950 consistency with the other containers. There exists an equivalence
84951 relation on keys, whose definition is different for hashed maps and
84952 ordered maps. A map never contains two or more nodes with equivalent
84953 keys. The length of a map is the number of nodes it contains.
84954
84955 6/2
84956 {AI95-00302-03AI95-00302-03} Each nonempty map has two particular nodes
84957 called the first node and the last node (which may be the same). Each
84958 node except for the last node has a successor node. If there are no
84959 other intervening operations, starting with the first node and
84960 repeatedly going to the successor node will visit each node in the map
84961 exactly once until the last node is reached. The exact definition of
84962 these terms is different for hashed maps and ordered maps.
84963
84964 7/2
84965 {AI95-00302-03AI95-00302-03} [Some operations of these generic packages
84966 have access-to-subprogram parameters. To ensure such operations are
84967 well-defined, they guard against certain actions by the designated
84968 subprogram. In particular, some operations check for "tampering with
84969 cursors" of a container because they depend on the set of elements of
84970 the container remaining constant, and others check for "tampering with
84971 elements" of a container because they depend on elements of the
84972 container not being replaced.]
84973
84974 8/2
84975 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with cursors
84976 of a map object M if:
84977
84978 9/2
84979 * it inserts or deletes elements of M, that is, it calls the Insert,
84980 Include, Clear, Delete, or Exclude procedures with M as a
84981 parameter; or
84982
84983 9.a/2
84984 To be honest: Operations which are defined to be equivalent to
84985 a call on one of these operations also are included.
84986 Similarly, operations which call one of these as part of their
84987 definition are included.
84988
84989 10/2
84990 * it finalizes M; or
84991
84992 10.1/3
84993 * {AI05-0001-1AI05-0001-1} it calls the Assign procedure with M as
84994 the Target parameter; or
84995
84996 10.a/3
84997 Ramification: We don't need to explicitly mention
84998 assignment_statement, because that finalizes the target object
84999 as part of the operation, and finalization of an object is
85000 already defined as tampering with cursors.
85001
85002 11/2
85003 * it calls the Move procedure with M as a parameter; or
85004
85005 12/2
85006 * it calls one of the operations defined to tamper with the cursors
85007 of M.
85008
85009 12.a/2
85010 Ramification: Replace only modifies a key and element rather
85011 than rehashing, so it does not tamper with cursors.
85012
85013 13/2
85014 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with
85015 elements of a map object M if:
85016
85017 14/2
85018 * it tampers with cursors of M; or
85019
85020 15/2
85021 * it replaces one or more elements of M, that is, it calls the
85022 Replace or Replace_Element procedures with M as a parameter.
85023
85024 15.a/2
85025 Reason: Complete replacement of an element can cause its
85026 memory to be deallocated while another operation is holding
85027 onto a reference to it. That can't be allowed. However, a
85028 simple modification of (part of) an element is not a problem,
85029 so Update_Element does not cause a problem.
85030
85031 15.1/3
85032 {AI05-0265-1AI05-0265-1} When tampering with cursors is prohibited for a
85033 particular map object M, Program_Error is propagated by a call of any
85034 language-defined subprogram that is defined to tamper with the cursors
85035 of M, leaving M unmodified. Similarly, when tampering with elements is
85036 prohibited for a particular map object M, Program_Error is propagated by
85037 a call of any language-defined subprogram that is defined to tamper with
85038 the elements of M [(or tamper with the cursors of M)], leaving M
85039 unmodified.
85040
85041 15.b/3
85042 Proof: Tampering with elements includes tampering with
85043 cursors, so we mention it only from completeness in the second
85044 sentence.
85045
85046 16/2
85047 {AI95-00302-03AI95-00302-03} Empty_Map represents the empty Map object.
85048 It has a length of 0. If an object of type Map is not otherwise
85049 initialized, it is initialized to the same value as Empty_Map.
85050
85051 17/2
85052 {AI95-00302-03AI95-00302-03} No_Element represents a cursor that
85053 designates no node. If an object of type Cursor is not otherwise
85054 initialized, it is initialized to the same value as No_Element.
85055
85056 18/2
85057 {AI95-00302-03AI95-00302-03} The predefined "=" operator for type Cursor
85058 returns True if both cursors are No_Element, or designate the same
85059 element in the same container.
85060
85061 19/2
85062 {AI95-00302-03AI95-00302-03} Execution of the default implementation of
85063 the Input, Output, Read, or Write attribute of type Cursor raises
85064 Program_Error.
85065
85066 19.a/2
85067 Reason: A cursor will probably be implemented in terms of one
85068 or more access values, and the effects of streaming access
85069 values is unspecified. Rather than letting the user stream
85070 junk by accident, we mandate that streaming of cursors raise
85071 Program_Error by default. The attributes can always be
85072 specified if there is a need to support streaming.
85073
85074 19.1/3
85075 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Map'Write for a Map
85076 object M writes Length(M) elements of the map to the stream. It also
85077 may write additional information about the map.
85078
85079 19.2/3
85080 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Map'Read reads the
85081 representation of a map from the stream, and assigns to Item a map with
85082 the same length and elements as was written by Map'Write.
85083
85084 19.b/3
85085 Ramification: Streaming more elements than the container
85086 length is wrong. For implementation implications of this
85087 rule, see the Implementation Note in *note A.18.2::.
85088
85089 19.3/3
85090 function Has_Element (Position : Cursor) return Boolean;
85091
85092 19.4/3
85093 {AI05-0212-1AI05-0212-1} Returns True if Position designates
85094 an element, and returns False otherwise.
85095
85096 19.c/3
85097 To be honest: {AI05-0005-1AI05-0005-1}
85098 {AI05-0212-1AI05-0212-1} This function might not detect
85099 cursors that designate deleted elements; such cursors are
85100 invalid (see below) and the result of calling Has_Element with
85101 an invalid cursor is unspecified (but not erroneous).
85102
85103 20/2
85104 function "=" (Left, Right : Map) return Boolean;
85105
85106 21/2
85107 {AI95-00302-03AI95-00302-03} If Left and Right denote the same
85108 map object, then the function returns True. If Left and Right
85109 have different lengths, then the function returns False.
85110 Otherwise, for each key K in Left, the function returns False
85111 if:
85112
85113 22/2
85114 * a key equivalent to K is not present in Right; or
85115
85116 23/2
85117 * the element associated with K in Left is not equal to the
85118 element associated with K in Right (using the generic
85119 formal equality operator for elements).
85120
85121 24/2
85122 If the function has not returned a result after checking all
85123 of the keys, it returns True. Any exception raised during
85124 evaluation of key equivalence or element equality is
85125 propagated.
85126
85127 24.a/2
85128 Implementation Note: This wording describes the canonical
85129 semantics. However, the order and number of calls on the
85130 formal equality function is unspecified for all of the
85131 operations that use it in this package, so an implementation
85132 can call it as many or as few times as it needs to get the
85133 correct answer. Specifically, there is no requirement to call
85134 the formal equality additional times once the answer has been
85135 determined.
85136
85137 25/2
85138 function Length (Container : Map) return Count_Type;
85139
85140 26/2
85141 {AI95-00302-03AI95-00302-03} Returns the number of nodes in
85142 Container.
85143
85144 27/2
85145 function Is_Empty (Container : Map) return Boolean;
85146
85147 28/2
85148 {AI95-00302-03AI95-00302-03} Equivalent to Length (Container)
85149 = 0.
85150
85151 29/2
85152 procedure Clear (Container : in out Map);
85153
85154 30/2
85155 {AI95-00302-03AI95-00302-03} Removes all the nodes from
85156 Container.
85157
85158 31/2
85159 function Key (Position : Cursor) return Key_Type;
85160
85161 32/2
85162 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
85163 then Constraint_Error is propagated. Otherwise, Key returns
85164 the key component of the node designated by Position.
85165
85166 33/2
85167 function Element (Position : Cursor) return Element_Type;
85168
85169 34/2
85170 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
85171 then Constraint_Error is propagated. Otherwise, Element
85172 returns the element component of the node designated by
85173 Position.
85174
85175 35/2
85176 procedure Replace_Element (Container : in out Map;
85177 Position : in Cursor;
85178 New_Item : in Element_Type);
85179
85180 36/3
85181 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
85182 Position equals No_Element, then Constraint_Error is
85183 propagated; if Position does not designate an element in
85184 Container, then Program_Error is propagated. Otherwise,
85185 Replace_Element assigns New_Item to the element of the node
85186 designated by Position.
85187
85188 37/2
85189 procedure Query_Element
85190 (Position : in Cursor;
85191 Process : not null access procedure (Key : in Key_Type;
85192 Element : in Element_Type));
85193
85194 38/3
85195 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1}
85196 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
85197 Constraint_Error is propagated. Otherwise, Query_Element
85198 calls Process.all with the key and element from the node
85199 designated by Position as the arguments. Tampering with the
85200 elements of the map that contains the element designated by
85201 Position is prohibited during the execution of the call on
85202 Process.all. Any exception raised by Process.all is
85203 propagated.
85204
85205 39/2
85206 procedure Update_Element
85207 (Container : in out Map;
85208 Position : in Cursor;
85209 Process : not null access procedure (Key : in Key_Type;
85210 Element : in out Element_Type));
85211
85212 40/3
85213 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1}
85214 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
85215 Constraint_Error is propagated; if Position does not designate
85216 an element in Container, then Program_Error is propagated.
85217 Otherwise, Update_Element calls Process.all with the key and
85218 element from the node designated by Position as the arguments.
85219 Tampering with the elements of Container is prohibited during
85220 the execution of the call on Process.all. Any exception
85221 raised by Process.all is propagated.
85222
85223 41/2
85224 If Element_Type is unconstrained and definite, then the actual
85225 Element parameter of Process.all shall be unconstrained.
85226
85227 41.a/2
85228 Ramification: This means that the elements cannot be directly
85229 allocated from the heap; it must be possible to change the
85230 discriminants of the element in place.
85231
85232 41.1/3
85233 type Constant_Reference_Type
85234 (Element : not null access constant Element_Type) is private
85235 with Implicit_Dereference => Element;
85236
85237 41.2/3
85238 type Reference_Type (Element : not null access Element_Type) is private
85239 with Implicit_Dereference => Element;
85240
85241 41.3/3
85242 {AI05-0212-1AI05-0212-1} The types Constant_Reference_Type and
85243 Reference_Type need finalization.
85244
85245 41.4/3
85246 The default initialization of an object of type
85247 Constant_Reference_Type or Reference_Type propagates
85248 Program_Error.
85249
85250 41.b/3
85251 Reason: It is expected that Reference_Type (and
85252 Constant_Reference_Type) will be a controlled type, for which
85253 finalization will have some action to terminate the tampering
85254 check for the associated container. If the object is created
85255 by default, however, there is no associated container. Since
85256 this is useless, and supporting this case would take extra
85257 work, we define it to raise an exception.
85258
85259 41.5/3
85260 function Constant_Reference (Container : aliased in Map;
85261 Position : in Cursor)
85262 return Constant_Reference_Type;
85263
85264 41.6/3
85265 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
85266 function (combined with the Constant_Indexing and
85267 Implicit_Dereference aspects) provides a convenient way to
85268 gain read access to an individual element of a map given a
85269 cursor.
85270
85271 41.7/3
85272 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
85273 equals No_Element, then Constraint_Error is propagated; if
85274 Position does not designate an element in Container, then
85275 Program_Error is propagated. Otherwise, Constant_Reference
85276 returns an object whose discriminant is an access value that
85277 designates the element designated by Position. Tampering with
85278 the elements of Container is prohibited while the object
85279 returned by Constant_Reference exists and has not been
85280 finalized.
85281
85282 41.8/3
85283 function Reference (Container : aliased in out Map;
85284 Position : in Cursor)
85285 return Reference_Type;
85286
85287 41.9/3
85288 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
85289 function (combined with the Variable_Indexing and
85290 Implicit_Dereference aspects) provides a convenient way to
85291 gain read and write access to an individual element of a map
85292 given a cursor.
85293
85294 41.10/3
85295 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
85296 equals No_Element, then Constraint_Error is propagated; if
85297 Position does not designate an element in Container, then
85298 Program_Error is propagated. Otherwise, Reference returns an
85299 object whose discriminant is an access value that designates
85300 the element designated by Position. Tampering with the
85301 elements of Container is prohibited while the object returned
85302 by Reference exists and has not been finalized.
85303
85304 41.11/3
85305 function Constant_Reference (Container : aliased in Map;
85306 Key : in Key_Type)
85307 return Constant_Reference_Type;
85308
85309 41.12/3
85310 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
85311 function (combined with the Constant_Indexing and
85312 Implicit_Dereference aspects) provides a convenient way to
85313 gain read access to an individual element of a map given a key
85314 value.
85315
85316 41.13/3
85317 Equivalent to Constant_Reference (Container, Find (Container,
85318 Key)).
85319
85320 41.14/3
85321 function Reference (Container : aliased in out Map;
85322 Key : in Key_Type)
85323 return Reference_Type;
85324
85325 41.15/3
85326 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
85327 function (combined with the Variable_Indexing and
85328 Implicit_Dereference aspects) provides a convenient way to
85329 gain read and write access to an individual element of a map
85330 given a key value.
85331
85332 41.16/3
85333 Equivalent to Reference (Container, Find (Container, Key)).
85334
85335 41.17/3
85336 procedure Assign (Target : in out Map; Source : in Map);
85337
85338 41.18/3
85339 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} If Target
85340 denotes the same object as Source, the operation has no
85341 effect. Otherwise, the key/element pairs of Source are copied
85342 to Target as for an assignment_statement assigning Source to
85343 Target.
85344
85345 41.c/3
85346 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
85347 compatibility with the bounded map containers. For an
85348 unbounded map, Assign(A, B) and A := B behave identically.
85349 For a bounded map, := will raise an exception if the container
85350 capacities are different, while Assign will not raise an
85351 exception if there is enough room in the target.
85352
85353 42/2
85354 procedure Move (Target : in out Map;
85355 Source : in out Map);
85356
85357 43/3
85358 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1}
85359 {AI05-0248-1AI05-0248-1} {AI05-0262-1AI05-0262-1} If Target
85360 denotes the same object as Source, then the operation has no
85361 effect. Otherwise, the operation is equivalent to Assign
85362 (Target, Source) followed by Clear (Source).
85363
85364 44/2
85365 procedure Insert (Container : in out Map;
85366 Key : in Key_Type;
85367 New_Item : in Element_Type;
85368 Position : out Cursor;
85369 Inserted : out Boolean);
85370
85371 45/2
85372 {AI95-00302-03AI95-00302-03} Insert checks if a node with a
85373 key equivalent to Key is already present in Container. If a
85374 match is found, Inserted is set to False and Position
85375 designates the element with the matching key. Otherwise,
85376 Insert allocates a new node, initializes it to Key and
85377 New_Item, and adds it to Container; Inserted is set to True
85378 and Position designates the newly-inserted node. Any
85379 exception raised during allocation is propagated and Container
85380 is not modified.
85381
85382 46/2
85383 procedure Insert (Container : in out Map;
85384 Key : in Key_Type;
85385 Position : out Cursor;
85386 Inserted : out Boolean);
85387
85388 47/2
85389 {AI95-00302-03AI95-00302-03} Insert inserts Key into Container
85390 as per the five-parameter Insert, with the difference that an
85391 element initialized by default (see *note 3.3.1::) is
85392 inserted.
85393
85394 48/2
85395 procedure Insert (Container : in out Map;
85396 Key : in Key_Type;
85397 New_Item : in Element_Type);
85398
85399 49/2
85400 {AI95-00302-03AI95-00302-03} Insert inserts Key and New_Item
85401 into Container as per the five-parameter Insert, with the
85402 difference that if a node with a key equivalent to Key is
85403 already in the map, then Constraint_Error is propagated.
85404
85405 49.a/2
85406 Ramification: This is equivalent to:
85407
85408 49.b/2
85409 declare
85410 Inserted : Boolean; C : Cursor;
85411 begin
85412 Insert (Container, Key, New_Item, C, Inserted);
85413 if not Inserted then
85414 raise Constraint_Error;
85415 end if;
85416 end;
85417
85418 49.c/2
85419 but doesn't require the hassle of out parameters.
85420
85421 50/2
85422 procedure Include (Container : in out Map;
85423 Key : in Key_Type;
85424 New_Item : in Element_Type);
85425
85426 51/2
85427 {AI95-00302-03AI95-00302-03} Include inserts Key and New_Item
85428 into Container as per the five-parameter Insert, with the
85429 difference that if a node with a key equivalent to Key is
85430 already in the map, then this operation assigns Key and
85431 New_Item to the matching node. Any exception raised during
85432 assignment is propagated.
85433
85434 51.a/2
85435 Ramification: This is equivalent to:
85436
85437 51.b/2
85438 declare
85439 C : Cursor := Find (Container, Key);
85440 begin
85441 if C = No_Element then
85442 Insert (Container, Key, New_Item);
85443 else
85444 Replace (Container, Key, New_Item);
85445 end if;
85446 end;
85447
85448 51.c/2
85449 but this avoids doing the search twice.
85450
85451 52/2
85452 procedure Replace (Container : in out Map;
85453 Key : in Key_Type;
85454 New_Item : in Element_Type);
85455
85456 53/2
85457 {AI95-00302-03AI95-00302-03} Replace checks if a node with a
85458 key equivalent to Key is present in Container. If a match is
85459 found, Replace assigns Key and New_Item to the matching node;
85460 otherwise, Constraint_Error is propagated.
85461
85462 53.a/2
85463 Discussion: We update the key as well as the element, as the
85464 key might include additional information that does not
85465 participate in equivalence. If only the element needs to be
85466 updated, use Replace_Element (Find (Container, Key),
85467 New_Element).
85468
85469 54/2
85470 procedure Exclude (Container : in out Map;
85471 Key : in Key_Type);
85472
85473 55/2
85474 {AI95-00302-03AI95-00302-03} Exclude checks if a node with a
85475 key equivalent to Key is present in Container. If a match is
85476 found, Exclude removes the node from the map.
85477
85478 55.a/2
85479 Ramification: Exclude should work on an empty map; nothing
85480 happens in that case.
85481
85482 56/2
85483 procedure Delete (Container : in out Map;
85484 Key : in Key_Type);
85485
85486 57/2
85487 {AI95-00302-03AI95-00302-03} Delete checks if a node with a
85488 key equivalent to Key is present in Container. If a match is
85489 found, Delete removes the node from the map; otherwise,
85490 Constraint_Error is propagated.
85491
85492 58/2
85493 procedure Delete (Container : in out Map;
85494 Position : in out Cursor);
85495
85496 59/2
85497 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
85498 then Constraint_Error is propagated. If Position does not
85499 designate an element in Container, then Program_Error is
85500 propagated. Otherwise, Delete removes the node designated by
85501 Position from the map. Position is set to No_Element on
85502 return.
85503
85504 59.a/2
85505 Ramification: The check on Position checks that the cursor
85506 does not belong to some other map. This check implies that a
85507 reference to the map is included in the cursor value. This
85508 wording is not meant to require detection of dangling cursors;
85509 such cursors are defined to be invalid, which means that
85510 execution is erroneous, and any result is allowed (including
85511 not raising an exception).
85512
85513 60/2
85514 function First (Container : Map) return Cursor;
85515
85516 61/2
85517 {AI95-00302-03AI95-00302-03} If Length (Container) = 0, then
85518 First returns No_Element. Otherwise, First returns a cursor
85519 that designates the first node in Container.
85520
85521 62/2
85522 function Next (Position : Cursor) return Cursor;
85523
85524 63/2
85525 {AI95-00302-03AI95-00302-03} Returns a cursor that designates
85526 the successor of the node designated by Position. If Position
85527 designates the last node, then No_Element is returned. If
85528 Position equals No_Element, then No_Element is returned.
85529
85530 64/2
85531 procedure Next (Position : in out Cursor);
85532
85533 65/2
85534 {AI95-00302-03AI95-00302-03} Equivalent to Position := Next
85535 (Position).
85536
85537 66/2
85538 function Find (Container : Map;
85539 Key : Key_Type) return Cursor;
85540
85541 67/2
85542 {AI95-00302-03AI95-00302-03} If Length (Container) equals 0,
85543 then Find returns No_Element. Otherwise, Find checks if a
85544 node with a key equivalent to Key is present in Container. If
85545 a match is found, a cursor designating the matching node is
85546 returned; otherwise, No_Element is returned.
85547
85548 68/2
85549 function Element (Container : Map;
85550 Key : Key_Type) return Element_Type;
85551
85552 69/2
85553 {AI95-00302-03AI95-00302-03} Equivalent to Element (Find
85554 (Container, Key)).
85555
85556 70/2
85557 function Contains (Container : Map;
85558 Key : Key_Type) return Boolean;
85559
85560 71/2
85561 {AI95-00302-03AI95-00302-03} Equivalent to Find (Container,
85562 Key) /= No_Element.
85563
85564 Paragraphs 72 and 73 were moved above.
85565
85566 74/2
85567 procedure Iterate
85568 (Container : in Map;
85569 Process : not null access procedure (Position : in Cursor));
85570
85571 75/3
85572 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} Iterate
85573 calls Process.all with a cursor that designates each node in
85574 Container, starting with the first node and moving the cursor
85575 according to the successor relation. Tampering with the
85576 cursors of Container is prohibited during the execution of a
85577 call on Process.all. Any exception raised by Process.all is
85578 propagated.
85579
85580 75.a/2
85581 Implementation Note: The "tamper with cursors" check takes
85582 place when the operations that insert or delete elements, and
85583 so on, are called.
85584
85585 75.b/2
85586 See Iterate for vectors (*note A.18.2::) for a suggested
85587 implementation of the check.
85588
85589 _Bounded (Run-Time) Errors_
85590
85591 75.1/3
85592 {AI05-0022-1AI05-0022-1} {AI05-0248-1AI05-0248-1} It is a bounded error
85593 for the actual function associated with a generic formal subprogram,
85594 when called as part of an operation of a map package, to tamper with
85595 elements of any map parameter of the operation. Either Program_Error is
85596 raised, or the operation works as defined on the value of the map either
85597 prior to, or subsequent to, some or all of the modifications to the map.
85598
85599 75.2/3
85600 {AI05-0027-1AI05-0027-1} It is a bounded error to call any subprogram
85601 declared in the visible part of a map package when the associated
85602 container has been finalized. If the operation takes Container as an in
85603 out parameter, then it raises Constraint_Error or Program_Error.
85604 Otherwise, the operation either proceeds as it would for an empty
85605 container, or it raises Constraint_Error or Program_Error.
85606
85607 _Erroneous Execution_
85608
85609 76/2
85610 {AI95-00302-03AI95-00302-03} A Cursor value is invalid if any of the
85611 following have occurred since it was created:
85612
85613 77/2
85614 * The map that contains the node it designates has been finalized;
85615
85616 77.1/3
85617 * {AI05-0160-1AI05-0160-1} The map that contains the node it
85618 designates has been used as the Target of a call to Assign, or as
85619 the target of an assignment_statement;
85620
85621 78/2
85622 * The map that contains the node it designates has been used as the
85623 Source or Target of a call to Move; or
85624
85625 79/3
85626 * {AI05-0160-1AI05-0160-1} {AI05-0262-1AI05-0262-1} The node it
85627 designates has been removed from the map that previously contained
85628 the node.
85629
85630 79.a/3
85631 Ramification: {AI05-0160-1AI05-0160-1} This can happen
85632 directly via calls to Clear, Exclude, and Delete.
85633
85634 80/2
85635 The result of "=" or Has_Element is unspecified if these functions are
85636 called with an invalid cursor parameter. Execution is erroneous if any
85637 other subprogram declared in Containers.Hashed_Maps or
85638 Containers.Ordered_Maps is called with an invalid cursor parameter.
85639
85640 80.a/2
85641 Discussion: The list above is intended to be exhaustive. In
85642 other cases, a cursor value continues to designate its
85643 original element. For instance, cursor values survive the
85644 insertion and deletion of other nodes.
85645
85646 80.b/2
85647 While it is possible to check for these cases, in many cases
85648 the overhead necessary to make the check is substantial in
85649 time or space. Implementations are encouraged to check for as
85650 many of these cases as possible and raise Program_Error if
85651 detected.
85652
85653 80.1/3
85654 {AI05-0212-1AI05-0212-1} Execution is erroneous if the map associated
85655 with the result of a call to Reference or Constant_Reference is
85656 finalized before the result object returned by the call to Reference or
85657 Constant_Reference is finalized.
85658
85659 80.c/3
85660 Reason: Each object of Reference_Type and
85661 Constant_Reference_Type probably contains some reference to
85662 the originating container. If that container is prematurely
85663 finalized (which is only possible via Unchecked_Deallocation,
85664 as accessibility checks prevent passing a container to
85665 Reference that will not live as long as the result), the
85666 finalization of the object of Reference_Type will try to
85667 access a nonexistent object. This is a normal case of a
85668 dangling pointer created by Unchecked_Deallocation; we have to
85669 explicitly mention it here as the pointer in question is not
85670 visible in the specification of the type. (This is the same
85671 reason we have to say this for invalid cursors.)
85672
85673 _Implementation Requirements_
85674
85675 81/2
85676 {AI95-00302-03AI95-00302-03} No storage associated with a Map object
85677 shall be lost upon assignment or scope exit.
85678
85679 82/3
85680 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The execution of
85681 an assignment_statement for a map shall have the effect of copying the
85682 elements from the source map object to the target map object and
85683 changing the length of the target object to that of the source object.
85684
85685 82.a/3
85686 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
85687 a Map is a "deep" copy; that is the elements are copied as
85688 well as the data structures. We say "effect of" in order to
85689 allow the implementation to avoid copying elements immediately
85690 if it wishes. For instance, an implementation that avoided
85691 copying until one of the containers is modified would be
85692 allowed. (Note that this implementation would require care,
85693 see *note A.18.2:: for more.)
85694
85695 _Implementation Advice_
85696
85697 83/2
85698 {AI95-00302-03AI95-00302-03} Move should not copy elements, and should
85699 minimize copying of internal data structures.
85700
85701 83.a/2
85702 Implementation Advice: Move for a map should not copy
85703 elements, and should minimize copying of internal data
85704 structures.
85705
85706 83.b/2
85707 Implementation Note: Usually that can be accomplished simply
85708 by moving the pointer(s) to the internal data structures from
85709 the Source container to the Target container.
85710
85711 84/2
85712 {AI95-00302-03AI95-00302-03} If an exception is propagated from a map
85713 operation, no storage should be lost, nor any elements removed from a
85714 map unless specified by the operation.
85715
85716 84.a/2
85717 Implementation Advice: If an exception is propagated from a
85718 map operation, no storage should be lost, nor any elements
85719 removed from a map unless specified by the operation.
85720
85721 84.b/2
85722 Reason: This is important so that programs can recover from
85723 errors. But we don't want to require heroic efforts, so we
85724 just require documentation of cases where this can't be
85725 accomplished.
85726
85727 _Wording Changes from Ada 95_
85728
85729 84.c/2
85730 {AI95-00302-03AI95-00302-03} This description of maps is new;
85731 the extensions are documented with the specific packages.
85732
85733 _Extensions to Ada 2005_
85734
85735 84.d/3
85736 {AI05-0212-1AI05-0212-1} Added reference support to make map
85737 containers more convenient to use.
85738
85739 _Wording Changes from Ada 2005_
85740
85741 84.e/3
85742 {AI05-0001-1AI05-0001-1} Added procedure Assign; the extension
85743 and incompatibility is documented with the specific packages.
85744
85745 84.f/3
85746 {AI05-0001-1AI05-0001-1} Generalized the definition of Move.
85747 Specified which elements are read/written by stream
85748 attributes.
85749
85750 84.g/3
85751 {AI05-0022-1AI05-0022-1} Correction: Added a Bounded
85752 (Run-Time) Error to cover tampering by generic actual
85753 subprograms.
85754
85755 84.h/3
85756 {AI05-0027-1AI05-0027-1} Correction: Added a Bounded
85757 (Run-Time) Error to cover access to finalized map containers.
85758
85759 84.i/3
85760 {AI05-0160-1AI05-0160-1} Correction: Revised the definition of
85761 invalid cursors to cover missing (and new) cases.
85762
85763 84.j/3
85764 {AI05-0265-1AI05-0265-1} Correction: Defined when a container
85765 prohibits tampering in order to more clearly define where the
85766 check is made and the exception raised.
85767
85768 \1f
85769 File: aarm2012.info, Node: A.18.5, Next: A.18.6, Prev: A.18.4, Up: A.18
85770
85771 A.18.5 The Generic Package Containers.Hashed_Maps
85772 -------------------------------------------------
85773
85774 _Static Semantics_
85775
85776 1/2
85777 {AI95-00302-03AI95-00302-03} The generic library package
85778 Containers.Hashed_Maps has the following declaration:
85779
85780 2/3
85781 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
85782 generic
85783 type Key_Type is private;
85784 type Element_Type is private;
85785 with function Hash (Key : Key_Type) return Hash_Type;
85786 with function Equivalent_Keys (Left, Right : Key_Type)
85787 return Boolean;
85788 with function "=" (Left, Right : Element_Type)
85789 return Boolean is <>;
85790 package Ada.Containers.Hashed_Maps is
85791 pragma Preelaborate(Hashed_Maps);
85792 pragma Remote_Types(Hashed_Maps);
85793
85794 3/3
85795 {AI05-0212-1AI05-0212-1} type Map is tagged private
85796 with Constant_Indexing => Constant_Reference,
85797 Variable_Indexing => Reference,
85798 Default_Iterator => Iterate,
85799 Iterator_Element => Element_Type;
85800 pragma Preelaborable_Initialization(Map);
85801
85802 4/2
85803 type Cursor is private;
85804 pragma Preelaborable_Initialization(Cursor);
85805
85806 5/2
85807 Empty_Map : constant Map;
85808
85809 6/2
85810 No_Element : constant Cursor;
85811
85812 6.1/3
85813 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
85814
85815 6.2/3
85816 {AI05-0212-1AI05-0212-1} package Map_Iterator_Interfaces is new
85817 Ada.Iterator_Interfaces (Cursor, Has_Element);
85818
85819 7/2
85820 function "=" (Left, Right : Map) return Boolean;
85821
85822 8/2
85823 function Capacity (Container : Map) return Count_Type;
85824
85825 9/2
85826 procedure Reserve_Capacity (Container : in out Map;
85827 Capacity : in Count_Type);
85828
85829 10/2
85830 function Length (Container : Map) return Count_Type;
85831
85832 11/2
85833 function Is_Empty (Container : Map) return Boolean;
85834
85835 12/2
85836 procedure Clear (Container : in out Map);
85837
85838 13/2
85839 function Key (Position : Cursor) return Key_Type;
85840
85841 14/2
85842 function Element (Position : Cursor) return Element_Type;
85843
85844 15/2
85845 procedure Replace_Element (Container : in out Map;
85846 Position : in Cursor;
85847 New_Item : in Element_Type);
85848
85849 16/2
85850 procedure Query_Element
85851 (Position : in Cursor;
85852 Process : not null access procedure (Key : in Key_Type;
85853 Element : in Element_Type));
85854
85855 17/2
85856 procedure Update_Element
85857 (Container : in out Map;
85858 Position : in Cursor;
85859 Process : not null access procedure
85860 (Key : in Key_Type;
85861 Element : in out Element_Type));
85862
85863 17.1/3
85864 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
85865 (Element : not null access constant Element_Type) is private
85866 with Implicit_Dereference => Element;
85867
85868 17.2/3
85869 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
85870 with Implicit_Dereference => Element;
85871
85872 17.3/3
85873 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Map;
85874 Position : in Cursor)
85875 return Constant_Reference_Type;
85876
85877 17.4/3
85878 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Map;
85879 Position : in Cursor)
85880 return Reference_Type;
85881
85882 17.5/3
85883 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Map;
85884 Key : in Key_Type)
85885 return Constant_Reference_Type;
85886
85887 17.6/3
85888 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Map;
85889 Key : in Key_Type)
85890 return Reference_Type;
85891
85892 17.7/3
85893 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Map; Source : in Map);
85894
85895 17.8/3
85896 {AI05-0001-1AI05-0001-1} function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
85897
85898 18/2
85899 procedure Move (Target : in out Map;
85900 Source : in out Map);
85901
85902 19/2
85903 procedure Insert (Container : in out Map;
85904 Key : in Key_Type;
85905 New_Item : in Element_Type;
85906 Position : out Cursor;
85907 Inserted : out Boolean);
85908
85909 20/2
85910 procedure Insert (Container : in out Map;
85911 Key : in Key_Type;
85912 Position : out Cursor;
85913 Inserted : out Boolean);
85914
85915 21/2
85916 procedure Insert (Container : in out Map;
85917 Key : in Key_Type;
85918 New_Item : in Element_Type);
85919
85920 22/2
85921 procedure Include (Container : in out Map;
85922 Key : in Key_Type;
85923 New_Item : in Element_Type);
85924
85925 23/2
85926 procedure Replace (Container : in out Map;
85927 Key : in Key_Type;
85928 New_Item : in Element_Type);
85929
85930 24/2
85931 procedure Exclude (Container : in out Map;
85932 Key : in Key_Type);
85933
85934 25/2
85935 procedure Delete (Container : in out Map;
85936 Key : in Key_Type);
85937
85938 26/2
85939 procedure Delete (Container : in out Map;
85940 Position : in out Cursor);
85941
85942 27/2
85943 function First (Container : Map)
85944 return Cursor;
85945
85946 28/2
85947 function Next (Position : Cursor) return Cursor;
85948
85949 29/2
85950 procedure Next (Position : in out Cursor);
85951
85952 30/2
85953 function Find (Container : Map;
85954 Key : Key_Type)
85955 return Cursor;
85956
85957 31/2
85958 function Element (Container : Map;
85959 Key : Key_Type)
85960 return Element_Type;
85961
85962 32/2
85963 function Contains (Container : Map;
85964 Key : Key_Type) return Boolean;
85965
85966 33/3
85967 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
85968
85969 34/2
85970 function Equivalent_Keys (Left, Right : Cursor)
85971 return Boolean;
85972
85973 35/2
85974 function Equivalent_Keys (Left : Cursor;
85975 Right : Key_Type)
85976 return Boolean;
85977
85978 36/2
85979 function Equivalent_Keys (Left : Key_Type;
85980 Right : Cursor)
85981 return Boolean;
85982
85983 37/2
85984 procedure Iterate
85985 (Container : in Map;
85986 Process : not null access procedure (Position : in Cursor));
85987
85988 37.1/3
85989 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Map)
85990 return Map_Iterator_Interfaces.Forward_Iterator'Class;
85991
85992 38/2
85993 private
85994
85995 39/2
85996 ... -- not specified by the language
85997
85998 40/2
85999 end Ada.Containers.Hashed_Maps;
86000
86001 41/2
86002 {AI95-00302-03AI95-00302-03} An object of type Map contains an
86003 expandable hash table, which is used to provide direct access to nodes.
86004 The capacity of an object of type Map is the maximum number of nodes
86005 that can be inserted into the hash table prior to it being automatically
86006 expanded.
86007
86008 41.a/2
86009 Implementation Note: The expected implementation for a Map
86010 uses a hash table which is grown when it is too small, with
86011 linked lists hanging off of each bucket. Note that in that
86012 implementation a cursor needs a back pointer to the Map object
86013 to implement iteration; that could either be in the nodes, or
86014 in the cursor object. To provide an average O(1) access time,
86015 capacity would typically equal the number of buckets in such
86016 an implementation, so that the average bucket linked list
86017 length would be no more than 1.0.
86018
86019 41.b/2
86020 There is no defined relationship between elements in a hashed
86021 map. Typically, iteration will return elements in the order
86022 that they are hashed in.
86023
86024 42/2
86025 {AI95-00302-03AI95-00302-03} Two keys K1 and K2 are defined to be
86026 equivalent if Equivalent_Keys (K1, K2) returns True.
86027
86028 43/2
86029 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
86030 function Hash is expected to return the same value each time it is
86031 called with a particular key value. For any two equivalent key values,
86032 the actual for Hash is expected to return the same value. If the actual
86033 for Hash behaves in some other manner, the behavior of this package is
86034 unspecified. Which subprograms of this package call Hash, and how many
86035 times they call it, is unspecified.
86036
86037 43.a/2
86038 Implementation Note: The implementation is not required to
86039 protect against Hash raising an exception, or returning random
86040 numbers, or any other "bad" behavior. It's not practical to
86041 do so, and a broken Hash function makes the container
86042 unusable.
86043
86044 43.b/2
86045 The implementation can call Hash whenever it is needed; we
86046 don't want to specify how often that happens. The result must
86047 remain the same (this is logically a pure function), or the
86048 behavior is unspecified.
86049
86050 44/2
86051 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
86052 function Equivalent_Keys on Key_Type values is expected to return the
86053 same value each time it is called with a particular pair of key values.
86054 It should define an equivalence relationship, that is, be reflexive,
86055 symmetric, and transitive. If the actual for Equivalent_Keys behaves in
86056 some other manner, the behavior of this package is unspecified. Which
86057 subprograms of this package call Equivalent_Keys, and how many times
86058 they call it, is unspecified.
86059
86060 44.a/2
86061 Implementation Note: As with Hash, the implementation is not
86062 required to protect against Equivalent_Keys raising an
86063 exception or returning random results. Similarly, the
86064 implementation can call this operation whenever it is needed.
86065 The result must remain the same (this is a logically pure
86066 function), or the behavior is unspecified.
86067
86068 45/2
86069 {AI95-00302-03AI95-00302-03} If the value of a key stored in a node of a
86070 map is changed other than by an operation in this package such that at
86071 least one of Hash or Equivalent_Keys give different results, the
86072 behavior of this package is unspecified.
86073
86074 45.a/2
86075 Implementation Note: The implementation is not required to
86076 protect against changes to key values other than via the
86077 operations declared in the Hashed_Maps package.
86078
86079 45.b/2
86080 To see how this could happen, imagine an instance of
86081 Hashed_Maps where the key type is an access-to-variable type
86082 and Hash returns a value derived from the components of the
86083 designated object. Then, any operation that has a key value
86084 could modify those components and change the hash value:
86085
86086 45.c/2
86087 Key (Map).Some_Component := New_Value;
86088
86089 45.d/2
86090 This is really a design error on the part of the user of the
86091 map; it shouldn't be possible to modify keys stored in a map.
86092 But we can't prevent this error anymore than we can prevent
86093 someone passing as Hash a random number generator.
86094
86095 46/2
86096 {AI95-00302-03AI95-00302-03} Which nodes are the first node and the last
86097 node of a map, and which node is the successor of a given node, are
86098 unspecified, other than the general semantics described in *note
86099 A.18.4::.
86100
86101 46.a/2
86102 Implementation Note: Typically the first node will be the
86103 first node in the first bucket, the last node will be the last
86104 node in the last bucket, and the successor will be obtained by
86105 following the collision list, and going to the next bucket at
86106 the end of each bucket.
86107
86108 47/2
86109 function Capacity (Container : Map) return Count_Type;
86110
86111 48/2
86112 {AI95-00302-03AI95-00302-03} Returns the capacity of
86113 Container.
86114
86115 49/2
86116 procedure Reserve_Capacity (Container : in out Map;
86117 Capacity : in Count_Type);
86118
86119 50/2
86120 {AI95-00302-03AI95-00302-03} Reserve_Capacity allocates a new
86121 hash table such that the length of the resulting map can
86122 become at least the value Capacity without requiring an
86123 additional call to Reserve_Capacity, and is large enough to
86124 hold the current length of Container. Reserve_Capacity then
86125 rehashes the nodes in Container onto the new hash table. It
86126 replaces the old hash table with the new hash table, and then
86127 deallocates the old hash table. Any exception raised during
86128 allocation is propagated and Container is not modified.
86129
86130 51/2
86131 Reserve_Capacity tampers with the cursors of Container.
86132
86133 51.a/2
86134 Implementation Note: This routine is used to preallocate the
86135 internal hash table to the specified capacity such that future
86136 Inserts do not require expansion of the hash table.
86137 Therefore, the implementation should allocate the needed
86138 memory to make that true at this point, even though the
86139 visible semantics could be preserved by waiting until enough
86140 elements are inserted.
86141
86142 51.b/3
86143 {AI05-0005-1AI05-0005-1} While Reserve_Capacity can be used to
86144 reduce the capacity of a map, we do not specify whether an
86145 implementation actually supports reduction of the capacity.
86146 Since the actual capacity can be anything greater than or
86147 equal to Capacity, an implementation never has to reduce the
86148 capacity.
86149
86150 51.c/2
86151 Reserve_Capacity tampers with the cursors, as rehashing
86152 probably will change the order that elements are stored in the
86153 map.
86154
86155 52/2
86156 procedure Clear (Container : in out Map);
86157
86158 53/2
86159 {AI95-00302-03AI95-00302-03} In addition to the semantics
86160 described in *note A.18.4::, Clear does not affect the
86161 capacity of Container.
86162
86163 53.1/3
86164 procedure Assign (Target : in out Map; Source : in Map);
86165
86166 53.2/3
86167 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} In addition
86168 to the semantics described in *note A.18.4::, if the length of
86169 Source is greater than the capacity of Target,
86170 Reserve_Capacity (Target, Length (Source)) is called before
86171 assigning any elements.
86172
86173 53.3/3
86174 function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
86175
86176 53.4/3
86177 {AI05-0001-1AI05-0001-1} Returns a map whose keys and elements
86178 are initialized from the keys and elements of Source. If
86179 Capacity is 0, then the map capacity is the length of Source;
86180 if Capacity is equal to or greater than the length of Source,
86181 the map capacity is at least the specified value. Otherwise,
86182 the operation propagates Capacity_Error.
86183
86184 53.a/2
86185 Implementation Note: In:
86186
86187 53.b/2
86188 procedure Move (Target : in out Map;
86189 Source : in out Map);
86190
86191 53.c/2
86192 The intended implementation is that the internal hash table of
86193 Target is first deallocated; then the internal hash table is
86194 removed from Source and moved to Target.
86195
86196 54/2
86197 procedure Insert (Container : in out Map;
86198 Key : in Key_Type;
86199 New_Item : in Element_Type;
86200 Position : out Cursor;
86201 Inserted : out Boolean);
86202
86203 55/2
86204 {AI95-00302-03AI95-00302-03} In addition to the semantics
86205 described in *note A.18.4::, if Length (Container) equals
86206 Capacity (Container), then Insert first calls Reserve_Capacity
86207 to increase the capacity of Container to some larger value.
86208
86209 55.a/2
86210 Implementation Note: Insert should only compare keys that hash
86211 to the same bucket in the hash table.
86212
86213 55.b/2
86214 We specify when Reserve_Capacity is called to bound the
86215 overhead of capacity expansion operations (which are
86216 potentially expensive). Moreover, expansion can be predicted
86217 by comparing Capacity(Map) to Length(Map). Since we don't
86218 specify by how much the hash table is expanded, this only can
86219 be used to predict the next expansion, not later ones.
86220
86221 55.c/2
86222 Implementation Note: In:
86223
86224 55.d/2
86225 procedure Exclude (Container : in out Map;
86226 Key : in Key_Type);
86227
86228 55.e/2
86229 Exclude should only compare keys that hash to the same bucket
86230 in the hash table.
86231
86232 55.f/2
86233 Implementation Note: In:
86234
86235 55.g/2
86236 procedure Delete (Container : in out Map;
86237 Key : in Key_Type);
86238
86239 55.h/2
86240 Delete should only compare keys that hash to the same bucket
86241 in the hash table. The node containing the element may be
86242 deallocated now, or it may be saved and reused later.
86243
86244 55.i/2
86245 Implementation Note: In:
86246
86247 55.j/2
86248 function First (Container : Map) return Cursor;
86249
86250 55.k/2
86251 In a typical implementation, this will be the first node in
86252 the lowest numbered hash bucket that contains a node.
86253
86254 55.l/2
86255 Implementation Note: In:
86256
86257 55.m/2
86258 function Next (Position : Cursor) return Cursor;
86259
86260 55.n/2
86261 In a typical implementation, this will return the next node in
86262 a bucket; if Position is the last node in a bucket, this will
86263 return the first node in the next nonempty bucket.
86264
86265 55.o/2
86266 A typical implementation will need to a keep a pointer at the
86267 map container in the cursor in order to implement this
86268 function.
86269
86270 55.p/2
86271 Implementation Note: In:
86272
86273 55.q/2
86274 function Find (Container : Map;
86275 Key : Key_Type) return Cursor;
86276
86277 55.r/2
86278 Find should only compare keys that hash to the same bucket in
86279 the hash table.
86280
86281 56/2
86282 function Equivalent_Keys (Left, Right : Cursor)
86283 return Boolean;
86284
86285 57/2
86286 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Keys
86287 (Key (Left), Key (Right)).
86288
86289 58/2
86290 function Equivalent_Keys (Left : Cursor;
86291 Right : Key_Type) return Boolean;
86292
86293 59/2
86294 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Keys
86295 (Key (Left), Right).
86296
86297 60/2
86298 function Equivalent_Keys (Left : Key_Type;
86299 Right : Cursor) return Boolean;
86300
86301 61/2
86302 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Keys
86303 (Left, Key (Right)).
86304
86305 61.1/3
86306 function Iterate (Container : in Map)
86307 return Map_Iterator_Interfaces.Forward_Iterator'Class;
86308
86309 61.2/3
86310 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
86311 {AI05-0269-1AI05-0269-1} Iterate returns an iterator object
86312 (see *note 5.5.1::) that will generate a value for a loop
86313 parameter (see *note 5.5.2::) designating each node in
86314 Container, starting with the first node and moving the cursor
86315 according to the successor relation. Tampering with the
86316 cursors of Container is prohibited while the iterator object
86317 exists (in particular, in the sequence_of_statements of the
86318 loop_statement whose iterator_specification denotes this
86319 object). The iterator object needs finalization.
86320
86321 _Implementation Advice_
86322
86323 62/2
86324 {AI95-00302-03AI95-00302-03} If N is the length of a map, the average
86325 time complexity of the subprograms Element, Insert, Include, Replace,
86326 Delete, Exclude and Find that take a key parameter should be O(log N).
86327 The average time complexity of the subprograms that take a cursor
86328 parameter should be O(1). The average time complexity of
86329 Reserve_Capacity should be O(N).
86330
86331 62.a/2
86332 Implementation Advice: The average time complexity of Element,
86333 Insert, Include, Replace, Delete, Exclude and Find operations
86334 that take a key parameter for Containers.Hashed_Maps should be
86335 O(log N). The average time complexity of the subprograms of
86336 Containers.Hashed_Maps that take a cursor parameter should be
86337 O(1). The average time complexity of
86338 Containers.Hashed_Maps.Reserve_Capacity should be O(N).
86339
86340 62.b/2
86341 Reason: We do not mean to overly constrain implementation
86342 strategies here. However, it is important for portability
86343 that the performance of large containers has roughly the same
86344 factors on different implementations. If a program is moved
86345 to an implementation for which Find is O(N), that program
86346 could be unusable when the maps are large. We allow O(log N)
86347 access because the proportionality constant and caching
86348 effects are likely to be larger than the log factor, and we
86349 don't want to discourage innovative implementations.
86350
86351 _Extensions to Ada 95_
86352
86353 62.c/2
86354 {AI95-00302-03AI95-00302-03} The generic package
86355 Containers.Hashed_Maps is new.
86356
86357 _Incompatibilities With Ada 2005_
86358
86359 62.d/3
86360 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
86361 to Containers.Hashed_Maps. If an instance of
86362 Containers.Hashed_Maps is referenced in a use_clause, and an
86363 entity E with the same defining_identifier as a new entity in
86364 Containers.Hashed_Maps is defined in a package that is also
86365 referenced in a use_clause, the entity E may no longer be
86366 use-visible, resulting in errors. This should be rare and is
86367 easily fixed if it does occur.
86368
86369 _Extensions to Ada 2005_
86370
86371 62.e/3
86372 {AI05-0212-1AI05-0212-1} Added iterator and indexing support
86373 to make hashed map containers more convenient to use.
86374
86375 _Wording Changes from Ada 2005_
86376
86377 62.f/3
86378 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
86379 Remote_Types so that containers can be used in distributed
86380 programs.
86381
86382 \1f
86383 File: aarm2012.info, Node: A.18.6, Next: A.18.7, Prev: A.18.5, Up: A.18
86384
86385 A.18.6 The Generic Package Containers.Ordered_Maps
86386 --------------------------------------------------
86387
86388 _Static Semantics_
86389
86390 1/2
86391 {AI95-00302-03AI95-00302-03} The generic library package
86392 Containers.Ordered_Maps has the following declaration:
86393
86394 2/3
86395 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
86396 generic
86397 type Key_Type is private;
86398 type Element_Type is private;
86399 with function "<" (Left, Right : Key_Type) return Boolean is <>;
86400 with function "=" (Left, Right : Element_Type) return Boolean is <>;
86401 package Ada.Containers.Ordered_Maps is
86402 pragma Preelaborate(Ordered_Maps);
86403 pragma Remote_Types(Ordered_Maps);
86404
86405 3/2
86406 function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
86407
86408 4/3
86409 {AI05-0212-1AI05-0212-1} type Map is tagged private
86410 with Constant_Indexing => Constant_Reference,
86411 Variable_Indexing => Reference,
86412 Default_Iterator => Iterate,
86413 Iterator_Element => Element_Type;
86414 pragma Preelaborable_Initialization(Map);
86415
86416 5/2
86417 type Cursor is private;
86418 pragma Preelaborable_Initialization(Cursor);
86419
86420 6/2
86421 Empty_Map : constant Map;
86422
86423 7/2
86424 No_Element : constant Cursor;
86425
86426 7.1/3
86427 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
86428
86429 7.2/3
86430 {AI05-0212-1AI05-0212-1} package Map_Iterator_Interfaces is new
86431 Ada.Iterator_Interfaces (Cursor, Has_Element);
86432
86433 8/2
86434 function "=" (Left, Right : Map) return Boolean;
86435
86436 9/2
86437 function Length (Container : Map) return Count_Type;
86438
86439 10/2
86440 function Is_Empty (Container : Map) return Boolean;
86441
86442 11/2
86443 procedure Clear (Container : in out Map);
86444
86445 12/2
86446 function Key (Position : Cursor) return Key_Type;
86447
86448 13/2
86449 function Element (Position : Cursor) return Element_Type;
86450
86451 14/2
86452 procedure Replace_Element (Container : in out Map;
86453 Position : in Cursor;
86454 New_Item : in Element_Type);
86455
86456 15/2
86457 procedure Query_Element
86458 (Position : in Cursor;
86459 Process : not null access procedure (Key : in Key_Type;
86460 Element : in Element_Type));
86461
86462 16/2
86463 procedure Update_Element
86464 (Container : in out Map;
86465 Position : in Cursor;
86466 Process : not null access procedure
86467 (Key : in Key_Type;
86468 Element : in out Element_Type));
86469
86470 16.1/3
86471 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
86472 (Element : not null access constant Element_Type) is private
86473 with Implicit_Dereference => Element;
86474
86475 16.2/3
86476 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
86477 with Implicit_Dereference => Element;
86478
86479 16.3/3
86480 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Map;
86481 Position : in Cursor)
86482 return Constant_Reference_Type;
86483
86484 16.4/3
86485 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Map;
86486 Position : in Cursor)
86487 return Reference_Type;
86488
86489 16.5/3
86490 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Map;
86491 Key : in Key_Type)
86492 return Constant_Reference_Type;
86493
86494 16.6/3
86495 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Map;
86496 Key : in Key_Type)
86497 return Reference_Type;
86498
86499 16.7/3
86500 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Map; Source : in Map);
86501
86502 16.8/3
86503 {AI05-0001-1AI05-0001-1} function Copy (Source : Map) return Map;
86504
86505 17/2
86506 procedure Move (Target : in out Map;
86507 Source : in out Map);
86508
86509 18/2
86510 procedure Insert (Container : in out Map;
86511 Key : in Key_Type;
86512 New_Item : in Element_Type;
86513 Position : out Cursor;
86514 Inserted : out Boolean);
86515
86516 19/2
86517 procedure Insert (Container : in out Map;
86518 Key : in Key_Type;
86519 Position : out Cursor;
86520 Inserted : out Boolean);
86521
86522 20/2
86523 procedure Insert (Container : in out Map;
86524 Key : in Key_Type;
86525 New_Item : in Element_Type);
86526
86527 21/2
86528 procedure Include (Container : in out Map;
86529 Key : in Key_Type;
86530 New_Item : in Element_Type);
86531
86532 22/2
86533 procedure Replace (Container : in out Map;
86534 Key : in Key_Type;
86535 New_Item : in Element_Type);
86536
86537 23/2
86538 procedure Exclude (Container : in out Map;
86539 Key : in Key_Type);
86540
86541 24/2
86542 procedure Delete (Container : in out Map;
86543 Key : in Key_Type);
86544
86545 25/2
86546 procedure Delete (Container : in out Map;
86547 Position : in out Cursor);
86548
86549 26/2
86550 procedure Delete_First (Container : in out Map);
86551
86552 27/2
86553 procedure Delete_Last (Container : in out Map);
86554
86555 28/2
86556 function First (Container : Map) return Cursor;
86557
86558 29/2
86559 function First_Element (Container : Map) return Element_Type;
86560
86561 30/2
86562 function First_Key (Container : Map) return Key_Type;
86563
86564 31/2
86565 function Last (Container : Map) return Cursor;
86566
86567 32/2
86568 function Last_Element (Container : Map) return Element_Type;
86569
86570 33/2
86571 function Last_Key (Container : Map) return Key_Type;
86572
86573 34/2
86574 function Next (Position : Cursor) return Cursor;
86575
86576 35/2
86577 procedure Next (Position : in out Cursor);
86578
86579 36/2
86580 function Previous (Position : Cursor) return Cursor;
86581
86582 37/2
86583 procedure Previous (Position : in out Cursor);
86584
86585 38/2
86586 function Find (Container : Map;
86587 Key : Key_Type) return Cursor;
86588
86589 39/2
86590 function Element (Container : Map;
86591 Key : Key_Type) return Element_Type;
86592
86593 40/2
86594 function Floor (Container : Map;
86595 Key : Key_Type) return Cursor;
86596
86597 41/2
86598 function Ceiling (Container : Map;
86599 Key : Key_Type) return Cursor;
86600
86601 42/2
86602 function Contains (Container : Map;
86603 Key : Key_Type) return Boolean;
86604
86605 43/3
86606 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
86607
86608 44/2
86609 function "<" (Left, Right : Cursor) return Boolean;
86610
86611 45/2
86612 function ">" (Left, Right : Cursor) return Boolean;
86613
86614 46/2
86615 function "<" (Left : Cursor; Right : Key_Type) return Boolean;
86616
86617 47/2
86618 function ">" (Left : Cursor; Right : Key_Type) return Boolean;
86619
86620 48/2
86621 function "<" (Left : Key_Type; Right : Cursor) return Boolean;
86622
86623 49/2
86624 function ">" (Left : Key_Type; Right : Cursor) return Boolean;
86625
86626 50/2
86627 procedure Iterate
86628 (Container : in Map;
86629 Process : not null access procedure (Position : in Cursor));
86630
86631 51/2
86632 procedure Reverse_Iterate
86633 (Container : in Map;
86634 Process : not null access procedure (Position : in Cursor));
86635
86636 51.1/3
86637 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Map)
86638 return Map_Iterator_Interfaces.Reversible_Iterator'Class;
86639
86640 51.2/3
86641 {AI05-0262-1AI05-0262-1} function Iterate (Container : in Map; Start : in Cursor)
86642 return Map_Iterator_Interfaces.Reversible_Iterator'Class;
86643
86644 52/2
86645 private
86646
86647 53/2
86648 ... -- not specified by the language
86649
86650 54/2
86651 end Ada.Containers.Ordered_Maps;
86652
86653 55/2
86654 {AI95-00302-03AI95-00302-03} Two keys K1 and K2 are equivalent if both
86655 K1 < K2 and K2 < K1 return False, using the generic formal "<" operator
86656 for keys. Function Equivalent_Keys returns True if Left and Right are
86657 equivalent, and False otherwise.
86658
86659 56/3
86660 {AI95-00302-03AI95-00302-03} {AI05-0044-1AI05-0044-1} The actual
86661 function for the generic formal function "<" on Key_Type values is
86662 expected to return the same value each time it is called with a
86663 particular pair of key values. It should define a strict weak ordering
86664 relationship (see *note A.18::). If the actual for "<" behaves in some
86665 other manner, the behavior of this package is unspecified. Which
86666 subprograms of this package call "<" and how many times they call it, is
86667 unspecified.
86668
86669 56.a/2
86670 Implementation Note: The implementation is not required to
86671 protect against "<" raising an exception, or returning random
86672 results, or any other "bad" behavior. It's not practical to
86673 do so, and a broken "<" function makes the container unusable.
86674
86675 56.b/2
86676 The implementation can call "<" whenever it is needed; we
86677 don't want to specify how often that happens. The result must
86678 remain the same (this is a logically pure function), or the
86679 behavior is unspecified.
86680
86681 57/2
86682 {AI95-00302-03AI95-00302-03} If the value of a key stored in a map is
86683 changed other than by an operation in this package such that at least
86684 one of "<" or "=" give different results, the behavior of this package
86685 is unspecified.
86686
86687 57.a/2
86688 Implementation Note: The implementation is not required to
86689 protect against changes to key values other than via the
86690 operations declared in the Ordered_Maps package.
86691
86692 57.b/2
86693 To see how this could happen, imagine an instance of
86694 Ordered_Maps package where the key type is an
86695 access-to-variable type and "<" returns a value derived from
86696 comparing the components of the designated objects. Then, any
86697 operation that has a key value (even if the key value is
86698 constant) could modify those components and change the result
86699 of "<":
86700
86701 57.c/2
86702 Key (Map).Some_Component := New_Value;
86703
86704 57.d/2
86705 This is really a design error on the part of the user of the
86706 map; it shouldn't be possible to modify keys stored in a map
86707 such that "<" changes. But we can't prevent this error
86708 anymore than we can prevent someone passing as "<" a routine
86709 that produces random answers.
86710
86711 58/3
86712 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The first node of
86713 a nonempty map is the one whose key is less than the key of all the
86714 other nodes in the map. The last node of a nonempty map is the one
86715 whose key is greater than the key of all the other elements in the map.
86716 The successor of a node is the node with the smallest key that is larger
86717 than the key of the given node. The predecessor of a node is the node
86718 with the largest key that is smaller than the key of the given node.
86719 All comparisons are done using the generic formal "<" operator for keys.
86720
86721 58.1/3
86722 function Copy (Source : Map) return Map;
86723
86724 58.2/3
86725 {AI05-0001-1AI05-0001-1} Returns a map whose keys and elements
86726 are initialized from the corresponding keys and elements of
86727 Source.
86728
86729 59/2
86730 procedure Delete_First (Container : in out Map);
86731
86732 60/3
86733 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
86734 Container is empty, Delete_First has no effect. Otherwise,
86735 the node designated by First (Container) is removed from
86736 Container. Delete_First tampers with the cursors of
86737 Container.
86738
86739 61/2
86740 procedure Delete_Last (Container : in out Map);
86741
86742 62/3
86743 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
86744 Container is empty, Delete_Last has no effect. Otherwise, the
86745 node designated by Last (Container) is removed from Container.
86746 Delete_Last tampers with the cursors of Container.
86747
86748 63/2
86749 function First_Element (Container : Map) return Element_Type;
86750
86751 64/2
86752 {AI95-00302-03AI95-00302-03} Equivalent to Element (First
86753 (Container)).
86754
86755 65/2
86756 function First_Key (Container : Map) return Key_Type;
86757
86758 66/2
86759 {AI95-00302-03AI95-00302-03} Equivalent to Key (First
86760 (Container)).
86761
86762 67/2
86763 function Last (Container : Map) return Cursor;
86764
86765 68/2
86766 {AI95-00302-03AI95-00302-03} Returns a cursor that designates
86767 the last node in Container. If Container is empty, returns
86768 No_Element.
86769
86770 69/2
86771 function Last_Element (Container : Map) return Element_Type;
86772
86773 70/2
86774 {AI95-00302-03AI95-00302-03} Equivalent to Element (Last
86775 (Container)).
86776
86777 71/2
86778 function Last_Key (Container : Map) return Key_Type;
86779
86780 72/2
86781 {AI95-00302-03AI95-00302-03} Equivalent to Key (Last
86782 (Container)).
86783
86784 73/2
86785 function Previous (Position : Cursor) return Cursor;
86786
86787 74/3
86788 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} If
86789 Position equals No_Element, then Previous returns No_Element.
86790 Otherwise, Previous returns a cursor designating the
86791 predecessor node of the one designated by Position. If
86792 Position designates the first element, then Previous returns
86793 No_Element.
86794
86795 75/2
86796 procedure Previous (Position : in out Cursor);
86797
86798 76/2
86799 {AI95-00302-03AI95-00302-03} Equivalent to Position :=
86800 Previous (Position).
86801
86802 77/2
86803 function Floor (Container : Map;
86804 Key : Key_Type) return Cursor;
86805
86806 78/3
86807 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} Floor
86808 searches for the last node whose key is not greater than Key,
86809 using the generic formal "<" operator for keys. If such a
86810 node is found, a cursor that designates it is returned.
86811 Otherwise, No_Element is returned.
86812
86813 79/2
86814 function Ceiling (Container : Map;
86815 Key : Key_Type) return Cursor;
86816
86817 80/3
86818 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} Ceiling
86819 searches for the first node whose key is not less than Key,
86820 using the generic formal "<" operator for keys. If such a
86821 node is found, a cursor that designates it is returned.
86822 Otherwise, No_Element is returned.
86823
86824 81/2
86825 function "<" (Left, Right : Cursor) return Boolean;
86826
86827 82/2
86828 {AI95-00302-03AI95-00302-03} Equivalent to Key (Left) < Key
86829 (Right).
86830
86831 83/2
86832 function ">" (Left, Right : Cursor) return Boolean;
86833
86834 84/2
86835 {AI95-00302-03AI95-00302-03} Equivalent to Key (Right) < Key
86836 (Left).
86837
86838 85/2
86839 function "<" (Left : Cursor; Right : Key_Type) return Boolean;
86840
86841 86/2
86842 {AI95-00302-03AI95-00302-03} Equivalent to Key (Left) < Right.
86843
86844 87/2
86845 function ">" (Left : Cursor; Right : Key_Type) return Boolean;
86846
86847 88/2
86848 {AI95-00302-03AI95-00302-03} Equivalent to Right < Key (Left).
86849
86850 89/2
86851 function "<" (Left : Key_Type; Right : Cursor) return Boolean;
86852
86853 90/2
86854 {AI95-00302-03AI95-00302-03} Equivalent to Left < Key (Right).
86855
86856 91/2
86857 function ">" (Left : Key_Type; Right : Cursor) return Boolean;
86858
86859 92/2
86860 {AI95-00302-03AI95-00302-03} Equivalent to Key (Right) < Left.
86861
86862 93/2
86863 procedure Reverse_Iterate
86864 (Container : in Map;
86865 Process : not null access procedure (Position : in Cursor));
86866
86867 94/3
86868 {AI95-00302-03AI95-00302-03} {AI05-0212-1AI05-0212-1} Iterates
86869 over the nodes in Container as per procedure Iterate, with the
86870 difference that the nodes are traversed in predecessor order,
86871 starting with the last node.
86872
86873 94.1/3
86874 function Iterate (Container : in Map)
86875 return Map_Iterator_Interfaces.Reversible_Iterator'Class;
86876
86877 94.2/3
86878 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
86879 {AI05-0269-1AI05-0269-1} Iterate returns a reversible iterator
86880 object (see *note 5.5.1::) that will generate a value for a
86881 loop parameter (see *note 5.5.2::) designating each node in
86882 Container, starting with the first node and moving the cursor
86883 according to the successor relation when used as a forward
86884 iterator, and starting with the last node and moving the
86885 cursor according to the predecessor relation when used as a
86886 reverse iterator. Tampering with the cursors of Container is
86887 prohibited while the iterator object exists (in particular, in
86888 the sequence_of_statements of the loop_statement whose
86889 iterator_specification denotes this object). The iterator
86890 object needs finalization.
86891
86892 94.3/3
86893 function Iterate (Container : in Map; Start : in Cursor)
86894 return Map_Iterator_Interfaces.Reversible_Iterator'Class;
86895
86896 94.4/3
86897 {AI05-0262-1AI05-0262-1} {AI05-0265-1AI05-0265-1}
86898 {AI05-0269-1AI05-0269-1} If Start is not No_Element and does
86899 not designate an item in Container, then Program_Error is
86900 propagated. If Start is No_Element, then Constraint_Error is
86901 propagated. Otherwise, Iterate returns a reversible iterator
86902 object (see *note 5.5.1::) that will generate a value for a
86903 loop parameter (see *note 5.5.2::) designating each node in
86904 Container, starting with the node designated by Start and
86905 moving the cursor according to the successor relation when
86906 used as a forward iterator, or moving the cursor according to
86907 the predecessor relation when used as a reverse iterator.
86908 Tampering with the cursors of Container is prohibited while
86909 the iterator object exists (in particular, in the
86910 sequence_of_statements of the loop_statement whose
86911 iterator_specification denotes this object). The iterator
86912 object needs finalization.
86913
86914 94.a/3
86915 Discussion: Exits are allowed from the loops created using the
86916 iterator objects. In particular, to stop the iteration at a
86917 particular cursor, just add
86918
86919 94.b/3
86920 exit when Cur = Stop;
86921
86922 94.c/3
86923 in the body of the loop (assuming that Cur is the loop
86924 parameter and Stop is the cursor that you want to stop at).
86925
86926 _Implementation Advice_
86927
86928 95/2
86929 {AI95-00302-03AI95-00302-03} If N is the length of a map, then the
86930 worst-case time complexity of the Element, Insert, Include, Replace,
86931 Delete, Exclude and Find operations that take a key parameter should be
86932 O((log N)**2) or better. The worst-case time complexity of the
86933 subprograms that take a cursor parameter should be O(1).
86934
86935 95.a/2
86936 Implementation Advice: The worst-case time complexity of
86937 Element, Insert, Include, Replace, Delete, Exclude and Find
86938 operations that take a key parameter for
86939 Containers.Ordered_Maps should be O((log N)**2) or better.
86940 The worst-case time complexity of the subprograms of
86941 Containers.Ordered_Maps that take a cursor parameter should be
86942 O(1).
86943
86944 95.b/2
86945 Implementation Note: A balanced (red-black) tree for keys has
86946 O(log N) worst-case performance. Note that a O(N) worst-case
86947 implementation (like a list) would be wrong.
86948
86949 95.c/2
86950 Reason: We do not mean to overly constrain implementation
86951 strategies here. However, it is important for portability
86952 that the performance of large containers has roughly the same
86953 factors on different implementations. If a program is moved
86954 to an implementation that takes O(N) to find elements, that
86955 program could be unusable when the maps are large. We allow
86956 the extra log N factors because the proportionality constant
86957 and caching effects are likely to be larger than the log
86958 factor, and we don't want to discourage innovative
86959 implementations.
86960
86961 _Extensions to Ada 95_
86962
86963 95.d/2
86964 {AI95-00302-03AI95-00302-03} The generic package
86965 Containers.Ordered_Maps is new.
86966
86967 _Incompatibilities With Ada 2005_
86968
86969 95.e/3
86970 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
86971 to Containers.Ordered_Maps. If an instance of
86972 Containers.Ordered_Maps is referenced in a use_clause, and an
86973 entity E with the same defining_identifier as a new entity in
86974 Containers.Ordered_Maps is defined in a package that is also
86975 referenced in a use_clause, the entity E may no longer be
86976 use-visible, resulting in errors. This should be rare and is
86977 easily fixed if it does occur.
86978
86979 _Extensions to Ada 2005_
86980
86981 95.f/3
86982 {AI05-0212-1AI05-0212-1} Added iterator and indexing support
86983 to make ordered map containers more convenient to use.
86984
86985 _Wording Changes from Ada 2005_
86986
86987 95.g/3
86988 {AI05-0044-1AI05-0044-1} Correction: Redefined "<" actuals to
86989 require a strict weak ordering; the old definition allowed
86990 indeterminant comparisons that would not have worked in a
86991 container.
86992
86993 95.h/3
86994 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
86995 Remote_Types so that containers can be used in distributed
86996 programs.
86997
86998 \1f
86999 File: aarm2012.info, Node: A.18.7, Next: A.18.8, Prev: A.18.6, Up: A.18
87000
87001 A.18.7 Sets
87002 -----------
87003
87004 1/2
87005 {AI95-00302-03AI95-00302-03} The language-defined generic packages
87006 Containers.Hashed_Sets and Containers.Ordered_Sets provide private types
87007 Set and Cursor, and a set of operations for each type. A set container
87008 allows elements of an arbitrary type to be stored without duplication.
87009 A hashed set uses a hash function to organize elements, while an ordered
87010 set orders its element per a specified relation.
87011
87012 2/3
87013 {AI95-00302-03AI95-00302-03} {AI05-0299-1AI05-0299-1} This subclause
87014 describes the declarations that are common to both kinds of sets. See
87015 *note A.18.8:: for a description of the semantics specific to
87016 Containers.Hashed_Sets and *note A.18.9:: for a description of the
87017 semantics specific to Containers.Ordered_Sets.
87018
87019 _Static Semantics_
87020
87021 3/2
87022 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
87023 function "=" on Element_Type values is expected to define a reflexive
87024 and symmetric relationship and return the same result value each time it
87025 is called with a particular pair of values. If it behaves in some other
87026 manner, the function "=" on set values returns an unspecified value.
87027 The exact arguments and number of calls of this generic formal function
87028 by the function "=" on set values are unspecified.
87029
87030 3.a/2
87031 Ramification: If the actual function for "=" is not symmetric
87032 and consistent, the result returned by the "=" for Set objects
87033 cannot be predicted. The implementation is not required to
87034 protect against "=" raising an exception, or returning random
87035 results, or any other "bad" behavior. And it can call "=" in
87036 whatever manner makes sense. But note that only the result of
87037 "=" for Set objects is unspecified; other subprograms are not
87038 allowed to break if "=" is bad (they aren't expected to use
87039 "=").
87040
87041 4/2
87042 {AI95-00302-03AI95-00302-03} The type Set is used to represent sets.
87043 The type Set needs finalization (see *note 7.6::).
87044
87045 5/2
87046 {AI95-00302-03AI95-00302-03} A set contains elements. Set cursors
87047 designate elements. There exists an equivalence relation on elements,
87048 whose definition is different for hashed sets and ordered sets. A set
87049 never contains two or more equivalent elements. The length of a set is
87050 the number of elements it contains.
87051
87052 6/2
87053 {AI95-00302-03AI95-00302-03} Each nonempty set has two particular
87054 elements called the first element and the last element (which may be the
87055 same). Each element except for the last element has a successor
87056 element. If there are no other intervening operations, starting with
87057 the first element and repeatedly going to the successor element will
87058 visit each element in the set exactly once until the last element is
87059 reached. The exact definition of these terms is different for hashed
87060 sets and ordered sets.
87061
87062 7/2
87063 {AI95-00302-03AI95-00302-03} [Some operations of these generic packages
87064 have access-to-subprogram parameters. To ensure such operations are
87065 well-defined, they guard against certain actions by the designated
87066 subprogram. In particular, some operations check for "tampering with
87067 cursors" of a container because they depend on the set of elements of
87068 the container remaining constant, and others check for "tampering with
87069 elements" of a container because they depend on elements of the
87070 container not being replaced.]
87071
87072 8/2
87073 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with cursors
87074 of a set object S if:
87075
87076 9/2
87077 * it inserts or deletes elements of S, that is, it calls the Insert,
87078 Include, Clear, Delete, Exclude, or Replace_Element procedures with
87079 S as a parameter; or
87080
87081 9.a/2
87082 To be honest: Operations which are defined to be equivalent to
87083 a call on one of these operations also are included.
87084 Similarly, operations which call one of these as part of their
87085 definition are included.
87086
87087 9.b/2
87088 Discussion: We have to include Replace_Element here because it
87089 might delete and reinsert the element if it moves in the set.
87090 That could change the order of iteration, which is what this
87091 check is designed to prevent. Replace is also included, as it
87092 is defined in terms of Replace_Element.
87093
87094 10/2
87095 * it finalizes S; or
87096
87097 10.1/3
87098 * {AI05-0001-1AI05-0001-1} it calls the Assign procedure with S as
87099 the Target parameter; or
87100
87101 10.a/3
87102 Ramification: We don't need to explicitly mention
87103 assignment_statement, because that finalizes the target object
87104 as part of the operation, and finalization of an object is
87105 already defined as tampering with cursors.
87106
87107 11/2
87108 * it calls the Move procedure with S as a parameter; or
87109
87110 12/2
87111 * it calls one of the operations defined to tamper with cursors of S.
87112
87113 13/2
87114 {AI95-00302-03AI95-00302-03} A subprogram is said to tamper with
87115 elements of a set object S if:
87116
87117 14/2
87118 * it tampers with cursors of S.
87119
87120 14.a/2
87121 Reason: Complete replacement of an element can cause its
87122 memory to be deallocated while another operation is holding
87123 onto a reference to it. That can't be allowed. However, a
87124 simple modification of (part of) an element is not a problem,
87125 so Update_Element_Preserving_Key does not cause a problem.
87126
87127 14.b/2
87128 We don't need to list Replace and Replace_Element here because
87129 they are covered by "tamper with cursors". For Set, "tamper
87130 with cursors" and "tamper with elements" are the same. We
87131 leave both terms so that the rules for routines like Iterate
87132 and Query_Element are consistent across all containers.
87133
87134 14.1/3
87135 {AI05-0265-1AI05-0265-1} When tampering with cursors is prohibited for a
87136 particular set object S, Program_Error is propagated by a call of any
87137 language-defined subprogram that is defined to tamper with the cursors
87138 of S, leaving S unmodified. Similarly, when tampering with elements is
87139 prohibited for a particular set object S, Program_Error is propagated by
87140 a call of any language-defined subprogram that is defined to tamper with
87141 the elements of S [(or tamper with the cursors of S)], leaving S
87142 unmodified.
87143
87144 14.c/3
87145 Proof: Tampering with elements includes tampering with
87146 cursors, so we mention it only from completeness in the second
87147 sentence.
87148
87149 15/2
87150 {AI95-00302-03AI95-00302-03} Empty_Set represents the empty Set object.
87151 It has a length of 0. If an object of type Set is not otherwise
87152 initialized, it is initialized to the same value as Empty_Set.
87153
87154 16/2
87155 {AI95-00302-03AI95-00302-03} No_Element represents a cursor that
87156 designates no element. If an object of type Cursor is not otherwise
87157 initialized, it is initialized to the same value as No_Element.
87158
87159 17/2
87160 {AI95-00302-03AI95-00302-03} The predefined "=" operator for type Cursor
87161 returns True if both cursors are No_Element, or designate the same
87162 element in the same container.
87163
87164 18/2
87165 {AI95-00302-03AI95-00302-03} Execution of the default implementation of
87166 the Input, Output, Read, or Write attribute of type Cursor raises
87167 Program_Error.
87168
87169 18.a/2
87170 Reason: A cursor will probably be implemented in terms of one
87171 or more access values, and the effects of streaming access
87172 values is unspecified. Rather than letting the user stream
87173 junk by accident, we mandate that streaming of cursors raise
87174 Program_Error by default. The attributes can always be
87175 specified if there is a need to support streaming.
87176
87177 18.1/3
87178 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Set'Write for a Set
87179 object S writes Length(S) elements of the set to the stream. It also
87180 may write additional information about the set.
87181
87182 18.2/3
87183 {AI05-0001-1AI05-0001-1} {AI05-0262-1AI05-0262-1} Set'Read reads the
87184 representation of a set from the stream, and assigns to Item a set with
87185 the same length and elements as was written by Set'Write.
87186
87187 18.b/3
87188 Ramification: Streaming more elements than the container
87189 length is wrong. For implementation implications of this
87190 rule, see the Implementation Note in *note A.18.2::.
87191
87192 18.3/3
87193 function Has_Element (Position : Cursor) return Boolean;
87194
87195 18.4/3
87196 {AI05-0212-1AI05-0212-1} Returns True if Position designates
87197 an element, and returns False otherwise.
87198
87199 18.c/3
87200 To be honest: {AI05-0005-1AI05-0005-1}
87201 {AI05-0212-1AI05-0212-1} This function might not detect
87202 cursors that designate deleted elements; such cursors are
87203 invalid (see below) and the result of calling Has_Element with
87204 an invalid cursor is unspecified (but not erroneous).
87205
87206 19/2
87207 function "=" (Left, Right : Set) return Boolean;
87208
87209 20/2
87210 {AI95-00302-03AI95-00302-03} If Left and Right denote the same
87211 set object, then the function returns True. If Left and Right
87212 have different lengths, then the function returns False.
87213 Otherwise, for each element E in Left, the function returns
87214 False if an element equal to E (using the generic formal
87215 equality operator) is not present in Right. If the function
87216 has not returned a result after checking all of the elements,
87217 it returns True. Any exception raised during evaluation of
87218 element equality is propagated.
87219
87220 20.a/2
87221 Implementation Note: This wording describes the canonical
87222 semantics. However, the order and number of calls on the
87223 formal equality function is unspecified for all of the
87224 operations that use it in this package, so an implementation
87225 can call it as many or as few times as it needs to get the
87226 correct answer. Specifically, there is no requirement to call
87227 the formal equality additional times once the answer has been
87228 determined.
87229
87230 21/2
87231 function Equivalent_Sets (Left, Right : Set) return Boolean;
87232
87233 22/2
87234 {AI95-00302-03AI95-00302-03} If Left and Right denote the same
87235 set object, then the function returns True. If Left and Right
87236 have different lengths, then the function returns False.
87237 Otherwise, for each element E in Left, the function returns
87238 False if an element equivalent to E is not present in Right.
87239 If the function has not returned a result after checking all
87240 of the elements, it returns True. Any exception raised during
87241 evaluation of element equivalence is propagated.
87242
87243 23/2
87244 function To_Set (New_Item : Element_Type) return Set;
87245
87246 24/2
87247 {AI95-00302-03AI95-00302-03} Returns a set containing the
87248 single element New_Item.
87249
87250 25/2
87251 function Length (Container : Set) return Count_Type;
87252
87253 26/2
87254 {AI95-00302-03AI95-00302-03} Returns the number of elements in
87255 Container.
87256
87257 27/2
87258 function Is_Empty (Container : Set) return Boolean;
87259
87260 28/2
87261 {AI95-00302-03AI95-00302-03} Equivalent to Length (Container)
87262 = 0.
87263
87264 29/2
87265 procedure Clear (Container : in out Set);
87266
87267 30/2
87268 {AI95-00302-03AI95-00302-03} Removes all the elements from
87269 Container.
87270
87271 31/2
87272 function Element (Position : Cursor) return Element_Type;
87273
87274 32/2
87275 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
87276 then Constraint_Error is propagated. Otherwise, Element
87277 returns the element designated by Position.
87278
87279 33/2
87280 procedure Replace_Element (Container : in out Set;
87281 Position : in Cursor;
87282 New_Item : in Element_Type);
87283
87284 34/2
87285 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
87286 then Constraint_Error is propagated; if Position does not
87287 designate an element in Container, then Program_Error is
87288 propagated. If an element equivalent to New_Item is already
87289 present in Container at a position other than Position,
87290 Program_Error is propagated. Otherwise, Replace_Element
87291 assigns New_Item to the element designated by Position. Any
87292 exception raised by the assignment is propagated.
87293
87294 34.a/2
87295 Implementation Note: The final assignment may require that the
87296 node of the element be moved in the Set's data structures.
87297 That could mean that implementing this operation exactly as
87298 worded above could require the overhead of searching twice.
87299 Implementations are encouraged to avoid this extra overhead
87300 when possible, by prechecking if the old element is equivalent
87301 to the new one, by inserting a placeholder node while checking
87302 for an equivalent element, and similar optimizations.
87303
87304 34.b/2
87305 The cursor still designates the same element after this
87306 operation; only the value of that element has changed.
87307 Cursors cannot include information about the relative position
87308 of an element in a Set (as they must survive insertions and
87309 deletions of other elements), so this should not pose an
87310 implementation hardship.
87311
87312 35/2
87313 procedure Query_Element
87314 (Position : in Cursor;
87315 Process : not null access procedure (Element : in Element_Type));
87316
87317 36/3
87318 {AI95-00302-03AI95-00302-03} {AI05-0021-1AI05-0021-1}
87319 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
87320 Constraint_Error is propagated. Otherwise, Query_Element
87321 calls Process.all with the element designated by Position as
87322 the argument. Tampering with the elements of the set that
87323 contains the element designated by Position is prohibited
87324 during the execution of the call on Process.all. Any
87325 exception raised by Process.all is propagated.
87326
87327 36.1/3
87328 type Constant_Reference_Type
87329 (Element : not null access constant Element_Type) is private
87330 with Implicit_Dereference => Element;
87331
87332 36.2/3
87333 {AI05-0212-1AI05-0212-1} The type Constant_Reference_Type
87334 needs finalization.
87335
87336 36.3/3
87337 The default initialization of an object of type
87338 Constant_Reference_Type propagates Program_Error.
87339
87340 36.a/3
87341 Reason: It is expected that Constant_Reference_Type will be a
87342 controlled type, for which finalization will have some action
87343 to terminate the tampering check for the associated container.
87344 If the object is created by default, however, there is no
87345 associated container. Since this is useless, and supporting
87346 this case would take extra work, we define it to raise an
87347 exception.
87348
87349 36.4/3
87350 function Constant_Reference (Container : aliased in Set;
87351 Position : in Cursor)
87352 return Constant_Reference_Type;
87353
87354 36.5/3
87355 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
87356 function (combined with the Constant_Indexing and
87357 Implicit_Dereference aspects) provides a convenient way to
87358 gain read access to an individual element of a set given a
87359 cursor.
87360
87361 36.6/3
87362 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
87363 equals No_Element, then Constraint_Error is propagated; if
87364 Position does not designate an element in Container, then
87365 Program_Error is propagated. Otherwise, Constant_Reference
87366 returns an object whose discriminant is an access value that
87367 designates the element designated by Position. Tampering with
87368 the elements of Container is prohibited while the object
87369 returned by Constant_Reference exists and has not been
87370 finalized.
87371
87372 36.7/3
87373 procedure Assign (Target : in out Set; Source : in Set);
87374
87375 36.8/3
87376 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} If Target
87377 denotes the same object as Source, the operation has no
87378 effect. Otherwise, the elements of Source are copied to
87379 Target as for an assignment_statement assigning Source to
87380 Target.
87381
87382 36.b/3
87383 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
87384 compatibility with the bounded set containers. For an
87385 unbounded set, Assign(A, B) and A := B behave identically.
87386 For a bounded set, := will raise an exception if the container
87387 capacities are different, while Assign will not raise an
87388 exception if there is enough room in the target.
87389
87390 37/2
87391 procedure Move (Target : in out Set;
87392 Source : in out Set);
87393
87394 38/3
87395 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1}
87396 {AI05-0248-1AI05-0248-1} {AI05-0262-1AI05-0262-1} If Target
87397 denotes the same object as Source, then the operation has no
87398 effect. Otherwise, the operation is equivalent to Assign
87399 (Target, Source) followed by Clear (Source).
87400
87401 39/2
87402 procedure Insert (Container : in out Set;
87403 New_Item : in Element_Type;
87404 Position : out Cursor;
87405 Inserted : out Boolean);
87406
87407 40/2
87408 {AI95-00302-03AI95-00302-03} Insert checks if an element
87409 equivalent to New_Item is already present in Container. If a
87410 match is found, Inserted is set to False and Position
87411 designates the matching element. Otherwise, Insert adds
87412 New_Item to Container; Inserted is set to True and Position
87413 designates the newly-inserted element. Any exception raised
87414 during allocation is propagated and Container is not modified.
87415
87416 41/2
87417 procedure Insert (Container : in out Set;
87418 New_Item : in Element_Type);
87419
87420 42/2
87421 {AI95-00302-03AI95-00302-03} Insert inserts New_Item into
87422 Container as per the four-parameter Insert, with the
87423 difference that if an element equivalent to New_Item is
87424 already in the set, then Constraint_Error is propagated.
87425
87426 42.a/2
87427 Discussion: This is equivalent to:
87428
87429 42.b/2
87430 declare
87431 Inserted : Boolean; C : Cursor;
87432 begin
87433 Insert (Container, New_Item, C, Inserted);
87434 if not Inserted then
87435 raise Constraint_Error;
87436 end if;
87437 end;
87438
87439 42.c/2
87440 but doesn't require the hassle of out parameters.
87441
87442 43/2
87443 procedure Include (Container : in out Set;
87444 New_Item : in Element_Type);
87445
87446 44/2
87447 {AI95-00302-03AI95-00302-03} Include inserts New_Item into
87448 Container as per the four-parameter Insert, with the
87449 difference that if an element equivalent to New_Item is
87450 already in the set, then it is replaced. Any exception raised
87451 during assignment is propagated.
87452
87453 45/2
87454 procedure Replace (Container : in out Set;
87455 New_Item : in Element_Type);
87456
87457 46/2
87458 {AI95-00302-03AI95-00302-03} Replace checks if an element
87459 equivalent to New_Item is already in the set. If a match is
87460 found, that element is replaced with New_Item; otherwise,
87461 Constraint_Error is propagated.
87462
87463 47/2
87464 procedure Exclude (Container : in out Set;
87465 Item : in Element_Type);
87466
87467 48/2
87468 {AI95-00302-03AI95-00302-03} Exclude checks if an element
87469 equivalent to Item is present in Container. If a match is
87470 found, Exclude removes the element from the set.
87471
87472 49/2
87473 procedure Delete (Container : in out Set;
87474 Item : in Element_Type);
87475
87476 50/2
87477 {AI95-00302-03AI95-00302-03} Delete checks if an element
87478 equivalent to Item is present in Container. If a match is
87479 found, Delete removes the element from the set; otherwise,
87480 Constraint_Error is propagated.
87481
87482 51/2
87483 procedure Delete (Container : in out Set;
87484 Position : in out Cursor);
87485
87486 52/2
87487 {AI95-00302-03AI95-00302-03} If Position equals No_Element,
87488 then Constraint_Error is propagated. If Position does not
87489 designate an element in Container, then Program_Error is
87490 propagated. Otherwise, Delete removes the element designated
87491 by Position from the set. Position is set to No_Element on
87492 return.
87493
87494 52.a/2
87495 Ramification: The check on Position checks that the cursor
87496 does not belong to some other set. This check implies that a
87497 reference to the set is included in the cursor value. This
87498 wording is not meant to require detection of dangling cursors;
87499 such cursors are defined to be invalid, which means that
87500 execution is erroneous, and any result is allowed (including
87501 not raising an exception).
87502
87503 53/2
87504 procedure Union (Target : in out Set;
87505 Source : in Set);
87506
87507 54/2
87508 {AI95-00302-03AI95-00302-03} Union inserts into Target the
87509 elements of Source that are not equivalent to some element
87510 already in Target.
87511
87512 54.a/2
87513 Implementation Note: If the objects are the same, the result
87514 is the same as the original object. The implementation needs
87515 to take care so that aliasing effects do not make the result
87516 trash; Union (S, S); must work.
87517
87518 55/2
87519 function Union (Left, Right : Set) return Set;
87520
87521 56/2
87522 {AI95-00302-03AI95-00302-03} Returns a set comprising all of
87523 the elements of Left, and the elements of Right that are not
87524 equivalent to some element of Left.
87525
87526 57/2
87527 procedure Intersection (Target : in out Set;
87528 Source : in Set);
87529
87530 58/3
87531 {AI95-00302-03AI95-00302-03} {AI05-0004-1AI05-0004-1}
87532 Intersection deletes from Target the elements of Target that
87533 are not equivalent to some element of Source.
87534
87535 58.a/2
87536 Implementation Note: If the objects are the same, the result
87537 is the same as the original object. The implementation needs
87538 to take care so that aliasing effects do not make the result
87539 trash; Intersection (S, S); must work.
87540
87541 59/2
87542 function Intersection (Left, Right : Set) return Set;
87543
87544 60/2
87545 {AI95-00302-03AI95-00302-03} Returns a set comprising all the
87546 elements of Left that are equivalent to the some element of
87547 Right.
87548
87549 61/2
87550 procedure Difference (Target : in out Set;
87551 Source : in Set);
87552
87553 62/2
87554 {AI95-00302-03AI95-00302-03} If Target denotes the same object
87555 as Source, then Difference clears Target. Otherwise, it
87556 deletes from Target the elements that are equivalent to some
87557 element of Source.
87558
87559 63/2
87560 function Difference (Left, Right : Set) return Set;
87561
87562 64/2
87563 {AI95-00302-03AI95-00302-03} Returns a set comprising the
87564 elements of Left that are not equivalent to some element of
87565 Right.
87566
87567 65/2
87568 procedure Symmetric_Difference (Target : in out Set;
87569 Source : in Set);
87570
87571 66/2
87572 {AI95-00302-03AI95-00302-03} If Target denotes the same object
87573 as Source, then Symmetric_Difference clears Target.
87574 Otherwise, it deletes from Target the elements that are
87575 equivalent to some element of Source, and inserts into Target
87576 the elements of Source that are not equivalent to some element
87577 of Target.
87578
87579 67/2
87580 function Symmetric_Difference (Left, Right : Set) return Set;
87581
87582 68/2
87583 {AI95-00302-03AI95-00302-03} Returns a set comprising the
87584 elements of Left that are not equivalent to some element of
87585 Right, and the elements of Right that are not equivalent to
87586 some element of Left.
87587
87588 69/2
87589 function Overlap (Left, Right : Set) return Boolean;
87590
87591 70/3
87592 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If an
87593 element of Left is equivalent to some element of Right, then
87594 Overlap returns True. Otherwise, it returns False.
87595
87596 70.a/2
87597 Discussion: This operation is commutative. If Overlap returns
87598 False, the two sets are disjoint.
87599
87600 71/2
87601 function Is_Subset (Subset : Set;
87602 Of_Set : Set) return Boolean;
87603
87604 72/3
87605 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If an
87606 element of Subset is not equivalent to some element of Of_Set,
87607 then Is_Subset returns False. Otherwise, it returns True.
87608
87609 72.a/2
87610 Discussion: This operation is not commutative, so we use
87611 parameter names that make it clear in named notation which set
87612 is which.
87613
87614 73/2
87615 function First (Container : Set) return Cursor;
87616
87617 74/2
87618 {AI95-00302-03AI95-00302-03} If Length (Container) = 0, then
87619 First returns No_Element. Otherwise, First returns a cursor
87620 that designates the first element in Container.
87621
87622 75/2
87623 function Next (Position : Cursor) return Cursor;
87624
87625 76/2
87626 {AI95-00302-03AI95-00302-03} Returns a cursor that designates
87627 the successor of the element designated by Position. If
87628 Position designates the last element, then No_Element is
87629 returned. If Position equals No_Element, then No_Element is
87630 returned.
87631
87632 77/2
87633 procedure Next (Position : in out Cursor);
87634
87635 78/2
87636 {AI95-00302-03AI95-00302-03} Equivalent to Position := Next
87637 (Position).
87638
87639 79/3
87640 This paragraph was deleted.{AI95-00302-03AI95-00302-03}
87641 {AI05-0004-1AI05-0004-1}
87642
87643 80/2
87644 function Find (Container : Set;
87645 Item : Element_Type) return Cursor;
87646
87647 81/2
87648 {AI95-00302-03AI95-00302-03} If Length (Container) equals 0,
87649 then Find returns No_Element. Otherwise, Find checks if an
87650 element equivalent to Item is present in Container. If a
87651 match is found, a cursor designating the matching element is
87652 returned; otherwise, No_Element is returned.
87653
87654 82/2
87655 function Contains (Container : Set;
87656 Item : Element_Type) return Boolean;
87657
87658 82.1/3
87659 {AI05-0004-1AI05-0004-1} Equivalent to Find (Container, Item)
87660 /= No_Element.
87661
87662 Paragraphs 83 and 84 were moved above.
87663
87664 85/2
87665 procedure Iterate
87666 (Container : in Set;
87667 Process : not null access procedure (Position : in Cursor));
87668
87669 86/3
87670 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} Iterate
87671 calls Process.all with a cursor that designates each element
87672 in Container, starting with the first element and moving the
87673 cursor according to the successor relation. Tampering with
87674 the cursors of Container is prohibited during the execution of
87675 a call on Process.all. Any exception raised by Process.all is
87676 propagated.
87677
87678 86.a/2
87679 Implementation Note: The "tamper with cursors" check takes
87680 place when the operations that insert or delete elements, and
87681 so on are called.
87682
87683 86.b/2
87684 See Iterate for vectors (*note A.18.2::) for a suggested
87685 implementation of the check.
87686
87687 87/2
87688 {AI95-00302-03AI95-00302-03} Both Containers.Hashed_Set and
87689 Containers.Ordered_Set declare a nested generic package Generic_Keys,
87690 which provides operations that allow set manipulation in terms of a key
87691 (typically, a portion of an element) instead of a complete element. The
87692 formal function Key of Generic_Keys extracts a key value from an
87693 element. It is expected to return the same value each time it is called
87694 with a particular element. The behavior of Generic_Keys is unspecified
87695 if Key behaves in some other manner.
87696
87697 88/2
87698 {AI95-00302-03AI95-00302-03} A key is expected to unambiguously
87699 determine a single equivalence class for elements. The behavior of
87700 Generic_Keys is unspecified if the formal parameters of this package
87701 behave in some other manner.
87702
87703 89/2
87704 function Key (Position : Cursor) return Key_Type;
87705
87706 90/2
87707 {AI95-00302-03AI95-00302-03} Equivalent to Key (Element
87708 (Position)).
87709
87710 91/2
87711 {AI95-00302-03AI95-00302-03} The subprograms in package Generic_Keys
87712 named Contains, Find, Element, Delete, and Exclude, are equivalent to
87713 the corresponding subprograms in the parent package, with the difference
87714 that the Key parameter is used to locate an element in the set.
87715
87716 92/2
87717 procedure Replace (Container : in out Set;
87718 Key : in Key_Type;
87719 New_Item : in Element_Type);
87720
87721 93/2
87722 {AI95-00302-03AI95-00302-03} Equivalent to Replace_Element
87723 (Container, Find (Container, Key), New_Item).
87724
87725 94/2
87726 procedure Update_Element_Preserving_Key
87727 (Container : in out Set;
87728 Position : in Cursor;
87729 Process : not null access procedure
87730 (Element : in out Element_Type));
87731
87732 95/3
87733 {AI95-00302-03AI95-00302-03} {AI05-0265-1AI05-0265-1} If
87734 Position equals No_Element, then Constraint_Error is
87735 propagated; if Position does not designate an element in
87736 Container, then Program_Error is propagated. Otherwise,
87737 Update_Element_Preserving_Key uses Key to save the key value K
87738 of the element designated by Position.
87739 Update_Element_Preserving_Key then calls Process.all with that
87740 element as the argument. Tampering with the elements of
87741 Container is prohibited during the execution of the call on
87742 Process.all. Any exception raised by Process.all is
87743 propagated. After Process.all returns,
87744 Update_Element_Preserving_Key checks if K determines the same
87745 equivalence class as that for the new element; if not, the
87746 element is removed from the set and Program_Error is
87747 propagated.
87748
87749 95.a/2
87750 Reason: The key check ensures that the invariants of the set
87751 are preserved by the modification. The "tampers with the
87752 elements" check prevents data loss (if Element_Type is
87753 by-copy) or erroneous execution (if element type is
87754 unconstrained and indefinite).
87755
87756 96/2
87757 If Element_Type is unconstrained and definite, then the actual
87758 Element parameter of Process.all shall be unconstrained.
87759
87760 96.a/2
87761 Ramification: This means that the elements cannot be directly
87762 allocated from the heap; it must be possible to change the
87763 discriminants of the element in place.
87764
87765 96.1/3
87766 type Reference_Type (Element : not null access Element_Type) is private
87767 with Implicit_Dereference => Element;
87768
87769 96.2/3
87770 {AI05-0212-1AI05-0212-1} The type Reference_Type needs
87771 finalization.
87772
87773 96.3/3
87774 The default initialization of an object of type Reference_Type
87775 propagates Program_Error.
87776
87777 96.4/3
87778 function Reference_Preserving_Key (Container : aliased in out Set;
87779 Position : in Cursor)
87780 return Reference_Type;
87781
87782 96.5/3
87783 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
87784 function (combined with the Implicit_Dereference aspect)
87785 provides a convenient way to gain read and write access to an
87786 individual element of a set given a cursor.
87787
87788 96.6/3
87789 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
87790 equals No_Element, then Constraint_Error is propagated; if
87791 Position does not designate an element in Container, then
87792 Program_Error is propagated. Otherwise,
87793 Reference_Preserving_Key uses Key to save the key value K;
87794 then returns an object whose discriminant is an access value
87795 that designates the element designated by Position. Tampering
87796 with the elements of Container is prohibited while the object
87797 returned by Reference_Preserving_Key exists and has not been
87798 finalized. When the object returned by
87799 Reference_Preserving_Key is finalized, a check is made if K
87800 determines the same equivalence class as that for the new
87801 element; if not, the element is removed from the set and
87802 Program_Error is propagated.
87803
87804 96.7/3
87805 function Constant_Reference (Container : aliased in Set;
87806 Key : in Key_Type)
87807 return Constant_Reference_Type;
87808
87809 96.8/3
87810 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
87811 function (combined with the Implicit_Dereference aspect)
87812 provides a convenient way to gain read access to an individual
87813 element of a set given a key value.
87814
87815 96.9/3
87816 Equivalent to Constant_Reference (Container, Find (Container,
87817 Key)).
87818
87819 96.10/3
87820 function Reference_Preserving_Key (Container : aliased in out Set;
87821 Key : in Key_Type)
87822 return Reference_Type;
87823
87824 96.11/3
87825 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
87826 function (combined with the Implicit_Dereference aspect)
87827 provides a convenient way to gain read and write access to an
87828 individual element of a set given a key value.
87829
87830 96.12/3
87831 Equivalent to Reference_Preserving_Key (Container, Find
87832 (Container, Key)).
87833
87834 _Bounded (Run-Time) Errors_
87835
87836 96.13/3
87837 {AI05-0022-1AI05-0022-1} {AI05-0248-1AI05-0248-1} It is a bounded error
87838 for the actual function associated with a generic formal subprogram,
87839 when called as part of an operation of a set package, to tamper with
87840 elements of any set parameter of the operation. Either Program_Error is
87841 raised, or the operation works as defined on the value of the set either
87842 prior to, or subsequent to, some or all of the modifications to the set.
87843
87844 96.14/3
87845 {AI05-0027-1AI05-0027-1} It is a bounded error to call any subprogram
87846 declared in the visible part of a set package when the associated
87847 container has been finalized. If the operation takes Container as an in
87848 out parameter, then it raises Constraint_Error or Program_Error.
87849 Otherwise, the operation either proceeds as it would for an empty
87850 container, or it raises Constraint_Error or Program_Error.
87851
87852 _Erroneous Execution_
87853
87854 97/2
87855 {AI95-00302-03AI95-00302-03} A Cursor value is invalid if any of the
87856 following have occurred since it was created:
87857
87858 98/2
87859 * The set that contains the element it designates has been finalized;
87860
87861 98.1/3
87862 * {AI05-0160-1AI05-0160-1} The set that contains the element it
87863 designates has been used as the Target of a call to Assign, or as
87864 the target of an assignment_statement;
87865
87866 99/2
87867 * The set that contains the element it designates has been used as
87868 the Source or Target of a call to Move; or
87869
87870 100/3
87871 * {AI05-0160-1AI05-0160-1} {AI05-0262-1AI05-0262-1} The element it
87872 designates has been removed from the set that previously contained
87873 the element.
87874
87875 100.a/3
87876 Ramification: {AI05-0160-1AI05-0160-1} This can happen
87877 directly via calls to Clear, Exclude, Delete, and
87878 Update_Element_Preserving_Key, and indirectly via calls to
87879 procedures Intersection, Difference, and Symmetric_Difference.
87880
87881 101/2
87882 {AI95-00302-03AI95-00302-03} The result of "=" or Has_Element is
87883 unspecified if these functions are called with an invalid cursor
87884 parameter. Execution is erroneous if any other subprogram declared in
87885 Containers.Hashed_Sets or Containers.Ordered_Sets is called with an
87886 invalid cursor parameter.
87887
87888 101.a/2
87889 Discussion: The list above is intended to be exhaustive. In
87890 other cases, a cursor value continues to designate its
87891 original element. For instance, cursor values survive the
87892 insertion and deletion of other elements.
87893
87894 101.b/2
87895 While it is possible to check for these cases, in many cases
87896 the overhead necessary to make the check is substantial in
87897 time or space. Implementations are encouraged to check for as
87898 many of these cases as possible and raise Program_Error if
87899 detected.
87900
87901 101.1/3
87902 {AI05-0212-1AI05-0212-1} Execution is erroneous if the set associated
87903 with the result of a call to Reference or Constant_Reference is
87904 finalized before the result object returned by the call to Reference or
87905 Constant_Reference is finalized.
87906
87907 101.c/3
87908 Reason: Each object of Reference_Type and
87909 Constant_Reference_Type probably contains some reference to
87910 the originating container. If that container is prematurely
87911 finalized (which is only possible via Unchecked_Deallocation,
87912 as accessibility checks prevent passing a container to
87913 Reference that will not live as long as the result), the
87914 finalization of the object of Reference_Type will try to
87915 access a nonexistent object. This is a normal case of a
87916 dangling pointer created by Unchecked_Deallocation; we have to
87917 explicitly mention it here as the pointer in question is not
87918 visible in the specification of the type. (This is the same
87919 reason we have to say this for invalid cursors.)
87920
87921 _Implementation Requirements_
87922
87923 102/2
87924 {AI95-00302-03AI95-00302-03} No storage associated with a Set object
87925 shall be lost upon assignment or scope exit.
87926
87927 103/3
87928 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The execution of
87929 an assignment_statement for a set shall have the effect of copying the
87930 elements from the source set object to the target set object and
87931 changing the length of the target object to that of the source object.
87932
87933 103.a/3
87934 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
87935 a Set is a "deep" copy; that is the elements are copied as
87936 well as the data structures. We say "effect of" in order to
87937 allow the implementation to avoid copying elements immediately
87938 if it wishes. For instance, an implementation that avoided
87939 copying until one of the containers is modified would be
87940 allowed. (Note that this implementation would require care,
87941 see *note A.18.2:: for more.)
87942
87943 _Implementation Advice_
87944
87945 104/2
87946 {AI95-00302-03AI95-00302-03} Move should not copy elements, and should
87947 minimize copying of internal data structures.
87948
87949 104.a/2
87950 Implementation Advice: Move for sets should not copy elements,
87951 and should minimize copying of internal data structures.
87952
87953 104.b/2
87954 Implementation Note: Usually that can be accomplished simply
87955 by moving the pointer(s) to the internal data structures from
87956 the Source container to the Target container.
87957
87958 105/2
87959 {AI95-00302-03AI95-00302-03} If an exception is propagated from a set
87960 operation, no storage should be lost, nor any elements removed from a
87961 set unless specified by the operation.
87962
87963 105.a/2
87964 Implementation Advice: If an exception is propagated from a
87965 set operation, no storage should be lost, nor any elements
87966 removed from a set unless specified by the operation.
87967
87968 105.b/2
87969 Reason: This is important so that programs can recover from
87970 errors. But we don't want to require heroic efforts, so we
87971 just require documentation of cases where this can't be
87972 accomplished.
87973
87974 _Wording Changes from Ada 95_
87975
87976 105.c/2
87977 {AI95-00302-03AI95-00302-03} This description of sets is new;
87978 the extensions are documented with the specific packages.
87979
87980 _Extensions to Ada 2005_
87981
87982 105.d/3
87983 {AI05-0212-1AI05-0212-1} Added reference support to make set
87984 containers more convenient to use.
87985
87986 _Wording Changes from Ada 2005_
87987
87988 105.e/3
87989 {AI05-0001-1AI05-0001-1} Added procedure Assign; the extension
87990 and incompatibility is documented with the specific packages.
87991
87992 105.f/3
87993 {AI05-0001-1AI05-0001-1} Generalized the definition of Move.
87994 Specified which elements are read/written by stream
87995 attributes.
87996
87997 105.g/3
87998 {AI05-0022-1AI05-0022-1} Correction: Added a Bounded
87999 (Run-Time) Error to cover tampering by generic actual
88000 subprograms.
88001
88002 105.h/3
88003 {AI05-0027-1AI05-0027-1} Correction: Added a Bounded
88004 (Run-Time) Error to cover access to finalized set containers.
88005
88006 105.i/3
88007 {AI05-0160-1AI05-0160-1} Correction: Revised the definition of
88008 invalid cursors to cover missing (and new) cases.
88009
88010 105.j/3
88011 {AI05-0265-1AI05-0265-1} Correction: Defined when a container
88012 prohibits tampering in order to more clearly define where the
88013 check is made and the exception raised.
88014
88015 \1f
88016 File: aarm2012.info, Node: A.18.8, Next: A.18.9, Prev: A.18.7, Up: A.18
88017
88018 A.18.8 The Generic Package Containers.Hashed_Sets
88019 -------------------------------------------------
88020
88021 _Static Semantics_
88022
88023 1/2
88024 {AI95-00302-03AI95-00302-03} The generic library package
88025 Containers.Hashed_Sets has the following declaration:
88026
88027 2/3
88028 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
88029 generic
88030 type Element_Type is private;
88031 with function Hash (Element : Element_Type) return Hash_Type;
88032 with function Equivalent_Elements (Left, Right : Element_Type)
88033 return Boolean;
88034 with function "=" (Left, Right : Element_Type) return Boolean is <>;
88035 package Ada.Containers.Hashed_Sets is
88036 pragma Preelaborate(Hashed_Sets);
88037 pragma Remote_Types(Hashed_Sets);
88038
88039 3/3
88040 {AI05-0212-1AI05-0212-1} type Set is tagged private
88041 with Constant_Indexing => Constant_Reference,
88042 Default_Iterator => Iterate,
88043 Iterator_Element => Element_Type;
88044 pragma Preelaborable_Initialization(Set);
88045
88046 4/2
88047 type Cursor is private;
88048 pragma Preelaborable_Initialization(Cursor);
88049
88050 5/2
88051 Empty_Set : constant Set;
88052
88053 6/2
88054 No_Element : constant Cursor;
88055
88056 6.1/3
88057 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
88058
88059 6.2/3
88060 {AI05-0212-1AI05-0212-1} package Set_Iterator_Interfaces is new
88061 Ada.Iterator_Interfaces (Cursor, Has_Element);
88062
88063 7/2
88064 function "=" (Left, Right : Set) return Boolean;
88065
88066 8/2
88067 function Equivalent_Sets (Left, Right : Set) return Boolean;
88068
88069 9/2
88070 function To_Set (New_Item : Element_Type) return Set;
88071
88072 10/2
88073 function Capacity (Container : Set) return Count_Type;
88074
88075 11/2
88076 procedure Reserve_Capacity (Container : in out Set;
88077 Capacity : in Count_Type);
88078
88079 12/2
88080 function Length (Container : Set) return Count_Type;
88081
88082 13/2
88083 function Is_Empty (Container : Set) return Boolean;
88084
88085 14/2
88086 procedure Clear (Container : in out Set);
88087
88088 15/2
88089 function Element (Position : Cursor) return Element_Type;
88090
88091 16/2
88092 procedure Replace_Element (Container : in out Set;
88093 Position : in Cursor;
88094 New_Item : in Element_Type);
88095
88096 17/2
88097 procedure Query_Element
88098 (Position : in Cursor;
88099 Process : not null access procedure (Element : in Element_Type));
88100
88101 17.1/3
88102 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
88103 (Element : not null access constant Element_Type) is private
88104 with Implicit_Dereference => Element;
88105
88106 17.2/3
88107 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Set;
88108 Position : in Cursor)
88109 return Constant_Reference_Type;
88110
88111 17.3/3
88112 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Set; Source : in Set);
88113
88114 17.4/3
88115 {AI05-0001-1AI05-0001-1} function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
88116
88117 18/2
88118 procedure Move (Target : in out Set;
88119 Source : in out Set);
88120
88121 19/2
88122 procedure Insert (Container : in out Set;
88123 New_Item : in Element_Type;
88124 Position : out Cursor;
88125 Inserted : out Boolean);
88126
88127 20/2
88128 procedure Insert (Container : in out Set;
88129 New_Item : in Element_Type);
88130
88131 21/2
88132 procedure Include (Container : in out Set;
88133 New_Item : in Element_Type);
88134
88135 22/2
88136 procedure Replace (Container : in out Set;
88137 New_Item : in Element_Type);
88138
88139 23/2
88140 procedure Exclude (Container : in out Set;
88141 Item : in Element_Type);
88142
88143 24/2
88144 procedure Delete (Container : in out Set;
88145 Item : in Element_Type);
88146
88147 25/2
88148 procedure Delete (Container : in out Set;
88149 Position : in out Cursor);
88150
88151 26/2
88152 procedure Union (Target : in out Set;
88153 Source : in Set);
88154
88155 27/2
88156 function Union (Left, Right : Set) return Set;
88157
88158 28/2
88159 function "or" (Left, Right : Set) return Set renames Union;
88160
88161 29/2
88162 procedure Intersection (Target : in out Set;
88163 Source : in Set);
88164
88165 30/2
88166 function Intersection (Left, Right : Set) return Set;
88167
88168 31/2
88169 function "and" (Left, Right : Set) return Set renames Intersection;
88170
88171 32/2
88172 procedure Difference (Target : in out Set;
88173 Source : in Set);
88174
88175 33/2
88176 function Difference (Left, Right : Set) return Set;
88177
88178 34/2
88179 function "-" (Left, Right : Set) return Set renames Difference;
88180
88181 35/2
88182 procedure Symmetric_Difference (Target : in out Set;
88183 Source : in Set);
88184
88185 36/2
88186 function Symmetric_Difference (Left, Right : Set) return Set;
88187
88188 37/2
88189 function "xor" (Left, Right : Set) return Set
88190 renames Symmetric_Difference;
88191
88192 38/2
88193 function Overlap (Left, Right : Set) return Boolean;
88194
88195 39/2
88196 function Is_Subset (Subset : Set;
88197 Of_Set : Set) return Boolean;
88198
88199 40/2
88200 function First (Container : Set) return Cursor;
88201
88202 41/2
88203 function Next (Position : Cursor) return Cursor;
88204
88205 42/2
88206 procedure Next (Position : in out Cursor);
88207
88208 43/2
88209 function Find (Container : Set;
88210 Item : Element_Type) return Cursor;
88211
88212 44/2
88213 function Contains (Container : Set;
88214 Item : Element_Type) return Boolean;
88215
88216 45/3
88217 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
88218
88219 46/2
88220 function Equivalent_Elements (Left, Right : Cursor)
88221 return Boolean;
88222
88223 47/2
88224 function Equivalent_Elements (Left : Cursor;
88225 Right : Element_Type)
88226 return Boolean;
88227
88228 48/2
88229 function Equivalent_Elements (Left : Element_Type;
88230 Right : Cursor)
88231 return Boolean;
88232
88233 49/2
88234 procedure Iterate
88235 (Container : in Set;
88236 Process : not null access procedure (Position : in Cursor));
88237
88238 49.1/3
88239 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Set)
88240 return Set_Iterator_Interfaces.Forward_Iterator'Class;
88241
88242 50/2
88243 generic
88244 type Key_Type (<>) is private;
88245 with function Key (Element : Element_Type) return Key_Type;
88246 with function Hash (Key : Key_Type) return Hash_Type;
88247 with function Equivalent_Keys (Left, Right : Key_Type)
88248 return Boolean;
88249 package Generic_Keys is
88250
88251 51/2
88252 function Key (Position : Cursor) return Key_Type;
88253
88254 52/2
88255 function Element (Container : Set;
88256 Key : Key_Type)
88257 return Element_Type;
88258
88259 53/2
88260 procedure Replace (Container : in out Set;
88261 Key : in Key_Type;
88262 New_Item : in Element_Type);
88263
88264 54/2
88265 procedure Exclude (Container : in out Set;
88266 Key : in Key_Type);
88267
88268 55/2
88269 procedure Delete (Container : in out Set;
88270 Key : in Key_Type);
88271
88272 56/2
88273 function Find (Container : Set;
88274 Key : Key_Type)
88275 return Cursor;
88276
88277 57/2
88278 function Contains (Container : Set;
88279 Key : Key_Type)
88280 return Boolean;
88281
88282 58/2
88283 procedure Update_Element_Preserving_Key
88284 (Container : in out Set;
88285 Position : in Cursor;
88286 Process : not null access procedure
88287 (Element : in out Element_Type));
88288
88289 58.1/3
88290 {AI05-0212-1AI05-0212-1} type Reference_Type
88291 (Element : not null access Element_Type) is private
88292 with Implicit_Dereference => Element;
88293
88294 58.2/3
88295 {AI05-0212-1AI05-0212-1} function Reference_Preserving_Key (Container : aliased in out Set;
88296 Position : in Cursor)
88297 return Reference_Type;
88298
88299 58.3/3
88300 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Set;
88301 Key : in Key_Type)
88302 return Constant_Reference_Type;
88303
88304 58.4/3
88305 {AI05-0212-1AI05-0212-1} function Reference_Preserving_Key (Container : aliased in out Set;
88306 Key : in Key_Type)
88307 return Reference_Type;
88308
88309 59/2
88310 end Generic_Keys;
88311
88312 60/2
88313 private
88314
88315 61/2
88316 ... -- not specified by the language
88317
88318 62/2
88319 end Ada.Containers.Hashed_Sets;
88320
88321 63/2
88322 {AI95-00302-03AI95-00302-03} An object of type Set contains an
88323 expandable hash table, which is used to provide direct access to
88324 elements. The capacity of an object of type Set is the maximum number
88325 of elements that can be inserted into the hash table prior to it being
88326 automatically expanded.
88327
88328 64/2
88329 {AI95-00302-03AI95-00302-03} Two elements E1 and E2 are defined to be
88330 equivalent if Equivalent_Elements (E1, E2) returns True.
88331
88332 65/2
88333 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
88334 function Hash is expected to return the same value each time it is
88335 called with a particular element value. For any two equivalent
88336 elements, the actual for Hash is expected to return the same value. If
88337 the actual for Hash behaves in some other manner, the behavior of this
88338 package is unspecified. Which subprograms of this package call Hash,
88339 and how many times they call it, is unspecified.
88340
88341 66/2
88342 {AI95-00302-03AI95-00302-03} The actual function for the generic formal
88343 function Equivalent_Elements is expected to return the same value each
88344 time it is called with a particular pair of Element values. It should
88345 define an equivalence relationship, that is, be reflexive, symmetric,
88346 and transitive. If the actual for Equivalent_Elements behaves in some
88347 other manner, the behavior of this package is unspecified. Which
88348 subprograms of this package call Equivalent_Elements, and how many times
88349 they call it, is unspecified.
88350
88351 66.1/3
88352 {AI05-0044-1AI05-0044-1} If the actual function for the generic formal
88353 function "=" returns True for any pair of nonequivalent elements, then
88354 the behavior of the container function "=" is unspecified.
88355
88356 67/2
88357 {AI95-00302-03AI95-00302-03} If the value of an element stored in a set
88358 is changed other than by an operation in this package such that at least
88359 one of Hash or Equivalent_Elements give different results, the behavior
88360 of this package is unspecified.
88361
88362 67.a/2
88363 Discussion: See *note A.18.5::, "*note A.18.5:: The Generic
88364 Package Containers.Hashed_Maps" for a suggested
88365 implementation, and for justification of the restrictions
88366 regarding Hash and Equivalent_Elements. Note that sets only
88367 need to store elements, not key/element pairs.
88368
88369 68/2
88370 {AI95-00302-03AI95-00302-03} Which elements are the first element and
88371 the last element of a set, and which element is the successor of a given
88372 element, are unspecified, other than the general semantics described in
88373 *note A.18.7::.
88374
88375 69/2
88376 function Capacity (Container : Set) return Count_Type;
88377
88378 70/2
88379 {AI95-00302-03AI95-00302-03} Returns the capacity of
88380 Container.
88381
88382 71/2
88383 procedure Reserve_Capacity (Container : in out Set;
88384 Capacity : in Count_Type);
88385
88386 72/2
88387 {AI95-00302-03AI95-00302-03} Reserve_Capacity allocates a new
88388 hash table such that the length of the resulting set can
88389 become at least the value Capacity without requiring an
88390 additional call to Reserve_Capacity, and is large enough to
88391 hold the current length of Container. Reserve_Capacity then
88392 rehashes the elements in Container onto the new hash table.
88393 It replaces the old hash table with the new hash table, and
88394 then deallocates the old hash table. Any exception raised
88395 during allocation is propagated and Container is not modified.
88396
88397 73/2
88398 Reserve_Capacity tampers with the cursors of Container.
88399
88400 73.a/2
88401 Reason: Reserve_Capacity tampers with the cursors, as
88402 rehashing probably will change the relationships of the
88403 elements in Container.
88404
88405 74/2
88406 procedure Clear (Container : in out Set);
88407
88408 75/2
88409 {AI95-00302-03AI95-00302-03} In addition to the semantics
88410 described in *note A.18.7::, Clear does not affect the
88411 capacity of Container.
88412
88413 75.1/3
88414 procedure Assign (Target : in out Set; Source : in Set);
88415
88416 75.2/3
88417 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} In addition
88418 to the semantics described in *note A.18.7::, if the length of
88419 Source is greater than the capacity of Target,
88420 Reserve_Capacity (Target, Length (Source)) is called before
88421 assigning any elements.
88422
88423 75.3/3
88424 function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
88425
88426 75.4/3
88427 {AI05-0001-1AI05-0001-1} Returns a set whose elements are
88428 initialized from the elements of Source. If Capacity is 0,
88429 then the set capacity is the length of Source; if Capacity is
88430 equal to or greater than the length of Source, the set
88431 capacity is at least the specified value. Otherwise, the
88432 operation propagates Capacity_Error.
88433
88434 76/2
88435 procedure Insert (Container : in out Set;
88436 New_Item : in Element_Type;
88437 Position : out Cursor;
88438 Inserted : out Boolean);
88439
88440 77/2
88441 {AI95-00302-03AI95-00302-03} In addition to the semantics
88442 described in *note A.18.7::, if Length (Container) equals
88443 Capacity (Container), then Insert first calls Reserve_Capacity
88444 to increase the capacity of Container to some larger value.
88445
88446 78/2
88447 function First (Container : Set) return Cursor;
88448
88449 79/2
88450 {AI95-00302-03AI95-00302-03} If Length (Container) = 0, then
88451 First returns No_Element. Otherwise, First returns a cursor
88452 that designates the first hashed element in Container.
88453
88454 80/2
88455 function Equivalent_Elements (Left, Right : Cursor)
88456 return Boolean;
88457
88458 81/2
88459 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Elements
88460 (Element (Left), Element (Right)).
88461
88462 82/2
88463 function Equivalent_Elements (Left : Cursor;
88464 Right : Element_Type) return Boolean;
88465
88466 83/2
88467 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Elements
88468 (Element (Left), Right).
88469
88470 84/2
88471 function Equivalent_Elements (Left : Element_Type;
88472 Right : Cursor) return Boolean;
88473
88474 85/2
88475 {AI95-00302-03AI95-00302-03} Equivalent to Equivalent_Elements
88476 (Left, Element (Right)).
88477
88478 85.1/3
88479 function Iterate (Container : in Set)
88480 return Set_Iterator_Interfaces.Forward_Iterator'Class;
88481
88482 85.2/3
88483 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
88484 {AI05-0269-1AI05-0269-1} Iterate returns an iterator object
88485 (see *note 5.5.1::) that will generate a value for a loop
88486 parameter (see *note 5.5.2::) designating each element in
88487 Container, starting with the first element and moving the
88488 cursor according to the successor relation. Tampering with
88489 the cursors of Container is prohibited while the iterator
88490 object exists (in particular, in the sequence_of_statements of
88491 the loop_statement whose iterator_specification denotes this
88492 object). The iterator object needs finalization.
88493
88494 86/2
88495 {AI95-00302-03AI95-00302-03} For any element E, the actual function for
88496 the generic formal function Generic_Keys.Hash is expected to be such
88497 that Hash (E) = Generic_Keys.Hash (Key (E)). If the actuals for Key or
88498 Generic_Keys.Hash behave in some other manner, the behavior of
88499 Generic_Keys is unspecified. Which subprograms of Generic_Keys call
88500 Generic_Keys.Hash, and how many times they call it, is unspecified.
88501
88502 87/2
88503 {AI95-00302-03AI95-00302-03} For any two elements E1 and E2, the boolean
88504 values Equivalent_Elements (E1, E2) and Equivalent_Keys (Key (E1), Key
88505 (E2)) are expected to be equal. If the actuals for Key or
88506 Equivalent_Keys behave in some other manner, the behavior of
88507 Generic_Keys is unspecified. Which subprograms of Generic_Keys call
88508 Equivalent_Keys, and how many times they call it, is unspecified.
88509
88510 _Implementation Advice_
88511
88512 88/2
88513 {AI95-00302-03AI95-00302-03} If N is the length of a set, the average
88514 time complexity of the subprograms Insert, Include, Replace, Delete,
88515 Exclude and Find that take an element parameter should be O(log N). The
88516 average time complexity of the subprograms that take a cursor parameter
88517 should be O(1). The average time complexity of Reserve_Capacity should
88518 be O(N).
88519
88520 88.a/2
88521 Implementation Advice: The average time complexity of the
88522 Insert, Include, Replace, Delete, Exclude and Find operations
88523 of Containers.Hashed_Sets that take an element parameter
88524 should be O(log N). The average time complexity of the
88525 subprograms of Containers.Hashed_Sets that take a cursor
88526 parameter should be O(1). The average time complexity of
88527 Containers.Hashed_Sets.Reserve_Capacity should be O(N).
88528
88529 88.b/2
88530 Implementation Note: {AI95-00302-03AI95-00302-03} See *note
88531 A.18.5::, "*note A.18.5:: The Generic Package
88532 Containers.Hashed_Maps" for implementation notes regarding
88533 some of the operations of this package.
88534
88535 _Extensions to Ada 95_
88536
88537 88.c/2
88538 {AI95-00302-03AI95-00302-03} The generic package
88539 Containers.Hashed_Sets is new.
88540
88541 _Incompatibilities With Ada 2005_
88542
88543 88.d/3
88544 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
88545 to Containers.Hashed_Sets. If an instance of
88546 Containers.Hashed_Sets is referenced in a use_clause, and an
88547 entity E with the same defining_identifier as a new entity in
88548 Containers.Hashed_Sets is defined in a package that is also
88549 referenced in a use_clause, the entity E may no longer be
88550 use-visible, resulting in errors. This should be rare and is
88551 easily fixed if it does occur.
88552
88553 _Extensions to Ada 2005_
88554
88555 88.e/3
88556 {AI05-0212-1AI05-0212-1} Added iterator and indexing support
88557 to make hashed set containers more convenient to use.
88558
88559 _Wording Changes from Ada 2005_
88560
88561 88.f/3
88562 {AI05-0044-1AI05-0044-1} Correction: Added wording to require
88563 the formal function be such that equal elements are also
88564 equivalent.
88565
88566 88.g/3
88567 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
88568 Remote_Types so that containers can be used in distributed
88569 programs.
88570
88571 \1f
88572 File: aarm2012.info, Node: A.18.9, Next: A.18.10, Prev: A.18.8, Up: A.18
88573
88574 A.18.9 The Generic Package Containers.Ordered_Sets
88575 --------------------------------------------------
88576
88577 _Static Semantics_
88578
88579 1/2
88580 {AI95-00302-03AI95-00302-03} The generic library package
88581 Containers.Ordered_Sets has the following declaration:
88582
88583 2/3
88584 {AI05-0084-1AI05-0084-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
88585 generic
88586 type Element_Type is private;
88587 with function "<" (Left, Right : Element_Type) return Boolean is <>;
88588 with function "=" (Left, Right : Element_Type) return Boolean is <>;
88589 package Ada.Containers.Ordered_Sets is
88590 pragma Preelaborate(Ordered_Sets);
88591 pragma Remote_Types(Ordered_Sets);
88592
88593 3/2
88594 function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
88595
88596 4/3
88597 {AI05-0212-1AI05-0212-1} type Set is tagged private
88598 with Constant_Indexing => Constant_Reference,
88599 Default_Iterator => Iterate,
88600 Iterator_Element => Element_Type;
88601 pragma Preelaborable_Initialization(Set);
88602
88603 5/2
88604 type Cursor is private;
88605 pragma Preelaborable_Initialization(Cursor);
88606
88607 6/2
88608 Empty_Set : constant Set;
88609
88610 7/2
88611 No_Element : constant Cursor;
88612
88613 7.1/3
88614 {AI05-0212-1AI05-0212-1} function Has_Element (Position : Cursor) return Boolean;
88615
88616 7.2/3
88617 {AI05-0212-1AI05-0212-1} package Set_Iterator_Interfaces is new
88618 Ada.Iterator_Interfaces (Cursor, Has_Element);
88619
88620 8/2
88621 function "=" (Left, Right : Set) return Boolean;
88622
88623 9/2
88624 function Equivalent_Sets (Left, Right : Set) return Boolean;
88625
88626 10/2
88627 function To_Set (New_Item : Element_Type) return Set;
88628
88629 11/2
88630 function Length (Container : Set) return Count_Type;
88631
88632 12/2
88633 function Is_Empty (Container : Set) return Boolean;
88634
88635 13/2
88636 procedure Clear (Container : in out Set);
88637
88638 14/2
88639 function Element (Position : Cursor) return Element_Type;
88640
88641 15/2
88642 procedure Replace_Element (Container : in out Set;
88643 Position : in Cursor;
88644 New_Item : in Element_Type);
88645
88646 16/2
88647 procedure Query_Element
88648 (Position : in Cursor;
88649 Process : not null access procedure (Element : in Element_Type));
88650
88651 16.1/3
88652 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
88653 (Element : not null access constant Element_Type) is private
88654 with Implicit_Dereference => Element;
88655
88656 16.2/3
88657 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Set;
88658 Position : in Cursor)
88659 return Constant_Reference_Type;
88660
88661 16.3/3
88662 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Set; Source : in Set);
88663
88664 16.4/3
88665 {AI05-0001-1AI05-0001-1} function Copy (Source : Set) return Set;
88666
88667 17/2
88668 procedure Move (Target : in out Set;
88669 Source : in out Set);
88670
88671 18/2
88672 procedure Insert (Container : in out Set;
88673 New_Item : in Element_Type;
88674 Position : out Cursor;
88675 Inserted : out Boolean);
88676
88677 19/2
88678 procedure Insert (Container : in out Set;
88679 New_Item : in Element_Type);
88680
88681 20/2
88682 procedure Include (Container : in out Set;
88683 New_Item : in Element_Type);
88684
88685 21/2
88686 procedure Replace (Container : in out Set;
88687 New_Item : in Element_Type);
88688
88689 22/2
88690 procedure Exclude (Container : in out Set;
88691 Item : in Element_Type);
88692
88693 23/2
88694 procedure Delete (Container : in out Set;
88695 Item : in Element_Type);
88696
88697 24/2
88698 procedure Delete (Container : in out Set;
88699 Position : in out Cursor);
88700
88701 25/2
88702 procedure Delete_First (Container : in out Set);
88703
88704 26/2
88705 procedure Delete_Last (Container : in out Set);
88706
88707 27/2
88708 procedure Union (Target : in out Set;
88709 Source : in Set);
88710
88711 28/2
88712 function Union (Left, Right : Set) return Set;
88713
88714 29/2
88715 function "or" (Left, Right : Set) return Set renames Union;
88716
88717 30/2
88718 procedure Intersection (Target : in out Set;
88719 Source : in Set);
88720
88721 31/2
88722 function Intersection (Left, Right : Set) return Set;
88723
88724 32/2
88725 function "and" (Left, Right : Set) return Set renames Intersection;
88726
88727 33/2
88728 procedure Difference (Target : in out Set;
88729 Source : in Set);
88730
88731 34/2
88732 function Difference (Left, Right : Set) return Set;
88733
88734 35/2
88735 function "-" (Left, Right : Set) return Set renames Difference;
88736
88737 36/2
88738 procedure Symmetric_Difference (Target : in out Set;
88739 Source : in Set);
88740
88741 37/2
88742 function Symmetric_Difference (Left, Right : Set) return Set;
88743
88744 38/2
88745 function "xor" (Left, Right : Set) return Set renames
88746 Symmetric_Difference;
88747
88748 39/2
88749 function Overlap (Left, Right : Set) return Boolean;
88750
88751 40/2
88752 function Is_Subset (Subset : Set;
88753 Of_Set : Set) return Boolean;
88754
88755 41/2
88756 function First (Container : Set) return Cursor;
88757
88758 42/2
88759 function First_Element (Container : Set) return Element_Type;
88760
88761 43/2
88762 function Last (Container : Set) return Cursor;
88763
88764 44/2
88765 function Last_Element (Container : Set) return Element_Type;
88766
88767 45/2
88768 function Next (Position : Cursor) return Cursor;
88769
88770 46/2
88771 procedure Next (Position : in out Cursor);
88772
88773 47/2
88774 function Previous (Position : Cursor) return Cursor;
88775
88776 48/2
88777 procedure Previous (Position : in out Cursor);
88778
88779 49/2
88780 function Find (Container : Set;
88781 Item : Element_Type)
88782 return Cursor;
88783
88784 50/2
88785 function Floor (Container : Set;
88786 Item : Element_Type)
88787 return Cursor;
88788
88789 51/2
88790 function Ceiling (Container : Set;
88791 Item : Element_Type)
88792 return Cursor;
88793
88794 52/2
88795 function Contains (Container : Set;
88796 Item : Element_Type) return Boolean;
88797
88798 53/3
88799 This paragraph was deleted.{AI05-0212-1AI05-0212-1}
88800
88801 54/2
88802 function "<" (Left, Right : Cursor) return Boolean;
88803
88804 55/2
88805 function ">" (Left, Right : Cursor) return Boolean;
88806
88807 56/2
88808 function "<" (Left : Cursor; Right : Element_Type)
88809 return Boolean;
88810
88811 57/2
88812 function ">" (Left : Cursor; Right : Element_Type)
88813 return Boolean;
88814
88815 58/2
88816 function "<" (Left : Element_Type; Right : Cursor)
88817 return Boolean;
88818
88819 59/2
88820 function ">" (Left : Element_Type; Right : Cursor)
88821 return Boolean;
88822
88823 60/2
88824 procedure Iterate
88825 (Container : in Set;
88826 Process : not null access procedure (Position : in Cursor));
88827
88828 61/2
88829 procedure Reverse_Iterate
88830 (Container : in Set;
88831 Process : not null access procedure (Position : in Cursor));
88832
88833 61.1/3
88834 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Set)
88835 return Set_Iterator_Interfaces.Reversible_Iterator'Class;
88836
88837 61.2/3
88838 {AI05-0262-1AI05-0262-1} function Iterate (Container : in Set; Start : in Cursor)
88839 return Set_Iterator_Interfaces.Reversible_Iterator'Class;
88840
88841 62/2
88842 generic
88843 type Key_Type (<>) is private;
88844 with function Key (Element : Element_Type) return Key_Type;
88845 with function "<" (Left, Right : Key_Type)
88846 return Boolean is <>;
88847 package Generic_Keys is
88848
88849 63/2
88850 function Equivalent_Keys (Left, Right : Key_Type)
88851 return Boolean;
88852
88853 64/2
88854 function Key (Position : Cursor) return Key_Type;
88855
88856 65/2
88857 function Element (Container : Set;
88858 Key : Key_Type)
88859 return Element_Type;
88860
88861 66/2
88862 procedure Replace (Container : in out Set;
88863 Key : in Key_Type;
88864 New_Item : in Element_Type);
88865
88866 67/2
88867 procedure Exclude (Container : in out Set;
88868 Key : in Key_Type);
88869
88870 68/2
88871 procedure Delete (Container : in out Set;
88872 Key : in Key_Type);
88873
88874 69/2
88875 function Find (Container : Set;
88876 Key : Key_Type)
88877 return Cursor;
88878
88879 70/2
88880 function Floor (Container : Set;
88881 Key : Key_Type)
88882 return Cursor;
88883
88884 71/2
88885 function Ceiling (Container : Set;
88886 Key : Key_Type)
88887 return Cursor;
88888
88889 72/2
88890 function Contains (Container : Set;
88891 Key : Key_Type) return Boolean;
88892
88893 73/2
88894 procedure Update_Element_Preserving_Key
88895 (Container : in out Set;
88896 Position : in Cursor;
88897 Process : not null access procedure
88898 (Element : in out Element_Type));
88899
88900 73.1/3
88901 {AI05-0212-1AI05-0212-1} type Reference_Type
88902 (Element : not null access Element_Type) is private
88903 with Implicit_Dereference => Element;
88904
88905 73.2/3
88906 {AI05-0212-1AI05-0212-1} function Reference_Preserving_Key (Container : aliased in out Set;
88907 Position : in Cursor)
88908 return Reference_Type;
88909
88910 73.3/3
88911 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Set;
88912 Key : in Key_Type)
88913 return Constant_Reference_Type;
88914
88915 73.4/3
88916 {AI05-0212-1AI05-0212-1} function Reference_Preserving_Key (Container : aliased in out Set;
88917 Key : in Key_Type)
88918 return Reference_Type;
88919
88920 74/2
88921 end Generic_Keys;
88922
88923 75/2
88924 private
88925
88926 76/2
88927 ... -- not specified by the language
88928
88929 77/2
88930 end Ada.Containers.Ordered_Sets;
88931
88932 78/2
88933 {AI95-00302-03AI95-00302-03} Two elements E1 and E2 are equivalent if
88934 both E1 < E2 and E2 < E1 return False, using the generic formal "<"
88935 operator for elements. Function Equivalent_Elements returns True if
88936 Left and Right are equivalent, and False otherwise.
88937
88938 79/3
88939 {AI95-00302-03AI95-00302-03} {AI05-0044-1AI05-0044-1} The actual
88940 function for the generic formal function "<" on Element_Type values is
88941 expected to return the same value each time it is called with a
88942 particular pair of key values. It should define a strict weak ordering
88943 relationship (see *note A.18::). If the actual for "<" behaves in some
88944 other manner, the behavior of this package is unspecified. Which
88945 subprograms of this package call "<" and how many times they call it, is
88946 unspecified.
88947
88948 79.1/3
88949 {AI05-0044-1AI05-0044-1} If the actual function for the generic formal
88950 function "=" returns True for any pair of nonequivalent elements, then
88951 the behavior of the container function "=" is unspecified.
88952
88953 80/2
88954 {AI95-00302-03AI95-00302-03} If the value of an element stored in a set
88955 is changed other than by an operation in this package such that at least
88956 one of "<" or "=" give different results, the behavior of this package
88957 is unspecified.
88958
88959 80.a/2
88960 Discussion: See *note A.18.6::, "*note A.18.6:: The Generic
88961 Package Containers.Ordered_Maps" for a suggested
88962 implementation, and for justification of the restrictions
88963 regarding "<" and "=". Note that sets only need to store
88964 elements, not key/element pairs.
88965
88966 81/3
88967 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} The first element
88968 of a nonempty set is the one which is less than all the other elements
88969 in the set. The last element of a nonempty set is the one which is
88970 greater than all the other elements in the set. The successor of an
88971 element is the smallest element that is larger than the given element.
88972 The predecessor of an element is the largest element that is smaller
88973 than the given element. All comparisons are done using the generic
88974 formal "<" operator for elements.
88975
88976 81.1/3
88977 function Copy (Source : Set) return Set;
88978
88979 81.2/3
88980 {AI05-0001-1AI05-0001-1} Returns a set whose elements are
88981 initialized from the corresponding elements of Source.
88982
88983 82/2
88984 procedure Delete_First (Container : in out Set);
88985
88986 83/3
88987 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
88988 Container is empty, Delete_First has no effect. Otherwise,
88989 the element designated by First (Container) is removed from
88990 Container. Delete_First tampers with the cursors of
88991 Container.
88992
88993 84/2
88994 procedure Delete_Last (Container : in out Set);
88995
88996 85/3
88997 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} If
88998 Container is empty, Delete_Last has no effect. Otherwise, the
88999 element designated by Last (Container) is removed from
89000 Container. Delete_Last tampers with the cursors of Container.
89001
89002 86/2
89003 function First_Element (Container : Set) return Element_Type;
89004
89005 87/2
89006 {AI95-00302-03AI95-00302-03} Equivalent to Element (First
89007 (Container)).
89008
89009 88/2
89010 function Last (Container : Set) return Cursor;
89011
89012 89/2
89013 {AI95-00302-03AI95-00302-03} Returns a cursor that designates
89014 the last element in Container. If Container is empty, returns
89015 No_Element.
89016
89017 90/2
89018 function Last_Element (Container : Set) return Element_Type;
89019
89020 91/2
89021 {AI95-00302-03AI95-00302-03} Equivalent to Element (Last
89022 (Container)).
89023
89024 92/2
89025 function Previous (Position : Cursor) return Cursor;
89026
89027 93/3
89028 {AI95-00302-03AI95-00302-03} {AI05-0262-1AI05-0262-1} If
89029 Position equals No_Element, then Previous returns No_Element.
89030 Otherwise, Previous returns a cursor designating the
89031 predecessor element of the one designated by Position. If
89032 Position designates the first element, then Previous returns
89033 No_Element.
89034
89035 94/2
89036 procedure Previous (Position : in out Cursor);
89037
89038 95/2
89039 {AI95-00302-03AI95-00302-03} Equivalent to Position :=
89040 Previous (Position).
89041
89042 96/2
89043 function Floor (Container : Set;
89044 Item : Element_Type) return Cursor;
89045
89046 97/3
89047 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} Floor
89048 searches for the last element which is not greater than Item.
89049 If such an element is found, a cursor that designates it is
89050 returned. Otherwise, No_Element is returned.
89051
89052 98/2
89053 function Ceiling (Container : Set;
89054 Item : Element_Type) return Cursor;
89055
89056 99/3
89057 {AI95-00302-03AI95-00302-03} {AI05-0264-1AI05-0264-1} Ceiling
89058 searches for the first element which is not less than Item.
89059 If such an element is found, a cursor that designates it is
89060 returned. Otherwise, No_Element is returned.
89061
89062 100/2
89063 function "<" (Left, Right : Cursor) return Boolean;
89064
89065 101/2
89066 {AI95-00302-03AI95-00302-03} Equivalent to Element (Left) <
89067 Element (Right).
89068
89069 102/2
89070 function ">" (Left, Right : Cursor) return Boolean;
89071
89072 103/2
89073 {AI95-00302-03AI95-00302-03} Equivalent to Element (Right) <
89074 Element (Left).
89075
89076 104/2
89077 function "<" (Left : Cursor; Right : Element_Type) return Boolean;
89078
89079 105/2
89080 {AI95-00302-03AI95-00302-03} Equivalent to Element (Left) <
89081 Right.
89082
89083 106/2
89084 function ">" (Left : Cursor; Right : Element_Type) return Boolean;
89085
89086 107/2
89087 {AI95-00302-03AI95-00302-03} Equivalent to Right < Element
89088 (Left).
89089
89090 108/2
89091 function "<" (Left : Element_Type; Right : Cursor) return Boolean;
89092
89093 109/2
89094 {AI95-00302-03AI95-00302-03} Equivalent to Left < Element
89095 (Right).
89096
89097 110/2
89098 function ">" (Left : Element_Type; Right : Cursor) return Boolean;
89099
89100 111/2
89101 {AI95-00302-03AI95-00302-03} Equivalent to Element (Right) <
89102 Left.
89103
89104 112/2
89105 procedure Reverse_Iterate
89106 (Container : in Set;
89107 Process : not null access procedure (Position : in Cursor));
89108
89109 113/3
89110 {AI95-00302-03AI95-00302-03} {AI05-0212-1AI05-0212-1} Iterates
89111 over the elements in Container as per procedure Iterate, with
89112 the difference that the elements are traversed in predecessor
89113 order, starting with the last element.
89114
89115 113.1/3
89116 function Iterate (Container : in Set)
89117 return Set_Iterator_Interfaces.Reversible_Iterator'Class;
89118
89119 113.2/3
89120 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
89121 {AI05-0269-1AI05-0269-1} Iterate returns a reversible iterator
89122 object (see *note 5.5.1::) that will generate a value for a
89123 loop parameter (see *note 5.5.2::) designating each element in
89124 Container, starting with the first element and moving the
89125 cursor according to the successor relation when used as a
89126 forward iterator, and starting with the last element and
89127 moving the cursor according to the predecessor relation when
89128 used as a reverse iterator. Tampering with the cursors of
89129 Container is prohibited while the iterator object exists (in
89130 particular, in the sequence_of_statements of the
89131 loop_statement whose iterator_specification denotes this
89132 object). The iterator object needs finalization.
89133
89134 113.3/3
89135 function Iterate (Container : in Set; Start : in Cursor)
89136 return Set_Iterator_Interfaces.Reversible_Iterator'Class;
89137
89138 113.4/3
89139 {AI05-0262-1AI05-0262-1} {AI05-0265-1AI05-0265-1}
89140 {AI05-0269-1AI05-0269-1} If Start is not No_Element and does
89141 not designate an item in Container, then Program_Error is
89142 propagated. If Start is No_Element, then Constraint_Error is
89143 propagated. Otherwise, Iterate returns a reversible iterator
89144 object (see *note 5.5.1::) that will generate a value for a
89145 loop parameter (see *note 5.5.2::) designating each element in
89146 Container, starting with the element designated by Start and
89147 moving the cursor according to the successor relation when
89148 used as a forward iterator, or moving the cursor according to
89149 the predecessor relation when used as a reverse iterator.
89150 Tampering with the cursors of Container is prohibited while
89151 the iterator object exists (in particular, in the
89152 sequence_of_statements of the loop_statement whose
89153 iterator_specification denotes this object). The iterator
89154 object needs finalization.
89155
89156 113.a/3
89157 Discussion: Exits are allowed from the loops created using the
89158 iterator objects. In particular, to stop the iteration at a
89159 particular cursor, just add
89160
89161 113.b/3
89162 exit when Cur = Stop;
89163
89164 113.c/3
89165 in the body of the loop (assuming that Cur is the loop
89166 parameter and Stop is the cursor that you want to stop at).
89167
89168 114/2
89169 {AI95-00302-03AI95-00302-03} For any two elements E1 and E2, the boolean
89170 values (E1 < E2) and (Key(E1) < Key(E2)) are expected to be equal. If
89171 the actuals for Key or Generic_Keys."<" behave in some other manner, the
89172 behavior of this package is unspecified. Which subprograms of this
89173 package call Key and Generic_Keys."<", and how many times the functions
89174 are called, is unspecified.
89175
89176 115/2
89177 {AI95-00302-03AI95-00302-03} In addition to the semantics described in
89178 *note A.18.7::, the subprograms in package Generic_Keys named Floor and
89179 Ceiling, are equivalent to the corresponding subprograms in the parent
89180 package, with the difference that the Key subprogram parameter is
89181 compared to elements in the container using the Key and "<" generic
89182 formal functions. The function named Equivalent_Keys in package
89183 Generic_Keys returns True if both Left < Right and Right < Left return
89184 False using the generic formal "<" operator, and returns True otherwise.
89185
89186 _Implementation Advice_
89187
89188 116/2
89189 {AI95-00302-03AI95-00302-03} If N is the length of a set, then the
89190 worst-case time complexity of the Insert, Include, Replace, Delete,
89191 Exclude and Find operations that take an element parameter should be
89192 O((log N)**2) or better. The worst-case time complexity of the
89193 subprograms that take a cursor parameter should be O(1).
89194
89195 116.a/2
89196 Implementation Advice: The worst-case time complexity of the
89197 Insert, Include, Replace, Delete, Exclude and Find operations
89198 of Containers.Ordered_Sets that take an element parameter
89199 should be O((log N)**2). The worst-case time complexity of
89200 the subprograms of Containers.Ordered_Sets that take a cursor
89201 parameter should be O(1).
89202
89203 116.b/2
89204 Implementation Note: {AI95-00302-03AI95-00302-03} See *note
89205 A.18.6::, "*note A.18.6:: The Generic Package
89206 Containers.Ordered_Maps" for implementation notes regarding
89207 some of the operations of this package.
89208
89209 _Extensions to Ada 95_
89210
89211 116.c/2
89212 {AI95-00302-03AI95-00302-03} The generic package
89213 Containers.Ordered_Sets is new.
89214
89215 _Incompatibilities With Ada 2005_
89216
89217 116.d/3
89218 {AI05-0001-1AI05-0001-1} Subprograms Assign and Copy are added
89219 to Containers.Ordered_Sets. If an instance of
89220 Containers.Ordered_Sets is referenced in a use_clause, and an
89221 entity E with the same defining_identifier as a new entity in
89222 Containers.Ordered_Sets is defined in a package that is also
89223 referenced in a use_clause, the entity E may no longer be
89224 use-visible, resulting in errors. This should be rare and is
89225 easily fixed if it does occur.
89226
89227 _Extensions to Ada 2005_
89228
89229 116.e/3
89230 {AI05-0212-1AI05-0212-1} Added iterator and indexing support
89231 to make ordered set containers more convenient to use.
89232
89233 _Wording Changes from Ada 2005_
89234
89235 116.f/3
89236 {AI05-0044-1AI05-0044-1} Correction: Added wording to require
89237 the formal function be such that equal elements are also
89238 equivalent.
89239
89240 116.g/3
89241 {AI05-0044-1AI05-0044-1} Correction: Redefined "<" actuals to
89242 require a strict weak ordering; the old definition allowed
89243 indeterminant comparisons that would not have worked in a
89244 container.
89245
89246 116.h/3
89247 {AI05-0084-1AI05-0084-1} Correction: Added a pragma
89248 Remote_Types so that containers can be used in distributed
89249 programs.
89250
89251 \1f
89252 File: aarm2012.info, Node: A.18.10, Next: A.18.11, Prev: A.18.9, Up: A.18
89253
89254 A.18.10 The Generic Package Containers.Multiway_Trees
89255 -----------------------------------------------------
89256
89257 1/3
89258 {AI05-0136-1AI05-0136-1} The language-defined generic package
89259 Containers.Multiway_Trees provides private types Tree and Cursor, and a
89260 set of operations for each type. A multiway tree container is
89261 well-suited to represent nested structures.
89262
89263 1.a/3
89264 Discussion: {AI05-0136-1AI05-0136-1} This tree just provides a
89265 basic structure, and make no promises about balancing or other
89266 automatic organization. In this sense, it is different than
89267 the indexed (Map, Set) forms. Rather, it provides a building
89268 block on which to construct more complex and more specialized
89269 tree containers.
89270
89271 2/3
89272 {AI05-0136-1AI05-0136-1} A multiway tree container object manages a tree
89273 of internal nodes, each of which contains an element and pointers to the
89274 parent, first child, last child, next (successor) sibling, and previous
89275 (predecessor) sibling internal nodes. A cursor designates a particular
89276 node within a tree (and by extension the element contained in that node,
89277 if any). A cursor keeps designating the same node (and element) as long
89278 as the node is part of the container, even if the node is moved within
89279 the container.
89280
89281 3/3
89282 {AI05-0136-1AI05-0136-1} {AI05-0269-1AI05-0269-1} A subtree is a
89283 particular node (which roots the subtree) and all of its child nodes
89284 (including all of the children of the child nodes, recursively). There
89285 is a special node, the root, which is always present and has neither an
89286 associated element value nor any parent node. The root node provides a
89287 place to add nodes to an otherwise empty tree and represents the base of
89288 the tree.
89289
89290 4/3
89291 {AI05-0136-1AI05-0136-1} {AI05-0269-1AI05-0269-1} A node that has no
89292 children is called a leaf node. The ancestors of a node are the node
89293 itself, its parent node, the parent of the parent node, and so on until
89294 a node with no parent is reached. Similarly, the descendants of a node
89295 are the node itself, its child nodes, the children of each child node,
89296 and so on.
89297
89298 5/3
89299 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1}
89300 {AI05-0269-1AI05-0269-1} The nodes of a subtree can be visited in
89301 several different orders. For a depth-first order, after visiting a
89302 node, the nodes of its child list are each visited in depth-first order,
89303 with each child node visited in natural order (first child to last
89304 child).
89305
89306 5.a/3
89307 Ramification: For the depth-first order, when each child node
89308 is visited, the child list of the child node is visited before
89309 the next sibling of the child node is visited.
89310
89311 _Static Semantics_
89312
89313 6/3
89314 {AI05-0136-1AI05-0136-1} The generic library package
89315 Containers.Multiway_Trees has the following declaration:
89316
89317 7/3
89318 {AI05-0136-1AI05-0136-1} {AI05-0212-1AI05-0212-1} with Ada.Iterator_Interfaces;
89319 generic
89320 type Element_Type is private;
89321 with function "=" (Left, Right : Element_Type) return Boolean is <>;
89322 package Ada.Containers.Multiway_Trees is
89323 pragma Preelaborate(Multiway_Trees);
89324 pragma Remote_Types(Multiway_Trees);
89325
89326 8/3
89327 {AI05-0136-1AI05-0136-1} {AI05-0212-1AI05-0212-1} type Tree is tagged private
89328 with Constant_Indexing => Constant_Reference,
89329 Variable_Indexing => Reference,
89330 Default_Iterator => Iterate,
89331 Iterator_Element => Element_Type;
89332 pragma Preelaborable_Initialization(Tree);
89333
89334 9/3
89335 type Cursor is private;
89336 pragma Preelaborable_Initialization(Cursor);
89337
89338 10/3
89339 Empty_Tree : constant Tree;
89340
89341 11/3
89342 No_Element : constant Cursor;
89343
89344 12/3
89345 function Has_Element (Position : Cursor) return Boolean;
89346
89347 13/3
89348 {AI05-0212-1AI05-0212-1} package Tree_Iterator_Interfaces is new
89349 Ada.Iterator_Interfaces (Cursor, Has_Element);
89350
89351 14/3
89352 function Equal_Subtree (Left_Position : Cursor;
89353 Right_Position: Cursor) return Boolean;
89354
89355 15/3
89356 function "=" (Left, Right : Tree) return Boolean;
89357
89358 16/3
89359 function Is_Empty (Container : Tree) return Boolean;
89360
89361 17/3
89362 function Node_Count (Container : Tree) return Count_Type;
89363
89364 18/3
89365 function Subtree_Node_Count (Position : Cursor) return Count_Type;
89366
89367 19/3
89368 function Depth (Position : Cursor) return Count_Type;
89369
89370 20/3
89371 function Is_Root (Position : Cursor) return Boolean;
89372
89373 21/3
89374 function Is_Leaf (Position : Cursor) return Boolean;
89375
89376 22/3
89377 function Root (Container : Tree) return Cursor;
89378
89379 23/3
89380 procedure Clear (Container : in out Tree);
89381
89382 24/3
89383 function Element (Position : Cursor) return Element_Type;
89384
89385 25/3
89386 procedure Replace_Element (Container : in out Tree;
89387 Position : in Cursor;
89388 New_Item : in Element_Type);
89389
89390 26/3
89391 procedure Query_Element
89392 (Position : in Cursor;
89393 Process : not null access procedure (Element : in Element_Type));
89394
89395 27/3
89396 procedure Update_Element
89397 (Container : in out Tree;
89398 Position : in Cursor;
89399 Process : not null access procedure
89400 (Element : in out Element_Type));
89401
89402 28/3
89403 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
89404 (Element : not null access constant Element_Type) is private
89405 with Implicit_Dereference => Element;
89406
89407 29/3
89408 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
89409 with Implicit_Dereference => Element;
89410
89411 30/3
89412 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Tree;
89413 Position : in Cursor)
89414 return Constant_Reference_Type;
89415
89416 31/3
89417 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Tree;
89418 Position : in Cursor)
89419 return Reference_Type;
89420
89421 32/3
89422 procedure Assign (Target : in out Tree; Source : in Tree);
89423
89424 33/3
89425 function Copy (Source : Tree) return Tree;
89426
89427 34/3
89428 procedure Move (Target : in out Tree;
89429 Source : in out Tree);
89430
89431 35/3
89432 procedure Delete_Leaf (Container : in out Tree;
89433 Position : in out Cursor);
89434
89435 36/3
89436 procedure Delete_Subtree (Container : in out Tree;
89437 Position : in out Cursor);
89438
89439 37/3
89440 procedure Swap (Container : in out Tree;
89441 I, J : in Cursor);
89442
89443 38/3
89444 function Find (Container : Tree;
89445 Item : Element_Type)
89446 return Cursor;
89447
89448 39/3
89449 function Find_In_Subtree (Position : Cursor;
89450 Item : Element_Type)
89451 return Cursor;
89452
89453 40/3
89454 function Ancestor_Find (Position : Cursor;
89455 Item : Element_Type)
89456 return Cursor;
89457
89458 41/3
89459 function Contains (Container : Tree;
89460 Item : Element_Type) return Boolean;
89461
89462 42/3
89463 procedure Iterate
89464 (Container : in Tree;
89465 Process : not null access procedure (Position : in Cursor));
89466
89467 43/3
89468 procedure Iterate_Subtree
89469 (Position : in Cursor;
89470 Process : not null access procedure (Position : in Cursor));
89471
89472 44/3
89473 {AI05-0212-1AI05-0212-1} function Iterate (Container : in Tree)
89474 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
89475
89476 45/3
89477 {AI05-0212-1AI05-0212-1} function Iterate_Subtree (Position : in Cursor)
89478 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
89479
89480 46/3
89481 function Child_Count (Parent : Cursor) return Count_Type;
89482
89483 47/3
89484 function Child_Depth (Parent, Child : Cursor) return Count_Type;
89485
89486 48/3
89487 procedure Insert_Child (Container : in out Tree;
89488 Parent : in Cursor;
89489 Before : in Cursor;
89490 New_Item : in Element_Type;
89491 Count : in Count_Type := 1);
89492
89493 49/3
89494 procedure Insert_Child (Container : in out Tree;
89495 Parent : in Cursor;
89496 Before : in Cursor;
89497 New_Item : in Element_Type;
89498 Position : out Cursor;
89499 Count : in Count_Type := 1);
89500
89501 50/3
89502 procedure Insert_Child (Container : in out Tree;
89503 Parent : in Cursor;
89504 Before : in Cursor;
89505 Position : out Cursor;
89506 Count : in Count_Type := 1);
89507
89508 51/3
89509 procedure Prepend_Child (Container : in out Tree;
89510 Parent : in Cursor;
89511 New_Item : in Element_Type;
89512 Count : in Count_Type := 1);
89513
89514 52/3
89515 procedure Append_Child (Container : in out Tree;
89516 Parent : in Cursor;
89517 New_Item : in Element_Type;
89518 Count : in Count_Type := 1);
89519
89520 53/3
89521 procedure Delete_Children (Container : in out Tree;
89522 Parent : in Cursor);
89523
89524 54/3
89525 procedure Copy_Subtree (Target : in out Tree;
89526 Parent : in Cursor;
89527 Before : in Cursor;
89528 Source : in Cursor);
89529
89530 55/3
89531 procedure Splice_Subtree (Target : in out Tree;
89532 Parent : in Cursor;
89533 Before : in Cursor;
89534 Source : in out Tree;
89535 Position : in out Cursor);
89536
89537 56/3
89538 procedure Splice_Subtree (Container: in out Tree;
89539 Parent : in Cursor;
89540 Before : in Cursor;
89541 Position : in Cursor);
89542
89543 57/3
89544 procedure Splice_Children (Target : in out Tree;
89545 Target_Parent : in Cursor;
89546 Before : in Cursor;
89547 Source : in out Tree;
89548 Source_Parent : in Cursor);
89549
89550 58/3
89551 procedure Splice_Children (Container : in out Tree;
89552 Target_Parent : in Cursor;
89553 Before : in Cursor;
89554 Source_Parent : in Cursor);
89555
89556 59/3
89557 function Parent (Position : Cursor) return Cursor;
89558
89559 60/3
89560 function First_Child (Parent : Cursor) return Cursor;
89561
89562 61/3
89563 function First_Child_Element (Parent : Cursor) return Element_Type;
89564
89565 62/3
89566 function Last_Child (Parent : Cursor) return Cursor;
89567
89568 63/3
89569 function Last_Child_Element (Parent : Cursor) return Element_Type;
89570
89571 64/3
89572 function Next_Sibling (Position : Cursor) return Cursor;
89573
89574 65/3
89575 function Previous_Sibling (Position : Cursor) return Cursor;
89576
89577 66/3
89578 procedure Next_Sibling (Position : in out Cursor);
89579
89580 67/3
89581 procedure Previous_Sibling (Position : in out Cursor);
89582
89583 68/3
89584 procedure Iterate_Children
89585 (Parent : in Cursor;
89586 Process : not null access procedure (Position : in Cursor));
89587
89588 69/3
89589 procedure Reverse_Iterate_Children
89590 (Parent : in Cursor;
89591 Process : not null access procedure (Position : in Cursor));
89592
89593 70/3
89594 {AI05-0212-1AI05-0212-1} function Iterate_Children (Container : in Tree; Parent : in Cursor)
89595 return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
89596
89597 71/3
89598 private
89599 ... -- not specified by the language
89600 end Ada.Containers.Multiway_Trees;
89601
89602 72/3
89603 {AI05-0136-1AI05-0136-1} The actual function for the generic formal
89604 function "=" on Element_Type values is expected to define a reflexive
89605 and symmetric relationship and return the same result value each time it
89606 is called with a particular pair of values. If it behaves in some other
89607 manner, the functions Find, Reverse_Find, Equal_Subtree, and "=" on tree
89608 values return an unspecified value. The exact arguments and number of
89609 calls of this generic formal function by the functions Find,
89610 Reverse_Find, Equal_Subtree, and "=" on tree values are unspecified.
89611
89612 73/3
89613 {AI05-0136-1AI05-0136-1} The type Tree is used to represent trees. The
89614 type Tree needs finalization (see *note 7.6::).
89615
89616 74/3
89617 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} Empty_Tree represents
89618 the empty Tree object. It contains only the root node (Node_Count
89619 (Empty_Tree) returns 1). If an object of type Tree is not otherwise
89620 initialized, it is initialized to the same value as Empty_Tree.
89621
89622 75/3
89623 {AI05-0136-1AI05-0136-1} No_Element represents a cursor that designates
89624 no element. If an object of type Cursor is not otherwise initialized,
89625 it is initialized to the same value as No_Element.
89626
89627 76/3
89628 {AI05-0136-1AI05-0136-1} The predefined "=" operator for type Cursor
89629 returns True if both cursors are No_Element, or designate the same
89630 element in the same container.
89631
89632 77/3
89633 {AI05-0136-1AI05-0136-1} Execution of the default implementation of the
89634 Input, Output, Read, or Write attribute of type Cursor raises
89635 Program_Error.
89636
89637 78/3
89638 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
89639 {AI05-0262-1AI05-0262-1} Tree'Write for a Tree object T writes
89640 Node_Count(T) - 1 elements of the tree to the stream. It also may write
89641 additional information about the tree.
89642
89643 79/3
89644 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
89645 {AI05-0262-1AI05-0262-1} Tree'Read reads the representation of a tree
89646 from the stream, and assigns to Item a tree with the same elements and
89647 structure as was written by Tree'Write.
89648
89649 79.a/3
89650 Ramification: Streaming more elements than the container holds
89651 is wrong. For implementation implications of this rule, see
89652 the Implementation Note in *note A.18.2::.
89653
89654 80/3
89655 {AI05-0136-1AI05-0136-1} [Some operations of this generic package have
89656 access-to-subprogram parameters. To ensure such operations are
89657 well-defined, they guard against certain actions by the designated
89658 subprogram. In particular, some operations check for "tampering with
89659 cursors" of a container because they depend on the set of elements of
89660 the container remaining constant, and others check for "tampering with
89661 elements" of a container because they depend on elements of the
89662 container not being replaced.]
89663
89664 81/3
89665 {AI05-0136-1AI05-0136-1} A subprogram is said to tamper with cursors of
89666 a tree object T if:
89667
89668 82/3
89669 * it inserts or deletes elements of T, that is, it calls the Clear,
89670 Delete_Leaf, Insert_Child, Delete_Children, Delete_Subtree, or
89671 Copy_Subtree procedures with T as a parameter; or
89672
89673 82.a/3
89674 To be honest: Operations which are defined to be equivalent to
89675 a call on one of these operations also are included.
89676 Similarly, operations which call one of these as part of their
89677 definition are included.
89678
89679 83/3
89680 * {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} it reorders the
89681 elements of T, that is, it calls the Splice_Subtree or
89682 Splice_Children procedures with T as a parameter; or
89683
89684 84/3
89685 * it finalizes T; or
89686
89687 85/3
89688 * it calls Assign with T as the Target parameter; or
89689
89690 85.a.1/3
89691 Ramification: We don't need to explicitly mention
89692 assignment_statement, because that finalizes the target object
89693 as part of the operation, and finalization of an object is
89694 already defined as tampering with cursors.
89695
89696 86/3
89697 * it calls the Move procedure with T as a parameter.
89698
89699 86.a/3
89700 Reason: Swap copies elements rather than reordering them, so
89701 it doesn't tamper with cursors.
89702
89703 87/3
89704 {AI05-0136-1AI05-0136-1} A subprogram is said to tamper with elements of
89705 a tree object T if:
89706
89707 88/3
89708 * it tampers with cursors of T; or
89709
89710 89/3
89711 * it replaces one or more elements of T, that is, it calls the
89712 Replace_Element or Swap procedures with T as a parameter.
89713
89714 89.a/3
89715 Reason: Complete replacement of an element can cause its
89716 memory to be deallocated while another operation is holding
89717 onto a reference to it. That can't be allowed. However, a
89718 simple modification of (part of) an element is not a problem,
89719 so Update_Element does not cause a problem.
89720
89721 89.a.1/3
89722 Ramification: Assign is defined in terms of Clear and
89723 Replace_Element, so we don't need to mention it explicitly.
89724 Similarly, we don't need to explicitly mention
89725 assignment_statement, because that finalizes the target object
89726 as part of the operation, and finalization of an object is
89727 already defined as tampering with the element.
89728
89729 90/3
89730 {AI05-0265-1AI05-0265-1} When tampering with cursors is prohibited for a
89731 particular tree object T, Program_Error is propagated by a call of any
89732 language-defined subprogram that is defined to tamper with the cursors
89733 of T, leaving T unmodified. Similarly, when tampering with elements is
89734 prohibited for a particular tree object T, Program_Error is propagated
89735 by a call of any language-defined subprogram that is defined to tamper
89736 with the elements of T [(or tamper with the cursors of T)], leaving T
89737 unmodified.
89738
89739 90.a/3
89740 Proof: Tampering with elements includes tampering with
89741 cursors, so we mention it only from completeness in the second
89742 sentence.
89743
89744 91/3
89745 function Has_Element (Position : Cursor) return Boolean;
89746
89747 92/3
89748 Returns True if Position designates an element, and returns
89749 False otherwise. [In particular, Has_Element returns False if
89750 the cursor designates a root node or equals No_Element.]
89751
89752 92.a/3
89753 To be honest: {AI05-0005-1AI05-0005-1}
89754 {AI05-0136-1AI05-0136-1} This function might not detect
89755 cursors that designate deleted elements; such cursors are
89756 invalid (see below) and the result of calling Has_Element with
89757 an invalid cursor is unspecified (but not erroneous).
89758
89759 93/3
89760 function Equal_Subtree (Left_Position : Cursor;
89761 Right_Position: Cursor) return Boolean;
89762
89763 94/3
89764 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
89765 {AI05-0262-1AI05-0262-1} {AI05-0264-1AI05-0264-1} If
89766 Left_Position or Right_Position equals No_Element, propagates
89767 Constraint_Error. If the number of child nodes of the element
89768 designated by Left_Position is different from the number of
89769 child nodes of the element designated by Right_Position, the
89770 function returns False. If Left_Position designates a root
89771 node and Right_Position does not, the function returns False.
89772 If Right_Position designates a root node and Left_Position
89773 does not, the function returns False. Unless both cursors
89774 designate a root node, the elements are compared using the
89775 generic formal equality operator. If the result of the
89776 element comparison is False, the function returns False.
89777 Otherwise, it calls Equal_Subtree on a cursor designating each
89778 child element of the element designated by Left_Position and a
89779 cursor designating the corresponding child element of the
89780 element designated by Right_Position. If any such call
89781 returns False, the function returns False; otherwise, it
89782 returns True. Any exception raised during the evaluation of
89783 element equality is propagated.
89784
89785 94.a/3
89786 Ramification: Left_Position and Right_Position do not need to
89787 be from the same tree.
89788
89789 94.b/3
89790 Implementation Note: This wording describes the canonical
89791 semantics. However, the order and number of calls on the
89792 formal equality function is unspecified for all of the
89793 operations that use it in this package, so an implementation
89794 can call it as many or as few times as it needs to get the
89795 correct answer. Similarly, a global rule (see the
89796 introduction of *note Annex A::) says that language-defined
89797 routines are not affected by overriding of other
89798 language-defined routines. This means that no reasonable
89799 program can tell how many times Equal_Subtree is called, and
89800 thus an implementation can call it as many or as few times as
89801 it needs to get the correct answer. Specifically, there is no
89802 requirement to call the formal equality or Equal_Subtree
89803 additional times once the answer has been determined.
89804
89805 95/3
89806 function "=" (Left, Right : Tree) return Boolean;
89807
89808 96/3
89809 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1} If Left and
89810 Right denote the same tree object, then the function returns
89811 True. Otherwise, it calls Equal_Subtree with cursors
89812 designating the root nodes of Left and Right; the result is
89813 returned. Any exception raised during the evaluation of
89814 Equal_Subtree is propagated.
89815
89816 96.a/3
89817 Implementation Note: Similar considerations apply here as
89818 apply to Equal_Subtree. The actual number of calls performed
89819 is unspecified.
89820
89821 97/3
89822 function Node_Count (Container : Tree) return Count_Type;
89823
89824 98/3
89825 {AI05-0136-1AI05-0136-1} Node_Count returns the number of
89826 nodes in Container.
89827
89828 98.a/3
89829 Ramification: Since all tree objects have a root node, this
89830 can never return a value of 0. Node_Count (Some_Tree) should
89831 always equal Subtree_Node_Count (Root (Some_Tree)).
89832
89833 99/3
89834 function Subtree_Node_Count (Position : Cursor) return Count_Type;
89835
89836 100/3
89837 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Position
89838 is No_Element, Subtree_Node_Count returns 0; otherwise,
89839 Subtree_Node_Count returns the number of nodes in the subtree
89840 that is rooted by Position.
89841
89842 101/3
89843 function Is_Empty (Container : Tree) return Boolean;
89844
89845 102/3
89846 {AI05-0136-1AI05-0136-1} Equivalent to Node_Count (Container)
89847 = 1.
89848
89849 102.a/3
89850 Ramification: An empty tree contains just the root node.
89851
89852 103/3
89853 function Depth (Position : Cursor) return Count_Type;
89854
89855 104/3
89856 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Position
89857 equals No_Element, Depth returns 0; otherwise, Depth returns
89858 the number of ancestor nodes of the node designated by
89859 Position (including the node itself).
89860
89861 104.a/3
89862 Ramification: Depth (Root (Some_Tree)) = 1.
89863
89864 105/3
89865 function Is_Root (Position : Cursor) return Boolean;
89866
89867 106/3
89868 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} Is_Root
89869 returns True if the Position designates the root node of some
89870 tree; and returns False otherwise.
89871
89872 107/3
89873 function Is_Leaf (Position : Cursor) return Boolean;
89874
89875 108/3
89876 {AI05-0136-1AI05-0136-1} Is_Leaf returns True if Position
89877 designates a node that does not have any child nodes; and
89878 returns False otherwise.
89879
89880 108.a/3
89881 Ramification: Is_Leaf returns False if passed No_Element,
89882 since No_Element does not designate a node. Is_Leaf can be
89883 passed a cursor that designates the root node; Is_Leaf will
89884 return True if passed the root node of an empty tree.
89885
89886 109/3
89887 function Root (Container : Tree) return Cursor;
89888
89889 110/3
89890 {AI05-0136-1AI05-0136-1} Root returns a cursor that designates
89891 the root node of Container.
89892
89893 110.a/3
89894 Ramification: There is always a root node, even in an empty
89895 container, so this function never returns No_Element.
89896
89897 111/3
89898 procedure Clear (Container : in out Tree);
89899
89900 112/3
89901 {AI05-0136-1AI05-0136-1} Removes all the elements from
89902 Container.
89903
89904 112.a/3
89905 Ramification: The root node is not removed; all trees have a
89906 root node.
89907
89908 113/3
89909 function Element (Position : Cursor) return Element_Type;
89910
89911 114/3
89912 {AI05-0136-1AI05-0136-1} If Position equals No_Element, then
89913 Constraint_Error is propagated; if Position designates the
89914 root node of a tree, then Program_Error is propagated.
89915 Otherwise, Element returns the element designated by Position.
89916
89917 114.a/3
89918 Ramification: The root node does not contain an element, so
89919 that value cannot be read or written.
89920
89921 115/3
89922 procedure Replace_Element (Container : in out Tree;
89923 Position : in Cursor;
89924 New_Item : in Element_Type);
89925
89926 116/3
89927 {AI05-0136-1AI05-0136-1} {AI05-0264-1AI05-0264-1} If Position
89928 equals No_Element, then Constraint_Error is propagated; if
89929 Position does not designate an element in Container (including
89930 if it designates the root node), then Program_Error is
89931 propagated. Otherwise, Replace_Element assigns the value
89932 New_Item to the element designated by Position.
89933
89934 117/3
89935 procedure Query_Element
89936 (Position : in Cursor;
89937 Process : not null access procedure (Element : in Element_Type));
89938
89939 118/3
89940 {AI05-0136-1AI05-0136-1} {AI05-0265-1AI05-0265-1} If Position
89941 equals No_Element, then Constraint_Error is propagated; if
89942 Position designates the root node of a tree, then
89943 Program_Error is propagated. Otherwise, Query_Element calls
89944 Process.all with the element designated by Position as the
89945 argument. Tampering with the elements of the tree that
89946 contains the element designated by Position is prohibited
89947 during the execution of the call on Process.all. Any
89948 exception raised by Process.all is propagated.
89949
89950 119/3
89951 procedure Update_Element
89952 (Container : in out Tree;
89953 Position : in Cursor;
89954 Process : not null access procedure
89955 (Element : in out Element_Type));
89956
89957 120/3
89958 {AI05-0136-1AI05-0136-1} {AI05-0264-1AI05-0264-1}
89959 {AI05-0265-1AI05-0265-1} If Position equals No_Element, then
89960 Constraint_Error is propagated; if Position does not designate
89961 an element in Container (including if it designates the root
89962 node), then Program_Error is propagated. Otherwise,
89963 Update_Element calls Process.all with the element designated
89964 by Position as the argument. Tampering with the elements of
89965 Container is prohibited during the execution of the call on
89966 Process.all. Any exception raised by Process.all is
89967 propagated.
89968
89969 121/3
89970 If Element_Type is unconstrained and definite, then the actual
89971 Element parameter of Process.all shall be unconstrained.
89972
89973 121.a/3
89974 Ramification: This means that the elements cannot be directly
89975 allocated from the heap; it must be possible to change the
89976 discriminants of the element in place.
89977
89978 122/3
89979 type Constant_Reference_Type
89980 (Element : not null access constant Element_Type) is private
89981 with Implicit_Dereference => Element;
89982
89983 123/3
89984 type Reference_Type (Element : not null access Element_Type) is private
89985 with Implicit_Dereference => Element;
89986
89987 124/3
89988 {AI05-0212-1AI05-0212-1} The types Constant_Reference_Type and
89989 Reference_Type need finalization.
89990
89991 125/3
89992 The default initialization of an object of type
89993 Constant_Reference_Type or Reference_Type propagates
89994 Program_Error.
89995
89996 125.a/3
89997 Reason: It is expected that Reference_Type (and
89998 Constant_Reference_Type) will be a controlled type, for which
89999 finalization will have some action to terminate the tampering
90000 check for the associated container. If the object is created
90001 by default, however, there is no associated container. Since
90002 this is useless, and supporting this case would take extra
90003 work, we define it to raise an exception.
90004
90005 126/3
90006 function Constant_Reference (Container : aliased in Tree;
90007 Position : in Cursor)
90008 return Constant_Reference_Type;
90009
90010 127/3
90011 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
90012 function (combined with the Constant_Indexing and
90013 Implicit_Dereference aspects) provides a convenient way to
90014 gain read access to an individual element of a tree given a
90015 cursor.
90016
90017 128/3
90018 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
90019 equals No_Element, then Constraint_Error is propagated; if
90020 Position does not designate an element in Container, then
90021 Program_Error is propagated. Otherwise, Constant_Reference
90022 returns an object whose discriminant is an access value that
90023 designates the element designated by Position. Tampering with
90024 the elements of Container is prohibited while the object
90025 returned by Constant_Reference exists and has not been
90026 finalized.
90027
90028 129/3
90029 function Reference (Container : aliased in out Tree;
90030 Position : in Cursor)
90031 return Reference_Type;
90032
90033 130/3
90034 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} This
90035 function (combined with the Variable_Indexing and
90036 Implicit_Dereference aspects) provides a convenient way to
90037 gain read and write access to an individual element of a tree
90038 given a cursor.
90039
90040 131/3
90041 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1} If Position
90042 equals No_Element, then Constraint_Error is propagated; if
90043 Position does not designate an element in Container, then
90044 Program_Error is propagated. Otherwise, Reference returns an
90045 object whose discriminant is an access value that designates
90046 the element designated by Position. Tampering with the
90047 elements of Container is prohibited while the object returned
90048 by Reference exists and has not been finalized.
90049
90050 132/3
90051 procedure Assign (Target : in out Tree; Source : in Tree);
90052
90053 133/3
90054 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Target
90055 denotes the same object as Source, the operation has no
90056 effect. Otherwise, the elements of Source are copied to
90057 Target as for an assignment_statement assigning Source to
90058 Target.
90059
90060 133.a/3
90061 Ramification: Each element in Target has a parent element that
90062 corresponds to the parent element of the Source element, and
90063 has child elements that correspond to the child elements of
90064 the Source element.
90065
90066 133.b/3
90067 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
90068 compatibility with the bounded tree container. For an
90069 unbounded tree, Assign(A, B) and A := B behave identically.
90070 For a bounded tree, := will raise an exception if the
90071 container capacities are different, while Assign will not
90072 raise an exception if there is enough room in the target.
90073
90074 134/3
90075 function Copy (Source : Tree) return Tree;
90076
90077 135/3
90078 {AI05-0136-1AI05-0136-1} Returns a tree with the same
90079 structure as Source and whose elements are initialized from
90080 the corresponding elements of Source.
90081
90082 136/3
90083 procedure Move (Target : in out Tree;
90084 Source : in out Tree);
90085
90086 137/3
90087 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Target
90088 denotes the same object as Source, then the operation has no
90089 effect. Otherwise, Move first calls Clear (Target). Then,
90090 the nodes other than the root node in Source are moved to
90091 Target (in the same positions). After Move completes,
90092 Node_Count (Target) is the number of nodes originally in
90093 Source, and Node_Count (Source) is 1.
90094
90095 138/3
90096 procedure Delete_Leaf (Container : in out Tree;
90097 Position : in out Cursor);
90098
90099 139/3
90100 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Position
90101 equals No_Element, then Constraint_Error is propagated; if
90102 Position does not designate an element in Container (including
90103 if it designates the root node), then Program_Error is
90104 propagated. If the element designated by position has any
90105 child elements, then Constraint_Error is propagated.
90106 Otherwise, Delete_Leaf removes (from Container) the element
90107 designated by Position. Finally, Position is set to
90108 No_Element.
90109
90110 139.a/3
90111 Ramification: The check on Position checks that the cursor
90112 does not belong to some other Container. This check implies
90113 that a reference to the container is included in the cursor
90114 value. This wording is not meant to require detection of
90115 dangling cursors; such cursors are defined to be invalid,
90116 which means that execution is erroneous, and any result is
90117 allowed (including not raising an exception).
90118
90119 139.b/3
90120 The root node cannot be deleted.
90121
90122 140/3
90123 procedure Delete_Subtree (Container : in out Tree;
90124 Position : in out Cursor);
90125
90126 141/3
90127 {AI05-0136-1AI05-0136-1} {AI05-0264-1AI05-0264-1}
90128 {AI05-0269-1AI05-0269-1} If Position equals No_Element, then
90129 Constraint_Error is propagated. If Position does not
90130 designate an element in Container (including if it designates
90131 the root node), then Program_Error is propagated. Otherwise,
90132 Delete_Subtree removes (from Container) the subtree designated
90133 by Position (that is, all descendants of the node designated
90134 by Position including the node itself), and Position is set to
90135 No_Element.
90136
90137 141.a/3
90138 Ramification: The root node cannot be deleted. To delete the
90139 entire contents of the tree, call Clear(Container).
90140
90141 142/3
90142 procedure Swap (Container : in out Tree;
90143 I, J : in Cursor);
90144
90145 143/3
90146 {AI05-0136-1AI05-0136-1} If either I or J equals No_Element,
90147 then Constraint_Error is propagated. If either I or J do not
90148 designate an element in Container (including if either
90149 designates the root node), then Program_Error is propagated.
90150 Otherwise, Swap exchanges the values of the elements
90151 designated by I and J.
90152
90153 143.a/3
90154 Ramification: After a call to Swap, I designates the element
90155 value previously designated by J, and J designates the element
90156 value previously designated by I. The position of the elements
90157 do not change; for instance, the parent node and the first
90158 child node of I are unchanged by the operation.
90159
90160 143.b/3
90161 The root nodes do not contain element values, so they cannot
90162 be swapped.
90163
90164 143.c/3
90165 To be honest: The implementation is not required to actually
90166 copy the elements if it can do the swap some other way. But
90167 it is allowed to copy the elements if needed.
90168
90169 144/3
90170 function Find (Container : Tree;
90171 Item : Element_Type)
90172 return Cursor;
90173
90174 145/3
90175 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1} Find
90176 searches the elements of Container for an element equal to
90177 Item (using the generic formal equality operator). The search
90178 starts at the root node. The search traverses the tree in a
90179 depth-first order. If no equal element is found, then Find
90180 returns No_Element. Otherwise, it returns a cursor
90181 designating the first equal element encountered.
90182
90183 146/3
90184 function Find_In_Subtree (Position : Cursor;
90185 Item : Element_Type)
90186 return Cursor;
90187
90188 147/3
90189 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90190 {AI05-0262-1AI05-0262-1} If Position equals No_Element, then
90191 Constraint_Error is propagated. Find_In_Subtree searches the
90192 subtree rooted by Position for an element equal to Item (using
90193 the generic formal equality operator). The search starts at
90194 the element designated by Position. The search traverses the
90195 subtree in a depth-first order. If no equal element is found,
90196 then Find returns No_Element. Otherwise, it returns a cursor
90197 designating the first equal element encountered.
90198
90199 147.a/3
90200 Ramification: Find_In_Subtree does not check any siblings of
90201 the element designated by Position. The root node does not
90202 contain an element, and therefore it can never be returned,
90203 but it can be explicitly passed to Position.
90204
90205 148/3
90206 function Ancestor_Find (Position : Cursor;
90207 Item : Element_Type)
90208 return Cursor;
90209
90210 149/3
90211 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Position
90212 equals No_Element, then Constraint_Error is propagated.
90213 Otherwise, Ancestor_Find searches for an element equal to Item
90214 (using the generic formal equality operator). The search
90215 starts at the node designated by Position, and checks each
90216 ancestor proceeding toward the root of the subtree. If no
90217 equal element is found, then Ancestor_Find returns No_Element.
90218 Otherwise, it returns a cursor designating the first equal
90219 element encountered.
90220
90221 149.a/3
90222 Ramification: {AI05-0248-1AI05-0248-1} No_Element is returned
90223 if Position is the root node.
90224
90225 150/3
90226 function Contains (Container : Tree;
90227 Item : Element_Type) return Boolean;
90228
90229 151/3
90230 {AI05-0136-1AI05-0136-1} Equivalent to Find (Container, Item)
90231 /= No_Element.
90232
90233 152/3
90234 procedure Iterate
90235 (Container : in Tree;
90236 Process : not null access procedure (Position : in Cursor));
90237
90238 153/3
90239 {AI05-0136-1AI05-0136-1} {AI05-0265-1AI05-0265-1} Iterate
90240 calls Process.all with a cursor that designates each element
90241 in Container, starting with the root node and proceeding in a
90242 depth-first order. Tampering with the cursors of Container is
90243 prohibited during the execution of a call on Process.all. Any
90244 exception raised by Process.all is propagated.
90245
90246 153.a/3
90247 Ramification: Process is not called with the root node, which
90248 does not have an associated element.
90249
90250 153.b/3
90251 Implementation Note: The purpose of the tamper with cursors
90252 check is to prevent erroneous execution from the Position
90253 parameter of Process.all becoming invalid. This check takes
90254 place when the operations that tamper with the cursors of the
90255 container are called. The check cannot be made later (say in
90256 the body of Iterate), because that could cause the Position
90257 cursor to be invalid and potentially cause execution to become
90258 erroneous -- defeating the purpose of the check.
90259
90260 153.c/3
90261 See Iterate for vectors (*note A.18.2::) for a suggested
90262 implementation of the check.
90263
90264 154/3
90265 procedure Iterate_Subtree
90266 (Position : in Cursor;
90267 Process : not null access procedure (Position : in Cursor));
90268
90269 155/3
90270 {AI05-0136-1AI05-0136-1} {AI05-0265-1AI05-0265-1} If Position
90271 equals No_Element, then Constraint_Error is propagated.
90272 Otherwise, Iterate_Subtree calls Process.all with a cursor
90273 that designates each element in the subtree rooted by the node
90274 designated by Position, starting with the node designated by
90275 Position and proceeding in a depth-first order. Tampering
90276 with the cursors of the tree that contains the element
90277 designated by Position is prohibited during the execution of a
90278 call on Process.all. Any exception raised by Process.all is
90279 propagated.
90280
90281 155.a/3
90282 Ramification: Position can be passed a cursor designating the
90283 root node; in that case, Process is not called with the root
90284 node, which does not have an associated element.
90285
90286 156/3
90287 function Iterate (Container : in Tree)
90288 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
90289
90290 157/3
90291 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
90292 {AI05-0269-1AI05-0269-1} Iterate returns an iterator object
90293 (see *note 5.5.1::) that will generate a value for a loop
90294 parameter (see *note 5.5.2::) designating each node in
90295 Container, starting with the root node and proceeding in a
90296 depth-first order. Tampering with the cursors of Container is
90297 prohibited while the iterator object exists (in particular, in
90298 the sequence_of_statements of the loop_statement whose
90299 iterator_specification denotes this object). The iterator
90300 object needs finalization.
90301
90302 157.a/3
90303 Discussion: Exits are allowed from the loops created using the
90304 iterator objects. In particular, to stop the iteration at a
90305 particular cursor, just add
90306
90307 157.b/3
90308 exit when Cur = Stop;
90309
90310 157.c/3
90311 in the body of the loop (assuming that Cur is the loop
90312 parameter and Stop is the cursor that you want to stop at).
90313
90314 158/3
90315 function Iterate_Subtree (Position : in Cursor)
90316 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
90317
90318 159/3
90319 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
90320 {AI05-0269-1AI05-0269-1} If Position equals No_Element, then
90321 Constraint_Error is propagated. Otherwise, Iterate_Subtree
90322 returns an iterator object (see *note 5.5.1::) that will
90323 generate a value for a loop parameter (see *note 5.5.2::)
90324 designating each element in the subtree rooted by the node
90325 designated by Position, starting with the node designated by
90326 Position and proceeding in a depth-first order. If Position
90327 equals No_Element, then Constraint_Error is propagated.
90328 Tampering with the cursors of the container that contains the
90329 node designated by Position is prohibited while the iterator
90330 object exists (in particular, in the sequence_of_statements of
90331 the loop_statement whose iterator_specification denotes this
90332 object). The iterator object needs finalization.
90333
90334 160/3
90335 function Child_Count (Parent : Cursor) return Count_Type;
90336
90337 161/3
90338 {AI05-0136-1AI05-0136-1} Child_Count returns the number of
90339 child nodes of the node designated by Parent.
90340
90341 162/3
90342 function Child_Depth (Parent, Child : Cursor) return Count_Type;
90343
90344 163/3
90345 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1} If Child or
90346 Parent is equal to No_Element, then Constraint_Error is
90347 propagated. Otherwise, Child_Depth returns the number of
90348 ancestor nodes of Child (including Child itself), up to but
90349 not including Parent; Program_Error is propagated if Parent is
90350 not an ancestor of Child.
90351
90352 163.a/3
90353 Ramification: Program_Error is propagated if Parent and Child
90354 are nodes in different containers.
90355
90356 163.b/3
90357 Child_Depth (Root (Some_Tree), Child) + 1 = Depth (Child) as
90358 the root is not counted.
90359
90360 164/3
90361 procedure Insert_Child (Container : in out Tree;
90362 Parent : in Cursor;
90363 Before : in Cursor;
90364 New_Item : in Element_Type;
90365 Count : in Count_Type := 1);
90366
90367 165/3
90368 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90369 {AI05-0262-1AI05-0262-1} If Parent equals No_Element, then
90370 Constraint_Error is propagated. If Parent does not designate
90371 a node in Container, then Program_Error is propagated. If
90372 Before is not equal to No_Element, and does not designate a
90373 node in Container, then Program_Error is propagated. If
90374 Before is not equal to No_Element, and Parent does not
90375 designate the parent node of the node designated by Before,
90376 then Constraint_Error is propagated. Otherwise, Insert_Child
90377 allocates Count nodes containing copies of New_Item and
90378 inserts them as children of Parent. If Parent already has
90379 child nodes, then the new nodes are inserted prior to the node
90380 designated by Before, or, if Before equals No_Element, the new
90381 nodes are inserted after the last existing child node of
90382 Parent. Any exception raised during allocation of internal
90383 storage is propagated, and Container is not modified.
90384
90385 166/3
90386 procedure Insert_Child (Container : in out Tree;
90387 Parent : in Cursor;
90388 Before : in Cursor;
90389 New_Item : in Element_Type;
90390 Position : out Cursor;
90391 Count : in Count_Type := 1);
90392
90393 167/3
90394 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90395 {AI05-0257-1AI05-0257-1} {AI05-0262-1AI05-0262-1} If Parent
90396 equals No_Element, then Constraint_Error is propagated. If
90397 Parent does not designate a node in Container, then
90398 Program_Error is propagated. If Before is not equal to
90399 No_Element, and does not designate a node in Container, then
90400 Program_Error is propagated. If Before is not equal to
90401 No_Element, and Parent does not designate the parent node of
90402 the node designated by Before, then Constraint_Error is
90403 propagated. Otherwise, Insert_Child allocates Count nodes
90404 containing copies of New_Item and inserts them as children of
90405 Parent. If Parent already has child nodes, then the new nodes
90406 are inserted prior to the node designated by Before, or, if
90407 Before equals No_Element, the new nodes are inserted after the
90408 last existing child node of Parent. Position designates the
90409 first newly-inserted node, or if Count equals 0, then Position
90410 is assigned the value of Before. Any exception raised during
90411 allocation of internal storage is propagated, and Container is
90412 not modified.
90413
90414 168/3
90415 procedure Insert_Child (Container : in out Tree;
90416 Parent : in Cursor;
90417 Before : in Cursor;
90418 Position : out Cursor;
90419 Count : in Count_Type := 1);
90420
90421 169/3
90422 {AI05-0136-1AI05-0136-1} {AI05-0257-1AI05-0257-1}
90423 {AI05-0262-1AI05-0262-1} {AI05-0264-1AI05-0264-1} If Parent
90424 equals No_Element, then Constraint_Error is propagated. If
90425 Parent does not designate a node in Container, then
90426 Program_Error is propagated. If Before is not equal to
90427 No_Element, and does not designate a node in Container, then
90428 Program_Error is propagated. If Before is not equal to
90429 No_Element, and Parent does not designate the parent node of
90430 the node designated by Before, then Constraint_Error is
90431 propagated. Otherwise, Insert_Child allocates Count nodes,
90432 the elements contained in the new nodes are initialized by
90433 default (see *note 3.3.1::), and the new nodes are inserted as
90434 children of Parent. If Parent already has child nodes, then
90435 the new nodes are inserted prior to the node designated by
90436 Before, or, if Before equals No_Element, the new nodes are
90437 inserted after the last existing child node of Parent.
90438 Position designates the first newly-inserted node, or if Count
90439 equals 0, then Position is assigned the value of Before. Any
90440 exception raised during allocation of internal storage is
90441 propagated, and Container is not modified.
90442
90443 170/3
90444 procedure Prepend_Child (Container : in out Tree;
90445 Parent : in Cursor;
90446 New_Item : in Element_Type;
90447 Count : in Count_Type := 1);
90448
90449 171/3
90450 {AI05-0136-1AI05-0136-1} Equivalent to Insert_Child
90451 (Container, Parent, First_Child (Container, Parent), New_Item,
90452 Count).
90453
90454 172/3
90455 procedure Append_Child (Container : in out Tree;
90456 Parent : in Cursor;
90457 New_Item : in Element_Type;
90458 Count : in Count_Type := 1);
90459
90460 173/3
90461 {AI05-0136-1AI05-0136-1} {AI05-0269-1AI05-0269-1} Equivalent
90462 to Insert_Child (Container, Parent, No_Element, New_Item,
90463 Count).
90464
90465 174/3
90466 procedure Delete_Children (Container : in out Tree;
90467 Parent : in Cursor);
90468
90469 175/3
90470 {AI05-0136-1AI05-0136-1} If Parent equals No_Element, then
90471 Constraint_Error is propagated. If Parent does not designate
90472 a node in Container, Program_Error is propagated. Otherwise,
90473 Delete_Children removes (from Container) all of the
90474 descendants of Parent other than Parent itself.
90475
90476 175.a/3
90477 Discussion: This routine deletes all of the child subtrees of
90478 Parent at once. Use Delete_Subtree to delete an individual
90479 subtree.
90480
90481 176/3
90482 procedure Copy_Subtree (Target : in out Tree;
90483 Parent : in Cursor;
90484 Before : in Cursor;
90485 Source : in Cursor);
90486
90487 177/3
90488 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90489 {AI05-0262-1AI05-0262-1} If Parent equals No_Element, then
90490 Constraint_Error is propagated. If Parent does not designate
90491 a node in Target, then Program_Error is propagated. If Before
90492 is not equal to No_Element, and does not designate a node in
90493 Target, then Program_Error is propagated. If Before is not
90494 equal to No_Element, and Parent does not designate the parent
90495 node of the node designated by Before, then Constraint_Error
90496 is propagated. If Source designates a root node, then
90497 Constraint_Error is propagated. If Source is equal to
90498 No_Element, then the operation has no effect. Otherwise, the
90499 subtree rooted by Source (which can be from any tree; it does
90500 not have to be a subtree of Target) is copied (new nodes are
90501 allocated to create a new subtree with the same structure as
90502 the Source subtree, with each element initialized from the
90503 corresponding element of the Source subtree) and inserted into
90504 Target as a child of Parent. If Parent already has child
90505 nodes, then the new nodes are inserted prior to the node
90506 designated by Before, or, if Before equals No_Element, the new
90507 nodes are inserted after the last existing child node of
90508 Parent. The parent of the newly created subtree is set to
90509 Parent, and the overall count of Target is incremented by
90510 Subtree_Node_Count (Source). Any exception raised during
90511 allocation of internal storage is propagated, and Container is
90512 not modified.
90513
90514 177.a/3
90515 Discussion: We only need one routine here, as the source
90516 object is not modified, so we can use the same routine for
90517 both copying within and between containers.
90518
90519 177.b/3
90520 Ramification: We do not allow copying a subtree that includes
90521 a root node, as that would require inserting a node with no
90522 value in the middle of the target tree. To copy an entire
90523 tree to another tree object, use Copy.
90524
90525 178/3
90526 procedure Splice_Subtree (Target : in out Tree;
90527 Parent : in Cursor;
90528 Before : in Cursor;
90529 Source : in out Tree;
90530 Position : in out Cursor);
90531
90532 179/3
90533 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90534 {AI05-0262-1AI05-0262-1} {AI05-0269-1AI05-0269-1} If Parent
90535 equals No_Element, then Constraint_Error is propagated. If
90536 Parent does not designate a node in Target, then Program_Error
90537 is propagated. If Before is not equal to No_Element, and does
90538 not designate a node in Target, then Program_Error is
90539 propagated. If Before is not equal to No_Element, and Parent
90540 does not designate the parent node of the node designated by
90541 Before, then Constraint_Error is propagated. If Position
90542 equals No_Element, Constraint_Error is propagated. If
90543 Position does not designate a node in Source or designates a
90544 root node, then Program_Error is propagated. If Source
90545 denotes the same object as Target, then: if Position equals
90546 Before there is no effect; if Position designates an ancestor
90547 of Parent (including Parent itself), Constraint_Error is
90548 propagated; otherwise, the subtree rooted by the element
90549 designated by Position is moved to be a child of Parent. If
90550 Parent already has child nodes, then the moved nodes are
90551 inserted prior to the node designated by Before, or, if Before
90552 equals No_Element, the moved nodes are inserted after the last
90553 existing child node of Parent. In each of these cases,
90554 Position and the count of Target are unchanged, and the parent
90555 of the element designated by Position is set to Parent.
90556
90557 179.a/3
90558 Reason: We can't allow moving the subtree of Position to a
90559 proper descendant node of the subtree, as the descendant node
90560 will be part of the subtree being moved. The result would be
90561 a circularly linked tree, or one with inaccessible nodes.
90562 Thus we have to check Position against Parent, even though
90563 such a check is O(Depth(Source)).
90564
90565 180/3
90566 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} Otherwise
90567 (if Source does not denote the same object as Target), the
90568 subtree designated by Position is removed from Source and
90569 moved to Target. The subtree is inserted as a child of
90570 Parent. If Parent already has child nodes, then the moved
90571 nodes are inserted prior to the node designated by Before, or,
90572 if Before equals No_Element, the moved nodes are inserted
90573 after the last existing child node of Parent. In each of
90574 these cases, the count of Target is incremented by
90575 Subtree_Node_Count (Position), and the count of Source is
90576 decremented by Subtree_Node_Count (Position), Position is
90577 updated to represent an element in Target.
90578
90579 180.a/3
90580 Ramification: If Source is the same as Target, and Position =
90581 Before, or Next_Sibling(Position) = Before, Splice_Subtree has
90582 no effect, as the subtree does not have to move to meet the
90583 postcondition.
90584
90585 180.b/3
90586 We do not allow splicing a subtree that includes a root node,
90587 as that would require inserting a node with no value in the
90588 middle of the target tree. Splice the children of the root
90589 node instead.
90590
90591 180.c/3
90592 For this reason there is no operation to splice an entire
90593 tree, as that would necessarily involve splicing a root node.
90594
90595 181/3
90596 procedure Splice_Subtree (Container: in out Tree;
90597 Parent : in Cursor;
90598 Before : in Cursor;
90599 Position : in Cursor);
90600
90601 182/3
90602 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90603 {AI05-0262-1AI05-0262-1} {AI05-0269-1AI05-0269-1} If Parent
90604 equals No_Element, then Constraint_Error is propagated. If
90605 Parent does not designate a node in Container, then
90606 Program_Error is propagated. If Before is not equal to
90607 No_Element, and does not designate a node in Container, then
90608 Program_Error is propagated. If Before is not equal to
90609 No_Element, and Parent does not designate the parent node of
90610 the node designated by Before, then Constraint_Error is
90611 propagated. If Position equals No_Element, Constraint_Error
90612 is propagated. If Position does not designate a node in
90613 Container or designates a root node, then Program_Error is
90614 propagated. If Position equals Before, there is no effect.
90615 If Position designates an ancestor of Parent (including Parent
90616 itself), Constraint_Error is propagated. Otherwise, the
90617 subtree rooted by the element designated by Position is moved
90618 to be a child of Parent. If Parent already has child nodes,
90619 then the moved nodes are inserted prior to the node designated
90620 by Before, or, if Before equals No_Element, the moved nodes
90621 are inserted after the last existing child node of Parent.
90622 The parent of the element designated by Position is set to
90623 Parent.
90624
90625 182.a/3
90626 Reason: We can't allow moving the subtree of Position to a
90627 proper descendant node of the subtree, as the descendant node
90628 will be part of the subtree being moved.
90629
90630 183/3
90631 procedure Splice_Children (Target : in out Tree;
90632 Target_Parent : in Cursor;
90633 Before : in Cursor;
90634 Source : in out Tree;
90635 Source_Parent : in Cursor);
90636
90637 184/3
90638 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1} If
90639 Target_Parent equals No_Element, then Constraint_Error is
90640 propagated. If Target_Parent does not designate a node in
90641 Target, then Program_Error is propagated. If Before is not
90642 equal to No_Element, and does not designate an element in
90643 Target, then Program_Error is propagated. If Source_Parent
90644 equals No_Element, then Constraint_Error is propagated. If
90645 Source_Parent does not designate a node in Source, then
90646 Program_Error is propagated. If Before is not equal to
90647 No_Element, and Target_Parent does not designate the parent
90648 node of the node designated by Before, then Constraint_Error
90649 is propagated.
90650
90651 185/3
90652 If Source denotes the same object as Target, then:
90653
90654 186/3
90655 * if Target_Parent equals Source_Parent there is no effect;
90656 else
90657
90658 187/3
90659 * {AI05-0136-1AI05-0136-1} {AI05-0269-1AI05-0269-1} if
90660 Source_Parent is an ancestor of Target_Parent other than
90661 Target_Parent itself, then Constraint_Error is
90662 propagated; else
90663
90664 188/3
90665 * {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90666 {AI05-0269-1AI05-0269-1} the child elements (and the
90667 further descendants) of Source_Parent are moved to be
90668 child elements of Target_Parent. If Target_Parent
90669 already has child elements, then the moved elements are
90670 inserted prior to the node designated by Before, or, if
90671 Before equals No_Element, the moved elements are inserted
90672 after the last existing child node of Target_Parent. The
90673 parent of each moved child element is set to
90674 Target_Parent.
90675
90676 188.a/3
90677 Reason: We can't allow moving the children of Source_Parent to
90678 a proper descendant node, as the descendant node will be part
90679 of one of the subtrees being moved.
90680
90681 189/3
90682 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90683 {AI05-0269-1AI05-0269-1} Otherwise (if Source does not denote
90684 the same object as Target), the child elements (and the
90685 further descendants) of Source_Parent are removed from Source
90686 and moved to Target. The child elements are inserted as
90687 children of Target_Parent. If Target_Parent already has child
90688 elements, then the moved elements are inserted prior to the
90689 node designated by Before, or, if Before equals No_Element,
90690 the moved elements are inserted after the last existing child
90691 node of Target_Parent. In each of these cases, the overall
90692 count of Target is incremented by Subtree_Node_Count
90693 (Source_Parent)-1, and the overall count of Source is
90694 decremented by Subtree_Node_Count (Source_Parent)-1.
90695
90696 189.a/3
90697 Ramification: The node designated by Source_Parent is not
90698 moved, thus we never need to update Source_Parent.
90699
90700 189.b/3
90701 Move (Target, Source) could be written Splice_Children
90702 (Target, Target.Root, No_Element, Source, Source.Root);
90703
90704 190/3
90705 procedure Splice_Children (Container : in out Tree;
90706 Target_Parent : in Cursor;
90707 Before : in Cursor;
90708 Source_Parent : in Cursor);
90709
90710 191/3
90711 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1}
90712 {AI05-0262-1AI05-0262-1} {AI05-0264-1AI05-0264-1}
90713 {AI05-0269-1AI05-0269-1} If Target_Parent equals No_Element,
90714 then Constraint_Error is propagated. If Target_Parent does
90715 not designate a node in Container, then Program_Error is
90716 propagated. If Before is not equal to No_Element, and does
90717 not designate an element in Container, then Program_Error is
90718 propagated. If Source_Parent equals No_Element, then
90719 Constraint_Error is propagated. If Source_Parent does not
90720 designate a node in Container, then Program_Error is
90721 propagated. If Before is not equal to No_Element, and
90722 Target_Parent does not designate the parent node of the node
90723 designated by Before, then Constraint_Error is propagated. If
90724 Target_Parent equals Source_Parent there is no effect. If
90725 Source_Parent is an ancestor of Target_Parent other than
90726 Target_Parent itself, then Constraint_Error is propagated.
90727 Otherwise, the child elements (and the further descendants) of
90728 Source_Parent are moved to be child elements of Target_Parent.
90729 If Target_Parent already has child elements, then the moved
90730 elements are inserted prior to the node designated by Before,
90731 or, if Before equals No_Element, the moved elements are
90732 inserted after the last existing child node of Target_Parent.
90733 The parent of each moved child element is set to
90734 Target_Parent.
90735
90736 192/3
90737 function Parent (Position : Cursor) return Cursor;
90738
90739 193/3
90740 {AI05-0136-1AI05-0136-1} If Position is equal to No_Element or
90741 designates a root node, No_Element is returned. Otherwise, a
90742 cursor designating the parent node of the node designated by
90743 Position is returned.
90744
90745 194/3
90746 function First_Child (Parent : Cursor) return Cursor;
90747
90748 195/3
90749 {AI05-0136-1AI05-0136-1} If Parent is equal to No_Element,
90750 then Constraint_Error is propagated. Otherwise, First_Child
90751 returns a cursor designating the first child node of the node
90752 designated by Parent; if there is no such node, No_Element is
90753 returned.
90754
90755 196/3
90756 function First_Child_Element (Parent : Cursor) return Element_Type;
90757
90758 197/3
90759 {AI05-0136-1AI05-0136-1} Equivalent to Element (First_Child
90760 (Parent)).
90761
90762 198/3
90763 function Last_Child (Parent : Cursor) return Cursor;
90764
90765 199/3
90766 {AI05-0136-1AI05-0136-1} If Parent is equal to No_Element,
90767 then Constraint_Error is propagated. Otherwise, Last_Child
90768 returns a cursor designating the last child node of the node
90769 designated by Parent; if there is no such node, No_Element is
90770 returned.
90771
90772 200/3
90773 function Last_Child_Element (Parent : Cursor) return Element_Type;
90774
90775 201/3
90776 {AI05-0136-1AI05-0136-1} Equivalent to Element (Last_Child
90777 (Parent)).
90778
90779 202/3
90780 function Next_Sibling (Position : Cursor) return Cursor;
90781
90782 203/3
90783 {AI05-0136-1AI05-0136-1} If Position equals No_Element or
90784 designates the last child node of its parent, then
90785 Next_Sibling returns the value No_Element. Otherwise, it
90786 returns a cursor that designates the successor (with the same
90787 parent) of the node designated by Position.
90788
90789 204/3
90790 function Previous_Sibling (Position : Cursor) return Cursor;
90791
90792 205/3
90793 {AI05-0136-1AI05-0136-1} If Position equals No_Element or
90794 designates the first child node of its parent, then
90795 Previous_Sibling returns the value No_Element. Otherwise, it
90796 returns a cursor that designates the predecessor (with the
90797 same parent) of the node designated by Position.
90798
90799 206/3
90800 procedure Next_Sibling (Position : in out Cursor);
90801
90802 207/3
90803 {AI05-0136-1AI05-0136-1} Equivalent to Position :=
90804 Next_Sibling (Position);
90805
90806 208/3
90807 procedure Previous_Sibling (Position : in out Cursor);
90808
90809 209/3
90810 {AI05-0136-1AI05-0136-1} Equivalent to Position :=
90811 Previous_Sibling (Position);
90812
90813 210/3
90814 procedure Iterate_Children
90815 (Parent : in Cursor;
90816 Process : not null access procedure (Position : in Cursor));
90817
90818 211/3
90819 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Parent
90820 equals No_Element, then Constraint_Error is propagated.
90821
90822 212/3
90823 Iterate_Children calls Process.all with a cursor that
90824 designates each child node of Parent, starting with the first
90825 child node and moving the cursor as per the Next_Sibling
90826 function.
90827
90828 213/3
90829 {AI05-0265-1AI05-0265-1} Tampering with the cursors of the
90830 tree containing Parent is prohibited during the execution of a
90831 call on Process.all. Any exception raised by Process.all is
90832 propagated.
90833
90834 214/3
90835 procedure Reverse_Iterate_Children
90836 (Parent : in Cursor;
90837 Process : not null access procedure (Position : in Cursor));
90838
90839 215/3
90840 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} If Parent
90841 equals No_Element, then Constraint_Error is propagated.
90842
90843 216/3
90844 Reverse_Iterate_Children calls Process.all with a cursor that
90845 designates each child node of Parent, starting with the last
90846 child node and moving the cursor as per the Previous_Sibling
90847 function.
90848
90849 217/3
90850 {AI05-0265-1AI05-0265-1} Tampering with the cursors of the
90851 tree containing Parent is prohibited during the execution of a
90852 call on Process.all. Any exception raised by Process.all is
90853 propagated.
90854
90855 218/3
90856 function Iterate_Children (Container : in Tree; Parent : in Cursor)
90857 return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
90858
90859 219/3
90860 {AI05-0212-1AI05-0212-1} {AI05-0265-1AI05-0265-1}
90861 Iterate_Children returns a reversible iterator object (see
90862 *note 5.5.1::) that will generate a value for a loop parameter
90863 (see *note 5.5.2::) designating each child node of Parent. If
90864 Parent equals No_Element, then Constraint_Error is propagated.
90865 If Parent does not designate a node in Container, then
90866 Program_Error is propagated. Otherwise, when used as a
90867 forward iterator, the nodes are designated starting with the
90868 first child node and moving the cursor as per the function
90869 Next_Sibling; when used as a reverse iterator, the nodes are
90870 designated starting with the last child node and moving the
90871 cursor as per the function Previous_Sibling. Tampering with
90872 the cursors of Container is prohibited while the iterator
90873 object exists (in particular, in the sequence_of_statements of
90874 the loop_statement whose iterator_specification denotes this
90875 object). The iterator object needs finalization.
90876
90877 _Bounded (Run-Time) Errors_
90878
90879 220/3
90880 {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} It is a bounded error
90881 for the actual function associated with a generic formal subprogram,
90882 when called as part of an operation of this package, to tamper with
90883 elements of any Tree parameter of the operation. Either Program_Error
90884 is raised, or the operation works as defined on the value of the Tree
90885 either prior to, or subsequent to, some or all of the modifications to
90886 the Tree.
90887
90888 221/3
90889 {AI05-0136-1AI05-0136-1} It is a bounded error to call any subprogram
90890 declared in the visible part of Containers.Multiway_Trees when the
90891 associated container has been finalized. If the operation takes
90892 Container as an in out parameter, then it raises Constraint_Error or
90893 Program_Error. Otherwise, the operation either proceeds as it would for
90894 an empty container, or it raises Constraint_Error or Program_Error.
90895
90896 _Erroneous Execution_
90897
90898 222/3
90899 {AI05-0136-1AI05-0136-1} A Cursor value is invalid if any of the
90900 following have occurred since it was created:
90901
90902 223/3
90903 * The tree that contains the element it designates has been
90904 finalized;
90905
90906 224/3
90907 * The tree that contains the element it designates has been used as
90908 the Source or Target of a call to Move;
90909
90910 225/3
90911 * The tree that contains the element it designates has been used as
90912 the Target of a call to Assign or the target of an
90913 assignment_statement;
90914
90915 226/3
90916 * The element it designates has been removed from the tree that
90917 previously contained the element.
90918
90919 226.a/3
90920 Reason: We talk about which tree the element was removed from
90921 in order to handle splicing nodes from one tree to another.
90922 The node still exists, but any cursors that designate it in
90923 the original tree are now invalid. This bullet covers
90924 removals caused by calls to Clear, Delete_Leaf,
90925 Delete_Subtree, Delete_Children, Splice_Children, and
90926 Splice_Subtree.
90927
90928 227/3
90929 The result of "=" or Has_Element is unspecified if it is called with an
90930 invalid cursor parameter. Execution is erroneous if any other
90931 subprogram declared in Containers.Multiway_Trees is called with an
90932 invalid cursor parameter.
90933
90934 227.a/3
90935 Discussion: The list above is intended to be exhaustive. In
90936 other cases, a cursor value continues to designate its
90937 original element (or the root node). For instance, cursor
90938 values survive the insertion and deletion of other nodes.
90939
90940 227.b/3
90941 While it is possible to check for these cases, in many cases
90942 the overhead necessary to make the check is substantial in
90943 time or space. Implementations are encouraged to check for as
90944 many of these cases as possible and raise Program_Error if
90945 detected.
90946
90947 228/3
90948 {AI05-0212-1AI05-0212-1} Execution is erroneous if the tree associated
90949 with the result of a call to Reference or Constant_Reference is
90950 finalized before the result object returned by the call to Reference or
90951 Constant_Reference is finalized.
90952
90953 228.a/3
90954 Reason: Each object of Reference_Type and
90955 Constant_Reference_Type probably contains some reference to
90956 the originating container. If that container is prematurely
90957 finalized (which is only possible via Unchecked_Deallocation,
90958 as accessibility checks prevent passing a container to
90959 Reference that will not live as long as the result), the
90960 finalization of the object of Reference_Type will try to
90961 access a nonexistent object. This is a normal case of a
90962 dangling pointer created by Unchecked_Deallocation; we have to
90963 explicitly mention it here as the pointer in question is not
90964 visible in the specification of the type. (This is the same
90965 reason we have to say this for invalid cursors.)
90966
90967 _Implementation Requirements_
90968
90969 229/3
90970 {AI05-0136-1AI05-0136-1} No storage associated with a multiway tree
90971 object shall be lost upon assignment or scope exit.
90972
90973 230/3
90974 {AI05-0136-1AI05-0136-1} {AI05-0262-1AI05-0262-1} The execution of an
90975 assignment_statement for a tree shall have the effect of copying the
90976 elements from the source tree object to the target tree object and
90977 changing the node count of the target object to that of the source
90978 object.
90979
90980 230.a/3
90981 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
90982 a Tree is a "deep" copy; that is the elements are copied as
90983 well the data structures. We say "effect of" in order to
90984 allow the implementation to avoid copying elements immediately
90985 if it wishes. For instance, an implementation that avoided
90986 copying until one of the containers is modified would be
90987 allowed. (Note that this implementation would require care,
90988 see *note A.18.2:: for more.)
90989
90990 _Implementation Advice_
90991
90992 231/3
90993 {AI05-0136-1AI05-0136-1} Containers.Multiway_Trees should be implemented
90994 similarly to a multiway tree. In particular, if N is the overall number
90995 of nodes for a particular tree, then the worst-case time complexity of
90996 Element, Parent, First_Child, Last_Child, Next_Sibling,
90997 Previous_Sibling, Insert_Child with Count=1, and Delete should be O(log
90998 N).
90999
91000 231.a/3
91001 Implementation Advice: The worst-case time complexity of the
91002 Element, Parent, First_Child, Last_Child, Next_Sibling,
91003 Previous_Sibling, Insert_Child with Count=1, and Delete
91004 operations of Containers.Multiway_Trees should be O(log N).
91005
91006 231.b/3
91007 Reason: We do not mean to overly constrain implementation
91008 strategies here. However, it is important for portability
91009 that the performance of large containers has roughly the same
91010 factors on different implementations. If a program is moved
91011 to an implementation that takes O(N) time to access elements,
91012 that program could be unusable when the trees are large. We
91013 allow O(log N) access because the proportionality constant and
91014 caching effects are likely to be larger than the log factor,
91015 and we don't want to discourage innovative implementations.
91016
91017 232/3
91018 {AI05-0136-1AI05-0136-1} Move should not copy elements, and should
91019 minimize copying of internal data structures.
91020
91021 232.a/3
91022 Implementation Advice: Containers.Multiway_Trees.Move should
91023 not copy elements, and should minimize copying of internal
91024 data structures.
91025
91026 232.b/3
91027 Implementation Note: Usually that can be accomplished simply
91028 by moving the pointer(s) to the internal data structures from
91029 the Source container to the Target container.
91030
91031 233/3
91032 {AI05-0136-1AI05-0136-1} If an exception is propagated from a tree
91033 operation, no storage should be lost, nor any elements removed from a
91034 tree unless specified by the operation.
91035
91036 233.a/3
91037 Implementation Advice: If an exception is propagated from a
91038 tree operation, no storage should be lost, nor any elements
91039 removed from a tree unless specified by the operation.
91040
91041 233.b/3
91042 Reason: This is important so that programs can recover from
91043 errors. But we don't want to require heroic efforts, so we
91044 just require documentation of cases where this can't be
91045 accomplished.
91046
91047 _Extensions to Ada 2005_
91048
91049 233.c/3
91050 {AI05-0136-1AI05-0136-1} {AI05-0257-1AI05-0257-1}
91051 {AI05-0265-1AI05-0265-1} {AI05-0269-1AI05-0269-1} The generic
91052 package Containers.Multiway_Trees is new.
91053
91054 \1f
91055 File: aarm2012.info, Node: A.18.11, Next: A.18.12, Prev: A.18.10, Up: A.18
91056
91057 A.18.11 The Generic Package Containers.Indefinite_Vectors
91058 ---------------------------------------------------------
91059
91060 1/2
91061 {AI95-00302-03AI95-00302-03} The language-defined generic package
91062 Containers.Indefinite_Vectors provides a private type Vector and a set
91063 of operations. It provides the same operations as the package
91064 Containers.Vectors (see *note A.18.2::), with the difference that the
91065 generic formal Element_Type is indefinite.
91066
91067 _Static Semantics_
91068
91069 2/3
91070 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91071 the generic library package Containers.Indefinite_Vectors has the same
91072 contents and semantics as Containers.Vectors except:
91073
91074 3/2
91075 * The generic formal Element_Type is indefinite.
91076
91077 4/2
91078 * The procedures with the profiles:
91079
91080 5/2
91081 procedure Insert (Container : in out Vector;
91082 Before : in Extended_Index;
91083 Count : in Count_Type := 1);
91084
91085 6/2
91086 procedure Insert (Container : in out Vector;
91087 Before : in Cursor;
91088 Position : out Cursor;
91089 Count : in Count_Type := 1);
91090
91091 7/2
91092 are omitted.
91093
91094 7.a/2
91095 Discussion: These procedures are omitted because there is no
91096 way to create a default-initialized object of an indefinite
91097 type. Note that Insert_Space can be used instead of this
91098 routine in most cases. Omitting the routine completely allows
91099 any problems to be diagnosed by the compiler when converting
91100 from a definite to indefinite vector.
91101
91102 8/2
91103 * The actual Element parameter of access subprogram Process of
91104 Update_Element may be constrained even if Element_Type is
91105 unconstrained.
91106
91107 _Extensions to Ada 95_
91108
91109 8.a/2
91110 {AI95-00302-03AI95-00302-03} The generic package
91111 Containers.Indefinite_Vectors is new.
91112
91113 \1f
91114 File: aarm2012.info, Node: A.18.12, Next: A.18.13, Prev: A.18.11, Up: A.18
91115
91116 A.18.12 The Generic Package Containers.Indefinite_Doubly_Linked_Lists
91117 ---------------------------------------------------------------------
91118
91119 1/2
91120 {AI95-00302-03AI95-00302-03} The language-defined generic package
91121 Containers.Indefinite_Doubly_Linked_Lists provides private types List
91122 and Cursor, and a set of operations for each type. It provides the same
91123 operations as the package Containers.Doubly_Linked_Lists (see *note
91124 A.18.3::), with the difference that the generic formal Element_Type is
91125 indefinite.
91126
91127 _Static Semantics_
91128
91129 2/3
91130 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91131 the generic library package Containers.Indefinite_Doubly_Linked_Lists
91132 has the same contents and semantics as Containers.Doubly_Linked_Lists
91133 except:
91134
91135 3/2
91136 * The generic formal Element_Type is indefinite.
91137
91138 4/2
91139 * The procedure with the profile:
91140
91141 5/2
91142 procedure Insert (Container : in out List;
91143 Before : in Cursor;
91144 Position : out Cursor;
91145 Count : in Count_Type := 1);
91146
91147 6/2
91148 is omitted.
91149
91150 6.a/2
91151 Discussion: This procedure is omitted because there is no way
91152 to create a default-initialized object of an indefinite type.
91153 We considered having this routine insert an empty element
91154 similar to the empty elements of a vector, but rejected this
91155 possibility because the semantics are fairly complex and very
91156 different from the existing definite container. That would
91157 make it more error-prone to convert a container from a
91158 definite type to an indefinite type; by omitting the routine
91159 completely, any problems will be diagnosed by the compiler.
91160
91161 7/2
91162 * The actual Element parameter of access subprogram Process of
91163 Update_Element may be constrained even if Element_Type is
91164 unconstrained.
91165
91166 _Extensions to Ada 95_
91167
91168 7.a/2
91169 {AI95-00302-03AI95-00302-03} The generic package
91170 Containers.Indefinite_Doubly_Linked_Lists is new.
91171
91172 \1f
91173 File: aarm2012.info, Node: A.18.13, Next: A.18.14, Prev: A.18.12, Up: A.18
91174
91175 A.18.13 The Generic Package Containers.Indefinite_Hashed_Maps
91176 -------------------------------------------------------------
91177
91178 1/2
91179 {AI95-00302-03AI95-00302-03} The language-defined generic package
91180 Containers.Indefinite_Hashed_Maps provides a map with the same
91181 operations as the package Containers.Hashed_Maps (see *note A.18.5::),
91182 with the difference that the generic formal types Key_Type and
91183 Element_Type are indefinite.
91184
91185 _Static Semantics_
91186
91187 2/3
91188 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91189 the generic library package Containers.Indefinite_Hashed_Maps has the
91190 same contents and semantics as Containers.Hashed_Maps except:
91191
91192 3/2
91193 * The generic formal Key_Type is indefinite.
91194
91195 4/2
91196 * The generic formal Element_Type is indefinite.
91197
91198 5/2
91199 * The procedure with the profile:
91200
91201 6/2
91202 procedure Insert (Container : in out Map;
91203 Key : in Key_Type;
91204 Position : out Cursor;
91205 Inserted : out Boolean);
91206
91207 7/2
91208 is omitted.
91209
91210 7.a/2
91211 Discussion: This procedure is omitted because there is no way
91212 to create a default-initialized object of an indefinite type.
91213 We considered having this routine insert an empty element
91214 similar to the empty elements of a vector, but rejected this
91215 possibility because the semantics are fairly complex and very
91216 different from the existing case. That would make it more
91217 error-prone to convert a container from a definite type to an
91218 indefinite type; by omitting the routine completely, any
91219 problems will be diagnosed by the compiler.
91220
91221 8/2
91222 * The actual Element parameter of access subprogram Process of
91223 Update_Element may be constrained even if Element_Type is
91224 unconstrained.
91225
91226 _Extensions to Ada 95_
91227
91228 8.a/2
91229 {AI95-00302-03AI95-00302-03} The generic package
91230 Containers.Indefinite_Hashed_Maps is new.
91231
91232 \1f
91233 File: aarm2012.info, Node: A.18.14, Next: A.18.15, Prev: A.18.13, Up: A.18
91234
91235 A.18.14 The Generic Package Containers.Indefinite_Ordered_Maps
91236 --------------------------------------------------------------
91237
91238 1/2
91239 {AI95-00302-03AI95-00302-03} The language-defined generic package
91240 Containers.Indefinite_Ordered_Maps provides a map with the same
91241 operations as the package Containers.Ordered_Maps (see *note A.18.6::),
91242 with the difference that the generic formal types Key_Type and
91243 Element_Type are indefinite.
91244
91245 _Static Semantics_
91246
91247 2/3
91248 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91249 the generic library package Containers.Indefinite_Ordered_Maps has the
91250 same contents and semantics as Containers.Ordered_Maps except:
91251
91252 3/2
91253 * The generic formal Key_Type is indefinite.
91254
91255 4/2
91256 * The generic formal Element_Type is indefinite.
91257
91258 5/2
91259 * The procedure with the profile:
91260
91261 6/2
91262 procedure Insert (Container : in out Map;
91263 Key : in Key_Type;
91264 Position : out Cursor;
91265 Inserted : out Boolean);
91266
91267 7/2
91268 is omitted.
91269
91270 7.a/2
91271 Discussion: This procedure is omitted because there is no way
91272 to create a default-initialized object of an indefinite type.
91273 We considered having this routine insert an empty element
91274 similar to the empty elements of a vector, but rejected this
91275 possibility because the semantics are fairly complex and very
91276 different from the existing case. That would make it more
91277 error-prone to convert a container from a definite type to an
91278 indefinite type; by omitting the routine completely, any
91279 problems will be diagnosed by the compiler.
91280
91281 8/2
91282 * The actual Element parameter of access subprogram Process of
91283 Update_Element may be constrained even if Element_Type is
91284 unconstrained.
91285
91286 _Extensions to Ada 95_
91287
91288 8.a/2
91289 {AI95-00302-03AI95-00302-03} The generic package
91290 Containers.Indefinite_Ordered_Maps is new.
91291
91292 \1f
91293 File: aarm2012.info, Node: A.18.15, Next: A.18.16, Prev: A.18.14, Up: A.18
91294
91295 A.18.15 The Generic Package Containers.Indefinite_Hashed_Sets
91296 -------------------------------------------------------------
91297
91298 1/2
91299 {AI95-00302-03AI95-00302-03} The language-defined generic package
91300 Containers.Indefinite_Hashed_Sets provides a set with the same
91301 operations as the package Containers.Hashed_Sets (see *note A.18.8::),
91302 with the difference that the generic formal type Element_Type is
91303 indefinite.
91304
91305 _Static Semantics_
91306
91307 2/3
91308 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91309 the generic library package Containers.Indefinite_Hashed_Sets has the
91310 same contents and semantics as Containers.Hashed_Sets except:
91311
91312 3/2
91313 * The generic formal Element_Type is indefinite.
91314
91315 4/2
91316 * The actual Element parameter of access subprogram Process of
91317 Update_Element_Preserving_Key may be constrained even if
91318 Element_Type is unconstrained.
91319
91320 _Extensions to Ada 95_
91321
91322 4.a/2
91323 {AI95-00302-03AI95-00302-03} The generic package
91324 Containers.Indefinite_Hashed_Sets is new.
91325
91326 \1f
91327 File: aarm2012.info, Node: A.18.16, Next: A.18.17, Prev: A.18.15, Up: A.18
91328
91329 A.18.16 The Generic Package Containers.Indefinite_Ordered_Sets
91330 --------------------------------------------------------------
91331
91332 1/2
91333 {AI95-00302-03AI95-00302-03} The language-defined generic package
91334 Containers.Indefinite_Ordered_Sets provides a set with the same
91335 operations as the package Containers.Ordered_Sets (see *note A.18.9::),
91336 with the difference that the generic formal type Element_Type is
91337 indefinite.
91338
91339 _Static Semantics_
91340
91341 2/3
91342 {AI95-00302-03AI95-00302-03} {AI05-0092-1AI05-0092-1} The declaration of
91343 the generic library package Containers.Indefinite_Ordered_Sets has the
91344 same contents and semantics as Containers.Ordered_Sets except:
91345
91346 3/2
91347 * The generic formal Element_Type is indefinite.
91348
91349 4/2
91350 * The actual Element parameter of access subprogram Process of
91351 Update_Element_Preserving_Key may be constrained even if
91352 Element_Type is unconstrained.
91353
91354 _Extensions to Ada 95_
91355
91356 4.a/2
91357 {AI95-00302-03AI95-00302-03} The generic package
91358 Containers.Indefinite_Ordered_Sets is new.
91359
91360 \1f
91361 File: aarm2012.info, Node: A.18.17, Next: A.18.18, Prev: A.18.16, Up: A.18
91362
91363 A.18.17 The Generic Package Containers.Indefinite_Multiway_Trees
91364 ----------------------------------------------------------------
91365
91366 1/3
91367 {AI05-0136-1AI05-0136-1} The language-defined generic package
91368 Containers.Indefinite_Multiway_Trees provides a multiway tree with the
91369 same operations as the package Containers.Multiway_Trees (see *note
91370 A.18.10::), with the difference that the generic formal Element_Type is
91371 indefinite.
91372
91373 _Static Semantics_
91374
91375 2/3
91376 {AI05-0136-1AI05-0136-1} The declaration of the generic library package
91377 Containers.Indefinite_Multiway_Trees has the same contents and semantics
91378 as Containers.Multiway_Trees except:
91379
91380 3/3
91381 * The generic formal Element_Type is indefinite.
91382
91383 4/3
91384 * The procedure with the profile:
91385
91386 5/3
91387 procedure Insert_Child (Container : in out Tree;
91388 Parent : in Cursor;
91389 Before : in Cursor;
91390 Position : out Cursor;
91391 Count : in Count_Type := 1);
91392
91393 6/3
91394 is omitted.
91395
91396 6.a/3
91397 Discussion: This procedure is omitted because there is no way
91398 to create a default-initialized object of an indefinite type.
91399 We considered having this routine insert an empty element
91400 similar to the empty elements of a vector, but rejected this
91401 possibility because the semantics are fairly complex and very
91402 different from the existing case. That would make it more
91403 error-prone to convert a container from a definite type to an
91404 indefinite type; by omitting the routine completely, any
91405 problems will be diagnosed by the compiler.
91406
91407 7/3
91408 * The actual Element parameter of access subprogram Process of
91409 Update_Element may be constrained even if Element_Type is
91410 unconstrained.
91411
91412 _Extensions to Ada 2005_
91413
91414 7.a/3
91415 {AI05-0136-1AI05-0136-1} The generic package
91416 Containers.Indefinite_Multiway_Trees is new.
91417
91418 \1f
91419 File: aarm2012.info, Node: A.18.18, Next: A.18.19, Prev: A.18.17, Up: A.18
91420
91421 A.18.18 The Generic Package Containers.Indefinite_Holders
91422 ---------------------------------------------------------
91423
91424 1/3
91425 {AI05-0069-1AI05-0069-1} The language-defined generic package
91426 Containers.Indefinite_Holders provides a private type Holder and a set
91427 of operations for that type. A holder container holds a single element
91428 of an indefinite type.
91429
91430 2/3
91431 {AI05-0069-1AI05-0069-1} A holder container allows the declaration of an
91432 object that can be used like an uninitialized variable or component of
91433 an indefinite type.
91434
91435 3/3
91436 {AI05-0069-1AI05-0069-1} A holder container may be empty. An empty
91437 holder does not contain an element.
91438
91439 _Static Semantics_
91440
91441 4/3
91442 {AI05-0069-1AI05-0069-1} The generic library package
91443 Containers.Indefinite_Holders has the following declaration:
91444
91445 5/3
91446 {AI05-0069-1AI05-0069-1} {AI05-0084-1AI05-0084-1} generic
91447 type Element_Type (<>) is private;
91448 with function "=" (Left, Right : Element_Type) return Boolean is <>;
91449 package Ada.Containers.Indefinite_Holders is
91450 pragma Preelaborate(Indefinite_Holders);
91451 pragma Remote_Types(Indefinite_Holders);
91452
91453 6/3
91454 type Holder is tagged private;
91455 pragma Preelaborable_Initialization (Holder);
91456
91457 7/3
91458 Empty_Holder : constant Holder;
91459
91460 8/3
91461 function "=" (Left, Right : Holder) return Boolean;
91462
91463 9/3
91464 function To_Holder (New_Item : Element_Type) return Holder;
91465
91466 10/3
91467 function Is_Empty (Container : Holder) return Boolean;
91468
91469 11/3
91470 procedure Clear (Container : in out Holder);
91471
91472 12/3
91473 function Element (Container : Holder) return Element_Type;
91474
91475 13/3
91476 procedure Replace_Element (Container : in out Holder;
91477 New_Item : in Element_Type);
91478
91479 14/3
91480 procedure Query_Element
91481 (Container : in Holder;
91482 Process : not null access procedure (Element : in Element_Type));
91483
91484 15/3
91485 {AI05-0069-1AI05-0069-1} {AI05-0248-1AI05-0248-1} procedure Update_Element
91486 (Container : in out Holder;
91487 Process : not null access procedure (Element : in out Element_Type));
91488
91489 16/3
91490 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
91491 (Element : not null access constant Element_Type) is private
91492 with Implicit_Dereference => Element;
91493
91494 17/3
91495 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
91496 with Implicit_Dereference => Element;
91497
91498 18/3
91499 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Holder)
91500 return Constant_Reference_Type;
91501
91502 19/3
91503 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Holder)
91504 return Reference_Type;
91505
91506 20/3
91507 {AI05-0001-1AI05-0001-1} procedure Assign (Target : in out Holder; Source : in Holder);
91508
91509 21/3
91510 {AI05-0001-1AI05-0001-1} function Copy (Source : Holder) return Holder;
91511
91512 22/3
91513 procedure Move (Target : in out Holder; Source : in out Holder);
91514
91515 23/3
91516 private
91517
91518 24/3
91519 ... -- not specified by the language
91520
91521 25/3
91522 end Ada.Containers.Indefinite_Holders;
91523
91524 26/3
91525 {AI05-0069-1AI05-0069-1} The actual function for the generic formal
91526 function "=" on Element_Type values is expected to define a reflexive
91527 and symmetric relationship and return the same result value each time it
91528 is called with a particular pair of values. If it behaves in some other
91529 manner, the function "=" on holder values returns an unspecified value.
91530 The exact arguments and number of calls of this generic formal function
91531 by the function "=" on holder values are unspecified.
91532
91533 26.a/3
91534 Ramification: If the actual function for "=" is not symmetric
91535 and consistent, the result returned by any of the functions
91536 defined to use "=" cannot be predicted. The implementation is
91537 not required to protect against "=" raising an exception, or
91538 returning random results, or any other "bad" behavior. And it
91539 can call "=" in whatever manner makes sense. But note that
91540 only the results of the function "=" is unspecified; other
91541 subprograms are not allowed to break if "=" is bad.
91542
91543 27/3
91544 {AI05-0069-1AI05-0069-1} The type Holder is used to represent holder
91545 containers. The type Holder needs finalization (see *note 7.6::).
91546
91547 28/3
91548 {AI05-0069-1AI05-0069-1} Empty_Holder represents an empty holder object.
91549 If an object of type Holder is not otherwise initialized, it is
91550 initialized to the same value as Empty_Holder.
91551
91552 29/3
91553 {AI05-0069-1AI05-0069-1} {AI05-0262-1AI05-0262-1} [Some operations of
91554 this generic package have access-to-subprogram parameters. To ensure
91555 such operations are well-defined, they guard against certain actions by
91556 the designated subprogram. In particular, some operations check for
91557 "tampering with the element" of a container because they depend on the
91558 element of the container not being replaced.]
91559
91560 30/3
91561 {AI05-0069-1AI05-0069-1} {AI05-0262-1AI05-0262-1} A subprogram is said
91562 to tamper with the element of a holder object H if:
91563
91564 31/3
91565 * It clears the element contained by H, that is, it calls the Clear
91566 procedure with H as a parameter;
91567
91568 32/3
91569 * It replaces the element contained by H, that is, it calls the
91570 Replace_Element procedure with H as a parameter;
91571
91572 33/3
91573 * It calls the Move procedure with H as a parameter;
91574
91575 34/3
91576 * It finalizes H.
91577
91578 34.a/3
91579 Reason: Complete replacement of an element can cause its
91580 memory to be deallocated while another operation is holding
91581 onto a reference to it. That can't be allowed. However, a
91582 simple modification of (part of) an element is not a problem,
91583 so Update_Element does not cause a problem.
91584
91585 35/3
91586 {AI05-0265-1AI05-0265-1} When tampering with the element is prohibited
91587 for a particular holder object H, Program_Error is propagated by a call
91588 of any language-defined subprogram that is defined to tamper with the
91589 element of H, leaving H unmodified.
91590
91591 36/3
91592 function "=" (Left, Right : Holder) return Boolean;
91593
91594 37/3
91595 {AI05-0069-1AI05-0069-1} If Left and Right denote the same
91596 holder object, then the function returns True. Otherwise, it
91597 compares the element contained in Left to the element
91598 contained in Right using the generic formal equality operator,
91599 returning the result of that operation. Any exception raised
91600 during the evaluation of element equality is propagated.
91601
91602 37.a/3
91603 Implementation Note: This wording describes the canonical
91604 semantics. However, the order and number of calls on the
91605 formal equality function is unspecified, so an implementation
91606 need not call the equality function if the correct answer can
91607 be determined without doing so.
91608
91609 38/3
91610 function To_Holder (New_Item : Element_Type) return Holder;
91611
91612 39/3
91613 {AI05-0069-1AI05-0069-1} Returns a nonempty holder containing
91614 an element initialized to New_Item.
91615
91616 40/3
91617 function Is_Empty (Container : Holder) return Boolean;
91618
91619 41/3
91620 {AI05-0069-1AI05-0069-1} Returns True if Container is empty,
91621 and False if it contains an element.
91622
91623 42/3
91624 procedure Clear (Container : in out Holder);
91625
91626 43/3
91627 {AI05-0069-1AI05-0069-1} Removes the element from Container.
91628 Container is empty after a successful Clear operation.
91629
91630 44/3
91631 function Element (Container : Holder) return Element_Type;
91632
91633 45/3
91634 {AI05-0069-1AI05-0069-1} If Container is empty,
91635 Constraint_Error is propagated. Otherwise, returns the
91636 element stored in Container.
91637
91638 46/3
91639 procedure Replace_Element (Container : in out Holder;
91640 New_Item : in Element_Type);
91641
91642 47/3
91643 {AI05-0069-1AI05-0069-1} Replace_Element assigns the value
91644 New_Item into Container, replacing any preexisting content of
91645 Container. Container is not empty after a successful call to
91646 Replace_Element.
91647
91648 48/3
91649 procedure Query_Element
91650 (Container : in Holder;
91651 Process : not null access procedure (Element : in Element_Type));
91652
91653 49/3
91654 {AI05-0069-1AI05-0069-1} {AI05-0262-1AI05-0262-1}
91655 {AI05-0265-1AI05-0265-1} If Container is empty,
91656 Constraint_Error is propagated. Otherwise, Query_Element
91657 calls Process.all with the contained element as the argument.
91658 Tampering with the element of Container is prohibited during
91659 the execution of the call on Process.all. Any exception
91660 raised by Process.all is propagated.
91661
91662 49.a/3
91663 Implementation Note: {AI05-0005-1AI05-0005-1} The "tamper with
91664 the element" check is intended to prevent the Element
91665 parameter of Process from being replaced or deleted outside of
91666 Process. The check prevents data loss (if Element_Type is
91667 passed by copy) or erroneous execution (if Element_Type is an
91668 unconstrained type).
91669
91670 50/3
91671 {AI05-0069-1AI05-0069-1} {AI05-0248-1AI05-0248-1} procedure Update_Element
91672 (Container : in out Holder;
91673 Process : not null access procedure (Element : in out Element_Type));
91674
91675 51/3
91676 {AI05-0069-1AI05-0069-1} {AI05-0262-1AI05-0262-1}
91677 {AI05-0265-1AI05-0265-1} If Container is empty,
91678 Constraint_Error is propagated. Otherwise, Update_Element
91679 calls Process.all with the contained element as the argument.
91680 Tampering with the element of Container is prohibited during
91681 the execution of the call on Process.all. Any exception
91682 raised by Process.all is propagated.
91683
91684 51.a/3
91685 Implementation Note: The Element parameter of Process.all may
91686 be constrained even if Element_Type is unconstrained.
91687
91688 52/3
91689 {AI05-0212-1AI05-0212-1} type Constant_Reference_Type
91690 (Element : not null access constant Element_Type) is private
91691 with Implicit_Dereference => Element;
91692
91693 53/3
91694 {AI05-0212-1AI05-0212-1} type Reference_Type (Element : not null access Element_Type) is private
91695 with Implicit_Dereference => Element;
91696
91697 54/3
91698 {AI05-0212-1AI05-0212-1} The types Constant_Reference_Type and
91699 Reference_Type need finalization.
91700
91701 55/3
91702 {AI05-0212-1AI05-0212-1} The default initialization of an
91703 object of type Constant_Reference_Type or Reference_Type
91704 propagates Program_Error.
91705
91706 55.a/3
91707 Reason: It is expected that Reference_Type (and
91708 Constant_Reference_Type) will be a controlled type, for which
91709 finalization will have some action to terminate the tampering
91710 check for the associated container. If the object is created
91711 by default, however, there is no associated container. Since
91712 this is useless, and supporting this case would take extra
91713 work, we define it to raise an exception.
91714
91715 56/3
91716 {AI05-0212-1AI05-0212-1} function Constant_Reference (Container : aliased in Holder)
91717 return Constant_Reference_Type;
91718
91719 57/3
91720 {AI05-0212-1AI05-0212-1} This function (combined with the
91721 Implicit_Dereference aspect) provides a convenient way to gain
91722 read access to the contained element of a holder container.
91723
91724 58/3
91725 {AI05-0212-1AI05-0212-1} {AI05-0262-1AI05-0262-1}
91726 {AI05-0265-1AI05-0265-1} If Container is empty,
91727 Constraint_Error is propagated. Otherwise, Constant_Reference
91728 returns an object whose discriminant is an access value that
91729 designates the contained element. Tampering with the elements
91730 of Container is prohibited while the object returned by
91731 Constant_Reference exists and has not been finalized.
91732
91733 59/3
91734 {AI05-0212-1AI05-0212-1} function Reference (Container : aliased in out Holder)
91735 return Reference_Type;
91736
91737 60/3
91738 {AI05-0212-1AI05-0212-1} This function (combined with the
91739 Implicit_Dereference aspects) provides a convenient way to
91740 gain read and write access to the contained element of a
91741 holder container.
91742
91743 61/3
91744 {AI05-0212-1AI05-0212-1} {AI05-0262-1AI05-0262-1}
91745 {AI05-0265-1AI05-0265-1} If Container is empty,
91746 Constraint_Error is propagated. Otherwise, Reference returns
91747 an object whose discriminant is an access value that
91748 designates the contained element. Tampering with the elements
91749 of Container is prohibited while the object returned by
91750 Reference exists and has not been finalized.
91751
91752 62/3
91753 procedure Assign (Target : in out Holder; Source : in Holder);
91754
91755 63/3
91756 {AI05-0001-1AI05-0001-1} If Target denotes the same object as
91757 Source, the operation has no effect. If Source is empty,
91758 Clear (Target) is called. Otherwise, Replace_Element (Target,
91759 Element (Source)) is called.
91760
91761 63.a/3
91762 Discussion: {AI05-0005-1AI05-0005-1} This routine exists for
91763 compatibility with the other containers. For a holder,
91764 Assign(A, B) and A := B behave effectively the same. (Assign
91765 Clears the Target, while := finalizes the Target, but these
91766 should have similar effects.)
91767
91768 64/3
91769 function Copy (Source : Holder) return Holder;
91770
91771 65/3
91772 {AI05-0001-1AI05-0001-1} If Source is empty, returns an empty
91773 holder container; otherwise, returns To_Holder (Element
91774 (Source)).
91775
91776 66/3
91777 procedure Move (Target : in out Holder; Source : in out Holder);
91778
91779 67/3
91780 {AI05-0069-1AI05-0069-1} {AI05-0248-1AI05-0248-1} If Target
91781 denotes the same object as Source, then the operation has no
91782 effect. Otherwise, the element contained by Source (if any)
91783 is removed from Source and inserted into Target, replacing any
91784 preexisting content. Source is empty after a successful call
91785 to Move.
91786
91787 _Bounded (Run-Time) Errors_
91788
91789 68/3
91790 {AI05-0022-1AI05-0022-1} {AI05-0069-1AI05-0069-1}
91791 {AI05-0248-1AI05-0248-1} {AI05-0262-1AI05-0262-1} It is a bounded error
91792 for the actual function associated with a generic formal subprogram,
91793 when called as part of an operation of this package, to tamper with the
91794 element of any Holder parameter of the operation. Either Program_Error
91795 is raised, or the operation works as defined on the value of the Holder
91796 either prior to, or subsequent to, some or all of the modifications to
91797 the Holder.
91798
91799 69/3
91800 {AI05-0027-1AI05-0027-1} {AI05-0069-1AI05-0069-1} It is a bounded error
91801 to call any subprogram declared in the visible part of
91802 Containers.Indefinite_Holders when the associated container has been
91803 finalized. If the operation takes Container as an in out parameter,
91804 then it raises Constraint_Error or Program_Error. Otherwise, the
91805 operation either proceeds as it would for an empty container, or it
91806 raises Constraint_Error or Program_Error.
91807
91808 _Erroneous Execution_
91809
91810 70/3
91811 {AI05-0212-1AI05-0212-1} {AI05-0269-1AI05-0269-1} Execution is erroneous
91812 if the holder container associated with the result of a call to
91813 Reference or Constant_Reference is finalized before the result object
91814 returned by the call to Reference or Constant_Reference is finalized.
91815
91816 70.a/3
91817 Reason: {AI05-0212-1AI05-0212-1} Each object of Reference_Type
91818 and Constant_Reference_Type probably contains some reference
91819 to the originating container. If that container is
91820 prematurely finalized (which is only possible via
91821 Unchecked_Deallocation, as accessibility checks prevent
91822 passing a container to Reference that will not live as long as
91823 the result), the finalization of the object of Reference_Type
91824 will try to access a nonexistent object. This is a normal
91825 case of a dangling pointer created by Unchecked_Deallocation;
91826 we have to explicitly mention it here as the pointer in
91827 question is not visible in the specification of the type.
91828 (This is the same reason we have to say this for invalid
91829 cursors.)
91830
91831 _Implementation Requirements_
91832
91833 71/3
91834 {AI05-0069-1AI05-0069-1} No storage associated with a holder object
91835 shall be lost upon assignment or scope exit.
91836
91837 72/3
91838 {AI05-0069-1AI05-0069-1} {AI05-0269-1AI05-0269-1} The execution of an
91839 assignment_statement for a holder container shall have the effect of
91840 copying the element (if any) from the source holder object to the target
91841 holder object.
91842
91843 72.a/3
91844 Implementation Note: {AI05-0298-1AI05-0298-1} An assignment of
91845 a holder container is a "deep" copy; that is the element is
91846 copied as well as any data structures. We say "effect of" in
91847 order to allow the implementation to avoid copying the element
91848 immediately if it wishes. For instance, an implementation
91849 that avoided copying until one of the containers is modified
91850 would be allowed. (Note that this implementation would
91851 require care, see *note A.18.2:: for more.)
91852
91853 _Implementation Advice_
91854
91855 73/3
91856 {AI05-0069-1AI05-0069-1} {AI05-0269-1AI05-0269-1} Move should not copy
91857 the element, and should minimize copying of internal data structures.
91858
91859 73.a.1/3
91860 Implementation Advice: Containers.Indefinite_Holders.Move
91861 should not copy the element, and should minimize copying of
91862 internal data structures.
91863
91864 73.a/3
91865 Implementation Note: Usually that can be accomplished simply
91866 by moving the pointer(s) to the internal data structures from
91867 the Source holder to the Target holder.
91868
91869 74/3
91870 {AI05-0069-1AI05-0069-1} {AI05-0269-1AI05-0269-1} If an exception is
91871 propagated from a holder operation, no storage should be lost, nor
91872 should the element be removed from a holder container unless specified
91873 by the operation.
91874
91875 74.a.1/3
91876 Implementation Advice: If an exception is propagated from a
91877 holder operation, no storage should be lost, nor should the
91878 element be removed from a holder container unless specified by
91879 the operation.
91880
91881 74.a/3
91882 Reason: This is important so that programs can recover from
91883 errors. But we don't want to require heroic efforts, so we
91884 just require documentation of cases where this can't be
91885 accomplished.
91886
91887 _Extensions to Ada 2005_
91888
91889 74.b/3
91890 {AI05-0069-1AI05-0069-1} {AI05-0084-1AI05-0084-1}
91891 {AI05-0265-1AI05-0265-1} The generic package
91892 Containers.Indefinite_Holders is new.
91893
91894 \1f
91895 File: aarm2012.info, Node: A.18.19, Next: A.18.20, Prev: A.18.18, Up: A.18
91896
91897 A.18.19 The Generic Package Containers.Bounded_Vectors
91898 ------------------------------------------------------
91899
91900 1/3
91901 {AI05-0001-1AI05-0001-1} The language-defined generic package
91902 Containers.Bounded_Vectors provides a private type Vector and a set of
91903 operations. It provides the same operations as the package
91904 Containers.Vectors (see *note A.18.2::), with the difference that the
91905 maximum storage is bounded.
91906
91907 _Static Semantics_
91908
91909 2/3
91910 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
91911 Containers.Bounded_Vectors has the same contents and semantics as
91912 Containers.Vectors except:
91913
91914 3/3
91915 * The pragma Preelaborate is replaced with pragma Pure.
91916
91917 4/3
91918 * The type Vector is declared with a discriminant that specifies the
91919 capacity:
91920
91921 5/3
91922 type Vector (Capacity : Count_Type) is tagged private;
91923
91924 6/3
91925 * The type Vector needs finalization if and only if type Element_Type
91926 needs finalization.
91927
91928 6.a/3
91929 Implementation Note: {AI05-0212-1AI05-0212-1} The type Vector
91930 cannot depend on package Ada.Finalization unless the element
91931 type depends on that package. The objects returned from the
91932 Iterator and Reference functions probably do depend on package
91933 Ada.Finalization. Restricted environments may need to avoid
91934 use of those functions and their associated types.
91935
91936 7/3
91937 * In function Copy, if the Capacity parameter is equal to or greater
91938 than the length of Source, the vector capacity exactly equals the
91939 value of the Capacity parameter.
91940
91941 8/3
91942 * The description of Reserve_Capacity is replaced with:
91943
91944 9/3
91945 If the specified Capacity is larger than the capacity of
91946 Container, then Reserve_Capacity propagates Capacity_Error.
91947 Otherwise, the operation has no effect.
91948
91949 _Bounded (Run-Time) Errors_
91950
91951 10/3
91952 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
91953 to assign from a bounded vector object while tampering with elements [or
91954 cursors] of that object is prohibited. Either Program_Error is raised
91955 by the assignment, execution proceeds with the target object prohibiting
91956 tampering with elements [or cursors], or execution proceeds normally.
91957
91958 10.a/3
91959 Proof: Tampering with elements includes tampering with
91960 cursors, so we only really need to talk about tampering with
91961 elements here; we mention cursors for clarity.
91962
91963 _Erroneous Execution_
91964
91965 11/3
91966 {AI05-0265-1AI05-0265-1} When a bounded vector object V is finalized, if
91967 tampering with cursors is prohibited for V other than due to an
91968 assignment from another vector, then execution is erroneous.
91969
91970 11.a/3
91971 Reason: This is a tampering event, but since the
91972 implementation is not allowed to use Ada.Finalization, it is
91973 not possible in a pure Ada implementation to detect this
91974 error. (There is no Finalize routine that will be called that
91975 could make the check.) Since the check probably cannot be
91976 made, the bad effects that could occur (such as an iterator
91977 going into an infinite loop or accessing a nonexistent
91978 element) cannot be prevented and we have to allow anything.
91979 We do allow re-assigning an object that only prohibits
91980 tampering because it was copied from another object as that
91981 cannot cause any negative effects.
91982
91983 _Implementation Requirements_
91984
91985 12/3
91986 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
91987 Containers.Vectors and each instance of Containers.Bounded_Vectors, if
91988 the two instances meet the following conditions, then the output
91989 generated by the Vector'Output or Vector'Write subprograms of either
91990 instance shall be readable by the Vector'Input or Vector'Read of the
91991 other instance, respectively:
91992
91993 13/3
91994 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
91995 parameters of the two instances are statically matching subtypes of
91996 the same type; and
91997
91998 14/3
91999 * {AI05-0184-1AI05-0184-1} the output generated by
92000 Element_Type'Output or Element_Type'Write is readable by
92001 Element_Type'Input or Element_Type'Read, respectively (where
92002 Element_Type denotes the type of the two actual Element_Type
92003 parameters); and
92004
92005 15/3
92006 * {AI05-0184-1AI05-0184-1} the preceding two conditions also hold for
92007 the Index_Type parameters of the instances.
92008
92009 _Implementation Advice_
92010
92011 16/3
92012 {AI05-0001-1AI05-0001-1} Bounded vector objects should be implemented
92013 without implicit pointers or dynamic allocation.
92014
92015 16.a.1/3
92016 Implementation Advice: Bounded vector objects should be
92017 implemented without implicit pointers or dynamic allocation.
92018
92019 17/3
92020 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92021 minimize copying does not apply.
92022
92023 17.a.1/3
92024 Implementation Advice: The implementation advice for procedure
92025 Move to minimize copying does not apply to bounded vectors.
92026
92027 _Extensions to Ada 2005_
92028
92029 17.a/3
92030 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92031 {AI05-0184-1AI05-0184-1} The generic package
92032 Containers.Bounded_Vectors is new.
92033
92034 \1f
92035 File: aarm2012.info, Node: A.18.20, Next: A.18.21, Prev: A.18.19, Up: A.18
92036
92037 A.18.20 The Generic Package Containers.Bounded_Doubly_Linked_Lists
92038 ------------------------------------------------------------------
92039
92040 1/3
92041 {AI05-0001-1AI05-0001-1} The language-defined generic package
92042 Containers.Bounded_Doubly_Linked_Lists provides a private type List and
92043 a set of operations. It provides the same operations as the package
92044 Containers.Doubly_Linked_Lists (see *note A.18.3::), with the difference
92045 that the maximum storage is bounded.
92046
92047 _Static Semantics_
92048
92049 2/3
92050 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
92051 Containers.Bounded_Doubly_Linked_Lists has the same contents and
92052 semantics as Containers.Doubly_Linked_Lists except:
92053
92054 3/3
92055 * The pragma Preelaborate is replaced with pragma Pure.
92056
92057 4/3
92058 * The type List is declared with a discriminant that specifies the
92059 capacity (maximum number of elements) as follows:
92060
92061 5/3
92062 type List (Capacity : Count_Type) is tagged private;
92063
92064 6/3
92065 * The type List needs finalization if and only if type Element_Type
92066 needs finalization.
92067
92068 6.a/3
92069 Implementation Note: {AI05-0212-1AI05-0212-1} The type List
92070 cannot depend on package Ada.Finalization unless the element
92071 type depends on that package. The objects returned from the
92072 Iterator and Reference functions probably do depend on package
92073 Ada.Finalization. Restricted environments may need to avoid
92074 use of those functions and their associated types.
92075
92076 7/3
92077 * The allocation of internal storage includes a check that the
92078 capacity is not exceeded, and Capacity_Error is raised if this
92079 check fails.
92080
92081 8/3
92082 * In procedure Assign, if Source length is greater than Target
92083 capacity, then Capacity_Error is propagated.
92084
92085 9/3
92086 * The function Copy is replaced with:
92087
92088 10/3
92089 function Copy (Source : List; Capacity : Count_Type := 0)
92090 return List;
92091
92092 11/3
92093 If Capacity is 0, then the list capacity is the length of
92094 Source; if Capacity is equal to or greater than the length of
92095 Source, the list capacity equals the value of the Capacity
92096 parameter; otherwise, the operation propagates Capacity_Error.
92097
92098 12/3
92099 * In the three-parameter procedure Splice whose Source has type List,
92100 if the sum of the length of Target and the length of Source is
92101 greater than the capacity of Target, then Splice propagates
92102 Capacity_Error.
92103
92104 13/3
92105 * In the four-parameter procedure Splice, if the length of Target
92106 equals the capacity of Target, then Splice propagates
92107 Capacity_Error.
92108
92109 _Bounded (Run-Time) Errors_
92110
92111 14/3
92112 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92113 to assign from a bounded list object while tampering with elements [or
92114 cursors] of that object is prohibited. Either Program_Error is raised
92115 by the assignment, execution proceeds with the target object prohibiting
92116 tampering with elements [or cursors], or execution proceeds normally.
92117
92118 14.a/3
92119 Proof: Tampering with elements includes tampering with
92120 cursors, so we only really need to talk about tampering with
92121 elements here; we mention cursors for clarity.
92122
92123 _Erroneous Execution_
92124
92125 15/3
92126 {AI05-0265-1AI05-0265-1} When a bounded list object L is finalized, if
92127 tampering with cursors is prohibited for L other than due to an
92128 assignment from another list, then execution is erroneous.
92129
92130 15.a/3
92131 Reason: This is a tampering event, but since the
92132 implementation is not allowed to use Ada.Finalization, it is
92133 not possible in a pure Ada implementation to detect this
92134 error. (There is no Finalize routine that will be called that
92135 could make the check.) Since the check probably cannot be
92136 made, the bad effects that could occur (such as an iterator
92137 going into an infinite loop or accessing a nonexistent
92138 element) cannot be prevented and we have to allow anything.
92139 We do allow re-assigning an object that only prohibits
92140 tampering because it was copied from another object as that
92141 cannot cause any negative effects.
92142
92143 _Implementation Requirements_
92144
92145 16/3
92146 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92147 Containers.Doubly_Linked_Lists and each instance of
92148 Containers.Bounded_Doubly_Linked_Lists, if the two instances meet the
92149 following conditions, then the output generated by the List'Output or
92150 List'Write subprograms of either instance shall be readable by the
92151 List'Input or List'Read of the other instance, respectively:
92152
92153 17/3
92154 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92155 parameters of the two instances are statically matching subtypes of
92156 the same type; and
92157
92158 18/3
92159 * {AI05-0184-1AI05-0184-1} the output generated by
92160 Element_Type'Output or Element_Type'Write is readable by
92161 Element_Type'Input or Element_Type'Read, respectively (where
92162 Element_Type denotes the type of the two actual Element_Type
92163 parameters).
92164
92165 _Implementation Advice_
92166
92167 19/3
92168 {AI05-0001-1AI05-0001-1} Bounded list objects should be implemented
92169 without implicit pointers or dynamic allocation.
92170
92171 19.a.1/3
92172 Implementation Advice: Bounded list objects should be
92173 implemented without implicit pointers or dynamic allocation.
92174
92175 20/3
92176 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92177 minimize copying does not apply.
92178
92179 20.a.1/3
92180 Implementation Advice: The implementation advice for procedure
92181 Move to minimize copying does not apply to bounded lists.
92182
92183 _Extensions to Ada 2005_
92184
92185 20.a/3
92186 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92187 {AI05-0184-1AI05-0184-1} The generic package
92188 Containers.Bounded_Doubly_Linked_Lists is new.
92189
92190 \1f
92191 File: aarm2012.info, Node: A.18.21, Next: A.18.22, Prev: A.18.20, Up: A.18
92192
92193 A.18.21 The Generic Package Containers.Bounded_Hashed_Maps
92194 ----------------------------------------------------------
92195
92196 1/3
92197 {AI05-0001-1AI05-0001-1} The language-defined generic package
92198 Containers.Bounded_Hashed_Maps provides a private type Map and a set of
92199 operations. It provides the same operations as the package
92200 Containers.Hashed_Maps (see *note A.18.5::), with the difference that
92201 the maximum storage is bounded.
92202
92203 _Static Semantics_
92204
92205 2/3
92206 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
92207 Containers.Bounded_Hashed_Maps has the same contents and semantics as
92208 Containers.Hashed_Maps except:
92209
92210 3/3
92211 * The pragma Preelaborate is replaced with pragma Pure.
92212
92213 4/3
92214 * The type Map is declared with discriminants that specify both the
92215 capacity (number of elements) and modulus (number of distinct hash
92216 values) of the hash table as follows:
92217
92218 5/3
92219 type Map (Capacity : Count_Type;
92220 Modulus : Hash_Type) is tagged private;
92221
92222 6/3
92223 * The type Map needs finalization if and only if type Key_Type or
92224 type Element_Type needs finalization.
92225
92226 6.a/3
92227 Implementation Note: {AI05-0212-1AI05-0212-1} The type Map
92228 cannot depend on package Ada.Finalization unless the element
92229 or key type depends on that package. The objects returned
92230 from the Iterator and Reference functions probably do depend
92231 on package Ada.Finalization. Restricted environments may need
92232 to avoid use of those functions and their associated types.
92233
92234 7/3
92235 * The description of Reserve_Capacity is replaced with:
92236
92237 8/3
92238 If the specified Capacity is larger than the capacity of
92239 Container, then Reserve_Capacity propagates Capacity_Error.
92240 Otherwise, the operation has no effect.
92241
92242 9/3
92243 * An additional operation is added immediately following
92244 Reserve_Capacity:
92245
92246 10/3
92247 function Default_Modulus (Capacity : Count_Type) return Hash_Type;
92248
92249 11/3
92250 Default_Modulus returns an implementation-defined value for
92251 the number of distinct hash values to be used for the given
92252 capacity (maximum number of elements).
92253
92254 12/3
92255 * The function Copy is replaced with:
92256
92257 13/3
92258 function Copy (Source : Map;
92259 Capacity : Count_Type := 0;
92260 Modulus : Hash_Type := 0) return Map;
92261
92262 14/3
92263 {AI05-0264-1AI05-0264-1} Returns a map with key/element pairs
92264 initialized from the values in Source. If Capacity is 0, then
92265 the map capacity is the length of Source; if Capacity is equal
92266 to or greater than the length of Source, the map capacity is
92267 the value of the Capacity parameter; otherwise, the operation
92268 propagates Capacity_Error. If the Modulus argument is 0, then
92269 the map modulus is the value returned by a call to
92270 Default_Modulus with the map capacity as its argument;
92271 otherwise, the map modulus is the value of the Modulus
92272 parameter.
92273
92274 _Bounded (Run-Time) Errors_
92275
92276 15/3
92277 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92278 to assign from a bounded map object while tampering with elements [or
92279 cursors] of that object is prohibited. Either Program_Error is raised
92280 by the assignment, execution proceeds with the target object prohibiting
92281 tampering with elements [or cursors], or execution proceeds normally.
92282
92283 15.a/3
92284 Proof: Tampering with elements includes tampering with
92285 cursors, so we only really need to talk about tampering with
92286 elements here; we mention cursors for clarity.
92287
92288 _Erroneous Execution_
92289
92290 16/3
92291 {AI05-0265-1AI05-0265-1} When a bounded map object M is finalized, if
92292 tampering with cursors is prohibited for M other than due to an
92293 assignment from another map, then execution is erroneous.
92294
92295 16.a/3
92296 Reason: This is a tampering event, but since the
92297 implementation is not allowed to use Ada.Finalization, it is
92298 not possible in a pure Ada implementation to detect this
92299 error. (There is no Finalize routine that will be called that
92300 could make the check.) Since the check probably cannot be
92301 made, the bad effects that could occur (such as an iterator
92302 going into an infinite loop or accessing a nonexistent
92303 element) cannot be prevented and we have to allow anything.
92304 We do allow re-assigning an object that only prohibits
92305 tampering because it was copied from another object as that
92306 cannot cause any negative effects.
92307
92308 _Implementation Requirements_
92309
92310 17/3
92311 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92312 Containers.Hashed_Maps and each instance of
92313 Containers.Bounded_Hashed_Maps, if the two instances meet the following
92314 conditions, then the output generated by the Map'Output or Map'Write
92315 subprograms of either instance shall be readable by the Map'Input or
92316 Map'Read of the other instance, respectively:
92317
92318 18/3
92319 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92320 parameters of the two instances are statically matching subtypes of
92321 the same type; and
92322
92323 19/3
92324 * {AI05-0184-1AI05-0184-1} the output generated by
92325 Element_Type'Output or Element_Type'Write is readable by
92326 Element_Type'Input or Element_Type'Read, respectively (where
92327 Element_Type denotes the type of the two actual Element_Type
92328 parameters); and
92329
92330 20/3
92331 * {AI05-0184-1AI05-0184-1} the preceding two conditions also hold for
92332 the Key_Type parameters of the instances.
92333
92334 _Implementation Advice_
92335
92336 21/3
92337 {AI05-0001-1AI05-0001-1} {AI05-0269-1AI05-0269-1} Bounded hashed map
92338 objects should be implemented without implicit pointers or dynamic
92339 allocation.
92340
92341 21.a.1/3
92342 Implementation Advice: Bounded hashed map objects should be
92343 implemented without implicit pointers or dynamic allocation.
92344
92345 22/3
92346 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92347 minimize copying does not apply.
92348
92349 22.a.1/3
92350 Implementation Advice: The implementation advice for procedure
92351 Move to minimize copying does not apply to bounded hashed
92352 maps.
92353
92354 _Extensions to Ada 2005_
92355
92356 22.a/3
92357 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92358 {AI05-0184-1AI05-0184-1} The generic package
92359 Containers.Bounded_Hashed_Maps is new.
92360
92361 \1f
92362 File: aarm2012.info, Node: A.18.22, Next: A.18.23, Prev: A.18.21, Up: A.18
92363
92364 A.18.22 The Generic Package Containers.Bounded_Ordered_Maps
92365 -----------------------------------------------------------
92366
92367 1/3
92368 {AI05-0001-1AI05-0001-1} The language-defined generic package
92369 Containers.Bounded_Ordered_Maps provides a private type Map and a set of
92370 operations. It provides the same operations as the package
92371 Containers.Ordered_Maps (see *note A.18.6::), with the difference that
92372 the maximum storage is bounded.
92373
92374 _Static Semantics_
92375
92376 2/3
92377 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
92378 Containers.Bounded_Ordered_Maps has the same contents and semantics as
92379 Containers.Ordered_Maps except:
92380
92381 3/3
92382 * The pragma Preelaborate is replaced with pragma Pure.
92383
92384 4/3
92385 * The type Map is declared with a discriminant that specifies the
92386 capacity (maximum number of elements) as follows:
92387
92388 5/3
92389 type Map (Capacity : Count_Type) is tagged private;
92390
92391 6/3
92392 * The type Map needs finalization if and only if type Key_Type or
92393 type Element_Type needs finalization.
92394
92395 6.a/3
92396 Implementation Note: {AI05-0212-1AI05-0212-1} The type Map
92397 cannot depend on package Ada.Finalization unless the element
92398 type depends on that package. The objects returned from the
92399 Iterator and Reference functions probably do depend on package
92400 Ada.Finalization. Restricted environments may need to avoid
92401 use of those functions and their associated types.
92402
92403 7/3
92404 * The allocation of a new node includes a check that the capacity is
92405 not exceeded, and Capacity_Error is raised if this check fails.
92406
92407 8/3
92408 * In procedure Assign, if Source length is greater than Target
92409 capacity, then Capacity_Error is propagated.
92410
92411 9/3
92412 * The function Copy is replaced with:
92413
92414 10/3
92415 function Copy (Source : Map;
92416 Capacity : Count_Type := 0) return Map;
92417
92418 11/3
92419 Returns a map with key/element pairs initialized from the
92420 values in Source. If Capacity is 0, then the map capacity is
92421 the length of Source; if Capacity is equal to or greater than
92422 the length of Source, the map capacity is the specified value;
92423 otherwise, the operation propagates Capacity_Error.
92424
92425 _Bounded (Run-Time) Errors_
92426
92427 12/3
92428 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92429 to assign from a bounded map object while tampering with elements [or
92430 cursors] of that object is prohibited. Either Program_Error is raised
92431 by the assignment, execution proceeds with the target object prohibiting
92432 tampering with elements [or cursors], or execution proceeds normally.
92433
92434 12.a/3
92435 Proof: Tampering with elements includes tampering with
92436 cursors, so we only really need to talk about tampering with
92437 elements here; we mention cursors for clarity.
92438
92439 _Erroneous Execution_
92440
92441 13/3
92442 {AI05-0265-1AI05-0265-1} When a bounded map object M is finalized, if
92443 tampering with cursors is prohibited for M other than due to an
92444 assignment from another map, then execution is erroneous.
92445
92446 13.a/3
92447 Reason: This is a tampering event, but since the
92448 implementation is not allowed to use Ada.Finalization, it is
92449 not possible in a pure Ada implementation to detect this
92450 error. (There is no Finalize routine that will be called that
92451 could make the check.) Since the check probably cannot be
92452 made, the bad effects that could occur (such as an iterator
92453 going into an infinite loop or accessing a nonexistent
92454 element) cannot be prevented and we have to allow anything.
92455 We do allow re-assigning an object that only prohibits
92456 tampering because it was copied from another object as that
92457 cannot cause any negative effects.
92458
92459 _Implementation Requirements_
92460
92461 14/3
92462 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92463 Containers.Ordered_Maps and each instance of
92464 Containers.Bounded_Ordered_Maps, if the two instances meet the following
92465 conditions, then the output generated by the Map'Output or Map'Write
92466 subprograms of either instance shall be readable by the Map'Input or
92467 Map'Read of the other instance, respectively:
92468
92469 15/3
92470 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92471 parameters of the two instances are statically matching subtypes of
92472 the same type; and
92473
92474 16/3
92475 * {AI05-0184-1AI05-0184-1} the output generated by
92476 Element_Type'Output or Element_Type'Write is readable by
92477 Element_Type'Input or Element_Type'Read, respectively (where
92478 Element_Type denotes the type of the two actual Element_Type
92479 parameters); and
92480
92481 17/3
92482 * {AI05-0184-1AI05-0184-1} the preceding two conditions also hold for
92483 the Key_Type parameters of the instances.
92484
92485 _Implementation Advice_
92486
92487 18/3
92488 {AI05-0001-1AI05-0001-1} {AI05-0269-1AI05-0269-1} Bounded ordered map
92489 objects should be implemented without implicit pointers or dynamic
92490 allocation.
92491
92492 18.a.1/3
92493 Implementation Advice: Bounded ordered map objects should be
92494 implemented without implicit pointers or dynamic allocation.
92495
92496 19/3
92497 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92498 minimize copying does not apply.
92499
92500 19.a.1/3
92501 Implementation Advice: The implementation advice for procedure
92502 Move to minimize copying does not apply to bounded ordered
92503 maps.
92504
92505 _Extensions to Ada 2005_
92506
92507 19.a/3
92508 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92509 {AI05-0184-1AI05-0184-1} The generic package
92510 Containers.Bounded_Ordered_Maps is new.
92511
92512 \1f
92513 File: aarm2012.info, Node: A.18.23, Next: A.18.24, Prev: A.18.22, Up: A.18
92514
92515 A.18.23 The Generic Package Containers.Bounded_Hashed_Sets
92516 ----------------------------------------------------------
92517
92518 1/3
92519 {AI05-0001-1AI05-0001-1} The language-defined generic package
92520 Containers.Bounded_Hashed_Sets provides a private type Set and a set of
92521 operations. It provides the same operations as the package
92522 Containers.Hashed_Sets (see *note A.18.8::), with the difference that
92523 the maximum storage is bounded.
92524
92525 _Static Semantics_
92526
92527 2/3
92528 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
92529 Containers.Bounded_Hashed_Sets has the same contents and semantics as
92530 Containers.Hashed_Sets except:
92531
92532 3/3
92533 * The pragma Preelaborate is replaced with pragma Pure.
92534
92535 4/3
92536 * The type Set is declared with discriminants that specify both the
92537 capacity (number of elements) and modulus (number of distinct hash
92538 values) of the hash table as follows:
92539
92540 5/3
92541 type Set (Capacity : Count_Type;
92542 Modulus : Hash_Type) is tagged private;
92543
92544 6/3
92545 * The type Set needs finalization if and only if type Element_Type
92546 needs finalization.
92547
92548 6.a/3
92549 Implementation Note: {AI05-0212-1AI05-0212-1} The type Set
92550 cannot depend on package Ada.Finalization unless the element
92551 or key type depends on that package. The objects returned
92552 from the Iterator and Reference functions probably do depend
92553 on package Ada.Finalization. Restricted environments may need
92554 to avoid use of those functions and their associated types.
92555
92556 7/3
92557 * The description of Reserve_Capacity is replaced with:
92558
92559 8/3
92560 If the specified Capacity is larger than the capacity of
92561 Container, then Reserve_Capacity propagates Capacity_Error.
92562 Otherwise, the operation has no effect.
92563
92564 9/3
92565 * An additional operation is added immediately following
92566 Reserve_Capacity:
92567
92568 10/3
92569 function Default_Modulus (Capacity : Count_Type) return Hash_Type;
92570
92571 11/3
92572 Default_Modulus returns an implementation-defined value for
92573 the number of distinct hash values to be used for the given
92574 capacity (maximum number of elements).
92575
92576 12/3
92577 * The function Copy is replaced with:
92578
92579 13/3
92580 function Copy (Source : Set;
92581 Capacity : Count_Type := 0;
92582 Modulus : Hash_Type := 0) return Set;
92583
92584 14/3
92585 {AI05-0264-1AI05-0264-1} Returns a set whose elements are
92586 initialized from the values in Source. If Capacity is 0, then
92587 the set capacity is the length of Source; if Capacity is equal
92588 to or greater than the length of Source, the set capacity is
92589 the value of the Capacity parameter; otherwise, the operation
92590 propagates Capacity_Error. If the Modulus argument is 0, then
92591 the set modulus is the value returned by a call to
92592 Default_Modulus with the set capacity as its argument;
92593 otherwise, the set modulus is the value of the Modulus
92594 parameter.
92595
92596 _Bounded (Run-Time) Errors_
92597
92598 15/3
92599 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92600 to assign from a bounded set object while tampering with elements [or
92601 cursors] of that object is prohibited. Either Program_Error is raised
92602 by the assignment, execution proceeds with the target object prohibiting
92603 tampering with elements [or cursors], or execution proceeds normally.
92604
92605 15.a/3
92606 Proof: Tampering with elements includes tampering with
92607 cursors, so we only really need to talk about tampering with
92608 elements here; we mention cursors for clarity.
92609
92610 _Erroneous Execution_
92611
92612 16/3
92613 {AI05-0265-1AI05-0265-1} When a bounded set object S is finalized, if
92614 tampering with cursors is prohibited for S other than due to an
92615 assignment from another set, then execution is erroneous.
92616
92617 16.a/3
92618 Reason: This is a tampering event, but since the
92619 implementation is not allowed to use Ada.Finalization, it is
92620 not possible in a pure Ada implementation to detect this
92621 error. (There is no Finalize routine that will be called that
92622 could make the check.) Since the check probably cannot be
92623 made, the bad effects that could occur (such as an iterator
92624 going into an infinite loop or accessing a nonexistent
92625 element) cannot be prevented and we have to allow anything.
92626 We do allow re-assigning an object that only prohibits
92627 tampering because it was copied from another object as that
92628 cannot cause any negative effects.
92629
92630 _Implementation Requirements_
92631
92632 17/3
92633 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92634 Containers.Hashed_Sets and each instance of
92635 Containers.Bounded_Hashed_Sets, if the two instances meet the following
92636 conditions, then the output generated by the Set'Output or Set'Write
92637 subprograms of either instance shall be readable by the Set'Input or
92638 Set'Read of the other instance, respectively:
92639
92640 18/3
92641 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92642 parameters of the two instances are statically matching subtypes of
92643 the same type; and
92644
92645 19/3
92646 * {AI05-0184-1AI05-0184-1} the output generated by
92647 Element_Type'Output or Element_Type'Write is readable by
92648 Element_Type'Input or Element_Type'Read, respectively (where
92649 Element_Type denotes the type of the two actual Element_Type
92650 parameters).
92651
92652 _Implementation Advice_
92653
92654 20/3
92655 {AI05-0001-1AI05-0001-1} {AI05-0269-1AI05-0269-1} Bounded hashed set
92656 objects should be implemented without implicit pointers or dynamic
92657 allocation.
92658
92659 20.a.1/3
92660 Implementation Advice: Bounded hashed set objects should be
92661 implemented without implicit pointers or dynamic allocation.
92662
92663 21/3
92664 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92665 minimize copying does not apply.
92666
92667 21.a.1/3
92668 Implementation Advice: The implementation advice for procedure
92669 Move to minimize copying does not apply to bounded hashed
92670 sets.
92671
92672 _Extensions to Ada 2005_
92673
92674 21.a/3
92675 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92676 {AI05-0184-1AI05-0184-1} The generic package
92677 Containers.Bounded_Hashed_Sets is new.
92678
92679 \1f
92680 File: aarm2012.info, Node: A.18.24, Next: A.18.25, Prev: A.18.23, Up: A.18
92681
92682 A.18.24 The Generic Package Containers.Bounded_Ordered_Sets
92683 -----------------------------------------------------------
92684
92685 1/3
92686 {AI05-0001-1AI05-0001-1} The language-defined generic package
92687 Containers.Bounded_Ordered_Sets provides a private type Set and a set of
92688 operations. It provides the same operations as the package
92689 Containers.Ordered_Sets (see *note A.18.9::), with the difference that
92690 the maximum storage is bounded.
92691
92692 _Static Semantics_
92693
92694 2/3
92695 {AI05-0001-1AI05-0001-1} The declaration of the generic library package
92696 Containers.Bounded_Ordered_Sets has the same contents and semantics as
92697 Containers.Ordered_Sets except:
92698
92699 3/3
92700 * The pragma Preelaborate is replaced with pragma Pure.
92701
92702 4/3
92703 * The type Set is declared with a discriminant that specifies the
92704 capacity (maximum number of elements) as follows:
92705
92706 5/3
92707 type Set (Capacity : Count_Type) is tagged private;
92708
92709 6/3
92710 * The type Set needs finalization if and only if type Element_Type
92711 needs finalization.
92712
92713 6.a/3
92714 Implementation Note: {AI05-0212-1AI05-0212-1} The type Set
92715 cannot depend on package Ada.Finalization unless the element
92716 type depends on that package. The objects returned from the
92717 Iterator and Reference functions probably do depend on package
92718 Ada.Finalization. Restricted environments may need to avoid
92719 use of those functions and their associated types.
92720
92721 7/3
92722 * If Insert (or Include) adds an element, a check is made that the
92723 capacity is not exceeded, and Capacity_Error is raised if this
92724 check fails.
92725
92726 8/3
92727 * In procedure Assign, if Source length is greater than Target
92728 capacity, then Capacity_Error is propagated.
92729
92730 9/3
92731 * The function Copy is replaced with:
92732
92733 10/3
92734 function Copy (Source : Set;
92735 Capacity : Count_Type := 0) return Set;
92736
92737 11/3
92738 Returns a set whose elements are initialized from the values
92739 in Source. If Capacity is 0, then the set capacity is the
92740 length of Source; if Capacity is equal to or greater than the
92741 length of Source, the set capacity is the specified value;
92742 otherwise, the operation propagates Capacity_Error.
92743
92744 _Bounded (Run-Time) Errors_
92745
92746 12/3
92747 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92748 to assign from a bounded set object while tampering with elements [or
92749 cursors] of that object is prohibited. Either Program_Error is raised
92750 by the assignment, execution proceeds with the target object prohibiting
92751 tampering with elements [or cursors], or execution proceeds normally.
92752
92753 12.a/3
92754 Proof: Tampering with elements includes tampering with
92755 cursors, so we only really need to talk about tampering with
92756 elements here; we mention cursors for clarity.
92757
92758 _Erroneous Execution_
92759
92760 13/3
92761 {AI05-0265-1AI05-0265-1} When a bounded set object S is finalized, if
92762 tampering with cursors is prohibited for S other than due to an
92763 assignment from another set, then execution is erroneous.
92764
92765 13.a/3
92766 Reason: This is a tampering event, but since the
92767 implementation is not allowed to use Ada.Finalization, it is
92768 not possible in a pure Ada implementation to detect this
92769 error. (There is no Finalize routine that will be called that
92770 could make the check.) Since the check probably cannot be
92771 made, the bad effects that could occur (such as an iterator
92772 going into an infinite loop or accessing a nonexistent
92773 element) cannot be prevented and we have to allow anything.
92774 We do allow re-assigning an object that only prohibits
92775 tampering because it was copied from another object as that
92776 cannot cause any negative effects.
92777
92778 _Implementation Requirements_
92779
92780 14/3
92781 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92782 Containers.Ordered_Sets and each instance of
92783 Containers.Bounded_Ordered_Sets, if the two instances meet the following
92784 conditions, then the output generated by the Set'Output or Set'Write
92785 subprograms of either instance shall be readable by the Set'Input or
92786 Set'Read of the other instance, respectively:
92787
92788 15/3
92789 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92790 parameters of the two instances are statically matching subtypes of
92791 the same type; and
92792
92793 16/3
92794 * {AI05-0184-1AI05-0184-1} the output generated by
92795 Element_Type'Output or Element_Type'Write is readable by
92796 Element_Type'Input or Element_Type'Read, respectively (where
92797 Element_Type denotes the type of the two actual Element_Type
92798 parameters).
92799
92800 _Implementation Advice_
92801
92802 17/3
92803 {AI05-0001-1AI05-0001-1} {AI05-0269-1AI05-0269-1} Bounded ordered set
92804 objects should be implemented without implicit pointers or dynamic
92805 allocation.
92806
92807 17.a.1/3
92808 Implementation Advice: Bounded ordered set objects should be
92809 implemented without implicit pointers or dynamic allocation.
92810
92811 18/3
92812 {AI05-0001-1AI05-0001-1} The implementation advice for procedure Move to
92813 minimize copying does not apply.
92814
92815 18.a.1/3
92816 Implementation Advice: The implementation advice for procedure
92817 Move to minimize copying does not apply to bounded ordered
92818 sets.
92819
92820 _Extensions to Ada 2005_
92821
92822 18.a/3
92823 {AI05-0001-1AI05-0001-1} {AI05-0160-1AI05-0160-1}
92824 {AI05-0184-1AI05-0184-1} The generic package
92825 Containers.Bounded_Ordered_Sets is new.
92826
92827 \1f
92828 File: aarm2012.info, Node: A.18.25, Next: A.18.26, Prev: A.18.24, Up: A.18
92829
92830 A.18.25 The Generic Package Containers.Bounded_Multiway_Trees
92831 -------------------------------------------------------------
92832
92833 1/3
92834 {AI05-0136-1AI05-0136-1} The language-defined generic package
92835 Containers.Bounded_Multiway_Trees provides a private type Tree and a set
92836 of operations. It provides the same operations as the package
92837 Containers.Multiway_Trees (see *note A.18.10::), with the difference
92838 that the maximum storage is bounded.
92839
92840 _Static Semantics_
92841
92842 2/3
92843 {AI05-0136-1AI05-0136-1} The declaration of the generic library package
92844 Containers.Bounded_Multiway_Trees has the same contents and semantics as
92845 Containers.Multiway_Trees except:
92846
92847 3/3
92848 * The pragma Preelaborate is replaced with pragma Pure.
92849
92850 4/3
92851 * The type Tree is declared with a discriminant that specifies the
92852 capacity (maximum number of elements) as follows:
92853
92854 5/3
92855 type Tree (Capacity : Count_Type) is tagged private;
92856
92857 6/3
92858 * The type Tree needs finalization if and only if type Element_Type
92859 needs finalization.
92860
92861 6.a/3
92862 Implementation Note: {AI05-0212-1AI05-0212-1} The type Tree
92863 cannot depend on package Ada.Finalization unless the element
92864 type depends on that package. The objects returned from the
92865 Iterator and Reference functions probably do depend on package
92866 Ada.Finalization. Restricted environments may need to avoid
92867 use of those functions and their associated types.
92868
92869 7/3
92870 * The allocation of internal storage includes a check that the
92871 capacity is not exceeded, and Capacity_Error is raised if this
92872 check fails.
92873
92874 8/3
92875 * In procedure Assign, if Source length is greater than Target
92876 capacity, then Capacity_Error is propagated.
92877
92878 9/3
92879 * Function Copy is declared as follows:
92880
92881 10/3
92882 function Copy (Source : Tree; Capacity : Count_Type := 0)
92883 return List;
92884
92885 11/3
92886 If Capacity is 0, then the tree capacity is the count of Source; if
92887 Capacity is equal to or greater than Source.Count, the tree
92888 capacity equals the value of the Capacity parameter; otherwise, the
92889 operation propagates Capacity_Error.
92890
92891 12/3
92892 * {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} In the
92893 five-parameter procedure Splice_Subtree, if Source is not the same
92894 object as Target, and if the sum of Target.Count and
92895 Subtree_Node_Count (Position) is greater than Target.Capacity, then
92896 Splice_Subtree propagates Capacity_Error.
92897
92898 13/3
92899 * {AI05-0136-1AI05-0136-1} {AI05-0248-1AI05-0248-1} In the
92900 five-parameter procedure Splice_Children, if Source is not the same
92901 object as Target, and if the sum of Target.Count and
92902 Subtree_Node_Count (Source_Parent)-1 is greater than
92903 Target.Capacity, then Splice_Children propagates Capacity_Error.
92904
92905 _Bounded (Run-Time) Errors_
92906
92907 14/3
92908 {AI05-0160-1AI05-0160-1} {AI05-0265-1AI05-0265-1} It is a bounded error
92909 to assign from a bounded tree object while tampering with elements [or
92910 cursors] of that object is prohibited. Either Program_Error is raised
92911 by the assignment, execution proceeds with the target object prohibiting
92912 tampering with elements [or cursors], or execution proceeds normally.
92913
92914 14.a/3
92915 Proof: Tampering with elements includes tampering with
92916 cursors, so we only really need to talk about tampering with
92917 elements here; we mention cursors for clarity.
92918
92919 _Erroneous Execution_
92920
92921 15/3
92922 {AI05-0265-1AI05-0265-1} When a bounded tree object T is finalized, if
92923 tampering with cursors is prohibited for T other than due to an
92924 assignment from another tree, then execution is erroneous.
92925
92926 15.a/3
92927 Reason: This is a tampering event, but since the
92928 implementation is not allowed to use Ada.Finalization, it is
92929 not possible in a pure Ada implementation to detect this
92930 error. (There is no Finalize routine that will be called that
92931 could make the check.) Since the check probably cannot be
92932 made, the bad effects that could occur (such as an iterator
92933 going into an infinite loop or accessing a nonexistent
92934 element) cannot be prevented and we have to allow anything.
92935 We do allow re-assigning an object that only prohibits
92936 tampering because it was copied from another object as that
92937 cannot cause any negative effects.
92938
92939 _Implementation Requirements_
92940
92941 16/3
92942 {AI05-0184-1AI05-0184-1} {AI05-0264-1AI05-0264-1} For each instance of
92943 Containers.Multiway_Trees and each instance of
92944 Containers.Bounded_Multiway_Trees, if the two instances meet the
92945 following conditions, then the output generated by the Tree'Output or
92946 Tree'Write subprograms of either instance shall be readable by the
92947 Tree'Input or Tree'Read of the other instance, respectively:
92948
92949 17/3
92950 * {AI05-0184-1AI05-0184-1} {AI05-0248-1AI05-0248-1} the Element_Type
92951 parameters of the two instances are statically matching subtypes of
92952 the same type; and
92953
92954 18/3
92955 * {AI05-0184-1AI05-0184-1} the output generated by
92956 Element_Type'Output or Element_Type'Write is readable by
92957 Element_Type'Input or Element_Type'Read, respectively (where
92958 Element_Type denotes the type of the two actual Element_Type
92959 parameters).
92960
92961 _Implementation Advice_
92962
92963 19/3
92964 {AI05-0136-1AI05-0136-1} Bounded tree objects should be implemented
92965 without implicit pointers or dynamic allocation.
92966
92967 19.a.1/3
92968 Implementation Advice: Bounded tree objects should be
92969 implemented without implicit pointers or dynamic allocation.
92970
92971 20/3
92972 {AI05-0136-1AI05-0136-1} The implementation advice for procedure Move to
92973 minimize copying does not apply.
92974
92975 20.a.1/3
92976 Implementation Advice: The implementation advice for procedure
92977 Move to minimize copying does not apply to bounded trees.
92978
92979 _Extensions to Ada 2005_
92980
92981 20.a/3
92982 {AI05-0136-1AI05-0136-1} {AI05-0184-1AI05-0184-1} The generic
92983 package Containers.Bounded_Multiway_Trees is new.
92984
92985 \1f
92986 File: aarm2012.info, Node: A.18.26, Next: A.18.27, Prev: A.18.25, Up: A.18
92987
92988 A.18.26 Array Sorting
92989 ---------------------
92990
92991 1/3
92992 {AI95-00302-03AI95-00302-03} {AI05-0001-1AI05-0001-1} The
92993 language-defined generic procedures Containers.Generic_Array_Sort,
92994 Containers.Generic_Constrained_Array_Sort, and Containers.Generic_Sort
92995 provide sorting on arbitrary array types.
92996
92997 _Static Semantics_
92998
92999 2/2
93000 {AI95-00302-03AI95-00302-03} The generic library procedure
93001 Containers.Generic_Array_Sort has the following declaration:
93002
93003 3/2
93004 generic
93005 type Index_Type is (<>);
93006 type Element_Type is private;
93007 type Array_Type is array (Index_Type range <>) of Element_Type;
93008 with function "<" (Left, Right : Element_Type)
93009 return Boolean is <>;
93010 procedure Ada.Containers.Generic_Array_Sort (Container : in out Array_Type);
93011 pragma Pure(Ada.Containers.Generic_Array_Sort);
93012
93013 4/2
93014 Reorders the elements of Container such that the elements are
93015 sorted smallest first as determined by the generic formal "<"
93016 operator provided. Any exception raised during evaluation of
93017 "<" is propagated.
93018
93019 5/3
93020 {AI05-0044-1AI05-0044-1} {AI05-0262-1AI05-0262-1} The actual
93021 function for the generic formal function "<" of
93022 Generic_Array_Sort is expected to return the same value each
93023 time it is called with a particular pair of element values.
93024 It should define a strict weak ordering relationship (see
93025 *note A.18::); it should not modify Container. If the actual
93026 for "<" behaves in some other manner, the behavior of the
93027 instance of Generic_Array_Sort is unspecified. The number of
93028 times Generic_Array_Sort calls "<" is unspecified.
93029
93030 5.a/2
93031 Ramification: This implies swapping the elements, usually
93032 including an intermediate copy. This of course means that the
93033 elements will be copied. Since the elements are nonlimited,
93034 this usually will not be a problem. Note that there is
93035 Implementation Advice below that the implementation should use
93036 a sort that minimizes copying of elements.
93037
93038 5.b/2
93039 The sort is not required to be stable (and the fast algorithm
93040 required will not be stable). If a stable sort is needed, the
93041 user can include the original location of the element as an
93042 extra "sort key". We considered requiring the implementation
93043 to do that, but it is mostly extra overhead -- usually there
93044 is something already in the element that provides the needed
93045 stability.
93046
93047 6/2
93048 {AI95-00302-03AI95-00302-03} The generic library procedure
93049 Containers.Generic_Constrained_Array_Sort has the following declaration:
93050
93051 7/2
93052 generic
93053 type Index_Type is (<>);
93054 type Element_Type is private;
93055 type Array_Type is array (Index_Type) of Element_Type;
93056 with function "<" (Left, Right : Element_Type)
93057 return Boolean is <>;
93058 procedure Ada.Containers.Generic_Constrained_Array_Sort
93059 (Container : in out Array_Type);
93060 pragma Pure(Ada.Containers.Generic_Constrained_Array_Sort);
93061
93062 8/2
93063 Reorders the elements of Container such that the elements are
93064 sorted smallest first as determined by the generic formal "<"
93065 operator provided. Any exception raised during evaluation of
93066 "<" is propagated.
93067
93068 9/3
93069 {AI05-0044-1AI05-0044-1} {AI05-0262-1AI05-0262-1} The actual
93070 function for the generic formal function "<" of
93071 Generic_Constrained_Array_Sort is expected to return the same
93072 value each time it is called with a particular pair of element
93073 values. It should define a strict weak ordering relationship
93074 (see *note A.18::); it should not modify Container. If the
93075 actual for "<" behaves in some other manner, the behavior of
93076 the instance of Generic_Constrained_Array_Sort is unspecified.
93077 The number of times Generic_Constrained_Array_Sort calls "<"
93078 is unspecified.
93079
93080 9.1/3
93081 {AI05-0001-1AI05-0001-1} The generic library procedure
93082 Containers.Generic_Sort has the following declaration:
93083
93084 9.2/3
93085 generic
93086 type Index_Type is (<>);
93087 with function Before (Left, Right : Index_Type) return Boolean;
93088 with procedure Swap (Left, Right : Index_Type);
93089 procedure Ada.Containers.Generic_Sort
93090 (First, Last : Index_Type'Base);
93091 pragma Pure(Ada.Containers.Generic_Sort);
93092
93093 9.3/3
93094 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} Reorders the
93095 elements of an indexable structure, over the range First ..
93096 Last, such that the elements are sorted in the ordering
93097 determined by the generic formal function Before; Before
93098 should return True if Left is to be sorted before Right. The
93099 generic formal Before compares the elements having the given
93100 indices, and the generic formal Swap exchanges the values of
93101 the indicated elements. Any exception raised during
93102 evaluation of Before or Swap is propagated.
93103
93104 9.4/3
93105 The actual function for the generic formal function Before of
93106 Generic_Sort is expected to return the same value each time it
93107 is called with index values that identify a particular pair of
93108 element values. It should define a strict weak ordering
93109 relationship (see *note A.18::); it should not modify the
93110 elements. The actual function for the generic formal Swap
93111 should exchange the values of the indicated elements. If the
93112 actual for either Before or Swap behaves in some other manner,
93113 the behavior of Generic_Sort is unspecified. The number of
93114 times the Generic_Sort calls Before or Swap is unspecified.
93115
93116 _Implementation Advice_
93117
93118 10/2
93119 {AI95-00302-03AI95-00302-03} The worst-case time complexity of a call on
93120 an instance of Containers.Generic_Array_Sort or
93121 Containers.Generic_Constrained_Array_Sort should be O(N**2) or better,
93122 and the average time complexity should be better than O(N**2), where N
93123 is the length of the Container parameter.
93124
93125 10.a/2
93126 Implementation Advice: Containers.Generic_Array_Sort and
93127 Containers.Generic_Constrained_Array_Sort should have an
93128 average time complexity better than O(N**2) and worst case no
93129 worse than O(N**2).
93130
93131 10.b/2
93132 Discussion: In other words, we're requiring the use of a
93133 sorting algorithm better than O(N**2), such as Quicksort. No
93134 bubble sorts allowed!
93135
93136 11/2
93137 {AI95-00302-03AI95-00302-03} Containers.Generic_Array_Sort and
93138 Containers.Generic_Constrained_Array_Sort should minimize copying of
93139 elements.
93140
93141 11.a/2
93142 Implementation Advice: Containers.Generic_Array_Sort and
93143 Containers.Generic_Constrained_Array_Sort should minimize
93144 copying of elements.
93145
93146 11.b/2
93147 To be honest: We do not mean "absolutely minimize" here; we're
93148 not intending to require a single copy for each element.
93149 Rather, we want to suggest that the sorting algorithm chosen
93150 is one that does not copy items unnecessarily. Bubble sort
93151 would not meet this advice, for instance.
93152
93153 12/3
93154 {AI05-0248-1AI05-0248-1} The worst-case time complexity of a call on an
93155 instance of Containers.Generic_Sort should be O(N**2) or better, and the
93156 average time complexity should be better than O(N**2), where N is the
93157 difference between the Last and First parameters plus 1.
93158
93159 12.a.1/3
93160 Implementation Advice: Containers.Generic_Sort should have an
93161 average time complexity better than O(N**2) and worst case no
93162 worse than O(N**2).
93163
93164 13/3
93165 {AI05-0248-1AI05-0248-1} Containers.Generic_Sort should minimize calls
93166 to the generic formal Swap.
93167
93168 13.a.1/3
93169 Implementation Advice: Containers.Generic_Sort should minimize
93170 calls to the generic formal Swap.
93171
93172 _Extensions to Ada 95_
93173
93174 13.a/2
93175 {AI95-00302-03AI95-00302-03} The generic procedures
93176 Containers.Generic_Array_Sort and
93177 Containers.Generic_Constrained_Array_Sort are new.
93178
93179 _Extensions to Ada 2005_
93180
93181 13.b/3
93182 {AI05-0001-1AI05-0001-1} {AI05-0248-1AI05-0248-1} The generic
93183 procedure Containers.Generic_Sort is new.
93184
93185 _Wording Changes from Ada 2005_
93186
93187 13.c/3
93188 {AI05-0044-1AI05-0044-1} Correction: Redefined "<" actuals to
93189 require a strict weak ordering; the old definition allowed
93190 indeterminant comparisons that would not have worked in a
93191 sort.
93192
93193 \1f
93194 File: aarm2012.info, Node: A.18.27, Next: A.18.28, Prev: A.18.26, Up: A.18
93195
93196 A.18.27 The Generic Package Containers.Synchronized_Queue_Interfaces
93197 --------------------------------------------------------------------
93198
93199 1/3
93200 {AI05-0159-1AI05-0159-1} The language-defined generic package
93201 Containers.Synchronized_Queue_Interfaces provides interface type Queue,
93202 and a set of operations for that type. Interface Queue specifies a
93203 first-in, first-out queue.
93204
93205 _Static Semantics_
93206
93207 2/3
93208 {AI05-0159-1AI05-0159-1} The generic library package
93209 Containers.Synchronized_Queue_Interfaces has the following declaration:
93210
93211 3/3
93212 generic
93213 type Element_Type is private;
93214 package Ada.Containers.Synchronized_Queue_Interfaces is
93215 pragma Pure(Synchronized_Queue_Interfaces);
93216
93217 4/3
93218 type Queue is synchronized interface;
93219
93220 5/3
93221 procedure Enqueue
93222 (Container : in out Queue;
93223 New_Item : in Element_Type) is abstract
93224 with Synchronization => By_Entry;
93225
93226 6/3
93227 procedure Dequeue
93228 (Container : in out Queue;
93229 Element : out Element_Type) is abstract
93230 with Synchronization => By_Entry;
93231
93232 7/3
93233 function Current_Use (Container : Queue) return Count_Type is abstract;
93234 function Peak_Use (Container : Queue) return Count_Type is abstract;
93235
93236 8/3
93237 end Ada.Containers.Synchronized_Queue_Interfaces;
93238
93239 9/3
93240 procedure Enqueue
93241 (Container : in out Queue;
93242 New_Item : in Element_Type) is abstract;
93243
93244 10/3
93245 {AI05-0159-1AI05-0159-1} {AI05-0262-1AI05-0262-1}
93246 {AI05-0264-1AI05-0264-1} A queue type that implements this
93247 interface is allowed to have a bounded capacity. If the queue
93248 object has a bounded capacity, and the number of existing
93249 elements equals the capacity, then Enqueue blocks until
93250 storage becomes available; otherwise, Enqueue does not block.
93251 In any case, it then copies New_Item onto the queue.
93252
93253 11/3
93254 procedure Dequeue
93255 (Container : in out Queue;
93256 Element : out Element_Type) is abstract;
93257
93258 12/3
93259 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} If the queue
93260 is empty, then Dequeue blocks until an item becomes available.
93261 In any case, it then assigns the element at the head of the
93262 queue to Element, and removes it from the queue.
93263
93264 13/3
93265 function Current_Use (Container : Queue) return Count_Type is abstract;
93266
93267 14/3
93268 {AI05-0159-1AI05-0159-1} Returns the number of elements
93269 currently in the queue.
93270
93271 15/3
93272 function Peak_Use (Container : Queue) return Count_Type is abstract;
93273
93274 16/3
93275 {AI05-0159-1AI05-0159-1} Returns the maximum number of
93276 elements that have been in the queue at any one time.
93277
93278 NOTES
93279
93280 17/3
93281 51 {AI05-0251-1AI05-0251-1} Unlike other language-defined
93282 containers, there are no queues whose element types are indefinite.
93283 Elements of an indefinite type can be handled by defining the
93284 element of the queue to be a holder container (see *note A.18.18::)
93285 of the indefinite type, or to be an explicit access type that
93286 designates the indefinite type.
93287
93288 17.a/3
93289 Reason: There are no indefinite queues, as a useful definition
93290 for Dequeue is not possible. Dequeue cannot be a function, as
93291 Ada does not have entries that are functions (thus conditional
93292 and timed calls would not be possible). Moreover, protected
93293 functions do not allow modifying the queue object (thus it
93294 doesn't work even if we decided we didn't care about
93295 conditional and timed calls). If Dequeue is an entry, then
93296 the dequeued object would have to be an out parameter and that
93297 would require the queue client to guess the tag and
93298 constraints of the value that will be dequeued (otherwise
93299 Constraint_Error would be raised), and that is rarely going to
93300 be possible.
93301
93302 _Extensions to Ada 2005_
93303
93304 17.b/3
93305 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} The generic
93306 package Containers.Synchronized_Queue_Interfaces is new.
93307
93308 \1f
93309 File: aarm2012.info, Node: A.18.28, Next: A.18.29, Prev: A.18.27, Up: A.18
93310
93311 A.18.28 The Generic Package Containers.Unbounded_Synchronized_Queues
93312 --------------------------------------------------------------------
93313
93314 _Static Semantics_
93315
93316 1/3
93317 {AI05-0159-1AI05-0159-1} The language-defined generic package
93318 Containers.Unbounded_Synchronized_Queues provides type Queue, which
93319 implements the interface type
93320 Containers.Synchronized_Queue_Interfaces.Queue.
93321
93322 2/3
93323 with System;
93324 with Ada.Containers.Synchronized_Queue_Interfaces;
93325 generic
93326 with package Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (<>);
93327 Default_Ceiling : System.Any_Priority := System.Priority'Last;
93328 package Ada.Containers.Unbounded_Synchronized_Queues is
93329 pragma Preelaborate(Unbounded_Synchronized_Queues);
93330
93331 3/3
93332 package Implementation is
93333 ... -- not specified by the language
93334 end Implementation;
93335
93336 4/3
93337 protected type Queue
93338 (Ceiling : System.Any_Priority := Default_Ceiling)
93339 with Priority => Ceiling is
93340 new Queue_Interfaces.Queue with
93341
93342 5/3
93343 overriding
93344 entry Enqueue (New_Item : in Queue_Interfaces.Element_Type);
93345 overriding
93346 entry Dequeue (Element : out Queue_Interfaces.Element_Type);
93347
93348 6/3
93349 overriding
93350 function Current_Use return Count_Type;
93351 overriding
93352 function Peak_Use return Count_Type;
93353
93354 7/3
93355 private
93356 ... -- not specified by the language
93357 end Queue;
93358
93359 8/3
93360 private
93361
93362 9/3
93363 ... -- not specified by the language
93364
93365 10/3
93366 end Ada.Containers.Unbounded_Synchronized_Queues;
93367
93368 11/3
93369 {AI05-0159-1AI05-0159-1} The type Queue is used to represent task-safe
93370 queues.
93371
93372 12/3
93373 {AI05-0159-1AI05-0159-1} The capacity for instances of type Queue is
93374 unbounded.
93375
93376 12.a/3
93377 Ramification: Enqueue never blocks; if more storage is needed
93378 for a new element, it is allocated dynamically. We don't need
93379 to explicitly specify that Queue needs finalization, because
93380 it is visibly protected.
93381
93382 12.b/3
93383 Discussion: Nested package Implementation can be used to
93384 declare the types needed to implement the protected type
93385 Queue. This nested package is necessary as types cannot be
93386 declared in the private part of a protected type, and the
93387 types have to be declared within the generic unit in order to
93388 depend on the types imported with package Queue_Interfaces.
93389 Clients should never depend on the contents of nested package
93390 Implementation.
93391
93392 _Extensions to Ada 2005_
93393
93394 12.c/3
93395 {AI05-0159-1AI05-0159-1} The generic package
93396 Containers.Unbounded_Synchronized_Queues is new.
93397
93398 \1f
93399 File: aarm2012.info, Node: A.18.29, Next: A.18.30, Prev: A.18.28, Up: A.18
93400
93401 A.18.29 The Generic Package Containers.Bounded_Synchronized_Queues
93402 ------------------------------------------------------------------
93403
93404 _Static Semantics_
93405
93406 1/3
93407 {AI05-0159-1AI05-0159-1} The language-defined generic package
93408 Containers.Bounded_Synchronized_Queues provides type Queue, which
93409 implements the interface type
93410 Containers.Synchronized_Queue_Interfaces.Queue.
93411
93412 2/3
93413 with System;
93414 with Ada.Containers.Synchronized_Queue_Interfaces;
93415 generic
93416 with package Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (<>);
93417 Default_Capacity : Count_Type;
93418 Default_Ceiling : System.Any_Priority := System.Priority'Last;
93419 package Ada.Containers.Bounded_Synchronized_Queues is
93420 pragma Preelaborate(Bounded_Synchronized_Queues);
93421
93422 3/3
93423 package Implementation is
93424 ... -- not specified by the language
93425 end Implementation;
93426
93427 4/3
93428 protected type Queue
93429 (Capacity : Count_Type := Default_Capacity;
93430 Ceiling : System.Any_Priority := Default_Ceiling)
93431 with Priority => Ceiling is
93432 new Queue_Interfaces.Queue with
93433
93434 5/3
93435 overriding
93436 entry Enqueue (New_Item : in Queue_Interfaces.Element_Type);
93437 overriding
93438 entry Dequeue (Element : out Queue_Interfaces.Element_Type);
93439
93440 6/3
93441 overriding
93442 function Current_Use return Count_Type;
93443 overriding
93444 function Peak_Use return Count_Type;
93445
93446 7/3
93447 private
93448 ... -- not specified by the language
93449 end Queue;
93450
93451 8/3
93452 private
93453
93454 9/3
93455 ... -- not specified by the language
93456
93457 10/3
93458 end Ada.Containers.Bounded_Synchronized_Queues;
93459
93460 11/3
93461 {AI05-0159-1AI05-0159-1} The semantics are the same as for
93462 Unbounded_Synchronized_Queues, except:
93463
93464 12/3
93465 * The capacity for instances of type Queue is bounded and specified
93466 by the discriminant Capacity.
93467
93468 12.a/3
93469 Ramification: Since this type has a bounded capacity, Enqueue
93470 might block if the queue is full.
93471
93472 _Implementation Advice_
93473
93474 13/3
93475 {AI05-0159-1AI05-0159-1} Bounded queue objects should be implemented
93476 without implicit pointers or dynamic allocation.
93477
93478 13.a.1/3
93479 Implementation Advice: Bounded queue objects should be
93480 implemented without implicit pointers or dynamic allocation.
93481
93482 _Extensions to Ada 2005_
93483
93484 13.a/3
93485 {AI05-0159-1AI05-0159-1} The generic package
93486 Containers.Bounded_Synchronized_Queues is new.
93487
93488 \1f
93489 File: aarm2012.info, Node: A.18.30, Next: A.18.31, Prev: A.18.29, Up: A.18
93490
93491 A.18.30 The Generic Package Containers.Unbounded_Priority_Queues
93492 ----------------------------------------------------------------
93493
93494 _Static Semantics_
93495
93496 1/3
93497 {AI05-0159-1AI05-0159-1} The language-defined generic package
93498 Containers.Unbounded_Priority_Queues provides type Queue, which
93499 implements the interface type
93500 Containers.Synchronized_Queue_Interfaces.Queue.
93501
93502 2/3
93503 with System;
93504 with Ada.Containers.Synchronized_Queue_Interfaces;
93505 generic
93506 with package Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (<>);
93507 type Queue_Priority is private;
93508 with function Get_Priority
93509 (Element : Queue_Interfaces.Element_Type) return Queue_Priority is <>;
93510 with function Before
93511 (Left, Right : Queue_Priority) return Boolean is <>;
93512 Default_Ceiling : System.Any_Priority := System.Priority'Last;
93513 package Ada.Containers.Unbounded_Priority_Queues is
93514 pragma Preelaborate(Unbounded_Priority_Queues);
93515
93516 3/3
93517 package Implementation is
93518 ... -- not specified by the language
93519 end Implementation;
93520
93521 4/3
93522 protected type Queue
93523 (Ceiling : System.Any_Priority := Default_Ceiling)
93524 with Priority => Ceiling is
93525 new Queue_Interfaces.Queue with
93526
93527 5/3
93528 overriding
93529 entry Enqueue (New_Item : in Queue_Interfaces.Element_Type);
93530 overriding
93531 entry Dequeue (Element : out Queue_Interfaces.Element_Type);
93532
93533 6/3
93534 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} not overriding
93535 procedure Dequeue_Only_High_Priority
93536 (At_Least : in Queue_Priority;
93537 Element : in out Queue_Interfaces.Element_Type;
93538 Success : out Boolean);
93539
93540 7/3
93541 overriding
93542 function Current_Use return Count_Type;
93543 overriding
93544 function Peak_Use return Count_Type;
93545
93546 8/3
93547 private
93548 ... -- not specified by the language
93549 end Queue;
93550
93551 9/3
93552 private
93553
93554 10/3
93555 ... -- not specified by the language
93556
93557 11/3
93558 end Ada.Containers.Unbounded_Priority_Queues;
93559
93560 12/3
93561 {AI05-0159-1AI05-0159-1} The type Queue is used to represent task-safe
93562 priority queues.
93563
93564 13/3
93565 {AI05-0159-1AI05-0159-1} The capacity for instances of type Queue is
93566 unbounded.
93567
93568 14/3
93569 {AI05-0159-1AI05-0159-1} Two elements E1 and E2 are equivalent if
93570 Before(Get_Priority(E1), Get_Priority(E2)) and Before(Get_Priority(E2),
93571 Get_Priority(E1)) both return False.
93572
93573 15/3
93574 {AI05-0159-1AI05-0159-1} {AI05-0248-1AI05-0248-1} The actual functions
93575 for Get_Priority and Before are expected to return the same value each
93576 time they are called with the same actuals, and should not modify their
93577 actuals. Before should define a strict weak ordering relationship (see
93578 *note A.18::). If the actual functions behave in some other manner, the
93579 behavior of Unbounded_Priority_Queues is unspecified.
93580
93581 16/3
93582 {AI05-0159-1AI05-0159-1} Enqueue inserts an item according to the order
93583 specified by the Before function on the result of Get_Priority on the
93584 elements; Before should return True if Left is to be inserted before
93585 Right. If the queue already contains elements equivalent to New_Item,
93586 then it is inserted after the existing equivalent elements.
93587
93588 16.a/3
93589 Ramification: Enqueue never blocks; if more storage is needed
93590 for a new element, it is allocated dynamically. We don't need
93591 to explicitly specify that Queue needs finalization, because
93592 it is visibly protected.
93593
93594 17/3
93595 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1}
93596 {AI05-0262-1AI05-0262-1} For a call on Dequeue_Only_High_Priority, if
93597 the head of the nonempty queue is E, and the function Before(At_Least,
93598 Get_Priority(E)) returns False, then E is assigned to Element and then
93599 removed from the queue, and Success is set to True; otherwise, Success
93600 is set to False and Element is unchanged.
93601
93602 17.a/3
93603 Ramification: {AI05-0251-1AI05-0251-1} Unlike Dequeue,
93604 Dequeue_Only_High_Priority is not blocking; it always returns
93605 immediately.
93606
93607 17.b/3
93608 Reason: {AI05-0251-1AI05-0251-1} The use of Before is
93609 "backwards" so that it acts like ">=" (it is defined similarly
93610 to ">"); thus we dequeue only when it is False.
93611
93612 _Extensions to Ada 2005_
93613
93614 17.c/3
93615 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} The generic
93616 package Containers.Unbounded_Priority_Queues is new.
93617
93618 \1f
93619 File: aarm2012.info, Node: A.18.31, Next: A.18.32, Prev: A.18.30, Up: A.18
93620
93621 A.18.31 The Generic Package Containers.Bounded_Priority_Queues
93622 --------------------------------------------------------------
93623
93624 _Static Semantics_
93625
93626 1/3
93627 {AI05-0159-1AI05-0159-1} The language-defined generic package
93628 Containers.Bounded_Priority_Queues provides type Queue, which implements
93629 the interface type Containers.Synchronized_Queue_Interfaces.Queue.
93630
93631 2/3
93632 with System;
93633 with Ada.Containers.Synchronized_Queue_Interfaces;
93634 generic
93635 with package Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (<>);
93636 type Queue_Priority is private;
93637 with function Get_Priority
93638 (Element : Queue_Interfaces.Element_Type) return Queue_Priority is <>;
93639 with function Before
93640 (Left, Right : Queue_Priority) return Boolean is <>;
93641 Default_Capacity : Count_Type;
93642 Default_Ceiling : System.Any_Priority := System.Priority'Last;
93643 package Ada.Containers.Bounded_Priority_Queues is
93644 pragma Preelaborate(Bounded_Priority_Queues);
93645
93646 3/3
93647 package Implementation is
93648 ... -- not specified by the language
93649 end Implementation;
93650
93651 4/3
93652 protected type Queue
93653 (Capacity : Count_Type := Default_Capacity;
93654 Ceiling : System.Any_Priority := Default_Ceiling)
93655 with Priority => Ceiling is
93656 new Queue_Interfaces.Queue with
93657
93658 5/3
93659 overriding
93660 entry Enqueue (New_Item : in Queue_Interfaces.Element_Type);
93661 overriding
93662 entry Dequeue (Element : out Queue_Interfaces.Element_Type);
93663
93664 6/3
93665 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} not overriding
93666 procedure Dequeue_Only_High_Priority
93667 (At_Least : in Queue_Priority;
93668 Element : in out Queue_Interfaces.Element_Type;
93669 Success : out Boolean);
93670
93671 7/3
93672 overriding
93673 function Current_Use return Count_Type;
93674 overriding
93675 function Peak_Use return Count_Type;
93676
93677 8/3
93678 private
93679 ... -- not specified by the language
93680 end Queue;
93681
93682 9/3
93683 private
93684
93685 10/3
93686 ... -- not specified by the language
93687
93688 11/3
93689 end Ada.Containers.Bounded_Priority_Queues;
93690
93691 12/3
93692 {AI05-0159-1AI05-0159-1} The semantics are the same as for
93693 Unbounded_Priority_Queues, except:
93694
93695 13/3
93696 * The capacity for instances of type Queue is bounded and specified
93697 by the discriminant Capacity.
93698
93699 13.a/3
93700 Ramification: Since this type has a bounded capacity, Enqueue
93701 might block if the queue is full.
93702
93703 _Implementation Advice_
93704
93705 14/3
93706 {AI05-0159-1AI05-0159-1} Bounded priority queue objects should be
93707 implemented without implicit pointers or dynamic allocation.
93708
93709 14.a.1/3
93710 Implementation Advice: Bounded priority queue objects should
93711 be implemented without implicit pointers or dynamic
93712 allocation.
93713
93714 _Extensions to Ada 2005_
93715
93716 14.a/3
93717 {AI05-0159-1AI05-0159-1} {AI05-0251-1AI05-0251-1} The generic
93718 package Containers.Bounded_Priority_Queues is new.
93719
93720 \1f
93721 File: aarm2012.info, Node: A.18.32, Prev: A.18.31, Up: A.18
93722
93723 A.18.32 Example of Container Use
93724 --------------------------------
93725
93726 _Examples_
93727
93728 1/3
93729 {AI05-0212-1AI05-0212-1} The following example is an implementation of
93730 Dijkstra's shortest path algorithm in a directed graph with positive
93731 distances. The graph is represented by a map from nodes to sets of
93732 edges.
93733
93734 2/3
93735 with Ada.Containers.Vectors;
93736 with Ada.Containers.Doubly_Linked_Lists;
93737 use Ada.Containers;
93738 generic
93739 type Node is range <>;
93740 package Shortest_Paths is
93741 type Distance is new Float range 0.0 .. Float'Last;
93742 type Edge is record
93743 To, From : Node;
93744 Length : Distance;
93745 end record;
93746
93747 3/3
93748 package Node_Maps is new Vectors (Node, Node);
93749 -- The algorithm builds a map to indicate the node used to reach a given
93750 -- node in the shortest distance.
93751
93752 4/3
93753 package Adjacency_Lists is new Doubly_Linked_Lists (Edge);
93754 use Adjacency_Lists;
93755
93756 5/3
93757 package Graphs is new Vectors (Node, Adjacency_Lists.List);
93758
93759 6/3
93760 package Paths is new Doubly_Linked_Lists (Node);
93761
93762 7/3
93763 function Shortest_Path
93764 (G : Graphs.Vector; Source : Node; Target : Node) return Paths.List
93765 with Pre => G (Source) /= Adjacency_Lists.Empty_List;
93766
93767 8/3
93768 end Shortest_Paths;
93769
93770 9/3
93771 package body Shortest_Paths is
93772 function Shortest_Path
93773 (G : Graphs.Vector; Source : Node; Target : Node) return Paths.List
93774 is
93775 use Adjacency_Lists, Node_Maps, Paths, Graphs;
93776 Reached : array (Node) of Boolean := (others => False);
93777 -- The set of nodes whose shortest distance to the source is known.
93778
93779 10/3
93780 {AI05-0299-1AI05-0299-1} Reached_From : array (Node) of Node;
93781 So_Far : array (Node) of Distance := (others => Distance'Last);
93782 The_Path : Paths.List := Paths.Empty_List;
93783 Nearest_Distance : Distance;
93784 Next : Node;
93785 begin
93786 So_Far(Source) := 0.0;
93787
93788 11/3
93789 while not Reached(Target) loop
93790 Nearest_Distance := Distance'Last;
93791
93792 12/3
93793 -- Find closest node not reached yet, by iterating over all nodes.
93794 -- A more efficient algorithm uses a priority queue for this step.
93795
93796 13/3
93797 Next := Source;
93798 for N in Node'First .. Node'Last loop
93799 if not Reached(N)
93800 and then So_Far(N) < Nearest_Distance then
93801 Next := N;
93802 Nearest_Distance := So_Far(N);
93803 end if;
93804 end loop;
93805
93806 14/3
93807 {AI05-0299-1AI05-0299-1} if Nearest_Distance = Distance'Last then
93808 -- No next node found, graph is not connected
93809 return Paths.Empty_List;
93810
93811 15/3
93812 else
93813 Reached(Next) := True;
93814 end if;
93815
93816 16/3
93817 -- Update minimum distance to newly reachable nodes.
93818
93819 17/3
93820 {AI05-0299-1AI05-0299-1} for E of G (Next) loop
93821 if not Reached(E.To) then
93822 Nearest_Distance := E.Length + So_Far(Next);
93823
93824 18/3
93825 if Nearest_Distance < So_Far(E.To) then
93826 Reached_From(E.To) := Next;
93827 So_Far(E.To) := Nearest_Distance;
93828 end if;
93829 end if;
93830 end loop;
93831 end loop;
93832
93833 19/3
93834 -- Rebuild path from target to source.
93835
93836 20/3
93837 declare
93838 N : Node := Target;
93839 begin
93840 while N /= Source loop
93841 N := Reached_From(N);
93842 Prepend (The_Path, N);
93843 end loop;
93844 end;
93845
93846 21/3
93847 return The_Path;
93848 end;
93849 end Shortest_Paths;
93850
93851 22/3
93852 {AI05-0212-1AI05-0212-1} Note that the effect of the Constant_Indexing
93853 aspect (on type Vector) and the Implicit_Dereference aspect (on type
93854 Reference_Type) is that
93855
93856 23/3
93857 G (Next)
93858
93859 24/3
93860 {AI05-0212-1AI05-0212-1} is a convenient short hand for
93861
93862 25/3
93863 G.Constant_Reference (Next).Element.all
93864
93865 26/3
93866 {AI05-0212-1AI05-0212-1} Similarly, the effect of the loop:
93867
93868 27/3
93869 for E of G (Next) loop
93870 if not Reached(E.To) then
93871 ...
93872 end if;
93873 end loop;
93874
93875 28/3
93876 {AI05-0212-1AI05-0212-1} is the same as:
93877
93878 29/3
93879 for C in G (Next).Iterate loop
93880 declare
93881 E : Edge renames G (Next)(C).all;
93882 begin
93883 if not Reached(E.To) then
93884 ...
93885 end if;
93886 end;
93887 end loop;
93888
93889 30/3
93890 {AI05-0212-1AI05-0212-1} which is the same as:
93891
93892 31/3
93893 declare
93894 L : Adjacency_Lists.List renames G (Next);
93895 C : Adjacency_Lists.Cursor := L.First;
93896 begin
93897 while Has_Element (C) loop
93898 declare
93899 E : Edge renames L(C).all;
93900 begin
93901 if not Reached(E.To) then
93902 ...
93903 end if;
93904 end;
93905 C := L.Next (C);
93906 end loop;
93907 end;
93908
93909 _Wording Changes from Ada 2005_
93910
93911 31.a/3
93912 {AI05-0212-1AI05-0212-1} This example of container use is new.
93913
93914 \1f
93915 File: aarm2012.info, Node: A.19, Prev: A.18, Up: Annex A
93916
93917 A.19 The Package Locales
93918 ========================
93919
93920 1/3
93921 {AI05-0127-2AI05-0127-2} {AI05-0248-1AI05-0248-1} A locale identifies a
93922 geopolitical place or region and its associated language, which can be
93923 used to determine other internationalization-related characteristics.
93924
93925 _Static Semantics_
93926
93927 2/3
93928 {AI05-0127-2AI05-0127-2} The library package Locales has the following
93929 declaration:
93930
93931 3/3
93932 package Ada.Locales is
93933 pragma Preelaborate(Locales);
93934 pragma Remote_Types(Locales);
93935
93936 4/3
93937 type Language_Code is array (1 .. 3) of Character range 'a' .. 'z';
93938 type Country_Code is array (1 .. 2) of Character range 'A' .. 'Z';
93939
93940 5/3
93941 Language_Unknown : constant Language_Code := "und";
93942 Country_Unknown : constant Country_Code := "ZZ";
93943
93944 6/3
93945 function Language return Language_Code;
93946 function Country return Country_Code;
93947
93948 7/3
93949 end Ada.Locales;
93950
93951 8/3
93952 {AI05-0127-2AI05-0127-2} {AI05-0233-1AI05-0233-1} The active locale is
93953 the locale associated with the partition of the current task.
93954
93955 8.a/3
93956 Implementation Note: {AI05-0233-1AI05-0233-1} Some
93957 environments define both a system locale and the locale of the
93958 current user. For such environments, the active locale is
93959 that of current user if any; otherwise (as in a partition
93960 running on a server without a user), the system locale should
93961 be used.
93962
93963 9/3
93964 {AI05-0127-2AI05-0127-2} Language_Code is a lower-case string
93965 representation of an ISO 639-3 alpha-3 code that identifies a language.
93966
93967 9.a/3
93968 Discussion: Some common language codes are: "eng" - English;
93969 "fra" - French; "deu" - German; "zho" - Chinese. These are
93970 the same codes as used by POSIX systems. We considered
93971 including constants for the most common languages, but that
93972 was rejected as the likely source of continual arguments about
93973 the constant names and which languages are important enough to
93974 include.
93975
93976 10/3
93977 {AI05-0127-2AI05-0127-2} Country_Code is an upper-case string
93978 representation of an ISO 3166-1 alpha-2 code that identifies a country.
93979
93980 10.a/3
93981 Discussion: Some common country codes are: "CA" - Canada; "FR"
93982 - France; "DE" - Germany; "IT" - Italy; "ES" - Spain; "GB" -
93983 United Kingdom; "US" - United States. These are the same
93984 codes as used by POSIX systems. We didn't include any country
93985 constants for the same reasons that we didn't include any
93986 language constants.
93987
93988 11/3
93989 {AI05-0127-2AI05-0127-2} {AI05-0248-1AI05-0248-1} Function Language
93990 returns the code of the language associated with the active locale. If
93991 the Language_Code associated with the active locale cannot be determined
93992 from the environment, then Language returns Language_Unknown.
93993
93994 12/3
93995 {AI05-0127-2AI05-0127-2} {AI05-0248-1AI05-0248-1} Function Country
93996 returns the code of the country associated with the active locale. If
93997 the Country_Code associated with the active locale cannot be determined
93998 from the environment, then Country returns Country_Unknown.
93999
94000 _Extensions to Ada 2005_
94001
94002 12.a/3
94003 {AI05-0127-2AI05-0127-2} {AI05-0233-1AI05-0233-1} Package
94004 Locales is new.
94005
94006 \1f
94007 File: aarm2012.info, Node: Annex B, Next: Annex C, Prev: Annex A, Up: Top
94008
94009 Annex B Interface to Other Languages
94010 ************************************
94011
94012 1
94013 This Annex describes features for writing mixed-language programs.
94014 General interface support is presented first; then specific support for
94015 C, COBOL, and Fortran is defined, in terms of language interface
94016 packages for each of these languages.
94017
94018 1.a
94019 Ramification: This Annex is not a "Specialized Needs" annex.
94020 Every implementation must support all nonoptional features
94021 defined here (mainly the package Interfaces).
94022
94023 _Language Design Principles_
94024
94025 1.b
94026 Ada should have strong support for mixed-language programming.
94027
94028 _Implementation Requirements_
94029
94030 2/3
94031 {AI05-0229-1AI05-0229-1} {AI05-0262-1AI05-0262-1}
94032 {AI05-0299-1AI05-0299-1} Support for interfacing to any foreign language
94033 is optional. However, an implementation shall not provide any optional
94034 aspect, attribute, library unit, or pragma having the same name as an
94035 aspect, attribute, library unit, or pragma (respectively) specified in
94036 the subclauses of this Annex unless the provided construct is either as
94037 specified in those subclauses or is more limited in capability than that
94038 required by those subclauses. A program that attempts to use an
94039 unsupported capability of this Annex shall either be identified by the
94040 implementation before run time or shall raise an exception at run time.
94041
94042 2.a/3
94043 Discussion: The intent is that the same rules apply for the
94044 optional parts of language interfacing as apply for
94045 Specialized Needs Annexes. See *note 1.1.3:: for a discussion
94046 of the purpose of these rules.
94047
94048 _Extensions to Ada 83_
94049
94050 2.b
94051 Much of the functionality in this Annex is new to Ada 95.
94052
94053 _Wording Changes from Ada 83_
94054
94055 2.c
94056 This Annex contains what used to be RM83-13.8.
94057
94058 _Wording Changes from Ada 2005_
94059
94060 2.d/3
94061 {AI05-0262-1AI05-0262-1} Moved the clarification that
94062 interfacing to foreign languages is optional and has the same
94063 restrictions as a Specialized Needs Annex here.
94064
94065 * Menu:
94066
94067 * B.1 :: Interfacing Aspects
94068 * B.2 :: The Package Interfaces
94069 * B.3 :: Interfacing with C and C++
94070 * B.4 :: Interfacing with COBOL
94071 * B.5 :: Interfacing with Fortran
94072
94073 \1f
94074 File: aarm2012.info, Node: B.1, Next: B.2, Up: Annex B
94075
94076 B.1 Interfacing Aspects
94077 =======================
94078
94079 0.1/3
94080 {AI05-0229-1AI05-0229-1} An interfacing aspect is a representation
94081 aspect that is one of the aspects Import, Export, Link_Name,
94082 External_Name, or Convention.
94083
94084 1/3
94085 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} Specifying the Import
94086 aspect to have the value True is used to import an entity defined in a
94087 foreign language into an Ada program, thus allowing a foreign-language
94088 subprogram to be called from Ada, or a foreign-language variable to be
94089 accessed from Ada. In contrast, specifying the Export aspect to have
94090 the value True is used to export an Ada entity to a foreign language,
94091 thus allowing an Ada subprogram to be called from a foreign language, or
94092 an Ada object to be accessed from a foreign language. The Import and
94093 Export aspects are intended primarily for objects and subprograms,
94094 although implementations are allowed to support other entities. The
94095 Link_Name and External_Name aspects are used to specify the link name
94096 and external name, respectively, to be used to identify imported or
94097 exported entities in the external environment.
94098
94099 1.a/3
94100 Aspect Description for Import: Entity is imported from another
94101 language.
94102
94103 1.b/3
94104 Aspect Description for Export: Entity is exported to another
94105 language.
94106
94107 1.c/3
94108 Aspect Description for External_Name: Name used to identify an
94109 imported or exported entity.
94110
94111 1.d/3
94112 Aspect Description for Link_Name: Linker symbol used to
94113 identify an imported or exported entity.
94114
94115 2/3
94116 {AI05-0229-1AI05-0229-1} The Convention aspect is used to indicate that
94117 an Ada entity should use the conventions of another language. It is
94118 intended primarily for types and "callback" subprograms. For example,
94119 "with Convention => Fortran" on the declaration of an array type Matrix
94120 implies that Matrix should be represented according to the conventions
94121 of the supported Fortran implementation, namely column-major order.
94122
94123 2.a/3
94124 Aspect Description for Convention: Calling convention or other
94125 convention used for interfacing to other languages.
94126
94127 3
94128 A pragma Linker_Options is used to specify the system linker parameters
94129 needed when a given compilation unit is included in a partition.
94130
94131 _Syntax_
94132
94133 4/3
94134 {AI05-0229-1AI05-0229-1} The form of a pragma Linker_Options is as
94135 follows:
94136
94137 Paragraphs 5 through 7 were moved to *note Annex J::, "*note Annex
94138 J:: Obsolescent Features".
94139
94140 8
94141 pragma Linker_Options(string_expression);
94142
94143 9
94144 A pragma Linker_Options is allowed only at the place of a
94145 declarative_item.
94146
94147 9.1/3
94148 This paragraph was deleted.{8652/00588652/0058}
94149 {AI95-00036-01AI95-00036-01} {AI05-0229-1AI05-0229-1}
94150
94151 _Name Resolution Rules_
94152
94153 9.2/3
94154 {AI05-0229-1AI05-0229-1} The Import and Export aspects are of type
94155 Boolean.
94156
94157 10/3
94158 {AI05-0229-1AI05-0229-1} The Link_Name and External_Name aspects are of
94159 type String.
94160
94161 10.a/3
94162 Ramification: There is no language-defined support for
94163 external or link names of type Wide_String, or of other string
94164 types. Implementations may, of course, have additional
94165 aspects for that purpose. Note that allowing both String and
94166 Wide_String in the same aspect_definition would cause
94167 ambiguities.
94168
94169 10.1/3
94170 {AI05-0229-1AI05-0229-1} The expected type for the string_expression in
94171 pragma Linker_Options is String.
94172
94173 _Legality Rules_
94174
94175 11/3
94176 {AI05-0229-1AI05-0229-1} The aspect Convention shall be specified by a
94177 convention_identifier which shall be the name of a convention. The
94178 convention names are implementation defined, except for certain
94179 language-defined ones, such as Ada and Intrinsic, as explained in *note
94180 6.3.1::, "*note 6.3.1:: Conformance Rules". [Additional convention
94181 names generally represent the calling conventions of foreign languages,
94182 language implementations, or specific run-time models.] The convention
94183 of a callable entity is its calling convention.
94184
94185 11.a
94186 Implementation defined: Implementation-defined convention
94187 names.
94188
94189 11.b
94190 Discussion: We considered representing the convention names
94191 using an enumeration type declared in System. Then,
94192 convention_identifier would be changed to convention_name, and
94193 we would make its expected type be the enumeration type. We
94194 didn't do this because it seems to introduce extra complexity,
94195 and because the list of available languages is better
94196 represented as the list of children of package Interfaces -- a
94197 more open-ended sort of list.
94198
94199 12
94200 If L is a convention_identifier for a language, then a type T is said to
94201 be compatible with convention L, (alternatively, is said to be an
94202 L-compatible type) if any of the following conditions are met:
94203
94204 13
94205 * T is declared in a language interface package corresponding to L
94206 and is defined to be L-compatible (see *note B.3::, *note B.3.1::,
94207 *note B.3.2::, *note B.4::, *note B.5::),
94208
94209 14/3
94210 * {AI05-0229-1AI05-0229-1} Convention L has been specified for T, and
94211 T is eligible for convention L; that is:
94212
94213 15
94214 * T is an array type with either an unconstrained or
94215 statically-constrained first subtype, and its component
94216 type is L-compatible,
94217
94218 16
94219 * T is a record type that has no discriminants and that
94220 only has components with statically-constrained subtypes,
94221 and each component type is L-compatible,
94222
94223 17/3
94224 * {AI05-0002-1AI05-0002-1} T is an access-to-object type,
94225 its designated type is L-compatible, and its designated
94226 subtype is not an unconstrained array subtype,
94227
94228 18
94229 * T is an access-to-subprogram type, and its designated
94230 profile's parameter and result types are all
94231 L-compatible.
94232
94233 19
94234 * T is derived from an L-compatible type,
94235
94236 20
94237 * The implementation permits T as an L-compatible type.
94238
94239 20.a
94240 Discussion: For example, an implementation might permit
94241 Integer as a C-compatible type, though the C type to which it
94242 corresponds might be different in different environments.
94243
94244 21/3
94245 {AI05-0229-1AI05-0229-1} If the Convention aspect is specified for a
94246 type, then the type shall either be compatible with or eligible for the
94247 specified convention.
94248
94249 21.a/3
94250 Ramification: {AI05-0229-1AI05-0229-1} If a type is derived
94251 from an L-compatible type, the derived type is by default
94252 L-compatible, but it is also permitted to specify the
94253 Convention aspect for the derived type.
94254
94255 21.b/3
94256 {AI05-0229-1AI05-0229-1} It is permitted to specify the
94257 Convention aspect for an incomplete type, but in the complete
94258 declaration each component must be L-compatible.
94259
94260 21.c/3
94261 {AI05-0229-1AI05-0229-1} If each component of a record type is
94262 L-compatible, then the record type itself is only L-compatible
94263 if it has a specified Convention.
94264
94265 22/3
94266 {AI05-0229-1AI05-0229-1} Notwithstanding any rule to the contrary, a
94267 declaration with a True Import aspect shall not have a completion.
94268
94269 22.a/3
94270 Discussion: {AI05-0229-1AI05-0229-1} For declarations of
94271 deferred constants and subprograms, we explicitly mention that
94272 no completion is allowed when aspect Import is True. For
94273 other declarations that require completions, we ignore the
94274 possibility of the aspect Import being True. Nevertheless, if
94275 an implementation chooses to allow specifying aspect Import to
94276 be True for the declaration of a task, protected type,
94277 incomplete type, private type, etc., it may do so, and the
94278 normal completion is then not allowed for that declaration.
94279
94280 23/3
94281 {AI05-0229-1AI05-0229-1} An entity with a True Import aspect (or Export
94282 aspect) is said to be imported (respectively, exported). An entity
94283 shall not be both imported and exported.
94284
94285 24
94286 The declaration of an imported object shall not include an explicit
94287 initialization expression. [Default initializations are not performed.]
94288
94289 24.a
94290 Proof: This follows from the "Notwithstanding ..." wording in
94291 the Dynamics Semantics paragraphs below.
94292
94293 25/3
94294 {AI05-0229-1AI05-0229-1} The type of an imported or exported object
94295 shall be compatible with the specified Convention aspect, if any.
94296
94297 25.a
94298 Ramification: This implies, for example, that importing an
94299 Integer object might be illegal, whereas importing an object
94300 of type Interfaces.C.int would be permitted.
94301
94302 26/3
94303 {AI05-0229-1AI05-0229-1} For an imported or exported subprogram, the
94304 result and parameter types shall each be compatible with the specified
94305 Convention aspect, if any.
94306
94307 27/3
94308 {AI05-0229-1AI05-0229-1} The aspect_definition (if any) used to directly
94309 specify an Import, Export, External_Name, or Link_Name aspect shall be a
94310 static expression. The string_expression of a pragma Linker_Options
94311 shall be static. An External_Name or Link_Name aspect shall be
94312 specified only for an entity that is either imported or exported.
94313
94314 _Static Semantics_
94315
94316 Paragraphs 28 and 29 were deleted.
94317
94318 30/3
94319 {AI05-0229-1AI05-0229-1} The Convention aspect represents the calling
94320 convention or representation convention of the entity. For an
94321 access-to-subprogram type, it represents the calling convention of
94322 designated subprograms. In addition:
94323
94324 31/3
94325 * A True Import aspect indicates that the entity is defined
94326 externally (that is, outside the Ada program). This aspect is
94327 never inherited; if not directly specified, the Import aspect is
94328 False.
94329
94330 32/3
94331 * A True Export aspect indicates that the entity is used externally.
94332 This aspect is never inherited; if not directly specified, the
94333 Export aspect is False.
94334
94335 33/3
94336 * For an entity with a True Import or Export aspect, an external
94337 name, link name, or both may also be specified.
94338
94339 34
94340 An external name is a string value for the name used by a foreign
94341 language program either for an entity that an Ada program imports, or
94342 for referring to an entity that an Ada program exports.
94343
94344 35
94345 A link name is a string value for the name of an exported or imported
94346 entity, based on the conventions of the foreign language's compiler in
94347 interfacing with the system's linker tool.
94348
94349 36
94350 The meaning of link names is implementation defined. If neither a link
94351 name nor the Address attribute of an imported or exported entity is
94352 specified, then a link name is chosen in an implementation-defined
94353 manner, based on the external name if one is specified.
94354
94355 36.a
94356 Implementation defined: The meaning of link names.
94357
94358 36.b
94359 Ramification: For example, an implementation might always
94360 prepend "_", and then pass it to the system linker.
94361
94362 36.c
94363 Implementation defined: The manner of choosing link names when
94364 neither the link name nor the address of an imported or
94365 exported entity is specified.
94366
94367 36.d
94368 Ramification: Normally, this will be the entity's defining
94369 name, or some simple transformation thereof.
94370
94371 37
94372 Pragma Linker_Options has the effect of passing its string argument as a
94373 parameter to the system linker (if one exists), if the immediately
94374 enclosing compilation unit is included in the partition being linked.
94375 The interpretation of the string argument, and the way in which the
94376 string arguments from multiple Linker_Options pragmas are combined, is
94377 implementation defined.
94378
94379 37.a
94380 Implementation defined: The effect of pragma Linker_Options.
94381
94382 _Dynamic Semantics_
94383
94384 38/3
94385 {AI05-0229-1AI05-0229-1} Notwithstanding what this International
94386 Standard says elsewhere, the elaboration of a declaration with a True
94387 Import aspect does not create the entity. Such an elaboration has no
94388 other effect than to allow the defining name to denote the external
94389 entity.
94390
94391 38.a
94392 Ramification: This implies that default initializations are
94393 skipped. (Explicit initializations are illegal.) For
94394 example, an imported access object is not initialized to null.
94395
94396 38.b/3
94397 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
94398
94399 38.c/3
94400 Discussion: {AI05-0229-1AI05-0229-1} This "notwithstanding"
94401 wording is better than saying "unless aspect Import is True"
94402 on every definition of elaboration. It says we recognize the
94403 contradiction, and this rule takes precedence.
94404
94405 _Erroneous Execution_
94406
94407 38.1/3
94408 {AI95-00320-01AI95-00320-01} {AI05-0229-1AI05-0229-1} It is the
94409 programmer's responsibility to ensure that the use of interfacing
94410 aspects does not violate Ada semantics; otherwise, program execution is
94411 erroneous.
94412
94413 _Implementation Advice_
94414
94415 39/3
94416 {AI05-0229-1AI05-0229-1} If an implementation supports Export for a
94417 given language, then it should also allow the main subprogram to be
94418 written in that language. It should support some mechanism for invoking
94419 the elaboration of the Ada library units included in the system, and for
94420 invoking the finalization of the environment task. On typical systems,
94421 the recommended mechanism is to provide two subprograms whose link names
94422 are "adainit" and "adafinal". Adainit should contain the elaboration
94423 code for library units. Adafinal should contain the finalization code.
94424 These subprograms should have no effect the second and subsequent time
94425 they are called.
94426
94427 39.a.1/3
94428 Implementation Advice: If Export is supported for a language,
94429 the main program should be able to be written in that
94430 language. Subprograms named "adainit" and "adafinal" should
94431 be provided for elaboration and finalization of the
94432 environment task.
94433
94434 39.a
94435 Ramification: For example, if the main subprogram is written
94436 in C, it can call adainit before the first call to an Ada
94437 subprogram, and adafinal after the last.
94438
94439 40/3
94440 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} Automatic elaboration
94441 of preelaborated packages should be provided when specifying the Export
94442 aspect as True is supported.
94443
94444 40.a.1/3
94445 Implementation Advice: Automatic elaboration of preelaborated
94446 packages should be provided when specifying the Export aspect
94447 as True is supported.
94448
94449 41/3
94450 {AI05-0229-1AI05-0229-1} For each supported convention L other than
94451 Intrinsic, an implementation should support specifying the Import and
94452 Export aspects for objects of L-compatible types and for subprograms,
94453 and the Convention aspect for L-eligible types and for subprograms,
94454 presuming the other language has corresponding features. Specifying the
94455 Convention aspect need not be supported for scalar types.
94456
94457 41.a.1/3
94458 Implementation Advice: For each supported convention L other
94459 than Intrinsic, specifying the aspects Import and Export
94460 should be supported for objects of L-compatible types and for
94461 subprograms, and aspect Convention should be supported for
94462 L-eligible types and for subprograms.
94463
94464 41.a/3
94465 Reason: {AI05-0229-1AI05-0229-1} Specifying aspect Convention
94466 is not necessary for scalar types, since the language
94467 interface packages declare scalar types corresponding to those
94468 provided by the respective foreign languages.
94469
94470 41.b/2
94471 Implementation Note: {AI95-00114-01AI95-00114-01} If an
94472 implementation supports interfacing to the C++ entities not
94473 supported by *note B.3::, it should do so via the convention
94474 identifier C_Plus_Plus (in additional to any
94475 C++-implementation-specific ones).
94476
94477 41.c/2
94478 Reason: {AI95-00114-01AI95-00114-01} The reason for giving the
94479 advice about C++ is to encourage uniformity among
94480 implementations, given that the name of the language is not
94481 syntactically legal as an identifier.
94482
94483 NOTES
94484
94485 42/3
94486 1 {AI05-0229-1AI05-0229-1} Implementations may place restrictions
94487 on interfacing aspects; for example, requiring each exported entity
94488 to be declared at the library level.
94489
94490 42.a
94491 Proof: Arbitrary restrictions are allowed by *note 13.1::.
94492
94493 42.b
94494 Ramification: Such a restriction might be to disallow them
94495 altogether. Alternatively, the implementation might allow
94496 them only for certain kinds of entities, or only for certain
94497 conventions.
94498
94499 43/3
94500 2 {AI05-0229-1AI05-0229-1} The Convention aspect in combination
94501 with the Import aspect indicates the conventions for accessing
94502 external entities. It is possible that the actual entity is
94503 written in assembly language, but reflects the conventions of a
94504 particular language. For example, with Convention => Ada can be
94505 used to interface to an assembly language routine that obeys the
94506 Ada compiler's calling conventions.
94507
94508 44/3
94509 3 {AI05-0229-1AI05-0229-1} To obtain "call-back" to an Ada
94510 subprogram from a foreign language environment, the Convention
94511 aspect should be specified both for the access-to-subprogram type
94512 and the specific subprogram(s) to which 'Access is applied.
94513
94514 Paragraphs 45 and 46 were deleted.
94515
94516 47
94517 4 See also *note 13.8::, "*note 13.8:: Machine Code Insertions".
94518
94519 47.a/3
94520 Ramification: {AI05-0229-1AI05-0229-1} The Intrinsic
94521 convention (see *note 6.3.1::) implies that the entity is
94522 somehow "built in" to the implementation. Thus, it generally
94523 does not make sense for users to specify Intrinsic along with
94524 specifying that the entity is imported. The intention is that
94525 only implementations will specify Intrinsic for an imported
94526 entity. The language also defines certain subprograms to be
94527 Intrinsic.
94528
94529 47.b/3
94530 Discussion: {AI05-0229-1AI05-0229-1} There are many imaginable
94531 interfacing aspects that don't make any sense. For example,
94532 setting the Convention of a protected procedure to Ada is
94533 probably wrong. Rather than enumerating all such cases,
94534 however, we leave it up to implementations to decide what is
94535 sensible.
94536
94537 48/3
94538 5 {AI05-0229-1AI05-0229-1} If both External_Name and Link_Name are
94539 specified for a given entity, then the External_Name is ignored.
94540
94541 49/2
94542 This paragraph was deleted.{AI95-00320-01AI95-00320-01}
94543
94544 _Examples_
94545
94546 50
94547 Example of interfacing pragmas:
94548
94549 51/3
94550 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} package Fortran_Library is
94551 function Sqrt (X : Float) return Float
94552 with Import => True, Convention => Fortran;
94553 type Matrix is array (Natural range <>, Natural range <>) of Float
94554 with Convention => Fortran;
94555 function Invert (M : Matrix) return Matrix
94556 with Import => True, Convention => Fortran;
94557 end Fortran_Library;
94558
94559 _Extensions to Ada 83_
94560
94561 51.a
94562 Interfacing pragmas are new to Ada 95. Pragma Import replaces
94563 Ada 83's pragma Interface. Existing implementations can
94564 continue to support pragma Interface for upward compatibility.
94565
94566 _Wording Changes from Ada 95_
94567
94568 51.b/2
94569 {8652/00588652/0058} {AI95-00036-01AI95-00036-01} Corrigendum:
94570 Clarified that pragmas Import and Export work like a
94571 subprogram call; parameters cannot be omitted unless named
94572 notation is used. (Reordering is still not permitted,
94573 however.)
94574
94575 51.c/2
94576 {AI95-00320-01AI95-00320-01} Added wording to say all bets are
94577 off if foreign code doesn't follow the semantics promised by
94578 the Ada specifications.
94579
94580 _Incompatibilities With Ada 2005_
94581
94582 51.d/3
94583 {AI05-0002-1AI05-0002-1} Correction: Access types that
94584 designate unconstrained arrays are no longer defined to be
94585 L-compatible. Such access-to-arrays require bounds
94586 information, which is likely to be incompatible with a foreign
94587 language. The change will allow (but not require) compilers
94588 to reject bad uses, which probably will not work anyway. Note
94589 that implementations can still support any type that it wants
94590 as L-compatible; such uses will not be portable, however. As
94591 such, there should be little existing code that will be
94592 impacted (compilers probably already rejected cases that could
94593 not be translated, whether or not the language allowed doing
94594 so formally).
94595
94596 _Extensions to Ada 2005_
94597
94598 51.e/3
94599 {AI05-0229-1AI05-0229-1} Aspects Convention, Import, Export,
94600 Link_Name, and External_Name are new; pragmas Convention,
94601 Import, and Export are now obsolescent.
94602
94603 \1f
94604 File: aarm2012.info, Node: B.2, Next: B.3, Prev: B.1, Up: Annex B
94605
94606 B.2 The Package Interfaces
94607 ==========================
94608
94609 1
94610 Package Interfaces is the parent of several library packages that
94611 declare types and other entities useful for interfacing to foreign
94612 languages. It also contains some implementation-defined types that are
94613 useful across more than one language (in particular for interfacing to
94614 assembly language).
94615
94616 1.a
94617 Implementation defined: The contents of the visible part of
94618 package Interfaces and its language-defined descendants.
94619
94620 _Static Semantics_
94621
94622 2
94623 The library package Interfaces has the following skeletal declaration:
94624
94625 3
94626
94627 package Interfaces is
94628 pragma Pure(Interfaces);
94629
94630 4
94631 type Integer_n is range -2**(n-1) .. 2**(n-1) - 1; --2's complement
94632
94633 5
94634 type Unsigned_n is mod 2**n;
94635
94636 6
94637 function Shift_Left (Value : Unsigned_n; Amount : Natural)
94638 return Unsigned_n;
94639 function Shift_Right (Value : Unsigned_n; Amount : Natural)
94640 return Unsigned_n;
94641 function Shift_Right_Arithmetic (Value : Unsigned_n; Amount : Natural)
94642 return Unsigned_n;
94643 function Rotate_Left (Value : Unsigned_n; Amount : Natural)
94644 return Unsigned_n;
94645 function Rotate_Right (Value : Unsigned_n; Amount : Natural)
94646 return Unsigned_n;
94647 ...
94648 end Interfaces;
94649
94650 _Implementation Requirements_
94651
94652 7
94653 An implementation shall provide the following declarations in the
94654 visible part of package Interfaces:
94655
94656 8
94657 * Signed and modular integer types of n bits, if supported by the
94658 target architecture, for each n that is at least the size of a
94659 storage element and that is a factor of the word size. The names
94660 of these types are of the form Integer_n for the signed types, and
94661 Unsigned_n for the modular types;
94662
94663 8.a
94664 Ramification: For example, for a typical 32-bit machine the
94665 corresponding types might be Integer_8, Unsigned_8,
94666 Integer_16, Unsigned_16, Integer_32, and Unsigned_32.
94667
94668 8.b
94669 The wording above implies, for example, that Integer_16'Size =
94670 Unsigned_16'Size = 16. Unchecked conversions between
94671 same-Sized types will work as expected.
94672
94673 9
94674 * For each such modular type in Interfaces, shifting and rotating
94675 subprograms as specified in the declaration of Interfaces above.
94676 These subprograms are Intrinsic. They operate on a bit-by-bit
94677 basis, using the binary representation of the value of the operands
94678 to yield a binary representation for the result. The Amount
94679 parameter gives the number of bits by which to shift or rotate.
94680 For shifting, zero bits are shifted in, except in the case of
94681 Shift_Right_Arithmetic, where one bits are shifted in if Value is
94682 at least half the modulus.
94683
94684 9.a
94685 Reason: We considered making shifting and rotating be
94686 primitive operations of all modular types. However, it is a
94687 design principle of Ada that all predefined operations should
94688 be operators (not functions named by identifiers). (Note that
94689 an early version of Ada had "abs" as an identifier, but it was
94690 changed to a reserved word operator before standardization of
94691 Ada 83.) This is important because the implicit declarations
94692 would hide nonoverloadable declarations with the same name,
94693 whereas operators are always overloadable. Therefore, we
94694 would have had to make shift and rotate into reserved words,
94695 which would have been upward incompatible, or else invent new
94696 operator symbols, which seemed like too much mechanism.
94697
94698 10
94699 * Floating point types corresponding to each floating point format
94700 fully supported by the hardware.
94701
94702 10.a
94703 Implementation Note: The names for these floating point types
94704 are not specified. However, if IEEE arithmetic is supported,
94705 then the names should be IEEE_Float_32 and IEEE_Float_64 for
94706 single and double precision, respectively.
94707
94708 _Implementation Permissions_
94709
94710 11
94711 An implementation may provide implementation-defined library units that
94712 are children of Interfaces, and may add declarations to the visible part
94713 of Interfaces in addition to the ones defined above.
94714
94715 11.a/2
94716 Implementation defined: Implementation-defined children of
94717 package Interfaces.
94718
94719 11.1/3
94720 {AI95-00204-01AI95-00204-01} {AI05-0229-1AI05-0229-1} A child package of
94721 package Interfaces with the name of a convention may be provided
94722 independently of whether the convention is supported by the Convention
94723 aspect and vice versa. Such a child package should contain any
94724 declarations that would be useful for interfacing to the language
94725 (implementation) represented by the convention. Any declarations useful
94726 for interfacing to any language on the given hardware architecture
94727 should be provided directly in Interfaces.
94728
94729 11.b/2
94730 Ramification: For example, package Interfaces.XYZ_Pascal might
94731 contain declarations of types that match the data types
94732 provided by the XYZ implementation of Pascal, so that it will
94733 be more convenient to pass parameters to a subprogram whose
94734 convention is XYZ_Pascal.
94735
94736 _Implementation Advice_
94737
94738 12/2
94739 This paragraph was deleted.{AI95-00204-01AI95-00204-01}
94740
94741 12.a/2
94742 This paragraph was deleted.
94743
94744 13/3
94745 {AI05-0299-1AI05-0299-1} An implementation supporting an interface to C,
94746 COBOL, or Fortran should provide the corresponding package or packages
94747 described in the following subclauses.
94748
94749 13.a.1/2
94750 Implementation Advice: If an interface to C, COBOL, or Fortran
94751 is provided, the corresponding package or packages described
94752 in *note Annex B::, "*note Annex B:: Interface to Other
94753 Languages" should also be provided.
94754
94755 13.a
94756 Implementation Note: The intention is that an implementation
94757 might support several implementations of the foreign language:
94758 Interfaces.This_Fortran and Interfaces.That_Fortran might both
94759 exist. The "default" implementation, overridable by the user,
94760 should be declared as a renaming:
94761
94762 13.b
94763 package Interfaces.Fortran renames Interfaces.This_Fortran;
94764
94765 _Wording Changes from Ada 95_
94766
94767 13.c/2
94768 {AI95-00204-01AI95-00204-01} Clarified that interfacing to
94769 foreign languages is optional and has the same restrictions as
94770 a Specialized Needs Annex.
94771
94772 _Wording Changes from Ada 2005_
94773
94774 13.d/3
94775 {AI05-0262-1AI05-0262-1} Move the restrictions on
94776 implementations of optional features to the start of this
94777 Annex.
94778
94779 \1f
94780 File: aarm2012.info, Node: B.3, Next: B.4, Prev: B.2, Up: Annex B
94781
94782 B.3 Interfacing with C and C++
94783 ==============================
94784
94785 1/3
94786 {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
94787 {AI95-00376-01AI95-00376-01} {AI05-0229-1AI05-0229-1} The facilities
94788 relevant to interfacing with the C language and the corresponding subset
94789 of the C++ language are the package Interfaces.C and its children, and
94790 support for specifying the Convention aspect with convention_identifiers
94791 C and C_Pass_By_Copy.
94792
94793 2/3
94794 {AI95-00376-01AI95-00376-01} {AI95-0262-1AI95-0262-1}
94795 {AI95-0299-1AI95-0299-1} The package Interfaces.C contains the basic
94796 types, constants, and subprograms that allow an Ada program to pass
94797 scalars and strings to C and C++ functions. When this subclause
94798 mentions a C entity, the reference also applies to the corresponding
94799 entity in C++.
94800
94801 _Static Semantics_
94802
94803 3
94804 The library package Interfaces.C has the following declaration:
94805
94806 4
94807 package Interfaces.C is
94808 pragma Pure(C);
94809
94810 5
94811 -- Declarations based on C's <limits.h>
94812
94813 6
94814 CHAR_BIT : constant := implementation-defined; -- typically 8
94815 SCHAR_MIN : constant := implementation-defined; -- typically -128
94816 SCHAR_MAX : constant := implementation-defined; -- typically 127
94817 UCHAR_MAX : constant := implementation-defined; -- typically 255
94818
94819 7
94820 -- Signed and Unsigned Integers
94821 type int is range implementation-defined;
94822 type short is range implementation-defined;
94823 type long is range implementation-defined;
94824
94825 8
94826 type signed_char is range SCHAR_MIN .. SCHAR_MAX;
94827 for signed_char'Size use CHAR_BIT;
94828
94829 9
94830 type unsigned is mod implementation-defined;
94831 type unsigned_short is mod implementation-defined;
94832 type unsigned_long is mod implementation-defined;
94833
94834 10
94835 type unsigned_char is mod (UCHAR_MAX+1);
94836 for unsigned_char'Size use CHAR_BIT;
94837
94838 11
94839 subtype plain_char is implementation-defined;
94840
94841 12
94842 type ptrdiff_t is range implementation-defined;
94843
94844 13
94845 type size_t is mod implementation-defined;
94846
94847 14
94848 -- Floating Point
94849
94850 15
94851 type C_float is digits implementation-defined;
94852
94853 16
94854 type double is digits implementation-defined;
94855
94856 17
94857 type long_double is digits implementation-defined;
94858
94859 18
94860 -- Characters and Strings
94861
94862 19
94863 type char is <implementation-defined character type>;
94864
94865 20/1
94866 {8652/00608652/0060} {AI95-00037-01AI95-00037-01} nul : constant char := implementation-defined;
94867
94868 21
94869 function To_C (Item : in Character) return char;
94870
94871 22
94872 function To_Ada (Item : in char) return Character;
94873
94874 23/3
94875 {AI05-0229-1AI05-0229-1} {AI05-0269-1AI05-0269-1} type char_array is array (size_t range <>) of aliased char
94876 with Pack;
94877 for char_array'Component_Size use CHAR_BIT;
94878
94879 24
94880 function Is_Nul_Terminated (Item : in char_array) return Boolean;
94881
94882 25
94883 function To_C (Item : in String;
94884 Append_Nul : in Boolean := True)
94885 return char_array;
94886
94887 26
94888 function To_Ada (Item : in char_array;
94889 Trim_Nul : in Boolean := True)
94890 return String;
94891
94892 27
94893 procedure To_C (Item : in String;
94894 Target : out char_array;
94895 Count : out size_t;
94896 Append_Nul : in Boolean := True);
94897
94898 28
94899 procedure To_Ada (Item : in char_array;
94900 Target : out String;
94901 Count : out Natural;
94902 Trim_Nul : in Boolean := True);
94903
94904 29
94905 -- Wide Character and Wide String
94906
94907 30/1
94908 {8652/00608652/0060} {AI95-00037-01AI95-00037-01} type wchar_t is <implementation-defined character type>;
94909
94910 31/1
94911 {8652/00608652/0060} {AI95-00037-01AI95-00037-01} wide_nul : constant wchar_t := implementation-defined;
94912
94913 32
94914 function To_C (Item : in Wide_Character) return wchar_t;
94915 function To_Ada (Item : in wchar_t ) return Wide_Character;
94916
94917 33/3
94918 {AI05-0229-1AI05-0229-1} type wchar_array is array (size_t range <>) of aliased wchar_t
94919 with Pack;
94920
94921 34/3
94922 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
94923
94924 35
94925 function Is_Nul_Terminated (Item : in wchar_array) return Boolean;
94926
94927 36
94928 function To_C (Item : in Wide_String;
94929 Append_Nul : in Boolean := True)
94930 return wchar_array;
94931
94932 37
94933 function To_Ada (Item : in wchar_array;
94934 Trim_Nul : in Boolean := True)
94935 return Wide_String;
94936
94937 38
94938 procedure To_C (Item : in Wide_String;
94939 Target : out wchar_array;
94940 Count : out size_t;
94941 Append_Nul : in Boolean := True);
94942
94943 39
94944 procedure To_Ada (Item : in wchar_array;
94945 Target : out Wide_String;
94946 Count : out Natural;
94947 Trim_Nul : in Boolean := True);
94948
94949 39.1/2
94950 {AI95-00285-01AI95-00285-01} -- ISO/IEC 10646:2003 compatible types defined by ISO/IEC TR 19769:2004.
94951
94952 39.2/2
94953 {AI95-00285-01AI95-00285-01} type char16_t is <implementation-defined character type>;
94954
94955 39.3/2
94956 char16_nul : constant char16_t := implementation-defined;
94957
94958 39.4/2
94959 function To_C (Item : in Wide_Character) return char16_t;
94960 function To_Ada (Item : in char16_t) return Wide_Character;
94961
94962 39.5/3
94963 {AI05-0229-1AI05-0229-1} type char16_array is array (size_t range <>) of aliased char16_t
94964 with Pack;
94965
94966 39.6/3
94967 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
94968
94969 39.7/2
94970 function Is_Nul_Terminated (Item : in char16_array) return Boolean;
94971 function To_C (Item : in Wide_String;
94972 Append_Nul : in Boolean := True)
94973 return char16_array;
94974
94975 39.8/2
94976 function To_Ada (Item : in char16_array;
94977 Trim_Nul : in Boolean := True)
94978 return Wide_String;
94979
94980 39.9/2
94981 procedure To_C (Item : in Wide_String;
94982 Target : out char16_array;
94983 Count : out size_t;
94984 Append_Nul : in Boolean := True);
94985
94986 39.10/2
94987 procedure To_Ada (Item : in char16_array;
94988 Target : out Wide_String;
94989 Count : out Natural;
94990 Trim_Nul : in Boolean := True);
94991
94992 39.11/2
94993 {AI95-00285-01AI95-00285-01} type char32_t is <implementation-defined character type>;
94994
94995 39.12/2
94996 char32_nul : constant char32_t := implementation-defined;
94997
94998 39.13/2
94999 function To_C (Item : in Wide_Wide_Character) return char32_t;
95000 function To_Ada (Item : in char32_t) return Wide_Wide_Character;
95001
95002 39.14/3
95003 {AI05-0229-1AI05-0229-1} type char32_array is array (size_t range <>) of aliased char32_t
95004 with Pack;
95005
95006 39.15/3
95007 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
95008
95009 39.16/2
95010 function Is_Nul_Terminated (Item : in char32_array) return Boolean;
95011 function To_C (Item : in Wide_Wide_String;
95012 Append_Nul : in Boolean := True)
95013 return char32_array;
95014
95015 39.17/2
95016 function To_Ada (Item : in char32_array;
95017 Trim_Nul : in Boolean := True)
95018 return Wide_Wide_String;
95019
95020 39.18/2
95021 procedure To_C (Item : in Wide_Wide_String;
95022 Target : out char32_array;
95023 Count : out size_t;
95024 Append_Nul : in Boolean := True);
95025
95026 39.19/2
95027 procedure To_Ada (Item : in char32_array;
95028 Target : out Wide_Wide_String;
95029 Count : out Natural;
95030 Trim_Nul : in Boolean := True);
95031
95032 40
95033 Terminator_Error : exception;
95034
95035 41
95036 end Interfaces.C;
95037
95038 41.a.1/2
95039 Implementation defined: The definitions of certain types and
95040 constants in Interfaces.C.
95041
95042 42
95043 Each of the types declared in Interfaces.C is C-compatible.
95044
95045 43/2
95046 {AI95-00285-01AI95-00285-01} The types int, short, long, unsigned,
95047 ptrdiff_t, size_t, double, char, wchar_t, char16_t, and char32_t
95048 correspond respectively to the C types having the same names. The types
95049 signed_char, unsigned_short, unsigned_long, unsigned_char, C_float, and
95050 long_double correspond respectively to the C types signed char, unsigned
95051 short, unsigned long, unsigned char, float, and long double.
95052
95053 43.a/2
95054 Discussion: The C types wchar_t and char16_t seem to be the
95055 same. However, wchar_t has an implementation-defined size,
95056 whereas char16_t is guaranteed to be an unsigned type of at
95057 least 16 bits. Also, char16_t and char32_t are encouraged to
95058 have UTF-16 and UTF-32 representations; that means that they
95059 are not directly the same as the Ada types, which most likely
95060 don't use any UTF encoding.
95061
95062 44
95063 The type of the subtype plain_char is either signed_char or
95064 unsigned_char, depending on the C implementation.
95065
95066 45
95067 function To_C (Item : in Character) return char;
95068 function To_Ada (Item : in char ) return Character;
95069
95070 46
95071 The functions To_C and To_Ada map between the Ada type
95072 Character and the C type char.
95073
95074 46.a.1/1
95075 Implementation Note: {8652/01148652/0114}
95076 {AI95-00038-01AI95-00038-01} The To_C and To_Ada functions map
95077 between corresponding characters, not necessarily between
95078 characters with the same internal representation.
95079 Corresponding characters are characters defined by the same
95080 enumeration literal, if such exist; otherwise, the
95081 correspondence is unspecified.
95082
95083 46.a.2/1
95084 The following definition is equivalent to the above summary:
95085
95086 46.a.3/1
95087 To_C (Latin_1_Char) =
95088 char'Value(Character'Image(Latin_1_Char))
95089 provided that char'Value does not raise an exception;
95090 otherwise the result is unspecified.
95091
95092 46.a.4/1
95093 To_Ada (Native_C_Char) =
95094 Character'Value(char'Image(Native_C_Char))
95095 provided that Character'Value does not raise an exception;
95096 otherwise the result is unspecified.
95097
95098 47
95099 function Is_Nul_Terminated (Item : in char_array) return Boolean;
95100
95101 48
95102 The result of Is_Nul_Terminated is True if Item contains nul,
95103 and is False otherwise.
95104
95105 49
95106 function To_C (Item : in String; Append_Nul : in Boolean := True)
95107 return char_array;
95108
95109 function To_Ada (Item : in char_array; Trim_Nul : in Boolean := True)
95110 return String;
95111
95112 50/2
95113 {AI95-00258-01AI95-00258-01} The result of To_C is a
95114 char_array value of length Item'Length (if Append_Nul is
95115 False) or Item'Length+1 (if Append_Nul is True). The lower
95116 bound is 0. For each component Item(I), the corresponding
95117 component in the result is To_C applied to Item(I). The value
95118 nul is appended if Append_Nul is True. If Append_Nul is False
95119 and Item'Length is 0, then To_C propagates Constraint_Error.
95120
95121 51
95122 The result of To_Ada is a String whose length is Item'Length
95123 (if Trim_Nul is False) or the length of the slice of Item
95124 preceding the first nul (if Trim_Nul is True). The lower
95125 bound of the result is 1. If Trim_Nul is False, then for each
95126 component Item(I) the corresponding component in the result is
95127 To_Ada applied to Item(I). If Trim_Nul is True, then for each
95128 component Item(I) before the first nul the corresponding
95129 component in the result is To_Ada applied to Item(I). The
95130 function propagates Terminator_Error if Trim_Nul is True and
95131 Item does not contain nul.
95132
95133 52
95134 procedure To_C (Item : in String;
95135 Target : out char_array;
95136 Count : out size_t;
95137 Append_Nul : in Boolean := True);
95138
95139 procedure To_Ada (Item : in char_array;
95140 Target : out String;
95141 Count : out Natural;
95142 Trim_Nul : in Boolean := True);
95143
95144 53
95145 For procedure To_C, each element of Item is converted (via the
95146 To_C function) to a char, which is assigned to the
95147 corresponding element of Target. If Append_Nul is True, nul
95148 is then assigned to the next element of Target. In either
95149 case, Count is set to the number of Target elements assigned.
95150 If Target is not long enough, Constraint_Error is propagated.
95151
95152 54
95153 For procedure To_Ada, each element of Item (if Trim_Nul is
95154 False) or each element of Item preceding the first nul (if
95155 Trim_Nul is True) is converted (via the To_Ada function) to a
95156 Character, which is assigned to the corresponding element of
95157 Target. Count is set to the number of Target elements
95158 assigned. If Target is not long enough, Constraint_Error is
95159 propagated. If Trim_Nul is True and Item does not contain
95160 nul, then Terminator_Error is propagated.
95161
95162 55
95163 function Is_Nul_Terminated (Item : in wchar_array) return Boolean;
95164
95165 56
95166 The result of Is_Nul_Terminated is True if Item contains
95167 wide_nul, and is False otherwise.
95168
95169 57
95170 function To_C (Item : in Wide_Character) return wchar_t;
95171 function To_Ada (Item : in wchar_t ) return Wide_Character;
95172
95173 58
95174 To_C and To_Ada provide the mappings between the Ada and C
95175 wide character types.
95176
95177 59
95178 function To_C (Item : in Wide_String;
95179 Append_Nul : in Boolean := True)
95180 return wchar_array;
95181
95182 function To_Ada (Item : in wchar_array;
95183 Trim_Nul : in Boolean := True)
95184 return Wide_String;
95185
95186 procedure To_C (Item : in Wide_String;
95187 Target : out wchar_array;
95188 Count : out size_t;
95189 Append_Nul : in Boolean := True);
95190
95191 procedure To_Ada (Item : in wchar_array;
95192 Target : out Wide_String;
95193 Count : out Natural;
95194 Trim_Nul : in Boolean := True);
95195
95196 60
95197 The To_C and To_Ada subprograms that convert between
95198 Wide_String and wchar_array have analogous effects to the To_C
95199 and To_Ada subprograms that convert between String and
95200 char_array, except that wide_nul is used instead of nul.
95201
95202 60.1/2
95203 function Is_Nul_Terminated (Item : in char16_array) return Boolean;
95204
95205 60.2/2
95206 {AI95-00285-01AI95-00285-01} The result of Is_Nul_Terminated
95207 is True if Item contains char16_nul, and is False otherwise.
95208
95209 60.3/2
95210 function To_C (Item : in Wide_Character) return char16_t;
95211 function To_Ada (Item : in char16_t ) return Wide_Character;
95212
95213 60.4/2
95214 {AI95-00285-01AI95-00285-01} To_C and To_Ada provide mappings
95215 between the Ada and C 16-bit character types.
95216
95217 60.5/2
95218 function To_C (Item : in Wide_String;
95219 Append_Nul : in Boolean := True)
95220 return char16_array;
95221
95222 function To_Ada (Item : in char16_array;
95223 Trim_Nul : in Boolean := True)
95224 return Wide_String;
95225
95226 procedure To_C (Item : in Wide_String;
95227 Target : out char16_array;
95228 Count : out size_t;
95229 Append_Nul : in Boolean := True);
95230
95231 procedure To_Ada (Item : in char16_array;
95232 Target : out Wide_String;
95233 Count : out Natural;
95234 Trim_Nul : in Boolean := True);
95235
95236 60.6/2
95237 {AI95-00285-01AI95-00285-01} The To_C and To_Ada subprograms
95238 that convert between Wide_String and char16_array have
95239 analogous effects to the To_C and To_Ada subprograms that
95240 convert between String and char_array, except that char16_nul
95241 is used instead of nul.
95242
95243 60.7/2
95244 function Is_Nul_Terminated (Item : in char32_array) return Boolean;
95245
95246 60.8/2
95247 {AI95-00285-01AI95-00285-01} The result of Is_Nul_Terminated
95248 is True if Item contains char16_nul, and is False otherwise.
95249
95250 60.9/2
95251 function To_C (Item : in Wide_Wide_Character) return char32_t;
95252 function To_Ada (Item : in char32_t ) return Wide_Wide_Character;
95253
95254 60.10/2
95255 {AI95-00285-01AI95-00285-01} To_C and To_Ada provide mappings
95256 between the Ada and C 32-bit character types.
95257
95258 60.11/2
95259 function To_C (Item : in Wide_Wide_String;
95260 Append_Nul : in Boolean := True)
95261 return char32_array;
95262
95263 function To_Ada (Item : in char32_array;
95264 Trim_Nul : in Boolean := True)
95265 return Wide_Wide_String;
95266
95267 procedure To_C (Item : in Wide_Wide_String;
95268 Target : out char32_array;
95269 Count : out size_t;
95270 Append_Nul : in Boolean := True);
95271
95272 procedure To_Ada (Item : in char32_array;
95273 Target : out Wide_Wide_String;
95274 Count : out Natural;
95275 Trim_Nul : in Boolean := True);
95276
95277 60.12/2
95278 {AI95-00285-01AI95-00285-01} The To_C and To_Ada subprograms
95279 that convert between Wide_Wide_String and char32_array have
95280 analogous effects to the To_C and To_Ada subprograms that
95281 convert between String and char_array, except that char32_nul
95282 is used instead of nul.
95283
95284 60.a
95285 Discussion: The Interfaces.C package provides an
95286 implementation-defined character type, char, designed to model
95287 the C run-time character set, and mappings between the types
95288 char and Character.
95289
95290 60.b
95291 One application of the C interface package is to compose a C
95292 string and pass it to a C function. One way to do this is for
95293 the programmer to declare an object that will hold the C
95294 array, and then pass this array to the C function. This is
95295 realized via the type char_array:
95296
95297 60.c
95298 type char_array is array (size_t range <>) of Char;
95299
95300 60.d
95301 The programmer can declare an Ada String, convert it to a
95302 char_array, and pass the char_array as actual parameter to the
95303 C function that is expecting a char *.
95304
95305 60.e
95306 An alternative approach is for the programmer to obtain a C
95307 char pointer from an Ada String (or from a char_array) by
95308 invoking an allocation function. The package
95309 Interfaces.C.Strings (see below) supplies the needed
95310 facilities, including a private type chars_ptr that
95311 corresponds to C's char *, and two allocation functions. To
95312 avoid storage leakage, a Free procedure releases the storage
95313 that was allocated by one of these allocate functions.
95314
95315 60.f
95316 It is typical for a C function that deals with strings to
95317 adopt the convention that the string is delimited by a nul
95318 char. The C interface packages support this convention. A
95319 constant nul of type Char is declared, and the function
95320 Value(Chars_Ptr) in Interfaces.C.Strings returns a char_array
95321 up to and including the first nul in the array that the
95322 chars_ptr points to. The Allocate_Chars function allocates an
95323 array that is nul terminated.
95324
95325 60.g
95326 Some C functions that deal with strings take an explicit
95327 length as a parameter, thus allowing strings to be passed that
95328 contain nul as a data element. Other C functions take an
95329 explicit length that is an upper bound: the prefix of the
95330 string up to the char before nul, or the prefix of the given
95331 length, is used by the function, whichever is shorter. The C
95332 Interface packages support calling such functions.
95333
95334 60.13/3
95335 {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95336 {AI05-0229-1AI05-0229-1} The Convention aspect with
95337 convention_identifier C_Pass_By_Copy shall only be specified for a type.
95338
95339 60.14/2
95340 {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95341 {AI95-00216-01AI95-00216-01} The eligibility rules in *note B.1:: do not
95342 apply to convention C_Pass_By_Copy. Instead, a type T is eligible for
95343 convention C_Pass_By_Copy if T is an unchecked union type or if T is a
95344 record type that has no discriminants and that only has components with
95345 statically constrained subtypes, and each component is C-compatible.
95346
95347 60.15/3
95348 {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95349 {AI05-0264-1AI05-0264-1} If a type is C_Pass_By_Copy-compatible, then it
95350 is also C-compatible.
95351
95352 _Implementation Requirements_
95353
95354 61/3
95355 {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95356 {AI05-0229-1AI05-0229-1} An implementation shall support specifying
95357 aspect Convention with a C convention_identifier for a C-eligible type
95358 (see *note B.1::). An implementation shall support specifying aspect
95359 Convention with a C_Pass_By_Copy convention_identifier for a
95360 C_Pass_By_Copy-eligible type.
95361
95362 _Implementation Permissions_
95363
95364 62
95365 An implementation may provide additional declarations in the C interface
95366 packages.
95367
95368 62.1/3
95369 {AI05-0002-1AI05-0002-1} {AI05-0229-1AI05-0229-1} An implementation need
95370 not support specifying the Convention aspect with convention_identifier
95371 C in the following cases:
95372
95373 62.2/3
95374 * {AI05-0248-1AI05-0248-1} for a subprogram that has a parameter of
95375 an unconstrained array subtype, unless the Import aspect has the
95376 value True for the subprogram;
95377
95378 62.3/3
95379 * for a function with an unconstrained array result subtype;
95380
95381 62.4/3
95382 * for an object whose nominal subtype is an unconstrained array
95383 subtype.
95384
95385 62.a/3
95386 Implementation Note: {AI05-0002-1AI05-0002-1} These rules
95387 ensure that an implementation never needs to create bounds for
95388 an unconstrained array that originates in C (and thus does not
95389 have bounds). An implementation can do so if it wishes, of
95390 course. Note that these permissions do not extend to passing
95391 an unconstrained array as a parameter to a C function; in this
95392 case, the bounds can simply be dropped and thus support is
95393 required.
95394
95395 _Implementation Advice_
95396
95397 62.5/3
95398 {8652/00608652/0060} {AI95-00037-01AI95-00037-01}
95399 {AI95-00285-01AI95-00285-01} The constants nul, wide_nul, char16_nul,
95400 and char32_nul should have a representation of zero.
95401
95402 62.b/2
95403 Implementation Advice: The constants nul, wide_nul,
95404 char16_nul, and char32_nul in package Interfaces.C should have
95405 a representation of zero.
95406
95407 63
95408 An implementation should support the following interface correspondences
95409 between Ada and C.
95410
95411 64
95412 * An Ada procedure corresponds to a void-returning C function.
95413
95414 64.a
95415 Discussion: The programmer can also choose an Ada procedure
95416 when the C function returns an int that is to be discarded.
95417
95418 65
95419 * An Ada function corresponds to a non-void C function.
95420
95421 66
95422 * An Ada in scalar parameter is passed as a scalar argument to a C
95423 function.
95424
95425 67
95426 * An Ada in parameter of an access-to-object type with designated
95427 type T is passed as a t* argument to a C function, where t is the C
95428 type corresponding to the Ada type T.
95429
95430 68
95431 * An Ada access T parameter, or an Ada out or in out parameter of an
95432 elementary type T, is passed as a t* argument to a C function,
95433 where t is the C type corresponding to the Ada type T. In the case
95434 of an elementary out or in out parameter, a pointer to a temporary
95435 copy is used to preserve by-copy semantics.
95436
95437 68.1/2
95438 * {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95439 {AI95-00343-01AI95-00343-01} An Ada parameter of a (record) type T
95440 of convention C_Pass_By_Copy, of mode in, is passed as a t argument
95441 to a C function, where t is the C struct corresponding to the Ada
95442 type T.
95443
95444 69/2
95445 * {8652/00598652/0059} {AI95-00131-01AI95-00131-01}
95446 {AI95-00343-01AI95-00343-01} An Ada parameter of a record type T,
95447 of any mode, other than an in parameter of a type of convention
95448 C_Pass_By_Copy, is passed as a t* argument to a C function, where t
95449 is the C struct corresponding to the Ada type T.
95450
95451 70
95452 * An Ada parameter of an array type with component type T, of any
95453 mode, is passed as a t* argument to a C function, where t is the C
95454 type corresponding to the Ada type T.
95455
95456 71
95457 * An Ada parameter of an access-to-subprogram type is passed as a
95458 pointer to a C function whose prototype corresponds to the
95459 designated subprogram's specification.
95460
95461 71.1/3
95462 * {AI05-0002-1AI05-0002-1} An Ada parameter of a private type is
95463 passed as specified for the full view of the type.
95464
95465 71.2/3
95466 * {AI05-0002-1AI05-0002-1} The rules of correspondence given above
95467 for parameters of mode in also apply to the return object of a
95468 function.
95469
95470 71.3/3
95471 This paragraph was deleted.{AI95-00337-01AI95-00337-01}
95472 {AI05-0002-1AI05-0002-1}
95473
95474 71.a/2
95475 Implementation Advice: If C interfacing is supported, the
95476 interface correspondences between Ada and C should be
95477 supported.
95478
95479 NOTES
95480
95481 72
95482 6 Values of type char_array are not implicitly terminated with
95483 nul. If a char_array is to be passed as a parameter to an imported
95484 C function requiring nul termination, it is the programmer's
95485 responsibility to obtain this effect.
95486
95487 73
95488 7 To obtain the effect of C's sizeof(item_type), where Item_Type
95489 is the corresponding Ada type, evaluate the expression:
95490 size_t(Item_Type'Size/CHAR_BIT).
95491
95492 74/2
95493 This paragraph was deleted.{AI95-00216-01AI95-00216-01}
95494
95495 75
95496 8 A C function that takes a variable number of arguments can
95497 correspond to several Ada subprograms, taking various specific
95498 numbers and types of parameters.
95499
95500 _Examples_
95501
95502 76
95503 Example of using the Interfaces.C package:
95504
95505 77
95506 --Calling the C Library Function strcpy
95507 with Interfaces.C;
95508 procedure Test is
95509 package C renames Interfaces.C;
95510 use type C.char_array;
95511 -- Call <string.h>strcpy:
95512 -- C definition of strcpy: char *strcpy(char *s1, const char *s2);
95513 -- This function copies the string pointed to by s2 (including the terminating null character)
95514 -- into the array pointed to by s1. If copying takes place between objects that overlap,
95515 -- the behavior is undefined. The strcpy function returns the value of s1.
95516
95517 78/3
95518 {AI05-0229-1AI05-0229-1} -- Note: since the C function's return value is of no interest, the Ada interface is a procedure
95519 procedure Strcpy (Target : out C.char_array;
95520 Source : in C.char_array)
95521 with Import => True, Convention => C, External_Name => "strcpy";
95522
95523 79/3
95524 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
95525
95526 80
95527 Chars1 : C.char_array(1..20);
95528 Chars2 : C.char_array(1..20);
95529
95530 81
95531 begin
95532 Chars2(1..6) := "qwert" & C.nul;
95533
95534 82
95535 Strcpy(Chars1, Chars2);
95536
95537 83
95538 -- Now Chars1(1..6) = "qwert" & C.Nul
95539
95540 84
95541 end Test;
95542
95543 _Incompatibilities With Ada 95_
95544
95545 84.a/3
95546 {AI95-00285-01AI95-00285-01} {AI05-0005-1AI05-0005-1} Types
95547 char16_t and char32_t and their related types and operations
95548 are added to Interfaces.C. If Interfaces.C is referenced in a
95549 use_clause, and an entity E with the same defining_identifier
95550 as a new entity in Interfaces.C is defined in a package that
95551 is also referenced in a use_clause, the entity E may no longer
95552 be use-visible, resulting in errors. This should be rare and
95553 is easily fixed if it does occur.
95554
95555 _Extensions to Ada 95_
95556
95557 84.b/2
95558 {8652/00598652/0059} {AI95-00131-01AI95-00131-01} Corrigendum:
95559 Convention C_Pass_By_Copy is new.
95560
95561 _Wording Changes from Ada 95_
95562
95563 84.c/2
95564 {8652/00608652/0060} {AI95-00037-01AI95-00037-01} Corrigendum:
95565 Clarified the intent for Nul and Wide_Nul.
95566
95567 84.d/2
95568 {AI95-00216-01AI95-00216-01} Specified that an unchecked union
95569 type (see *note B.3.3::) is eligible for convention
95570 C_Pass_By_Copy.
95571
95572 84.e/2
95573 {AI95-00258-01AI95-00258-01} Specified what happens if the
95574 To_C function tries to return a null string.
95575
95576 84.f/2
95577 {AI95-00337-01AI95-00337-01} Clarified that the interface
95578 correspondences also apply to private types whose full types
95579 have the specified characteristics.
95580
95581 84.g/2
95582 {AI95-00343-01AI95-00343-01} Clarified that a type must have
95583 convention C_Pass_By_Copy in order to be passed by copy (not
95584 just a type that could have that convention).
95585
95586 84.h/2
95587 {AI95-00376-01AI95-00376-01} Added wording to make it clear
95588 that these facilities can also be used with C++.
95589
95590 _Incompatibilities With Ada 2005_
95591
95592 84.i/3
95593 {AI05-0002-1AI05-0002-1} Correction: Added a definition of
95594 correspondences for function results. Also added wording to
95595 make it clear that we do not expect the implementation to
95596 conjure bounds for unconstrained arrays out of thin air.
95597 These changes allow (but don't require) compilers to reject
95598 unreasonable uses of array types. Such uses probably didn't
95599 work anyway (and probably were rejected, no matter what the
95600 language definition said), so little existing code should be
95601 impacted.
95602
95603 * Menu:
95604
95605 * B.3.1 :: The Package Interfaces.C.Strings
95606 * B.3.2 :: The Generic Package Interfaces.C.Pointers
95607 * B.3.3 :: Unchecked Union Types
95608
95609 \1f
95610 File: aarm2012.info, Node: B.3.1, Next: B.3.2, Up: B.3
95611
95612 B.3.1 The Package Interfaces.C.Strings
95613 --------------------------------------
95614
95615 1/3
95616 {AI05-0229-1AI05-0229-1} The package Interfaces.C.Strings declares types
95617 and subprograms allowing an Ada program to allocate, reference, update,
95618 and free C-style strings. In particular, the private type chars_ptr
95619 corresponds to a common use of "char *" in C programs, and an object of
95620 this type can be passed to a subprogram to which with Import => True,
95621 Convention => C has been specified, and for which "char *" is the type
95622 of the argument of the C function.
95623
95624 _Static Semantics_
95625
95626 2
95627 The library package Interfaces.C.Strings has the following declaration:
95628
95629 3
95630 package Interfaces.C.Strings is
95631 pragma Preelaborate(Strings);
95632
95633 4
95634 type char_array_access is access all char_array;
95635
95636 5/2
95637 {AI95-00161-01AI95-00161-01} type chars_ptr is private;
95638 pragma Preelaborable_Initialization(chars_ptr);
95639
95640 6/2
95641 {AI95-00276-01AI95-00276-01} type chars_ptr_array is array (size_t range <>) of aliased chars_ptr;
95642
95643 7
95644 Null_Ptr : constant chars_ptr;
95645
95646 8
95647 function To_Chars_Ptr (Item : in char_array_access;
95648 Nul_Check : in Boolean := False)
95649 return chars_ptr;
95650
95651 9
95652 function New_Char_Array (Chars : in char_array) return chars_ptr;
95653
95654 10
95655 function New_String (Str : in String) return chars_ptr;
95656
95657 11
95658 procedure Free (Item : in out chars_ptr);
95659
95660 12
95661 Dereference_Error : exception;
95662
95663 13
95664 function Value (Item : in chars_ptr) return char_array;
95665
95666 14
95667 function Value (Item : in chars_ptr; Length : in size_t)
95668 return char_array;
95669
95670 15
95671 function Value (Item : in chars_ptr) return String;
95672
95673 16
95674 function Value (Item : in chars_ptr; Length : in size_t)
95675 return String;
95676
95677 17
95678 function Strlen (Item : in chars_ptr) return size_t;
95679
95680 18
95681 procedure Update (Item : in chars_ptr;
95682 Offset : in size_t;
95683 Chars : in char_array;
95684 Check : in Boolean := True);
95685
95686 19
95687 procedure Update (Item : in chars_ptr;
95688 Offset : in size_t;
95689 Str : in String;
95690 Check : in Boolean := True);
95691
95692 20
95693 Update_Error : exception;
95694
95695 21
95696 private
95697 ... -- not specified by the language
95698 end Interfaces.C.Strings;
95699
95700 21.a
95701 Discussion: The string manipulation types and subprograms
95702 appear in a child of Interfaces.C versus being there directly,
95703 since it is useful to have Interfaces.C specified as pragma
95704 Pure.
95705
95706 21.b
95707 Differently named functions New_String and New_Char_Array are
95708 declared, since if there were a single overloaded function a
95709 call with a string literal as actual parameter would be
95710 ambiguous.
95711
95712 22
95713 The type chars_ptr is C-compatible and corresponds to the use of C's
95714 "char *" for a pointer to the first char in a char array terminated by
95715 nul. When an object of type chars_ptr is declared, its value is by
95716 default set to Null_Ptr, unless the object is imported (see *note
95717 B.1::).
95718
95719 22.a
95720 Discussion: The type char_array_access is not necessarily
95721 C-compatible, since an object of this type may carry "dope"
95722 information. The programmer should convert from
95723 char_array_access to chars_ptr for objects imported from,
95724 exported to, or passed to C.
95725
95726 23
95727 function To_Chars_Ptr (Item : in char_array_access;
95728 Nul_Check : in Boolean := False)
95729 return chars_ptr;
95730
95731 24/3
95732 {8652/00618652/0061} {AI95-00140-01AI95-00140-01}
95733 {AI05-0264-1AI05-0264-1} If Item is null, then To_Chars_Ptr
95734 returns Null_Ptr. If Item is not null, Nul_Check is True, and
95735 Item.all does not contain nul, then the function propagates
95736 Terminator_Error; otherwise, To_Chars_Ptr performs a pointer
95737 conversion with no allocation of memory.
95738
95739 25
95740 function New_Char_Array (Chars : in char_array) return chars_ptr;
95741
95742 26
95743 This function returns a pointer to an allocated object
95744 initialized to Chars(Chars'First .. Index) & nul, where
95745
95746 27
95747 * Index = Chars'Last if Chars does not contain nul, or
95748
95749 28
95750 * Index is the smallest size_t value I such that Chars(I+1)
95751 = nul.
95752
95753 28.1
95754 Storage_Error is propagated if the allocation fails.
95755
95756 29
95757 function New_String (Str : in String) return chars_ptr;
95758
95759 30
95760 This function is equivalent to New_Char_Array(To_C(Str)).
95761
95762 31
95763 procedure Free (Item : in out chars_ptr);
95764
95765 32
95766 If Item is Null_Ptr, then Free has no effect. Otherwise, Free
95767 releases the storage occupied by Value(Item), and resets Item
95768 to Null_Ptr.
95769
95770 33
95771 function Value (Item : in chars_ptr) return char_array;
95772
95773 34/3
95774 {AI05-0264-1AI05-0264-1} If Item = Null_Ptr, then Value
95775 propagates Dereference_Error. Otherwise, Value returns the
95776 prefix of the array of chars pointed to by Item, up to and
95777 including the first nul. The lower bound of the result is 0.
95778 If Item does not point to a nul-terminated string, then
95779 execution of Value is erroneous.
95780
95781 35
95782 function Value (Item : in chars_ptr; Length : in size_t)
95783 return char_array;
95784
95785 36/3
95786 {8652/00628652/0062} {AI95-00139-01AI95-00139-01}
95787 {AI05-0264-1AI05-0264-1} If Item = Null_Ptr, then Value
95788 propagates Dereference_Error. Otherwise, Value returns the
95789 shorter of two arrays, either the first Length chars pointed
95790 to by Item, or Value(Item). The lower bound of the result is
95791 0. If Length is 0, then Value propagates Constraint_Error.
95792
95793 36.a
95794 Ramification: Value(New_Char_Array(Chars)) = Chars if Chars
95795 does not contain nul; else Value(New_Char_Array( Chars)) is
95796 the prefix of Chars up to and including the first nul.
95797
95798 37
95799 function Value (Item : in chars_ptr) return String;
95800
95801 38
95802 Equivalent to To_Ada(Value(Item), Trim_Nul=>True).
95803
95804 39
95805 function Value (Item : in chars_ptr; Length : in size_t)
95806 return String;
95807
95808 40/1
95809 {8652/00638652/0063} {AI95-00177-01AI95-00177-01} Equivalent
95810 to To_Ada(Value(Item, Length) & nul, Trim_Nul=>True).
95811
95812 41
95813 function Strlen (Item : in chars_ptr) return size_t;
95814
95815 42
95816 Returns Val'Length-1 where Val = Value(Item); propagates
95817 Dereference_Error if Item = Null_Ptr.
95818
95819 42.a
95820 Ramification: Strlen returns the number of chars in the array
95821 pointed to by Item, up to and including the char immediately
95822 before the first nul.
95823
95824 42.b
95825 Strlen has the same possibility for erroneous execution as
95826 Value, in cases where the string has not been nul-terminated.
95827
95828 42.c
95829 Strlen has the effect of C's strlen function.
95830
95831 43
95832 procedure Update (Item : in chars_ptr;
95833 Offset : in size_t;
95834 Chars : in char_array;
95835 Check : Boolean := True);
95836
95837 44/1
95838 {8652/00648652/0064} {AI95-00039-01AI95-00039-01} If Item =
95839 Null_Ptr, then Update propagates Dereference_Error.
95840 Otherwise, this procedure updates the value pointed to by
95841 Item, starting at position Offset, using Chars as the data to
95842 be copied into the array. Overwriting the nul terminator, and
95843 skipping with the Offset past the nul terminator, are both
95844 prevented if Check is True, as follows:
95845
95846 45
95847 * Let N = Strlen(Item). If Check is True, then:
95848
95849 46
95850 * If Offset+Chars'Length>N, propagate
95851 Update_Error.
95852
95853 47
95854 * Otherwise, overwrite the data in the array
95855 pointed to by Item, starting at the char at
95856 position Offset, with the data in Chars.
95857
95858 48
95859 * If Check is False, then processing is as above, but with
95860 no check that Offset+Chars'Length>N.
95861
95862 48.a
95863 Ramification: If Chars contains nul, Update's effect may be to
95864 "shorten" the pointed-to char array.
95865
95866 49
95867 procedure Update (Item : in chars_ptr;
95868 Offset : in size_t;
95869 Str : in String;
95870 Check : in Boolean := True);
95871
95872 50/2
95873 {AI95-00242-01AI95-00242-01} Equivalent to Update(Item,
95874 Offset, To_C(Str, Append_Nul => False), Check).
95875
95876 50.a/2
95877 Discussion: {AI95-00242-01AI95-00242-01} To truncate the Item
95878 to the length of Str, use Update(Item, Offset, To_C(Str),
95879 Check) instead of Update(Item, Offset, Str, Check). Note that
95880 when truncating Item, Item must be longer than Str.
95881
95882 _Erroneous Execution_
95883
95884 51
95885 Execution of any of the following is erroneous if the Item parameter is
95886 not null_ptr and Item does not point to a nul-terminated array of chars.
95887
95888 52
95889 * a Value function not taking a Length parameter,
95890
95891 53
95892 * the Free procedure,
95893
95894 54
95895 * the Strlen function.
95896
95897 55
95898 Execution of Free(X) is also erroneous if the chars_ptr X was not
95899 returned by New_Char_Array or New_String.
95900
95901 56
95902 Reading or updating a freed char_array is erroneous.
95903
95904 57
95905 Execution of Update is erroneous if Check is False and a call with Check
95906 equal to True would have propagated Update_Error.
95907
95908 NOTES
95909
95910 58
95911 9 New_Char_Array and New_String might be implemented either
95912 through the allocation function from the C environment ("malloc")
95913 or through Ada dynamic memory allocation ("new"). The key points
95914 are
95915
95916 59
95917 * the returned value (a chars_ptr) is represented as a C "char
95918 *" so that it may be passed to C functions;
95919
95920 60
95921 * the allocated object should be freed by the programmer via a
95922 call of Free, not by a called C function.
95923
95924 _Inconsistencies With Ada 95_
95925
95926 60.a/2
95927 {AI95-00242-01AI95-00242-01} Amendment Correction: Update for
95928 a String parameter is now defined to not add a nul character.
95929 It did add a nul in Ada 95. This means that programs that
95930 used this behavior of Update to truncate a string will no
95931 longer work (the string will not be truncated). This change
95932 makes Update for a string consistent with Update for a
95933 char_array (no implicit nul is added to the end of a
95934 char_array).
95935
95936 _Extensions to Ada 95_
95937
95938 60.b/2
95939 {AI95-00161-01AI95-00161-01} Amendment Correction: Added
95940 pragma Preelaborable_Initialization to type chars_ptr, so that
95941 it can be used in preelaborated units.
95942
95943 60.c/2
95944 {AI95-00276-01AI95-00276-01} Amendment Correction: The
95945 components of chars_ptr_array are aliased so that it can be
95946 used to instantiate Interfaces.C.Pointers (that is its
95947 intended purpose, which is otherwise mysterious as it has no
95948 operations).
95949
95950 _Wording Changes from Ada 95_
95951
95952 60.d/2
95953 {8652/00618652/0061} {AI95-00140-01AI95-00140-01} Corrigendum:
95954 Fixed the missing semantics of To_Char_Ptr when Nul_Check is
95955 False.
95956
95957 60.e/2
95958 {8652/00628652/0062} {AI95-00139-01AI95-00139-01} Corrigendum:
95959 Fixed the missing semantics of Value when the Length is 0.
95960
95961 60.f/2
95962 {8652/00638652/0063} {AI95-00177-01AI95-00177-01} Corrigendum:
95963 Corrected the definition of Value to avoid raising
95964 Terminator_Error.
95965
95966 60.g/2
95967 {8652/00648652/0064} {AI95-00039-01AI95-00039-01} Corrigendum:
95968 Fixed the missing semantics of Update when Item is Null_Ptr.
95969
95970 \1f
95971 File: aarm2012.info, Node: B.3.2, Next: B.3.3, Prev: B.3.1, Up: B.3
95972
95973 B.3.2 The Generic Package Interfaces.C.Pointers
95974 -----------------------------------------------
95975
95976 1
95977 The generic package Interfaces.C.Pointers allows the Ada programmer to
95978 perform C-style operations on pointers. It includes an access type
95979 Pointer, Value functions that dereference a Pointer and deliver the
95980 designated array, several pointer arithmetic operations, and "copy"
95981 procedures that copy the contents of a source pointer into the array
95982 designated by a destination pointer. As in C, it treats an object Ptr
95983 of type Pointer as a pointer to the first element of an array, so that
95984 for example, adding 1 to Ptr yields a pointer to the second element of
95985 the array.
95986
95987 2
95988 The generic allows two styles of usage: one in which the array is
95989 terminated by a special terminator element; and another in which the
95990 programmer needs to keep track of the length.
95991
95992 _Static Semantics_
95993
95994 3
95995 The generic library package Interfaces.C.Pointers has the following
95996 declaration:
95997
95998 4
95999 generic
96000 type Index is (<>);
96001 type Element is private;
96002 type Element_Array is array (Index range <>) of aliased Element;
96003 Default_Terminator : Element;
96004 package Interfaces.C.Pointers is
96005 pragma Preelaborate(Pointers);
96006
96007 5
96008 type Pointer is access all Element;
96009
96010 6
96011 function Value(Ref : in Pointer;
96012 Terminator : in Element := Default_Terminator)
96013 return Element_Array;
96014
96015 7
96016 function Value(Ref : in Pointer;
96017 Length : in ptrdiff_t)
96018 return Element_Array;
96019
96020 8
96021 Pointer_Error : exception;
96022
96023 9
96024 -- C-style Pointer arithmetic
96025
96026 10/3
96027 {AI05-0229-1AI05-0229-1} function "+" (Left : in Pointer; Right : in ptrdiff_t) return Pointer
96028 with Convention => Intrinsic;
96029 function "+" (Left : in ptrdiff_t; Right : in Pointer) return Pointer
96030 with Convention => Intrinsic;
96031 function "-" (Left : in Pointer; Right : in ptrdiff_t) return Pointer
96032 with Convention => Intrinsic;
96033 function "-" (Left : in Pointer; Right : in Pointer) return ptrdiff_t
96034 with Convention => Intrinsic;
96035
96036 11/3
96037 {AI05-0229-1AI05-0229-1} procedure Increment (Ref : in out Pointer)
96038 with Convention => Intrinsic;
96039 procedure Decrement (Ref : in out Pointer)
96040 with Convention => Intrinsic;
96041
96042 12/3
96043 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
96044
96045 13
96046 function Virtual_Length (Ref : in Pointer;
96047 Terminator : in Element := Default_Terminator)
96048 return ptrdiff_t;
96049
96050 14
96051 procedure Copy_Terminated_Array
96052 (Source : in Pointer;
96053 Target : in Pointer;
96054 Limit : in ptrdiff_t := ptrdiff_t'Last;
96055 Terminator : in Element := Default_Terminator);
96056
96057 15
96058 procedure Copy_Array (Source : in Pointer;
96059 Target : in Pointer;
96060 Length : in ptrdiff_t);
96061
96062 16
96063 end Interfaces.C.Pointers;
96064
96065 17
96066 The type Pointer is C-compatible and corresponds to one use of C's
96067 "Element *". An object of type Pointer is interpreted as a pointer to
96068 the initial Element in an Element_Array. Two styles are supported:
96069
96070 18
96071 * Explicit termination of an array value with Default_Terminator (a
96072 special terminator value);
96073
96074 19
96075 * Programmer-managed length, with Default_Terminator treated simply
96076 as a data element.
96077
96078 20
96079 function Value(Ref : in Pointer;
96080 Terminator : in Element := Default_Terminator)
96081 return Element_Array;
96082
96083 21
96084 This function returns an Element_Array whose value is the
96085 array pointed to by Ref, up to and including the first
96086 Terminator; the lower bound of the array is Index'First.
96087 Interfaces.C.Strings.Dereference_Error is propagated if Ref is
96088 null.
96089
96090 22
96091 function Value(Ref : in Pointer;
96092 Length : in ptrdiff_t)
96093 return Element_Array;
96094
96095 23
96096 This function returns an Element_Array comprising the first
96097 Length elements pointed to by Ref. The exception
96098 Interfaces.C.Strings.Dereference_Error is propagated if Ref is
96099 null.
96100
96101 24
96102 The "+" and "-" functions perform arithmetic on Pointer values, based on
96103 the Size of the array elements. In each of these functions,
96104 Pointer_Error is propagated if a Pointer parameter is null.
96105
96106 25
96107 procedure Increment (Ref : in out Pointer);
96108
96109 26
96110 Equivalent to Ref := Ref+1.
96111
96112 27
96113 procedure Decrement (Ref : in out Pointer);
96114
96115 28
96116 Equivalent to Ref := Ref-1.
96117
96118 29
96119 function Virtual_Length (Ref : in Pointer;
96120 Terminator : in Element := Default_Terminator)
96121 return ptrdiff_t;
96122
96123 30
96124 Returns the number of Elements, up to the one just before the
96125 first Terminator, in Value(Ref, Terminator).
96126
96127 31
96128 procedure Copy_Terminated_Array
96129 (Source : in Pointer;
96130 Target : in Pointer;
96131 Limit : in ptrdiff_t := ptrdiff_t'Last;
96132 Terminator : in Element := Default_Terminator);
96133
96134 32
96135 This procedure copies Value(Source, Terminator) into the array
96136 pointed to by Target; it stops either after Terminator has
96137 been copied, or the number of elements copied is Limit,
96138 whichever occurs first. Dereference_Error is propagated if
96139 either Source or Target is null.
96140
96141 32.a
96142 Ramification: It is the programmer's responsibility to ensure
96143 that elements are not copied beyond the logical length of the
96144 target array.
96145
96146 32.b
96147 Implementation Note: The implementation has to take care to
96148 check the Limit first.
96149
96150 33
96151 procedure Copy_Array (Source : in Pointer;
96152 Target : in Pointer;
96153 Length : in ptrdiff_t);
96154
96155 34
96156 This procedure copies the first Length elements from the array
96157 pointed to by Source, into the array pointed to by Target.
96158 Dereference_Error is propagated if either Source or Target is
96159 null.
96160
96161 _Erroneous Execution_
96162
96163 35
96164 It is erroneous to dereference a Pointer that does not designate an
96165 aliased Element.
96166
96167 35.a
96168 Discussion: Such a Pointer could arise via "+", "-",
96169 Increment, or Decrement.
96170
96171 36
96172 Execution of Value(Ref, Terminator) is erroneous if Ref does not
96173 designate an aliased Element in an Element_Array terminated by
96174 Terminator.
96175
96176 37
96177 Execution of Value(Ref, Length) is erroneous if Ref does not designate
96178 an aliased Element in an Element_Array containing at least Length
96179 Elements between the designated Element and the end of the array,
96180 inclusive.
96181
96182 38
96183 Execution of Virtual_Length(Ref, Terminator) is erroneous if Ref does
96184 not designate an aliased Element in an Element_Array terminated by
96185 Terminator.
96186
96187 39
96188 Execution of Copy_Terminated_Array(Source, Target, Limit, Terminator) is
96189 erroneous in either of the following situations:
96190
96191 40
96192 * Execution of both Value(Source, Terminator) and Value(Source,
96193 Limit) are erroneous, or
96194
96195 41
96196 * Copying writes past the end of the array containing the Element
96197 designated by Target.
96198
96199 42
96200 Execution of Copy_Array(Source, Target, Length) is erroneous if either
96201 Value(Source, Length) is erroneous, or copying writes past the end of
96202 the array containing the Element designated by Target.
96203
96204 NOTES
96205
96206 43
96207 10 To compose a Pointer from an Element_Array, use 'Access on the
96208 first element. For example (assuming appropriate instantiations):
96209
96210 44
96211 Some_Array : Element_Array(0..5) ;
96212 Some_Pointer : Pointer := Some_Array(0)'Access;
96213
96214 _Examples_
96215
96216 45
96217 Example of Interfaces.C.Pointers:
96218
96219 46
96220 with Interfaces.C.Pointers;
96221 with Interfaces.C.Strings;
96222 procedure Test_Pointers is
96223 package C renames Interfaces.C;
96224 package Char_Ptrs is
96225 new C.Pointers (Index => C.size_t,
96226 Element => C.char,
96227 Element_Array => C.char_array,
96228 Default_Terminator => C.nul);
96229
96230 47
96231 use type Char_Ptrs.Pointer;
96232 subtype Char_Star is Char_Ptrs.Pointer;
96233
96234 48
96235 procedure Strcpy (Target_Ptr, Source_Ptr : Char_Star) is
96236 Target_Temp_Ptr : Char_Star := Target_Ptr;
96237 Source_Temp_Ptr : Char_Star := Source_Ptr;
96238 Element : C.char;
96239 begin
96240 if Target_Temp_Ptr = null or Source_Temp_Ptr = null then
96241 raise C.Strings.Dereference_Error;
96242 end if;
96243
96244 49/1
96245 {8652/00658652/0065} {AI95-00142-01AI95-00142-01} loop
96246 Element := Source_Temp_Ptr.all;
96247 Target_Temp_Ptr.all := Element;
96248 exit when C."="(Element, C.nul);
96249 Char_Ptrs.Increment(Target_Temp_Ptr);
96250 Char_Ptrs.Increment(Source_Temp_Ptr);
96251 end loop;
96252 end Strcpy;
96253 begin
96254 ...
96255 end Test_Pointers;
96256
96257 \1f
96258 File: aarm2012.info, Node: B.3.3, Prev: B.3.2, Up: B.3
96259
96260 B.3.3 Unchecked Union Types
96261 ---------------------------
96262
96263 1/3
96264 {AI95-00216-01AI95-00216-01} {AI05-0229-1AI05-0229-1}
96265 {AI05-0269-1AI05-0269-1} [Specifying aspect Unchecked_Union to have the
96266 value True defines an interface correspondence between a given
96267 discriminated type and some C union. The aspect requires that the
96268 associated type shall be given a representation that allocates no space
96269 for its discriminant(s).]
96270
96271 Paragraphs 2 through 3 were moved to *note Annex J::, "*note Annex J::
96272 Obsolescent Features".
96273
96274 _Static Semantics_
96275
96276 3.1/3
96277 {AI05-0229-1AI05-0229-1} For a discriminated record type having a
96278 variant_part, the following language-defined representation aspect may
96279 be specified:
96280
96281 3.2/3
96282 Unchecked_Union
96283 The type of aspect Unchecked_Union is Boolean. If
96284 directly specified, the aspect_definition shall be a
96285 static expression. If not specified (including by
96286 inheritance), the aspect is False.
96287
96288 3.a/3
96289 Aspect Description for Unchecked_Union: Type is used to
96290 interface to a C union type.
96291
96292 _Legality Rules_
96293
96294 Paragraphs 4 and 5 were deleted.
96295
96296 6/3
96297 {AI95-00216-01AI95-00216-01} {AI05-0229-1AI05-0229-1} A type for which
96298 aspect Unchecked_Union is True is called an unchecked union type. A
96299 subtype of an unchecked union type is defined to be an unchecked union
96300 subtype. An object of an unchecked union type is defined to be an
96301 unchecked union object.
96302
96303 7/2
96304 {AI95-00216-01AI95-00216-01} All component subtypes of an unchecked
96305 union type shall be C-compatible.
96306
96307 8/2
96308 {AI95-00216-01AI95-00216-01} If a component subtype of an unchecked
96309 union type is subject to a per-object constraint, then the component
96310 subtype shall be an unchecked union subtype.
96311
96312 9/3
96313 {AI95-00216-01AI95-00216-01} {AI05-0026-1AI05-0026-1} Any name that
96314 denotes a discriminant of an object of an unchecked union type shall
96315 occur within the declarative region of the type, and shall not occur
96316 within a record_representation_clause.
96317
96318 10/3
96319 {AI95-00216-01AI95-00216-01} {AI05-0026-1AI05-0026-1} The type of a
96320 component declared in a variant_part of an unchecked union type shall
96321 not need finalization. In addition to the places where Legality Rules
96322 normally apply (see *note 12.3::), this rule also applies in the private
96323 part of an instance of a generic unit. For an unchecked union type
96324 declared within the body of a generic unit, or within the body of any of
96325 its descendant library units, no part of the type of a component
96326 declared in a variant_part of the unchecked union type shall be of a
96327 formal private type or formal private extension declared within the
96328 formal part of the generic unit.
96329
96330 10.a/3
96331 Reason: {AI05-0026-1AI05-0026-1} The last part is a classic
96332 assume-the-worst rule that avoids dependence on the actuals in
96333 a generic body. We did not include this in the definition of
96334 "needs finalization" as it has a bad interaction with the use
96335 of that term for the No_Nested_Finalization restriction.
96336
96337 11/2
96338 {AI95-00216-01AI95-00216-01} The completion of an incomplete or private
96339 type declaration having a known_discriminant_part shall not be an
96340 unchecked union type.
96341
96342 12/2
96343 {AI95-00216-01AI95-00216-01} An unchecked union subtype shall only be
96344 passed as a generic actual parameter if the corresponding formal type
96345 has no known discriminants or is an unchecked union type.
96346
96347 12.a/2
96348 Ramification: This includes formal private types without a
96349 known_discriminant_part, formal derived types that do not
96350 inherit any discriminants (formal derived types do not have
96351 known_discriminant_parts), and formal derived types that are
96352 unchecked union types.
96353
96354 _Static Semantics_
96355
96356 13/2
96357 {AI95-00216-01AI95-00216-01} An unchecked union type is eligible for
96358 convention C.
96359
96360 14/2
96361 {AI95-00216-01AI95-00216-01} All objects of an unchecked union type have
96362 the same size.
96363
96364 15/2
96365 {AI95-00216-01AI95-00216-01} Discriminants of objects of an unchecked
96366 union type are of size zero.
96367
96368 16/2
96369 {AI95-00216-01AI95-00216-01} Any check which would require reading a
96370 discriminant of an unchecked union object is suppressed (see *note
96371 11.5::). These checks include:
96372
96373 17/2
96374 * The check performed when addressing a variant component (i.e., a
96375 component that was declared in a variant part) of an unchecked
96376 union object that the object has this component (see *note
96377 4.1.3::).
96378
96379 18/2
96380 * Any checks associated with a type or subtype conversion of a value
96381 of an unchecked union type (see *note 4.6::). This includes, for
96382 example, the check associated with the implicit subtype conversion
96383 of an assignment statement.
96384
96385 19/2
96386 * The subtype membership check associated with the evaluation of a
96387 qualified expression (see *note 4.7::) or an uninitialized
96388 allocator (see *note 4.8::).
96389
96390 19.a/2
96391 Discussion: If a suppressed check would have failed, execution
96392 is erroneous (see *note 11.5::). An implementation is always
96393 allowed to make a suppressed check if it can somehow determine
96394 the discriminant value.
96395
96396 _Dynamic Semantics_
96397
96398 20/2
96399 {AI95-00216-01AI95-00216-01} A view of an unchecked union object
96400 (including a type conversion or function call) has inferable
96401 discriminants if it has a constrained nominal subtype, unless the object
96402 is a component of an enclosing unchecked union object that is subject to
96403 a per-object constraint and the enclosing object lacks inferable
96404 discriminants.
96405
96406 21/2
96407 {AI95-00216-01AI95-00216-01} An expression of an unchecked union type
96408 has inferable discriminants if it is either a name of an object with
96409 inferable discriminants or a qualified expression whose subtype_mark
96410 denotes a constrained subtype.
96411
96412 22/2
96413 {AI95-00216-01AI95-00216-01} Program_Error is raised in the following
96414 cases:
96415
96416 23/2
96417 * Evaluation of the predefined equality operator for an unchecked
96418 union type if either of the operands lacks inferable discriminants.
96419
96420 24/2
96421 * Evaluation of the predefined equality operator for a type which has
96422 a subcomponent of an unchecked union type whose nominal subtype is
96423 unconstrained.
96424
96425 25/2
96426 * Evaluation of a membership test if the subtype_mark denotes a
96427 constrained unchecked union subtype and the expression lacks
96428 inferable discriminants.
96429
96430 26/2
96431 * Conversion from a derived unchecked union type to an unconstrained
96432 non-unchecked-union type if the operand of the conversion lacks
96433 inferable discriminants.
96434
96435 27/2
96436 * Execution of the default implementation of the Write or Read
96437 attribute of an unchecked union type.
96438
96439 28/2
96440 * Execution of the default implementation of the Output or Input
96441 attribute of an unchecked union type if the type lacks default
96442 discriminant values.
96443
96444 Paragraph 29 was deleted.
96445
96446 NOTES
96447
96448 30/2
96449 11 {AI95-00216-01AI95-00216-01} The use of an unchecked union to
96450 obtain the effect of an unchecked conversion results in erroneous
96451 execution (see *note 11.5::). Execution of the following example
96452 is erroneous even if Float'Size = Integer'Size:
96453
96454 31/3
96455 {AI05-0229-1AI05-0229-1} type T (Flag : Boolean := False) is
96456 record
96457 case Flag is
96458 when False =>
96459 F1 : Float := 0.0;
96460 when True =>
96461 F2 : Integer := 0;
96462 end case;
96463 end record
96464 with Unchecked_Union;
96465
96466 32/2
96467 X : T;
96468 Y : Integer := X.F2; -- erroneous
96469
96470 _Extensions to Ada 95_
96471
96472 32.a/2
96473 {AI95-00216-01AI95-00216-01} Pragma Unchecked_Union is new.
96474
96475 _Incompatibilities With Ada 2005_
96476
96477 32.b/3
96478 {AI05-0026-1AI05-0026-1} Correction: The use of discriminants
96479 on Unchecked_Union types is now illegal in
96480 record_representation_clauses, as it makes no sense to specify
96481 a position for something that is not supposed to exist. It is
96482 very unlikely that this change will have any impact on
96483 existing code.
96484
96485 _Extensions to Ada 2005_
96486
96487 32.c/3
96488 {AI05-0229-1AI05-0229-1} Aspect Unchecked_Union is new; pragma
96489 Unchecked_Union is now obsolescent.
96490
96491 _Wording Changes from Ada 2005_
96492
96493 32.d/3
96494 {AI05-0026-1AI05-0026-1} Correction: Revised the rules to use
96495 the "needs finalization" definition, and eliminated generic
96496 contract issues.
96497
96498 \1f
96499 File: aarm2012.info, Node: B.4, Next: B.5, Prev: B.3, Up: Annex B
96500
96501 B.4 Interfacing with COBOL
96502 ==========================
96503
96504 1/3
96505 {AI05-0229-1AI05-0229-1} The facilities relevant to interfacing with the
96506 COBOL language are the package Interfaces.COBOL and support for
96507 specifying the Convention aspect with convention_identifier COBOL.
96508
96509 2
96510 The COBOL interface package supplies several sets of facilities:
96511
96512 3
96513 * A set of types corresponding to the native COBOL types of the
96514 supported COBOL implementation (so-called "internal COBOL
96515 representations"), allowing Ada data to be passed as parameters to
96516 COBOL programs
96517
96518 4
96519 * A set of types and constants reflecting external data
96520 representations such as might be found in files or databases,
96521 allowing COBOL-generated data to be read by an Ada program, and
96522 Ada-generated data to be read by COBOL programs
96523
96524 5
96525 * A generic package for converting between an Ada decimal type value
96526 and either an internal or external COBOL representation
96527
96528 _Static Semantics_
96529
96530 6
96531 The library package Interfaces.COBOL has the following declaration:
96532
96533 7
96534 package Interfaces.COBOL is
96535 pragma Preelaborate(COBOL);
96536
96537 8
96538 -- Types and operations for internal data representations
96539
96540 9
96541 type Floating is digits implementation-defined;
96542 type Long_Floating is digits implementation-defined;
96543
96544 10
96545 type Binary is range implementation-defined;
96546 type Long_Binary is range implementation-defined;
96547
96548 11
96549 Max_Digits_Binary : constant := implementation-defined;
96550 Max_Digits_Long_Binary : constant := implementation-defined;
96551
96552 12/3
96553 {AI05-0229-1AI05-0229-1} type Decimal_Element is mod implementation-defined;
96554 type Packed_Decimal is array (Positive range <>) of Decimal_Element
96555 with Pack;
96556
96557 13
96558 type COBOL_Character is implementation-defined character type;
96559
96560 14
96561 Ada_To_COBOL : array (Character) of COBOL_Character := implementation-defined;
96562
96563 15
96564 COBOL_To_Ada : array (COBOL_Character) of Character := implementation-defined;
96565
96566 16/3
96567 {AI05-0229-1AI05-0229-1} type Alphanumeric is array (Positive range <>) of COBOL_Character
96568 with Pack;
96569
96570 17
96571 function To_COBOL (Item : in String) return Alphanumeric;
96572 function To_Ada (Item : in Alphanumeric) return String;
96573
96574 18
96575 procedure To_COBOL (Item : in String;
96576 Target : out Alphanumeric;
96577 Last : out Natural);
96578
96579 19
96580 procedure To_Ada (Item : in Alphanumeric;
96581 Target : out String;
96582 Last : out Natural);
96583
96584 20/3
96585 {AI05-0229-1AI05-0229-1} type Numeric is array (Positive range <>) of COBOL_Character
96586 with Pack;
96587
96588 21
96589 -- Formats for COBOL data representations
96590
96591 22
96592 type Display_Format is private;
96593
96594 23
96595 Unsigned : constant Display_Format;
96596 Leading_Separate : constant Display_Format;
96597 Trailing_Separate : constant Display_Format;
96598 Leading_Nonseparate : constant Display_Format;
96599 Trailing_Nonseparate : constant Display_Format;
96600
96601 24
96602 type Binary_Format is private;
96603
96604 25
96605 High_Order_First : constant Binary_Format;
96606 Low_Order_First : constant Binary_Format;
96607 Native_Binary : constant Binary_Format;
96608
96609 26
96610 type Packed_Format is private;
96611
96612 27
96613 Packed_Unsigned : constant Packed_Format;
96614 Packed_Signed : constant Packed_Format;
96615
96616 28
96617 -- Types for external representation of COBOL binary data
96618
96619 29/3
96620 {AI05-0229-1AI05-0229-1} type Byte is mod 2**COBOL_Character'Size;
96621 type Byte_Array is array (Positive range <>) of Byte
96622 with Pack;
96623
96624 30
96625 Conversion_Error : exception;
96626
96627 31
96628 generic
96629 type Num is delta <> digits <>;
96630 package Decimal_Conversions is
96631
96632 32
96633 -- Display Formats: data values are represented as Numeric
96634
96635 33
96636 function Valid (Item : in Numeric;
96637 Format : in Display_Format) return Boolean;
96638
96639 34
96640 function Length (Format : in Display_Format) return Natural;
96641
96642 35
96643 function To_Decimal (Item : in Numeric;
96644 Format : in Display_Format) return Num;
96645
96646 36
96647 function To_Display (Item : in Num;
96648 Format : in Display_Format) return Numeric;
96649
96650 37
96651 -- Packed Formats: data values are represented as Packed_Decimal
96652
96653 38
96654 function Valid (Item : in Packed_Decimal;
96655 Format : in Packed_Format) return Boolean;
96656
96657 39
96658 function Length (Format : in Packed_Format) return Natural;
96659
96660 40
96661 function To_Decimal (Item : in Packed_Decimal;
96662 Format : in Packed_Format) return Num;
96663
96664 41
96665 function To_Packed (Item : in Num;
96666 Format : in Packed_Format) return Packed_Decimal;
96667
96668 42
96669 -- Binary Formats: external data values are represented as Byte_Array
96670
96671 43
96672 function Valid (Item : in Byte_Array;
96673 Format : in Binary_Format) return Boolean;
96674
96675 44
96676 function Length (Format : in Binary_Format) return Natural;
96677 function To_Decimal (Item : in Byte_Array;
96678 Format : in Binary_Format) return Num;
96679
96680 45
96681 function To_Binary (Item : in Num;
96682 Format : in Binary_Format) return Byte_Array;
96683
96684 46
96685 -- Internal Binary formats: data values are of type Binary or Long_Binary
96686
96687 47
96688 function To_Decimal (Item : in Binary) return Num;
96689 function To_Decimal (Item : in Long_Binary) return Num;
96690
96691 48
96692 function To_Binary (Item : in Num) return Binary;
96693 function To_Long_Binary (Item : in Num) return Long_Binary;
96694
96695 49
96696 end Decimal_Conversions;
96697
96698 50
96699 private
96700 ... -- not specified by the language
96701 end Interfaces.COBOL;
96702
96703 50.a/1
96704 Implementation defined: The types Floating, Long_Floating,
96705 Binary, Long_Binary, Decimal_Element, and COBOL_Character; and
96706 the initializations of the variables Ada_To_COBOL and
96707 COBOL_To_Ada, in Interfaces.COBOL.
96708
96709 51
96710 Each of the types in Interfaces.COBOL is COBOL-compatible.
96711
96712 52
96713 The types Floating and Long_Floating correspond to the native types in
96714 COBOL for data items with computational usage implemented by floating
96715 point. The types Binary and Long_Binary correspond to the native types
96716 in COBOL for data items with binary usage, or with computational usage
96717 implemented by binary.
96718
96719 53
96720 Max_Digits_Binary is the largest number of decimal digits in a numeric
96721 value that is represented as Binary. Max_Digits_Long_Binary is the
96722 largest number of decimal digits in a numeric value that is represented
96723 as Long_Binary.
96724
96725 54
96726 The type Packed_Decimal corresponds to COBOL's packed-decimal usage.
96727
96728 55
96729 The type COBOL_Character defines the run-time character set used in the
96730 COBOL implementation. Ada_To_COBOL and COBOL_To_Ada are the mappings
96731 between the Ada and COBOL run-time character sets.
96732
96733 55.a
96734 Reason: The character mappings are visible variables, since
96735 the user needs the ability to modify them at run time.
96736
96737 56
96738 Type Alphanumeric corresponds to COBOL's alphanumeric data category.
96739
96740 57
96741 Each of the functions To_COBOL and To_Ada converts its parameter based
96742 on the mappings Ada_To_COBOL and COBOL_To_Ada, respectively. The length
96743 of the result for each is the length of the parameter, and the lower
96744 bound of the result is 1. Each component of the result is obtained by
96745 applying the relevant mapping to the corresponding component of the
96746 parameter.
96747
96748 58
96749 Each of the procedures To_COBOL and To_Ada copies converted elements
96750 from Item to Target, using the appropriate mapping (Ada_To_COBOL or
96751 COBOL_To_Ada, respectively). The index in Target of the last element
96752 assigned is returned in Last (0 if Item is a null array). If
96753 Item'Length exceeds Target'Length, Constraint_Error is propagated.
96754
96755 59
96756 Type Numeric corresponds to COBOL's numeric data category with display
96757 usage.
96758
96759 60
96760 The types Display_Format, Binary_Format, and Packed_Format are used in
96761 conversions between Ada decimal type values and COBOL internal or
96762 external data representations. The value of the constant Native_Binary
96763 is either High_Order_First or Low_Order_First, depending on the
96764 implementation.
96765
96766 61
96767 function Valid (Item : in Numeric;
96768 Format : in Display_Format) return Boolean;
96769
96770 62
96771 The function Valid checks that the Item parameter has a value
96772 consistent with the value of Format. If the value of Format
96773 is other than Unsigned, Leading_Separate, and
96774 Trailing_Separate, the effect is implementation defined. If
96775 Format does have one of these values, the following rules
96776 apply:
96777
96778 63/3
96779 * {8652/00668652/0066} {AI95-00071-01AI95-00071-01}
96780 {AI05-0264-1AI05-0264-1} Format=Unsigned: if Item
96781 comprises one or more decimal digit characters, then
96782 Valid returns True, else it returns False.
96783
96784 64/1
96785 * {8652/00668652/0066} {AI95-00071-01AI95-00071-01}
96786 Format=Leading_Separate: if Item comprises a single
96787 occurrence of the plus or minus sign character, and then
96788 one or more decimal digit characters, then Valid returns
96789 True, else it returns False.
96790
96791 65/1
96792 * {8652/00668652/0066} {AI95-00071-01AI95-00071-01}
96793 Format=Trailing_Separate: if Item comprises one or more
96794 decimal digit characters and finally a plus or minus sign
96795 character, then Valid returns True, else it returns
96796 False.
96797
96798 66
96799 function Length (Format : in Display_Format) return Natural;
96800
96801 67
96802 The Length function returns the minimal length of a Numeric
96803 value sufficient to hold any value of type Num when
96804 represented as Format.
96805
96806 68
96807 function To_Decimal (Item : in Numeric;
96808 Format : in Display_Format) return Num;
96809
96810 69
96811 Produces a value of type Num corresponding to Item as
96812 represented by Format. The number of digits after the assumed
96813 radix point in Item is Num'Scale. Conversion_Error is
96814 propagated if the value represented by Item is outside the
96815 range of Num.
96816
96817 69.a
96818 Discussion: There is no issue of truncation versus rounding,
96819 since the number of decimal places is established by
96820 Num'Scale.
96821
96822 70
96823 function To_Display (Item : in Num;
96824 Format : in Display_Format) return Numeric;
96825
96826 71/1
96827 {8652/00678652/0067} {AI95-00072-01AI95-00072-01} This
96828 function returns the Numeric value for Item, represented in
96829 accordance with Format. The length of the returned value is
96830 Length(Format), and the lower bound is 1. Conversion_Error is
96831 propagated if Num is negative and Format is Unsigned.
96832
96833 72
96834 function Valid (Item : in Packed_Decimal;
96835 Format : in Packed_Format) return Boolean;
96836
96837 73
96838 This function returns True if Item has a value consistent with
96839 Format, and False otherwise. The rules for the formation of
96840 Packed_Decimal values are implementation defined.
96841
96842 74
96843 function Length (Format : in Packed_Format) return Natural;
96844
96845 75
96846 This function returns the minimal length of a Packed_Decimal
96847 value sufficient to hold any value of type Num when
96848 represented as Format.
96849
96850 76
96851 function To_Decimal (Item : in Packed_Decimal;
96852 Format : in Packed_Format) return Num;
96853
96854 77
96855 Produces a value of type Num corresponding to Item as
96856 represented by Format. Num'Scale is the number of digits
96857 after the assumed radix point in Item. Conversion_Error is
96858 propagated if the value represented by Item is outside the
96859 range of Num.
96860
96861 78
96862 function To_Packed (Item : in Num;
96863 Format : in Packed_Format) return Packed_Decimal;
96864
96865 79/1
96866 {8652/00678652/0067} {AI95-00072-01AI95-00072-01} This
96867 function returns the Packed_Decimal value for Item,
96868 represented in accordance with Format. The length of the
96869 returned value is Length(Format), and the lower bound is 1.
96870 Conversion_Error is propagated if Num is negative and Format
96871 is Packed_Unsigned.
96872
96873 80
96874 function Valid (Item : in Byte_Array;
96875 Format : in Binary_Format) return Boolean;
96876
96877 81
96878 This function returns True if Item has a value consistent with
96879 Format, and False otherwise.
96880
96881 81.a
96882 Ramification: This function returns False only when the
96883 represented value is outside the range of Num.
96884
96885 82
96886 function Length (Format : in Binary_Format) return Natural;
96887
96888 83
96889 This function returns the minimal length of a Byte_Array value
96890 sufficient to hold any value of type Num when represented as
96891 Format.
96892
96893 84
96894 function To_Decimal (Item : in Byte_Array;
96895 Format : in Binary_Format) return Num;
96896
96897 85
96898 Produces a value of type Num corresponding to Item as
96899 represented by Format. Num'Scale is the number of digits
96900 after the assumed radix point in Item. Conversion_Error is
96901 propagated if the value represented by Item is outside the
96902 range of Num.
96903
96904 86
96905 function To_Binary (Item : in Num;
96906 Format : in Binary_Format) return Byte_Array;
96907
96908 87/1
96909 {8652/00678652/0067} {AI95-00072-01AI95-00072-01} This
96910 function returns the Byte_Array value for Item, represented in
96911 accordance with Format. The length of the returned value is
96912 Length(Format), and the lower bound is 1.
96913
96914 88
96915 function To_Decimal (Item : in Binary) return Num;
96916
96917 function To_Decimal (Item : in Long_Binary) return Num;
96918
96919 89
96920 These functions convert from COBOL binary format to a
96921 corresponding value of the decimal type Num. Conversion_Error
96922 is propagated if Item is too large for Num.
96923
96924 89.a
96925 Ramification: There is no rescaling performed on the
96926 conversion. That is, the returned value in each case is a
96927 "bit copy" if Num has a binary radix. The programmer is
96928 responsible for maintaining the correct scale.
96929
96930 90
96931 function To_Binary (Item : in Num) return Binary;
96932
96933 function To_Long_Binary (Item : in Num) return Long_Binary;
96934
96935 91
96936 These functions convert from Ada decimal to COBOL binary
96937 format. Conversion_Error is propagated if the value of Item
96938 is too large to be represented in the result type.
96939
96940 91.a
96941 Discussion: One style of interface supported for COBOL,
96942 similar to what is provided for C, is the ability to call and
96943 pass parameters to an existing COBOL program. Thus the
96944 interface package supplies types that can be used in an Ada
96945 program as parameters to subprograms whose bodies will be in
96946 COBOL. These types map to COBOL's alphanumeric and numeric
96947 data categories.
96948
96949 91.b
96950 Several types are provided for support of alphanumeric data.
96951 Since COBOL's run-time character set is not necessarily the
96952 same as Ada's, Interfaces.COBOL declares an
96953 implementation-defined character type COBOL_Character, and
96954 mappings between Character and COBOL_Character. These
96955 mappings are visible variables (rather than, say, functions or
96956 constant arrays), since in the situation where COBOL_Character
96957 is EBCDIC, the flexibility of dynamically modifying the
96958 mappings is needed. Corresponding to COBOL's alphanumeric
96959 data is the string type Alphanumeric.
96960
96961 91.c
96962 Numeric data may have either a "display" or "computational"
96963 representation in COBOL. On the Ada side, the data is of a
96964 decimal fixed point type. Passing an Ada decimal data item to
96965 a COBOL program requires conversion from the Ada decimal type
96966 to some type that reflects the representation expected on the
96967 COBOL side.
96968
96969 91.d
96970 * Computational Representation
96971
96972 91.e
96973 Floating point representation is modeled by Ada floating
96974 point types, Floating and Long_Floating. Conversion
96975 between these types and Ada decimal types is obtained
96976 directly, since the type name serves as a conversion
96977 function.
96978
96979 91.f
96980 Binary representation is modeled by an Ada integer type,
96981 Binary, and possibly other types such as Long_Binary.
96982 Conversion between, say, Binary and a decimal type is
96983 through functions from an instantiation of the generic
96984 package Decimal_Conversions.
96985
96986 91.g
96987 Packed decimal representation is modeled by the Ada array
96988 type Packed_Decimal. Conversion between packed decimal
96989 and a decimal type is through functions from an
96990 instantiation of the generic package Decimal_Conversions.
96991
96992 91.h
96993 * Display Representation
96994
96995 91.i
96996 Display representation for numeric data is modeled by the
96997 array type Numeric. Conversion between display
96998 representation and a decimal type is through functions
96999 from an instantiation of the generic package
97000 Decimal_Conversions. A parameter to the conversion
97001 function indicates the desired interpretation of the data
97002 (e.g., signed leading separate, etc.)
97003
97004 91.j/3
97005 {AI05-0229-1AI05-0229-1} The Convention of a record type may
97006 be specified as COBOL to direct the compiler to choose a
97007 COBOL-compatible representation for objects of the type.
97008
97009 91.k
97010 The package Interfaces.COBOL allows the Ada programmer to deal
97011 with data from files (or databases) created by a COBOL
97012 program. For data that is alphanumeric, or in display or
97013 packed decimal format, the approach is the same as for passing
97014 parameters (instantiate Decimal_Conversions to obtain the
97015 needed conversion functions). For binary data, the external
97016 representation is treated as a Byte array, and an
97017 instantiation of Decimal_IO produces a package that declares
97018 the needed conversion functions. A parameter to the
97019 conversion function indicates the desired interpretation of
97020 the data (e.g., high- versus low-order byte first).
97021
97022 _Implementation Requirements_
97023
97024 92/3
97025 {AI05-0229-1AI05-0229-1} An implementation shall support specifying
97026 aspect Convention with a COBOL convention_identifier for a
97027 COBOL-eligible type (see *note B.1::).
97028
97029 92.a
97030 Ramification: An implementation supporting this package shall
97031 ensure that if the bounds of a Packed_Decimal, Alphanumeric,
97032 or Numeric variable are static, then the representation of the
97033 object comprises solely the array components (that is, there
97034 is no implicit run-time "descriptor" that is part of the
97035 object).
97036
97037 _Implementation Permissions_
97038
97039 93
97040 An implementation may provide additional constants of the private types
97041 Display_Format, Binary_Format, or Packed_Format.
97042
97043 93.a
97044 Reason: This is to allow exploitation of other external
97045 formats that may be available in the COBOL implementation.
97046
97047 94
97048 An implementation may provide further floating point and integer types
97049 in Interfaces.COBOL to match additional native COBOL types, and may also
97050 supply corresponding conversion functions in the generic package
97051 Decimal_Conversions.
97052
97053 _Implementation Advice_
97054
97055 95
97056 An Ada implementation should support the following interface
97057 correspondences between Ada and COBOL.
97058
97059 96
97060 * An Ada access T parameter is passed as a "BY REFERENCE" data item
97061 of the COBOL type corresponding to T.
97062
97063 97
97064 * An Ada in scalar parameter is passed as a "BY CONTENT" data item of
97065 the corresponding COBOL type.
97066
97067 98
97068 * Any other Ada parameter is passed as a "BY REFERENCE" data item of
97069 the COBOL type corresponding to the Ada parameter type; for
97070 scalars, a local copy is used if necessary to ensure by-copy
97071 semantics.
97072
97073 98.a/2
97074 Implementation Advice: If COBOL interfacing is supported, the
97075 interface correspondences between Ada and COBOL should be
97076 supported.
97077
97078 NOTES
97079
97080 99/3
97081 12 {AI05-0229-1AI05-0229-1} An implementation is not required to
97082 support specifying aspect Convention for access types, nor is it
97083 required to support specifying aspects Import, Export, or
97084 Convention for functions.
97085
97086 99.a
97087 Reason: COBOL does not have a pointer facility, and a COBOL
97088 program does not return a value.
97089
97090 100
97091 13 If an Ada subprogram is exported to COBOL, then a call from
97092 COBOL call may specify either "BY CONTENT" or "BY REFERENCE".
97093
97094 _Examples_
97095
97096 101
97097 Examples of Interfaces.COBOL:
97098
97099 102
97100 with Interfaces.COBOL;
97101 procedure Test_Call is
97102
97103 103
97104 -- Calling a foreign COBOL program
97105 -- Assume that a COBOL program PROG has the following declaration
97106 -- in its LINKAGE section:
97107 -- 01 Parameter-Area
97108 -- 05 NAME PIC X(20).
97109 -- 05 SSN PIC X(9).
97110 -- 05 SALARY PIC 99999V99 USAGE COMP.
97111 -- The effect of PROG is to update SALARY based on some algorithm
97112
97113 104
97114 package COBOL renames Interfaces.COBOL;
97115
97116 105
97117 type Salary_Type is delta 0.01 digits 7;
97118
97119 106/3
97120 {AI05-0229-1AI05-0229-1} type COBOL_Record is
97121 record
97122 Name : COBOL.Numeric(1..20);
97123 SSN : COBOL.Numeric(1..9);
97124 Salary : COBOL.Binary; -- Assume Binary = 32 bits
97125 end record
97126 with Convention => COBOL;
97127
97128 107/3
97129 {AI05-0229-1AI05-0229-1} procedure Prog (Item : in out COBOL_Record)
97130 with Import => True, Convention => COBOL;
97131
97132 108
97133 package Salary_Conversions is
97134 new COBOL.Decimal_Conversions(Salary_Type);
97135
97136 109
97137 Some_Salary : Salary_Type := 12_345.67;
97138 Some_Record : COBOL_Record :=
97139 (Name => "Johnson, John ",
97140 SSN => "111223333",
97141 Salary => Salary_Conversions.To_Binary(Some_Salary));
97142
97143 110
97144 begin
97145 Prog (Some_Record);
97146 ...
97147 end Test_Call;
97148
97149 111
97150 with Interfaces.COBOL;
97151 with COBOL_Sequential_IO; -- Assumed to be supplied by implementation
97152 procedure Test_External_Formats is
97153
97154 112
97155 -- Using data created by a COBOL program
97156 -- Assume that a COBOL program has created a sequential file with
97157 -- the following record structure, and that we need to
97158 -- process the records in an Ada program
97159 -- 01 EMPLOYEE-RECORD
97160 -- 05 NAME PIC X(20).
97161 -- 05 SSN PIC X(9).
97162 -- 05 SALARY PIC 99999V99 USAGE COMP.
97163 -- 05 ADJUST PIC S999V999 SIGN LEADING SEPARATE.
97164 -- The COMP data is binary (32 bits), high-order byte first
97165
97166 113
97167 package COBOL renames Interfaces.COBOL;
97168
97169 114
97170 type Salary_Type is delta 0.01 digits 7;
97171 type Adjustments_Type is delta 0.001 digits 6;
97172
97173 115/3
97174 {AI05-0229-1AI05-0229-1} type COBOL_Employee_Record_Type is -- External representation
97175 record
97176 Name : COBOL.Alphanumeric(1..20);
97177 SSN : COBOL.Alphanumeric(1..9);
97178 Salary : COBOL.Byte_Array(1..4);
97179 Adjust : COBOL.Numeric(1..7); -- Sign and 6 digits
97180 end record
97181 with Convention => COBOL;
97182
97183 116
97184 package COBOL_Employee_IO is
97185 new COBOL_Sequential_IO(COBOL_Employee_Record_Type);
97186 use COBOL_Employee_IO;
97187
97188 117
97189 COBOL_File : File_Type;
97190
97191 118
97192 type Ada_Employee_Record_Type is -- Internal representation
97193 record
97194 Name : String(1..20);
97195 SSN : String(1..9);
97196 Salary : Salary_Type;
97197 Adjust : Adjustments_Type;
97198 end record;
97199
97200 119
97201 COBOL_Record : COBOL_Employee_Record_Type;
97202 Ada_Record : Ada_Employee_Record_Type;
97203
97204 120
97205 package Salary_Conversions is
97206 new COBOL.Decimal_Conversions(Salary_Type);
97207 use Salary_Conversions;
97208
97209 121
97210 package Adjustments_Conversions is
97211 new COBOL.Decimal_Conversions(Adjustments_Type);
97212 use Adjustments_Conversions;
97213
97214 122
97215 begin
97216 Open (COBOL_File, Name => "Some_File");
97217
97218 123
97219 loop
97220 Read (COBOL_File, COBOL_Record);
97221
97222 124
97223 Ada_Record.Name := To_Ada(COBOL_Record.Name);
97224 Ada_Record.SSN := To_Ada(COBOL_Record.SSN);
97225 Ada_Record.Salary :=
97226 To_Decimal(COBOL_Record.Salary, COBOL.High_Order_First);
97227 Ada_Record.Adjust :=
97228 To_Decimal(COBOL_Record.Adjust, COBOL.Leading_Separate);
97229 ... -- Process Ada_Record
97230 end loop;
97231 exception
97232 when End_Error => ...
97233 end Test_External_Formats;
97234
97235 _Wording Changes from Ada 95_
97236
97237 124.a/2
97238 {8652/00668652/0066} {AI95-00071-01AI95-00071-01} Corrigendum:
97239 Corrected the definition of Valid to match COBOL.
97240
97241 124.b/2
97242 {8652/00678652/0067} {AI95-00072-01AI95-00072-01} Corrigendum:
97243 Specified the bounds of the results of To_Display, To_Packed,
97244 and To_Binary.
97245
97246 \1f
97247 File: aarm2012.info, Node: B.5, Prev: B.4, Up: Annex B
97248
97249 B.5 Interfacing with Fortran
97250 ============================
97251
97252 1/3
97253 {AI05-0229-1AI05-0229-1} The facilities relevant to interfacing with the
97254 Fortran language are the package Interfaces.Fortran and support for
97255 specifying the Convention aspect with convention_identifier Fortran.
97256
97257 2
97258 The package Interfaces.Fortran defines Ada types whose representations
97259 are identical to the default representations of the Fortran intrinsic
97260 types Integer, Real, Double Precision, Complex, Logical, and Character
97261 in a supported Fortran implementation. These Ada types can therefore be
97262 used to pass objects between Ada and Fortran programs.
97263
97264 _Static Semantics_
97265
97266 3
97267 The library package Interfaces.Fortran has the following declaration:
97268
97269 4
97270 with Ada.Numerics.Generic_Complex_Types; -- see *note G.1.1::
97271 pragma Elaborate_All(Ada.Numerics.Generic_Complex_Types);
97272 package Interfaces.Fortran is
97273 pragma Pure(Fortran);
97274
97275 5
97276 type Fortran_Integer is range implementation-defined;
97277
97278 6
97279 type Real is digits implementation-defined;
97280 type Double_Precision is digits implementation-defined;
97281
97282 7
97283 type Logical is new Boolean;
97284
97285 8
97286 package Single_Precision_Complex_Types is
97287 new Ada.Numerics.Generic_Complex_Types (Real);
97288
97289 9
97290 type Complex is new Single_Precision_Complex_Types.Complex;
97291
97292 10
97293 subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
97294 i : Imaginary renames Single_Precision_Complex_Types.i;
97295 j : Imaginary renames Single_Precision_Complex_Types.j;
97296
97297 11
97298 type Character_Set is implementation-defined character type;
97299
97300 12/3
97301 {AI05-0229-1AI05-0229-1} type Fortran_Character is array (Positive range <>) of Character_Set
97302 with Pack;
97303
97304 13
97305 function To_Fortran (Item : in Character) return Character_Set;
97306 function To_Ada (Item : in Character_Set) return Character;
97307
97308 14
97309 function To_Fortran (Item : in String) return Fortran_Character;
97310 function To_Ada (Item : in Fortran_Character) return String;
97311
97312 15
97313 procedure To_Fortran (Item : in String;
97314 Target : out Fortran_Character;
97315 Last : out Natural);
97316
97317 16
97318 procedure To_Ada (Item : in Fortran_Character;
97319 Target : out String;
97320 Last : out Natural);
97321
97322 17
97323 end Interfaces.Fortran;
97324
97325 17.a.1/1
97326 Implementation defined: The types Fortran_Integer, Real,
97327 Double_Precision, and Character_Set in Interfaces.Fortran.
97328
97329 17.a
97330 Ramification: The means by which the Complex type is provided
97331 in Interfaces.Fortran creates a dependence of
97332 Interfaces.Fortran on Numerics.Generic_Complex_Types (see
97333 *note G.1.1::). This dependence is intentional and
97334 unavoidable, if the Fortran-compatible Complex type is to be
97335 useful in Ada code without duplicating facilities defined
97336 elsewhere.
97337
97338 18
97339 The types Fortran_Integer, Real, Double_Precision, Logical, Complex, and
97340 Fortran_Character are Fortran-compatible.
97341
97342 19
97343 The To_Fortran and To_Ada functions map between the Ada type Character
97344 and the Fortran type Character_Set, and also between the Ada type String
97345 and the Fortran type Fortran_Character. The To_Fortran and To_Ada
97346 procedures have analogous effects to the string conversion subprograms
97347 found in Interfaces.COBOL.
97348
97349 _Implementation Requirements_
97350
97351 20/3
97352 {AI05-0229-1AI05-0229-1} An implementation shall support specifying
97353 aspect Convention with a Fortran convention_identifier for a
97354 Fortran-eligible type (see *note B.1::).
97355
97356 _Implementation Permissions_
97357
97358 21
97359 An implementation may add additional declarations to the Fortran
97360 interface packages. For example, the Fortran interface package for an
97361 implementation of Fortran 77 (ANSI X3.9-1978) that defines types like
97362 Integer*n, Real*n, Logical*n, and Complex*n may contain the declarations
97363 of types named Integer_Star_n, Real_Star_n, Logical_Star_n, and
97364 Complex_Star_n. (This convention should not apply to Character*n, for
97365 which the Ada analog is the constrained array subtype Fortran_Character
97366 (1..n).) Similarly, the Fortran interface package for an implementation
97367 of Fortran 90 that provides multiple kinds of intrinsic types, e.g.
97368 Integer (Kind=n), Real (Kind=n), Logical (Kind=n), Complex (Kind=n), and
97369 Character (Kind=n), may contain the declarations of types with the
97370 recommended names Integer_Kind_n, Real_Kind_n, Logical_Kind_n,
97371 Complex_Kind_n, and Character_Kind_n.
97372
97373 21.a
97374 Discussion: Implementations may add auxiliary declarations as
97375 needed to assist in the declarations of additional
97376 Fortran-compatible types. For example, if a double precision
97377 complex type is defined, then Numerics.Generic_Complex_Types
97378 may be instantiated for the double precision type. Similarly,
97379 if a wide character type is defined to match a Fortran 90 wide
97380 character type (accessible in Fortran 90 with the Kind
97381 modifier), then an auxiliary character set may be declared to
97382 serve as its component type.
97383
97384 _Implementation Advice_
97385
97386 22
97387 An Ada implementation should support the following interface
97388 correspondences between Ada and Fortran:
97389
97390 23
97391 * An Ada procedure corresponds to a Fortran subroutine.
97392
97393 24
97394 * An Ada function corresponds to a Fortran function.
97395
97396 25
97397 * An Ada parameter of an elementary, array, or record type T is
97398 passed as a TF argument to a Fortran procedure, where TF is the
97399 Fortran type corresponding to the Ada type T, and where the INTENT
97400 attribute of the corresponding dummy argument matches the Ada
97401 formal parameter mode; the Fortran implementation's parameter
97402 passing conventions are used. For elementary types, a local copy
97403 is used if necessary to ensure by-copy semantics.
97404
97405 26
97406 * An Ada parameter of an access-to-subprogram type is passed as a
97407 reference to a Fortran procedure whose interface corresponds to the
97408 designated subprogram's specification.
97409
97410 26.a/2
97411 Implementation Advice: If Fortran interfacing is supported,
97412 the interface correspondences between Ada and Fortran should
97413 be supported.
97414
97415 NOTES
97416
97417 27
97418 14 An object of a Fortran-compatible record type, declared in a
97419 library package or subprogram, can correspond to a Fortran common
97420 block; the type also corresponds to a Fortran "derived type".
97421
97422 _Examples_
97423
97424 28
97425 Example of Interfaces.Fortran:
97426
97427 29
97428 with Interfaces.Fortran;
97429 use Interfaces.Fortran;
97430 procedure Ada_Application is
97431
97432 30/3
97433 {AI05-0229-1AI05-0229-1} type Fortran_Matrix is array (Integer range <>,
97434 Integer range <>) of Double_Precision
97435 with Convention => Fortran; -- stored in Fortran's
97436 -- column-major order
97437 procedure Invert (Rank : in Fortran_Integer; X : in out Fortran_Matrix)
97438 with Import => True, Convention => Fortran; -- a Fortran subroutine
97439
97440 31
97441 Rank : constant Fortran_Integer := 100;
97442 My_Matrix : Fortran_Matrix (1 .. Rank, 1 .. Rank);
97443
97444 32
97445 begin
97446
97447 33
97448 ...
97449 My_Matrix := ...;
97450 ...
97451 Invert (Rank, My_Matrix);
97452 ...
97453
97454 34
97455 end Ada_Application;
97456
97457 \1f
97458 File: aarm2012.info, Node: Annex C, Next: Annex D, Prev: Annex B, Up: Top
97459
97460 Annex C Systems Programming
97461 ***************************
97462
97463 1
97464 [ The Systems Programming Annex specifies additional capabilities
97465 provided for low-level programming. These capabilities are also
97466 required in many real-time, embedded, distributed, and information
97467 systems.]
97468
97469 _Extensions to Ada 83_
97470
97471 1.a
97472 This Annex is new to Ada 95.
97473
97474 * Menu:
97475
97476 * C.1 :: Access to Machine Operations
97477 * C.2 :: Required Representation Support
97478 * C.3 :: Interrupt Support
97479 * C.4 :: Preelaboration Requirements
97480 * C.5 :: Pragma Discard_Names
97481 * C.6 :: Shared Variable Control
97482 * C.7 :: Task Information
97483
97484 \1f
97485 File: aarm2012.info, Node: C.1, Next: C.2, Up: Annex C
97486
97487 C.1 Access to Machine Operations
97488 ================================
97489
97490 1/3
97491 {AI05-0299-1AI05-0299-1} [This subclause specifies rules regarding
97492 access to machine instructions from within an Ada program.]
97493
97494 1.a/2
97495 Implementation defined: Implementation-defined intrinsic
97496 subprograms.
97497
97498 _Implementation Requirements_
97499
97500 2
97501 The implementation shall support machine code insertions (see *note
97502 13.8::) or intrinsic subprograms (see *note 6.3.1::) (or both).
97503 Implementation-defined attributes shall be provided to allow the use of
97504 Ada entities as operands.
97505
97506 _Implementation Advice_
97507
97508 3
97509 The machine code or intrinsics support should allow access to all
97510 operations normally available to assembly language programmers for the
97511 target environment, including privileged instructions, if any.
97512
97513 3.a.1/2
97514 Implementation Advice: The machine code or intrinsics support
97515 should allow access to all operations normally available to
97516 assembly language programmers for the target environment.
97517
97518 3.a
97519 Ramification: Of course, on a machine with protection, an
97520 attempt to execute a privileged instruction in user mode will
97521 probably trap. Nonetheless, we want implementations to
97522 provide access to them so that Ada can be used to write
97523 systems programs that run in privileged mode.
97524
97525 4/3
97526 {AI05-0229-1AI05-0229-1} The support for interfacing aspects (see *note
97527 Annex B::) should include interface to assembler; the default assembler
97528 should be associated with the convention identifier Assembler.
97529
97530 4.a/2
97531 Implementation Advice: Interface to assembler should be
97532 supported; the default assembler should be associated with the
97533 convention identifier Assembler.
97534
97535 5
97536 If an entity is exported to assembly language, then the implementation
97537 should allocate it at an addressable location, and should ensure that it
97538 is retained by the linking process, even if not otherwise referenced
97539 from the Ada code. The implementation should assume that any call to a
97540 machine code or assembler subprogram is allowed to read or update every
97541 object that is specified as exported.
97542
97543 5.a/2
97544 Implementation Advice: If an entity is exported to assembly
97545 language, then the implementation should allocate it at an
97546 addressable location even if not otherwise referenced from the
97547 Ada code. A call to a machine code or assembler subprogram
97548 should be treated as if it could read or update every object
97549 that is specified as exported.
97550
97551 _Documentation Requirements_
97552
97553 6
97554 The implementation shall document the overhead associated with calling
97555 machine-code or intrinsic subprograms, as compared to a fully-inlined
97556 call, and to a regular out-of-line call.
97557
97558 6.a/2
97559 Documentation Requirement: The overhead of calling
97560 machine-code or intrinsic subprograms.
97561
97562 7
97563 The implementation shall document the types of the package
97564 System.Machine_Code usable for machine code insertions, and the
97565 attributes to be used in machine code insertions for references to Ada
97566 entities.
97567
97568 7.a/2
97569 Documentation Requirement: The types and attributes used in
97570 machine code insertions.
97571
97572 8/3
97573 {AI05-0229-1AI05-0229-1} The implementation shall document the
97574 subprogram calling conventions associated with the convention
97575 identifiers available for use with the Convention aspect (Ada and
97576 Assembler, at a minimum), including register saving, exception
97577 propagation, parameter passing, and function value returning.
97578
97579 8.a/2
97580 Documentation Requirement: The subprogram calling conventions
97581 for all supported convention identifiers.
97582
97583 9
97584 For exported and imported subprograms, the implementation shall document
97585 the mapping between the Link_Name string, if specified, or the Ada
97586 designator, if not, and the external link name used for such a
97587 subprogram.
97588
97589 9.a/2
97590 This paragraph was deleted.
97591
97592 9.b/2
97593 Documentation Requirement: The mapping between the Link_Name
97594 or Ada designator and the external link name.
97595
97596 _Implementation Advice_
97597
97598 10
97599 The implementation should ensure that little or no overhead is
97600 associated with calling intrinsic and machine-code subprograms.
97601
97602 10.a/2
97603 Implementation Advice: Little or no overhead should be
97604 associated with calling intrinsic and machine-code
97605 subprograms.
97606
97607 11
97608 It is recommended that intrinsic subprograms be provided for convenient
97609 access to any machine operations that provide special capabilities or
97610 efficiency and that are not otherwise available through the language
97611 constructs. Examples of such instructions include:
97612
97613 12
97614 * Atomic read-modify-write operations -- e.g., test and set, compare
97615 and swap, decrement and test, enqueue/dequeue.
97616
97617 13
97618 * Standard numeric functions -- e.g., sin, log.
97619
97620 14
97621 * String manipulation operations -- e.g., translate and test.
97622
97623 15
97624 * Vector operations -- e.g., compare vector against thresholds.
97625
97626 16
97627 * Direct operations on I/O ports.
97628
97629 16.a/2
97630 Implementation Advice: Intrinsic subprograms should be
97631 provided to access any machine operations that provide special
97632 capabilities or efficiency not normally available.
97633
97634 \1f
97635 File: aarm2012.info, Node: C.2, Next: C.3, Prev: C.1, Up: Annex C
97636
97637 C.2 Required Representation Support
97638 ===================================
97639
97640 1/3
97641 {AI95-00434-01AI95-00434-01} {AI05-0299-1AI05-0299-1} This subclause
97642 specifies minimal requirements on the support for representation items
97643 and related features.
97644
97645 _Implementation Requirements_
97646
97647 2/3
97648 {AI05-0299-1AI05-0299-1} The implementation shall support at least the
97649 functionality defined by the recommended levels of support in Clause
97650 *note 13::.
97651
97652 \1f
97653 File: aarm2012.info, Node: C.3, Next: C.4, Prev: C.2, Up: Annex C
97654
97655 C.3 Interrupt Support
97656 =====================
97657
97658 1/3
97659 {AI05-0299-1AI05-0299-1} [This subclause specifies the language-defined
97660 model for hardware interrupts in addition to mechanisms for handling
97661 interrupts.]
97662
97663 _Dynamic Semantics_
97664
97665 2
97666 [An interrupt represents a class of events that are detected by the
97667 hardware or the system software.] Interrupts are said to occur. An
97668 occurrence of an interrupt is separable into generation and delivery.
97669 Generation of an interrupt is the event in the underlying hardware or
97670 system that makes the interrupt available to the program. Delivery is
97671 the action that invokes part of the program as response to the interrupt
97672 occurrence. Between generation and delivery, the interrupt occurrence
97673 [(or interrupt)] is pending. Some or all interrupts may be blocked.
97674 When an interrupt is blocked, all occurrences of that interrupt are
97675 prevented from being delivered. Certain interrupts are reserved. The
97676 set of reserved interrupts is implementation defined. A reserved
97677 interrupt is either an interrupt for which user-defined handlers are not
97678 supported, or one which already has an attached handler by some other
97679 implementation-defined means. Program units can be connected to
97680 nonreserved interrupts. While connected, the program unit is said to be
97681 attached to that interrupt. The execution of that program unit, the
97682 interrupt handler, is invoked upon delivery of the interrupt occurrence.
97683
97684 2.a/2
97685 This paragraph was deleted.
97686
97687 2.b
97688 To be honest: As an obsolescent feature, interrupts may be
97689 attached to task entries by an address clause. See *note
97690 J.7.1::.
97691
97692 3
97693 While a handler is attached to an interrupt, it is called once for each
97694 delivered occurrence of that interrupt. While the handler executes, the
97695 corresponding interrupt is blocked.
97696
97697 4
97698 While an interrupt is blocked, all occurrences of that interrupt are
97699 prevented from being delivered. Whether such occurrences remain pending
97700 or are lost is implementation defined.
97701
97702 5
97703 Each interrupt has a default treatment which determines the system's
97704 response to an occurrence of that interrupt when no user-defined handler
97705 is attached. The set of possible default treatments is implementation
97706 defined, as is the method (if one exists) for configuring the default
97707 treatments for interrupts.
97708
97709 6
97710 An interrupt is delivered to the handler (or default treatment) that is
97711 in effect for that interrupt at the time of delivery.
97712
97713 7
97714 An exception propagated from a handler that is invoked by an interrupt
97715 has no effect.
97716
97717 8
97718 [If the Ceiling_Locking policy (see *note D.3::) is in effect, the
97719 interrupt handler executes with the active priority that is the ceiling
97720 priority of the corresponding protected object.]
97721
97722 _Implementation Requirements_
97723
97724 9
97725 The implementation shall provide a mechanism to determine the minimum
97726 stack space that is needed for each interrupt handler and to reserve
97727 that space for the execution of the handler. [This space should
97728 accommodate nested invocations of the handler where the system permits
97729 this.]
97730
97731 10
97732 If the hardware or the underlying system holds pending interrupt
97733 occurrences, the implementation shall provide for later delivery of
97734 these occurrences to the program.
97735
97736 11
97737 If the Ceiling_Locking policy is not in effect, the implementation shall
97738 provide means for the application to specify whether interrupts are to
97739 be blocked during protected actions.
97740
97741 _Documentation Requirements_
97742
97743 12
97744 The implementation shall document the following items:
97745
97746 12.a
97747 Discussion: This information may be different for different
97748 forms of interrupt handlers.
97749
97750 13
97751 1. For each interrupt, which interrupts are blocked from delivery
97752 when a handler attached to that interrupt executes (either as a
97753 result of an interrupt delivery or of an ordinary call on a
97754 procedure of the corresponding protected object).
97755
97756 14
97757 2. Any interrupts that cannot be blocked, and the effect of
97758 attaching handlers to such interrupts, if this is permitted.
97759
97760 15
97761 3. Which run-time stack an interrupt handler uses when it executes
97762 as a result of an interrupt delivery; if this is configurable, what
97763 is the mechanism to do so; how to specify how much space to reserve
97764 on that stack.
97765
97766 16
97767 4. Any implementation- or hardware-specific activity that happens
97768 before a user-defined interrupt handler gets control (e.g., reading
97769 device registers, acknowledging devices).
97770
97771 17
97772 5. Any timing or other limitations imposed on the execution of
97773 interrupt handlers.
97774
97775 18
97776 6. The state (blocked/unblocked) of the nonreserved interrupts
97777 when the program starts; if some interrupts are unblocked, what is
97778 the mechanism a program can use to protect itself before it can
97779 attach the corresponding handlers.
97780
97781 19
97782 7. Whether the interrupted task is allowed to resume execution
97783 before the interrupt handler returns.
97784
97785 20
97786 8. The treatment of interrupt occurrences that are generated while
97787 the interrupt is blocked; i.e., whether one or more occurrences are
97788 held for later delivery, or all are lost.
97789
97790 21
97791 9. Whether predefined or implementation-defined exceptions are
97792 raised as a result of the occurrence of any interrupt, and the
97793 mapping between the machine interrupts (or traps) and the
97794 predefined exceptions.
97795
97796 22
97797 10. On a multi-processor, the rules governing the delivery of an
97798 interrupt to a particular processor.
97799
97800 22.a/2
97801 Documentation Requirement: The treatment of interrupts.
97802
97803 _Implementation Permissions_
97804
97805 23/2
97806 {AI95-00434-01AI95-00434-01} If the underlying system or hardware does
97807 not allow interrupts to be blocked, then no blocking is required [as
97808 part of the execution of subprograms of a protected object for which one
97809 of its subprograms is an interrupt handler].
97810
97811 24
97812 In a multi-processor with more than one interrupt subsystem, it is
97813 implementation defined whether (and how) interrupt sources from separate
97814 subsystems share the same Interrupt_Id type (see *note C.3.2::). In
97815 particular, the meaning of a blocked or pending interrupt may then be
97816 applicable to one processor only.
97817
97818 24.a
97819 Discussion: This issue is tightly related to the issue of
97820 scheduling on a multi-processor. In a sense, if a particular
97821 interrupt source is not available to all processors, the
97822 system is not truly homogeneous.
97823
97824 24.b
97825 One way to approach this problem is to assign sub-ranges
97826 within Interrupt_Id to each interrupt subsystem, such that
97827 "similar" interrupt sources (e.g. a timer) in different
97828 subsystems get a distinct id.
97829
97830 25
97831 Implementations are allowed to impose timing or other limitations on the
97832 execution of interrupt handlers.
97833
97834 25.a
97835 Reason: These limitations are often necessary to ensure proper
97836 behavior of the implementation.
97837
97838 26/3
97839 {AI95-00434-01AI95-00434-01} {AI05-0299-1AI05-0299-1} Other forms of
97840 handlers are allowed to be supported, in which case the rules of this
97841 subclause should be adhered to.
97842
97843 27
97844 The active priority of the execution of an interrupt handler is allowed
97845 to vary from one occurrence of the same interrupt to another.
97846
97847 _Implementation Advice_
97848
97849 28/2
97850 {AI95-00434-01AI95-00434-01} If the Ceiling_Locking policy is not in
97851 effect, the implementation should provide means for the application to
97852 specify which interrupts are to be blocked during protected actions, if
97853 the underlying system allows for finer-grained control of interrupt
97854 blocking.
97855
97856 28.a/2
97857 Implementation Advice: If the Ceiling_Locking policy is not in
97858 effect and the target system allows for finer-grained control
97859 of interrupt blocking, a means for the application to specify
97860 which interrupts are to be blocked during protected actions
97861 should be provided.
97862
97863 NOTES
97864
97865 29
97866 1 The default treatment for an interrupt can be to keep the
97867 interrupt pending or to deliver it to an implementation-defined
97868 handler. Examples of actions that an implementation-defined
97869 handler is allowed to perform include aborting the partition,
97870 ignoring (i.e., discarding occurrences of) the interrupt, or
97871 queuing one or more occurrences of the interrupt for possible later
97872 delivery when a user-defined handler is attached to that interrupt.
97873
97874 30
97875 2 It is a bounded error to call Task_Identification.Current_Task
97876 (see *note C.7.1::) from an interrupt handler.
97877
97878 31
97879 3 The rule that an exception propagated from an interrupt handler
97880 has no effect is modeled after the rule about exceptions propagated
97881 out of task bodies.
97882
97883 * Menu:
97884
97885 * C.3.1 :: Protected Procedure Handlers
97886 * C.3.2 :: The Package Interrupts
97887
97888 \1f
97889 File: aarm2012.info, Node: C.3.1, Next: C.3.2, Up: C.3
97890
97891 C.3.1 Protected Procedure Handlers
97892 ----------------------------------
97893
97894 Paragraphs 1 through 6 were moved to *note Annex J::, "*note Annex J::
97895 Obsolescent Features".
97896
97897 _Static Semantics_
97898
97899 6.1/3
97900 {AI05-0229-1AI05-0229-1} For a parameterless protected procedure, the
97901 following language-defined representation aspects may be specified:
97902
97903 6.2/3
97904 Interrupt_Handler
97905 The type of aspect Interrupt_Handler is Boolean. If
97906 directly specified, the aspect_definition shall be a
97907 static expression. [This aspect is never inherited;] if
97908 not directly specified, the aspect is False.
97909
97910 6.a/3
97911 Aspect Description for Interrupt_Handler: Protected procedure
97912 may be attached to interrupts.
97913
97914 6.3/3
97915 Attach_Handler
97916 The aspect Attach_Handler is an expression, which shall
97917 be of type Interrupts.Interrupt_Id. [This aspect is
97918 never inherited.]
97919
97920 6.b/3
97921 Aspect Description for Attach_Handler: Protected procedure is
97922 attached to an interrupt.
97923
97924 _Legality Rules_
97925
97926 7/3
97927 {AI95-00434-01AI95-00434-01} {AI05-0033-1AI05-0033-1}
97928 {AI05-0229-1AI05-0229-1} If either the Attach_Handler or
97929 Interrupt_Handler aspect are specified for a protected procedure, the
97930 corresponding protected_type_declaration (*note 9.4: S0210.) or
97931 single_protected_declaration (*note 9.4: S0211.) shall be a
97932 library-level declaration and shall not be declared within a generic
97933 body. In addition to the places where Legality Rules normally apply
97934 (see *note 12.3::), this rule also applies in the private part of an
97935 instance of a generic unit.
97936
97937 7.a
97938 Discussion: In the case of a protected_type_declaration, an
97939 object_declaration of an object of that type need not be at
97940 library level.
97941
97942 7.b/3
97943 {AI05-0033-1AI05-0033-1} {AI05-0229-1AI05-0229-1} We cannot
97944 allow these aspects in protected declarations in a generic
97945 body, because legality rules are not checked for instance
97946 bodies, and these should not be allowed if the instance is not
97947 at the library level. The protected types can be declared in
97948 the private part if this is desired. Note that while the
97949 'Access to use the handler would provide the check in the case
97950 of Interrupt_Handler, there is no other check for
97951 Attach_Handler. Since these aspects are so similar, we want
97952 the rules to be the same.
97953
97954 8/3
97955 This paragraph was deleted.{AI95-00253-01AI95-00253-01}
97956 {AI95-00303-01AI95-00303-01} {AI05-0033-1AI05-0033-1}
97957
97958 _Dynamic Semantics_
97959
97960 9/3
97961 {AI05-0229-1AI05-0229-1} If the Interrupt_Handler aspect of a protected
97962 procedure is True, then the procedure may be attached dynamically, as a
97963 handler, to interrupts (see *note C.3.2::). [Such procedures are
97964 allowed to be attached to multiple interrupts.]
97965
97966 10/3
97967 {AI05-0229-1AI05-0229-1} The expression specified for the Attach_Handler
97968 aspect of a protected procedure P is evaluated as part of the creation
97969 of the protected object that contains P. The value of the expression
97970 identifies an interrupt. As part of the initialization of that object,
97971 P (the handler procedure) is attached to the identified interrupt. A
97972 check is made that the corresponding interrupt is not reserved.
97973 Program_Error is raised if the check fails, and the existing treatment
97974 for the interrupt is not affected.
97975
97976 11/3
97977 {AI95-00434-01AI95-00434-01} {AI05-0229-1AI05-0229-1} If the
97978 Ceiling_Locking policy (see *note D.3::) is in effect, then upon the
97979 initialization of a protected object that contains a protected procedure
97980 for which either the Attach_Handler aspect is specified or the
97981 Interrupt_Handler aspect is True, a check is made that the initial
97982 ceiling priority of the object is in the range of
97983 System.Interrupt_Priority. If the check fails, Program_Error is raised.
97984
97985 12/3
97986 {8652/00688652/0068} {AI95-00121-01AI95-00121-01}
97987 {AI05-0229-1AI05-0229-1} When a protected object is finalized, for any
97988 of its procedures that are attached to interrupts, the handler is
97989 detached. If the handler was attached by a procedure in the Interrupts
97990 package or if no user handler was previously attached to the interrupt,
97991 the default treatment is restored. If the Attach_Handler aspect was
97992 specified and the most recently attached handler for the same interrupt
97993 is the same as the one that was attached at the time the protected
97994 object was initialized, the previous handler is restored.
97995
97996 12.a/3
97997 Discussion: {8652/00688652/0068} {AI95-00121-01AI95-00121-01}
97998 {AI95-00303-01AI95-00303-01} {AI05-0229-1AI05-0229-1} If all
97999 protected objects for interrupt handlers are declared at the
98000 library level, the finalization discussed above occurs only as
98001 part of the finalization of all library-level packages in a
98002 partition. However, objects of a protected type containing
98003 procedures with an Attach_Handler aspect specified need not be
98004 at the library level. Thus, an implementation needs to be
98005 able to restore handlers during the execution of the program.
98006 (An object with an Interrupt_Handler aspect also need not be
98007 at the library level, but such a handler cannot be attached to
98008 an interrupt using the Interrupts package.)
98009
98010 13
98011 When a handler is attached to an interrupt, the interrupt is blocked
98012 [(subject to the Implementation Permission in *note C.3::)] during the
98013 execution of every protected action on the protected object containing
98014 the handler.
98015
98016 _Erroneous Execution_
98017
98018 14
98019 If the Ceiling_Locking policy (see *note D.3::) is in effect and an
98020 interrupt is delivered to a handler, and the interrupt hardware priority
98021 is higher than the ceiling priority of the corresponding protected
98022 object, the execution of the program is erroneous.
98023
98024 14.1/3
98025 {8652/00688652/0068} {AI95-00121-01AI95-00121-01}
98026 {AI05-0229-1AI05-0229-1} If the handlers for a given interrupt attached
98027 via aspect Attach_Handler are not attached and detached in a stack-like
98028 (LIFO) order, program execution is erroneous. In particular, when a
98029 protected object is finalized, the execution is erroneous if any of the
98030 procedures of the protected object are attached to interrupts via aspect
98031 Attach_Handler and the most recently attached handler for the same
98032 interrupt is not the same as the one that was attached at the time the
98033 protected object was initialized.
98034
98035 14.a/3
98036 Discussion: {8652/00688652/0068} {AI95-00121-01AI95-00121-01}
98037 {AI05-0229-1AI05-0229-1} This simplifies implementation of the
98038 Attach_Handler aspect by not requiring a check that the
98039 current handler is the same as the one attached by the
98040 initialization of a protected object.
98041
98042 _Metrics_
98043
98044 15
98045 The following metric shall be documented by the implementation:
98046
98047 16/2
98048 * {AI95-00434-01AI95-00434-01} The worst-case overhead for an
98049 interrupt handler that is a parameterless protected procedure, in
98050 clock cycles. This is the execution time not directly attributable
98051 to the handler procedure or the interrupted execution. It is
98052 estimated as C - (A+B), where A is how long it takes to complete a
98053 given sequence of instructions without any interrupt, B is how long
98054 it takes to complete a normal call to a given protected procedure,
98055 and C is how long it takes to complete the same sequence of
98056 instructions when it is interrupted by one execution of the same
98057 procedure called via an interrupt.
98058
98059 16.a
98060 Implementation Note: The instruction sequence and interrupt
98061 handler used to measure interrupt handling overhead should be
98062 chosen so as to maximize the execution time cost due to cache
98063 misses. For example, if the processor has cache memory and
98064 the activity of an interrupt handler could invalidate the
98065 contents of cache memory, the handler should be written such
98066 that it invalidates all of the cache memory.
98067
98068 16.b/2
98069 Documentation Requirement: The metrics for interrupt handlers.
98070
98071 _Implementation Permissions_
98072
98073 17/3
98074 {AI05-0229-1AI05-0229-1} When the aspects Attach_Handler or
98075 Interrupt_Handler are specified for a protected procedure, the
98076 implementation is allowed to impose implementation-defined restrictions
98077 on the corresponding protected_type_declaration (*note 9.4: S0210.) and
98078 protected_body (*note 9.4: S0215.).
98079
98080 17.a
98081 Ramification: The restrictions may be on the constructs that
98082 are allowed within them, and on ordinary calls (i.e. not via
98083 interrupts) on protected operations in these protected
98084 objects.
98085
98086 17.b/3
98087 Implementation defined: Any restrictions on a protected
98088 procedure or its containing type when an aspect Attach_handler
98089 or Interrupt_Handler is specified.
98090
98091 18
98092 An implementation may use a different mechanism for invoking a protected
98093 procedure in response to a hardware interrupt than is used for a call to
98094 that protected procedure from a task.
98095
98096 18.a
98097 Discussion: This is despite the fact that the priority of an
98098 interrupt handler (see *note D.1::) is modeled after a
98099 hardware task calling the handler.
98100
98101 19/3
98102 {AI05-0229-1AI05-0229-1} Notwithstanding what this subclause says
98103 elsewhere, the Attach_Handler and Interrupt_Handler aspects are allowed
98104 to be used for other, implementation defined, forms of interrupt
98105 handlers.
98106
98107 19.a/3
98108 Ramification: {AI05-0229-1AI05-0229-1} For example, if an
98109 implementation wishes to allow interrupt handlers to have
98110 parameters, it is allowed to do so via these aspects; it need
98111 not invent implementation-defined aspects for the purpose.
98112
98113 19.b/3
98114 Implementation defined: Any other forms of interrupt handler
98115 supported by the Attach_Handler and Interrupt_Handler aspects.
98116
98117 _Implementation Advice_
98118
98119 20
98120 Whenever possible, the implementation should allow interrupt handlers to
98121 be called directly by the hardware.
98122
98123 20.a/2
98124 Implementation Advice: Interrupt handlers should be called
98125 directly by the hardware.
98126
98127 21
98128 Whenever practical, the implementation should detect violations of any
98129 implementation-defined restrictions before run time.
98130
98131 21.a/2
98132 Implementation Advice: Violations of any
98133 implementation-defined restrictions on interrupt handlers
98134 should be detected before run time.
98135
98136 NOTES
98137
98138 22/3
98139 4 {AI05-0229-1AI05-0229-1} The Attach_Handler aspect may provide
98140 static attachment of handlers to interrupts if the implementation
98141 supports preelaboration of protected objects. (See *note C.4::.)
98142
98143 23/2
98144 5 {AI95-00434-01AI95-00434-01} A protected object that has a
98145 (protected) procedure attached to an interrupt should have a
98146 ceiling priority at least as high as the highest processor priority
98147 at which that interrupt will ever be delivered.
98148
98149 24
98150 6 Protected procedures can also be attached dynamically to
98151 interrupts via operations declared in the predefined package
98152 Interrupts.
98153
98154 25
98155 7 An example of a possible implementation-defined restriction is
98156 disallowing the use of the standard storage pools within the body
98157 of a protected procedure that is an interrupt handler.
98158
98159 _Incompatibilities With Ada 95_
98160
98161 25.a/2
98162 {AI95-00253-01AI95-00253-01} Amendment Correction: Corrected
98163 the wording so that the rules for the use of Attach_Handler
98164 and Interrupt_Handler are identical. This means that uses of
98165 pragma Interrupt_Handler outside of the target protected type
98166 or single protected object are now illegal.
98167
98168 _Wording Changes from Ada 95_
98169
98170 25.b/2
98171 {8652/00688652/0068} {AI95-00121-01AI95-00121-01} Corrigendum:
98172 Clarified the meaning of "the previous handler" when
98173 finalizing protected objects containing interrupt handlers.
98174
98175 25.c/2
98176 {AI95-00303-01AI95-00303-01} Dropped the requirement that an
98177 object of a type containing an Interrupt_Handler pragma must
98178 be declared at the library level. This was a generic contract
98179 model violation. This change is not an extension, as an
98180 attempt to attach such a handler with a routine in package
98181 Interrupts will fail an accessibility check anyway. Moreover,
98182 implementations can retain the rule as an
98183 implementation-defined restriction on the use of the type, as
98184 permitted by the Implementation Permissions above.
98185
98186 _Extensions to Ada 2005_
98187
98188 25.d/3
98189 {AI05-0229-1AI05-0229-1} Aspects Interrupt_Handler and
98190 Attach_Handler are new; pragmas Interrupt_Handler and
98191 Attach_Handler are now obsolescent.
98192
98193 _Wording Changes from Ada 2005_
98194
98195 25.e/3
98196 {AI05-0033-1AI05-0033-1} Correction: Added missing generic
98197 contract wording for the aspects Attach_Handler and
98198 Interrupt_Handler.
98199
98200 \1f
98201 File: aarm2012.info, Node: C.3.2, Prev: C.3.1, Up: C.3
98202
98203 C.3.2 The Package Interrupts
98204 ----------------------------
98205
98206 _Static Semantics_
98207
98208 1
98209 The following language-defined packages exist:
98210
98211 2/3
98212 {AI05-0167-1AI05-0167-1} with System;
98213 with System.Multiprocessors;
98214 package Ada.Interrupts is
98215 type Interrupt_Id is implementation-defined;
98216 type Parameterless_Handler is
98217 access protected procedure;
98218
98219 3/1
98220 This paragraph was deleted.
98221
98222 4
98223 function Is_Reserved (Interrupt : Interrupt_Id)
98224 return Boolean;
98225
98226 5
98227 function Is_Attached (Interrupt : Interrupt_Id)
98228 return Boolean;
98229
98230 6
98231 function Current_Handler (Interrupt : Interrupt_Id)
98232 return Parameterless_Handler;
98233
98234 7
98235 procedure Attach_Handler
98236 (New_Handler : in Parameterless_Handler;
98237 Interrupt : in Interrupt_Id);
98238
98239 8
98240 procedure Exchange_Handler
98241 (Old_Handler : out Parameterless_Handler;
98242 New_Handler : in Parameterless_Handler;
98243 Interrupt : in Interrupt_Id);
98244
98245 9
98246 procedure Detach_Handler
98247 (Interrupt : in Interrupt_Id);
98248
98249 10
98250 function Reference (Interrupt : Interrupt_Id)
98251 return System.Address;
98252
98253 10.1/3
98254 {AI05-0167-1AI05-0167-1} function Get_CPU (Interrupt : Interrupt_Id)
98255 return System.Multiprocessors.CPU_Range;
98256
98257 11
98258 private
98259 ... -- not specified by the language
98260 end Ada.Interrupts;
98261
98262 12
98263 package Ada.Interrupts.Names is
98264 implementation-defined : constant Interrupt_Id :=
98265 implementation-defined;
98266 . . .
98267 implementation-defined : constant Interrupt_Id :=
98268 implementation-defined;
98269 end Ada.Interrupts.Names;
98270
98271 _Dynamic Semantics_
98272
98273 13
98274 The Interrupt_Id type is an implementation-defined discrete type used to
98275 identify interrupts.
98276
98277 14
98278 The Is_Reserved function returns True if and only if the specified
98279 interrupt is reserved.
98280
98281 15
98282 The Is_Attached function returns True if and only if a user-specified
98283 interrupt handler is attached to the interrupt.
98284
98285 16/1
98286 {8652/00698652/0069} {AI95-00166-01AI95-00166-01} The Current_Handler
98287 function returns a value that represents the attached handler of the
98288 interrupt. If no user-defined handler is attached to the interrupt,
98289 Current_Handler returns null.
98290
98291 17/3
98292 {AI05-0229-1AI05-0229-1} The Attach_Handler procedure attaches the
98293 specified handler to the interrupt, overriding any existing treatment
98294 (including a user handler) in effect for that interrupt. If New_Handler
98295 is null, the default treatment is restored. If New_Handler designates a
98296 protected procedure for which the aspect Interrupt_Handler is False,
98297 Program_Error is raised. In this case, the operation does not modify
98298 the existing interrupt treatment.
98299
98300 18/1
98301 {8652/00698652/0069} {AI95-00166-01AI95-00166-01} The Exchange_Handler
98302 procedure operates in the same manner as Attach_Handler with the
98303 addition that the value returned in Old_Handler designates the previous
98304 treatment for the specified interrupt. If the previous treatment is not
98305 a user-defined handler, null is returned.
98306
98307 18.a
98308 Ramification: Calling Attach_Handler or Exchange_Handler with
98309 this value for New_Handler restores the previous handler.
98310
98311 18.a.1/1
98312 {8652/00698652/0069} {AI95-00166-01AI95-00166-01} If the
98313 application uses only parameterless procedures as handlers
98314 (other types of handlers may be provided by the
98315 implementation, but are not required by the standard), then if
98316 Old_Handler is not null, it may be called to execute the
98317 previous handler. This provides a way to cascade application
98318 interrupt handlers. However, the default handler cannot be
98319 cascaded this way (Old_Handler must be null for the default
98320 handler).
98321
98322 19
98323 The Detach_Handler procedure restores the default treatment for the
98324 specified interrupt.
98325
98326 20
98327 For all operations defined in this package that take a parameter of type
98328 Interrupt_Id, with the exception of Is_Reserved and Reference, a check
98329 is made that the specified interrupt is not reserved. Program_Error is
98330 raised if this check fails.
98331
98332 21/3
98333 {AI05-0229-1AI05-0229-1} If, by using the Attach_Handler,
98334 Detach_Handler, or Exchange_Handler procedures, an attempt is made to
98335 detach a handler that was attached statically (using the aspect
98336 Attach_Handler), the handler is not detached and Program_Error is
98337 raised.
98338
98339 22/2
98340 {AI95-00434-01AI95-00434-01} The Reference function returns a value of
98341 type System.Address that can be used to attach a task entry via an
98342 address clause (see *note J.7.1::) to the interrupt specified by
98343 Interrupt. This function raises Program_Error if attaching task entries
98344 to interrupts (or to this particular interrupt) is not supported.
98345
98346 22.1/3
98347 {AI05-0153-3AI05-0153-3} The function Get_CPU returns the processor on
98348 which the handler for Interrupt is executed. If the handler can execute
98349 on more than one processor the value
98350 System.Multiprocessors.Not_A_Specific_CPU is returned.
98351
98352 _Implementation Requirements_
98353
98354 23
98355 At no time during attachment or exchange of handlers shall the current
98356 handler of the corresponding interrupt be undefined.
98357
98358 _Documentation Requirements_
98359
98360 24/3
98361 {AI95-00434-01AI95-00434-01} {AI05-0229-1AI05-0229-1} If the
98362 Ceiling_Locking policy (see *note D.3::) is in effect, the
98363 implementation shall document the default ceiling priority assigned to a
98364 protected object that contains a protected procedure that specifies
98365 either the Attach_Handler or Interrupt_Handler aspects, but does not
98366 specify the Interrupt_Priority aspect. [This default need not be the
98367 same for all interrupts.]
98368
98369 24.a.1/3
98370 Documentation Requirement: If the Ceiling_Locking policy is in
98371 effect, the default ceiling priority for a protected object
98372 that specifies an interrupt handler aspect.
98373
98374 _Implementation Advice_
98375
98376 25
98377 If implementation-defined forms of interrupt handler procedures are
98378 supported, such as protected procedures with parameters, then for each
98379 such form of a handler, a type analogous to Parameterless_Handler should
98380 be specified in a child package of Interrupts, with the same operations
98381 as in the predefined package Interrupts.
98382
98383 25.a/2
98384 Implementation Advice: If implementation-defined forms of
98385 interrupt handler procedures are supported, then for each such
98386 form of a handler, a type analogous to Parameterless_Handler
98387 should be specified in a child package of Interrupts, with the
98388 same operations as in the predefined package Interrupts.
98389
98390 NOTES
98391
98392 26
98393 8 The package Interrupts.Names contains implementation-defined
98394 names (and constant values) for the interrupts that are supported
98395 by the implementation.
98396
98397 _Examples_
98398
98399 27
98400 Example of interrupt handlers:
98401
98402 28/3
98403 {AI05-0229-1AI05-0229-1} Device_Priority : constant
98404 array (1..5) of System.Interrupt_Priority := ( ... );
98405 protected type Device_Interface
98406 (Int_Id : Ada.Interrupts.Interrupt_Id)
98407 with Interrupt_Priority => Device_Priority(Int_Id) is
98408 procedure Handler
98409 with Attach_Handler => Int_Id;
98410 ...
98411 end Device_Interface;
98412 ...
98413 Device_1_Driver : Device_Interface(1);
98414 ...
98415 Device_5_Driver : Device_Interface(5);
98416 ...
98417
98418 _Wording Changes from Ada 95_
98419
98420 28.a/2
98421 {8652/00698652/0069} {AI95-00166-01AI95-00166-01} Corrigendum:
98422 Clarified that the value returned by Current_Handler and
98423 Exchange_Handler for the default treatment is null.
98424
98425 _Incompatibilities With Ada 2005_
98426
98427 28.b/3
98428 {AI05-0167-1AI05-0167-1} Functions Get_CPU is added to
98429 Interrupts. If Interrupts is referenced in a use_clause, and
98430 an entity E with a defining_identifier of Get_CPU is defined
98431 in a package that is also referenced in a use_clause, the
98432 entity E may no longer be use-visible, resulting in errors.
98433 This should be rare and is easily fixed if it does occur.
98434
98435 \1f
98436 File: aarm2012.info, Node: C.4, Next: C.5, Prev: C.3, Up: Annex C
98437
98438 C.4 Preelaboration Requirements
98439 ===============================
98440
98441 1/3
98442 {AI05-0299-1AI05-0299-1} [This subclause specifies additional
98443 implementation and documentation requirements for the Preelaborate
98444 pragma (see *note 10.2.1::).]
98445
98446 _Implementation Requirements_
98447
98448 2
98449 The implementation shall not incur any run-time overhead for the
98450 elaboration checks of subprograms and protected_bodies declared in
98451 preelaborated library units.
98452
98453 3
98454 The implementation shall not execute any memory write operations after
98455 load time for the elaboration of constant objects declared immediately
98456 within the declarative region of a preelaborated library package, so
98457 long as the subtype and initial expression (or default initial
98458 expressions if initialized by default) of the object_declaration satisfy
98459 the following restrictions. The meaning of load time is implementation
98460 defined.
98461
98462 3.a
98463 Discussion: On systems where the image of the partition is
98464 initially copied from disk to RAM, or from ROM to RAM, prior
98465 to starting execution of the partition, the intention is that
98466 "load time" consist of this initial copying step. On other
98467 systems, load time and run time might actually be
98468 interspersed.
98469
98470 4
98471 * Any subtype_mark denotes a statically constrained subtype, with
98472 statically constrained subcomponents, if any;
98473
98474 4.1/2
98475 * {AI95-00161-01AI95-00161-01} no subtype_mark denotes a controlled
98476 type, a private type, a private extension, a generic formal private
98477 type, a generic formal derived type, or a descendant of such a
98478 type;
98479
98480 4.a.1/2
98481 Reason: For an implementation that uses the registration
98482 method of finalization, a controlled object will require some
98483 code executed to register the object at the appropriate point.
98484 The other types are those that might have a controlled
98485 component. None of these types were allowed in preelaborated
98486 units in Ada 95. These types are covered by the
98487 Implementation Advice, of course, so they should still execute
98488 as little code as possible.
98489
98490 5
98491 * any constraint is a static constraint;
98492
98493 6
98494 * any allocator is for an access-to-constant type;
98495
98496 7
98497 * any uses of predefined operators appear only within static
98498 expressions;
98499
98500 8
98501 * any primaries that are names, other than attribute_references for
98502 the Access or Address attributes, appear only within static
98503 expressions;
98504
98505 8.a
98506 Ramification: This cuts out attribute_references that are not
98507 static, except for Access and Address.
98508
98509 9
98510 * any name that is not part of a static expression is an expanded
98511 name or direct_name that statically denotes some entity;
98512
98513 9.a
98514 Ramification: This cuts out function_calls and
98515 type_conversions that are not static, including calls on
98516 attribute functions like 'Image and 'Value.
98517
98518 10
98519 * any discrete_choice of an array_aggregate is static;
98520
98521 11
98522 * no language-defined check associated with the elaboration of the
98523 object_declaration can fail.
98524
98525 11.a/2
98526 Reason: {AI95-00114-01AI95-00114-01} The intent is that
98527 aggregates all of whose scalar subcomponents are static and
98528 all of whose access subcomponents are null, allocators for
98529 access-to-constant types, or X'Access, will be supported with
98530 no run-time code generated.
98531
98532 _Documentation Requirements_
98533
98534 12
98535 The implementation shall document any circumstances under which the
98536 elaboration of a preelaborated package causes code to be executed at run
98537 time.
98538
98539 12.a/2
98540 Documentation Requirement: Any circumstances when the
98541 elaboration of a preelaborated package causes code to be
98542 executed.
98543
98544 13
98545 The implementation shall document whether the method used for
98546 initialization of preelaborated variables allows a partition to be
98547 restarted without reloading.
98548
98549 13.a.1/2
98550 Documentation Requirement: Whether a partition can be
98551 restarted without reloading.
98552
98553 13.a/2
98554 This paragraph was deleted.
98555
98556 13.b/2
98557 Discussion: {AI95-00114-01AI95-00114-01} This covers the issue
98558 of the run-time system itself being restartable, so that need
98559 not be a separate Documentation Requirement.
98560
98561 _Implementation Advice_
98562
98563 14
98564 It is recommended that preelaborated packages be implemented in such a
98565 way that there should be little or no code executed at run time for the
98566 elaboration of entities not already covered by the Implementation
98567 Requirements.
98568
98569 14.a/2
98570 Implementation Advice: Preelaborated packages should be
98571 implemented such that little or no code is executed at run
98572 time for the elaboration of entities.
98573
98574 _Wording Changes from Ada 95_
98575
98576 14.b/2
98577 {AI95-00161-01AI95-00161-01} Added wording to exclude the
98578 additional kinds of types allowed in preelaborated units from
98579 the Implementation Requirements.
98580
98581 \1f
98582 File: aarm2012.info, Node: C.5, Next: C.6, Prev: C.4, Up: Annex C
98583
98584 C.5 Pragma Discard_Names
98585 ========================
98586
98587 1
98588 [A pragma Discard_Names may be used to request a reduction in storage
98589 used for the names of certain entities.]
98590
98591 _Syntax_
98592
98593 2
98594 The form of a pragma Discard_Names is as follows:
98595
98596 3
98597 pragma Discard_Names[([On => ] local_name)];
98598
98599 4
98600 A pragma Discard_Names is allowed only immediately within a
98601 declarative_part, immediately within a package_specification, or as
98602 a configuration pragma.
98603
98604 _Legality Rules_
98605
98606 5
98607 The local_name (if present) shall denote a nonderived enumeration
98608 [first] subtype, a tagged [first] subtype, or an exception. The pragma
98609 applies to the type or exception. Without a local_name, the pragma
98610 applies to all such entities declared after the pragma, within the same
98611 declarative region. Alternatively, the pragma can be used as a
98612 configuration pragma. If the pragma applies to a type, then it applies
98613 also to all descendants of the type.
98614
98615 _Static Semantics_
98616
98617 6
98618 If a local_name is given, then a pragma Discard_Names is a
98619 representation pragma.
98620
98621 6.a/3
98622 Ramification: {AI05-0229-1AI05-0229-1} Representation pragmas
98623 automatically specify aspects of the same name, so
98624 Discard_Names can be used as an aspect_mark in an
98625 aspect_specification instead of using the pragma on individual
98626 entities.
98627
98628 7/2
98629 {AI95-00285-01AI95-00285-01} {AI95-00400-01AI95-00400-01} If the pragma
98630 applies to an enumeration type, then the semantics of the
98631 Wide_Wide_Image and Wide_Wide_Value attributes are implementation
98632 defined for that type[; the semantics of Image, Wide_Image, Value, and
98633 Wide_Value are still defined in terms of Wide_Wide_Image and
98634 Wide_Wide_Value]. In addition, the semantics of Text_IO.Enumeration_IO
98635 are implementation defined. If the pragma applies to a tagged type,
98636 then the semantics of the Tags.Wide_Wide_Expanded_Name function are
98637 implementation defined for that type[; the semantics of
98638 Tags.Expanded_Name and Tags.Wide_Expanded_Name are still defined in
98639 terms of Tags.Wide_Wide_Expanded_Name]. If the pragma applies to an
98640 exception, then the semantics of the Exceptions.Wide_Wide_Exception_Name
98641 function are implementation defined for that exception[; the semantics
98642 of Exceptions.Exception_Name and Exceptions.Wide_Exception_Name are
98643 still defined in terms of Exceptions.Wide_Wide_Exception_Name].
98644
98645 7.a
98646 Implementation defined: The semantics of pragma Discard_Names.
98647
98648 7.b
98649 Ramification: The Width attribute is still defined in terms of
98650 Image.
98651
98652 7.c/2
98653 {AI95-00285-01AI95-00285-01} The semantics of
98654 S'Wide_Wide_Image and S'Wide_Wide_Value are implementation
98655 defined for any subtype of an enumeration type to which the
98656 pragma applies. (The pragma actually names the first subtype,
98657 of course.)
98658
98659 _Implementation Advice_
98660
98661 8
98662 If the pragma applies to an entity, then the implementation should
98663 reduce the amount of storage used for storing names associated with that
98664 entity.
98665
98666 8.a/2
98667 Implementation Advice: If pragma Discard_Names applies to an
98668 entity, then the amount of storage used for storing names
98669 associated with that entity should be reduced.
98670
98671 8.b
98672 Reason: A typical implementation of the Image attribute for
98673 enumeration types is to store a table containing the names of
98674 all the enumeration literals. Pragma Discard_Names allows the
98675 implementation to avoid storing such a table without having to
98676 prove that the Image attribute is never used (which can be
98677 difficult in the presence of separate compilation).
98678
98679 8.c
98680 We did not specify the semantics of the Image attribute in the
98681 presence of this pragma because different semantics might be
98682 desirable in different situations. In some cases, it might
98683 make sense to use the Image attribute to print out a useful
98684 value that can be used to identify the entity given
98685 information in compiler-generated listings. In other cases,
98686 it might make sense to get an error at compile time or at run
98687 time. In cases where memory is plentiful, the simplest
98688 implementation makes sense: ignore the pragma.
98689 Implementations that are capable of avoiding the extra storage
98690 in cases where the Image attribute is never used might also
98691 wish to ignore the pragma.
98692
98693 8.d
98694 The same applies to the Tags.Expanded_Name and
98695 Exceptions.Exception_Name functions.
98696
98697 _Wording Changes from Ada 95_
98698
98699 8.e/2
98700 {AI95-00285-01AI95-00285-01} {AI95-00400-01AI95-00400-01}
98701 Updated the wording to reflect that the double wide image and
98702 value functions are now the master versions that the others
98703 are defined from.
98704
98705 \1f
98706 File: aarm2012.info, Node: C.6, Next: C.7, Prev: C.5, Up: Annex C
98707
98708 C.6 Shared Variable Control
98709 ===========================
98710
98711 1/3
98712 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} [This subclause
98713 defines representation aspects that control the use of shared
98714 variables.]
98715
98716 Paragraphs 2 through 6 were moved to *note Annex J::, "*note Annex J::
98717 Obsolescent Features".
98718
98719 _Static Semantics_
98720
98721 6.1/3
98722 {AI05-0229-1AI05-0229-1} For an object_declaration, a
98723 component_declaration, or a full_type_declaration, the following
98724 representation aspects may be specified:
98725
98726 6.2/3
98727 Atomic
98728 The type of aspect Atomic is Boolean.
98729
98730 6.a/3
98731 Aspect Description for Atomic: Declare that a type, object, or
98732 component is atomic.
98733
98734 6.3/3
98735 Independent
98736 The type of aspect Independent is Boolean.
98737
98738 6.b/3
98739 Aspect Description for Independent: Declare that a type,
98740 object, or component is independently addressable.
98741
98742 6.4/3
98743 Volatile
98744 The type of aspect Volatile is Boolean.
98745
98746 6.c/3
98747 Aspect Description for Volatile: Declare that a type, object,
98748 or component is volatile.
98749
98750 6.5/3
98751 {AI05-0229-1AI05-0229-1} For a full_type_declaration of an array type
98752 (including the anonymous type of an object_declaration of an anonymous
98753 array object), the following representation aspects may be specified:
98754
98755 6.6/3
98756 Atomic_Components
98757 The type of aspect Atomic_Components is Boolean.
98758
98759 6.d/3
98760 Aspect Description for Atomic_Components: Declare that the
98761 components of an array type or object are atomic.
98762
98763 6.7/3
98764 Volatile_Components
98765 The type of aspect Volatile_Components is Boolean.
98766
98767 6.e/3
98768 Aspect Description for Volatile_Components: Declare that the
98769 components of an array type or object are volatile.
98770
98771 6.8/3
98772 {AI05-0229-1AI05-0229-1} For a full_type_declaration (including the
98773 anonymous type of an object_declaration of an anonymous array object),
98774 the following representation aspect may be specified:
98775
98776 6.9/3
98777 Independent_Components
98778 The type of aspect Independent_Components is Boolean.
98779
98780 6.f/3
98781 Aspect Description for Independent_Components: Declare that
98782 the components of an array or record type, or an array object,
98783 are independently addressable.
98784
98785 6.10/3
98786 {AI05-0229-1AI05-0229-1} If any of these aspects are directly specified,
98787 the aspect_definition shall be a static expression. If not specified
98788 (including by inheritance), each of these aspects is False.
98789
98790 7/3
98791 {AI95-00272-01AI95-00272-01} {AI05-0229-1AI05-0229-1} An atomic type is
98792 one for which the aspect Atomic is True. An atomic object (including a
98793 component) is one for which the aspect Atomic is True, or a component of
98794 an array for which the aspect Atomic_Components is True for the
98795 associated type, or any object of an atomic type, other than objects
98796 obtained by evaluating a slice.
98797
98798 7.a/2
98799 Ramification: {AI95-00272-01AI95-00272-01} A slice of an
98800 atomic array object is not itself atomic. That's necessary as
98801 executing a read or write of a dynamic number of components in
98802 a single instruction is not possible on many targets.
98803
98804 8/3
98805 {AI05-0229-1AI05-0229-1} A volatile type is one for which the aspect
98806 Volatile is True. A volatile object (including a component) is one for
98807 which the aspect Volatile is True, or a component of an array for which
98808 the aspect Volatile_Components is True for the associated type, or any
98809 object of a volatile type. In addition, every atomic type or object is
98810 also defined to be volatile. Finally, if an object is volatile, then so
98811 are all of its subcomponents [(the same does not apply to atomic)].
98812
98813 8.1/3
98814 {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1} When True, the aspects
98815 Independent and Independent_Components specify as independently
98816 addressable the named object or component(s), or in the case of a type,
98817 all objects or components of that type. All atomic objects are
98818 considered to be specified as independently addressable.
98819
98820 8.a/3
98821 Ramification: If the compiler cannot guarantee that an object
98822 (including a component) for which aspect Independent or aspect
98823 Independent_Components is True is independently addressable
98824 from any other nonoverlapping object, then the aspect
98825 specification must be rejected.
98826
98827 8.b/3
98828 Similarly, an atomic object (including atomic components) is
98829 always independently addressable from any other nonoverlapping
98830 object. Any representation item which would prevent this from
98831 being true should be rejected, notwithstanding what this
98832 Standard says elsewhere (specifically, in the Recommended
98833 Level of Support).
98834
98835 Paragraph 9 was moved to *note Annex J::, "*note Annex J:: Obsolescent
98836 Features".
98837
98838 _Legality Rules_
98839
98840 9.1/3
98841 {AI05-0229-1AI05-0229-1} If aspect Independent_Components is specified
98842 for a full_type_declaration, the declaration shall be that of an array
98843 or record type.
98844
98845 10/3
98846 {AI05-0229-1AI05-0229-1} It is illegal to specify either of the aspects
98847 Atomic or Atomic_Components to have the value True for an object or type
98848 if the implementation cannot support the indivisible reads and updates
98849 required by the aspect (see below).
98850
98851 11
98852 It is illegal to specify the Size attribute of an atomic object, the
98853 Component_Size attribute for an array type with atomic components, or
98854 the layout attributes of an atomic component, in a way that prevents the
98855 implementation from performing the required indivisible reads and
98856 updates.
98857
98858 12/3
98859 {AI05-0142-4AI05-0142-4} {AI05-0218-1AI05-0218-1} If an atomic object is
98860 passed as a parameter, then the formal parameter shall either have an
98861 atomic type or allow pass by copy. If an atomic object is used as an
98862 actual for a generic formal object of mode in out, then the type of the
98863 generic formal object shall be atomic. If the prefix of an
98864 attribute_reference for an Access attribute denotes an atomic object
98865 [(including a component)], then the designated type of the resulting
98866 access type shall be atomic. If an atomic type is used as an actual for
98867 a generic formal derived type, then the ancestor of the formal type
98868 shall be atomic. Corresponding rules apply to volatile objects and
98869 types.
98870
98871 12.a/3
98872 Ramification: {AI05-0142-4AI05-0142-4} A formal parameter
98873 allows pass by copy if it is not aliased and it is of a type
98874 that allows pass by copy (that is, is not a by-reference
98875 type).
98876
98877 12.1/3
98878 {AI05-0218-1AI05-0218-1} If a volatile type is used as an actual for a
98879 generic formal array type, then the element type of the formal type
98880 shall be volatile.
98881
98882 13/3
98883 {AI05-0229-1AI05-0229-1} If an aspect Volatile, Volatile_Components,
98884 Atomic, or Atomic_Components is directly specified to have the value
98885 True for a stand-alone constant object, then the aspect Import shall
98886 also be specified as True for it.
98887
98888 13.a
98889 Ramification: Hence, no initialization expression is allowed
98890 for such a constant. Note that a constant that is atomic or
98891 volatile because of its type is allowed.
98892
98893 13.b
98894 Reason: Stand-alone constants that are explicitly specified as
98895 Atomic or Volatile only make sense if they are being
98896 manipulated outside the Ada program. From the Ada perspective
98897 the object is read-only. Nevertheless, if imported and atomic
98898 or volatile, the implementation should presume it might be
98899 altered externally. For an imported stand-alone constant that
98900 is not atomic or volatile, the implementation can assume that
98901 it will not be altered.
98902
98903 13.c/3
98904 To be honest: {AI05-0218-1AI05-0218-1} Volatile_Components and
98905 Atomic_Components actually are aspects of the anonymous array
98906 type; this rule only applies when the aspect is specified
98907 directly on the constant object and not when the (named) array
98908 type has the aspect.
98909
98910 13.1/3
98911 {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1} It is illegal to
98912 specify the aspect Independent or Independent_Components as True for a
98913 component, object or type if the implementation cannot provide the
98914 independent addressability required by the aspect (see *note 9.10::).
98915
98916 13.2/3
98917 {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1} It is illegal to
98918 specify a representation aspect for a component, object or type for
98919 which the aspect Independent or Independent_Components is True, in a way
98920 that prevents the implementation from providing the independent
98921 addressability required by the aspect.
98922
98923 Paragraph 14 was moved to *note Annex J::, "*note Annex J:: Obsolescent
98924 Features".
98925
98926 _Dynamic Semantics_
98927
98928 15
98929 For an atomic object (including an atomic component) all reads and
98930 updates of the object as a whole are indivisible.
98931
98932 16/3
98933 {AI05-0117-1AI05-0117-1} {AI05-0275-1AI05-0275-1} All tasks of the
98934 program (on all processors) that read or update volatile variables see
98935 the same order of updates to the variables. A use of an atomic variable
98936 or other mechanism may be necessary to avoid erroneous execution and to
98937 ensure that access to nonatomic volatile variables is sequential (see
98938 *note 9.10::).
98939
98940 16.a/3
98941 Implementation Note: {AI05-0117-1AI05-0117-1}
98942 {AI05-0275-1AI05-0275-1} To ensure this, on a multiprocessor,
98943 any read or update of an atomic object may require the use of
98944 an appropriate memory barrier.
98945
98946 16.b/3
98947 Discussion: {AI05-0275-1AI05-0275-1} From *note 9.10:: it
98948 follows that (in non-erroneous programs) accesses to
98949 variables, including those shared by multiple tasks, are
98950 always sequential. This guarantees that no task will ever see
98951 partial updates of any variable. For volatile variables
98952 (including atomic variables), the above rule additionally
98953 specifies that all tasks see the same order of updates.
98954
98955 16.c/3
98956 {AI05-0275-1AI05-0275-1} If for a shared variable X, a read of
98957 X occurs sequentially after an update of X, then the read will
98958 return the updated value if X is volatile or atomic, but may
98959 or or may not return the updated value if X is nonvolatile.
98960 For nonvolatile accesses, a signaling action is needed in
98961 order to share the updated value.
98962
98963 16.d/3
98964 {AI05-0275-1AI05-0275-1} Because accesses to the same atomic
98965 variable by different tasks establish a sequential order
98966 between the actions of those tasks, implementations may be
98967 required to emit memory barriers around such updates or use
98968 atomic instructions that imply such barriers.
98969
98970 17
98971 Two actions are sequential (see *note 9.10::) if each is the read or
98972 update of the same atomic object.
98973
98974 18
98975 If a type is atomic or volatile and it is not a by-copy type, then the
98976 type is defined to be a by-reference type. If any subcomponent of a
98977 type is atomic or volatile, then the type is defined to be a
98978 by-reference type.
98979
98980 19
98981 If an actual parameter is atomic or volatile, and the corresponding
98982 formal parameter is not, then the parameter is passed by copy.
98983
98984 19.a
98985 Implementation Note: Note that in the case where such a
98986 parameter is normally passed by reference, a copy of the
98987 actual will have to be produced at the call-site, and a
98988 pointer to the copy passed to the formal parameter. If the
98989 actual is atomic, any copying has to use indivisible read on
98990 the way in, and indivisible write on the way out.
98991
98992 19.b
98993 Reason: It has to be known at compile time whether an atomic
98994 or a volatile parameter is to be passed by copy or by
98995 reference. For some types, it is unspecified whether
98996 parameters are passed by copy or by reference. The above
98997 rules further specify the parameter passing rules involving
98998 atomic and volatile types and objects.
98999
99000 _Implementation Requirements_
99001
99002 20
99003 The external effect of a program (see *note 1.1.3::) is defined to
99004 include each read and update of a volatile or atomic object. The
99005 implementation shall not generate any memory reads or updates of atomic
99006 or volatile objects other than those specified by the program.
99007
99008 20.a
99009 Discussion: The presumption is that volatile or atomic objects
99010 might reside in an "active" part of the address space where
99011 each read has a potential side effect, and at the very least
99012 might deliver a different value.
99013
99014 20.b
99015 The rule above and the definition of external effect are
99016 intended to prevent (at least) the following incorrect
99017 optimizations, where V is a volatile variable:
99018
99019 20.c
99020 * X:= V; Y:=V; cannot be allowed to be translated as Y:=V;
99021 X:=V;
99022
99023 20.d
99024 * Deleting redundant loads: X:= V; X:= V; shall read the
99025 value of V from memory twice.
99026
99027 20.e
99028 * Deleting redundant stores: V:= X; V:= X; shall write into
99029 V twice.
99030
99031 20.f
99032 * Extra stores: V:= X+Y; should not translate to something
99033 like V:= X; V:= V+Y;
99034
99035 20.g
99036 * Extra loads: X:= V; Y:= X+Z; X:=X+B; should not translate
99037 to something like Y:= V+Z; X:= V+B;
99038
99039 20.h
99040 * Reordering of loads from volatile variables: X:= V1; Y:=
99041 V2; (whether or not V1 = V2) should not translate to Y:=
99042 V2; X:= V1;
99043
99044 20.i
99045 * Reordering of stores to volatile variables: V1:= X; V2:=
99046 X; should not translate to V2:=X; V1:= X;
99047
99048 21/3
99049 {AI05-0229-1AI05-0229-1} If the Pack aspect is True for a type any of
99050 whose subcomponents are atomic, the implementation shall not pack the
99051 atomic subcomponents more tightly than that for which it can support
99052 indivisible reads and updates.
99053
99054 21.a/3
99055 Implementation Note: {AI05-0009-1AI05-0009-1} Usually,
99056 specifying aspect Pack for such a type will be illegal as the
99057 Recommended Level of Support cannot be achieved; otherwise, a
99058 warning might be appropriate if no packing whatsoever can be
99059 achieved.
99060
99061 _Implementation Advice_
99062
99063 22/2
99064 {AI95-00259-01AI95-00259-01} A load or store of a volatile object whose
99065 size is a multiple of System.Storage_Unit and whose alignment is
99066 nonzero, should be implemented by accessing exactly the bits of the
99067 object and no others.
99068
99069 22.a/2
99070 Implementation Advice: A load or store of a volatile object
99071 whose size is a multiple of System.Storage_Unit and whose
99072 alignment is nonzero, should be implemented by accessing
99073 exactly the bits of the object and no others.
99074
99075 22.b/2
99076 Reason: Since any object can be a volatile object, including
99077 packed array components and bit-mapped record components, we
99078 require the above only when it is reasonable to assume that
99079 the machine can avoid accessing bits outside of the object.
99080
99081 22.c/2
99082 Ramification: This implies that the load or store of a
99083 volatile object that meets the above requirement should not be
99084 combined with that of any other object, nor should it access
99085 any bits not belonging to any other object. This means that
99086 the suitability of the implementation for memory-mapped I/O
99087 can be determined from its documentation, as any cases where
99088 the implementation does not follow Implementation Advice must
99089 be documented.
99090
99091 23/2
99092 {AI95-00259-01AI95-00259-01} A load or store of an atomic object should,
99093 where possible, be implemented by a single load or store instruction.
99094
99095 23.a/2
99096 Implementation Advice: A load or store of an atomic object
99097 should be implemented by a single load or store instruction.
99098
99099 NOTES
99100
99101 24
99102 9 An imported volatile or atomic constant behaves as a constant
99103 (i.e. read-only) with respect to other parts of the Ada program,
99104 but can still be modified by an "external source."
99105
99106 _Incompatibilities With Ada 83_
99107
99108 24.a
99109 Pragma Atomic replaces Ada 83's pragma Shared. The name
99110 "Shared" was confusing, because the pragma was not used to
99111 mark variables as shared.
99112
99113 _Wording Changes from Ada 95_
99114
99115 24.b/2
99116 {AI95-00259-01AI95-00259-01} Added Implementation Advice to
99117 clarify the meaning of Atomic and Volatile in machine terms.
99118 The documentation that this advice applies will make the use
99119 of Ada implementations more predictable for low-level (such as
99120 device register) programming.
99121
99122 24.c/2
99123 {AI95-00272-01AI95-00272-01} Added wording to clarify that a
99124 slice of an object of an atomic type is not atomic, just like
99125 a component of an atomic type is not (necessarily) atomic.
99126
99127 _Incompatibilities With Ada 2005_
99128
99129 24.d/3
99130 {AI05-0218-1AI05-0218-1} Correction: Plugged a hole involving
99131 volatile components of formal types when the formal type's
99132 component has a nonvolatile type. This was done by making
99133 certain actual types illegal for formal derived and formal
99134 array types; these types were allowed for Ada 95 and Ada 2005.
99135
99136 _Extensions to Ada 2005_
99137
99138 24.e/3
99139 {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1} Aspects
99140 Independent and Independent_Components are new; they eliminate
99141 ambiguity about independent addressability.
99142
99143 24.f/3
99144 {AI05-0229-1AI05-0229-1} Aspects Atomic, Atomic_Components,
99145 Volatile, and Volatile_Components are new; pragmas Atomic,
99146 Atomic_Components, Volatile, and Volatile_Components are now
99147 obsolescent.
99148
99149 _Wording Changes from Ada 2005_
99150
99151 24.g/3
99152 {AI05-0117-1AI05-0117-1} {AI05-0275-1AI05-0275-1} Revised the
99153 definition of volatile to eliminate overspecification and
99154 simply focus on the root requirement (that all tasks see the
99155 same view of volatile objects). This is not an inconsistency;
99156 "memory" arguably includes on-chip caches so long as those are
99157 kept consistent. Moreover, it is difficult to imagine a
99158 program that could tell the difference.
99159
99160 24.h/3
99161 {AI05-0142-4AI05-0142-4} Added wording to take explicitly
99162 aliased parameters (see *note 6.1::) into account when
99163 determining the legality of parameter passing of volatile and
99164 atomic objects.
99165
99166 \1f
99167 File: aarm2012.info, Node: C.7, Prev: C.6, Up: Annex C
99168
99169 C.7 Task Information
99170 ====================
99171
99172 1/3
99173 {AI95-00266-02AI95-00266-02} {AI05-0299-1AI05-0299-1} [This subclause
99174 describes operations and attributes that can be used to obtain the
99175 identity of a task. In addition, a package that associates user-defined
99176 information with a task is defined. Finally, a package that associates
99177 termination procedures with a task or set of tasks is defined.]
99178
99179 _Wording Changes from Ada 95_
99180
99181 1.a/3
99182 {AI95-00266-02AI95-00266-02} {AI05-0299-1AI05-0299-1} The
99183 title and text here were updated to reflect the addition of
99184 task termination procedures to this subclause.
99185
99186 * Menu:
99187
99188 * C.7.1 :: The Package Task_Identification
99189 * C.7.2 :: The Package Task_Attributes
99190 * C.7.3 :: The Package Task_Termination
99191
99192 \1f
99193 File: aarm2012.info, Node: C.7.1, Next: C.7.2, Up: C.7
99194
99195 C.7.1 The Package Task_Identification
99196 -------------------------------------
99197
99198 _Static Semantics_
99199
99200 1
99201 The following language-defined library package exists:
99202
99203 2/2
99204 {AI95-00362-01AI95-00362-01} package Ada.Task_Identification is
99205 pragma Preelaborate(Task_Identification);
99206 type Task_Id is private;
99207 pragma Preelaborable_Initialization (Task_Id);
99208 Null_Task_Id : constant Task_Id;
99209 function "=" (Left, Right : Task_Id) return Boolean;
99210
99211 3/3
99212 {8652/00708652/0070} {AI95-00101-01AI95-00101-01} {AI05-0189-1AI05-0189-1} function Image (T : Task_Id) return String;
99213 function Current_Task return Task_Id;
99214 function Environment_Task return Task_Id;
99215 procedure Abort_Task (T : in Task_Id);
99216
99217 4/3
99218 {AI05-0189-1AI05-0189-1} function Is_Terminated (T : Task_Id) return Boolean;
99219 function Is_Callable (T : Task_Id) return Boolean;
99220 function Activation_Is_Complete (T : Task_Id) return Boolean;
99221 private
99222 ... -- not specified by the language
99223 end Ada.Task_Identification;
99224
99225 _Dynamic Semantics_
99226
99227 5
99228 A value of the type Task_Id identifies an existent task. The constant
99229 Null_Task_Id does not identify any task. Each object of the type
99230 Task_Id is default initialized to the value of Null_Task_Id.
99231
99232 6
99233 The function "=" returns True if and only if Left and Right identify the
99234 same task or both have the value Null_Task_Id.
99235
99236 7
99237 The function Image returns an implementation-defined string that
99238 identifies T. If T equals Null_Task_Id, Image returns an empty string.
99239
99240 7.a
99241 Implementation defined: The result of the
99242 Task_Identification.Image attribute.
99243
99244 8
99245 The function Current_Task returns a value that identifies the calling
99246 task.
99247
99248 8.1/3
99249 {AI05-0189-1AI05-0189-1} The function Environment_Task returns a value
99250 that identifies the environment task.
99251
99252 9
99253 The effect of Abort_Task is the same as the abort_statement for the task
99254 identified by T. [In addition, if T identifies the environment task, the
99255 entire partition is aborted, See *note E.1::.]
99256
99257 10
99258 The functions Is_Terminated and Is_Callable return the value of the
99259 corresponding attribute of the task identified by T.
99260
99261 10.a.1/1
99262 Ramification: {8652/01158652/0115}
99263 {AI95-00206-01AI95-00206-01} These routines can be called with
99264 an argument identifying the environment task. Is_Terminated
99265 will always be False for such a call, but Is_Callable (usually
99266 True) could be False if the environment task is waiting for
99267 the termination of dependent tasks. Thus, a dependent task
99268 can use Is_Callable to determine if the main subprogram has
99269 completed.
99270
99271 10.1/3
99272 {AI05-0189-1AI05-0189-1} The function Activation_Is_Complete returns
99273 True if the task identified by T has completed its activation (whether
99274 successfully or not). It returns False otherwise. If T identifies the
99275 environment task, Activation_Is_Complete returns True after the
99276 elaboration of the library_items of the partition has completed.
99277
99278 11
99279 For a prefix T that is of a task type [(after any implicit
99280 dereference)], the following attribute is defined:
99281
99282 12
99283 T'Identity
99284 Yields a value of the type Task_Id that identifies the
99285 task denoted by T.
99286
99287 13
99288 For a prefix E that denotes an entry_declaration, the following
99289 attribute is defined:
99290
99291 14/3
99292 E'Caller
99293 {AI05-0262-1AI05-0262-1} Yields a value of the type
99294 Task_Id that identifies the task whose call is now being
99295 serviced. Use of this attribute is allowed only inside
99296 an accept_statement, or entry_body after the
99297 entry_barrier, corresponding to the entry_declaration
99298 denoted by E.
99299
99300 15
99301 Program_Error is raised if a value of Null_Task_Id is passed as a
99302 parameter to Abort_Task, Is_Terminated, and Is_Callable.
99303
99304 16
99305 Abort_Task is a potentially blocking operation (see *note 9.5.1::).
99306
99307 _Bounded (Run-Time) Errors_
99308
99309 17/3
99310 {AI95-00237-01AI95-00237-01} {AI05-0004-1AI05-0004-1} It is a bounded
99311 error to call the Current_Task function from an entry_body, interrupt
99312 handler, or finalization of a task attribute. Program_Error is raised,
99313 or an implementation-defined value of the type Task_Id is returned.
99314
99315 17.a/2
99316 Implementation defined: The value of Current_Task when in a
99317 protected entry, interrupt handler, or finalization of a task
99318 attribute.
99319
99320 17.b
99321 Implementation Note: This value could be Null_Task_Id, or the
99322 ID of some user task, or that of an internal task created by
99323 the implementation.
99324
99325 17.c/2
99326 Ramification: {AI95-00237-01AI95-00237-01} An entry barrier is
99327 syntactically part of an entry_body, so a call to Current_Task
99328 from an entry barrier is also covered by this rule.
99329
99330 _Erroneous Execution_
99331
99332 18
99333 If a value of Task_Id is passed as a parameter to any of the operations
99334 declared in this package (or any language-defined child of this
99335 package), and the corresponding task object no longer exists, the
99336 execution of the program is erroneous.
99337
99338 _Documentation Requirements_
99339
99340 19
99341 The implementation shall document the effect of calling Current_Task
99342 from an entry body or interrupt handler.
99343
99344 19.a/2
99345 This paragraph was deleted.
99346
99347 19.b/2
99348 Documentation Requirement: The effect of calling Current_Task
99349 from an entry body or interrupt handler.
99350
99351 NOTES
99352
99353 20
99354 10 This package is intended for use in writing user-defined task
99355 scheduling packages and constructing server tasks. Current_Task
99356 can be used in conjunction with other operations requiring a task
99357 as an argument such as Set_Priority (see *note D.5::).
99358
99359 21
99360 11 The function Current_Task and the attribute Caller can return a
99361 Task_Id value that identifies the environment task.
99362
99363 _Extensions to Ada 95_
99364
99365 21.a/2
99366 {AI95-00362-01AI95-00362-01} Task_Identification is now
99367 preelaborated, so it can be used in preelaborated units.
99368
99369 _Wording Changes from Ada 95_
99370
99371 21.b/2
99372 {8652/00708652/0070} {AI95-00101-01AI95-00101-01} Corrigendum:
99373 Corrected the mode of the parameter to Abort_Task to in.
99374
99375 21.c/2
99376 {AI95-00237-01AI95-00237-01} Corrected the wording to include
99377 finalization of a task attribute in the bounded error case; we
99378 don't want to specify which task does these operations.
99379
99380 _Incompatibilities With Ada 2005_
99381
99382 21.d/3
99383 {AI05-0189-1AI05-0189-1} Functions Environment_Task and
99384 Activation_Is_Complete are added to Task_Identification. If
99385 Task_Identification is referenced in a use_clause, and an
99386 entity E with a defining_identifier of Environment_Task or
99387 Activation_Is_Complete is defined in a package that is also
99388 referenced in a use_clause, the entity E may no longer be
99389 use-visible, resulting in errors. This should be rare and is
99390 easily fixed if it does occur.
99391
99392 \1f
99393 File: aarm2012.info, Node: C.7.2, Next: C.7.3, Prev: C.7.1, Up: C.7
99394
99395 C.7.2 The Package Task_Attributes
99396 ---------------------------------
99397
99398 _Static Semantics_
99399
99400 1
99401 The following language-defined generic library package exists:
99402
99403 2
99404 with Ada.Task_Identification; use Ada.Task_Identification;
99405 generic
99406 type Attribute is private;
99407 Initial_Value : in Attribute;
99408 package Ada.Task_Attributes is
99409
99410 3
99411 type Attribute_Handle is access all Attribute;
99412
99413 4
99414 function Value(T : Task_Id := Current_Task)
99415 return Attribute;
99416
99417 5
99418 function Reference(T : Task_Id := Current_Task)
99419 return Attribute_Handle;
99420
99421 6
99422 procedure Set_Value(Val : in Attribute;
99423 T : in Task_Id := Current_Task);
99424 procedure Reinitialize(T : in Task_Id := Current_Task);
99425
99426 7
99427 end Ada.Task_Attributes;
99428
99429 _Dynamic Semantics_
99430
99431 8
99432 When an instance of Task_Attributes is elaborated in a given active
99433 partition, an object of the actual type corresponding to the formal type
99434 Attribute is implicitly created for each task (of that partition) that
99435 exists and is not yet terminated. This object acts as a user-defined
99436 attribute of the task. A task created previously in the partition and
99437 not yet terminated has this attribute from that point on. Each task
99438 subsequently created in the partition will have this attribute when
99439 created. In all these cases, the initial value of the given attribute
99440 is Initial_Value.
99441
99442 9
99443 The Value operation returns the value of the corresponding attribute of
99444 T.
99445
99446 10
99447 The Reference operation returns an access value that designates the
99448 corresponding attribute of T.
99449
99450 11
99451 The Set_Value operation performs any finalization on the old value of
99452 the attribute of T and assigns Val to that attribute (see *note 5.2::
99453 and *note 7.6::).
99454
99455 12
99456 The effect of the Reinitialize operation is the same as Set_Value where
99457 the Val parameter is replaced with Initial_Value.
99458
99459 12.a
99460 Implementation Note: In most cases, the attribute memory can
99461 be reclaimed at this point.
99462
99463 13
99464 For all the operations declared in this package, Tasking_Error is raised
99465 if the task identified by T is terminated. Program_Error is raised if
99466 the value of T is Null_Task_Id.
99467
99468 13.1/2
99469 {AI95-00237-01AI95-00237-01} After a task has terminated, all of its
99470 attributes are finalized, unless they have been finalized earlier. When
99471 the master of an instantiation of Ada.Task_Attributes is finalized, the
99472 corresponding attribute of each task is finalized, unless it has been
99473 finalized earlier.
99474
99475 13.a/2
99476 Reason: This is necessary so that a task attribute does not
99477 outlive its type. For instance, that's possible if the
99478 instantiation is nested, and the attribute is on a
99479 library-level task.
99480
99481 13.b/2
99482 Ramification: The task owning an attribute cannot, in general,
99483 finalize that attribute. That's because the attributes are
99484 finalized after the task is terminated; moreover, a task may
99485 have attributes as soon as it is created; the task may never
99486 even have been activated.
99487
99488 _Bounded (Run-Time) Errors_
99489
99490 13.2/1
99491 {8652/00718652/0071} {AI95-00165-01AI95-00165-01} If the package
99492 Ada.Task_Attributes is instantiated with a controlled type and the
99493 controlled type has user-defined Adjust or Finalize operations that in
99494 turn access task attributes by any of the above operations, then a call
99495 of Set_Value of the instantiated package constitutes a bounded error.
99496 The call may perform as expected or may result in forever blocking the
99497 calling task and subsequently some or all tasks of the partition.
99498
99499 _Erroneous Execution_
99500
99501 14
99502 It is erroneous to dereference the access value returned by a given call
99503 on Reference after a subsequent call on Reinitialize for the same task
99504 attribute, or after the associated task terminates.
99505
99506 14.a
99507 Reason: This allows the storage to be reclaimed for the object
99508 associated with an attribute upon Reinitialize or task
99509 termination.
99510
99511 15
99512 If a value of Task_Id is passed as a parameter to any of the operations
99513 declared in this package and the corresponding task object no longer
99514 exists, the execution of the program is erroneous.
99515
99516 15.1/2
99517 {8652/00718652/0071} {AI95-00165-01AI95-00165-01}
99518 {AI95-00237-01AI95-00237-01} An access to a task attribute via a value
99519 of type Attribute_Handle is erroneous if executed concurrently with
99520 another such access or a call of any of the operations declared in
99521 package Task_Attributes. An access to a task attribute is erroneous if
99522 executed concurrently with or after the finalization of the task
99523 attribute.
99524
99525 15.a.1/1
99526 Reason: There is no requirement of atomicity on accesses via a
99527 value of type Attribute_Handle.
99528
99529 15.a.2/2
99530 Ramification: A task attribute can only be accessed after
99531 finalization through a value of type Attribute_Handle.
99532 Operations in package Task_Attributes cannot be used to access
99533 a task attribute after finalization, because either the master
99534 of the instance has been or is in the process of being left
99535 (in which case the instance is out of scope and thus cannot be
99536 called), or the associated task is already terminated (in
99537 which case Tasking_Error is raised for any attempt to call a
99538 task attribute operation).
99539
99540 _Implementation Requirements_
99541
99542 16/1
99543 {8652/00718652/0071} {AI95-00165-01AI95-00165-01} For a given attribute
99544 of a given task, the implementation shall perform the operations
99545 declared in this package atomically with respect to any of these
99546 operations of the same attribute of the same task. The granularity of
99547 any locking mechanism necessary to achieve such atomicity is
99548 implementation defined.
99549
99550 16.a.1/1
99551 Implementation defined: Granularity of locking for
99552 Task_Attributes.
99553
99554 16.a
99555 Ramification: Hence, other than by dereferencing an access
99556 value returned by Reference, an attribute of a given task can
99557 be safely read and updated concurrently by multiple tasks.
99558
99559 17/2
99560 {AI95-00237-01AI95-00237-01} After task attributes are finalized, the
99561 implementation shall reclaim any storage associated with the attributes.
99562
99563 _Documentation Requirements_
99564
99565 18
99566 The implementation shall document the limit on the number of attributes
99567 per task, if any, and the limit on the total storage for attribute
99568 values per task, if such a limit exists.
99569
99570 19
99571 In addition, if these limits can be configured, the implementation shall
99572 document how to configure them.
99573
99574 19.a/2
99575 This paragraph was deleted.
99576
99577 19.b/2
99578 Documentation Requirement: For package Task_Attributes, limits
99579 on the number and size of task attributes, and how to
99580 configure any limits.
99581
99582 _Metrics_
99583
99584 20/2
99585 {AI95-00434-01AI95-00434-01} The implementation shall document the
99586 following metrics: A task calling the following subprograms shall
99587 execute at a sufficiently high priority as to not be preempted during
99588 the measurement period. This period shall start just before issuing the
99589 call and end just after the call completes. If the attributes of task T
99590 are accessed by the measurement tests, no other task shall access
99591 attributes of that task during the measurement period. For all
99592 measurements described here, the Attribute type shall be a scalar type
99593 whose size is equal to the size of the predefined type Integer. For
99594 each measurement, two cases shall be documented: one where the accessed
99595 attributes are of the calling task [(that is, the default value for the
99596 T parameter is used)], and the other, where T identifies another,
99597 nonterminated, task.
99598
99599 21
99600 The following calls (to subprograms in the Task_Attributes package)
99601 shall be measured:
99602
99603 22
99604 * a call to Value, where the return value is Initial_Value;
99605
99606 23
99607 * a call to Value, where the return value is not equal to
99608 Initial_Value;
99609
99610 24
99611 * a call to Reference, where the return value designates a value
99612 equal to Initial_Value;
99613
99614 25
99615 * a call to Reference, where the return value designates a value not
99616 equal to Initial_Value;
99617
99618 26/2
99619 * {AI95-00434-01AI95-00434-01} a call to Set_Value where the Val
99620 parameter is not equal to Initial_Value and the old attribute value
99621 is equal to Initial_Value;
99622
99623 27
99624 * a call to Set_Value where the Val parameter is not equal to
99625 Initial_Value and the old attribute value is not equal to
99626 Initial_Value.
99627
99628 27.a/2
99629 Documentation Requirement: The metrics for the Task_Attributes
99630 package.
99631
99632 _Implementation Permissions_
99633
99634 28
99635 An implementation need not actually create the object corresponding to a
99636 task attribute until its value is set to something other than that of
99637 Initial_Value, or until Reference is called for the task attribute.
99638 Similarly, when the value of the attribute is to be reinitialized to
99639 that of Initial_Value, the object may instead be finalized and its
99640 storage reclaimed, to be recreated when needed later. While the object
99641 does not exist, the function Value may simply return Initial_Value,
99642 rather than implicitly creating the object.
99643
99644 28.a
99645 Discussion: The effect of this permission can only be observed
99646 if the assignment operation for the corresponding type has
99647 side effects.
99648
99649 28.b/2
99650 Implementation Note: {AI95-00114-01AI95-00114-01} This
99651 permission means that even though every task has every
99652 attribute, storage need only be allocated for those attributes
99653 for which function Reference has been invoked or set to a
99654 value other than that of Initial_Value.
99655
99656 29
99657 An implementation is allowed to place restrictions on the maximum number
99658 of attributes a task may have, the maximum size of each attribute, and
99659 the total storage size allocated for all the attributes of a task.
99660
99661 _Implementation Advice_
99662
99663 30/2
99664 {AI95-00434-01AI95-00434-01} Some implementations are targeted to
99665 domains in which memory use at run time must be completely
99666 deterministic. For such implementations, it is recommended that the
99667 storage for task attributes will be pre-allocated statically and not
99668 from the heap. This can be accomplished by either placing restrictions
99669 on the number and the size of the attributes of a task, or by using the
99670 pre-allocated storage for the first N attribute objects, and the heap
99671 for the others. In the latter case, N should be documented.
99672
99673 30.a/2
99674 Implementation Advice: If the target domain requires
99675 deterministic memory use at run time, storage for task
99676 attributes should be pre-allocated statically and the number
99677 of attributes pre-allocated should be documented.
99678
99679 30.b/2
99680 Discussion: We don't mention "restrictions on the size and
99681 number" (that is, limits) in the text for the Annex, because
99682 it is covered by the Documentation Requirement above, and we
99683 try not to repeat requirements in the Annex (they're enough
99684 work to meet without having to do things twice).
99685
99686 30.1/2
99687 {AI95-00237-01AI95-00237-01} Finalization of task attributes and
99688 reclamation of associated storage should be performed as soon as
99689 possible after task termination.
99690
99691 30.c/2
99692 Implementation Advice: Finalization of task attributes and
99693 reclamation of associated storage should be performed as soon
99694 as possible after task termination.
99695
99696 30.d/2
99697 Reason: {AI95-00237-01AI95-00237-01} This is necessary because
99698 the normative wording only says that attributes are finalized
99699 "after" task termination. Without this advice, waiting until
99700 the instance is finalized would meet the requirements (it is
99701 after termination, but may be a very long time after
99702 termination). We can't say anything more specific than this,
99703 as we do not want to require the overhead of an interaction
99704 with the tasking system to be done at a specific point.
99705
99706 NOTES
99707
99708 31
99709 12 An attribute always exists (after instantiation), and has the
99710 initial value. It need not occupy memory until the first operation
99711 that potentially changes the attribute value. The same holds true
99712 after Reinitialize.
99713
99714 32
99715 13 The result of the Reference function should be used with care;
99716 it is always safe to use that result in the task body whose
99717 attribute is being accessed. However, when the result is being
99718 used by another task, the programmer must make sure that the task
99719 whose attribute is being accessed is not yet terminated. Failing
99720 to do so could make the program execution erroneous.
99721
99722 _Wording Changes from Ada 95_
99723
99724 33.a/2
99725 {8652/00718652/0071} {AI95-00165-01AI95-00165-01} Corrigendum:
99726 Clarified that use of task attribute operations from within a
99727 task attribute operation (by an Adjust or Finalize call) is a
99728 bounded error, and that concurrent use of attribute handles is
99729 erroneous.
99730
99731 33.b/2
99732 {AI95-00237-01AI95-00237-01} Clarified the wording so that the
99733 finalization takes place after the termination of the task or
99734 when the instance is finalized (whichever is sooner).
99735
99736 \1f
99737 File: aarm2012.info, Node: C.7.3, Prev: C.7.2, Up: C.7
99738
99739 C.7.3 The Package Task_Termination
99740 ----------------------------------
99741
99742 _Static Semantics_
99743
99744 1/2
99745 {AI95-00266-02AI95-00266-02} The following language-defined library
99746 package exists:
99747
99748 2/2
99749 with Ada.Task_Identification;
99750 with Ada.Exceptions;
99751 package Ada.Task_Termination is
99752 pragma Preelaborate(Task_Termination);
99753
99754 3/2
99755 type Cause_Of_Termination is (Normal, Abnormal, Unhandled_Exception);
99756
99757 4/2
99758 type Termination_Handler is access protected procedure
99759 (Cause : in Cause_Of_Termination;
99760 T : in Ada.Task_Identification.Task_Id;
99761 X : in Ada.Exceptions.Exception_Occurrence);
99762
99763 5/2
99764 procedure Set_Dependents_Fallback_Handler
99765 (Handler: in Termination_Handler);
99766 function Current_Task_Fallback_Handler return Termination_Handler;
99767
99768 6/2
99769 procedure Set_Specific_Handler
99770 (T : in Ada.Task_Identification.Task_Id;
99771 Handler : in Termination_Handler);
99772 function Specific_Handler (T : Ada.Task_Identification.Task_Id)
99773 return Termination_Handler;
99774
99775 7/2
99776 end Ada.Task_Termination;
99777
99778 _Dynamic Semantics_
99779
99780 8/3
99781 {AI95-00266-02AI95-00266-02} {AI05-0202-1AI05-0202-1} The type
99782 Termination_Handler identifies a protected procedure to be executed by
99783 the implementation when a task terminates. Such a protected procedure
99784 is called a handler. In all cases T identifies the task that is
99785 terminating. If the task terminates due to completing the last
99786 statement of its body, or as a result of waiting on a terminate
99787 alternative, and the finalization of the task completes normally, then
99788 Cause is set to Normal and X is set to Null_Occurrence. If the task
99789 terminates because it is being aborted, then Cause is set to Abnormal; X
99790 is set to Null_Occurrence if the finalization of the task completes
99791 normally. If the task terminates because of an exception raised by the
99792 execution of its task_body, then Cause is set to Unhandled_Exception; X
99793 is set to the associated exception occurrence if the finalization of the
99794 task completes normally. Independent of how the task completes, if
99795 finalization of the task propagates an exception, then Cause is either
99796 Unhandled_Exception or Abnormal, and X is an exception occurrence that
99797 identifies the Program_Error exception.
99798
99799 9/2
99800 {AI95-00266-02AI95-00266-02} Each task has two termination handlers, a
99801 fall-back handler and a specific handler. The specific handler applies
99802 only to the task itself, while the fall-back handler applies only to the
99803 dependent tasks of the task. A handler is said to be set if it is
99804 associated with a nonnull value of type Termination_Handler, and cleared
99805 otherwise. When a task is created, its specific handler and fall-back
99806 handler are cleared.
99807
99808 10/3
99809 {AI95-00266-02AI95-00266-02} {AI05-0264-1AI05-0264-1} The procedure
99810 Set_Dependents_Fallback_Handler changes the fall-back handler for the
99811 calling task: if Handler is null, that fall-back handler is cleared;
99812 otherwise, it is set to be Handler.all. If a fall-back handler had
99813 previously been set it is replaced.
99814
99815 11/3
99816 {AI95-00266-02AI95-00266-02} {AI05-0264-1AI05-0264-1} The function
99817 Current_Task_Fallback_Handler returns the fall-back handler that is
99818 currently set for the calling task, if one is set; otherwise, it returns
99819 null.
99820
99821 12/3
99822 {AI95-00266-02AI95-00266-02} {AI05-0264-1AI05-0264-1} The procedure
99823 Set_Specific_Handler changes the specific handler for the task
99824 identified by T: if Handler is null, that specific handler is cleared;
99825 otherwise, it is set to be Handler.all. If a specific handler had
99826 previously been set it is replaced.
99827
99828 12.a/3
99829 Ramification: {AI05-0005-1AI05-0005-1} This package cannot
99830 portably be used to set a handler on the program as a whole.
99831 It is possible to call Set_Specific_Handler with the
99832 environment task's ID. But any call to the handler would
99833 necessarily be a Bounded (Run-Time) Error, as the handler is
99834 called after the task's finalization has completed. In the
99835 case of the environment task, that includes any possible
99836 protected objects, and calling a protected object after it is
99837 finalized is a Bounded (Run-Time) Error (see *note 9.4::).
99838 This might work in a particular implementation, but it cannot
99839 be depended upon.
99840
99841 13/3
99842 {AI95-00266-02AI95-00266-02} {AI05-0264-1AI05-0264-1} The function
99843 Specific_Handler returns the specific handler that is currently set for
99844 the task identified by T, if one is set; otherwise, it returns null.
99845
99846 14/2
99847 {AI95-00266-02AI95-00266-02} As part of the finalization of a task_body,
99848 after performing the actions specified in *note 7.6:: for finalization
99849 of a master, the specific handler for the task, if one is set, is
99850 executed. If the specific handler is cleared, a search for a fall-back
99851 handler proceeds by recursively following the master relationship for
99852 the task. If a task is found whose fall-back handler is set, that
99853 handler is executed; otherwise, no handler is executed.
99854
99855 15/2
99856 {AI95-00266-02AI95-00266-02} For Set_Specific_Handler or
99857 Specific_Handler, Tasking_Error is raised if the task identified by T
99858 has already terminated. Program_Error is raised if the value of T is
99859 Ada.Task_Identification.Null_Task_Id.
99860
99861 16/2
99862 {AI95-00266-02AI95-00266-02} An exception propagated from a handler that
99863 is invoked as part of the termination of a task has no effect.
99864
99865 _Erroneous Execution_
99866
99867 17/2
99868 {AI95-00266-02AI95-00266-02} For a call of Set_Specific_Handler or
99869 Specific_Handler, if the task identified by T no longer exists, the
99870 execution of the program is erroneous.
99871
99872 _Extensions to Ada 95_
99873
99874 17.a/2
99875 {AI95-00266-02AI95-00266-02} Package Task_Termination is new.
99876
99877 _Wording Changes from Ada 2005_
99878
99879 17.b/3
99880 {AI05-0202-1AI05-0202-1} Correction: Specified what is passed
99881 to the handler if the finalization of the task fails after it
99882 is completed. This was not specified at all in Ada 2005, so
99883 there is a possibility that some program depended on some
99884 other behavior of an implementation. But as this case is very
99885 unlikely (and only occurs when there is already a significant
99886 bug in the program - so should not occur in fielded systems),
99887 we're not listing this as an inconsistency.
99888
99889 \1f
99890 File: aarm2012.info, Node: Annex D, Next: Annex E, Prev: Annex C, Up: Top
99891
99892 Annex D Real-Time Systems
99893 *************************
99894
99895 1
99896 This Annex specifies additional characteristics of Ada implementations
99897 intended for real-time systems software. To conform to this Annex, an
99898 implementation shall also conform to the Systems Programming Annex.
99899
99900 _Metrics_
99901
99902 2
99903 The metrics are documentation requirements; an implementation shall
99904 document the values of the language-defined metrics for at least one
99905 configuration [of hardware or an underlying system] supported by the
99906 implementation, and shall document the details of that configuration.
99907
99908 2.a/2
99909 This paragraph was deleted.
99910
99911 2.a.1/2
99912 Documentation Requirement: The details of the configuration
99913 used to generate the values of all metrics.
99914
99915 2.b
99916 Reason: The actual values of the metrics are likely to depend
99917 on hardware configuration details that are variable and
99918 generally outside the control of a compiler vendor.
99919
99920 3
99921 The metrics do not necessarily yield a simple number. [For some, a
99922 range is more suitable, for others a formula dependent on some parameter
99923 is appropriate, and for others, it may be more suitable to break the
99924 metric into several cases.] Unless specified otherwise, the metrics in
99925 this annex are expressed in processor clock cycles. For metrics that
99926 require documentation of an upper bound, if there is no upper bound, the
99927 implementation shall report that the metric is unbounded.
99928
99929 3.a
99930 Discussion: There are several good reasons to specify metrics
99931 in seconds; there are however equally good reasons to specify
99932 them in processor clock cycles. In defining the metrics, we
99933 have tried to strike a balance on a case-by-case basis.
99934
99935 3.b
99936 It has been suggested that all metrics should be given names,
99937 so that "data-sheets" could be formulated and published by
99938 vendors. However the paragraph number can serve that purpose.
99939
99940 NOTES
99941
99942 4
99943 1 The specification of the metrics makes a distinction between
99944 upper bounds and simple execution times. Where something is just
99945 specified as "the execution time of" a piece of code, this leaves
99946 one the freedom to choose a nonpathological case. This kind of
99947 metric is of the form "there exists a program such that the value
99948 of the metric is V". Conversely, the meaning of upper bounds is
99949 "there is no program such that the value of the metric is greater
99950 than V". This kind of metric can only be partially tested, by
99951 finding the value of V for one or more test programs.
99952
99953 5
99954 2 The metrics do not cover the whole language; they are limited to
99955 features that are specified in *note Annex C::, "*note Annex C::
99956 Systems Programming" and in this Annex. The metrics are intended
99957 to provide guidance to potential users as to whether a particular
99958 implementation of such a feature is going to be adequate for a
99959 particular real-time application. As such, the metrics are aimed
99960 at known implementation choices that can result in significant
99961 performance differences.
99962
99963 6
99964 3 The purpose of the metrics is not necessarily to provide
99965 fine-grained quantitative results or to serve as a comparison
99966 between different implementations on the same or different
99967 platforms. Instead, their goal is rather qualitative; to define a
99968 standard set of approximate values that can be measured and used to
99969 estimate the general suitability of an implementation, or to
99970 evaluate the comparative utility of certain features of an
99971 implementation for a particular real-time application.
99972
99973 _Extensions to Ada 83_
99974
99975 6.a
99976 This Annex is new to Ada 95.
99977
99978 * Menu:
99979
99980 * D.1 :: Task Priorities
99981 * D.2 :: Priority Scheduling
99982 * D.3 :: Priority Ceiling Locking
99983 * D.4 :: Entry Queuing Policies
99984 * D.5 :: Dynamic Priorities
99985 * D.6 :: Preemptive Abort
99986 * D.7 :: Tasking Restrictions
99987 * D.8 :: Monotonic Time
99988 * D.9 :: Delay Accuracy
99989 * D.10 :: Synchronous Task Control
99990 * D.11 :: Asynchronous Task Control
99991 * D.12 :: Other Optimizations and Determinism Rules
99992 * D.13 :: The Ravenscar Profile
99993 * D.14 :: Execution Time
99994 * D.15 :: Timing Events
99995 * D.16 :: Multiprocessor Implementation
99996
99997 \1f
99998 File: aarm2012.info, Node: D.1, Next: D.2, Up: Annex D
99999
100000 D.1 Task Priorities
100001 ===================
100002
100003 1/3
100004 {AI05-0299-1AI05-0299-1} [This subclause specifies the priority model
100005 for real-time systems. In addition, the methods for specifying
100006 priorities are defined.]
100007
100008 Paragraphs 2 through 6 were moved to *note Annex J::, "*note Annex J::
100009 Obsolescent Features".
100010
100011 _Static Semantics_
100012
100013 6.1/3
100014 {AI05-0229-1AI05-0229-1} For a task type (including the anonymous type
100015 of a single_task_declaration), protected type (including the anonymous
100016 type of a single_protected_declaration), or subprogram, the following
100017 language-defined representation aspects may be specified:
100018
100019 6.2/3
100020 Priority
100021 The aspect Priority is an expression, which shall be of
100022 type Integer.
100023
100024 6.a/3
100025 Aspect Description for Priority: Priority of a task object or
100026 type, or priority of a protected object or type; the priority
100027 is not in the interrupt range.
100028
100029 6.3/3
100030 Interrupt_Priority
100031 The aspect Interrupt_Priority is an expression, which
100032 shall be of type Integer.
100033
100034 6.b/3
100035 Aspect Description for Interrupt_Priority: Priority of a task
100036 object or type, or priority of a protected object or type; the
100037 priority is in the interrupt range.
100038
100039 _Legality Rules_
100040
100041 7/3
100042 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
100043
100044 8/3
100045 {AI05-0229-1AI05-0229-1} If the Priority aspect is specified for a
100046 subprogram, the expression shall be static, and its value shall be in
100047 the range of System.Priority.
100048
100049 8.a
100050 Reason: This value is needed before it gets elaborated, when
100051 the environment task starts executing.
100052
100053 8.1/3
100054 {AI05-0229-1AI05-0229-1} At most one of the Priority and
100055 Interrupt_Priority aspects may be specified for a given entity.
100056
100057 8.b/3
100058 Ramification: This includes specifying via pragmas (see *note
100059 J.15.11::). Note that *note 13.1:: prevents multiple
100060 specifications of a single representation aspect by any means.
100061
100062 8.2/3
100063 {AI05-0229-1AI05-0229-1} Neither of the Priority or Interrupt_Priority
100064 aspects shall be specified for a synchronized interface type.
100065
100066 _Static Semantics_
100067
100068 9
100069 The following declarations exist in package System:
100070
100071 10
100072 subtype Any_Priority is Integer range implementation-defined;
100073 subtype Priority is Any_Priority
100074 range Any_Priority'First .. implementation-defined;
100075 subtype Interrupt_Priority is Any_Priority
100076 range Priority'Last+1 .. Any_Priority'Last;
100077
100078 11
100079 Default_Priority : constant Priority := (Priority'First + Priority'Last)/2;
100080
100081 11.a
100082 Implementation defined: The declarations of Any_Priority and
100083 Priority.
100084
100085 12
100086 The full range of priority values supported by an implementation is
100087 specified by the subtype Any_Priority. The subrange of priority values
100088 that are high enough to require the blocking of one or more interrupts
100089 is specified by the subtype Interrupt_Priority. [The subrange of
100090 priority values below System.Interrupt_Priority'First is specified by
100091 the subtype System.Priority.]
100092
100093 13/3
100094 This paragraph was deleted.{AI05-0229-1AI05-0229-1}
100095
100096 _Dynamic Semantics_
100097
100098 14/3
100099 {AI05-0229-1AI05-0229-1} The Priority aspect has no effect if it is
100100 specified for a subprogram other than the main subprogram; the Priority
100101 value is not associated with any task.
100102
100103 15
100104 A task priority is an integer value that indicates a degree of urgency
100105 and is the basis for resolving competing demands of tasks for resources.
100106 Unless otherwise specified, whenever tasks compete for processors or
100107 other implementation-defined resources, the resources are allocated to
100108 the task with the highest priority value. The base priority of a task
100109 is the priority with which it was created, or to which it was later set
100110 by Dynamic_Priorities.Set_Priority (see *note D.5::). At all times, a
100111 task also has an active priority, which generally reflects its base
100112 priority as well as any priority it inherits from other sources.
100113 Priority inheritance is the process by which the priority of a task or
100114 other entity (e.g. a protected object; see *note D.3::) is used in the
100115 evaluation of another task's active priority.
100116
100117 15.a
100118 Implementation defined: Implementation-defined execution
100119 resources.
100120
100121 16/3
100122 {AI05-0229-1AI05-0229-1} The effect of specifying a Priority or
100123 Interrupt_Priority aspect for a protected type or
100124 single_protected_declaration is discussed in *note D.3::.
100125
100126 17/3
100127 {AI05-0229-1AI05-0229-1} The expression specified for the Priority or
100128 Interrupt_Priority aspect of a task is evaluated for each task object
100129 (see *note 9.1::). For the Priority aspect, the value of the expression
100130 is converted to the subtype Priority; for the Interrupt_Priority aspect,
100131 this value is converted to the subtype Any_Priority. The priority value
100132 is then associated with the task object whose task declaration specifies
100133 the aspect.
100134
100135 18/3
100136 {AI05-0229-1AI05-0229-1} Likewise, the priority value is associated with
100137 the environment task if the aspect is specified for the main subprogram.
100138
100139 19/3
100140 {AI05-0229-1AI05-0229-1} The initial value of a task's base priority is
100141 specified by default or by means of a Priority or Interrupt_Priority
100142 aspect. [After a task is created, its base priority can be changed only
100143 by a call to Dynamic_Priorities.Set_Priority (see *note D.5::).] The
100144 initial base priority of a task in the absence of an aspect is the base
100145 priority of the task that creates it at the time of creation (see *note
100146 9.1::). If the aspect Priority is not specified for the main
100147 subprogram, the initial base priority of the environment task is
100148 System.Default_Priority. [The task's active priority is used when the
100149 task competes for processors. Similarly, the task's active priority is
100150 used to determine the task's position in any queue when Priority_Queuing
100151 is specified (see *note D.4::).]
100152
100153 20/2
100154 {AI95-00357-01AI95-00357-01} At any time, the active priority of a task
100155 is the maximum of all the priorities the task is inheriting at that
100156 instant. For a task that is not held (see *note D.11::), its base
100157 priority is a source of priority inheritance unless otherwise specified
100158 for a particular task dispatching policy. Other sources of priority
100159 inheritance are specified under the following conditions:
100160
100161 20.a
100162 Discussion: Other parts of the annex, e.g. *note D.11::,
100163 define other sources of priority inheritance.
100164
100165 21/1
100166 * {8652/00728652/0072} {AI95-00092-01AI95-00092-01} During
100167 activation, a task being activated inherits the active priority
100168 that its activator (see *note 9.2::) had at the time the activation
100169 was initiated.
100170
100171 22/1
100172 * {8652/00728652/0072} {AI95-00092-01AI95-00092-01} During
100173 rendezvous, the task accepting the entry call inherits the priority
100174 of the entry call (see *note 9.5.3:: and *note D.4::).
100175
100176 23
100177 * During a protected action on a protected object, a task inherits
100178 the ceiling priority of the protected object (see *note 9.5:: and
100179 *note D.3::).
100180
100181 24
100182 In all of these cases, the priority ceases to be inherited as soon as
100183 the condition calling for the inheritance no longer exists.
100184
100185 _Implementation Requirements_
100186
100187 25
100188 The range of System.Interrupt_Priority shall include at least one value.
100189
100190 26
100191 The range of System.Priority shall include at least 30 values.
100192
100193 NOTES
100194
100195 27
100196 4 The priority expression can include references to discriminants
100197 of the enclosing type.
100198
100199 28
100200 5 It is a consequence of the active priority rules that at the
100201 point when a task stops inheriting a priority from another source,
100202 its active priority is re-evaluated. This is in addition to other
100203 instances described in this Annex for such re-evaluation.
100204
100205 29/3
100206 6 {AI05-0248-1AI05-0248-1} An implementation may provide a
100207 nonstandard mode in which tasks inherit priorities under conditions
100208 other than those specified above.
100209
100210 29.a/3
100211 Ramification: {AI05-0229-1AI05-0229-1} The use of a Priority
100212 or Interrupt_Priority aspect does not require the package
100213 System to be named in a with_clause for the enclosing
100214 compilation_unit.
100215
100216 _Extensions to Ada 83_
100217
100218 29.b
100219 The priority of a task is per-object and not per-type.
100220
100221 29.c
100222 Priorities need not be static anymore (except for the main
100223 subprogram).
100224
100225 _Wording Changes from Ada 83_
100226
100227 29.d
100228 The description of the Priority pragma has been moved to this
100229 annex.
100230
100231 _Wording Changes from Ada 95_
100232
100233 29.e/2
100234 {8652/00728652/0072} {AI95-00092-01AI95-00092-01} Corrigendum:
100235 Clarified that dynamic priority changes are not transitive -
100236 that is, they don't apply to tasks that are being activated by
100237 or in rendezvous with the task that had its priority changed.
100238
100239 29.f/2
100240 {AI95-00357-01AI95-00357-01} Generalized the definition of
100241 priority inheritance to take into account the differences
100242 between the existing and new dispatching policies.
100243
100244 _Extensions to Ada 2005_
100245
100246 29.g/3
100247 {AI05-0229-1AI05-0229-1} Aspects Priority and
100248 Interrupt_Priority are new; pragmas Priority and
100249 Interrupt_Priority are now obsolescent.
100250
100251 \1f
100252 File: aarm2012.info, Node: D.2, Next: D.3, Prev: D.1, Up: Annex D
100253
100254 D.2 Priority Scheduling
100255 =======================
100256
100257 1/3
100258 {AI95-00321-01AI95-00321-01} {AI05-0299-1AI05-0299-1} [This subclause
100259 describes the rules that determine which task is selected for execution
100260 when more than one task is ready (see *note 9::).]
100261
100262 _Wording Changes from Ada 95_
100263
100264 1.a/3
100265 {AI95-00321-01AI95-00321-01} {AI05-0299-1AI05-0299-1} This
100266 introduction is simplified in order to reflect the
100267 rearrangement and expansion of this subclause.
100268
100269 * Menu:
100270
100271 * D.2.1 :: The Task Dispatching Model
100272 * D.2.2 :: Task Dispatching Pragmas
100273 * D.2.3 :: Preemptive Dispatching
100274 * D.2.4 :: Non-Preemptive Dispatching
100275 * D.2.5 :: Round Robin Dispatching
100276 * D.2.6 :: Earliest Deadline First Dispatching
100277
100278 \1f
100279 File: aarm2012.info, Node: D.2.1, Next: D.2.2, Up: D.2
100280
100281 D.2.1 The Task Dispatching Model
100282 --------------------------------
100283
100284 1/2
100285 {AI95-00321-01AI95-00321-01} [The task dispatching model specifies task
100286 scheduling, based on conceptual priority-ordered ready queues.]
100287
100288 _Static Semantics_
100289
100290 1.1/2
100291 {AI95-00355-01AI95-00355-01} The following language-defined library
100292 package exists:
100293
100294 1.2/3
100295 {AI05-0166-1AI05-0166-1} package Ada.Dispatching is
100296 pragma Preelaborate(Dispatching);
100297
100298 1.3/3
100299 {AI05-0166-1AI05-0166-1} procedure Yield;
100300
100301 1.4/3
100302 {AI05-0166-1AI05-0166-1} Dispatching_Policy_Error : exception;
100303 end Ada.Dispatching;
100304
100305 1.5/2
100306 Dispatching serves as the parent of other language-defined library units
100307 concerned with task dispatching.
100308
100309 _Dynamic Semantics_
100310
100311 2/2
100312 {AI95-00321-01AI95-00321-01} A task can become a running task only if it
100313 is ready (see *note 9::) and the execution resources required by that
100314 task are available. Processors are allocated to tasks based on each
100315 task's active priority.
100316
100317 3
100318 It is implementation defined whether, on a multiprocessor, a task that
100319 is waiting for access to a protected object keeps its processor busy.
100320
100321 3.a
100322 Implementation defined: Whether, on a multiprocessor, a task
100323 that is waiting for access to a protected object keeps its
100324 processor busy.
100325
100326 4/2
100327 {AI95-00321-01AI95-00321-01} Task dispatching is the process by which
100328 one ready task is selected for execution on a processor. This selection
100329 is done at certain points during the execution of a task called task
100330 dispatching points. A task reaches a task dispatching point whenever it
100331 becomes blocked, and when it terminates. [Other task dispatching points
100332 are defined throughout this Annex for specific policies.]
100333
100334 4.a
100335 Ramification: On multiprocessor systems, more than one task
100336 can be chosen, at the same time, for execution on more than
100337 one processor, as explained below.
100338
100339 5/2
100340 {AI95-00321-01AI95-00321-01} Task dispatching policies are specified in
100341 terms of conceptual ready queues and task states. A ready queue is an
100342 ordered list of ready tasks. The first position in a queue is called
100343 the head of the queue, and the last position is called the tail of the
100344 queue. A task is ready if it is in a ready queue, or if it is running.
100345 Each processor has one ready queue for each priority value. At any
100346 instant, each ready queue of a processor contains exactly the set of
100347 tasks of that priority that are ready for execution on that processor,
100348 but are not running on any processor; that is, those tasks that are
100349 ready, are not running on any processor, and can be executed using that
100350 processor and other available resources. A task can be on the ready
100351 queues of more than one processor.
100352
100353 5.a
100354 Discussion: The core language defines a ready task as one that
100355 is not blocked. Here we refine this definition and talk about
100356 ready queues.
100357
100358 6/2
100359 {AI95-00321-01AI95-00321-01} Each processor also has one running task,
100360 which is the task currently being executed by that processor. Whenever
100361 a task running on a processor reaches a task dispatching point it goes
100362 back to one or more ready queues; a task (possibly the same task) is
100363 then selected to run on that processor. The task selected is the one at
100364 the head of the highest priority nonempty ready queue; this task is then
100365 removed from all ready queues to which it belongs.
100366
100367 6.a
100368 Discussion: There is always at least one task to run, if we
100369 count the idle task.
100370
100371 7/3
100372 {AI95-00321-01AI95-00321-01} {AI05-0166-1AI05-0166-1} A call of Yield is
100373 a task dispatching point. Yield is a potentially blocking operation
100374 (see *note 9.5.1::).
100375
100376 7.a/2
100377 This paragraph was deleted.
100378
100379 8/2
100380 This paragraph was deleted.{AI95-00321-01AI95-00321-01}
100381
100382 8.a/2
100383 This paragraph was deleted.
100384
100385 _Implementation Permissions_
100386
100387 9/2
100388 {AI95-00321-01AI95-00321-01} An implementation is allowed to define
100389 additional resources as execution resources, and to define the
100390 corresponding allocation policies for them. Such resources may have an
100391 implementation-defined effect on task dispatching.
100392
100393 9.a/2
100394 Implementation defined: The effect of implementation-defined
100395 execution resources on task dispatching.
100396
100397 10
100398 An implementation may place implementation-defined restrictions on tasks
100399 whose active priority is in the Interrupt_Priority range.
100400
100401 10.a/3
100402 Ramification: {AI05-0229-1AI05-0229-1} For example, on some
100403 operating systems, it might be necessary to disallow them
100404 altogether. This permission applies to tasks whose priority
100405 is set to interrupt level for any reason: via an aspect, via a
100406 call to Dynamic_Priorities.Set_Priority, or via priority
100407 inheritance.
100408
100409 10.1/2
100410 {AI95-00321-01AI95-00321-01} [For optimization purposes,] an
100411 implementation may alter the points at which task dispatching occurs, in
100412 an implementation-defined manner. However, a delay_statement always
100413 corresponds to at least one task dispatching point.
100414
100415 NOTES
100416
100417 11/3
100418 7 {AI05-0299-1AI05-0299-1} Clause *note 9:: specifies under which
100419 circumstances a task becomes ready. The ready state is affected by
100420 the rules for task activation and termination, delay statements,
100421 and entry calls. When a task is not ready, it is said to be
100422 blocked.
100423
100424 12
100425 8 An example of a possible implementation-defined execution
100426 resource is a page of physical memory, which needs to be loaded
100427 with a particular page of virtual memory before a task can continue
100428 execution.
100429
100430 13
100431 9 The ready queues are purely conceptual; there is no requirement
100432 that such lists physically exist in an implementation.
100433
100434 14
100435 10 While a task is running, it is not on any ready queue. Any
100436 time the task that is running on a processor is added to a ready
100437 queue, a new running task is selected for that processor.
100438
100439 15
100440 11 In a multiprocessor system, a task can be on the ready queues
100441 of more than one processor. At the extreme, if several processors
100442 share the same set of ready tasks, the contents of their ready
100443 queues is identical, and so they can be viewed as sharing one ready
100444 queue, and can be implemented that way. [Thus, the dispatching
100445 model covers multiprocessors where dispatching is implemented using
100446 a single ready queue, as well as those with separate dispatching
100447 domains.]
100448
100449 16
100450 12 The priority of a task is determined by rules specified in this
100451 subclause, and under *note D.1::, "*note D.1:: Task Priorities",
100452 *note D.3::, "*note D.3:: Priority Ceiling Locking", and *note
100453 D.5::, "*note D.5:: Dynamic Priorities".
100454
100455 17/2
100456 13 {AI95-00321-01AI95-00321-01} The setting of a task's base
100457 priority as a result of a call to Set_Priority does not always take
100458 effect immediately when Set_Priority is called. The effect of
100459 setting the task's base priority is deferred while the affected
100460 task performs a protected action.
100461
100462 _Wording Changes from Ada 95_
100463
100464 17.a/3
100465 {AI95-00321-01AI95-00321-01} {AI05-0005-1AI05-0005-1} This
100466 description is simplified to describe only the parts of the
100467 dispatching model common to all policies. In particular,
100468 rules about preemption are moved elsewhere. This makes it
100469 easier to add other policies (which might not involve
100470 preemption).
100471
100472 _Incompatibilities With Ada 2005_
100473
100474 17.b/3
100475 {AI05-0166-1AI05-0166-1} Procedure Yield is added to
100476 Dispatching. If Dispatching is referenced in a use_clause,
100477 and an entity E with a defining_identifier of Yield is defined
100478 in a package that is also referenced in a use_clause, the
100479 entity E may no longer be use-visible, resulting in errors.
100480 This should be rare and is easily fixed if it does occur.
100481
100482 \1f
100483 File: aarm2012.info, Node: D.2.2, Next: D.2.3, Prev: D.2.1, Up: D.2
100484
100485 D.2.2 Task Dispatching Pragmas
100486 ------------------------------
100487
100488 1/3
100489 {AI95-00355-01AI95-00355-01} {AI05-0299-1AI05-0299-1} [This subclause
100490 allows a single task dispatching policy to be defined for all
100491 priorities, or the range of priorities to be split into subranges that
100492 are assigned individual dispatching policies.]
100493
100494 _Syntax_
100495
100496 2
100497 The form of a pragma Task_Dispatching_Policy is as follows:
100498
100499 3
100500 pragma Task_Dispatching_Policy(policy_identifier);
100501
100502 3.1/2
100503 {AI95-00355-01AI95-00355-01} The form of a pragma
100504 Priority_Specific_Dispatching is as follows:
100505
100506 3.2/2
100507 pragma Priority_Specific_Dispatching (
100508 policy_identifier, first_priority_expression, last_priority_
100509 expression);
100510
100511 _Name Resolution Rules_
100512
100513 3.3/2
100514 {AI95-00355-01AI95-00355-01} The expected type for
100515 first_priority_expression and last_priority_expression is Integer.
100516
100517 _Legality Rules_
100518
100519 4/2
100520 {AI95-00321-01AI95-00321-01} {AI95-00355-01AI95-00355-01} The
100521 policy_identifier used in a pragma Task_Dispatching_Policy shall be the
100522 name of a task dispatching policy.
100523
100524 4.a/2
100525 This paragraph was deleted.
100526
100527 4.1/2
100528 {AI95-00355-01AI95-00355-01} The policy_identifier used in a pragma
100529 Priority_Specific_Dispatching shall be the name of a task dispatching
100530 policy.
100531
100532 4.2/2
100533 {AI95-00355-01AI95-00355-01} Both first_priority_expression and
100534 last_priority_expression shall be static expressions in the range of
100535 System.Any_Priority; last_priority_expression shall have a value greater
100536 than or equal to first_priority_expression.
100537
100538 _Static Semantics_
100539
100540 4.3/2
100541 {AI95-00355-01AI95-00355-01} Pragma Task_Dispatching_Policy specifies
100542 the single task dispatching policy.
100543
100544 4.4/2
100545 {AI95-00355-01AI95-00355-01} Pragma Priority_Specific_Dispatching
100546 specifies the task dispatching policy for the specified range of
100547 priorities. Tasks with base priorities within the range of priorities
100548 specified in a Priority_Specific_Dispatching pragma have their active
100549 priorities determined according to the specified dispatching policy.
100550 Tasks with active priorities within the range of priorities specified in
100551 a Priority_Specific_Dispatching pragma are dispatched according to the
100552 specified dispatching policy.
100553
100554 4.b/2
100555 Reason: {AI95-00355-01AI95-00355-01} Each ready queue is
100556 managed by exactly one policy. Anything else would be chaos.
100557 The ready queue is determined by the active priority.
100558 However, how the active priority is calculated is determined
100559 by the policy; in order to break out of this circle, we have
100560 to say that the active priority is calculated by the method
100561 determined by the policy of the base priority.
100562
100563 4.5/3
100564 {AI95-00355-01AI95-00355-01} {AI05-0262-1AI05-0262-1} If a partition
100565 contains one or more Priority_Specific_Dispatching pragmas, the
100566 dispatching policy for priorities not covered by any
100567 Priority_Specific_Dispatching pragmas is FIFO_Within_Priorities.
100568
100569 _Post-Compilation Rules_
100570
100571 5/2
100572 {AI95-00355-01AI95-00355-01} A Task_Dispatching_Policy pragma is a
100573 configuration pragma. A Priority_Specific_Dispatching pragma is a
100574 configuration pragma.
100575
100576 5.1/2
100577 {AI95-00355-01AI95-00355-01} The priority ranges specified in more than
100578 one Priority_Specific_Dispatching pragma within the same partition shall
100579 not be overlapping.
100580
100581 5.2/2
100582 {AI95-00355-01AI95-00355-01} If a partition contains one or more
100583 Priority_Specific_Dispatching pragmas it shall not contain a
100584 Task_Dispatching_Policy pragma.
100585
100586 6/2
100587 This paragraph was deleted.{AI95-00333-01AI95-00333-01}
100588
100589 _Dynamic Semantics_
100590
100591 7/2
100592 {AI95-00355-01AI95-00355-01} [A task dispatching policy specifies the
100593 details of task dispatching that are not covered by the basic task
100594 dispatching model. These rules govern when tasks are inserted into and
100595 deleted from the ready queues.] A single task dispatching policy is
100596 specified by a Task_Dispatching_Policy pragma. Pragma
100597 Priority_Specific_Dispatching assigns distinct dispatching policies to
100598 subranges of System.Any_Priority.
100599
100600 7.1/2
100601 {AI95-00355-01AI95-00355-01} If neither pragma applies to any of the
100602 program units comprising a partition, the task dispatching policy for
100603 that partition is unspecified.
100604
100605 7.2/3
100606 {AI95-00355-01AI95-00355-01} {AI05-0262-1AI05-0262-1} If a partition
100607 contains one or more Priority_Specific_Dispatching pragmas, a task
100608 dispatching point occurs for the currently running task of a processor
100609 whenever there is a nonempty ready queue for that processor with a
100610 higher priority than the priority of the running task.
100611
100612 7.a/3
100613 Discussion: {AI05-0005-1AI05-0005-1} If we have priority
100614 specific dispatching then we want preemption across the entire
100615 range of priorities. That prevents higher priority tasks from
100616 being blocked by lower priority tasks that have a different
100617 policy. On the other hand, if we have a single policy for the
100618 entire partition, we want the characteristics of that policy
100619 to apply for preemption; specifically, we might not require
100620 any preemption. Note that policy
100621 Non_Preemptive_FIFO_Within_Priorities is not allowed in a
100622 priority specific dispatching pragma.
100623
100624 7.3/2
100625 {AI95-00355-01AI95-00355-01} A task that has its base priority changed
100626 may move from one dispatching policy to another. It is immediately
100627 subject to the new dispatching policy.
100628
100629 7.b/2
100630 Ramification: Once subject to the new dispatching policy, it
100631 may be immediately preempted or dispatched, according the
100632 rules of the new policy.
100633
100634 Paragraphs 7 through 13 were moved to D.2.3.
100635
100636 _Implementation Requirements_
100637
100638 14.1/2
100639 {AI95-00333-01AI95-00333-01} {AI95-00355-01AI95-00355-01} An
100640 implementation shall allow, for a single partition, both the locking
100641 policy (see *note D.3::) to be specified as Ceiling_Locking and also one
100642 or more Priority_Specific_Dispatching pragmas to be given.
100643
100644 _Documentation Requirements_
100645
100646 Paragraphs 14 through 16 were moved to D.2.3.
100647
100648 17.a/2
100649 This paragraph was deleted.
100650
100651 _Implementation Permissions_
100652
100653 18/2
100654 {AI95-00256-01AI95-00256-01} Implementations are allowed to define other
100655 task dispatching policies, but need not support more than one task
100656 dispatching policy per partition.
100657
100658 19/2
100659 {AI95-00355-01AI95-00355-01} An implementation need not support pragma
100660 Priority_Specific_Dispatching if it is infeasible to support it in the
100661 target environment.
100662
100663 19.a/2
100664 Implementation defined: Implementation defined task
100665 dispatching policies.
100666
100667 NOTES
100668
100669 Paragraphs 19 through 21 were deleted.
100670
100671 _Extensions to Ada 95_
100672
100673 22.a/2
100674 {AI95-00333-01AI95-00333-01} Amendment Correction: It is no
100675 longer required to specify Ceiling_Locking with the
100676 language-defined task dispatching policies; we only require
100677 that implementations allow them to be used together.
100678
100679 22.b/3
100680 {AI95-00355-01AI95-00355-01} {AI05-0005-1AI05-0005-1} Pragma
100681 Priority_Specific_Dispatching is new; it allows the
100682 specification of different policies for different priorities.
100683
100684 _Wording Changes from Ada 95_
100685
100686 22.c/2
100687 {AI95-00256-01AI95-00256-01} Clarified that an implementation
100688 need support only one task dispatching policy (of any kind,
100689 language-defined or otherwise) per partition.
100690
100691 22.d/3
100692 {AI95-00321-01AI95-00321-01} {AI05-0005-1AI05-0005-1} This
100693 description is simplified to describe only the rules for the
100694 Task_Dispatching_Policy pragma that are common to all
100695 policies. In particular, rules about preemption are moved
100696 elsewhere. This makes it easier to add other policies (which
100697 might not involve preemption).
100698
100699 \1f
100700 File: aarm2012.info, Node: D.2.3, Next: D.2.4, Prev: D.2.2, Up: D.2
100701
100702 D.2.3 Preemptive Dispatching
100703 ----------------------------
100704
100705 1/3
100706 {AI95-00321-01AI95-00321-01} {AI05-0299-1AI05-0299-1} [This subclause
100707 defines a preemptive task dispatching policy.]
100708
100709 _Static Semantics_
100710
100711 2/2
100712 {AI95-00355-01AI95-00355-01} The policy_identifier
100713 FIFO_Within_Priorities is a task dispatching policy.
100714
100715 _Dynamic Semantics_
100716
100717 3/2
100718 {AI95-00321-01AI95-00321-01} When FIFO_Within_Priorities is in effect,
100719 modifications to the ready queues occur only as follows:
100720
100721 4/2
100722 * {AI95-00321-01AI95-00321-01} When a blocked task becomes ready, it
100723 is added at the tail of the ready queue for its active priority.
100724
100725 5/2
100726 * When the active priority of a ready task that is not running
100727 changes, or the setting of its base priority takes effect, the task
100728 is removed from the ready queue for its old active priority and is
100729 added at the tail of the ready queue for its new active priority,
100730 except in the case where the active priority is lowered due to the
100731 loss of inherited priority, in which case the task is added at the
100732 head of the ready queue for its new active priority.
100733
100734 6/2
100735 * When the setting of the base priority of a running task takes
100736 effect, the task is added to the tail of the ready queue for its
100737 active priority.
100738
100739 7/2
100740 * When a task executes a delay_statement that does not result in
100741 blocking, it is added to the tail of the ready queue for its active
100742 priority.
100743
100744 7.a/2
100745 Ramification: If the delay does result in blocking, the task
100746 moves to the "delay queue", not to the ready queue.
100747
100748 8/2
100749 {AI95-00321-01AI95-00321-01} Each of the events specified above is a
100750 task dispatching point (see *note D.2.1::).
100751
100752 9/2
100753 {AI95-00321-01AI95-00321-01} A task dispatching point occurs for the
100754 currently running task of a processor whenever there is a nonempty ready
100755 queue for that processor with a higher priority than the priority of the
100756 running task. The currently running task is said to be preempted and it
100757 is added at the head of the ready queue for its active priority.
100758
100759 _Implementation Requirements_
100760
100761 10/2
100762 {AI95-00333-01AI95-00333-01} An implementation shall allow, for a single
100763 partition, both the task dispatching policy to be specified as
100764 FIFO_Within_Priorities and also the locking policy (see *note D.3::) to
100765 be specified as Ceiling_Locking.
100766
100767 10.a/2
100768 Reason: This is the preferred combination of the
100769 FIFO_Within_Priorities policy with a locking policy, and we
100770 want that combination to be portable.
100771
100772 _Documentation Requirements_
100773
100774 11/2
100775 {AI95-00321-01AI95-00321-01} Priority inversion is the duration for
100776 which a task remains at the head of the highest priority nonempty ready
100777 queue while the processor executes a lower priority task. The
100778 implementation shall document:
100779
100780 12/2
100781 * The maximum priority inversion a user task can experience due to
100782 activity of the implementation (on behalf of lower priority tasks),
100783 and
100784
100785 12.a/2
100786 Documentation Requirement: The maximum priority inversion a
100787 user task can experience from the implementation.
100788
100789 13/2
100790 * whether execution of a task can be preempted by the implementation
100791 processing of delay expirations for lower priority tasks, and if
100792 so, for how long.
100793
100794 13.a/2
100795 Documentation Requirement: The amount of time that a task can
100796 be preempted for processing on behalf of lower-priority tasks.
100797
100798 NOTES
100799
100800 14/2
100801 14 {AI95-00321-01AI95-00321-01} If the active priority of a
100802 running task is lowered due to loss of inherited priority (as it is
100803 on completion of a protected operation) and there is a ready task
100804 of the same active priority that is not running, the running task
100805 continues to run (provided that there is no higher priority task).
100806
100807 15/2
100808 15 {AI95-00321-01AI95-00321-01} Setting the base priority of a
100809 ready task causes the task to move to the tail of the queue for its
100810 active priority, regardless of whether the active priority of the
100811 task actually changes.
100812
100813 _Wording Changes from Ada 95_
100814
100815 15.a/2
100816 {AI95-00321-01AI95-00321-01} This subclause is new; it mainly
100817 consists of text that was found in *note D.2.1:: and *note
100818 D.2.2:: in Ada 95. This was separated out so the definition
100819 of additional policies was easier.
100820
100821 15.b/2
100822 {AI95-00333-01AI95-00333-01} We require that implementations
100823 allow this policy and Ceiling_Locking together.
100824
100825 15.c/2
100826 {AI95-00355-01AI95-00355-01} We explicitly defined
100827 FIFO_Within_Priorities to be a task dispatching policy.
100828
100829 \1f
100830 File: aarm2012.info, Node: D.2.4, Next: D.2.5, Prev: D.2.3, Up: D.2
100831
100832 D.2.4 Non-Preemptive Dispatching
100833 --------------------------------
100834
100835 1/3
100836 {AI95-00298-01AI95-00298-01} {AI05-0299-1AI05-0299-1} [This subclause
100837 defines a non-preemptive task dispatching policy.]
100838
100839 _Static Semantics_
100840
100841 2/2
100842 {AI95-00298-01AI95-00298-01} {AI95-00355-01AI95-00355-01} The
100843 policy_identifier Non_Preemptive_FIFO_Within_Priorities is a task
100844 dispatching policy.
100845
100846 2.1/3
100847 {AI05-0166-1AI05-0166-1} The following language-defined library package
100848 exists:
100849
100850 2.2/3
100851 package Ada.Dispatching.Non_Preemptive is
100852 pragma Preelaborate(Non_Preemptive);
100853 procedure Yield_To_Higher;
100854 procedure Yield_To_Same_Or_Higher renames Yield;
100855 end Ada.Dispatching.Non_Preemptive;
100856
100857 2.3/3
100858 {AI05-0166-1AI05-0166-1} {AI05-0264-1AI05-0264-1} A call of
100859 Yield_To_Higher is a task dispatching point for this policy. If the
100860 task at the head of the highest priority ready queue has a higher active
100861 priority than the calling task, then the calling task is preempted.
100862
100863 2.a/3
100864 Ramification: For language-defined policies other than
100865 Non_Preemptive_FIFO_Within_Priorities, a higher priority task
100866 should never be on a ready queue while a lower priority task
100867 is executed. Thus, for such policies, Yield_To_Higher does
100868 nothing.
100869
100870 2.b/3
100871 Yield_To_Higher is not a potentially blocking operation; it
100872 can be used during a protected operation. That is allowed, as
100873 under the predefined Ceiling_Locking policy any task with a
100874 higher priority than the protected operation cannot call the
100875 operation (that would violate the locking policy). An
100876 implementation-defined locking policy may need to define the
100877 semantics of Yield_To_Higher differently.
100878
100879 _Legality Rules_
100880
100881 3/2
100882 {AI95-00355-01AI95-00355-01} Non_Preemptive_FIFO_Within_Priorities shall
100883 not be specified as the policy_identifier of pragma
100884 Priority_Specific_Dispatching (see *note D.2.2::).
100885
100886 3.a/2
100887 Reason: The non-preemptive nature of this policy could cause
100888 the policies of higher priority tasks to malfunction, missing
100889 deadlines and having unlimited priority inversion. That would
100890 render the use of such policies impotent and misleading. As
100891 such, this policy only makes sense for a complete system.
100892
100893 _Dynamic Semantics_
100894
100895 4/2
100896 {AI95-00298-01AI95-00298-01} When Non_Preemptive_FIFO_Within_Priorities
100897 is in effect, modifications to the ready queues occur only as follows:
100898
100899 5/2
100900 * {AI95-00298-01AI95-00298-01} When a blocked task becomes ready, it
100901 is added at the tail of the ready queue for its active priority.
100902
100903 6/2
100904 * When the active priority of a ready task that is not running
100905 changes, or the setting of its base priority takes effect, the task
100906 is removed from the ready queue for its old active priority and is
100907 added at the tail of the ready queue for its new active priority.
100908
100909 7/2
100910 * When the setting of the base priority of a running task takes
100911 effect, the task is added to the tail of the ready queue for its
100912 active priority.
100913
100914 8/2
100915 * When a task executes a delay_statement that does not result in
100916 blocking, it is added to the tail of the ready queue for its active
100917 priority.
100918
100919 8.a/2
100920 Ramification: If the delay does result in blocking, the task
100921 moves to the "delay queue", not to the ready queue.
100922
100923 9/3
100924 {AI05-0166-1AI05-0166-1} For this policy, blocking or termination of a
100925 task, a delay_statement, a call to Yield_To_Higher, and a call to
100926 Yield_To_Same_Or_Higher or Yield are the only task dispatching points
100927 (see *note D.2.1::).
100928
100929 9.a/3
100930 Ramification: {AI05-0166-1AI05-0166-1} A delay_statement is
100931 always a task dispatching point even if it is not blocking.
100932 Similarly, a call to Yield_To_Higher is never blocking, but it
100933 is a task dispatching point In each of these cases, they can
100934 cause the current task to stop running (it is still ready).
100935 Otherwise, the running task continues to run until it is
100936 blocked.
100937
100938 _Implementation Requirements_
100939
100940 10/2
100941 {AI95-00333-01AI95-00333-01} An implementation shall allow, for a single
100942 partition, both the task dispatching policy to be specified as
100943 Non_Preemptive_FIFO_Within_Priorities and also the locking policy (see
100944 *note D.3::) to be specified as Ceiling_Locking.
100945
100946 10.a/2
100947 Reason: This is the preferred combination of the
100948 Non_Preemptive_FIFO_Within_Priorities policy with a locking
100949 policy, and we want that combination to be portable.
100950
100951 _Implementation Permissions_
100952
100953 11/3
100954 {AI95-00298-01AI95-00298-01} {AI05-0229-1AI05-0229-1}
100955 {AI05-0269-1AI05-0269-1} Since implementations are allowed to round all
100956 ceiling priorities in subrange System.Priority to System.Priority'Last
100957 (see *note D.3::), an implementation may allow a task of a partition
100958 using the Non_Premptive_FIFO_Within_Priorities policy to execute within
100959 a protected object without raising its active priority provided the
100960 associated protected unit does not contain any subprograms with aspects
100961 Interrupt_Handler or Attach_Handler specified, nor does the unit have
100962 aspect Interrupt_Priority specified. When the locking policy (see *note
100963 D.3::) is Ceiling_Locking, an implementation taking advantage of this
100964 permission shall ensure that a call to Yield_to_Higher that occurs
100965 within a protected action uses the ceiling priority of the protected
100966 object (rather than the active priority of the task) when determining
100967 whether to preempt the task.
100968
100969 11.a.1/3
100970 Reason: {AI05-0269-1AI05-0269-1} We explicitly require that
100971 the ceiling priority be used in calls to Yield_to_Higher in
100972 order to prevent a risk of priority inversion and consequent
100973 loss of mutual exclusion when Yield_to_Higher is used in a
100974 protected object. This requirement might lessen the value of
100975 the permission (as the current Ceiling_Priority will have to
100976 be maintained in the TCB), but loss of mutual exclusion cannot
100977 be tolerated. The primary benefit of the permission
100978 (eliminating the need for preemption at the end of a protected
100979 action) is still available. As noted above, an
100980 implementation-defined locking policy will need to specify the
100981 semantics of Yield_to_Higher, including this case.
100982
100983 _Extensions to Ada 95_
100984
100985 11.a/2
100986 {AI95-00298-01AI95-00298-01} {AI95-00355-01AI95-00355-01}
100987 Policy Non_Preemptive_FIFO_Within_Priorities is new.
100988
100989 _Extensions to Ada 2005_
100990
100991 11.b/3
100992 {AI05-0166-1AI05-0166-1} Package Dispatching.Non_Preemptive is
100993 new.
100994
100995 \1f
100996 File: aarm2012.info, Node: D.2.5, Next: D.2.6, Prev: D.2.4, Up: D.2
100997
100998 D.2.5 Round Robin Dispatching
100999 -----------------------------
101000
101001 1/3
101002 {AI95-00355-01AI95-00355-01} {AI05-0299-1AI05-0299-1} [This subclause
101003 defines the task dispatching policy Round_Robin_Within_Priorities and
101004 the package Round_Robin.]
101005
101006 _Static Semantics_
101007
101008 2/2
101009 {AI95-00355-01AI95-00355-01} The policy_identifier
101010 Round_Robin_Within_Priorities is a task dispatching policy.
101011
101012 3/2
101013 {AI95-00355-01AI95-00355-01} The following language-defined library
101014 package exists:
101015
101016 4/2
101017 with System;
101018 with Ada.Real_Time;
101019 package Ada.Dispatching.Round_Robin is
101020 Default_Quantum : constant Ada.Real_Time.Time_Span :=
101021 implementation-defined;
101022 procedure Set_Quantum (Pri : in System.Priority;
101023 Quantum : in Ada.Real_Time.Time_Span);
101024 procedure Set_Quantum (Low, High : in System.Priority;
101025 Quantum : in Ada.Real_Time.Time_Span);
101026 function Actual_Quantum (Pri : System.Priority)
101027 return Ada.Real_Time.Time_Span;
101028 function Is_Round_Robin (Pri : System.Priority) return Boolean;
101029 end Ada.Dispatching.Round_Robin;
101030
101031 4.a.1/2
101032 Implementation defined: The value of Default_Quantum in
101033 Dispatching.Round_Robin.
101034
101035 5/2
101036 {AI95-00355-01AI95-00355-01} When task dispatching policy
101037 Round_Robin_Within_Priorities is the single policy in effect for a
101038 partition, each task with priority in the range of
101039 System.Interrupt_Priority is dispatched according to policy
101040 FIFO_Within_Priorities.
101041
101042 _Dynamic Semantics_
101043
101044 6/2
101045 {AI95-00355-01AI95-00355-01} The procedures Set_Quantum set the required
101046 Quantum value for a single priority level Pri or a range of priority
101047 levels Low .. High. If no quantum is set for a Round Robin priority
101048 level, Default_Quantum is used.
101049
101050 7/2
101051 {AI95-00355-01AI95-00355-01} The function Actual_Quantum returns the
101052 actual quantum used by the implementation for the priority level Pri.
101053
101054 8/3
101055 {AI95-00355-01AI95-00355-01} {AI05-0264-1AI05-0264-1} The function
101056 Is_Round_Robin returns True if priority Pri is covered by task
101057 dispatching policy Round_Robin_Within_Priorities; otherwise, it returns
101058 False.
101059
101060 9/2
101061 {AI95-00355-01AI95-00355-01} A call of Actual_Quantum or Set_Quantum
101062 raises exception Dispatching.Dispatching_Policy_Error if a predefined
101063 policy other than Round_Robin_Within_Priorities applies to the specified
101064 priority or any of the priorities in the specified range.
101065
101066 10/2
101067 {AI95-00355-01AI95-00355-01} For Round_Robin_Within_Priorities, the
101068 dispatching rules for FIFO_Within_Priorities apply with the following
101069 additional rules:
101070
101071 11/2
101072 * When a task is added or moved to the tail of the ready queue for
101073 its base priority, it has an execution time budget equal to the
101074 quantum for that priority level. This will also occur when a
101075 blocked task becomes executable again.
101076
101077 12/2
101078 * When a task is preempted (by a higher priority task) and is added
101079 to the head of the ready queue for its priority level, it retains
101080 its remaining budget.
101081
101082 13/2
101083 * While a task is executing, its budget is decreased by the amount of
101084 execution time it uses. The accuracy of this accounting is the
101085 same as that for execution time clocks (see *note D.14::).
101086
101087 13.a/2
101088 Ramification: Note that this happens even when the task is
101089 executing at a higher, inherited priority, and even if that
101090 higher priority is dispatched by a different policy than round
101091 robin.
101092
101093 14/2
101094 * When a task has exhausted its budget and is without an inherited
101095 priority (and is not executing within a protected operation), it is
101096 moved to the tail of the ready queue for its priority level. This
101097 is a task dispatching point.
101098
101099 14.a/2
101100 Ramification: In this case, it will be given a budget as
101101 described in the first bullet.
101102
101103 14.b/2
101104 The rules for FIFO_Within_Priority (to which these bullets are
101105 added) say that a task that has its base priority set to a
101106 Round Robin priority is moved to the tail of the ready queue
101107 for its new priority level, and then will be given a budget as
101108 described in the first bullet. That happens whether or not
101109 the task's original base priority was a Round Robin priority.
101110
101111 _Implementation Requirements_
101112
101113 15/2
101114 {AI95-00333-01AI95-00333-01} {AI95-00355-01AI95-00355-01} An
101115 implementation shall allow, for a single partition, both the task
101116 dispatching policy to be specified as Round_Robin_Within_Priorities and
101117 also the locking policy (see *note D.3::) to be specified as
101118 Ceiling_Locking.
101119
101120 15.a/2
101121 Reason: This is the preferred combination of the
101122 Round_Robin_Within_Priorities policy with a locking policy,
101123 and we want that combination to be portable.
101124
101125 _Documentation Requirements_
101126
101127 16/2
101128 {AI95-00355-01AI95-00355-01} An implementation shall document the
101129 quantum values supported.
101130
101131 16.a.1/2
101132 Documentation Requirement: The quantum values supported for
101133 round robin dispatching.
101134
101135 17/2
101136 {AI95-00355-01AI95-00355-01} An implementation shall document the
101137 accuracy with which it detects the exhaustion of the budget of a task.
101138
101139 17.a.1/2
101140 Documentation Requirement: The accuracy of the detection of
101141 the exhaustion of the budget of a task for round robin
101142 dispatching.
101143
101144 NOTES
101145
101146 18/2
101147 16 {AI95-00355-01AI95-00355-01} Due to implementation constraints,
101148 the quantum value returned by Actual_Quantum might not be identical
101149 to that set with Set_Quantum.
101150
101151 19/2
101152 17 {AI95-00355-01AI95-00355-01} A task that executes continuously
101153 with an inherited priority will not be subject to round robin
101154 dispatching.
101155
101156 _Extensions to Ada 95_
101157
101158 19.a/2
101159 {AI95-00355-01AI95-00355-01} Policy
101160 Round_Robin_Within_Priorities and package
101161 Dispatching.Round_Robin are new.
101162
101163 \1f
101164 File: aarm2012.info, Node: D.2.6, Prev: D.2.5, Up: D.2
101165
101166 D.2.6 Earliest Deadline First Dispatching
101167 -----------------------------------------
101168
101169 1/2
101170 {AI95-00357-01AI95-00357-01} The deadline of a task is an indication of
101171 the urgency of the task; it represents a point on an ideal physical time
101172 line. The deadline might affect how resources are allocated to the
101173 task.
101174
101175 2/3
101176 {AI95-00357-01AI95-00357-01} {AI05-0229-1AI05-0229-1}
101177 {AI05-0299-1AI05-0299-1} This subclause defines a package for
101178 representing the deadline of a task and a dispatching policy that
101179 defines Earliest Deadline First (EDF) dispatching. An aspect is defined
101180 to assign an initial deadline to a task.
101181
101182 2.a/3
101183 Discussion: {AI05-0229-1AI05-0229-1} This aspect is the only
101184 way of assigning an initial deadline to a task so that its
101185 activation can be controlled by EDF scheduling. This is
101186 similar to the way aspect Priority is used to give an initial
101187 priority to a task.
101188
101189 _Language Design Principles_
101190
101191 2.b/3
101192 {AI95-00357-01AI95-00357-01} {AI05-0299-1AI05-0299-1} To
101193 predict the behavior of a multi-tasking program it is
101194 necessary to control access to the processor which is
101195 preemptive, and shared objects which are usually
101196 non-preemptive and embodied in protected objects. Two common
101197 dispatching policies for the processor are fixed priority and
101198 EDF. The most effective control over shared objects is via
101199 preemption levels. With a pure priority scheme a single
101200 notion of priority is used for processor dispatching and
101201 preemption levels. With EDF and similar schemes priority is
101202 used for preemption levels (only), with another measure used
101203 for dispatching. T.P. Baker showed (Real-Time Systems, March
101204 1991, vol. 3, num. 1, Stack-Based Scheduling of Realtime
101205 Processes) that for EDF a newly released task should only
101206 preempt the currently running task if it has an earlier
101207 deadline and a higher preemption level than any currently
101208 "locked" protected object. The rules of this subclause
101209 implement this scheme including the case where the newly
101210 released task should execute before some existing tasks but
101211 not preempt the currently executing task.
101212
101213 Paragraphs 3 through 6 were moved to *note Annex J::, "*note Annex J::
101214 Obsolescent Features".
101215
101216 _Static Semantics_
101217
101218 7/2
101219 {AI95-00357-01AI95-00357-01} The policy_identifier EDF_Across_Priorities
101220 is a task dispatching policy.
101221
101222 8/2
101223 {AI95-00357-01AI95-00357-01} The following language-defined library
101224 package exists:
101225
101226 9/2
101227 with Ada.Real_Time;
101228 with Ada.Task_Identification;
101229 package Ada.Dispatching.EDF is
101230 subtype Deadline is Ada.Real_Time.Time;
101231 Default_Deadline : constant Deadline :=
101232 Ada.Real_Time.Time_Last;
101233 procedure Set_Deadline (D : in Deadline;
101234 T : in Ada.Task_Identification.Task_Id :=
101235 Ada.Task_Identification.Current_Task);
101236 procedure Delay_Until_And_Set_Deadline (
101237 Delay_Until_Time : in Ada.Real_Time.Time;
101238 Deadline_Offset : in Ada.Real_Time.Time_Span);
101239 function Get_Deadline (T : Ada.Task_Identification.Task_Id :=
101240 Ada.Task_Identification.Current_Task) return Deadline;
101241 end Ada.Dispatching.EDF;
101242
101243 9.1/3
101244 {AI05-0229-1AI05-0229-1} For a task type (including the anonymous type
101245 of a single_task_declaration) or subprogram, the following
101246 language-defined representation aspect may be specified:
101247
101248 9.2/3
101249 Relative_Deadline
101250 The aspect Relative_Deadline is an expression, which
101251 shall be of type Real_Time.Time_Span.
101252
101253 9.a/3
101254 Aspect Description for Relative_Deadline: Task parameter used
101255 in Earliest Deadline First Dispatching.
101256
101257 _Legality Rules_
101258
101259 9.3/3
101260 {AI05-0229-1AI05-0229-1} The Relative_Deadline aspect shall not be
101261 specified on a task interface type.
101262
101263 _Post-Compilation Rules_
101264
101265 10/2
101266 {AI95-00357-01AI95-00357-01} If the EDF_Across_Priorities policy is
101267 specified for a partition, then the Ceiling_Locking policy (see *note
101268 D.3::) shall also be specified for the partition.
101269
101270 11/2
101271 {AI95-00357-01AI95-00357-01} If the EDF_Across_Priorities policy appears
101272 in a Priority_Specific_Dispatching pragma (see *note D.2.2::) in a
101273 partition, then the Ceiling_Locking policy (see *note D.3::) shall also
101274 be specified for the partition.
101275
101276 11.a/2
101277 Reason: Unlike the other language-defined dispatching
101278 policies, the semantic description of EDF_Across_Priorities
101279 assumes Ceiling_Locking (and a ceiling priority) in order to
101280 make the mapping between deadlines and priorities work. Thus,
101281 we require both policies to be specified if EDF is used in the
101282 partition.
101283
101284 _Dynamic Semantics_
101285
101286 12/3
101287 {AI95-00357-01AI95-00357-01} {AI05-0229-1AI05-0229-1} The
101288 Relative_Deadline aspect has no effect if it is specified for a
101289 subprogram other than the main subprogram.
101290
101291 13/3
101292 {AI95-00357-01AI95-00357-01} {AI05-0229-1AI05-0229-1} The initial
101293 absolute deadline of a task for which aspect Relative_Deadline is
101294 specified is the value of Real_Time.Clock + the expression that is the
101295 value of the aspect, where this entire expression, including the call of
101296 Real_Time.Clock, is evaluated between task creation and the start of its
101297 activation. If the aspect Relative_Deadline is not specified, then the
101298 initial absolute deadline of a task is the value of Default_Deadline.
101299 The environment task is also given an initial deadline by this rule,
101300 using the value of the Relative_Deadline aspect of the main subprogram
101301 (if any).
101302
101303 13.a/2
101304 Proof: The environment task is a normal task by *note 10.2::,
101305 so of course this rule applies to it.
101306
101307 14/2
101308 {AI95-00357-01AI95-00357-01} The procedure Set_Deadline changes the
101309 absolute deadline of the task to D. The function Get_Deadline returns
101310 the absolute deadline of the task.
101311
101312 15/2
101313 {AI95-00357-01AI95-00357-01} The procedure Delay_Until_And_Set_Deadline
101314 delays the calling task until time Delay_Until_Time. When the task
101315 becomes runnable again it will have deadline Delay_Until_Time +
101316 Deadline_Offset.
101317
101318 16/2
101319 {AI95-00357-01AI95-00357-01} On a system with a single processor, the
101320 setting of the deadline of a task to the new value occurs immediately at
101321 the first point that is outside the execution of a protected action. If
101322 the task is currently on a ready queue it is removed and re-entered on
101323 to the ready queue determined by the rules defined below.
101324
101325 17/2
101326 {AI95-00357-01AI95-00357-01} When EDF_Across_Priorities is specified for
101327 priority range Low..High all ready queues in this range are ordered by
101328 deadline. The task at the head of a queue is the one with the earliest
101329 deadline.
101330
101331 18/2
101332 {AI95-00357-01AI95-00357-01} A task dispatching point occurs for the
101333 currently running task T to which policy EDF_Across_Priorities applies:
101334
101335 19/2
101336 * when a change to the deadline of T occurs;
101337
101338 20/2
101339 * there is a task on the ready queue for the active priority of T
101340 with a deadline earlier than the deadline of T; or
101341
101342 21/2
101343 * there is a nonempty ready queue for that processor with a higher
101344 priority than the active priority of the running task.
101345
101346 22/2
101347 In these cases, the currently running task is said to be preempted and
101348 is returned to the ready queue for its active priority.
101349
101350 23/2
101351 {AI95-00357-01AI95-00357-01} For a task T to which policy
101352 EDF_Across_Priorities applies, the base priority is not a source of
101353 priority inheritance; the active priority when first activated or while
101354 it is blocked is defined as the maximum of the following:
101355
101356 24/2
101357 * the lowest priority in the range specified as EDF_Across_Priorities
101358 that includes the base priority of T;
101359
101360 25/2
101361 * the priorities, if any, currently inherited by T;
101362
101363 26/3
101364 * {AI05-0055-1AI05-0055-1} the highest priority P, if any, less than
101365 the base priority of T such that one or more tasks are executing
101366 within a protected object with ceiling priority P and task T has an
101367 earlier deadline than all such tasks; and furthermore T has an
101368 earlier deadline than all other tasks on ready queues with
101369 priorities in the given EDF_Across_Priorities range that are
101370 strictly less than P.
101371
101372 26.a/2
101373 Ramification: The active priority of T might be lower than its
101374 base priority.
101375
101376 27/2
101377 {AI95-00357-01AI95-00357-01} When a task T is first activated or becomes
101378 unblocked, it is added to the ready queue corresponding to this active
101379 priority. Until it becomes blocked again, the active priority of T
101380 remains no less than this value; it will exceed this value only while it
101381 is inheriting a higher priority.
101382
101383 27.a/2
101384 Discussion: These rules ensure that a task executing in a
101385 protected object is preempted only by a task with a shorter
101386 deadline and a higher base priority. This matches the
101387 traditional preemption level description without the need to
101388 define a new kind of protected object locking.
101389
101390 28/2
101391 {AI95-00357-01AI95-00357-01} When the setting of the base priority of a
101392 ready task takes effect and the new priority is in a range specified as
101393 EDF_Across_Priorities, the task is added to the ready queue
101394 corresponding to its new active priority, as determined above.
101395
101396 29/2
101397 {AI95-00357-01AI95-00357-01} For all the operations defined in
101398 Dispatching.EDF, Tasking_Error is raised if the task identified by T has
101399 terminated. Program_Error is raised if the value of T is Null_Task_Id.
101400
101401 _Bounded (Run-Time) Errors_
101402
101403 30/2
101404 {AI95-00357-01AI95-00357-01} If EDF_Across_Priorities is specified for
101405 priority range Low..High, it is a bounded error to declare a protected
101406 object with ceiling priority Low or to assign the value Low to attribute
101407 'Priority. In either case either Program_Error is raised or the ceiling
101408 of the protected object is assigned the value Low+1.
101409
101410 _Erroneous Execution_
101411
101412 31/2
101413 {AI95-00357-01AI95-00357-01} If a value of Task_Id is passed as a
101414 parameter to any of the subprograms of this package and the
101415 corresponding task object no longer exists, the execution of the program
101416 is erroneous.
101417
101418 _Documentation Requirements_
101419
101420 32/2
101421 {AI95-00357-01AI95-00357-01} On a multiprocessor, the implementation
101422 shall document any conditions that cause the completion of the setting
101423 of the deadline of a task to be delayed later than what is specified for
101424 a single processor.
101425
101426 32.a.1/2
101427 Documentation Requirement: Any conditions that cause the
101428 completion of the setting of the deadline of a task to be
101429 delayed for a multiprocessor.
101430
101431 NOTES
101432
101433 33/3
101434 18 {AI95-00357-01AI95-00357-01} {AI05-0264-1AI05-0264-1} If two
101435 adjacent priority ranges, A..B and B+1..C are specified to have
101436 policy EDF_Across_Priorities, then this is not equivalent to this
101437 policy being specified for the single range, A..C.
101438
101439 34/2
101440 19 {AI95-00357-01AI95-00357-01} The above rules implement the
101441 preemption-level protocol (also called Stack Resource Policy
101442 protocol) for resource sharing under EDF dispatching. The
101443 preemption-level for a task is denoted by its base priority. The
101444 definition of a ceiling preemption-level for a protected object
101445 follows the existing rules for ceiling locking.
101446
101447 34.a/2
101448 Implementation Note: {AI95-00357-01AI95-00357-01} An
101449 implementation may support additional dispatching policies by
101450 replacing absolute deadline with an alternative measure of
101451 urgency.
101452
101453 _Extensions to Ada 95_
101454
101455 34.b/2
101456 {AI95-00357-01AI95-00357-01} Policy EDF_Across_Priorities and
101457 package Dispatching.EDF are new.
101458
101459 _Extensions to Ada 2005_
101460
101461 34.c/3
101462 {AI05-0229-1AI05-0229-1} Aspect Relative_Deadline is new;
101463 pragma Relative_Deadline is now obsolescent.
101464
101465 _Wording Changes from Ada 2005_
101466
101467 34.d/3
101468 {AI05-0055-1AI05-0055-1} Correction: Corrected definition of
101469 active priority to avoid deadline inversion in an unusual
101470 case.
101471
101472 \1f
101473 File: aarm2012.info, Node: D.3, Next: D.4, Prev: D.2, Up: Annex D
101474
101475 D.3 Priority Ceiling Locking
101476 ============================
101477
101478 1/3
101479 {AI05-0299-1AI05-0299-1} [This subclause specifies the interactions
101480 between priority task scheduling and protected object ceilings. This
101481 interaction is based on the concept of the ceiling priority of a
101482 protected object.]
101483
101484 _Syntax_
101485
101486 2
101487 The form of a pragma Locking_Policy is as follows:
101488
101489 3
101490 pragma Locking_Policy(policy_identifier);
101491
101492 _Legality Rules_
101493
101494 4
101495 The policy_identifier shall either be Ceiling_Locking or an
101496 implementation-defined identifier.
101497
101498 4.a
101499 Implementation defined: Implementation-defined policy_
101500 identifiers allowed in a pragma Locking_Policy.
101501
101502 _Post-Compilation Rules_
101503
101504 5
101505 A Locking_Policy pragma is a configuration pragma.
101506
101507 _Dynamic Semantics_
101508
101509 6/2
101510 {8652/00738652/0073} {AI95-00091-01AI95-00091-01}
101511 {AI95-00327-01AI95-00327-01} [A locking policy specifies the details of
101512 protected object locking. All protected objects have a priority. The
101513 locking policy specifies the meaning of the priority of a protected
101514 object, and the relationships between these priorities and task
101515 priorities. In addition, the policy specifies the state of a task when
101516 it executes a protected action, and how its active priority is affected
101517 by the locking.] The locking policy is specified by a Locking_Policy
101518 pragma. For implementation-defined locking policies, the meaning of the
101519 priority of a protected object is implementation defined. If no
101520 Locking_Policy pragma applies to any of the program units comprising a
101521 partition, the locking policy for that partition, as well as the meaning
101522 of the priority of a protected object, are implementation defined.
101523
101524 6.a/2
101525 Implementation defined: The locking policy if no
101526 Locking_Policy pragma applies to any unit of a partition.
101527
101528 6.1/3
101529 {AI95-00327-01AI95-00327-01} {AI05-0229-1AI05-0229-1} The expression
101530 specified for the Priority or Interrupt_Priority aspect (see *note
101531 D.1::) is evaluated as part of the creation of the corresponding
101532 protected object and converted to the subtype System.Any_Priority or
101533 System.Interrupt_Priority, respectively. The value of the expression is
101534 the initial priority of the corresponding protected object. If no
101535 Priority or Interrupt_Priority aspect is specified for a protected
101536 object, the initial priority is specified by the locking policy.
101537
101538 7
101539 There is one predefined locking policy, Ceiling_Locking; this policy is
101540 defined as follows:
101541
101542 8/3
101543 * {AI95-00327-01AI95-00327-01} {AI05-0229-1AI05-0229-1} Every
101544 protected object has a ceiling priority, which is determined by
101545 either a Priority or Interrupt_Priority aspect as defined in *note
101546 D.1::, or by assignment to the Priority attribute as described in
101547 *note D.5.2::. The ceiling priority of a protected object (or
101548 ceiling, for short) is an upper bound on the active priority a task
101549 can have when it calls protected operations of that protected
101550 object.
101551
101552 9/2
101553 * {AI95-00327-01AI95-00327-01} The initial ceiling priority of a
101554 protected object is equal to the initial priority for that object.
101555
101556 10/3
101557 * {AI95-00327-01AI95-00327-01} {AI05-0229-1AI05-0229-1} If an
101558 Interrupt_Handler or Attach_Handler aspect (see *note C.3.1::) is
101559 specified for a protected subprogram of a protected type that does
101560 not have the Interrupt_Priority aspect specified, the initial
101561 priority of protected objects of that type is implementation
101562 defined, but in the range of the subtype System.Interrupt_Priority.
101563
101564 10.a
101565 Implementation defined: Default ceiling priorities.
101566
101567 11/3
101568 * {AI95-00327-01AI95-00327-01} {AI05-0229-1AI05-0229-1} If neither
101569 aspect Priority nor Interrupt_Priority is specified for a protected
101570 type, and no protected subprogram of the type has aspect
101571 Interrupt_Handler or Attach_Handler specified, then the initial
101572 priority of the corresponding protected object is
101573 System.Priority'Last.
101574
101575 12
101576 * While a task executes a protected action, it inherits the ceiling
101577 priority of the corresponding protected object.
101578
101579 13
101580 * When a task calls a protected operation, a check is made that its
101581 active priority is not higher than the ceiling of the corresponding
101582 protected object; Program_Error is raised if this check fails.
101583
101584 _Bounded (Run-Time) Errors_
101585
101586 13.1/2
101587 {AI95-00327-01AI95-00327-01} Following any change of priority, it is a
101588 bounded error for the active priority of any task with a call queued on
101589 an entry of a protected object to be higher than the ceiling priority of
101590 the protected object. In this case one of the following applies:
101591
101592 13.2/2
101593 * at any time prior to executing the entry body Program_Error is
101594 raised in the calling task;
101595
101596 13.3/2
101597 * when the entry is open the entry body is executed at the ceiling
101598 priority of the protected object;
101599
101600 13.4/2
101601 * when the entry is open the entry body is executed at the ceiling
101602 priority of the protected object and then Program_Error is raised
101603 in the calling task; or
101604
101605 13.5/2
101606 * when the entry is open the entry body is executed at the ceiling
101607 priority of the protected object that was in effect when the entry
101608 call was queued.
101609
101610 13.a.1/2
101611 Ramification: Note that the error is "blamed" on the task that
101612 did the entry call, not the task that changed the priority of
101613 the task or protected object. This seems to make sense for
101614 the case of changing the priority of a task blocked on a call,
101615 since if the Set_Priority had happened a little bit sooner,
101616 before the task queued a call, the entry-calling task would
101617 get the error. Similarly, there is no reason not to raise the
101618 priority of a task that is executing in an abortable_part, so
101619 long as its priority is lowered before it gets to the end and
101620 needs to cancel the call. The priority might need to be
101621 lowered to allow it to remove the call from the entry queue,
101622 in order to avoid violating the ceiling. This seems
101623 relatively harmless, since there is an error, and the task is
101624 about to start raising an exception anyway.
101625
101626 _Implementation Permissions_
101627
101628 14
101629 The implementation is allowed to round all ceilings in a certain
101630 subrange of System.Priority or System.Interrupt_Priority up to the top
101631 of that subrange, uniformly.
101632
101633 14.a
101634 Discussion: For example, an implementation might use
101635 Priority'Last for all ceilings in Priority, and
101636 Interrupt_Priority'Last for all ceilings in
101637 Interrupt_Priority. This would be equivalent to having two
101638 ceiling priorities for protected objects, "nonpreemptible" and
101639 "noninterruptible", and is an allowed behavior.
101640
101641 14.b
101642 Note that the implementation cannot choose a subrange that
101643 crosses the boundary between normal and interrupt priorities.
101644
101645 15/2
101646 {AI95-00256-01AI95-00256-01} Implementations are allowed to define other
101647 locking policies, but need not support more than one locking policy per
101648 partition.
101649
101650 16
101651 [Since implementations are allowed to place restrictions on code that
101652 runs at an interrupt-level active priority (see *note C.3.1:: and *note
101653 D.2.1::), the implementation may implement a language feature in terms
101654 of a protected object with an implementation-defined ceiling, but the
101655 ceiling shall be no less than Priority'Last.]
101656
101657 16.a
101658 Implementation defined: The ceiling of any protected object
101659 used internally by the implementation.
101660
101661 16.b
101662 Proof: This permission follows from the fact that the
101663 implementation can place restrictions on interrupt handlers
101664 and on any other code that runs at an interrupt-level active
101665 priority.
101666
101667 16.c
101668 The implementation might protect a storage pool with a
101669 protected object whose ceiling is Priority'Last, which would
101670 cause allocators to fail when evaluated at interrupt priority.
101671 Note that the ceiling of such an object has to be at least
101672 Priority'Last, since there is no permission for allocators to
101673 fail when evaluated at a noninterrupt priority.
101674
101675 _Implementation Advice_
101676
101677 17
101678 The implementation should use names that end with "_Locking" for
101679 implementation-defined locking policies.
101680
101681 17.a/2
101682 Implementation Advice: Names that end with "_Locking" should
101683 be used for implementation-defined locking policies.
101684
101685 NOTES
101686
101687 18
101688 20 While a task executes in a protected action, it can be
101689 preempted only by tasks whose active priorities are higher than the
101690 ceiling priority of the protected object.
101691
101692 19
101693 21 If a protected object has a ceiling priority in the range of
101694 Interrupt_Priority, certain interrupts are blocked while protected
101695 actions of that object execute. In the extreme, if the ceiling is
101696 Interrupt_Priority'Last, all blockable interrupts are blocked
101697 during that time.
101698
101699 20
101700 22 The ceiling priority of a protected object has to be in the
101701 Interrupt_Priority range if one of its procedures is to be used as
101702 an interrupt handler (see *note C.3::).
101703
101704 21
101705 23 When specifying the ceiling of a protected object, one should
101706 choose a value that is at least as high as the highest active
101707 priority at which tasks can be executing when they call protected
101708 operations of that object. In determining this value the following
101709 factors, which can affect active priority, should be considered:
101710 the effect of Set_Priority, nested protected operations, entry
101711 calls, task activation, and other implementation-defined factors.
101712
101713 22
101714 24 Attaching a protected procedure whose ceiling is below the
101715 interrupt hardware priority to an interrupt causes the execution of
101716 the program to be erroneous (see *note C.3.1::).
101717
101718 23
101719 25 On a single processor implementation, the ceiling priority
101720 rules guarantee that there is no possibility of deadlock involving
101721 only protected subprograms (excluding the case where a protected
101722 operation calls another protected operation on the same protected
101723 object).
101724
101725 _Extensions to Ada 95_
101726
101727 23.a/2
101728 {AI95-00327-01AI95-00327-01} All protected objects now have a
101729 priority, which is the value of the Priority attribute of
101730 *note D.5.2::. How this value is interpreted depends on the
101731 locking policy; for instance, the ceiling priority is derived
101732 from this value when the locking policy is Ceiling_Locking.
101733
101734 _Wording Changes from Ada 95_
101735
101736 23.b/2
101737 {8652/00738652/0073} {AI95-00091-01AI95-00091-01} Corrigendum:
101738 Corrected the wording to reflect that pragma Locking_Policy
101739 cannot be inside of a program unit.
101740
101741 23.c/2
101742 {AI95-00256-01AI95-00256-01} Clarified that an implementation
101743 need support only one locking policy (of any kind,
101744 language-defined or otherwise) per partition.
101745
101746 23.d/2
101747 {AI95-00327-01AI95-00327-01} The bounded error for the
101748 priority of a task being higher than the ceiling of an object
101749 it is currently in was moved here from *note D.5::, so that it
101750 applies no matter how the situation arises.
101751
101752 _Wording Changes from Ada 2005_
101753
101754 23.e/3
101755 {AI05-0229-1AI05-0229-1} Revised to use aspects Priority and
101756 Interrupt_Priority as pragmas Priority and Interrupt_Priority
101757 are now obsolescent.
101758
101759 \1f
101760 File: aarm2012.info, Node: D.4, Next: D.5, Prev: D.3, Up: Annex D
101761
101762 D.4 Entry Queuing Policies
101763 ==========================
101764
101765 1/3
101766 {8652/00748652/0074} {AI95-00068-01AI95-00068-01}
101767 {AI05-0299-1AI05-0299-1} [ This subclause specifies a mechanism for a
101768 user to choose an entry queuing policy. It also defines two such
101769 policies. Other policies are implementation defined.]
101770
101771 1.a
101772 Implementation defined: Implementation-defined queuing
101773 policies.
101774
101775 _Syntax_
101776
101777 2
101778 The form of a pragma Queuing_Policy is as follows:
101779
101780 3
101781 pragma Queuing_Policy(policy_identifier);
101782
101783 _Legality Rules_
101784
101785 4
101786 The policy_identifier shall be either FIFO_Queuing, Priority_Queuing or
101787 an implementation-defined identifier.
101788
101789 _Post-Compilation Rules_
101790
101791 5
101792 A Queuing_Policy pragma is a configuration pragma.
101793
101794 _Dynamic Semantics_
101795
101796 6
101797 [A queuing policy governs the order in which tasks are queued for entry
101798 service, and the order in which different entry queues are considered
101799 for service.] The queuing policy is specified by a Queuing_Policy
101800 pragma.
101801
101802 6.a
101803 Ramification: The queuing policy includes entry queuing order,
101804 the choice among open alternatives of a selective_accept, and
101805 the choice among queued entry calls of a protected object when
101806 more than one entry_barrier condition is True.
101807
101808 7/2
101809 {AI95-00355-01AI95-00355-01} Two queuing policies, FIFO_Queuing and
101810 Priority_Queuing, are language defined. If no Queuing_Policy pragma
101811 applies to any of the program units comprising the partition, the
101812 queuing policy for that partition is FIFO_Queuing. The rules for this
101813 policy are specified in *note 9.5.3:: and *note 9.7.1::.
101814
101815 8
101816 The Priority_Queuing policy is defined as follows:
101817
101818 9
101819 * The calls to an entry [(including a member of an entry family)] are
101820 queued in an order consistent with the priorities of the calls.
101821 The priority of an entry call is initialized from the active
101822 priority of the calling task at the time the call is made, but can
101823 change later. Within the same priority, the order is consistent
101824 with the calling (or requeuing, or priority setting) time (that is,
101825 a FIFO order).
101826
101827 10/1
101828 * {8652/00758652/0075} {AI95-00205-01AI95-00205-01} After a call is
101829 first queued, changes to the active priority of a task do not
101830 affect the priority of the call, unless the base priority of the
101831 task is set while the task is blocked on an entry call.
101832
101833 11
101834 * When the base priority of a task is set (see *note D.5::), if the
101835 task is blocked on an entry call, and the call is queued, the
101836 priority of the call is updated to the new active priority of the
101837 calling task. This causes the call to be removed from and then
101838 reinserted in the queue at the new active priority.
101839
101840 11.a
101841 Reason: A task is blocked on an entry call if the entry call
101842 is simple, conditional, or timed. If the call came from the
101843 triggering_statement of an asynchronous_select, or a requeue
101844 thereof, then the task is not blocked on that call; such calls
101845 do not have their priority updated. Thus, there can exist
101846 many queued calls from a given task (caused by many nested
101847 ATC's), but a task can be blocked on only one call at a time.
101848
101849 11.b
101850 A previous version of Ada 9X required queue reordering in the
101851 asynchronous_select case as well. If the call corresponds to
101852 a "synchronous" entry call, then the task is blocked while
101853 queued, and it makes good sense to move it up in the queue if
101854 its priority is raised.
101855
101856 11.c
101857 However, if the entry call is "asynchronous," that is, it is
101858 due to an asynchronous_select whose triggering_statement is an
101859 entry call, then the task is not waiting for this entry call,
101860 so the placement of the entry call on the queue is irrelevant
101861 to the rate at which the task proceeds.
101862
101863 11.d
101864 Furthermore, when an entry is used for asynchronous_selects,
101865 it is almost certain to be a "broadcast" entry or have only
101866 one caller at a time. For example, if the entry is used to
101867 notify tasks of a mode switch, then all tasks on the entry
101868 queue would be signaled when the mode changes. Similarly, if
101869 it is indicating some interrupting event such as a control-C,
101870 all tasks sensitive to the interrupt will want to be informed
101871 that the event occurred. Hence, the order on such a queue is
101872 essentially irrelevant.
101873
101874 11.e
101875 Given the above, it seems an unnecessary semantic and
101876 implementation complexity to specify that asynchronous queued
101877 calls are moved in response to dynamic priority changes.
101878 Furthermore, it is somewhat inconsistent, since the call was
101879 originally queued based on the active priority of the task,
101880 but dynamic priority changes are changing the base priority of
101881 the task, and only indirectly the active priority. We say
101882 explicitly that asynchronous queued calls are not affected by
101883 normal changes in active priority during the execution of an
101884 abortable_part. Saying that, if a change in the base priority
101885 affects the active priority, then we do want the calls
101886 reordered, would be inconsistent. It would also require the
101887 implementation to maintain a readily accessible list of all
101888 queued calls which would not otherwise be necessary.
101889
101890 11.f
101891 Several rules were removed or simplified when we changed the
101892 rules so that calls due to asynchronous_selects are never
101893 moved due to intervening changes in active priority, be they
101894 due to protected actions, some other priority inheritance, or
101895 changes in the base priority.
101896
101897 12
101898 * When more than one condition of an entry_barrier of a protected
101899 object becomes True, and more than one of the respective queues is
101900 nonempty, the call with the highest priority is selected. If more
101901 than one such call has the same priority, the call that is queued
101902 on the entry whose declaration is first in textual order in the
101903 protected_definition is selected. For members of the same entry
101904 family, the one with the lower family index is selected.
101905
101906 13
101907 * If the expiration time of two or more open delay_alternatives is
101908 the same and no other accept_alternatives are open, the
101909 sequence_of_statements of the delay_alternative that is first in
101910 textual order in the selective_accept is executed.
101911
101912 14
101913 * When more than one alternative of a selective_accept is open and
101914 has queued calls, an alternative whose queue has the
101915 highest-priority call at its head is selected. If two or more open
101916 alternatives have equal-priority queued calls, then a call on the
101917 entry in the accept_alternative that is first in textual order in
101918 the selective_accept is selected.
101919
101920 _Implementation Permissions_
101921
101922 15/2
101923 {AI95-00256-01AI95-00256-01} Implementations are allowed to define other
101924 queuing policies, but need not support more than one queuing policy per
101925 partition.
101926
101927 15.a.1/2
101928 Discussion: {8652/01168652/0116} {AI95-00069-01AI95-00069-01}
101929 {AI95-00256-01AI95-00256-01} This rule is really redundant, as
101930 *note 10.1.5:: allows an implementation to limit the use of
101931 configuration pragmas to an empty environment. In that case,
101932 there would be no way to have multiple policies in a
101933 partition.
101934
101935 15.1/2
101936 {AI95-00188-02AI95-00188-02} Implementations are allowed to defer the
101937 reordering of entry queues following a change of base priority of a task
101938 blocked on the entry call if it is not practical to reorder the queue
101939 immediately.
101940
101941 15.a.2/2
101942 Reason: Priority change is immediate, but the effect of the
101943 change on entry queues can be deferred. That is necessary in
101944 order to implement priority changes on top of a non-Ada
101945 kernel.
101946
101947 15.a.3/2
101948 Discussion: The reordering should occur as soon as the blocked
101949 task can itself perform the reinsertion into the entry queue.
101950
101951 _Implementation Advice_
101952
101953 16
101954 The implementation should use names that end with "_Queuing" for
101955 implementation-defined queuing policies.
101956
101957 16.a/2
101958 Implementation Advice: Names that end with "_Queuing" should
101959 be used for implementation-defined queuing policies.
101960
101961 _Wording Changes from Ada 95_
101962
101963 16.b/2
101964 {8652/00748652/0074} {AI95-00068-01AI95-00068-01} Corrigendum:
101965 Corrected the number of queuing policies defined.
101966
101967 16.c/2
101968 {8652/00758652/0075} {AI95-00205-01AI95-00205-01} Corrigendum:
101969 Corrected so that a call of Set_Priority in an abortable part
101970 does not change the priority of the triggering entry call.
101971
101972 16.d/2
101973 {AI95-00188-02AI95-00188-02} Added a permission to defer queue
101974 reordering when the base priority of a task is changed. This
101975 is a counterpart to stronger requirements on the
101976 implementation of priority change.
101977
101978 16.e/2
101979 {AI95-00256-01AI95-00256-01} Clarified that an implementation
101980 need support only one queuing policy (of any kind,
101981 language-defined or otherwise) per partition.
101982
101983 16.f/2
101984 {AI95-00355-01AI95-00355-01} Fixed wording to make clear that
101985 pragma never appears inside of a unit; rather it "applies to"
101986 the unit.
101987
101988 \1f
101989 File: aarm2012.info, Node: D.5, Next: D.6, Prev: D.4, Up: Annex D
101990
101991 D.5 Dynamic Priorities
101992 ======================
101993
101994 1/3
101995 {AI95-00327-01AI95-00327-01} {AI05-0299-1AI05-0299-1} [This subclause
101996 describes how the priority of an entity can be modified or queried at
101997 run time.]
101998
101999 _Wording Changes from Ada 95_
102000
102001 1.a/3
102002 {AI95-00327-01AI95-00327-01} {AI05-0299-1AI05-0299-1} This
102003 subclause is turned into two subclauses. This subclause
102004 introduction is new.
102005
102006 * Menu:
102007
102008 * D.5.1 :: Dynamic Priorities for Tasks
102009 * D.5.2 :: Dynamic Priorities for Protected Objects
102010
102011 \1f
102012 File: aarm2012.info, Node: D.5.1, Next: D.5.2, Up: D.5
102013
102014 D.5.1 Dynamic Priorities for Tasks
102015 ----------------------------------
102016
102017 1/3
102018 {AI05-0299-1AI05-0299-1} [This subclause describes how the base priority
102019 of a task can be modified or queried at run time.]
102020
102021 _Static Semantics_
102022
102023 2
102024 The following language-defined library package exists:
102025
102026 3/2
102027 {AI95-00362-01AI95-00362-01} with System;
102028 with Ada.Task_Identification; -- See *note C.7.1::
102029 package Ada.Dynamic_Priorities is
102030 pragma Preelaborate(Dynamic_Priorities);
102031
102032 4
102033 procedure Set_Priority(Priority : in System.Any_Priority;
102034 T : in Ada.Task_Identification.Task_Id :=
102035 Ada.Task_Identification.Current_Task);
102036
102037 5
102038 function Get_Priority (T : Ada.Task_Identification.Task_Id :=
102039 Ada.Task_Identification.Current_Task)
102040 return System.Any_Priority;
102041
102042 6
102043 end Ada.Dynamic_Priorities;
102044
102045 _Dynamic Semantics_
102046
102047 7
102048 The procedure Set_Priority sets the base priority of the specified task
102049 to the specified Priority value. Set_Priority has no effect if the task
102050 is terminated.
102051
102052 8
102053 The function Get_Priority returns T's current base priority.
102054 Tasking_Error is raised if the task is terminated.
102055
102056 8.a
102057 Reason: There is no harm in setting the priority of a
102058 terminated task. A previous version of Ada 9X made this a
102059 run-time error. However, there is little difference between
102060 setting the priority of a terminated task, and setting the
102061 priority of a task that is about to terminate very soon;
102062 neither case should be an error. Furthermore, the run-time
102063 check is not necessarily feasible to implement on all systems,
102064 since priority changes might be deferred due to
102065 inter-processor communication overhead, so the error might not
102066 be detected until after Set_Priority has returned.
102067
102068 8.b
102069 However, we wish to allow implementations to avoid storing
102070 "extra" information about terminated tasks. Therefore, we
102071 make Get_Priority of a terminated task raise an exception; the
102072 implementation need not continue to store the priority of a
102073 task that has terminated.
102074
102075 9
102076 Program_Error is raised by Set_Priority and Get_Priority if T is equal
102077 to Null_Task_Id.
102078
102079 10/2
102080 {AI95-00188-02AI95-00188-02} On a system with a single processor, the
102081 setting of the base priority of a task T to the new value occurs
102082 immediately at the first point when T is outside the execution of a
102083 protected action.
102084
102085 10.a/2
102086 Implementation Note: {AI95-00188-02AI95-00188-02} The priority
102087 change is immediate if the target task is on a delay queue or
102088 a ready queue outside of a protected action. However,
102089 consider when Set_Priority is called by a task T1 to set the
102090 priority of T2, if T2 is blocked, waiting on an entry call
102091 queued on a protected object, the entry queue needs to be
102092 reordered. Since T1 might have a priority that is higher than
102093 the ceiling of the protected object, T1 cannot, in general, do
102094 the reordering. One way to implement this is to wake T2 up
102095 and have T2 do the work. This is similar to the disentangling
102096 of queues that needs to happen when a high-priority task
102097 aborts a lower-priority task, which might have a call queued
102098 on a protected object with a low ceiling. We have an
102099 Implementation Permission in *note D.4:: to allow this
102100 implementation. We could have required an immediate priority
102101 change if on a ready queue during a protected action, but that
102102 would have required extra checks for ceiling violations to
102103 meet Bounded (Run-Time) Error requirements of *note D.3:: and
102104 potentially could cause a protected action to be abandoned in
102105 the middle (by raising Program_Error). That seems bad.
102106
102107 10.b
102108 Reason: A previous version of Ada 9X made it a run-time error
102109 for a high-priority task to set the priority of a
102110 lower-priority task that has a queued call on a protected
102111 object with a low ceiling. This was changed because:
102112
102113 10.c
102114 * The check was not feasible to implement on all systems,
102115 since priority changes might be deferred due to
102116 inter-processor communication overhead. The calling task
102117 would continue to execute without finding out whether the
102118 operation succeeded or not.
102119
102120 10.d
102121 * The run-time check would tend to cause intermittent
102122 system failures -- how is the caller supposed to know
102123 whether the other task happens to have a queued call at
102124 any given time? Consider for example an interrupt that
102125 needs to trigger a priority change in some task. The
102126 interrupt handler could not safely call Set_Priority
102127 without knowing exactly what the other task is doing, or
102128 without severely restricting the ceilings used in the
102129 system. If the interrupt handler wants to hand the job
102130 off to a third task whose job is to call Set_Priority,
102131 this won't help, because one would normally want the
102132 third task to have high priority.
102133
102134 Paragraph 11 was deleted.
102135
102136 _Erroneous Execution_
102137
102138 12
102139 If any subprogram in this package is called with a parameter T that
102140 specifies a task object that no longer exists, the execution of the
102141 program is erroneous.
102142
102143 12.a
102144 Ramification: Note that this rule overrides the above rule
102145 saying that Program_Error is raised on Get_Priority of a
102146 terminated task. If the task object still exists, and the
102147 task is terminated, Get_Priority raises Program_Error.
102148 However, if the task object no longer exists, calling
102149 Get_Priority causes erroneous execution.
102150
102151 _Documentation Requirements_
102152
102153 12.1/2
102154 {AI95-00188-02AI95-00188-02} On a multiprocessor, the implementation
102155 shall document any conditions that cause the completion of the setting
102156 of the priority of a task to be delayed later than what is specified for
102157 a single processor.
102158
102159 12.a.1/2
102160 Documentation Requirement: Any conditions that cause the
102161 completion of the setting of the priority of a task to be
102162 delayed for a multiprocessor.
102163
102164 _Metrics_
102165
102166 13
102167 The implementation shall document the following metric:
102168
102169 14
102170 * The execution time of a call to Set_Priority, for the nonpreempting
102171 case, in processor clock cycles. This is measured for a call that
102172 modifies the priority of a ready task that is not running (which
102173 cannot be the calling one), where the new base priority of the
102174 affected task is lower than the active priority of the calling
102175 task, and the affected task is not on any entry queue and is not
102176 executing a protected operation.
102177
102178 14.a/2
102179 Documentation Requirement: The metrics for Set_Priority.
102180
102181 NOTES
102182
102183 15/2
102184 26 {AI95-00321-01AI95-00321-01} Setting a task's base priority
102185 affects task dispatching. First, it can change the task's active
102186 priority. Second, under the FIFO_Within_Priorities policy it
102187 always causes the task to move to the tail of the ready queue
102188 corresponding to its active priority, even if the new base priority
102189 is unchanged.
102190
102191 16
102192 27 Under the priority queuing policy, setting a task's base
102193 priority has an effect on a queued entry call if the task is
102194 blocked waiting for the call. That is, setting the base priority
102195 of a task causes the priority of a queued entry call from that task
102196 to be updated and the call to be removed and then reinserted in the
102197 entry queue at the new priority (see *note D.4::), unless the call
102198 originated from the triggering_statement of an asynchronous_select.
102199
102200 17
102201 28 The effect of two or more Set_Priority calls executed in
102202 parallel on the same task is defined as executing these calls in
102203 some serial order.
102204
102205 17.a
102206 Proof: This follows from the general reentrancy requirements
102207 stated near the beginning of *note Annex A::, "*note Annex A::
102208 Predefined Language Environment".
102209
102210 18/3
102211 29 {AI05-0092-1AI05-0092-1} The rule for when Tasking_Error is
102212 raised for Set_Priority or Get_Priority is different from the rule
102213 for when Tasking_Error is raised on an entry call (see *note
102214 9.5.3::). In particular, querying the priority of a completed or
102215 an abnormal task is allowed, so long as the task is not yet
102216 terminated, and setting the priority of a task is allowed for any
102217 task state (including for terminated tasks).
102218
102219 19
102220 30 Changing the priorities of a set of tasks can be performed by a
102221 series of calls to Set_Priority for each task separately. For this
102222 to work reliably, it should be done within a protected operation
102223 that has high enough ceiling priority to guarantee that the
102224 operation completes without being preempted by any of the affected
102225 tasks.
102226
102227 _Extensions to Ada 95_
102228
102229 19.a/2
102230 {AI95-00188-02AI95-00188-02} Amendment Correction: Priority
102231 changes are now required to be done immediately so long as the
102232 target task is not on an entry queue.
102233
102234 19.b/2
102235 {AI95-00362-01AI95-00362-01} Dynamic_Priorities is now
102236 Preelaborated, so it can be used in preelaborated units.
102237
102238 _Wording Changes from Ada 95_
102239
102240 19.c/3
102241 {AI95-00327-01AI95-00327-01} {AI05-0299-1AI05-0299-1} This Ada
102242 95 subclause was moved down a level. The paragraph numbers
102243 are the same as those for *note D.5:: in Ada 95.
102244
102245 19.d/2
102246 {AI95-00321-01AI95-00321-01} There is no "standard" policy
102247 anymore, so that phrase was replaced by the name of a specific
102248 policy in the notes.
102249
102250 19.e/2
102251 {AI95-00327-01AI95-00327-01} The bounded error for the
102252 priority of a task being higher than the ceiling of an object
102253 it is currently in was moved to *note D.3::, so that it
102254 applies no matter how the situation arises.
102255
102256 \1f
102257 File: aarm2012.info, Node: D.5.2, Prev: D.5.1, Up: D.5
102258
102259 D.5.2 Dynamic Priorities for Protected Objects
102260 ----------------------------------------------
102261
102262 1/3
102263 {AI95-00327-01AI95-00327-01} {AI05-0299-1AI05-0299-1} This subclause
102264 specifies how the priority of a protected object can be modified or
102265 queried at run time.
102266
102267 _Static Semantics_
102268
102269 2/2
102270 {AI95-00327-01AI95-00327-01} The following attribute is defined for a
102271 prefix P that denotes a protected object:
102272
102273 3/2
102274 P'Priority
102275 {AI95-00327-01AI95-00327-01} Denotes a non-aliased
102276 component of the protected object P. This component is of
102277 type System.Any_Priority and its value is the priority of
102278 P. P'Priority denotes a variable if and only if P denotes
102279 a variable. A reference to this attribute shall appear
102280 only within the body of P.
102281
102282 4/2
102283 {AI95-00327-01AI95-00327-01} The initial value of this attribute is the
102284 initial value of the priority of the protected object[, and can be
102285 changed by an assignment].
102286
102287 _Dynamic Semantics_
102288
102289 5/3
102290 {AI95-00327-01AI95-00327-01} {AI05-0264-1AI05-0264-1} If the locking
102291 policy Ceiling_Locking (see *note D.3::) is in effect, then the ceiling
102292 priority of a protected object P is set to the value of P'Priority at
102293 the end of each protected action of P.
102294
102295 6/3
102296 {AI95-00445-01AI95-00445-01} {AI05-0229-1AI05-0229-1} If the locking
102297 policy Ceiling_Locking is in effect, then for a protected object P with
102298 either an Attach_Handler or Interrupt_Handler aspect specified for one
102299 of its procedures, a check is made that the value to be assigned to
102300 P'Priority is in the range System.Interrupt_Priority. If the check
102301 fails, Program_Error is raised.
102302
102303 _Metrics_
102304
102305 7/2
102306 {AI95-00327-01AI95-00327-01} The implementation shall document the
102307 following metric:
102308
102309 8/2
102310 * The difference in execution time of calls to the following
102311 procedures in protected object P:
102312
102313 9/2
102314 protected P is
102315 procedure Do_Not_Set_Ceiling (Pr : System.Any_Priority);
102316 procedure Set_Ceiling (Pr : System.Any_Priority);
102317 end P;
102318
102319 10/2
102320 protected body P is
102321 procedure Do_Not_Set_Ceiling (Pr : System.Any_Priority) is
102322 begin
102323 null;
102324 end;
102325 procedure Set_Ceiling (Pr : System.Any_Priority) is
102326 begin
102327 P'Priority := Pr;
102328 end;
102329 end P;
102330
102331 10.a/2
102332 Documentation Requirement: The metrics for setting the
102333 priority of a protected object.
102334
102335 NOTES
102336
102337 11/2
102338 31 {AI95-00327-01AI95-00327-01} Since P'Priority is a normal
102339 variable, the value following an assignment to the attribute
102340 immediately reflects the new value even though its impact on the
102341 ceiling priority of P is postponed until completion of the
102342 protected action in which it is executed.
102343
102344 _Extensions to Ada 95_
102345
102346 11.a/2
102347 {AI95-00327-01AI95-00327-01} {AI95-00445-01AI95-00445-01} The
102348 ability to dynamically change and query the priority of a
102349 protected object is new.
102350
102351 \1f
102352 File: aarm2012.info, Node: D.6, Next: D.7, Prev: D.5, Up: Annex D
102353
102354 D.6 Preemptive Abort
102355 ====================
102356
102357 1/3
102358 {AI05-0299-1AI05-0299-1} [This subclause specifies requirements on the
102359 immediacy with which an aborted construct is completed.]
102360
102361 _Dynamic Semantics_
102362
102363 2
102364 On a system with a single processor, an aborted construct is completed
102365 immediately at the first point that is outside the execution of an
102366 abort-deferred operation.
102367
102368 _Documentation Requirements_
102369
102370 3
102371 On a multiprocessor, the implementation shall document any conditions
102372 that cause the completion of an aborted construct to be delayed later
102373 than what is specified for a single processor.
102374
102375 3.a/2
102376 This paragraph was deleted.
102377
102378 3.b/2
102379 Documentation Requirement: On a multiprocessor, any conditions
102380 that cause the completion of an aborted construct to be
102381 delayed later than what is specified for a single processor.
102382
102383 _Metrics_
102384
102385 4
102386 The implementation shall document the following metrics:
102387
102388 5
102389 * The execution time, in processor clock cycles, that it takes for an
102390 abort_statement to cause the completion of the aborted task. This
102391 is measured in a situation where a task T2 preempts task T1 and
102392 aborts T1. T1 does not have any finalization code. T2 shall
102393 verify that T1 has terminated, by means of the Terminated
102394 attribute.
102395
102396 6
102397 * On a multiprocessor, an upper bound in seconds, on the time that
102398 the completion of an aborted task can be delayed beyond the point
102399 that it is required for a single processor.
102400
102401 7/2
102402 * {AI95-00114-01AI95-00114-01} An upper bound on the execution time
102403 of an asynchronous_select, in processor clock cycles. This is
102404 measured between a point immediately before a task T1 executes a
102405 protected operation Pr.Set that makes the condition of an
102406 entry_barrier Pr.Wait True, and the point where task T2 resumes
102407 execution immediately after an entry call to Pr.Wait in an
102408 asynchronous_select. T1 preempts T2 while T2 is executing the
102409 abortable part, and then blocks itself so that T2 can execute. The
102410 execution time of T1 is measured separately, and subtracted.
102411
102412 8
102413 * An upper bound on the execution time of an asynchronous_select, in
102414 the case that no asynchronous transfer of control takes place.
102415 This is measured between a point immediately before a task executes
102416 the asynchronous_select with a nonnull abortable part, and the
102417 point where the task continues execution immediately after it. The
102418 execution time of the abortable part is subtracted.
102419
102420 8.a/2
102421 Documentation Requirement: The metrics for aborts.
102422
102423 _Implementation Advice_
102424
102425 9
102426 Even though the abort_statement is included in the list of potentially
102427 blocking operations (see *note 9.5.1::), it is recommended that this
102428 statement be implemented in a way that never requires the task executing
102429 the abort_statement to block.
102430
102431 9.a/2
102432 Implementation Advice: The abort_statement should not require
102433 the task executing the statement to block.
102434
102435 10
102436 On a multi-processor, the delay associated with aborting a task on
102437 another processor should be bounded; the implementation should use
102438 periodic polling, if necessary, to achieve this.
102439
102440 10.a/2
102441 Implementation Advice: On a multi-processor, the delay
102442 associated with aborting a task on another processor should be
102443 bounded.
102444
102445 NOTES
102446
102447 11
102448 32 Abortion does not change the active or base priority of the
102449 aborted task.
102450
102451 12
102452 33 Abortion cannot be more immediate than is allowed by the rules
102453 for deferral of abortion during finalization and in protected
102454 actions.
102455
102456 \1f
102457 File: aarm2012.info, Node: D.7, Next: D.8, Prev: D.6, Up: Annex D
102458
102459 D.7 Tasking Restrictions
102460 ========================
102461
102462 1/3
102463 {AI05-0299-1AI05-0299-1} [This subclause defines restrictions that can
102464 be used with a pragma Restrictions (see *note 13.12::) to facilitate the
102465 construction of highly efficient tasking run-time systems.]
102466
102467 _Static Semantics_
102468
102469 2
102470 The following restriction_identifiers are language defined:
102471
102472 3/3
102473 {AI05-0013-1AI05-0013-1} {AI05-0216-1AI05-0216-1} No_Task_Hierarchy
102474 No task depends on a master other than the library-level
102475 master.
102476
102477 3.a/3
102478 Ramification: {AI05-0216-1AI05-0216-1} This is equivalent to
102479 saying "no task depends on a master other than the master that
102480 is the execution of the body of the environment task of the
102481 partition", but it is much easier to understand. This is a
102482 post-compilation check, which can be checked at compile-time.
102483
102484 3.b/3
102485 {AI05-0013-1AI05-0013-1} This disallows any function returning
102486 an object with a task part or coextension, even if called at
102487 the library level, as such a task would temporarily depend on
102488 a nested master (the master of the return statement), which is
102489 disallowed by this restriction.
102490
102491 4/3
102492 {8652/00428652/0042} {AI95-00130-01AI95-00130-01}
102493 {AI95-00360-01AI95-00360-01} {AI05-0013-1AI05-0013-1}
102494 No_Nested_Finalization
102495 Objects of a type that needs finalization (see *note
102496 7.6::) are declared only at library level. If an access
102497 type does not have library-level accessibility, then
102498 there are no allocators of the type where the type
102499 determined by the subtype_mark of the subtype_indication
102500 or qualified_expression needs finalization.
102501
102502 4.a/1
102503 This paragraph was deleted.{8652/00428652/0042}
102504 {AI95-00130-01AI95-00130-01}
102505
102506 4.b/3
102507 Ramification: {AI05-0013-1AI05-0013-1} The second sentence
102508 prevents the declaration of objects of access types which
102509 would require nested finalization. It also prevents the
102510 declarations of coextensions that need finalization in a
102511 nested scope. The latter cannot be done by preventing the
102512 declaration of the objects, as it is not necessarily known if
102513 the coextension type needs finalization (it could be a limited
102514 view).
102515
102516 5/3
102517 {AI05-0211-1AI05-0211-1} No_Abort_Statements
102518 There are no abort_statements, and there is no use of a
102519 name denoting Task_Identification.Abort_Task.
102520
102521 6
102522 No_Terminate_Alternatives
102523 There are no selective_accepts with
102524 terminate_alternatives.
102525
102526 7
102527 No_Task_Allocators
102528 There are no allocators for task types or types
102529 containing task subcomponents.
102530
102531 7.1/3
102532 {AI05-0224-1AI05-0224-1} In the case of an initialized
102533 allocator of an access type whose designated type is
102534 class-wide and limited, a check is made that the specific
102535 type of the allocated object has no task subcomponents.
102536 Program_Error is raised if this check fails.
102537
102538 8
102539 No_Implicit_Heap_Allocations
102540 There are no operations that implicitly require heap
102541 storage allocation to be performed by the implementation.
102542 The operations that implicitly require heap storage
102543 allocation are implementation defined.
102544
102545 8.a
102546 Implementation defined: Any operations that implicitly require
102547 heap storage allocation.
102548
102549 9/2
102550 {AI95-00327-01AI95-00327-01} No_Dynamic_Priorities
102551 There are no semantic dependences on the package
102552 Dynamic_Priorities, and no occurrences of the attribute
102553 Priority.
102554
102555 10/3
102556 {AI95-00305-01AI95-00305-01} {AI95-00394-01AI95-00394-01}
102557 {AI05-0013-1AI05-0013-1} {AI05-0211-1AI05-0211-1} No_Dynamic_Attachment
102558 There is no use of a name denoting any of the operations
102559 defined in package Interrupts (Is_Reserved, Is_Attached,
102560 Current_Handler, Attach_Handler, Exchange_Handler,
102561 Detach_Handler, and Reference).
102562
102563 10.a/3
102564 Ramification: {AI05-0013-1AI05-0013-1} This includes 'Access
102565 and 'Address of any of these operations, as well as inherited
102566 versions of these operations.
102567
102568 10.1/3
102569 {AI95-00305-01AI95-00305-01} {AI05-0013-1AI05-0013-1}
102570 No_Local_Protected_Objects
102571 Protected objects are declared only at library level.
102572
102573 10.2/3
102574 {AI95-00297-01AI95-00297-01} {AI05-0013-1AI05-0013-1}
102575 No_Local_Timing_Events
102576 Timing_Events are declared only at library level.
102577
102578 10.3/2
102579 {AI95-00305-01AI95-00305-01} No_Protected_Type_Allocators
102580 There are no allocators for protected types or types
102581 containing protected type subcomponents.
102582
102583 10.4/3
102584 {AI05-0224-1AI05-0224-1} In the case of an initialized
102585 allocator of an access type whose designated type is
102586 class-wide and limited, a check is made that the specific
102587 type of the allocated object has no protected
102588 subcomponents. Program_Error is raised if this check
102589 fails.
102590
102591 10.5/3
102592 {AI95-00305-01AI95-00305-01} {AI05-0211-1AI05-0211-1} No_Relative_Delay
102593 There are no delay_relative_statements, and there is no
102594 use of a name that denotes the Timing_Events.Set_Handler
102595 subprogram that has a Time_Span parameter.
102596
102597 10.6/3
102598 {AI95-00305-01AI95-00305-01} No_Requeue_Statements
102599 There are no requeue_statements.
102600
102601 10.7/3
102602 {AI95-00305-01AI95-00305-01} No_Select_Statements
102603 There are no select_statements.
102604
102605 10.8/3
102606 {AI95-00394-01AI95-00394-01} {AI05-0211-1AI05-0211-1}
102607 No_Specific_Termination_Handlers
102608 There is no use of a name denoting the
102609 Set_Specific_Handler and Specific_Handler subprograms in
102610 Task_Termination.
102611
102612 10.9/3
102613 {AI95-00305-01AI95-00305-01} {AI05-0013-1AI05-0013-1} Simple_Barriers
102614 The Boolean expression in each entry barrier is either a
102615 static expression or a name that statically denotes a
102616 component of the enclosing protected object.
102617
102618 11
102619 The following restriction_parameter_identifiers are language defined:
102620
102621 12
102622 Max_Select_Alternatives
102623 Specifies the maximum number of alternatives in a
102624 selective_accept.
102625
102626 13
102627 Max_Task_Entries
102628 Specifies the maximum number of entries per task. The
102629 bounds of every entry family of a task unit shall be
102630 static, or shall be defined by a discriminant of a
102631 subtype whose corresponding bound is static. [A value of
102632 zero indicates that no rendezvous are possible.]
102633
102634 14
102635 Max_Protected_Entries
102636 Specifies the maximum number of entries per protected
102637 type. The bounds of every entry family of a protected
102638 unit shall be static, or shall be defined by a
102639 discriminant of a subtype whose corresponding bound is
102640 static.
102641
102642 _Dynamic Semantics_
102643
102644 15/2
102645 {8652/00768652/0076} {AI95-00067-01AI95-00067-01}
102646 {AI95-00305-01AI95-00305-01} The following restriction_identifier is
102647 language defined:
102648
102649 15.1/2
102650 {AI95-00305-01AI95-00305-01} {AI95-00394-01AI95-00394-01}
102651 No_Task_Termination
102652 All tasks are nonterminating. It is
102653 implementation-defined what happens if a task attempts to
102654 terminate. If there is a fall-back handler (see C.7.3)
102655 set for the partition it should be called when the first
102656 task attempts to terminate.
102657
102658 15.a.1/2
102659 Implementation defined: When restriction No_Task_Termination
102660 applies to a partition, what happens when a task terminates.
102661
102662 16
102663 The following restriction_parameter_identifiers are language defined:
102664
102665 17/1
102666 {8652/00768652/0076} {AI95-00067-01AI95-00067-01}
102667 Max_Storage_At_Blocking
102668 Specifies the maximum portion [(in storage elements)] of
102669 a task's Storage_Size that can be retained by a blocked
102670 task. If an implementation chooses to detect a violation
102671 of this restriction, Storage_Error should be raised;
102672 otherwise, the behavior is implementation defined.
102673
102674 17.a.1/2
102675 Implementation defined: The behavior when restriction
102676 Max_Storage_At_Blocking is violated.
102677
102678 18/1
102679 {8652/00768652/0076} {AI95-00067-01AI95-00067-01}
102680 Max_Asynchronous_Select_Nesting
102681 Specifies the maximum dynamic nesting level of
102682 asynchronous_selects. A value of zero prevents the use
102683 of any asynchronous_select (*note 9.7.4: S0241.) and, if
102684 a program contains an asynchronous_select (*note 9.7.4:
102685 S0241.), it is illegal. If an implementation chooses to
102686 detect a violation of this restriction for values other
102687 than zero, Storage_Error should be raised; otherwise, the
102688 behavior is implementation defined.
102689
102690 18.a.1/2
102691 Implementation defined: The behavior when restriction
102692 Max_Asynchronous_Select_Nesting is violated.
102693
102694 19/1
102695 {8652/00768652/0076} {AI95-00067-01AI95-00067-01} Max_Tasks
102696 Specifies the maximum number of task creations that may
102697 be executed over the lifetime of a partition, not
102698 counting the creation of the environment task. A value
102699 of zero prevents any task creation and, if a program
102700 contains a task creation, it is illegal. If an
102701 implementation chooses to detect a violation of this
102702 restriction, Storage_Error should be raised; otherwise,
102703 the behavior is implementation defined.
102704
102705 19.a
102706 Ramification: Note that this is not a limit on the number of
102707 tasks active at a given time; it is a limit on the total
102708 number of task creations that occur.
102709
102710 19.b
102711 Implementation Note: We envision an implementation approach
102712 that places TCBs or pointers to them in a fixed-size table,
102713 and never reuses table elements.
102714
102715 19.b.1/2
102716 Implementation defined: The behavior when restriction
102717 Max_Tasks is violated.
102718
102719 19.1/2
102720 {AI95-00305-01AI95-00305-01} Max_Entry_Queue_Length
102721 Max_Entry_Queue_Length defines the maximum number of
102722 calls that are queued on an entry. Violation of this
102723 restriction results in the raising of Program_Error at
102724 the point of the call or requeue.
102725
102726 19.2/3
102727 {AI05-0189-1AI05-0189-1} No_Standard_Allocators_After_Elaboration
102728 Specifies that an allocator using a standard storage pool
102729 (see *note 13.11::) shall not occur within a
102730 parameterless library subprogram, nor within the
102731 handled_sequence_of_statements of a task body. For the
102732 purposes of this rule, an allocator of a type derived
102733 from a formal access type does not use a standard storage
102734 pool.
102735
102736 19.3/3
102737 {AI05-0189-1AI05-0189-1} {AI05-0262-1AI05-0262-1} At run
102738 time, Storage_Error is raised if an allocator using a
102739 standard storage pool is evaluated after the elaboration
102740 of the library_items of the partition has completed.
102741
102742 20
102743 It is implementation defined whether the use of pragma Restrictions
102744 results in a reduction in executable program size, storage requirements,
102745 or execution time. If possible, the implementation should provide
102746 quantitative descriptions of such effects for each restriction.
102747
102748 20.a/2
102749 Implementation defined: Whether the use of pragma Restrictions
102750 results in a reduction in program code or data size or
102751 execution time.
102752
102753 _Implementation Advice_
102754
102755 21
102756 When feasible, the implementation should take advantage of the specified
102757 restrictions to produce a more efficient implementation.
102758
102759 21.a/2
102760 Implementation Advice: When feasible, specified restrictions
102761 should be used to produce a more efficient implementation.
102762
102763 NOTES
102764
102765 22
102766 34 The above Storage_Checks can be suppressed with pragma
102767 Suppress.
102768
102769 _Incompatibilities With Ada 95_
102770
102771 22.a/2
102772 {AI95-00360-01AI95-00360-01} Amendment Correction: The
102773 No_Nested_Finalization is now defined in terms of types that
102774 need finalization. These types include a variety of
102775 language-defined types that might be implemented with a
102776 controlled type. If the restriction No_Nested_Finalization
102777 (see *note D.7::) applies to the partition, and one of these
102778 language-defined types does not have a controlled part, it
102779 will not be allowed in local objects in Ada 2005 whereas it
102780 would be allowed in original Ada 95. Such code is not
102781 portable, as other Ada compilers may have had a controlled
102782 part, and thus would be illegal under the restriction.
102783
102784 _Extensions to Ada 95_
102785
102786 22.b/2
102787 {AI95-00297-01AI95-00297-01} {AI95-00305-01AI95-00305-01}
102788 {AI95-00394-01AI95-00394-01} Restrictions
102789 No_Dynamic_Attachment, No_Local_Protected_Objects,
102790 No_Protected_Type_Allocators, No_Local_Timing_Events,
102791 No_Relative_Delay, No_Requeue_Statement, No_Select_Statements,
102792 No_Specific_Termination_Handlers, No_Task_Termination,
102793 Max_Entry_Queue_Length, and Simple_Barriers are newly added to
102794 Ada.
102795
102796 _Wording Changes from Ada 95_
102797
102798 22.c/2
102799 {8652/00428652/0042} {AI95-00130-01AI95-00130-01} Corrigendum:
102800 Clarified that No_Nested_Finalization covered task and
102801 protected parts as well.
102802
102803 22.d/2
102804 {8652/00768652/0076} {AI95-00067-01AI95-00067-01} Corrigendum:
102805 Changed the description of Max_Tasks and
102806 Max_Asynchronous_Select_Nested to eliminate conflicts with the
102807 High Integrity Annex (see *note H.4::).
102808
102809 22.e/2
102810 {AI95-00327-01AI95-00327-01} Added using of the new Priority
102811 attribute to the restriction No_Dynamic_Priorities.
102812
102813 22.f/2
102814 {AI95-00394-01AI95-00394-01} Restriction
102815 No_Asynchronous_Control is now obsolescent.
102816
102817 _Incompatibilities With Ada 2005_
102818
102819 22.g/3
102820 {AI05-0013-1AI05-0013-1} Correction: Changed so that
102821 coextensions of types that require nested finalization are
102822 also prohibited; this is done by prohibiting allocators rather
102823 than objects of specific access types. It seems unlikely that
102824 any program depending on this restriction would violate it in
102825 this blatant manner, so it is expected that very few programs
102826 will be affected by this change.
102827
102828 22.h/3
102829 {AI05-0211-1AI05-0211-1} Correction: The restriction
102830 No_Relative_Delay was changed to include the Timing_Events
102831 routine that uses a relative delay. This means that a program
102832 that uses that routine and this restriction will now be
102833 rejected. However, such a program violates the spirit and
102834 intent of the restriction and as such the program should never
102835 have been allowed. Moreover, it is unlikely that any program
102836 depending on this restriction would violate it in such an
102837 obvious manner, so it is expected that very few programs will
102838 be affected by this change.
102839
102840 22.i/3
102841 {AI05-0211-1AI05-0211-1} Correction: A number of restrictions
102842 were changed from "no calls" on some subprogram to "no use of
102843 a name that denotes" that subprogram. This closes a hole
102844 where renames, uses as the prefix of 'Access, and the like,
102845 would not be rejected by the restriction, possibly allowing
102846 backdoor access to the prohibited subprogram. A program that
102847 uses one of these restrictions and using such backdoor access
102848 will now be rejected; however, it is extremely unlikely that
102849 any program that relies on these restrictions would also use
102850 an end-run around the restriction, so it is expected that very
102851 few programs will be affected by this change.
102852
102853 _Extensions to Ada 2005_
102854
102855 22.j/3
102856 {AI05-0189-1AI05-0189-1} Restriction
102857 No_Standard_Allocators_After_Elaboration is newly added to
102858 Ada.
102859
102860 _Wording Changes from Ada 2005_
102861
102862 22.k/3
102863 {AI05-0013-1AI05-0013-1} {AI05-0216-1AI05-0216-1} Correction:
102864 Improved the wording of various restrictions to make it
102865 clearer that they prohibit things that would otherwise be
102866 legal, and to word them as definitions, not Legality Rules;.
102867
102868 22.l/3
102869 {AI05-0192-1AI05-0192-1} Correction: Added wording to explain
102870 how No_Task_Allocators and No_Protected_Type_Allocators are
102871 checked for class-wide types. This might be an extension if
102872 the compiler assumed the worst in the past (it is now a
102873 runtime check).
102874
102875 \1f
102876 File: aarm2012.info, Node: D.8, Next: D.9, Prev: D.7, Up: Annex D
102877
102878 D.8 Monotonic Time
102879 ==================
102880
102881 1/3
102882 {AI05-0299-1AI05-0299-1} [This subclause specifies a high-resolution,
102883 monotonic clock package.]
102884
102885 _Static Semantics_
102886
102887 2
102888 The following language-defined library package exists:
102889
102890 3
102891 package Ada.Real_Time is
102892
102893 4
102894 type Time is private;
102895 Time_First : constant Time;
102896 Time_Last : constant Time;
102897 Time_Unit : constant := implementation-defined-real-number;
102898
102899 5
102900 type Time_Span is private;
102901 Time_Span_First : constant Time_Span;
102902 Time_Span_Last : constant Time_Span;
102903 Time_Span_Zero : constant Time_Span;
102904 Time_Span_Unit : constant Time_Span;
102905
102906 6
102907 Tick : constant Time_Span;
102908 function Clock return Time;
102909
102910 7
102911 function "+" (Left : Time; Right : Time_Span) return Time;
102912 function "+" (Left : Time_Span; Right : Time) return Time;
102913 function "-" (Left : Time; Right : Time_Span) return Time;
102914 function "-" (Left : Time; Right : Time) return Time_Span;
102915
102916 8
102917 function "<" (Left, Right : Time) return Boolean;
102918 function "<="(Left, Right : Time) return Boolean;
102919 function ">" (Left, Right : Time) return Boolean;
102920 function ">="(Left, Right : Time) return Boolean;
102921
102922 9
102923 function "+" (Left, Right : Time_Span) return Time_Span;
102924 function "-" (Left, Right : Time_Span) return Time_Span;
102925 function "-" (Right : Time_Span) return Time_Span;
102926 function "*" (Left : Time_Span; Right : Integer) return Time_Span;
102927 function "*" (Left : Integer; Right : Time_Span) return Time_Span;
102928 function "/" (Left, Right : Time_Span) return Integer;
102929 function "/" (Left : Time_Span; Right : Integer) return Time_Span;
102930
102931 10
102932 function "abs"(Right : Time_Span) return Time_Span;
102933
102934 11/1
102935 This paragraph was deleted.
102936
102937 12
102938 function "<" (Left, Right : Time_Span) return Boolean;
102939 function "<="(Left, Right : Time_Span) return Boolean;
102940 function ">" (Left, Right : Time_Span) return Boolean;
102941 function ">="(Left, Right : Time_Span) return Boolean;
102942
102943 13
102944 function To_Duration (TS : Time_Span) return Duration;
102945 function To_Time_Span (D : Duration) return Time_Span;
102946
102947 14/2
102948 {AI95-00386-01AI95-00386-01} function Nanoseconds (NS : Integer) return Time_Span;
102949 function Microseconds (US : Integer) return Time_Span;
102950 function Milliseconds (MS : Integer) return Time_Span;
102951 function Seconds (S : Integer) return Time_Span;
102952 function Minutes (M : Integer) return Time_Span;
102953
102954 15
102955 type Seconds_Count is range implementation-defined;
102956
102957 16
102958 procedure Split(T : in Time; SC : out Seconds_Count; TS : out Time_Span);
102959 function Time_Of(SC : Seconds_Count; TS : Time_Span) return Time;
102960
102961 17
102962 private
102963 ... -- not specified by the language
102964 end Ada.Real_Time;
102965
102966 17.a/2
102967 This paragraph was deleted.
102968
102969 18
102970 In this Annex, real time is defined to be the physical time as observed
102971 in the external environment. The type Time is a time type as defined by
102972 *note 9.6::; [values of this type may be used in a
102973 delay_until_statement.] Values of this type represent segments of an
102974 ideal time line. The set of values of the type Time corresponds
102975 one-to-one with an implementation-defined range of mathematical
102976 integers.
102977
102978 18.a
102979 Discussion: Informally, real time is defined to be the
102980 International Atomic Time (TAI) which is monotonic and
102981 nondecreasing. We use it here for the purpose of discussing
102982 rate of change and monotonic behavior only. It does not imply
102983 anything about the absolute value of Real_Time.Clock, or about
102984 Real_Time.Time being synchronized with TAI. It is also used
102985 for real time in the metrics, for comparison purposes.
102986
102987 18.b
102988 Implementation Note: The specification of TAI as "real time"
102989 does not preclude the use of a simulated TAI clock for
102990 simulated execution environments.
102991
102992 19
102993 The Time value I represents the half-open real time interval that starts
102994 with E+I*Time_Unit and is limited by E+(I+1)*Time_Unit, where Time_Unit
102995 is an implementation-defined real number and E is an unspecified origin
102996 point, the epoch, that is the same for all values of the type Time. It
102997 is not specified by the language whether the time values are
102998 synchronized with any standard time reference. [For example, E can
102999 correspond to the time of system initialization or it can correspond to
103000 the epoch of some time standard.]
103001
103002 19.a
103003 Discussion: E itself does not have to be a proper time value.
103004
103005 19.b
103006 This half-open interval I consists of all real numbers R such
103007 that E+I*Time_Unit <= R < E+(I+1)*Time_Unit.
103008
103009 20
103010 Values of the type Time_Span represent length of real time duration.
103011 The set of values of this type corresponds one-to-one with an
103012 implementation-defined range of mathematical integers. The Time_Span
103013 value corresponding to the integer I represents the real-time duration
103014 I*Time_Unit.
103015
103016 20.a
103017 Reason: The purpose of this type is similar to
103018 Standard.Duration; the idea is to have a type with a higher
103019 resolution.
103020
103021 20.b
103022 Discussion: We looked at many possible names for this type:
103023 Real_Time.Duration, Fine_Duration, Interval,
103024 Time_Interval_Length, Time_Measure, and more. Each of these
103025 names had some problems, and we've finally settled for
103026 Time_Span.
103027
103028 21
103029 Time_First and Time_Last are the smallest and largest values of the Time
103030 type, respectively. Similarly, Time_Span_First and Time_Span_Last are
103031 the smallest and largest values of the Time_Span type, respectively.
103032
103033 22
103034 A value of type Seconds_Count represents an elapsed time, measured in
103035 seconds, since the epoch.
103036
103037 _Dynamic Semantics_
103038
103039 23
103040 Time_Unit is the smallest amount of real time representable by the Time
103041 type; it is expressed in seconds. Time_Span_Unit is the difference
103042 between two successive values of the Time type. It is also the smallest
103043 positive value of type Time_Span. Time_Unit and Time_Span_Unit
103044 represent the same real time duration. A clock tick is a real time
103045 interval during which the clock value (as observed by calling the Clock
103046 function) remains constant. Tick is the average length of such
103047 intervals.
103048
103049 24/2
103050 {AI95-00432-01AI95-00432-01} The function To_Duration converts the value
103051 TS to a value of type Duration. Similarly, the function To_Time_Span
103052 converts the value D to a value of type Time_Span. For To_Duration, the
103053 result is rounded to the nearest value of type Duration (away from zero
103054 if exactly halfway between two values). If the result is outside the
103055 range of Duration, Constraint_Error is raised. For To_Time_Span, the
103056 value of D is first rounded to the nearest integral multiple of
103057 Time_Unit, away from zero if exactly halfway between two multiples. If
103058 the rounded value is outside the range of Time_Span, Constraint_Error is
103059 raised. Otherwise, the value is converted to the type Time_Span.
103060
103061 25
103062 To_Duration(Time_Span_Zero) returns 0.0, and To_Time_Span(0.0) returns
103063 Time_Span_Zero.
103064
103065 26/2
103066 {AI95-00386-01AI95-00386-01} {AI95-00432-01AI95-00432-01} The functions
103067 Nanoseconds, Microseconds, Milliseconds, Seconds, and Minutes convert
103068 the input parameter to a value of the type Time_Span. NS, US, MS, S,
103069 and M are interpreted as a number of nanoseconds, microseconds,
103070 milliseconds, seconds, and minutes respectively. The input parameter is
103071 first converted to seconds and rounded to the nearest integral multiple
103072 of Time_Unit, away from zero if exactly halfway between two multiples.
103073 If the rounded value is outside the range of Time_Span, Constraint_Error
103074 is raised. Otherwise, the rounded value is converted to the type
103075 Time_Span.
103076
103077 26.a/2
103078 This paragraph was deleted.{AI95-00432-01AI95-00432-01}
103079
103080 27
103081 The effects of the operators on Time and Time_Span are as for the
103082 operators defined for integer types.
103083
103084 27.a
103085 Implementation Note: Though time values are modeled by
103086 integers, the types Time and Time_Span need not be implemented
103087 as integers.
103088
103089 28
103090 The function Clock returns the amount of time since the epoch.
103091
103092 29
103093 The effects of the Split and Time_Of operations are defined as follows,
103094 treating values of type Time, Time_Span, and Seconds_Count as
103095 mathematical integers. The effect of Split(T,SC,TS) is to set SC and TS
103096 to values such that T*Time_Unit = SC*1.0 + TS*Time_Unit, and 0.0 <=
103097 TS*Time_Unit < 1.0. The value returned by Time_Of(SC,TS) is the value T
103098 such that T*Time_Unit = SC*1.0 + TS*Time_Unit.
103099
103100 _Implementation Requirements_
103101
103102 30
103103 The range of Time values shall be sufficient to uniquely represent the
103104 range of real times from program start-up to 50 years later. Tick shall
103105 be no greater than 1 millisecond. Time_Unit shall be less than or equal
103106 to 20 microseconds.
103107
103108 30.a
103109 Implementation Note: The required range and accuracy of Time
103110 are such that 32-bits worth of seconds and 32-bits worth of
103111 ticks in a second could be used as the representation.
103112
103113 31
103114 Time_Span_First shall be no greater than -3600 seconds, and
103115 Time_Span_Last shall be no less than 3600 seconds.
103116
103117 31.a
103118 Reason: This is equivalent to ± one hour and there is still
103119 room for a two-microsecond resolution.
103120
103121 32
103122 A clock jump is the difference between two successive distinct values of
103123 the clock (as observed by calling the Clock function). There shall be
103124 no backward clock jumps.
103125
103126 _Documentation Requirements_
103127
103128 33
103129 The implementation shall document the values of Time_First, Time_Last,
103130 Time_Span_First, Time_Span_Last, Time_Span_Unit, and Tick.
103131
103132 33.a/2
103133 Documentation Requirement: The values of Time_First,
103134 Time_Last, Time_Span_First, Time_Span_Last, Time_Span_Unit,
103135 and Tick for package Real_Time.
103136
103137 34
103138 The implementation shall document the properties of the underlying time
103139 base used for the clock and for type Time, such as the range of values
103140 supported and any relevant aspects of the underlying hardware or
103141 operating system facilities used.
103142
103143 34.a.1/2
103144 Documentation Requirement: The properties of the underlying
103145 time base used in package Real_Time.
103146
103147 34.a
103148 Discussion: If there is an underlying operating system, this
103149 might include information about which system call is used to
103150 implement the clock. Otherwise, it might include information
103151 about which hardware clock is used.
103152
103153 35
103154 The implementation shall document whether or not there is any
103155 synchronization with external time references, and if such
103156 synchronization exists, the sources of synchronization information, the
103157 frequency of synchronization, and the synchronization method applied.
103158
103159 35.a.1/2
103160 Documentation Requirement: Any synchronization of package
103161 Real_Time with external time references.
103162
103163 36/3
103164 {AI05-0299-1AI05-0299-1} The implementation shall document any aspects
103165 of the external environment that could interfere with the clock behavior
103166 as defined in this subclause.
103167
103168 36.a.1/2
103169 Documentation Requirement: Any aspects of the external
103170 environment that could interfere with package Real_Time.
103171
103172 36.a
103173 Discussion: For example, the implementation is allowed to rely
103174 on the time services of an underlying operating system, and
103175 this operating system clock can implement time zones or allow
103176 the clock to be reset by an operator. This dependence has to
103177 be documented.
103178
103179 _Metrics_
103180
103181 37/3
103182 {AI05-0299-1AI05-0299-1} For the purpose of the metrics defined in this
103183 subclause, real time is defined to be the International Atomic Time
103184 (TAI).
103185
103186 38
103187 The implementation shall document the following metrics:
103188
103189 39
103190 * An upper bound on the real-time duration of a clock tick. This is
103191 a value D such that if t1 and t2 are any real times such that t1 <
103192 t2 and Clockt1 = Clockt2 then t2 - t1 <= D.
103193
103194 40
103195 * An upper bound on the size of a clock jump.
103196
103197 41
103198 * An upper bound on the drift rate of Clock with respect to real
103199 time. This is a real number D such that
103200
103201 42
103202 E*(1-D) <= (Clockt+E - Clockt) <= E*(1+D)
103203 provided that: Clockt + E*(1+D) <= Time_Last.
103204
103205 43
103206 * where Clockt is the value of Clock at time t, and E is a real time
103207 duration not less than 24 hours. The value of E used for this
103208 metric shall be reported.
103209
103210 43.a
103211 Reason: This metric is intended to provide a measurement of
103212 the long term (cumulative) deviation; therefore, 24 hours is
103213 the lower bound on the measurement period. On some
103214 implementations, this is also the maximum period, since the
103215 language does not require that the range of the type Duration
103216 be more than 24 hours. On those implementations that support
103217 longer-range Duration, longer measurements should be
103218 performed.
103219
103220 44
103221 * An upper bound on the execution time of a call to the Clock
103222 function, in processor clock cycles.
103223
103224 45
103225 * Upper bounds on the execution times of the operators of the types
103226 Time and Time_Span, in processor clock cycles.
103227
103228 45.a
103229 Implementation Note: A fast implementation of the Clock
103230 function involves repeated reading until you get the same
103231 value twice. It is highly improbable that more than three
103232 reads will be necessary. Arithmetic on time values should not
103233 be significantly slower than 64-bit arithmetic in the
103234 underlying machine instruction set.
103235
103236 45.a.1/2
103237 Documentation Requirement: The metrics for package Real_Time.
103238
103239 _Implementation Permissions_
103240
103241 46
103242 Implementations targeted to machines with word size smaller than 32 bits
103243 need not support the full range and granularity of the Time and
103244 Time_Span types.
103245
103246 46.a
103247 Discussion: These requirements are based on machines with a
103248 word size of 32 bits.
103249
103250 46.b
103251 Since the range and granularity are implementation defined,
103252 the supported values need to be documented.
103253
103254 _Implementation Advice_
103255
103256 47
103257 When appropriate, implementations should provide configuration
103258 mechanisms to change the value of Tick.
103259
103260 47.a.1/2
103261 Implementation Advice: When appropriate, mechanisms to change
103262 the value of Tick should be provided.
103263
103264 47.a
103265 Reason: This is often needed when the compilation system was
103266 originally targeted to a particular processor with a
103267 particular interval timer, but the customer uses the same
103268 processor with a different interval timer.
103269
103270 47.b
103271 Discussion: Tick is a deferred constant and not a named number
103272 specifically for this purpose.
103273
103274 47.c
103275 Implementation Note: This can be achieved either by
103276 pre-run-time configuration tools, or by having Tick be
103277 initialized (in the package private part) by a function call
103278 residing in a board specific module.
103279
103280 48
103281 It is recommended that Calendar.Clock and Real_Time.Clock be implemented
103282 as transformations of the same time base.
103283
103284 48.a.1/2
103285 Implementation Advice: Calendar.Clock and Real_Time.Clock
103286 should be transformations of the same time base.
103287
103288 49
103289 It is recommended that the "best" time base which exists in the
103290 underlying system be available to the application through Clock. "Best"
103291 may mean highest accuracy or largest range.
103292
103293 49.a.1/2
103294 Implementation Advice: The "best" time base which exists in
103295 the underlying system should be available to the application
103296 through Real_Time.Clock.
103297
103298 NOTES
103299
103300 50/3
103301 35 {AI05-0299-1AI05-0299-1} The rules in this subclause do not
103302 imply that the implementation can protect the user from operator or
103303 installation errors which could result in the clock being set
103304 incorrectly.
103305
103306 51
103307 36 Time_Unit is the granularity of the Time type. In contrast,
103308 Tick represents the granularity of Real_Time.Clock. There is no
103309 requirement that these be the same.
103310
103311 _Incompatibilities With Ada 95_
103312
103313 51.a/3
103314 {AI95-00386-01AI95-00386-01} {AI05-0005-1AI05-0005-1}
103315 Functions Seconds and Minutes are added to Real_Time. If
103316 Real_Time is referenced in a use_clause, and an entity E with
103317 a defining_identifier of Seconds or Minutes is defined in a
103318 package that is also referenced in a use_clause, the entity E
103319 may no longer be use-visible, resulting in errors. This
103320 should be rare and is easily fixed if it does occur.
103321
103322 _Wording Changes from Ada 95_
103323
103324 51.b/2
103325 {AI95-00432-01AI95-00432-01} Added wording explaining how and
103326 when many of these functions can raise Constraint_Error.
103327 While there always was an intent to raise Constraint_Error if
103328 the values did not fit, there never was any wording to that
103329 effect, and since Time_Span was a private type, the normal
103330 numeric type rules do not apply to it.
103331
103332 \1f
103333 File: aarm2012.info, Node: D.9, Next: D.10, Prev: D.8, Up: Annex D
103334
103335 D.9 Delay Accuracy
103336 ==================
103337
103338 1/3
103339 {AI05-0299-1AI05-0299-1} [This subclause specifies performance
103340 requirements for the delay_statement. The rules apply both to
103341 delay_relative_statement (*note 9.6: S0229.) and to
103342 delay_until_statement (*note 9.6: S0228.). Similarly, they apply
103343 equally to a simple delay_statement (*note 9.6: S0227.) and to one which
103344 appears in a delay_alternative (*note 9.7.1: S0235.).]
103345
103346 _Dynamic Semantics_
103347
103348 2
103349 The effect of the delay_statement for Real_Time.Time is defined in terms
103350 of Real_Time.Clock:
103351
103352 3
103353 * If C1 is a value of Clock read before a task executes a
103354 delay_relative_statement with duration D, and C2 is a value of
103355 Clock read after the task resumes execution following that
103356 delay_statement, then C2 - C1 >= D.
103357
103358 4
103359 * If C is a value of Clock read after a task resumes execution
103360 following a delay_until_statement with Real_Time.Time value T, then
103361 C >= T.
103362
103363 5
103364 A simple delay_statement with a negative or zero value for the
103365 expiration time does not cause the calling task to be blocked; it is
103366 nevertheless a potentially blocking operation (see *note 9.5.1::).
103367
103368 6/3
103369 {AI05-0004-1AI05-0004-1} When a delay_statement appears in a
103370 delay_alternative of a timed_entry_call the selection of the entry call
103371 is attempted, regardless of the specified expiration time. When a
103372 delay_statement appears in a select_alternative, and a call is queued on
103373 one of the open entries, the selection of that entry call proceeds,
103374 regardless of the value of the delay expression.
103375
103376 6.a
103377 Ramification: The effect of these requirements is that one has
103378 to always attempt a rendezvous, regardless of the value of the
103379 delay expression. This can be tested by issuing a
103380 timed_entry_call with an expiration time of zero, to an open
103381 entry.
103382
103383 _Documentation Requirements_
103384
103385 7
103386 The implementation shall document the minimum value of the delay
103387 expression of a delay_relative_statement that causes the task to
103388 actually be blocked.
103389
103390 7.a/2
103391 Documentation Requirement: The minimum value of the delay
103392 expression of a delay_relative_statement that causes a task to
103393 actually be blocked.
103394
103395 8
103396 The implementation shall document the minimum difference between the
103397 value of the delay expression of a delay_until_statement and the value
103398 of Real_Time.Clock, that causes the task to actually be blocked.
103399
103400 8.a/2
103401 This paragraph was deleted.
103402
103403 8.b/2
103404 Documentation Requirement: The minimum difference between the
103405 value of the delay expression of a delay_until_statement and
103406 the value of Real_Time.Clock, that causes the task to actually
103407 be blocked.
103408
103409 _Metrics_
103410
103411 9
103412 The implementation shall document the following metrics:
103413
103414 10
103415 * An upper bound on the execution time, in processor clock cycles, of
103416 a delay_relative_statement whose requested value of the delay
103417 expression is less than or equal to zero.
103418
103419 11
103420 * An upper bound on the execution time, in processor clock cycles, of
103421 a delay_until_statement whose requested value of the delay
103422 expression is less than or equal to the value of Real_Time.Clock at
103423 the time of executing the statement. Similarly, for
103424 Calendar.Clock.
103425
103426 12
103427 * An upper bound on the lateness of a delay_relative_statement, for a
103428 positive value of the delay expression, in a situation where the
103429 task has sufficient priority to preempt the processor as soon as it
103430 becomes ready, and does not need to wait for any other execution
103431 resources. The upper bound is expressed as a function of the value
103432 of the delay expression. The lateness is obtained by subtracting
103433 the value of the delay expression from the actual duration. The
103434 actual duration is measured from a point immediately before a task
103435 executes the delay_statement to a point immediately after the task
103436 resumes execution following this statement.
103437
103438 13
103439 * An upper bound on the lateness of a delay_until_statement, in a
103440 situation where the value of the requested expiration time is after
103441 the time the task begins executing the statement, the task has
103442 sufficient priority to preempt the processor as soon as it becomes
103443 ready, and it does not need to wait for any other execution
103444 resources. The upper bound is expressed as a function of the
103445 difference between the requested expiration time and the clock
103446 value at the time the statement begins execution. The lateness of
103447 a delay_until_statement is obtained by subtracting the requested
103448 expiration time from the real time that the task resumes execution
103449 following this statement.
103450
103451 13.a/2
103452 Documentation Requirement: The metrics for delay statements.
103453
103454 _Wording Changes from Ada 83_
103455
103456 14.a
103457 The rules regarding a timed_entry_call with a very small
103458 positive Duration value, have been tightened to always require
103459 the check whether the rendezvous is immediately possible.
103460
103461 _Wording Changes from Ada 95_
103462
103463 14.b/2
103464 {AI95-00355-01AI95-00355-01} The note about "voluntary
103465 round-robin', while still true, has been deleted as
103466 potentially confusing as it is describing a different kind of
103467 round-robin than is defined by the round-robin dispatching
103468 policy.
103469
103470 \1f
103471 File: aarm2012.info, Node: D.10, Next: D.11, Prev: D.9, Up: Annex D
103472
103473 D.10 Synchronous Task Control
103474 =============================
103475
103476 1/3
103477 {AI05-0299-1AI05-0299-1} [This subclause describes a language-defined
103478 private semaphore (suspension object), which can be used for two-stage
103479 suspend operations and as a simple building block for implementing
103480 higher-level queues.]
103481
103482 _Static Semantics_
103483
103484 2
103485 The following language-defined package exists:
103486
103487 3/2
103488 {AI95-00362-01AI95-00362-01} package Ada.Synchronous_Task_Control is
103489 pragma Preelaborate(Synchronous_Task_Control);
103490
103491 4
103492 type Suspension_Object is limited private;
103493 procedure Set_True(S : in out Suspension_Object);
103494 procedure Set_False(S : in out Suspension_Object);
103495 function Current_State(S : Suspension_Object) return Boolean;
103496 procedure Suspend_Until_True(S : in out Suspension_Object);
103497 private
103498 ... -- not specified by the language
103499 end Ada.Synchronous_Task_Control;
103500
103501 5
103502 The type Suspension_Object is a by-reference type.
103503
103504 5.a/2
103505 Implementation Note: {AI95-00318-02AI95-00318-02} The
103506 implementation can ensure this by, for example, making the
103507 full view an explicitly limited record type.
103508
103509 5.1/3
103510 {AI05-0168-1AI05-0168-1} The following language-defined package exists:
103511
103512 5.2/3
103513 {AI05-0168-1AI05-0168-1} package Ada.Synchronous_Task_Control.EDF is
103514 procedure Suspend_Until_True_And_Set_Deadline
103515 (S : in out Suspension_Object;
103516 TS : in Ada.Real_Time.Time_Span);
103517 end Ada.Synchronous_Task_Control.EDF;
103518
103519 _Dynamic Semantics_
103520
103521 6/2
103522 {AI95-00114-01AI95-00114-01} An object of the type Suspension_Object has
103523 two visible states: True and False. Upon initialization, its value is
103524 set to False.
103525
103526 6.a
103527 Discussion: This object is assumed to be private to the
103528 declaring task, i.e. only that task will call
103529 Suspend_Until_True on this object, and the count of callers is
103530 at most one. Other tasks can, of course, change and query the
103531 state of this object.
103532
103533 7/2
103534 {AI95-00114-01AI95-00114-01} The operations Set_True and Set_False are
103535 atomic with respect to each other and with respect to
103536 Suspend_Until_True; they set the state to True and False respectively.
103537
103538 8
103539 Current_State returns the current state of the object.
103540
103541 8.a
103542 Discussion: This state can change immediately after the
103543 operation returns.
103544
103545 9/2
103546 {AI95-00114-01AI95-00114-01} The procedure Suspend_Until_True blocks the
103547 calling task until the state of the object S is True; at that point the
103548 task becomes ready and the state of the object becomes False.
103549
103550 10
103551 Program_Error is raised upon calling Suspend_Until_True if another task
103552 is already waiting on that suspension object. Suspend_Until_True is a
103553 potentially blocking operation (see *note 9.5.1::).
103554
103555 10.1/3
103556 {AI05-0168-1AI05-0168-1} {AI05-0269-1AI05-0269-1} The procedure
103557 Suspend_Until_True_And_Set_Deadline blocks the calling task until the
103558 state of the object S is True; at that point the task becomes ready with
103559 a deadline of Ada.Real_Time.Clock + TS, and the state of the object
103560 becomes False. Program_Error is raised upon calling
103561 Suspend_Until_True_And_Set_Deadline if another task is already waiting
103562 on that suspension object. Suspend_Until_True_And_Set_Deadline is a
103563 potentially blocking operation.
103564
103565 _Implementation Requirements_
103566
103567 11
103568 The implementation is required to allow the calling of Set_False and
103569 Set_True during any protected action, even one that has its ceiling
103570 priority in the Interrupt_Priority range.
103571
103572 NOTES
103573
103574 12/3
103575 37 {AI05-0168-1AI05-0168-1} More complex schemes, such as setting
103576 the deadline relative to when Set_True is called, can be programmed
103577 using a protected object.
103578
103579 _Extensions to Ada 95_
103580
103581 12.a/2
103582 {AI95-00362-01AI95-00362-01} Synchronous_Task_Control is now
103583 Preelaborated, so it can be used in preelaborated units.
103584
103585 _Extensions to Ada 2005_
103586
103587 12.b/3
103588 {AI05-0168-1AI05-0168-1} Child package
103589 Ada.Synchronous_Task_Control.EDF is new.
103590
103591 * Menu:
103592
103593 * D.10.1 :: Synchronous Barriers
103594
103595 \1f
103596 File: aarm2012.info, Node: D.10.1, Up: D.10
103597
103598 D.10.1 Synchronous Barriers
103599 ---------------------------
103600
103601 1/3
103602 {AI05-0174-1AI05-0174-1} {AI05-0299-1AI05-0299-1} This subclause
103603 introduces a language-defined package to synchronously release a group
103604 of tasks after the number of blocked tasks reaches a specified count
103605 value.
103606
103607 _Static Semantics_
103608
103609 2/3
103610 {AI05-0174-1AI05-0174-1} The following language-defined library package
103611 exists:
103612
103613 3/3
103614 package Ada.Synchronous_Barriers is
103615 pragma Preelaborate(Synchronous_Barriers);
103616
103617 4/3
103618 subtype Barrier_Limit is Positive range 1 .. implementation-defined;
103619
103620 4.a.1/3
103621 Implementation defined: The value of Barrier_Limit'Last in
103622 Synchronous_Barriers.
103623
103624 5/3
103625 type Synchronous_Barrier (Release_Threshold : Barrier_Limit) is limited private;
103626
103627 6/3
103628 procedure Wait_For_Release (The_Barrier : in out Synchronous_Barrier;
103629 Notified : out Boolean);
103630
103631 7/3
103632 private
103633 -- not specified by the language
103634 end Ada.Synchronous_Barriers;
103635
103636 8/3
103637 {AI05-0174-1AI05-0174-1} Type Synchronous_Barrier needs finalization
103638 (see *note 7.6::).
103639
103640 _Dynamic Semantics_
103641
103642 9/3
103643 {AI05-0174-1AI05-0174-1} Each call to Wait_For_Release blocks the
103644 calling task until the number of blocked tasks associated with the
103645 Synchronous_Barrier object is equal to Release_Threshold, at which time
103646 all blocked tasks are released. Notified is set to True for one of the
103647 released tasks, and set to False for all other released tasks.
103648
103649 10/3
103650 {AI05-0174-1AI05-0174-1} The mechanism for determining which task sets
103651 Notified to True is implementation defined.
103652
103653 11/3
103654 {AI05-0174-1AI05-0174-1} Once all tasks have been released, a
103655 Synchronous_Barrier object may be reused to block another
103656 Release_Threshold number of tasks.
103657
103658 12/3
103659 {AI05-0174-1AI05-0174-1} As the first step of the finalization of a
103660 Synchronous_Barrier, each blocked task is unblocked and Program_Error is
103661 raised at the place of the call to Wait_For_Release.
103662
103663 13/3
103664 {AI05-0174-1AI05-0174-1} It is implementation defined whether an
103665 abnormal task which is waiting on a Synchronous_Barrier object is
103666 aborted immediately or aborted when the tasks waiting on the object are
103667 released.
103668
103669 13.a.1/3
103670 Implementation defined: When an aborted task that is waiting
103671 on a Synchronous_Barrier is aborted.
103672
103673 14/3
103674 {AI05-0174-1AI05-0174-1} Wait_For_Release is a potentially blocking
103675 operation (see *note 9.5.1::).
103676
103677 _Bounded (Run-Time) Errors_
103678
103679 15/3
103680 {AI05-0174-1AI05-0174-1} It is a bounded error to call Wait_For_Release
103681 on a Synchronous_Barrier object after that object is finalized. If the
103682 error is detected, Program_Error is raised. Otherwise, the call
103683 proceeds normally, which may leave a task blocked forever.
103684
103685 _Extensions to Ada 2005_
103686
103687 15.a/3
103688 {AI05-0174-1AI05-0174-1} The package Ada.Synchronous_Barriers
103689 is new.
103690
103691 \1f
103692 File: aarm2012.info, Node: D.11, Next: D.12, Prev: D.10, Up: Annex D
103693
103694 D.11 Asynchronous Task Control
103695 ==============================
103696
103697 1/3
103698 {AI05-0299-1AI05-0299-1} [This subclause introduces a language-defined
103699 package to do asynchronous suspend/resume on tasks. It uses a
103700 conceptual held priority value to represent the task's held state.]
103701
103702 _Static Semantics_
103703
103704 2
103705 The following language-defined library package exists:
103706
103707 3/2
103708 {AI95-00362-01AI95-00362-01} with Ada.Task_Identification;
103709 package Ada.Asynchronous_Task_Control is
103710 pragma Preelaborate(Asynchronous_Task_Control);
103711 procedure Hold(T : in Ada.Task_Identification.Task_Id);
103712 procedure Continue(T : in Ada.Task_Identification.Task_Id);
103713 function Is_Held(T : Ada.Task_Identification.Task_Id)
103714 return Boolean;
103715 end Ada.Asynchronous_Task_Control;
103716
103717 _Dynamic Semantics_
103718
103719 4/2
103720 {AI95-00357-01AI95-00357-01} After the Hold operation has been applied
103721 to a task, the task becomes held. For each processor there is a
103722 conceptual idle task, which is always ready. The base priority of the
103723 idle task is below System.Any_Priority'First. The held priority is a
103724 constant of the type Integer whose value is below the base priority of
103725 the idle task.
103726
103727 4.a
103728 Discussion: The held state should not be confused with the
103729 blocked state as defined in *note 9.2::; the task is still
103730 ready.
103731
103732 4.1/2
103733 {AI95-00357-01AI95-00357-01} For any priority below
103734 System.Any_Priority'First, the task dispatching policy is
103735 FIFO_Within_Priorities.
103736
103737 4.b/2
103738 To be honest: This applies even if a Task_Dispatching_Policy
103739 specifies the policy for all of the priorities of the
103740 partition.
103741
103742 4.c/2
103743 Ramification: A task at the held priority never runs, so it is
103744 not necessary to implement FIFO_Within_Priorities for systems
103745 that have only one policy (such as EDF_Across_Priorities).
103746
103747 5/2
103748 {AI95-00357-01AI95-00357-01} The Hold operation sets the state of T to
103749 held. For a held task, the active priority is reevaluated as if the
103750 base priority of the task were the held priority.
103751
103752 5.a
103753 Ramification: For example, if T is currently inheriting
103754 priorities from other sources (e.g. it is executing in a
103755 protected action), its active priority does not change, and it
103756 continues to execute until it leaves the protected action.
103757
103758 6/2
103759 {AI95-00357-01AI95-00357-01} The Continue operation resets the state of
103760 T to not-held; its active priority is then reevaluated as determined by
103761 the task dispatching policy associated with its base priority.
103762
103763 7
103764 The Is_Held function returns True if and only if T is in the held state.
103765
103766 7.a
103767 Discussion: Note that the state of T can be changed
103768 immediately after Is_Held returns.
103769
103770 8
103771 As part of these operations, a check is made that the task identified by
103772 T is not terminated. Tasking_Error is raised if the check fails.
103773 Program_Error is raised if the value of T is Null_Task_Id.
103774
103775 _Erroneous Execution_
103776
103777 9
103778 If any operation in this package is called with a parameter T that
103779 specifies a task object that no longer exists, the execution of the
103780 program is erroneous.
103781
103782 _Implementation Permissions_
103783
103784 10
103785 An implementation need not support Asynchronous_Task_Control if it is
103786 infeasible to support it in the target environment.
103787
103788 10.a
103789 Reason: A direct implementation of the
103790 Asynchronous_Task_Control semantics using priorities is not
103791 necessarily efficient enough. Thus, we envision
103792 implementations that use some other mechanism to set the
103793 "held" state. If there is no other such mechanism, support
103794 for Asynchronous_Task_Control might be infeasible, because an
103795 implementation in terms of priority would require one idle
103796 task per processor. On some systems, programs are not
103797 supposed to know how many processors are available, so
103798 creating enough idle tasks would be problematic.
103799
103800 NOTES
103801
103802 11
103803 38 It is a consequence of the priority rules that held tasks
103804 cannot be dispatched on any processor in a partition (unless they
103805 are inheriting priorities) since their priorities are defined to be
103806 below the priority of any idle task.
103807
103808 12
103809 39 The effect of calling Get_Priority and Set_Priority on a Held
103810 task is the same as on any other task.
103811
103812 13
103813 40 Calling Hold on a held task or Continue on a non-held task has
103814 no effect.
103815
103816 14
103817 41 The rules affecting queuing are derived from the above rules,
103818 in addition to the normal priority rules:
103819
103820 15
103821 * When a held task is on the ready queue, its priority is so low
103822 as to never reach the top of the queue as long as there are
103823 other tasks on that queue.
103824
103825 16
103826 * If a task is executing in a protected action, inside a
103827 rendezvous, or is inheriting priorities from other sources
103828 (e.g. when activated), it continues to execute until it is no
103829 longer executing the corresponding construct.
103830
103831 17
103832 * If a task becomes held while waiting (as a caller) for a
103833 rendezvous to complete, the active priority of the accepting
103834 task is not affected.
103835
103836 18/1
103837 * {8652/00778652/0077} {AI95-00111-01AI95-00111-01} If a task
103838 becomes held while waiting in a selective_accept, and an entry
103839 call is issued to one of the open entries, the corresponding
103840 accept_alternative (*note 9.7.1: S0234.) executes. When the
103841 rendezvous completes, the active priority of the accepting
103842 task is lowered to the held priority (unless it is still
103843 inheriting from other sources), and the task does not execute
103844 until another Continue.
103845
103846 19
103847 * The same holds if the held task is the only task on a
103848 protected entry queue whose barrier becomes open. The
103849 corresponding entry body executes.
103850
103851 _Extensions to Ada 95_
103852
103853 19.a/2
103854 {AI95-00362-01AI95-00362-01} Asynchronous_Task_Control is now
103855 Preelaborated, so it can be used in preelaborated units.
103856
103857 _Wording Changes from Ada 95_
103858
103859 19.b/2
103860 {8652/00778652/0077} {AI95-00111-01AI95-00111-01} Corrigendum:
103861 Corrected to eliminate the use of the undefined term "accept
103862 body".
103863
103864 19.c/2
103865 {AI95-00357-01AI95-00357-01} The description of held tasks was
103866 changed to reflect that the calculation of active priorities
103867 depends on the dispatching policy of the base priority. Thus,
103868 the policy of the held priority was specified in order to
103869 avoid surprises (especially when using the EDF policy).
103870
103871 \1f
103872 File: aarm2012.info, Node: D.12, Next: D.13, Prev: D.11, Up: Annex D
103873
103874 D.12 Other Optimizations and Determinism Rules
103875 ==============================================
103876
103877 1/3
103878 {AI05-0299-1AI05-0299-1} [This subclause describes various requirements
103879 for improving the response and determinism in a real-time system.]
103880
103881 _Implementation Requirements_
103882
103883 2
103884 If the implementation blocks interrupts (see *note C.3::) not as a
103885 result of direct user action (e.g. an execution of a protected action)
103886 there shall be an upper bound on the duration of this blocking.
103887
103888 2.a
103889 Ramification: The implementation shall not allow itself to be
103890 interrupted when it is in a state where it is unable to
103891 support all the language-defined operations permitted in the
103892 execution of interrupt handlers. (see *note 9.5.1::).
103893
103894 3
103895 The implementation shall recognize entry-less protected types. The
103896 overhead of acquiring the execution resource of an object of such a type
103897 (see *note 9.5.1::) shall be minimized. In particular, there should not
103898 be any overhead due to evaluating entry_barrier conditions.
103899
103900 3.a
103901 Implementation Note: Ideally the overhead should just be a
103902 spin-lock.
103903
103904 4
103905 Unchecked_Deallocation shall be supported for terminated tasks that are
103906 designated by access types, and shall have the effect of releasing all
103907 the storage associated with the task. This includes any run-time system
103908 or heap storage that has been implicitly allocated for the task by the
103909 implementation.
103910
103911 _Documentation Requirements_
103912
103913 5
103914 The implementation shall document the upper bound on the duration of
103915 interrupt blocking caused by the implementation. If this is different
103916 for different interrupts or interrupt priority levels, it should be
103917 documented for each case.
103918
103919 5.a/2
103920 This paragraph was deleted.
103921
103922 5.b/2
103923 Documentation Requirement: The upper bound on the duration of
103924 interrupt blocking caused by the implementation.
103925
103926 _Metrics_
103927
103928 6
103929 The implementation shall document the following metric:
103930
103931 7
103932 * The overhead associated with obtaining a mutual-exclusive access to
103933 an entry-less protected object. This shall be measured in the
103934 following way:
103935
103936 8
103937 For a protected object of the form:
103938
103939 9
103940 protected Lock is
103941 procedure Set;
103942 function Read return Boolean;
103943 private
103944 Flag : Boolean := False;
103945 end Lock;
103946
103947 10
103948 protected body Lock is
103949 procedure Set is
103950 begin
103951 Flag := True;
103952 end Set;
103953 function Read return Boolean
103954 Begin
103955 return Flag;
103956 end Read;
103957 end Lock;
103958
103959 11
103960 The execution time, in processor clock cycles, of a call to Set.
103961 This shall be measured between the point just before issuing the
103962 call, and the point just after the call completes. The function
103963 Read shall be called later to verify that Set was indeed called
103964 (and not optimized away). The calling task shall have sufficiently
103965 high priority as to not be preempted during the measurement period.
103966 The protected object shall have sufficiently high ceiling priority
103967 to allow the task to call Set.
103968
103969 12
103970 For a multiprocessor, if supported, the metric shall be reported
103971 for the case where no contention (on the execution resource) exists
103972 [from tasks executing on other processors].
103973
103974 12.a/2
103975 Documentation Requirement: The metrics for entry-less
103976 protected objects.
103977
103978 \1f
103979 File: aarm2012.info, Node: D.13, Next: D.14, Prev: D.12, Up: Annex D
103980
103981 D.13 The Ravenscar Profile
103982 ==========================
103983
103984 1/3
103985 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1}
103986 {AI05-0299-1AI05-0299-1} [This subclause defines the Ravenscar profile.]
103987
103988 Paragraphs 2 and 3 were moved to *note 13.12::, "*note 13.12:: Pragma
103989 Restrictions and Pragma Profile".
103990
103991 _Legality Rules_
103992
103993 4/3
103994 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The
103995 profile_identifier Ravenscar is a usage profile (see *note 13.12::).
103996 For usage profile Ravenscar, there shall be no
103997 profile_pragma_argument_association (*note 2.8: S0020.)s.
103998
103999 _Static Semantics_
104000
104001 5/3
104002 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The usage profile
104003 Ravenscar is equivalent to the following set of pragmas:
104004
104005 6/3
104006 {AI95-00249-01AI95-00249-01} {AI95-00297-01AI95-00297-01} {AI95-00394-01AI95-00394-01} {AI05-0171-1AI05-0171-1} {AI05-0246-1AI05-0246-1} pragma Task_Dispatching_Policy (FIFO_Within_Priorities);
104007 pragma Locking_Policy (Ceiling_Locking);
104008 pragma Detect_Blocking;
104009 pragma Restrictions (
104010 No_Abort_Statements,
104011 No_Dynamic_Attachment,
104012 No_Dynamic_Priorities,
104013 No_Implicit_Heap_Allocations,
104014 No_Local_Protected_Objects,
104015 No_Local_Timing_Events,
104016 No_Protected_Type_Allocators,
104017 No_Relative_Delay,
104018 No_Requeue_Statements,
104019 No_Select_Statements,
104020 No_Specific_Termination_Handlers,
104021 No_Task_Allocators,
104022 No_Task_Hierarchy,
104023 No_Task_Termination,
104024 Simple_Barriers,
104025 Max_Entry_Queue_Length => 1,
104026 Max_Protected_Entries => 1,
104027 Max_Task_Entries => 0,
104028 No_Dependence => Ada.Asynchronous_Task_Control,
104029 No_Dependence => Ada.Calendar,
104030 No_Dependence => Ada.Execution_Time.Group_Budgets,
104031 No_Dependence => Ada.Execution_Time.Timers,
104032 No_Dependence => Ada.Task_Attributes,
104033 No_Dependence => System.Multiprocessors.Dispatching_Domains);
104034
104035 6.a/3
104036 Discussion: The Ravenscar profile is named for the location of
104037 the meeting that defined its initial version. The name is now
104038 in widespread use, so we stick with existing practice, rather
104039 than using a more descriptive name.
104040
104041 Paragraph 7 was deleted.
104042
104043 _Implementation Requirements_
104044
104045 8/3
104046 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} A task shall only be
104047 on the ready queues of one processor, and the processor to which a task
104048 belongs shall be defined statically. Whenever a task running on a
104049 processor reaches a task dispatching point, it goes back to the ready
104050 queues of the same processor. A task with a CPU value of
104051 Not_A_Specific_CPU will execute on an implementation defined processor.
104052 [A task without a CPU aspect will activate and execute on the same
104053 processor as its activating task.]
104054
104055 8.a/3
104056 Proof: The processor of a task without a CPU aspect is defined
104057 in *note D.16::.
104058
104059 8.a.1/3
104060 Implementation defined: The processor on which a task with a
104061 CPU value of a Not_A_Specific_CPU will execute when the
104062 Ravenscar profile is in effect.
104063
104064 _Implementation Advice_
104065
104066 9/3
104067 {AI05-0171-1AI05-0171-1} On a multiprocessor system, an implementation
104068 should support a fully partitioned approach. Each processor should have
104069 separate and disjoint ready queues.
104070
104071 9.a.1/3
104072 Implementation Advice: On a multiprocessor system, each
104073 processor should have a separate and disjoint ready queue.
104074
104075 NOTES
104076
104077 10/3
104078 42 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The
104079 effect of the Max_Entry_Queue_Length => 1 restriction applies only
104080 to protected entry queues due to the accompanying restriction of
104081 Max_Task_Entries => 0.
104082
104083 _Extensions to Ada 95_
104084
104085 10.a/3
104086 {AI95-00249-01AI95-00249-01} {AI05-0246-1AI05-0246-1} The
104087 Ravenscar profile is new; it was moved here by Ada 2012.
104088
104089 _Wording Changes from Ada 2005_
104090
104091 10.b/3
104092 {AI05-0171-1AI05-0171-1} How Ravenscar behaves on a
104093 multiprocessor system is now defined.
104094
104095 \1f
104096 File: aarm2012.info, Node: D.14, Next: D.15, Prev: D.13, Up: Annex D
104097
104098 D.14 Execution Time
104099 ===================
104100
104101 1/3
104102 {AI95-00307-01AI95-00307-01} {AI05-0299-1AI05-0299-1} This subclause
104103 describes a language-defined package to measure execution time.
104104
104105 _Static Semantics_
104106
104107 2/2
104108 {AI95-00307-01AI95-00307-01} The following language-defined library
104109 package exists:
104110
104111 3/2
104112 with Ada.Task_Identification;
104113 with Ada.Real_Time; use Ada.Real_Time;
104114 package Ada.Execution_Time is
104115
104116 4/2
104117 type CPU_Time is private;
104118 CPU_Time_First : constant CPU_Time;
104119 CPU_Time_Last : constant CPU_Time;
104120 CPU_Time_Unit : constant := implementation-defined-real-number;
104121 CPU_Tick : constant Time_Span;
104122
104123 5/2
104124 function Clock
104125 (T : Ada.Task_Identification.Task_Id
104126 := Ada.Task_Identification.Current_Task)
104127 return CPU_Time;
104128
104129 6/2
104130 function "+" (Left : CPU_Time; Right : Time_Span) return CPU_Time;
104131 function "+" (Left : Time_Span; Right : CPU_Time) return CPU_Time;
104132 function "-" (Left : CPU_Time; Right : Time_Span) return CPU_Time;
104133 function "-" (Left : CPU_Time; Right : CPU_Time) return Time_Span;
104134
104135 7/2
104136 function "<" (Left, Right : CPU_Time) return Boolean;
104137 function "<=" (Left, Right : CPU_Time) return Boolean;
104138 function ">" (Left, Right : CPU_Time) return Boolean;
104139 function ">=" (Left, Right : CPU_Time) return Boolean;
104140
104141 8/2
104142 procedure Split
104143 (T : in CPU_Time; SC : out Seconds_Count; TS : out Time_Span);
104144
104145 9/2
104146 function Time_Of (SC : Seconds_Count;
104147 TS : Time_Span := Time_Span_Zero) return CPU_Time;
104148
104149 9.1/3
104150 {AI05-0170-1AI05-0170-1} Interrupt_Clocks_Supported : constant Boolean := implementation-defined;
104151
104152 9.2/3
104153 {AI05-0170-1AI05-0170-1} Separate_Interrupt_Clocks_Supported : constant Boolean :=
104154 implementation-defined;
104155
104156 9.3/3
104157 {AI05-0170-1AI05-0170-1} function Clock_For_Interrupts return CPU_Time;
104158
104159 10/2
104160 private
104161 ... -- not specified by the language
104162 end Ada.Execution_Time;
104163
104164 11/3
104165 {AI95-00307-01AI95-00307-01} {AI05-0170-1AI05-0170-1}
104166 {AI05-0269-1AI05-0269-1} The execution time or CPU time of a given task
104167 is defined as the time spent by the system executing that task,
104168 including the time spent executing run-time or system services on its
104169 behalf. The mechanism used to measure execution time is implementation
104170 defined. The Boolean constant Interrupt_Clocks_Supported is set to True
104171 if the implementation separately accounts for the execution time of
104172 interrupt handlers. If it is set to False it is implementation defined
104173 which task, if any, is charged the execution time that is consumed by
104174 interrupt handlers. The Boolean constant
104175 Separate_Interrupt_Clocks_Supported is set to True if the implementation
104176 separately accounts for the execution time of individual interrupt
104177 handlers (see *note D.14.3::).
104178
104179 11.a/2
104180 Discussion: The implementation-defined properties above and of
104181 the values declared in the package are repeated in
104182 Documentation Requirements, so we don't mark them as
104183 implementation-defined.
104184
104185 12/2
104186 {AI95-00307-01AI95-00307-01} The type CPU_Time represents the execution
104187 time of a task. The set of values of this type corresponds one-to-one
104188 with an implementation-defined range of mathematical integers.
104189
104190 13/2
104191 {AI95-00307-01AI95-00307-01} The CPU_Time value I represents the
104192 half-open execution-time interval that starts with I*CPU_Time_Unit and
104193 is limited by (I+1)*CPU_Time_Unit, where CPU_Time_Unit is an
104194 implementation-defined real number. For each task, the execution time
104195 value is set to zero at the creation of the task.
104196
104197 13.a/2
104198 Ramification: Since it is implementation-defined which task is
104199 charged execution time for system services, the execution time
104200 value may become nonzero even before the start of the
104201 activation of the task.
104202
104203 14/2
104204 {AI95-00307-01AI95-00307-01} CPU_Time_First and CPU_Time_Last are the
104205 smallest and largest values of the CPU_Time type, respectively.
104206
104207 14.1/3
104208 {AI05-0170-1AI05-0170-1} The execution time value for the function
104209 Clock_For_Interrupts is initialized to zero.
104210
104211 _Dynamic Semantics_
104212
104213 15/2
104214 {AI95-00307-01AI95-00307-01} CPU_Time_Unit is the smallest amount of
104215 execution time representable by the CPU_Time type; it is expressed in
104216 seconds. A CPU clock tick is an execution time interval during which
104217 the clock value (as observed by calling the Clock function) remains
104218 constant. CPU_Tick is the average length of such intervals.
104219
104220 16/2
104221 {AI95-00307-01AI95-00307-01} The effects of the operators on CPU_Time
104222 and Time_Span are as for the operators defined for integer types.
104223
104224 17/2
104225 {AI95-00307-01AI95-00307-01} The function Clock returns the current
104226 execution time of the task identified by T; Tasking_Error is raised if
104227 that task has terminated; Program_Error is raised if the value of T is
104228 Task_Identification.Null_Task_Id.
104229
104230 18/2
104231 {AI95-00307-01AI95-00307-01} The effects of the Split and Time_Of
104232 operations are defined as follows, treating values of type CPU_Time,
104233 Time_Span, and Seconds_Count as mathematical integers. The effect of
104234 Split (T, SC, TS) is to set SC and TS to values such that
104235 T*CPU_Time_Unit = SC*1.0 + TS*CPU_Time_Unit, and 0.0 <= TS*CPU_Time_Unit
104236 < 1.0. The value returned by Time_Of(SC,TS) is the execution-time value
104237 T such that T*CPU_Time_Unit=SC*1.0 + TS*CPU_Time_Unit.
104238
104239 18.1/3
104240 {AI05-0170-1AI05-0170-1} The function Clock_For_Interrupts returns the
104241 total cumulative time spent executing within all interrupt handlers.
104242 This time is not allocated to any task execution time clock. If
104243 Interrupt_Clocks_Supported is set to False the function raises
104244 Program_Error.
104245
104246 _Erroneous Execution_
104247
104248 19/2
104249 {AI95-00307-01AI95-00307-01} For a call of Clock, if the task identified
104250 by T no longer exists, the execution of the program is erroneous.
104251
104252 _Implementation Requirements_
104253
104254 20/2
104255 {AI95-00307-01AI95-00307-01} The range of CPU_Time values shall be
104256 sufficient to uniquely represent the range of execution times from the
104257 task start-up to 50 years of execution time later. CPU_Tick shall be no
104258 greater than 1 millisecond.
104259
104260 _Documentation Requirements_
104261
104262 21/2
104263 {AI95-00307-01AI95-00307-01} The implementation shall document the
104264 values of CPU_Time_First, CPU_Time_Last, CPU_Time_Unit, and CPU_Tick.
104265
104266 21.a/2
104267 Documentation Requirement: The values of CPU_Time_First,
104268 CPU_Time_Last, CPU_Time_Unit, and CPU_Tick of package
104269 Execution_Time.
104270
104271 22/2
104272 {AI95-00307-01AI95-00307-01} The implementation shall document the
104273 properties of the underlying mechanism used to measure execution times,
104274 such as the range of values supported and any relevant aspects of the
104275 underlying hardware or operating system facilities used.
104276
104277 22.a/3
104278 Documentation Requirement: The properties of the mechanism
104279 used to implement package Execution_Time, including the values
104280 of the constants defined in the package.
104281
104282 _Metrics_
104283
104284 23/2
104285 {AI95-00307-01AI95-00307-01} The implementation shall document the
104286 following metrics:
104287
104288 24/2
104289 * An upper bound on the execution-time duration of a clock tick.
104290 This is a value D such that if t1 and t2 are any execution times of
104291 a given task such that t1 < t2 and Clockt1 = Clockt2 then t2 - t1
104292 <= D.
104293
104294 25/2
104295 * An upper bound on the size of a clock jump. A clock jump is the
104296 difference between two successive distinct values of an
104297 execution-time clock (as observed by calling the Clock function
104298 with the same Task_Id).
104299
104300 26/2
104301 * An upper bound on the execution time of a call to the Clock
104302 function, in processor clock cycles.
104303
104304 27/2
104305 * Upper bounds on the execution times of the operators of the type
104306 CPU_Time, in processor clock cycles.
104307
104308 27.a/2
104309 Documentation Requirement: The metrics for execution time.
104310
104311 _Implementation Permissions_
104312
104313 28/2
104314 {AI95-00307-01AI95-00307-01} Implementations targeted to machines with
104315 word size smaller than 32 bits need not support the full range and
104316 granularity of the CPU_Time type.
104317
104318 _Implementation Advice_
104319
104320 29/2
104321 {AI95-00307-01AI95-00307-01} When appropriate, implementations should
104322 provide configuration mechanisms to change the value of CPU_Tick.
104323
104324 29.a/2
104325 Implementation Advice: When appropriate, implementations
104326 should provide configuration mechanisms to change the value of
104327 Execution_Time.CPU_Tick.
104328
104329 _Extensions to Ada 95_
104330
104331 29.b/2
104332 {AI95-00307-01AI95-00307-01} The package Execution_Time is
104333 new.
104334
104335 _Incompatibilities With Ada 2005_
104336
104337 29.c/3
104338 {AI05-0170-1AI05-0170-1} Function Clock_For_Interrupts, and
104339 constants Interrupt_Clocks_Supported and
104340 Separate_Interrupt_Clocks_Supported are added to
104341 Execution_Time. If Execution_Time is referenced in a
104342 use_clause, and an entity E with a defining_identifier of one
104343 of the added entities is defined in a package that is also
104344 referenced in a use_clause, the entity E may no longer be
104345 use-visible, resulting in errors. This should be rare and is
104346 easily fixed if it does occur.
104347
104348 _Wording Changes from Ada 2005_
104349
104350 29.d/3
104351 {AI05-0170-1AI05-0170-1} If Interrupt_Clocks_Supported is
104352 True, it is now possible to determine the execution time of
104353 interrupt handlers. This is not an inconsistency, as not
104354 charging any task for such time was a legitimate
104355 implementation for Ada 2005.
104356
104357 * Menu:
104358
104359 * D.14.1 :: Execution Time Timers
104360 * D.14.2 :: Group Execution Time Budgets
104361 * D.14.3 :: Execution Time of Interrupt Handlers
104362
104363 \1f
104364 File: aarm2012.info, Node: D.14.1, Next: D.14.2, Up: D.14
104365
104366 D.14.1 Execution Time Timers
104367 ----------------------------
104368
104369 1/3
104370 {AI95-00307-01AI95-00307-01} {AI05-0299-1AI05-0299-1} This subclause
104371 describes a language-defined package that provides a facility for
104372 calling a handler when a task has used a defined amount of CPU time.
104373
104374 _Static Semantics_
104375
104376 2/2
104377 {AI95-00307-01AI95-00307-01} The following language-defined library
104378 package exists:
104379
104380 3/2
104381 with System;
104382 package Ada.Execution_Time.Timers is
104383
104384 4/2
104385 type Timer (T : not null access constant
104386 Ada.Task_Identification.Task_Id) is
104387 tagged limited private;
104388
104389 5/2
104390 type Timer_Handler is
104391 access protected procedure (TM : in out Timer);
104392
104393 6/2
104394 Min_Handler_Ceiling : constant System.Any_Priority :=
104395 implementation-defined;
104396
104397 7/2
104398 procedure Set_Handler (TM : in out Timer;
104399 In_Time : in Time_Span;
104400 Handler : in Timer_Handler);
104401 procedure Set_Handler (TM : in out Timer;
104402 At_Time : in CPU_Time;
104403 Handler : in Timer_Handler);
104404 function Current_Handler (TM : Timer) return Timer_Handler;
104405 procedure Cancel_Handler (TM : in out Timer;
104406 Cancelled : out Boolean);
104407
104408 8/2
104409 function Time_Remaining (TM : Timer) return Time_Span;
104410
104411 9/2
104412 Timer_Resource_Error : exception;
104413
104414 10/2
104415 private
104416 ... -- not specified by the language
104417 end Ada.Execution_Time.Timers;
104418
104419 11/2
104420 {AI95-00307-01AI95-00307-01} The type Timer represents an execution-time
104421 event for a single task and is capable of detecting execution-time
104422 overruns. The access discriminant T identifies the task concerned. The
104423 type Timer needs finalization (see *note 7.6::).
104424
104425 12/2
104426 {AI95-00307-01AI95-00307-01} An object of type Timer is said to be set
104427 if it is associated with a nonnull value of type Timer_Handler and
104428 cleared otherwise. All Timer objects are initially cleared.
104429
104430 13/2
104431 {AI95-00307-01AI95-00307-01} The type Timer_Handler identifies a
104432 protected procedure to be executed by the implementation when the timer
104433 expires. Such a protected procedure is called a handler.
104434
104435 13.a/2
104436 Discussion: Type Timer is tagged. This makes it possible to
104437 share a handler between several events. In simple cases,
104438 'Access can be used to compare the parameter with a specific
104439 timer object (this works because a tagged type is a
104440 by-reference type). In more complex cases, a type extension
104441 of type Timer can be declared; a double type conversion can be
104442 used to access the extension data. An example of how this can
104443 be done can be found for the similar type Timing_Event, see
104444 *note D.15::.
104445
104446 _Dynamic Semantics_
104447
104448 14/2
104449 {AI95-00307-01AI95-00307-01} When a Timer object is created, or upon the
104450 first call of a Set_Handler procedure with the timer as parameter, the
104451 resources required to operate an execution-time timer based on the
104452 associated execution-time clock are allocated and initialized. If this
104453 operation would exceed the available resources, Timer_Resource_Error is
104454 raised.
104455
104456 15/3
104457 {AI95-00307-01AI95-00307-01} {AI05-0264-1AI05-0264-1} The procedures
104458 Set_Handler associate the handler Handler with the timer TM: if Handler
104459 is null, the timer is cleared; otherwise, it is set. The first
104460 procedure Set_Handler loads the timer TM with an interval specified by
104461 the Time_Span parameter. In this mode, the timer TM expires when the
104462 execution time of the task identified by TM.T.all has increased by
104463 In_Time; if In_Time is less than or equal to zero, the timer expires
104464 immediately. The second procedure Set_Handler loads the timer TM with
104465 the absolute value specified by At_Time. In this mode, the timer TM
104466 expires when the execution time of the task identified by TM.T.all
104467 reaches At_Time; if the value of At_Time has already been reached when
104468 Set_Handler is called, the timer expires immediately.
104469
104470 15.a/2
104471 Implementation Note: Since an access-to-constant can designate
104472 a variable, the Task_Id value designated by the discriminant
104473 of a Timer object can be changed after the object is created.
104474 Thus, an implementation cannot use the value of the Task_Id
104475 other than where this Standard specifies. For instance, the
104476 Task_Id should be read when the timer is set, but it should
104477 not be used when the timer expires (as it may designate a
104478 different task at that point).
104479
104480 16/2
104481 {AI95-00307-01AI95-00307-01} A call of a procedure Set_Handler for a
104482 timer that is already set replaces the handler and the (absolute or
104483 relative) execution time; if Handler is not null, the timer remains set.
104484
104485 17/2
104486 {AI95-00307-01AI95-00307-01} When a timer expires, the associated
104487 handler is executed, passing the timer as parameter. The initial action
104488 of the execution of the handler is to clear the event.
104489
104490 18/3
104491 {AI95-00307-01AI95-00307-01} {AI05-0264-1AI05-0264-1} The function
104492 Current_Handler returns the handler associated with the timer TM if that
104493 timer is set; otherwise, it returns null.
104494
104495 19/3
104496 {AI95-00307-01AI95-00307-01} {AI05-0264-1AI05-0264-1} The procedure
104497 Cancel_Handler clears the timer if it is set. Cancelled is assigned
104498 True if the timer was set prior to it being cleared; otherwise, it is
104499 assigned False.
104500
104501 20/3
104502 {AI95-00307-01AI95-00307-01} {AI05-0264-1AI05-0264-1} The function
104503 Time_Remaining returns the execution time interval that remains until
104504 the timer TM would expire, if that timer is set; otherwise, it returns
104505 Time_Span_Zero.
104506
104507 21/2
104508 {AI95-00307-01AI95-00307-01} The constant Min_Handler_Ceiling is the
104509 minimum ceiling priority required for a protected object with a handler
104510 to ensure that no ceiling violation will occur when that handler is
104511 invoked.
104512
104513 22/2
104514 {AI95-00307-01AI95-00307-01} As part of the finalization of an object of
104515 type Timer, the timer is cleared.
104516
104517 23/2
104518 {AI95-00307-01AI95-00307-01} For all the subprograms defined in this
104519 package, Tasking_Error is raised if the task identified by TM.T.all has
104520 terminated, and Program_Error is raised if the value of TM.T.all is
104521 Task_Identification.Null_Task_Id.
104522
104523 24/2
104524 {AI95-00307-01AI95-00307-01} An exception propagated from a handler
104525 invoked as part of the expiration of a timer has no effect.
104526
104527 _Erroneous Execution_
104528
104529 25/2
104530 {AI95-00307-01AI95-00307-01} For a call of any of the subprograms
104531 defined in this package, if the task identified by TM.T.all no longer
104532 exists, the execution of the program is erroneous.
104533
104534 _Implementation Requirements_
104535
104536 26/2
104537 {AI95-00307-01AI95-00307-01} For a given Timer object, the
104538 implementation shall perform the operations declared in this package
104539 atomically with respect to any of these operations on the same Timer
104540 object. The replacement of a handler by a call of Set_Handler shall be
104541 performed atomically with respect to the execution of the handler.
104542
104543 26.a/2
104544 Reason: This prevents various race conditions. In particular
104545 it ensures that if an event occurs when Set_Handler is
104546 changing the handler then either the new or old handler is
104547 executed in response to the appropriate event. It is never
104548 possible for a new handler to be executed in response to an
104549 old event
104550
104551 27/2
104552 {AI95-00307-01AI95-00307-01} When an object of type Timer is finalized,
104553 the system resources used by the timer shall be deallocated.
104554
104555 _Implementation Permissions_
104556
104557 28/3
104558 {AI95-00307-01AI95-00307-01} {AI05-0264-1AI05-0264-1} Implementations
104559 may limit the number of timers that can be defined for each task. If
104560 this limit is exceeded, then Timer_Resource_Error is raised.
104561
104562 NOTES
104563
104564 29/2
104565 43 {AI95-00307-01AI95-00307-01} A Timer_Handler can be associated
104566 with several Timer objects.
104567
104568 _Extensions to Ada 95_
104569
104570 29.a/2
104571 {AI95-00307-01AI95-00307-01} The package Execution_Time.Timers
104572 is new.
104573
104574 \1f
104575 File: aarm2012.info, Node: D.14.2, Next: D.14.3, Prev: D.14.1, Up: D.14
104576
104577 D.14.2 Group Execution Time Budgets
104578 -----------------------------------
104579
104580 1/3
104581 {AI95-00354-01AI95-00354-01} {AI05-0299-1AI05-0299-1} This subclause
104582 describes a language-defined package to assign execution time budgets to
104583 groups of tasks.
104584
104585 _Static Semantics_
104586
104587 2/2
104588 {AI95-00354-01AI95-00354-01} The following language-defined library
104589 package exists:
104590
104591 3/3
104592 {AI05-0169-1AI05-0169-1} with System;
104593 with System.Multiprocessors;
104594 package Ada.Execution_Time.Group_Budgets is
104595
104596 4/3
104597 {AI05-0092-1AI05-0092-1} {AI05-0169-1AI05-0169-1} type Group_Budget(CPU : System.Multiprocessors.CPU :=
104598 System.Multiprocessors.CPU'First)
104599 is tagged limited private;
104600
104601 5/2
104602 type Group_Budget_Handler is access
104603 protected procedure (GB : in out Group_Budget);
104604
104605 6/2
104606 type Task_Array is array (Positive range <>) of
104607 Ada.Task_Identification.Task_Id;
104608
104609 7/2
104610 Min_Handler_Ceiling : constant System.Any_Priority :=
104611 implementation-defined;
104612
104613 7.a.1/3
104614 Implementation defined: The value of Min_Handler_Ceiling in
104615 Execution_Time.Group_Budgets.
104616
104617 8/2
104618 procedure Add_Task (GB : in out Group_Budget;
104619 T : in Ada.Task_Identification.Task_Id);
104620 procedure Remove_Task (GB: in out Group_Budget;
104621 T : in Ada.Task_Identification.Task_Id);
104622 function Is_Member (GB : Group_Budget;
104623 T : Ada.Task_Identification.Task_Id) return Boolean;
104624 function Is_A_Group_Member
104625 (T : Ada.Task_Identification.Task_Id) return Boolean;
104626 function Members (GB : Group_Budget) return Task_Array;
104627
104628 9/2
104629 procedure Replenish (GB : in out Group_Budget; To : in Time_Span);
104630 procedure Add (GB : in out Group_Budget; Interval : in Time_Span);
104631 function Budget_Has_Expired (GB : Group_Budget) return Boolean;
104632 function Budget_Remaining (GB : Group_Budget) return Time_Span;
104633
104634 10/2
104635 procedure Set_Handler (GB : in out Group_Budget;
104636 Handler : in Group_Budget_Handler);
104637 function Current_Handler (GB : Group_Budget)
104638 return Group_Budget_Handler;
104639 procedure Cancel_Handler (GB : in out Group_Budget;
104640 Cancelled : out Boolean);
104641
104642 11/2
104643 Group_Budget_Error : exception;
104644
104645 12/2
104646 private
104647 -- not specified by the language
104648 end Ada.Execution_Time.Group_Budgets;
104649
104650 13/2
104651 {AI95-00354-01AI95-00354-01} The type Group_Budget represents an
104652 execution time budget to be used by a group of tasks. The type
104653 Group_Budget needs finalization (see *note 7.6::). A task can belong to
104654 at most one group. Tasks of any priority can be added to a group.
104655
104656 14/2
104657 {AI95-00354-01AI95-00354-01} An object of type Group_Budget has an
104658 associated nonnegative value of type Time_Span known as its budget,
104659 which is initially Time_Span_Zero. The type Group_Budget_Handler
104660 identifies a protected procedure to be executed by the implementation
104661 when the budget is exhausted, that is, reaches zero. Such a protected
104662 procedure is called a handler.
104663
104664 15/2
104665 {AI95-00354-01AI95-00354-01} An object of type Group_Budget also
104666 includes a handler, which is a value of type Group_Budget_Handler. The
104667 handler of the object is said to be set if it is not null and cleared
104668 otherwise. The handler of all Group_Budget objects is initially
104669 cleared.
104670
104671 15.a/2
104672 Discussion: Type Group_Budget is tagged. This makes it
104673 possible to share a handler between several events. In simple
104674 cases, 'Access can be used to compare the parameter with a
104675 specific group budget object (this works because a tagged type
104676 is a by-reference type). In more complex cases, a type
104677 extension of type Group_Budget can be declared; a double type
104678 conversion can be used to access the extension data. An
104679 example of how this can be done can be found for the similar
104680 type Timing_Event, see *note D.15::.
104681
104682 _Dynamic Semantics_
104683
104684 16/2
104685 {AI95-00354-01AI95-00354-01} The procedure Add_Task adds the task
104686 identified by T to the group GB; if that task is already a member of
104687 some other group, Group_Budget_Error is raised.
104688
104689 17/2
104690 {AI95-00354-01AI95-00354-01} The procedure Remove_Task removes the task
104691 identified by T from the group GB; if that task is not a member of the
104692 group GB, Group_Budget_Error is raised. After successful execution of
104693 this procedure, the task is no longer a member of any group.
104694
104695 18/3
104696 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The function
104697 Is_Member returns True if the task identified by T is a member of the
104698 group GB; otherwise, it returns False.
104699
104700 19/3
104701 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The function
104702 Is_A_Group_Member returns True if the task identified by T is a member
104703 of some group; otherwise, it returns False.
104704
104705 20/2
104706 {AI95-00354-01AI95-00354-01} The function Members returns an array of
104707 values of type Task_Identification.Task_Id identifying the members of
104708 the group GB. The order of the components of the array is unspecified.
104709
104710 21/3
104711 {AI95-00354-01AI95-00354-01} {AI05-0092-1AI05-0092-1}
104712 {AI05-0169-1AI05-0169-1} The procedure Replenish loads the group budget
104713 GB with To as the Time_Span value. The exception Group_Budget_Error is
104714 raised if the Time_Span value To is nonpositive. Any execution on CPU
104715 of any member of the group of tasks results in the budget counting down,
104716 unless exhausted. When the budget becomes exhausted (reaches
104717 Time_Span_Zero), the associated handler is executed if the handler of
104718 group budget GB is set. Nevertheless, the tasks continue to execute.
104719
104720 22/2
104721 {AI95-00354-01AI95-00354-01} The procedure Add modifies the budget of
104722 the group GB. A positive value for Interval increases the budget. A
104723 negative value for Interval reduces the budget, but never below
104724 Time_Span_Zero. A zero value for Interval has no effect. A call of
104725 procedure Add that results in the value of the budget going to
104726 Time_Span_Zero causes the associated handler to be executed if the
104727 handler of the group budget GB is set.
104728
104729 23/3
104730 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The function
104731 Budget_Has_Expired returns True if the budget of group GB is exhausted
104732 (equal to Time_Span_Zero); otherwise, it returns False.
104733
104734 24/2
104735 {AI95-00354-01AI95-00354-01} The function Budget_Remaining returns the
104736 remaining budget for the group GB. If the budget is exhausted it returns
104737 Time_Span_Zero. This is the minimum value for a budget.
104738
104739 25/3
104740 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The procedure
104741 Set_Handler associates the handler Handler with the Group_Budget GB: if
104742 Handler is null, the handler of Group_Budget is cleared; otherwise, it
104743 is set.
104744
104745 26/2
104746 {AI95-00354-01AI95-00354-01} A call of Set_Handler for a Group_Budget
104747 that already has a handler set replaces the handler; if Handler is not
104748 null, the handler for Group_Budget remains set.
104749
104750 27/3
104751 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The function
104752 Current_Handler returns the handler associated with the group budget GB
104753 if the handler for that group budget is set; otherwise, it returns null.
104754
104755 28/3
104756 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} The procedure
104757 Cancel_Handler clears the handler for the group budget if it is set.
104758 Cancelled is assigned True if the handler for the group budget was set
104759 prior to it being cleared; otherwise, it is assigned False.
104760
104761 29/2
104762 {AI95-00354-01AI95-00354-01} The constant Min_Handler_Ceiling is the
104763 minimum ceiling priority required for a protected object with a handler
104764 to ensure that no ceiling violation will occur when that handler is
104765 invoked.
104766
104767 30/2
104768 {AI95-00354-01AI95-00354-01} The precision of the accounting of task
104769 execution time to a Group_Budget is the same as that defined for
104770 execution-time clocks from the parent package.
104771
104772 31/2
104773 {AI95-00354-01AI95-00354-01} As part of the finalization of an object of
104774 type Group_Budget all member tasks are removed from the group identified
104775 by that object.
104776
104777 32/3
104778 {AI95-00354-01AI95-00354-01} {AI05-0264-1AI05-0264-1} If a task is a
104779 member of a Group_Budget when it terminates, then as part of the
104780 finalization of the task it is removed from the group.
104781
104782 33/2
104783 {AI95-00354-01AI95-00354-01} For all the operations defined in this
104784 package, Tasking_Error is raised if the task identified by T has
104785 terminated, and Program_Error is raised if the value of T is
104786 Task_Identification.Null_Task_Id.
104787
104788 34/2
104789 {AI95-00354-01AI95-00354-01} An exception propagated from a handler
104790 invoked when the budget of a group of tasks becomes exhausted has no
104791 effect.
104792
104793 _Erroneous Execution_
104794
104795 35/2
104796 {AI95-00354-01AI95-00354-01} For a call of any of the subprograms
104797 defined in this package, if the task identified by T no longer exists,
104798 the execution of the program is erroneous.
104799
104800 _Implementation Requirements_
104801
104802 36/2
104803 {AI95-00354-01AI95-00354-01} For a given Group_Budget object, the
104804 implementation shall perform the operations declared in this package
104805 atomically with respect to any of these operations on the same
104806 Group_Budget object. The replacement of a handler, by a call of
104807 Set_Handler, shall be performed atomically with respect to the execution
104808 of the handler.
104809
104810 36.a/2
104811 Reason: This prevents various race conditions. In particular
104812 it ensures that if the budget is exhausted when Set_Handler is
104813 changing the handler then either the new or old handler is
104814 executed and the exhausting event is not lost.
104815
104816 NOTES
104817
104818 37/2
104819 44 {AI95-00354-01AI95-00354-01} Clearing or setting of the handler
104820 of a group budget does not change the current value of the budget.
104821 Exhaustion or loading of a budget does not change whether the
104822 handler of the group budget is set or cleared.
104823
104824 38/2
104825 45 {AI95-00354-01AI95-00354-01} A Group_Budget_Handler can be
104826 associated with several Group_Budget objects.
104827
104828 _Extensions to Ada 95_
104829
104830 38.a/2
104831 {AI95-00354-01AI95-00354-01} The package
104832 Execution_Time.Group_Budgets is new.
104833
104834 _Inconsistencies With Ada 2005_
104835
104836 38.b/3
104837 {AI05-0169-1AI05-0169-1} A Group_Budget is now defined to work
104838 on a single processor. If an implementation managed to make
104839 this package work for programs running on a multiprocessor
104840 system, and a program depends on that fact, it could fail when
104841 ported to Ada 2012. We believe it is unlikely that such an
104842 implementation exists because of the difficulty of signalling
104843 other processors when the time reaches zero; in any case,
104844 depending on such an implementation is not portable.
104845
104846 \1f
104847 File: aarm2012.info, Node: D.14.3, Prev: D.14.2, Up: D.14
104848
104849 D.14.3 Execution Time of Interrupt Handlers
104850 -------------------------------------------
104851
104852 1/3
104853 {AI05-0170-1AI05-0170-1} {AI05-0299-1AI05-0299-1} This subclause
104854 describes a language-defined package to measure the execution time of
104855 interrupt handlers.
104856
104857 _Static Semantics_
104858
104859 2/3
104860 {AI05-0170-1AI05-0170-1} The following language-defined library package
104861 exists:
104862
104863 3/3
104864 with Ada.Interrupts;
104865 package Ada.Execution_Time.Interrupts is
104866 function Clock (Interrupt : Ada.Interrupts.Interrupt_Id)
104867 return CPU_Time;
104868 function Supported (Interrupt : Ada.Interrupts.Interrupt_Id)
104869 return Boolean;
104870 end Ada.Execution_Time.Interrupts;
104871
104872 4/3
104873 {AI05-0170-1AI05-0170-1} The execution time or CPU time of a given
104874 interrupt Interrupt is defined as the time spent by the system executing
104875 interrupt handlers identified by Interrupt, including the time spent
104876 executing run-time or system services on its behalf. The mechanism used
104877 to measure execution time is implementation defined. Time spent
104878 executing interrupt handlers is distinct from time spent executing any
104879 task.
104880
104881 4.a/3
104882 Discussion: The implementation-defined mechanism here is the
104883 same as that covered by the Documentation Requirements of
104884 *note D.14::, so we don't repeat that requirement here.
104885
104886 5/3
104887 {AI05-0170-1AI05-0170-1} For each interrupt, the execution time value is
104888 initially set to zero.
104889
104890 _Dynamic Semantics_
104891
104892 6/3
104893 {AI05-0170-1AI05-0170-1} The function Clock returns the current
104894 cumulative execution time of the interrupt identified by Interrupt. If
104895 Separate_Interrupt_Clocks_Supported is set to False the function raises
104896 Program_Error.
104897
104898 7/3
104899 {AI05-0170-1AI05-0170-1} {AI05-0264-1AI05-0264-1} The function Supported
104900 returns True if the implementation is monitoring the execution time of
104901 the interrupt identified by Interrupt; otherwise, it returns False. For
104902 any Interrupt_Id Interrupt for which Supported(Interrupt) returns False,
104903 the function Clock(Interrupt) will return a value equal to
104904 Ada.Execution_Time.Time_Of(0).
104905
104906 _Extensions to Ada 2005_
104907
104908 7.a/3
104909 {AI05-0170-1AI05-0170-1} The package Execution_Time.Interrupts
104910 is new.
104911
104912 \1f
104913 File: aarm2012.info, Node: D.15, Next: D.16, Prev: D.14, Up: Annex D
104914
104915 D.15 Timing Events
104916 ==================
104917
104918 1/3
104919 {AI95-00297-01AI95-00297-01} {AI05-0299-1AI05-0299-1} This subclause
104920 describes a language-defined package to allow user-defined protected
104921 procedures to be executed at a specified time without the need for a
104922 task or a delay statement.
104923
104924 _Static Semantics_
104925
104926 2/2
104927 {AI95-00297-01AI95-00297-01} The following language-defined library
104928 package exists:
104929
104930 3/2
104931 package Ada.Real_Time.Timing_Events is
104932
104933 4/2
104934 type Timing_Event is tagged limited private;
104935 type Timing_Event_Handler
104936 is access protected procedure (Event : in out Timing_Event);
104937
104938 5/2
104939 procedure Set_Handler (Event : in out Timing_Event;
104940 At_Time : in Time;
104941 Handler : in Timing_Event_Handler);
104942 procedure Set_Handler (Event : in out Timing_Event;
104943 In_Time : in Time_Span;
104944 Handler : in Timing_Event_Handler);
104945 function Current_Handler (Event : Timing_Event)
104946 return Timing_Event_Handler;
104947 procedure Cancel_Handler (Event : in out Timing_Event;
104948 Cancelled : out Boolean);
104949
104950 6/2
104951 function Time_Of_Event (Event : Timing_Event) return Time;
104952
104953 7/2
104954 private
104955 ... -- not specified by the language
104956 end Ada.Real_Time.Timing_Events;
104957
104958 8/2
104959 {AI95-00297-01AI95-00297-01} The type Timing_Event represents a time in
104960 the future when an event is to occur. The type Timing_Event needs
104961 finalization (see *note 7.6::).
104962
104963 9/2
104964 {AI95-00297-01AI95-00297-01} An object of type Timing_Event is said to
104965 be set if it is associated with a nonnull value of type
104966 Timing_Event_Handler and cleared otherwise. All Timing_Event objects
104967 are initially cleared.
104968
104969 10/2
104970 {AI95-00297-01AI95-00297-01} The type Timing_Event_Handler identifies a
104971 protected procedure to be executed by the implementation when the timing
104972 event occurs. Such a protected procedure is called a handler.
104973
104974 10.a/2
104975 Discussion: Type Timing_Event is tagged. This makes it
104976 possible to share a handler between several events. In simple
104977 cases, 'Access can be used to compare the parameter with a
104978 specific timing event object (this works because a tagged type
104979 is a by-reference type). In more complex cases, a type
104980 extension of type Timing_Event can be declared; a double type
104981 conversion can be used to access the extension data. For
104982 example:
104983
104984 10.b/2
104985 type Toaster_Timing_Event is new Timing_Event with record
104986 Slot : Natural;
104987 end record;
104988
104989 10.c/2
104990 ...
104991
104992 10.d/2
104993 protected body Toaster is
104994
104995 10.e/2
104996 procedure Timer (Event : in out Timing_Event) is
104997 begin
104998 Pop_Up_Toast (Toaster_Timing_Event(Timing_Event'Class(Event)).Slot);
104999 end Timer;
105000
105001 10.f/2
105002 ...
105003 end Toaster;
105004
105005 10.g/2
105006 The extra conversion to the class-wide type is necessary to
105007 make the conversions legal. While this usage is clearly ugly,
105008 we think that the need for this sort of usage will be rare, so
105009 we can live with it. It's certainly better than having no way
105010 to associate data with an event.
105011
105012 _Dynamic Semantics_
105013
105014 11/3
105015 {AI95-00297-01AI95-00297-01} {AI05-0264-1AI05-0264-1} The procedures
105016 Set_Handler associate the handler Handler with the event Event: if
105017 Handler is null, the event is cleared; otherwise, it is set. The first
105018 procedure Set_Handler sets the execution time for the event to be
105019 At_Time. The second procedure Set_Handler sets the execution time for
105020 the event to be Real_Time.Clock + In_Time.
105021
105022 12/2
105023 {AI95-00297-01AI95-00297-01} A call of a procedure Set_Handler for an
105024 event that is already set replaces the handler and the time of
105025 execution; if Handler is not null, the event remains set.
105026
105027 13/2
105028 {AI95-00297-01AI95-00297-01} As soon as possible after the time set for
105029 the event, the handler is executed, passing the event as parameter. The
105030 handler is only executed if the timing event is in the set state at the
105031 time of execution. The initial action of the execution of the handler
105032 is to clear the event.
105033
105034 13.a/2
105035 Reason: The second sentence of this paragraph is because of a
105036 potential race condition. The time might expire and yet
105037 before the handler is executed, some task could call
105038 Cancel_Handler (or equivalently call Set_Handler with a null
105039 parameter) and thus clear the handler.
105040
105041 14/2
105042 {AI95-00297-01AI95-00297-01} If the Ceiling_Locking policy (see *note
105043 D.3::) is in effect when a procedure Set_Handler is called, a check is
105044 made that the ceiling priority of Handler.all is
105045 Interrupt_Priority'Last. If the check fails, Program_Error is raised.
105046
105047 15/3
105048 {AI95-00297-01AI95-00297-01} {AI05-0094-1AI05-0094-1}
105049 {AI05-0264-1AI05-0264-1} If a procedure Set_Handler is called with zero
105050 or negative In_Time or with At_Time indicating a time in the past, then
105051 the handler is executed as soon as possible after the completion of the
105052 call of Set_Handler.
105053
105054 15.a/3
105055 Ramification: {AI05-0094-1AI05-0094-1} The handler will still
105056 be executed. Under no circumstances is a scheduled call of a
105057 handler lost.
105058
105059 15.b/3
105060 Discussion: {AI05-0094-1AI05-0094-1} We say "as soon as
105061 possible" so that we do not deadlock if we are executing the
105062 handler when Set_Handler is called. In that case, the current
105063 invocation of the handler must complete before the new handler
105064 can start executing.
105065
105066 16/3
105067 {AI95-00297-01AI95-00297-01} {AI05-0264-1AI05-0264-1} The function
105068 Current_Handler returns the handler associated with the event Event if
105069 that event is set; otherwise, it returns null.
105070
105071 17/3
105072 {AI95-00297-01AI95-00297-01} {AI05-0264-1AI05-0264-1} The procedure
105073 Cancel_Handler clears the event if it is set. Cancelled is assigned
105074 True if the event was set prior to it being cleared; otherwise, it is
105075 assigned False.
105076
105077 18/3
105078 {AI95-00297-01AI95-00297-01} {AI05-0264-1AI05-0264-1} The function
105079 Time_Of_Event returns the time of the event if the event is set;
105080 otherwise, it returns Real_Time.Time_First.
105081
105082 19/2
105083 {AI95-00297-01AI95-00297-01} As part of the finalization of an object of
105084 type Timing_Event, the Timing_Event is cleared.
105085
105086 19.a/2
105087 Implementation Note: This is the only finalization defined by
105088 the language that has a visible effect; but an implementation
105089 may have other finalization that it needs to perform.
105090 Implementations need to ensure that the event is cleared
105091 before anything else is finalized that would prevent a set
105092 event from being triggered.
105093
105094 20/2
105095 {AI95-00297-01AI95-00297-01} If several timing events are set for the
105096 same time, they are executed in FIFO order of being set.
105097
105098 21/2
105099 {AI95-00297-01AI95-00297-01} An exception propagated from a handler
105100 invoked by a timing event has no effect.
105101
105102 _Implementation Requirements_
105103
105104 22/2
105105 {AI95-00297-01AI95-00297-01} For a given Timing_Event object, the
105106 implementation shall perform the operations declared in this package
105107 atomically with respect to any of these operations on the same
105108 Timing_Event object. The replacement of a handler by a call of
105109 Set_Handler shall be performed atomically with respect to the execution
105110 of the handler.
105111
105112 22.a/2
105113 Reason: This prevents various race conditions. In particular
105114 it ensures that if an event occurs when Set_Handler is
105115 changing the handler then either the new or old handler is
105116 executed in response to the appropriate event. It is never
105117 possible for a new handler to be executed in response to an
105118 old event.
105119
105120 _Metrics_
105121
105122 23/2
105123 {AI95-00297-01AI95-00297-01} The implementation shall document the
105124 following metric:
105125
105126 24/3
105127 * {AI05-0210-1AI05-0210-1} An upper bound on the lateness of the
105128 execution of a handler. That is, the maximum time between the time
105129 specified for the event and when a handler is actually invoked
105130 assuming no other handler or task is executing during this
105131 interval.
105132
105133 24.a/2
105134 Documentation Requirement: The metrics for timing events.
105135
105136 _Implementation Advice_
105137
105138 25/2
105139 {AI95-00297-01AI95-00297-01} The protected handler procedure should be
105140 executed directly by the real-time clock interrupt mechanism.
105141
105142 25.a/2
105143 Implementation Advice: For a timing event, the handler should
105144 be executed directly by the real-time clock interrupt
105145 mechanism.
105146
105147 NOTES
105148
105149 26/2
105150 46 {AI95-00297-01AI95-00297-01} Since a call of Set_Handler is not
105151 a potentially blocking operation, it can be called from within a
105152 handler.
105153
105154 27/2
105155 47 {AI95-00297-01AI95-00297-01} A Timing_Event_Handler can be
105156 associated with several Timing_Event objects.
105157
105158 _Extensions to Ada 95_
105159
105160 27.a/2
105161 {AI95-00297-01AI95-00297-01} The package
105162 Real_Time.Timing_Events is new.
105163
105164 _Wording Changes from Ada 2005_
105165
105166 27.b/3
105167 {AI05-0094-1AI05-0094-1} Correction: Reworded to eliminate a
105168 deadlock condition if the event time is in the past and a
105169 handler is currently executing. This is technically an
105170 inconsistency, but only if a program is depending on
105171 deadlocking; since it is impossible to imagine how that could
105172 be useful, we have not documented this as an inconsistency.
105173
105174 27.c/3
105175 {AI05-0210-1AI05-0210-1} Correction: Clarified the metric for
105176 lateness of a timing event to exclude interference from other
105177 handlers and tasks. This change might change the
105178 documentation of an implementation, but not the implementation
105179 itself, so there is no inconsistency.
105180
105181 \1f
105182 File: aarm2012.info, Node: D.16, Prev: D.15, Up: Annex D
105183
105184 D.16 Multiprocessor Implementation
105185 ==================================
105186
105187 1/3
105188 {AI05-0171-1AI05-0171-1} {AI05-0299-1AI05-0299-1} This subclause allows
105189 implementations on multiprocessor platforms to be configured.
105190
105191 _Static Semantics_
105192
105193 2/3
105194 {AI05-0171-1AI05-0171-1} The following language-defined library package
105195 exists:
105196
105197 3/3
105198 package System.Multiprocessors is
105199 pragma Preelaborate(Multiprocessors);
105200
105201 4/3
105202 type CPU_Range is range 0 .. implementation-defined;
105203 Not_A_Specific_CPU : constant CPU_Range := 0;
105204 subtype CPU is CPU_Range range 1 .. CPU_Range'Last;
105205
105206 4.a.1/3
105207 Implementation defined: The value of CPU_Range'Last in
105208 System.Multiprocessors.
105209
105210 5/3
105211 function Number_Of_CPUs return CPU;
105212 end System.Multiprocessors;
105213
105214 6/3
105215 {AI05-0171-1AI05-0171-1} A call of Number_Of_CPUs returns the number of
105216 processors available to the program. Within a given partition, each
105217 call on Number_Of_CPUs will return the same value.
105218
105219 7/3
105220 {AI05-0229-1AI05-0229-1} For a task type (including the anonymous type
105221 of a single_task_declaration) or subprogram, the following
105222 language-defined representation aspect may be specified:
105223
105224 8/3
105225 CPU
105226 The aspect CPU is an expression, which shall be of type
105227 System.Multiprocessors.CPU_Range.
105228
105229 8.a/3
105230 Aspect Description for CPU: Processor on which a given task
105231 should run.
105232
105233 _Legality Rules_
105234
105235 9/3
105236 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} If the CPU aspect is
105237 specified for a subprogram, the expression shall be static.
105238
105239 10/3
105240 {AI05-0229-1AI05-0229-1} The CPU aspect shall not be specified on a task
105241 interface type.
105242
105243 _Dynamic Semantics_
105244
105245 11/3
105246 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} The expression
105247 specified for the CPU aspect of a task is evaluated for each task object
105248 (see *note 9.1::). The CPU value is then associated with the task
105249 object whose task declaration specifies the aspect.
105250
105251 12/3
105252 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} The CPU aspect has no
105253 effect if it is specified for a subprogram other than the main
105254 subprogram; the CPU value is not associated with any task.
105255
105256 13/3
105257 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} The CPU value is
105258 associated with the environment task if the CPU aspect is specified for
105259 the main subprogram. If the CPU aspect is not specified for the main
105260 subprogram it is implementation defined on which processor the
105261 environment task executes.
105262
105263 13.a.1/3
105264 Implementation defined: The processor on which the environment
105265 task executes in the absence of a value for the aspect CPU.
105266
105267 14/3
105268 {AI05-0171-1AI05-0171-1} {AI05-0264-1AI05-0264-1} The CPU value
105269 determines the processor on which the task will activate and execute;
105270 the task is said to be assigned to that processor. If the CPU value is
105271 Not_A_Specific_CPU, then the task is not assigned to a processor. A
105272 task without a CPU aspect specified will activate and execute on the
105273 same processor as its activating task if the activating task is assigned
105274 a processor. If the CPU value is not in the range of
105275 System.Multiprocessors.CPU_Range or is greater than Number_Of_CPUs the
105276 task is defined to have failed, and it becomes a completed task (see
105277 *note 9.2::).
105278
105279 _Extensions to Ada 2005_
105280
105281 14.a/3
105282 {AI05-0171-1AI05-0171-1} {AI05-0229-1AI05-0229-1} The package
105283 System.Multiprocessors and the CPU aspect are new.
105284
105285 * Menu:
105286
105287 * D.16.1 :: Multiprocessor Dispatching Domains
105288
105289 \1f
105290 File: aarm2012.info, Node: D.16.1, Up: D.16
105291
105292 D.16.1 Multiprocessor Dispatching Domains
105293 -----------------------------------------
105294
105295 1/3
105296 {AI05-0167-1AI05-0167-1} {AI05-0299-1AI05-0299-1} This subclause allows
105297 implementations on multiprocessor platforms to be partitioned into
105298 distinct dispatching domains during program startup.
105299
105300 _Static Semantics_
105301
105302 2/3
105303 {AI05-0167-1AI05-0167-1} The following language-defined library package
105304 exists:
105305
105306 3/3
105307 with Ada.Real_Time;
105308 with Ada.Task_Identification;
105309 package System.Multiprocessors.Dispatching_Domains is
105310
105311 4/3
105312 Dispatching_Domain_Error : exception;
105313
105314 5/3
105315 type Dispatching_Domain (<>) is limited private;
105316
105317 6/3
105318 System_Dispatching_Domain : constant Dispatching_Domain;
105319
105320 7/3
105321 function Create (First, Last : CPU) return Dispatching_Domain;
105322
105323 8/3
105324 function Get_First_CPU (Domain : Dispatching_Domain) return CPU;
105325
105326 9/3
105327 function Get_Last_CPU (Domain : Dispatching_Domain) return CPU;
105328
105329 10/3
105330 function Get_Dispatching_Domain
105331 (T : Ada.Task_Identification.Task_Id :=
105332 Ada.Task_Identification.Current_Task)
105333 return Dispatching_Domain;
105334
105335 11/3
105336 procedure Assign_Task
105337 (Domain : in out Dispatching_Domain;
105338 CPU : in CPU_Range := Not_A_Specific_CPU;
105339 T : in Ada.Task_Identification.Task_Id :=
105340 Ada.Task_Identification.Current_Task);
105341
105342 12/3
105343 procedure Set_CPU
105344 (CPU : in CPU_Range;
105345 T : in Ada.Task_Identification.Task_Id :=
105346 Ada.Task_Identification.Current_Task);
105347
105348 13/3
105349 function Get_CPU
105350 (T : Ada.Task_Identification.Task_Id :=
105351 Ada.Task_Identification.Current_Task)
105352 return CPU_Range;
105353
105354 14/3
105355 procedure Delay_Until_And_Set_CPU
105356 (Delay_Until_Time : in Ada.Real_Time.Time; CPU : in CPU_Range);
105357
105358 15/3
105359 private
105360 ... -- not specified by the language
105361 end System.Multiprocessors.Dispatching_Domains;
105362
105363 16/3
105364 {AI05-0167-1AI05-0167-1} The type Dispatching_Domain represents a series
105365 of processors on which a task may execute. Each processor is contained
105366 within exactly one Dispatching_Domain. System_Dispatching_Domain
105367 contains the processor or processors on which the environment task
105368 executes. At program start-up all processors are contained within
105369 System_Dispatching_Domain.
105370
105371 17/3
105372 {AI05-0167-1AI05-0167-1} For a task type (including the anonymous type
105373 of a single_task_declaration), the following language-defined
105374 representation aspect may be specified:
105375
105376 18/3
105377 Dispatching_Domain
105378 The value of aspect Dispatching_Domain is an expression,
105379 which shall be of type
105380 Dispatching_Domains.Dispatching_Domain. This aspect is
105381 the domain to which the task (or all objects of the task
105382 type) are assigned.
105383
105384 18.a/3
105385 Aspect Description for Dispatching_Domain: Domain (group of
105386 processors) on which a given task should run.
105387
105388 _Legality Rules_
105389
105390 19/3
105391 {AI05-0167-1AI05-0167-1} The Dispatching_Domain aspect shall not be
105392 specified for a task interface.
105393
105394 _Dynamic Semantics_
105395
105396 20/3
105397 {AI05-0167-1AI05-0167-1} The expression specified for the
105398 Dispatching_Domain aspect of a task is evaluated for each task object
105399 (see *note 9.1::). The Dispatching_Domain value is then associated with
105400 the task object whose task declaration specifies the aspect.
105401
105402 21/3
105403 {AI05-0167-1AI05-0167-1} If a task is not explicitly assigned to any
105404 domain, it is assigned to that of the activating task. A task always
105405 executes on some CPU in its domain.
105406
105407 22/3
105408 {AI05-0167-1AI05-0167-1} If both Dispatching_Domain and CPU are
105409 specified for a task, and the CPU value is not contained within the
105410 range of processors for the domain (and is not Not_A_Specific_CPU), the
105411 activation of the task is defined to have failed, and it becomes a
105412 completed task (see *note 9.2::).
105413
105414 23/3
105415 {AI05-0167-1AI05-0167-1} The function Create creates and returns a
105416 Dispatching_Domain containing all the processors in the range First ..
105417 Last. These processors are removed from System_Dispatching_Domain. A
105418 call of Create will raise Dispatching_Domain_Error if any designated
105419 processor is not currently in System_Dispatching_Domain, or if the
105420 system cannot support a distinct domain over the processors identified,
105421 or if a processor has a task assigned to it, or if the allocation would
105422 leave System_Dispatching_Domain empty. A call of Create will raise
105423 Dispatching_Domain_Error if the calling task is not the environment
105424 task, or if Create is called after the call to the main subprogram.
105425
105426 24/3
105427 {AI05-0167-1AI05-0167-1} The function Get_First_CPU returns the first
105428 CPU in Domain; Get_Last_CPU returns the last one.
105429
105430 25/3
105431 {AI05-0167-1AI05-0167-1} The function Get_Dispatching_Domain returns the
105432 Dispatching_Domain on which the task is assigned.
105433
105434 26/3
105435 {AI05-0167-1AI05-0167-1} {AI05-0278-1AI05-0278-1} A call of the
105436 procedure Assign_Task assigns task T to the CPU within
105437 Dispatching_Domain Domain. Task T can now execute only on CPU unless
105438 CPU designates Not_A_Specific_CPU, in which case it can execute on any
105439 processor within Domain. The exception Dispatching_Domain_Error is
105440 propagated if T is already assigned to a Dispatching_Domain other than
105441 System_Dispatching_Domain, or if CPU is not one of the processors of
105442 Domain (and is not Not_A_Specific_CPU). A call of Assign_Task is a task
105443 dispatching point for task T unless T is inside of a protected action,
105444 in which case the effect on task T is delayed until its next task
105445 dispatching point. If T is the Current_Task the effect is immediate if
105446 T is not inside a protected action, otherwise the effect is as soon as
105447 practical. Assigning a task to System_Dispatching_Domain that is
105448 already assigned to that domain has no effect.
105449
105450 27/3
105451 {AI05-0167-1AI05-0167-1} {AI05-0278-1AI05-0278-1} A call of procedure
105452 Set_CPU assigns task T to the CPU. Task T can now execute only on CPU,
105453 unless CPU designates Not_A_Specific_CPU, in which case it can execute
105454 on any processor within its Dispatching_Domain. The exception
105455 Dispatching_Domain_Error is propagated if CPU is not one of the
105456 processors of the Dispatching_Domain on which T is assigned (and is not
105457 Not_A_Specific_CPU). A call of Set_CPU is a task dispatching point for
105458 task T unless T is inside of a protected action, in which case the
105459 effect on task T is delayed until its next task dispatching point. If T
105460 is the Current_Task the effect is immediate if T is not inside a
105461 protected action, otherwise the effect is as soon as practical.
105462
105463 28/3
105464 {AI05-0167-1AI05-0167-1} The function Get_CPU returns the processor
105465 assigned to task T, or Not_A_Specific_CPU if the task is not assigned to
105466 a processor.
105467
105468 29/3
105469 {AI05-0167-1AI05-0167-1} A call of Delay_Until_And_Set_CPU delays the
105470 calling task for the designated time and then assigns the task to the
105471 specified processor when the delay expires. The exception
105472 Dispatching_Domain_Error is propagated if P is not one of the processors
105473 of the calling task's Dispatching_Domain (and is not
105474 Not_A_Specific_CPU).
105475
105476 _Implementation Requirements_
105477
105478 30/3
105479 {AI05-0167-1AI05-0167-1} The implementation shall perform the operations
105480 Assign_Task, Set_CPU, Get_CPU and Delay_Until_And_Set_CPU atomically
105481 with respect to any of these operations on the same dispatching_domain,
105482 processor or task.
105483
105484 _Implementation Advice_
105485
105486 31/3
105487 {AI05-0167-1AI05-0167-1} Each dispatching domain should have separate
105488 and disjoint ready queues.
105489
105490 31.a/3
105491 Implementation Advice: Each dispatching domain should have
105492 separate and disjoint ready queues.
105493
105494 _Documentation Requirements_
105495
105496 32/3
105497 {AI05-0167-1AI05-0167-1} The implementation shall document the
105498 processor(s) on which the clock interrupt is handled and hence where
105499 delay queue and ready queue manipulations occur. For any Interrupt_Id
105500 whose handler can execute on more than one processor the implementation
105501 shall also document this set of processors.
105502
105503 32.a/3
105504 Documentation Requirement: The processor(s) on which the clock
105505 interrupt is handled; the processors on which each
105506 Interrupt_Id can be handled.
105507
105508 _Implementation Permissions_
105509
105510 33/3
105511 {AI05-0167-1AI05-0167-1} An implementation may limit the number of
105512 dispatching domains that can be created and raise
105513 Dispatching_Domain_Error if an attempt is made to exceed this number.
105514
105515 _Extensions to Ada 2005_
105516
105517 33.a/3
105518 {AI05-0167-1AI05-0167-1} {AI05-0278-1AI05-0278-1} The package
105519 System.Multiprocessors.Dispatching_Domains and the aspect
105520 Dispatching_Domains are new.
105521
105522 \1f
105523 File: aarm2012.info, Node: Annex E, Next: Annex F, Prev: Annex D, Up: Top
105524
105525 Annex E Distributed Systems
105526 ***************************
105527
105528 1
105529 [This Annex defines facilities for supporting the implementation of
105530 distributed systems using multiple partitions working cooperatively as
105531 part of a single Ada program.]
105532
105533 _Extensions to Ada 83_
105534
105535 1.a
105536 This Annex is new to Ada 95.
105537
105538 _Post-Compilation Rules_
105539
105540 2
105541 A distributed system is an interconnection of one or more processing
105542 nodes (a system resource that has both computational and storage
105543 capabilities), and zero or more storage nodes (a system resource that
105544 has only storage capabilities, with the storage addressable by one or
105545 more processing nodes).
105546
105547 3
105548 A distributed program comprises one or more partitions that execute
105549 independently (except when they communicate) in a distributed system.
105550
105551 4
105552 The process of mapping the partitions of a program to the nodes in a
105553 distributed system is called configuring the partitions of the program.
105554
105555 _Implementation Requirements_
105556
105557 5
105558 The implementation shall provide means for explicitly assigning library
105559 units to a partition and for the configuring and execution of a program
105560 consisting of multiple partitions on a distributed system; the means are
105561 implementation defined.
105562
105563 5.a
105564 Implementation defined: The means for creating and executing
105565 distributed programs.
105566
105567 _Implementation Permissions_
105568
105569 6
105570 An implementation may require that the set of processing nodes of a
105571 distributed system be homogeneous.
105572
105573 NOTES
105574
105575 7
105576 1 The partitions comprising a program may be executed on
105577 differently configured distributed systems or on a nondistributed
105578 system without requiring recompilation. A distributed program may
105579 be partitioned differently from the same set of library units
105580 without recompilation. The resulting execution is semantically
105581 equivalent.
105582
105583 8
105584 2 A distributed program retains the same type safety as the
105585 equivalent single partition program.
105586
105587 * Menu:
105588
105589 * E.1 :: Partitions
105590 * E.2 :: Categorization of Library Units
105591 * E.3 :: Consistency of a Distributed System
105592 * E.4 :: Remote Subprogram Calls
105593 * E.5 :: Partition Communication Subsystem
105594
105595 \1f
105596 File: aarm2012.info, Node: E.1, Next: E.2, Up: Annex E
105597
105598 E.1 Partitions
105599 ==============
105600
105601 1
105602 [The partitions of a distributed program are classified as either active
105603 or passive.]
105604
105605 _Post-Compilation Rules_
105606
105607 2
105608 An active partition is a partition as defined in *note 10.2::. A
105609 passive partition is a partition that has no thread of control of its
105610 own, whose library units are all preelaborated, and whose data and
105611 subprograms are accessible to one or more active partitions.
105612
105613 2.a
105614 Discussion: In most situations, a passive partition does not
105615 execute, and does not have a "real" environment task. Any
105616 execution involved in its elaboration and initialization
105617 occurs before it comes into existence in a distributed program
105618 (like most preelaborated entities). Likewise, there is no
105619 concrete meaning to passive partition termination.
105620
105621 3
105622 A passive partition shall include only library_items that either are
105623 declared pure or are shared passive (see *note 10.2.1:: and *note
105624 E.2.1::).
105625
105626 4
105627 An active partition shall be configured on a processing node. A passive
105628 partition shall be configured either on a storage node or on a
105629 processing node.
105630
105631 5
105632 The configuration of the partitions of a program onto a distributed
105633 system shall be consistent with the possibility for data references or
105634 calls between the partitions implied by their semantic dependences. Any
105635 reference to data or call of a subprogram across partitions is called a
105636 remote access.
105637
105638 5.a
105639 Discussion: For example, an active partition that includes a
105640 unit with a semantic dependence on the declaration of another
105641 RCI package of some other active partition has to be connected
105642 to that other partition by some sort of a message passing
105643 mechanism.
105644
105645 5.b
105646 A passive partition that is accessible to an active partition
105647 should have its storage addressable to the processor(s) of the
105648 active partition. The processor(s) should be able to read and
105649 write from/to that storage, as well as to perform
105650 "read-modify-write" operations (in order to support entry-less
105651 protected objects).
105652
105653 _Dynamic Semantics_
105654
105655 6
105656 A library_item is elaborated as part of the elaboration of each
105657 partition that includes it. If a normal library unit (see *note E.2::)
105658 has state, then a separate copy of the state exists in each active
105659 partition that elaborates it. [The state evolves independently in each
105660 such partition.]
105661
105662 6.a
105663 Ramification: Normal library units cannot be included in
105664 passive partitions.
105665
105666 7
105667 [An active partition terminates when its environment task terminates.]
105668 A partition becomes inaccessible if it terminates or if it is aborted.
105669 An active partition is aborted when its environment task is aborted. In
105670 addition, if a partition fails during its elaboration, it becomes
105671 inaccessible to other partitions. Other implementation-defined events
105672 can also result in a partition becoming inaccessible.
105673
105674 7.a
105675 Implementation defined: Any events that can result in a
105676 partition becoming inaccessible.
105677
105678 8/1
105679 For a prefix D that denotes a library-level declaration, excepting a
105680 declaration of or within a declared-pure library unit, the following
105681 attribute is defined:
105682
105683 9
105684 D'Partition_Id
105685 Denotes a value of the type universal_integer that
105686 identifies the partition in which D was elaborated. If D
105687 denotes the declaration of a remote call interface
105688 library unit (see *note E.2.3::) the given partition is
105689 the one where the body of D was elaborated.
105690
105691 _Bounded (Run-Time) Errors_
105692
105693 10/2
105694 {AI95-00226-01AI95-00226-01} It is a bounded error for there to be
105695 cyclic elaboration dependences between the active partitions of a single
105696 distributed program. The possible effects, in each of the partitions
105697 involved, are deadlock during elaboration, or the raising of
105698 Communication_Error or Program_Error.
105699
105700 _Implementation Permissions_
105701
105702 11
105703 An implementation may allow multiple active or passive partitions to be
105704 configured on a single processing node, and multiple passive partitions
105705 to be configured on a single storage node. In these cases, the
105706 scheduling policies, treatment of priorities, and management of shared
105707 resources between these partitions are implementation defined.
105708
105709 11.a
105710 Implementation defined: The scheduling policies, treatment of
105711 priorities, and management of shared resources between
105712 partitions in certain cases.
105713
105714 12
105715 An implementation may allow separate copies of an active partition to be
105716 configured on different processing nodes, and to provide appropriate
105717 interactions between the copies to present a consistent state of the
105718 partition to other active partitions.
105719
105720 12.a
105721 Ramification: The language does not specify the nature of
105722 these interactions, nor the actual level of consistency
105723 preserved.
105724
105725 13
105726 In an implementation, the partitions of a distributed program need not
105727 be loaded and elaborated all at the same time; they may be loaded and
105728 elaborated one at a time over an extended period of time. An
105729 implementation may provide facilities to abort and reload a partition
105730 during the execution of a distributed program.
105731
105732 14
105733 An implementation may allow the state of some of the partitions of a
105734 distributed program to persist while other partitions of the program
105735 terminate and are later reinvoked.
105736
105737 NOTES
105738
105739 15
105740 3 Library units are grouped into partitions after compile time,
105741 but before run time. At compile time, only the relevant library
105742 unit properties are identified using categorization pragmas.
105743
105744 16
105745 4 The value returned by the Partition_Id attribute can be used as
105746 a parameter to implementation-provided subprograms in order to
105747 query information about the partition.
105748
105749 _Wording Changes from Ada 95_
105750
105751 16.a/2
105752 {AI95-00226-01AI95-00226-01} Corrected wording so that a
105753 partition that has an elaboration problem will either deadlock
105754 or raise an exception. While an Ada 95 implementation could
105755 allow some partitions to continue to execute, they could be
105756 accessing unelaborated data, which is very bad (and erroneous
105757 in a practical sense). Therefore, this isn't listed as an
105758 inconsistency.
105759
105760 \1f
105761 File: aarm2012.info, Node: E.2, Next: E.3, Prev: E.1, Up: Annex E
105762
105763 E.2 Categorization of Library Units
105764 ===================================
105765
105766 1
105767 [Library units can be categorized according to the role they play in a
105768 distributed program. Certain restrictions are associated with each
105769 category to ensure that the semantics of a distributed program remain
105770 close to the semantics for a nondistributed program.]
105771
105772 2/3
105773 {AI05-0243-1AI05-0243-1} A categorization pragma is a library unit
105774 pragma (see *note 10.1.5::) that specifies a corresponding
105775 categorization aspect. A categorization aspect restricts the
105776 declarations, child units, or semantic dependences of the library unit
105777 to which it applies. A categorized library unit is a library unit that
105778 has a categorization aspect that is True.
105779
105780 3/3
105781 {AI05-0243-1AI05-0243-1} The pragmas Shared_Passive, Remote_Types, and
105782 Remote_Call_Interface are categorization pragmas, and the associated
105783 aspects are categorization aspects. In addition, for the purposes of
105784 this Annex, the aspect Pure (see *note 10.2.1::) is considered a
105785 categorization aspect and the pragma Pure is considered a categorization
105786 pragma.
105787
105788 4/3
105789 {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
105790 {AI05-0243-1AI05-0243-1} [ A library package or generic library package
105791 is called a shared passive library unit if the Shared_Passive aspect of
105792 the unit is True. A library package or generic library package is
105793 called a remote types library unit if the Remote_Types aspect of the
105794 unit is True. A library unit is called a remote call interface if the
105795 Remote_Call_Interface aspect of the unit is True.] A normal library
105796 unit is one for which no categorization aspect is True.
105797
105798 4.a/3
105799 Proof: {AI05-0243-1AI05-0243-1} {AI05-0299-1AI05-0299-1} These
105800 terms (other than "normal library unit") are really defined in
105801 the following subclauses.
105802
105803 4.a.1/1
105804 Ramification: {8652/00788652/0078}
105805 {AI95-00048-01AI95-00048-01} A library subprogram can be a
105806 remote call interface, but it cannot be a remote types or
105807 shared passive library unit.
105808
105809 5/3
105810 {AI05-0206-1AI05-0206-1} {AI05-0243-1AI05-0243-1}
105811 {AI05-0269-1AI05-0269-1} {AI05-0299-1AI05-0299-1} [The various
105812 categories of library units and the associated restrictions are
105813 described in this and the following subclauses. The categories are
105814 related hierarchically in that the library units of one category can
105815 depend semantically only on library units of that category or an earlier
105816 one in the hierarchy, except that the body of a remote types or remote
105817 call interface library unit is unrestricted, the declaration of a remote
105818 types or remote call interface library unit may depend on preelaborated
105819 normal library units that are mentioned only in private with clauses,
105820 and all categories can depend on limited views.
105821
105822 6/3
105823 {AI05-0243-1AI05-0243-1} {AI05-0269-1AI05-0269-1} The overall hierarchy
105824 (including declared pure) is as follows, with a lower-numbered category
105825 being "earlier in the hierarchy" in the sense of the previous paragraph:
105826
105827 6.1/3
105828 1. Declared Pure
105829
105830 6.2/3
105831 2. Shared Passive
105832
105833 6.3/3
105834 3. Remote Types
105835
105836 6.4/3
105837 4. Remote Call Interface
105838
105839 6.5/3
105840 5. Normal (no restrictions)
105841
105842 Paragraphs 7 through 11 were deleted.
105843
105844 12
105845 Declared pure and shared passive library units are preelaborated. The
105846 declaration of a remote types or remote call interface library unit is
105847 required to be preelaborable. ]
105848
105849 Paragraph 13 was deleted.
105850
105851 _Implementation Permissions_
105852
105853 14
105854 Implementations are allowed to define other categorization pragmas.
105855
105856 _Wording Changes from Ada 95_
105857
105858 14.a/2
105859 {8652/00788652/0078} {AI95-00048-01AI95-00048-01} Corrigendum:
105860 Clarified that a library subprogram can be a remote call
105861 interface unit.
105862
105863 14.b/2
105864 {8652/00798652/0079} {AI95-00208-01AI95-00208-01} Corrigendum:
105865 Removed the requirement that types be represented the same in
105866 all partitions, because it prevents the definition of
105867 heterogeneous distributed systems and goes much further than
105868 required.
105869
105870 _Wording Changes from Ada 2005_
105871
105872 14.c/3
105873 {AI05-0206-1AI05-0206-1} {AI05-0299-1AI05-0299-1} We now allow
105874 private withs of preelaborated units in Remote Types and
105875 Remote Call Interface units; this is documented as an
105876 extension in the subclauses where this is defined normatively.
105877
105878 14.d/3
105879 {AI05-0243-1AI05-0243-1} {AI05-0299-1AI05-0299-1} We have
105880 introduced categorization aspects; these are documented as
105881 extensions in the subclauses where they actually are defined.
105882
105883 * Menu:
105884
105885 * E.2.1 :: Shared Passive Library Units
105886 * E.2.2 :: Remote Types Library Units
105887 * E.2.3 :: Remote Call Interface Library Units
105888
105889 \1f
105890 File: aarm2012.info, Node: E.2.1, Next: E.2.2, Up: E.2
105891
105892 E.2.1 Shared Passive Library Units
105893 ----------------------------------
105894
105895 1
105896 [A shared passive library unit is used for managing global data shared
105897 between active partitions. The restrictions on shared passive library
105898 units prevent the data or tasks of one active partition from being
105899 accessible to another active partition through references implicit in
105900 objects declared in the shared passive library unit.]
105901
105902 _Language Design Principles_
105903
105904 1.a
105905 The restrictions governing a shared passive library unit are
105906 designed to ensure that objects and subprograms declared in
105907 the package can be used safely from multiple active
105908 partitions, even though the active partitions live in
105909 different address spaces, and have separate run-time systems.
105910
105911 _Syntax_
105912
105913 2
105914 The form of a pragma Shared_Passive is as follows:
105915
105916 3
105917 pragma Shared_Passive[(library_unit_name)];
105918
105919 _Legality Rules_
105920
105921 4/3
105922 {AI05-0243-1AI05-0243-1} A pragma Shared_Passive is used to specify that
105923 a library unit is a shared passive library unit, namely that the
105924 Shared_Passive aspect of the library unit is True. The following
105925 restrictions apply to such a library unit:
105926
105927 4.a/3
105928 Aspect Description for Shared_Passive: A given package is used
105929 to represent shared memory in a distributed system.
105930
105931 5
105932 * [it shall be preelaborable (see *note 10.2.1::);]
105933
105934 5.a
105935 Ramification: It cannot contain library-level declarations of
105936 protected objects with entries, nor of task objects. Task
105937 objects are disallowed because passive partitions don't have
105938 any threads of control of their own, nor any run-time system
105939 of their own. Protected objects with entries are disallowed
105940 because an entry queue contains references to calling tasks,
105941 and that would require in effect a pointer from a passive
105942 partition back to a task in some active partition.
105943
105944 6/3
105945 * {AI05-0243-1AI05-0243-1} it shall depend semantically only upon
105946 declared pure or shared passive library_items;
105947
105948 6.a
105949 Reason: Shared passive packages cannot depend semantically
105950 upon remote types packages because the values of an access
105951 type declared in a remote types package refer to the local
105952 heap of the active partition including the remote types
105953 package.
105954
105955 6.b/3
105956 Ramification: {AI05-0243-1AI05-0243-1} We say library_item
105957 here, so that limited views are allowed; those are not library
105958 units, but they are library_item.
105959
105960 7/1
105961 * {8652/00808652/0080} {AI95-00003-01AI95-00003-01} it shall not
105962 contain a library-level declaration of an access type that
105963 designates a class-wide type, task type, or protected type with
105964 entry_declarations.
105965
105966 7.a
105967 Reason: These kinds of access types are disallowed because the
105968 object designated by an access value of such a type could
105969 contain an implicit reference back to the active partition on
105970 whose behalf the designated object was created.
105971
105972 8
105973 Notwithstanding the definition of accessibility given in *note 3.10.2::,
105974 the declaration of a library unit P1 is not accessible from within the
105975 declarative region of a shared passive library unit P2, unless the
105976 shared passive library unit P2 depends semantically on P1.
105977
105978 8.a
105979 Discussion: We considered a more complex rule, but dropped it.
105980 This is the simplest rule that recognizes that a shared
105981 passive package may outlive some other library package, unless
105982 it depends semantically on that package. In a nondistributed
105983 program, all library packages are presumed to have the same
105984 lifetime.
105985
105986 8.b
105987 Implementations may define additional pragmas that force two
105988 library packages to be in the same partition, or to have the
105989 same lifetime, which would allow this rule to be relaxed in
105990 the presence of such pragmas.
105991
105992 _Static Semantics_
105993
105994 9
105995 A shared passive library unit is preelaborated.
105996
105997 _Post-Compilation Rules_
105998
105999 10
106000 A shared passive library unit shall be assigned to at most one partition
106001 within a given program.
106002
106003 11
106004 Notwithstanding the rule given in *note 10.2::, a compilation unit in a
106005 given partition does not need (in the sense of *note 10.2::) the shared
106006 passive library units on which it depends semantically to be included in
106007 that same partition; they will typically reside in separate passive
106008 partitions.
106009
106010 _Wording Changes from Ada 95_
106011
106012 11.a/2
106013 {8652/00808652/0080} {AI95-00003-01AI95-00003-01} Corrigendum:
106014 Corrected the wording to allow access types in blocks in
106015 shared passive generic packages.
106016
106017 _Extensions to Ada 2005_
106018
106019 11.b/3
106020 {AI05-0243-1AI05-0243-1} Shared_Passive is now a
106021 categorization aspect, so it can be specified by an
106022 aspect_specification -- although the pragma is still preferred
106023 by the Standard.
106024
106025 \1f
106026 File: aarm2012.info, Node: E.2.2, Next: E.2.3, Prev: E.2.1, Up: E.2
106027
106028 E.2.2 Remote Types Library Units
106029 --------------------------------
106030
106031 1
106032 [A remote types library unit supports the definition of types intended
106033 for use in communication between active partitions.]
106034
106035 _Language Design Principles_
106036
106037 1.a
106038 The restrictions governing a remote types package are similar
106039 to those for a declared pure package. However, the
106040 restrictions are relaxed deliberately to allow such a package
106041 to contain declarations that violate the stateless property of
106042 pure packages, though it is presumed that any state-dependent
106043 properties are essentially invisible outside the package.
106044
106045 _Syntax_
106046
106047 2
106048 The form of a pragma Remote_Types is as follows:
106049
106050 3
106051 pragma Remote_Types[(library_unit_name)];
106052
106053 _Legality Rules_
106054
106055 4/3
106056 {AI05-0243-1AI05-0243-1} A pragma Remote_Types is used to specify that a
106057 library unit is a remote types library unit, namely that the
106058 Remote_Types aspect of the library unit is True. The following
106059 restrictions apply to the declaration of such a library unit:
106060
106061 4.a/3
106062 Aspect Description for Remote_Types: Types in a given package
106063 may be used in remote procedure calls.
106064
106065 5
106066 * [it shall be preelaborable;]
106067
106068 6/3
106069 * {AI05-0206-1AI05-0206-1} {AI05-0243-1AI05-0243-1} it shall depend
106070 semantically only on declared pure library_items, shared passive
106071 library units, other remote types library units, or preelaborated
106072 normal library units that are mentioned only in private with
106073 clauses;
106074
106075 6.a/3
106076 Ramification: {AI05-0243-1AI05-0243-1} We say declared pure
106077 library_item here, so that (all) limited views are allowed;
106078 those are not library units, but they are declared pure
106079 library_items.
106080
106081 7
106082 * it shall not contain the declaration of any variable within the
106083 visible part of the library unit;
106084
106085 7.a
106086 Reason: This is essentially a "methodological" restriction. A
106087 separate copy of a remote types package is included in each
106088 partition that references it, just like a normal package.
106089 Nevertheless, a remote types package is thought of as an
106090 "essentially pure" package for defining types to be used for
106091 interpartition communication, and it could be misleading to
106092 declare visible objects when no remote data access is actually
106093 being provided.
106094
106095 8/2
106096 * {AI95-00240-01AI95-00240-01} {AI95-00366-01AI95-00366-01} the full
106097 view of each type declared in the visible part of the library unit
106098 that has any available stream attributes shall support external
106099 streaming (see *note 13.13.2::).
106100
106101 8.a
106102 Reason: This is to prevent the use of the predefined Read and
106103 Write attributes of an access type as part of the Read and
106104 Write attributes of a visible type.
106105
106106 8.b/2
106107 Ramification: {AI95-00366-01AI95-00366-01} Types that do not
106108 have available stream attributes are excluded from this rule;
106109 that means that attributes do not need to be specified for
106110 most limited types. It is only necessary to specify
106111 attributes for nonlimited types that have a part that is of
106112 any access type, and for extensions of limited types with
106113 available stream attributes where the record_extension_part
106114 includes a subcomponent of an access type, where the access
106115 type does not have specified attributes.
106116
106117 9/3
106118 {8652/00828652/0082} {AI95-00164-01AI95-00164-01}
106119 {AI05-0060-1AI05-0060-1} A named access type declared in the visible
106120 part of a remote types or remote call interface library unit is called a
106121 remote access type. Such a type shall be:
106122
106123 9.1/1
106124 * {8652/00828652/0082} {AI95-00164-01AI95-00164-01} an
106125 access-to-subprogram type, or
106126
106127 9.2/3
106128 * {8652/00828652/0082} {AI95-00164-01AI95-00164-01}
106129 {AI05-0060-1AI05-0060-1} a general access type that designates a
106130 class-wide limited private type, a class-wide limited interface
106131 type, or a class-wide private extension all of whose ancestors are
106132 either private extensions, limited interface types, or limited
106133 private types.
106134
106135 9.3/1
106136 {8652/00818652/0081} {AI95-00004-01AI95-00004-01} A type that is derived
106137 from a remote access type is also a remote access type.
106138
106139 10
106140 The following restrictions apply to the use of a remote
106141 access-to-subprogram type:
106142
106143 11/2
106144 * {AI95-00431-01AI95-00431-01} A value of a remote
106145 access-to-subprogram type shall be converted only to or from
106146 another (subtype-conformant) remote access-to-subprogram type;
106147
106148 12
106149 * The prefix of an Access attribute_reference that yields a value of
106150 a remote access-to-subprogram type shall statically denote a
106151 (subtype-conformant) remote subprogram.
106152
106153 13
106154 The following restrictions apply to the use of a remote
106155 access-to-class-wide type:
106156
106157 14/3
106158 * {8652/00838652/0083} {AI95-00047-01AI95-00047-01}
106159 {AI95-00240-01AI95-00240-01} {AI95-00366-01AI95-00366-01}
106160 {AI05-0060-1AI05-0060-1} {AI05-0101-1AI05-0101-1} The primitive
106161 subprograms of the corresponding specific type shall only have
106162 access parameters if they are controlling formal parameters. The
106163 primitive functions of the corresponding specific type shall only
106164 have an access result if it is a controlling access result. Each
106165 noncontrolling formal parameter and noncontrolling result type
106166 shall support external streaming (see *note 13.13.2::);
106167
106168 14.1/3
106169 * {AI05-0060-1AI05-0060-1} {AI05-0215-1AI05-0215-1}
106170 {AI05-0269-1AI05-0269-1} The corresponding specific type shall not
106171 have a primitive procedure with the Synchronization aspect
106172 specified unless the synchronization_kind is Optional (see *note
106173 9.5::);
106174
106175 15
106176 * A value of a remote access-to-class-wide type shall be explicitly
106177 converted only to another remote access-to-class-wide type;
106178
106179 16
106180 * A value of a remote access-to-class-wide type shall be dereferenced
106181 (or implicitly converted to an anonymous access type) only as part
106182 of a dispatching call where the value designates a controlling
106183 operand of the call (see *note E.4::, "*note E.4:: Remote
106184 Subprogram Calls");
106185
106186 16.1/3
106187 * {AI05-0101-1AI05-0101-1} A controlling access result value for a
106188 primitive function with any controlling operands of the
106189 corresponding specific type shall either be explicitly converted to
106190 a remote access-to-class-wide type or be part of a dispatching call
106191 where the value designates a controlling operand of the call;
106192
106193 17/2
106194 * {AI95-00366-01AI95-00366-01} The Storage_Pool attribute is not
106195 defined for a remote access-to-class-wide type; the expected type
106196 for an allocator shall not be a remote access-to-class-wide type.
106197 A remote access-to-class-wide type shall not be an actual parameter
106198 for a generic formal access type. The Storage_Size attribute of a
106199 remote access-to-class-wide type yields 0; it is not allowed in an
106200 attribute_definition_clause.
106201
106202 17.a/3
106203 Reason: {AI05-0005-1AI05-0005-1} All three of these
106204 restrictions are because there is no storage pool associated
106205 with a remote access-to-class-wide type. The Storage_Size is
106206 defined to be 0 so that there is no conflict with the rules
106207 for pure units.
106208
106209 NOTES
106210
106211 18
106212 5 A remote types library unit need not be pure, and the types it
106213 defines may include levels of indirection implemented by using
106214 access types. User-specified Read and Write attributes (see *note
106215 13.13.2::) provide for sending values of such a type between active
106216 partitions, with Write marshalling the representation, and Read
106217 unmarshalling any levels of indirection.
106218
106219 19/3
106220 6 {AI05-0060-1AI05-0060-1} The value of a remote
106221 access-to-class-wide limited interface can designate an object of a
106222 nonlimited type derived from the interface.
106223
106224 20/3
106225 7 {AI05-0060-1AI05-0060-1} A remote access type may designate a
106226 class-wide synchronized, protected, or task interface type.
106227
106228 20.a/3
106229 Proof: Synchronized, protected, and task interfaces are all
106230 considered limited interfaces, see *note 3.9.4::.
106231
106232 _Incompatibilities With Ada 95_
106233
106234 20.b/3
106235 {AI95-00240-01AI95-00240-01} {AI05-0248-1AI05-0248-1}
106236 Amendment Correction: The wording was changed from
106237 "user-specified" to "available" read and write attributes.
106238 (This was then further changed, see below.) This means that
106239 an access type with the attributes specified in the private
106240 part would originally have been sufficient to allow the access
106241 type to be used in a remote type, but that is no longer
106242 allowed. Similarly, the attributes of a remote type that has
106243 access components have to be specified in the visible part.
106244 These changes were made so that the rules were consistent with
106245 the rules introduced for the Corrigendum for stream
106246 attributes; moreover, legality should not depend on the
106247 contents of the private part.
106248
106249 _Extensions to Ada 95_
106250
106251 20.c/3
106252 {AI95-00366-01AI95-00366-01} {AI05-0005-1AI05-0005-1} Remote
106253 types that cannot be streamed (that is, have no available
106254 stream attributes) do not require the specification of stream
106255 attributes. This is necessary so that most extensions of
106256 Limited_Controlled do not need stream attributes defined
106257 (otherwise there would be a significant incompatibility, as
106258 Limited_Controlled would need stream attributes, and then all
106259 extensions of it also would need stream attributes).
106260
106261 _Wording Changes from Ada 95_
106262
106263 20.d/2
106264 {8652/00818652/0081} {AI95-00004-01AI95-00004-01} Corrigendum:
106265 Added missing wording so that a type derived from a remote
106266 access type is also a remote access type.
106267
106268 20.e/2
106269 {8652/00838652/0083} {AI95-00047-01AI95-00047-01} Corrigendum:
106270 Clarified that user-defined Read and Write attributes are
106271 required for the primitive subprograms corresponding to a
106272 remote access-to-class-wide type.
106273
106274 20.f/2
106275 {8652/00828652/0082} {AI95-00164-01AI95-00164-01} Corrigendum:
106276 Added missing wording so that a remote access type can
106277 designate an appropriate private extension.
106278
106279 20.g/2
106280 {AI95-00366-01AI95-00366-01} Changed the wording to use the
106281 newly defined term type that supports external streaming, so
106282 that various issues with access types in pure units and
106283 implicitly declared attributes for type extensions are
106284 properly handled.
106285
106286 20.h/2
106287 {AI95-00366-01AI95-00366-01} Defined Storage_Size to be 0 for
106288 remote access-to-class-wide types, rather than having it
106289 undefined. This eliminates issues with pure units requiring a
106290 defined storage size.
106291
106292 20.i/2
106293 {AI95-00431-01AI95-00431-01} Corrected the wording so that a
106294 value of a local access-to-subprogram type cannot be converted
106295 to a remote access-to-subprogram type, as intended (and
106296 required by the ACATS).
106297
106298 _Incompatibilities With Ada 2005_
106299
106300 20.j/3
106301 {AI05-0101-1AI05-0101-1} Correction: Added rules for returning
106302 of remote access-to-classwide types; this had been missed in
106303 the past. While programs that returned unstreamable types
106304 from RCI functions were legal, it is not clear what they could
106305 have done (as the results could not be marshalled).
106306 Similarly, RCI functions that return remote controlling access
106307 types could try to save those values, but it is unlikely that
106308 a compiler would know how to do that usefully. Thus, it seems
106309 unlikely that any real programs will be impacted by these
106310 changes.
106311
106312 _Extensions to Ada 2005_
106313
106314 20.k/3
106315 {AI05-0060-1AI05-0060-1} Correction: Clarified that anonymous
106316 access types are never remote access types (and can be used in
106317 remote types units subject to the normal restrictions). Added
106318 wording to allow limited class-wide interfaces to be
106319 designated by remote access types.
106320
106321 20.l/3
106322 {AI05-0206-1AI05-0206-1} Added wording to allow private withs
106323 of preelaborated normal units in the specification of a remote
106324 types unit.
106325
106326 20.m/3
106327 {AI05-0243-1AI05-0243-1} Remote_Types is now a categorization
106328 aspect, so it can be specified by an aspect_specification --
106329 although the pragma is still preferred by the Standard.
106330
106331 \1f
106332 File: aarm2012.info, Node: E.2.3, Prev: E.2.2, Up: E.2
106333
106334 E.2.3 Remote Call Interface Library Units
106335 -----------------------------------------
106336
106337 1
106338 [A remote call interface library unit can be used as an interface for
106339 remote procedure calls (RPCs) (or remote function calls) between active
106340 partitions.]
106341
106342 _Language Design Principles_
106343
106344 1.a
106345 The restrictions governing a remote call interface library
106346 unit are intended to ensure that the values of the actual
106347 parameters in a remote call can be meaningfully sent between
106348 two active partitions.
106349
106350 _Syntax_
106351
106352 2
106353 The form of a pragma Remote_Call_Interface is as follows:
106354
106355 3
106356 pragma Remote_Call_Interface[(library_unit_name)];
106357
106358 4
106359 The form of a pragma All_Calls_Remote is as follows:
106360
106361 5
106362 pragma All_Calls_Remote[(library_unit_name)];
106363
106364 6
106365 A pragma All_Calls_Remote is a library unit pragma.
106366
106367 _Legality Rules_
106368
106369 7/3
106370 {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106371 {AI05-0243-1AI05-0243-1} A pragma Remote_Call_Interface is used to
106372 specify that a library unit is a remote call interface (RCI), namely
106373 that the Remote_Call_Interface aspect of the library unit is True. A
106374 subprogram declared in the visible part of such a library unit, or
106375 declared by such a library unit, is called a remote subprogram.
106376
106377 7.a/3
106378 Aspect Description for Remote_Call_Interface: Subprograms in a
106379 given package may be used in remote procedure calls.
106380
106381 8/3
106382 {AI05-0206-1AI05-0206-1} {AI05-0243-1AI05-0243-1} The declaration of an
106383 RCI library unit shall be preelaborable (see *note 10.2.1::), and shall
106384 depend semantically only upon declared pure library_items, shared
106385 passive library units, remote types library units, other remote call
106386 interface library units, or preelaborated normal library units that are
106387 mentioned only in private with clauses.
106388
106389 8.a/3
106390 Ramification: {AI05-0243-1AI05-0243-1} We say declared pure
106391 library_item here, so that (all) limited views are allowed;
106392 those are not library units, but they are declared pure
106393 library_items.
106394
106395 9/1
106396 {8652/00788652/0078} {AI95-00048-01AI95-00048-01} In addition, the
106397 following restrictions apply to an RCI library unit:
106398
106399 10/1
106400 * {8652/00788652/0078} {AI95-00048-01AI95-00048-01} its visible part
106401 shall not contain the declaration of a variable;
106402
106403 10.a/1
106404 Reason: {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106405 Remote call interface units do not provide remote data access.
106406 A shared passive package has to be used for that.
106407
106408 11/1
106409 * {8652/00788652/0078} {AI95-00048-01AI95-00048-01} its visible part
106410 shall not contain the declaration of a limited type;
106411
106412 11.a/2
106413 Reason: {AI95-00240-01AI95-00240-01}
106414 {AI95-00366-01AI95-00366-01} We disallow the declaration of
106415 task and protected types, since calling an entry or a
106416 protected subprogram implicitly passes an object of a limited
106417 type (the target task or protected object). We disallow other
106418 limited types since we require that such types have available
106419 Read and Write attributes, but we certainly don't want the
106420 Read and Write attributes themselves to involve remote calls
106421 (thereby defeating their purpose of marshalling the value for
106422 remote calls).
106423
106424 12/1
106425 * {8652/00788652/0078} {AI95-00048-01AI95-00048-01} its visible part
106426 shall not contain a nested generic_declaration;
106427
106428 12.a
106429 Reason: This is disallowed because the body of the nested
106430 generic would presumably have access to data inside the body
106431 of the RCI package, and if instantiated in a different
106432 partition, remote data access might result, which is not
106433 supported.
106434
106435 13/3
106436 * {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106437 {AI05-0229-1AI05-0229-1} it shall not be, nor shall its visible
106438 part contain, the declaration of a subprogram for which aspect
106439 Inline is True;
106440
106441 14/3
106442 * {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106443 {AI95-00240-01AI95-00240-01} {AI95-00366-01AI95-00366-01}
106444 {AI05-0101-1AI05-0101-1} it shall not be, nor shall its visible
106445 part contain, a subprogram (or access-to-subprogram) declaration
106446 whose profile has a parameter or result of a type that does not
106447 support external streaming (see *note 13.13.2::);
106448
106449 14.a/3
106450 Ramification: {AI05-0101-1AI05-0101-1} No anonymous access
106451 types support external streaming, so they are never allowed as
106452 parameters or results of RCI subprograms.
106453
106454 15
106455 * any public child of the library unit shall be a remote call
106456 interface library unit.
106457
106458 15.a
106459 Reason: No restrictions apply to the private part of an RCI
106460 package, and since a public child can "see" the private part
106461 of its parent, such a child must itself have a
106462 Remote_Call_Interface pragma, and be assigned to the same
106463 partition (see below).
106464
106465 15.b
106466 Discussion: We considered making the public child of an RCI
106467 package implicitly RCI, but it seemed better to require an
106468 explicit pragma to avoid any confusion.
106469
106470 15.c
106471 Note that there is no need for a private child to be an RCI
106472 package, since it can only be seen from the body of its parent
106473 or its siblings, all of which are required to be in the same
106474 active partition.
106475
106476 16/3
106477 {AI05-0229-1AI05-0229-1} A pragma All_Calls_Remote sets the
106478 All_Calls_Remote representation aspect of the library unit to which the
106479 pragma applies to the value True. If the All_Calls_Remote aspect of a
106480 library unit is True, the library unit shall be a remote call interface.
106481
106482 16.a/3
106483 Aspect Description for All_Calls_Remote: All remote procedure
106484 calls should use the Partition Communication Subsystem, even
106485 if they are local.
106486
106487 _Post-Compilation Rules_
106488
106489 17
106490 A remote call interface library unit shall be assigned to at most one
106491 partition of a given program. A remote call interface library unit
106492 whose parent is also an RCI library unit shall be assigned only to the
106493 same partition as its parent.
106494
106495 17.a/1
106496 Implementation Note: {8652/00788652/0078}
106497 {AI95-00048-01AI95-00048-01} The declaration of an RCI unit,
106498 with a calling-stub body, is automatically included in all
106499 active partitions with compilation units that depend on it.
106500 However the whole RCI library unit, including its (non-stub)
106501 body, will only be in one of the active partitions.
106502
106503 18
106504 Notwithstanding the rule given in *note 10.2::, a compilation unit in a
106505 given partition that semantically depends on the declaration of an RCI
106506 library unit, needs (in the sense of *note 10.2::) only the declaration
106507 of the RCI library unit, not the body, to be included in that same
106508 partition. [Therefore, the body of an RCI library unit is included only
106509 in the partition to which the RCI library unit is explicitly assigned.]
106510
106511 _Implementation Requirements_
106512
106513 19/3
106514 {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106515 {AI05-0229-1AI05-0229-1} If aspect All_Calls_Remote is True for a given
106516 RCI library unit, then the implementation shall route any call to a
106517 subprogram of the RCI unit from outside the declarative region of the
106518 unit through the Partition Communication Subsystem (PCS); see *note
106519 E.5::. Calls to such subprograms from within the declarative region of
106520 the unit are defined to be local and shall not go through the PCS.
106521
106522 19.a/3
106523 Discussion: {8652/00788652/0078} {AI95-00048-01AI95-00048-01}
106524 {AI05-0229-1AI05-0229-1} When this aspect is False (or not
106525 used), it is presumed that most implementations will make
106526 direct calls if the call originates in the same partition as
106527 that of the RCI unit. When this aspect is True, all calls
106528 from outside the subsystem rooted at the RCI unit are treated
106529 like calls from outside the partition, ensuring that the PCS
106530 is involved in all such calls (for debugging, redundancy,
106531 etc.).
106532
106533 19.b
106534 Reason: There is no point to force local calls (or calls from
106535 children) to go through the PCS, since on the target system,
106536 these calls are always local, and all the units are in the
106537 same active partition.
106538
106539 _Implementation Permissions_
106540
106541 20/3
106542 {AI05-0243-1AI05-0243-1} An implementation need not support the
106543 Remote_Call_Interface pragma or aspect nor the All_Calls_Remote pragma.
106544 [Explicit message-based communication between active partitions can be
106545 supported as an alternative to RPC.]
106546
106547 20.a
106548 Ramification: Of course, it is pointless to support the
106549 All_Calls_Remote pragma if the Remote_Call_Interface pragma
106550 (or some approximate equivalent) is not supported.
106551
106552 _Incompatibilities With Ada 95_
106553
106554 20.b/3
106555 {AI95-00240-01AI95-00240-01} {AI05-0248-1AI05-0248-1}
106556 Amendment Correction: The wording was changed from
106557 "user-specified" to "available" read and write attributes.
106558 (This was then further changed, see below.) This means that a
106559 type with the attributes specified in the private part would
106560 originally have been allowed as a formal parameter of an RCI
106561 subprogram, but that is no longer allowed. This change was
106562 made so that the rules were consistent with the rules
106563 introduced for the Corrigendum for stream attributes;
106564 moreover, legality should not depend on the contents of the
106565 private part.
106566
106567 _Wording Changes from Ada 95_
106568
106569 20.c/2
106570 {8652/00788652/0078} {AI95-00048-01AI95-00048-01} Corrigendum:
106571 Changed the wording to allow a library subprogram to be a
106572 remote call interface unit.
106573
106574 20.d/2
106575 {AI95-00366-01AI95-00366-01} Changed the wording to use the
106576 newly defined term type that supports external streaming, so
106577 that various issues with access types in pure units and
106578 implicitly declared attributes for type extensions are
106579 properly handled.
106580
106581 _Incompatibilities With Ada 2005_
106582
106583 20.e/3
106584 {AI05-0101-1AI05-0101-1} Correction: Added a rule to ensure
106585 that function results are streamable; this was missing in
106586 previous versions of Ada. While programs that returned
106587 unstreamable types from RCI functions were legal, it is not
106588 clear what they could have done (as the results could not be
106589 marshalled). Thus, it seems unlikely that any real programs
106590 will be impacted by this change.
106591
106592 _Extensions to Ada 2005_
106593
106594 20.f/3
106595 {AI05-0206-1AI05-0206-1} Added wording to allow private withs
106596 of preelaborated normal units in the specification of a remote
106597 call interface unit.
106598
106599 20.g/3
106600 {AI05-0229-1AI05-0229-1} All_Calls_Remote is now a
106601 representation aspect, so it can be specified by an
106602 aspect_specification -- although the pragma is still preferred
106603 by the Standard.
106604
106605 20.h/3
106606 {AI05-0243-1AI05-0243-1} Remote_Call_Interface is now a
106607 categorization aspect, so it can be specified by an
106608 aspect_specification -- although the pragma is still preferred
106609 by the Standard.
106610
106611 \1f
106612 File: aarm2012.info, Node: E.3, Next: E.4, Prev: E.2, Up: Annex E
106613
106614 E.3 Consistency of a Distributed System
106615 =======================================
106616
106617 1/3
106618 {AI05-0299-1AI05-0299-1} [This subclause defines attributes and rules
106619 associated with verifying the consistency of a distributed program.]
106620
106621 _Language Design Principles_
106622
106623 1.a/3
106624 {AI05-0248-1AI05-0248-1} The rules guarantee that remote call
106625 interface and shared passive library units are consistent
106626 among all partitions prior to the execution of a distributed
106627 program, so that the semantics of the distributed program are
106628 well defined.
106629
106630 _Static Semantics_
106631
106632 2/1
106633 For a prefix P that statically denotes a program unit, the following
106634 attributes are defined:
106635
106636 3
106637 P'Version
106638 Yields a value of the predefined type String that
106639 identifies the version of the compilation unit that
106640 contains the declaration of the program unit.
106641
106642 4
106643 P'Body_Version
106644 Yields a value of the predefined type String that
106645 identifies the version of the compilation unit that
106646 contains the body (but not any subunits) of the program
106647 unit.
106648
106649 5/1
106650 {8652/00848652/0084} {AI95-00104-01AI95-00104-01} The version of a
106651 compilation unit changes whenever the compilation unit changes in a
106652 semantically significant way. This International Standard does not
106653 define the exact meaning of "semantically significant". It is
106654 unspecified whether there are other events (such as recompilation) that
106655 result in the version of a compilation unit changing.
106656
106657 5.a/1
106658 This paragraph was deleted.
106659
106660 5.1/1
106661 {8652/00848652/0084} {AI95-00104-01AI95-00104-01} If P is not a library
106662 unit, and P has no completion, then P'Body_Version returns the
106663 Body_Version of the innermost program unit enclosing the declaration of
106664 P. If P is a library unit, and P has no completion, then P'Body_Version
106665 returns a value that is different from Body_Version of any version of P
106666 that has a completion.
106667
106668 _Bounded (Run-Time) Errors_
106669
106670 6
106671 In a distributed program, a library unit is consistent if the same
106672 version of its declaration is used throughout. It is a bounded error to
106673 elaborate a partition of a distributed program that contains a
106674 compilation unit that depends on a different version of the declaration
106675 of a shared passive or RCI library unit than that included in the
106676 partition to which the shared passive or RCI library unit was assigned.
106677 As a result of this error, Program_Error can be raised in one or both
106678 partitions during elaboration; in any case, the partitions become
106679 inaccessible to one another.
106680
106681 6.a
106682 Ramification: Because a version changes if anything on which
106683 it depends undergoes a version change, requiring consistency
106684 for shared passive and remote call interface library units is
106685 sufficient to ensure consistency for the declared pure and
106686 remote types library units that define the types used for the
106687 objects and parameters through which interpartition
106688 communication takes place.
106689
106690 6.b
106691 Note that we do not require matching Body_Versions; it is
106692 irrelevant for shared passive and remote call interface
106693 packages, since only one copy of their body exists in a
106694 distributed program (in the absence of implicit replication),
106695 and we allow the bodies to differ for declared pure and remote
106696 types packages from partition to partition, presuming that the
106697 differences are due to required error corrections that took
106698 place during the execution of a long-running distributed
106699 program. The Body_Version attribute provides a means for
106700 performing stricter consistency checks.
106701
106702 _Wording Changes from Ada 95_
106703
106704 6.c/2
106705 {8652/00848652/0084} {AI95-00104-01AI95-00104-01} Corrigendum:
106706 Clarified the meaning of 'Version and 'Body_Version.
106707
106708 \1f
106709 File: aarm2012.info, Node: E.4, Next: E.5, Prev: E.3, Up: Annex E
106710
106711 E.4 Remote Subprogram Calls
106712 ===========================
106713
106714 1
106715 A remote subprogram call is a subprogram call that invokes the execution
106716 of a subprogram in another partition. The partition that originates the
106717 remote subprogram call is the calling partition, and the partition that
106718 executes the corresponding subprogram body is the called partition.
106719 Some remote procedure calls are allowed to return prior to the
106720 completion of subprogram execution. These are called asynchronous
106721 remote procedure calls.
106722
106723 2
106724 There are three different ways of performing a remote subprogram call:
106725
106726 3
106727 * As a direct call on a (remote) subprogram explicitly declared in a
106728 remote call interface;
106729
106730 4
106731 * As an indirect call through a value of a remote
106732 access-to-subprogram type;
106733
106734 5
106735 * As a dispatching call with a controlling operand designated by a
106736 value of a remote access-to-class-wide type.
106737
106738 6
106739 The first way of calling corresponds to a static binding between the
106740 calling and the called partition. The latter two ways correspond to a
106741 dynamic binding between the calling and the called partition.
106742
106743 7/3
106744 {AI05-0101-1AI05-0101-1} Remote types library units (see *note E.2.2::)
106745 and remote call interface library units (see *note E.2.3::) define the
106746 remote subprograms or remote access types used for remote subprogram
106747 calls.
106748
106749 _Language Design Principles_
106750
106751 7.a
106752 Remote subprogram calls are standardized since the RPC
106753 paradigm is widely-used, and establishing an interface to it
106754 in the annex will increase the portability and reusability of
106755 distributed programs.
106756
106757 _Legality Rules_
106758
106759 8
106760 In a dispatching call with two or more controlling operands, if one
106761 controlling operand is designated by a value of a remote
106762 access-to-class-wide type, then all shall be.
106763
106764 _Dynamic Semantics_
106765
106766 9
106767 For the execution of a remote subprogram call, subprogram parameters
106768 (and later the results, if any) are passed using a stream-oriented
106769 representation (see *note 13.13.1::) [which is suitable for transmission
106770 between partitions]. This action is called marshalling. Unmarshalling
106771 is the reverse action of reconstructing the parameters or results from
106772 the stream-oriented representation. [Marshalling is performed initially
106773 as part of the remote subprogram call in the calling partition;
106774 unmarshalling is done in the called partition. After the remote
106775 subprogram completes, marshalling is performed in the called partition,
106776 and finally unmarshalling is done in the calling partition.]
106777
106778 10
106779 A calling stub is the sequence of code that replaces the subprogram body
106780 of a remotely called subprogram in the calling partition. A receiving
106781 stub is the sequence of code (the "wrapper") that receives a remote
106782 subprogram call on the called partition and invokes the appropriate
106783 subprogram body.
106784
106785 10.a
106786 Discussion: The use of the term stub in this annex should not
106787 be confused with body_stub as defined in *note 10.1.3::. The
106788 term stub is used here because it is a commonly understood
106789 term when talking about the RPC paradigm.
106790
106791 11
106792 Remote subprogram calls are executed at most once, that is, if the
106793 subprogram call returns normally, then the called subprogram's body was
106794 executed exactly once.
106795
106796 12
106797 The task executing a remote subprogram call blocks until the subprogram
106798 in the called partition returns, unless the call is asynchronous. For
106799 an asynchronous remote procedure call, the calling task can become ready
106800 before the procedure in the called partition returns.
106801
106802 13
106803 If a construct containing a remote call is aborted, the remote
106804 subprogram call is cancelled. Whether the execution of the remote
106805 subprogram is immediately aborted as a result of the cancellation is
106806 implementation defined.
106807
106808 13.a
106809 Implementation defined: Whether the execution of the remote
106810 subprogram is immediately aborted as a result of cancellation.
106811
106812 14
106813 If a remote subprogram call is received by a called partition before the
106814 partition has completed its elaboration, the call is kept pending until
106815 the called partition completes its elaboration (unless the call is
106816 cancelled by the calling partition prior to that).
106817
106818 15
106819 If an exception is propagated by a remotely called subprogram, and the
106820 call is not an asynchronous call, the corresponding exception is
106821 reraised at the point of the remote subprogram call. For an
106822 asynchronous call, if the remote procedure call returns prior to the
106823 completion of the remotely called subprogram, any exception is lost.
106824
106825 16
106826 The exception Communication_Error (see *note E.5::) is raised if a
106827 remote call cannot be completed due to difficulties in communicating
106828 with the called partition.
106829
106830 17
106831 All forms of remote subprogram calls are potentially blocking operations
106832 (see *note 9.5.1::).
106833
106834 17.a
106835 Reason: Asynchronous remote procedure calls are potentially
106836 blocking since the implementation may require waiting for the
106837 availability of shared resources to initiate the remote call.
106838
106839 18/1
106840 {8652/00858652/0085} {AI95-00215-01AI95-00215-01} In a remote subprogram
106841 call with a formal parameter of a class-wide type, a check is made that
106842 the tag of the actual parameter identifies a tagged type declared in a
106843 declared-pure or shared passive library unit, or in the visible part of
106844 a remote types or remote call interface library unit. Program_Error is
106845 raised if this check fails. In a remote function call which returns a
106846 class-wide type, the same check is made on the function result.
106847
106848 18.a/1
106849 Discussion: {8652/00858652/0085} {AI95-00215-01AI95-00215-01}
106850 This check makes certain that the specific type passed or
106851 returned in an RPC satisfies the rules for a "communicable"
106852 type. Normally this is guaranteed by the compile-time
106853 restrictions on remote call interfaces. However, with
106854 class-wide types, it is possible to pass an object whose tag
106855 identifies a type declared outside the "safe" packages.
106856
106857 18.b
106858 This is considered an accessibility_check since only the types
106859 declared in "safe" packages are considered truly "global"
106860 (cross-partition). Other types are local to a single
106861 partition. This is analogous to the "accessibility" of global
106862 vs. local declarations in a single-partition program.
106863
106864 18.c
106865 This rule replaces a rule from an early version of Ada 9X
106866 which was given in the subclause on Remote Types Library Units
106867 (now *note E.2.2::, "*note E.2.2:: Remote Types Library
106868 Units"). That rule tried to prevent "bad" types from being
106869 sent by arranging for their tags to mismatch between
106870 partitions. However, that interfered with other uses of tags.
106871 The new rule allows tags to agree in all partitions, even for
106872 those types which are not "safe" to pass in an RPC.
106873
106874 19
106875 In a dispatching call with two or more controlling operands that are
106876 designated by values of a remote access-to-class-wide type, a check is
106877 made [(in addition to the normal Tag_Check -- see *note 11.5::)] that
106878 all the remote access-to-class-wide values originated from Access
106879 attribute_references that were evaluated by tasks of the same active
106880 partition. Constraint_Error is raised if this check fails.
106881
106882 19.a
106883 Implementation Note: When a remote access-to-class-wide value
106884 is created by an Access attribute_reference, the identity of
106885 the active partition that evaluated the attribute_reference
106886 should be recorded in the representation of the remote access
106887 value.
106888
106889 _Implementation Requirements_
106890
106891 20
106892 The implementation of remote subprogram calls shall conform to the PCS
106893 interface as defined by the specification of the language-defined
106894 package System.RPC (see *note E.5::). The calling stub shall use the
106895 Do_RPC procedure unless the remote procedure call is asynchronous in
106896 which case Do_APC shall be used. On the receiving side, the
106897 corresponding receiving stub shall be invoked by the RPC-receiver.
106898
106899 20.a
106900 Implementation Note: One possible implementation model is as
106901 follows:
106902
106903 20.b
106904 The code for calls to subprograms declared in an RCI package
106905 is generated normally, that is, the call-site is the same as
106906 for a local subprogram call. The code for the remotely
106907 callable subprogram bodies is also generated normally.
106908 Subprogram's prologue and epilogue are the same as for a local
106909 call.
106910
106911 20.c
106912 When compiling the specification of an RCI package, the
106913 compiler generates calling stubs for each visible subprogram.
106914 Similarly, when compiling the body of an RCI package, the
106915 compiler generates receiving stubs for each visible subprogram
106916 together with the appropriate tables to allow the RPC-receiver
106917 to locate the correct receiving stub.
106918
106919 20.d
106920 For the statically bound remote calls, the identity of the
106921 remote partition is statically determined (it is resolved at
106922 configuration/link time).
106923
106924 20.e
106925 The calling stub operates as follows:
106926
106927 20.f
106928 * It allocates (or reuses) a stream of Params_Stream_Type
106929 of Initial_Size, and initializes it by repeatedly calling
106930 Write operations, first to identify which remote
106931 subprogram in the receiving partition is being called,
106932 and then to pass the incoming value of each of the in and
106933 in out parameters of the call.
106934
106935 20.g/3
106936 * {AI05-0229-1AI05-0229-1} It allocates (or reuses) a
106937 stream for the Result, unless an aspect Asynchronous is
106938 specified as True for the procedure.
106939
106940 20.h/3
106941 * {AI05-0229-1AI05-0229-1} It calls Do_RPC unless an aspect
106942 Asynchronous is specified as True for the procedure in
106943 which case it calls Do_APC. An access value designating
106944 the message stream allocated and initialized above is
106945 passed as the Params parameter. An access value
106946 designating the Result stream is passed as the Result
106947 parameter.
106948
106949 20.i/3
106950 * {AI05-0229-1AI05-0229-1} If the aspect Asynchronous is
106951 not specified for the procedure, Do_RPC blocks until a
106952 reply message arrives, and then returns to the calling
106953 stub. The stub returns after extracting from the Result
106954 stream, using Read operations, the in out and out
106955 parameters or the function result. If the reply message
106956 indicates that the execution of the remote subprogram
106957 propagated an exception, the exception is propagated from
106958 Do_RPC to the calling stub, and thence to the point of
106959 the original remote subprogram call. If Do_RPC detects
106960 that communication with the remote partition has failed,
106961 it propagates Communication_Error.
106962
106963 20.j
106964 On the receiving side, the RPC-receiver procedure operates as
106965 follows:
106966
106967 20.k
106968 * It is called from the PCS when a remote-subprogram-call
106969 message is received. The call originates in some remote
106970 call receiver task executed and managed in the context of
106971 the PCS.
106972
106973 20.l
106974 * It extracts information from the stream to identify the
106975 appropriate receiving stub.
106976
106977 20.m
106978 * The receiving stub extracts the in and in out parameters
106979 using Read from the stream designated by the Params
106980 parameter.
106981
106982 20.n
106983 * The receiving stub calls the actual subprogram body and,
106984 upon completion of the subprogram, uses Write to insert
106985 the results into the stream pointed to by the Result
106986 parameter. The receiving stub returns to the
106987 RPC-receiver procedure which in turn returns to the PCS.
106988 If the actual subprogram body propagates an exception, it
106989 is propagated by the RPC-receiver to the PCS, which
106990 handles the exception, and indicates in the reply message
106991 that the execution of the subprogram body propagated an
106992 exception. The exception occurrence can be represented
106993 in the reply message using the Write attribute of
106994 Ada.Exceptions.Exception_Occurrence.
106995
106996 20.o
106997 For remote access-to-subprogram types:
106998
106999 20.p
107000 A value of a remote access-to-subprogram type can be
107001 represented by the following components: a reference to the
107002 remote partition, an index to the package containing the
107003 remote subprogram, and an index to the subprogram within the
107004 package. The values of these components are determined at run
107005 time when the remote access value is created. These three
107006 components serve the same purpose when calling Do_APC/RPC, as
107007 in the statically bound remote calls; the only difference is
107008 that they are evaluated dynamically.
107009
107010 20.q
107011 For remote access-to-class-wide types:
107012
107013 20.r
107014 For each remote access-to-class-wide type, a calling stub is
107015 generated for each dispatching operation of the designated
107016 type. In addition, receiving stubs are generated to perform
107017 the remote dispatching operations in the called partition.
107018 The appropriate subprogram_body is determined as for a local
107019 dispatching call once the receiving stub has been reached.
107020
107021 20.s
107022 A value of a remote access-to-class-wide type can be
107023 represented with the following components: a reference to the
107024 remote partition, an index to a table (created one per each
107025 such access type) containing addresses of all the dispatching
107026 operations of the designated type, and an access value
107027 designating the actual remote object.
107028
107029 20.t
107030 Alternatively, a remote access-to-class-wide value can be
107031 represented as a normal access value, pointing to a "stub"
107032 object which in turn contains the information mentioned above.
107033 A call on any dispatching operation of such a stub object does
107034 the remote call, if necessary, using the information in the
107035 stub object to locate the target partition, etc. This
107036 approach has the advantage that less special-casing is
107037 required in the compiler. All access values can remain just a
107038 simple address.
107039
107040 20.u
107041 For a call to Do_RPC or Do_APC: The partition ID of all
107042 controlling operands are checked for equality (a
107043 Constraint_Error is raised if this check fails). The
107044 partition ID value is used for the Partition parameter. An
107045 index into the tagged-type-descriptor is created. This index
107046 points to the receiving stub of the class-wide operation.
107047 This index and the index to the table (described above) are
107048 written to the stream. Then, the actual parameters are
107049 marshalled into the message stream. For a controlling
107050 operand, only the access value designating the remote object
107051 is required (the other two components are already present in
107052 the other parameters).
107053
107054 20.v
107055 On the called partition (after the RPC-receiver has
107056 transferred control to the appropriate receiving stub) the
107057 parameters are first unmarshalled. Then, the tags of the
107058 controlling operands (obtained by dereferencing the pointer to
107059 the object) are checked for equality. If the check fails
107060 Constraint_Error is raised and propagated back to the calling
107061 partition, unless it is a result of an asynchronous call.
107062 Finally, a dispatching call to the specific subprogram (based
107063 on the controlling object's tag) is made. Note that since
107064 this subprogram is not in an RCI package, no specific stub is
107065 generated for it, it is called normally from the dispatching
107066 stub.
107067
107068 20.1/1
107069 {8652/00868652/0086} {AI95-00159-01AI95-00159-01} With respect to shared
107070 variables in shared passive library units, the execution of the
107071 corresponding subprogram body of a synchronous remote procedure call is
107072 considered to be part of the execution of the calling task. The
107073 execution of the corresponding subprogram body of an asynchronous remote
107074 procedure call proceeds in parallel with the calling task and does not
107075 signal the next action of the calling task (see *note 9.10::).
107076
107077 NOTES
107078
107079 21
107080 8 A given active partition can both make and receive remote
107081 subprogram calls. Thus, an active partition can act as both a
107082 client and a server.
107083
107084 22
107085 9 If a given exception is propagated by a remote subprogram call,
107086 but the exception does not exist in the calling partition, the
107087 exception can be handled by an others choice or be propagated to
107088 and handled by a third partition.
107089
107090 22.a
107091 Discussion: This situation can happen in a case of dynamically
107092 nested remote subprogram calls, where an intermediate call
107093 executes in a partition that does not include the library unit
107094 that defines the exception.
107095
107096 _Wording Changes from Ada 95_
107097
107098 22.b/2
107099 {8652/00868652/0086} {AI95-00159-01AI95-00159-01} Corrigendum:
107100 Added rules so that tasks can safely access shared passive
107101 objects.
107102
107103 22.c/2
107104 {8652/00858652/0085} {AI95-00215-01AI95-00215-01} Corrigendum:
107105 Clarified that the check on class-wide types also applies to
107106 values returned from remote subprogram call functions.
107107
107108 _Wording Changes from Ada 2005_
107109
107110 22.d/3
107111 {AI05-0101-1AI05-0101-1} Correction: Corrected the text to
107112 note that remote access types can be defined in remote types
107113 units.
107114
107115 * Menu:
107116
107117 * E.4.1 :: Asynchronous Remote Calls
107118 * E.4.2 :: Example of Use of a Remote Access-to-Class-Wide Type
107119
107120 \1f
107121 File: aarm2012.info, Node: E.4.1, Next: E.4.2, Up: E.4
107122
107123 E.4.1 Asynchronous Remote Calls
107124 -------------------------------
107125
107126 1/3
107127 {AI05-0229-1AI05-0229-1} [This subclause introduces the aspect
107128 Asynchronous which can be specified to allow a remote subprogram call to
107129 return prior to completion of the execution of the corresponding remote
107130 subprogram body.]
107131
107132 Paragraphs 2 through 7 were deleted.
107133
107134 _Static Semantics_
107135
107136 8/3
107137 {AI05-0229-1AI05-0229-1} For a remote procedure, the following
107138 language-defined representation aspect may be specified:
107139
107140 8.1/3
107141 Asynchronous
107142 The type of aspect Asynchronous is Boolean. If directly
107143 specified, the aspect_definition shall be a static
107144 expression. If not specified, the aspect is False.
107145
107146 8.a/3
107147 Aspect Description for Asynchronous: Remote procedure calls
107148 are asynchronous; the caller continues without waiting for the
107149 call to return.
107150
107151 8.2/3
107152 {AI05-0229-1AI05-0229-1} For a remote access type, the following
107153 language-defined representation aspect may be specified:
107154
107155 8.3/3
107156 Asynchronous
107157 The type of aspect Asynchronous is Boolean. If directly
107158 specified, the aspect_definition shall be a static
107159 expression. If not specified (including by inheritance),
107160 the aspect is False.
107161
107162 _Legality Rules_
107163
107164 8.4/3
107165 {AI05-0229-1AI05-0229-1} If aspect Asynchronous is specified for a
107166 remote procedure, the formal parameters of the procedure shall all be of
107167 mode in.
107168
107169 8.5/3
107170 {AI05-0229-1AI05-0229-1} If aspect Asynchronous is specified for a
107171 remote access type, the type shall be a remote access-to-class-wide
107172 type, or the type shall be a remote access-to-procedure type with the
107173 formal parameters of the designated profile of the type all of mode in.
107174
107175 _Dynamic Semantics_
107176
107177 9/3
107178 {AI05-0229-1AI05-0229-1} A remote call is asynchronous if it is a call
107179 to a procedure, or a call through a value of an access-to-procedure
107180 type, for which aspect Asynchronous is True. In addition, if aspect
107181 Asynchronous is True for a remote access-to-class-wide type, then a
107182 dispatching call on a procedure with a controlling operand designated by
107183 a value of the type is asynchronous if the formal parameters of the
107184 procedure are all of mode in.
107185
107186 _Implementation Requirements_
107187
107188 10
107189 Asynchronous remote procedure calls shall be implemented such that the
107190 corresponding body executes at most once as a result of the call.
107191
107192 10.a
107193 To be honest: It is not clear that this rule can be tested or
107194 even defined formally.
107195
107196 _Extensions to Ada 2005_
107197
107198 10.b/3
107199 {AI05-0229-1AI05-0229-1} Aspect Asynchronous is new; pragma
107200 Asynchronous is now obsolescent.
107201
107202 \1f
107203 File: aarm2012.info, Node: E.4.2, Prev: E.4.1, Up: E.4
107204
107205 E.4.2 Example of Use of a Remote Access-to-Class-Wide Type
107206 ----------------------------------------------------------
107207
107208 _Examples_
107209
107210 1
107211 Example of using a remote access-to-class-wide type to achieve dynamic
107212 binding across active partitions:
107213
107214 2
107215 package Tapes is
107216 pragma Pure(Tapes);
107217 type Tape is abstract tagged limited private;
107218 -- Primitive dispatching operations where
107219 -- Tape is controlling operand
107220 procedure Copy (From, To : access Tape; Num_Recs : in Natural) is abstract;
107221 procedure Rewind (T : access Tape) is abstract;
107222 -- More operations
107223 private
107224 type Tape is ...
107225 end Tapes;
107226
107227 3
107228 with Tapes;
107229 package Name_Server is
107230 pragma Remote_Call_Interface;
107231 -- Dynamic binding to remote operations is achieved
107232 -- using the access-to-limited-class-wide type Tape_Ptr
107233 type Tape_Ptr is access all Tapes.Tape'Class;
107234 -- The following statically bound remote operations
107235 -- allow for a name-server capability in this example
107236 function Find (Name : String) return Tape_Ptr;
107237 procedure Register (Name : in String; T : in Tape_Ptr);
107238 procedure Remove (T : in Tape_Ptr);
107239 -- More operations
107240 end Name_Server;
107241
107242 4
107243 package Tape_Driver is
107244 -- Declarations are not shown, they are irrelevant here
107245 end Tape_Driver;
107246
107247 5
107248 with Tapes, Name_Server;
107249 package body Tape_Driver is
107250 type New_Tape is new Tapes.Tape with ...
107251 procedure Copy
107252 (From, To : access New_Tape; Num_Recs: in Natural) is
107253 begin
107254 . . .
107255 end Copy;
107256 procedure Rewind (T : access New_Tape) is
107257 begin
107258 . . .
107259 end Rewind;
107260 -- Objects remotely accessible through use
107261 -- of Name_Server operations
107262 Tape1, Tape2 : aliased New_Tape;
107263 begin
107264 Name_Server.Register ("NINE-TRACK", Tape1'Access);
107265 Name_Server.Register ("SEVEN-TRACK", Tape2'Access);
107266 end Tape_Driver;
107267
107268 6
107269 with Tapes, Name_Server;
107270 -- Tape_Driver is not needed and thus not mentioned in the with_clause
107271 procedure Tape_Client is
107272 T1, T2 : Name_Server.Tape_Ptr;
107273 begin
107274 T1 := Name_Server.Find ("NINE-TRACK");
107275 T2 := Name_Server.Find ("SEVEN-TRACK");
107276 Tapes.Rewind (T1);
107277 Tapes.Rewind (T2);
107278 Tapes.Copy (T1, T2, 3);
107279 end Tape_Client;
107280
107281 7
107282 Notes on the example:
107283
107284 7.a
107285 Discussion: The example does not show the case where tapes are
107286 removed from or added to the system. In the former case, an
107287 appropriate exception needs to be defined to instruct the
107288 client to use another tape. In the latter, the Name_Server
107289 should have a query function visible to the clients to inform
107290 them about the availability of the tapes in the system.
107291
107292 8/1
107293 This paragraph was deleted.
107294
107295 9
107296 * The package Tapes provides the necessary declarations of the type
107297 and its primitive operations.
107298
107299 10
107300 * Name_Server is a remote call interface package and is elaborated in
107301 a separate active partition to provide the necessary naming
107302 services (such as Register and Find) to the entire distributed
107303 program through remote subprogram calls.
107304
107305 11
107306 * Tape_Driver is a normal package that is elaborated in a partition
107307 configured on the processing node that is connected to the tape
107308 device(s). The abstract operations are overridden to support the
107309 locally declared tape devices (Tape1, Tape2). The package is not
107310 visible to its clients, but it exports the tape devices (as remote
107311 objects) through the services of the Name_Server. This allows for
107312 tape devices to be dynamically added, removed or replaced without
107313 requiring the modification of the clients' code.
107314
107315 12
107316 * The Tape_Client procedure references only declarations in the Tapes
107317 and Name_Server packages. Before using a tape for the first time,
107318 it needs to query the Name_Server for a system-wide identity for
107319 that tape. From then on, it can use that identity to access the
107320 tape device.
107321
107322 13
107323 * Values of remote access type Tape_Ptr include the necessary
107324 information to complete the remote dispatching operations that
107325 result from dereferencing the controlling operands T1 and T2.
107326
107327 \1f
107328 File: aarm2012.info, Node: E.5, Prev: E.4, Up: Annex E
107329
107330 E.5 Partition Communication Subsystem
107331 =====================================
107332
107333 1/2
107334 {AI95-00273-01AI95-00273-01} [The Partition Communication Subsystem
107335 (PCS) provides facilities for supporting communication between the
107336 active partitions of a distributed program. The package System.RPC is a
107337 language-defined interface to the PCS.]
107338
107339 1.a
107340 Reason: The prefix RPC is used rather than RSC because the
107341 term remote procedure call and its acronym are more familiar.
107342
107343 _Static Semantics_
107344
107345 2
107346 The following language-defined library package exists:
107347
107348 3
107349 with Ada.Streams; -- see *note 13.13.1::
107350 package System.RPC is
107351
107352 4
107353 type Partition_Id is range 0 .. implementation-defined;
107354
107355 5
107356 Communication_Error : exception;
107357
107358 6
107359 type Params_Stream_Type (
107360 Initial_Size : Ada.Streams.Stream_Element_Count) is new
107361 Ada.Streams.Root_Stream_Type with private;
107362
107363 7
107364 procedure Read(
107365 Stream : in out Params_Stream_Type;
107366 Item : out Ada.Streams.Stream_Element_Array;
107367 Last : out Ada.Streams.Stream_Element_Offset);
107368
107369 8
107370 procedure Write(
107371 Stream : in out Params_Stream_Type;
107372 Item : in Ada.Streams.Stream_Element_Array);
107373
107374 9
107375 -- Synchronous call
107376 procedure Do_RPC(
107377 Partition : in Partition_Id;
107378 Params : access Params_Stream_Type;
107379 Result : access Params_Stream_Type);
107380
107381 10
107382 -- Asynchronous call
107383 procedure Do_APC(
107384 Partition : in Partition_Id;
107385 Params : access Params_Stream_Type);
107386
107387 11
107388 -- The handler for incoming RPCs
107389 type RPC_Receiver is access procedure(
107390 Params : access Params_Stream_Type;
107391 Result : access Params_Stream_Type);
107392
107393 12
107394 procedure Establish_RPC_Receiver(
107395 Partition : in Partition_Id;
107396 Receiver : in RPC_Receiver);
107397
107398 13
107399 private
107400 ... -- not specified by the language
107401 end System.RPC;
107402
107403 14
107404 A value of the type Partition_Id is used to identify a partition.
107405
107406 14.a/2
107407 Implementation defined: The range of type
107408 System.RPC.Partition_Id.
107409
107410 15
107411 An object of the type Params_Stream_Type is used for identifying the
107412 particular remote subprogram that is being called, as well as
107413 marshalling and unmarshalling the parameters or result of a remote
107414 subprogram call, as part of sending them between partitions.
107415
107416 16
107417 [The Read and Write procedures override the corresponding abstract
107418 operations for the type Params_Stream_Type.]
107419
107420 _Dynamic Semantics_
107421
107422 17
107423 The Do_RPC and Do_APC procedures send a message to the active partition
107424 identified by the Partition parameter.
107425
107426 17.a
107427 Implementation Note: It is assumed that the RPC interface is
107428 above the message-passing layer of the network protocol stack
107429 and is implemented in terms of it.
107430
107431 18
107432 After sending the message, Do_RPC blocks the calling task until a reply
107433 message comes back from the called partition or some error is detected
107434 by the underlying communication system in which case Communication_Error
107435 is raised at the point of the call to Do_RPC.
107436
107437 18.a
107438 Reason: Only one exception is defined in System.RPC, although
107439 many sources of errors might exist. This is so because it is
107440 not always possible to distinguish among these errors. In
107441 particular, it is often impossible to tell the difference
107442 between a failing communication link and a failing processing
107443 node. Additional information might be associated with a
107444 particular Exception_Occurrence for a Communication_Error.
107445
107446 19
107447 Do_APC operates in the same way as Do_RPC except that it is allowed to
107448 return immediately after sending the message.
107449
107450 20
107451 Upon normal return, the stream designated by the Result parameter of
107452 Do_RPC contains the reply message.
107453
107454 21
107455 The procedure System.RPC.Establish_RPC_Receiver is called once,
107456 immediately after elaborating the library units of an active partition
107457 (that is, right after the elaboration of the partition) if the partition
107458 includes an RCI library unit, but prior to invoking the main subprogram,
107459 if any. The Partition parameter is the Partition_Id of the active
107460 partition being elaborated. The Receiver parameter designates an
107461 implementation-provided procedure called the RPC-receiver which will
107462 handle all RPCs received by the partition from the PCS.
107463 Establish_RPC_Receiver saves a reference to the RPC-receiver; when a
107464 message is received at the called partition, the RPC-receiver is called
107465 with the Params stream containing the message. When the RPC-receiver
107466 returns, the contents of the stream designated by Result is placed in a
107467 message and sent back to the calling partition.
107468
107469 21.a
107470 Implementation Note: It is defined by the PCS implementation
107471 whether one or more threads of control should be available to
107472 process incoming messages and to wait for their completion.
107473
107474 21.b
107475 Implementation Note: At link-time, the linker provides the
107476 RPC-receiver and the necessary tables to support it. A call
107477 on Establish_RPC_Receiver is inserted just before the call on
107478 the main subprogram.
107479
107480 21.c
107481 Reason: The interface between the PCS (the System.RPC package)
107482 and the RPC-receiver is defined to be dynamic in order to
107483 allow the elaboration sequence to notify the PCS that all
107484 packages have been elaborated and that it is safe to call the
107485 receiving stubs. It is not guaranteed that the PCS units will
107486 be the last to be elaborated, so some other indication that
107487 elaboration is complete is needed.
107488
107489 22
107490 If a call on Do_RPC is aborted, a cancellation message is sent to the
107491 called partition, to request that the execution of the remotely called
107492 subprogram be aborted.
107493
107494 22.a
107495 To be honest: The full effects of this message are dependent
107496 on the implementation of the PCS.
107497
107498 23
107499 The subprograms declared in System.RPC are potentially blocking
107500 operations.
107501
107502 _Implementation Requirements_
107503
107504 24
107505 The implementation of the RPC-receiver shall be reentrant[, thereby
107506 allowing concurrent calls on it from the PCS to service concurrent
107507 remote subprogram calls into the partition].
107508
107509 24.a
107510 Reason: There seems no reason to allow the implementation of
107511 RPC-receiver to be nonreentrant, even though we don't require
107512 that every implementation of the PCS actually perform
107513 concurrent calls on the RPC-receiver.
107514
107515 24.1/1
107516 {8652/00878652/0087} {AI95-00082-01AI95-00082-01} An implementation
107517 shall not restrict the replacement of the body of System.RPC. An
107518 implementation shall not restrict children of System.RPC. [The related
107519 implementation permissions in the introduction to Annex A do not apply.]
107520
107521 24.a.1/1
107522 Reason: The point of System.RPC is to let the user tailor the
107523 communications mechanism without requiring changes to or other
107524 cooperation from the compiler. However, implementations can
107525 restrict the replacement of language-defined units. This
107526 requirement overrides that permission for System.RPC.
107527
107528 24.2/1
107529 {8652/00878652/0087} {AI95-00082-01AI95-00082-01} If the implementation
107530 of System.RPC is provided by the user, an implementation shall support
107531 remote subprogram calls as specified.
107532
107533 24.b/2
107534 Discussion: {AI95-00273-01AI95-00273-01} If the implementation
107535 takes advantage of the implementation permission to use a
107536 different specification for System.RPC, it still needs to use
107537 it for remote subprogram calls, and allow the user to replace
107538 the body of System.RPC. It just isn't guaranteed to be
107539 portable to do so in Ada 2005 - an advantage which was more
107540 theoretical than real anyway.
107541
107542 _Documentation Requirements_
107543
107544 25
107545 The implementation of the PCS shall document whether the RPC-receiver is
107546 invoked from concurrent tasks. If there is an upper limit on the number
107547 of such tasks, this limit shall be documented as well, together with the
107548 mechanisms to configure it (if this is supported).
107549
107550 25.a/2
107551 This paragraph was deleted.
107552
107553 25.a.1/2
107554 Documentation Requirement: Whether the RPC-receiver is invoked
107555 from concurrent tasks, and if so, the number of such tasks.
107556
107557 _Implementation Permissions_
107558
107559 26
107560 The PCS is allowed to contain implementation-defined interfaces for
107561 explicit message passing, broadcasting, etc. Similarly, it is allowed
107562 to provide additional interfaces to query the state of some remote
107563 partition (given its partition ID) or of the PCS itself, to set timeouts
107564 and retry parameters, to get more detailed error status, etc. These
107565 additional interfaces should be provided in child packages of
107566 System.RPC.
107567
107568 26.a
107569 Implementation defined: Implementation-defined interfaces in
107570 the PCS.
107571
107572 27
107573 A body for the package System.RPC need not be supplied by the
107574 implementation.
107575
107576 27.a
107577 Reason: It is presumed that a body for the package System.RPC
107578 might be extremely environment specific. Therefore, we do not
107579 require that a body be provided by the (compiler)
107580 implementation. The user will have to write a body, or
107581 acquire one, appropriate for the target environment.
107582
107583 27.1/3
107584 {AI95-00273-01AI95-00273-01} {AI05-0299-1AI05-0299-1} An alternative
107585 declaration is allowed for package System.RPC as long as it provides a
107586 set of operations that is substantially equivalent to the specification
107587 defined in this subclause.
107588
107589 27.b/2
107590 Reason: Experience has proved that the definition of
107591 System.RPC given here is inadequate for interfacing to
107592 existing distribution mechanisms (such as CORBA), especially
107593 on heterogeneous systems. Rather than mandate a change in the
107594 mechanism (which would break existing systems), require
107595 implementations to support multiple mechanisms (which is
107596 impractical), or prevent the use of Annex E facilities with
107597 existing systems (which would be silly), we simply make this
107598 facility optional.
107599
107600 27.c/2
107601 One of the purposes behind System.RPC was that knowledgeable
107602 users, rather than compiler vendors, could create this package
107603 tailored to their networks. Experience has shown that users
107604 get their RPC from vendors anyway; users have not taken
107605 advantage of the flexibility provided by this defined
107606 interface. Moreover, one could compare this defined interface
107607 to requiring Ada compilers to use a defined interface to
107608 implement tasking. No one thinks that the latter is a good
107609 idea, why should anyone believe that the former is?
107610
107611 27.d/3
107612 {AI05-0299-1AI05-0299-1} Therefore, this subclause is made
107613 optional. We considered deleting the subclause outright, but
107614 we still require that users may replace the package (whatever
107615 its interface). Also, it still provides a useful guide to the
107616 implementation of this feature.
107617
107618 _Implementation Advice_
107619
107620 28
107621 Whenever possible, the PCS on the called partition should allow for
107622 multiple tasks to call the RPC-receiver with different messages and
107623 should allow them to block until the corresponding subprogram body
107624 returns.
107625
107626 28.a/2
107627 Implementation Advice: The PCS should allow for multiple tasks
107628 to call the RPC-receiver.
107629
107630 29
107631 The Write operation on a stream of type Params_Stream_Type should raise
107632 Storage_Error if it runs out of space trying to write the Item into the
107633 stream.
107634
107635 29.a.1/2
107636 Implementation Advice: The System.RPC.Write operation should
107637 raise Storage_Error if it runs out of space when writing an
107638 item.
107639
107640 29.a
107641 Implementation Note: An implementation could also dynamically
107642 allocate more space as needed, only propagating Storage_Error
107643 if the allocator it calls raises Storage_Error. This storage
107644 could be managed through a controlled component of the stream
107645 object, to ensure that it is reclaimed when the stream object
107646 is finalized.
107647
107648 NOTES
107649
107650 30
107651 10 The package System.RPC is not designed for direct calls by user
107652 programs. It is instead designed for use in the implementation of
107653 remote subprograms calls, being called by the calling stubs
107654 generated for a remote call interface library unit to initiate a
107655 remote call, and in turn calling back to an RPC-receiver that
107656 dispatches to the receiving stubs generated for the body of a
107657 remote call interface, to handle a remote call received from
107658 elsewhere.
107659
107660 _Incompatibilities With Ada 95_
107661
107662 30.a/2
107663 {AI95-00273-01AI95-00273-01} The specification of System.RPC
107664 can now be tailored for an implementation. If a program
107665 replaces the body of System.RPC with a user-defined body, it
107666 might not compile in a given implementation of Ada 2005 (if
107667 the specification of System.RPC has been changed).
107668
107669 _Wording Changes from Ada 95_
107670
107671 30.b/2
107672 {8652/00878652/0087} {AI95-00082-01AI95-00082-01} Corrigendum:
107673 Clarified that the user can replace System.RPC.
107674
107675 \1f
107676 File: aarm2012.info, Node: Annex F, Next: Annex G, Prev: Annex E, Up: Top
107677
107678 Annex F Information Systems
107679 ***************************
107680
107681 1
107682 This Annex provides a set of facilities relevant to Information Systems
107683 programming. These fall into several categories:
107684
107685 2
107686 * an attribute definition clause specifying Machine_Radix for a
107687 decimal subtype;
107688
107689 3
107690 * the package Decimal, which declares a set of constants defining the
107691 implementation's capacity for decimal types, and a generic
107692 procedure for decimal division; and
107693
107694 4/2
107695 * {AI95-00285-01AI95-00285-01} the child packages Text_IO.Editing,
107696 Wide_Text_IO.Editing, and Wide_Wide_Text_IO.Editing, which support
107697 formatted and localized output of decimal data, based on "picture
107698 String" values.
107699
107700 5/2
107701 {AI95-00434-01AI95-00434-01} See also: *note 3.5.9::, "*note 3.5.9::
107702 Fixed Point Types"; *note 3.5.10::, "*note 3.5.10:: Operations of Fixed
107703 Point Types"; *note 4.6::, "*note 4.6:: Type Conversions"; *note 13.3::,
107704 "*note 13.3:: Operational and Representation Attributes"; *note
107705 A.10.9::, "*note A.10.9:: Input-Output for Real Types"; *note B.3::,
107706 "*note B.3:: Interfacing with C and C++"; *note B.4::, "*note B.4::
107707 Interfacing with COBOL"; *note Annex G::, "*note Annex G:: Numerics".
107708
107709 6
107710 The character and string handling packages in *note Annex A::, "*note
107711 Annex A:: Predefined Language Environment" are also relevant for
107712 Information Systems.
107713
107714 _Implementation Advice_
107715
107716 7/3
107717 {AI05-0229-1AI05-0229-1} If COBOL (respectively, C) is widely supported
107718 in the target environment, implementations supporting the Information
107719 Systems Annex should provide the child package Interfaces.COBOL
107720 (respectively, Interfaces.C) specified in *note Annex B:: and should
107721 support a convention_identifier of COBOL (respectively, C) for the
107722 Convention aspect (see *note Annex B::), thus allowing Ada programs to
107723 interface with programs written in that language.
107724
107725 7.a/2
107726 Implementation Advice: If COBOL (respectively, C) is supported
107727 in the target environment, then interfacing to COBOL
107728 (respectively, C) should be supported as specified in *note
107729 Annex B::.
107730
107731 _Extensions to Ada 83_
107732
107733 7.b
107734 This Annex is new to Ada 95.
107735
107736 _Wording Changes from Ada 95_
107737
107738 7.c/2
107739 {AI95-00285-01AI95-00285-01} Added a mention of
107740 Wide_Wide_Text_IO.Editing, part of the support for 32-bit
107741 characters.
107742
107743 * Menu:
107744
107745 * F.1 :: Machine_Radix Attribute Definition Clause
107746 * F.2 :: The Package Decimal
107747 * F.3 :: Edited Output for Decimal Types
107748
107749 \1f
107750 File: aarm2012.info, Node: F.1, Next: F.2, Up: Annex F
107751
107752 F.1 Machine_Radix Attribute Definition Clause
107753 =============================================
107754
107755 _Static Semantics_
107756
107757 1
107758 Machine_Radix may be specified for a decimal first subtype (see *note
107759 3.5.9::) via an attribute_definition_clause; the expression of such a
107760 clause shall be static, and its value shall be 2 or 10. A value of 2
107761 implies a binary base range; a value of 10 implies a decimal base range.
107762
107763 1.a
107764 Ramification: In the absence of a Machine_Radix clause, the
107765 choice of 2 versus 10 for S'Machine_Radix is not specified.
107766
107767 1.b/3
107768 Aspect Description for Machine_Radix: Radix (2 or 10) that is
107769 used to represent a decimal fixed point type.
107770
107771 _Implementation Advice_
107772
107773 2
107774 Packed decimal should be used as the internal representation for objects
107775 of subtype S when S'Machine_Radix = 10.
107776
107777 2.a/2
107778 Implementation Advice: Packed decimal should be used as the
107779 internal representation for objects of subtype S when
107780 S'Machine_Radix = 10.
107781
107782 2.b/3
107783 Discussion: {AI05-0229-1AI05-0229-1} The intent of a decimal
107784 Machine_Radix attribute definition clause is to allow the
107785 programmer to declare an Ada decimal data object whose
107786 representation matches a particular COBOL implementation's
107787 representation of packed decimal items. The Ada object may
107788 then be passed to an interfaced COBOL program that takes a
107789 packed decimal data item as a parameter, assuming that
107790 convention COBOL has been specified for the Ada object's type
107791 with an aspect Convention.
107792
107793 2.c
107794 Additionally, the Ada compiler may choose to generate
107795 arithmetic instructions that exploit the packed decimal
107796 representation.
107797
107798 _Examples_
107799
107800 3
107801 Example of Machine_Radix attribute definition clause:
107802
107803 4
107804 type Money is delta 0.01 digits 15;
107805 for Money'Machine_Radix use 10;
107806
107807 \1f
107808 File: aarm2012.info, Node: F.2, Next: F.3, Prev: F.1, Up: Annex F
107809
107810 F.2 The Package Decimal
107811 =======================
107812
107813 _Static Semantics_
107814
107815 1
107816 The library package Decimal has the following declaration:
107817
107818 2
107819 package Ada.Decimal is
107820 pragma Pure(Decimal);
107821
107822 3
107823 Max_Scale : constant := implementation-defined;
107824 Min_Scale : constant := implementation-defined;
107825
107826 4
107827 Min_Delta : constant := 10.0**(-Max_Scale);
107828 Max_Delta : constant := 10.0**(-Min_Scale);
107829
107830 5
107831 Max_Decimal_Digits : constant := implementation-defined;
107832
107833 6/3
107834 {AI05-0229-1AI05-0229-1} generic
107835 type Dividend_Type is delta <> digits <>;
107836 type Divisor_Type is delta <> digits <>;
107837 type Quotient_Type is delta <> digits <>;
107838 type Remainder_Type is delta <> digits <>;
107839 procedure Divide (Dividend : in Dividend_Type;
107840 Divisor : in Divisor_Type;
107841 Quotient : out Quotient_Type;
107842 Remainder : out Remainder_Type)
107843 with Convention => Intrinsic;
107844
107845 7
107846 end Ada.Decimal;
107847
107848 7.a
107849 Implementation defined: The values of named numbers in the
107850 package Decimal.
107851
107852 8
107853 Max_Scale is the largest N such that 10.0**(-N) is allowed as a decimal
107854 type's delta. Its type is universal_integer.
107855
107856 9
107857 Min_Scale is the smallest N such that 10.0**(-N) is allowed as a decimal
107858 type's delta. Its type is universal_integer.
107859
107860 10
107861 Min_Delta is the smallest value allowed for delta in a
107862 decimal_fixed_point_definition. Its type is universal_real.
107863
107864 11
107865 Max_Delta is the largest value allowed for delta in a
107866 decimal_fixed_point_definition. Its type is universal_real.
107867
107868 12
107869 Max_Decimal_Digits is the largest value allowed for digits in a
107870 decimal_fixed_point_definition. Its type is universal_integer.
107871
107872 12.a
107873 Reason: The name is Max_Decimal_Digits versus Max_Digits, in
107874 order to avoid confusion with the named number
107875 System.Max_Digits relevant to floating point.
107876
107877 _Static Semantics_
107878
107879 13
107880 The effect of Divide is as follows. The value of Quotient is
107881 Quotient_Type(Dividend/Divisor). The value of Remainder is
107882 Remainder_Type(Intermediate), where Intermediate is the difference
107883 between Dividend and the product of Divisor and Quotient; this result is
107884 computed exactly.
107885
107886 _Implementation Requirements_
107887
107888 14
107889 Decimal.Max_Decimal_Digits shall be at least 18.
107890
107891 15
107892 Decimal.Max_Scale shall be at least 18.
107893
107894 16
107895 Decimal.Min_Scale shall be at most 0.
107896
107897 NOTES
107898
107899 17
107900 1 The effect of division yielding a quotient with control over
107901 rounding versus truncation is obtained by applying either the
107902 function attribute Quotient_Type'Round or the conversion
107903 Quotient_Type to the expression Dividend/Divisor.
107904
107905 \1f
107906 File: aarm2012.info, Node: F.3, Prev: F.2, Up: Annex F
107907
107908 F.3 Edited Output for Decimal Types
107909 ===================================
107910
107911 1/2
107912 {AI95-00285-01AI95-00285-01} The child packages Text_IO.Editing,
107913 Wide_Text_IO.Editing, and Wide_Wide_Text_IO.Editing provide localizable
107914 formatted text output, known as edited output, for decimal types. An
107915 edited output string is a function of a numeric value,
107916 program-specifiable locale elements, and a format control value. The
107917 numeric value is of some decimal type. The locale elements are:
107918
107919 2
107920 * the currency string;
107921
107922 3
107923 * the digits group separator character;
107924
107925 4
107926 * the radix mark character; and
107927
107928 5
107929 * the fill character that replaces leading zeros of the numeric
107930 value.
107931
107932 6/2
107933 {AI95-00285-01AI95-00285-01} For Text_IO.Editing the edited output and
107934 currency strings are of type String, and the locale characters are of
107935 type Character. For Wide_Text_IO.Editing their types are Wide_String
107936 and Wide_Character, respectively. For Wide_Wide_Text_IO.Editing their
107937 types are Wide_Wide_String and Wide_Wide_Character, respectively.
107938
107939 7
107940 Each of the locale elements has a default value that can be replaced or
107941 explicitly overridden.
107942
107943 8
107944 A format-control value is of the private type Picture; it determines the
107945 composition of the edited output string and controls the form and
107946 placement of the sign, the position of the locale elements and the
107947 decimal digits, the presence or absence of a radix mark, suppression of
107948 leading zeros, and insertion of particular character values.
107949
107950 9
107951 A Picture object is composed from a String value, known as a picture
107952 String, that serves as a template for the edited output string, and a
107953 Boolean value that controls whether a string of all space characters is
107954 produced when the number's value is zero. A picture String comprises a
107955 sequence of one- or two-Character symbols, each serving as a placeholder
107956 for a character or string at a corresponding position in the edited
107957 output string. The picture String symbols fall into several categories
107958 based on their effect on the edited output string:
107959
107960 10
107961 Decimal Digit: '9'
107962 Radix Control: '.' 'V'
107963 Sign Control: '+' '-' '<' '>' "CR" "DB"
107964 Currency Control: '$' '#'
107965 Zero Suppression: 'Z' '*'
107966 Simple Insertion: '_' 'B' '0' '/'
107967
107968 11
107969 The entries are not case-sensitive. Mixed- or lower-case forms for "CR"
107970 and "DB", and lower-case forms for 'V', 'Z', and 'B', have the same
107971 effect as the upper-case symbols shown.
107972
107973 12
107974 An occurrence of a '9' Character in the picture String represents a
107975 decimal digit position in the edited output string.
107976
107977 13
107978 A radix control Character in the picture String indicates the position
107979 of the radix mark in the edited output string: an actual character
107980 position for '.', or an assumed position for 'V'.
107981
107982 14
107983 A sign control Character in the picture String affects the form of the
107984 sign in the edited output string. The '<' and '>' Character values
107985 indicate parentheses for negative values. A Character '+', '-', or '<'
107986 appears either singly, signifying a fixed-position sign in the edited
107987 output, or repeated, signifying a floating-position sign that is
107988 preceded by zero or more space characters and that replaces a leading 0.
107989
107990 15
107991 A currency control Character in the picture String indicates an
107992 occurrence of the currency string in the edited output string. The '$'
107993 Character represents the complete currency string; the '#' Character
107994 represents one character of the currency string. A '$' Character
107995 appears either singly, indicating a fixed-position currency string in
107996 the edited output, or repeated, indicating a floating-position currency
107997 string that occurs in place of a leading 0. A sequence of '#' Character
107998 values indicates either a fixed- or floating-position currency string,
107999 depending on context.
108000
108001 16
108002 A zero suppression Character in the picture String allows a leading zero
108003 to be replaced by either the space character (for 'Z') or the fill
108004 character (for '*').
108005
108006 17
108007 A simple insertion Character in the picture String represents, in
108008 general, either itself (if '/' or '0'), the space character (if 'B'), or
108009 the digits group separator character (if '_'). In some contexts it is
108010 treated as part of a floating sign, floating currency, or zero
108011 suppression string.
108012
108013 18/2
108014 {AI95-00434-01AI95-00434-01} An example of a picture String is
108015 "<###Z_ZZ9.99>". If the currency string is "kr", the separator
108016 character is ',', and the radix mark is '.' then the edited output
108017 string values for the decimal values 32.10 and -5432.10 are
108018 "bbkrbbb32.10b" and "(bkr5,432.10)", respectively, where 'b' indicates
108019 the space character.
108020
108021 19/2
108022 {AI95-00285-01AI95-00285-01} The generic packages Text_IO.Decimal_IO,
108023 Wide_Text_IO.Decimal_IO, and Wide_Wide_Text_IO.Decimal_IO (see *note
108024 A.10.9::, "*note A.10.9:: Input-Output for Real Types") provide text
108025 input and nonedited text output for decimal types.
108026
108027 NOTES
108028
108029 20/2
108030 2 {AI95-00285-01AI95-00285-01} A picture String is of type
108031 Standard.String, for all of Text_IO.Editing, Wide_Text_IO.Editing,
108032 and Wide_Wide_Text_IO.Editing.
108033
108034 _Wording Changes from Ada 95_
108035
108036 20.a/2
108037 {AI95-00285-01AI95-00285-01} Added descriptions of
108038 Wide_Wide_Text_IO.Editing; see *note F.3.5::.
108039
108040 * Menu:
108041
108042 * F.3.1 :: Picture String Formation
108043 * F.3.2 :: Edited Output Generation
108044 * F.3.3 :: The Package Text_IO.Editing
108045 * F.3.4 :: The Package Wide_Text_IO.Editing
108046 * F.3.5 :: The Package Wide_Wide_Text_IO.Editing
108047
108048 \1f
108049 File: aarm2012.info, Node: F.3.1, Next: F.3.2, Up: F.3
108050
108051 F.3.1 Picture String Formation
108052 ------------------------------
108053
108054 1/3
108055 {AI05-0299-1AI05-0299-1} A well-formed picture String, or simply picture
108056 String, is a String value that conforms to the syntactic rules,
108057 composition constraints, and character replication conventions specified
108058 in this subclause.
108059
108060 _Dynamic Semantics_
108061
108062 2/1
108063 This paragraph was deleted.
108064
108065 3
108066 picture_string ::=
108067 fixed_$_picture_string
108068 | fixed_#_picture_string
108069 | floating_currency_picture_string
108070 | non_currency_picture_string
108071
108072 4
108073 fixed_$_picture_string ::=
108074 [fixed_LHS_sign] fixed_$_char {direct_insertion} [zero_suppression]
108075 number [RHS_sign]
108076
108077 | [fixed_LHS_sign {direct_insertion}] [zero_suppression]
108078 number fixed_$_char {direct_insertion} [RHS_sign]
108079
108080 | floating_LHS_sign number fixed_$_char {direct_insertion} [RHS_sign]
108081
108082 | [fixed_LHS_sign] fixed_$_char {direct_insertion}
108083 all_zero_suppression_number {direct_insertion} [RHS_sign]
108084
108085 | [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
108086 fixed_$_char {direct_insertion} [RHS_sign]
108087
108088 | all_sign_number {direct_insertion} fixed_$_char {direct_insertion} [RHS_sign]
108089
108090 5
108091 fixed_#_picture_string ::=
108092 [fixed_LHS_sign] single_#_currency {direct_insertion}
108093 [zero_suppression] number [RHS_sign]
108094
108095 | [fixed_LHS_sign] multiple_#_currency {direct_insertion}
108096 zero_suppression number [RHS_sign]
108097
108098 | [fixed_LHS_sign {direct_insertion}] [zero_suppression]
108099 number fixed_#_currency {direct_insertion} [RHS_sign]
108100
108101 | floating_LHS_sign number fixed_#_currency {direct_insertion} [RHS_sign]
108102
108103 | [fixed_LHS_sign] single_#_currency {direct_insertion}
108104 all_zero_suppression_number {direct_insertion} [RHS_sign]
108105
108106 | [fixed_LHS_sign] multiple_#_currency {direct_insertion}
108107 all_zero_suppression_number {direct_insertion} [RHS_sign]
108108
108109 | [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
108110 fixed_#_currency {direct_insertion} [RHS_sign]
108111
108112 | all_sign_number {direct_insertion} fixed_#_currency {direct_insertion} [RHS_sign]
108113
108114 6
108115 floating_currency_picture_string ::=
108116 [fixed_LHS_sign] {direct_insertion} floating_$_currency number [RHS_sign]
108117 | [fixed_LHS_sign] {direct_insertion} floating_#_currency number [RHS_sign]
108118 | [fixed_LHS_sign] {direct_insertion} all_currency_number {direct_insertion} [RHS_sign]
108119
108120 7
108121 non_currency_picture_string ::=
108122 [fixed_LHS_sign {direct_insertion}] zero_suppression number [RHS_sign]
108123 | [floating_LHS_sign] number [RHS_sign]
108124 | [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
108125 [RHS_sign]
108126 | all_sign_number {direct_insertion}
108127 | fixed_LHS_sign direct_insertion {direct_insertion} number [RHS_sign]
108128
108129 8
108130 fixed_LHS_sign ::= LHS_Sign
108131
108132 9
108133 LHS_Sign ::= + | - | <
108134
108135 10
108136 fixed_$_char ::= $
108137
108138 11
108139 direct_insertion ::= simple_insertion
108140
108141 12
108142 simple_insertion ::= _ | B | 0 | /
108143
108144 13
108145 zero_suppression ::= Z {Z | context_sensitive_insertion} | fill_string
108146
108147 14
108148 context_sensitive_insertion ::= simple_insertion
108149
108150 15
108151 fill_string ::= * {* | context_sensitive_insertion}
108152
108153 16
108154 number ::=
108155 fore_digits [radix [aft_digits] {direct_insertion}]
108156 | radix aft_digits {direct_insertion}
108157
108158 17
108159 fore_digits ::= 9 {9 | direct_insertion}
108160
108161 18
108162 aft_digits ::= {9 | direct_insertion} 9
108163
108164 19
108165 radix ::= . | V
108166
108167 20
108168 RHS_sign ::= + | - | > | CR | DB
108169
108170 21
108171 floating_LHS_sign ::=
108172 LHS_Sign {context_sensitive_insertion} LHS_Sign {LHS_Sign | context_sensitive_insertion}
108173
108174 22
108175 single_#_currency ::= #
108176
108177 23
108178 multiple_#_currency ::= ## {#}
108179
108180 24
108181 fixed_#_currency ::= single_#_currency | multiple_#_currency
108182
108183 25
108184 floating_$_currency ::=
108185 $ {context_sensitive_insertion} $ {$ | context_sensitive_insertion}
108186
108187 26
108188 floating_#_currency ::=
108189 # {context_sensitive_insertion} # {# | context_sensitive_insertion}
108190
108191 27
108192 all_sign_number ::= all_sign_fore [radix [all_sign_aft]] [>]
108193
108194 28
108195 all_sign_fore ::=
108196 sign_char {context_sensitive_insertion} sign_char {sign_char | context_sensitive_insertion}
108197
108198 29
108199 all_sign_aft ::= {all_sign_aft_char} sign_char
108200
108201 all_sign_aft_char ::= sign_char | context_sensitive_insertion
108202
108203 30
108204 sign_char ::= + | - | <
108205
108206 31
108207 all_currency_number ::= all_currency_fore [radix [all_currency_aft]]
108208
108209 32
108210 all_currency_fore ::=
108211 currency_char {context_sensitive_insertion}
108212 currency_char {currency_char | context_sensitive_insertion}
108213
108214 33
108215 all_currency_aft ::= {all_currency_aft_char} currency_char
108216
108217 all_currency_aft_char ::= currency_char | context_sensitive_insertion
108218
108219 34
108220 currency_char ::= $ | #
108221
108222 35
108223 all_zero_suppression_number ::= all_zero_suppression_fore [ radix [all_zero_suppression_aft]]
108224
108225 36
108226 all_zero_suppression_fore ::=
108227 zero_suppression_char {zero_suppression_char | context_sensitive_insertion}
108228
108229 37
108230 all_zero_suppression_aft ::= {all_zero_suppression_aft_char} zero_suppression_char
108231
108232 all_zero_suppression_aft_char ::= zero_suppression_char | context_sensitive_insertion
108233
108234 38
108235 zero_suppression_char ::= Z | *
108236
108237 39
108238 The following composition constraints apply to a picture String:
108239
108240 40
108241 * A floating_LHS_sign does not have occurrences of different LHS_Sign
108242 Character values.
108243
108244 41
108245 * If a picture String has '<' as fixed_LHS_sign, then it has '>' as
108246 RHS_sign.
108247
108248 42
108249 * If a picture String has '<' in a floating_LHS_sign or in an
108250 all_sign_number, then it has an occurrence of '>'.
108251
108252 43/1
108253 * {8652/00888652/0088} {AI95-00153AI95-00153} If a picture String has
108254 '+' or '-' as fixed_LHS_sign, in a floating_LHS_sign, or in an
108255 all_sign_number, then it has no RHS_sign or '>' character.
108256
108257 44
108258 * An instance of all_sign_number does not have occurrences of
108259 different sign_char Character values.
108260
108261 45
108262 * An instance of all_currency_number does not have occurrences of
108263 different currency_char Character values.
108264
108265 46
108266 * An instance of all_zero_suppression_number does not have
108267 occurrences of different zero_suppression_char Character values,
108268 except for possible case differences between 'Z' and 'z'.
108269
108270 47
108271 A replicable Character is a Character that, by the above rules, can
108272 occur in two consecutive positions in a picture String.
108273
108274 48
108275 A Character replication is a String
108276
108277 49
108278 char & '(' & spaces & count_string & ')'
108279
108280 50
108281 where char is a replicable Character, spaces is a String (possibly
108282 empty) comprising only space Character values, and count_string is a
108283 String of one or more decimal digit Character values. A Character
108284 replication in a picture String has the same effect as (and is said to
108285 be equivalent to) a String comprising n consecutive occurrences of char,
108286 where n=Integer'Value(count_string).
108287
108288 51
108289 An expanded picture String is a picture String containing no Character
108290 replications.
108291
108292 51.a
108293 Discussion: Since 'B' is not allowed after a RHS sign, there
108294 is no need for a special rule to disallow "9.99DB(2)" as an
108295 abbreviation for "9.99DBB"
108296
108297 NOTES
108298
108299 52
108300 3 Although a sign to the left of the number can float, a sign to
108301 the right of the number is in a fixed position.
108302
108303 _Wording Changes from Ada 95_
108304
108305 52.a/2
108306 {8652/00888652/0088} {AI95-00153-01AI95-00153-01} Corrigendum:
108307 The picture string rules for numbers were tightened.
108308
108309 \1f
108310 File: aarm2012.info, Node: F.3.2, Next: F.3.3, Prev: F.3.1, Up: F.3
108311
108312 F.3.2 Edited Output Generation
108313 ------------------------------
108314
108315 _Dynamic Semantics_
108316
108317 1
108318 The contents of an edited output string are based on:
108319
108320 2
108321 * A value, Item, of some decimal type Num,
108322
108323 3
108324 * An expanded picture String Pic_String,
108325
108326 4
108327 * A Boolean value, Blank_When_Zero,
108328
108329 5
108330 * A Currency string,
108331
108332 6
108333 * A Fill character,
108334
108335 7
108336 * A Separator character, and
108337
108338 8
108339 * A Radix_Mark character.
108340
108341 9
108342 The combination of a True value for Blank_When_Zero and a '*' character
108343 in Pic_String is inconsistent; no edited output string is defined.
108344
108345 9.a/2
108346 Reason: {AI95-00114-01AI95-00114-01} Such a Pic_String is
108347 invalid, and any attempt to use such a string will raise
108348 Picture_Error.
108349
108350 10
108351 A layout error is identified in the rules below if leading nonzero
108352 digits of Item, character values of the Currency string, or a negative
108353 sign would be truncated; in such cases no edited output string is
108354 defined.
108355
108356 11
108357 The edited output string has lower bound 1 and upper bound N where N =
108358 Pic_String'Length + Currency_Length_Adjustment - Radix_Adjustment, and
108359
108360 12
108361 * Currency_Length_Adjustment = Currency'Length - 1 if there is some
108362 occurrence of '$' in Pic_String, and 0 otherwise.
108363
108364 13
108365 * Radix_Adjustment = 1 if there is an occurrence of 'V' or 'v' in
108366 Pic_Str, and 0 otherwise.
108367
108368 14
108369 Let the magnitude of Item be expressed as a base-10 number
108370 Ip···I1.F1···Fq, called the displayed magnitude of Item, where:
108371
108372 15
108373 * q = Min(Max(Num'Scale, 0), n) where n is 0 if Pic_String has no
108374 radix and is otherwise the number of digit positions following
108375 radix in Pic_String, where a digit position corresponds to an
108376 occurrence of '9', a zero_suppression_char (for an
108377 all_zero_suppression_number), a currency_char (for an
108378 all_currency_number), or a sign_char (for an all_sign_number).
108379
108380 16
108381 * Ip /= 0 if p>0.
108382
108383 17
108384 If n < Num'Scale, then the above number is the result of rounding (away
108385 from 0 if exactly midway between values).
108386
108387 18
108388 If Blank_When_Zero = True and the displayed magnitude of Item is zero,
108389 then the edited output string comprises all space character values.
108390 Otherwise, the picture String is treated as a sequence of instances of
108391 syntactic categories based on the rules in *note F.3.1::, and the edited
108392 output string is the concatenation of string values derived from these
108393 categories according to the following mapping rules.
108394
108395 19
108396 Table F-1 shows the mapping from a sign control symbol to a
108397 corresponding character or string in the edited output. In the columns
108398 showing the edited output, a lower-case 'b' represents the space
108399 character. If there is no sign control symbol but the value of Item is
108400 negative, a layout error occurs and no edited output string is produced.
108401
108402 Table F-1: Edited Output for Sign Control Symbols
108403 Sign Control Symbol Edited Output for Edited Output for
108404 Nonnegative Number Negative Number
108405 '+' '+' '-'
108406 '-' 'b' '-'
108407 '<' 'b' '('
108408 '>' 'b' ')'
108409 "CR" "bb" "CR"
108410 "DB" "bb" "DB"
108411 20
108412 An instance of fixed_LHS_sign maps to a character as shown in Table F-1.
108413
108414 21
108415 An instance of fixed_$_char maps to Currency.
108416
108417 22
108418 An instance of direct_insertion maps to Separator if direct_insertion =
108419 '_', and to the direct_insertion Character otherwise.
108420
108421 23
108422 An instance of number maps to a string integer_part & radix_part &
108423 fraction_part where:
108424
108425 24
108426 * The string for integer_part is obtained as follows:
108427
108428 25
108429 1. Occurrences of '9' in fore_digits of number are replaced
108430 from right to left with the decimal digit character values for
108431 I1, ..., Ip, respectively.
108432
108433 26
108434 2. Each occurrence of '9' in fore_digits to the left of the
108435 leftmost '9' replaced according to rule 1 is replaced with
108436 '0'.
108437
108438 27
108439 3. If p exceeds the number of occurrences of '9' in
108440 fore_digits of number, then the excess leftmost digits are
108441 eligible for use in the mapping of an instance of
108442 zero_suppression, floating_LHS_sign, floating_$_currency, or
108443 floating_#_currency to the left of number; if there is no such
108444 instance, then a layout error occurs and no edited output
108445 string is produced.
108446
108447 28
108448 * The radix_part is:
108449
108450 29
108451 * "" if number does not include a radix, if radix = 'V', or
108452 if radix = 'v'
108453
108454 30
108455 * Radix_Mark if number includes '.' as radix
108456
108457 31
108458 * The string for fraction_part is obtained as follows:
108459
108460 32
108461 1. Occurrences of '9' in aft_digits of number are replaced
108462 from left to right with the decimal digit character values for
108463 F1, ... Fq.
108464
108465 33
108466 2. Each occurrence of '9' in aft_digits to the right of the
108467 rightmost '9' replaced according to rule 1 is replaced by '0'.
108468
108469 34
108470 An instance of zero_suppression maps to the string obtained as follows:
108471
108472 35
108473 1. The rightmost 'Z', 'z', or '*' Character values are replaced
108474 with the excess digits (if any) from the integer_part of the
108475 mapping of the number to the right of the zero_suppression
108476 instance,
108477
108478 36
108479 2. A context_sensitive_insertion Character is replaced as though
108480 it were a direct_insertion Character, if it occurs to the right of
108481 some 'Z', 'z', or '*' in zero_suppression that has been mapped to
108482 an excess digit,
108483
108484 37
108485 3. Each Character to the left of the leftmost Character replaced
108486 according to rule 1 above is replaced by:
108487
108488 38
108489 * the space character if the zero suppression Character is
108490 'Z' or 'z', or
108491
108492 39
108493 * the Fill character if the zero suppression Character is
108494 '*'.
108495
108496 40
108497 4. A layout error occurs if some excess digits remain after all
108498 'Z', 'z', and '*' Character values in zero_suppression have been
108499 replaced via rule 1; no edited output string is produced.
108500
108501 41
108502 An instance of RHS_sign maps to a character or string as shown in Table
108503 F-1.
108504
108505 42
108506 An instance of floating_LHS_sign maps to the string obtained as follows.
108507
108508 43
108509 1. Up to all but one of the rightmost LHS_Sign Character values
108510 are replaced by the excess digits (if any) from the integer_part of
108511 the mapping of the number to the right of the floating_LHS_sign
108512 instance.
108513
108514 44
108515 2. The next Character to the left is replaced with the character
108516 given by the entry in Table F-1 corresponding to the LHS_Sign
108517 Character.
108518
108519 45
108520 3. A context_sensitive_insertion Character is replaced as though
108521 it were a direct_insertion Character, if it occurs to the right of
108522 the leftmost LHS_Sign character replaced according to rule 1.
108523
108524 46
108525 4. Any other Character is replaced by the space character..
108526
108527 47
108528 5. A layout error occurs if some excess digits remain after
108529 replacement via rule 1; no edited output string is produced.
108530
108531 48
108532 An instance of fixed_#_currency maps to the Currency string with n space
108533 character values concatenated on the left (if the instance does not
108534 follow a radix) or on the right (if the instance does follow a radix),
108535 where n is the difference between the length of the fixed_#_currency
108536 instance and Currency'Length. A layout error occurs if Currency'Length
108537 exceeds the length of the fixed_#_currency instance; no edited output
108538 string is produced.
108539
108540 49
108541 An instance of floating_$_currency maps to the string obtained as
108542 follows:
108543
108544 50
108545 1. Up to all but one of the rightmost '$' Character values are
108546 replaced with the excess digits (if any) from the integer_part of
108547 the mapping of the number to the right of the floating_$_currency
108548 instance.
108549
108550 51
108551 2. The next Character to the left is replaced by the Currency
108552 string.
108553
108554 52
108555 3. A context_sensitive_insertion Character is replaced as though
108556 it were a direct_insertion Character, if it occurs to the right of
108557 the leftmost '$' Character replaced via rule 1.
108558
108559 53
108560 4. Each other Character is replaced by the space character.
108561
108562 54
108563 5. A layout error occurs if some excess digits remain after
108564 replacement by rule 1; no edited output string is produced.
108565
108566 55
108567 An instance of floating_#_currency maps to the string obtained as
108568 follows:
108569
108570 56
108571 1. Up to all but one of the rightmost '#' Character values are
108572 replaced with the excess digits (if any) from the integer_part of
108573 the mapping of the number to the right of the floating_#_currency
108574 instance.
108575
108576 57
108577 2. The substring whose last Character occurs at the position
108578 immediately preceding the leftmost Character replaced via rule 1,
108579 and whose length is Currency'Length, is replaced by the Currency
108580 string.
108581
108582 58
108583 3. A context_sensitive_insertion Character is replaced as though
108584 it were a direct_insertion Character, if it occurs to the right of
108585 the leftmost '#' replaced via rule 1.
108586
108587 59
108588 4. Any other Character is replaced by the space character.
108589
108590 60
108591 5. A layout error occurs if some excess digits remain after
108592 replacement rule 1, or if there is no substring with the required
108593 length for replacement rule 2; no edited output string is produced.
108594
108595 61
108596 An instance of all_zero_suppression_number maps to:
108597
108598 62
108599 * a string of all spaces if the displayed magnitude of Item is zero,
108600 the zero_suppression_char is 'Z' or 'z', and the instance of
108601 all_zero_suppression_number does not have a radix at its last
108602 character position;
108603
108604 63
108605 * a string containing the Fill character in each position except for
108606 the character (if any) corresponding to radix, if
108607 zero_suppression_char = '*' and the displayed magnitude of Item is
108608 zero;
108609
108610 64
108611 * otherwise, the same result as if each zero_suppression_char in
108612 all_zero_suppression_aft were '9', interpreting the instance of
108613 all_zero_suppression_number as either zero_suppression number (if a
108614 radix and all_zero_suppression_aft are present), or as
108615 zero_suppression otherwise.
108616
108617 65
108618 An instance of all_sign_number maps to:
108619
108620 66
108621 * a string of all spaces if the displayed magnitude of Item is zero
108622 and the instance of all_sign_number does not have a radix at its
108623 last character position;
108624
108625 67
108626 * otherwise, the same result as if each sign_char in
108627 all_sign_number_aft were '9', interpreting the instance of
108628 all_sign_number as either floating_LHS_sign number (if a radix and
108629 all_sign_number_aft are present), or as floating_LHS_sign
108630 otherwise.
108631
108632 68
108633 An instance of all_currency_number maps to:
108634
108635 69
108636 * a string of all spaces if the displayed magnitude of Item is zero
108637 and the instance of all_currency_number does not have a radix at
108638 its last character position;
108639
108640 70
108641 * otherwise, the same result as if each currency_char in
108642 all_currency_number_aft were '9', interpreting the instance of
108643 all_currency_number as floating_$_currency number or
108644 floating_#_currency number (if a radix and all_currency_number_aft
108645 are present), or as floating_$_currency or floating_#_currency
108646 otherwise.
108647
108648 _Examples_
108649
108650 71
108651 In the result string values shown below, 'b' represents the space
108652 character.
108653
108654 72
108655 Item: Picture and Result Strings:
108656
108657 73/3
108658 {AI05-0248-1AI05-0248-1} 123456.78 Picture: "-###**_***_**9.99"
108659 Result: "bbb$***123,456.78"
108660 "bbFF***123.456,78" (currency = "FF",
108661 separator = '.',
108662 radix mark = ',')
108663
108664 74/1
108665 {8652/00898652/0089} {AI95-00070AI95-00070} 123456.78 Picture: "-$**_***_**9.99"
108666 Result: "b$***123,456.78"
108667 "bFF***123.456,78" (currency = "FF",
108668 separator = '.',
108669 radix mark = ',')
108670
108671 75
108672 0.0 Picture: "-$$$$$$.$$"
108673 Result: "bbbbbbbbbb"
108674
108675 76
108676 0.20 Picture: "-$$$$$$.$$"
108677 Result: "bbbbbb$.20"
108678
108679 77
108680 -1234.565 Picture: "<<<<_<<<.<<###>"
108681 Result: "bb(1,234.57DMb)" (currency = "DM")
108682
108683 78
108684 12345.67 Picture: "###_###_##9.99"
108685 Result: "bbCHF12,345.67" (currency = "CHF")
108686
108687 _Wording Changes from Ada 95_
108688
108689 78.a/2
108690 {8652/00898652/0089} {AI95-00070-01AI95-00070-01} Corrigendum:
108691 Corrected the picture string example.
108692
108693 \1f
108694 File: aarm2012.info, Node: F.3.3, Next: F.3.4, Prev: F.3.2, Up: F.3
108695
108696 F.3.3 The Package Text_IO.Editing
108697 ---------------------------------
108698
108699 1
108700 The package Text_IO.Editing provides a private type Picture with
108701 associated operations, and a generic package Decimal_Output. An object
108702 of type Picture is composed from a well-formed picture String (see *note
108703 F.3.1::) and a Boolean item indicating whether a zero numeric value will
108704 result in an edited output string of all space characters. The package
108705 Decimal_Output contains edited output subprograms implementing the
108706 effects defined in *note F.3.2::.
108707
108708 _Static Semantics_
108709
108710 2
108711 The library package Text_IO.Editing has the following declaration:
108712
108713 3
108714 package Ada.Text_IO.Editing is
108715
108716 4
108717 type Picture is private;
108718
108719 5
108720 function Valid (Pic_String : in String;
108721 Blank_When_Zero : in Boolean := False) return Boolean;
108722
108723 6
108724 function To_Picture (Pic_String : in String;
108725 Blank_When_Zero : in Boolean := False)
108726 return Picture;
108727
108728 7
108729 function Pic_String (Pic : in Picture) return String;
108730 function Blank_When_Zero (Pic : in Picture) return Boolean;
108731
108732 8
108733 Max_Picture_Length : constant := implementation_defined;
108734
108735 9
108736 Picture_Error : exception;
108737
108738 10
108739 Default_Currency : constant String := "$";
108740 Default_Fill : constant Character := '*';
108741 Default_Separator : constant Character := ',';
108742 Default_Radix_Mark : constant Character := '.';
108743
108744 11
108745 generic
108746 type Num is delta <> digits <>;
108747 Default_Currency : in String := Text_IO.Editing.Default_Currency;
108748 Default_Fill : in Character := Text_IO.Editing.Default_Fill;
108749 Default_Separator : in Character :=
108750 Text_IO.Editing.Default_Separator;
108751 Default_Radix_Mark : in Character :=
108752 Text_IO.Editing.Default_Radix_Mark;
108753 package Decimal_Output is
108754 function Length (Pic : in Picture;
108755 Currency : in String := Default_Currency)
108756 return Natural;
108757
108758 12
108759 function Valid (Item : in Num;
108760 Pic : in Picture;
108761 Currency : in String := Default_Currency)
108762 return Boolean;
108763
108764 13
108765 function Image (Item : in Num;
108766 Pic : in Picture;
108767 Currency : in String := Default_Currency;
108768 Fill : in Character := Default_Fill;
108769 Separator : in Character := Default_Separator;
108770 Radix_Mark : in Character := Default_Radix_Mark)
108771 return String;
108772
108773 14
108774 procedure Put (File : in File_Type;
108775 Item : in Num;
108776 Pic : in Picture;
108777 Currency : in String := Default_Currency;
108778 Fill : in Character := Default_Fill;
108779 Separator : in Character := Default_Separator;
108780 Radix_Mark : in Character := Default_Radix_Mark);
108781
108782 15
108783 procedure Put (Item : in Num;
108784 Pic : in Picture;
108785 Currency : in String := Default_Currency;
108786 Fill : in Character := Default_Fill;
108787 Separator : in Character := Default_Separator;
108788 Radix_Mark : in Character := Default_Radix_Mark);
108789
108790 16
108791 procedure Put (To : out String;
108792 Item : in Num;
108793 Pic : in Picture;
108794 Currency : in String := Default_Currency;
108795 Fill : in Character := Default_Fill;
108796 Separator : in Character := Default_Separator;
108797 Radix_Mark : in Character := Default_Radix_Mark);
108798 end Decimal_Output;
108799 private
108800 ... -- not specified by the language
108801 end Ada.Text_IO.Editing;
108802
108803 16.a
108804 Implementation defined: The value of Max_Picture_Length in the
108805 package Text_IO.Editing
108806
108807 17
108808 The exception Constraint_Error is raised if the Image function or any of
108809 the Put procedures is invoked with a null string for Currency.
108810
108811 18
108812 function Valid (Pic_String : in String;
108813 Blank_When_Zero : in Boolean := False) return Boolean;
108814
108815 19
108816 Valid returns True if Pic_String is a well-formed picture
108817 String (see *note F.3.1::) the length of whose expansion does
108818 not exceed Max_Picture_Length, and if either Blank_When_Zero
108819 is False or Pic_String contains no '*'.
108820
108821 20
108822 function To_Picture (Pic_String : in String;
108823 Blank_When_Zero : in Boolean := False)
108824 return Picture;
108825
108826 21
108827 To_Picture returns a result Picture such that the application
108828 of the function Pic_String to this result yields an expanded
108829 picture String equivalent to Pic_String, and such that
108830 Blank_When_Zero applied to the result Picture is the same
108831 value as the parameter Blank_When_Zero. Picture_Error is
108832 raised if not Valid(Pic_String, Blank_When_Zero).
108833
108834 22
108835 function Pic_String (Pic : in Picture) return String;
108836
108837 function Blank_When_Zero (Pic : in Picture) return Boolean;
108838
108839 23
108840 If Pic is To_Picture(String_Item, Boolean_Item) for some
108841 String_Item and Boolean_Item, then:
108842
108843 24
108844 * Pic_String(Pic) returns an expanded picture String
108845 equivalent to String_Item and with any lower-case letter
108846 replaced with its corresponding upper-case form, and
108847
108848 25
108849 * Blank_When_Zero(Pic) returns Boolean_Item.
108850
108851 26
108852 If Pic_1 and Pic_2 are objects of type Picture, then
108853 "="(Pic_1, Pic_2) is True when
108854
108855 27
108856 * Pic_String(Pic_1) = Pic_String(Pic_2), and
108857
108858 28
108859 * Blank_When_Zero(Pic_1) = Blank_When_Zero(Pic_2).
108860
108861 29
108862 function Length (Pic : in Picture;
108863 Currency : in String := Default_Currency)
108864 return Natural;
108865
108866 30
108867 Length returns Pic_String(Pic)'Length +
108868 Currency_Length_Adjustment - Radix_Adjustment where
108869
108870 31
108871 * Currency_Length_Adjustment =
108872
108873 32
108874 * Currency'Length - 1 if there is some occurrence
108875 of '$' in Pic_String(Pic), and
108876
108877 33
108878 * 0 otherwise.
108879
108880 34
108881 * Radix_Adjustment =
108882
108883 35
108884 * 1 if there is an occurrence of 'V' or 'v' in
108885 Pic_Str(Pic), and
108886
108887 36
108888 * 0 otherwise.
108889
108890 37
108891 function Valid (Item : in Num;
108892 Pic : in Picture;
108893 Currency : in String := Default_Currency)
108894 return Boolean;
108895
108896 38
108897 Valid returns True if Image(Item, Pic, Currency) does not
108898 raise Layout_Error, and returns False otherwise.
108899
108900 39
108901 function Image (Item : in Num;
108902 Pic : in Picture;
108903 Currency : in String := Default_Currency;
108904 Fill : in Character := Default_Fill;
108905 Separator : in Character := Default_Separator;
108906 Radix_Mark : in Character := Default_Radix_Mark)
108907 return String;
108908
108909 40
108910 Image returns the edited output String as defined in *note
108911 F.3.2:: for Item, Pic_String(Pic), Blank_When_Zero(Pic),
108912 Currency, Fill, Separator, and Radix_Mark. If these rules
108913 identify a layout error, then Image raises the exception
108914 Layout_Error.
108915
108916 41
108917 procedure Put (File : in File_Type;
108918 Item : in Num;
108919 Pic : in Picture;
108920 Currency : in String := Default_Currency;
108921 Fill : in Character := Default_Fill;
108922 Separator : in Character := Default_Separator;
108923 Radix_Mark : in Character := Default_Radix_Mark);
108924
108925 procedure Put (Item : in Num;
108926 Pic : in Picture;
108927 Currency : in String := Default_Currency;
108928 Fill : in Character := Default_Fill;
108929 Separator : in Character := Default_Separator;
108930 Radix_Mark : in Character := Default_Radix_Mark);
108931
108932 42
108933 Each of these Put procedures outputs Image(Item, Pic,
108934 Currency, Fill, Separator, Radix_Mark) consistent with the
108935 conventions for Put for other real types in case of bounded
108936 line length (see *note A.10.6::, "*note A.10.6:: Get and Put
108937 Procedures").
108938
108939 43
108940 procedure Put (To : out String;
108941 Item : in Num;
108942 Pic : in Picture;
108943 Currency : in String := Default_Currency;
108944 Fill : in Character := Default_Fill;
108945 Separator : in Character := Default_Separator;
108946 Radix_Mark : in Character := Default_Radix_Mark);
108947
108948 44/3
108949 {AI05-0264-1AI05-0264-1} Put copies Image(Item, Pic, Currency,
108950 Fill, Separator, Radix_Mark) to the given string, right
108951 justified. Otherwise, unassigned Character values in To are
108952 assigned the space character. If To'Length is less than the
108953 length of the string resulting from Image, then Layout_Error
108954 is raised.
108955
108956 _Implementation Requirements_
108957
108958 45
108959 Max_Picture_Length shall be at least 30. The implementation shall
108960 support currency strings of length up to at least 10, both for
108961 Default_Currency in an instantiation of Decimal_Output, and for Currency
108962 in an invocation of Image or any of the Put procedures.
108963
108964 45.a
108965 Discussion: This implies that a picture string with character
108966 replications need not be supported (i.e., To_Picture will
108967 raise Picture_Error) if its expanded form exceeds 30
108968 characters.
108969
108970 NOTES
108971
108972 46
108973 4 The rules for edited output are based on COBOL (ANSI X3.23:1985,
108974 endorsed by ISO as ISO 1989-1985), with the following differences:
108975
108976 47
108977 * The COBOL provisions for picture string localization and for
108978 'P' format are absent from Ada.
108979
108980 48
108981 * The following Ada facilities are not in COBOL:
108982
108983 49
108984 * currency symbol placement after the number,
108985
108986 50
108987 * localization of edited output string for
108988 multi-character currency string values, including
108989 support for both length-preserving and
108990 length-expanding currency symbols in picture strings
108991
108992 51
108993 * localization of the radix mark, digits separator,
108994 and fill character, and
108995
108996 52
108997 * parenthesization of negative values.
108998
108999 52.1
109000 The value of 30 for Max_Picture_Length is the same limit as in
109001 COBOL.
109002
109003 52.a
109004 Reason: There are several reasons we have not adopted the
109005 COBOL-style permission to provide a single-character
109006 replacement in the picture string for the '$' as currency
109007 symbol, or to interchange the roles of '.' and ',' in picture
109008 strings
109009
109010 52.b
109011 * It would have introduced considerable complexity into
109012 Ada, as well as confusion between run-time and
109013 compile-time character interpretation, since picture
109014 Strings are dynamically computable in Ada, in contrast
109015 with COBOL
109016
109017 52.c
109018 * Ada's rules for real literals provide a natural
109019 interpretation of '_' as digits separator and '.' for
109020 radix mark; it is not essential to allow these to be
109021 localized in picture strings, since Ada does not allow
109022 them to be localized in real literals.
109023
109024 52.d
109025 * The COBOL restriction for the currency symbol in a
109026 picture string to be replaced by a single character
109027 currency symbol is a compromise solution. For general
109028 international usage a mechanism is needed to localize the
109029 edited output to be a multi-character currency string.
109030 Allowing a single-Character localization for the picture
109031 Character, and a multiple-character localization for the
109032 currency string, would be an unnecessary complication.
109033
109034 \1f
109035 File: aarm2012.info, Node: F.3.4, Next: F.3.5, Prev: F.3.3, Up: F.3
109036
109037 F.3.4 The Package Wide_Text_IO.Editing
109038 --------------------------------------
109039
109040 _Static Semantics_
109041
109042 1
109043 The child package Wide_Text_IO.Editing has the same contents as
109044 Text_IO.Editing, except that:
109045
109046 2
109047 * each occurrence of Character is replaced by Wide_Character,
109048
109049 3
109050 * each occurrence of Text_IO is replaced by Wide_Text_IO,
109051
109052 4
109053 * the subtype of Default_Currency is Wide_String rather than String,
109054 and
109055
109056 5
109057 * each occurrence of String in the generic package Decimal_Output is
109058 replaced by Wide_String.
109059
109060 5.a
109061 Implementation defined: The value of Max_Picture_Length in the
109062 package Wide_Text_IO.Editing
109063
109064 NOTES
109065
109066 6
109067 5 Each of the functions Wide_Text_IO.Editing.Valid, To_Picture,
109068 and Pic_String has String (versus Wide_String) as its parameter or
109069 result subtype, since a picture String is not localizable.
109070
109071 \1f
109072 File: aarm2012.info, Node: F.3.5, Prev: F.3.4, Up: F.3
109073
109074 F.3.5 The Package Wide_Wide_Text_IO.Editing
109075 -------------------------------------------
109076
109077 _Static Semantics_
109078
109079 1/2
109080 {AI95-00285-01AI95-00285-01} The child package Wide_Wide_Text_IO.Editing
109081 has the same contents as Text_IO.Editing, except that:
109082
109083 2/2
109084 * each occurrence of Character is replaced by Wide_Wide_Character,
109085
109086 3/2
109087 * each occurrence of Text_IO is replaced by Wide_Wide_Text_IO,
109088
109089 4/2
109090 * the subtype of Default_Currency is Wide_Wide_String rather than
109091 String, and
109092
109093 5/2
109094 * each occurrence of String in the generic package Decimal_Output is
109095 replaced by Wide_Wide_String.
109096
109097 5.a/2
109098 Implementation defined: The value of Max_Picture_Length in the
109099 package Wide_Wide_Text_IO.Editing
109100
109101 NOTES
109102
109103 6/2
109104 6 {AI95-00285-01AI95-00285-01} Each of the functions
109105 Wide_Wide_Text_IO.Editing.Valid, To_Picture, and Pic_String has
109106 String (versus Wide_Wide_String) as its parameter or result
109107 subtype, since a picture String is not localizable.
109108
109109 _Extensions to Ada 95_
109110
109111 6.a/2
109112 {AI95-00285-01AI95-00285-01} Package Wide_Wide_Text_IO.Editing
109113 is new; it supports 32-bit character strings. (Shouldn't it
109114 have been "Widest_Text_IO.Editing"? :-)
109115
109116 \1f
109117 File: aarm2012.info, Node: Annex G, Next: Annex H, Prev: Annex F, Up: Top
109118
109119 Annex G Numerics
109120 ****************
109121
109122 1
109123 The Numerics Annex specifies
109124
109125 2
109126 * features for complex arithmetic, including complex I/O;
109127
109128 3
109129 * a mode ("strict mode"), in which the predefined arithmetic
109130 operations of floating point and fixed point types and the
109131 functions and operations of various predefined packages have to
109132 provide guaranteed accuracy or conform to other numeric performance
109133 requirements, which the Numerics Annex also specifies;
109134
109135 4
109136 * a mode ("relaxed mode"), in which no accuracy or other numeric
109137 performance requirements need be satisfied, as for implementations
109138 not conforming to the Numerics Annex;
109139
109140 5/2
109141 * {AI95-00296-01AI95-00296-01} models of floating point and fixed
109142 point arithmetic on which the accuracy requirements of strict mode
109143 are based;
109144
109145 6/2
109146 * {AI95-00296-01AI95-00296-01} the definitions of the model-oriented
109147 attributes of floating point types that apply in the strict mode;
109148 and
109149
109150 6.1/2
109151 * {AI95-00296-01AI95-00296-01} features for the manipulation of real
109152 and complex vectors and matrices.
109153
109154 _Implementation Advice_
109155
109156 7/3
109157 {AI05-0229-1AI05-0229-1} If Fortran (respectively, C) is widely
109158 supported in the target environment, implementations supporting the
109159 Numerics Annex should provide the child package Interfaces.Fortran
109160 (respectively, Interfaces.C) specified in *note Annex B:: and should
109161 support a convention_identifier of Fortran (respectively, C) for the
109162 Convention aspect (see *note Annex B::), thus allowing Ada programs to
109163 interface with programs written in that language.
109164
109165 7.a.1/2
109166 Implementation Advice: If Fortran (respectively, C) is
109167 supported in the target environment, then interfacing to
109168 Fortran (respectively, C) should be supported as specified in
109169 *note Annex B::.
109170
109171 _Extensions to Ada 83_
109172
109173 7.a
109174 This Annex is new to Ada 95.
109175
109176 * Menu:
109177
109178 * G.1 :: Complex Arithmetic
109179 * G.2 :: Numeric Performance Requirements
109180 * G.3 :: Vector and Matrix Manipulation
109181
109182 \1f
109183 File: aarm2012.info, Node: G.1, Next: G.2, Up: Annex G
109184
109185 G.1 Complex Arithmetic
109186 ======================
109187
109188 1
109189 Types and arithmetic operations for complex arithmetic are provided in
109190 Generic_Complex_Types, which is defined in *note G.1.1::.
109191 Implementation-defined approximations to the complex analogs of the
109192 mathematical functions known as the "elementary functions" are provided
109193 by the subprograms in Generic_Complex_Elementary_Functions, which is
109194 defined in *note G.1.2::. Both of these library units are generic
109195 children of the predefined package Numerics (see *note A.5::).
109196 Nongeneric equivalents of these generic packages for each of the
109197 predefined floating point types are also provided as children of
109198 Numerics.
109199
109200 1.a
109201 Implementation defined: The accuracy actually achieved by the
109202 complex elementary functions and by other complex arithmetic
109203 operations.
109204
109205 1.b
109206 Discussion: Complex arithmetic is defined in the Numerics
109207 Annex, rather than in the core, because it is considered to be
109208 a specialized need of (some) numeric applications.
109209
109210 * Menu:
109211
109212 * G.1.1 :: Complex Types
109213 * G.1.2 :: Complex Elementary Functions
109214 * G.1.3 :: Complex Input-Output
109215 * G.1.4 :: The Package Wide_Text_IO.Complex_IO
109216 * G.1.5 :: The Package Wide_Wide_Text_IO.Complex_IO
109217
109218 \1f
109219 File: aarm2012.info, Node: G.1.1, Next: G.1.2, Up: G.1
109220
109221 G.1.1 Complex Types
109222 -------------------
109223
109224 _Static Semantics_
109225
109226 1
109227 The generic library package Numerics.Generic_Complex_Types has the
109228 following declaration:
109229
109230 2/1
109231 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} generic
109232 type Real is digits <>;
109233 package Ada.Numerics.Generic_Complex_Types is
109234 pragma Pure(Generic_Complex_Types);
109235
109236 3
109237 type Complex is
109238 record
109239 Re, Im : Real'Base;
109240 end record;
109241
109242 4/2
109243 {AI95-00161-01AI95-00161-01} type Imaginary is private;
109244 pragma Preelaborable_Initialization(Imaginary);
109245
109246 5
109247 i : constant Imaginary;
109248 j : constant Imaginary;
109249
109250 6
109251 function Re (X : Complex) return Real'Base;
109252 function Im (X : Complex) return Real'Base;
109253 function Im (X : Imaginary) return Real'Base;
109254
109255 7
109256 procedure Set_Re (X : in out Complex;
109257 Re : in Real'Base);
109258 procedure Set_Im (X : in out Complex;
109259 Im : in Real'Base);
109260 procedure Set_Im (X : out Imaginary;
109261 Im : in Real'Base);
109262
109263 8
109264 function Compose_From_Cartesian (Re, Im : Real'Base) return Complex;
109265 function Compose_From_Cartesian (Re : Real'Base) return Complex;
109266 function Compose_From_Cartesian (Im : Imaginary) return Complex;
109267
109268 9
109269 function Modulus (X : Complex) return Real'Base;
109270 function "abs" (Right : Complex) return Real'Base renames Modulus;
109271
109272 10
109273 function Argument (X : Complex) return Real'Base;
109274 function Argument (X : Complex;
109275 Cycle : Real'Base) return Real'Base;
109276
109277 11
109278 function Compose_From_Polar (Modulus, Argument : Real'Base)
109279 return Complex;
109280 function Compose_From_Polar (Modulus, Argument, Cycle : Real'Base)
109281 return Complex;
109282
109283 12
109284 function "+" (Right : Complex) return Complex;
109285 function "-" (Right : Complex) return Complex;
109286 function Conjugate (X : Complex) return Complex;
109287
109288 13
109289 function "+" (Left, Right : Complex) return Complex;
109290 function "-" (Left, Right : Complex) return Complex;
109291 function "*" (Left, Right : Complex) return Complex;
109292 function "/" (Left, Right : Complex) return Complex;
109293
109294 14
109295 function "**" (Left : Complex; Right : Integer) return Complex;
109296
109297 15
109298 function "+" (Right : Imaginary) return Imaginary;
109299 function "-" (Right : Imaginary) return Imaginary;
109300 function Conjugate (X : Imaginary) return Imaginary renames "-";
109301 function "abs" (Right : Imaginary) return Real'Base;
109302
109303 16
109304 function "+" (Left, Right : Imaginary) return Imaginary;
109305 function "-" (Left, Right : Imaginary) return Imaginary;
109306 function "*" (Left, Right : Imaginary) return Real'Base;
109307 function "/" (Left, Right : Imaginary) return Real'Base;
109308
109309 17
109310 function "**" (Left : Imaginary; Right : Integer) return Complex;
109311
109312 18
109313 function "<" (Left, Right : Imaginary) return Boolean;
109314 function "<=" (Left, Right : Imaginary) return Boolean;
109315 function ">" (Left, Right : Imaginary) return Boolean;
109316 function ">=" (Left, Right : Imaginary) return Boolean;
109317
109318 19
109319 function "+" (Left : Complex; Right : Real'Base) return Complex;
109320 function "+" (Left : Real'Base; Right : Complex) return Complex;
109321 function "-" (Left : Complex; Right : Real'Base) return Complex;
109322 function "-" (Left : Real'Base; Right : Complex) return Complex;
109323 function "*" (Left : Complex; Right : Real'Base) return Complex;
109324 function "*" (Left : Real'Base; Right : Complex) return Complex;
109325 function "/" (Left : Complex; Right : Real'Base) return Complex;
109326 function "/" (Left : Real'Base; Right : Complex) return Complex;
109327
109328 20
109329 function "+" (Left : Complex; Right : Imaginary) return Complex;
109330 function "+" (Left : Imaginary; Right : Complex) return Complex;
109331 function "-" (Left : Complex; Right : Imaginary) return Complex;
109332 function "-" (Left : Imaginary; Right : Complex) return Complex;
109333 function "*" (Left : Complex; Right : Imaginary) return Complex;
109334 function "*" (Left : Imaginary; Right : Complex) return Complex;
109335 function "/" (Left : Complex; Right : Imaginary) return Complex;
109336 function "/" (Left : Imaginary; Right : Complex) return Complex;
109337
109338 21
109339 function "+" (Left : Imaginary; Right : Real'Base) return Complex;
109340 function "+" (Left : Real'Base; Right : Imaginary) return Complex;
109341 function "-" (Left : Imaginary; Right : Real'Base) return Complex;
109342 function "-" (Left : Real'Base; Right : Imaginary) return Complex;
109343 function "*" (Left : Imaginary; Right : Real'Base) return Imaginary;
109344 function "*" (Left : Real'Base; Right : Imaginary) return Imaginary;
109345 function "/" (Left : Imaginary; Right : Real'Base) return Imaginary;
109346 function "/" (Left : Real'Base; Right : Imaginary) return Imaginary;
109347
109348 22
109349 private
109350
109351 23
109352 type Imaginary is new Real'Base;
109353 i : constant Imaginary := 1.0;
109354 j : constant Imaginary := 1.0;
109355
109356 24
109357 end Ada.Numerics.Generic_Complex_Types;
109358
109359 25/1
109360 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} The library package
109361 Numerics.Complex_Types is declared pure and defines the same types,
109362 constants, and subprograms as Numerics.Generic_Complex_Types, except
109363 that the predefined type Float is systematically substituted for
109364 Real'Base throughout. Nongeneric equivalents of
109365 Numerics.Generic_Complex_Types for each of the other predefined floating
109366 point types are defined similarly, with the names
109367 Numerics.Short_Complex_Types, Numerics.Long_Complex_Types, etc.
109368
109369 25.a
109370 Reason: The nongeneric equivalents are provided to allow the
109371 programmer to construct simple mathematical applications
109372 without being required to understand and use generics.
109373
109374 25.b
109375 Reason: The nongeneric equivalents all export the types
109376 Complex and Imaginary and the constants i and j (rather than
109377 uniquely named types and constants, such as Short_Complex,
109378 Long_Complex, etc.) to preserve their equivalence to actual
109379 instantiations of the generic package and to allow the
109380 programmer to change the precision of an application globally
109381 by changing a single context clause.
109382
109383 26/2
109384 {AI95-00434-01AI95-00434-01} [Complex is a visible type with Cartesian
109385 components.]
109386
109387 26.a
109388 Reason: The Cartesian representation is far more common than
109389 the polar representation, in practice. The accuracy of the
109390 results of the complex arithmetic operations and of the
109391 complex elementary functions is dependent on the
109392 representation; thus, implementers need to know that
109393 representation. The type is visible so that complex
109394 "literals" can be written in aggregate notation, if desired.
109395
109396 27
109397 [Imaginary is a private type; its full type is derived from Real'Base.]
109398
109399 27.a
109400 Reason: The Imaginary type and the constants i and j are
109401 provided for two reasons:
109402
109403 27.b
109404 * They allow complex "literals" to be written in the
109405 alternate form of a + b*i (or a + b*j), if desired. Of
109406 course, in some contexts the sum will need to be
109407 parenthesized.
109408
109409 27.c
109410 * When an Ada binding to IEC 559:1989 that provides
109411 (signed) infinities as the result of operations that
109412 overflow becomes available, it will be important to allow
109413 arithmetic between pure-imaginary and complex operands
109414 without requiring the former to be represented as (or
109415 promoted to) complex values with a real component of
109416 zero. For example, the multiplication of a + b*i by d*i
109417 should yield -b· d + a· d*i, but if one cannot avoid
109418 representing the pure-imaginary value d*i as the complex
109419 value 0.0 + d*i, then a NaN ("Not-a-Number") could be
109420 produced as the result of multiplying a by 0.0 (e.g.,
109421 when a is infinite); the NaN could later trigger an
109422 exception. Providing the Imaginary type and overloadings
109423 of the arithmetic operators for mixtures of Imaginary and
109424 Complex operands gives the programmer the same control
109425 over avoiding premature coercion of pure-imaginary values
109426 to complex as is already provided for pure-real values.
109427
109428 27.d
109429 Reason: The Imaginary type is private, rather than being
109430 visibly derived from Real'Base, for two reasons:
109431
109432 27.e
109433 * to preclude implicit conversions of real literals to the
109434 Imaginary type (such implicit conversions would make many
109435 common arithmetic expressions ambiguous); and
109436
109437 27.f
109438 * to suppress the implicit derivation of the
109439 multiplication, division, and absolute value operators
109440 with Imaginary operands and an Imaginary result (the
109441 result type would be incorrect).
109442
109443 27.g
109444 Reason: The base subtype Real'Base is used for the component
109445 type of Complex, the parent type of Imaginary, and the
109446 parameter and result types of some of the subprograms to
109447 maximize the chances of being able to pass meaningful values
109448 into the subprograms and receive meaningful results back. The
109449 generic formal parameter Real therefore plays only one role,
109450 that of providing the precision to be maintained in complex
109451 arithmetic calculations. Thus, the subprograms in
109452 Numerics.Generic_Complex_Types share with those in
109453 Numerics.Generic_Elementary_Functions, and indeed even with
109454 the predefined arithmetic operations (see *note 4.5::), the
109455 property of being free of range checks on input and output,
109456 i.e., of being able to exploit the base range of the relevant
109457 floating point type fully. As a result, the user loses the
109458 ability to impose application-oriented bounds on the range of
109459 values that the components of a complex variable can acquire;
109460 however, it can be argued that few, if any, applications have
109461 a naturally square domain (as opposed to a circular domain)
109462 anyway.
109463
109464 28
109465 The arithmetic operations and the Re, Im, Modulus, Argument, and
109466 Conjugate functions have their usual mathematical meanings. When
109467 applied to a parameter of pure-imaginary type, the "imaginary-part"
109468 function Im yields the value of its parameter, as the corresponding real
109469 value. The remaining subprograms have the following meanings:
109470
109471 28.a
109472 Reason: The middle case can be understood by considering the
109473 parameter of pure-imaginary type to represent a complex value
109474 with a zero real part.
109475
109476 29
109477 * The Set_Re and Set_Im procedures replace the designated component
109478 of a complex parameter with the given real value; applied to a
109479 parameter of pure-imaginary type, the Set_Im procedure replaces the
109480 value of that parameter with the imaginary value corresponding to
109481 the given real value.
109482
109483 30
109484 * The Compose_From_Cartesian function constructs a complex value from
109485 the given real and imaginary components. If only one component is
109486 given, the other component is implicitly zero.
109487
109488 31
109489 * The Compose_From_Polar function constructs a complex value from the
109490 given modulus (radius) and argument (angle). When the value of the
109491 parameter Modulus is positive (resp., negative), the result is the
109492 complex value represented by the point in the complex plane lying
109493 at a distance from the origin given by the absolute value of
109494 Modulus and forming an angle measured counterclockwise from the
109495 positive (resp., negative) real axis given by the value of the
109496 parameter Argument.
109497
109498 32
109499 When the Cycle parameter is specified, the result of the Argument
109500 function and the parameter Argument of the Compose_From_Polar function
109501 are measured in units such that a full cycle of revolution has the given
109502 value; otherwise, they are measured in radians.
109503
109504 33
109505 The computed results of the mathematically multivalued functions are
109506 rendered single-valued by the following conventions, which are meant to
109507 imply the principal branch:
109508
109509 34
109510 * The result of the Modulus function is nonnegative.
109511
109512 35
109513 * The result of the Argument function is in the quadrant containing
109514 the point in the complex plane represented by the parameter X. This
109515 may be any quadrant (I through IV); thus, the range of the Argument
109516 function is approximately -PI to PI (-Cycle/2.0 to Cycle/2.0, if
109517 the parameter Cycle is specified). When the point represented by
109518 the parameter X lies on the negative real axis, the result
109519 approximates
109520
109521 36
109522 * PI (resp., -PI) when the sign of the imaginary component
109523 of X is positive (resp., negative), if Real'Signed_Zeros
109524 is True;
109525
109526 37
109527 * PI, if Real'Signed_Zeros is False.
109528
109529 38
109530 * Because a result lying on or near one of the axes may not be
109531 exactly representable, the approximation inherent in computing the
109532 result may place it in an adjacent quadrant, close to but on the
109533 wrong side of the axis.
109534
109535 _Dynamic Semantics_
109536
109537 39
109538 The exception Numerics.Argument_Error is raised by the Argument and
109539 Compose_From_Polar functions with specified cycle, signaling a parameter
109540 value outside the domain of the corresponding mathematical function,
109541 when the value of the parameter Cycle is zero or negative.
109542
109543 40
109544 The exception Constraint_Error is raised by the division operator when
109545 the value of the right operand is zero, and by the exponentiation
109546 operator when the value of the left operand is zero and the value of the
109547 exponent is negative, provided that Real'Machine_Overflows is True; when
109548 Real'Machine_Overflows is False, the result is unspecified.
109549 [Constraint_Error can also be raised when a finite result overflows (see
109550 *note G.2.6::).]
109551
109552 40.a
109553 Discussion: It is anticipated that an Ada binding to IEC
109554 559:1989 will be developed in the future. As part of such a
109555 binding, the Machine_Overflows attribute of a conformant
109556 floating point type will be specified to yield False, which
109557 will permit implementations of the complex arithmetic
109558 operations to deliver results with an infinite component (and
109559 set the overflow flag defined by the binding) instead of
109560 raising Constraint_Error in overflow situations, when traps
109561 are disabled. Similarly, it is appropriate for the complex
109562 arithmetic operations to deliver results with infinite
109563 components (and set the zero-divide flag defined by the
109564 binding) instead of raising Constraint_Error in the situations
109565 defined above, when traps are disabled. Finally, such a
109566 binding should also specify the behavior of the complex
109567 arithmetic operations, when sensible, given operands with
109568 infinite components.
109569
109570 _Implementation Requirements_
109571
109572 41
109573 In the implementation of Numerics.Generic_Complex_Types, the range of
109574 intermediate values allowed during the calculation of a final result
109575 shall not be affected by any range constraint of the subtype Real.
109576
109577 41.a
109578 Implementation Note: Implementations of
109579 Numerics.Generic_Complex_Types written in Ada should therefore
109580 avoid declaring local variables of subtype Real; the subtype
109581 Real'Base should be used instead.
109582
109583 42
109584 In the following cases, evaluation of a complex arithmetic operation
109585 shall yield the prescribed result, provided that the preceding rules do
109586 not call for an exception to be raised:
109587
109588 43
109589 * The results of the Re, Im, and Compose_From_Cartesian functions are
109590 exact.
109591
109592 44
109593 * The real (resp., imaginary) component of the result of a binary
109594 addition operator that yields a result of complex type is exact
109595 when either of its operands is of pure-imaginary (resp., real)
109596 type.
109597
109598 44.a
109599 Ramification: The result of the addition operator is exact
109600 when one of its operands is of real type and the other is of
109601 pure-imaginary type. In this particular case, the operator is
109602 analogous to the Compose_From_Cartesian function; it performs
109603 no arithmetic.
109604
109605 45
109606 * The real (resp., imaginary) component of the result of a binary
109607 subtraction operator that yields a result of complex type is exact
109608 when its right operand is of pure-imaginary (resp., real) type.
109609
109610 46
109611 * The real component of the result of the Conjugate function for the
109612 complex type is exact.
109613
109614 47
109615 * When the point in the complex plane represented by the parameter X
109616 lies on the nonnegative real axis, the Argument function yields a
109617 result of zero.
109618
109619 47.a
109620 Discussion: Argument(X + i*Y) is analogous to EF.Arctan(Y, X),
109621 where EF is an appropriate instance of
109622 Numerics.Generic_Elementary_Functions, except when X and Y are
109623 both zero, in which case the former yields the value zero
109624 while the latter raises Numerics.Argument_Error.
109625
109626 48
109627 * When the value of the parameter Modulus is zero, the
109628 Compose_From_Polar function yields a result of zero.
109629
109630 49
109631 * When the value of the parameter Argument is equal to a multiple of
109632 the quarter cycle, the result of the Compose_From_Polar function
109633 with specified cycle lies on one of the axes. In this case, one of
109634 its components is zero, and the other has the magnitude of the
109635 parameter Modulus.
109636
109637 50
109638 * Exponentiation by a zero exponent yields the value one.
109639 Exponentiation by a unit exponent yields the value of the left
109640 operand. Exponentiation of the value one yields the value one.
109641 Exponentiation of the value zero yields the value zero, provided
109642 that the exponent is nonzero. When the left operand is of
109643 pure-imaginary type, one component of the result of the
109644 exponentiation operator is zero.
109645
109646 51
109647 When the result, or a result component, of any operator of
109648 Numerics.Generic_Complex_Types has a mathematical definition in terms of
109649 a single arithmetic or relational operation, that result or result
109650 component exhibits the accuracy of the corresponding operation of the
109651 type Real.
109652
109653 52
109654 Other accuracy requirements for the Modulus, Argument, and
109655 Compose_From_Polar functions, and accuracy requirements for the
109656 multiplication of a pair of complex operands or for division by a
109657 complex operand, all of which apply only in the strict mode, are given
109658 in *note G.2.6::.
109659
109660 53
109661 The sign of a zero result or zero result component yielded by a complex
109662 arithmetic operation or function is implementation defined when
109663 Real'Signed_Zeros is True.
109664
109665 53.a
109666 Implementation defined: The sign of a zero result (or a
109667 component thereof) from any operator or function in
109668 Numerics.Generic_Complex_Types, when Real'Signed_Zeros is
109669 True.
109670
109671 _Implementation Permissions_
109672
109673 54
109674 The nongeneric equivalent packages may, but need not, be actual
109675 instantiations of the generic package for the appropriate predefined
109676 type.
109677
109678 55/2
109679 {8652/00918652/0091} {AI95-00434-01AI95-00434-01} Implementations may
109680 obtain the result of exponentiation of a complex or pure-imaginary
109681 operand by repeated complex multiplication, with arbitrary association
109682 of the factors and with a possible final complex reciprocation (when the
109683 exponent is negative). Implementations are also permitted to obtain the
109684 result of exponentiation of a complex operand, but not of a
109685 pure-imaginary operand, by converting the left operand to a polar
109686 representation; exponentiating the modulus by the given exponent;
109687 multiplying the argument by the given exponent; and reconverting to a
109688 Cartesian representation. Because of this implementation freedom, no
109689 accuracy requirement is imposed on complex exponentiation (except for
109690 the prescribed results given above, which apply regardless of the
109691 implementation method chosen).
109692
109693 _Implementation Advice_
109694
109695 56
109696 Because the usual mathematical meaning of multiplication of a complex
109697 operand and a real operand is that of the scaling of both components of
109698 the former by the latter, an implementation should not perform this
109699 operation by first promoting the real operand to complex type and then
109700 performing a full complex multiplication. In systems that, in the
109701 future, support an Ada binding to IEC 559:1989, the latter technique
109702 will not generate the required result when one of the components of the
109703 complex operand is infinite. (Explicit multiplication of the infinite
109704 component by the zero component obtained during promotion yields a NaN
109705 that propagates into the final result.) Analogous advice applies in the
109706 case of multiplication of a complex operand and a pure-imaginary
109707 operand, and in the case of division of a complex operand by a real or
109708 pure-imaginary operand.
109709
109710 56.a/2
109711 Implementation Advice: Mixed real and complex operations (as
109712 well as pure-imaginary and complex operations) should not be
109713 performed by converting the real (resp. pure-imaginary)
109714 operand to complex.
109715
109716 57
109717 Likewise, because the usual mathematical meaning of addition of a
109718 complex operand and a real operand is that the imaginary operand remains
109719 unchanged, an implementation should not perform this operation by first
109720 promoting the real operand to complex type and then performing a full
109721 complex addition. In implementations in which the Signed_Zeros
109722 attribute of the component type is True (and which therefore conform to
109723 IEC 559:1989 in regard to the handling of the sign of zero in predefined
109724 arithmetic operations), the latter technique will not generate the
109725 required result when the imaginary component of the complex operand is a
109726 negatively signed zero. (Explicit addition of the negative zero to the
109727 zero obtained during promotion yields a positive zero.) Analogous
109728 advice applies in the case of addition of a complex operand and a
109729 pure-imaginary operand, and in the case of subtraction of a complex
109730 operand and a real or pure-imaginary operand.
109731
109732 58
109733 Implementations in which Real'Signed_Zeros is True should attempt to
109734 provide a rational treatment of the signs of zero results and result
109735 components. As one example, the result of the Argument function should
109736 have the sign of the imaginary component of the parameter X when the
109737 point represented by that parameter lies on the positive real axis; as
109738 another, the sign of the imaginary component of the Compose_From_Polar
109739 function should be the same as (resp., the opposite of) that of the
109740 Argument parameter when that parameter has a value of zero and the
109741 Modulus parameter has a nonnegative (resp., negative) value.
109742
109743 58.a.1/3
109744 Implementation Advice: If Real'Signed_Zeros is True for
109745 Numerics.Generic_Complex_Types, a rational treatment of the
109746 signs of zero results and result components should be
109747 provided.
109748
109749 _Wording Changes from Ada 83_
109750
109751 58.a
109752 The semantics of Numerics.Generic_Complex_Types differs from
109753 Generic_Complex_Types as defined in ISO/IEC CD 13813 (for Ada
109754 83) in the following ways:
109755
109756 58.b
109757 * The generic package is a child of the package defining
109758 the Argument_Error exception.
109759
109760 58.c
109761 * The nongeneric equivalents export types and constants
109762 with the same names as those exported by the generic
109763 package, rather than with names unique to the package.
109764
109765 58.d
109766 * Implementations are not allowed to impose an optional
109767 restriction that the generic actual parameter associated
109768 with Real be unconstrained. (In view of the ability to
109769 declare variables of subtype Real'Base in implementations
109770 of Numerics.Generic_Complex_Types, this flexibility is no
109771 longer needed.)
109772
109773 58.e
109774 * The dependence of the Argument function on the sign of a
109775 zero parameter component is tied to the value of
109776 Real'Signed_Zeros.
109777
109778 58.f
109779 * Conformance to accuracy requirements is conditional.
109780
109781 _Extensions to Ada 95_
109782
109783 58.g/2
109784 {AI95-00161-01AI95-00161-01} Amendment Correction: Added a
109785 pragma Preelaborable_Initialization to type Imaginary, so that
109786 it can be used in preelaborated units.
109787
109788 _Wording Changes from Ada 95_
109789
109790 58.h/2
109791 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} Corrigendum:
109792 Explicitly stated that the nongeneric equivalents of
109793 Generic_Complex_Types are pure.
109794
109795 \1f
109796 File: aarm2012.info, Node: G.1.2, Next: G.1.3, Prev: G.1.1, Up: G.1
109797
109798 G.1.2 Complex Elementary Functions
109799 ----------------------------------
109800
109801 _Static Semantics_
109802
109803 1
109804 The generic library package
109805 Numerics.Generic_Complex_Elementary_Functions has the following
109806 declaration:
109807
109808 2/2
109809 {AI95-00434-01AI95-00434-01} with Ada.Numerics.Generic_Complex_Types;
109810 generic
109811 with package Complex_Types is
109812 new Ada.Numerics.Generic_Complex_Types (<>);
109813 use Complex_Types;
109814 package Ada.Numerics.Generic_Complex_Elementary_Functions is
109815 pragma Pure(Generic_Complex_Elementary_Functions);
109816
109817 3
109818 function Sqrt (X : Complex) return Complex;
109819 function Log (X : Complex) return Complex;
109820 function Exp (X : Complex) return Complex;
109821 function Exp (X : Imaginary) return Complex;
109822 function "**" (Left : Complex; Right : Complex) return Complex;
109823 function "**" (Left : Complex; Right : Real'Base) return Complex;
109824 function "**" (Left : Real'Base; Right : Complex) return Complex;
109825
109826 4
109827 function Sin (X : Complex) return Complex;
109828 function Cos (X : Complex) return Complex;
109829 function Tan (X : Complex) return Complex;
109830 function Cot (X : Complex) return Complex;
109831
109832 5
109833 function Arcsin (X : Complex) return Complex;
109834 function Arccos (X : Complex) return Complex;
109835 function Arctan (X : Complex) return Complex;
109836 function Arccot (X : Complex) return Complex;
109837
109838 6
109839 function Sinh (X : Complex) return Complex;
109840 function Cosh (X : Complex) return Complex;
109841 function Tanh (X : Complex) return Complex;
109842 function Coth (X : Complex) return Complex;
109843
109844 7
109845 function Arcsinh (X : Complex) return Complex;
109846 function Arccosh (X : Complex) return Complex;
109847 function Arctanh (X : Complex) return Complex;
109848 function Arccoth (X : Complex) return Complex;
109849
109850 8
109851 end Ada.Numerics.Generic_Complex_Elementary_Functions;
109852
109853 9/1
109854 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} The library package
109855 Numerics.Complex_Elementary_Functions is declared pure and defines the
109856 same subprograms as Numerics.Generic_Complex_Elementary_Functions,
109857 except that the predefined type Float is systematically substituted for
109858 Real'Base, and the Complex and Imaginary types exported by
109859 Numerics.Complex_Types are systematically substituted for Complex and
109860 Imaginary, throughout. Nongeneric equivalents of
109861 Numerics.Generic_Complex_Elementary_Functions corresponding to each of
109862 the other predefined floating point types are defined similarly, with
109863 the names Numerics.Short_Complex_Elementary_Functions,
109864 Numerics.Long_Complex_Elementary_Functions, etc.
109865
109866 9.a
109867 Reason: The nongeneric equivalents are provided to allow the
109868 programmer to construct simple mathematical applications
109869 without being required to understand and use generics.
109870
109871 10
109872 The overloading of the Exp function for the pure-imaginary type is
109873 provided to give the user an alternate way to compose a complex value
109874 from a given modulus and argument. In addition to
109875 Compose_From_Polar(Rho, Theta) (see *note G.1.1::), the programmer may
109876 write Rho * Exp(i * Theta).
109877
109878 11
109879 The imaginary (resp., real) component of the parameter X of the forward
109880 hyperbolic (resp., trigonometric) functions and of the Exp function (and
109881 the parameter X, itself, in the case of the overloading of the Exp
109882 function for the pure-imaginary type) represents an angle measured in
109883 radians, as does the imaginary (resp., real) component of the result of
109884 the Log and inverse hyperbolic (resp., trigonometric) functions.
109885
109886 12
109887 The functions have their usual mathematical meanings. However, the
109888 arbitrariness inherent in the placement of branch cuts, across which
109889 some of the complex elementary functions exhibit discontinuities, is
109890 eliminated by the following conventions:
109891
109892 13
109893 * The imaginary component of the result of the Sqrt and Log functions
109894 is discontinuous as the parameter X crosses the negative real axis.
109895
109896 14
109897 * The result of the exponentiation operator when the left operand is
109898 of complex type is discontinuous as that operand crosses the
109899 negative real axis.
109900
109901 15/2
109902 * {AI95-00185-01AI95-00185-01} The imaginary component of the result
109903 of the Arcsin, Arccos, and Arctanh functions is discontinuous as
109904 the parameter X crosses the real axis to the left of -1.0 or the
109905 right of 1.0.
109906
109907 16/2
109908 * {AI95-00185-01AI95-00185-01} The real component of the result of
109909 the Arctan and Arcsinh functions is discontinuous as the parameter
109910 X crosses the imaginary axis below -i or above i.
109911
109912 17/2
109913 * {AI95-00185-01AI95-00185-01} The real component of the result of
109914 the Arccot function is discontinuous as the parameter X crosses the
109915 imaginary axis below -i or above i.
109916
109917 18
109918 * The imaginary component of the Arccosh function is discontinuous as
109919 the parameter X crosses the real axis to the left of 1.0.
109920
109921 19
109922 * The imaginary component of the result of the Arccoth function is
109923 discontinuous as the parameter X crosses the real axis between -1.0
109924 and 1.0.
109925
109926 19.a/2
109927 Discussion: {AI95-00185-01AI95-00185-01} The branch cuts come
109928 from the fact that the functions in question are really
109929 multi-valued in the complex domain, and that we have to pick
109930 one principal value to be the result of the function.
109931 Evidently we have much freedom in choosing where the branch
109932 cuts lie. However, we are adhering to the following
109933 principles which seem to lead to the more natural definitions:
109934
109935 19.b/2
109936 * A branch cut should not intersect the real axis at a
109937 place where the corresponding real function is
109938 well-defined (in other words, the complex function should
109939 be an extension of the corresponding real function).
109940
109941 19.c/2
109942 * Because all the functions in question are analytic, to
109943 ensure power series validity for the principal value, the
109944 branch cuts should be invariant by complex conjugation.
109945
109946 19.d/2
109947 * For odd functions, to ensure that the principal value
109948 remains an odd function, the branch cuts should be
109949 invariant by reflection in the origin.
109950
109951 20/2
109952 {AI95-00185-01AI95-00185-01} The computed results of the mathematically
109953 multivalued functions are rendered single-valued by the following
109954 conventions, which are meant to imply that the principal branch is an
109955 analytic continuation of the corresponding real-valued function in
109956 Numerics.Generic_Elementary_Functions. (For Arctan and Arccot, the
109957 single-argument function in question is that obtained from the
109958 two-argument version by fixing the second argument to be its default
109959 value.)
109960
109961 21
109962 * The real component of the result of the Sqrt and Arccosh functions
109963 is nonnegative.
109964
109965 22
109966 * The same convention applies to the imaginary component of the
109967 result of the Log function as applies to the result of the
109968 natural-cycle version of the Argument function of
109969 Numerics.Generic_Complex_Types (see *note G.1.1::).
109970
109971 23
109972 * The range of the real (resp., imaginary) component of the result of
109973 the Arcsin and Arctan (resp., Arcsinh and Arctanh) functions is
109974 approximately -PI/2.0 to PI/2.0.
109975
109976 24
109977 * The real (resp., imaginary) component of the result of the Arccos
109978 and Arccot (resp., Arccoth) functions ranges from 0.0 to
109979 approximately PI.
109980
109981 25
109982 * The range of the imaginary component of the result of the Arccosh
109983 function is approximately -PI to PI.
109984
109985 26
109986 In addition, the exponentiation operator inherits the single-valuedness
109987 of the Log function.
109988
109989 _Dynamic Semantics_
109990
109991 27
109992 The exception Numerics.Argument_Error is raised by the exponentiation
109993 operator, signaling a parameter value outside the domain of the
109994 corresponding mathematical function, when the value of the left operand
109995 is zero and the real component of the exponent (or the exponent itself,
109996 when it is of real type) is zero.
109997
109998 28
109999 The exception Constraint_Error is raised, signaling a pole of the
110000 mathematical function (analogous to dividing by zero), in the following
110001 cases, provided that Complex_Types.Real'Machine_Overflows is True:
110002
110003 29
110004 * by the Log, Cot, and Coth functions, when the value of the
110005 parameter X is zero;
110006
110007 30
110008 * by the exponentiation operator, when the value of the left operand
110009 is zero and the real component of the exponent (or the exponent
110010 itself, when it is of real type) is negative;
110011
110012 31
110013 * by the Arctan and Arccot functions, when the value of the parameter
110014 X is ± i;
110015
110016 32
110017 * by the Arctanh and Arccoth functions, when the value of the
110018 parameter X is ± 1.0.
110019
110020 33
110021 [Constraint_Error can also be raised when a finite result overflows (see
110022 *note G.2.6::); this may occur for parameter values sufficiently near
110023 poles, and, in the case of some of the functions, for parameter values
110024 having components of sufficiently large magnitude.] When
110025 Complex_Types.Real'Machine_Overflows is False, the result at poles is
110026 unspecified.
110027
110028 33.a
110029 Reason: The purpose of raising Constraint_Error (rather than
110030 Numerics.Argument_Error) at the poles of a function, when
110031 Float_Type'Machine_Overflows is True, is to provide continuous
110032 behavior as the actual parameters of the function approach the
110033 pole and finally reach it.
110034
110035 33.b
110036 Discussion: It is anticipated that an Ada binding to IEC
110037 559:1989 will be developed in the future. As part of such a
110038 binding, the Machine_Overflows attribute of a conformant
110039 floating point type will be specified to yield False, which
110040 will permit implementations of the complex elementary
110041 functions to deliver results with an infinite component (and
110042 set the overflow flag defined by the binding) instead of
110043 raising Constraint_Error in overflow situations, when traps
110044 are disabled. Similarly, it is appropriate for the complex
110045 elementary functions to deliver results with an infinite
110046 component (and set the zero-divide flag defined by the
110047 binding) instead of raising Constraint_Error at poles, when
110048 traps are disabled. Finally, such a binding should also
110049 specify the behavior of the complex elementary functions, when
110050 sensible, given parameters with infinite components.
110051
110052 _Implementation Requirements_
110053
110054 34
110055 In the implementation of Numerics.Generic_Complex_Elementary_Functions,
110056 the range of intermediate values allowed during the calculation of a
110057 final result shall not be affected by any range constraint of the
110058 subtype Complex_Types.Real.
110059
110060 34.a
110061 Implementation Note: Implementations of
110062 Numerics.Generic_Complex_Elementary_Functions written in Ada
110063 should therefore avoid declaring local variables of subtype
110064 Complex_Types.Real; the subtype Complex_Types.Real'Base should
110065 be used instead.
110066
110067 35
110068 In the following cases, evaluation of a complex elementary function
110069 shall yield the prescribed result (or a result having the prescribed
110070 component), provided that the preceding rules do not call for an
110071 exception to be raised:
110072
110073 36
110074 * When the parameter X has the value zero, the Sqrt, Sin, Arcsin,
110075 Tan, Arctan, Sinh, Arcsinh, Tanh, and Arctanh functions yield a
110076 result of zero; the Exp, Cos, and Cosh functions yield a result of
110077 one; the Arccos and Arccot functions yield a real result; and the
110078 Arccoth function yields an imaginary result.
110079
110080 37
110081 * When the parameter X has the value one, the Sqrt function yields a
110082 result of one; the Log, Arccos, and Arccosh functions yield a
110083 result of zero; and the Arcsin function yields a real result.
110084
110085 38
110086 * When the parameter X has the value -1.0, the Sqrt function yields
110087 the result
110088
110089 39
110090 * i (resp., -i), when the sign of the imaginary component
110091 of X is positive (resp., negative), if
110092 Complex_Types.Real'Signed_Zeros is True;
110093
110094 40
110095 * i, if Complex_Types.Real'Signed_Zeros is False;
110096
110097 41/2
110098 * {AI95-00434-01AI95-00434-01} When the parameter X has the value
110099 -1.0, the Log function yields an imaginary result; and the Arcsin
110100 and Arccos functions yield a real result.
110101
110102 42
110103 * When the parameter X has the value ± i, the Log function yields an
110104 imaginary result.
110105
110106 43
110107 * Exponentiation by a zero exponent yields the value one.
110108 Exponentiation by a unit exponent yields the value of the left
110109 operand (as a complex value). Exponentiation of the value one
110110 yields the value one. Exponentiation of the value zero yields the
110111 value zero.
110112
110113 43.a
110114 Discussion: It is possible to give many other prescribed
110115 results restricting the result to the real or imaginary axis
110116 when the parameter X is appropriately restricted to easily
110117 testable portions of the domain. We follow the proposed
110118 ISO/IEC standard for Generic_Complex_Elementary_Functions (for
110119 Ada 83), CD 13813, in not doing so, however.
110120
110121 44
110122 Other accuracy requirements for the complex elementary functions, which
110123 apply only in the strict mode, are given in *note G.2.6::.
110124
110125 45
110126 The sign of a zero result or zero result component yielded by a complex
110127 elementary function is implementation defined when
110128 Complex_Types.Real'Signed_Zeros is True.
110129
110130 45.a
110131 Implementation defined: The sign of a zero result (or a
110132 component thereof) from any operator or function in
110133 Numerics.Generic_Complex_Elementary_Functions, when
110134 Complex_Types.Real'Signed_Zeros is True.
110135
110136 _Implementation Permissions_
110137
110138 46
110139 The nongeneric equivalent packages may, but need not, be actual
110140 instantiations of the generic package with the appropriate predefined
110141 nongeneric equivalent of Numerics.Generic_Complex_Types; if they are,
110142 then the latter shall have been obtained by actual instantiation of
110143 Numerics.Generic_Complex_Types.
110144
110145 47
110146 The exponentiation operator may be implemented in terms of the Exp and
110147 Log functions. Because this implementation yields poor accuracy in some
110148 parts of the domain, no accuracy requirement is imposed on complex
110149 exponentiation.
110150
110151 48
110152 The implementation of the Exp function of a complex parameter X is
110153 allowed to raise the exception Constraint_Error, signaling overflow,
110154 when the real component of X exceeds an unspecified threshold that is
110155 approximately log(Complex_Types.Real'Safe_Last). This permission
110156 recognizes the impracticality of avoiding overflow in the marginal case
110157 that the exponential of the real component of X exceeds the safe range
110158 of Complex_Types.Real but both components of the final result do not.
110159 Similarly, the Sin and Cos (resp., Sinh and Cosh) functions are allowed
110160 to raise the exception Constraint_Error, signaling overflow, when the
110161 absolute value of the imaginary (resp., real) component of the parameter
110162 X exceeds an unspecified threshold that is approximately
110163 log(Complex_Types.Real'Safe_Last) + log(2.0). This permission
110164 recognizes the impracticality of avoiding overflow in the marginal case
110165 that the hyperbolic sine or cosine of the imaginary (resp., real)
110166 component of X exceeds the safe range of Complex_Types.Real but both
110167 components of the final result do not.
110168
110169 _Implementation Advice_
110170
110171 49
110172 Implementations in which Complex_Types.Real'Signed_Zeros is True should
110173 attempt to provide a rational treatment of the signs of zero results and
110174 result components. For example, many of the complex elementary
110175 functions have components that are odd functions of one of the parameter
110176 components; in these cases, the result component should have the sign of
110177 the parameter component at the origin. Other complex elementary
110178 functions have zero components whose sign is opposite that of a
110179 parameter component at the origin, or is always positive or always
110180 negative.
110181
110182 49.a.1/3
110183 Implementation Advice: If Complex_Types.Real'Signed_Zeros is
110184 True for Numerics.Generic_Complex_Elementary_Functions, a
110185 rational treatment of the signs of zero results and result
110186 components should be provided.
110187
110188 _Wording Changes from Ada 83_
110189
110190 49.a
110191 The semantics of Numerics.Generic_Complex_Elementary_Functions
110192 differs from Generic_Complex_Elementary_Functions as defined
110193 in ISO/IEC CD 13814 (for Ada 83) in the following ways:
110194
110195 49.b
110196 * The generic package is a child unit of the package
110197 defining the Argument_Error exception.
110198
110199 49.c
110200 * The proposed Generic_Complex_Elementary_Functions
110201 standard (for Ada 83) specified names for the nongeneric
110202 equivalents, if provided. Here, those nongeneric
110203 equivalents are required.
110204
110205 49.d
110206 * The generic package imports an instance of
110207 Numerics.Generic_Complex_Types rather than a long list of
110208 individual types and operations exported by such an
110209 instance.
110210
110211 49.e
110212 * The dependence of the imaginary component of the Sqrt and
110213 Log functions on the sign of a zero parameter component
110214 is tied to the value of Complex_Types.Real'Signed_Zeros.
110215
110216 49.f
110217 * Conformance to accuracy requirements is conditional.
110218
110219 _Wording Changes from Ada 95_
110220
110221 49.g/2
110222 {8652/00208652/0020} {AI95-00126-01AI95-00126-01} Corrigendum:
110223 Explicitly stated that the nongeneric equivalents of
110224 Generic_Complex_Elementary_Functions are pure.
110225
110226 49.h/2
110227 {AI95-00185-01AI95-00185-01} Corrected various inconsistencies
110228 in the definition of the branch cuts.
110229
110230 \1f
110231 File: aarm2012.info, Node: G.1.3, Next: G.1.4, Prev: G.1.2, Up: G.1
110232
110233 G.1.3 Complex Input-Output
110234 --------------------------
110235
110236 1
110237 The generic package Text_IO.Complex_IO defines procedures for the
110238 formatted input and output of complex values. The generic actual
110239 parameter in an instantiation of Text_IO.Complex_IO is an instance of
110240 Numerics.Generic_Complex_Types for some floating point subtype.
110241 Exceptional conditions are reported by raising the appropriate exception
110242 defined in Text_IO.
110243
110244 1.a
110245 Implementation Note: An implementation of Text_IO.Complex_IO
110246 can be built around an instance of Text_IO.Float_IO for the
110247 base subtype of Complex_Types.Real, where Complex_Types is the
110248 generic formal package parameter of Text_IO.Complex_IO. There
110249 is no need for an implementation of Text_IO.Complex_IO to
110250 parse real values.
110251
110252 _Static Semantics_
110253
110254 2
110255 The generic library package Text_IO.Complex_IO has the following
110256 declaration:
110257
110258 2.a
110259 Ramification: Because this is a child of Text_IO, the
110260 declarations of the visible part of Text_IO are directly
110261 visible within it.
110262
110263 3
110264 with Ada.Numerics.Generic_Complex_Types;
110265 generic
110266 with package Complex_Types is
110267 new Ada.Numerics.Generic_Complex_Types (<>);
110268 package Ada.Text_IO.Complex_IO is
110269
110270 4
110271 use Complex_Types;
110272
110273 5
110274 Default_Fore : Field := 2;
110275 Default_Aft : Field := Real'Digits - 1;
110276 Default_Exp : Field := 3;
110277
110278 6
110279 procedure Get (File : in File_Type;
110280 Item : out Complex;
110281 Width : in Field := 0);
110282 procedure Get (Item : out Complex;
110283 Width : in Field := 0);
110284
110285 7
110286 procedure Put (File : in File_Type;
110287 Item : in Complex;
110288 Fore : in Field := Default_Fore;
110289 Aft : in Field := Default_Aft;
110290 Exp : in Field := Default_Exp);
110291 procedure Put (Item : in Complex;
110292 Fore : in Field := Default_Fore;
110293 Aft : in Field := Default_Aft;
110294 Exp : in Field := Default_Exp);
110295
110296 8
110297 procedure Get (From : in String;
110298 Item : out Complex;
110299 Last : out Positive);
110300 procedure Put (To : out String;
110301 Item : in Complex;
110302 Aft : in Field := Default_Aft;
110303 Exp : in Field := Default_Exp);
110304
110305 9
110306 end Ada.Text_IO.Complex_IO;
110307
110308 9.1/2
110309 {AI95-00328-01AI95-00328-01} The library package Complex_Text_IO defines
110310 the same subprograms as Text_IO.Complex_IO, except that the predefined
110311 type Float is systematically substituted for Real, and the type
110312 Numerics.Complex_Types.Complex is systematically substituted for Complex
110313 throughout. Nongeneric equivalents of Text_IO.Complex_IO corresponding
110314 to each of the other predefined floating point types are defined
110315 similarly, with the names Short_Complex_Text_IO, Long_Complex_Text_IO,
110316 etc.
110317
110318 9.a/2
110319 Reason: The nongeneric equivalents are provided to allow the
110320 programmer to construct simple mathematical applications
110321 without being required to understand and use generics.
110322
110323 10
110324 The semantics of the Get and Put procedures are as follows:
110325
110326 11
110327 procedure Get (File : in File_Type;
110328 Item : out Complex;
110329 Width : in Field := 0);
110330 procedure Get (Item : out Complex;
110331 Width : in Field := 0);
110332
110333 12/1
110334 {8652/00928652/0092} {AI95-00029-01AI95-00029-01} The input
110335 sequence is a pair of optionally signed real literals
110336 representing the real and imaginary components of a complex
110337 value. These components have the format defined for the
110338 corresponding Get procedure of an instance of Text_IO.Float_IO
110339 (see *note A.10.9::) for the base subtype of
110340 Complex_Types.Real. The pair of components may be separated
110341 by a comma or surrounded by a pair of parentheses or both.
110342 Blanks are freely allowed before each of the components and
110343 before the parentheses and comma, if either is used. If the
110344 value of the parameter Width is zero, then
110345
110346 13
110347 * line and page terminators are also allowed in these
110348 places;
110349
110350 14
110351 * the components shall be separated by at least one blank
110352 or line terminator if the comma is omitted; and
110353
110354 15
110355 * reading stops when the right parenthesis has been read,
110356 if the input sequence includes a left parenthesis, or
110357 when the imaginary component has been read, otherwise.
110358
110359 15.1
110360 If a nonzero value of Width is supplied, then
110361
110362 16
110363 * the components shall be separated by at least one blank
110364 if the comma is omitted; and
110365
110366 17
110367 * exactly Width characters are read, or the characters
110368 (possibly none) up to a line terminator, whichever comes
110369 first (blanks are included in the count).
110370
110371 17.a
110372 Reason: The parenthesized and comma-separated form is the form
110373 produced by Put on output (see below), and also by
110374 list-directed output in Fortran. The other allowed forms
110375 match several common styles of edit-directed output in
110376 Fortran, allowing most preexisting Fortran data files
110377 containing complex data to be read easily. When such files
110378 contain complex values with no separation between the real and
110379 imaginary components, the user will have to read those
110380 components separately, using an instance of Text_IO.Float_IO.
110381
110382 18
110383 Returns, in the parameter Item, the value of type Complex that
110384 corresponds to the input sequence.
110385
110386 19
110387 The exception Text_IO.Data_Error is raised if the input
110388 sequence does not have the required syntax or if the
110389 components of the complex value obtained are not of the base
110390 subtype of Complex_Types.Real.
110391
110392 20
110393 procedure Put (File : in File_Type;
110394 Item : in Complex;
110395 Fore : in Field := Default_Fore;
110396 Aft : in Field := Default_Aft;
110397 Exp : in Field := Default_Exp);
110398 procedure Put (Item : in Complex;
110399 Fore : in Field := Default_Fore;
110400 Aft : in Field := Default_Aft;
110401 Exp : in Field := Default_Exp);
110402
110403 21
110404 Outputs the value of the parameter Item as a pair of decimal
110405 literals representing the real and imaginary components of the
110406 complex value, using the syntax of an aggregate. More
110407 specifically,
110408
110409 22
110410 * outputs a left parenthesis;
110411
110412 23
110413 * outputs the value of the real component of the parameter
110414 Item with the format defined by the corresponding Put
110415 procedure of an instance of Text_IO.Float_IO for the base
110416 subtype of Complex_Types.Real, using the given values of
110417 Fore, Aft, and Exp;
110418
110419 24
110420 * outputs a comma;
110421
110422 25
110423 * outputs the value of the imaginary component of the
110424 parameter Item with the format defined by the
110425 corresponding Put procedure of an instance of
110426 Text_IO.Float_IO for the base subtype of
110427 Complex_Types.Real, using the given values of Fore, Aft,
110428 and Exp;
110429
110430 26
110431 * outputs a right parenthesis.
110432
110433 26.a
110434 Discussion: If the file has a bounded line length, a line
110435 terminator may be output implicitly before any element of the
110436 sequence itemized above.
110437
110438 26.b
110439 Discussion: The option of outputting the complex value as a
110440 pair of reals without additional punctuation is not provided,
110441 since it can be accomplished by outputting the real and
110442 imaginary components of the complex value separately.
110443
110444 27
110445 procedure Get (From : in String;
110446 Item : out Complex;
110447 Last : out Positive);
110448
110449 28/2
110450 {AI95-00434-01AI95-00434-01} Reads a complex value from the
110451 beginning of the given string, following the same rule as the
110452 Get procedure that reads a complex value from a file, but
110453 treating the end of the string as a file terminator. Returns,
110454 in the parameter Item, the value of type Complex that
110455 corresponds to the input sequence. Returns in Last the index
110456 value such that From(Last) is the last character read.
110457
110458 29
110459 The exception Text_IO.Data_Error is raised if the input
110460 sequence does not have the required syntax or if the
110461 components of the complex value obtained are not of the base
110462 subtype of Complex_Types.Real.
110463
110464 30
110465 procedure Put (To : out String;
110466 Item : in Complex;
110467 Aft : in Field := Default_Aft;
110468 Exp : in Field := Default_Exp);
110469
110470 31
110471 Outputs the value of the parameter Item to the given string as
110472 a pair of decimal literals representing the real and imaginary
110473 components of the complex value, using the syntax of an
110474 aggregate. More specifically,
110475
110476 32
110477 * a left parenthesis, the real component, and a comma are
110478 left justified in the given string, with the real
110479 component having the format defined by the Put procedure
110480 (for output to a file) of an instance of Text_IO.Float_IO
110481 for the base subtype of Complex_Types.Real, using a value
110482 of zero for Fore and the given values of Aft and Exp;
110483
110484 33
110485 * the imaginary component and a right parenthesis are right
110486 justified in the given string, with the imaginary
110487 component having the format defined by the Put procedure
110488 (for output to a file) of an instance of Text_IO.Float_IO
110489 for the base subtype of Complex_Types.Real, using a value
110490 for Fore that completely fills the remainder of the
110491 string, together with the given values of Aft and Exp.
110492
110493 33.a
110494 Reason: This rule is the one proposed in LSN-1051. Other
110495 rules were considered, including one that would have read
110496 "Outputs the value of the parameter Item to the given string,
110497 following the same rule as for output to a file, using a value
110498 for Fore such that the sequence of characters output exactly
110499 fills, or comes closest to filling, the string; in the latter
110500 case, the string is filled by inserting one extra blank
110501 immediately after the comma." While this latter rule might be
110502 considered the closest analogue to the rule for output to a
110503 string in Text_IO.Float_IO, it requires a more difficult and
110504 inefficient implementation involving special cases when the
110505 integer part of one component is substantially longer than
110506 that of the other and the string is too short to allow both to
110507 be preceded by blanks. Unless such a special case applies,
110508 the latter rule might produce better columnar output if
110509 several such strings are ultimately output to a file, but very
110510 nearly the same output can be produced by outputting to the
110511 file directly, with the appropriate value of Fore; in any
110512 case, it might validly be assumed that output to a string is
110513 intended for further computation rather than for display, so
110514 that the precise formatting of the string to achieve a
110515 particular appearance is not the major concern.
110516
110517 34
110518 The exception Text_IO.Layout_Error is raised if the given
110519 string is too short to hold the formatted output.
110520
110521 _Implementation Permissions_
110522
110523 35
110524 Other exceptions declared (by renaming) in Text_IO may be raised by the
110525 preceding procedures in the appropriate circumstances, as for the
110526 corresponding procedures of Text_IO.Float_IO.
110527
110528 _Extensions to Ada 95_
110529
110530 35.a/2
110531 {AI95-00328-01AI95-00328-01} Nongeneric equivalents for
110532 Text_IO.Complex_IO are added, to be consistent with all other
110533 language-defined Numerics generic packages.
110534
110535 _Wording Changes from Ada 95_
110536
110537 35.b/2
110538 {8652/00928652/0092} {AI95-00029-01AI95-00029-01} Corrigendum:
110539 Clarified that the syntax of values read by Complex_IO is the
110540 same as that read by Text_IO.Float_IO.
110541
110542 \1f
110543 File: aarm2012.info, Node: G.1.4, Next: G.1.5, Prev: G.1.3, Up: G.1
110544
110545 G.1.4 The Package Wide_Text_IO.Complex_IO
110546 -----------------------------------------
110547
110548 _Static Semantics_
110549
110550 1
110551 Implementations shall also provide the generic library package
110552 Wide_Text_IO.Complex_IO. Its declaration is obtained from that of
110553 Text_IO.Complex_IO by systematically replacing Text_IO by Wide_Text_IO
110554 and String by Wide_String; the description of its behavior is obtained
110555 by additionally replacing references to particular characters (commas,
110556 parentheses, etc.) by those for the corresponding wide characters.
110557
110558 \1f
110559 File: aarm2012.info, Node: G.1.5, Prev: G.1.4, Up: G.1
110560
110561 G.1.5 The Package Wide_Wide_Text_IO.Complex_IO
110562 ----------------------------------------------
110563
110564 _Static Semantics_
110565
110566 1/2
110567 {AI95-00285-01AI95-00285-01} Implementations shall also provide the
110568 generic library package Wide_Wide_Text_IO.Complex_IO. Its declaration is
110569 obtained from that of Text_IO.Complex_IO by systematically replacing
110570 Text_IO by Wide_Wide_Text_IO and String by Wide_Wide_String; the
110571 description of its behavior is obtained by additionally replacing
110572 references to particular characters (commas, parentheses, etc.) by
110573 those for the corresponding wide wide characters.
110574
110575 _Extensions to Ada 95_
110576
110577 1.a/2
110578 {AI95-00285-01AI95-00285-01} Package
110579 Wide_Wide_Text_IO.Complex_IO is new. (At least it wasn't
110580 called Incredibly_Wide_Text_IO.Complex_IO; maybe next time.)
110581
110582 \1f
110583 File: aarm2012.info, Node: G.2, Next: G.3, Prev: G.1, Up: Annex G
110584
110585 G.2 Numeric Performance Requirements
110586 ====================================
110587
110588 _Implementation Requirements_
110589
110590 1
110591 Implementations shall provide a user-selectable mode in which the
110592 accuracy and other numeric performance requirements detailed in the
110593 following subclauses are observed. This mode, referred to as the strict
110594 mode, may or may not be the default mode; it directly affects the
110595 results of the predefined arithmetic operations of real types and the
110596 results of the subprograms in children of the Numerics package, and
110597 indirectly affects the operations in other language defined packages.
110598 Implementations shall also provide the opposing mode, which is known as
110599 the relaxed mode.
110600
110601 1.a
110602 Reason: On the assumption that the users of an implementation
110603 that does not support the Numerics Annex have no particular
110604 need for numerical performance, such an implementation has no
110605 obligation to meet any particular requirements in this area.
110606 On the other hand, users of an implementation that does
110607 support the Numerics Annex are provided with a way of ensuring
110608 that their programs achieve a known level of numerical
110609 performance and that the performance is portable to other such
110610 implementations. The relaxed mode is provided to allow
110611 implementers to offer an efficient but not fully accurate
110612 alternative in the case that the strict mode entails a time
110613 overhead that some users may find excessive. In some of its
110614 areas of impact, the relaxed mode may be fully equivalent to
110615 the strict mode.
110616
110617 1.b
110618 Implementation Note: The relaxed mode may, for example, be
110619 used to exploit the implementation of (some of) the elementary
110620 functions in hardware, when available. Such implementations
110621 often do not meet the accuracy requirements of the strict
110622 mode, or do not meet them over the specified range of
110623 parameter values, but compensate in other ways that may be
110624 important to the user, such as their extreme speed.
110625
110626 1.c
110627 Ramification: For implementations supporting the Numerics
110628 Annex, the choice of mode has no effect on the selection of a
110629 representation for a real type or on the values of attributes
110630 of a real type.
110631
110632 _Implementation Permissions_
110633
110634 2
110635 Either mode may be the default mode.
110636
110637 2.a
110638 Implementation defined: Whether the strict mode or the relaxed
110639 mode is the default.
110640
110641 3
110642 The two modes need not actually be different.
110643
110644 _Extensions to Ada 83_
110645
110646 3.a
110647 The choice between strict and relaxed numeric performance was
110648 not available in Ada 83.
110649
110650 * Menu:
110651
110652 * G.2.1 :: Model of Floating Point Arithmetic
110653 * G.2.2 :: Model-Oriented Attributes of Floating Point Types
110654 * G.2.3 :: Model of Fixed Point Arithmetic
110655 * G.2.4 :: Accuracy Requirements for the Elementary Functions
110656 * G.2.5 :: Performance Requirements for Random Number Generation
110657 * G.2.6 :: Accuracy Requirements for Complex Arithmetic
110658
110659 \1f
110660 File: aarm2012.info, Node: G.2.1, Next: G.2.2, Up: G.2
110661
110662 G.2.1 Model of Floating Point Arithmetic
110663 ----------------------------------------
110664
110665 1
110666 In the strict mode, the predefined operations of a floating point type
110667 shall satisfy the accuracy requirements specified here and shall avoid
110668 or signal overflow in the situations described. This behavior is
110669 presented in terms of a model of floating point arithmetic that builds
110670 on the concept of the canonical form (see *note A.5.3::).
110671
110672 _Static Semantics_
110673
110674 2
110675 Associated with each floating point type is an infinite set of model
110676 numbers. The model numbers of a type are used to define the accuracy
110677 requirements that have to be satisfied by certain predefined operations
110678 of the type; through certain attributes of the model numbers, they are
110679 also used to explain the meaning of a user-declared floating point type
110680 declaration. The model numbers of a derived type are those of the
110681 parent type; the model numbers of a subtype are those of its type.
110682
110683 3
110684 The model numbers of a floating point type T are zero and all the values
110685 expressible in the canonical form (for the type T), in which mantissa
110686 has T'Model_Mantissa digits and exponent has a value greater than or
110687 equal to T'Model_Emin. (These attributes are defined in *note G.2.2::.)
110688
110689 3.a
110690 Discussion: The model is capable of describing the behavior of
110691 most existing hardware that has a mantissa-exponent
110692 representation. As applied to a type T, it is parameterized
110693 by the values of T'Machine_Radix, T'Model_Mantissa,
110694 T'Model_Emin, T'Safe_First, and T'Safe_Last. The values of
110695 these attributes are determined by how, and how well, the
110696 hardware behaves. They in turn determine the set of model
110697 numbers and the safe range of the type, which figure in the
110698 accuracy and range (overflow avoidance) requirements.
110699
110700 3.b
110701 In hardware that is free of arithmetic anomalies,
110702 T'Model_Mantissa, T'Model_Emin, T'Safe_First, and T'Safe_Last
110703 will yield the same values as T'Machine_Mantissa,
110704 T'Machine_Emin, T'Base'First, and T'Base'Last, respectively,
110705 and the model numbers in the safe range of the type T will
110706 coincide with the machine numbers of the type T. In less
110707 perfect hardware, it is not possible for the model-oriented
110708 attributes to have these optimal values, since the hardware,
110709 by definition, and therefore the implementation, cannot
110710 conform to the stringencies of the resulting model; in this
110711 case, the values yielded by the model-oriented parameters have
110712 to be made more conservative (i.e., have to be penalized),
110713 with the result that the model numbers are more widely
110714 separated than the machine numbers, and the safe range is a
110715 subrange of the base range. The implementation will then be
110716 able to conform to the requirements of the weaker model
110717 defined by the sparser set of model numbers and the smaller
110718 safe range.
110719
110720 4
110721 A model interval of a floating point type is any interval whose bounds
110722 are model numbers of the type. The model interval of a type T
110723 associated with a value v is the smallest model interval of T that
110724 includes v. (The model interval associated with a model number of a
110725 type consists of that number only.)
110726
110727 _Implementation Requirements_
110728
110729 5
110730 The accuracy requirements for the evaluation of certain predefined
110731 operations of floating point types are as follows.
110732
110733 5.a
110734 Discussion: This subclause does not cover the accuracy of an
110735 operation of a static expression; such operations have to be
110736 evaluated exactly (see *note 4.9::). It also does not cover
110737 the accuracy of the predefined attributes of a floating point
110738 subtype that yield a value of the type; such operations also
110739 yield exact results (see *note 3.5.8:: and *note A.5.3::).
110740
110741 6
110742 An operand interval is the model interval, of the type specified for the
110743 operand of an operation, associated with the value of the operand.
110744
110745 7
110746 For any predefined arithmetic operation that yields a result of a
110747 floating point type T, the required bounds on the result are given by a
110748 model interval of T (called the result interval) defined in terms of the
110749 operand values as follows:
110750
110751 8
110752 * The result interval is the smallest model interval of T that
110753 includes the minimum and the maximum of all the values obtained by
110754 applying the (exact) mathematical operation to values arbitrarily
110755 selected from the respective operand intervals.
110756
110757 9
110758 The result interval of an exponentiation is obtained by applying the
110759 above rule to the sequence of multiplications defined by the exponent,
110760 assuming arbitrary association of the factors, and to the final division
110761 in the case of a negative exponent.
110762
110763 10
110764 The result interval of a conversion of a numeric value to a floating
110765 point type T is the model interval of T associated with the operand
110766 value, except when the source expression is of a fixed point type with a
110767 small that is not a power of T'Machine_Radix or is a fixed point
110768 multiplication or division either of whose operands has a small that is
110769 not a power of T'Machine_Radix; in these cases, the result interval is
110770 implementation defined.
110771
110772 10.a
110773 Implementation defined: The result interval in certain cases
110774 of fixed-to-float conversion.
110775
110776 11
110777 For any of the foregoing operations, the implementation shall deliver a
110778 value that belongs to the result interval when both bounds of the result
110779 interval are in the safe range of the result type T, as determined by
110780 the values of T'Safe_First and T'Safe_Last; otherwise,
110781
110782 12
110783 * if T'Machine_Overflows is True, the implementation shall either
110784 deliver a value that belongs to the result interval or raise
110785 Constraint_Error;
110786
110787 13
110788 * if T'Machine_Overflows is False, the result is implementation
110789 defined.
110790
110791 13.a
110792 Implementation defined: The result of a floating point
110793 arithmetic operation in overflow situations, when the
110794 Machine_Overflows attribute of the result type is False.
110795
110796 14
110797 For any predefined relation on operands of a floating point type T, the
110798 implementation may deliver any value (i.e., either True or False)
110799 obtained by applying the (exact) mathematical comparison to values
110800 arbitrarily chosen from the respective operand intervals.
110801
110802 15
110803 The result of a membership test is defined in terms of comparisons of
110804 the operand value with the lower and upper bounds of the given range or
110805 type mark (the usual rules apply to these comparisons).
110806
110807 _Implementation Permissions_
110808
110809 16
110810 If the underlying floating point hardware implements division as
110811 multiplication by a reciprocal, the result interval for division (and
110812 exponentiation by a negative exponent) is implementation defined.
110813
110814 16.a
110815 Implementation defined: The result interval for division (or
110816 exponentiation by a negative exponent), when the floating
110817 point hardware implements division as multiplication by a
110818 reciprocal.
110819
110820 _Wording Changes from Ada 83_
110821
110822 16.b
110823 The Ada 95 model numbers of a floating point type that are in
110824 the safe range of the type are comparable to the Ada 83 safe
110825 numbers of the type. There is no analog of the Ada 83 model
110826 numbers. The Ada 95 model numbers, when not restricted to the
110827 safe range, are an infinite set.
110828
110829 _Inconsistencies With Ada 83_
110830
110831 16.c
110832 Giving the model numbers the hardware radix, instead of always
110833 a radix of two, allows (in conjunction with other changes)
110834 some borderline declared types to be represented with less
110835 precision than in Ada 83 (i.e., with single precision, whereas
110836 Ada 83 would have used double precision). Because the lower
110837 precision satisfies the requirements of the model (and did so
110838 in Ada 83 as well), this change is viewed as a desirable
110839 correction of an anomaly, rather than a worrisome
110840 inconsistency. (Of course, the wider representation chosen in
110841 Ada 83 also remains eligible for selection in Ada 95.)
110842
110843 16.d
110844 As an example of this phenomenon, assume that Float is
110845 represented in single precision and that a double precision
110846 type is also available. Also assume hexadecimal hardware with
110847 clean properties, for example certain IBM hardware. Then,
110848
110849 16.e
110850 type T is digits Float'Digits range -Float'Last .. Float'Last;
110851
110852 16.f
110853 results in T being represented in double precision in Ada 83
110854 and in single precision in Ada 95. The latter is intuitively
110855 correct; the former is counterintuitive. The reason why the
110856 double precision type is used in Ada 83 is that Float has
110857 model and safe numbers (in Ada 83) with 21 binary digits in
110858 their mantissas, as is required to model the hypothesized
110859 hexadecimal hardware using a binary radix; thus Float'Last,
110860 which is not a model number, is slightly outside the range of
110861 safe numbers of the single precision type, making that type
110862 ineligible for selection as the representation of T even
110863 though it provides adequate precision. In Ada 95, Float'Last
110864 (the same value as before) is a model number and is in the
110865 safe range of Float on the hypothesized hardware, making Float
110866 eligible for the representation of T.
110867
110868 _Extensions to Ada 83_
110869
110870 16.g
110871 Giving the model numbers the hardware radix allows for
110872 practical implementations on decimal hardware.
110873
110874 _Wording Changes from Ada 83_
110875
110876 16.h
110877 The wording of the model of floating point arithmetic has been
110878 simplified to a large extent.
110879
110880 \1f
110881 File: aarm2012.info, Node: G.2.2, Next: G.2.3, Prev: G.2.1, Up: G.2
110882
110883 G.2.2 Model-Oriented Attributes of Floating Point Types
110884 -------------------------------------------------------
110885
110886 1
110887 In implementations that support the Numerics Annex, the model-oriented
110888 attributes of floating point types shall yield the values defined here,
110889 in both the strict and the relaxed modes. These definitions add
110890 conditions to those in *note A.5.3::.
110891
110892 _Static Semantics_
110893
110894 2
110895 For every subtype S of a floating point type T:
110896
110897 3/2
110898 {AI95-00256-01AI95-00256-01} S'Model_Mantissa
110899 Yields the number of digits in the mantissa of the
110900 canonical form of the model numbers of T (see *note
110901 A.5.3::). The value of this attribute shall be greater
110902 than or equal to
110903
110904 3.1/2
110905 'ceiling(d · log(10) / log(T'Machine_Radix))' + g
110906
110907 3.2/2
110908 where d is the requested decimal precision of T, and g is
110909 0 if T'Machine_Radix is a positive power of 10 and 1
110910 otherwise. In addition, T'Model_Mantissa shall be less
110911 than or equal to the value of T'Machine_Mantissa. This
110912 attribute yields a value of the type universal_integer.
110913
110914 3.a
110915 Ramification: S'Model_Epsilon, which is defined in terms of
110916 S'Model_Mantissa (see *note A.5.3::), yields the absolute
110917 value of the difference between one and the next model number
110918 of the type T above one. It is equal to or larger than the
110919 absolute value of the difference between one and the next
110920 machine number of the type T above one.
110921
110922 4
110923 S'Model_Emin
110924 Yields the minimum exponent of the canonical form of the
110925 model numbers of T (see *note A.5.3::). The value of
110926 this attribute shall be greater than or equal to the
110927 value of T'Machine_Emin. This attribute yields a value
110928 of the type universal_integer.
110929
110930 4.a
110931 Ramification: S'Model_Small, which is defined in terms of
110932 S'Model_Emin (see *note A.5.3::), yields the smallest positive
110933 (nonzero) model number of the type T.
110934
110935 5
110936 S'Safe_First
110937 Yields the lower bound of the safe range of T. The value
110938 of this attribute shall be a model number of T and
110939 greater than or equal to the lower bound of the base
110940 range of T. In addition, if T is declared by a
110941 floating_point_definition or is derived from such a type,
110942 and the floating_point_definition includes a
110943 real_range_specification specifying a lower bound of lb,
110944 then the value of this attribute shall be less than or
110945 equal to lb; otherwise, it shall be less than or equal to
110946 -10.0 4 · d, where d is the requested decimal precision
110947 of T. This attribute yields a value of the type
110948 universal_real.
110949
110950 6
110951 S'Safe_Last
110952 Yields the upper bound of the safe range of T. The value
110953 of this attribute shall be a model number of T and less
110954 than or equal to the upper bound of the base range of T.
110955 In addition, if T is declared by a
110956 floating_point_definition or is derived from such a type,
110957 and the floating_point_definition includes a
110958 real_range_specification specifying an upper bound of ub,
110959 then the value of this attribute shall be greater than or
110960 equal to ub; otherwise, it shall be greater than or equal
110961 to 10.0 4 · d, where d is the requested decimal precision
110962 of T. This attribute yields a value of the type
110963 universal_real.
110964
110965 7
110966 S'Model
110967 Denotes a function (of a parameter X) whose specification
110968 is given in *note A.5.3::. If X is a model number of T,
110969 the function yields X; otherwise, it yields the value
110970 obtained by rounding or truncating X to either one of the
110971 adjacent model numbers of T. Constraint_Error is raised
110972 if the resulting model number is outside the safe range
110973 of S. A zero result has the sign of X when S'Signed_Zeros
110974 is True.
110975
110976 8
110977 Subject to the constraints given above, the values of S'Model_Mantissa
110978 and S'Safe_Last are to be maximized, and the values of S'Model_Emin and
110979 S'Safe_First minimized, by the implementation as follows:
110980
110981 9
110982 * First, S'Model_Mantissa is set to the largest value for which
110983 values of S'Model_Emin, S'Safe_First, and S'Safe_Last can be chosen
110984 so that the implementation satisfies the strict-mode requirements
110985 of *note G.2.1:: in terms of the model numbers and safe range
110986 induced by these attributes.
110987
110988 10
110989 * Next, S'Model_Emin is set to the smallest value for which values of
110990 S'Safe_First and S'Safe_Last can be chosen so that the
110991 implementation satisfies the strict-mode requirements of *note
110992 G.2.1:: in terms of the model numbers and safe range induced by
110993 these attributes and the previously determined value of
110994 S'Model_Mantissa.
110995
110996 11/3
110997 * {AI05-0092-1AI05-0092-1} Finally, S'Safe_First and S'Safe_Last are
110998 set (in either order) to the smallest and largest values,
110999 respectively, for which the implementation satisfies the
111000 strict-mode requirements of *note G.2.1:: in terms of the model
111001 numbers and safe range induced by these attributes and the
111002 previously determined values of S'Model_Mantissa and S'Model_Emin.
111003
111004 11.a
111005 Ramification: The following table shows appropriate attribute
111006 values for IEEE basic single and double precision types
111007 (ANSI/IEEE Std 754-1985, IEC 559:1989). Here, we use the
111008 names IEEE_Float_32 and IEEE_Float_64, the names that would
111009 typically be declared in package Interfaces, in an
111010 implementation that supports IEEE arithmetic. In such an
111011 implementation, the attributes would typically be the same for
111012 Standard.Float and Long_Float, respectively.
111013
111014 11.b
111015 Attribute IEEE_Float_32 IEEE_Float_64
111016
111017 11.c
111018 'Machine_Radix 2 2
111019 'Machine_Mantissa 24 53
111020 'Machine_Emin -125 -1021
111021 'Machine_Emax 128 1024
111022 'Denorm True True
111023 'Machine_Rounds True True
111024 'Machine_Overflows True/False True/False
111025 'Signed_Zeros should be True should be True
111026
111027 11.d
111028 'Model_Mantissa (same as 'Machine_Mantissa) (same as 'Machine_Mantissa)
111029 'Model_Emin (same as 'Machine_Emin) (same as 'Machine_Emin)
111030 'Model_Epsilon 2.0**(-23) 2.0**(-52)
111031 'Model_Small 2.0**(-126) 2.0**(-1022)
111032 'Safe_First -2.0**128*(1.0-2.0**(-24)) -2.0**1024*(1.0-2.0**(-53))
111033 'Safe_Last 2.0**128*(1.0-2.0**(-24)) 2.0**1024*(1.0-2.0**(-53))
111034
111035 11.e
111036 'Digits 6 15
111037 'Base'Digits (same as 'Digits) (same as 'Digits)
111038
111039 11.f
111040 'First (same as 'Safe_First) (same as 'Safe_First)
111041 'Last (same as 'Safe_Last) (same as 'Safe_Last)
111042 'Size 32 64
111043
111044 11.g
111045 Note: 'Machine_Overflows can be True or False, depending on
111046 whether the Ada implementation raises Constraint_Error or
111047 delivers a signed infinity in overflow and zerodivide
111048 situations (and at poles of the elementary functions).
111049
111050 _Wording Changes from Ada 95_
111051
111052 11.h/2
111053 {AI95-00256-01AI95-00256-01} Corrected the definition of
111054 Model_Mantissa to match that given in *note 3.5.8::.
111055
111056 \1f
111057 File: aarm2012.info, Node: G.2.3, Next: G.2.4, Prev: G.2.2, Up: G.2
111058
111059 G.2.3 Model of Fixed Point Arithmetic
111060 -------------------------------------
111061
111062 1
111063 In the strict mode, the predefined arithmetic operations of a fixed
111064 point type shall satisfy the accuracy requirements specified here and
111065 shall avoid or signal overflow in the situations described.
111066
111067 _Implementation Requirements_
111068
111069 2
111070 The accuracy requirements for the predefined fixed point arithmetic
111071 operations and conversions, and the results of relations on fixed point
111072 operands, are given below.
111073
111074 2.a
111075 Discussion: This subclause does not cover the accuracy of an
111076 operation of a static expression; such operations have to be
111077 evaluated exactly (see *note 4.9::).
111078
111079 3
111080 The operands of the fixed point adding operators, absolute value, and
111081 comparisons have the same type. These operations are required to yield
111082 exact results, unless they overflow.
111083
111084 4
111085 Multiplications and divisions are allowed between operands of any two
111086 fixed point types; the result has to be (implicitly or explicitly)
111087 converted to some other numeric type. For purposes of defining the
111088 accuracy rules, the multiplication or division and the conversion are
111089 treated as a single operation whose accuracy depends on three types
111090 (those of the operands and the result). For decimal fixed point types,
111091 the attribute T'Round may be used to imply explicit conversion with
111092 rounding (see *note 3.5.10::).
111093
111094 5
111095 When the result type is a floating point type, the accuracy is as given
111096 in *note G.2.1::. For some combinations of the operand and result types
111097 in the remaining cases, the result is required to belong to a small set
111098 of values called the perfect result set; for other combinations, it is
111099 required merely to belong to a generally larger and
111100 implementation-defined set of values called the close result set. When
111101 the result type is a decimal fixed point type, the perfect result set
111102 contains a single value; thus, operations on decimal types are always
111103 fully specified.
111104
111105 5.a
111106 Implementation defined: The definition of close result set,
111107 which determines the accuracy of certain fixed point
111108 multiplications and divisions.
111109
111110 6
111111 When one operand of a fixed-fixed multiplication or division is of type
111112 universal_real, that operand is not implicitly converted in the usual
111113 sense, since the context does not determine a unique target type, but
111114 the accuracy of the result of the multiplication or division (i.e.,
111115 whether the result has to belong to the perfect result set or merely the
111116 close result set) depends on the value of the operand of type
111117 universal_real and on the types of the other operand and of the result.
111118
111119 6.a
111120 Discussion: We need not consider here the multiplication or
111121 division of two such operands, since in that case either the
111122 operation is evaluated exactly (i.e., it is an operation of a
111123 static expression all of whose operators are of a root numeric
111124 type) or it is considered to be an operation of a floating
111125 point type.
111126
111127 7
111128 For a fixed point multiplication or division whose (exact) mathematical
111129 result is v, and for the conversion of a value v to a fixed point type,
111130 the perfect result set and close result set are defined as follows:
111131
111132 8
111133 * If the result type is an ordinary fixed point type with a small of
111134 s,
111135
111136 9
111137 * if v is an integer multiple of s, then the perfect result
111138 set contains only the value v;
111139
111140 10
111141 * otherwise, it contains the integer multiple of s just
111142 below v and the integer multiple of s just above v.
111143
111144 11
111145 The close result set is an implementation-defined set of
111146 consecutive integer multiples of s containing the perfect result
111147 set as a subset.
111148
111149 12
111150 * If the result type is a decimal type with a small of s,
111151
111152 13
111153 * if v is an integer multiple of s, then the perfect result
111154 set contains only the value v;
111155
111156 14/3
111157 * {AI05-0264-1AI05-0264-1} otherwise, if truncation
111158 applies, then it contains only the integer multiple of s
111159 in the direction toward zero, whereas if rounding
111160 applies, then it contains only the nearest integer
111161 multiple of s (with ties broken by rounding away from
111162 zero).
111163
111164 15
111165 The close result set is an implementation-defined set of
111166 consecutive integer multiples of s containing the perfect result
111167 set as a subset.
111168
111169 15.a
111170 Ramification: As a consequence of subsequent rules, this case
111171 does not arise when the operand types are also decimal types.
111172
111173 16
111174 * If the result type is an integer type,
111175
111176 17
111177 * if v is an integer, then the perfect result set contains
111178 only the value v;
111179
111180 18
111181 * otherwise, it contains the integer nearest to the value v
111182 (if v lies equally distant from two consecutive integers,
111183 the perfect result set contains the one that is further
111184 from zero).
111185
111186 19
111187 The close result set is an implementation-defined set of
111188 consecutive integers containing the perfect result set as a subset.
111189
111190 20
111191 The result of a fixed point multiplication or division shall belong
111192 either to the perfect result set or to the close result set, as
111193 described below, if overflow does not occur. In the following cases, if
111194 the result type is a fixed point type, let s be its small; otherwise,
111195 i.e. when the result type is an integer type, let s be 1.0.
111196
111197 21
111198 * For a multiplication or division neither of whose operands is of
111199 type universal_real, let l and r be the smalls of the left and
111200 right operands. For a multiplication, if (l · r) / s is an integer
111201 or the reciprocal of an integer (the smalls are said to be
111202 "compatible" in this case), the result shall belong to the perfect
111203 result set; otherwise, it belongs to the close result set. For a
111204 division, if l / (r · s) is an integer or the reciprocal of an
111205 integer (i.e., the smalls are compatible), the result shall belong
111206 to the perfect result set; otherwise, it belongs to the close
111207 result set.
111208
111209 21.a
111210 Ramification: When the operand and result types are all
111211 decimal types, their smalls are necessarily compatible; the
111212 same is true when they are all ordinary fixed point types with
111213 binary smalls.
111214
111215 22
111216 * For a multiplication or division having one universal_real operand
111217 with a value of v, note that it is always possible to factor v as
111218 an integer multiple of a "compatible" small, but the integer
111219 multiple may be "too big." If there exists a factorization in
111220 which that multiple is less than some implementation-defined limit,
111221 the result shall belong to the perfect result set; otherwise, it
111222 belongs to the close result set.
111223
111224 22.a
111225 Implementation defined: Conditions on a universal_real operand
111226 of a fixed point multiplication or division for which the
111227 result shall be in the perfect result set.
111228
111229 23
111230 A multiplication P * Q of an operand of a fixed point type F by an
111231 operand of an integer type I, or vice-versa, and a division P / Q of an
111232 operand of a fixed point type F by an operand of an integer type I, are
111233 also allowed. In these cases, the result has a type of F; explicit
111234 conversion of the result is never required. The accuracy required in
111235 these cases is the same as that required for a multiplication F(P * Q)
111236 or a division F(P / Q) obtained by interpreting the operand of the
111237 integer type to have a fixed point type with a small of 1.0.
111238
111239 24
111240 The accuracy of the result of a conversion from an integer or fixed
111241 point type to a fixed point type, or from a fixed point type to an
111242 integer type, is the same as that of a fixed point multiplication of the
111243 source value by a fixed point operand having a small of 1.0 and a value
111244 of 1.0, as given by the foregoing rules. The result of a conversion
111245 from a floating point type to a fixed point type shall belong to the
111246 close result set. The result of a conversion of a universal_real
111247 operand to a fixed point type shall belong to the perfect result set.
111248
111249 25
111250 The possibility of overflow in the result of a predefined arithmetic
111251 operation or conversion yielding a result of a fixed point type T is
111252 analogous to that for floating point types, except for being related to
111253 the base range instead of the safe range. If all of the permitted
111254 results belong to the base range of T, then the implementation shall
111255 deliver one of the permitted results; otherwise,
111256
111257 26
111258 * if T'Machine_Overflows is True, the implementation shall either
111259 deliver one of the permitted results or raise Constraint_Error;
111260
111261 27
111262 * if T'Machine_Overflows is False, the result is implementation
111263 defined.
111264
111265 27.a
111266 Implementation defined: The result of a fixed point arithmetic
111267 operation in overflow situations, when the Machine_Overflows
111268 attribute of the result type is False.
111269
111270 _Inconsistencies With Ada 83_
111271
111272 27.b
111273 Since the values of a fixed point type are now just the
111274 integer multiples of its small, the possibility of using extra
111275 bits available in the chosen representation for extra accuracy
111276 rather than for increasing the base range would appear to be
111277 removed, raising the possibility that some fixed point
111278 expressions will yield less accurate results than in Ada 83.
111279 However, this is partially offset by the ability of an
111280 implementation to choose a smaller default small than before.
111281 Of course, if it does so for a type T then T'Small will have a
111282 different value than it previously had.
111283
111284 27.c
111285 The accuracy requirements in the case of incompatible smalls
111286 are relaxed to foster wider support for nonbinary smalls. If
111287 this relaxation is exploited for a type that was previously
111288 supported, lower accuracy could result; however, there is no
111289 particular incentive to exploit the relaxation in such a case.
111290
111291 _Wording Changes from Ada 83_
111292
111293 27.d
111294 The fixed point accuracy requirements are now expressed
111295 without reference to model or safe numbers, largely because
111296 the full generality of the former model was never exploited in
111297 the case of fixed point types (particularly in regard to
111298 operand perturbation). Although the new formulation in terms
111299 of perfect result sets and close result sets is still verbose,
111300 it can be seen to distill down to two cases:
111301
111302 27.e
111303 * a case where the result must be the exact result, if the
111304 exact result is representable, or, if not, then either
111305 one of the adjacent values of the type (in some subcases
111306 only one of those adjacent values is allowed);
111307
111308 27.f
111309 * a case where the accuracy is not specified by the
111310 language.
111311
111312 \1f
111313 File: aarm2012.info, Node: G.2.4, Next: G.2.5, Prev: G.2.3, Up: G.2
111314
111315 G.2.4 Accuracy Requirements for the Elementary Functions
111316 --------------------------------------------------------
111317
111318 1
111319 In the strict mode, the performance of
111320 Numerics.Generic_Elementary_Functions shall be as specified here.
111321
111322 _Implementation Requirements_
111323
111324 2
111325 When an exception is not raised, the result of evaluating a function in
111326 an instance EF of Numerics.Generic_Elementary_Functions belongs to a
111327 result interval, defined as the smallest model interval of EF.Float_Type
111328 that contains all the values of the form f · (1.0 + d), where f is the
111329 exact value of the corresponding mathematical function at the given
111330 parameter values, d is a real number, and |d| is less than or equal to
111331 the function's maximum relative error. The function delivers a value
111332 that belongs to the result interval when both of its bounds belong to
111333 the safe range of EF.Float_Type; otherwise,
111334
111335 3
111336 * if EF.Float_Type'Machine_Overflows is True, the function either
111337 delivers a value that belongs to the result interval or raises
111338 Constraint_Error, signaling overflow;
111339
111340 4
111341 * if EF.Float_Type'Machine_Overflows is False, the result is
111342 implementation defined.
111343
111344 4.a
111345 Implementation defined: The result of an elementary function
111346 reference in overflow situations, when the Machine_Overflows
111347 attribute of the result type is False.
111348
111349 5
111350 The maximum relative error exhibited by each function is as follows:
111351
111352 6
111353 * 2.0 · EF.Float_Type'Model_Epsilon, in the case of the Sqrt, Sin,
111354 and Cos functions;
111355
111356 7
111357 * 4.0 · EF.Float_Type'Model_Epsilon, in the case of the Log, Exp,
111358 Tan, Cot, and inverse trigonometric functions; and
111359
111360 8
111361 * 8.0 · EF.Float_Type'Model_Epsilon, in the case of the forward and
111362 inverse hyperbolic functions.
111363
111364 9
111365 The maximum relative error exhibited by the exponentiation operator,
111366 which depends on the values of the operands, is (4.0 + |Right ·
111367 log(Left)| / 32.0) · EF.Float_Type'Model_Epsilon.
111368
111369 10
111370 The maximum relative error given above applies throughout the domain of
111371 the forward trigonometric functions when the Cycle parameter is
111372 specified. When the Cycle parameter is omitted, the maximum relative
111373 error given above applies only when the absolute value of the angle
111374 parameter X is less than or equal to some implementation-defined angle
111375 threshold, which shall be at least EF.Float_Type'Machine_Radix
111376 'floor(EF.Float_Type'Machine_Mantissa/2)'. Beyond the angle threshold,
111377 the accuracy of the forward trigonometric functions is implementation
111378 defined.
111379
111380 10.a
111381 Implementation defined: The value of the angle threshold,
111382 within which certain elementary functions, complex arithmetic
111383 operations, and complex elementary functions yield results
111384 conforming to a maximum relative error bound.
111385
111386 10.b
111387 Implementation defined: The accuracy of certain elementary
111388 functions for parameters beyond the angle threshold.
111389
111390 10.c
111391 Implementation Note: The angle threshold indirectly determines
111392 the amount of precision that the implementation has to
111393 maintain during argument reduction.
111394
111395 11/2
111396 {AI95-00434-01AI95-00434-01} The prescribed results specified in *note
111397 A.5.1:: for certain functions at particular parameter values take
111398 precedence over the maximum relative error bounds; effectively, they
111399 narrow to a single value the result interval allowed by the maximum
111400 relative error bounds. Additional rules with a similar effect are given
111401 by table G-1 for the inverse trigonometric functions, at particular
111402 parameter values for which the mathematical result is possibly not a
111403 model number of EF.Float_Type (or is, indeed, even transcendental). In
111404 each table entry, the values of the parameters are such that the result
111405 lies on the axis between two quadrants; the corresponding accuracy rule,
111406 which takes precedence over the maximum relative error bounds, is that
111407 the result interval is the model interval of EF.Float_Type associated
111408 with the exact mathematical result given in the table.
111409
111410 12/1
111411 This paragraph was deleted.
111412
111413 13
111414 The last line of the table is meant to apply when
111415 EF.Float_Type'Signed_Zeros is False; the two lines just above it, when
111416 EF.Float_Type'Signed_Zeros is True and the parameter Y has a zero value
111417 with the indicated sign.
111418
111419 Table G-1: Tightly Approximated Elementary Function Results
111420 Function Value of X Value of Y Exact Result Exact Result
111421 when Cycle when Cycle
111422 Specified Omitted
111423 Arcsin 1.0 n.a. Cycle/4.0 PI/2.0
111424 Arcsin -1.0 n.a. -Cycle/4.0 -PI/2.0
111425 Arccos 0.0 n.a. Cycle/4.0 PI/2.0
111426 Arccos -1.0 n.a. Cycle/2.0 PI
111427 Arctan 0.0 positive Cycle/4.0 PI/2.0
111428 and
111429 Arccot
111430 Arctan 0.0 negative -Cycle/4.0 -PI/2.0
111431 and
111432 Arccot
111433 Arctan negative +0.0 Cycle/2.0 PI
111434 and
111435 Arccot
111436 Arctan negative -0.0 -Cycle/2.0 -PI
111437 and
111438 Arccot
111439 Arctan negative 0.0 Cycle/2.0 PI
111440 and
111441 Arccot
111442 14
111443 The amount by which the result of an inverse trigonometric function is
111444 allowed to spill over into a quadrant adjacent to the one corresponding
111445 to the principal branch, as given in *note A.5.1::, is limited. The
111446 rule is that the result belongs to the smallest model interval of
111447 EF.Float_Type that contains both boundaries of the quadrant
111448 corresponding to the principal branch. This rule also takes precedence
111449 over the maximum relative error bounds, effectively narrowing the result
111450 interval allowed by them.
111451
111452 15
111453 Finally, the following specifications also take precedence over the
111454 maximum relative error bounds:
111455
111456 16
111457 * The absolute value of the result of the Sin, Cos, and Tanh
111458 functions never exceeds one.
111459
111460 17
111461 * The absolute value of the result of the Coth function is never less
111462 than one.
111463
111464 18
111465 * The result of the Cosh function is never less than one.
111466
111467 _Implementation Advice_
111468
111469 19
111470 The versions of the forward trigonometric functions without a Cycle
111471 parameter should not be implemented by calling the corresponding version
111472 with a Cycle parameter of 2.0*Numerics.Pi, since this will not provide
111473 the required accuracy in some portions of the domain. For the same
111474 reason, the version of Log without a Base parameter should not be
111475 implemented by calling the corresponding version with a Base parameter
111476 of Numerics.e.
111477
111478 19.a.1/2
111479 Implementation Advice: For elementary functions, the forward
111480 trigonometric functions without a Cycle parameter should not
111481 be implemented by calling the corresponding version with a
111482 Cycle parameter. Log without a Base parameter should not be
111483 implemented by calling Log with a Base parameter.
111484
111485 _Wording Changes from Ada 83_
111486
111487 19.a
111488 The semantics of Numerics.Generic_Elementary_Functions differs
111489 from Generic_Elementary_Functions as defined in ISO/IEC DIS
111490 11430 (for Ada 83) in the following ways related to the
111491 accuracy specified for strict mode:
111492
111493 19.b
111494 * The maximum relative error bounds use the Model_Epsilon
111495 attribute instead of the Base'Epsilon attribute.
111496
111497 19.c
111498 * The accuracy requirements are expressed in terms of
111499 result intervals that are model intervals. On the one
111500 hand, this facilitates the description of the required
111501 results in the presence of underflow; on the other hand,
111502 it slightly relaxes the requirements expressed in ISO/IEC
111503 DIS 11430.
111504
111505 \1f
111506 File: aarm2012.info, Node: G.2.5, Next: G.2.6, Prev: G.2.4, Up: G.2
111507
111508 G.2.5 Performance Requirements for Random Number Generation
111509 -----------------------------------------------------------
111510
111511 1
111512 In the strict mode, the performance of Numerics.Float_Random and
111513 Numerics.Discrete_Random shall be as specified here.
111514
111515 _Implementation Requirements_
111516
111517 2
111518 Two different calls to the time-dependent Reset procedure shall reset
111519 the generator to different states, provided that the calls are separated
111520 in time by at least one second and not more than fifty years.
111521
111522 3
111523 The implementation's representations of generator states and its
111524 algorithms for generating random numbers shall yield a period of at
111525 least 231-2; much longer periods are desirable but not required.
111526
111527 4
111528 The implementations of Numerics.Float_Random.Random and
111529 Numerics.Discrete_Random.Random shall pass at least 85% of the
111530 individual trials in a suite of statistical tests. For
111531 Numerics.Float_Random, the tests are applied directly to the floating
111532 point values generated (i.e., they are not converted to integers first),
111533 while for Numerics.Discrete_Random they are applied to the generated
111534 values of various discrete types. Each test suite performs 6 different
111535 tests, with each test repeated 10 times, yielding a total of 60
111536 individual trials. An individual trial is deemed to pass if the
111537 chi-square value (or other statistic) calculated for the observed counts
111538 or distribution falls within the range of values corresponding to the
111539 2.5 and 97.5 percentage points for the relevant degrees of freedom
111540 (i.e., it shall be neither too high nor too low). For the purpose of
111541 determining the degrees of freedom, measurement categories are combined
111542 whenever the expected counts are fewer than 5.
111543
111544 4.a
111545 Implementation Note: In the floating point random number test
111546 suite, the generator is reset to a time-dependent state at the
111547 beginning of the run. The test suite incorporates the
111548 following tests, adapted from D. E. Knuth, The Art of Computer
111549 Programming, vol. 2: Seminumerical Algorithms. In the
111550 descriptions below, the given number of degrees of freedom is
111551 the number before reduction due to any necessary combination
111552 of measurement categories with small expected counts; it is
111553 one less than the number of measurement categories.
111554
111555 4.b
111556 * Proportional Distribution Test (a variant of the
111557 Equidistribution Test). The interval 0.0 .. 1.0 is
111558 partitioned into K subintervals. K is chosen randomly
111559 between 4 and 25 for each repetition of the test, along
111560 with the boundaries of the subintervals (subject to the
111561 constraint that at least 2 of the subintervals have a
111562 width of 0.001 or more). 5000 random floating point
111563 numbers are generated. The counts of random numbers
111564 falling into each subinterval are tallied and compared
111565 with the expected counts, which are proportional to the
111566 widths of the subintervals. The number of degrees of
111567 freedom for the chi-square test is K-1.
111568
111569 4.c
111570 * Gap Test. The bounds of a range A .. B, with 0.0 <= A <
111571 B <= 1.0, are chosen randomly for each repetition of the
111572 test, subject to the constraint that 0.2 <= B-A <= 0.6.
111573 Random floating point numbers are generated until 5000
111574 falling into the range A .. B have been encountered.
111575 Each of these 5000 is preceded by a "gap" (of length
111576 greater than or equal to 0) of consecutive random numbers
111577 not falling into the range A .. B. The counts of gaps of
111578 each length from 0 to 15, and of all lengths greater than
111579 15 lumped together, are tallied and compared with the
111580 expected counts. Let P = B-A. The probability that a gap
111581 has a length of L is (1-P) L · P for L <= 15, while the
111582 probability that a gap has a length of 16 or more is
111583 (1-P) 16. The number of degrees of freedom for the
111584 chi-square test is 16.
111585
111586 4.d
111587 * Permutation Test. 5000 tuples of 4 different random
111588 floating point numbers are generated. (An entire 4-tuple
111589 is discarded in the unlikely event that it contains any
111590 two exactly equal components.) The counts of each of the
111591 4! = 24 possible relative orderings of the components of
111592 the 4-tuples are tallied and compared with the expected
111593 counts. Each of the possible relative orderings has an
111594 equal probability. The number of degrees of freedom for
111595 the chi-square test is 23.
111596
111597 4.e
111598 * Increasing-Runs Test. Random floating point numbers are
111599 generated until 5000 increasing runs have been observed.
111600 An "increasing run" is a sequence of random numbers in
111601 strictly increasing order; it is followed by a random
111602 number that is strictly smaller than the preceding random
111603 number. (A run under construction is entirely discarded
111604 in the unlikely event that one random number is followed
111605 immediately by an exactly equal random number.) The
111606 decreasing random number that follows an increasing run
111607 is discarded and not included with the next increasing
111608 run. The counts of increasing runs of each length from 1
111609 to 4, and of all lengths greater than 4 lumped together,
111610 are tallied and compared with the expected counts. The
111611 probability that an increasing run has a length of L is
111612 1/L! - 1/(L+1)! for L <= 4, while the probability that
111613 an increasing run has a length of 5 or more is 1/5!. The
111614 number of degrees of freedom for the chi-square test is
111615 4.
111616
111617 4.f
111618 * Decreasing-Runs Test. The test is similar to the
111619 Increasing Runs Test, but with decreasing runs.
111620
111621 4.g
111622 * Maximum-of-t Test (with t = 5). 5000 tuples of 5 random
111623 floating point numbers are generated. The maximum of the
111624 components of each 5-tuple is determined and raised to
111625 the 5th power. The uniformity of the resulting values
111626 over the range 0.0 .. 1.0 is tested as in the
111627 Proportional Distribution Test.
111628
111629 4.h
111630 Implementation Note: In the discrete random number test suite,
111631 Numerics.Discrete_Random is instantiated as described below.
111632 The generator is reset to a time-dependent state after each
111633 instantiation. The test suite incorporates the following
111634 tests, adapted from D. E. Knuth (op. cit.) and other
111635 sources. The given number of degrees of freedom for the
111636 chi-square test is reduced by any necessary combination of
111637 measurement categories with small expected counts, as
111638 described above.
111639
111640 4.i
111641 * Equidistribution Test. In each repetition of the test, a
111642 number R between 2 and 30 is chosen randomly, and
111643 Numerics.Discrete_Random is instantiated with an integer
111644 subtype whose range is 1 .. R. 5000 integers are
111645 generated randomly from this range. The counts of
111646 occurrences of each integer in the range are tallied and
111647 compared with the expected counts, which have equal
111648 probabilities. The number of degrees of freedom for the
111649 chi-square test is R-1.
111650
111651 4.j
111652 * Simplified Poker Test. Numerics.Discrete_Random is
111653 instantiated once with an enumeration subtype
111654 representing the 13 denominations (Two through Ten, Jack,
111655 Queen, King, and Ace) of an infinite deck of playing
111656 cards. 2000 "poker" hands (5-tuples of values of this
111657 subtype) are generated randomly. The counts of hands
111658 containing exactly K different denominations (1 <= K <=
111659 5) are tallied and compared with the expected counts.
111660 The probability that a hand contains exactly K different
111661 denominations is given by a formula in Knuth. The number
111662 of degrees of freedom for the chi-square test is 4.
111663
111664 4.k
111665 * Coupon Collector's Test. Numerics.Discrete_Random is
111666 instantiated in each repetition of the test with an
111667 integer subtype whose range is 1 .. R, where R varies
111668 systematically from 2 to 11. Integers are generated
111669 randomly from this range until each value in the range
111670 has occurred, and the number K of integers generated is
111671 recorded. This constitutes a "coupon collector's
111672 segment" of length K. 2000 such segments are generated.
111673 The counts of segments of each length from R to R+29, and
111674 of all lengths greater than R+29 lumped together, are
111675 tallied and compared with the expected counts. The
111676 probability that a segment has any given length is given
111677 by formulas in Knuth. The number of degrees of freedom
111678 for the chi-square test is 30.
111679
111680 4.l
111681 * Craps Test (Lengths of Games). Numerics.Discrete_Random
111682 is instantiated once with an integer subtype whose range
111683 is 1 .. 6 (representing the six numbers on a die). 5000
111684 craps games are played, and their lengths are recorded.
111685 (The length of a craps game is the number of rolls of the
111686 pair of dice required to produce a win or a loss. A game
111687 is won on the first roll if the dice show 7 or 11; it is
111688 lost if they show 2, 3, or 12. If the dice show some
111689 other sum on the first roll, it is called the point, and
111690 the game is won if and only if the point is rolled again
111691 before a 7 is rolled.) The counts of games of each
111692 length from 1 to 18, and of all lengths greater than 18
111693 lumped together, are tallied and compared with the
111694 expected counts. For 2 <= S <= 12, let D S be the
111695 probability that a roll of a pair of dice shows the sum
111696 S, and let Q S(L) = D S · (1 - (D S + D 7)) L-2 · (D S +
111697 D 7). Then, the probability that a game has a length of
111698 1 is D 7 + D 11 + D 2 + D 3 + D 12 and, for L > 1, the
111699 probability that a game has a length of L is Q 4(L) + Q
111700 5(L) + Q 6(L) + Q 8(L) + Q 9(L) + Q 10(L). The number of
111701 degrees of freedom for the chi-square test is 18.
111702
111703 4.m
111704 * Craps Test (Lengths of Passes). This test is similar to
111705 the last, but enough craps games are played for 3000
111706 losses to occur. A string of wins followed by a loss is
111707 called a pass, and its length is the number of wins
111708 preceding the loss. The counts of passes of each length
111709 from 0 to 7, and of all lengths greater than 7 lumped
111710 together, are tallied and compared with the expected
111711 counts. For L >= 0, the probability that a pass has a
111712 length of L is W L · (1-W), where W, the probability that
111713 a game ends in a win, is 244.0/495.0. The number of
111714 degrees of freedom for the chi-square test is 8.
111715
111716 4.n
111717 * Collision Test. Numerics.Discrete_Random is instantiated
111718 once with an integer or enumeration type representing
111719 binary bits. 15 successive calls on the Random function
111720 are used to obtain the bits of a 15-bit binary integer
111721 between 0 and 32767. 3000 such integers are generated,
111722 and the number of collisions (integers previously
111723 generated) is counted and compared with the expected
111724 count. A chi-square test is not used to assess the
111725 number of collisions; rather, the limits on the number of
111726 collisions, corresponding to the 2.5 and 97.5 percentage
111727 points, are (from formulas in Knuth) 112 and 154. The
111728 test passes if and only if the number of collisions is in
111729 this range.
111730
111731 \1f
111732 File: aarm2012.info, Node: G.2.6, Prev: G.2.5, Up: G.2
111733
111734 G.2.6 Accuracy Requirements for Complex Arithmetic
111735 --------------------------------------------------
111736
111737 1
111738 In the strict mode, the performance of Numerics.Generic_Complex_Types
111739 and Numerics.Generic_Complex_Elementary_Functions shall be as specified
111740 here.
111741
111742 _Implementation Requirements_
111743
111744 2
111745 When an exception is not raised, the result of evaluating a real
111746 function of an instance CT of Numerics.Generic_Complex_Types (i.e., a
111747 function that yields a value of subtype CT.Real'Base or CT.Imaginary)
111748 belongs to a result interval defined as for a real elementary function
111749 (see *note G.2.4::).
111750
111751 3
111752 When an exception is not raised, each component of the result of
111753 evaluating a complex function of such an instance, or of an instance of
111754 Numerics.Generic_Complex_Elementary_Functions obtained by instantiating
111755 the latter with CT (i.e., a function that yields a value of subtype
111756 CT.Complex), also belongs to a result interval. The result intervals
111757 for the components of the result are either defined by a maximum
111758 relative error bound or by a maximum box error bound. When the result
111759 interval for the real (resp., imaginary) component is defined by maximum
111760 relative error, it is defined as for that of a real function, relative
111761 to the exact value of the real (resp., imaginary) part of the result of
111762 the corresponding mathematical function. When defined by maximum box
111763 error, the result interval for a component of the result is the smallest
111764 model interval of CT.Real that contains all the values of the
111765 corresponding part of f · (1.0 + d), where f is the exact complex value
111766 of the corresponding mathematical function at the given parameter
111767 values, d is complex, and |d| is less than or equal to the given maximum
111768 box error. The function delivers a value that belongs to the result
111769 interval (or a value both of whose components belong to their respective
111770 result intervals) when both bounds of the result interval(s) belong to
111771 the safe range of CT.Real; otherwise,
111772
111773 3.a
111774 Discussion: The maximum relative error could be specified
111775 separately for each component, but we do not take advantage of
111776 that freedom here.
111777
111778 3.b
111779 Discussion: Note that f · (1.0 + d) defines a small circular
111780 region of the complex plane centered at f, and the result
111781 intervals for the real and imaginary components of the result
111782 define a small rectangular box containing that circle.
111783
111784 3.c
111785 Reason: Box error is used when the computation of the result
111786 risks loss of significance in a component due to cancellation.
111787
111788 3.d
111789 Ramification: The components of a complex function that
111790 exhibits bounded relative error in each component have to have
111791 the correct sign. In contrast, one of the components of a
111792 complex function that exhibits bounded box error may have the
111793 wrong sign, since the dimensions of the box containing the
111794 result are proportional to the modulus of the mathematical
111795 result and not to either component of the mathematical result
111796 individually. Thus, for example, the box containing the
111797 computed result of a complex function whose mathematical
111798 result has a large modulus but lies very close to the
111799 imaginary axis might well straddle that axis, allowing the
111800 real component of the computed result to have the wrong sign.
111801 In this case, the distance between the computed result and the
111802 mathematical result is, nevertheless, a small fraction of the
111803 modulus of the mathematical result.
111804
111805 4
111806 * if CT.Real'Machine_Overflows is True, the function either delivers
111807 a value that belongs to the result interval (or a value both of
111808 whose components belong to their respective result intervals) or
111809 raises Constraint_Error, signaling overflow;
111810
111811 5
111812 * if CT.Real'Machine_Overflows is False, the result is implementation
111813 defined.
111814
111815 5.a
111816 Implementation defined: The result of a complex arithmetic
111817 operation or complex elementary function reference in overflow
111818 situations, when the Machine_Overflows attribute of the
111819 corresponding real type is False.
111820
111821 6/2
111822 {AI95-00434-01AI95-00434-01} The error bounds for particular complex
111823 functions are tabulated in table G-2. In the table, the error bound is
111824 given as the coefficient of CT.Real'Model_Epsilon.
111825
111826 7/1
111827 This paragraph was deleted.
111828
111829 Table G-2: Error Bounds for Particular Complex Functions
111830 Function or Operator Nature of Nature of Error Bound
111831 Result Bound
111832 Modulus real max. 3.0
111833 rel.
111834 error
111835 Argument real max. 4.0
111836 rel.
111837 error
111838 Compose_From_Polar complex max. 3.0
111839 rel.
111840 error
111841 "*" (both operands complex max. 5.0
111842 complex) box
111843 error
111844 "/" (right operand complex max. 13.0
111845 complex) box
111846 error
111847 Sqrt complex max. 6.0
111848 rel.
111849 error
111850 Log complex max. 13.0
111851 box
111852 error
111853 Exp (complex complex max. 7.0
111854 parameter) rel.
111855 error
111856 Exp (imaginary complex max. 2.0
111857 parameter) rel.
111858 error
111859 Sin, Cos, Sinh, and complex max. 11.0
111860 Cosh rel.
111861 error
111862 Tan, Cot, Tanh, and complex max. 35.0
111863 Coth rel.
111864 error
111865 inverse complex max. 14.0
111866 trigonometric rel.
111867 error
111868 inverse hyperbolic complex max. 14.0
111869 rel.
111870 error
111871 8
111872 The maximum relative error given above applies throughout the domain of
111873 the Compose_From_Polar function when the Cycle parameter is specified.
111874 When the Cycle parameter is omitted, the maximum relative error applies
111875 only when the absolute value of the parameter Argument is less than or
111876 equal to the angle threshold (see *note G.2.4::). For the Exp function,
111877 and for the forward hyperbolic (resp., trigonometric) functions, the
111878 maximum relative error given above likewise applies only when the
111879 absolute value of the imaginary (resp., real) component of the parameter
111880 X (or the absolute value of the parameter itself, in the case of the Exp
111881 function with a parameter of pure-imaginary type) is less than or equal
111882 to the angle threshold. For larger angles, the accuracy is
111883 implementation defined.
111884
111885 8.a
111886 Implementation defined: The accuracy of certain complex
111887 arithmetic operations and certain complex elementary functions
111888 for parameters (or components thereof) beyond the angle
111889 threshold.
111890
111891 9
111892 The prescribed results specified in *note G.1.2:: for certain functions
111893 at particular parameter values take precedence over the error bounds;
111894 effectively, they narrow to a single value the result interval allowed
111895 by the error bounds for a component of the result. Additional rules
111896 with a similar effect are given below for certain inverse trigonometric
111897 and inverse hyperbolic functions, at particular parameter values for
111898 which a component of the mathematical result is transcendental. In each
111899 case, the accuracy rule, which takes precedence over the error bounds,
111900 is that the result interval for the stated result component is the model
111901 interval of CT.Real associated with the component's exact mathematical
111902 value. The cases in question are as follows:
111903
111904 10
111905 * When the parameter X has the value zero, the real (resp.,
111906 imaginary) component of the result of the Arccot (resp., Arccoth)
111907 function is in the model interval of CT.Real associated with the
111908 value PI/2.0.
111909
111910 11
111911 * When the parameter X has the value one, the real component of the
111912 result of the Arcsin function is in the model interval of CT.Real
111913 associated with the value PI/2.0.
111914
111915 12
111916 * When the parameter X has the value -1.0, the real component of the
111917 result of the Arcsin (resp., Arccos) function is in the model
111918 interval of CT.Real associated with the value -PI/2.0 (resp., PI).
111919
111920 12.a
111921 Discussion: It is possible to give many other prescribed
111922 results in which a component of the parameter is restricted to
111923 a similar model interval when the parameter X is appropriately
111924 restricted to an easily testable portion of the domain. We
111925 follow the proposed ISO/IEC standard for
111926 Generic_Complex_Elementary_Functions (for Ada 83) in not doing
111927 so, however.
111928
111929 13/2
111930 {AI95-00434-01AI95-00434-01} The amount by which a component of the
111931 result of an inverse trigonometric or inverse hyperbolic function is
111932 allowed to spill over into a quadrant adjacent to the one corresponding
111933 to the principal branch, as given in *note G.1.2::, is limited. The
111934 rule is that the result belongs to the smallest model interval of
111935 CT.Real that contains both boundaries of the quadrant corresponding to
111936 the principal branch. This rule also takes precedence over the maximum
111937 error bounds, effectively narrowing the result interval allowed by them.
111938
111939 14
111940 Finally, the results allowed by the error bounds are narrowed by one
111941 further rule: The absolute value of each component of the result of the
111942 Exp function, for a pure-imaginary parameter, never exceeds one.
111943
111944 _Implementation Advice_
111945
111946 15
111947 The version of the Compose_From_Polar function without a Cycle parameter
111948 should not be implemented by calling the corresponding version with a
111949 Cycle parameter of 2.0*Numerics.Pi, since this will not provide the
111950 required accuracy in some portions of the domain.
111951
111952 15.a.1/2
111953 Implementation Advice: For complex arithmetic, the
111954 Compose_From_Polar function without a Cycle parameter should
111955 not be implemented by calling Compose_From_Polar with a Cycle
111956 parameter.
111957
111958 _Wording Changes from Ada 83_
111959
111960 15.a
111961 The semantics of Numerics.Generic_Complex_Types and
111962 Numerics.Generic_Complex_Elementary_Functions differs from
111963 Generic_Complex_Types and Generic_Complex_Elementary_Functions
111964 as defined in ISO/IEC CDs 13813 and 13814 (for Ada 83) in ways
111965 analogous to those identified for the elementary functions in
111966 *note G.2.4::. In addition, we do not generally specify the
111967 signs of zero results (or result components), although those
111968 proposed standards do.
111969
111970 \1f
111971 File: aarm2012.info, Node: G.3, Prev: G.2, Up: Annex G
111972
111973 G.3 Vector and Matrix Manipulation
111974 ==================================
111975
111976 1/2
111977 {AI95-00296-01AI95-00296-01} Types and operations for the manipulation
111978 of real vectors and matrices are provided in Generic_Real_Arrays, which
111979 is defined in *note G.3.1::. Types and operations for the manipulation
111980 of complex vectors and matrices are provided in Generic_Complex_Arrays,
111981 which is defined in *note G.3.2::. Both of these library units are
111982 generic children of the predefined package Numerics (see *note A.5::).
111983 Nongeneric equivalents of these packages for each of the predefined
111984 floating point types are also provided as children of Numerics.
111985
111986 1.a/2
111987 Discussion: Vector and matrix manipulation is defined in the
111988 Numerics Annex, rather than in the core, because it is
111989 considered to be a specialized need of (some) numeric
111990 applications.
111991
111992 1.b/2
111993 These packages provide facilities that are similar to and
111994 replace those found in ISO/IEC 13813:1998 Information
111995 technology -- Programming languages -- Generic packages of
111996 real and complex type declarations and basic operations for
111997 Ada (including vector and matrix types). (The other
111998 facilities provided by that Standard were already provided in
111999 Ada 95.) In addition to the main facilities of that Standard,
112000 these packages also include subprograms for the solution of
112001 linear equations, matrix inversion, determinants, and the
112002 determination of the eigenvalues and eigenvectors of real
112003 symmetric matrices and Hermitian matrices.
112004
112005 _Extensions to Ada 95_
112006
112007 1.c/3
112008 {AI95-00296-01AI95-00296-01} {AI05-0299-1AI05-0299-1} This
112009 subclause It just provides an introduction to the following
112010 subclauses.
112011
112012 * Menu:
112013
112014 * G.3.1 :: Real Vectors and Matrices
112015 * G.3.2 :: Complex Vectors and Matrices
112016
112017 \1f
112018 File: aarm2012.info, Node: G.3.1, Next: G.3.2, Up: G.3
112019
112020 G.3.1 Real Vectors and Matrices
112021 -------------------------------
112022
112023 _Static Semantics_
112024
112025 1/2
112026 {AI95-00296-01AI95-00296-01} {AI95-00418-01AI95-00418-01} The generic
112027 library package Numerics.Generic_Real_Arrays has the following
112028 declaration:
112029
112030 2/2
112031 generic
112032 type Real is digits <>;
112033 package Ada.Numerics.Generic_Real_Arrays is
112034 pragma Pure(Generic_Real_Arrays);
112035
112036 3/2
112037 -- Types
112038
112039 4/2
112040 type Real_Vector is array (Integer range <>) of Real'Base;
112041 type Real_Matrix is array (Integer range <>, Integer range <>)
112042 of Real'Base;
112043
112044 5/2
112045 -- Subprograms for Real_Vector types
112046
112047 6/2
112048 -- Real_Vector arithmetic operations
112049
112050 7/2
112051 function "+" (Right : Real_Vector) return Real_Vector;
112052 function "-" (Right : Real_Vector) return Real_Vector;
112053 function "abs" (Right : Real_Vector) return Real_Vector;
112054
112055 8/2
112056 function "+" (Left, Right : Real_Vector) return Real_Vector;
112057 function "-" (Left, Right : Real_Vector) return Real_Vector;
112058
112059 9/2
112060 function "*" (Left, Right : Real_Vector) return Real'Base;
112061
112062 10/2
112063 function "abs" (Right : Real_Vector) return Real'Base;
112064
112065 11/2
112066 -- Real_Vector scaling operations
112067
112068 12/2
112069 function "*" (Left : Real'Base; Right : Real_Vector)
112070 return Real_Vector;
112071 function "*" (Left : Real_Vector; Right : Real'Base)
112072 return Real_Vector;
112073 function "/" (Left : Real_Vector; Right : Real'Base)
112074 return Real_Vector;
112075
112076 13/2
112077 -- Other Real_Vector operations
112078
112079 14/2
112080 function Unit_Vector (Index : Integer;
112081 Order : Positive;
112082 First : Integer := 1) return Real_Vector;
112083
112084 15/2
112085 -- Subprograms for Real_Matrix types
112086
112087 16/2
112088 -- Real_Matrix arithmetic operations
112089
112090 17/2
112091 function "+" (Right : Real_Matrix) return Real_Matrix;
112092 function "-" (Right : Real_Matrix) return Real_Matrix;
112093 function "abs" (Right : Real_Matrix) return Real_Matrix;
112094 function Transpose (X : Real_Matrix) return Real_Matrix;
112095
112096 18/2
112097 function "+" (Left, Right : Real_Matrix) return Real_Matrix;
112098 function "-" (Left, Right : Real_Matrix) return Real_Matrix;
112099 function "*" (Left, Right : Real_Matrix) return Real_Matrix;
112100
112101 19/2
112102 function "*" (Left, Right : Real_Vector) return Real_Matrix;
112103
112104 20/2
112105 function "*" (Left : Real_Vector; Right : Real_Matrix)
112106 return Real_Vector;
112107 function "*" (Left : Real_Matrix; Right : Real_Vector)
112108 return Real_Vector;
112109
112110 21/2
112111 -- Real_Matrix scaling operations
112112
112113 22/2
112114 function "*" (Left : Real'Base; Right : Real_Matrix)
112115 return Real_Matrix;
112116 function "*" (Left : Real_Matrix; Right : Real'Base)
112117 return Real_Matrix;
112118 function "/" (Left : Real_Matrix; Right : Real'Base)
112119 return Real_Matrix;
112120
112121 23/2
112122 -- Real_Matrix inversion and related operations
112123
112124 24/2
112125 function Solve (A : Real_Matrix; X : Real_Vector) return Real_Vector;
112126 function Solve (A, X : Real_Matrix) return Real_Matrix;
112127 function Inverse (A : Real_Matrix) return Real_Matrix;
112128 function Determinant (A : Real_Matrix) return Real'Base;
112129
112130 25/2
112131 -- Eigenvalues and vectors of a real symmetric matrix
112132
112133 26/2
112134 function Eigenvalues (A : Real_Matrix) return Real_Vector;
112135
112136 27/2
112137 procedure Eigensystem (A : in Real_Matrix;
112138 Values : out Real_Vector;
112139 Vectors : out Real_Matrix);
112140
112141 28/2
112142 -- Other Real_Matrix operations
112143
112144 29/2
112145 function Unit_Matrix (Order : Positive;
112146 First_1, First_2 : Integer := 1)
112147 return Real_Matrix;
112148
112149 30/2
112150 end Ada.Numerics.Generic_Real_Arrays;
112151
112152 31/2
112153 {AI95-00296-01AI95-00296-01} The library package Numerics.Real_Arrays is
112154 declared pure and defines the same types and subprograms as
112155 Numerics.Generic_Real_Arrays, except that the predefined type Float is
112156 systematically substituted for Real'Base throughout. Nongeneric
112157 equivalents for each of the other predefined floating point types are
112158 defined similarly, with the names Numerics.Short_Real_Arrays,
112159 Numerics.Long_Real_Arrays, etc.
112160
112161 31.a/2
112162 Reason: The nongeneric equivalents are provided to allow the
112163 programmer to construct simple mathematical applications
112164 without being required to understand and use generics, and to
112165 be consistent with other Numerics packages.
112166
112167 32/2
112168 {AI95-00296-01AI95-00296-01} Two types are defined and exported by
112169 Numerics.Generic_Real_Arrays. The composite type Real_Vector is
112170 provided to represent a vector with components of type Real; it is
112171 defined as an unconstrained, one-dimensional array with an index of type
112172 Integer. The composite type Real_Matrix is provided to represent a
112173 matrix with components of type Real; it is defined as an unconstrained,
112174 two-dimensional array with indices of type Integer.
112175
112176 33/2
112177 {AI95-00296-01AI95-00296-01} The effect of the various subprograms is as
112178 described below. In most cases the subprograms are described in terms
112179 of corresponding scalar operations of the type Real; any exception
112180 raised by those operations is propagated by the array operation.
112181 Moreover, the accuracy of the result for each individual component is as
112182 defined for the scalar operation unless stated otherwise.
112183
112184 34/2
112185 {AI95-00296-01AI95-00296-01} In the case of those operations which are
112186 defined to involve an inner product, Constraint_Error may be raised if
112187 an intermediate result is outside the range of Real'Base even though the
112188 mathematical final result would not be.
112189
112190 35/2
112191 function "+" (Right : Real_Vector) return Real_Vector;
112192 function "-" (Right : Real_Vector) return Real_Vector;
112193 function "abs" (Right : Real_Vector) return Real_Vector;
112194
112195 36/2
112196 {AI95-00296-01AI95-00296-01} Each operation returns the result
112197 of applying the corresponding operation of the type Real to
112198 each component of Right. The index range of the result is
112199 Right'Range.
112200
112201 37/2
112202 function "+" (Left, Right : Real_Vector) return Real_Vector;
112203 function "-" (Left, Right : Real_Vector) return Real_Vector;
112204
112205 38/2
112206 {AI95-00296-01AI95-00296-01} Each operation returns the result
112207 of applying the corresponding operation of the type Real to
112208 each component of Left and the matching component of Right.
112209 The index range of the result is Left'Range. Constraint_Error
112210 is raised if Left'Length is not equal to Right'Length.
112211
112212 39/2
112213 function "*" (Left, Right : Real_Vector) return Real'Base;
112214
112215 40/2
112216 {AI95-00296-01AI95-00296-01} This operation returns the inner
112217 product of Left and Right. Constraint_Error is raised if
112218 Left'Length is not equal to Right'Length. This operation
112219 involves an inner product.
112220
112221 41/2
112222 function "abs" (Right : Real_Vector) return Real'Base;
112223
112224 42/2
112225 {AI95-00418-01AI95-00418-01} This operation returns the
112226 L2-norm of Right (the square root of the inner product of the
112227 vector with itself).
112228
112229 42.a/2
112230 Discussion: Normalization of vectors is a frequent enough
112231 operation that it is useful to provide the norm as a basic
112232 operation. Furthermore, implementing the norm is not entirely
112233 straightforward, because the inner product might overflow
112234 while the final norm does not. An implementation cannot
112235 merely return Sqrt (X * X), it has to cope with a possible
112236 overflow of the inner product.
112237
112238 42.b/2
112239 Implementation Note: While the definition is given in terms of
112240 an inner product, the norm doesn't "involve an inner product"
112241 in the technical sense. The reason is that it has accuracy
112242 requirements substantially different from those applicable to
112243 inner products; and that cancellations cannot occur, because
112244 all the terms are positive, so there is no possibility of
112245 intermediate overflow.
112246
112247 43/2
112248 function "*" (Left : Real'Base; Right : Real_Vector) return Real_Vector;
112249
112250 44/2
112251 {AI95-00296-01AI95-00296-01} This operation returns the result
112252 of multiplying each component of Right by the scalar Left
112253 using the "*" operation of the type Real. The index range of
112254 the result is Right'Range.
112255
112256 45/2
112257 function "*" (Left : Real_Vector; Right : Real'Base) return Real_Vector;
112258 function "/" (Left : Real_Vector; Right : Real'Base) return Real_Vector;
112259
112260 46/2
112261 {AI95-00296-01AI95-00296-01} Each operation returns the result
112262 of applying the corresponding operation of the type Real to
112263 each component of Left and to the scalar Right. The index
112264 range of the result is Left'Range.
112265
112266 47/2
112267 function Unit_Vector (Index : Integer;
112268 Order : Positive;
112269 First : Integer := 1) return Real_Vector;
112270
112271 48/2
112272 {AI95-00296-01AI95-00296-01} This function returns a unit
112273 vector with Order components and a lower bound of First. All
112274 components are set to 0.0 except for the Index component which
112275 is set to 1.0. Constraint_Error is raised if Index < First,
112276 Index > First + Order - 1 or if First + Order - 1 >
112277 Integer'Last.
112278
112279 49/2
112280 function "+" (Right : Real_Matrix) return Real_Matrix;
112281 function "-" (Right : Real_Matrix) return Real_Matrix;
112282 function "abs" (Right : Real_Matrix) return Real_Matrix;
112283
112284 50/2
112285 {AI95-00296-01AI95-00296-01} Each operation returns the result
112286 of applying the corresponding operation of the type Real to
112287 each component of Right. The index ranges of the result are
112288 those of Right.
112289
112290 51/2
112291 function Transpose (X : Real_Matrix) return Real_Matrix;
112292
112293 52/2
112294 {AI95-00296-01AI95-00296-01} This function returns the
112295 transpose of a matrix X. The first and second index ranges of
112296 the result are X'Range(2) and X'Range(1) respectively.
112297
112298 53/2
112299 function "+" (Left, Right : Real_Matrix) return Real_Matrix;
112300 function "-" (Left, Right : Real_Matrix) return Real_Matrix;
112301
112302 54/2
112303 {AI95-00296-01AI95-00296-01} Each operation returns the result
112304 of applying the corresponding operation of the type Real to
112305 each component of Left and the matching component of Right.
112306 The index ranges of the result are those of Left.
112307 Constraint_Error is raised if Left'Length(1) is not equal to
112308 Right'Length(1) or Left'Length(2) is not equal to
112309 Right'Length(2).
112310
112311 55/2
112312 function "*" (Left, Right : Real_Matrix) return Real_Matrix;
112313
112314 56/2
112315 {AI95-00296-01AI95-00296-01} This operation provides the
112316 standard mathematical operation for matrix multiplication.
112317 The first and second index ranges of the result are
112318 Left'Range(1) and Right'Range(2) respectively.
112319 Constraint_Error is raised if Left'Length(2) is not equal to
112320 Right'Length(1). This operation involves inner products.
112321
112322 57/2
112323 function "*" (Left, Right : Real_Vector) return Real_Matrix;
112324
112325 58/2
112326 {AI95-00296-01AI95-00296-01} This operation returns the outer
112327 product of a (column) vector Left by a (row) vector Right
112328 using the operation "*" of the type Real for computing the
112329 individual components. The first and second index ranges of
112330 the result are Left'Range and Right'Range respectively.
112331
112332 59/2
112333 function "*" (Left : Real_Vector; Right : Real_Matrix) return Real_Vector;
112334
112335 60/2
112336 {AI95-00296-01AI95-00296-01} This operation provides the
112337 standard mathematical operation for multiplication of a (row)
112338 vector Left by a matrix Right. The index range of the (row)
112339 vector result is Right'Range(2). Constraint_Error is raised
112340 if Left'Length is not equal to Right'Length(1). This
112341 operation involves inner products.
112342
112343 61/2
112344 function "*" (Left : Real_Matrix; Right : Real_Vector) return Real_Vector;
112345
112346 62/2
112347 {AI95-00296-01AI95-00296-01} This operation provides the
112348 standard mathematical operation for multiplication of a matrix
112349 Left by a (column) vector Right. The index range of the
112350 (column) vector result is Left'Range(1). Constraint_Error is
112351 raised if Left'Length(2) is not equal to Right'Length. This
112352 operation involves inner products.
112353
112354 63/2
112355 function "*" (Left : Real'Base; Right : Real_Matrix) return Real_Matrix;
112356
112357 64/2
112358 {AI95-00296-01AI95-00296-01} This operation returns the result
112359 of multiplying each component of Right by the scalar Left
112360 using the "*" operation of the type Real. The index ranges of
112361 the result are those of Right.
112362
112363 65/2
112364 function "*" (Left : Real_Matrix; Right : Real'Base) return Real_Matrix;
112365 function "/" (Left : Real_Matrix; Right : Real'Base) return Real_Matrix;
112366
112367 66/2
112368 {AI95-00296-01AI95-00296-01} Each operation returns the result
112369 of applying the corresponding operation of the type Real to
112370 each component of Left and to the scalar Right. The index
112371 ranges of the result are those of Left.
112372
112373 67/2
112374 function Solve (A : Real_Matrix; X : Real_Vector) return Real_Vector;
112375
112376 68/2
112377 {AI95-00296-01AI95-00296-01} This function returns a vector Y
112378 such that X is (nearly) equal to A * Y. This is the standard
112379 mathematical operation for solving a single set of linear
112380 equations. The index range of the result is A'Range(2).
112381 Constraint_Error is raised if A'Length(1), A'Length(2), and
112382 X'Length are not equal. Constraint_Error is raised if the
112383 matrix A is ill-conditioned.
112384
112385 68.a/2
112386 Discussion: The text says that Y is such that "X is (nearly)
112387 equal to A * Y" rather than "X is equal to A * Y" because
112388 rounding errors may mean that there is no value of Y such that
112389 X is exactly equal to A * Y. On the other hand it does not
112390 mean that any old rough value will do. The algorithm given
112391 under Implementation Advice should be followed.
112392
112393 68.b/2
112394 The requirement to raise Constraint_Error if the matrix is
112395 ill-conditioned is really a reflection of what will happen if
112396 the matrix is ill-conditioned. See Implementation Advice. We
112397 do not make any attempt to define ill-conditioned formally.
112398
112399 68.c/2
112400 These remarks apply to all versions of Solve and Inverse.
112401
112402 69/2
112403 function Solve (A, X : Real_Matrix) return Real_Matrix;
112404
112405 70/2
112406 {AI95-00296-01AI95-00296-01} This function returns a matrix Y
112407 such that X is (nearly) equal to A * Y. This is the standard
112408 mathematical operation for solving several sets of linear
112409 equations. The index ranges of the result are A'Range(2) and
112410 X'Range(2). Constraint_Error is raised if A'Length(1),
112411 A'Length(2), and X'Length(1) are not equal. Constraint_Error
112412 is raised if the matrix A is ill-conditioned.
112413
112414 71/2
112415 function Inverse (A : Real_Matrix) return Real_Matrix;
112416
112417 72/2
112418 {AI95-00296-01AI95-00296-01} This function returns a matrix B
112419 such that A * B is (nearly) equal to the unit matrix. The
112420 index ranges of the result are A'Range(2) and A'Range(1).
112421 Constraint_Error is raised if A'Length(1) is not equal to
112422 A'Length(2). Constraint_Error is raised if the matrix A is
112423 ill-conditioned.
112424
112425 73/2
112426 function Determinant (A : Real_Matrix) return Real'Base;
112427
112428 74/2
112429 {AI95-00296-01AI95-00296-01} This function returns the
112430 determinant of the matrix A. Constraint_Error is raised if
112431 A'Length(1) is not equal to A'Length(2).
112432
112433 75/2
112434 function Eigenvalues(A : Real_Matrix) return Real_Vector;
112435
112436 76/2
112437 {AI95-00296-01AI95-00296-01} This function returns the
112438 eigenvalues of the symmetric matrix A as a vector sorted into
112439 order with the largest first. Constraint_Error is raised if
112440 A'Length(1) is not equal to A'Length(2). The index range of
112441 the result is A'Range(1). Argument_Error is raised if the
112442 matrix A is not symmetric.
112443
112444 77/2
112445 procedure Eigensystem(A : in Real_Matrix;
112446 Values : out Real_Vector;
112447 Vectors : out Real_Matrix);
112448
112449 78/3
112450 {AI95-00296-01AI95-00296-01} {AI05-0047-1AI05-0047-1} This
112451 procedure computes both the eigenvalues and eigenvectors of
112452 the symmetric matrix A. The out parameter Values is the same
112453 as that obtained by calling the function Eigenvalues. The out
112454 parameter Vectors is a matrix whose columns are the
112455 eigenvectors of the matrix A. The order of the columns
112456 corresponds to the order of the eigenvalues. The eigenvectors
112457 are normalized and mutually orthogonal (they are orthonormal),
112458 including when there are repeated eigenvalues.
112459 Constraint_Error is raised if A'Length(1) is not equal to
112460 A'Length(2), or if Values'Range is not equal to A'Range(1), or
112461 if the index ranges of the parameter Vectors are not equal to
112462 those of A. Argument_Error is raised if the matrix A is not
112463 symmetric. Constraint_Error is also raised in
112464 implementation-defined circumstances if the algorithm used
112465 does not converge quickly enough.
112466
112467 78.a/3
112468 Ramification: {AI05-0047-1AI05-0047-1} There is no requirement
112469 on the absolute direction of the returned eigenvectors. Thus
112470 they might be multiplied by -1. It is only the ratios of the
112471 components that matter. This is standard practice.
112472
112473 79/2
112474 function Unit_Matrix (Order : Positive;
112475 First_1, First_2 : Integer := 1) return Real_Matrix;
112476
112477 80/2
112478 {AI95-00296-01AI95-00296-01} This function returns a square
112479 unit matrix with Order**2 components and lower bounds of
112480 First_1 and First_2 (for the first and second index ranges
112481 respectively). All components are set to 0.0 except for the
112482 main diagonal, whose components are set to 1.0.
112483 Constraint_Error is raised if First_1 + Order - 1 >
112484 Integer'Last or First_2 + Order - 1 > Integer'Last.
112485
112486 _Implementation Requirements_
112487
112488 81/2
112489 {AI95-00296-01AI95-00296-01} Accuracy requirements for the subprograms
112490 Solve, Inverse, Determinant, Eigenvalues and Eigensystem are
112491 implementation defined.
112492
112493 81.a/2
112494 Implementation defined: The accuracy requirements for the
112495 subprograms Solve, Inverse, Determinant, Eigenvalues and
112496 Eigensystem for type Real_Matrix.
112497
112498 82/2
112499 For operations not involving an inner product, the accuracy requirements
112500 are those of the corresponding operations of the type Real in both the
112501 strict mode and the relaxed mode (see *note G.2::).
112502
112503 83/2
112504 For operations involving an inner product, no requirements are specified
112505 in the relaxed mode. In the strict mode the modulus of the absolute
112506 error of the inner product X*Y shall not exceed g*abs(X)*abs(Y) where g
112507 is defined as
112508
112509 84/2
112510 g = X'Length * Real'Machine_Radix**(1 - Real'Model_Mantissa)
112511
112512 85/2
112513 {AI95-00418-01AI95-00418-01} For the L2-norm, no accuracy requirements
112514 are specified in the relaxed mode. In the strict mode the relative
112515 error on the norm shall not exceed g / 2.0 + 3.0 * Real'Model_Epsilon
112516 where g is defined as above.
112517
112518 85.a/2
112519 Reason: This is simply the combination of the error on the
112520 inner product with the error on Sqrt. A first order
112521 computation would lead to 2.0 * Real'Model_Epsilon above, but
112522 we are adding an extra Real'Model_Epsilon to account for
112523 higher order effects.
112524
112525 _Documentation Requirements_
112526
112527 86/2
112528 {AI95-00296-01AI95-00296-01} Implementations shall document any
112529 techniques used to reduce cancellation errors such as extended precision
112530 arithmetic.
112531
112532 86.a/2
112533 Documentation Requirement: Any techniques used to reduce
112534 cancellation errors in Numerics.Generic_Real_Arrays shall be
112535 documented.
112536
112537 86.b/2
112538 Implementation Note: The above accuracy requirement is met by
112539 the canonical implementation of the inner product by
112540 multiplication and addition using the corresponding operations
112541 of type Real'Base and performing the cumulative addition using
112542 ascending indices. Note however, that some hardware provides
112543 special operations for the computation of the inner product
112544 and although these may be fast they may not meet the accuracy
112545 requirement specified. See Accuracy and Stability of
112546 Numerical Algorithms By N J Higham (ISBN 0-89871-355-2),
112547 Section 3.1.
112548
112549 86.c/3
112550 {AI05-0047-1AI05-0047-1} Note moreover that the componentwise
112551 accuracy requirements are not met by subcubic methods for
112552 matrix multiplication such as that devised by Strassen. These
112553 methods, which are typically used for the fast multiplication
112554 of very large matrices (e.g. order more than a few
112555 thousands), have normwise accuracy properties. If it is
112556 desired to use such methods, then distinct subprograms should
112557 be provided (perhaps in a child package). See Section 22.2.2
112558 in the above reference.
112559
112560 _Implementation Permissions_
112561
112562 87/2
112563 {AI95-00296-01AI95-00296-01} The nongeneric equivalent packages may, but
112564 need not, be actual instantiations of the generic package for the
112565 appropriate predefined type.
112566
112567 _Implementation Advice_
112568
112569 88/3
112570 {AI95-00296-01AI95-00296-01} {AI05-0264-1AI05-0264-1} Implementations
112571 should implement the Solve and Inverse functions using established
112572 techniques such as LU decomposition with row interchanges followed by
112573 back and forward substitution. Implementations are recommended to
112574 refine the result by performing an iteration on the residuals; if this
112575 is done, then it should be documented.
112576
112577 88.a/2
112578 Implementation Advice: Solve and Inverse for
112579 Numerics.Generic_Real_Arrays should be implemented using
112580 established techniques such as LU decomposition and the result
112581 should be refined by an iteration on the residuals.
112582
112583 89/2
112584 It is not the intention that any special provision should be made to
112585 determine whether a matrix is ill-conditioned or not. The naturally
112586 occurring overflow (including division by zero) which will result from
112587 executing these functions with an ill-conditioned matrix and thus raise
112588 Constraint_Error is sufficient.
112589
112590 89.a/2
112591 Discussion: There isn't any advice for the implementation to
112592 document with this paragraph.
112593
112594 90/2
112595 The test that a matrix is symmetric should be performed by using the
112596 equality operator to compare the relevant components.
112597
112598 90.a/2
112599 Implementation Advice: The equality operator should be used to
112600 test that a matrix in Numerics.Generic_Real_Arrays is
112601 symmetric.
112602
112603 91/3
112604 {AI05-0047-1AI05-0047-1} An implementation should minimize the
112605 circumstances under which the algorithm used for Eigenvalues and
112606 Eigensystem fails to converge.
112607
112608 91.a.1/3
112609 Implementation Advice: An implementation should minimize the
112610 circumstances under which the algorithm used for
112611 Numerics.Generic_Real_Arrays.Eigenvalues and
112612 Numerics.Generic_Real_Arrays.Eigensystem fails to converge.
112613
112614 91.a/3
112615 Implementation Note: J. H. Wilkinson is the acknowledged
112616 expert in this area. See for example Wilkinson, J. H., and
112617 Reinsch, C. , Linear Algebra , vol II of Handbook for
112618 Automatic Computation, Springer-Verlag, or Wilkinson, J. H.,
112619 The Algebraic Eigenvalue Problem, Oxford University Press.
112620
112621 _Extensions to Ada 95_
112622
112623 91.b/2
112624 {AI95-00296-01AI95-00296-01} The package
112625 Numerics.Generic_Real_Arrays and its nongeneric equivalents
112626 are new.
112627
112628 _Wording Changes from Ada 2005_
112629
112630 91.c/3
112631 {AI05-0047-1AI05-0047-1} Correction: Corrected various
112632 accuracy and definition issues.
112633
112634 \1f
112635 File: aarm2012.info, Node: G.3.2, Prev: G.3.1, Up: G.3
112636
112637 G.3.2 Complex Vectors and Matrices
112638 ----------------------------------
112639
112640 _Static Semantics_
112641
112642 1/2
112643 {AI95-00296-01AI95-00296-01} The generic library package
112644 Numerics.Generic_Complex_Arrays has the following declaration:
112645
112646 2/2
112647 with Ada.Numerics.Generic_Real_Arrays, Ada.Numerics.Generic_Complex_Types;
112648 generic
112649 with package Real_Arrays is new
112650 Ada.Numerics.Generic_Real_Arrays (<>);
112651 use Real_Arrays;
112652 with package Complex_Types is new
112653 Ada.Numerics.Generic_Complex_Types (Real);
112654 use Complex_Types;
112655 package Ada.Numerics.Generic_Complex_Arrays is
112656 pragma Pure(Generic_Complex_Arrays);
112657
112658 3/2
112659 -- Types
112660
112661 4/2
112662 type Complex_Vector is array (Integer range <>) of Complex;
112663 type Complex_Matrix is array (Integer range <>,
112664 Integer range <>) of Complex;
112665
112666 5/2
112667 -- Subprograms for Complex_Vector types
112668
112669 6/2
112670 -- Complex_Vector selection, conversion and composition operations
112671
112672 7/2
112673 function Re (X : Complex_Vector) return Real_Vector;
112674 function Im (X : Complex_Vector) return Real_Vector;
112675
112676 8/2
112677 procedure Set_Re (X : in out Complex_Vector;
112678 Re : in Real_Vector);
112679 procedure Set_Im (X : in out Complex_Vector;
112680 Im : in Real_Vector);
112681
112682 9/2
112683 function Compose_From_Cartesian (Re : Real_Vector)
112684 return Complex_Vector;
112685 function Compose_From_Cartesian (Re, Im : Real_Vector)
112686 return Complex_Vector;
112687
112688 10/2
112689 function Modulus (X : Complex_Vector) return Real_Vector;
112690 function "abs" (Right : Complex_Vector) return Real_Vector
112691 renames Modulus;
112692 function Argument (X : Complex_Vector) return Real_Vector;
112693 function Argument (X : Complex_Vector;
112694 Cycle : Real'Base) return Real_Vector;
112695
112696 11/2
112697 function Compose_From_Polar (Modulus, Argument : Real_Vector)
112698 return Complex_Vector;
112699 function Compose_From_Polar (Modulus, Argument : Real_Vector;
112700 Cycle : Real'Base)
112701 return Complex_Vector;
112702
112703 12/2
112704 -- Complex_Vector arithmetic operations
112705
112706 13/2
112707 function "+" (Right : Complex_Vector) return Complex_Vector;
112708 function "-" (Right : Complex_Vector) return Complex_Vector;
112709 function Conjugate (X : Complex_Vector) return Complex_Vector;
112710
112711 14/2
112712 function "+" (Left, Right : Complex_Vector) return Complex_Vector;
112713 function "-" (Left, Right : Complex_Vector) return Complex_Vector;
112714
112715 15/2
112716 function "*" (Left, Right : Complex_Vector) return Complex;
112717
112718 16/3
112719 {AI05-0047-1AI05-0047-1} function "abs" (Right : Complex_Vector) return Real'Base;
112720
112721 17/2
112722 -- Mixed Real_Vector and Complex_Vector arithmetic operations
112723
112724 18/2
112725 function "+" (Left : Real_Vector;
112726 Right : Complex_Vector) return Complex_Vector;
112727 function "+" (Left : Complex_Vector;
112728 Right : Real_Vector) return Complex_Vector;
112729 function "-" (Left : Real_Vector;
112730 Right : Complex_Vector) return Complex_Vector;
112731 function "-" (Left : Complex_Vector;
112732 Right : Real_Vector) return Complex_Vector;
112733
112734 19/2
112735 function "*" (Left : Real_Vector; Right : Complex_Vector)
112736 return Complex;
112737 function "*" (Left : Complex_Vector; Right : Real_Vector)
112738 return Complex;
112739
112740 20/2
112741 -- Complex_Vector scaling operations
112742
112743 21/2
112744 function "*" (Left : Complex;
112745 Right : Complex_Vector) return Complex_Vector;
112746 function "*" (Left : Complex_Vector;
112747 Right : Complex) return Complex_Vector;
112748 function "/" (Left : Complex_Vector;
112749 Right : Complex) return Complex_Vector;
112750
112751 22/2
112752 function "*" (Left : Real'Base;
112753 Right : Complex_Vector) return Complex_Vector;
112754 function "*" (Left : Complex_Vector;
112755 Right : Real'Base) return Complex_Vector;
112756 function "/" (Left : Complex_Vector;
112757 Right : Real'Base) return Complex_Vector;
112758
112759 23/2
112760 -- Other Complex_Vector operations
112761
112762 24/2
112763 function Unit_Vector (Index : Integer;
112764 Order : Positive;
112765 First : Integer := 1) return Complex_Vector;
112766
112767 25/2
112768 -- Subprograms for Complex_Matrix types
112769
112770 26/2
112771 -- Complex_Matrix selection, conversion and composition operations
112772
112773 27/2
112774 function Re (X : Complex_Matrix) return Real_Matrix;
112775 function Im (X : Complex_Matrix) return Real_Matrix;
112776
112777 28/2
112778 procedure Set_Re (X : in out Complex_Matrix;
112779 Re : in Real_Matrix);
112780 procedure Set_Im (X : in out Complex_Matrix;
112781 Im : in Real_Matrix);
112782
112783 29/2
112784 function Compose_From_Cartesian (Re : Real_Matrix)
112785 return Complex_Matrix;
112786 function Compose_From_Cartesian (Re, Im : Real_Matrix)
112787 return Complex_Matrix;
112788
112789 30/2
112790 function Modulus (X : Complex_Matrix) return Real_Matrix;
112791 function "abs" (Right : Complex_Matrix) return Real_Matrix
112792 renames Modulus;
112793
112794 31/2
112795 function Argument (X : Complex_Matrix) return Real_Matrix;
112796 function Argument (X : Complex_Matrix;
112797 Cycle : Real'Base) return Real_Matrix;
112798
112799 32/2
112800 function Compose_From_Polar (Modulus, Argument : Real_Matrix)
112801 return Complex_Matrix;
112802 function Compose_From_Polar (Modulus, Argument : Real_Matrix;
112803 Cycle : Real'Base)
112804 return Complex_Matrix;
112805
112806 33/2
112807 -- Complex_Matrix arithmetic operations
112808
112809 34/2
112810 function "+" (Right : Complex_Matrix) return Complex_Matrix;
112811 function "-" (Right : Complex_Matrix) return Complex_Matrix;
112812 function Conjugate (X : Complex_Matrix) return Complex_Matrix;
112813 function Transpose (X : Complex_Matrix) return Complex_Matrix;
112814
112815 35/2
112816 function "+" (Left, Right : Complex_Matrix) return Complex_Matrix;
112817 function "-" (Left, Right : Complex_Matrix) return Complex_Matrix;
112818 function "*" (Left, Right : Complex_Matrix) return Complex_Matrix;
112819
112820 36/2
112821 function "*" (Left, Right : Complex_Vector) return Complex_Matrix;
112822
112823 37/2
112824 function "*" (Left : Complex_Vector;
112825 Right : Complex_Matrix) return Complex_Vector;
112826 function "*" (Left : Complex_Matrix;
112827 Right : Complex_Vector) return Complex_Vector;
112828
112829 38/2
112830 -- Mixed Real_Matrix and Complex_Matrix arithmetic operations
112831
112832 39/2
112833 function "+" (Left : Real_Matrix;
112834 Right : Complex_Matrix) return Complex_Matrix;
112835 function "+" (Left : Complex_Matrix;
112836 Right : Real_Matrix) return Complex_Matrix;
112837 function "-" (Left : Real_Matrix;
112838 Right : Complex_Matrix) return Complex_Matrix;
112839 function "-" (Left : Complex_Matrix;
112840 Right : Real_Matrix) return Complex_Matrix;
112841 function "*" (Left : Real_Matrix;
112842 Right : Complex_Matrix) return Complex_Matrix;
112843 function "*" (Left : Complex_Matrix;
112844 Right : Real_Matrix) return Complex_Matrix;
112845
112846 40/2
112847 function "*" (Left : Real_Vector;
112848 Right : Complex_Vector) return Complex_Matrix;
112849 function "*" (Left : Complex_Vector;
112850 Right : Real_Vector) return Complex_Matrix;
112851
112852 41/2
112853 function "*" (Left : Real_Vector;
112854 Right : Complex_Matrix) return Complex_Vector;
112855 function "*" (Left : Complex_Vector;
112856 Right : Real_Matrix) return Complex_Vector;
112857 function "*" (Left : Real_Matrix;
112858 Right : Complex_Vector) return Complex_Vector;
112859 function "*" (Left : Complex_Matrix;
112860 Right : Real_Vector) return Complex_Vector;
112861
112862 42/2
112863 -- Complex_Matrix scaling operations
112864
112865 43/2
112866 function "*" (Left : Complex;
112867 Right : Complex_Matrix) return Complex_Matrix;
112868 function "*" (Left : Complex_Matrix;
112869 Right : Complex) return Complex_Matrix;
112870 function "/" (Left : Complex_Matrix;
112871 Right : Complex) return Complex_Matrix;
112872
112873 44/2
112874 function "*" (Left : Real'Base;
112875 Right : Complex_Matrix) return Complex_Matrix;
112876 function "*" (Left : Complex_Matrix;
112877 Right : Real'Base) return Complex_Matrix;
112878 function "/" (Left : Complex_Matrix;
112879 Right : Real'Base) return Complex_Matrix;
112880
112881 45/2
112882 -- Complex_Matrix inversion and related operations
112883
112884 46/2
112885 function Solve (A : Complex_Matrix; X : Complex_Vector)
112886 return Complex_Vector;
112887 function Solve (A, X : Complex_Matrix) return Complex_Matrix;
112888 function Inverse (A : Complex_Matrix) return Complex_Matrix;
112889 function Determinant (A : Complex_Matrix) return Complex;
112890
112891 47/2
112892 -- Eigenvalues and vectors of a Hermitian matrix
112893
112894 48/2
112895 function Eigenvalues(A : Complex_Matrix) return Real_Vector;
112896
112897 49/2
112898 procedure Eigensystem(A : in Complex_Matrix;
112899 Values : out Real_Vector;
112900 Vectors : out Complex_Matrix);
112901
112902 50/2
112903 -- Other Complex_Matrix operations
112904
112905 51/2
112906 function Unit_Matrix (Order : Positive;
112907 First_1, First_2 : Integer := 1)
112908 return Complex_Matrix;
112909
112910 52/2
112911 end Ada.Numerics.Generic_Complex_Arrays;
112912
112913 53/2
112914 {AI95-00296-01AI95-00296-01} The library package Numerics.Complex_Arrays
112915 is declared pure and defines the same types and subprograms as
112916 Numerics.Generic_Complex_Arrays, except that the predefined type Float
112917 is systematically substituted for Real'Base, and the Real_Vector and
112918 Real_Matrix types exported by Numerics.Real_Arrays are systematically
112919 substituted for Real_Vector and Real_Matrix, and the Complex type
112920 exported by Numerics.Complex_Types is systematically substituted for
112921 Complex, throughout. Nongeneric equivalents for each of the other
112922 predefined floating point types are defined similarly, with the names
112923 Numerics.Short_Complex_Arrays, Numerics.Long_Complex_Arrays, etc.
112924
112925 54/2
112926 {AI95-00296-01AI95-00296-01} Two types are defined and exported by
112927 Numerics.Generic_Complex_Arrays. The composite type Complex_Vector is
112928 provided to represent a vector with components of type Complex; it is
112929 defined as an unconstrained one-dimensional array with an index of type
112930 Integer. The composite type Complex_Matrix is provided to represent a
112931 matrix with components of type Complex; it is defined as an
112932 unconstrained, two-dimensional array with indices of type Integer.
112933
112934 55/2
112935 {AI95-00296-01AI95-00296-01} The effect of the various subprograms is as
112936 described below. In many cases they are described in terms of
112937 corresponding scalar operations in Numerics.Generic_Complex_Types. Any
112938 exception raised by those operations is propagated by the array
112939 subprogram. Moreover, any constraints on the parameters and the
112940 accuracy of the result for each individual component are as defined for
112941 the scalar operation.
112942
112943 56/2
112944 {AI95-00296-01AI95-00296-01} In the case of those operations which are
112945 defined to involve an inner product, Constraint_Error may be raised if
112946 an intermediate result has a component outside the range of Real'Base
112947 even though the final mathematical result would not.
112948
112949 56.a/3
112950 Discussion: {AI05-0047-1AI05-0047-1} An inner product never
112951 involves implicit complex conjugation. If the product of a
112952 vector with the conjugate of another (or the same) vector is
112953 required, then this has to be stated explicitly by writing for
112954 example X * Conjugate(Y). This mimics the usual mathematical
112955 notation.
112956
112957 57/2
112958 function Re (X : Complex_Vector) return Real_Vector;
112959 function Im (X : Complex_Vector) return Real_Vector;
112960
112961 58/2
112962 {AI95-00296-01AI95-00296-01} Each function returns a vector of
112963 the specified Cartesian components of X. The index range of
112964 the result is X'Range.
112965
112966 59/2
112967 procedure Set_Re (X : in out Complex_Vector; Re : in Real_Vector);
112968 procedure Set_Im (X : in out Complex_Vector; Im : in Real_Vector);
112969
112970 60/2
112971 {AI95-00296-01AI95-00296-01} Each procedure replaces the
112972 specified (Cartesian) component of each of the components of X
112973 by the value of the matching component of Re or Im; the other
112974 (Cartesian) component of each of the components is unchanged.
112975 Constraint_Error is raised if X'Length is not equal to
112976 Re'Length or Im'Length.
112977
112978 61/2
112979 function Compose_From_Cartesian (Re : Real_Vector)
112980 return Complex_Vector;
112981 function Compose_From_Cartesian (Re, Im : Real_Vector)
112982 return Complex_Vector;
112983
112984 62/2
112985 {AI95-00296-01AI95-00296-01} Each function constructs a vector
112986 of Complex results (in Cartesian representation) formed from
112987 given vectors of Cartesian components; when only the real
112988 components are given, imaginary components of zero are
112989 assumed. The index range of the result is Re'Range.
112990 Constraint_Error is raised if Re'Length is not equal to
112991 Im'Length.
112992
112993 63/2
112994 function Modulus (X : Complex_Vector) return Real_Vector;
112995 function "abs" (Right : Complex_Vector) return Real_Vector
112996 renames Modulus;
112997 function Argument (X : Complex_Vector) return Real_Vector;
112998 function Argument (X : Complex_Vector;
112999 Cycle : Real'Base) return Real_Vector;
113000
113001 64/2
113002 {AI95-00296-01AI95-00296-01} Each function calculates and
113003 returns a vector of the specified polar components of X or
113004 Right using the corresponding function in
113005 numerics.generic_complex_types. The index range of the result
113006 is X'Range or Right'Range.
113007
113008 65/2
113009 function Compose_From_Polar (Modulus, Argument : Real_Vector)
113010 return Complex_Vector;
113011 function Compose_From_Polar (Modulus, Argument : Real_Vector;
113012 Cycle : Real'Base)
113013 return Complex_Vector;
113014
113015 66/2
113016 {AI95-00296-01AI95-00296-01} Each function constructs a vector
113017 of Complex results (in Cartesian representation) formed from
113018 given vectors of polar components using the corresponding
113019 function in numerics.generic_complex_types on matching
113020 components of Modulus and Argument. The index range of the
113021 result is Modulus'Range. Constraint_Error is raised if
113022 Modulus'Length is not equal to Argument'Length.
113023
113024 67/2
113025 function "+" (Right : Complex_Vector) return Complex_Vector;
113026 function "-" (Right : Complex_Vector) return Complex_Vector;
113027
113028 68/2
113029 {AI95-00296-01AI95-00296-01} Each operation returns the result
113030 of applying the corresponding operation in
113031 numerics.generic_complex_types to each component of Right.
113032 The index range of the result is Right'Range.
113033
113034 69/2
113035 function Conjugate (X : Complex_Vector) return Complex_Vector;
113036
113037 70/2
113038 {AI95-00296-01AI95-00296-01} This function returns the result
113039 of applying the appropriate function Conjugate in
113040 numerics.generic_complex_types to each component of X. The
113041 index range of the result is X'Range.
113042
113043 71/2
113044 function "+" (Left, Right : Complex_Vector) return Complex_Vector;
113045 function "-" (Left, Right : Complex_Vector) return Complex_Vector;
113046
113047 72/2
113048 {AI95-00296-01AI95-00296-01} Each operation returns the result
113049 of applying the corresponding operation in
113050 numerics.generic_complex_types to each component of Left and
113051 the matching component of Right. The index range of the
113052 result is Left'Range. Constraint_Error is raised if
113053 Left'Length is not equal to Right'Length.
113054
113055 73/2
113056 function "*" (Left, Right : Complex_Vector) return Complex;
113057
113058 74/2
113059 {AI95-00296-01AI95-00296-01} This operation returns the inner
113060 product of Left and Right. Constraint_Error is raised if
113061 Left'Length is not equal to Right'Length. This operation
113062 involves an inner product.
113063
113064 75/3
113065 {AI05-0047-1AI05-0047-1} function "abs" (Right : Complex_Vector) return Real'Base;
113066
113067 76/2
113068 {AI95-00418-01AI95-00418-01} This operation returns the
113069 Hermitian L2-norm of Right (the square root of the inner
113070 product of the vector with its conjugate).
113071
113072 76.a/2
113073 Implementation Note: While the definition is given in terms of
113074 an inner product, the norm doesn't "involve an inner product"
113075 in the technical sense. The reason is that it has accuracy
113076 requirements substantially different from those applicable to
113077 inner products; and that cancellations cannot occur, because
113078 all the terms are positive, so there is no possibility of
113079 intermediate overflow.
113080
113081 77/2
113082 function "+" (Left : Real_Vector;
113083 Right : Complex_Vector) return Complex_Vector;
113084 function "+" (Left : Complex_Vector;
113085 Right : Real_Vector) return Complex_Vector;
113086 function "-" (Left : Real_Vector;
113087 Right : Complex_Vector) return Complex_Vector;
113088 function "-" (Left : Complex_Vector;
113089 Right : Real_Vector) return Complex_Vector;
113090
113091 78/2
113092 {AI95-00296-01AI95-00296-01} Each operation returns the result
113093 of applying the corresponding operation in
113094 numerics.generic_complex_types to each component of Left and
113095 the matching component of Right. The index range of the
113096 result is Left'Range. Constraint_Error is raised if
113097 Left'Length is not equal to Right'Length.
113098
113099 79/2
113100 function "*" (Left : Real_Vector; Right : Complex_Vector) return Complex;
113101 function "*" (Left : Complex_Vector; Right : Real_Vector) return Complex;
113102
113103 80/2
113104 {AI95-00296-01AI95-00296-01} Each operation returns the inner
113105 product of Left and Right. Constraint_Error is raised if
113106 Left'Length is not equal to Right'Length. These operations
113107 involve an inner product.
113108
113109 81/2
113110 function "*" (Left : Complex; Right : Complex_Vector) return Complex_Vector;
113111
113112 82/2
113113 {AI95-00296-01AI95-00296-01} This operation returns the result
113114 of multiplying each component of Right by the complex number
113115 Left using the appropriate operation "*" in
113116 numerics.generic_complex_types. The index range of the result
113117 is Right'Range.
113118
113119 83/2
113120 function "*" (Left : Complex_Vector; Right : Complex) return Complex_Vector;
113121 function "/" (Left : Complex_Vector; Right : Complex) return Complex_Vector;
113122
113123 84/2
113124 {AI95-00296-01AI95-00296-01} Each operation returns the result
113125 of applying the corresponding operation in
113126 numerics.generic_complex_types to each component of the vector
113127 Left and the complex number Right. The index range of the
113128 result is Left'Range.
113129
113130 85/2
113131 function "*" (Left : Real'Base;
113132 Right : Complex_Vector) return Complex_Vector;
113133
113134 86/2
113135 {AI95-00296-01AI95-00296-01} This operation returns the result
113136 of multiplying each component of Right by the real number Left
113137 using the appropriate operation "*" in
113138 numerics.generic_complex_types. The index range of the result
113139 is Right'Range.
113140
113141 87/2
113142 function "*" (Left : Complex_Vector;
113143 Right : Real'Base) return Complex_Vector;
113144 function "/" (Left : Complex_Vector;
113145 Right : Real'Base) return Complex_Vector;
113146
113147 88/2
113148 {AI95-00296-01AI95-00296-01} Each operation returns the result
113149 of applying the corresponding operation in
113150 numerics.generic_complex_types to each component of the vector
113151 Left and the real number Right. The index range of the result
113152 is Left'Range.
113153
113154 89/2
113155 function Unit_Vector (Index : Integer;
113156 Order : Positive;
113157 First : Integer := 1) return Complex_Vector;
113158
113159 90/2
113160 {AI95-00296-01AI95-00296-01} This function returns a unit
113161 vector with Order components and a lower bound of First. All
113162 components are set to (0.0, 0.0) except for the Index
113163 component which is set to (1.0, 0.0). Constraint_Error is
113164 raised if Index < First, Index > First + Order - 1, or if
113165 First + Order - 1 > Integer'Last.
113166
113167 91/2
113168 function Re (X : Complex_Matrix) return Real_Matrix;
113169 function Im (X : Complex_Matrix) return Real_Matrix;
113170
113171 92/2
113172 {AI95-00296-01AI95-00296-01} Each function returns a matrix of
113173 the specified Cartesian components of X. The index ranges of
113174 the result are those of X.
113175
113176 93/2
113177 procedure Set_Re (X : in out Complex_Matrix; Re : in Real_Matrix);
113178 procedure Set_Im (X : in out Complex_Matrix; Im : in Real_Matrix);
113179
113180 94/2
113181 {AI95-00296-01AI95-00296-01} Each procedure replaces the
113182 specified (Cartesian) component of each of the components of X
113183 by the value of the matching component of Re or Im; the other
113184 (Cartesian) component of each of the components is unchanged.
113185 Constraint_Error is raised if X'Length(1) is not equal to
113186 Re'Length(1) or Im'Length(1) or if X'Length(2) is not equal to
113187 Re'Length(2) or Im'Length(2).
113188
113189 95/2
113190 function Compose_From_Cartesian (Re : Real_Matrix)
113191 return Complex_Matrix;
113192 function Compose_From_Cartesian (Re, Im : Real_Matrix)
113193 return Complex_Matrix;
113194
113195 96/2
113196 {AI95-00296-01AI95-00296-01} Each function constructs a matrix
113197 of Complex results (in Cartesian representation) formed from
113198 given matrices of Cartesian components; when only the real
113199 components are given, imaginary components of zero are
113200 assumed. The index ranges of the result are those of Re.
113201 Constraint_Error is raised if Re'Length(1) is not equal to
113202 Im'Length(1) or Re'Length(2) is not equal to Im'Length(2).
113203
113204 97/2
113205 function Modulus (X : Complex_Matrix) return Real_Matrix;
113206 function "abs" (Right : Complex_Matrix) return Real_Matrix
113207 renames Modulus;
113208 function Argument (X : Complex_Matrix) return Real_Matrix;
113209 function Argument (X : Complex_Matrix;
113210 Cycle : Real'Base) return Real_Matrix;
113211
113212 98/2
113213 {AI95-00296-01AI95-00296-01} Each function calculates and
113214 returns a matrix of the specified polar components of X or
113215 Right using the corresponding function in
113216 numerics.generic_complex_types. The index ranges of the
113217 result are those of X or Right.
113218
113219 99/2
113220 function Compose_From_Polar (Modulus, Argument : Real_Matrix)
113221 return Complex_Matrix;
113222 function Compose_From_Polar (Modulus, Argument : Real_Matrix;
113223 Cycle : Real'Base)
113224 return Complex_Matrix;
113225
113226 100/2
113227 {AI95-00296-01AI95-00296-01} Each function constructs a matrix
113228 of Complex results (in Cartesian representation) formed from
113229 given matrices of polar components using the corresponding
113230 function in numerics.generic_complex_types on matching
113231 components of Modulus and Argument. The index ranges of the
113232 result are those of Modulus. Constraint_Error is raised if
113233 Modulus'Length(1) is not equal to Argument'Length(1) or
113234 Modulus'Length(2) is not equal to Argument'Length(2).
113235
113236 101/2
113237 function "+" (Right : Complex_Matrix) return Complex_Matrix;
113238 function "-" (Right : Complex_Matrix) return Complex_Matrix;
113239
113240 102/2
113241 {AI95-00296-01AI95-00296-01} Each operation returns the result
113242 of applying the corresponding operation in
113243 numerics.generic_complex_types to each component of Right.
113244 The index ranges of the result are those of Right.
113245
113246 103/2
113247 function Conjugate (X : Complex_Matrix) return Complex_Matrix;
113248
113249 104/2
113250 {AI95-00296-01AI95-00296-01} This function returns the result
113251 of applying the appropriate function Conjugate in
113252 numerics.generic_complex_types to each component of X. The
113253 index ranges of the result are those of X.
113254
113255 105/2
113256 function Transpose (X : Complex_Matrix) return Complex_Matrix;
113257
113258 106/2
113259 {AI95-00296-01AI95-00296-01} This function returns the
113260 transpose of a matrix X. The first and second index ranges of
113261 the result are X'Range(2) and X'Range(1) respectively.
113262
113263 107/2
113264 function "+" (Left, Right : Complex_Matrix) return Complex_Matrix;
113265 function "-" (Left, Right : Complex_Matrix) return Complex_Matrix;
113266
113267 108/2
113268 {AI95-00296-01AI95-00296-01} Each operation returns the result
113269 of applying the corresponding operation in
113270 numerics.generic_complex_types to each component of Left and
113271 the matching component of Right. The index ranges of the
113272 result are those of Left. Constraint_Error is raised if
113273 Left'Length(1) is not equal to Right'Length(1) or
113274 Left'Length(2) is not equal to Right'Length(2).
113275
113276 109/2
113277 function "*" (Left, Right : Complex_Matrix) return Complex_Matrix;
113278
113279 110/2
113280 {AI95-00296-01AI95-00296-01} This operation provides the
113281 standard mathematical operation for matrix multiplication.
113282 The first and second index ranges of the result are
113283 Left'Range(1) and Right'Range(2) respectively.
113284 Constraint_Error is raised if Left'Length(2) is not equal to
113285 Right'Length(1). This operation involves inner products.
113286
113287 111/2
113288 function "*" (Left, Right : Complex_Vector) return Complex_Matrix;
113289
113290 112/2
113291 {AI95-00296-01AI95-00296-01} This operation returns the outer
113292 product of a (column) vector Left by a (row) vector Right
113293 using the appropriate operation "*" in
113294 numerics.generic_complex_types for computing the individual
113295 components. The first and second index ranges of the result
113296 are Left'Range and Right'Range respectively.
113297
113298 113/2
113299 function "*" (Left : Complex_Vector;
113300 Right : Complex_Matrix) return Complex_Vector;
113301
113302 114/2
113303 {AI95-00296-01AI95-00296-01} This operation provides the
113304 standard mathematical operation for multiplication of a (row)
113305 vector Left by a matrix Right. The index range of the (row)
113306 vector result is Right'Range(2). Constraint_Error is raised
113307 if Left'Length is not equal to Right'Length(1). This
113308 operation involves inner products.
113309
113310 115/2
113311 function "*" (Left : Complex_Matrix;
113312 Right : Complex_Vector) return Complex_Vector;
113313
113314 116/2
113315 {AI95-00296-01AI95-00296-01} This operation provides the
113316 standard mathematical operation for multiplication of a matrix
113317 Left by a (column) vector Right. The index range of the
113318 (column) vector result is Left'Range(1). Constraint_Error is
113319 raised if Left'Length(2) is not equal to Right'Length. This
113320 operation involves inner products.
113321
113322 117/2
113323 function "+" (Left : Real_Matrix;
113324 Right : Complex_Matrix) return Complex_Matrix;
113325 function "+" (Left : Complex_Matrix;
113326 Right : Real_Matrix) return Complex_Matrix;
113327 function "-" (Left : Real_Matrix;
113328 Right : Complex_Matrix) return Complex_Matrix;
113329 function "-" (Left : Complex_Matrix;
113330 Right : Real_Matrix) return Complex_Matrix;
113331
113332 118/2
113333 {AI95-00296-01AI95-00296-01} Each operation returns the result
113334 of applying the corresponding operation in
113335 numerics.generic_complex_types to each component of Left and
113336 the matching component of Right. The index ranges of the
113337 result are those of Left. Constraint_Error is raised if
113338 Left'Length(1) is not equal to Right'Length(1) or
113339 Left'Length(2) is not equal to Right'Length(2).
113340
113341 119/2
113342 function "*" (Left : Real_Matrix;
113343 Right : Complex_Matrix) return Complex_Matrix;
113344 function "*" (Left : Complex_Matrix;
113345 Right : Real_Matrix) return Complex_Matrix;
113346
113347 120/2
113348 {AI95-00296-01AI95-00296-01} Each operation provides the
113349 standard mathematical operation for matrix multiplication.
113350 The first and second index ranges of the result are
113351 Left'Range(1) and Right'Range(2) respectively.
113352 Constraint_Error is raised if Left'Length(2) is not equal to
113353 Right'Length(1). These operations involve inner products.
113354
113355 121/2
113356 function "*" (Left : Real_Vector;
113357 Right : Complex_Vector) return Complex_Matrix;
113358 function "*" (Left : Complex_Vector;
113359 Right : Real_Vector) return Complex_Matrix;
113360
113361 122/2
113362 {AI95-00296-01AI95-00296-01} Each operation returns the outer
113363 product of a (column) vector Left by a (row) vector Right
113364 using the appropriate operation "*" in
113365 numerics.generic_complex_types for computing the individual
113366 components. The first and second index ranges of the result
113367 are Left'Range and Right'Range respectively.
113368
113369 123/2
113370 function "*" (Left : Real_Vector;
113371 Right : Complex_Matrix) return Complex_Vector;
113372 function "*" (Left : Complex_Vector;
113373 Right : Real_Matrix) return Complex_Vector;
113374
113375 124/2
113376 {AI95-00296-01AI95-00296-01} Each operation provides the
113377 standard mathematical operation for multiplication of a (row)
113378 vector Left by a matrix Right. The index range of the (row)
113379 vector result is Right'Range(2). Constraint_Error is raised
113380 if Left'Length is not equal to Right'Length(1). These
113381 operations involve inner products.
113382
113383 125/2
113384 function "*" (Left : Real_Matrix;
113385 Right : Complex_Vector) return Complex_Vector;
113386 function "*" (Left : Complex_Matrix;
113387 Right : Real_Vector) return Complex_Vector;
113388
113389 126/2
113390 {AI95-00296-01AI95-00296-01} Each operation provides the
113391 standard mathematical operation for multiplication of a matrix
113392 Left by a (column) vector Right. The index range of the
113393 (column) vector result is Left'Range(1). Constraint_Error is
113394 raised if Left'Length(2) is not equal to Right'Length. These
113395 operations involve inner products.
113396
113397 127/2
113398 function "*" (Left : Complex; Right : Complex_Matrix) return Complex_Matrix;
113399
113400 128/2
113401 {AI95-00296-01AI95-00296-01} This operation returns the result
113402 of multiplying each component of Right by the complex number
113403 Left using the appropriate operation "*" in
113404 numerics.generic_complex_types. The index ranges of the
113405 result are those of Right.
113406
113407 129/2
113408 function "*" (Left : Complex_Matrix; Right : Complex) return Complex_Matrix;
113409 function "/" (Left : Complex_Matrix; Right : Complex) return Complex_Matrix;
113410
113411 130/2
113412 {AI95-00296-01AI95-00296-01} Each operation returns the result
113413 of applying the corresponding operation in
113414 numerics.generic_complex_types to each component of the matrix
113415 Left and the complex number Right. The index ranges of the
113416 result are those of Left.
113417
113418 131/2
113419 function "*" (Left : Real'Base;
113420 Right : Complex_Matrix) return Complex_Matrix;
113421
113422 132/2
113423 {AI95-00296-01AI95-00296-01} This operation returns the result
113424 of multiplying each component of Right by the real number Left
113425 using the appropriate operation "*" in
113426 numerics.generic_complex_types. The index ranges of the
113427 result are those of Right.
113428
113429 133/2
113430 function "*" (Left : Complex_Matrix;
113431 Right : Real'Base) return Complex_Matrix;
113432 function "/" (Left : Complex_Matrix;
113433 Right : Real'Base) return Complex_Matrix;
113434
113435 134/2
113436 {AI95-00296-01AI95-00296-01} Each operation returns the result
113437 of applying the corresponding operation in
113438 numerics.generic_complex_types to each component of the matrix
113439 Left and the real number Right. The index ranges of the
113440 result are those of Left.
113441
113442 135/2
113443 function Solve (A : Complex_Matrix; X : Complex_Vector) return Complex_Vector;
113444
113445 136/2
113446 {AI95-00296-01AI95-00296-01} This function returns a vector Y
113447 such that X is (nearly) equal to A * Y. This is the standard
113448 mathematical operation for solving a single set of linear
113449 equations. The index range of the result is A'Range(2).
113450 Constraint_Error is raised if A'Length(1), A'Length(2), and
113451 X'Length are not equal. Constraint_Error is raised if the
113452 matrix A is ill-conditioned.
113453
113454 136.a/2
113455 Discussion: The text says that Y is such that "X is (nearly)
113456 equal to A * Y" rather than "X is equal to A * Y" because
113457 rounding errors may mean that there is no value of Y such that
113458 X is exactly equal to A * Y. On the other hand it does not
113459 mean that any old rough value will do. The algorithm given
113460 under Implementation Advice should be followed.
113461
113462 136.b/2
113463 The requirement to raise Constraint_Error if the matrix is
113464 ill-conditioned is really a reflection of what will happen if
113465 the matrix is ill-conditioned. See Implementation Advice. We
113466 do not make any attempt to define ill-conditioned formally.
113467
113468 136.c/2
113469 These remarks apply to all versions of Solve and Inverse.
113470
113471 137/2
113472 function Solve (A, X : Complex_Matrix) return Complex_Matrix;
113473
113474 138/2
113475 {AI95-00296-01AI95-00296-01} This function returns a matrix Y
113476 such that X is (nearly) equal to A * Y. This is the standard
113477 mathematical operation for solving several sets of linear
113478 equations. The index ranges of the result are A'Range(2) and
113479 X'Range(2). Constraint_Error is raised if A'Length(1),
113480 A'Length(2), and X'Length(1) are not equal. Constraint_Error
113481 is raised if the matrix A is ill-conditioned.
113482
113483 139/2
113484 function Inverse (A : Complex_Matrix) return Complex_Matrix;
113485
113486 140/2
113487 {AI95-00296-01AI95-00296-01} This function returns a matrix B
113488 such that A * B is (nearly) equal to the unit matrix. The
113489 index ranges of the result are A'Range(2) and A'Range(1).
113490 Constraint_Error is raised if A'Length(1) is not equal to
113491 A'Length(2). Constraint_Error is raised if the matrix A is
113492 ill-conditioned.
113493
113494 141/2
113495 function Determinant (A : Complex_Matrix) return Complex;
113496
113497 142/2
113498 {AI95-00296-01AI95-00296-01} This function returns the
113499 determinant of the matrix A. Constraint_Error is raised if
113500 A'Length(1) is not equal to A'Length(2).
113501
113502 143/2
113503 function Eigenvalues(A : Complex_Matrix) return Real_Vector;
113504
113505 144/2
113506 {AI95-00296-01AI95-00296-01} This function returns the
113507 eigenvalues of the Hermitian matrix A as a vector sorted into
113508 order with the largest first. Constraint_Error is raised if
113509 A'Length(1) is not equal to A'Length(2). The index range of
113510 the result is A'Range(1). Argument_Error is raised if the
113511 matrix A is not Hermitian.
113512
113513 144.a/2
113514 Discussion: A Hermitian matrix is one whose transpose is equal
113515 to its complex conjugate. The eigenvalues of a Hermitian
113516 matrix are always real. We only support this case because
113517 algorithms for solving the general case are inherently
113518 unstable.
113519
113520 145/2
113521 procedure Eigensystem(A : in Complex_Matrix;
113522 Values : out Real_Vector;
113523 Vectors : out Complex_Matrix);
113524
113525 146/3
113526 {AI95-00296-01AI95-00296-01} {AI05-0047-1AI05-0047-1} This
113527 procedure computes both the eigenvalues and eigenvectors of
113528 the Hermitian matrix A. The out parameter Values is the same
113529 as that obtained by calling the function Eigenvalues. The out
113530 parameter Vectors is a matrix whose columns are the
113531 eigenvectors of the matrix A. The order of the columns
113532 corresponds to the order of the eigenvalues. The eigenvectors
113533 are mutually orthonormal, including when there are repeated
113534 eigenvalues. Constraint_Error is raised if A'Length(1) is not
113535 equal to A'Length(2), or if Values'Range is not equal to
113536 A'Range(1), or if the index ranges of the parameter Vectors
113537 are not equal to those of A. Argument_Error is raised if the
113538 matrix A is not Hermitian. Constraint_Error is also raised in
113539 implementation-defined circumstances if the algorithm used
113540 does not converge quickly enough.
113541
113542 146.a/3
113543 Ramification: {AI05-0047-1AI05-0047-1} There is no requirement
113544 on the absolute direction of the returned eigenvectors. Thus
113545 they might be multiplied by any complex number whose modulus
113546 is 1. It is only the ratios of the components that matter.
113547 This is standard practice.
113548
113549 147/2
113550 function Unit_Matrix (Order : Positive;
113551 First_1, First_2 : Integer := 1)
113552 return Complex_Matrix;
113553
113554 148/2
113555 {AI95-00296-01AI95-00296-01} This function returns a square
113556 unit matrix with Order**2 components and lower bounds of
113557 First_1 and First_2 (for the first and second index ranges
113558 respectively). All components are set to (0.0, 0.0) except
113559 for the main diagonal, whose components are set to (1.0, 0.0).
113560 Constraint_Error is raised if First_1 + Order - 1 >
113561 Integer'Last or First_2 + Order - 1 > Integer'Last.
113562
113563 _Implementation Requirements_
113564
113565 149/2
113566 {AI95-00296-01AI95-00296-01} Accuracy requirements for the subprograms
113567 Solve, Inverse, Determinant, Eigenvalues and Eigensystem are
113568 implementation defined.
113569
113570 149.a/2
113571 Implementation defined: The accuracy requirements for the
113572 subprograms Solve, Inverse, Determinant, Eigenvalues and
113573 Eigensystem for type Complex_Matrix.
113574
113575 150/2
113576 {AI95-00296-01AI95-00296-01} For operations not involving an inner
113577 product, the accuracy requirements are those of the corresponding
113578 operations of the type Real'Base and Complex in both the strict mode and
113579 the relaxed mode (see *note G.2::).
113580
113581 151/2
113582 {AI95-00296-01AI95-00296-01} For operations involving an inner product,
113583 no requirements are specified in the relaxed mode. In the strict mode
113584 the modulus of the absolute error of the inner product X*Y shall not
113585 exceed g*abs(X)*abs(Y) where g is defined as
113586
113587 152/2
113588 g = X'Length * Real'Machine_Radix**(1 - Real'Model_Mantissa)
113589 for mixed complex and real operands
113590
113591 153/2
113592 g = sqrt(2.0) * X'Length * Real'Machine_Radix**(1 - Real'Model_Mantissa)
113593 for two complex operands
113594
113595 154/2
113596 {AI95-00418-01AI95-00418-01} For the L2-norm, no accuracy requirements
113597 are specified in the relaxed mode. In the strict mode the relative
113598 error on the norm shall not exceed g / 2.0 + 3.0 * Real'Model_Epsilon
113599 where g has the definition appropriate for two complex operands.
113600
113601 _Documentation Requirements_
113602
113603 155/2
113604 {AI95-00296-01AI95-00296-01} Implementations shall document any
113605 techniques used to reduce cancellation errors such as extended precision
113606 arithmetic.
113607
113608 155.a/2
113609 Documentation Requirement: Any techniques used to reduce
113610 cancellation errors in Numerics.Generic_Complex_Arrays shall
113611 be documented.
113612
113613 155.b/2
113614 Implementation Note: The above accuracy requirement is met by
113615 the canonical implementation of the inner product by
113616 multiplication and addition using the corresponding operations
113617 of type Complex and performing the cumulative addition using
113618 ascending indices. Note however, that some hardware provides
113619 special operations for the computation of the inner product
113620 and although these may be fast they may not meet the accuracy
113621 requirement specified. See Accuracy and Stability of
113622 Numerical Algorithms by N J Higham (ISBN 0-89871-355-2),
113623 Sections 3.1 and 3.6.
113624
113625 _Implementation Permissions_
113626
113627 156/2
113628 {AI95-00296-01AI95-00296-01} The nongeneric equivalent packages may, but
113629 need not, be actual instantiations of the generic package for the
113630 appropriate predefined type.
113631
113632 157/2
113633 {AI95-00296-01AI95-00296-01} Although many operations are defined in
113634 terms of operations from numerics.generic_complex_types, they need not
113635 be implemented by calling those operations provided that the effect is
113636 the same.
113637
113638 _Implementation Advice_
113639
113640 158/3
113641 {AI95-00296-01AI95-00296-01} {AI05-0264-1AI05-0264-1} Implementations
113642 should implement the Solve and Inverse functions using established
113643 techniques. Implementations are recommended to refine the result by
113644 performing an iteration on the residuals; if this is done, then it
113645 should be documented.
113646
113647 158.a/2
113648 Implementation Advice: Solve and Inverse for
113649 Numerics.Generic_Complex_Arrays should be implemented using
113650 established techniques and the result should be refined by an
113651 iteration on the residuals.
113652
113653 159/2
113654 {AI95-00296-01AI95-00296-01} It is not the intention that any special
113655 provision should be made to determine whether a matrix is
113656 ill-conditioned or not. The naturally occurring overflow (including
113657 division by zero) which will result from executing these functions with
113658 an ill-conditioned matrix and thus raise Constraint_Error is sufficient.
113659
113660 159.a/2
113661 Discussion: There isn't any advice for the implementation to
113662 document with this paragraph.
113663
113664 160/2
113665 {AI95-00296-01AI95-00296-01} The test that a matrix is Hermitian should
113666 use the equality operator to compare the real components and negation
113667 followed by equality to compare the imaginary components (see *note
113668 G.2.1::).
113669
113670 160.a/2
113671 Implementation Advice: The equality and negation operators
113672 should be used to test that a matrix is Hermitian.
113673
113674 160.1/3
113675 An implementation should minimize the circumstances under which the
113676 algorithm used for Eigenvalues and Eigensystem fails to converge.
113677
113678 160.a.1/3
113679 Implementation Advice: An implementation should minimize the
113680 circumstances under which the algorithm used for
113681 Numerics.Generic_Complex_Arrays.Eigenvalues and
113682 Numerics.Generic_Complex_Arrays.Eigensystem fails to converge.
113683
113684 160.b/3
113685 Implementation Note: J. H. Wilkinson is the acknowledged
113686 expert in this area. See for example Wilkinson, J. H., and
113687 Reinsch, C. , Linear Algebra , vol II of Handbook for
113688 Automatic Computation, Springer-Verlag, or Wilkinson, J. H.,
113689 The Algebraic Eigenvalue Problem, Oxford University Press.
113690
113691 161/2
113692 {AI95-00296-01AI95-00296-01} Implementations should not perform
113693 operations on mixed complex and real operands by first converting the
113694 real operand to complex. See *note G.1.1::.
113695
113696 161.a/2
113697 Implementation Advice: Mixed real and complex operations
113698 should not be performed by converting the real operand to
113699 complex.
113700
113701 _Extensions to Ada 95_
113702
113703 161.b/2
113704 {AI95-00296-01AI95-00296-01} The package
113705 Numerics.Generic_Complex_Arrays and its nongeneric equivalents
113706 are new.
113707
113708 _Wording Changes from Ada 2005_
113709
113710 161.c/3
113711 {AI05-0047-1AI05-0047-1} Correction: Corrected various
113712 accuracy and definition issues.
113713
113714 \1f
113715 File: aarm2012.info, Node: Annex H, Next: Annex J, Prev: Annex G, Up: Top
113716
113717 Annex H High Integrity Systems
113718 ******************************
113719
113720 1/2
113721 {AI95-00347-01AI95-00347-01} This Annex addresses requirements for high
113722 integrity systems (including safety-critical systems and
113723 security-critical systems). It provides facilities and specifies
113724 documentation requirements that relate to several needs:
113725
113726 2
113727 * Understanding program execution;
113728
113729 3
113730 * Reviewing object code;
113731
113732 4
113733 * Restricting language constructs whose usage might complicate the
113734 demonstration of program correctness
113735
113736 4.1
113737 Execution understandability is supported by pragma Normalize_Scalars,
113738 and also by requirements for the implementation to document the effect
113739 of a program in the presence of a bounded error or where the language
113740 rules leave the effect unspecified.
113741
113742 5
113743 The pragmas Reviewable and Restrictions relate to the other requirements
113744 addressed by this Annex.
113745
113746 NOTES
113747
113748 6
113749 1 The Valid attribute (see *note 13.9.2::) is also useful in
113750 addressing these needs, to avoid problems that could otherwise
113751 arise from scalars that have values outside their declared range
113752 constraints.
113753
113754 6.a
113755 Discussion: The Annex tries to provide high assurance rather
113756 than language features. However, it is not possible, in
113757 general, to test for high assurance. For any specific
113758 language feature, it is possible to demonstrate its presence
113759 by a functional test, as in the ACVC. One can also check for
113760 the presence of some documentation requirements, but it is not
113761 easy to determine objectively that the documentation is
113762 "adequate".
113763
113764 _Extensions to Ada 83_
113765
113766 6.b
113767 This Annex is new to Ada 95.
113768
113769 _Wording Changes from Ada 95_
113770
113771 6.c/2
113772 {AI95-00347-01AI95-00347-01} The title of this annex was
113773 changed to better reflect its purpose and scope. High
113774 integrity systems has become the standard way of identifying
113775 systems that have high reliability requirements; it subsumes
113776 terms such as safety and security. Moreover, the annex does
113777 not include any security specific features and as such the
113778 previous title is somewhat misleading.
113779
113780 * Menu:
113781
113782 * H.1 :: Pragma Normalize_Scalars
113783 * H.2 :: Documentation of Implementation Decisions
113784 * H.3 :: Reviewable Object Code
113785 * H.4 :: High Integrity Restrictions
113786 * H.5 :: Pragma Detect_Blocking
113787 * H.6 :: Pragma Partition_Elaboration_Policy
113788
113789 \1f
113790 File: aarm2012.info, Node: H.1, Next: H.2, Up: Annex H
113791
113792 H.1 Pragma Normalize_Scalars
113793 ============================
113794
113795 1
113796 This pragma ensures that an otherwise uninitialized scalar object is set
113797 to a predictable value, but out of range if possible.
113798
113799 1.a
113800 Discussion: The goal of the pragma is to reduce the impact of
113801 a bounded error that results from a reference to an
113802 uninitialized scalar object, by having such a reference
113803 violate a range check and thus raise Constraint_Error.
113804
113805 _Syntax_
113806
113807 2
113808 The form of a pragma Normalize_Scalars is as follows:
113809
113810 3
113811 pragma Normalize_Scalars;
113812
113813 _Post-Compilation Rules_
113814
113815 4
113816 Pragma Normalize_Scalars is a configuration pragma. It applies to all
113817 compilation_units included in a partition.
113818
113819 _Documentation Requirements_
113820
113821 5/2
113822 {AI95-00434-01AI95-00434-01} If a pragma Normalize_Scalars applies, the
113823 implementation shall document the implicit initial values for scalar
113824 subtypes, and shall identify each case in which such a value is used and
113825 is not an invalid representation.
113826
113827 5.a/2
113828 Documentation Requirement: If a pragma Normalize_Scalars
113829 applies, the implicit initial values of scalar subtypes shall
113830 be documented. Such a value should be an invalid
113831 representation when possible; any cases when is it not shall
113832 be documented.
113833
113834 5.b
113835 To be honest: It's slightly inaccurate to say that the value
113836 is a representation, but the point should be clear anyway.
113837
113838 5.c
113839 Discussion: By providing a type with a size specification so
113840 that spare bits are present, it is possible to force an
113841 implementation of Normalize_Scalars to use an out of range
113842 value. This can be tested for by ensuring that
113843 Constraint_Error is raised. Similarly, for an unconstrained
113844 integer type, in which no spare bit is surely present, one can
113845 check that the initialization takes place to the value
113846 specified in the documentation of the implementation. For a
113847 floating point type, spare bits might not be available, but a
113848 range constraint can provide the ability to use an out of
113849 range value.
113850
113851 5.d
113852 If it is difficult to document the general rule for the
113853 implicit initial value, the implementation might choose
113854 instead to record the value on the object code listing or
113855 similar output produced during compilation.
113856
113857 _Implementation Advice_
113858
113859 6/2
113860 {AI95-00434-01AI95-00434-01} Whenever possible, the implicit initial
113861 values for a scalar subtype should be an invalid representation (see
113862 *note 13.9.1::).
113863
113864 6.a
113865 Discussion: When an out of range value is used for the
113866 initialization, it is likely that constraint checks will
113867 detect it. In addition, it can be detected by the Valid
113868 attribute.
113869
113870 6.b/2
113871 This rule is included in the documentation requirements, and
113872 thus does not need a separate summary item.
113873
113874 NOTES
113875
113876 7
113877 2 The initialization requirement applies to uninitialized scalar
113878 objects that are subcomponents of composite objects, to allocated
113879 objects, and to stand-alone objects. It also applies to scalar out
113880 parameters. Scalar subcomponents of composite out parameters are
113881 initialized to the corresponding part of the actual, by virtue of
113882 *note 6.4.1::.
113883
113884 8
113885 3 The initialization requirement does not apply to a scalar for
113886 which pragma Import has been specified, since initialization of an
113887 imported object is performed solely by the foreign language
113888 environment (see *note B.1::).
113889
113890 9
113891 4 The use of pragma Normalize_Scalars in conjunction with Pragma
113892 Restrictions(No_Exceptions) may result in erroneous execution (see
113893 *note H.4::).
113894
113895 9.a
113896 Discussion: Since the effect of an access to an out of range
113897 value will often be to raise Constraint_Error, it is clear
113898 that suppressing the exception mechanism could result in
113899 erroneous execution. In particular, the assignment to an
113900 array, with the array index out of range, will result in a
113901 write to an arbitrary store location, having unpredictable
113902 effects.
113903
113904 \1f
113905 File: aarm2012.info, Node: H.2, Next: H.3, Prev: H.1, Up: Annex H
113906
113907 H.2 Documentation of Implementation Decisions
113908 =============================================
113909
113910 _Documentation Requirements_
113911
113912 1
113913 The implementation shall document the range of effects for each
113914 situation that the language rules identify as either a bounded error or
113915 as having an unspecified effect. If the implementation can constrain
113916 the effects of erroneous execution for a given construct, then it shall
113917 document such constraints. [The documentation might be provided either
113918 independently of any compilation unit or partition, or as part of an
113919 annotated listing for a given unit or partition. See also *note
113920 1.1.3::, and *note 1.1.2::.]
113921
113922 1.a/2
113923 This paragraph was deleted.
113924
113925 1.b/2
113926 Documentation Requirement: The range of effects for each
113927 bounded error and each unspecified effect. If the effects of
113928 a given erroneous construct are constrained, the constraints
113929 shall be documented.
113930
113931 NOTES
113932
113933 2
113934 5 Among the situations to be documented are the conventions chosen
113935 for parameter passing, the methods used for the management of
113936 run-time storage, and the method used to evaluate numeric
113937 expressions if this involves extended range or extra precision.
113938
113939 2.a
113940 Discussion: Look up "unspecified" and "erroneous execution" in
113941 the index for a list of the cases.
113942
113943 2.b
113944 The management of run-time storage is particularly important.
113945 For safety applications, it is often necessary to show that a
113946 program cannot raise Storage_Error, and for security
113947 applications that information cannot leak via the run-time
113948 system. Users are likely to prefer a simple storage model
113949 that can be easily validated.
113950
113951 2.c
113952 The documentation could helpfully take into account that users
113953 may well adopt a subset to avoid some forms of erroneous
113954 execution, for instance, not using the abort statement, so
113955 that the effects of a partly completed assignment_statement do
113956 not have to be considered in the validation of a program (see
113957 *note 9.8::). For this reason documentation linked to an
113958 actual compilation may be most useful. Similarly, an
113959 implementation may be able to take into account use of the
113960 Restrictions pragma.
113961
113962 \1f
113963 File: aarm2012.info, Node: H.3, Next: H.4, Prev: H.2, Up: Annex H
113964
113965 H.3 Reviewable Object Code
113966 ==========================
113967
113968 1
113969 Object code review and validation are supported by pragmas Reviewable
113970 and Inspection_Point.
113971
113972 * Menu:
113973
113974 * H.3.1 :: Pragma Reviewable
113975 * H.3.2 :: Pragma Inspection_Point
113976
113977 \1f
113978 File: aarm2012.info, Node: H.3.1, Next: H.3.2, Up: H.3
113979
113980 H.3.1 Pragma Reviewable
113981 -----------------------
113982
113983 1
113984 This pragma directs the implementation to provide information to
113985 facilitate analysis and review of a program's object code, in particular
113986 to allow determination of execution time and storage usage and to
113987 identify the correspondence between the source and object programs.
113988
113989 1.a
113990 Discussion: Since the purpose of this pragma is to provide
113991 information to the user, it is hard to objectively test for
113992 conformity. In practice, users want the information in an
113993 easily understood and convenient form, but neither of these
113994 properties can be easily measured.
113995
113996 _Syntax_
113997
113998 2
113999 The form of a pragma Reviewable is as follows:
114000
114001 3
114002 pragma Reviewable;
114003
114004 _Post-Compilation Rules_
114005
114006 4
114007 Pragma Reviewable is a configuration pragma. It applies to all
114008 compilation_units included in a partition.
114009
114010 _Implementation Requirements_
114011
114012 5
114013 The implementation shall provide the following information for any
114014 compilation unit to which such a pragma applies:
114015
114016 5.a
114017 Discussion: The list of requirements can be checked for, even
114018 if issues like intelligibility are not addressed.
114019
114020 6
114021 * Where compiler-generated run-time checks remain;
114022
114023 6.a
114024 Discussion: A constraint check which is implemented via a
114025 check on the upper and lower bound should clearly be
114026 indicated. If a check is implicit in the form of machine
114027 instructions used (such an overflow checking), this should
114028 also be covered by the documentation. It is particularly
114029 important to cover those checks which are not obvious from the
114030 source code, such as that for stack overflow.
114031
114032 7
114033 * An identification of any construct with a language-defined check
114034 that is recognized prior to run time as certain to fail if executed
114035 (even if the generation of run-time checks has been suppressed);
114036
114037 7.a
114038 Discussion: In this case, if the compiler determines that a
114039 check must fail, the user should be informed of this.
114040 However, since it is not in general possible to know what the
114041 compiler will detect, it is not easy to test for this. In
114042 practice, it is thought that compilers claiming conformity to
114043 this Annex will perform significant optimizations and
114044 therefore will detect such situations. Of course, such events
114045 could well indicate a programmer error.
114046
114047 8/2
114048 * {AI95-00209-01AI95-00209-01} For each read of a scalar object, an
114049 identification of the read as either "known to be initialized," or
114050 "possibly uninitialized," independent of whether pragma
114051 Normalize_Scalars applies;
114052
114053 8.a
114054 Discussion: This issue again raises the question as to what
114055 the compiler has determined. A lazy implementation could
114056 clearly mark all scalars as "possibly uninitialized", but this
114057 would be very unhelpful to the user. It should be possible to
114058 analyze a range of scalar uses and note the percentage in each
114059 class. Note that an access marked "known to be initialized"
114060 does not imply that the value is in range, since the
114061 initialization could be from an (erroneous) call of unchecked
114062 conversion, or by means external to the Ada program.
114063
114064 9
114065 * Where run-time support routines are implicitly invoked;
114066
114067 9.a
114068 Discussion: Validators will need to know the calls invoked in
114069 order to check for the correct functionality. For instance,
114070 for some safety applications, it may be necessary to ensure
114071 that certain sections of code can execute in a particular
114072 time.
114073
114074 10
114075 * An object code listing, including:
114076
114077 11
114078 * Machine instructions, with relative offsets;
114079
114080 11.a
114081 Discussion: The machine instructions should be in a format
114082 that is easily understood, such as the symbolic format of the
114083 assembler. The relative offsets are needed in numeric format,
114084 to check any alignment restrictions that the architecture
114085 might impose.
114086
114087 12
114088 * Where each data object is stored during its lifetime;
114089
114090 12.a
114091 Discussion: This requirement implies that if the optimizer
114092 assigns a variable to a register, this needs to be evident.
114093
114094 13
114095 * Correspondence with the source program, including an
114096 identification of the code produced per declaration and
114097 per statement.
114098
114099 13.a
114100 Discussion: This correspondence will be quite complex when
114101 extensive optimization is performed. In particular, address
114102 calculation to access some data structures could be moved from
114103 the actual access. However, when all the machine code arising
114104 from a statement or declaration is in one basic block, this
114105 must be indicated by the implementation.
114106
114107 14
114108 * An identification of each construct for which the implementation
114109 detects the possibility of erroneous execution;
114110
114111 14.a
114112 Discussion: This requirement is quite vague. In general, it
114113 is hard for compilers to detect erroneous execution and
114114 therefore the requirement will be rarely invoked. However, if
114115 the pragma Suppress is used and the compiler can show that a
114116 predefined exception will be raised, then such an
114117 identification would be useful.
114118
114119 15
114120 * For each subprogram, block, task, or other construct implemented by
114121 reserving and subsequently freeing an area on a run-time stack, an
114122 identification of the length of the fixed-size portion of the area
114123 and an indication of whether the non-fixed size portion is reserved
114124 on the stack or in a dynamically-managed storage region.
114125
114126 15.a
114127 Discussion: This requirement is vital for those requiring to
114128 show that the storage available to a program is sufficient.
114129 This is crucial in those cases in which the internal checks
114130 for stack overflow are suppressed (perhaps by pragma
114131 Restrictions(No_Exceptions)).
114132
114133 16
114134 The implementation shall provide the following information for any
114135 partition to which the pragma applies:
114136
114137 17
114138 * An object code listing of the entire partition, including
114139 initialization and finalization code as well as run-time system
114140 components, and with an identification of those instructions and
114141 data that will be relocated at load time;
114142
114143 17.a
114144 Discussion: The object code listing should enable a validator
114145 to estimate upper bounds for the time taken by critical parts
114146 of a program. Similarly, by an analysis of the entire
114147 partition, it should be possible to ensure that the storage
114148 requirements are suitably bounded, assuming that the partition
114149 was written in an appropriate manner.
114150
114151 18
114152 * A description of the run-time model relevant to the partition.
114153
114154 18.a
114155 Discussion: For example, a description of the storage model is
114156 vital, since the Ada language does not explicitly define such
114157 a model.
114158
114159 18.1
114160 The implementation shall provide control- and data-flow information,
114161 both within each compilation unit and across the compilation units of
114162 the partition.
114163
114164 18.b
114165 Discussion: This requirement is quite vague, since it is
114166 unclear what control and data flow information the compiler
114167 has produced. It is really a plea not to throw away
114168 information that could be useful to the validator. Note that
114169 the data flow information is relevant to the detection of
114170 "possibly uninitialized" objects referred to above.
114171
114172 _Implementation Advice_
114173
114174 19
114175 The implementation should provide the above information in both a
114176 human-readable and machine-readable form, and should document the latter
114177 so as to ease further processing by automated tools.
114178
114179 19.a/2
114180 Implementation Advice: The information produced by pragma
114181 Reviewable should be provided in both a human-readable and
114182 machine-readable form, and the latter form should be
114183 documented.
114184
114185 20
114186 Object code listings should be provided both in a symbolic format and
114187 also in an appropriate numeric format (such as hexadecimal or octal).
114188
114189 20.a/2
114190 Implementation Advice: Object code listings should be provided
114191 both in a symbolic format and in a numeric format.
114192
114193 20.b
114194 Reason: This is to enable other tools to perform any analysis
114195 that the user needed to aid validation. The format should be
114196 in some agreed form.
114197
114198 NOTES
114199
114200 21
114201 6 The order of elaboration of library units will be documented
114202 even in the absence of pragma Reviewable (see *note 10.2::).
114203
114204 21.a
114205 Discussion: There might be some interactions between pragma
114206 Reviewable and compiler optimizations. For example, an
114207 implementation may disable some optimizations when pragma
114208 Reviewable is in force if it would be overly complicated to
114209 provide the detailed information to allow review of the
114210 optimized object code. See also pragma Optimize (*note
114211 2.8::).
114212
114213 _Wording Changes from Ada 95_
114214
114215 21.b/2
114216 {AI95-00209-01AI95-00209-01} The wording was clarified that
114217 pragma Reviewable applies to each read of an object, as it
114218 makes no sense to talk about the state of an object that will
114219 immediately be overwritten.
114220
114221 \1f
114222 File: aarm2012.info, Node: H.3.2, Prev: H.3.1, Up: H.3
114223
114224 H.3.2 Pragma Inspection_Point
114225 -----------------------------
114226
114227 1
114228 An occurrence of a pragma Inspection_Point identifies a set of objects
114229 each of whose values is to be available at the point(s) during program
114230 execution corresponding to the position of the pragma in the compilation
114231 unit. The purpose of such a pragma is to facilitate code validation.
114232
114233 1.a
114234 Discussion: Inspection points are a high level equivalent of
114235 break points used by debuggers.
114236
114237 _Syntax_
114238
114239 2
114240 The form of a pragma Inspection_Point is as follows:
114241
114242 3
114243 pragma Inspection_Point[(object_name {, object_name})];
114244
114245 _Legality Rules_
114246
114247 4
114248 A pragma Inspection_Point is allowed wherever a declarative_item or
114249 statement is allowed. Each object_name shall statically denote the
114250 declaration of an object.
114251
114252 4.a
114253 Discussion: The static denotation is required, since no
114254 dynamic evaluation of a name is involved in this pragma.
114255
114256 _Static Semantics_
114257
114258 5/2
114259 {8652/00938652/0093} {AI95-00207-01AI95-00207-01}
114260 {AI95-00434-01AI95-00434-01} An inspection point is a point in the
114261 object code corresponding to the occurrence of a pragma Inspection_Point
114262 in the compilation unit. An object is inspectable at an inspection
114263 point if the corresponding pragma Inspection_Point either has an
114264 argument denoting that object, or has no arguments and the declaration
114265 of the object is visible at the inspection point.
114266
114267 5.a
114268 Ramification: If a pragma Inspection_Point is in an in-lined
114269 subprogram, there might be numerous inspection points in the
114270 object code corresponding to the single occurrence of the
114271 pragma in the source; similar considerations apply if such a
114272 pragma is in a generic, or in a loop that has been "unrolled"
114273 by an optimizer.
114274
114275 5.a.1/1
114276 {8652/00938652/0093} {AI95-00207-01AI95-00207-01} The short
114277 form of the pragma is a convenient shorthand for listing all
114278 objects which could be explicitly made inspectable by the long
114279 form of the pragma; thus only visible objects are made
114280 inspectable by it. Objects that are not visible at the point
114281 of the pragma are not made inspectable by the short form
114282 pragma. This is necessary so that implementations need not
114283 keep information about (or prevent optimizations on) a unit
114284 simply because some other unit might contain a short form
114285 Inspection_Point pragma.
114286
114287 5.b/1
114288 Discussion: {8652/00938652/0093} {AI95-00207-01AI95-00207-01}
114289 If the short form of the pragma is used, then all visible
114290 objects are inspectable. This implies that global objects
114291 from other compilation units are inspectable. A good
114292 interactive debugging system could provide information similar
114293 to a post-mortem dump at such inspection points. The annex
114294 does not require that any inspection facility is provided,
114295 merely that the information is available to understand the
114296 state of the machine at those points.
114297
114298 _Dynamic Semantics_
114299
114300 6
114301 Execution of a pragma Inspection_Point has no effect.
114302
114303 6.a/2
114304 Discussion: {AI95-00114-01AI95-00114-01} Although an
114305 inspection point has no (semantic) effect, the removal or
114306 adding of a new point could change the machine code generated
114307 by the compiler.
114308
114309 _Implementation Requirements_
114310
114311 7
114312 Reaching an inspection point is an external interaction with respect to
114313 the values of the inspectable objects at that point (see *note 1.1.3::).
114314
114315 7.a
114316 Ramification: The compiler is inhibited from moving an
114317 assignment to an inspectable variable past an inspection point
114318 for that variable. On the other hand, the evaluation of an
114319 expression that might raise an exception may be moved past an
114320 inspection point (see *note 11.6::).
114321
114322 _Documentation Requirements_
114323
114324 8
114325 For each inspection point, the implementation shall identify a mapping
114326 between each inspectable object and the machine resources (such as
114327 memory locations or registers) from which the object's value can be
114328 obtained.
114329
114330 8.a/2
114331 This paragraph was deleted.
114332
114333 8.b/2
114334 Documentation Requirement: For each inspection point, a
114335 mapping between each inspectable object and the machine
114336 resources where the object's value can be obtained shall be
114337 provided.
114338
114339 NOTES
114340
114341 9/2
114342 7 {AI95-00209-01AI95-00209-01} The implementation is not allowed
114343 to perform "dead store elimination" on the last assignment to a
114344 variable prior to a point where the variable is inspectable. Thus
114345 an inspection point has the effect of an implicit read of each of
114346 its inspectable objects.
114347
114348 10
114349 8 Inspection points are useful in maintaining a correspondence
114350 between the state of the program in source code terms, and the
114351 machine state during the program's execution. Assertions about the
114352 values of program objects can be tested in machine terms at
114353 inspection points. Object code between inspection points can be
114354 processed by automated tools to verify programs mechanically.
114355
114356 10.a
114357 Discussion: Although it is not a requirement of the annex, it
114358 would be useful if the state of the stack and heap could be
114359 interrogated. This would allow users to check that a program
114360 did not have a 'storage leak'.
114361
114362 11
114363 9 The identification of the mapping from source program objects to
114364 machine resources is allowed to be in the form of an annotated
114365 object listing, in human-readable or tool-processable form.
114366
114367 11.a
114368 Discussion: In principle, it is easy to check an
114369 implementation for this pragma, since one merely needs to
114370 check the content of objects against those values known from
114371 the source listing. In practice, one needs a tool similar to
114372 an interactive debugger to perform the check.
114373
114374 _Wording Changes from Ada 95_
114375
114376 11.b/2
114377 {8652/00938652/0093} {AI95-00207-01AI95-00207-01} Corrigendum:
114378 Corrected the definition of the Inspection_Point pragma to
114379 apply to only variables visible at the point of the pragma.
114380 Otherwise, the compiler would have to assume that some other
114381 code somewhere could have a pragma Inspection_Point,
114382 preventing many optimizations (such as unused object
114383 elimination).
114384
114385 \1f
114386 File: aarm2012.info, Node: H.4, Next: H.5, Prev: H.3, Up: Annex H
114387
114388 H.4 High Integrity Restrictions
114389 ===============================
114390
114391 1/3
114392 {AI05-0299-1AI05-0299-1} This subclause defines restrictions that can be
114393 used with pragma Restrictions (see *note 13.12::); these facilitate the
114394 demonstration of program correctness by allowing tailored versions of
114395 the run-time system.
114396
114397 1.a/3
114398 Discussion: {AI05-0005-1AI05-0005-1} Note that the
114399 restrictions are absolute. If a partition has 100 library
114400 units and just one needs Unchecked_Conversion, then the pragma
114401 cannot be used to ensure the other 99 units do not use
114402 Unchecked_Conversion. Note also that these are restrictions
114403 on all Ada code within a partition, and therefore it might not
114404 be evident from the specification of a package whether a
114405 restriction can be imposed.
114406
114407 _Static Semantics_
114408
114409 2/2
114410 This paragraph was deleted.{AI95-00347-01AI95-00347-01}
114411 {AI95-00394-01AI95-00394-01}
114412
114413 3/2
114414 {AI95-00394-01AI95-00394-01} The following restriction_identifiers are
114415 language defined:
114416
114417 4
114418 Tasking-related restriction:
114419
114420 5
114421 No_Protected_Types
114422 There are no declarations of protected types or protected
114423 objects.
114424
114425 6
114426 Memory-management related restrictions:
114427
114428 7
114429 No_Allocators
114430 There are no occurrences of an allocator.
114431
114432 8/1
114433 {8652/00428652/0042} {AI95-00130AI95-00130} No_Local_Allocators
114434 Allocators are prohibited in subprograms, generic
114435 subprograms, tasks, and entry bodies.
114436
114437 8.a
114438 Ramification: Thus allocators are permitted only in
114439 expressions whose evaluation can only be performed before the
114440 main subprogram is invoked.
114441
114442 8.b/1
114443 This paragraph was deleted.{8652/00428652/0042}
114444 {AI95-00130AI95-00130}
114445
114446 8.1/3
114447 {AI05-0152-1AI05-0152-1} {AI05-0262-1AI05-0262-1}
114448 No_Anonymous_Allocators
114449 There are no allocators of anonymous access types.
114450
114451 8.2/3
114452 {AI05-0190-1AI05-0190-1} No_Coextensions
114453 There are no coextensions. See *note 3.10.2::.
114454
114455 8.3/3
114456 {AI05-0190-1AI05-0190-1} No_Access_Parameter_Allocators
114457 Allocators are not permitted as the actual parameter to
114458 an access parameter. See *note 6.1::.
114459
114460 9/2
114461
114462 This paragraph was deleted.{AI95-00394-01AI95-00394-01}
114463
114464 10
114465 Immediate_Reclamation
114466 Except for storage occupied by objects created by
114467 allocators and not deallocated via unchecked
114468 deallocation, any storage reserved at run time for an
114469 object is immediately reclaimed when the object no longer
114470 exists.
114471
114472 10.a
114473 Discussion: Immediate reclamation would apply to storage
114474 created by the compiler, such as for a return value from a
114475 function whose size is not known at the call site.
114476
114477 11
114478 Exception-related restriction:
114479
114480 12
114481 No_Exceptions
114482 Raise_statements and exception_handlers are not allowed.
114483 No language-defined run-time checks are generated;
114484 however, a run-time check performed automatically by the
114485 hardware is permitted.
114486
114487 12.a
114488 Discussion: This restriction mirrors a method of working that
114489 is quite common in the safety area. The programmer is
114490 required to show that exceptions cannot be raised. Then a
114491 simplified run-time system is used without exception handling.
114492 However, some hardware checks may still be enforced. If the
114493 software check would have failed, or if the hardware check
114494 actually fails, then the execution of the program is
114495 unpredictable. There are obvious dangers in this approach,
114496 but it is similar to programming at the assembler level.
114497
114498 13
114499 Other restrictions:
114500
114501 14
114502 No_Floating_Point
114503 Uses of predefined floating point types and operations,
114504 and declarations of new floating point types, are not
114505 allowed.
114506
114507 14.a/2
114508 Discussion: {AI95-00114-01AI95-00114-01} The intention is to
114509 avoid the use of floating point hardware at run time, but this
114510 is expressed in language terms. It is conceivable that
114511 floating point is used implicitly in some contexts, say fixed
114512 point type conversions of high accuracy. However, the
114513 Implementation Requirements below make it clear that the
114514 restriction would apply to the "run-time system" and hence not
114515 be allowed. This restriction could be used to inform a
114516 compiler that a variant of the architecture is being used
114517 which does not have floating point instructions.
114518
114519 15
114520 No_Fixed_Point
114521 Uses of predefined fixed point types and operations, and
114522 declarations of new fixed point types, are not allowed.
114523
114524 15.a
114525 Discussion: This restriction would have the side effect of
114526 prohibiting the delay_relative_statement. As with the
114527 No_Floating_Point restriction, this might be used to avoid any
114528 question of rounding errors. Unless an Ada run-time is
114529 written in Ada, it seems hard to rule out implicit use of
114530 fixed point, since at the machine level, fixed point is
114531 virtually the same as integer arithmetic.
114532
114533 16/2
114534
114535 This paragraph was deleted.{AI95-00394-01AI95-00394-01}
114536
114537 17
114538 No_Access_Subprograms
114539 The declaration of access-to-subprogram types is not
114540 allowed.
114541
114542 17.a.1/2
114543 Discussion: Most critical applications would require some
114544 restrictions or additional validation checks on uses of
114545 access-to-subprogram types. If the application does not
114546 require the functionality, then this restriction provides a
114547 means of ensuring the design requirement has been satisfied.
114548 The same applies to several of the following restrictions, and
114549 to restriction No_Dependence => Ada.Unchecked_Conversion.
114550
114551 18
114552 No_Unchecked_Access
114553 The Unchecked_Access attribute is not allowed.
114554
114555 19
114556 No_Dispatch
114557 Occurrences of T'Class are not allowed, for any (tagged)
114558 subtype T.
114559
114560 20/2
114561 {AI95-00285-01AI95-00285-01} No_IO
114562 Semantic dependence on any of the library units
114563 Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO,
114564 Wide_Wide_Text_IO, or Stream_IO is not allowed.
114565
114566 20.a
114567 Discussion: Excluding the input-output facilities of an
114568 implementation may be needed in those environments which
114569 cannot support the supplied functionality. A program in such
114570 an environment is likely to require some low level facilities
114571 or a call on a non-Ada feature.
114572
114573 21
114574 No_Delay
114575 Delay_Statements and semantic dependence on package
114576 Calendar are not allowed.
114577
114578 21.a
114579 Ramification: This implies that delay_alternatives in a
114580 select_statement are prohibited.
114581
114582 21.b
114583 The purpose of this restriction is to avoid the need for
114584 timing facilities within the run-time system.
114585
114586 22
114587 No_Recursion
114588 As part of the execution of a subprogram, the same
114589 subprogram is not invoked.
114590
114591 23
114592 No_Reentrancy
114593 During the execution of a subprogram by a task, no other
114594 task invokes the same subprogram.
114595
114596 _Implementation Requirements_
114597
114598 23.1/2
114599 {AI95-00394-01AI95-00394-01} An implementation of this Annex shall
114600 support:
114601
114602 23.2/2
114603 * the restrictions defined in this subclause; and
114604
114605 23.3/3
114606 * {AI05-0189-1AI05-0189-1} the following restrictions defined in
114607 *note D.7::: No_Task_Hierarchy, No_Abort_Statement,
114608 No_Implicit_Heap_Allocation,
114609 No_Standard_Allocators_After_Elaboration; and
114610
114611 23.4/2
114612 * {AI95-00347-01AI95-00347-01} the pragma Profile(Ravenscar); and
114613
114614 23.a/2
114615 Discussion: {AI95-00347-01AI95-00347-01} The reference to
114616 pragma Profile(Ravenscar) is intended to show that properly
114617 restricted tasking is appropriate for use in high integrity
114618 systems. The Ada 95 Annex seemed to suggest that tasking was
114619 inappropriate for such systems.
114620
114621 23.5/2
114622 * the following uses of restriction_parameter_identifiers defined in
114623 *note D.7::[, which are checked prior to program execution]:
114624
114625 23.6/2
114626 * Max_Task_Entries => 0,
114627
114628 23.7/2
114629 * Max_Asynchronous_Select_Nesting => 0, and
114630
114631 23.8/2
114632 * Max_Tasks => 0.
114633
114634 24/3
114635 {AI05-0263-1AI05-0263-1} {AI05-0272-1AI05-0272-1} If an implementation
114636 supports pragma Restrictions for a particular argument, then except for
114637 the restrictions No_Unchecked_Deallocation, No_Unchecked_Conversion,
114638 No_Access_Subprograms, No_Unchecked_Access, No_Specification_of_Aspect,
114639 No_Use_of_Attribute, No_Use_of_Pragma, and the equivalent use of
114640 No_Dependence, the associated restriction applies to the run-time
114641 system.
114642
114643 24.a
114644 Reason: Permission is granted for the run-time system to use
114645 the specified otherwise-restricted features, since the use of
114646 these features may simplify the run-time system by allowing
114647 more of it to be written in Ada.
114648
114649 24.b
114650 Discussion: The restrictions that are applied to the partition
114651 are also applied to the run-time system. For example, if
114652 No_Floating_Point is specified, then an implementation that
114653 uses floating point for implementing the delay statement (say)
114654 would require that No_Floating_Point is only used in
114655 conjunction with No_Delay. It is clearly important that
114656 restrictions are effective so that Max_Tasks=0 does imply that
114657 tasking is not used, even implicitly (for input-output, say).
114658
114659 24.c
114660 An implementation of tasking could be produced based upon a
114661 run-time system written in Ada in which the rendezvous was
114662 controlled by protected types. In this case,
114663 No_Protected_Types could only be used in conjunction with
114664 Max_Task_Entries=0. Other implementation dependencies could
114665 be envisaged.
114666
114667 24.d
114668 If the run-time system is not written in Ada, then the wording
114669 needs to be applied in an appropriate fashion.
114670
114671 24.e/3
114672 {AI05-0263-1AI05-0263-1} "the equivalent use of No_Dependence"
114673 refers to No_Dependence => Ada.Unchecked_Conversion and the
114674 like, not all uses of No_Dependence.
114675
114676 _Documentation Requirements_
114677
114678 25
114679 If a pragma Restrictions(No_Exceptions) is specified, the implementation
114680 shall document the effects of all constructs where language-defined
114681 checks are still performed automatically (for example, an overflow check
114682 performed by the processor).
114683
114684 25.a/2
114685 This paragraph was deleted.
114686
114687 25.b/2
114688 Documentation Requirement: If a pragma
114689 Restrictions(No_Exceptions) is specified, the effects of all
114690 constructs where language-defined checks are still performed.
114691
114692 25.c/2
114693 Discussion: {AI95-00114-01AI95-00114-01} The documentation
114694 requirements here are quite difficult to satisfy. One method
114695 is to review the object code generated and determine the
114696 checks that are still present, either explicitly, or
114697 implicitly within the architecture. As another example from
114698 that of overflow, consider the question of dereferencing a
114699 null pointer. This could be undertaken by a memory access
114700 trap when checks are performed. When checks are suppressed
114701 via the argument No_Exceptions, it would not be necessary to
114702 have the memory access trap mechanism enabled.
114703
114704 _Erroneous Execution_
114705
114706 26
114707 Program execution is erroneous if pragma Restrictions(No_Exceptions) has
114708 been specified and the conditions arise under which a generated
114709 language-defined run-time check would fail.
114710
114711 26.a
114712 Discussion: The situation here is very similar to the
114713 application of pragma Suppress. Since users are removing some
114714 of the protection the language provides, they had better be
114715 careful!
114716
114717 27
114718 Program execution is erroneous if pragma Restrictions(No_Recursion) has
114719 been specified and a subprogram is invoked as part of its own execution,
114720 or if pragma Restrictions(No_Reentrancy) has been specified and during
114721 the execution of a subprogram by a task, another task invokes the same
114722 subprogram.
114723
114724 27.a/3
114725 Discussion: {AI05-0005-1AI05-0005-1} In practice, many
114726 implementations might not exploit the absence of recursion or
114727 need for reentrancy, in which case the program execution would
114728 be unaffected by the use of recursion or reentrancy, even
114729 though the program is still formally erroneous.
114730
114731 27.b/2
114732 This paragraph was deleted.
114733
114734 NOTES
114735
114736 28/2
114737 10 {AI95-00394-01AI95-00394-01} Uses of
114738 restriction_parameter_identifier No_Dependence defined in *note
114739 13.12.1::: No_Dependence => Ada.Unchecked_Deallocation and
114740 No_Dependence => Ada.Unchecked_Conversion may be appropriate for
114741 high-integrity systems. Other uses of No_Dependence can also be
114742 appropriate for high-integrity systems.
114743
114744 28.a/2
114745 Discussion: The specific mention of these two uses is meant to
114746 replace the identifiers now banished to *note J.13::, "*note
114747 J.13:: Dependence Restriction Identifiers".
114748
114749 28.b/2
114750 Restriction No_Dependence => Ada.Unchecked_Deallocation would
114751 be useful in those contexts in which heap storage is needed on
114752 program start-up, but need not be increased subsequently. The
114753 danger of a dangling pointer can therefore be avoided.
114754
114755 _Extensions to Ada 95_
114756
114757 28.c/2
114758 {8652/00428652/0042} {AI95-00130-01AI95-00130-01}
114759 No_Local_Allocators no longer prohibits generic
114760 instantiations.
114761
114762 _Wording Changes from Ada 95_
114763
114764 28.d/2
114765 {AI95-00285-01AI95-00285-01} Wide_Wide_Text_IO (which is new)
114766 is added to the No_IO restriction.
114767
114768 28.e/3
114769 {AI95-00347-01AI95-00347-01} {AI05-0299-1AI05-0299-1} The
114770 title of this subclause was changed to match the change to the
114771 Annex title. Pragma Profile(Ravenscar) is part of this annex.
114772
114773 28.f/2
114774 {AI95-00394-01AI95-00394-01} Restriction No_Dependence is used
114775 instead of special restriction_identifiers. The old names are
114776 banished to Obsolescent Features (see *note J.13::).
114777
114778 28.g/2
114779 {AI95-00394-01AI95-00394-01} The bizarre wording "apply in
114780 this Annex" (which no one quite can explain the meaning of) is
114781 banished.
114782
114783 _Extensions to Ada 2005_
114784
114785 28.h/3
114786 {AI05-0152-1AI05-0152-1} {AI05-0190-1AI05-0190-1} Restrictions
114787 No_Anonymous_Allocators, No_Coextensions, and
114788 No_Access_Parameter_Allocators are new.
114789
114790 _Wording Changes from Ada 2005_
114791
114792 28.i/3
114793 {AI05-0189-1AI05-0189-1} New restriction
114794 No_Standard_Allocators_After_Elaboration is added to the list
114795 of restrictions that are required by this annex.
114796
114797 28.j/3
114798 {AI05-0263-1AI05-0263-1} Correction: Ada 2005 restriction
114799 No_Dependence is added where needed (this was missed in Ada
114800 2005).
114801
114802 28.k/3
114803 {AI05-0272-1AI05-0272-1} Restrictions against individual
114804 aspects, pragmas, and attributes do not apply to the run-time
114805 system, in order that an implementation can use whatever
114806 aspects, pragmas, and attributes are needed to do the job.
114807 For instance, attempting to write a run-time system for Linux
114808 that does not use the Import aspect would be very difficult
114809 and probably is not what the user is trying to prevent anyway.
114810
114811 \1f
114812 File: aarm2012.info, Node: H.5, Next: H.6, Prev: H.4, Up: Annex H
114813
114814 H.5 Pragma Detect_Blocking
114815 ==========================
114816
114817 1/2
114818 {AI95-00305-01AI95-00305-01} The following pragma forces an
114819 implementation to detect potentially blocking operations within a
114820 protected operation.
114821
114822 _Syntax_
114823
114824 2/2
114825 {AI95-00305-01AI95-00305-01} The form of a pragma Detect_Blocking
114826 is as follows:
114827
114828 3/2
114829 pragma Detect_Blocking;
114830
114831 _Post-Compilation Rules_
114832
114833 4/2
114834 {AI95-00305-01AI95-00305-01} A pragma Detect_Blocking is a configuration
114835 pragma.
114836
114837 _Dynamic Semantics_
114838
114839 5/2
114840 {AI95-00305-01AI95-00305-01} An implementation is required to detect a
114841 potentially blocking operation within a protected operation, and to
114842 raise Program_Error (see *note 9.5.1::).
114843
114844 _Implementation Permissions_
114845
114846 6/2
114847 {AI95-00305-01AI95-00305-01} An implementation is allowed to reject a
114848 compilation_unit if a potentially blocking operation is present directly
114849 within an entry_body or the body of a protected subprogram.
114850
114851 NOTES
114852
114853 7/2
114854 11 {AI95-00305-01AI95-00305-01} An operation that causes a task to
114855 be blocked within a foreign language domain is not defined to be
114856 potentially blocking, and need not be detected.
114857
114858 _Extensions to Ada 95_
114859
114860 7.a/2
114861 {AI95-00305-01AI95-00305-01} Pragma Detect_Blocking is new.
114862
114863 \1f
114864 File: aarm2012.info, Node: H.6, Prev: H.5, Up: Annex H
114865
114866 H.6 Pragma Partition_Elaboration_Policy
114867 =======================================
114868
114869 1/3
114870 {AI95-00265-01AI95-00265-01} {AI05-0299-1AI05-0299-1} This subclause
114871 defines a pragma for user control over elaboration policy.
114872
114873 _Syntax_
114874
114875 2/2
114876 {AI95-00265-01AI95-00265-01} The form of a pragma
114877 Partition_Elaboration_Policy is as follows:
114878
114879 3/2
114880 pragma Partition_Elaboration_Policy (policy_identifier);
114881
114882 4/2
114883 The policy_identifier shall be either Sequential, Concurrent or an
114884 implementation-defined identifier.
114885
114886 4.a/2
114887 Implementation defined: Implementation-defined
114888 policy_identifiers allowed in a pragma
114889 Partition_Elaboration_Policy.
114890
114891 4.b/3
114892 Ramification: Note that the Ravenscar profile (see *note
114893 D.13::) has nothing to say about which
114894 Partition_Elaboration_Policy is used. This was intentionally
114895 omitted from the profile, as there was no agreement as to
114896 whether the Sequential policy should be required for Ravenscar
114897 programs. As such it was defined separately.
114898
114899 _Post-Compilation Rules_
114900
114901 5/2
114902 {AI95-00265-01AI95-00265-01} A pragma Partition_Elaboration_Policy is a
114903 configuration pragma. It specifies the elaboration policy for a
114904 partition. At most one elaboration policy shall be specified for a
114905 partition.
114906
114907 6/3
114908 {AI95-00265-01AI95-00265-01} {AI05-0264-1AI05-0264-1} If the Sequential
114909 policy is specified for a partition, then pragma Restrictions
114910 (No_Task_Hierarchy) shall also be specified for the partition.
114911
114912 _Dynamic Semantics_
114913
114914 7/2
114915 {AI95-00265-01AI95-00265-01} Notwithstanding what this International
114916 Standard says elsewhere, this pragma allows partition elaboration rules
114917 concerning task activation and interrupt attachment to be changed. If
114918 the policy_identifier is Concurrent, or if there is no pragma
114919 Partition_Elaboration_Policy defined for the partition, then the rules
114920 defined elsewhere in this Standard apply.
114921
114922 8/2
114923 {AI95-00265-01AI95-00265-01} {AI95-00421-01AI95-00421-01} If the
114924 partition elaboration policy is Sequential, then task activation and
114925 interrupt attachment are performed in the following sequence of steps:
114926
114927 9/2
114928 * The activation of all library-level tasks and the attachment of
114929 interrupt handlers are deferred until all library units are
114930 elaborated.
114931
114932 10/2
114933 * The interrupt handlers are attached by the environment task.
114934
114935 11/2
114936 * The environment task is suspended while the library-level tasks are
114937 activated.
114938
114939 12/2
114940 * The environment task executes the main subprogram (if any)
114941 concurrently with these executing tasks.
114942
114943 13/2
114944 {AI95-00265-01AI95-00265-01} {AI95-00421-01AI95-00421-01} If several
114945 dynamic interrupt handler attachments for the same interrupt are
114946 deferred, then the most recent call of Attach_Handler or
114947 Exchange_Handler determines which handler is attached.
114948
114949 14/2
114950 {AI95-00265-01AI95-00265-01} {AI95-00421-01AI95-00421-01} If any
114951 deferred task activation fails, Tasking_Error is raised at the beginning
114952 of the sequence of statements of the body of the environment task prior
114953 to calling the main subprogram.
114954
114955 _Implementation Advice_
114956
114957 15/3
114958 {AI95-00265-01AI95-00265-01} {AI05-0264-1AI05-0264-1} If the partition
114959 elaboration policy is Sequential and the Environment task becomes
114960 permanently blocked during elaboration, then the partition is deadlocked
114961 and it is recommended that the partition be immediately terminated.
114962
114963 15.a/3
114964 Implementation Advice: If the partition elaboration policy is
114965 Sequential and the Environment task becomes permanently
114966 blocked during elaboration, then the partition should be
114967 immediately terminated.
114968
114969 _Implementation Permissions_
114970
114971 16/3
114972 {AI95-00265-01AI95-00265-01} {AI05-0264-1AI05-0264-1} If the partition
114973 elaboration policy is Sequential and any task activation fails, then an
114974 implementation may immediately terminate the active partition to
114975 mitigate the hazard posed by continuing to execute with a subset of the
114976 tasks being active.
114977
114978 NOTES
114979
114980 17/2
114981 12 {AI95-00421-01AI95-00421-01} If any deferred task activation
114982 fails, the environment task is unable to handle the Tasking_Error
114983 exception and completes immediately. By contrast, if the partition
114984 elaboration policy is Concurrent, then this exception could be
114985 handled within a library unit.
114986
114987 _Extensions to Ada 95_
114988
114989 17.a/2
114990 {AI95-00265-01AI95-00265-01} {AI95-00421-01AI95-00421-01}
114991 Pragma Partition_Elaboration_Policy is new.
114992
114993 \1f
114994 File: aarm2012.info, Node: Annex J, Next: Annex K, Prev: Annex H, Up: Top
114995
114996 Annex J Obsolescent Features
114997 ****************************
114998
114999 1/2
115000 {AI95-00368-01AI95-00368-01} [ This Annex contains descriptions of
115001 features of the language whose functionality is largely redundant with
115002 other features defined by this International Standard. Use of these
115003 features is not recommended in newly written programs. Use of these
115004 features can be prevented by using pragma Restrictions
115005 (No_Obsolescent_Features), see *note 13.12.1::.]
115006
115007 1.a
115008 Ramification: These features are still part of the language,
115009 and have to be implemented by conforming implementations. The
115010 primary reason for putting these descriptions here is to get
115011 redundant features out of the way of most readers. The
115012 designers of the next version of Ada will have to assess
115013 whether or not it makes sense to drop these features from the
115014 language.
115015
115016 _Wording Changes from Ada 83_
115017
115018 1.b
115019 The following features have been removed from the language,
115020 rather than declared to be obsolescent:
115021
115022 1.c
115023 * The package Low_Level_IO (see *note A.6::).
115024
115025 1.d
115026 * The Epsilon, Mantissa, Emax, Small, Large, Safe_Emax,
115027 Safe_Small, and Safe_Large attributes of floating point
115028 types (see *note A.5.3::).
115029
115030 1.e/2
115031 * This paragraph was deleted.{AI95-00284-02AI95-00284-02}
115032
115033 1.f
115034 * The pragmas System_Name, Storage_Unit, and Memory_Size
115035 (see *note 13.7::).
115036
115037 1.g
115038 * The pragma Shared (see *note C.6::).
115039
115040 1.h
115041 Implementations can continue to support the above features for
115042 upward compatibility.
115043
115044 _Wording Changes from Ada 95_
115045
115046 1.i/2
115047 {AI95-00368-01AI95-00368-01} A mention of the
115048 No_Obsolescent_Features restriction was added.
115049
115050 _Wording Changes from Ada 2005_
115051
115052 1.j/3
115053 {AI05-0229-1AI05-0229-1} Pragma Controlled has been removed
115054 from the language, rather than declared to be obsolescent. No
115055 existing implementation gives it any effect. An
115056 implementation could continue to support the pragma as an
115057 implementation-defined pragma for upward compatibility.
115058
115059 * Menu:
115060
115061 * J.1 :: Renamings of Library Units
115062 * J.2 :: Allowed Replacements of Characters
115063 * J.3 :: Reduced Accuracy Subtypes
115064 * J.4 :: The Constrained Attribute
115065 * J.5 :: ASCII
115066 * J.6 :: Numeric_Error
115067 * J.7 :: At Clauses
115068 * J.8 :: Mod Clauses
115069 * J.9 :: The Storage_Size Attribute
115070 * J.10 :: Specific Suppression of Checks
115071 * J.11 :: The Class Attribute of Untagged Incomplete Types
115072 * J.12 :: Pragma Interface
115073 * J.13 :: Dependence Restriction Identifiers
115074 * J.14 :: Character and Wide_Character Conversion Functions
115075 * J.15 :: Aspect-related Pragmas
115076
115077 \1f
115078 File: aarm2012.info, Node: J.1, Next: J.2, Up: Annex J
115079
115080 J.1 Renamings of Library Units
115081 ==============================
115082
115083 _Static Semantics_
115084
115085 1
115086 The following library_unit_renaming_declarations exist:
115087
115088 2
115089 with Ada.Unchecked_Conversion;
115090 generic function Unchecked_Conversion renames Ada.Unchecked_Conversion;
115091
115092 3
115093 with Ada.Unchecked_Deallocation;
115094 generic procedure Unchecked_Deallocation renames Ada.Unchecked_Deallocation;
115095
115096 4
115097 with Ada.Sequential_IO;
115098 generic package Sequential_IO renames Ada.Sequential_IO;
115099
115100 5
115101 with Ada.Direct_IO;
115102 generic package Direct_IO renames Ada.Direct_IO;
115103
115104 6
115105 with Ada.Text_IO;
115106 package Text_IO renames Ada.Text_IO;
115107
115108 7
115109 with Ada.IO_Exceptions;
115110 package IO_Exceptions renames Ada.IO_Exceptions;
115111
115112 8
115113 with Ada.Calendar;
115114 package Calendar renames Ada.Calendar;
115115
115116 9
115117 with System.Machine_Code;
115118 package Machine_Code renames System.Machine_Code; -- If supported.
115119
115120 9.a/3
115121 Discussion: {AI05-0004-1AI05-0004-1} These library units
115122 correspond to those declared in Ada 83, which did not have the
115123 child unit concept or the parent package Ada.
115124
115125 _Implementation Requirements_
115126
115127 10
115128 The implementation shall allow the user to replace these renamings.
115129
115130 \1f
115131 File: aarm2012.info, Node: J.2, Next: J.3, Prev: J.1, Up: Annex J
115132
115133 J.2 Allowed Replacements of Characters
115134 ======================================
115135
115136 _Syntax_
115137
115138 1
115139 The following replacements are allowed for the vertical line,
115140 number sign, and quotation mark characters:
115141
115142 2
115143 * A vertical line character (|) can be replaced by an
115144 exclamation mark (!) where used as a delimiter.
115145
115146 3
115147 * The number sign characters (#) of a based_literal can be
115148 replaced by colons (:) provided that the replacement is done
115149 for both occurrences.
115150
115151 3.a/2
115152 To be honest: {AI95-00285-01AI95-00285-01} The intent is that
115153 such a replacement works in the Value, Wide_Value, and
115154 Wide_Wide_Value attributes, and in the Get procedures of
115155 Text_IO (and Wide_Text_IO and Wide_Wide_Text_IO as well)}, so
115156 that things like "16:.123:" is acceptable.
115157
115158 4
115159 * The quotation marks (") used as string brackets at both ends
115160 of a string literal can be replaced by percent signs (%)
115161 provided that the enclosed sequence of characters contains no
115162 quotation mark, and provided that both string brackets are
115163 replaced. Any percent sign within the sequence of characters
115164 shall then be doubled and each such doubled percent sign is
115165 interpreted as a single percent sign character value.
115166
115167 5
115168 These replacements do not change the meaning of the program.
115169
115170 5.a
115171 Reason: The original purpose of this feature was to support
115172 hardware (for example, teletype machines) that has long been
115173 obsolete. The feature is no longer necessary for that reason.
115174 Another use of the feature has been to replace the vertical
115175 line character (|) when using certain hardware that treats
115176 that character as a (non-English) letter. The feature is no
115177 longer necessary for that reason, either, since Ada 95 has
115178 full support for international character sets. Therefore, we
115179 believe this feature is no longer necessary.
115180
115181 5.b
115182 Users of equipment that still uses | to represent a letter
115183 will continue to do so. Perhaps by next the time Ada is
115184 revised, such equipment will no longer be in use.
115185
115186 5.c
115187 Note that it was never legal to use this feature as a
115188 convenient method of including double quotes in a string
115189 without doubling them -- the string literal:
115190
115191 5.d
115192 %"This is quoted."%
115193
115194 5.e/3
115195 {AI05-0248-1AI05-0248-1} is not legal in Ada (and never was
115196 legal). One has to write:
115197
115198 5.f
115199 """This is quoted."""
115200
115201 \1f
115202 File: aarm2012.info, Node: J.3, Next: J.4, Prev: J.2, Up: Annex J
115203
115204 J.3 Reduced Accuracy Subtypes
115205 =============================
115206
115207 1
115208 A digits_constraint may be used to define a floating point subtype with
115209 a new value for its requested decimal precision, as reflected by its
115210 Digits attribute. Similarly, a delta_constraint may be used to define
115211 an ordinary fixed point subtype with a new value for its delta, as
115212 reflected by its Delta attribute.
115213
115214 1.a
115215 Discussion: It might be more direct to make these attributes
115216 specifiable via an attribute_definition_clause, and eliminate
115217 the syntax for these _constraints.
115218
115219 _Syntax_
115220
115221 2
115222 delta_constraint ::= delta static_expression [range_constraint]
115223
115224 _Name Resolution Rules_
115225
115226 3
115227 The expression of a delta_constraint is expected to be of any real type.
115228
115229 _Legality Rules_
115230
115231 4
115232 The expression of a delta_constraint shall be static.
115233
115234 5
115235 For a subtype_indication with a delta_constraint, the subtype_mark shall
115236 denote an ordinary fixed point subtype.
115237
115238 6
115239 For a subtype_indication with a digits_constraint, the subtype_mark
115240 shall denote either a decimal fixed point subtype or a floating point
115241 subtype (notwithstanding the rule given in *note 3.5.9:: that only
115242 allows a decimal fixed point subtype).
115243
115244 6.a/2
115245 This paragraph was deleted.{AI95-00114-01AI95-00114-01}
115246
115247 _Static Semantics_
115248
115249 7
115250 A subtype_indication with a subtype_mark that denotes an ordinary fixed
115251 point subtype and a delta_constraint defines an ordinary fixed point
115252 subtype with a delta given by the value of the expression of the
115253 delta_constraint. If the delta_constraint includes a range_constraint
115254 (*note 3.5: S0036.), then the ordinary fixed point subtype is
115255 constrained by the range_constraint (*note 3.5: S0036.).
115256
115257 8
115258 A subtype_indication with a subtype_mark that denotes a floating point
115259 subtype and a digits_constraint defines a floating point subtype with a
115260 requested decimal precision (as reflected by its Digits attribute) given
115261 by the value of the expression of the digits_constraint. If the
115262 digits_constraint includes a range_constraint (*note 3.5: S0036.), then
115263 the floating point subtype is constrained by the range_constraint (*note
115264 3.5: S0036.).
115265
115266 _Dynamic Semantics_
115267
115268 9
115269 A delta_constraint is compatible with an ordinary fixed point subtype if
115270 the value of the expression is no less than the delta of the subtype,
115271 and the range_constraint, if any, is compatible with the subtype.
115272
115273 10
115274 A digits_constraint is compatible with a floating point subtype if the
115275 value of the expression is no greater than the requested decimal
115276 precision of the subtype, and the range_constraint, if any, is
115277 compatible with the subtype.
115278
115279 11
115280 The elaboration of a delta_constraint consists of the elaboration of the
115281 range_constraint, if any.
115282
115283 11.a
115284 Reason: A numeric subtype is considered "constrained" only if
115285 a range constraint applies to it. The only effect of a
115286 digits_constraint or a delta_constraint without a
115287 range_constraint is to specify the value of the corresponding
115288 Digits or Delta attribute in the new subtype. The set of
115289 values of the subtype is not "constrained" in any way by such
115290 _constraints.
115291
115292 _Wording Changes from Ada 83_
115293
115294 11.b
115295 In Ada 83, a delta_constraint is called a
115296 fixed_point_constraint, and a digits_constraint is called a
115297 floating_point_constraint. We have adopted other terms
115298 because digits_constraints apply primarily to decimal fixed
115299 point types now (they apply to floating point types only as an
115300 obsolescent feature).
115301
115302 \1f
115303 File: aarm2012.info, Node: J.4, Next: J.5, Prev: J.3, Up: Annex J
115304
115305 J.4 The Constrained Attribute
115306 =============================
115307
115308 _Static Semantics_
115309
115310 1
115311 For every private subtype S, the following attribute is defined:
115312
115313 1.a
115314 Discussion: This includes generic formal private subtypes.
115315
115316 2
115317 S'Constrained
115318 Yields the value False if S denotes an unconstrained
115319 nonformal private subtype with discriminants; also yields
115320 the value False if S denotes a generic formal private
115321 subtype, and the associated actual subtype is either an
115322 unconstrained subtype with discriminants or an
115323 unconstrained array subtype; yields the value True
115324 otherwise. The value of this attribute is of the
115325 predefined subtype Boolean.
115326
115327 2.a
115328 Reason: Because Ada 95 has unknown_discriminant_parts, the
115329 Constrained attribute of private subtypes is obsolete. This
115330 is fortunate, since its Ada 83 definition was confusing, as
115331 explained below. Because this attribute is obsolete, we do
115332 not bother to extend its definition to private extensions.
115333
115334 2.b
115335 The Constrained attribute of an object is not obsolete.
115336
115337 2.c
115338 Note well: S'Constrained matches the Ada 95 definition of
115339 "constrained" only for composite subtypes. For elementary
115340 subtypes, S'Constrained is always true, whether or not S is
115341 constrained. (The Constrained attribute of an object does not
115342 have this problem, as it is only defined for objects of a
115343 discriminated type.) So one should think of its designator as
115344 being 'Constrained_Or_Elementary.
115345
115346 \1f
115347 File: aarm2012.info, Node: J.5, Next: J.6, Prev: J.4, Up: Annex J
115348
115349 J.5 ASCII
115350 =========
115351
115352 _Static Semantics_
115353
115354 1
115355 The following declaration exists in the declaration of package Standard:
115356
115357 2
115358 package ASCII is
115359
115360 3
115361 -- Control characters:
115362
115363 4
115364 NUL : constant Character := nul; SOH : constant Character := soh;
115365 STX : constant Character := stx; ETX : constant Character := etx;
115366 EOT : constant Character := eot; ENQ : constant Character := enq;
115367 ACK : constant Character := ack; BEL : constant Character := bel;
115368 BS : constant Character := bs; HT : constant Character := ht;
115369 LF : constant Character := lf; VT : constant Character := vt;
115370 FF : constant Character := ff; CR : constant Character := cr;
115371 SO : constant Character := so; SI : constant Character := si;
115372 DLE : constant Character := dle; DC1 : constant Character := dc1;
115373 DC2 : constant Character := dc2; DC3 : constant Character := dc3;
115374 DC4 : constant Character := dc4; NAK : constant Character := nak;
115375 SYN : constant Character := syn; ETB : constant Character := etb;
115376 CAN : constant Character := can; EM : constant Character := em;
115377 SUB : constant Character := sub; ESC : constant Character := esc;
115378 FS : constant Character := fs; GS : constant Character := gs;
115379 RS : constant Character := rs; US : constant Character := us;
115380 DEL : constant Character := del;
115381
115382 5
115383 -- Other characters:
115384
115385 6
115386 Exclam : constant Character:= '!'; Quotation : constant Character:= '"';
115387 Sharp : constant Character:= '#'; Dollar : constant Character:= '$';
115388 Percent : constant Character:= '%'; Ampersand : constant Character:= '&';
115389 Colon : constant Character:= ':'; Semicolon : constant Character:= ';';
115390 Query : constant Character:= '?'; At_Sign : constant Character:= '@';
115391 L_Bracket: constant Character:= '['; Back_Slash: constant Character:= '\';
115392 R_Bracket: constant Character:= ']'; Circumflex: constant Character:= '^';
115393 Underline: constant Character:= '_'; Grave : constant Character:= '`';
115394 L_Brace : constant Character:= '{'; Bar : constant Character:= '|';
115395 R_Brace : constant Character:= '}'; Tilde : constant Character:= '~';
115396
115397 7
115398 -- Lower case letters:
115399
115400 8
115401 LC_A: constant Character:= 'a';
115402 ...
115403 LC_Z: constant Character:= 'z';
115404
115405 9
115406 end ASCII;
115407
115408 \1f
115409 File: aarm2012.info, Node: J.6, Next: J.7, Prev: J.5, Up: Annex J
115410
115411 J.6 Numeric_Error
115412 =================
115413
115414 _Static Semantics_
115415
115416 1
115417 The following declaration exists in the declaration of package Standard:
115418
115419 2
115420 Numeric_Error : exception renames Constraint_Error;
115421
115422 2.a
115423 Discussion: This is true even though it is not shown in *note
115424 A.1::.
115425
115426 2.b
115427 Reason: In Ada 83, it was unclear which situations should
115428 raise Numeric_Error, and which should raise Constraint_Error.
115429 The permissions of RM83-11.6 could often be used to allow the
115430 implementation to raise Constraint_Error in a situation where
115431 one would normally expect Numeric_Error. To avoid this
115432 confusion, all situations that raise Numeric_Error in Ada 83
115433 are changed to raise Constraint_Error in Ada 95.
115434 Numeric_Error is changed to be a renaming of Constraint_Error
115435 to avoid most of the upward compatibilities associated with
115436 this change.
115437
115438 2.c
115439 In new code, Constraint_Error should be used instead of
115440 Numeric_Error.
115441
115442 \1f
115443 File: aarm2012.info, Node: J.7, Next: J.8, Prev: J.6, Up: Annex J
115444
115445 J.7 At Clauses
115446 ==============
115447
115448 _Syntax_
115449
115450 1
115451 at_clause ::= for direct_name use at expression;
115452
115453 _Static Semantics_
115454
115455 2
115456 An at_clause of the form "for x use at y;" is equivalent to an
115457 attribute_definition_clause of the form "for x'Address use y;".
115458
115459 2.a
115460 Reason: The preferred syntax for specifying the address of an
115461 entity is an attribute_definition_clause specifying the
115462 Address attribute. Therefore, the special-purpose at_clause
115463 syntax is now obsolete.
115464
115465 2.b
115466 The above equivalence implies, for example, that only one
115467 at_clause is allowed for a given entity. Similarly, it is
115468 illegal to give both an at_clause and an
115469 attribute_definition_clause specifying the Address attribute.
115470
115471 _Extensions to Ada 83_
115472
115473 2.c
115474 We now allow to define the address of an entity using an
115475 attribute_definition_clause. This is because Ada 83's
115476 at_clause is so hard to remember: programmers often tend to
115477 write "for X'Address use...;".
115478
115479 _Wording Changes from Ada 83_
115480
115481 2.d
115482 Ada 83's address_clause is now called an at_clause to avoid
115483 confusion with the new term "Address clause" (that is, an
115484 attribute_definition_clause for the Address attribute).
115485
115486 * Menu:
115487
115488 * J.7.1 :: Interrupt Entries
115489
115490 \1f
115491 File: aarm2012.info, Node: J.7.1, Up: J.7
115492
115493 J.7.1 Interrupt Entries
115494 -----------------------
115495
115496 1
115497 [Implementations are permitted to allow the attachment of task entries
115498 to interrupts via the address clause. Such an entry is referred to as
115499 an interrupt entry.
115500
115501 2
115502 The address of the task entry corresponds to a hardware interrupt in an
115503 implementation-defined manner. (See Ada.Interrupts.Reference in *note
115504 C.3.2::.)]
115505
115506 _Static Semantics_
115507
115508 3
115509 The following attribute is defined:
115510
115511 4
115512 For any task entry X:
115513
115514 5
115515 X'Address
115516 For a task entry whose address is specified (an interrupt
115517 entry), the value refers to the corresponding hardware
115518 interrupt. For such an entry, as for any other task
115519 entry, the meaning of this value is implementation
115520 defined. The value of this attribute is of the type of
115521 the subtype System.Address.
115522
115523 6
115524 Address may be specified for single entries via an
115525 attribute_definition_clause.
115526
115527 6.a
115528 Reason: Because of the equivalence of at_clauses and
115529 attribute_definition_clauses, an interrupt entry may be
115530 specified via either notation.
115531
115532 _Dynamic Semantics_
115533
115534 7
115535 As part of the initialization of a task object, the address clause for
115536 an interrupt entry is elaborated[, which evaluates the expression of the
115537 address clause]. A check is made that the address specified is
115538 associated with some interrupt to which a task entry may be attached.
115539 If this check fails, Program_Error is raised. Otherwise, the interrupt
115540 entry is attached to the interrupt associated with the specified
115541 address.
115542
115543 8
115544 Upon finalization of the task object, the interrupt entry, if any, is
115545 detached from the corresponding interrupt and the default treatment is
115546 restored.
115547
115548 9
115549 While an interrupt entry is attached to an interrupt, the interrupt is
115550 reserved (see *note C.3::).
115551
115552 10
115553 An interrupt delivered to a task entry acts as a call to the entry
115554 issued by a hardware task whose priority is in the
115555 System.Interrupt_Priority range. It is implementation defined whether
115556 the call is performed as an ordinary entry call, a timed entry call, or
115557 a conditional entry call; which kind of call is performed can depend on
115558 the specific interrupt.
115559
115560 _Bounded (Run-Time) Errors_
115561
115562 11
115563 It is a bounded error to evaluate E'Caller (see *note C.7.1::) in an
115564 accept_statement for an interrupt entry. The possible effects are the
115565 same as for calling Current_Task from an entry body.
115566
115567 _Documentation Requirements_
115568
115569 12
115570 The implementation shall document to which interrupts a task entry may
115571 be attached.
115572
115573 12.a/2
115574 Documentation Requirement: The interrupts to which a task
115575 entry may be attached.
115576
115577 13
115578 The implementation shall document whether the invocation of an interrupt
115579 entry has the effect of an ordinary entry call, conditional call, or a
115580 timed call, and whether the effect varies in the presence of pending
115581 interrupts.
115582
115583 13.a/2
115584 Documentation Requirement: The type of entry call invoked for
115585 an interrupt entry.
115586
115587 _Implementation Permissions_
115588
115589 14
115590 The support for this subclause is optional.
115591
115592 15
115593 Interrupts to which the implementation allows a task entry to be
115594 attached may be designated as reserved for the entire duration of
115595 program execution[; that is, not just when they have an interrupt entry
115596 attached to them].
115597
115598 16/1
115599 {8652/00778652/0077} {AI95-00111-01AI95-00111-01} Interrupt entry calls
115600 may be implemented by having the hardware execute directly the
115601 appropriate accept_statement. Alternatively, the implementation is
115602 allowed to provide an internal interrupt handler to simulate the effect
115603 of a normal task calling the entry.
115604
115605 17
115606 The implementation is allowed to impose restrictions on the
115607 specifications and bodies of tasks that have interrupt entries.
115608
115609 18
115610 It is implementation defined whether direct calls (from the program) to
115611 interrupt entries are allowed.
115612
115613 19
115614 If a select_statement contains both a terminate_alternative and an
115615 accept_alternative for an interrupt entry, then an implementation is
115616 allowed to impose further requirements for the selection of the
115617 terminate_alternative in addition to those given in *note 9.3::.
115618
115619 NOTES
115620
115621 20/1
115622 1 {8652/00778652/0077} {AI95-00111-01AI95-00111-01} Queued
115623 interrupts correspond to ordinary entry calls. Interrupts that are
115624 lost if not immediately processed correspond to conditional entry
115625 calls. It is a consequence of the priority rules that an
115626 accept_statement executed in response to an interrupt can be
115627 executed with the active priority at which the hardware generates
115628 the interrupt, taking precedence over lower priority tasks, without
115629 a scheduling action.
115630
115631 21
115632 2 Control information that is supplied upon an interrupt can be
115633 passed to an associated interrupt entry as one or more parameters
115634 of mode in.
115635
115636 _Examples_
115637
115638 22
115639 Example of an interrupt entry:
115640
115641 23
115642 task Interrupt_Handler is
115643 entry Done;
115644 for Done'Address use Ada.Interrupts.Reference(Ada.Interrupts.Names.Device_Done);
115645 end Interrupt_Handler;
115646
115647 _Wording Changes from Ada 83_
115648
115649 23.a/2
115650 {AI95-00114-01AI95-00114-01} RM83-13.5.1 did not adequately
115651 address the problems associated with interrupts. This feature
115652 is now obsolescent and is replaced by the Ada 95 interrupt
115653 model as specified in the Systems Programming Annex.
115654
115655 _Wording Changes from Ada 95_
115656
115657 23.b/2
115658 {8652/00778652/0077} {AI95-00111-01AI95-00111-01} Corrigendum:
115659 The undefined term accept body was replaced by
115660 accept_statement.
115661
115662 \1f
115663 File: aarm2012.info, Node: J.8, Next: J.9, Prev: J.7, Up: Annex J
115664
115665 J.8 Mod Clauses
115666 ===============
115667
115668 _Syntax_
115669
115670 1
115671 mod_clause ::= at mod static_expression;
115672
115673 _Static Semantics_
115674
115675 2
115676 A record_representation_clause of the form:
115677
115678 3/3
115679 {AI05-0092-1AI05-0092-1} for r use
115680 record at mod a;
115681 ...
115682 end record;
115683
115684 4
115685 is equivalent to:
115686
115687 5
115688 for r'Alignment use a;
115689 for r use
115690 record
115691 ...
115692 end record;
115693
115694 5.a
115695 Reason: The preferred syntax for specifying the alignment of
115696 an entity is an attribute_definition_clause specifying the
115697 Alignment attribute. Therefore, the special-purpose
115698 mod_clause syntax is now obsolete.
115699
115700 5.b
115701 The above equivalence implies, for example, that it is illegal
115702 to give both a mod_clause and an attribute_definition_clause
115703 specifying the Alignment attribute for the same type.
115704
115705 _Wording Changes from Ada 83_
115706
115707 5.c
115708 Ada 83's alignment_clause is now called a mod_clause to avoid
115709 confusion with the new term "Alignment clause" (that is, an
115710 attribute_definition_clause for the Alignment attribute).
115711
115712 \1f
115713 File: aarm2012.info, Node: J.9, Next: J.10, Prev: J.8, Up: Annex J
115714
115715 J.9 The Storage_Size Attribute
115716 ==============================
115717
115718 _Static Semantics_
115719
115720 1
115721 For any task subtype T, the following attribute is defined:
115722
115723 2
115724 T'Storage_Size
115725 Denotes an implementation-defined value of type
115726 universal_integer representing the number of storage
115727 elements reserved for a task of the subtype T.
115728
115729 2.a/3
115730 To be honest: {AI05-0229-1AI05-0229-1} T'Storage_Size cannot
115731 be particularly meaningful in the presence of the
115732 specification of the aspect Storage_Size, especially when the
115733 expression is dynamic, or depends on a discriminant of the
115734 task, because the Storage_Size will be different for different
115735 objects of the type. Even without such a specification, the
115736 Storage_Size can be different for different objects of the
115737 type, and in any case, the value is implementation defined.
115738 Hence, it is always implementation defined.
115739
115740 3/3
115741 {AI95-00345-01AI95-00345-01} {AI05-0229-1AI05-0229-1}
115742 Storage_Size may be specified for a task first subtype
115743 that is not an interface via an
115744 attribute_definition_clause. When the attribute is
115745 specified, the Storage_Size aspect is specified to be the
115746 value of the given expression.
115747
115748 3.a/3
115749 Ramification: {AI05-0229-1AI05-0229-1} When this attribute is
115750 specified with an attribute_definition_clause, the associated
115751 aspect is set to the value of the expression given in the
115752 attribute_definition_clause, rather than the expression
115753 itself. This value is therefore the same for all objects of
115754 the type; in particular, it is not re-evaluated when objects
115755 are created. This is different than when the aspect is
115756 specified with an aspect_specification (see *note 13.3::).
115757
115758 _Wording Changes from Ada 95_
115759
115760 3.b/2
115761 {AI95-00345-01AI95-00345-01} We don't allow specifying
115762 Storage_Size on task interfaces. We don't need to mention
115763 class-wide task types, because these cannot be a first
115764 subtype.
115765
115766 \1f
115767 File: aarm2012.info, Node: J.10, Next: J.11, Prev: J.9, Up: Annex J
115768
115769 J.10 Specific Suppression of Checks
115770 ===================================
115771
115772 1/2
115773 {AI95-00224-01AI95-00224-01} Pragma Suppress can be used to suppress
115774 checks on specific entities.
115775
115776 _Syntax_
115777
115778 2/2
115779 {AI95-00224-01AI95-00224-01} The form of a specific Suppress pragma
115780 is as follows:
115781
115782 3/2
115783 pragma Suppress(identifier, [On =>] name);
115784
115785 _Legality Rules_
115786
115787 4/2
115788 {AI95-00224-01AI95-00224-01} The identifier shall be the name of a check
115789 (see *note 11.5::). The name shall statically denote some entity.
115790
115791 5/2
115792 {AI95-00224-01AI95-00224-01} For a specific Suppress pragma that is
115793 immediately within a package_specification, the name shall denote an
115794 entity (or several overloaded subprograms) declared immediately within
115795 the package_specification (*note 7.1: S0191.).
115796
115797 _Static Semantics_
115798
115799 6/2
115800 {AI95-00224-01AI95-00224-01} A specific Suppress pragma applies to the
115801 named check from the place of the pragma to the end of the innermost
115802 enclosing declarative region, or, if the pragma is given in a
115803 package_specification, to the end of the scope of the named entity. The
115804 pragma applies only to the named entity, or, for a subtype, on objects
115805 and values of its type. A specific Suppress pragma suppresses the named
115806 check for any entities to which it applies (see *note 11.5::). Which
115807 checks are associated with a specific entity is not defined by this
115808 International Standard.
115809
115810 6.a/2
115811 Discussion: The language doesn't specify exactly which
115812 entities control whether a check is performed. For example,
115813 in
115814
115815 6.b
115816 pragma Suppress (Range_Check, On => A);
115817 A := B;
115818
115819 6.c
115820 whether or not the range check is performed is not specified.
115821 The compiler may require that checks are suppressed on B or on
115822 the type of A in order to omit the range check.
115823
115824 _Implementation Permissions_
115825
115826 7/2
115827 {AI95-00224-01AI95-00224-01} An implementation is allowed to place
115828 restrictions on specific Suppress pragmas.
115829
115830 NOTES
115831
115832 8/2
115833 3 {AI95-00224-01AI95-00224-01} An implementation may support a
115834 similar On parameter on pragma Unsuppress (see *note 11.5::).
115835
115836 _Wording Changes from Ada 95_
115837
115838 8.a/3
115839 {AI95-00224-01AI95-00224-01} {AI05-0299-1AI05-0299-1} This
115840 subclause is new. This feature was moved here because it is
115841 important for pragma Unsuppress that there be an unambiguous
115842 meaning for each checking pragma. For instance, in the
115843 example
115844
115845 8.b
115846 pragma Suppress (Range_Check);
115847 pragma Unsuppress (Range_Check, On => A);
115848 A := B;
115849
115850 8.c
115851 the user needs to be able to depend on the range check being
115852 made on the assignment. But a compiler survey showed that the
115853 interpretation of this feature varied widely; trying to define
115854 this carefully was likely to cause a lot of user and
115855 implementer pain. Thus the feature was moved here, to
115856 emphasize that its use is not portable.
115857
115858 \1f
115859 File: aarm2012.info, Node: J.11, Next: J.12, Prev: J.10, Up: Annex J
115860
115861 J.11 The Class Attribute of Untagged Incomplete Types
115862 =====================================================
115863
115864 _Static Semantics_
115865
115866 1/2
115867 {AI95-00326-01AI95-00326-01} For the first subtype S of a type T
115868 declared by an incomplete_type_declaration that is not tagged, the
115869 following attribute is defined:
115870
115871 2/2
115872 {AI95-00326-01AI95-00326-01} S'Class
115873 Denotes the first subtype of the incomplete class-wide
115874 type rooted at T. The completion of T shall declare a
115875 tagged type. Such an attribute reference shall occur in
115876 the same library unit as the incomplete_type_declaration.
115877
115878 2.a/2
115879 Reason: {AI95-00326-01AI95-00326-01} This must occur in the
115880 same unit to prevent children from imposing requirements on
115881 their ancestor library units for deferred incomplete types.
115882
115883 _Wording Changes from Ada 95_
115884
115885 2.b/3
115886 {AI95-00326-01AI95-00326-01} {AI05-0299-1AI05-0299-1} This
115887 subclause is new. This feature was moved here because the
115888 tagged incomplete type provides a better way to provide this
115889 capability (it doesn't put requirements on the completion
115890 based on uses that could be anywhere). Pity we didn't think
115891 of it in 1994.
115892
115893 \1f
115894 File: aarm2012.info, Node: J.12, Next: J.13, Prev: J.11, Up: Annex J
115895
115896 J.12 Pragma Interface
115897 =====================
115898
115899 _Syntax_
115900
115901 1/2
115902 {AI95-00284-02AI95-00284-02} In addition to an identifier, the
115903 reserved word interface is allowed as a pragma name, to provide
115904 compatibility with a prior edition of this International Standard.
115905
115906 1.a/2
115907 Implementation Note: {AI95-00284-02AI95-00284-02} All
115908 implementations need to at least recognize and ignore this
115909 pragma. A syntax error is not an acceptable implementation of
115910 this pragma.
115911
115912 _Wording Changes from Ada 95_
115913
115914 1.b/3
115915 {AI95-00326-01AI95-00326-01} {AI05-0299-1AI05-0299-1} This
115916 subclause is new. This is necessary as interface is now a
115917 reserved word, which would prevent pragma Interface from being
115918 an implementation-defined pragma. We don't define any
115919 semantics for this pragma, as we expect that implementations
115920 will continue to use whatever they currently implement -
115921 requiring any changes would be counter-productive.
115922
115923 \1f
115924 File: aarm2012.info, Node: J.13, Next: J.14, Prev: J.12, Up: Annex J
115925
115926 J.13 Dependence Restriction Identifiers
115927 =======================================
115928
115929 1/2
115930 {AI95-00394-01AI95-00394-01} The following restrictions involve
115931 dependence on specific language-defined units. The more general
115932 restriction No_Dependence (see *note 13.12.1::) should be used for this
115933 purpose.
115934
115935 _Static Semantics_
115936
115937 2/2
115938 {AI95-00394-01AI95-00394-01} The following restriction_identifiers
115939 exist:
115940
115941 3/2
115942 {AI95-00394-01AI95-00394-01} No_Asynchronous_Control
115943 Semantic dependence on the predefined package
115944 Asynchronous_Task_Control is not allowed.
115945
115946 4/2
115947 {AI95-00394-01AI95-00394-01} No_Unchecked_Conversion
115948 Semantic dependence on the predefined generic function
115949 Unchecked_Conversion is not allowed.
115950
115951 5/2
115952 {AI95-00394-01AI95-00394-01} No_Unchecked_Deallocation
115953 Semantic dependence on the predefined generic procedure
115954 Unchecked_Deallocation is not allowed.
115955
115956 _Wording Changes from Ada 95_
115957
115958 5.a/3
115959 {AI95-00394-01AI95-00394-01} {AI05-0299-1AI05-0299-1} This
115960 subclause is new. These restrictions are replaced by the more
115961 general No_Dependence (see *note 13.12.1::).
115962
115963 \1f
115964 File: aarm2012.info, Node: J.14, Next: J.15, Prev: J.13, Up: Annex J
115965
115966 J.14 Character and Wide_Character Conversion Functions
115967 ======================================================
115968
115969 _Static Semantics_
115970
115971 1/2
115972 {AI95-00395-01AI95-00395-01} The following declarations exist in the
115973 declaration of package Ada.Characters.Handling:
115974
115975 2/2
115976 function Is_Character (Item : in Wide_Character) return Boolean
115977 renames Conversions.Is_Character;
115978 function Is_String (Item : in Wide_String) return Boolean
115979 renames Conversions.Is_String;
115980
115981 3/2
115982 function To_Character (Item : in Wide_Character;
115983 Substitute : in Character := ' ')
115984 return Character
115985 renames Conversions.To_Character;
115986
115987 4/2
115988 function To_String (Item : in Wide_String;
115989 Substitute : in Character := ' ')
115990 return String
115991 renames Conversions.To_String;
115992
115993 5/2
115994 function To_Wide_Character (Item : in Character) return Wide_Character
115995 renames Conversions.To_Wide_Character;
115996
115997 6/2
115998 function To_Wide_String (Item : in String) return Wide_String
115999 renames Conversions.To_Wide_String;
116000
116001 _Wording Changes from Ada 95_
116002
116003 6.a/3
116004 {AI95-00394-01AI95-00394-01} {AI05-0299-1AI05-0299-1} This
116005 subclause is new. These subprograms were moved to
116006 Characters.Conversions (see *note A.3.4::).
116007
116008 \1f
116009 File: aarm2012.info, Node: J.15, Prev: J.14, Up: Annex J
116010
116011 J.15 Aspect-related Pragmas
116012 ===========================
116013
116014 1/3
116015 {AI05-0229-1AI05-0229-1} Pragmas can be used as an alternative to
116016 aspect_specifications to specify certain aspects.
116017
116018 _Wording Changes from Ada 2005_
116019
116020 1.a/3
116021 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116022 subclause is new. Many existing pragmas have been converted
116023 into aspects; the pragmas have moved here.
116024
116025 * Menu:
116026
116027 * J.15.1 :: Pragma Inline
116028 * J.15.2 :: Pragma No_Return
116029 * J.15.3 :: Pragma Pack
116030 * J.15.4 :: Pragma Storage_Size
116031 * J.15.5 :: Interfacing Pragmas
116032 * J.15.6 :: Pragma Unchecked_Union
116033 * J.15.7 :: Pragmas Interrupt_Handler and Attach_Handler
116034 * J.15.8 :: Shared Variable Pragmas
116035 * J.15.9 :: Pragma CPU
116036 * J.15.10 :: Pragma Dispatching_Domain
116037 * J.15.11 :: Pragmas Priority and Interrupt_Priority
116038 * J.15.12 :: Pragma Relative_Deadline
116039 * J.15.13 :: Pragma Asynchronous
116040
116041 \1f
116042 File: aarm2012.info, Node: J.15.1, Next: J.15.2, Up: J.15
116043
116044 J.15.1 Pragma Inline
116045 --------------------
116046
116047 _Syntax_
116048
116049 1/3
116050 {AI05-0229-1AI05-0229-1} The form of a pragma Inline, which is a
116051 program unit pragma (see *note 10.1.5::), is as follows:
116052
116053 2/3
116054 pragma Inline (name{, name});
116055
116056 _Legality Rules_
116057
116058 3/3
116059 {AI05-0229-1AI05-0229-1} The pragma shall apply to one or more callable
116060 entities or generic subprograms.
116061
116062 _Static Semantics_
116063
116064 4/3
116065 {AI05-0229-1AI05-0229-1} Pragma Inline specifies that the Inline aspect
116066 (see *note 6.3.2::) for each entity denoted by each name given in the
116067 pragma has the value True.
116068
116069 4.a/3
116070 Ramification: Note that inline expansion is desired no matter
116071 what name is used in the call. This allows one to request
116072 inlining for only one of several overloaded subprograms as
116073 follows:
116074
116075 4.b/3
116076 package IO is
116077 procedure Put(X : in Integer);
116078 procedure Put(X : in String);
116079 procedure Put(X : in Character);
116080 private
116081 procedure Character_Put(X : in Character) renames Put;
116082 pragma Inline(Character_Put);
116083 end IO;
116084
116085 4.c/3
116086 with IO; use IO;
116087 procedure Main is
116088 I : Integer;
116089 C : Character;
116090 begin
116091 ...
116092 Put(C); -- Inline expansion is desired.
116093 Put(I); -- Inline expansion is NOT desired.
116094 end Main;
116095
116096 _Implementation Permissions_
116097
116098 5/3
116099 {AI05-0229-1AI05-0229-1} An implementation may allow a pragma Inline
116100 that has an argument which is a direct_name denoting a subprogram_body
116101 of the same declarative_part.
116102
116103 5.a/3
116104 Reason: This is allowed for Ada 83 compatibility. This is
116105 only a permission as this usage was considered obsolescent
116106 even for Ada 95.
116107
116108 5.b/3
116109 Discussion: We only need to allow this in declarative_parts,
116110 because a body is only allowed in another body, and these all
116111 have declarative_parts.
116112
116113 NOTES
116114
116115 6/3
116116 4 {AI05-0229-1AI05-0229-1} The name in a pragma Inline may denote
116117 more than one entity in the case of overloading. Such a pragma
116118 applies to all of the denoted entities.
116119
116120 _Incompatibilities With Ada 83_
116121
116122 6.a/3
116123 {AI95-00309-01AI95-00309-01} {AI05-0229-1AI05-0229-1} A pragma
116124 Inline cannot refer to a subprogram_body outside of that body.
116125 The pragma can be given inside of the subprogram body. Ada
116126 2005 adds an Implementation Permission to allow this usage for
116127 compatibility (and Ada 95 implementations also can use this
116128 permission), but implementations do not have to allow such
116129 pragmas.
116130
116131 _Extensions to Ada 83_
116132
116133 6.b/3
116134 {AI05-0229-1AI05-0229-1} A pragma Inline is allowed inside a
116135 subprogram_body if there is no corresponding
116136 subprogram_declaration. This is for uniformity with other
116137 program unit pragmas.
116138
116139 _Extensions to Ada 95_
116140
116141 6.c/3
116142 {AI95-00309-01AI95-00309-01} {AI05-0229-1AI05-0229-1}
116143 Amendment Correction: Implementations are allowed to let
116144 Pragma Inline apply to a subprogram_body.
116145
116146 _Wording Changes from Ada 2005_
116147
116148 6.d/3
116149 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116150 subclause is new. Pragma Inline was moved here from *note
116151 6.3.2::; aspect Inline lives there now.
116152
116153 \1f
116154 File: aarm2012.info, Node: J.15.2, Next: J.15.3, Prev: J.15.1, Up: J.15
116155
116156 J.15.2 Pragma No_Return
116157 -----------------------
116158
116159 _Syntax_
116160
116161 1/3
116162 {AI05-0229-1AI05-0229-1} The form of a pragma No_Return, which is a
116163 representation pragma (see *note 13.1::), is as follows:
116164
116165 2/3
116166 pragma No_Return (procedure_local_name{, procedure_local_name});
116167
116168 _Legality Rules_
116169
116170 3/3
116171 {AI05-0229-1AI05-0229-1} Each procedure_local_name shall denote one or
116172 more procedures or generic procedures. [The procedure_local_name shall
116173 not denote a null procedure nor an instance of a generic unit.]
116174
116175 _Static Semantics_
116176
116177 4/3
116178 {AI05-0229-1AI05-0229-1} Pragma No_Return specifies that the No_Return
116179 aspect (see *note 6.5.1::) for each procedure denoted by each local_name
116180 given in the pragma has the value True.
116181
116182 _Wording Changes from Ada 2005_
116183
116184 4.a/3
116185 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116186 subclause is new. Pragma No_Return was moved here from *note
116187 6.5.1::; aspect No_Return lives there now.
116188
116189 \1f
116190 File: aarm2012.info, Node: J.15.3, Next: J.15.4, Prev: J.15.2, Up: J.15
116191
116192 J.15.3 Pragma Pack
116193 ------------------
116194
116195 _Syntax_
116196
116197 1/3
116198 {AI05-0229-1AI05-0229-1} The form of a pragma Pack, which is a
116199 representation pragma (see *note 13.1::), is as follows:
116200
116201 2/3
116202 pragma Pack (first_subtype_local_name);
116203
116204 _Legality Rules_
116205
116206 3/3
116207 {AI05-0229-1AI05-0229-1} The first_subtype_local_name of a pragma Pack
116208 shall denote a composite subtype.
116209
116210 _Static Semantics_
116211
116212 4/3
116213 {AI05-0229-1AI05-0229-1} Pragma Pack specifies that the Pack aspect (see
116214 *note 13.2::) for the type denoted by first_subtype_local_name has the
116215 value True.
116216
116217 _Wording Changes from Ada 2005_
116218
116219 4.a/3
116220 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116221 subclause is new. Pragma Pack was moved here from *note
116222 13.2::; aspect Pack lives there now.
116223
116224 \1f
116225 File: aarm2012.info, Node: J.15.4, Next: J.15.5, Prev: J.15.3, Up: J.15
116226
116227 J.15.4 Pragma Storage_Size
116228 --------------------------
116229
116230 _Syntax_
116231
116232 1/3
116233 {AI05-0229-1AI05-0229-1} The form of a pragma Storage_Size is as
116234 follows:
116235
116236 2/3
116237 pragma Storage_Size (expression);
116238
116239 3/3
116240 {AI05-0229-1AI05-0229-1} A pragma Storage_Size is allowed only
116241 immediately within a task_definition.
116242
116243 _Name Resolution Rules_
116244
116245 4/3
116246 {AI05-0229-1AI05-0229-1} The expression of a pragma Storage_Size is
116247 expected to be of any integer type.
116248
116249 _Static Semantics_
116250
116251 5/3
116252 {AI05-0229-1AI05-0229-1} The pragma Storage_Size sets the Storage_Size
116253 aspect (see *note 13.3::) of the type defined by the immediately
116254 enclosing task_definition to the value of the expression of the pragma.
116255
116256 _Wording Changes from Ada 2005_
116257
116258 5.a/3
116259 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116260 subclause is new. Pragma Storage_Size was moved here from
116261 *note 13.3::; aspect Storage_Size lives there now.
116262
116263 \1f
116264 File: aarm2012.info, Node: J.15.5, Next: J.15.6, Prev: J.15.4, Up: J.15
116265
116266 J.15.5 Interfacing Pragmas
116267 --------------------------
116268
116269 _Syntax_
116270
116271 1/3
116272 {AI05-0229-1AI05-0229-1} An interfacing pragma is a representation
116273 pragma that is one of the pragmas Import, Export, or Convention.
116274 Their forms are as follows:
116275
116276 2/3
116277 pragma Import(
116278 [Convention =>] convention_identifier, [Entity =>] local_name
116279 [, [External_Name =>] external_name_string_expression]
116280 [, [Link_Name =>] link_name_string_expression]);
116281
116282 3/3
116283 pragma Export(
116284 [Convention =>] convention_identifier, [Entity =>] local_name
116285 [, [External_Name =>] external_name_string_expression]
116286 [, [Link_Name =>] link_name_string_expression]);
116287
116288 4/3
116289 pragma Convention([Convention =>] convention_identifier,[Entity
116290 =>] local_name);
116291
116292 5/3
116293 {AI05-0229-1AI05-0229-1} For pragmas Import and Export, the
116294 argument for Link_Name shall not be given without the
116295 pragma_argument_identifier unless the argument for External_Name is
116296 given.
116297
116298 _Name Resolution Rules_
116299
116300 6/3
116301 {AI05-0229-1AI05-0229-1} The expected type for an
116302 external_name_string_expression and a link_name_string_expression in an
116303 interfacing pragma is String.
116304
116305 _Legality Rules_
116306
116307 7/3
116308 {AI05-0229-1AI05-0229-1} The convention_identifier of an interfacing
116309 pragma shall be the name of a convention (see *note B.1::).
116310
116311 8/3
116312 {AI05-0229-1AI05-0229-1} A pragma Import shall be the completion of a
116313 declaration. Notwithstanding any rule to the contrary, a pragma Import
116314 may serve as the completion of any kind of (explicit) declaration if
116315 supported by an implementation for that kind of declaration. If a
116316 completion is a pragma Import, then it shall appear in the same
116317 declarative_part, package_specification, task_definition, or
116318 protected_definition as the declaration. For a library unit, it shall
116319 appear in the same compilation, before any subsequent compilation_units
116320 other than pragmas. If the local_name denotes more than one entity,
116321 then the pragma Import is the completion of all of them.
116322
116323 9/3
116324 {AI05-0229-1AI05-0229-1} The external_name_string_expression and
116325 link_name_string_expression of a pragma Import or Export shall be
116326 static.
116327
116328 10/3
116329 {AI05-0229-1AI05-0229-1} The local_name of each of these pragmas shall
116330 denote a declaration that may have the similarly named aspect specified.
116331
116332 _Static Semantics_
116333
116334 11/3
116335 {AI05-0229-1AI05-0229-1} An interfacing pragma specifies various aspects
116336 of the entity denoted by the local_name as follows:
116337
116338 12/3
116339 * The Convention aspect (see *note B.1::) is convention_identifier.
116340
116341 13/3
116342 * A pragma Import specifies that the Import aspect (see *note B.1::)
116343 is True.
116344
116345 14/3
116346 * A pragma Export specifies that the Export aspect (see *note B.1::)
116347 is True.
116348
116349 15/3
116350 * For both pragma Import and Export, if an external name is given in
116351 the pragma, the External_Name aspect (see *note B.1::) is specified
116352 to be external_name_string_expression. If a link name is given in
116353 the pragma, the Link_Name aspect (see *note B.1::) is specified to
116354 be the link_name_string_expression.
116355
116356 _Wording Changes from Ada 2005_
116357
116358 15.a/3
116359 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116360 subclause is new. Pragmas Import, Export, and Convention were
116361 moved here from *note B.1::; aspects Import, Export,
116362 Convention, Link_Name, and External_Name live there now.
116363
116364 \1f
116365 File: aarm2012.info, Node: J.15.6, Next: J.15.7, Prev: J.15.5, Up: J.15
116366
116367 J.15.6 Pragma Unchecked_Union
116368 -----------------------------
116369
116370 _Syntax_
116371
116372 1/3
116373 {AI05-0229-1AI05-0229-1} The form of a pragma Unchecked_Union,
116374 which is a representation pragma (see *note 13.1::), is as follows:
116375
116376
116377 2/3
116378 pragma Unchecked_Union (first_subtype_local_name);
116379
116380 _Legality Rules_
116381
116382 3/3
116383 {AI05-0229-1AI05-0229-1} The first_subtype_local_name of a pragma
116384 Unchecked_Union shall denote an unconstrained discriminated record
116385 subtype having a variant_part.
116386
116387 _Static Semantics_
116388
116389 4/3
116390 {AI05-0229-1AI05-0229-1} A pragma Unchecked_Union specifies that the
116391 Unchecked_Union aspect (see *note B.3.3::) for the type denoted by
116392 first_subtype_local_name has the value True.
116393
116394 _Wording Changes from Ada 2005_
116395
116396 4.a/3
116397 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116398 subclause is new. Pragma Unchecked_Union was moved here from
116399 *note B.3.3::; aspect Unchecked_Union lives there now.
116400
116401 \1f
116402 File: aarm2012.info, Node: J.15.7, Next: J.15.8, Prev: J.15.6, Up: J.15
116403
116404 J.15.7 Pragmas Interrupt_Handler and Attach_Handler
116405 ---------------------------------------------------
116406
116407 _Syntax_
116408
116409 1/3
116410 {AI05-0229-1AI05-0229-1} The form of a pragma Interrupt_Handler is
116411 as follows:
116412
116413 2/3
116414 pragma Interrupt_Handler (handler_name);
116415
116416 3/3
116417 {AI05-0229-1AI05-0229-1} The form of a pragma Attach_Handler is as
116418 follows:
116419
116420 4/3
116421 pragma Attach_Handler (handler_name, expression);
116422
116423 _Name Resolution Rules_
116424
116425 5/3
116426 {AI05-0229-1AI05-0229-1} For the Interrupt_Handler and Attach_Handler
116427 pragmas, the handler_name shall resolve to denote a protected procedure
116428 with a parameterless profile.
116429
116430 6/3
116431 {AI05-0229-1AI05-0229-1} For the Attach_Handler pragma, the expected
116432 type for the expression is Interrupts.Interrupt_Id (see *note C.3.2::).
116433
116434 _Legality Rules_
116435
116436 7/3
116437 {AI05-0033-1AI05-0033-1} {AI05-0229-1AI05-0229-1} The Attach_Handler and
116438 Interrupt_Handler pragmas are only allowed immediately within the
116439 protected_definition where the corresponding subprogram is declared.
116440 The corresponding protected_type_declaration or
116441 single_protected_declaration shall be a library-level declaration, and
116442 shall not be declared within a generic body. In addition to the places
116443 where Legality Rules normally apply (see *note 12.3::), these rules also
116444 apply in the private part of an instance of a generic unit.
116445
116446 7.a/3
116447 Discussion: In the case of a protected_type_declaration, an
116448 object_declaration of an object of that type need not be at
116449 library level.
116450
116451 7.b/3
116452 {AI05-0033-1AI05-0033-1} We cannot allow these pragmas in a
116453 generic body, because legality rules are not checked for
116454 instance bodies, and these should not be allowed if the
116455 instance is not at the library level. The protected types can
116456 be declared in the private part if this is desired. Note that
116457 while the 'Access to use the handler would provide the check
116458 in the case of Interrupt_Handler, there is no other check for
116459 Attach_Handler. Since these pragmas are so similar, we want
116460 the rules to be the same.
116461
116462 _Static Semantics_
116463
116464 8/3
116465 {AI05-0229-1AI05-0229-1} For an implementation that supports Annex C, a
116466 pragma Interrupt_Handler specifies the Interrupt_Handler aspect (see
116467 *note C.3.1::) for the protected procedure handler_name to have the
116468 value True. For an implementation that supports Annex C, a pragma
116469 Attach_Handler specifies the Attach_Handler aspect (see *note C.3.1::)
116470 for the protected procedure handler_name to have the value of the given
116471 expression[ as evaluated at object creation time].
116472
116473 _Incompatibilities With Ada 2005_
116474
116475 8.a/3
116476 {AI05-0033-1AI05-0033-1} Correction: Added missing generic
116477 contract wording for the pragma Attach_Handler and
116478 Interrupt_Handler. This means that nested instances with
116479 these pragmas in the private part are now illegal. This is
116480 not likely to occur in practice.
116481
116482 _Wording Changes from Ada 2005_
116483
116484 8.b/3
116485 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116486 subclause is new. Pragmas Interrupt_Handler and
116487 Attach_Handler were moved here from *note C.3.1::; aspects
116488 Interrupt_Handler and Attach_Handler live there now.
116489
116490 \1f
116491 File: aarm2012.info, Node: J.15.8, Next: J.15.9, Prev: J.15.7, Up: J.15
116492
116493 J.15.8 Shared Variable Pragmas
116494 ------------------------------
116495
116496 _Syntax_
116497
116498 1/3
116499 {AI05-0229-1AI05-0229-1} The form for pragmas Atomic, Volatile,
116500 Independent, Atomic_Components, and Volatile_Components, and
116501 Independent_Components is as follows:
116502
116503 2/3
116504 pragma Atomic (local_name);
116505
116506 3/3
116507 pragma Volatile (local_name);
116508
116509 4/3
116510 {AI05-0009-1AI05-0009-1} pragma Independent (component_
116511 local_name);
116512
116513 5/3
116514 pragma Atomic_Components (array_local_name);
116515
116516 6/3
116517 pragma Volatile_Components (array_local_name);
116518
116519 7/3
116520 {AI05-0009-1AI05-0009-1} pragma Independent_Components (
116521 local_name);
116522
116523 7.a/3
116524 Discussion: {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1}
116525 Pragmas Independent and Independent_Components are born
116526 obsolescent; they are defined to provide consistency with the
116527 existing shared variable pragmas. As with all obsolescent
116528 features, these pragmas are not optional; all Ada
116529 implementations need to implement them. Also note that these
116530 pragmas were defined as a Correction; as such, they are
116531 expected to be implemented as part of Ada 2005 implementations
116532 (and they would not be obsolescent there).
116533
116534 _Name Resolution Rules_
116535
116536 8/3
116537 {AI05-0009-1AI05-0009-1} {AI05-0229-1AI05-0229-1} The local_name in an
116538 Atomic or Volatile pragma shall resolve to denote either an
116539 object_declaration, a noninherited component_declaration, or a
116540 full_type_declaration. The component_local_name in an Independent
116541 pragma shall resolve to denote a noninherited component_declaration.
116542 The array_local_name in an Atomic_Components or Volatile_Components
116543 pragma shall resolve to denote the declaration of an array type or an
116544 array object of an anonymous type. The local_name in an
116545 Independent_Components pragma shall resolve to denote the declaration of
116546 an array or record type or an array object of an anonymous type.
116547
116548 _Static Semantics_
116549
116550 9/3
116551 {AI05-0229-1AI05-0229-1} These pragmas are representation pragmas (see
116552 *note 13.1::). Each of these pragmas specifies that the similarly named
116553 aspect (see *note C.6::) of the type, object, or component denoted by
116554 its argument is True.
116555
116556 _Legality Rules_
116557
116558 10/3
116559 {AI05-0229-1AI05-0229-1} The local_name of each of these pragmas shall
116560 denote a declaration that may have the similarly named aspect specified.
116561
116562 _Wording Changes from Ada 2005_
116563
116564 10.a/3
116565 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116566 subclause is new. These pragmas were moved here from *note
116567 C.6::; various aspects live there now.
116568
116569 \1f
116570 File: aarm2012.info, Node: J.15.9, Next: J.15.10, Prev: J.15.8, Up: J.15
116571
116572 J.15.9 Pragma CPU
116573 -----------------
116574
116575 0.a/3
116576 Discussion: {AI05-0229-1AI05-0229-1} This pragma is born
116577 obsolescent; it is defined to provide consistency with
116578 existing real-time pragmas. As with all obsolescent features,
116579 this pragma is not optional; all Ada implementations need to
116580 implement it.
116581
116582 _Syntax_
116583
116584 1/3
116585 {AI05-0229-1AI05-0229-1} The form of a pragma CPU is as follows:
116586
116587 2/3
116588 pragma CPU (expression);
116589
116590 _Name Resolution Rules_
116591
116592 3/3
116593 {AI05-0229-1AI05-0229-1} The expected type for the expression of a
116594 pragma CPU is System.Multiprocessors.CPU_Range.
116595
116596 _Legality Rules_
116597
116598 4/3
116599 {AI05-0229-1AI05-0229-1} A CPU pragma is allowed only immediately within
116600 a task_definition, or the declarative_part of a subprogram_body.
116601
116602 5/3
116603 {AI05-0229-1AI05-0229-1} For a CPU pragma that appears in the
116604 declarative_part of a subprogram_body, the expression shall be static.
116605
116606 _Static Semantics_
116607
116608 6/3
116609 {AI05-0229-1AI05-0229-1} For an implementation that supports Annex D, a
116610 pragma CPU specifies the value of the CPU aspect (see *note D.16::). If
116611 the pragma appears in a task_definition, the expression is associated
116612 with the aspect for the task type or single_task_declaration that
116613 contains the pragma; otherwise, the expression is associated with the
116614 aspect for the subprogram that contains the pragma.
116615
116616 _Extensions to Ada 2005_
116617
116618 6.a/3
116619 {AI05-0009-1AI05-0009-1} Pragma CPU is new.
116620
116621 \1f
116622 File: aarm2012.info, Node: J.15.10, Next: J.15.11, Prev: J.15.9, Up: J.15
116623
116624 J.15.10 Pragma Dispatching_Domain
116625 ---------------------------------
116626
116627 0.a/3
116628 Discussion: {AI05-0167-1AI05-0167-1} This pragma is born
116629 obsolescent; it is defined to provide consistency with
116630 existing real-time pragmas. As with all obsolescent features,
116631 this pragma is not optional; all Ada implementations need to
116632 implement it.
116633
116634 _Syntax_
116635
116636 1/3
116637 {AI05-0167-1AI05-0167-1} The form of a pragma Dispatching_Domain is
116638 as follows:
116639
116640 2/3
116641 pragma Dispatching_Domain (expression);
116642
116643 _Name Resolution Rules_
116644
116645 3/3
116646 {AI05-0167-1AI05-0167-1} The expected type for the expression is
116647 System.Multiprocessors.Dispatching_Domains.Dispatching_Domain.
116648
116649 _Legality Rules_
116650
116651 4/3
116652 {AI05-0167-1AI05-0167-1} A Dispatching_Domain pragma is allowed only
116653 immediately within a task_definition.
116654
116655 _Static Semantics_
116656
116657 5/3
116658 {AI05-0167-1AI05-0167-1} For an implementation that supports Annex D, a
116659 pragma Dispatching_Domain specifies the value of the Dispatching_Domain
116660 aspect (see *note D.16.1::). The expression is associated with the
116661 aspect for the task type or single_task_declaration that contains the
116662 pragma.
116663
116664 _Extensions to Ada 2005_
116665
116666 5.a/3
116667 {AI05-0009-1AI05-0009-1} Pragma Dispatching_Domain is new.
116668
116669 \1f
116670 File: aarm2012.info, Node: J.15.11, Next: J.15.12, Prev: J.15.10, Up: J.15
116671
116672 J.15.11 Pragmas Priority and Interrupt_Priority
116673 -----------------------------------------------
116674
116675 _Syntax_
116676
116677 1/3
116678 {AI05-0229-1AI05-0229-1} The form of a pragma Priority is as
116679 follows:
116680
116681 2/3
116682 pragma Priority (expression);
116683
116684 3/3
116685 {AI05-0229-1AI05-0229-1} The form of a pragma Interrupt_Priority is
116686 as follows:
116687
116688 4/3
116689 pragma Interrupt_Priority [(expression);]
116690
116691 _Name Resolution Rules_
116692
116693 5/3
116694 {AI05-0229-1AI05-0229-1} The expected type for the expression in a
116695 Priority or Interrupt_Priority pragma is Integer.
116696
116697 _Legality Rules_
116698
116699 6/3
116700 {AI05-0229-1AI05-0229-1} A Priority pragma is allowed only immediately
116701 within a task_definition, a protected_definition, or the
116702 declarative_part of a subprogram_body. An Interrupt_Priority pragma is
116703 allowed only immediately within a task_definition or a
116704 protected_definition.
116705
116706 7/3
116707 {AI05-0229-1AI05-0229-1} For a Priority pragma that appears in the
116708 declarative_part of a subprogram_body, the expression shall be static,
116709 and its value shall be in the range of System.Priority.
116710
116711 _Static Semantics_
116712
116713 8/3
116714 {AI05-0229-1AI05-0229-1} For an implementation that supports Annex D, a
116715 pragma Priority specifies the value of the Priority aspect (see *note
116716 D.1::) and a pragma Interrupt_Priority specifies the value of the
116717 Interrupt_Priority aspect as follows:
116718
116719 9/3
116720 * If the pragma appears in a task_definition, the expression is
116721 associated with the aspect for the task type or
116722 single_task_declaration that contains the pragma;
116723
116724 10/3
116725 * If the pragma appears in a protected_definition, the expression is
116726 associated with the aspect for the protected type or
116727 single_protected_declaration that contains the pragma;
116728
116729 11/3
116730 * If the pragma appears in the declarative_part of a subprogram_body,
116731 the expression is associated with the aspect for the subprogram
116732 that contains the pragma.
116733
116734 12/3
116735 {AI05-0229-1AI05-0229-1} If there is no expression in an
116736 Interrupt_Priority pragma, the Interrupt_Priority aspect has the value
116737 Interrupt_Priority'Last.
116738
116739 _Wording Changes from Ada 2005_
116740
116741 12.a/3
116742 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116743 subclause is new. Pragmas Interrupt_Priority and Priority
116744 were moved here from *note D.1::; aspects Interrupt_Priority
116745 and Priority live there now.
116746
116747 \1f
116748 File: aarm2012.info, Node: J.15.12, Next: J.15.13, Prev: J.15.11, Up: J.15
116749
116750 J.15.12 Pragma Relative_Deadline
116751 --------------------------------
116752
116753 _Syntax_
116754
116755 1/3
116756 {AI05-0229-1AI05-0229-1} The form of a pragma Relative_Deadline is
116757 as follows:
116758
116759 2/3
116760 pragma Relative_Deadline (relative_deadline_expression);
116761
116762 _Name Resolution Rules_
116763
116764 3/3
116765 {AI05-0229-1AI05-0229-1} The expected type for a
116766 relative_deadline_expression is Real_Time.Time_Span.
116767
116768 _Legality Rules_
116769
116770 4/3
116771 {AI05-0229-1AI05-0229-1} A Relative_Deadline pragma is allowed only
116772 immediately within a task_definition or the declarative_part of a
116773 subprogram_body.
116774
116775 _Static Semantics_
116776
116777 5/3
116778 {AI05-0229-1AI05-0229-1} For an implementation that supports Annex D, a
116779 pragma Relative_Deadline specifies the value of the Relative_Deadline
116780 aspect (see *note D.2.6::). If the pragma appears in a task_definition,
116781 the expression is associated with the aspect for the task type or
116782 single_task_declaration that contains the pragma; otherwise, the
116783 expression is associated with the aspect for the subprogram that
116784 contains the pragma.
116785
116786 _Wording Changes from Ada 2005_
116787
116788 5.a/3
116789 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116790 subclause is new. Pragma Relative_Deadline was moved here
116791 from *note D.2.6::; aspect Relative_Deadline lives there now.
116792
116793 \1f
116794 File: aarm2012.info, Node: J.15.13, Prev: J.15.12, Up: J.15
116795
116796 J.15.13 Pragma Asynchronous
116797 ---------------------------
116798
116799 _Syntax_
116800
116801 1/3
116802 {AI05-0229-1AI05-0229-1} The form of a pragma Asynchronous, which
116803 is a representation pragma (see *note 13.1::), is as follows:
116804
116805 2/3
116806 pragma Asynchronous (local_name);
116807
116808 _Static Semantics_
116809
116810 3/3
116811 {AI05-0229-1AI05-0229-1} For an implementation that supports Annex E, a
116812 pragma Asynchronous specifies that the Asynchronous aspect (see *note
116813 E.4.1::) for the procedure or type denoted by local_name has the value
116814 True.
116815
116816 _Legality Rules_
116817
116818 4/3
116819 {AI05-0229-1AI05-0229-1} The local_name of a pragma Asynchronous shall
116820 denote a declaration that may have aspect Asynchronous specified.
116821
116822 _Wording Changes from Ada 2005_
116823
116824 4.a/3
116825 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This
116826 subclause is new. Pragma Asynchronous was moved here from
116827 *note E.4.1::; aspect Asynchronous lives there now.
116828
116829 \1f
116830 File: aarm2012.info, Node: Annex K, Next: Annex L, Prev: Annex J, Up: Top
116831
116832 Annex K Language-Defined Aspects and Attributes
116833 ***********************************************
116834
116835 1/3
116836 {AI05-0229-1AI05-0229-1} This annex summarizes the definitions given
116837 elsewhere of the language-defined aspects and attributes. Some aspects
116838 have corresponding attributes, as noted.
116839
116840 * Menu:
116841
116842 * K.1 :: Language-Defined Aspects
116843 * K.2 :: Language-Defined Attributes
116844
116845 \1f
116846 File: aarm2012.info, Node: K.1, Next: K.2, Up: Annex K
116847
116848 K.1 Language-Defined Aspects
116849 ============================
116850
116851 1/3
116852 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This subclause
116853 summarizes the definitions given elsewhere of the language-defined
116854 aspects. Aspects are properties of entities that can be specified by
116855 the Ada program; unless otherwise specified below, aspects can be
116856 specified using an aspect_specification.
116857
116858 2/3
116859 Address
116860 Machine address of an entity. See *note 13.3::.
116861
116862 3/3
116863 Alignment (object)
116864 Alignment of an object. See *note 13.3::.
116865
116866 4/3
116867 Alignment (subtype)
116868 Alignment of a subtype. See *note 13.3::.
116869
116870 5/3
116871 All_Calls_Remote
116872 All remote procedure calls should use the Partition
116873 Communication Subsystem, even if they are local. See
116874 *note E.2.3::.
116875
116876 6/3
116877 Asynchronous
116878 Remote procedure calls are asynchronous; the caller
116879 continues without waiting for the call to return. See
116880 *note E.4.1::.
116881
116882 7/3
116883 Atomic
116884 Declare that a type, object, or component is atomic. See
116885 *note C.6::.
116886
116887 8/3
116888 Atomic_Components
116889 Declare that the components of an array type or object
116890 are atomic. See *note C.6::.
116891
116892 9/3
116893 Attach_Handler
116894 Protected procedure is attached to an interrupt. See
116895 *note C.3.1::.
116896
116897 10/3
116898 Bit_Order
116899 Order of bit numbering in a record_representation_clause.
116900 See *note 13.5.3::.
116901
116902 11/3
116903 Coding
116904 Internal representation of enumeration literals.
116905 Specified by an enumeration_representation_clause, not by
116906 an aspect_specification. See *note 13.4::.
116907
116908 12/3
116909 Component_Size
116910 Size in bits of a component of an array type. See *note
116911 13.3::.
116912
116913 13/3
116914 Constant_Indexing
116915 Defines function(s) to implement user-defined
116916 indexed_components. See *note 4.1.6::.
116917
116918 14/3
116919 Convention
116920 Calling convention or other convention used for
116921 interfacing to other languages. See *note B.1::.
116922
116923 15/3
116924 CPU
116925 Processor on which a given task should run. See *note
116926 D.16::.
116927
116928 16/3
116929 Default_Component_Value
116930 Default value for the components of an array-of-scalar
116931 subtype. See *note 3.6::.
116932
116933 17/3
116934 Default_Iterator
116935 Default iterator to be used in for loops. See *note
116936 5.5.1::.
116937
116938 18/3
116939 Default_Storage_Pool
116940 Default storage pool for a generic instance. See *note
116941 13.11.3::.
116942
116943 19/3
116944 Default_Value
116945 Default value for a scalar subtype. See *note 3.5::.
116946
116947 20/3
116948 Dispatching_Domain
116949 Domain (group of processors) on which a given task should
116950 run. See *note D.16.1::.
116951
116952 21/3
116953 Dynamic_Predicate
116954 Condition that must hold true for objects of a given
116955 subtype; the subtype is not static. See *note 3.2.4::.
116956
116957 22/3
116958 Elaborate_Body
116959 A given package must have a body, and that body is
116960 elaborated immediately after the declaration. See *note
116961 10.2.1::.
116962
116963 23/3
116964 Export
116965 Entity is exported to another language. See *note B.1::.
116966
116967 24/3
116968 External_Name
116969 Name used to identify an imported or exported entity.
116970 See *note B.1::.
116971
116972 25/3
116973 External_Tag
116974 Unique identifier for a tagged type in streams. See
116975 *note 13.3::.
116976
116977 26/3
116978 Implicit_Dereference
116979 Mechanism for user-defined implicit .all. See *note
116980 4.1.5::.
116981
116982 27/3
116983 Import
116984 Entity is imported from another language. See *note
116985 B.1::.
116986
116987 28/3
116988 Independent
116989 Declare that a type, object, or component is
116990 independently addressable. See *note C.6::.
116991
116992 29/3
116993 Independent_Components
116994 Declare that the components of an array or record type,
116995 or an array object, are independently addressable. See
116996 *note C.6::.
116997
116998 30/3
116999 Inline
117000 For efficiency, Inline calls are requested for a
117001 subprogram. See *note 6.3.2::.
117002
117003 31/3
117004 Input
117005 Function to read a value from a stream for a given type,
117006 including any bounds and discriminants. See *note
117007 13.13.2::.
117008
117009 32/3
117010 Interrupt_Handler
117011 Protected procedure may be attached to interrupts. See
117012 *note C.3.1::.
117013
117014 33/3
117015 Interrupt_Priority
117016 Priority of a task object or type, or priority of a
117017 protected object or type; the priority is in the
117018 interrupt range. See *note D.1::.
117019
117020 34/3
117021 Iterator_Element
117022 Element type to be used for user-defined iterators. See
117023 *note 5.5.1::.
117024
117025 35/3
117026 Layout (record)
117027 Layout of record components. Specified by a
117028 record_representation_clause, not by an
117029 aspect_specification. See *note 13.5.1::.
117030
117031 36/3
117032 Link_Name
117033 Linker symbol used to identify an imported or exported
117034 entity. See *note B.1::.
117035
117036 37/3
117037 Machine_Radix
117038 Radix (2 or 10) that is used to represent a decimal fixed
117039 point type. See *note F.1::.
117040
117041 38/3
117042 No_Return
117043 A procedure will not return normally. See *note 6.5.1::.
117044
117045 39/3
117046 Output
117047 Procedure to write a value to a stream for a given type,
117048 including any bounds and discriminants. See *note
117049 13.13.2::.
117050
117051 40/3
117052 Pack
117053 Minimize storage when laying out records and arrays. See
117054 *note 13.2::.
117055
117056 41/3
117057 Post
117058 Postcondition; a condition that must hold true after a
117059 call. See *note 6.1.1::.
117060
117061 42/3
117062 Post'Class
117063 Postcondition inherited on type derivation. See *note
117064 6.1.1::.
117065
117066 43/3
117067 Pre
117068 Precondition; a condition that must hold true before a
117069 call. See *note 6.1.1::.
117070
117071 44/3
117072 Pre'Class
117073 Precondition inherited on type derivation. See *note
117074 6.1.1::.
117075
117076 45/3
117077 Preelaborate
117078 Code execution during elaboration is avoided for a given
117079 package. See *note 10.2.1::.
117080
117081 46/3
117082 Priority
117083 Priority of a task object or type, or priority of a
117084 protected object or type; the priority is not in the
117085 interrupt range. See *note D.1::.
117086
117087 47/3
117088 Pure
117089 Side effects are avoided in the subprograms of a given
117090 package. See *note 10.2.1::.
117091
117092 48/3
117093 Read
117094 Procedure to read a value from a stream for a given type.
117095 See *note 13.13.2::.
117096
117097 49/3
117098 Record layout
117099 See Layout. See *note 13.5.1::.
117100
117101 50/3
117102 Relative_Deadline
117103 Task parameter used in Earliest Deadline First
117104 Dispatching. See *note D.2.6::.
117105
117106 51/3
117107 Remote_Call_Interface
117108 Subprograms in a given package may be used in remote
117109 procedure calls. See *note E.2.3::.
117110
117111 52/3
117112 Remote_Types
117113 Types in a given package may be used in remote procedure
117114 calls. See *note E.2.2::.
117115
117116 53/3
117117 Shared_Passive
117118 A given package is used to represent shared memory in a
117119 distributed system. See *note E.2.1::.
117120
117121 54/3
117122 Size (object)
117123 Size in bits of an object. See *note 13.3::.
117124
117125 55/3
117126 Size (subtype)
117127 Size in bits of a subtype. See *note 13.3::.
117128
117129 56/3
117130 Small
117131 Scale factor for a fixed point type. See *note 3.5.10::.
117132
117133 57/3
117134 Static_Predicate
117135 Condition that must hold true for objects of a given
117136 subtype; the subtype may be static. See *note 3.2.4::.
117137
117138 58/3
117139 Storage_Pool
117140 Pool of memory from which new will allocate for a given
117141 access type. See *note 13.11::.
117142
117143 59/3
117144 Storage_Size (access)
117145 Sets memory size for allocations for an access type. See
117146 *note 13.11::.
117147
117148 60/3
117149 Storage_Size (task)
117150 Size in storage elements reserved for a task type or
117151 single task object. See *note 13.3::.
117152
117153 61/3
117154 Stream_Size
117155 Size in bits used to represent elementary objects in a
117156 stream. See *note 13.13.2::.
117157
117158 62/3
117159 Synchronization
117160 Defines whether a given primitive operation of a
117161 synchronized interface must be implemented by an entry or
117162 protected procedure. See *note 9.5::.
117163
117164 63/3
117165 Type_Invariant
117166 A condition that must hold true for all objects of a
117167 type. See *note 7.3.2::.
117168
117169 64/3
117170 Type_Invariant'Class
117171 A condition that must hold true for all objects in a
117172 class of types. See *note 7.3.2::.
117173
117174 65/3
117175 Unchecked_Union
117176 Type is used to interface to a C union type. See *note
117177 B.3.3::.
117178
117179 66/3
117180 Variable_Indexing
117181 Defines function(s) to implement user-defined
117182 indexed_components. See *note 4.1.6::.
117183
117184 67/3
117185 Volatile
117186 Declare that a type, object, or component is volatile.
117187 See *note C.6::.
117188
117189 68/3
117190 Volatile_Components
117191 Declare that the components of an array type or object
117192 are volatile. See *note C.6::.
117193
117194 69/3
117195 Write
117196 Procedure to write a value to a stream for a given type.
117197 See *note 13.13.2::.
117198
117199 \1f
117200 File: aarm2012.info, Node: K.2, Prev: K.1, Up: Annex K
117201
117202 K.2 Language-Defined Attributes
117203 ===============================
117204
117205 1/3
117206 {AI05-0229-1AI05-0229-1} {AI05-0299-1AI05-0299-1} This subclause
117207 summarizes the definitions given elsewhere of the language-defined
117208 attributes. Attributes are properties of entities that can be queried
117209 by an Ada program.
117210
117211 2
117212 P'Access
117213 For a prefix P that denotes a subprogram:
117214
117215 3
117216 P'Access yields an access value that designates the
117217 subprogram denoted by P. The type of P'Access is an
117218 access-to-subprogram type (S), as determined by the
117219 expected type. See *note 3.10.2::.
117220
117221 4
117222 X'Access
117223 For a prefix X that denotes an aliased view of an object:
117224
117225 5
117226 X'Access yields an access value that designates the
117227 object denoted by X. The type of X'Access is an
117228 access-to-object type, as determined by the expected
117229 type. The expected type shall be a general access type.
117230 See *note 3.10.2::.
117231
117232 6/1
117233 X'Address
117234 For a prefix X that denotes an object, program unit, or
117235 label:
117236
117237 7
117238 Denotes the address of the first of the storage elements
117239 allocated to X. For a program unit or label, this value
117240 refers to the machine code associated with the
117241 corresponding body or statement. The value of this
117242 attribute is of type System.Address. See *note 13.3::.
117243
117244 8
117245 S'Adjacent
117246 For every subtype S of a floating point type T:
117247
117248 9
117249 S'Adjacent denotes a function with the following
117250 specification:
117251
117252 10
117253 function S'Adjacent (X, Towards : T)
117254 return T
117255
117256 11
117257 If Towards = X, the function yields X; otherwise, it
117258 yields the machine number of the type T adjacent to X in
117259 the direction of Towards, if that machine number exists.
117260 If the result would be outside the base range of S,
117261 Constraint_Error is raised. When T'Signed_Zeros is True,
117262 a zero result has the sign of X. When Towards is zero,
117263 its sign has no bearing on the result. See *note
117264 A.5.3::.
117265
117266 12
117267 S'Aft
117268 For every fixed point subtype S:
117269
117270 13
117271 S'Aft yields the number of decimal digits needed after
117272 the decimal point to accommodate the delta of the subtype
117273 S, unless the delta of the subtype S is greater than 0.1,
117274 in which case the attribute yields the value one. (S'Aft
117275 is the smallest positive integer N for which
117276 (10**N)*S'Delta is greater than or equal to one.) The
117277 value of this attribute is of the type universal_integer.
117278 See *note 3.5.10::.
117279
117280 13.1/2
117281 S'Alignment
117282 For every subtype S:
117283
117284 13.2/2
117285 The value of this attribute is of type universal_integer,
117286 and nonnegative.
117287
117288 13.3/2
117289 For an object X of subtype S, if S'Alignment is not zero,
117290 then X'Alignment is a nonzero integral multiple of
117291 S'Alignment unless specified otherwise by a
117292 representation item. See *note 13.3::.
117293
117294 14/1
117295 X'Alignment
117296 For a prefix X that denotes an object:
117297
117298 15
117299 The value of this attribute is of type universal_integer,
117300 and nonnegative; zero means that the object is not
117301 necessarily aligned on a storage element boundary. If
117302 X'Alignment is not zero, then X is aligned on a storage
117303 unit boundary and X'Address is an integral multiple of
117304 X'Alignment (that is, the Address modulo the Alignment is
117305 zero).
117306
117307 16/2
117308
117309 This paragraph was deleted. See *note 13.3::.
117310
117311 17
117312 S'Base
117313 For every scalar subtype S:
117314
117315 18
117316 S'Base denotes an unconstrained subtype of the type of S.
117317 This unconstrained subtype is called the base subtype of
117318 the type. See *note 3.5::.
117319
117320 19
117321 S'Bit_Order
117322 For every specific record subtype S:
117323
117324 20
117325 Denotes the bit ordering for the type of S. The value of
117326 this attribute is of type System.Bit_Order. See *note
117327 13.5.3::.
117328
117329 21/1
117330 P'Body_Version
117331 For a prefix P that statically denotes a program unit:
117332
117333 22
117334 Yields a value of the predefined type String that
117335 identifies the version of the compilation unit that
117336 contains the body (but not any subunits) of the program
117337 unit. See *note E.3::.
117338
117339 23
117340 T'Callable
117341 For a prefix T that is of a task type (after any implicit
117342 dereference):
117343
117344 24
117345 Yields the value True when the task denoted by T is
117346 callable, and False otherwise; See *note 9.9::.
117347
117348 25
117349 E'Caller
117350 For a prefix E that denotes an entry_declaration:
117351
117352 26/3
117353 Yields a value of the type Task_Id that identifies the
117354 task whose call is now being serviced. Use of this
117355 attribute is allowed only inside an accept_statement, or
117356 entry_body after the entry_barrier, corresponding to the
117357 entry_declaration denoted by E. See *note C.7.1::.
117358
117359 27
117360 S'Ceiling
117361 For every subtype S of a floating point type T:
117362
117363 28
117364 S'Ceiling denotes a function with the following
117365 specification:
117366
117367 29
117368 function S'Ceiling (X : T)
117369 return T
117370
117371 30
117372 The function yields the value 'ceiling(X)', i.e., the
117373 smallest (most negative) integral value greater than or
117374 equal to X. When X is zero, the result has the sign of X;
117375 a zero result otherwise has a negative sign when
117376 S'Signed_Zeros is True. See *note A.5.3::.
117377
117378 31
117379 S'Class
117380 For every subtype S of a tagged type T (specific or
117381 class-wide):
117382
117383 32
117384 S'Class denotes a subtype of the class-wide type (called
117385 T'Class in this International Standard) for the class
117386 rooted at T (or if S already denotes a class-wide
117387 subtype, then S'Class is the same as S).
117388
117389 33
117390 S'Class is unconstrained. However, if S is constrained,
117391 then the values of S'Class are only those that when
117392 converted to the type T belong to S. See *note 3.9::.
117393
117394 34
117395 S'Class
117396 For every subtype S of an untagged private type whose
117397 full view is tagged:
117398
117399 35
117400 Denotes the class-wide subtype corresponding to the full
117401 view of S. This attribute is allowed only from the
117402 beginning of the private part in which the full view is
117403 declared, until the declaration of the full view. After
117404 the full view, the Class attribute of the full view can
117405 be used. See *note 7.3.1::.
117406
117407 36/1
117408 X'Component_Size
117409 For a prefix X that denotes an array subtype or array
117410 object (after any implicit dereference):
117411
117412 37
117413 Denotes the size in bits of components of the type of X.
117414 The value of this attribute is of type universal_integer.
117415 See *note 13.3::.
117416
117417 38
117418 S'Compose
117419 For every subtype S of a floating point type T:
117420
117421 39
117422 S'Compose denotes a function with the following
117423 specification:
117424
117425 40
117426 function S'Compose (Fraction : T;
117427 Exponent : universal_integer)
117428 return T
117429
117430 41
117431 Let v be the value Fraction · T'Machine_RadixExponent-k,
117432 where k is the normalized exponent of Fraction. If v is
117433 a machine number of the type T, or if |v| >=
117434 T'Model_Small, the function yields v; otherwise, it
117435 yields either one of the machine numbers of the type T
117436 adjacent to v. Constraint_Error is optionally raised if
117437 v is outside the base range of S. A zero result has the
117438 sign of Fraction when S'Signed_Zeros is True. See *note
117439 A.5.3::.
117440
117441 42
117442 A'Constrained
117443 For a prefix A that is of a discriminated type (after any
117444 implicit dereference):
117445
117446 43/3
117447 Yields the value True if A denotes a constant, a value, a
117448 tagged object, or a constrained variable, and False
117449 otherwise. See *note 3.7.2::.
117450
117451 44
117452 S'Copy_Sign
117453 For every subtype S of a floating point type T:
117454
117455 45
117456 S'Copy_Sign denotes a function with the following
117457 specification:
117458
117459 46
117460 function S'Copy_Sign (Value, Sign : T)
117461 return T
117462
117463 47
117464 If the value of Value is nonzero, the function yields a
117465 result whose magnitude is that of Value and whose sign is
117466 that of Sign; otherwise, it yields the value zero.
117467 Constraint_Error is optionally raised if the result is
117468 outside the base range of S. A zero result has the sign
117469 of Sign when S'Signed_Zeros is True. See *note A.5.3::.
117470
117471 48
117472 E'Count
117473 For a prefix E that denotes an entry of a task or
117474 protected unit:
117475
117476 49
117477 Yields the number of calls presently queued on the entry
117478 E of the current instance of the unit. The value of this
117479 attribute is of the type universal_integer. See *note
117480 9.9::.
117481
117482 50/1
117483 S'Definite
117484 For a prefix S that denotes a formal indefinite subtype:
117485
117486 51/3
117487 S'Definite yields True if the actual subtype
117488 corresponding to S is definite; otherwise, it yields
117489 False. The value of this attribute is of the predefined
117490 type Boolean. See *note 12.5.1::.
117491
117492 52
117493 S'Delta
117494 For every fixed point subtype S:
117495
117496 53
117497 S'Delta denotes the delta of the fixed point subtype S.
117498 The value of this attribute is of the type
117499 universal_real. See *note 3.5.10::.
117500
117501 54
117502 S'Denorm
117503 For every subtype S of a floating point type T:
117504
117505 55
117506 Yields the value True if every value expressible in the
117507 form
117508 ± mantissa · T'Machine_RadixT'Machine_Emin
117509 where mantissa is a nonzero T'Machine_Mantissa-digit
117510 fraction in the number base T'Machine_Radix, the first
117511 digit of which is zero, is a machine number (see *note
117512 3.5.7::) of the type T; yields the value False otherwise.
117513 The value of this attribute is of the predefined type
117514 Boolean. See *note A.5.3::.
117515
117516 56
117517 S'Digits
117518 For every floating point subtype S:
117519
117520 57
117521 S'Digits denotes the requested decimal precision for the
117522 subtype S. The value of this attribute is of the type
117523 universal_integer. See *note 3.5.8::.
117524
117525 58
117526 S'Digits
117527 For every decimal fixed point subtype S:
117528
117529 59
117530 S'Digits denotes the digits of the decimal fixed point
117531 subtype S, which corresponds to the number of decimal
117532 digits that are representable in objects of the subtype.
117533 The value of this attribute is of the type
117534 universal_integer. See *note 3.5.10::.
117535
117536 60
117537 S'Exponent
117538 For every subtype S of a floating point type T:
117539
117540 61
117541 S'Exponent denotes a function with the following
117542 specification:
117543
117544 62
117545 function S'Exponent (X : T)
117546 return universal_integer
117547
117548 63
117549 The function yields the normalized exponent of X. See
117550 *note A.5.3::.
117551
117552 64
117553 S'External_Tag
117554 For every subtype S of a tagged type T (specific or
117555 class-wide):
117556
117557 65
117558 S'External_Tag denotes an external string representation
117559 for S'Tag; it is of the predefined type String.
117560 External_Tag may be specified for a specific tagged type
117561 via an attribute_definition_clause; the expression of
117562 such a clause shall be static. The default external tag
117563 representation is implementation defined. See *note
117564 13.13.2::. See *note 13.3::.
117565
117566 66/1
117567 A'First
117568 For a prefix A that is of an array type (after any
117569 implicit dereference), or denotes a constrained array
117570 subtype:
117571
117572 67
117573 A'First denotes the lower bound of the first index range;
117574 its type is the corresponding index type. See *note
117575 3.6.2::.
117576
117577 68
117578 S'First
117579 For every scalar subtype S:
117580
117581 69
117582 S'First denotes the lower bound of the range of S. The
117583 value of this attribute is of the type of S. See *note
117584 3.5::.
117585
117586 70/1
117587 A'First(N)
117588 For a prefix A that is of an array type (after any
117589 implicit dereference), or denotes a constrained array
117590 subtype:
117591
117592 71
117593 A'First(N) denotes the lower bound of the N-th index
117594 range; its type is the corresponding index type. See
117595 *note 3.6.2::.
117596
117597 72
117598 R.C'First_Bit
117599 For a component C of a composite, non-array object R:
117600
117601 73/2
117602 If the nondefault bit ordering applies to the composite
117603 type, and if a component_clause specifies the placement
117604 of C, denotes the value given for the first_bit of the
117605 component_clause; otherwise, denotes the offset, from the
117606 start of the first of the storage elements occupied by C,
117607 of the first bit occupied by C. This offset is measured
117608 in bits. The first bit of a storage element is numbered
117609 zero. The value of this attribute is of the type
117610 universal_integer. See *note 13.5.2::.
117611
117612 73.1/3
117613 S'First_Valid
117614 For every static discrete subtype S for which there
117615 exists at least one value belonging to S that satisfies
117616 any predicate of S:
117617
117618 73.2/3
117619 S'First_Valid denotes the smallest value that belongs to
117620 S and satisfies the predicate of S. The value of this
117621 attribute is of the type of S. See *note 3.5.5::.
117622
117623 74
117624 S'Floor
117625 For every subtype S of a floating point type T:
117626
117627 75
117628 S'Floor denotes a function with the following
117629 specification:
117630
117631 76
117632 function S'Floor (X : T)
117633 return T
117634
117635 77
117636 The function yields the value 'floor(X)', i.e., the
117637 largest (most positive) integral value less than or equal
117638 to X. When X is zero, the result has the sign of X; a
117639 zero result otherwise has a positive sign. See *note
117640 A.5.3::.
117641
117642 78
117643 S'Fore
117644 For every fixed point subtype S:
117645
117646 79
117647 S'Fore yields the minimum number of characters needed
117648 before the decimal point for the decimal representation
117649 of any value of the subtype S, assuming that the
117650 representation does not include an exponent, but includes
117651 a one-character prefix that is either a minus sign or a
117652 space. (This minimum number does not include superfluous
117653 zeros or underlines, and is at least 2.) The value of
117654 this attribute is of the type universal_integer. See
117655 *note 3.5.10::.
117656
117657 80
117658 S'Fraction
117659 For every subtype S of a floating point type T:
117660
117661 81
117662 S'Fraction denotes a function with the following
117663 specification:
117664
117665 82
117666 function S'Fraction (X : T)
117667 return T
117668
117669 83
117670 The function yields the value X · T'Machine_Radix-k,
117671 where k is the normalized exponent of X. A zero result,
117672 which can only occur when X is zero, has the sign of X.
117673 See *note A.5.3::.
117674
117675 83.1/3
117676 X'Has_Same_Storage
117677 For a prefix X that denotes an object:
117678
117679 83.2/3
117680 X'Has_Same_Storage denotes a function with the following
117681 specification:
117682
117683 83.3/3
117684 function X'Has_Same_Storage (Arg : any_type)
117685 return Boolean
117686
117687 83.4/3
117688 The actual parameter shall be a name that denotes an
117689 object. The object denoted by the actual parameter can
117690 be of any type. This function evaluates the names of the
117691 objects involved and returns True if the representation
117692 of the object denoted by the actual parameter occupies
117693 exactly the same bits as the representation of the object
117694 denoted by X; otherwise, it returns False. See *note
117695 13.3::.
117696
117697 84/1
117698 E'Identity
117699 For a prefix E that denotes an exception:
117700
117701 85
117702 E'Identity returns the unique identity of the exception.
117703 The type of this attribute is Exception_Id. See *note
117704 11.4.1::.
117705
117706 86
117707 T'Identity
117708 For a prefix T that is of a task type (after any implicit
117709 dereference):
117710
117711 87
117712 Yields a value of the type Task_Id that identifies the
117713 task denoted by T. See *note C.7.1::.
117714
117715 88
117716 S'Image
117717 For every scalar subtype S:
117718
117719 89
117720 S'Image denotes a function with the following
117721 specification:
117722
117723 90
117724 function S'Image(Arg : S'Base)
117725 return String
117726
117727 91/3
117728 The function returns an image of the value of Arg as a
117729 String. See *note 3.5::.
117730
117731 92
117732 S'Class'Input
117733 For every subtype S'Class of a class-wide type T'Class:
117734
117735 93
117736 S'Class'Input denotes a function with the following
117737 specification:
117738
117739 94/2
117740 function S'Class'Input(
117741 Stream : not null access Ada.Streams.Root_Stream_Type'Class)
117742 return T'Class
117743
117744 95/3
117745 First reads the external tag from Stream and determines
117746 the corresponding internal tag (by calling
117747 Tags.Descendant_Tag(String'Input(Stream), S'Tag) which
117748 might raise Tag_Error -- see *note 3.9::) and then
117749 dispatches to the subprogram denoted by the Input
117750 attribute of the specific type identified by the internal
117751 tag; returns that result. If the specific type
117752 identified by the internal tag is abstract,
117753 Constraint_Error is raised. See *note 13.13.2::.
117754
117755 96
117756 S'Input
117757 For every subtype S of a specific type T:
117758
117759 97
117760 S'Input denotes a function with the following
117761 specification:
117762
117763 98/2
117764 function S'Input(
117765 Stream : not null access Ada.Streams.Root_Stream_Type'Class)
117766 return T
117767
117768 99
117769 S'Input reads and returns one value from Stream, using
117770 any bounds or discriminants written by a corresponding
117771 S'Output to determine how much to read. See *note
117772 13.13.2::.
117773
117774 100/1
117775 A'Last
117776 For a prefix A that is of an array type (after any
117777 implicit dereference), or denotes a constrained array
117778 subtype:
117779
117780 101
117781 A'Last denotes the upper bound of the first index range;
117782 its type is the corresponding index type. See *note
117783 3.6.2::.
117784
117785 102
117786 S'Last
117787 For every scalar subtype S:
117788
117789 103
117790 S'Last denotes the upper bound of the range of S. The
117791 value of this attribute is of the type of S. See *note
117792 3.5::.
117793
117794 104/1
117795 A'Last(N)
117796 For a prefix A that is of an array type (after any
117797 implicit dereference), or denotes a constrained array
117798 subtype:
117799
117800 105
117801 A'Last(N) denotes the upper bound of the N-th index
117802 range; its type is the corresponding index type. See
117803 *note 3.6.2::.
117804
117805 106
117806 R.C'Last_Bit
117807 For a component C of a composite, non-array object R:
117808
117809 107/2
117810 If the nondefault bit ordering applies to the composite
117811 type, and if a component_clause specifies the placement
117812 of C, denotes the value given for the last_bit of the
117813 component_clause; otherwise, denotes the offset, from the
117814 start of the first of the storage elements occupied by C,
117815 of the last bit occupied by C. This offset is measured in
117816 bits. The value of this attribute is of the type
117817 universal_integer. See *note 13.5.2::.
117818
117819 107.1/3
117820 S'Last_Valid
117821 For every static discrete subtype S for which there
117822 exists at least one value belonging to S that satisfies
117823 any predicate of S:
117824
117825 107.2/3
117826 S'Last_Valid denotes the largest value that belongs to S
117827 and satisfies the predicate of S. The value of this
117828 attribute is of the type of S. See *note 3.5.5::.
117829
117830 108
117831 S'Leading_Part
117832 For every subtype S of a floating point type T:
117833
117834 109
117835 S'Leading_Part denotes a function with the following
117836 specification:
117837
117838 110
117839 function S'Leading_Part (X : T;
117840 Radix_Digits : universal_integer)
117841 return T
117842
117843 111
117844 Let v be the value T'Machine_Radixk-Radix_Digits, where k
117845 is the normalized exponent of X. The function yields the
117846 value
117847
117848 112
117849 * 'floor(X/v)' · v, when X is nonnegative and
117850 Radix_Digits is positive;
117851
117852 113
117853 * 'ceiling(X/v)' · v, when X is negative and
117854 Radix_Digits is positive.
117855
117856 114
117857 Constraint_Error is raised when Radix_Digits is zero or
117858 negative. A zero result, which can only occur when X is
117859 zero, has the sign of X. See *note A.5.3::.
117860
117861 115/1
117862 A'Length
117863 For a prefix A that is of an array type (after any
117864 implicit dereference), or denotes a constrained array
117865 subtype:
117866
117867 116
117868 A'Length denotes the number of values of the first index
117869 range (zero for a null range); its type is
117870 universal_integer. See *note 3.6.2::.
117871
117872 117/1
117873 A'Length(N)
117874 For a prefix A that is of an array type (after any
117875 implicit dereference), or denotes a constrained array
117876 subtype:
117877
117878 118
117879 A'Length(N) denotes the number of values of the N-th
117880 index range (zero for a null range); its type is
117881 universal_integer. See *note 3.6.2::.
117882
117883 119
117884 S'Machine
117885 For every subtype S of a floating point type T:
117886
117887 120
117888 S'Machine denotes a function with the following
117889 specification:
117890
117891 121
117892 function S'Machine (X : T)
117893 return T
117894
117895 122
117896 If X is a machine number of the type T, the function
117897 yields X; otherwise, it yields the value obtained by
117898 rounding or truncating X to either one of the adjacent
117899 machine numbers of the type T. Constraint_Error is raised
117900 if rounding or truncating X to the precision of the
117901 machine numbers results in a value outside the base range
117902 of S. A zero result has the sign of X when S'Signed_Zeros
117903 is True. See *note A.5.3::.
117904
117905 123
117906 S'Machine_Emax
117907 For every subtype S of a floating point type T:
117908
117909 124
117910 Yields the largest (most positive) value of exponent such
117911 that every value expressible in the canonical form (for
117912 the type T), having a mantissa of T'Machine_Mantissa
117913 digits, is a machine number (see *note 3.5.7::) of the
117914 type T. This attribute yields a value of the type
117915 universal_integer. See *note A.5.3::.
117916
117917 125
117918 S'Machine_Emin
117919 For every subtype S of a floating point type T:
117920
117921 126
117922 Yields the smallest (most negative) value of exponent
117923 such that every value expressible in the canonical form
117924 (for the type T), having a mantissa of T'Machine_Mantissa
117925 digits, is a machine number (see *note 3.5.7::) of the
117926 type T. This attribute yields a value of the type
117927 universal_integer. See *note A.5.3::.
117928
117929 127
117930 S'Machine_Mantissa
117931 For every subtype S of a floating point type T:
117932
117933 128
117934 Yields the largest value of p such that every value
117935 expressible in the canonical form (for the type T),
117936 having a p-digit mantissa and an exponent between
117937 T'Machine_Emin and T'Machine_Emax, is a machine number
117938 (see *note 3.5.7::) of the type T. This attribute yields
117939 a value of the type universal_integer. See *note
117940 A.5.3::.
117941
117942 129
117943 S'Machine_Overflows
117944 For every subtype S of a floating point type T:
117945
117946 130
117947 Yields the value True if overflow and divide-by-zero are
117948 detected and reported by raising Constraint_Error for
117949 every predefined operation that yields a result of the
117950 type T; yields the value False otherwise. The value of
117951 this attribute is of the predefined type Boolean. See
117952 *note A.5.3::.
117953
117954 131
117955 S'Machine_Overflows
117956 For every subtype S of a fixed point type T:
117957
117958 132
117959 Yields the value True if overflow and divide-by-zero are
117960 detected and reported by raising Constraint_Error for
117961 every predefined operation that yields a result of the
117962 type T; yields the value False otherwise. The value of
117963 this attribute is of the predefined type Boolean. See
117964 *note A.5.4::.
117965
117966 133
117967 S'Machine_Radix
117968 For every subtype S of a floating point type T:
117969
117970 134
117971 Yields the radix of the hardware representation of the
117972 type T. The value of this attribute is of the type
117973 universal_integer. See *note A.5.3::.
117974
117975 135
117976 S'Machine_Radix
117977 For every subtype S of a fixed point type T:
117978
117979 136
117980 Yields the radix of the hardware representation of the
117981 type T. The value of this attribute is of the type
117982 universal_integer. See *note A.5.4::.
117983
117984 136.1/2
117985 S'Machine_Rounding
117986 For every subtype S of a floating point type T:
117987
117988 136.2/2
117989 S'Machine_Rounding denotes a function with the following
117990 specification:
117991
117992 136.3/2
117993 function S'Machine_Rounding (X : T)
117994 return T
117995
117996 136.4/2
117997 The function yields the integral value nearest to X. If X
117998 lies exactly halfway between two integers, one of those
117999 integers is returned, but which of them is returned is
118000 unspecified. A zero result has the sign of X when
118001 S'Signed_Zeros is True. This function provides access to
118002 the rounding behavior which is most efficient on the
118003 target processor. See *note A.5.3::.
118004
118005 137
118006 S'Machine_Rounds
118007 For every subtype S of a floating point type T:
118008
118009 138
118010 Yields the value True if rounding is performed on inexact
118011 results of every predefined operation that yields a
118012 result of the type T; yields the value False otherwise.
118013 The value of this attribute is of the predefined type
118014 Boolean. See *note A.5.3::.
118015
118016 139
118017 S'Machine_Rounds
118018 For every subtype S of a fixed point type T:
118019
118020 140
118021 Yields the value True if rounding is performed on inexact
118022 results of every predefined operation that yields a
118023 result of the type T; yields the value False otherwise.
118024 The value of this attribute is of the predefined type
118025 Boolean. See *note A.5.4::.
118026
118027 141
118028 S'Max
118029 For every scalar subtype S:
118030
118031 142
118032 S'Max denotes a function with the following
118033 specification:
118034
118035 143
118036 function S'Max(Left, Right : S'Base)
118037 return S'Base
118038
118039 144
118040 The function returns the greater of the values of the two
118041 parameters. See *note 3.5::.
118042
118043 144.1/3
118044 S'Max_Alignment_For_Allocation
118045 For every subtype S:
118046
118047 144.2/3
118048 Denotes the maximum value for Alignment that could be
118049 requested by the implementation via Allocate for an
118050 access type whose designated subtype is S. The value of
118051 this attribute is of type universal_integer. See *note
118052 13.11.1::.
118053
118054 145
118055 S'Max_Size_In_Storage_Elements
118056 For every subtype S:
118057
118058 146/3
118059 Denotes the maximum value for Size_In_Storage_Elements
118060 that could be requested by the implementation via
118061 Allocate for an access type whose designated subtype is
118062 S. The value of this attribute is of type
118063 universal_integer. See *note 13.11.1::.
118064
118065 147
118066 S'Min
118067 For every scalar subtype S:
118068
118069 148
118070 S'Min denotes a function with the following
118071 specification:
118072
118073 149
118074 function S'Min(Left, Right : S'Base)
118075 return S'Base
118076
118077 150
118078 The function returns the lesser of the values of the two
118079 parameters. See *note 3.5::.
118080
118081 150.1/2
118082 S'Mod
118083 For every modular subtype S:
118084
118085 150.2/2
118086 S'Mod denotes a function with the following
118087 specification:
118088
118089 150.3/2
118090 function S'Mod (Arg : universal_integer)
118091 return S'Base
118092
118093 150.4/2
118094 This function returns Arg mod S'Modulus, as a value of
118095 the type of S. See *note 3.5.4::.
118096
118097 151
118098 S'Model
118099 For every subtype S of a floating point type T:
118100
118101 152
118102 S'Model denotes a function with the following
118103 specification:
118104
118105 153
118106 function S'Model (X : T)
118107 return T
118108
118109 154
118110 If the Numerics Annex is not supported, the meaning of
118111 this attribute is implementation defined; see *note
118112 G.2.2:: for the definition that applies to
118113 implementations supporting the Numerics Annex. See *note
118114 A.5.3::.
118115
118116 155
118117 S'Model_Emin
118118 For every subtype S of a floating point type T:
118119
118120 156
118121 If the Numerics Annex is not supported, this attribute
118122 yields an implementation defined value that is greater
118123 than or equal to the value of T'Machine_Emin. See *note
118124 G.2.2:: for further requirements that apply to
118125 implementations supporting the Numerics Annex. The value
118126 of this attribute is of the type universal_integer. See
118127 *note A.5.3::.
118128
118129 157
118130 S'Model_Epsilon
118131 For every subtype S of a floating point type T:
118132
118133 158
118134 Yields the value T'Machine_Radix1 - T'Model_Mantissa.
118135 The value of this attribute is of the type
118136 universal_real. See *note A.5.3::.
118137
118138 159
118139 S'Model_Mantissa
118140 For every subtype S of a floating point type T:
118141
118142 160
118143 If the Numerics Annex is not supported, this attribute
118144 yields an implementation defined value that is greater
118145 than or equal to 'ceiling(d · log(10) /
118146 log(T'Machine_Radix))' + 1, where d is the requested
118147 decimal precision of T, and less than or equal to the
118148 value of T'Machine_Mantissa. See *note G.2.2:: for
118149 further requirements that apply to implementations
118150 supporting the Numerics Annex. The value of this
118151 attribute is of the type universal_integer. See *note
118152 A.5.3::.
118153
118154 161
118155 S'Model_Small
118156 For every subtype S of a floating point type T:
118157
118158 162
118159 Yields the value T'Machine_RadixT'Model_Emin - 1. The
118160 value of this attribute is of the type universal_real.
118161 See *note A.5.3::.
118162
118163 163
118164 S'Modulus
118165 For every modular subtype S:
118166
118167 164
118168 S'Modulus yields the modulus of the type of S, as a value
118169 of the type universal_integer. See *note 3.5.4::.
118170
118171 164.1/3
118172 X'Old
118173 For a prefix X that denotes an object of a nonlimited
118174 type:
118175
118176 164.2/3
118177 For each X'Old in a postcondition expression that is
118178 enabled, a constant is implicitly declared at the
118179 beginning of the subprogram or entry. The constant is of
118180 the type of X and is initialized to the result of
118181 evaluating X (as an expression) at the point of the
118182 constant declaration. The value of X'Old in the
118183 postcondition expression is the value of this constant;
118184 the type of X'Old is the type of X. These implicit
118185 constant declarations occur in an arbitrary order. See
118186 *note 6.1.1::.
118187
118188 165
118189 S'Class'Output
118190 For every subtype S'Class of a class-wide type T'Class:
118191
118192 166
118193 S'Class'Output denotes a procedure with the following
118194 specification:
118195
118196 167/2
118197 procedure S'Class'Output(
118198 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118199 Item : in T'Class)
118200
118201 168/2
118202 First writes the external tag of Item to Stream (by
118203 calling String'Output(Stream,
118204 Tags.External_Tag(Item'Tag)) -- see *note 3.9::) and then
118205 dispatches to the subprogram denoted by the Output
118206 attribute of the specific type identified by the tag.
118207 Tag_Error is raised if the tag of Item identifies a type
118208 declared at an accessibility level deeper than that of S.
118209 See *note 13.13.2::.
118210
118211 169
118212 S'Output
118213 For every subtype S of a specific type T:
118214
118215 170
118216 S'Output denotes a procedure with the following
118217 specification:
118218
118219 171/2
118220 procedure S'Output(
118221 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118222 Item : in T)
118223
118224 172
118225 S'Output writes the value of Item to Stream, including
118226 any bounds or discriminants. See *note 13.13.2::.
118227
118228 172.1/3
118229 X'Overlaps_Storage
118230 For a prefix X that denotes an object:
118231
118232 172.2/3
118233 X'Overlaps_Storage denotes a function with the following
118234 specification:
118235
118236 172.3/3
118237 function X'Overlaps_Storage (Arg : any_type)
118238 return Boolean
118239
118240 172.4/3
118241 The actual parameter shall be a name that denotes an
118242 object. The object denoted by the actual parameter can
118243 be of any type. This function evaluates the names of the
118244 objects involved and returns True if the representation
118245 of the object denoted by the actual parameter shares at
118246 least one bit with the representation of the object
118247 denoted by X; otherwise, it returns False. See *note
118248 13.3::.
118249
118250 173/1
118251 D'Partition_Id
118252 For a prefix D that denotes a library-level declaration,
118253 excepting a declaration of or within a declared-pure
118254 library unit:
118255
118256 174
118257 Denotes a value of the type universal_integer that
118258 identifies the partition in which D was elaborated. If D
118259 denotes the declaration of a remote call interface
118260 library unit (see *note E.2.3::) the given partition is
118261 the one where the body of D was elaborated. See *note
118262 E.1::.
118263
118264 175
118265 S'Pos
118266 For every discrete subtype S:
118267
118268 176
118269 S'Pos denotes a function with the following
118270 specification:
118271
118272 177
118273 function S'Pos(Arg : S'Base)
118274 return universal_integer
118275
118276 178
118277 This function returns the position number of the value of
118278 Arg, as a value of type universal_integer. See *note
118279 3.5.5::.
118280
118281 179
118282 R.C'Position
118283 For a component C of a composite, non-array object R:
118284
118285 180/2
118286 If the nondefault bit ordering applies to the composite
118287 type, and if a component_clause specifies the placement
118288 of C, denotes the value given for the position of the
118289 component_clause; otherwise, denotes the same value as
118290 R.C'Address - R'Address. The value of this attribute is
118291 of the type universal_integer. See *note 13.5.2::.
118292
118293 181
118294 S'Pred
118295 For every scalar subtype S:
118296
118297 182
118298 S'Pred denotes a function with the following
118299 specification:
118300
118301 183
118302 function S'Pred(Arg : S'Base)
118303 return S'Base
118304
118305 184
118306 For an enumeration type, the function returns the value
118307 whose position number is one less than that of the value
118308 of Arg; Constraint_Error is raised if there is no such
118309 value of the type. For an integer type, the function
118310 returns the result of subtracting one from the value of
118311 Arg. For a fixed point type, the function returns the
118312 result of subtracting small from the value of Arg. For a
118313 floating point type, the function returns the machine
118314 number (as defined in *note 3.5.7::) immediately below
118315 the value of Arg; Constraint_Error is raised if there is
118316 no such machine number. See *note 3.5::.
118317
118318 184.1/2
118319 P'Priority
118320 For a prefix P that denotes a protected object:
118321
118322 184.2/2
118323 Denotes a non-aliased component of the protected object
118324 P. This component is of type System.Any_Priority and its
118325 value is the priority of P. P'Priority denotes a variable
118326 if and only if P denotes a variable. A reference to this
118327 attribute shall appear only within the body of P. See
118328 *note D.5.2::.
118329
118330 185/1
118331 A'Range
118332 For a prefix A that is of an array type (after any
118333 implicit dereference), or denotes a constrained array
118334 subtype:
118335
118336 186
118337 A'Range is equivalent to the range A'First .. A'Last,
118338 except that the prefix A is only evaluated once. See
118339 *note 3.6.2::.
118340
118341 187
118342 S'Range
118343 For every scalar subtype S:
118344
118345 188
118346 S'Range is equivalent to the range S'First .. S'Last.
118347 See *note 3.5::.
118348
118349 189/1
118350 A'Range(N)
118351 For a prefix A that is of an array type (after any
118352 implicit dereference), or denotes a constrained array
118353 subtype:
118354
118355 190
118356 A'Range(N) is equivalent to the range A'First(N) ..
118357 A'Last(N), except that the prefix A is only evaluated
118358 once. See *note 3.6.2::.
118359
118360 191
118361 S'Class'Read
118362 For every subtype S'Class of a class-wide type T'Class:
118363
118364 192
118365 S'Class'Read denotes a procedure with the following
118366 specification:
118367
118368 193/2
118369 procedure S'Class'Read(
118370 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118371 Item : out T'Class)
118372
118373 194
118374 Dispatches to the subprogram denoted by the Read
118375 attribute of the specific type identified by the tag of
118376 Item. See *note 13.13.2::.
118377
118378 195
118379 S'Read
118380 For every subtype S of a specific type T:
118381
118382 196
118383 S'Read denotes a procedure with the following
118384 specification:
118385
118386 197/2
118387 procedure S'Read(
118388 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118389 Item : out T)
118390
118391 198
118392 S'Read reads the value of Item from Stream. See *note
118393 13.13.2::.
118394
118395 199
118396 S'Remainder
118397 For every subtype S of a floating point type T:
118398
118399 200
118400 S'Remainder denotes a function with the following
118401 specification:
118402
118403 201
118404 function S'Remainder (X, Y : T)
118405 return T
118406
118407 202
118408 For nonzero Y, let v be the value X - n · Y, where n is
118409 the integer nearest to the exact value of X/Y; if |n -
118410 X/Y| = 1/2, then n is chosen to be even. If v is a
118411 machine number of the type T, the function yields v;
118412 otherwise, it yields zero. Constraint_Error is raised if
118413 Y is zero. A zero result has the sign of X when
118414 S'Signed_Zeros is True. See *note A.5.3::.
118415
118416 202.1/3
118417 F'Result
118418 For a prefix F that denotes a function declaration:
118419
118420 202.2/3
118421 Within a postcondition expression for function F, denotes
118422 the result object of the function. The type of this
118423 attribute is that of the function result except within a
118424 Post'Class postcondition expression for a function with a
118425 controlling result or with a controlling access result.
118426 For a controlling result, the type of the attribute is
118427 T'Class, where T is the function result type. For a
118428 controlling access result, the type of the attribute is
118429 an anonymous access type whose designated type is
118430 T'Class, where T is the designated type of the function
118431 result type. See *note 6.1.1::.
118432
118433 203
118434 S'Round
118435 For every decimal fixed point subtype S:
118436
118437 204
118438 S'Round denotes a function with the following
118439 specification:
118440
118441 205
118442 function S'Round(X : universal_real)
118443 return S'Base
118444
118445 206
118446 The function returns the value obtained by rounding X
118447 (away from 0, if X is midway between two values of the
118448 type of S). See *note 3.5.10::.
118449
118450 207
118451 S'Rounding
118452 For every subtype S of a floating point type T:
118453
118454 208
118455 S'Rounding denotes a function with the following
118456 specification:
118457
118458 209
118459 function S'Rounding (X : T)
118460 return T
118461
118462 210
118463 The function yields the integral value nearest to X,
118464 rounding away from zero if X lies exactly halfway between
118465 two integers. A zero result has the sign of X when
118466 S'Signed_Zeros is True. See *note A.5.3::.
118467
118468 211
118469 S'Safe_First
118470 For every subtype S of a floating point type T:
118471
118472 212
118473 Yields the lower bound of the safe range (see *note
118474 3.5.7::) of the type T. If the Numerics Annex is not
118475 supported, the value of this attribute is implementation
118476 defined; see *note G.2.2:: for the definition that
118477 applies to implementations supporting the Numerics Annex.
118478 The value of this attribute is of the type
118479 universal_real. See *note A.5.3::.
118480
118481 213
118482 S'Safe_Last
118483 For every subtype S of a floating point type T:
118484
118485 214
118486 Yields the upper bound of the safe range (see *note
118487 3.5.7::) of the type T. If the Numerics Annex is not
118488 supported, the value of this attribute is implementation
118489 defined; see *note G.2.2:: for the definition that
118490 applies to implementations supporting the Numerics Annex.
118491 The value of this attribute is of the type
118492 universal_real. See *note A.5.3::.
118493
118494 215
118495 S'Scale
118496 For every decimal fixed point subtype S:
118497
118498 216
118499 S'Scale denotes the scale of the subtype S, defined as
118500 the value N such that S'Delta = 10.0**(-N). The scale
118501 indicates the position of the point relative to the
118502 rightmost significant digits of values of subtype S. The
118503 value of this attribute is of the type universal_integer.
118504 See *note 3.5.10::.
118505
118506 217
118507 S'Scaling
118508 For every subtype S of a floating point type T:
118509
118510 218
118511 S'Scaling denotes a function with the following
118512 specification:
118513
118514 219
118515 function S'Scaling (X : T;
118516 Adjustment : universal_integer)
118517 return T
118518
118519 220
118520 Let v be the value X · T'Machine_RadixAdjustment. If v
118521 is a machine number of the type T, or if |v| >=
118522 T'Model_Small, the function yields v; otherwise, it
118523 yields either one of the machine numbers of the type T
118524 adjacent to v. Constraint_Error is optionally raised if
118525 v is outside the base range of S. A zero result has the
118526 sign of X when S'Signed_Zeros is True. See *note
118527 A.5.3::.
118528
118529 221
118530 S'Signed_Zeros
118531 For every subtype S of a floating point type T:
118532
118533 222
118534 Yields the value True if the hardware representation for
118535 the type T has the capability of representing both
118536 positively and negatively signed zeros, these being
118537 generated and used by the predefined operations of the
118538 type T as specified in IEC 559:1989; yields the value
118539 False otherwise. The value of this attribute is of the
118540 predefined type Boolean. See *note A.5.3::.
118541
118542 223
118543 S'Size
118544 For every subtype S:
118545
118546 224
118547 If S is definite, denotes the size (in bits) that the
118548 implementation would choose for the following objects of
118549 subtype S:
118550
118551 225
118552 * A record component of subtype S when the record type
118553 is packed.
118554
118555 226
118556 * The formal parameter of an instance of
118557 Unchecked_Conversion that converts from subtype S to
118558 some other subtype.
118559
118560 227
118561 If S is indefinite, the meaning is implementation
118562 defined. The value of this attribute is of the type
118563 universal_integer. See *note 13.3::.
118564
118565 228/1
118566 X'Size
118567 For a prefix X that denotes an object:
118568
118569 229
118570 Denotes the size in bits of the representation of the
118571 object. The value of this attribute is of the type
118572 universal_integer. See *note 13.3::.
118573
118574 230
118575 S'Small
118576 For every fixed point subtype S:
118577
118578 231
118579 S'Small denotes the small of the type of S. The value of
118580 this attribute is of the type universal_real. See *note
118581 3.5.10::.
118582
118583 232
118584 S'Storage_Pool
118585 For every access-to-object subtype S:
118586
118587 233
118588 Denotes the storage pool of the type of S. The type of
118589 this attribute is Root_Storage_Pool'Class. See *note
118590 13.11::.
118591
118592 234
118593 S'Storage_Size
118594 For every access-to-object subtype S:
118595
118596 235
118597 Yields the result of calling
118598 Storage_Size(S'Storage_Pool), which is intended to be a
118599 measure of the number of storage elements reserved for
118600 the pool. The type of this attribute is
118601 universal_integer. See *note 13.11::.
118602
118603 236/1
118604 T'Storage_Size
118605 For a prefix T that denotes a task object (after any
118606 implicit dereference):
118607
118608 237
118609 Denotes the number of storage elements reserved for the
118610 task. The value of this attribute is of the type
118611 universal_integer. The Storage_Size includes the size of
118612 the task's stack, if any. The language does not specify
118613 whether or not it includes other storage associated with
118614 the task (such as the "task control block" used by some
118615 implementations.) See *note 13.3::.
118616
118617 237.1/3
118618 S'Stream_Size
118619 For every subtype S of an elementary type T:
118620
118621 237.2/3
118622 Denotes the number of bits read from or written to a
118623 stream by the default implementations of S'Read and
118624 S'Write. Hence, the number of stream elements required
118625 per item of elementary type T is:
118626
118627 237.3/2
118628 T'Stream_Size / Ada.Streams.Stream_Element'Size
118629
118630 237.4/2
118631 The value of this attribute is of type universal_integer
118632 and is a multiple of Stream_Element'Size. See *note
118633 13.13.2::.
118634
118635 238
118636 S'Succ
118637 For every scalar subtype S:
118638
118639 239
118640 S'Succ denotes a function with the following
118641 specification:
118642
118643 240
118644 function S'Succ(Arg : S'Base)
118645 return S'Base
118646
118647 241
118648 For an enumeration type, the function returns the value
118649 whose position number is one more than that of the value
118650 of Arg; Constraint_Error is raised if there is no such
118651 value of the type. For an integer type, the function
118652 returns the result of adding one to the value of Arg.
118653 For a fixed point type, the function returns the result
118654 of adding small to the value of Arg. For a floating
118655 point type, the function returns the machine number (as
118656 defined in *note 3.5.7::) immediately above the value of
118657 Arg; Constraint_Error is raised if there is no such
118658 machine number. See *note 3.5::.
118659
118660 242
118661 S'Tag
118662 For every subtype S of a tagged type T (specific or
118663 class-wide):
118664
118665 243
118666 S'Tag denotes the tag of the type T (or if T is
118667 class-wide, the tag of the root type of the corresponding
118668 class). The value of this attribute is of type Tag. See
118669 *note 3.9::.
118670
118671 244
118672 X'Tag
118673 For a prefix X that is of a class-wide tagged type (after
118674 any implicit dereference):
118675
118676 245
118677 X'Tag denotes the tag of X. The value of this attribute
118678 is of type Tag. See *note 3.9::.
118679
118680 246
118681 T'Terminated
118682 For a prefix T that is of a task type (after any implicit
118683 dereference):
118684
118685 247
118686 Yields the value True if the task denoted by T is
118687 terminated, and False otherwise. The value of this
118688 attribute is of the predefined type Boolean. See *note
118689 9.9::.
118690
118691 248
118692 S'Truncation
118693 For every subtype S of a floating point type T:
118694
118695 249
118696 S'Truncation denotes a function with the following
118697 specification:
118698
118699 250
118700 function S'Truncation (X : T)
118701 return T
118702
118703 251
118704 The function yields the value 'ceiling(X)' when X is
118705 negative, and 'floor(X)' otherwise. A zero result has
118706 the sign of X when S'Signed_Zeros is True. See *note
118707 A.5.3::.
118708
118709 252
118710 S'Unbiased_Rounding
118711 For every subtype S of a floating point type T:
118712
118713 253
118714 S'Unbiased_Rounding denotes a function with the following
118715 specification:
118716
118717 254
118718 function S'Unbiased_Rounding (X : T)
118719 return T
118720
118721 255
118722 The function yields the integral value nearest to X,
118723 rounding toward the even integer if X lies exactly
118724 halfway between two integers. A zero result has the sign
118725 of X when S'Signed_Zeros is True. See *note A.5.3::.
118726
118727 256
118728 X'Unchecked_Access
118729 For a prefix X that denotes an aliased view of an object:
118730
118731 257
118732 All rules and semantics that apply to X'Access (see *note
118733 3.10.2::) apply also to X'Unchecked_Access, except that,
118734 for the purposes of accessibility rules and checks, it is
118735 as if X were declared immediately within a library
118736 package. See *note 13.10::.
118737
118738 258
118739 S'Val
118740 For every discrete subtype S:
118741
118742 259
118743 S'Val denotes a function with the following
118744 specification:
118745
118746 260
118747 function S'Val(Arg : universal_integer)
118748 return S'Base
118749
118750 261
118751 This function returns a value of the type of S whose
118752 position number equals the value of Arg. See *note
118753 3.5.5::.
118754
118755 262
118756 X'Valid
118757 For a prefix X that denotes a scalar object (after any
118758 implicit dereference):
118759
118760 263/3
118761 Yields True if and only if the object denoted by X is
118762 normal, has a valid representation, and the predicate of
118763 the nominal subtype of X evaluates to True. The value of
118764 this attribute is of the predefined type Boolean. See
118765 *note 13.9.2::.
118766
118767 264
118768 S'Value
118769 For every scalar subtype S:
118770
118771 265
118772 S'Value denotes a function with the following
118773 specification:
118774
118775 266
118776 function S'Value(Arg : String)
118777 return S'Base
118778
118779 267
118780 This function returns a value given an image of the value
118781 as a String, ignoring any leading or trailing spaces.
118782 See *note 3.5::.
118783
118784 268/1
118785 P'Version
118786 For a prefix P that statically denotes a program unit:
118787
118788 269
118789 Yields a value of the predefined type String that
118790 identifies the version of the compilation unit that
118791 contains the declaration of the program unit. See *note
118792 E.3::.
118793
118794 270
118795 S'Wide_Image
118796 For every scalar subtype S:
118797
118798 271
118799 S'Wide_Image denotes a function with the following
118800 specification:
118801
118802 272
118803 function S'Wide_Image(Arg : S'Base)
118804 return Wide_String
118805
118806 273/3
118807 The function returns an image of the value of Arg as a
118808 Wide_String. See *note 3.5::.
118809
118810 274
118811 S'Wide_Value
118812 For every scalar subtype S:
118813
118814 275
118815 S'Wide_Value denotes a function with the following
118816 specification:
118817
118818 276
118819 function S'Wide_Value(Arg : Wide_String)
118820 return S'Base
118821
118822 277
118823 This function returns a value given an image of the value
118824 as a Wide_String, ignoring any leading or trailing
118825 spaces. See *note 3.5::.
118826
118827 277.1/2
118828 S'Wide_Wide_Image
118829 For every scalar subtype S:
118830
118831 277.2/2
118832 S'Wide_Wide_Image denotes a function with the following
118833 specification:
118834
118835 277.3/2
118836 function S'Wide_Wide_Image(Arg : S'Base)
118837 return Wide_Wide_String
118838
118839 277.4/2
118840 The function returns an image of the value of Arg, that
118841 is, a sequence of characters representing the value in
118842 display form. See *note 3.5::.
118843
118844 277.5/2
118845 S'Wide_Wide_Value
118846 For every scalar subtype S:
118847
118848 277.6/2
118849 S'Wide_Wide_Value denotes a function with the following
118850 specification:
118851
118852 277.7/2
118853 function S'Wide_Wide_Value(Arg : Wide_Wide_String)
118854 return S'Base
118855
118856 277.8/2
118857 This function returns a value given an image of the value
118858 as a Wide_Wide_String, ignoring any leading or trailing
118859 spaces. See *note 3.5::.
118860
118861 277.9/2
118862 S'Wide_Wide_Width
118863 For every scalar subtype S:
118864
118865 277.10/2
118866 S'Wide_Wide_Width denotes the maximum length of a
118867 Wide_Wide_String returned by S'Wide_Wide_Image over all
118868 values of the subtype S. It denotes zero for a subtype
118869 that has a null range. Its type is universal_integer.
118870 See *note 3.5::.
118871
118872 278
118873 S'Wide_Width
118874 For every scalar subtype S:
118875
118876 279
118877 S'Wide_Width denotes the maximum length of a Wide_String
118878 returned by S'Wide_Image over all values of the subtype
118879 S. It denotes zero for a subtype that has a null range.
118880 Its type is universal_integer. See *note 3.5::.
118881
118882 280
118883 S'Width
118884 For every scalar subtype S:
118885
118886 281
118887 S'Width denotes the maximum length of a String returned
118888 by S'Image over all values of the subtype S. It denotes
118889 zero for a subtype that has a null range. Its type is
118890 universal_integer. See *note 3.5::.
118891
118892 282
118893 S'Class'Write
118894 For every subtype S'Class of a class-wide type T'Class:
118895
118896 283
118897 S'Class'Write denotes a procedure with the following
118898 specification:
118899
118900 284/2
118901 procedure S'Class'Write(
118902 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118903 Item : in T'Class)
118904
118905 285
118906 Dispatches to the subprogram denoted by the Write
118907 attribute of the specific type identified by the tag of
118908 Item. See *note 13.13.2::.
118909
118910 286
118911 S'Write
118912 For every subtype S of a specific type T:
118913
118914 287
118915 S'Write denotes a procedure with the following
118916 specification:
118917
118918 288/2
118919 procedure S'Write(
118920 Stream : not null access Ada.Streams.Root_Stream_Type'Class;
118921 Item : in T)
118922
118923 289
118924 S'Write writes the value of Item to Stream. See *note
118925 13.13.2::.
118926
118927 \1f
118928 File: aarm2012.info, Node: Annex L, Next: Annex M, Prev: Annex K, Up: Top
118929
118930 Annex L Language-Defined Pragmas
118931 ********************************
118932
118933 1
118934 This Annex summarizes the definitions given elsewhere of the
118935 language-defined pragmas.
118936
118937 2
118938 pragma All_Calls_Remote[(library_unit_name)]; -- See *note E.2.3::.
118939
118940 2.1/2
118941 pragma Assert([Check =>] boolean_expression[, [Message =>] string_
118942 expression]); -- See *note 11.4.2::.
118943
118944 2.2/2
118945 pragma Assertion_Policy(policy_identifier); -- See *note 11.4.2::.
118946
118947 2.3/3
118948 pragma Assertion_Policy(
118949 assertion_aspect_mark => policy_identifier
118950 {, assertion_aspect_mark => policy_identifier}); -- See *note
118951 11.4.2::.
118952
118953 3/3
118954 This paragraph was deleted.
118955
118956 3.1/3
118957 pragma Asynchronous (local_name); -- See *note J.15.13::.
118958
118959 4/3
118960 This paragraph was deleted.
118961
118962 4.1/3
118963 pragma Atomic (local_name); -- See *note J.15.8::.
118964
118965 5/3
118966 This paragraph was deleted.
118967
118968 5.1/3
118969 pragma Atomic_Components (array_local_name); -- See *note J.15.8::.
118970
118971 6/3
118972 This paragraph was deleted.
118973
118974 6.1/3
118975 pragma Attach_Handler (handler_name, expression); -- See *note J.15.7::.
118976
118977 7/3
118978 This paragraph was deleted.
118979
118980 8/3
118981 This paragraph was deleted.
118982
118983 8.1/3
118984 pragma Convention([Convention =>] convention_identifier,[Entity =>]
118985 local_name); -- See *note J.15.5::.
118986
118987 8.2/3
118988 pragma CPU (expression); -- See *note J.15.9::.
118989
118990 8.3/3
118991 pragma Default_Storage_Pool (storage_pool_indicator); -- See *note
118992 13.11.3::.
118993
118994 8.4/2
118995 pragma Detect_Blocking; -- See *note H.5::.
118996
118997 9
118998 pragma Discard_Names[([On => ] local_name)]; -- See *note C.5::.
118999
119000 9.1/3
119001 pragma Dispatching_Domain (expression); -- See *note J.15.10::.
119002
119003 10
119004 pragma Elaborate(library_unit_name{, library_unit_name}); -- See *note
119005 10.2.1::.
119006
119007 11
119008 pragma Elaborate_All(library_unit_name{, library_unit_name}); -- See
119009 *note 10.2.1::.
119010
119011 12
119012 pragma Elaborate_Body[(library_unit_name)]; -- See *note 10.2.1::.
119013
119014 13/3
119015 This paragraph was deleted.
119016
119017 13.1/3
119018 pragma Export(
119019 [Convention =>] convention_identifier, [Entity =>] local_name
119020 [, [External_Name =>] external_name_string_expression]
119021 [, [Link_Name =>] link_name_string_expression]); -- See *note
119022 J.15.5::.
119023
119024 14/3
119025 This paragraph was deleted.
119026
119027 14.1/3
119028 pragma Import(
119029 [Convention =>] convention_identifier, [Entity =>] local_name
119030 [, [External_Name =>] external_name_string_expression]
119031 [, [Link_Name =>] link_name_string_expression]); -- See *note
119032 J.15.5::.
119033
119034 14.2/3
119035 pragma Independent (component_local_name); -- See *note J.15.8::.
119036
119037 14.3/3
119038 pragma Independent_Components (local_name); -- See *note J.15.8::.
119039
119040 15/3
119041 This paragraph was deleted.
119042
119043 15.1/3
119044 pragma Inline (name{, name}); -- See *note J.15.1::.
119045
119046 16
119047 pragma Inspection_Point[(object_name {, object_name})]; -- See *note
119048 H.3.2::.
119049
119050 17/3
119051 This paragraph was deleted.
119052
119053 17.1/3
119054 pragma Interrupt_Handler (handler_name); -- See *note J.15.7::.
119055
119056 18/3
119057 This paragraph was deleted.
119058
119059 18.1/3
119060 pragma Interrupt_Priority [(expression);] -- See *note J.15.11::.
119061
119062 19
119063 pragma Linker_Options(string_expression); -- See *note B.1::.
119064
119065 20
119066 pragma List(identifier); -- See *note 2.8::.
119067
119068 21
119069 pragma Locking_Policy(policy_identifier); -- See *note D.3::.
119070
119071 21.1/3
119072 This paragraph was deleted.
119073
119074 21.2/3
119075 pragma No_Return (procedure_local_name{, procedure_local_name}); -- See
119076 *note J.15.2::.
119077
119078 22
119079 pragma Normalize_Scalars; -- See *note H.1::.
119080
119081 23
119082 pragma Optimize(identifier); -- See *note 2.8::.
119083
119084 24/3
119085 This paragraph was deleted.
119086
119087 24.1/3
119088 pragma Pack (first_subtype_local_name); -- See *note J.15.3::.
119089
119090 25
119091 pragma Page; -- See *note 2.8::.
119092
119093 25.1/2
119094 pragma Partition_Elaboration_Policy (policy_identifier); -- See *note
119095 H.6::.
119096
119097 25.2/2
119098 pragma Preelaborable_Initialization(direct_name); -- See *note 10.2.1::.
119099
119100 26
119101 pragma Preelaborate[(library_unit_name)]; -- See *note 10.2.1::.
119102
119103 27/3
119104 This paragraph was deleted.
119105
119106 27.1/3
119107 pragma Priority (expression); -- See *note J.15.11::.
119108
119109 27.2/2
119110 pragma Priority_Specific_Dispatching (
119111 policy_identifier, first_priority_expression, last_priority_
119112 expression); -- See *note D.2.2::.
119113
119114 27.3/3
119115 pragma Profile (profile_identifier {, profile_
119116 pragma_argument_association}); -- See *note 13.12::.
119117
119118 27.4/3
119119 This paragraph was deleted.
119120
119121 28
119122 pragma Pure[(library_unit_name)]; -- See *note 10.2.1::.
119123
119124 29
119125 pragma Queuing_Policy(policy_identifier); -- See *note D.4::.
119126
119127 29.1/3
119128 This paragraph was deleted.
119129
119130 29.2/3
119131 pragma Relative_Deadline (relative_deadline_expression); -- See *note
119132 J.15.12::.
119133
119134 30
119135 pragma Remote_Call_Interface[(library_unit_name)]; -- See *note E.2.3::.
119136
119137 31
119138 pragma Remote_Types[(library_unit_name)]; -- See *note E.2.2::.
119139
119140 32
119141 pragma Restrictions(restriction{, restriction}); -- See *note 13.12::.
119142
119143 33
119144 pragma Reviewable; -- See *note H.3.1::.
119145
119146 34
119147 pragma Shared_Passive[(library_unit_name)]; -- See *note E.2.1::.
119148
119149 35/3
119150 This paragraph was deleted.
119151
119152 35.1/3
119153 pragma Storage_Size (expression); -- See *note J.15.4::.
119154
119155 36
119156 pragma Suppress(identifier); -- See *note 11.5::.
119157
119158 37
119159 pragma Task_Dispatching_Policy(policy_identifier); -- See *note D.2.2::.
119160
119161 37.1/3
119162 This paragraph was deleted.
119163
119164 37.2/3
119165 pragma Unchecked_Union (first_subtype_local_name); -- See *note
119166 J.15.6::.
119167
119168 37.3/2
119169 pragma Unsuppress(identifier); -- See *note 11.5::.
119170
119171 38/3
119172 This paragraph was deleted.
119173
119174 38.1/3
119175 pragma Volatile (local_name); -- See *note J.15.8::.
119176
119177 39/3
119178 This paragraph was deleted.
119179
119180 39.1/3
119181 pragma Volatile_Components (array_local_name); -- See *note J.15.8::.
119182
119183 _Wording Changes from Ada 83_
119184
119185 39.a
119186 Pragmas List, Page, and Optimize are now officially defined in
119187 *note 2.8::, "*note 2.8:: Pragmas".
119188
119189 \1f
119190 File: aarm2012.info, Node: Annex M, Next: Annex N, Prev: Annex L, Up: Top
119191
119192 Annex M Summary of Documentation Requirements
119193 *********************************************
119194
119195 1/3
119196 {AI05-0299-1AI05-0299-1} The Ada language allows for certain target
119197 machine dependences in a controlled manner. Each Ada implementation
119198 must document many characteristics and properties of the target system.
119199 This International Standard contains specific documentation
119200 requirements. In addition, many characteristics that require
119201 documentation are identified throughout this International Standard as
119202 being implementation defined. Finally, this International Standard
119203 requires documentation of whether implementation advice is followed.
119204 The following subclauses provide summaries of these documentation
119205 requirements.
119206
119207 * Menu:
119208
119209 * M.1 :: Specific Documentation Requirements
119210 * M.2 :: Implementation-Defined Characteristics
119211 * M.3 :: Implementation Advice
119212
119213 \1f
119214 File: aarm2012.info, Node: M.1, Next: M.2, Up: Annex M
119215
119216 M.1 Specific Documentation Requirements
119217 =======================================
119218
119219 1/2
119220 In addition to implementation-defined characteristics, each Ada
119221 implementation must document various properties of the implementation:
119222
119223 1.a/2
119224 Ramification: Most of the items in this list require
119225 documentation only for implementations that conform to
119226 Specialized Needs Annexes.
119227
119228 2/2
119229 * The behavior of implementations in implementation-defined
119230 situations shall be documented -- see *note M.2::, "*note M.2::
119231 Implementation-Defined Characteristics" for a listing. See *note
119232 1.1.3::(19).
119233
119234 3/2
119235 * The set of values that a user-defined Allocate procedure needs to
119236 accept for the Alignment parameter. How the standard storage pool
119237 is chosen, and how storage is allocated by standard storage pools.
119238 See *note 13.11::(22).
119239
119240 4/2
119241 * The algorithm used for random number generation, including a
119242 description of its period. See *note A.5.2::(44).
119243
119244 5/2
119245 * The minimum time interval between calls to the time-dependent Reset
119246 procedure that is guaranteed to initiate different random number
119247 sequences. See *note A.5.2::(45).
119248
119249 6/2
119250 * The conditions under which Io_Exceptions.Name_Error,
119251 Io_Exceptions.Use_Error, and Io_Exceptions.Device_Error are
119252 propagated. See *note A.13::(15).
119253
119254 7/2
119255 * The behavior of package Environment_Variables when environment
119256 variables are changed by external mechanisms. See *note
119257 A.17::(30/2).
119258
119259 8/2
119260 * The overhead of calling machine-code or intrinsic subprograms. See
119261 *note C.1::(6).
119262
119263 9/2
119264 * The types and attributes used in machine code insertions. See
119265 *note C.1::(7).
119266
119267 10/2
119268 * The subprogram calling conventions for all supported convention
119269 identifiers. See *note C.1::(8/3).
119270
119271 11/2
119272 * The mapping between the Link_Name or Ada designator and the
119273 external link name. See *note C.1::(9).
119274
119275 12/2
119276 * The treatment of interrupts. See *note C.3::(22).
119277
119278 13/2
119279 * The metrics for interrupt handlers. See *note C.3.1::(16).
119280
119281 14/3
119282 * If the Ceiling_Locking policy is in effect, the default ceiling
119283 priority for a protected object that specifies an interrupt handler
119284 aspect. See *note C.3.2::(24/3).
119285
119286 15/2
119287 * Any circumstances when the elaboration of a preelaborated package
119288 causes code to be executed. See *note C.4::(12).
119289
119290 16/2
119291 * Whether a partition can be restarted without reloading. See *note
119292 C.4::(13).
119293
119294 17/2
119295 * The effect of calling Current_Task from an entry body or interrupt
119296 handler. See *note C.7.1::(19).
119297
119298 18/2
119299 * For package Task_Attributes, limits on the number and size of task
119300 attributes, and how to configure any limits. See *note
119301 C.7.2::(19).
119302
119303 19/2
119304 * The metrics for the Task_Attributes package. See *note
119305 C.7.2::(27).
119306
119307 20/2
119308 * The details of the configuration used to generate the values of all
119309 metrics. See *note D::(2).
119310
119311 21/2
119312 * The maximum priority inversion a user task can experience from the
119313 implementation. See *note D.2.3::(12/2).
119314
119315 22/2
119316 * The amount of time that a task can be preempted for processing on
119317 behalf of lower-priority tasks. See *note D.2.3::(13/2).
119318
119319 23/2
119320 * The quantum values supported for round robin dispatching. See
119321 *note D.2.5::(16/2).
119322
119323 24/2
119324 * The accuracy of the detection of the exhaustion of the budget of a
119325 task for round robin dispatching. See *note D.2.5::(17/2).
119326
119327 25/2
119328 * Any conditions that cause the completion of the setting of the
119329 deadline of a task to be delayed for a multiprocessor. See *note
119330 D.2.6::(32/2).
119331
119332 26/2
119333 * Any conditions that cause the completion of the setting of the
119334 priority of a task to be delayed for a multiprocessor. See *note
119335 D.5.1::(12.1/2).
119336
119337 27/2
119338 * The metrics for Set_Priority. See *note D.5.1::(14).
119339
119340 28/2
119341 * The metrics for setting the priority of a protected object. See
119342 *note D.5.2::(10).
119343
119344 29/2
119345 * On a multiprocessor, any conditions that cause the completion of an
119346 aborted construct to be delayed later than what is specified for a
119347 single processor. See *note D.6::(3).
119348
119349 30/2
119350 * The metrics for aborts. See *note D.6::(8).
119351
119352 31/2
119353 * The values of Time_First, Time_Last, Time_Span_First,
119354 Time_Span_Last, Time_Span_Unit, and Tick for package Real_Time.
119355 See *note D.8::(33).
119356
119357 32/2
119358 * The properties of the underlying time base used in package
119359 Real_Time. See *note D.8::(34).
119360
119361 33/2
119362 * Any synchronization of package Real_Time with external time
119363 references. See *note D.8::(35).
119364
119365 34/2
119366 * Any aspects of the external environment that could interfere with
119367 package Real_Time. See *note D.8::(36/3).
119368
119369 35/2
119370 * The metrics for package Real_Time. See *note D.8::(45).
119371
119372 36/2
119373 * The minimum value of the delay expression of a
119374 delay_relative_statement that causes a task to actually be blocked.
119375 See *note D.9::(7).
119376
119377 37/2
119378 * The minimum difference between the value of the delay expression of
119379 a delay_until_statement and the value of Real_Time.Clock, that
119380 causes the task to actually be blocked. See *note D.9::(8).
119381
119382 38/2
119383 * The metrics for delay statements. See *note D.9::(13).
119384
119385 39/2
119386 * The upper bound on the duration of interrupt blocking caused by the
119387 implementation. See *note D.12::(5).
119388
119389 40/2
119390 * The metrics for entry-less protected objects. See *note
119391 D.12::(12).
119392
119393 41/2
119394 * The values of CPU_Time_First, CPU_Time_Last, CPU_Time_Unit, and
119395 CPU_Tick of package Execution_Time. See *note D.14::(21/2).
119396
119397 42/3
119398 * The properties of the mechanism used to implement package
119399 Execution_Time, including the values of the constants defined in
119400 the package. See *note D.14::(22/2).
119401
119402 43/2
119403 * The metrics for execution time. See *note D.14::(27).
119404
119405 44/2
119406 * The metrics for timing events. See *note D.15::(24).
119407
119408 44.1/3
119409 * The processor(s) on which the clock interrupt is handled; the
119410 processors on which each Interrupt_Id can be handled. See *note
119411 D.16.1::(32).
119412
119413 45/2
119414 * Whether the RPC-receiver is invoked from concurrent tasks, and if
119415 so, the number of such tasks. See *note E.5::(25).
119416
119417 46/2
119418 * Any techniques used to reduce cancellation errors in
119419 Numerics.Generic_Real_Arrays shall be documented. See *note
119420 G.3.1::(86/2).
119421
119422 47/2
119423 * Any techniques used to reduce cancellation errors in
119424 Numerics.Generic_Complex_Arrays shall be documented. See *note
119425 G.3.2::(155/2).
119426
119427 48/2
119428 * If a pragma Normalize_Scalars applies, the implicit initial values
119429 of scalar subtypes shall be documented. Such a value should be an
119430 invalid representation when possible; any cases when is it not
119431 shall be documented. See *note H.1::(5/2).
119432
119433 49/2
119434 * The range of effects for each bounded error and each unspecified
119435 effect. If the effects of a given erroneous construct are
119436 constrained, the constraints shall be documented. See *note
119437 H.2::(1).
119438
119439 50/2
119440 * For each inspection point, a mapping between each inspectable
119441 object and the machine resources where the object's value can be
119442 obtained shall be provided. See *note H.3.2::(8).
119443
119444 51/2
119445 * If a pragma Restrictions(No_Exceptions) is specified, the effects
119446 of all constructs where language-defined checks are still
119447 performed. See *note H.4::(25).
119448
119449 52/2
119450 * The interrupts to which a task entry may be attached. See *note
119451 J.7.1::(12).
119452
119453 53/2
119454 * The type of entry call invoked for an interrupt entry. See *note
119455 J.7.1::(13).
119456
119457 \1f
119458 File: aarm2012.info, Node: M.2, Next: M.3, Prev: M.1, Up: Annex M
119459
119460 M.2 Implementation-Defined Characteristics
119461 ==========================================
119462
119463 1/2
119464 The Ada language allows for certain machine dependences in a controlled
119465 manner. Each Ada implementation must document all
119466 implementation-defined characteristics:
119467
119468 1.a
119469 Ramification: It need not document unspecified
119470 characteristics.
119471
119472 1.b
119473 Some of the items in this list require documentation only for
119474 implementations that conform to Specialized Needs Annexes.
119475
119476 2/2
119477 * Whether or not each recommendation given in Implementation Advice
119478 is followed -- see *note M.3::, "*note M.3:: Implementation Advice"
119479 for a listing. See *note 1.1.2::(37).
119480
119481 3
119482 * Capacity limitations of the implementation. See *note 1.1.3::(3).
119483
119484 4
119485 * Variations from the standard that are impractical to avoid given
119486 the implementation's execution environment. See *note 1.1.3::(6).
119487
119488 5
119489 * Which code_statements cause external interactions. See *note
119490 1.1.3::(10).
119491
119492 6
119493 * The coded representation for the text of an Ada program. See *note
119494 2.1::(4/3).
119495
119496 6.1/2
119497 * The semantics of an Ada program whose text is not in Normalization
119498 Form KC. See *note 2.1::(4.1/3).
119499
119500 7/2
119501 * This paragraph was deleted.
119502
119503 8
119504 * The representation for an end of line. See *note 2.2::(2/3).
119505
119506 9
119507 * Maximum supported line length and lexical element length. See
119508 *note 2.2::(14).
119509
119510 10
119511 * Implementation-defined pragmas. See *note 2.8::(14).
119512
119513 11
119514 * Effect of pragma Optimize. See *note 2.8::(27).
119515
119516 11.1/2
119517 * The sequence of characters of the value returned by S'Wide_Image
119518 when some of the graphic characters of S'Wide_Wide_Image are not
119519 defined in Wide_Character. See *note 3.5::(30/3).
119520
119521 12/2
119522 * The sequence of characters of the value returned by S'Image when
119523 some of the graphic characters of S'Wide_Wide_Image are not defined
119524 in Character. See *note 3.5::(37/3).
119525
119526 13
119527 * The predefined integer types declared in Standard. See *note
119528 3.5.4::(25).
119529
119530 14
119531 * Any nonstandard integer types and the operators defined for them.
119532 See *note 3.5.4::(26).
119533
119534 15
119535 * Any nonstandard real types and the operators defined for them. See
119536 *note 3.5.6::(8).
119537
119538 16
119539 * What combinations of requested decimal precision and range are
119540 supported for floating point types. See *note 3.5.7::(7).
119541
119542 17
119543 * The predefined floating point types declared in Standard. See
119544 *note 3.5.7::(16).
119545
119546 18
119547 * The small of an ordinary fixed point type. See *note 3.5.9::(8/2).
119548
119549 19
119550 * What combinations of small, range, and digits are supported for
119551 fixed point types. See *note 3.5.9::(10).
119552
119553 20/2
119554 * The result of Tags.Wide_Wide_Expanded_Name for types declared
119555 within an unnamed block_statement. See *note 3.9::(10).
119556
119557 20.1/2
119558 * The sequence of characters of the value returned by
119559 Tags.Expanded_Name (respectively, Tags.Wide_Expanded_Name) when
119560 some of the graphic characters of Tags.Wide_Wide_Expanded_Name are
119561 not defined in Character (respectively, Wide_Character). See *note
119562 3.9::(10.1/2).
119563
119564 21
119565 * Implementation-defined attributes. See *note 4.1.4::(12/1).
119566
119567 21.1/2
119568 * Rounding of real static expressions which are exactly half-way
119569 between two machine numbers. See *note 4.9::(38/2).
119570
119571 22
119572 * Any implementation-defined time types. See *note 9.6::(6/3).
119573
119574 23
119575 * The time base associated with relative delays. See *note
119576 9.6::(20).
119577
119578 24
119579 * The time base of the type Calendar.Time. See *note 9.6::(23).
119580
119581 25/2
119582 * The time zone used for package Calendar operations. See *note
119583 9.6::(24/2).
119584
119585 26
119586 * Any limit on delay_until_statements of select_statements. See
119587 *note 9.6::(29).
119588
119589 26.1/2
119590 * The result of Calendar.Formating.Image if its argument represents
119591 more than 100 hours. See *note 9.6.1::(86/2).
119592
119593 27/3
119594 * This paragraph was deleted.
119595
119596 28
119597 * The representation for a compilation. See *note 10.1::(2).
119598
119599 29
119600 * Any restrictions on compilations that contain multiple
119601 compilation_units. See *note 10.1::(4).
119602
119603 30
119604 * The mechanisms for creating an environment and for adding and
119605 replacing compilation units. See *note 10.1.4::(3/2).
119606
119607 30.1/2
119608 * The mechanisms for adding a compilation unit mentioned in a
119609 limited_with_clause to an environment. See *note 10.1.4::(3).
119610
119611 31
119612 * The manner of explicitly assigning library units to a partition.
119613 See *note 10.2::(2).
119614
119615 32
119616 * The implementation-defined means, if any, of specifying which
119617 compilation units are needed by a given compilation unit. See
119618 *note 10.2::(2).
119619
119620 33
119621 * The manner of designating the main subprogram of a partition. See
119622 *note 10.2::(7).
119623
119624 34
119625 * The order of elaboration of library_items. See *note 10.2::(18).
119626
119627 35
119628 * Parameter passing and function return for the main subprogram. See
119629 *note 10.2::(21).
119630
119631 36
119632 * The mechanisms for building and running partitions. See *note
119633 10.2::(24).
119634
119635 37
119636 * The details of program execution, including program termination.
119637 See *note 10.2::(25).
119638
119639 38
119640 * The semantics of any nonactive partitions supported by the
119641 implementation. See *note 10.2::(28/3).
119642
119643 39
119644 * The information returned by Exception_Message. See *note
119645 11.4.1::(10.1/3).
119646
119647 40/2
119648 * The result of Exceptions.Wide_Wide_Exception_Name for exceptions
119649 declared within an unnamed block_statement. See *note
119650 11.4.1::(12).
119651
119652 40.1/2
119653 * The sequence of characters of the value returned by
119654 Exceptions.Exception_Name (respectively,
119655 Exceptions.Wide_Exception_Name) when some of the graphic characters
119656 of Exceptions.Wide_Wide_Exception_Name are not defined in Character
119657 (respectively, Wide_Character). See *note 11.4.1::(12.1/2).
119658
119659 41
119660 * The information returned by Exception_Information. See *note
119661 11.4.1::(13/2).
119662
119663 41.1/3
119664 * Implementation-defined policy_identifiers and
119665 assertion_aspect_marks allowed in a pragma Assertion_Policy. See
119666 *note 11.4.2::(9/3).
119667
119668 41.2/2
119669 * The default assertion policy. See *note 11.4.2::(10).
119670
119671 42
119672 * Implementation-defined check names. See *note 11.5::(27).
119673
119674 42.1/2
119675 * Existence and meaning of second parameter of pragma Unsuppress.
119676 See *note 11.5::(27.1/2).
119677
119678 42.2/2
119679 * The cases that cause conflicts between the representation of the
119680 ancestors of a type_declaration. See *note 13.1::(13.1/3).
119681
119682 43/3
119683 * The interpretation of each representation aspect. See *note
119684 13.1::(20).
119685
119686 44/3
119687 * Any restrictions placed upon the specification of representation
119688 aspects. See *note 13.1::(20).
119689
119690 44.1/3
119691 * Implementation-defined aspects, inluding the syntax for specifying
119692 such aspects and the legality rules for such aspects. See *note
119693 13.1.1::(38).
119694
119695 44.2/2
119696 * The set of machine scalars. See *note 13.3::(8.1/3).
119697
119698 45
119699 * The meaning of Size for indefinite subtypes. See *note 13.3::(48).
119700
119701 46
119702 * The default external representation for a type tag. See *note
119703 13.3::(75/3).
119704
119705 47
119706 * What determines whether a compilation unit is the same in two
119707 different partitions. See *note 13.3::(76).
119708
119709 48
119710 * Implementation-defined components. See *note 13.5.1::(15).
119711
119712 49
119713 * If Word_Size = Storage_Unit, the default bit ordering. See *note
119714 13.5.3::(5).
119715
119716 50/2
119717 * The contents of the visible part of package System. See *note
119718 13.7::(2).
119719
119720 50.1/2
119721 * The range of Storage_Elements.Storage_Offset, the modulus of
119722 Storage_Elements.Storage_Element, and the declaration of
119723 Storage_Elements.Integer_Address.. See *note 13.7.1::(11).
119724
119725 51
119726 * The contents of the visible part of package System.Machine_Code,
119727 and the meaning of code_statements. See *note 13.8::(7).
119728
119729 51.1/2
119730 * The result of unchecked conversion for instances with scalar result
119731 types whose result is not defined by the language. See *note
119732 13.9::(11).
119733
119734 52/2
119735 * The effect of unchecked conversion for instances with nonscalar
119736 result types whose effect is not defined by the language. See
119737 *note 13.9::(11).
119738
119739 53/2
119740 * This paragraph was deleted.
119741
119742 54
119743 * Whether or not the implementation provides user-accessible names
119744 for the standard pool type(s). See *note 13.11::(17).
119745
119746 55/2
119747 * The meaning of Storage_Size when neither the Storage_Size nor the
119748 Storage_Pool is specified for an access type. See *note
119749 13.11::(18).
119750
119751 56/2
119752 * This paragraph was deleted.
119753
119754 57/3
119755 * This paragraph was deleted.
119756
119757 57.1/3
119758 * Implementation-defined restrictions allowed in a pragma
119759 Restrictions. See *note 13.12::(8.7/3).
119760
119761 58
119762 * The consequences of violating limitations on Restrictions pragmas.
119763 See *note 13.12::(9).
119764
119765 58.1/3
119766 * Implementation-defined usage profiles allowed in a pragma Profile.
119767 See *note 13.12::(15).
119768
119769 59/2
119770 * The contents of the stream elements read and written by the Read
119771 and Write attributes of elementary types. See *note 13.13.2::(9).
119772
119773 60
119774 * The names and characteristics of the numeric subtypes declared in
119775 the visible part of package Standard. See *note A.1::(3).
119776
119777 60.1/2
119778 * The values returned by Strings.Hash. See *note A.4.9::(3/2).
119779
119780 61
119781 * The accuracy actually achieved by the elementary functions. See
119782 *note A.5.1::(1).
119783
119784 62
119785 * The sign of a zero result from some of the operators or functions
119786 in Numerics.Generic_Elementary_Functions, when
119787 Float_Type'Signed_Zeros is True. See *note A.5.1::(46).
119788
119789 63
119790 * The value of Numerics.Float_Random.Max_Image_Width. See *note
119791 A.5.2::(27).
119792
119793 64
119794 * The value of Numerics.Discrete_Random.Max_Image_Width. See *note
119795 A.5.2::(27).
119796
119797 65/2
119798 * This paragraph was deleted.
119799
119800 66
119801 * The string representation of a random number generator's state.
119802 See *note A.5.2::(38).
119803
119804 67/2
119805 * This paragraph was deleted.
119806
119807 68
119808 * The values of the Model_Mantissa, Model_Emin, Model_Epsilon, Model,
119809 Safe_First, and Safe_Last attributes, if the Numerics Annex is not
119810 supported. See *note A.5.3::(72).
119811
119812 69/2
119813 * This paragraph was deleted.
119814
119815 70
119816 * The value of Buffer_Size in Storage_IO. See *note A.9::(10).
119817
119818 71/2
119819 * The external files associated with the standard input, standard
119820 output, and standard error files. See *note A.10::(5).
119821
119822 72
119823 * The accuracy of the value produced by Put. See *note A.10.9::(36).
119824
119825 72.1/1
119826 * Current size for a stream file for which positioning is not
119827 supported. See *note A.12.1::(1.1/1).
119828
119829 73/2
119830 * The meaning of Argument_Count, Argument, and Command_Name for
119831 package Command_Line. The bounds of type Command_Line.Exit_Status.
119832 See *note A.15::(1).
119833
119834 73.1/2
119835 * The interpretation of file names and directory names. See *note
119836 A.16::(46/2).
119837
119838 73.2/2
119839 * The maximum value for a file size in Directories. See *note
119840 A.16::(87/2).
119841
119842 73.3/2
119843 * The result for Directories.Size for a directory or special file See
119844 *note A.16::(93/2).
119845
119846 73.4/2
119847 * The result for Directories.Modification_Time for a directory or
119848 special file. See *note A.16::(95/2).
119849
119850 73.5/2
119851 * The interpretation of a nonnull search pattern in Directories. See
119852 *note A.16::(104/3).
119853
119854 73.6/2
119855 * The results of a Directories search if the contents of the
119856 directory are altered while a search is in progress. See *note
119857 A.16::(110/3).
119858
119859 73.7/2
119860 * The definition and meaning of an environment variable. See *note
119861 A.17::(1/2).
119862
119863 73.8/2
119864 * The circumstances where an environment variable cannot be defined.
119865 See *note A.17::(16/2).
119866
119867 73.9/2
119868 * Environment names for which Set has the effect of Clear. See *note
119869 A.17::(17/2).
119870
119871 73.10/2
119872 * The value of Containers.Hash_Type'Modulus. The value of
119873 Containers.Count_Type'Last. See *note A.18.1::(7/2).
119874
119875 74
119876 * Implementation-defined convention names. See *note B.1::(11/3).
119877
119878 75
119879 * The meaning of link names. See *note B.1::(36).
119880
119881 76
119882 * The manner of choosing link names when neither the link name nor
119883 the address of an imported or exported entity is specified. See
119884 *note B.1::(36).
119885
119886 77
119887 * The effect of pragma Linker_Options. See *note B.1::(37).
119888
119889 78
119890 * The contents of the visible part of package Interfaces and its
119891 language-defined descendants. See *note B.2::(1).
119892
119893 79/2
119894 * Implementation-defined children of package Interfaces. See *note
119895 B.2::(11).
119896
119897 79.1/2
119898 * The definitions of certain types and constants in Interfaces.C. See
119899 *note B.3::(41).
119900
119901 80/1
119902 * The types Floating, Long_Floating, Binary, Long_Binary,
119903 Decimal_Element, and COBOL_Character; and the initializations of
119904 the variables Ada_To_COBOL and COBOL_To_Ada, in Interfaces.COBOL.
119905 See *note B.4::(50).
119906
119907 80.1/1
119908 * The types Fortran_Integer, Real, Double_Precision, and
119909 Character_Set in Interfaces.Fortran. See *note B.5::(17).
119910
119911 81/2
119912 * Implementation-defined intrinsic subprograms. See *note
119913 C.1::(1/3).
119914
119915 82/2
119916 * This paragraph was deleted.
119917
119918 83/2
119919 * This paragraph was deleted.
119920
119921 83.1/3
119922 * Any restrictions on a protected procedure or its containing type
119923 when an aspect Attach_handler or Interrupt_Handler is specified.
119924 See *note C.3.1::(17).
119925
119926 83.2/3
119927 * Any other forms of interrupt handler supported by the
119928 Attach_Handler and Interrupt_Handler aspects. See *note
119929 C.3.1::(19).
119930
119931 84/2
119932 * This paragraph was deleted.
119933
119934 85
119935 * The semantics of pragma Discard_Names. See *note C.5::(7).
119936
119937 86
119938 * The result of the Task_Identification.Image attribute. See *note
119939 C.7.1::(7).
119940
119941 87/2
119942 * The value of Current_Task when in a protected entry, interrupt
119943 handler, or finalization of a task attribute. See *note
119944 C.7.1::(17/3).
119945
119946 88/2
119947 * This paragraph was deleted.
119948
119949 88.1/1
119950 * Granularity of locking for Task_Attributes. See *note
119951 C.7.2::(16/1).
119952
119953 89/2
119954 * This paragraph was deleted.
119955
119956 90/2
119957 * This paragraph was deleted.
119958
119959 91
119960 * The declarations of Any_Priority and Priority. See *note
119961 D.1::(11).
119962
119963 92
119964 * Implementation-defined execution resources. See *note D.1::(15).
119965
119966 93
119967 * Whether, on a multiprocessor, a task that is waiting for access to
119968 a protected object keeps its processor busy. See *note D.2.1::(3).
119969
119970 94/2
119971 * The effect of implementation-defined execution resources on task
119972 dispatching. See *note D.2.1::(9/2).
119973
119974 95/2
119975 * This paragraph was deleted.
119976
119977 96/2
119978 * This paragraph was deleted.
119979
119980 97/2
119981 * Implementation defined task dispatching policies. See *note
119982 D.2.2::(19).
119983
119984 97.1/2
119985 * The value of Default_Quantum in Dispatching.Round_Robin. See *note
119986 D.2.5::(4).
119987
119988 98
119989 * Implementation-defined policy_identifiers allowed in a pragma
119990 Locking_Policy. See *note D.3::(4).
119991
119992 98.1/2
119993 * The locking policy if no Locking_Policy pragma applies to any unit
119994 of a partition. See *note D.3::(6).
119995
119996 99
119997 * Default ceiling priorities. See *note D.3::(10/3).
119998
119999 100
120000 * The ceiling of any protected object used internally by the
120001 implementation. See *note D.3::(16).
120002
120003 101
120004 * Implementation-defined queuing policies. See *note D.4::(1/3).
120005
120006 102/2
120007 * This paragraph was deleted.
120008
120009 103
120010 * Any operations that implicitly require heap storage allocation.
120011 See *note D.7::(8).
120012
120013 103.1/2
120014 * When restriction No_Task_Termination applies to a partition, what
120015 happens when a task terminates. See *note D.7::(15.1/2).
120016
120017 103.2/2
120018 * The behavior when restriction Max_Storage_At_Blocking is violated.
120019 See *note D.7::(17/1).
120020
120021 103.3/2
120022 * The behavior when restriction Max_Asynchronous_Select_Nesting is
120023 violated. See *note D.7::(18/1).
120024
120025 103.4/2
120026 * The behavior when restriction Max_Tasks is violated. See *note
120027 D.7::(19).
120028
120029 104/2
120030 * Whether the use of pragma Restrictions results in a reduction in
120031 program code or data size or execution time. See *note D.7::(20).
120032
120033 105/2
120034 * This paragraph was deleted.
120035
120036 106/2
120037 * This paragraph was deleted.
120038
120039 106.1/3
120040 * The value of Barrier_Limit'Last in Synchronous_Barriers. See *note
120041 D.10.1::(4/3).
120042
120043 106.2/3
120044 * When an aborted task that is waiting on a Synchronous_Barrier is
120045 aborted. See *note D.10.1::(13/3).
120046
120047 107/2
120048 * This paragraph was deleted.
120049
120050 107.1/3
120051 * The processor on which a task with a CPU value of a
120052 Not_A_Specific_CPU will execute when the Ravenscar profile is in
120053 effect. See *note D.13::(8).
120054
120055 107.2/3
120056 * The value of Min_Handler_Ceiling in Execution_Time.Group_Budgets.
120057 See *note D.14.2::(7/2).
120058
120059 107.3/3
120060 * The value of CPU_Range'Last in System.Multiprocessors. See *note
120061 D.16::(4/3).
120062
120063 107.4/3
120064 * The processor on which the environment task executes in the absence
120065 of a value for the aspect CPU. See *note D.16::(13/3).
120066
120067 108
120068 * The means for creating and executing distributed programs. See
120069 *note E::(5).
120070
120071 109
120072 * Any events that can result in a partition becoming inaccessible.
120073 See *note E.1::(7).
120074
120075 110
120076 * The scheduling policies, treatment of priorities, and management of
120077 shared resources between partitions in certain cases. See *note
120078 E.1::(11).
120079
120080 111/1
120081 * This paragraph was deleted.
120082
120083 112
120084 * Whether the execution of the remote subprogram is immediately
120085 aborted as a result of cancellation. See *note E.4::(13).
120086
120087 112.1/2
120088 * The range of type System.RPC.Partition_Id. See *note E.5::(14).
120089
120090 113/2
120091 * This paragraph was deleted.
120092
120093 114
120094 * Implementation-defined interfaces in the PCS. See *note E.5::(26).
120095
120096 115
120097 * The values of named numbers in the package Decimal. See *note
120098 F.2::(7).
120099
120100 116
120101 * The value of Max_Picture_Length in the package Text_IO.Editing See
120102 *note F.3.3::(16).
120103
120104 117
120105 * The value of Max_Picture_Length in the package Wide_Text_IO.Editing
120106 See *note F.3.4::(5).
120107
120108 117.1/2
120109 * The value of Max_Picture_Length in the package
120110 Wide_Wide_Text_IO.Editing See *note F.3.5::(5).
120111
120112 118
120113 * The accuracy actually achieved by the complex elementary functions
120114 and by other complex arithmetic operations. See *note G.1::(1).
120115
120116 119
120117 * The sign of a zero result (or a component thereof) from any
120118 operator or function in Numerics.Generic_Complex_Types, when
120119 Real'Signed_Zeros is True. See *note G.1.1::(53).
120120
120121 120
120122 * The sign of a zero result (or a component thereof) from any
120123 operator or function in
120124 Numerics.Generic_Complex_Elementary_Functions, when
120125 Complex_Types.Real'Signed_Zeros is True. See *note G.1.2::(45).
120126
120127 121
120128 * Whether the strict mode or the relaxed mode is the default. See
120129 *note G.2::(2).
120130
120131 122
120132 * The result interval in certain cases of fixed-to-float conversion.
120133 See *note G.2.1::(10).
120134
120135 123
120136 * The result of a floating point arithmetic operation in overflow
120137 situations, when the Machine_Overflows attribute of the result type
120138 is False. See *note G.2.1::(13).
120139
120140 124
120141 * The result interval for division (or exponentiation by a negative
120142 exponent), when the floating point hardware implements division as
120143 multiplication by a reciprocal. See *note G.2.1::(16).
120144
120145 125
120146 * The definition of close result set, which determines the accuracy
120147 of certain fixed point multiplications and divisions. See *note
120148 G.2.3::(5).
120149
120150 126
120151 * Conditions on a universal_real operand of a fixed point
120152 multiplication or division for which the result shall be in the
120153 perfect result set. See *note G.2.3::(22).
120154
120155 127
120156 * The result of a fixed point arithmetic operation in overflow
120157 situations, when the Machine_Overflows attribute of the result type
120158 is False. See *note G.2.3::(27).
120159
120160 128
120161 * The result of an elementary function reference in overflow
120162 situations, when the Machine_Overflows attribute of the result type
120163 is False. See *note G.2.4::(4).
120164
120165 129
120166 * The value of the angle threshold, within which certain elementary
120167 functions, complex arithmetic operations, and complex elementary
120168 functions yield results conforming to a maximum relative error
120169 bound. See *note G.2.4::(10).
120170
120171 130
120172 * The accuracy of certain elementary functions for parameters beyond
120173 the angle threshold. See *note G.2.4::(10).
120174
120175 131
120176 * The result of a complex arithmetic operation or complex elementary
120177 function reference in overflow situations, when the
120178 Machine_Overflows attribute of the corresponding real type is
120179 False. See *note G.2.6::(5).
120180
120181 132
120182 * The accuracy of certain complex arithmetic operations and certain
120183 complex elementary functions for parameters (or components thereof)
120184 beyond the angle threshold. See *note G.2.6::(8).
120185
120186 132.1/2
120187 * The accuracy requirements for the subprograms Solve, Inverse,
120188 Determinant, Eigenvalues and Eigensystem for type Real_Matrix. See
120189 *note G.3.1::(81/2).
120190
120191 132.2/2
120192 * The accuracy requirements for the subprograms Solve, Inverse,
120193 Determinant, Eigenvalues and Eigensystem for type Complex_Matrix.
120194 See *note G.3.2::(149/2).
120195
120196 133/2
120197 * This paragraph was deleted.
120198
120199 134/2
120200 * This paragraph was deleted.
120201
120202 135/2
120203 * This paragraph was deleted.
120204
120205 136/2
120206 * This paragraph was deleted.
120207
120208 136.1/2
120209 * Implementation-defined policy_identifiers allowed in a pragma
120210 Partition_Elaboration_Policy. See *note H.6::(4/2).
120211
120212 \1f
120213 File: aarm2012.info, Node: M.3, Prev: M.2, Up: Annex M
120214
120215 M.3 Implementation Advice
120216 =========================
120217
120218 1/2
120219 This International Standard sometimes gives advice about handling
120220 certain target machine dependences. Each Ada implementation must
120221 document whether that advice is followed:
120222
120223 1.a/2
120224 Ramification: Some of the items in this list require
120225 documentation only for implementations that conform to
120226 Specialized Needs Annexes.
120227
120228 2/2
120229 * Program_Error should be raised when an unsupported Specialized
120230 Needs Annex feature is used at run time. See *note 1.1.3::(20).
120231
120232 3/2
120233 * Implementation-defined extensions to the functionality of a
120234 language-defined library unit should be provided by adding children
120235 to the library unit. See *note 1.1.3::(21).
120236
120237 4/2
120238 * If a bounded error or erroneous execution is detected,
120239 Program_Error should be raised. See *note 1.1.5::(12).
120240
120241 5/2
120242 * Implementation-defined pragmas should have no semantic effect for
120243 error-free programs. See *note 2.8::(16/3).
120244
120245 6/2
120246 * Implementation-defined pragmas should not make an illegal program
120247 legal, unless they complete a declaration or configure the
120248 library_items in an environment. See *note 2.8::(19).
120249
120250 7/2
120251 * Long_Integer should be declared in Standard if the target supports
120252 32-bit arithmetic. No other named integer subtypes should be
120253 declared in Standard. See *note 3.5.4::(28).
120254
120255 8/2
120256 * For a two's complement target, modular types with a binary modulus
120257 up to System.Max_Int*2+2 should be supported. A nonbinary modulus
120258 up to Integer'Last should be supported. See *note 3.5.4::(29).
120259
120260 9/2
120261 * Program_Error should be raised for the evaluation of S'Pos for an
120262 enumeration type, if the value of the operand does not correspond
120263 to the internal code for any enumeration literal of the type. See
120264 *note 3.5.5::(8).
120265
120266 10/2
120267 * Long_Float should be declared in Standard if the target supports 11
120268 or more digits of precision. No other named float subtypes should
120269 be declared in Standard. See *note 3.5.7::(17).
120270
120271 11/2
120272 * Multidimensional arrays should be represented in row-major order,
120273 unless the array has convention Fortran. See *note 3.6.2::(11/3).
120274
120275 12/3
120276 * Tags.Internal_Tag should return the tag of a type, if one exists,
120277 whose innermost master is a master of the point of the function
120278 call.. See *note 3.9::(26.1/3).
120279
120280 13/2
120281 * A real static expression with a nonformal type that is not part of
120282 a larger static expression should be rounded the same as the target
120283 system. See *note 4.9::(38.1/2).
120284
120285 14/2
120286 * The value of Duration'Small should be no greater than 100
120287 microseconds. See *note 9.6::(30).
120288
120289 15/2
120290 * The time base for delay_relative_statements should be monotonic.
120291 See *note 9.6::(31).
120292
120293 16/2
120294 * Leap seconds should be supported if the target system supports
120295 them. Otherwise, operations in Calendar.Formatting should return
120296 results consistent with no leap seconds. See *note 9.6.1::(89/2).
120297
120298 17/2
120299 * When applied to a generic unit, a program unit pragma that is not a
120300 library unit pragma should apply to each instance of the generic
120301 unit for which there is not an overriding pragma applied directly
120302 to the instance. See *note 10.1.5::(10/1).
120303
120304 18/2
120305 * A type declared in a preelaborated package should have the same
120306 representation in every elaboration of a given version of the
120307 package. See *note 10.2.1::(12).
120308
120309 19/2
120310 * Exception_Information should provide information useful for
120311 debugging, and should include the Exception_Name and
120312 Exception_Message. See *note 11.4.1::(19).
120313
120314 20/2
120315 * Exception_Message by default should be short, provide information
120316 useful for debugging, and should not include the Exception_Name.
120317 See *note 11.4.1::(19).
120318
120319 21/2
120320 * Code executed for checks that have been suppressed should be
120321 minimized. See *note 11.5::(28).
120322
120323 22/2
120324 * The recommended level of support for all representation items
120325 should be followed. See *note 13.1::(28/3).
120326
120327 23/2
120328 * Storage allocated to objects of a packed type should be minimized.
120329 See *note 13.2::(6).
120330
120331 24/3
120332 * The recommended level of support for the Pack aspect should be
120333 followed. See *note 13.2::(9).
120334
120335 25/2
120336 * For an array X, X'Address should point at the first component of
120337 the array rather than the array bounds. See *note 13.3::(14).
120338
120339 26/2
120340 * The recommended level of support for the Address attribute should
120341 be followed. See *note 13.3::(19).
120342
120343 26.1/3
120344 * For any tagged specific subtype S, S'Class'Alignment should equal
120345 S'Alignment. See *note 13.3::(28).
120346
120347 27/2
120348 * The recommended level of support for the Alignment attribute should
120349 be followed. See *note 13.3::(35).
120350
120351 28/2
120352 * The Size of an array object should not include its bounds. See
120353 *note 13.3::(41.1/2).
120354
120355 29/2
120356 * If the Size of a subtype allows for efficient independent
120357 addressability, then the Size of most objects of the subtype should
120358 equal the Size of the subtype. See *note 13.3::(52).
120359
120360 30/2
120361 * A Size clause on a composite subtype should not affect the internal
120362 layout of components. See *note 13.3::(53).
120363
120364 31/2
120365 * The recommended level of support for the Size attribute should be
120366 followed. See *note 13.3::(56).
120367
120368 32/2
120369 * The recommended level of support for the Component_Size attribute
120370 should be followed. See *note 13.3::(73).
120371
120372 33/2
120373 * The recommended level of support for
120374 enumeration_representation_clauses should be followed. See *note
120375 13.4::(10).
120376
120377 34/2
120378 * The recommended level of support for record_representation_clauses
120379 should be followed. See *note 13.5.1::(22).
120380
120381 35/2
120382 * If a component is represented using a pointer to the actual data of
120383 the component which is contiguous with the rest of the object, then
120384 the storage place attributes should reflect the place of the actual
120385 data. If a component is allocated discontiguously from the rest of
120386 the object, then a warning should be generated upon reference to
120387 one of its storage place attributes. See *note 13.5.2::(5).
120388
120389 36/2
120390 * The recommended level of support for the nondefault bit ordering
120391 should be followed. See *note 13.5.3::(8).
120392
120393 37/2
120394 * Type System.Address should be a private type. See *note
120395 13.7::(37).
120396
120397 38/2
120398 * Operations in System and its children should reflect the target
120399 environment; operations that do not make sense should raise
120400 Program_Error. See *note 13.7.1::(16).
120401
120402 39/2
120403 * Since the Size of an array object generally does not include its
120404 bounds, the bounds should not be part of the converted data in an
120405 instance of Unchecked_Conversion. See *note 13.9::(14/2).
120406
120407 40/2
120408 * There should not be unnecessary run-time checks on the result of an
120409 Unchecked_Conversion; the result should be returned by reference
120410 when possible. Restrictions on Unchecked_Conversions should be
120411 avoided. See *note 13.9::(15).
120412
120413 41/2
120414 * The recommended level of support for Unchecked_Conversion should be
120415 followed. See *note 13.9::(17).
120416
120417 42/2
120418 * Any cases in which heap storage is dynamically allocated other than
120419 as part of the evaluation of an allocator should be documented.
120420 See *note 13.11::(23).
120421
120422 43/2
120423 * A default storage pool for an access-to-constant type should not
120424 have overhead to support deallocation of individual objects. See
120425 *note 13.11::(24).
120426
120427 44/2
120428 * Usually, a storage pool for an access discriminant or access
120429 parameter should be created at the point of an allocator, and be
120430 reclaimed when the designated object becomes inaccessible. For
120431 other anonymous access types, the pool should be created at the
120432 point where the type is elaborated and need not support
120433 deallocation of individual objects. See *note 13.11::(25).
120434
120435 45/2
120436 * For a standard storage pool, an instance of Unchecked_Deallocation
120437 should actually reclaim the storage. See *note 13.11.2::(17).
120438
120439 45.1/3
120440 * A call on an instance of Unchecked_Deallocation with a nonnull
120441 access value should raise Program_Error if the actual access type
120442 of the instance is a type for which the Storage_Size has been
120443 specified to be zero or is defined by the language to be zero. See
120444 *note 13.11.2::(17.1/3).
120445
120446 46/2
120447 * If not specified, the value of Stream_Size for an elementary type
120448 should be the number of bits that corresponds to the minimum number
120449 of stream elements required by the first subtype of the type,
120450 rounded up to the nearest factor or multiple of the word size that
120451 is also a multiple of the stream element size. See *note
120452 13.13.2::(1.6/2).
120453
120454 47/2
120455 * The recommended level of support for the Stream_Size attribute
120456 should be followed. See *note 13.13.2::(1.8/2).
120457
120458 48/2
120459 * If an implementation provides additional named predefined integer
120460 types, then the names should end with "Integer". If an
120461 implementation provides additional named predefined floating point
120462 types, then the names should end with "Float". See *note
120463 A.1::(52).
120464
120465 49/2
120466 * Implementation-defined operations on Wide_Character, Wide_String,
120467 Wide_Wide_Character, and Wide_Wide_String should be child units of
120468 Wide_Characters or Wide_Wide_Characters. See *note A.3.1::(7/3).
120469
120470 49.1/3
120471 * The string returned by
120472 Wide_Characters.Handling.Character_Set_Version should include
120473 either "10646:" or "Unicode". See *note A.3.5::(62).
120474
120475 50/2
120476 * Bounded string objects should not be implemented by implicit
120477 pointers and dynamic allocation. See *note A.4.4::(106).
120478
120479 51/2
120480 * Strings.Hash should be good a hash function, returning a wide
120481 spread of values for different string values, and similar strings
120482 should rarely return the same value. See *note A.4.9::(12/2).
120483
120484 51.1/3
120485 * If an implementation supports other string encoding schemes, a
120486 child of Ada.Strings similar to UTF_Encoding should be defined.
120487 See *note A.4.11::(107/3).
120488
120489 52/2
120490 * Any storage associated with an object of type Generator of the
120491 random number packages should be reclaimed on exit from the scope
120492 of the object. See *note A.5.2::(46).
120493
120494 53/2
120495 * Each value of Initiator passed to Reset for the random number
120496 packages should initiate a distinct sequence of random numbers, or,
120497 if that is not possible, be at least a rapidly varying function of
120498 the initiator value. See *note A.5.2::(47).
120499
120500 54/2
120501 * Get_Immediate should be implemented with unbuffered input; input
120502 should be available immediately; line-editing should be disabled.
120503 See *note A.10.7::(23).
120504
120505 55/2
120506 * Package Directories.Information should be provided to retrieve
120507 other information about a file. See *note A.16::(124/2).
120508
120509 56/3
120510 * Directories.Start_Search and Directories.Search should raise
120511 Name_Error for malformed patterns. See *note A.16::(125).
120512
120513 57/2
120514 * Directories.Rename should be supported at least when both New_Name
120515 and Old_Name are simple names and New_Name does not identify an
120516 existing external file. See *note A.16::(126/2).
120517
120518 57.1/3
120519 * Directories.Hierarchical_File_Names should be provided for systems
120520 with hierarchical file naming, and should not be provided on other
120521 systems. See *note A.16.1::(36/3).
120522
120523 58/2
120524 * If the execution environment supports subprocesses, the current
120525 environment variables should be used to initialize the environment
120526 variables of a subprocess. See *note A.17::(32/2).
120527
120528 59/2
120529 * Changes to the environment variables made outside the control of
120530 Environment_Variables should be reflected immediately. See *note
120531 A.17::(33/2).
120532
120533 60/2
120534 * Containers.Hash_Type'Modulus should be at least 2**32.
120535 Containers.Count_Type'Last should be at least 2**31-1. See *note
120536 A.18.1::(8/2).
120537
120538 61/2
120539 * The worst-case time complexity of Element for Containers.Vector
120540 should be O(log N). See *note A.18.2::(256/2).
120541
120542 62/2
120543 * The worst-case time complexity of Append with Count = 1 when N is
120544 less than the capacity for Containers.Vector should be O(log N).
120545 See *note A.18.2::(257/2).
120546
120547 63/2
120548 * The worst-case time complexity of Prepend with Count = 1 and
120549 Delete_First with Count=1 for Containers.Vectors should be O(N log
120550 N). See *note A.18.2::(258/2).
120551
120552 64/2
120553 * The worst-case time complexity of a call on procedure Sort of an
120554 instance of Containers.Vectors.Generic_Sorting should be O(N**2),
120555 and the average time complexity should be better than O(N**2). See
120556 *note A.18.2::(259/2).
120557
120558 65/2
120559 * Containers.Vectors.Generic_Sorting.Sort and
120560 Containers.Vectors.Generic_Sorting.Merge should minimize copying of
120561 elements. See *note A.18.2::(260/2).
120562
120563 66/2
120564 * Containers.Vectors.Move should not copy elements, and should
120565 minimize copying of internal data structures. See *note
120566 A.18.2::(261/2).
120567
120568 67/2
120569 * If an exception is propagated from a vector operation, no storage
120570 should be lost, nor any elements removed from a vector unless
120571 specified by the operation. See *note A.18.2::(262/2).
120572
120573 68/2
120574 * The worst-case time complexity of Element, Insert with Count=1, and
120575 Delete with Count=1 for Containers.Doubly_Linked_Lists should be
120576 O(log N). See *note A.18.3::(160/2).
120577
120578 69/2
120579 * A call on procedure Sort of an instance of
120580 Containers.Doubly_Linked_Lists.Generic_Sorting should have an
120581 average time complexity better than O(N**2) and worst case no worse
120582 than O(N**2). See *note A.18.3::(161/2).
120583
120584 70/2
120585 * Containers.Doubly_Linked_Lists.Move should not copy elements, and
120586 should minimize copying of internal data structures. See *note
120587 A.18.3::(162/2).
120588
120589 71/2
120590 * If an exception is propagated from a list operation, no storage
120591 should be lost, nor any elements removed from a list unless
120592 specified by the operation. See *note A.18.3::(163/2).
120593
120594 72/2
120595 * Move for a map should not copy elements, and should minimize
120596 copying of internal data structures. See *note A.18.4::(83/2).
120597
120598 73/2
120599 * If an exception is propagated from a map operation, no storage
120600 should be lost, nor any elements removed from a map unless
120601 specified by the operation. See *note A.18.4::(84/2).
120602
120603 74/2
120604 * The average time complexity of Element, Insert, Include, Replace,
120605 Delete, Exclude and Find operations that take a key parameter for
120606 Containers.Hashed_Maps should be O(log N). The average time
120607 complexity of the subprograms of Containers.Hashed_Maps that take a
120608 cursor parameter should be O(1). The average time complexity of
120609 Containers.Hashed_Maps.Reserve_Capacity should be O(N). See *note
120610 A.18.5::(62/2).
120611
120612 75/2
120613 * The worst-case time complexity of Element, Insert, Include,
120614 Replace, Delete, Exclude and Find operations that take a key
120615 parameter for Containers.Ordered_Maps should be O((log N)**2) or
120616 better. The worst-case time complexity of the subprograms of
120617 Containers.Ordered_Maps that take a cursor parameter should be
120618 O(1). See *note A.18.6::(95/2).
120619
120620 76/2
120621 * Move for sets should not copy elements, and should minimize copying
120622 of internal data structures. See *note A.18.7::(104/2).
120623
120624 77/2
120625 * If an exception is propagated from a set operation, no storage
120626 should be lost, nor any elements removed from a set unless
120627 specified by the operation. See *note A.18.7::(105/2).
120628
120629 78/2
120630 * The average time complexity of the Insert, Include, Replace,
120631 Delete, Exclude and Find operations of Containers.Hashed_Sets that
120632 take an element parameter should be O(log N). The average time
120633 complexity of the subprograms of Containers.Hashed_Sets that take a
120634 cursor parameter should be O(1). The average time complexity of
120635 Containers.Hashed_Sets.Reserve_Capacity should be O(N). See *note
120636 A.18.8::(88/2).
120637
120638 79/2
120639 * The worst-case time complexity of the Insert, Include, Replace,
120640 Delete, Exclude and Find operations of Containers.Ordered_Sets that
120641 take an element parameter should be O((log N)**2). The worst-case
120642 time complexity of the subprograms of Containers.Ordered_Sets that
120643 take a cursor parameter should be O(1). See *note A.18.9::(116/2).
120644
120645 79.1/3
120646 * The worst-case time complexity of the Element, Parent, First_Child,
120647 Last_Child, Next_Sibling, Previous_Sibling, Insert_Child with
120648 Count=1, and Delete operations of Containers.Multiway_Trees should
120649 be O(log N). See *note A.18.10::(231/3).
120650
120651 79.2/3
120652 * Containers.Multiway_Trees.Move should not copy elements, and should
120653 minimize copying of internal data structures. See *note
120654 A.18.10::(232/3).
120655
120656 79.3/3
120657 * If an exception is propagated from a tree operation, no storage
120658 should be lost, nor any elements removed from a tree unless
120659 specified by the operation. See *note A.18.10::(233/3).
120660
120661 79.4/3
120662 * Containers.Indefinite_Holders.Move should not copy the element, and
120663 should minimize copying of internal data structures. See *note
120664 A.18.18::(73/3).
120665
120666 79.5/3
120667 * If an exception is propagated from a holder operation, no storage
120668 should be lost, nor should the element be removed from a holder
120669 container unless specified by the operation. See *note
120670 A.18.18::(74/3).
120671
120672 79.6/3
120673 * Bounded vector objects should be implemented without implicit
120674 pointers or dynamic allocation. See *note A.18.19::(16/3).
120675
120676 79.7/3
120677 * The implementation advice for procedure Move to minimize copying
120678 does not apply to bounded vectors. See *note A.18.19::(17/3).
120679
120680 79.8/3
120681 * Bounded list objects should be implemented without implicit
120682 pointers or dynamic allocation. See *note A.18.20::(19/3).
120683
120684 79.9/3
120685 * The implementation advice for procedure Move to minimize copying
120686 does not apply to bounded lists. See *note A.18.20::(20/3).
120687
120688 79.10/3
120689 * Bounded hashed map objects should be implemented without implicit
120690 pointers or dynamic allocation. See *note A.18.21::(21/3).
120691
120692 79.11/3
120693 * The implementation advice for procedure Move to minimize copying
120694 does not apply to bounded hashed maps. See *note A.18.21::(22/3).
120695
120696 79.12/3
120697 * Bounded ordered map objects should be implemented without implicit
120698 pointers or dynamic allocation. See *note A.18.22::(18/3).
120699
120700 79.13/3
120701 * The implementation advice for procedure Move to minimize copying
120702 does not apply to bounded ordered maps. See *note A.18.22::(19/3).
120703
120704 79.14/3
120705 * Bounded hashed set objects should be implemented without implicit
120706 pointers or dynamic allocation. See *note A.18.23::(20/3).
120707
120708 79.15/3
120709 * The implementation advice for procedure Move to minimize copying
120710 does not apply to bounded hashed sets. See *note A.18.23::(21/3).
120711
120712 79.16/3
120713 * Bounded ordered set objects should be implemented without implicit
120714 pointers or dynamic allocation. See *note A.18.24::(17/3).
120715
120716 79.17/3
120717 * The implementation advice for procedure Move to minimize copying
120718 does not apply to bounded ordered sets. See *note A.18.24::(18/3).
120719
120720 79.18/3
120721 * Bounded tree objects should be implemented without implicit
120722 pointers or dynamic allocation. See *note A.18.25::(19/3).
120723
120724 79.19/3
120725 * The implementation advice for procedure Move to minimize copying
120726 does not apply to bounded trees. See *note A.18.25::(20/3).
120727
120728 80/2
120729 * Containers.Generic_Array_Sort and
120730 Containers.Generic_Constrained_Array_Sort should have an average
120731 time complexity better than O(N**2) and worst case no worse than
120732 O(N**2). See *note A.18.26::(10/2).
120733
120734 81/2
120735 * Containers.Generic_Array_Sort and
120736 Containers.Generic_Constrained_Array_Sort should minimize copying
120737 of elements. See *note A.18.26::(11/2).
120738
120739 81.1/3
120740 * Containers.Generic_Sort should have an average time complexity
120741 better than O(N**2) and worst case no worse than O(N**2). See
120742 *note A.18.26::(12/3).
120743
120744 81.2/3
120745 * Containers.Generic_Sort should minimize calls to the generic formal
120746 Swap. See *note A.18.26::(13/3).
120747
120748 81.3/3
120749 * Bounded queue objects should be implemented without implicit
120750 pointers or dynamic allocation. See *note A.18.29::(13/3).
120751
120752 81.4/3
120753 * Bounded priority queue objects should be implemented without
120754 implicit pointers or dynamic allocation. See *note
120755 A.18.31::(14/3).
120756
120757 82/3
120758 * If Export is supported for a language, the main program should be
120759 able to be written in that language. Subprograms named "adainit"
120760 and "adafinal" should be provided for elaboration and finalization
120761 of the environment task. See *note B.1::(39/3).
120762
120763 83/3
120764 * Automatic elaboration of preelaborated packages should be provided
120765 when specifying the Export aspect as True is supported. See *note
120766 B.1::(40/3).
120767
120768 84/3
120769 * For each supported convention L other than Intrinsic, specifying
120770 the aspects Import and Export should be supported for objects of
120771 L-compatible types and for subprograms, and aspect Convention
120772 should be supported for L-eligible types and for subprograms. See
120773 *note B.1::(41/3).
120774
120775 85/2
120776 * If an interface to C, COBOL, or Fortran is provided, the
120777 corresponding package or packages described in *note Annex B::,
120778 "*note Annex B:: Interface to Other Languages" should also be
120779 provided. See *note B.2::(13/3).
120780
120781 86/2
120782 * The constants nul, wide_nul, char16_nul, and char32_nul in package
120783 Interfaces.C should have a representation of zero. See *note
120784 B.3::(62.5/3).
120785
120786 87/2
120787 * If C interfacing is supported, the interface correspondences
120788 between Ada and C should be supported. See *note B.3::(71).
120789
120790 88/2
120791 * If COBOL interfacing is supported, the interface correspondences
120792 between Ada and COBOL should be supported. See *note B.4::(98).
120793
120794 89/2
120795 * If Fortran interfacing is supported, the interface correspondences
120796 between Ada and Fortran should be supported. See *note B.5::(26).
120797
120798 90/2
120799 * The machine code or intrinsics support should allow access to all
120800 operations normally available to assembly language programmers for
120801 the target environment. See *note C.1::(3).
120802
120803 91/2
120804 * Interface to assembler should be supported; the default assembler
120805 should be associated with the convention identifier Assembler. See
120806 *note C.1::(4/3).
120807
120808 92/2
120809 * If an entity is exported to assembly language, then the
120810 implementation should allocate it at an addressable location even
120811 if not otherwise referenced from the Ada code. A call to a machine
120812 code or assembler subprogram should be treated as if it could read
120813 or update every object that is specified as exported. See *note
120814 C.1::(5).
120815
120816 93/2
120817 * Little or no overhead should be associated with calling intrinsic
120818 and machine-code subprograms. See *note C.1::(10).
120819
120820 94/2
120821 * Intrinsic subprograms should be provided to access any machine
120822 operations that provide special capabilities or efficiency not
120823 normally available. See *note C.1::(16).
120824
120825 95/2
120826 * If the Ceiling_Locking policy is not in effect and the target
120827 system allows for finer-grained control of interrupt blocking, a
120828 means for the application to specify which interrupts are to be
120829 blocked during protected actions should be provided. See *note
120830 C.3::(28/2).
120831
120832 96/2
120833 * Interrupt handlers should be called directly by the hardware. See
120834 *note C.3.1::(20).
120835
120836 97/2
120837 * Violations of any implementation-defined restrictions on interrupt
120838 handlers should be detected before run time. See *note
120839 C.3.1::(21).
120840
120841 98/2
120842 * If implementation-defined forms of interrupt handler procedures are
120843 supported, then for each such form of a handler, a type analogous
120844 to Parameterless_Handler should be specified in a child package of
120845 Interrupts, with the same operations as in the predefined package
120846 Interrupts. See *note C.3.2::(25).
120847
120848 99/2
120849 * Preelaborated packages should be implemented such that little or no
120850 code is executed at run time for the elaboration of entities. See
120851 *note C.4::(14).
120852
120853 100/2
120854 * If pragma Discard_Names applies to an entity, then the amount of
120855 storage used for storing names associated with that entity should
120856 be reduced. See *note C.5::(8).
120857
120858 101/2
120859 * A load or store of a volatile object whose size is a multiple of
120860 System.Storage_Unit and whose alignment is nonzero, should be
120861 implemented by accessing exactly the bits of the object and no
120862 others. See *note C.6::(22/2).
120863
120864 102/2
120865 * A load or store of an atomic object should be implemented by a
120866 single load or store instruction. See *note C.6::(23/2).
120867
120868 103/2
120869 * If the target domain requires deterministic memory use at run time,
120870 storage for task attributes should be pre-allocated statically and
120871 the number of attributes pre-allocated should be documented. See
120872 *note C.7.2::(30).
120873
120874 104/2
120875 * Finalization of task attributes and reclamation of associated
120876 storage should be performed as soon as possible after task
120877 termination. See *note C.7.2::(30.1/2).
120878
120879 105/2
120880 * Names that end with "_Locking" should be used for
120881 implementation-defined locking policies. See *note D.3::(17).
120882
120883 106/2
120884 * Names that end with "_Queuing" should be used for
120885 implementation-defined queuing policies. See *note D.4::(16).
120886
120887 107/2
120888 * The abort_statement should not require the task executing the
120889 statement to block. See *note D.6::(9).
120890
120891 108/2
120892 * On a multi-processor, the delay associated with aborting a task on
120893 another processor should be bounded. See *note D.6::(10).
120894
120895 109/2
120896 * When feasible, specified restrictions should be used to produce a
120897 more efficient implementation. See *note D.7::(21).
120898
120899 110/2
120900 * When appropriate, mechanisms to change the value of Tick should be
120901 provided. See *note D.8::(47).
120902
120903 111/2
120904 * Calendar.Clock and Real_Time.Clock should be transformations of the
120905 same time base. See *note D.8::(48).
120906
120907 112/2
120908 * The "best" time base which exists in the underlying system should
120909 be available to the application through Real_Time.Clock. See *note
120910 D.8::(49).
120911
120912 112.1/3
120913 * On a multiprocessor system, each processor should have a separate
120914 and disjoint ready queue. See *note D.13::(9).
120915
120916 113/2
120917 * When appropriate, implementations should provide configuration
120918 mechanisms to change the value of Execution_Time.CPU_Tick. See
120919 *note D.14::(29/2).
120920
120921 114/2
120922 * For a timing event, the handler should be executed directly by the
120923 real-time clock interrupt mechanism. See *note D.15::(25).
120924
120925 114.1/3
120926 * Each dispatching domain should have separate and disjoint ready
120927 queues. See *note D.16.1::(31).
120928
120929 115/2
120930 * The PCS should allow for multiple tasks to call the RPC-receiver.
120931 See *note E.5::(28).
120932
120933 116/2
120934 * The System.RPC.Write operation should raise Storage_Error if it
120935 runs out of space when writing an item. See *note E.5::(29).
120936
120937 117/2
120938 * If COBOL (respectively, C) is supported in the target environment,
120939 then interfacing to COBOL (respectively, C) should be supported as
120940 specified in *note Annex B::. See *note F::(7/3).
120941
120942 118/2
120943 * Packed decimal should be used as the internal representation for
120944 objects of subtype S when S'Machine_Radix = 10. See *note
120945 F.1::(2).
120946
120947 119/2
120948 * If Fortran (respectively, C) is supported in the target
120949 environment, then interfacing to Fortran (respectively, C) should
120950 be supported as specified in *note Annex B::. See *note G::(7/3).
120951
120952 120/2
120953 * Mixed real and complex operations (as well as pure-imaginary and
120954 complex operations) should not be performed by converting the real
120955 (resp. pure-imaginary) operand to complex. See *note G.1.1::(56).
120956
120957 121/3
120958 * If Real'Signed_Zeros is True for Numerics.Generic_Complex_Types, a
120959 rational treatment of the signs of zero results and result
120960 components should be provided. See *note G.1.1::(58).
120961
120962 122/3
120963 * If Complex_Types.Real'Signed_Zeros is True for
120964 Numerics.Generic_Complex_Elementary_Functions, a rational treatment
120965 of the signs of zero results and result components should be
120966 provided. See *note G.1.2::(49).
120967
120968 123/2
120969 * For elementary functions, the forward trigonometric functions
120970 without a Cycle parameter should not be implemented by calling the
120971 corresponding version with a Cycle parameter. Log without a Base
120972 parameter should not be implemented by calling Log with a Base
120973 parameter. See *note G.2.4::(19).
120974
120975 124/2
120976 * For complex arithmetic, the Compose_From_Polar function without a
120977 Cycle parameter should not be implemented by calling
120978 Compose_From_Polar with a Cycle parameter. See *note G.2.6::(15).
120979
120980 125/2
120981 * Solve and Inverse for Numerics.Generic_Real_Arrays should be
120982 implemented using established techniques such as LU decomposition
120983 and the result should be refined by an iteration on the residuals.
120984 See *note G.3.1::(88/3).
120985
120986 126/2
120987 * The equality operator should be used to test that a matrix in
120988 Numerics.Generic_Real_Arrays is symmetric. See *note
120989 G.3.1::(90/2).
120990
120991 126.1/3
120992 * An implementation should minimize the circumstances under which the
120993 algorithm used for Numerics.Generic_Real_Arrays.Eigenvalues and
120994 Numerics.Generic_Real_Arrays.Eigensystem fails to converge. See
120995 *note G.3.1::(91/3).
120996
120997 127/2
120998 * Solve and Inverse for Numerics.Generic_Complex_Arrays should be
120999 implemented using established techniques and the result should be
121000 refined by an iteration on the residuals. See *note
121001 G.3.2::(158/3).
121002
121003 128/2
121004 * The equality and negation operators should be used to test that a
121005 matrix is Hermitian. See *note G.3.2::(160/2).
121006
121007 128.1/3
121008 * An implementation should minimize the circumstances under which the
121009 algorithm used for Numerics.Generic_Complex_Arrays.Eigenvalues and
121010 Numerics.Generic_Complex_Arrays.Eigensystem fails to converge. See
121011 *note G.3.2::(160.1/3).
121012
121013 129/2
121014 * Mixed real and complex operations should not be performed by
121015 converting the real operand to complex. See *note G.3.2::(161/2).
121016
121017 130/2
121018 * The information produced by pragma Reviewable should be provided in
121019 both a human-readable and machine-readable form, and the latter
121020 form should be documented. See *note H.3.1::(19).
121021
121022 131/2
121023 * Object code listings should be provided both in a symbolic format
121024 and in a numeric format. See *note H.3.1::(20).
121025
121026 132/3
121027 * If the partition elaboration policy is Sequential and the
121028 Environment task becomes permanently blocked during elaboration,
121029 then the partition should be immediately terminated. See *note
121030 H.6::(15/3).
121031
121032 \1f
121033 File: aarm2012.info, Node: Annex N, Next: Annex P, Prev: Annex M, Up: Top
121034
121035 Annex N Glossary
121036 ****************
121037
121038 1/2
121039 {AI95-00437-01AI95-00437-01} This Annex contains informal descriptions
121040 of some of the terms used in this International Standard. The index
121041 provides references to more formal definitions of all of the terms used
121042 in this International Standard.
121043
121044 1.1/2
121045 Abstract type. An abstract type is a tagged type intended for use as an
121046 ancestor of other types, but which is not allowed to have objects of its
121047 own.
121048
121049 2
121050 Access type. An access type has values that designate aliased objects.
121051 Access types correspond to "pointer types" or "reference types" in some
121052 other languages.
121053
121054 3
121055 Aliased. An aliased view of an object is one that can be designated by
121056 an access value. Objects allocated by allocators are aliased. Objects
121057 can also be explicitly declared as aliased with the reserved word
121058 aliased. The Access attribute can be used to create an access value
121059 designating an aliased object.
121060
121061 3.1/2
121062 Ancestor. An ancestor of a type is the type itself or, in the case of a
121063 type derived from other types, its parent type or one of its progenitor
121064 types or one of their ancestors. Note that ancestor and descendant are
121065 inverse relationships.
121066
121067 4
121068 Array type. An array type is a composite type whose components are all
121069 of the same type. Components are selected by indexing.
121070
121071 4.1/3
121072 Aspect. An aspect is a specifiable property of an entity. An aspect
121073 may be specified by an aspect_specification on the declaration of the
121074 entity. Some aspects may be queried via attributes.
121075
121076 4.2/3
121077 Assertion. An assertion is a boolean expression that appears in any of
121078 the following: a pragma Assert, a predicate, a precondition, a
121079 postcondition, an invariant, a constraint, or a null exclusion. An
121080 assertion is expected to be True at run time at certain specified
121081 places.
121082
121083 4.3/2
121084 Category (of types). A category of types is a set of types with one or
121085 more common properties, such as primitive operations. A category of
121086 types that is closed under derivation is also known as a class.
121087
121088 5
121089 Character type. A character type is an enumeration type whose values
121090 include characters.
121091
121092 6/2
121093 Class (of types). A class is a set of types that is closed under
121094 derivation, which means that if a given type is in the class, then all
121095 types derived from that type are also in the class. The set of types of
121096 a class share common properties, such as their primitive operations.
121097
121098 7
121099 Compilation unit. The text of a program can be submitted to the
121100 compiler in one or more compilations. Each compilation is a succession
121101 of compilation_units. A compilation_unit contains either the
121102 declaration, the body, or a renaming of a program unit.
121103
121104 8/2
121105 Composite type. A composite type may have components.
121106
121107 9
121108 Construct. A construct is a piece of text (explicit or implicit) that
121109 is an instance of a syntactic category defined under "Syntax".
121110
121111 9.1/3
121112 Container. A container is an object that contain other objects all of
121113 the same type, which could be class-wide. Several predefined container
121114 types are provided by the children of package Ada.Containers (see *note
121115 A.18.1::).
121116
121117 10
121118 Controlled type. A controlled type supports user-defined assignment and
121119 finalization. Objects are always finalized before being destroyed.
121120
121121 11
121122 Declaration. A declaration is a language construct that associates a
121123 name with (a view of) an entity. A declaration may appear explicitly in
121124 the program text (an explicit declaration), or may be supposed to occur
121125 at a given place in the text as a consequence of the semantics of
121126 another construct (an implicit declaration).
121127
121128 12/2
121129 This paragraph was deleted.
121130
121131 13/2
121132 Derived type. A derived type is a type defined in terms of one or more
121133 other types given in a derived type definition. The first of those
121134 types is the parent type of the derived type and any others are
121135 progenitor types. Each class containing the parent type or a progenitor
121136 type also contains the derived type. The derived type inherits
121137 properties such as components and primitive operations from the parent
121138 and progenitors. A type together with the types derived from it
121139 (directly or indirectly) form a derivation class.
121140
121141 13.1/2
121142 Descendant. A type is a descendant of itself, its parent and progenitor
121143 types, and their ancestors. Note that descendant and ancestor are
121144 inverse relationships.
121145
121146 14
121147 Discrete type. A discrete type is either an integer type or an
121148 enumeration type. Discrete types may be used, for example, in
121149 case_statements and as array indices.
121150
121151 15/2
121152 Discriminant. A discriminant is a parameter for a composite type. It
121153 can control, for example, the bounds of a component of the type if the
121154 component is an array. A discriminant for a task type can be used to
121155 pass data to a task of the type upon creation.
121156
121157 15.1/2
121158 Elaboration. The process by which a declaration achieves its run-time
121159 effect is called elaboration. Elaboration is one of the forms of
121160 execution.
121161
121162 16
121163 Elementary type. An elementary type does not have components.
121164
121165 17
121166 Enumeration type. An enumeration type is defined by an enumeration of
121167 its values, which may be named by identifiers or character literals.
121168
121169 17.1/2
121170 Evaluation. The process by which an expression achieves its run-time
121171 effect is called evaluation. Evaluation is one of the forms of
121172 execution.
121173
121174 18
121175 Exception. An exception represents a kind of exceptional situation; an
121176 occurrence of such a situation (at run time) is called an exception
121177 occurrence. To raise an exception is to abandon normal program
121178 execution so as to draw attention to the fact that the corresponding
121179 situation has arisen. Performing some actions in response to the
121180 arising of an exception is called handling the exception.
121181
121182 19
121183 Execution. The process by which a construct achieves its run-time
121184 effect is called execution. Execution of a declaration is also called
121185 elaboration. Execution of an expression is also called evaluation.
121186
121187 19.1/2
121188 Function. A function is a form of subprogram that returns a result and
121189 can be called as part of an expression.
121190
121191 20
121192 Generic unit. A generic unit is a template for a (nongeneric) program
121193 unit; the template can be parameterized by objects, types, subprograms,
121194 and packages. An instance of a generic unit is created by a
121195 generic_instantiation. The rules of the language are enforced when a
121196 generic unit is compiled, using a generic contract model; additional
121197 checks are performed upon instantiation to verify the contract is met.
121198 That is, the declaration of a generic unit represents a contract between
121199 the body of the generic and instances of the generic. Generic units can
121200 be used to perform the role that macros sometimes play in other
121201 languages.
121202
121203 20.1/2
121204 Incomplete type. An incomplete type gives a view of a type that reveals
121205 only some of its properties. The remaining properties are provided by
121206 the full view given elsewhere. Incomplete types can be used for
121207 defining recursive data structures.
121208
121209 20.2/3
121210 Indexable container type. An indexable container type is one that has
121211 user-defined behavior for indexing, via the Constant_Indexing or
121212 Variable_Indexing aspects.
121213
121214 21
121215 Integer type. Integer types comprise the signed integer types and the
121216 modular types. A signed integer type has a base range that includes
121217 both positive and negative numbers, and has operations that may raise an
121218 exception when the result is outside the base range. A modular type has
121219 a base range whose lower bound is zero, and has operations with
121220 "wraparound" semantics. Modular types subsume what are called "unsigned
121221 types" in some other languages.
121222
121223 21.1/2
121224 Interface type. An interface type is a form of abstract tagged type
121225 which has no components or concrete operations except possibly null
121226 procedures. Interface types are used for composing other interfaces and
121227 tagged types and thereby provide multiple inheritance. Only an
121228 interface type can be used as a progenitor of another type.
121229
121230 21.2/3
121231 Invariant. A invariant is an assertion that is expected to be True for
121232 all objects of a given private type when viewed from outside the
121233 defining package.
121234
121235 21.3/3
121236 Iterable container type. An iterable container type is one that has
121237 user-defined behavior for iteration, via the Default_Iterator and
121238 Iterator_Element aspects.
121239
121240 21.4/3
121241 Iterator. An iterator is a construct that is used to loop over the
121242 elements of an array or container. Iterators may be user defined, and
121243 may perform arbitrary computations to access elements from a container.
121244
121245 22
121246 Library unit. A library unit is a separately compiled program unit, and
121247 is always a package, subprogram, or generic unit. Library units may
121248 have other (logically nested) library units as children, and may have
121249 other program units physically nested within them. A root library unit,
121250 together with its children and grandchildren and so on, form a
121251 subsystem.
121252
121253 23/2
121254 Limited type. A limited type is a type for which copying (such as in an
121255 assignment_statement) is not allowed. A nonlimited type is a type for
121256 which copying is allowed.
121257
121258 24
121259 Object. An object is either a constant or a variable. An object
121260 contains a value. An object is created by an object_declaration or by
121261 an allocator. A formal parameter is (a view of) an object. A
121262 subcomponent of an object is an object.
121263
121264 24.1/2
121265 Overriding operation. An overriding operation is one that replaces an
121266 inherited primitive operation. Operations may be marked explicitly as
121267 overriding or not overriding.
121268
121269 25
121270 Package. Packages are program units that allow the specification of
121271 groups of logically related entities. Typically, a package contains the
121272 declaration of a type (often a private type or private extension) along
121273 with the declarations of primitive subprograms of the type, which can be
121274 called from outside the package, while their inner workings remain
121275 hidden from outside users.
121276
121277 25.1/2
121278 Parent. The parent of a derived type is the first type given in the
121279 definition of the derived type. The parent can be almost any kind of
121280 type, including an interface type.
121281
121282 26
121283 Partition. A partition is a part of a program. Each partition consists
121284 of a set of library units. Each partition may run in a separate address
121285 space, possibly on a separate computer. A program may contain just one
121286 partition. A distributed program typically contains multiple
121287 partitions, which can execute concurrently.
121288
121289 26.1/3
121290 Postcondition. A postcondition is an assertion that is expected to be
121291 True when a given subprogram returns normally.
121292
121293 27
121294 Pragma. A pragma is a compiler directive. There are language-defined
121295 pragmas that give instructions for optimization, listing control, etc.
121296 An implementation may support additional (implementation-defined)
121297 pragmas.
121298
121299 27.1/3
121300 Precondition. A precondition is an assertion that is expected to be
121301 True when a given subprogram is called.
121302
121303 27.2/3
121304 Predicate. A predicate is an assertion that is expected to be True for
121305 all objects of a given subtype.
121306
121307 28
121308 Primitive operations. The primitive operations of a type are the
121309 operations (such as subprograms) declared together with the type
121310 declaration. They are inherited by other types in the same class of
121311 types. For a tagged type, the primitive subprograms are dispatching
121312 subprograms, providing run-time polymorphism. A dispatching subprogram
121313 may be called with statically tagged operands, in which case the
121314 subprogram body invoked is determined at compile time. Alternatively, a
121315 dispatching subprogram may be called using a dispatching call, in which
121316 case the subprogram body invoked is determined at run time.
121317
121318 29/2
121319 Private extension. A private extension is a type that extends another
121320 type, with the additional properties hidden from its clients.
121321
121322 30/2
121323 Private type. A private type gives a view of a type that reveals only
121324 some of its properties. The remaining properties are provided by the
121325 full view given elsewhere. Private types can be used for defining
121326 abstractions that hide unnecessary details from their clients.
121327
121328 30.1/2
121329 Procedure. A procedure is a form of subprogram that does not return a
121330 result and can only be called by a statement.
121331
121332 30.2/2
121333 Progenitor. A progenitor of a derived type is one of the types given in
121334 the definition of the derived type other than the first. A progenitor
121335 is always an interface type. Interfaces, tasks, and protected types may
121336 also have progenitors.
121337
121338 31
121339 Program. A program is a set of partitions, each of which may execute in
121340 a separate address space, possibly on a separate computer. A partition
121341 consists of a set of library units.
121342
121343 32
121344 Program unit. A program unit is either a package, a task unit, a
121345 protected unit, a protected entry, a generic unit, or an explicitly
121346 declared subprogram other than an enumeration literal. Certain kinds of
121347 program units can be separately compiled. Alternatively, they can
121348 appear physically nested within other program units.
121349
121350 33/2
121351 Protected type. A protected type is a composite type whose components
121352 are accessible only through one of its protected operations which
121353 synchronize concurrent access by multiple tasks.
121354
121355 34
121356 Real type. A real type has values that are approximations of the real
121357 numbers. Floating point and fixed point types are real types.
121358
121359 35
121360 Record extension. A record extension is a type that extends another
121361 type by adding additional components.
121362
121363 36
121364 Record type. A record type is a composite type consisting of zero or
121365 more named components, possibly of different types.
121366
121367 36.1/3
121368 Reference type. A reference type is one that has user-defined behavior
121369 for ".all", defined by the Implicit_Dereference aspect.
121370
121371 36.2/2
121372 Renaming. A renaming_declaration is a declaration that does not define
121373 a new entity, but instead defines a view of an existing entity.
121374
121375 37
121376 Scalar type. A scalar type is either a discrete type or a real type.
121377
121378 37.1/3
121379 Storage pool. Each access-to-object type has an associated storage pool
121380 object. The storage for an object created by an allocator comes from
121381 the storage pool of the type of the allocator. Some storage pools may
121382 be partitioned into subpools in order to support finer-grained storage
121383 management.
121384
121385 37.2/3
121386 Stream. A stream is a sequence of elements that can be used, along with
121387 the stream-oriented attributes, to support marshalling and unmarshalling
121388 of values of most types.
121389
121390 37.3/2
121391 Subprogram. A subprogram is a section of a program that can be executed
121392 in various contexts. It is invoked by a subprogram call that may
121393 qualify the effect of the subprogram through the passing of parameters.
121394 There are two forms of subprograms: functions, which return values, and
121395 procedures, which do not.
121396
121397 38/3
121398 Subtype. A subtype is a type together with optional constraints, null
121399 exclusions, and predicates, which constrain the values of the subtype to
121400 satisfy certain conditions. The values of a subtype are a subset of the
121401 values of its type.
121402
121403 38.1/2
121404 Synchronized. A synchronized entity is one that will work safely with
121405 multiple tasks at one time. A synchronized interface can be an ancestor
121406 of a task or a protected type. Such a task or protected type is called
121407 a synchronized tagged type.
121408
121409 39
121410 Tagged type. The objects of a tagged type have a run-time type tag,
121411 which indicates the specific type with which the object was originally
121412 created. An operand of a class-wide tagged type can be used in a
121413 dispatching call; the tag indicates which subprogram body to invoke.
121414 Nondispatching calls, in which the subprogram body to invoke is
121415 determined at compile time, are also allowed. Tagged types may be
121416 extended with additional components.
121417
121418 40/2
121419 Task type. A task type is a composite type used to represent active
121420 entities which execute concurrently and which can communicate via queued
121421 task entries. The top-level task of a partition is called the
121422 environment task.
121423
121424 41/2
121425 Type. Each object has a type. A type has an associated set of values,
121426 and a set of primitive operations which implement the fundamental
121427 aspects of its semantics. Types are grouped into categories. Most
121428 language-defined categories of types are also classes of types.
121429
121430 42/2
121431 View. A view of an entity reveals some or all of the properties of the
121432 entity. A single entity may have multiple views.
121433
121434 \1f
121435 File: aarm2012.info, Node: Annex P, Next: Annex Q, Prev: Annex N, Up: Top
121436
121437 Annex P Syntax Summary
121438 **********************
121439
121440 This Annex summarizes the complete syntax of the language. See *note
121441 1.1.4:: for a description of the notation used.
121442
121443 *note 2.3:::
121444 identifier ::=
121445 identifier_start {identifier_start | identifier_extend}
121446
121447 *note 2.3:::
121448 identifier_start ::=
121449 letter_uppercase
121450 | letter_lowercase
121451 | letter_titlecase
121452 | letter_modifier
121453 | letter_other
121454 | number_letter
121455
121456 *note 2.3:::
121457 identifier_extend ::=
121458 mark_non_spacing
121459 | mark_spacing_combining
121460 | number_decimal
121461 | punctuation_connector
121462
121463 *note 2.4:::
121464 numeric_literal ::= decimal_literal | based_literal
121465
121466 *note 2.4.1:::
121467 decimal_literal ::= numeral [.numeral] [exponent]
121468
121469 *note 2.4.1:::
121470 numeral ::= digit {[underline] digit}
121471
121472 *note 2.4.1:::
121473 exponent ::= E [+] numeral | E - numeral
121474
121475 *note 2.4.1:::
121476 digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
121477
121478 *note 2.4.2:::
121479 based_literal ::=
121480 base # based_numeral [.based_numeral] # [exponent]
121481
121482 *note 2.4.2:::
121483 base ::= numeral
121484
121485 *note 2.4.2:::
121486 based_numeral ::=
121487 extended_digit {[underline] extended_digit}
121488
121489 *note 2.4.2:::
121490 extended_digit ::= digit | A | B | C | D | E | F
121491
121492 *note 2.5:::
121493 character_literal ::= 'graphic_character'
121494
121495 *note 2.6:::
121496 string_literal ::= "{string_element}"
121497
121498 *note 2.6:::
121499 string_element ::= "" | non_quotation_mark_graphic_character
121500
121501 *note 2.7:::
121502 comment ::= --{non_end_of_line_character}
121503
121504 *note 2.8:::
121505 pragma ::=
121506 pragma identifier [(pragma_argument_association {,
121507 pragma_argument_association})];
121508
121509 *note 2.8:::
121510 pragma_argument_association ::=
121511 [pragma_argument_identifier =>] name
121512 | [pragma_argument_identifier =>] expression
121513 | pragma_argument_aspect_mark => name
121514 | pragma_argument_aspect_mark => expression
121515
121516 *note 3.1:::
121517 basic_declaration ::=
121518 type_declaration | subtype_declaration
121519 | object_declaration | number_declaration
121520 | subprogram_declaration | abstract_subprogram_declaration
121521 | null_procedure_declaration | expression_function_declaration
121522 | package_declaration | renaming_declaration
121523 | exception_declaration | generic_declaration
121524 | generic_instantiation
121525
121526 *note 3.1:::
121527 defining_identifier ::= identifier
121528
121529 *note 3.2.1:::
121530 type_declaration ::= full_type_declaration
121531 | incomplete_type_declaration
121532 | private_type_declaration
121533 | private_extension_declaration
121534
121535 *note 3.2.1:::
121536 full_type_declaration ::=
121537 type defining_identifier [known_discriminant_part] is
121538 type_definition
121539 [aspect_specification];
121540 | task_type_declaration
121541 | protected_type_declaration
121542
121543 *note 3.2.1:::
121544 type_definition ::=
121545 enumeration_type_definition | integer_type_definition
121546 | real_type_definition | array_type_definition
121547 | record_type_definition | access_type_definition
121548 | derived_type_definition | interface_type_definition
121549
121550 *note 3.2.2:::
121551 subtype_declaration ::=
121552 subtype defining_identifier is subtype_indication
121553 [aspect_specification];
121554
121555 *note 3.2.2:::
121556 subtype_indication ::= [null_exclusion] subtype_mark [constraint]
121557
121558 *note 3.2.2:::
121559 subtype_mark ::= subtype_name
121560
121561 *note 3.2.2:::
121562 constraint ::= scalar_constraint | composite_constraint
121563
121564 *note 3.2.2:::
121565 scalar_constraint ::=
121566 range_constraint | digits_constraint | delta_constraint
121567
121568 *note 3.2.2:::
121569 composite_constraint ::=
121570 index_constraint | discriminant_constraint
121571
121572 *note 3.3.1:::
121573 object_declaration ::=
121574 defining_identifier_list : [aliased] [constant]
121575 subtype_indication [:= expression]
121576 [aspect_specification];
121577 | defining_identifier_list : [aliased] [constant]
121578 access_definition [:= expression]
121579 [aspect_specification];
121580 | defining_identifier_list : [aliased] [constant]
121581 array_type_definition [:= expression]
121582 [aspect_specification];
121583 | single_task_declaration
121584 | single_protected_declaration
121585
121586 *note 3.3.1:::
121587 defining_identifier_list ::=
121588 defining_identifier {, defining_identifier}
121589
121590 *note 3.3.2:::
121591 number_declaration ::=
121592 defining_identifier_list : constant := static_expression;
121593
121594 *note 3.4:::
121595 derived_type_definition ::=
121596 [abstract] [limited] new parent_subtype_indication [[and
121597 interface_list] record_extension_part]
121598
121599 *note 3.5:::
121600 range_constraint ::= range range
121601
121602 *note 3.5:::
121603 range ::= range_attribute_reference
121604 | simple_expression .. simple_expression
121605
121606 *note 3.5.1:::
121607 enumeration_type_definition ::=
121608 (enumeration_literal_specification {,
121609 enumeration_literal_specification})
121610
121611 *note 3.5.1:::
121612 enumeration_literal_specification ::= defining_identifier |
121613 defining_character_literal
121614
121615 *note 3.5.1:::
121616 defining_character_literal ::= character_literal
121617
121618 *note 3.5.4:::
121619 integer_type_definition ::= signed_integer_type_definition |
121620 modular_type_definition
121621
121622 *note 3.5.4:::
121623 signed_integer_type_definition ::= range static_
121624 simple_expression .. static_simple_expression
121625
121626 *note 3.5.4:::
121627 modular_type_definition ::= mod static_expression
121628
121629 *note 3.5.6:::
121630 real_type_definition ::=
121631 floating_point_definition | fixed_point_definition
121632
121633 *note 3.5.7:::
121634 floating_point_definition ::=
121635 digits static_expression [real_range_specification]
121636
121637 *note 3.5.7:::
121638 real_range_specification ::=
121639 range static_simple_expression .. static_simple_expression
121640
121641 *note 3.5.9:::
121642 fixed_point_definition ::= ordinary_fixed_point_definition |
121643 decimal_fixed_point_definition
121644
121645 *note 3.5.9:::
121646 ordinary_fixed_point_definition ::=
121647 delta static_expression real_range_specification
121648
121649 *note 3.5.9:::
121650 decimal_fixed_point_definition ::=
121651 delta static_expression digits static_expression [
121652 real_range_specification]
121653
121654 *note 3.5.9:::
121655 digits_constraint ::=
121656 digits static_expression [range_constraint]
121657
121658 *note 3.6:::
121659 array_type_definition ::=
121660 unconstrained_array_definition | constrained_array_definition
121661
121662 *note 3.6:::
121663 unconstrained_array_definition ::=
121664 array(index_subtype_definition {, index_subtype_definition}) of
121665 component_definition
121666
121667 *note 3.6:::
121668 index_subtype_definition ::= subtype_mark range <>
121669
121670 *note 3.6:::
121671 constrained_array_definition ::=
121672 array (discrete_subtype_definition {,
121673 discrete_subtype_definition}) of component_definition
121674
121675 *note 3.6:::
121676 discrete_subtype_definition ::= discrete_subtype_indication | range
121677
121678 *note 3.6:::
121679 component_definition ::=
121680 [aliased] subtype_indication
121681 | [aliased] access_definition
121682
121683 *note 3.6.1:::
121684 index_constraint ::= (discrete_range {, discrete_range})
121685
121686 *note 3.6.1:::
121687 discrete_range ::= discrete_subtype_indication | range
121688
121689 *note 3.7:::
121690 discriminant_part ::= unknown_discriminant_part |
121691 known_discriminant_part
121692
121693 *note 3.7:::
121694 unknown_discriminant_part ::= (<>)
121695
121696 *note 3.7:::
121697 known_discriminant_part ::=
121698 (discriminant_specification {; discriminant_specification})
121699
121700 *note 3.7:::
121701 discriminant_specification ::=
121702 defining_identifier_list : [null_exclusion] subtype_mark [:=
121703 default_expression]
121704 | defining_identifier_list : access_definition [:=
121705 default_expression]
121706
121707 *note 3.7:::
121708 default_expression ::= expression
121709
121710 *note 3.7.1:::
121711 discriminant_constraint ::=
121712 (discriminant_association {, discriminant_association})
121713
121714 *note 3.7.1:::
121715 discriminant_association ::=
121716 [discriminant_selector_name {| discriminant_selector_name} =>]
121717 expression
121718
121719 *note 3.8:::
121720 record_type_definition ::= [[abstract] tagged] [limited]
121721 record_definition
121722
121723 *note 3.8:::
121724 record_definition ::=
121725 record
121726 component_list
121727 end record
121728 | null record
121729
121730 *note 3.8:::
121731 component_list ::=
121732 component_item {component_item}
121733 | {component_item} variant_part
121734 | null;
121735
121736 *note 3.8:::
121737 component_item ::= component_declaration | aspect_clause
121738
121739 *note 3.8:::
121740 component_declaration ::=
121741 defining_identifier_list : component_definition [:=
121742 default_expression]
121743 [aspect_specification];
121744
121745 *note 3.8.1:::
121746 variant_part ::=
121747 case discriminant_direct_name is
121748 variant
121749 {variant}
121750 end case;
121751
121752 *note 3.8.1:::
121753 variant ::=
121754 when discrete_choice_list =>
121755 component_list
121756
121757 *note 3.8.1:::
121758 discrete_choice_list ::= discrete_choice {| discrete_choice}
121759
121760 *note 3.8.1:::
121761 discrete_choice ::= choice_expression | discrete_
121762 subtype_indication | range | others
121763
121764 *note 3.9.1:::
121765 record_extension_part ::= with record_definition
121766
121767 *note 3.9.3:::
121768 abstract_subprogram_declaration ::=
121769 [overriding_indicator]
121770 subprogram_specification is abstract
121771 [aspect_specification];
121772
121773 *note 3.9.4:::
121774 interface_type_definition ::=
121775 [limited | task | protected | synchronized] interface [and
121776 interface_list]
121777
121778 *note 3.9.4:::
121779 interface_list ::= interface_subtype_mark {and interface_
121780 subtype_mark}
121781
121782 *note 3.10:::
121783 access_type_definition ::=
121784 [null_exclusion] access_to_object_definition
121785 | [null_exclusion] access_to_subprogram_definition
121786
121787 *note 3.10:::
121788 access_to_object_definition ::=
121789 access [general_access_modifier] subtype_indication
121790
121791 *note 3.10:::
121792 general_access_modifier ::= all | constant
121793
121794 *note 3.10:::
121795 access_to_subprogram_definition ::=
121796 access [protected] procedure parameter_profile
121797 | access [protected] function parameter_and_result_profile
121798
121799 *note 3.10:::
121800 null_exclusion ::= not null
121801
121802 *note 3.10:::
121803 access_definition ::=
121804 [null_exclusion] access [constant] subtype_mark
121805 | [null_exclusion] access [protected] procedure parameter_profile
121806 | [null_exclusion] access [protected] function
121807 parameter_and_result_profile
121808
121809 *note 3.10.1:::
121810 incomplete_type_declaration ::= type defining_identifier [
121811 discriminant_part] [is tagged];
121812
121813 *note 3.11:::
121814 declarative_part ::= {declarative_item}
121815
121816 *note 3.11:::
121817 declarative_item ::=
121818 basic_declarative_item | body
121819
121820 *note 3.11:::
121821 basic_declarative_item ::=
121822 basic_declaration | aspect_clause | use_clause
121823
121824 *note 3.11:::
121825 body ::= proper_body | body_stub
121826
121827 *note 3.11:::
121828 proper_body ::=
121829 subprogram_body | package_body | task_body | protected_body
121830
121831 *note 4.1:::
121832 name ::=
121833 direct_name | explicit_dereference
121834 | indexed_component | slice
121835 | selected_component | attribute_reference
121836 | type_conversion | function_call
121837 | character_literal | qualified_expression
121838 | generalized_reference | generalized_indexing
121839
121840 *note 4.1:::
121841 direct_name ::= identifier | operator_symbol
121842
121843 *note 4.1:::
121844 prefix ::= name | implicit_dereference
121845
121846 *note 4.1:::
121847 explicit_dereference ::= name.all
121848
121849 *note 4.1:::
121850 implicit_dereference ::= name
121851
121852 *note 4.1.1:::
121853 indexed_component ::= prefix(expression {, expression})
121854
121855 *note 4.1.2:::
121856 slice ::= prefix(discrete_range)
121857
121858 *note 4.1.3:::
121859 selected_component ::= prefix . selector_name
121860
121861 *note 4.1.3:::
121862 selector_name ::= identifier | character_literal | operator_symbol
121863
121864 *note 4.1.4:::
121865 attribute_reference ::= prefix'attribute_designator
121866
121867 *note 4.1.4:::
121868 attribute_designator ::=
121869 identifier[(static_expression)]
121870 | Access | Delta | Digits | Mod
121871
121872 *note 4.1.4:::
121873 range_attribute_reference ::= prefix'range_attribute_designator
121874
121875 *note 4.1.4:::
121876 range_attribute_designator ::= Range[(static_expression)]
121877
121878 *note 4.1.5:::
121879 generalized_reference ::= reference_object_name
121880
121881 *note 4.1.6:::
121882 generalized_indexing ::= indexable_container_object_prefix
121883 actual_parameter_part
121884
121885 *note 4.3:::
121886 aggregate ::= record_aggregate | extension_aggregate |
121887 array_aggregate
121888
121889 *note 4.3.1:::
121890 record_aggregate ::= (record_component_association_list)
121891
121892 *note 4.3.1:::
121893 record_component_association_list ::=
121894 record_component_association {, record_component_association}
121895 | null record
121896
121897 *note 4.3.1:::
121898 record_component_association ::=
121899 [component_choice_list =>] expression
121900 | component_choice_list => <>
121901
121902 *note 4.3.1:::
121903 component_choice_list ::=
121904 component_selector_name {| component_selector_name}
121905 | others
121906
121907 *note 4.3.2:::
121908 extension_aggregate ::=
121909 (ancestor_part with record_component_association_list)
121910
121911 *note 4.3.2:::
121912 ancestor_part ::= expression | subtype_mark
121913
121914 *note 4.3.3:::
121915 array_aggregate ::=
121916 positional_array_aggregate | named_array_aggregate
121917
121918 *note 4.3.3:::
121919 positional_array_aggregate ::=
121920 (expression, expression {, expression})
121921 | (expression {, expression}, others => expression)
121922 | (expression {, expression}, others => <>)
121923
121924 *note 4.3.3:::
121925 named_array_aggregate ::=
121926 (array_component_association {, array_component_association})
121927
121928 *note 4.3.3:::
121929 array_component_association ::=
121930 discrete_choice_list => expression
121931 | discrete_choice_list => <>
121932
121933 *note 4.4:::
121934 expression ::=
121935 relation {and relation} | relation {and then relation}
121936 | relation {or relation} | relation {or else relation}
121937 | relation {xor relation}
121938
121939 *note 4.4:::
121940 choice_expression ::=
121941 choice_relation {and choice_relation}
121942 | choice_relation {or choice_relation}
121943 | choice_relation {xor choice_relation}
121944 | choice_relation {and then choice_relation}
121945 | choice_relation {or else choice_relation}
121946
121947 *note 4.4:::
121948 choice_relation ::=
121949 simple_expression [relational_operator simple_expression]
121950
121951 *note 4.4:::
121952 relation ::=
121953 simple_expression [relational_operator simple_expression]
121954 | simple_expression [not] in membership_choice_list
121955
121956 *note 4.4:::
121957 membership_choice_list ::= membership_choice {| membership_choice}
121958
121959 *note 4.4:::
121960 membership_choice ::= choice_expression | range | subtype_mark
121961
121962 *note 4.4:::
121963 simple_expression ::= [unary_adding_operator] term {
121964 binary_adding_operator term}
121965
121966 *note 4.4:::
121967 term ::= factor {multiplying_operator factor}
121968
121969 *note 4.4:::
121970 factor ::= primary [** primary] | abs primary | not primary
121971
121972 *note 4.4:::
121973 primary ::=
121974 numeric_literal | null | string_literal | aggregate
121975 | name | allocator | (expression)
121976 | (conditional_expression) | (quantified_expression)
121977
121978 *note 4.5:::
121979 logical_operator ::= and | or | xor
121980
121981 *note 4.5:::
121982 relational_operator ::= = | /= | < | <= | > | >=
121983
121984 *note 4.5:::
121985 binary_adding_operator ::= + | - | &
121986
121987 *note 4.5:::
121988 unary_adding_operator ::= + | -
121989
121990 *note 4.5:::
121991 multiplying_operator ::= * | / | mod | rem
121992
121993 *note 4.5:::
121994 highest_precedence_operator ::= ** | abs | not
121995
121996 *note 4.5.7:::
121997 conditional_expression ::= if_expression | case_expression
121998
121999 *note 4.5.7:::
122000 if_expression ::=
122001 if condition then dependent_expression
122002 {elsif condition then dependent_expression}
122003 [else dependent_expression]
122004
122005 *note 4.5.7:::
122006 condition ::= boolean_expression
122007
122008 *note 4.5.7:::
122009 case_expression ::=
122010 case selecting_expression is
122011 case_expression_alternative {,
122012 case_expression_alternative}
122013
122014 *note 4.5.7:::
122015 case_expression_alternative ::=
122016 when discrete_choice_list =>
122017 dependent_expression
122018
122019 *note 4.5.8:::
122020 quantified_expression ::= for quantifier
122021 loop_parameter_specification => predicate
122022 | for quantifier iterator_specification => predicate
122023
122024 *note 4.5.8:::
122025 quantifier ::= all | some
122026
122027 *note 4.5.8:::
122028 predicate ::= boolean_expression
122029
122030 *note 4.6:::
122031 type_conversion ::=
122032 subtype_mark(expression)
122033 | subtype_mark(name)
122034
122035 *note 4.7:::
122036 qualified_expression ::=
122037 subtype_mark'(expression) | subtype_mark'aggregate
122038
122039 *note 4.8:::
122040 allocator ::=
122041 new [subpool_specification] subtype_indication
122042 | new [subpool_specification] qualified_expression
122043
122044 *note 4.8:::
122045 subpool_specification ::= (subpool_handle_name)
122046
122047 *note 5.1:::
122048 sequence_of_statements ::= statement {statement} {label}
122049
122050 *note 5.1:::
122051 statement ::=
122052 {label} simple_statement | {label} compound_statement
122053
122054 *note 5.1:::
122055 simple_statement ::= null_statement
122056 | assignment_statement | exit_statement
122057 | goto_statement | procedure_call_statement
122058 | simple_return_statement | entry_call_statement
122059 | requeue_statement | delay_statement
122060 | abort_statement | raise_statement
122061 | code_statement
122062
122063 *note 5.1:::
122064 compound_statement ::=
122065 if_statement | case_statement
122066 | loop_statement | block_statement
122067 | extended_return_statement
122068 | accept_statement | select_statement
122069
122070 *note 5.1:::
122071 null_statement ::= null;
122072
122073 *note 5.1:::
122074 label ::= <<label_statement_identifier>>
122075
122076 *note 5.1:::
122077 statement_identifier ::= direct_name
122078
122079 *note 5.2:::
122080 assignment_statement ::=
122081 variable_name := expression;
122082
122083 *note 5.3:::
122084 if_statement ::=
122085 if condition then
122086 sequence_of_statements
122087 {elsif condition then
122088 sequence_of_statements}
122089 [else
122090 sequence_of_statements]
122091 end if;
122092
122093 *note 5.4:::
122094 case_statement ::=
122095 case selecting_expression is
122096 case_statement_alternative
122097 {case_statement_alternative}
122098 end case;
122099
122100 *note 5.4:::
122101 case_statement_alternative ::=
122102 when discrete_choice_list =>
122103 sequence_of_statements
122104
122105 *note 5.5:::
122106 loop_statement ::=
122107 [loop_statement_identifier:]
122108 [iteration_scheme] loop
122109 sequence_of_statements
122110 end loop [loop_identifier];
122111
122112 *note 5.5:::
122113 iteration_scheme ::= while condition
122114 | for loop_parameter_specification
122115 | for iterator_specification
122116
122117 *note 5.5:::
122118 loop_parameter_specification ::=
122119 defining_identifier in [reverse] discrete_subtype_definition
122120
122121 *note 5.5.2:::
122122 iterator_specification ::=
122123 defining_identifier in [reverse] iterator_name
122124 | defining_identifier [:
122125 subtype_indication] of [reverse] iterable_name
122126
122127 *note 5.6:::
122128 block_statement ::=
122129 [block_statement_identifier:]
122130 [declare
122131 declarative_part]
122132 begin
122133 handled_sequence_of_statements
122134 end [block_identifier];
122135
122136 *note 5.7:::
122137 exit_statement ::=
122138 exit [loop_name] [when condition];
122139
122140 *note 5.8:::
122141 goto_statement ::= goto label_name;
122142
122143 *note 6.1:::
122144 subprogram_declaration ::=
122145 [overriding_indicator]
122146 subprogram_specification
122147 [aspect_specification];
122148
122149 *note 6.1:::
122150 subprogram_specification ::=
122151 procedure_specification
122152 | function_specification
122153
122154 *note 6.1:::
122155 procedure_specification ::= procedure defining_program_unit_name
122156 parameter_profile
122157
122158 *note 6.1:::
122159 function_specification ::= function defining_designator
122160 parameter_and_result_profile
122161
122162 *note 6.1:::
122163 designator ::= [parent_unit_name . ]identifier | operator_symbol
122164
122165 *note 6.1:::
122166 defining_designator ::= defining_program_unit_name |
122167 defining_operator_symbol
122168
122169 *note 6.1:::
122170 defining_program_unit_name ::= [parent_unit_name . ]
122171 defining_identifier
122172
122173 *note 6.1:::
122174 operator_symbol ::= string_literal
122175
122176 *note 6.1:::
122177 defining_operator_symbol ::= operator_symbol
122178
122179 *note 6.1:::
122180 parameter_profile ::= [formal_part]
122181
122182 *note 6.1:::
122183 parameter_and_result_profile ::=
122184 [formal_part] return [null_exclusion] subtype_mark
122185 | [formal_part] return access_definition
122186
122187 *note 6.1:::
122188 formal_part ::=
122189 (parameter_specification {; parameter_specification})
122190
122191 *note 6.1:::
122192 parameter_specification ::=
122193 defining_identifier_list : [aliased] mode [null_exclusion]
122194 subtype_mark [:= default_expression]
122195 | defining_identifier_list : access_definition [:=
122196 default_expression]
122197
122198 *note 6.1:::
122199 mode ::= [in] | in out | out
122200
122201 *note 6.3:::
122202 subprogram_body ::=
122203 [overriding_indicator]
122204 subprogram_specification
122205 [aspect_specification] is
122206 declarative_part
122207 begin
122208 handled_sequence_of_statements
122209 end [designator];
122210
122211 *note 6.4:::
122212 procedure_call_statement ::=
122213 procedure_name;
122214 | procedure_prefix actual_parameter_part;
122215
122216 *note 6.4:::
122217 function_call ::=
122218 function_name
122219 | function_prefix actual_parameter_part
122220
122221 *note 6.4:::
122222 actual_parameter_part ::=
122223 (parameter_association {, parameter_association})
122224
122225 *note 6.4:::
122226 parameter_association ::=
122227 [formal_parameter_selector_name =>] explicit_actual_parameter
122228
122229 *note 6.4:::
122230 explicit_actual_parameter ::= expression | variable_name
122231
122232 *note 6.5:::
122233 simple_return_statement ::= return [expression];
122234
122235 *note 6.5:::
122236 extended_return_object_declaration ::=
122237 defining_identifier : [aliased][constant]
122238 return_subtype_indication [:= expression]
122239
122240 *note 6.5:::
122241 extended_return_statement ::=
122242 return extended_return_object_declaration [do
122243 handled_sequence_of_statements
122244 end return];
122245
122246 *note 6.5:::
122247 return_subtype_indication ::= subtype_indication |
122248 access_definition
122249
122250 *note 6.7:::
122251 null_procedure_declaration ::=
122252 [overriding_indicator]
122253 procedure_specification is null
122254 [aspect_specification];
122255
122256 *note 6.8:::
122257 expression_function_declaration ::=
122258 [overriding_indicator]
122259 function_specification is
122260 (expression)
122261 [aspect_specification];
122262
122263 *note 7.1:::
122264 package_declaration ::= package_specification;
122265
122266 *note 7.1:::
122267 package_specification ::=
122268 package defining_program_unit_name
122269 [aspect_specification] is
122270 {basic_declarative_item}
122271 [private
122272 {basic_declarative_item}]
122273 end [[parent_unit_name.]identifier]
122274
122275 *note 7.2:::
122276 package_body ::=
122277 package body defining_program_unit_name
122278 [aspect_specification] is
122279 declarative_part
122280 [begin
122281 handled_sequence_of_statements]
122282 end [[parent_unit_name.]identifier];
122283
122284 *note 7.3:::
122285 private_type_declaration ::=
122286 type defining_identifier [
122287 discriminant_part] is [[abstract] tagged] [limited] private
122288 [aspect_specification];
122289
122290 *note 7.3:::
122291 private_extension_declaration ::=
122292 type defining_identifier [discriminant_part] is
122293 [abstract] [limited | synchronized] new ancestor_
122294 subtype_indication
122295 [and interface_list] with private
122296 [aspect_specification];
122297
122298 *note 8.3.1:::
122299 overriding_indicator ::= [not] overriding
122300
122301 *note 8.4:::
122302 use_clause ::= use_package_clause | use_type_clause
122303
122304 *note 8.4:::
122305 use_package_clause ::= use package_name {, package_name};
122306
122307 *note 8.4:::
122308 use_type_clause ::= use [all] type subtype_mark {, subtype_mark};
122309
122310 *note 8.5:::
122311 renaming_declaration ::=
122312 object_renaming_declaration
122313 | exception_renaming_declaration
122314 | package_renaming_declaration
122315 | subprogram_renaming_declaration
122316 | generic_renaming_declaration
122317
122318 *note 8.5.1:::
122319 object_renaming_declaration ::=
122320 defining_identifier : [null_exclusion]
122321 subtype_mark renames object_name
122322 [aspect_specification];
122323 | defining_identifier : access_definition renames object_name
122324 [aspect_specification];
122325
122326 *note 8.5.2:::
122327 exception_renaming_declaration ::=
122328 defining_identifier : exception renames exception_name
122329 [aspect_specification];
122330
122331 *note 8.5.3:::
122332 package_renaming_declaration ::= package
122333 defining_program_unit_name renames package_name
122334 [aspect_specification];
122335
122336 *note 8.5.4:::
122337 subprogram_renaming_declaration ::=
122338 [overriding_indicator]
122339 subprogram_specification renames callable_entity_name
122340 [aspect_specification];
122341
122342 *note 8.5.5:::
122343 generic_renaming_declaration ::=
122344 generic package
122345 defining_program_unit_name renames generic_package_name
122346 [aspect_specification];
122347 | generic procedure
122348 defining_program_unit_name renames generic_procedure_name
122349 [aspect_specification];
122350 | generic function
122351 defining_program_unit_name renames generic_function_name
122352 [aspect_specification];
122353
122354 *note 9.1:::
122355 task_type_declaration ::=
122356 task type defining_identifier [known_discriminant_part]
122357 [aspect_specification] [is
122358 [new interface_list with]
122359 task_definition];
122360
122361 *note 9.1:::
122362 single_task_declaration ::=
122363 task defining_identifier
122364 [aspect_specification][is
122365 [new interface_list with]
122366 task_definition];
122367
122368 *note 9.1:::
122369 task_definition ::=
122370 {task_item}
122371 [ private
122372 {task_item}]
122373 end [task_identifier]
122374
122375 *note 9.1:::
122376 task_item ::= entry_declaration | aspect_clause
122377
122378 *note 9.1:::
122379 task_body ::=
122380 task body defining_identifier
122381 [aspect_specification] is
122382 declarative_part
122383 begin
122384 handled_sequence_of_statements
122385 end [task_identifier];
122386
122387 *note 9.4:::
122388 protected_type_declaration ::=
122389 protected type defining_identifier [known_discriminant_part]
122390 [aspect_specification] is
122391 [new interface_list with]
122392 protected_definition;
122393
122394 *note 9.4:::
122395 single_protected_declaration ::=
122396 protected defining_identifier
122397 [aspect_specification] is
122398 [new interface_list with]
122399 protected_definition;
122400
122401 *note 9.4:::
122402 protected_definition ::=
122403 { protected_operation_declaration }
122404 [ private
122405 { protected_element_declaration } ]
122406 end [protected_identifier]
122407
122408 *note 9.4:::
122409 protected_operation_declaration ::= subprogram_declaration
122410 | entry_declaration
122411 | aspect_clause
122412
122413 *note 9.4:::
122414 protected_element_declaration ::= protected_operation_declaration
122415 | component_declaration
122416
122417 *note 9.4:::
122418 protected_body ::=
122419 protected body defining_identifier
122420 [aspect_specification] is
122421 { protected_operation_item }
122422 end [protected_identifier];
122423
122424 *note 9.4:::
122425 protected_operation_item ::= subprogram_declaration
122426 | subprogram_body
122427 | entry_body
122428 | aspect_clause
122429
122430 *note 9.5:::
122431 synchronization_kind ::= By_Entry | By_Protected_Procedure | Optional
122432
122433 *note 9.5.2:::
122434 entry_declaration ::=
122435 [overriding_indicator]
122436 entry defining_identifier [(discrete_subtype_definition)]
122437 parameter_profile
122438 [aspect_specification];
122439
122440 *note 9.5.2:::
122441 accept_statement ::=
122442 accept entry_direct_name [(entry_index)] parameter_profile [do
122443 handled_sequence_of_statements
122444 end [entry_identifier]];
122445
122446 *note 9.5.2:::
122447 entry_index ::= expression
122448
122449 *note 9.5.2:::
122450 entry_body ::=
122451 entry defining_identifier entry_body_formal_part
122452 entry_barrier is
122453 declarative_part
122454 begin
122455 handled_sequence_of_statements
122456 end [entry_identifier];
122457
122458 *note 9.5.2:::
122459 entry_body_formal_part ::= [(entry_index_specification)]
122460 parameter_profile
122461
122462 *note 9.5.2:::
122463 entry_barrier ::= when condition
122464
122465 *note 9.5.2:::
122466 entry_index_specification ::= for defining_identifier in
122467 discrete_subtype_definition
122468
122469 *note 9.5.3:::
122470 entry_call_statement ::= entry_name [actual_parameter_part];
122471
122472 *note 9.5.4:::
122473 requeue_statement ::= requeue procedure_or_entry_name [with abort];
122474
122475 *note 9.6:::
122476 delay_statement ::= delay_until_statement |
122477 delay_relative_statement
122478
122479 *note 9.6:::
122480 delay_until_statement ::= delay until delay_expression;
122481
122482 *note 9.6:::
122483 delay_relative_statement ::= delay delay_expression;
122484
122485 *note 9.7:::
122486 select_statement ::=
122487 selective_accept
122488 | timed_entry_call
122489 | conditional_entry_call
122490 | asynchronous_select
122491
122492 *note 9.7.1:::
122493 selective_accept ::=
122494 select
122495 [guard]
122496 select_alternative
122497 { or
122498 [guard]
122499 select_alternative }
122500 [ else
122501 sequence_of_statements ]
122502 end select;
122503
122504 *note 9.7.1:::
122505 guard ::= when condition =>
122506
122507 *note 9.7.1:::
122508 select_alternative ::=
122509 accept_alternative
122510 | delay_alternative
122511 | terminate_alternative
122512
122513 *note 9.7.1:::
122514 accept_alternative ::=
122515 accept_statement [sequence_of_statements]
122516
122517 *note 9.7.1:::
122518 delay_alternative ::=
122519 delay_statement [sequence_of_statements]
122520
122521 *note 9.7.1:::
122522 terminate_alternative ::= terminate;
122523
122524 *note 9.7.2:::
122525 timed_entry_call ::=
122526 select
122527 entry_call_alternative
122528 or
122529 delay_alternative
122530 end select;
122531
122532 *note 9.7.2:::
122533 entry_call_alternative ::=
122534 procedure_or_entry_call [sequence_of_statements]
122535
122536 *note 9.7.2:::
122537 procedure_or_entry_call ::=
122538 procedure_call_statement | entry_call_statement
122539
122540 *note 9.7.3:::
122541 conditional_entry_call ::=
122542 select
122543 entry_call_alternative
122544 else
122545 sequence_of_statements
122546 end select;
122547
122548 *note 9.7.4:::
122549 asynchronous_select ::=
122550 select
122551 triggering_alternative
122552 then abort
122553 abortable_part
122554 end select;
122555
122556 *note 9.7.4:::
122557 triggering_alternative ::= triggering_statement [
122558 sequence_of_statements]
122559
122560 *note 9.7.4:::
122561 triggering_statement ::= procedure_or_entry_call | delay_statement
122562
122563 *note 9.7.4:::
122564 abortable_part ::= sequence_of_statements
122565
122566 *note 9.8:::
122567 abort_statement ::= abort task_name {, task_name};
122568
122569 *note 10.1.1:::
122570 compilation ::= {compilation_unit}
122571
122572 *note 10.1.1:::
122573 compilation_unit ::=
122574 context_clause library_item
122575 | context_clause subunit
122576
122577 *note 10.1.1:::
122578 library_item ::= [private] library_unit_declaration
122579 | library_unit_body
122580 | [private] library_unit_renaming_declaration
122581
122582 *note 10.1.1:::
122583 library_unit_declaration ::=
122584 subprogram_declaration | package_declaration
122585 | generic_declaration | generic_instantiation
122586
122587 *note 10.1.1:::
122588 library_unit_renaming_declaration ::=
122589 package_renaming_declaration
122590 | generic_renaming_declaration
122591 | subprogram_renaming_declaration
122592
122593 *note 10.1.1:::
122594 library_unit_body ::= subprogram_body | package_body
122595
122596 *note 10.1.1:::
122597 parent_unit_name ::= name
122598
122599 *note 10.1.2:::
122600 context_clause ::= {context_item}
122601
122602 *note 10.1.2:::
122603 context_item ::= with_clause | use_clause
122604
122605 *note 10.1.2:::
122606 with_clause ::= limited_with_clause | nonlimited_with_clause
122607
122608 *note 10.1.2:::
122609 limited_with_clause ::= limited [private] with library_unit_
122610 name {, library_unit_name};
122611
122612 *note 10.1.2:::
122613 nonlimited_with_clause ::= [private] with library_unit_
122614 name {, library_unit_name};
122615
122616 *note 10.1.3:::
122617 body_stub ::= subprogram_body_stub | package_body_stub |
122618 task_body_stub | protected_body_stub
122619
122620 *note 10.1.3:::
122621 subprogram_body_stub ::=
122622 [overriding_indicator]
122623 subprogram_specification is separate
122624 [aspect_specification];
122625
122626 *note 10.1.3:::
122627 package_body_stub ::=
122628 package body defining_identifier is separate
122629 [aspect_specification];
122630
122631 *note 10.1.3:::
122632 task_body_stub ::=
122633 task body defining_identifier is separate
122634 [aspect_specification];
122635
122636 *note 10.1.3:::
122637 protected_body_stub ::=
122638 protected body defining_identifier is separate
122639 [aspect_specification];
122640
122641 *note 10.1.3:::
122642 subunit ::= separate (parent_unit_name) proper_body
122643
122644 *note 11.1:::
122645 exception_declaration ::= defining_identifier_list : exception
122646 [aspect_specification];
122647
122648 *note 11.2:::
122649 handled_sequence_of_statements ::=
122650 sequence_of_statements
122651 [exception
122652 exception_handler
122653 {exception_handler}]
122654
122655 *note 11.2:::
122656 exception_handler ::=
122657 when [choice_parameter_specification:] exception_choice {|
122658 exception_choice} =>
122659 sequence_of_statements
122660
122661 *note 11.2:::
122662 choice_parameter_specification ::= defining_identifier
122663
122664 *note 11.2:::
122665 exception_choice ::= exception_name | others
122666
122667 *note 11.3:::
122668 raise_statement ::= raise;
122669 | raise exception_name [with string_expression];
122670
122671 *note 12.1:::
122672 generic_declaration ::= generic_subprogram_declaration |
122673 generic_package_declaration
122674
122675 *note 12.1:::
122676 generic_subprogram_declaration ::=
122677 generic_formal_part subprogram_specification
122678 [aspect_specification];
122679
122680 *note 12.1:::
122681 generic_package_declaration ::=
122682 generic_formal_part package_specification;
122683
122684 *note 12.1:::
122685 generic_formal_part ::= generic {
122686 generic_formal_parameter_declaration | use_clause}
122687
122688 *note 12.1:::
122689 generic_formal_parameter_declaration ::=
122690 formal_object_declaration
122691 | formal_type_declaration
122692 | formal_subprogram_declaration
122693 | formal_package_declaration
122694
122695 *note 12.3:::
122696 generic_instantiation ::=
122697 package defining_program_unit_name is
122698 new generic_package_name [generic_actual_part]
122699 [aspect_specification];
122700 | [overriding_indicator]
122701 procedure defining_program_unit_name is
122702 new generic_procedure_name [generic_actual_part]
122703 [aspect_specification];
122704 | [overriding_indicator]
122705 function defining_designator is
122706 new generic_function_name [generic_actual_part]
122707 [aspect_specification];
122708
122709 *note 12.3:::
122710 generic_actual_part ::=
122711 (generic_association {, generic_association})
122712
122713 *note 12.3:::
122714 generic_association ::=
122715 [generic_formal_parameter_selector_name =>]
122716 explicit_generic_actual_parameter
122717
122718 *note 12.3:::
122719 explicit_generic_actual_parameter ::= expression | variable_name
122720 | subprogram_name | entry_name | subtype_mark
122721 | package_instance_name
122722
122723 *note 12.4:::
122724 formal_object_declaration ::=
122725 defining_identifier_list : mode [null_exclusion]
122726 subtype_mark [:= default_expression]
122727 [aspect_specification];
122728 | defining_identifier_list : mode access_definition [:=
122729 default_expression]
122730 [aspect_specification];
122731
122732 *note 12.5:::
122733 formal_type_declaration ::=
122734 formal_complete_type_declaration
122735 | formal_incomplete_type_declaration
122736
122737 *note 12.5:::
122738 formal_complete_type_declaration ::=
122739 type defining_identifier[discriminant_part] is
122740 formal_type_definition
122741 [aspect_specification];
122742
122743 *note 12.5:::
122744 formal_incomplete_type_declaration ::=
122745 type defining_identifier[discriminant_part] [is tagged];
122746
122747 *note 12.5:::
122748 formal_type_definition ::=
122749 formal_private_type_definition
122750 | formal_derived_type_definition
122751 | formal_discrete_type_definition
122752 | formal_signed_integer_type_definition
122753 | formal_modular_type_definition
122754 | formal_floating_point_definition
122755 | formal_ordinary_fixed_point_definition
122756 | formal_decimal_fixed_point_definition
122757 | formal_array_type_definition
122758 | formal_access_type_definition
122759 | formal_interface_type_definition
122760
122761 *note 12.5.1:::
122762 formal_private_type_definition ::= [[abstract] tagged] [limited] private
122763
122764 *note 12.5.1:::
122765 formal_derived_type_definition ::=
122766 [abstract] [limited | synchronized] new subtype_mark [[and
122767 interface_list]with private]
122768
122769 *note 12.5.2:::
122770 formal_discrete_type_definition ::= (<>)
122771
122772 *note 12.5.2:::
122773 formal_signed_integer_type_definition ::= range <>
122774
122775 *note 12.5.2:::
122776 formal_modular_type_definition ::= mod <>
122777
122778 *note 12.5.2:::
122779 formal_floating_point_definition ::= digits <>
122780
122781 *note 12.5.2:::
122782 formal_ordinary_fixed_point_definition ::= delta <>
122783
122784 *note 12.5.2:::
122785 formal_decimal_fixed_point_definition ::= delta <> digits <>
122786
122787 *note 12.5.3:::
122788 formal_array_type_definition ::= array_type_definition
122789
122790 *note 12.5.4:::
122791 formal_access_type_definition ::= access_type_definition
122792
122793 *note 12.5.5:::
122794 formal_interface_type_definition ::= interface_type_definition
122795
122796 *note 12.6:::
122797 formal_subprogram_declaration ::=
122798 formal_concrete_subprogram_declaration
122799 | formal_abstract_subprogram_declaration
122800
122801 *note 12.6:::
122802 formal_concrete_subprogram_declaration ::=
122803 with subprogram_specification [is subprogram_default]
122804 [aspect_specification];
122805
122806 *note 12.6:::
122807 formal_abstract_subprogram_declaration ::=
122808 with subprogram_specification is abstract [subprogram_default]
122809 [aspect_specification];
122810
122811 *note 12.6:::
122812 subprogram_default ::= default_name | <> | null
122813
122814 *note 12.6:::
122815 default_name ::= name
122816
122817 *note 12.7:::
122818 formal_package_declaration ::=
122819 with package defining_identifier is new generic_package_name
122820 formal_package_actual_part
122821 [aspect_specification];
122822
122823 *note 12.7:::
122824 formal_package_actual_part ::=
122825 ([others =>] <>)
122826 | [generic_actual_part]
122827 | (formal_package_association {,
122828 formal_package_association} [, others => <>])
122829
122830 *note 12.7:::
122831 formal_package_association ::=
122832 generic_association
122833 | generic_formal_parameter_selector_name => <>
122834
122835 *note 13.1:::
122836 aspect_clause ::= attribute_definition_clause
122837 | enumeration_representation_clause
122838 | record_representation_clause
122839 | at_clause
122840
122841 *note 13.1:::
122842 local_name ::= direct_name
122843 | direct_name'attribute_designator
122844 | library_unit_name
122845
122846 *note 13.1.1:::
122847 aspect_specification ::=
122848 with aspect_mark [=> aspect_definition] {,
122849 aspect_mark [=> aspect_definition] }
122850
122851 *note 13.1.1:::
122852 aspect_mark ::= aspect_identifier['Class]
122853
122854 *note 13.1.1:::
122855 aspect_definition ::= name | expression | identifier
122856
122857 *note 13.3:::
122858 attribute_definition_clause ::=
122859 for local_name'attribute_designator use expression;
122860 | for local_name'attribute_designator use name;
122861
122862 *note 13.4:::
122863 enumeration_representation_clause ::=
122864 for first_subtype_local_name use enumeration_aggregate;
122865
122866 *note 13.4:::
122867 enumeration_aggregate ::= array_aggregate
122868
122869 *note 13.5.1:::
122870 record_representation_clause ::=
122871 for first_subtype_local_name use
122872 record [mod_clause]
122873 {component_clause}
122874 end record;
122875
122876 *note 13.5.1:::
122877 component_clause ::=
122878 component_local_name at position range first_bit .. last_bit;
122879
122880 *note 13.5.1:::
122881 position ::= static_expression
122882
122883 *note 13.5.1:::
122884 first_bit ::= static_simple_expression
122885
122886 *note 13.5.1:::
122887 last_bit ::= static_simple_expression
122888
122889 *note 13.8:::
122890 code_statement ::= qualified_expression;
122891
122892 *note 13.11.3:::
122893 storage_pool_indicator ::= storage_pool_name | null
122894
122895 *note 13.12:::
122896 restriction ::= restriction_identifier
122897 | restriction_parameter_identifier =>
122898 restriction_parameter_argument
122899
122900 *note 13.12:::
122901 restriction_parameter_argument ::= name | expression
122902
122903 *note J.3:::
122904 delta_constraint ::= delta static_expression [range_constraint]
122905
122906 *note J.7:::
122907 at_clause ::= for direct_name use at expression;
122908
122909 *note J.8:::
122910 mod_clause ::= at mod static_expression;
122911
122912 Syntax Cross Reference
122913
122914
122915 1/3
122916 {AI05-0299-1AI05-0299-1} In the following syntax cross reference, each
122917 syntactic category is followed by the subclause number where it is
122918 defined. In addition, each syntactic category S is followed by a list
122919 of the categories that use S in their definitions. For example, the
122920 first listing below shows that abort_statement appears in the definition
122921 of simple_statement.
122922
122923 abort_statement *note 9.8::
122924 simple_statement *note 5.1::
122925
122926 abortable_part *note 9.7.4::
122927 asynchronous_select *note 9.7.4::
122928
122929 abstract_subprogram_declaration *note 3.9.3::
122930 basic_declaration *note 3.1::
122931
122932 accept_alternative *note 9.7.1::
122933 select_alternative *note 9.7.1::
122934
122935 accept_statement *note 9.5.2::
122936 accept_alternative *note 9.7.1::
122937 compound_statement *note 5.1::
122938
122939 access_definition *note 3.10::
122940 component_definition *note 3.6::
122941 discriminant_specification *note 3.7::
122942 formal_object_declaration *note 12.4::
122943 object_declaration *note 3.3.1::
122944 object_renaming_declaration *note 8.5.1::
122945 parameter_and_result_profile *note 6.1::
122946 parameter_specification *note 6.1::
122947 return_subtype_indication *note 6.5::
122948
122949 access_to_object_definition *note 3.10::
122950 access_type_definition *note 3.10::
122951
122952 access_to_subprogram_definition *note 3.10::
122953 access_type_definition *note 3.10::
122954
122955 access_type_definition *note 3.10::
122956 formal_access_type_definition *note 12.5.4::
122957 type_definition *note 3.2.1::
122958
122959 actual_parameter_part *note 6.4::
122960 entry_call_statement *note 9.5.3::
122961 function_call *note 6.4::
122962 generalized_indexing *note 4.1.6::
122963 procedure_call_statement *note 6.4::
122964
122965 aggregate *note 4.3::
122966 primary *note 4.4::
122967 qualified_expression *note 4.7::
122968
122969 allocator *note 4.8::
122970 primary *note 4.4::
122971
122972 ancestor_part *note 4.3.2::
122973 extension_aggregate *note 4.3.2::
122974
122975 array_aggregate *note 4.3.3::
122976 aggregate *note 4.3::
122977 enumeration_aggregate *note 13.4::
122978
122979 array_component_association *note 4.3.3::
122980 named_array_aggregate *note 4.3.3::
122981
122982 array_type_definition *note 3.6::
122983 formal_array_type_definition *note 12.5.3::
122984 object_declaration *note 3.3.1::
122985 type_definition *note 3.2.1::
122986
122987 aspect_clause *note 13.1::
122988 basic_declarative_item *note 3.11::
122989 component_item *note 3.8::
122990 protected_operation_declaration *note 9.4::
122991 protected_operation_item *note 9.4::
122992 task_item *note 9.1::
122993
122994 aspect_definition *note 13.1.1::
122995 aspect_specification *note 13.1.1::
122996
122997 aspect_mark *note 13.1.1::
122998 aspect_specification *note 13.1.1::
122999 pragma_argument_association *note 2.8::
123000
123001 aspect_specification *note 13.1.1::
123002 abstract_subprogram_declaration *note 3.9.3::
123003 component_declaration *note 3.8::
123004 entry_declaration *note 9.5.2::
123005 exception_declaration *note 11.1::
123006 exception_renaming_declaration *note 8.5.2::
123007 expression_function_declaration *note 6.8::
123008 formal_abstract_subprogram_declaration *note 12.6::
123009 formal_complete_type_declaration *note 12.5::
123010 formal_concrete_subprogram_declaration *note 12.6::
123011 formal_object_declaration *note 12.4::
123012 formal_package_declaration *note 12.7::
123013 full_type_declaration *note 3.2.1::
123014 generic_instantiation *note 12.3::
123015 generic_renaming_declaration *note 8.5.5::
123016 generic_subprogram_declaration *note 12.1::
123017 null_procedure_declaration *note 6.7::
123018 object_declaration *note 3.3.1::
123019 object_renaming_declaration *note 8.5.1::
123020 package_body *note 7.2::
123021 package_body_stub *note 10.1.3::
123022 package_renaming_declaration *note 8.5.3::
123023 package_specification *note 7.1::
123024 private_extension_declaration *note 7.3::
123025 private_type_declaration *note 7.3::
123026 protected_body *note 9.4::
123027 protected_body_stub *note 10.1.3::
123028 protected_type_declaration *note 9.4::
123029 single_protected_declaration *note 9.4::
123030 single_task_declaration *note 9.1::
123031 subprogram_body *note 6.3::
123032 subprogram_body_stub *note 10.1.3::
123033 subprogram_declaration *note 6.1::
123034 subprogram_renaming_declaration *note 8.5.4::
123035 subtype_declaration *note 3.2.2::
123036 task_body *note 9.1::
123037 task_body_stub *note 10.1.3::
123038 task_type_declaration *note 9.1::
123039
123040 assignment_statement *note 5.2::
123041 simple_statement *note 5.1::
123042
123043 asynchronous_select *note 9.7.4::
123044 select_statement *note 9.7::
123045
123046 at_clause *note J.7::
123047 aspect_clause *note 13.1::
123048
123049 attribute_definition_clause *note 13.3::
123050 aspect_clause *note 13.1::
123051
123052 attribute_designator *note 4.1.4::
123053 attribute_definition_clause *note 13.3::
123054 attribute_reference *note 4.1.4::
123055 local_name *note 13.1::
123056
123057 attribute_reference *note 4.1.4::
123058 name *note 4.1::
123059
123060 base *note 2.4.2::
123061 based_literal *note 2.4.2::
123062
123063 based_literal *note 2.4.2::
123064 numeric_literal *note 2.4::
123065
123066 based_numeral *note 2.4.2::
123067 based_literal *note 2.4.2::
123068
123069 basic_declaration *note 3.1::
123070 basic_declarative_item *note 3.11::
123071
123072 basic_declarative_item *note 3.11::
123073 declarative_item *note 3.11::
123074 package_specification *note 7.1::
123075
123076 binary_adding_operator *note 4.5::
123077 simple_expression *note 4.4::
123078
123079 block_statement *note 5.6::
123080 compound_statement *note 5.1::
123081
123082 body *note 3.11::
123083 declarative_item *note 3.11::
123084
123085 body_stub *note 10.1.3::
123086 body *note 3.11::
123087
123088 case_expression *note 4.5.7::
123089 conditional_expression *note 4.5.7::
123090
123091 case_expression_alternative *note 4.5.7::
123092 case_expression *note 4.5.7::
123093
123094 case_statement *note 5.4::
123095 compound_statement *note 5.1::
123096
123097 case_statement_alternative *note 5.4::
123098 case_statement *note 5.4::
123099
123100 character *note 2.1::
123101 comment *note 2.7::
123102
123103 character_literal *note 2.5::
123104 defining_character_literal *note 3.5.1::
123105 name *note 4.1::
123106 selector_name *note 4.1.3::
123107
123108 choice_expression *note 4.4::
123109 discrete_choice *note 3.8.1::
123110 membership_choice *note 4.4::
123111
123112 choice_parameter_specification *note 11.2::
123113 exception_handler *note 11.2::
123114
123115 choice_relation *note 4.4::
123116 choice_expression *note 4.4::
123117
123118 code_statement *note 13.8::
123119 simple_statement *note 5.1::
123120
123121 compilation_unit *note 10.1.1::
123122 compilation *note 10.1.1::
123123
123124 component_choice_list *note 4.3.1::
123125 record_component_association *note 4.3.1::
123126
123127 component_clause *note 13.5.1::
123128 record_representation_clause *note 13.5.1::
123129
123130 component_declaration *note 3.8::
123131 component_item *note 3.8::
123132 protected_element_declaration *note 9.4::
123133
123134 component_definition *note 3.6::
123135 component_declaration *note 3.8::
123136 constrained_array_definition *note 3.6::
123137 unconstrained_array_definition *note 3.6::
123138
123139 component_item *note 3.8::
123140 component_list *note 3.8::
123141
123142 component_list *note 3.8::
123143 record_definition *note 3.8::
123144 variant *note 3.8.1::
123145
123146 composite_constraint *note 3.2.2::
123147 constraint *note 3.2.2::
123148
123149 compound_statement *note 5.1::
123150 statement *note 5.1::
123151
123152 condition *note 4.5.7::
123153 entry_barrier *note 9.5.2::
123154 exit_statement *note 5.7::
123155 guard *note 9.7.1::
123156 if_expression *note 4.5.7::
123157 if_statement *note 5.3::
123158 iteration_scheme *note 5.5::
123159
123160 conditional_entry_call *note 9.7.3::
123161 select_statement *note 9.7::
123162
123163 conditional_expression *note 4.5.7::
123164 primary *note 4.4::
123165
123166 constrained_array_definition *note 3.6::
123167 array_type_definition *note 3.6::
123168
123169 constraint *note 3.2.2::
123170 subtype_indication *note 3.2.2::
123171
123172 context_clause *note 10.1.2::
123173 compilation_unit *note 10.1.1::
123174
123175 context_item *note 10.1.2::
123176 context_clause *note 10.1.2::
123177
123178 decimal_fixed_point_definition *note 3.5.9::
123179 fixed_point_definition *note 3.5.9::
123180
123181 decimal_literal *note 2.4.1::
123182 numeric_literal *note 2.4::
123183
123184 declarative_item *note 3.11::
123185 declarative_part *note 3.11::
123186
123187 declarative_part *note 3.11::
123188 block_statement *note 5.6::
123189 entry_body *note 9.5.2::
123190 package_body *note 7.2::
123191 subprogram_body *note 6.3::
123192 task_body *note 9.1::
123193
123194 default_expression *note 3.7::
123195 component_declaration *note 3.8::
123196 discriminant_specification *note 3.7::
123197 formal_object_declaration *note 12.4::
123198 parameter_specification *note 6.1::
123199
123200 default_name *note 12.6::
123201 subprogram_default *note 12.6::
123202
123203 defining_character_literal *note 3.5.1::
123204 enumeration_literal_specification *note 3.5.1::
123205
123206 defining_designator *note 6.1::
123207 function_specification *note 6.1::
123208 generic_instantiation *note 12.3::
123209
123210 defining_identifier *note 3.1::
123211 choice_parameter_specification *note 11.2::
123212 defining_identifier_list *note 3.3.1::
123213 defining_program_unit_name *note 6.1::
123214 entry_body *note 9.5.2::
123215 entry_declaration *note 9.5.2::
123216 entry_index_specification *note 9.5.2::
123217 enumeration_literal_specification *note 3.5.1::
123218 exception_renaming_declaration *note 8.5.2::
123219 extended_return_object_declaration *note 6.5::
123220 formal_complete_type_declaration *note 12.5::
123221 formal_incomplete_type_declaration *note 12.5::
123222 formal_package_declaration *note 12.7::
123223 full_type_declaration *note 3.2.1::
123224 incomplete_type_declaration *note 3.10.1::
123225 iterator_specification *note 5.5.2::
123226 loop_parameter_specification *note 5.5::
123227 object_renaming_declaration *note 8.5.1::
123228 package_body_stub *note 10.1.3::
123229 private_extension_declaration *note 7.3::
123230 private_type_declaration *note 7.3::
123231 protected_body *note 9.4::
123232 protected_body_stub *note 10.1.3::
123233 protected_type_declaration *note 9.4::
123234 single_protected_declaration *note 9.4::
123235 single_task_declaration *note 9.1::
123236 subtype_declaration *note 3.2.2::
123237 task_body *note 9.1::
123238 task_body_stub *note 10.1.3::
123239 task_type_declaration *note 9.1::
123240
123241 defining_identifier_list *note 3.3.1::
123242 component_declaration *note 3.8::
123243 discriminant_specification *note 3.7::
123244 exception_declaration *note 11.1::
123245 formal_object_declaration *note 12.4::
123246 number_declaration *note 3.3.2::
123247 object_declaration *note 3.3.1::
123248 parameter_specification *note 6.1::
123249
123250 defining_operator_symbol *note 6.1::
123251 defining_designator *note 6.1::
123252
123253 defining_program_unit_name *note 6.1::
123254 defining_designator *note 6.1::
123255 generic_instantiation *note 12.3::
123256 generic_renaming_declaration *note 8.5.5::
123257 package_body *note 7.2::
123258 package_renaming_declaration *note 8.5.3::
123259 package_specification *note 7.1::
123260 procedure_specification *note 6.1::
123261
123262 delay_alternative *note 9.7.1::
123263 select_alternative *note 9.7.1::
123264 timed_entry_call *note 9.7.2::
123265
123266 delay_relative_statement *note 9.6::
123267 delay_statement *note 9.6::
123268
123269 delay_statement *note 9.6::
123270 delay_alternative *note 9.7.1::
123271 simple_statement *note 5.1::
123272 triggering_statement *note 9.7.4::
123273
123274 delay_until_statement *note 9.6::
123275 delay_statement *note 9.6::
123276
123277 delta_constraint *note J.3::
123278 scalar_constraint *note 3.2.2::
123279
123280 derived_type_definition *note 3.4::
123281 type_definition *note 3.2.1::
123282
123283 designator *note 6.1::
123284 subprogram_body *note 6.3::
123285
123286 digit *note 2.4.1::
123287 extended_digit *note 2.4.2::
123288 numeral *note 2.4.1::
123289
123290 digits_constraint *note 3.5.9::
123291 scalar_constraint *note 3.2.2::
123292
123293 direct_name *note 4.1::
123294 accept_statement *note 9.5.2::
123295 at_clause *note J.7::
123296 local_name *note 13.1::
123297 name *note 4.1::
123298 statement_identifier *note 5.1::
123299 variant_part *note 3.8.1::
123300
123301 discrete_choice *note 3.8.1::
123302 discrete_choice_list *note 3.8.1::
123303
123304 discrete_choice_list *note 3.8.1::
123305 array_component_association *note 4.3.3::
123306 case_expression_alternative *note 4.5.7::
123307 case_statement_alternative *note 5.4::
123308 variant *note 3.8.1::
123309
123310 discrete_range *note 3.6.1::
123311 index_constraint *note 3.6.1::
123312 slice *note 4.1.2::
123313
123314 discrete_subtype_definition *note 3.6::
123315 constrained_array_definition *note 3.6::
123316 entry_declaration *note 9.5.2::
123317 entry_index_specification *note 9.5.2::
123318 loop_parameter_specification *note 5.5::
123319
123320 discriminant_association *note 3.7.1::
123321 discriminant_constraint *note 3.7.1::
123322
123323 discriminant_constraint *note 3.7.1::
123324 composite_constraint *note 3.2.2::
123325
123326 discriminant_part *note 3.7::
123327 formal_complete_type_declaration *note 12.5::
123328 formal_incomplete_type_declaration *note 12.5::
123329 incomplete_type_declaration *note 3.10.1::
123330 private_extension_declaration *note 7.3::
123331 private_type_declaration *note 7.3::
123332
123333 discriminant_specification *note 3.7::
123334 known_discriminant_part *note 3.7::
123335
123336 entry_barrier *note 9.5.2::
123337 entry_body *note 9.5.2::
123338
123339 entry_body *note 9.5.2::
123340 protected_operation_item *note 9.4::
123341
123342 entry_body_formal_part *note 9.5.2::
123343 entry_body *note 9.5.2::
123344
123345 entry_call_alternative *note 9.7.2::
123346 conditional_entry_call *note 9.7.3::
123347 timed_entry_call *note 9.7.2::
123348
123349 entry_call_statement *note 9.5.3::
123350 procedure_or_entry_call *note 9.7.2::
123351 simple_statement *note 5.1::
123352
123353 entry_declaration *note 9.5.2::
123354 protected_operation_declaration *note 9.4::
123355 task_item *note 9.1::
123356
123357 entry_index *note 9.5.2::
123358 accept_statement *note 9.5.2::
123359
123360 entry_index_specification *note 9.5.2::
123361 entry_body_formal_part *note 9.5.2::
123362
123363 enumeration_aggregate *note 13.4::
123364 enumeration_representation_clause *note 13.4::
123365
123366 enumeration_literal_specification *note 3.5.1::
123367 enumeration_type_definition *note 3.5.1::
123368
123369 enumeration_representation_clause *note 13.4::
123370 aspect_clause *note 13.1::
123371
123372 enumeration_type_definition *note 3.5.1::
123373 type_definition *note 3.2.1::
123374
123375 exception_choice *note 11.2::
123376 exception_handler *note 11.2::
123377
123378 exception_declaration *note 11.1::
123379 basic_declaration *note 3.1::
123380
123381 exception_handler *note 11.2::
123382 handled_sequence_of_statements *note 11.2::
123383
123384 exception_renaming_declaration *note 8.5.2::
123385 renaming_declaration *note 8.5::
123386
123387 exit_statement *note 5.7::
123388 simple_statement *note 5.1::
123389
123390 explicit_actual_parameter *note 6.4::
123391 parameter_association *note 6.4::
123392
123393 explicit_dereference *note 4.1::
123394 name *note 4.1::
123395
123396 explicit_generic_actual_parameter *note 12.3::
123397 generic_association *note 12.3::
123398
123399 exponent *note 2.4.1::
123400 based_literal *note 2.4.2::
123401 decimal_literal *note 2.4.1::
123402
123403 expression *note 4.4::
123404 ancestor_part *note 4.3.2::
123405 array_component_association *note 4.3.3::
123406 aspect_definition *note 13.1.1::
123407 assignment_statement *note 5.2::
123408 at_clause *note J.7::
123409 attribute_definition_clause *note 13.3::
123410 attribute_designator *note 4.1.4::
123411 case_expression *note 4.5.7::
123412 case_expression_alternative *note 4.5.7::
123413 case_statement *note 5.4::
123414 condition *note 4.5.7::
123415 decimal_fixed_point_definition *note 3.5.9::
123416 default_expression *note 3.7::
123417 delay_relative_statement *note 9.6::
123418 delay_until_statement *note 9.6::
123419 delta_constraint *note J.3::
123420 digits_constraint *note 3.5.9::
123421 discriminant_association *note 3.7.1::
123422 entry_index *note 9.5.2::
123423 explicit_actual_parameter *note 6.4::
123424 explicit_generic_actual_parameter *note 12.3::
123425 expression_function_declaration *note 6.8::
123426 extended_return_object_declaration *note 6.5::
123427 floating_point_definition *note 3.5.7::
123428 if_expression *note 4.5.7::
123429 indexed_component *note 4.1.1::
123430 mod_clause *note J.8::
123431 modular_type_definition *note 3.5.4::
123432 number_declaration *note 3.3.2::
123433 object_declaration *note 3.3.1::
123434 ordinary_fixed_point_definition *note 3.5.9::
123435 position *note 13.5.1::
123436 positional_array_aggregate *note 4.3.3::
123437 pragma_argument_association *note 2.8::
123438 predicate *note 4.5.8::
123439 primary *note 4.4::
123440 qualified_expression *note 4.7::
123441 raise_statement *note 11.3::
123442 range_attribute_designator *note 4.1.4::
123443 record_component_association *note 4.3.1::
123444 restriction_parameter_argument *note 13.12::
123445 simple_return_statement *note 6.5::
123446 type_conversion *note 4.6::
123447
123448 expression_function_declaration *note 6.8::
123449 basic_declaration *note 3.1::
123450
123451 extended_digit *note 2.4.2::
123452 based_numeral *note 2.4.2::
123453
123454 extended_return_object_declaration *note 6.5::
123455 extended_return_statement *note 6.5::
123456
123457 extended_return_statement *note 6.5::
123458 compound_statement *note 5.1::
123459
123460 extension_aggregate *note 4.3.2::
123461 aggregate *note 4.3::
123462
123463 factor *note 4.4::
123464 term *note 4.4::
123465
123466 first_bit *note 13.5.1::
123467 component_clause *note 13.5.1::
123468
123469 fixed_point_definition *note 3.5.9::
123470 real_type_definition *note 3.5.6::
123471
123472 floating_point_definition *note 3.5.7::
123473 real_type_definition *note 3.5.6::
123474
123475 formal_abstract_subprogram_declaration *note 12.6::
123476 formal_subprogram_declaration *note 12.6::
123477
123478 formal_access_type_definition *note 12.5.4::
123479 formal_type_definition *note 12.5::
123480
123481 formal_array_type_definition *note 12.5.3::
123482 formal_type_definition *note 12.5::
123483
123484 formal_complete_type_declaration *note 12.5::
123485 formal_type_declaration *note 12.5::
123486
123487 formal_concrete_subprogram_declaration *note 12.6::
123488 formal_subprogram_declaration *note 12.6::
123489
123490 formal_decimal_fixed_point_definition *note 12.5.2::
123491 formal_type_definition *note 12.5::
123492
123493 formal_derived_type_definition *note 12.5.1::
123494 formal_type_definition *note 12.5::
123495
123496 formal_discrete_type_definition *note 12.5.2::
123497 formal_type_definition *note 12.5::
123498
123499 formal_floating_point_definition *note 12.5.2::
123500 formal_type_definition *note 12.5::
123501
123502 formal_incomplete_type_declaration *note 12.5::
123503 formal_type_declaration *note 12.5::
123504
123505 formal_interface_type_definition *note 12.5.5::
123506 formal_type_definition *note 12.5::
123507
123508 formal_modular_type_definition *note 12.5.2::
123509 formal_type_definition *note 12.5::
123510
123511 formal_object_declaration *note 12.4::
123512 generic_formal_parameter_declaration *note 12.1::
123513
123514 formal_ordinary_fixed_point_definition *note 12.5.2::
123515 formal_type_definition *note 12.5::
123516
123517 formal_package_actual_part *note 12.7::
123518 formal_package_declaration *note 12.7::
123519
123520 formal_package_association *note 12.7::
123521 formal_package_actual_part *note 12.7::
123522
123523 formal_package_declaration *note 12.7::
123524 generic_formal_parameter_declaration *note 12.1::
123525
123526 formal_part *note 6.1::
123527 parameter_and_result_profile *note 6.1::
123528 parameter_profile *note 6.1::
123529
123530 formal_private_type_definition *note 12.5.1::
123531 formal_type_definition *note 12.5::
123532
123533 formal_signed_integer_type_definition *note 12.5.2::
123534 formal_type_definition *note 12.5::
123535
123536 formal_subprogram_declaration *note 12.6::
123537 generic_formal_parameter_declaration *note 12.1::
123538
123539 formal_type_declaration *note 12.5::
123540 generic_formal_parameter_declaration *note 12.1::
123541
123542 formal_type_definition *note 12.5::
123543 formal_complete_type_declaration *note 12.5::
123544
123545 full_type_declaration *note 3.2.1::
123546 type_declaration *note 3.2.1::
123547
123548 function_call *note 6.4::
123549 name *note 4.1::
123550
123551 function_specification *note 6.1::
123552 expression_function_declaration *note 6.8::
123553 subprogram_specification *note 6.1::
123554
123555 general_access_modifier *note 3.10::
123556 access_to_object_definition *note 3.10::
123557
123558 generalized_indexing *note 4.1.6::
123559 name *note 4.1::
123560
123561 generalized_reference *note 4.1.5::
123562 name *note 4.1::
123563
123564 generic_actual_part *note 12.3::
123565 formal_package_actual_part *note 12.7::
123566 generic_instantiation *note 12.3::
123567
123568 generic_association *note 12.3::
123569 formal_package_association *note 12.7::
123570 generic_actual_part *note 12.3::
123571
123572 generic_declaration *note 12.1::
123573 basic_declaration *note 3.1::
123574 library_unit_declaration *note 10.1.1::
123575
123576 generic_formal_parameter_declaration *note 12.1::
123577 generic_formal_part *note 12.1::
123578
123579 generic_formal_part *note 12.1::
123580 generic_package_declaration *note 12.1::
123581 generic_subprogram_declaration *note 12.1::
123582
123583 generic_instantiation *note 12.3::
123584 basic_declaration *note 3.1::
123585 library_unit_declaration *note 10.1.1::
123586
123587 generic_package_declaration *note 12.1::
123588 generic_declaration *note 12.1::
123589
123590 generic_renaming_declaration *note 8.5.5::
123591 library_unit_renaming_declaration *note 10.1.1::
123592 renaming_declaration *note 8.5::
123593
123594 generic_subprogram_declaration *note 12.1::
123595 generic_declaration *note 12.1::
123596
123597 goto_statement *note 5.8::
123598 simple_statement *note 5.1::
123599
123600 graphic_character *note 2.1::
123601 character_literal *note 2.5::
123602 string_element *note 2.6::
123603
123604 guard *note 9.7.1::
123605 selective_accept *note 9.7.1::
123606
123607 handled_sequence_of_statements *note 11.2::
123608 accept_statement *note 9.5.2::
123609 block_statement *note 5.6::
123610 entry_body *note 9.5.2::
123611 extended_return_statement *note 6.5::
123612 package_body *note 7.2::
123613 subprogram_body *note 6.3::
123614 task_body *note 9.1::
123615
123616 identifier *note 2.3::
123617 accept_statement *note 9.5.2::
123618 aspect_definition *note 13.1.1::
123619 aspect_mark *note 13.1.1::
123620 attribute_designator *note 4.1.4::
123621 block_statement *note 5.6::
123622 defining_identifier *note 3.1::
123623 designator *note 6.1::
123624 direct_name *note 4.1::
123625 entry_body *note 9.5.2::
123626 loop_statement *note 5.5::
123627 package_body *note 7.2::
123628 package_specification *note 7.1::
123629 pragma *note 2.8::
123630 pragma_argument_association *note 2.8::
123631 protected_body *note 9.4::
123632 protected_definition *note 9.4::
123633 restriction *note 13.12::
123634 selector_name *note 4.1.3::
123635 task_body *note 9.1::
123636 task_definition *note 9.1::
123637
123638 identifier_extend *note 2.3::
123639 identifier *note 2.3::
123640
123641 identifier_start *note 2.3::
123642 identifier *note 2.3::
123643
123644 if_expression *note 4.5.7::
123645 conditional_expression *note 4.5.7::
123646
123647 if_statement *note 5.3::
123648 compound_statement *note 5.1::
123649
123650 implicit_dereference *note 4.1::
123651 prefix *note 4.1::
123652
123653 incomplete_type_declaration *note 3.10.1::
123654 type_declaration *note 3.2.1::
123655
123656 index_constraint *note 3.6.1::
123657 composite_constraint *note 3.2.2::
123658
123659 index_subtype_definition *note 3.6::
123660 unconstrained_array_definition *note 3.6::
123661
123662 indexed_component *note 4.1.1::
123663 name *note 4.1::
123664
123665 integer_type_definition *note 3.5.4::
123666 type_definition *note 3.2.1::
123667
123668 interface_list *note 3.9.4::
123669 derived_type_definition *note 3.4::
123670 formal_derived_type_definition *note 12.5.1::
123671 interface_type_definition *note 3.9.4::
123672 private_extension_declaration *note 7.3::
123673 protected_type_declaration *note 9.4::
123674 single_protected_declaration *note 9.4::
123675 single_task_declaration *note 9.1::
123676 task_type_declaration *note 9.1::
123677
123678 interface_type_definition *note 3.9.4::
123679 formal_interface_type_definition *note 12.5.5::
123680 type_definition *note 3.2.1::
123681
123682 iteration_scheme *note 5.5::
123683 loop_statement *note 5.5::
123684
123685 iterator_specification *note 5.5.2::
123686 iteration_scheme *note 5.5::
123687 quantified_expression *note 4.5.8::
123688
123689 known_discriminant_part *note 3.7::
123690 discriminant_part *note 3.7::
123691 full_type_declaration *note 3.2.1::
123692 protected_type_declaration *note 9.4::
123693 task_type_declaration *note 9.1::
123694
123695 label *note 5.1::
123696 sequence_of_statements *note 5.1::
123697 statement *note 5.1::
123698
123699 last_bit *note 13.5.1::
123700 component_clause *note 13.5.1::
123701
123702 letter_lowercase ...
123703 identifier_start *note 2.3::
123704
123705 letter_modifier ...
123706 identifier_start *note 2.3::
123707
123708 letter_other ...
123709 identifier_start *note 2.3::
123710
123711 letter_titlecase ...
123712 identifier_start *note 2.3::
123713
123714 letter_uppercase ...
123715 identifier_start *note 2.3::
123716
123717 library_item *note 10.1.1::
123718 compilation_unit *note 10.1.1::
123719
123720 library_unit_body *note 10.1.1::
123721 library_item *note 10.1.1::
123722
123723 library_unit_declaration *note 10.1.1::
123724 library_item *note 10.1.1::
123725
123726 library_unit_renaming_declaration *note 10.1.1::
123727 library_item *note 10.1.1::
123728
123729 limited_with_clause *note 10.1.2::
123730 with_clause *note 10.1.2::
123731
123732 local_name *note 13.1::
123733 attribute_definition_clause *note 13.3::
123734 component_clause *note 13.5.1::
123735 enumeration_representation_clause *note 13.4::
123736 record_representation_clause *note 13.5.1::
123737
123738 loop_parameter_specification *note 5.5::
123739 iteration_scheme *note 5.5::
123740 quantified_expression *note 4.5.8::
123741
123742 loop_statement *note 5.5::
123743 compound_statement *note 5.1::
123744
123745 mark_non_spacing ...
123746 identifier_extend *note 2.3::
123747
123748 mark_spacing_combining ...
123749 identifier_extend *note 2.3::
123750
123751 membership_choice *note 4.4::
123752 membership_choice_list *note 4.4::
123753
123754 membership_choice_list *note 4.4::
123755 relation *note 4.4::
123756
123757 mod_clause *note J.8::
123758 record_representation_clause *note 13.5.1::
123759
123760 mode *note 6.1::
123761 formal_object_declaration *note 12.4::
123762 parameter_specification *note 6.1::
123763
123764 modular_type_definition *note 3.5.4::
123765 integer_type_definition *note 3.5.4::
123766
123767 multiplying_operator *note 4.5::
123768 term *note 4.4::
123769
123770 name *note 4.1::
123771 abort_statement *note 9.8::
123772 aspect_definition *note 13.1.1::
123773 assignment_statement *note 5.2::
123774 attribute_definition_clause *note 13.3::
123775 default_name *note 12.6::
123776 entry_call_statement *note 9.5.3::
123777 exception_choice *note 11.2::
123778 exception_renaming_declaration *note 8.5.2::
123779 exit_statement *note 5.7::
123780 explicit_actual_parameter *note 6.4::
123781 explicit_dereference *note 4.1::
123782 explicit_generic_actual_parameter *note 12.3::
123783 formal_package_declaration *note 12.7::
123784 function_call *note 6.4::
123785 generalized_reference *note 4.1.5::
123786 generic_instantiation *note 12.3::
123787 generic_renaming_declaration *note 8.5.5::
123788 goto_statement *note 5.8::
123789 implicit_dereference *note 4.1::
123790 iterator_specification *note 5.5.2::
123791 limited_with_clause *note 10.1.2::
123792 local_name *note 13.1::
123793 nonlimited_with_clause *note 10.1.2::
123794 object_renaming_declaration *note 8.5.1::
123795 package_renaming_declaration *note 8.5.3::
123796 parent_unit_name *note 10.1.1::
123797 pragma_argument_association *note 2.8::
123798 prefix *note 4.1::
123799 primary *note 4.4::
123800 procedure_call_statement *note 6.4::
123801 raise_statement *note 11.3::
123802 requeue_statement *note 9.5.4::
123803 restriction_parameter_argument *note 13.12::
123804 storage_pool_indicator *note 13.11.3::
123805 subpool_specification *note 4.8::
123806 subprogram_renaming_declaration *note 8.5.4::
123807 subtype_mark *note 3.2.2::
123808 type_conversion *note 4.6::
123809 use_package_clause *note 8.4::
123810
123811 named_array_aggregate *note 4.3.3::
123812 array_aggregate *note 4.3.3::
123813
123814 nonlimited_with_clause *note 10.1.2::
123815 with_clause *note 10.1.2::
123816
123817 null_exclusion *note 3.10::
123818 access_definition *note 3.10::
123819 access_type_definition *note 3.10::
123820 discriminant_specification *note 3.7::
123821 formal_object_declaration *note 12.4::
123822 object_renaming_declaration *note 8.5.1::
123823 parameter_and_result_profile *note 6.1::
123824 parameter_specification *note 6.1::
123825 subtype_indication *note 3.2.2::
123826
123827 null_procedure_declaration *note 6.7::
123828 basic_declaration *note 3.1::
123829
123830 null_statement *note 5.1::
123831 simple_statement *note 5.1::
123832
123833 number_decimal ...
123834 identifier_extend *note 2.3::
123835
123836 number_declaration *note 3.3.2::
123837 basic_declaration *note 3.1::
123838
123839 number_letter ...
123840 identifier_start *note 2.3::
123841
123842 numeral *note 2.4.1::
123843 base *note 2.4.2::
123844 decimal_literal *note 2.4.1::
123845 exponent *note 2.4.1::
123846
123847 numeric_literal *note 2.4::
123848 primary *note 4.4::
123849
123850 object_declaration *note 3.3.1::
123851 basic_declaration *note 3.1::
123852
123853 object_renaming_declaration *note 8.5.1::
123854 renaming_declaration *note 8.5::
123855
123856 operator_symbol *note 6.1::
123857 defining_operator_symbol *note 6.1::
123858 designator *note 6.1::
123859 direct_name *note 4.1::
123860 selector_name *note 4.1.3::
123861
123862 ordinary_fixed_point_definition *note 3.5.9::
123863 fixed_point_definition *note 3.5.9::
123864
123865 overriding_indicator *note 8.3.1::
123866 abstract_subprogram_declaration *note 3.9.3::
123867 entry_declaration *note 9.5.2::
123868 expression_function_declaration *note 6.8::
123869 generic_instantiation *note 12.3::
123870 null_procedure_declaration *note 6.7::
123871 subprogram_body *note 6.3::
123872 subprogram_body_stub *note 10.1.3::
123873 subprogram_declaration *note 6.1::
123874 subprogram_renaming_declaration *note 8.5.4::
123875
123876 package_body *note 7.2::
123877 library_unit_body *note 10.1.1::
123878 proper_body *note 3.11::
123879
123880 package_body_stub *note 10.1.3::
123881 body_stub *note 10.1.3::
123882
123883 package_declaration *note 7.1::
123884 basic_declaration *note 3.1::
123885 library_unit_declaration *note 10.1.1::
123886
123887 package_renaming_declaration *note 8.5.3::
123888 library_unit_renaming_declaration *note 10.1.1::
123889 renaming_declaration *note 8.5::
123890
123891 package_specification *note 7.1::
123892 generic_package_declaration *note 12.1::
123893 package_declaration *note 7.1::
123894
123895 parameter_and_result_profile *note 6.1::
123896 access_definition *note 3.10::
123897 access_to_subprogram_definition *note 3.10::
123898 function_specification *note 6.1::
123899
123900 parameter_association *note 6.4::
123901 actual_parameter_part *note 6.4::
123902
123903 parameter_profile *note 6.1::
123904 accept_statement *note 9.5.2::
123905 access_definition *note 3.10::
123906 access_to_subprogram_definition *note 3.10::
123907 entry_body_formal_part *note 9.5.2::
123908 entry_declaration *note 9.5.2::
123909 procedure_specification *note 6.1::
123910
123911 parameter_specification *note 6.1::
123912 formal_part *note 6.1::
123913
123914 parent_unit_name *note 10.1.1::
123915 defining_program_unit_name *note 6.1::
123916 designator *note 6.1::
123917 package_body *note 7.2::
123918 package_specification *note 7.1::
123919 subunit *note 10.1.3::
123920
123921 position *note 13.5.1::
123922 component_clause *note 13.5.1::
123923
123924 positional_array_aggregate *note 4.3.3::
123925 array_aggregate *note 4.3.3::
123926
123927 pragma_argument_association *note 2.8::
123928 pragma *note 2.8::
123929
123930 predicate *note 4.5.8::
123931 quantified_expression *note 4.5.8::
123932
123933 prefix *note 4.1::
123934 attribute_reference *note 4.1.4::
123935 function_call *note 6.4::
123936 generalized_indexing *note 4.1.6::
123937 indexed_component *note 4.1.1::
123938 procedure_call_statement *note 6.4::
123939 range_attribute_reference *note 4.1.4::
123940 selected_component *note 4.1.3::
123941 slice *note 4.1.2::
123942
123943 primary *note 4.4::
123944 factor *note 4.4::
123945
123946 private_extension_declaration *note 7.3::
123947 type_declaration *note 3.2.1::
123948
123949 private_type_declaration *note 7.3::
123950 type_declaration *note 3.2.1::
123951
123952 procedure_call_statement *note 6.4::
123953 procedure_or_entry_call *note 9.7.2::
123954 simple_statement *note 5.1::
123955
123956 procedure_or_entry_call *note 9.7.2::
123957 entry_call_alternative *note 9.7.2::
123958 triggering_statement *note 9.7.4::
123959
123960 procedure_specification *note 6.1::
123961 null_procedure_declaration *note 6.7::
123962 subprogram_specification *note 6.1::
123963
123964 proper_body *note 3.11::
123965 body *note 3.11::
123966 subunit *note 10.1.3::
123967
123968 protected_body *note 9.4::
123969 proper_body *note 3.11::
123970
123971 protected_body_stub *note 10.1.3::
123972 body_stub *note 10.1.3::
123973
123974 protected_definition *note 9.4::
123975 protected_type_declaration *note 9.4::
123976 single_protected_declaration *note 9.4::
123977
123978 protected_element_declaration *note 9.4::
123979 protected_definition *note 9.4::
123980
123981 protected_operation_declaration *note 9.4::
123982 protected_definition *note 9.4::
123983 protected_element_declaration *note 9.4::
123984
123985 protected_operation_item *note 9.4::
123986 protected_body *note 9.4::
123987
123988 protected_type_declaration *note 9.4::
123989 full_type_declaration *note 3.2.1::
123990
123991 punctuation_connector ...
123992 identifier_extend *note 2.3::
123993
123994 qualified_expression *note 4.7::
123995 allocator *note 4.8::
123996 code_statement *note 13.8::
123997 name *note 4.1::
123998
123999 quantified_expression *note 4.5.8::
124000 primary *note 4.4::
124001
124002 quantifier *note 4.5.8::
124003 quantified_expression *note 4.5.8::
124004
124005 raise_statement *note 11.3::
124006 simple_statement *note 5.1::
124007
124008 range *note 3.5::
124009 discrete_choice *note 3.8.1::
124010 discrete_range *note 3.6.1::
124011 discrete_subtype_definition *note 3.6::
124012 membership_choice *note 4.4::
124013 range_constraint *note 3.5::
124014
124015 range_attribute_designator *note 4.1.4::
124016 range_attribute_reference *note 4.1.4::
124017
124018 range_attribute_reference *note 4.1.4::
124019 range *note 3.5::
124020
124021 range_constraint *note 3.5::
124022 delta_constraint *note J.3::
124023 digits_constraint *note 3.5.9::
124024 scalar_constraint *note 3.2.2::
124025
124026 real_range_specification *note 3.5.7::
124027 decimal_fixed_point_definition *note 3.5.9::
124028 floating_point_definition *note 3.5.7::
124029 ordinary_fixed_point_definition *note 3.5.9::
124030
124031 real_type_definition *note 3.5.6::
124032 type_definition *note 3.2.1::
124033
124034 record_aggregate *note 4.3.1::
124035 aggregate *note 4.3::
124036
124037 record_component_association *note 4.3.1::
124038 record_component_association_list *note 4.3.1::
124039
124040 record_component_association_list *note 4.3.1::
124041 extension_aggregate *note 4.3.2::
124042 record_aggregate *note 4.3.1::
124043
124044 record_definition *note 3.8::
124045 record_extension_part *note 3.9.1::
124046 record_type_definition *note 3.8::
124047
124048 record_extension_part *note 3.9.1::
124049 derived_type_definition *note 3.4::
124050
124051 record_representation_clause *note 13.5.1::
124052 aspect_clause *note 13.1::
124053
124054 record_type_definition *note 3.8::
124055 type_definition *note 3.2.1::
124056
124057 relation *note 4.4::
124058 expression *note 4.4::
124059
124060 relational_operator *note 4.5::
124061 choice_relation *note 4.4::
124062 relation *note 4.4::
124063
124064 renaming_declaration *note 8.5::
124065 basic_declaration *note 3.1::
124066
124067 requeue_statement *note 9.5.4::
124068 simple_statement *note 5.1::
124069
124070 restriction_parameter_argument *note 13.12::
124071 restriction *note 13.12::
124072
124073 return_subtype_indication *note 6.5::
124074 extended_return_object_declaration *note 6.5::
124075
124076 scalar_constraint *note 3.2.2::
124077 constraint *note 3.2.2::
124078
124079 select_alternative *note 9.7.1::
124080 selective_accept *note 9.7.1::
124081
124082 select_statement *note 9.7::
124083 compound_statement *note 5.1::
124084
124085 selected_component *note 4.1.3::
124086 name *note 4.1::
124087
124088 selective_accept *note 9.7.1::
124089 select_statement *note 9.7::
124090
124091 selector_name *note 4.1.3::
124092 component_choice_list *note 4.3.1::
124093 discriminant_association *note 3.7.1::
124094 formal_package_association *note 12.7::
124095 generic_association *note 12.3::
124096 parameter_association *note 6.4::
124097 selected_component *note 4.1.3::
124098
124099 sequence_of_statements *note 5.1::
124100 abortable_part *note 9.7.4::
124101 accept_alternative *note 9.7.1::
124102 case_statement_alternative *note 5.4::
124103 conditional_entry_call *note 9.7.3::
124104 delay_alternative *note 9.7.1::
124105 entry_call_alternative *note 9.7.2::
124106 exception_handler *note 11.2::
124107 handled_sequence_of_statements *note 11.2::
124108 if_statement *note 5.3::
124109 loop_statement *note 5.5::
124110 selective_accept *note 9.7.1::
124111 triggering_alternative *note 9.7.4::
124112
124113 signed_integer_type_definition *note 3.5.4::
124114 integer_type_definition *note 3.5.4::
124115
124116 simple_expression *note 4.4::
124117 choice_relation *note 4.4::
124118 first_bit *note 13.5.1::
124119 last_bit *note 13.5.1::
124120 range *note 3.5::
124121 real_range_specification *note 3.5.7::
124122 relation *note 4.4::
124123 signed_integer_type_definition *note 3.5.4::
124124
124125 simple_return_statement *note 6.5::
124126 simple_statement *note 5.1::
124127
124128 simple_statement *note 5.1::
124129 statement *note 5.1::
124130
124131 single_protected_declaration *note 9.4::
124132 object_declaration *note 3.3.1::
124133
124134 single_task_declaration *note 9.1::
124135 object_declaration *note 3.3.1::
124136
124137 slice *note 4.1.2::
124138 name *note 4.1::
124139
124140 statement *note 5.1::
124141 sequence_of_statements *note 5.1::
124142
124143 statement_identifier *note 5.1::
124144 block_statement *note 5.6::
124145 label *note 5.1::
124146 loop_statement *note 5.5::
124147
124148 string_element *note 2.6::
124149 string_literal *note 2.6::
124150
124151 string_literal *note 2.6::
124152 operator_symbol *note 6.1::
124153 primary *note 4.4::
124154
124155 subpool_specification *note 4.8::
124156 allocator *note 4.8::
124157
124158 subprogram_body *note 6.3::
124159 library_unit_body *note 10.1.1::
124160 proper_body *note 3.11::
124161 protected_operation_item *note 9.4::
124162
124163 subprogram_body_stub *note 10.1.3::
124164 body_stub *note 10.1.3::
124165
124166 subprogram_declaration *note 6.1::
124167 basic_declaration *note 3.1::
124168 library_unit_declaration *note 10.1.1::
124169 protected_operation_declaration *note 9.4::
124170 protected_operation_item *note 9.4::
124171
124172 subprogram_default *note 12.6::
124173 formal_abstract_subprogram_declaration *note 12.6::
124174 formal_concrete_subprogram_declaration *note 12.6::
124175
124176 subprogram_renaming_declaration *note 8.5.4::
124177 library_unit_renaming_declaration *note 10.1.1::
124178 renaming_declaration *note 8.5::
124179
124180 subprogram_specification *note 6.1::
124181 abstract_subprogram_declaration *note 3.9.3::
124182 formal_abstract_subprogram_declaration *note 12.6::
124183 formal_concrete_subprogram_declaration *note 12.6::
124184 generic_subprogram_declaration *note 12.1::
124185 subprogram_body *note 6.3::
124186 subprogram_body_stub *note 10.1.3::
124187 subprogram_declaration *note 6.1::
124188 subprogram_renaming_declaration *note 8.5.4::
124189
124190 subtype_declaration *note 3.2.2::
124191 basic_declaration *note 3.1::
124192
124193 subtype_indication *note 3.2.2::
124194 access_to_object_definition *note 3.10::
124195 allocator *note 4.8::
124196 component_definition *note 3.6::
124197 derived_type_definition *note 3.4::
124198 discrete_choice *note 3.8.1::
124199 discrete_range *note 3.6.1::
124200 discrete_subtype_definition *note 3.6::
124201 iterator_specification *note 5.5.2::
124202 object_declaration *note 3.3.1::
124203 private_extension_declaration *note 7.3::
124204 return_subtype_indication *note 6.5::
124205 subtype_declaration *note 3.2.2::
124206
124207 subtype_mark *note 3.2.2::
124208 access_definition *note 3.10::
124209 ancestor_part *note 4.3.2::
124210 discriminant_specification *note 3.7::
124211 explicit_generic_actual_parameter *note 12.3::
124212 formal_derived_type_definition *note 12.5.1::
124213 formal_object_declaration *note 12.4::
124214 index_subtype_definition *note 3.6::
124215 interface_list *note 3.9.4::
124216 membership_choice *note 4.4::
124217 object_renaming_declaration *note 8.5.1::
124218 parameter_and_result_profile *note 6.1::
124219 parameter_specification *note 6.1::
124220 qualified_expression *note 4.7::
124221 subtype_indication *note 3.2.2::
124222 type_conversion *note 4.6::
124223 use_type_clause *note 8.4::
124224
124225 subunit *note 10.1.3::
124226 compilation_unit *note 10.1.1::
124227
124228 task_body *note 9.1::
124229 proper_body *note 3.11::
124230
124231 task_body_stub *note 10.1.3::
124232 body_stub *note 10.1.3::
124233
124234 task_definition *note 9.1::
124235 single_task_declaration *note 9.1::
124236 task_type_declaration *note 9.1::
124237
124238 task_item *note 9.1::
124239 task_definition *note 9.1::
124240
124241 task_type_declaration *note 9.1::
124242 full_type_declaration *note 3.2.1::
124243
124244 term *note 4.4::
124245 simple_expression *note 4.4::
124246
124247 terminate_alternative *note 9.7.1::
124248 select_alternative *note 9.7.1::
124249
124250 timed_entry_call *note 9.7.2::
124251 select_statement *note 9.7::
124252
124253 triggering_alternative *note 9.7.4::
124254 asynchronous_select *note 9.7.4::
124255
124256 triggering_statement *note 9.7.4::
124257 triggering_alternative *note 9.7.4::
124258
124259 type_conversion *note 4.6::
124260 name *note 4.1::
124261
124262 type_declaration *note 3.2.1::
124263 basic_declaration *note 3.1::
124264
124265 type_definition *note 3.2.1::
124266 full_type_declaration *note 3.2.1::
124267
124268 unary_adding_operator *note 4.5::
124269 simple_expression *note 4.4::
124270
124271 unconstrained_array_definition *note 3.6::
124272 array_type_definition *note 3.6::
124273
124274 underline ...
124275 based_numeral *note 2.4.2::
124276 numeral *note 2.4.1::
124277
124278 unknown_discriminant_part *note 3.7::
124279 discriminant_part *note 3.7::
124280
124281 use_clause *note 8.4::
124282 basic_declarative_item *note 3.11::
124283 context_item *note 10.1.2::
124284 generic_formal_part *note 12.1::
124285
124286 use_package_clause *note 8.4::
124287 use_clause *note 8.4::
124288
124289 use_type_clause *note 8.4::
124290 use_clause *note 8.4::
124291
124292 variant *note 3.8.1::
124293 variant_part *note 3.8.1::
124294
124295 variant_part *note 3.8.1::
124296 component_list *note 3.8::
124297
124298 with_clause *note 10.1.2::
124299 context_item *note 10.1.2::
124300
124301 \1f
124302 File: aarm2012.info, Node: Annex Q, Next: Index, Prev: Annex P, Up: Top
124303
124304 Annex Q Language-Defined Entities
124305 *********************************
124306
124307 1/2
124308 {AI95-00440-01AI95-00440-01} This annex lists the language-defined
124309 entities of the language. A list of language-defined library units can
124310 be found in *note Annex A::, "*note Annex A:: Predefined Language
124311 Environment".
124312
124313 * Menu:
124314
124315 * Q.1 :: Language-Defined Packages
124316 * Q.2 :: Language-Defined Types and Subtypes
124317 * Q.3 :: Language-Defined Subprograms
124318 * Q.4 :: Language-Defined Exceptions
124319 * Q.5 :: Language-Defined Objects
124320
124321 \1f
124322 File: aarm2012.info, Node: Q.1, Next: Q.2, Up: Annex Q
124323
124324 Q.1 Language-Defined Packages
124325 =============================
124326
124327 1/3
124328 {AI95-00440-01AI95-00440-01} {AI05-0299-1AI05-0299-1} This subclause
124329 lists all language-defined packages.
124330
124331
124332
124333 Ada *note A.2(2): 5900.
124334
124335 Address_To_Access_Conversions
124336 child of System *note 13.7.2(2): 5572.
124337
124338 Arithmetic
124339 child of Ada.Calendar *note 9.6.1(8/2): 4489.
124340
124341 ASCII
124342 in Standard *note A.1(36.3/2): 5887.
124343
124344 Assertions
124345 child of Ada *note 11.4.2(12/2): 4971.
124346
124347 Asynchronous_Task_Control
124348 child of Ada *note D.11(3/2): 8572.
124349
124350 Bounded
124351 child of Ada.Strings *note A.4.4(3): 6300.
124352
124353 Bounded_IO
124354 child of Ada.Text_IO *note A.10.11(3/2): 7030.
124355 child of Ada.Wide_Text_IO *note A.11(4/3): 7056.
124356 child of Ada.Wide_Wide_Text_IO *note A.11(4/3): 7057.
124357
124358 Bounded_Priority_Queues
124359 child of Ada.Containers *note A.18.31(2/3): 7916.
124360
124361 Bounded_Synchronized_Queues
124362 child of Ada.Containers *note A.18.29(2/3): 7901.
124363
124364 C
124365 child of Interfaces *note B.3(4): 7986.
124366
124367 Calendar
124368 child of Ada *note 9.6(10): 4458.
124369
124370 Characters
124371 child of Ada *note A.3.1(2): 5903.
124372
124373 COBOL
124374 child of Interfaces *note B.4(7): 8106.
124375
124376 Command_Line
124377 child of Ada *note A.15(3): 7127.
124378
124379 Complex_Arrays
124380 child of Ada.Numerics *note G.3.2(53/2): 9041.
124381
124382 Complex_Elementary_Functions
124383 child of Ada.Numerics *note G.1.2(9/1): 8915.
124384
124385 Complex_Text_IO
124386 child of Ada *note G.1.3(9.1/2): 8933.
124387
124388 Complex_Types
124389 child of Ada.Numerics *note G.1.1(25/1): 8887.
124390
124391 Complex_IO
124392 child of Ada.Text_IO *note G.1.3(3): 8923.
124393 child of Ada.Wide_Text_IO *note G.1.4(1): 8936.
124394 child of Ada.Wide_Wide_Text_IO *note G.1.5(1/2): 8938.
124395
124396 Constants
124397 child of Ada.Strings.Maps *note A.4.6(3/2): 6417.
124398
124399 Containers
124400 child of Ada *note A.18.1(3/2): 7225.
124401
124402 Conversions
124403 child of Ada.Characters *note A.3.4(2/2): 6178.
124404 child of Ada.Strings.UTF_Encoding *note A.4.11(15/3): 6547.
124405
124406 Decimal
124407 child of Ada *note F.2(2): 8829.
124408
124409 Decimal_Conversions
124410 in Interfaces.COBOL *note B.4(31): 8140.
124411
124412 Decimal_IO
124413 in Ada.Text_IO *note A.10.1(73): 6987.
124414
124415 Decimal_Output
124416 in Ada.Text_IO.Editing *note F.3.3(11): 8852.
124417
124418 Direct_IO
124419 child of Ada *note A.8.4(2): 6807.
124420
124421 Directories
124422 child of Ada *note A.16(3/2): 7137.
124423
124424 Discrete_Random
124425 child of Ada.Numerics *note A.5.2(17): 6635.
124426
124427 Dispatching
124428 child of Ada *note D.2.1(1.2/3): 8338.
124429
124430 Dispatching_Domains
124431 child of System.Multiprocessors *note D.16.1(3/3): 8671.
124432
124433 Doubly_Linked_Lists
124434 child of Ada.Containers *note A.18.3(5/3): 7337.
124435
124436 Dynamic_Priorities
124437 child of Ada *note D.5.1(3/2): 8443.
124438
124439 EDF
124440 child of Ada.Dispatching *note D.2.6(9/2): 8395.
124441 child of Ada.Synchronous_Task_Control *note D.10(5.2/3): 8560.
124442
124443 Editing
124444 child of Ada.Text_IO *note F.3.3(3): 8840.
124445 child of Ada.Wide_Text_IO *note F.3.4(1): 8860.
124446 child of Ada.Wide_Wide_Text_IO *note F.3.5(1/2): 8862.
124447
124448 Elementary_Functions
124449 child of Ada.Numerics *note A.5.1(9/1): 6614.
124450
124451 Enumeration_IO
124452 in Ada.Text_IO *note A.10.1(79): 6997.
124453
124454 Environment_Variables
124455 child of Ada *note A.17(3/2): 7205.
124456
124457 Exceptions
124458 child of Ada *note 11.4.1(2/2): 4927.
124459
124460 Execution_Time
124461 child of Ada *note D.14(3/2): 8585.
124462
124463 Finalization
124464 child of Ada *note 7.6(4/3): 3927.
124465
124466 Fixed
124467 child of Ada.Strings *note A.4.3(5): 6262.
124468
124469 Fixed_IO
124470 in Ada.Text_IO *note A.10.1(68): 6977.
124471
124472 Float_Random
124473 child of Ada.Numerics *note A.5.2(5): 6622.
124474
124475 Float_Text_IO
124476 child of Ada *note A.10.9(33): 7029.
124477
124478 Float_Wide_Text_IO
124479 child of Ada *note A.11(2/2): 7052.
124480
124481 Float_Wide_Wide_Text_IO
124482 child of Ada *note A.11(3/2): 7055.
124483
124484 Float_IO
124485 in Ada.Text_IO *note A.10.1(63): 6967.
124486
124487 Formatting
124488 child of Ada.Calendar *note 9.6.1(15/2): 4493.
124489
124490 Fortran
124491 child of Interfaces *note B.5(4): 8160.
124492
124493 Generic_Complex_Arrays
124494 child of Ada.Numerics *note G.3.2(2/2): 9005.
124495
124496 Generic_Complex_Elementary_Functions
124497 child of Ada.Numerics *note G.1.2(2/2): 8894.
124498
124499 Generic_Complex_Types
124500 child of Ada.Numerics *note G.1.1(2/1): 8866.
124501
124502 Generic_Dispatching_Constructor
124503 child of Ada.Tags *note 3.9(18.2/3): 2254.
124504
124505 Generic_Elementary_Functions
124506 child of Ada.Numerics *note A.5.1(3): 6585.
124507
124508 Generic_Bounded_Length
124509 in Ada.Strings.Bounded *note A.4.4(4): 6301.
124510
124511 Generic_Keys
124512 in Ada.Containers.Hashed_Sets *note A.18.8(50/2): 7614.
124513 in Ada.Containers.Ordered_Sets *note A.18.9(62/2): 7695.
124514
124515 Generic_Real_Arrays
124516 child of Ada.Numerics *note G.3.1(2/2): 8988.
124517
124518 Generic_Sorting
124519 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(47/2): 7384.
124520 in Ada.Containers.Vectors *note A.18.2(75/2): 7309.
124521
124522 Group_Budgets
124523 child of Ada.Execution_Time *note D.14.2(3/3): 8619.
124524
124525 Handling
124526 child of Ada.Characters *note A.3.2(2/2): 5907.
124527 child of Ada.Wide_Characters *note A.3.5(3/3): 6198.
124528 child of Ada.Wide_Wide_Characters *note A.3.6(1/3): 6220.
124529
124530 Hashed_Maps
124531 child of Ada.Containers *note A.18.5(2/3): 7428.
124532
124533 Hashed_Sets
124534 child of Ada.Containers *note A.18.8(2/3): 7567.
124535
124536 Hierarchical_File_Names
124537 child of Ada.Directories *note A.16.1(3/3): 7191.
124538
124539 Indefinite_Doubly_Linked_Lists
124540 child of Ada.Containers *note A.18.12(2/3): 7811.
124541
124542 Indefinite_Hashed_Maps
124543 child of Ada.Containers *note A.18.13(2/3): 7813.
124544
124545 Indefinite_Hashed_Sets
124546 child of Ada.Containers *note A.18.15(2/3): 7817.
124547
124548 Indefinite_Holders
124549 child of Ada.Containers *note A.18.18(5/3): 7824.
124550
124551 Indefinite_Multiway_Trees
124552 child of Ada.Containers *note A.18.17(2/3): 7821.
124553
124554 Indefinite_Ordered_Maps
124555 child of Ada.Containers *note A.18.14(2/3): 7815.
124556
124557 Indefinite_Ordered_Sets
124558 child of Ada.Containers *note A.18.16(2/3): 7819.
124559
124560 Indefinite_Vectors
124561 child of Ada.Containers *note A.18.11(2/3): 7809.
124562
124563 Information
124564 child of Ada.Directories *note A.16(124/2): 7187.
124565
124566 Integer_Text_IO
124567 child of Ada *note A.10.8(21): 7027.
124568
124569 Integer_Wide_Text_IO
124570 child of Ada *note A.11(2/2): 7051.
124571
124572 Integer_Wide_Wide_Text_IO
124573 child of Ada *note A.11(3/2): 7054.
124574
124575 Integer_IO
124576 in Ada.Text_IO *note A.10.1(52): 6949.
124577
124578 Interfaces *note B.2(3): 7980.
124579
124580 Interrupts
124581 child of Ada *note C.3.2(2/3): 8224.
124582 child of Ada.Execution_Time *note D.14.3(3/3): 8646.
124583
124584 IO_Exceptions
124585 child of Ada *note A.13(3): 7114.
124586
124587 Iterator_Interfaces
124588 child of Ada *note 5.5.1(2/3): 3439.
124589
124590 Latin_1
124591 child of Ada.Characters *note A.3.3(3): 5947.
124592
124593 List_Iterator_Interfaces
124594 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9.2/3): 7343.
124595
124596 Locales
124597 child of Ada *note A.19(3/3): 7925.
124598
124599 Machine_Code
124600 child of System *note 13.8(7): 5581.
124601
124602 Map_Iterator_Interfaces
124603 in Ada.Containers.Hashed_Maps *note A.18.5(6.2/3): 7434.
124604 in Ada.Containers.Ordered_Maps *note A.18.6(7.2/3): 7490.
124605
124606 Maps
124607 child of Ada.Strings *note A.4.2(3/2): 6237.
124608
124609 Modular_IO
124610 in Ada.Text_IO *note A.10.1(57): 6958.
124611
124612 Multiprocessors
124613 child of System *note D.16(3/3): 8663.
124614
124615 Multiway_Trees
124616 child of Ada.Containers *note A.18.10(7/3): 7733.
124617
124618 Names
124619 child of Ada.Interrupts *note C.3.2(12): 8235.
124620
124621 Non_Preemptive
124622 child of Ada.Dispatching *note D.2.4(2.2/3): 8377.
124623
124624 Numerics
124625 child of Ada *note A.5(3/2): 6579.
124626
124627 Ordered_Maps
124628 child of Ada.Containers *note A.18.6(2/3): 7483.
124629
124630 Ordered_Sets
124631 child of Ada.Containers *note A.18.9(2/3): 7642.
124632
124633 Pointers
124634 child of Interfaces.C *note B.3.2(4): 8076.
124635
124636 Real_Arrays
124637 child of Ada.Numerics *note G.3.1(31/2): 9000.
124638
124639 Real_Time
124640 child of Ada *note D.8(3): 8521.
124641
124642 Round_Robin
124643 child of Ada.Dispatching *note D.2.5(4/2): 8386.
124644
124645 RPC
124646 child of System *note E.5(3): 8808.
124647
124648 Sequential_IO
124649 child of Ada *note A.8.1(2): 6781.
124650
124651 Set_Iterator_Interfaces
124652 in Ada.Containers.Hashed_Sets *note A.18.8(6.2/3): 7573.
124653 in Ada.Containers.Ordered_Sets *note A.18.9(7.2/3): 7649.
124654
124655 Single_Precision_Complex_Types
124656 in Interfaces.Fortran *note B.5(8): 8165.
124657
124658 Standard *note A.1(4): 5878.
124659
124660 Storage_Elements
124661 child of System *note 13.7.1(2/2): 5559.
124662
124663 Storage_IO
124664 child of Ada *note A.9(3): 6839.
124665
124666 Storage_Pools
124667 child of System *note 13.11(5): 5622.
124668
124669 Stream_IO
124670 child of Ada.Streams *note A.12.1(3/3): 7065.
124671
124672 Streams
124673 child of Ada *note 13.13.1(2): 5776.
124674
124675 Strings
124676 child of Ada *note A.4.1(3): 6223.
124677 child of Ada.Strings.UTF_Encoding *note A.4.11(22/3): 6553.
124678 child of Interfaces.C *note B.3.1(3): 8052.
124679
124680 Subpools
124681 child of System.Storage_Pools *note 13.11.4(3/3): 5694.
124682
124683 Synchronized_Queue_Interfaces
124684 child of Ada.Containers *note A.18.27(3/3): 7886.
124685
124686 Synchronous_Barriers
124687 child of Ada *note D.10.1(3/3): 8567.
124688
124689 Synchronous_Task_Control
124690 child of Ada *note D.10(3/2): 8554.
124691
124692 System *note 13.7(3/2): 5530.
124693
124694 Tags
124695 child of Ada *note 3.9(6/2): 2229.
124696
124697 Task_Attributes
124698 child of Ada *note C.7.2(2): 8293.
124699
124700 Task_Identification
124701 child of Ada *note C.7.1(2/2): 8272.
124702
124703 Task_Termination
124704 child of Ada *note C.7.3(2/2): 8305.
124705
124706 Text_Streams
124707 child of Ada.Text_IO *note A.12.2(3): 7104.
124708 child of Ada.Wide_Text_IO *note A.12.3(3): 7107.
124709 child of Ada.Wide_Wide_Text_IO *note A.12.4(3/2): 7110.
124710
124711 Text_IO
124712 child of Ada *note A.10.1(2): 6860.
124713
124714 Time_Zones
124715 child of Ada.Calendar *note 9.6.1(2/2): 4485.
124716
124717 Timers
124718 child of Ada.Execution_Time *note D.14.1(3/2): 8603.
124719
124720 Timing_Events
124721 child of Ada.Real_Time *note D.15(3/2): 8650.
124722
124723 Tree_Iterator_Interfaces
124724 in Ada.Containers.Multiway_Trees *note A.18.10(13/3): 7739.
124725
124726 Unbounded
124727 child of Ada.Strings *note A.4.5(3): 6362.
124728
124729 Unbounded_IO
124730 child of Ada.Text_IO *note A.10.12(3/2): 7040.
124731 child of Ada.Wide_Text_IO *note A.11(5/3): 7058.
124732 child of Ada.Wide_Wide_Text_IO *note A.11(5/3): 7059.
124733
124734 Unbounded_Priority_Queues
124735 child of Ada.Containers *note A.18.30(2/3): 7908.
124736
124737 Unbounded_Synchronized_Queues
124738 child of Ada.Containers *note A.18.28(2/3): 7894.
124739
124740 UTF_Encoding
124741 child of Ada.Strings *note A.4.11(3/3): 6536.
124742
124743 Vector_Iterator_Interfaces
124744 in Ada.Containers.Vectors *note A.18.2(11.2/3): 7244.
124745
124746 Vectors
124747 child of Ada.Containers *note A.18.2(6/3): 7236.
124748
124749 Wide_Bounded
124750 child of Ada.Strings *note A.4.7(1/3): 6434.
124751
124752 Wide_Constants
124753 child of Ada.Strings.Wide_Maps *note A.4.7(1/3): 6448, *note
124754 A.4.8(28/2): 6512.
124755
124756 Wide_Equal_Case_Insensitive
124757 child of Ada.Strings *note A.4.7(1/3): 6440.
124758
124759 Wide_Fixed
124760 child of Ada.Strings *note A.4.7(1/3): 6433.
124761
124762 Wide_Hash
124763 child of Ada.Strings *note A.4.7(1/3): 6436.
124764
124765 Wide_Hash_Case_Insensitive
124766 child of Ada.Strings *note A.4.7(1/3): 6444.
124767
124768 Wide_Maps
124769 child of Ada.Strings *note A.4.7(3): 6449.
124770
124771 Wide_Text_IO
124772 child of Ada *note A.11(2/2): 7050.
124773
124774 Wide_Unbounded
124775 child of Ada.Strings *note A.4.7(1/3): 6435.
124776
124777 Wide_Characters
124778 child of Ada *note A.3.1(4/2): 5904.
124779
124780 Wide_Strings
124781 child of Ada.Strings.UTF_Encoding *note A.4.11(30/3): 6560.
124782
124783 Wide_Wide_Constants
124784 child of Ada.Strings.Wide_Wide_Maps *note A.4.8(1/3): 6490.
124785
124786 Wide_Wide_Equal_Case_Insensitive
124787 child of Ada.Strings *note A.4.8(1/3): 6482.
124788
124789 Wide_Wide_Hash
124790 child of Ada.Strings *note A.4.8(1/3): 6478.
124791
124792 Wide_Wide_Hash_Case_Insensitive
124793 child of Ada.Strings *note A.4.8(1/3): 6486.
124794
124795 Wide_Wide_Text_IO
124796 child of Ada *note A.11(3/2): 7053.
124797
124798 Wide_Wide_Bounded
124799 child of Ada.Strings *note A.4.8(1/3): 6476.
124800
124801 Wide_Wide_Characters
124802 child of Ada *note A.3.1(6/2): 5905.
124803
124804 Wide_Wide_Fixed
124805 child of Ada.Strings *note A.4.8(1/3): 6475.
124806
124807 Wide_Wide_Maps
124808 child of Ada.Strings *note A.4.8(3/2): 6491.
124809
124810 Wide_Wide_Strings
124811 child of Ada.Strings.UTF_Encoding *note A.4.11(38/3): 6567.
124812
124813 Wide_Wide_Unbounded
124814 child of Ada.Strings *note A.4.8(1/3): 6477.
124815
124816 \1f
124817 File: aarm2012.info, Node: Q.2, Next: Q.3, Prev: Q.1, Up: Annex Q
124818
124819 Q.2 Language-Defined Types and Subtypes
124820 =======================================
124821
124822 1/3
124823 {AI95-00440-01AI95-00440-01} {AI05-0299-1AI05-0299-1} This subclause
124824 lists all language-defined types and subtypes.
124825
124826
124827
124828 Address
124829 in System *note 13.7(12): 5542.
124830
124831 Alignment
124832 in Ada.Strings *note A.4.1(6): 6231.
124833
124834 Alphanumeric
124835 in Interfaces.COBOL *note B.4(16/3): 8118.
124836
124837 Any_Priority subtype of Integer
124838 in System *note 13.7(16): 5552.
124839
124840 Attribute_Handle
124841 in Ada.Task_Attributes *note C.7.2(3): 8294.
124842
124843 Barrier_Limit subtype of Positive
124844 in Ada.Synchronous_Barriers *note D.10.1(4/3): 8568.
124845
124846 Binary
124847 in Interfaces.COBOL *note B.4(10): 8109.
124848
124849 Binary_Format
124850 in Interfaces.COBOL *note B.4(24): 8130.
124851
124852 Bit_Order
124853 in System *note 13.7(15/2): 5548.
124854
124855 Boolean
124856 in Standard *note A.1(5): 5879.
124857
124858 Bounded_String
124859 in Ada.Strings.Bounded *note A.4.4(6): 6303.
124860
124861 Buffer_Type subtype of Storage_Array
124862 in Ada.Storage_IO *note A.9(4): 6841.
124863
124864 Byte
124865 in Interfaces.COBOL *note B.4(29/3): 8137.
124866
124867 Byte_Array
124868 in Interfaces.COBOL *note B.4(29/3): 8138.
124869
124870 C_float
124871 in Interfaces.C *note B.3(15): 8002.
124872
124873 Cause_Of_Termination
124874 in Ada.Task_Termination *note C.7.3(3/2): 8306.
124875
124876 char
124877 in Interfaces.C *note B.3(19): 8005.
124878
124879 char16_array
124880 in Interfaces.C *note B.3(39.5/3): 8029.
124881
124882 char16_t
124883 in Interfaces.C *note B.3(39.2/2): 8025.
124884
124885 char32_array
124886 in Interfaces.C *note B.3(39.14/3): 8039.
124887
124888 char32_t
124889 in Interfaces.C *note B.3(39.11/2): 8035.
124890
124891 char_array
124892 in Interfaces.C *note B.3(23/3): 8009.
124893
124894 char_array_access
124895 in Interfaces.C.Strings *note B.3.1(4): 8053.
124896
124897 Character
124898 in Standard *note A.1(35/3): 5884.
124899
124900 Character_Mapping
124901 in Ada.Strings.Maps *note A.4.2(20/2): 6251.
124902
124903 Character_Mapping_Function
124904 in Ada.Strings.Maps *note A.4.2(25): 6257.
124905
124906 Character_Range
124907 in Ada.Strings.Maps *note A.4.2(6): 6240.
124908
124909 Character_Ranges
124910 in Ada.Strings.Maps *note A.4.2(7): 6241.
124911
124912 Character_Sequence subtype of String
124913 in Ada.Strings.Maps *note A.4.2(16): 6247.
124914
124915 Character_Set
124916 in Ada.Strings.Maps *note A.4.2(4/2): 6238.
124917 in Interfaces.Fortran *note B.5(11): 8170.
124918
124919 chars_ptr
124920 in Interfaces.C.Strings *note B.3.1(5/2): 8054.
124921
124922 chars_ptr_array
124923 in Interfaces.C.Strings *note B.3.1(6/2): 8055.
124924
124925 COBOL_Character
124926 in Interfaces.COBOL *note B.4(13): 8115.
124927
124928 Complex
124929 in Ada.Numerics.Generic_Complex_Types *note G.1.1(3): 8867.
124930 in Interfaces.Fortran *note B.5(9): 8166.
124931
124932 Complex_Matrix
124933 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(4/2): 9007.
124934
124935 Complex_Vector
124936 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(4/2): 9006.
124937
124938 Constant_Reference_Type
124939 in Ada.Containers.Indefinite_Holders *note A.18.18(16/3): 7834.
124940 in Ada.Containers.Multiway_Trees *note A.18.10(28/3): 7753.
124941
124942 Controlled
124943 in Ada.Finalization *note 7.6(5/2): 3928.
124944
124945 Count
124946 in Ada.Direct_IO *note A.8.4(4): 6810.
124947 in Ada.Streams.Stream_IO *note A.12.1(7): 7069.
124948 in Ada.Text_IO *note A.10.1(5): 6863.
124949
124950 Count_Type
124951 in Ada.Containers *note A.18.1(5/2): 7227.
124952
124953 Country_Code
124954 in Ada.Locales *note A.19(4/3): 7927.
124955
124956 CPU subtype of CPU_Range
124957 in System.Multiprocessors *note D.16(4/3): 8666.
124958
124959 CPU_Range
124960 in System.Multiprocessors *note D.16(4/3): 8664.
124961
124962 CPU_Time
124963 in Ada.Execution_Time *note D.14(4/2): 8586.
124964
124965 Cursor
124966 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(7/2): 7339.
124967 in Ada.Containers.Hashed_Maps *note A.18.5(4/2): 7430.
124968 in Ada.Containers.Hashed_Sets *note A.18.8(4/2): 7569.
124969 in Ada.Containers.Multiway_Trees *note A.18.10(9/3): 7735.
124970 in Ada.Containers.Ordered_Maps *note A.18.6(5/2): 7486.
124971 in Ada.Containers.Ordered_Sets *note A.18.9(5/2): 7645.
124972 in Ada.Containers.Vectors *note A.18.2(9/2): 7240.
124973
124974 Day_Count
124975 in Ada.Calendar.Arithmetic *note 9.6.1(10/2): 4490.
124976
124977 Day_Duration subtype of Duration
124978 in Ada.Calendar *note 9.6(11/2): 4463.
124979
124980 Day_Name
124981 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4494.
124982
124983 Day_Number subtype of Integer
124984 in Ada.Calendar *note 9.6(11/2): 4462.
124985
124986 Deadline subtype of Time
124987 in Ada.Dispatching.EDF *note D.2.6(9/2): 8396.
124988
124989 Decimal_Element
124990 in Interfaces.COBOL *note B.4(12/3): 8113.
124991
124992 Direction
124993 in Ada.Strings *note A.4.1(6): 6234.
124994
124995 Directory_Entry_Type
124996 in Ada.Directories *note A.16(29/2): 7161.
124997
124998 Dispatching_Domain
124999 in System.Multiprocessors.Dispatching_Domains *note D.16.1(5/3):
125000 8673.
125001
125002 Display_Format
125003 in Interfaces.COBOL *note B.4(22): 8124.
125004
125005 double
125006 in Interfaces.C *note B.3(16): 8003.
125007
125008 Double_Precision
125009 in Interfaces.Fortran *note B.5(6): 8163.
125010
125011 Duration
125012 in Standard *note A.1(43): 5892.
125013
125014 Encoding_Scheme
125015 in Ada.Strings.UTF_Encoding *note A.4.11(4/3): 6537.
125016
125017 Exception_Id
125018 in Ada.Exceptions *note 11.4.1(2/2): 4928.
125019
125020 Exception_Occurrence
125021 in Ada.Exceptions *note 11.4.1(3/2): 4933.
125022
125023 Exception_Occurrence_Access
125024 in Ada.Exceptions *note 11.4.1(3/2): 4934.
125025
125026 Exit_Status
125027 in Ada.Command_Line *note A.15(7): 7131.
125028
125029 Extended_Index subtype of Index_Type'Base
125030 in Ada.Containers.Vectors *note A.18.2(7/2): 7237.
125031
125032 Field subtype of Integer
125033 in Ada.Text_IO *note A.10.1(6): 6866.
125034
125035 File_Access
125036 in Ada.Text_IO *note A.10.1(18): 6888.
125037
125038 File_Kind
125039 in Ada.Directories *note A.16(22/2): 7155.
125040
125041 File_Mode
125042 in Ada.Direct_IO *note A.8.4(4): 6809.
125043 in Ada.Sequential_IO *note A.8.1(4): 6783.
125044 in Ada.Streams.Stream_IO *note A.12.1(6): 7068.
125045 in Ada.Text_IO *note A.10.1(4): 6862.
125046
125047 File_Size
125048 in Ada.Directories *note A.16(23/2): 7156.
125049
125050 File_Type
125051 in Ada.Direct_IO *note A.8.4(3): 6808.
125052 in Ada.Sequential_IO *note A.8.1(3): 6782.
125053 in Ada.Streams.Stream_IO *note A.12.1(5): 7067.
125054 in Ada.Text_IO *note A.10.1(3): 6861.
125055
125056 Filter_Type
125057 in Ada.Directories *note A.16(30/2): 7162.
125058
125059 Float
125060 in Standard *note A.1(21): 5883.
125061
125062 Floating
125063 in Interfaces.COBOL *note B.4(9): 8107.
125064
125065 Fortran_Character
125066 in Interfaces.Fortran *note B.5(12/3): 8171.
125067
125068 Fortran_Integer
125069 in Interfaces.Fortran *note B.5(5): 8161.
125070
125071 Forward_Iterator
125072 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3440.
125073
125074 Generator
125075 in Ada.Numerics.Discrete_Random *note A.5.2(19): 6636.
125076 in Ada.Numerics.Float_Random *note A.5.2(7): 6623.
125077
125078 Group_Budget
125079 in Ada.Execution_Time.Group_Budgets *note D.14.2(4/3): 8620.
125080
125081 Group_Budget_Handler
125082 in Ada.Execution_Time.Group_Budgets *note D.14.2(5/2): 8621.
125083
125084 Hash_Type
125085 in Ada.Containers *note A.18.1(4/2): 7226.
125086
125087 Holder
125088 in Ada.Containers.Indefinite_Holders *note A.18.18(6/3): 7825.
125089
125090 Hour_Number subtype of Natural
125091 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4503.
125092
125093 Imaginary
125094 in Ada.Numerics.Generic_Complex_Types *note G.1.1(4/2): 8868.
125095
125096 Imaginary subtype of Imaginary
125097 in Interfaces.Fortran *note B.5(10): 8167.
125098
125099 int
125100 in Interfaces.C *note B.3(7): 7991.
125101
125102 Integer
125103 in Standard *note A.1(12): 5880.
125104
125105 Integer_Address
125106 in System.Storage_Elements *note 13.7.1(10/3): 5565.
125107
125108 Interrupt_Id
125109 in Ada.Interrupts *note C.3.2(2/3): 8225.
125110
125111 Interrupt_Priority subtype of Any_Priority
125112 in System *note 13.7(16): 5554.
125113
125114 ISO_646 subtype of Character
125115 in Ada.Characters.Handling *note A.3.2(9): 5930.
125116
125117 Language_Code
125118 in Ada.Locales *note A.19(4/3): 7926.
125119
125120 Leap_Seconds_Count subtype of Integer
125121 in Ada.Calendar.Arithmetic *note 9.6.1(11/2): 4491.
125122
125123 Length_Range subtype of Natural
125124 in Ada.Strings.Bounded *note A.4.4(8): 6305.
125125
125126 Limited_Controlled
125127 in Ada.Finalization *note 7.6(7/2): 3932.
125128
125129 List
125130 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(6/3): 7338.
125131
125132 Logical
125133 in Interfaces.Fortran *note B.5(7): 8164.
125134
125135 long
125136 in Interfaces.C *note B.3(7): 7993.
125137
125138 Long_Binary
125139 in Interfaces.COBOL *note B.4(10): 8110.
125140
125141 long_double
125142 in Interfaces.C *note B.3(17): 8004.
125143
125144 Long_Floating
125145 in Interfaces.COBOL *note B.4(9): 8108.
125146
125147 Map
125148 in Ada.Containers.Hashed_Maps *note A.18.5(3/3): 7429.
125149 in Ada.Containers.Ordered_Maps *note A.18.6(4/3): 7485.
125150
125151 Membership
125152 in Ada.Strings *note A.4.1(6): 6233.
125153
125154 Minute_Number subtype of Natural
125155 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4504.
125156
125157 Month_Number subtype of Integer
125158 in Ada.Calendar *note 9.6(11/2): 4461.
125159
125160 Name
125161 in System *note 13.7(4): 5531.
125162
125163 Name_Case_Kind
125164 in Ada.Directories *note A.16(20.1/3): 7153.
125165
125166 Natural subtype of Integer
125167 in Standard *note A.1(13): 5881.
125168
125169 Number_Base subtype of Integer
125170 in Ada.Text_IO *note A.10.1(6): 6867.
125171
125172 Numeric
125173 in Interfaces.COBOL *note B.4(20/3): 8123.
125174
125175 Packed_Decimal
125176 in Interfaces.COBOL *note B.4(12/3): 8114.
125177
125178 Packed_Format
125179 in Interfaces.COBOL *note B.4(26): 8134.
125180
125181 Parameterless_Handler
125182 in Ada.Interrupts *note C.3.2(2/3): 8226.
125183
125184 Params_Stream_Type
125185 in System.RPC *note E.5(6): 8811.
125186
125187 Partition_Id
125188 in System.RPC *note E.5(4): 8809.
125189
125190 Picture
125191 in Ada.Text_IO.Editing *note F.3.3(4): 8841.
125192
125193 plain_char
125194 in Interfaces.C *note B.3(11): 7999.
125195
125196 Pointer
125197 in Interfaces.C.Pointers *note B.3.2(5): 8077.
125198
125199 Positive subtype of Integer
125200 in Standard *note A.1(13): 5882.
125201
125202 Positive_Count subtype of Count
125203 in Ada.Direct_IO *note A.8.4(4): 6811.
125204 in Ada.Streams.Stream_IO *note A.12.1(7): 7070.
125205 in Ada.Text_IO *note A.10.1(5): 6864.
125206
125207 Priority subtype of Any_Priority
125208 in System *note 13.7(16): 5553.
125209
125210 ptrdiff_t
125211 in Interfaces.C *note B.3(12): 8000.
125212
125213 Queue
125214 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(4/3): 7917.
125215 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(4/3):
125216 7902.
125217 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(4/3):
125218 7887.
125219 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(4/3):
125220 7909.
125221 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(4/3):
125222 7895.
125223
125224 Real
125225 in Interfaces.Fortran *note B.5(6): 8162.
125226
125227 Real_Matrix
125228 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(4/2): 8990.
125229
125230 Real_Vector
125231 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(4/2): 8989.
125232
125233 Reference_Type
125234 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.2/3): 7351.
125235 in Ada.Containers.Hashed_Maps *note A.18.5(17.2/3): 7445.
125236 in Ada.Containers.Hashed_Sets *note A.18.8(58.1/3): 7623.
125237 in Ada.Containers.Indefinite_Holders *note A.18.18(17/3): 7835.
125238 in Ada.Containers.Multiway_Trees *note A.18.10(29/3): 7754.
125239 in Ada.Containers.Ordered_Maps *note A.18.6(16.2/3): 7499.
125240 in Ada.Containers.Ordered_Sets *note A.18.9(73.1/3): 7707.
125241 in Ada.Containers.Vectors *note A.18.2(34.2/3): 7263.
125242
125243 Reversible_Iterator
125244 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3443.
125245
125246 Root_Storage_Pool
125247 in System.Storage_Pools *note 13.11(6/2): 5623.
125248
125249 Root_Storage_Pool_With_Subpools
125250 in System.Storage_Pools.Subpools *note 13.11.4(4/3): 5695.
125251
125252 Root_Stream_Type
125253 in Ada.Streams *note 13.13.1(3/2): 5778.
125254
125255 Root_Subpool
125256 in System.Storage_Pools.Subpools *note 13.11.4(5/3): 5696.
125257
125258 RPC_Receiver
125259 in System.RPC *note E.5(11): 8816.
125260
125261 Search_Type
125262 in Ada.Directories *note A.16(31/2): 7163.
125263
125264 Second_Duration subtype of Day_Duration
125265 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4506.
125266
125267 Second_Number subtype of Natural
125268 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4505.
125269
125270 Seconds_Count
125271 in Ada.Real_Time *note D.8(15): 8540.
125272
125273 Set
125274 in Ada.Containers.Hashed_Sets *note A.18.8(3/3): 7568.
125275 in Ada.Containers.Ordered_Sets *note A.18.9(4/3): 7644.
125276
125277 short
125278 in Interfaces.C *note B.3(7): 7992.
125279
125280 signed_char
125281 in Interfaces.C *note B.3(8): 7994.
125282
125283 size_t
125284 in Interfaces.C *note B.3(13): 8001.
125285
125286 State
125287 in Ada.Numerics.Discrete_Random *note A.5.2(23): 6640.
125288 in Ada.Numerics.Float_Random *note A.5.2(11): 6628.
125289
125290 Storage_Array
125291 in System.Storage_Elements *note 13.7.1(5): 5563.
125292
125293 Storage_Count subtype of Storage_Offset
125294 in System.Storage_Elements *note 13.7.1(4): 5561.
125295
125296 Storage_Element
125297 in System.Storage_Elements *note 13.7.1(5): 5562.
125298
125299 Storage_Offset
125300 in System.Storage_Elements *note 13.7.1(3): 5560.
125301
125302 Stream_Access
125303 in Ada.Streams.Stream_IO *note A.12.1(4): 7066.
125304 in Ada.Text_IO.Text_Streams *note A.12.2(3): 7105.
125305 in Ada.Wide_Text_IO.Text_Streams *note A.12.3(3): 7108.
125306 in Ada.Wide_Wide_Text_IO.Text_Streams *note A.12.4(3/2): 7111.
125307
125308 Stream_Element
125309 in Ada.Streams *note 13.13.1(4/1): 5779.
125310
125311 Stream_Element_Array
125312 in Ada.Streams *note 13.13.1(4/1): 5782.
125313
125314 Stream_Element_Count subtype of Stream_Element_Offset
125315 in Ada.Streams *note 13.13.1(4/1): 5781.
125316
125317 Stream_Element_Offset
125318 in Ada.Streams *note 13.13.1(4/1): 5780.
125319
125320 String
125321 in Standard *note A.1(37/3): 5889.
125322
125323 String_Access
125324 in Ada.Strings.Unbounded *note A.4.5(7): 6366.
125325
125326 Subpool_Handle
125327 in System.Storage_Pools.Subpools *note 13.11.4(6/3): 5697.
125328
125329 Suspension_Object
125330 in Ada.Synchronous_Task_Control *note D.10(4): 8555.
125331
125332 Synchronous_Barrier
125333 in Ada.Synchronous_Barriers *note D.10.1(5/3): 8569.
125334
125335 Tag
125336 in Ada.Tags *note 3.9(6/2): 2230.
125337
125338 Tag_Array
125339 in Ada.Tags *note 3.9(7.3/2): 2240.
125340
125341 Task_Array
125342 in Ada.Execution_Time.Group_Budgets *note D.14.2(6/2): 8622.
125343
125344 Task_Id
125345 in Ada.Task_Identification *note C.7.1(2/2): 8273.
125346
125347 Termination_Handler
125348 in Ada.Task_Termination *note C.7.3(4/2): 8307.
125349
125350 Time
125351 in Ada.Calendar *note 9.6(10): 4459.
125352 in Ada.Real_Time *note D.8(4): 8522.
125353
125354 Time_Offset
125355 in Ada.Calendar.Time_Zones *note 9.6.1(4/2): 4486.
125356
125357 Time_Span
125358 in Ada.Real_Time *note D.8(5): 8526.
125359
125360 Timer
125361 in Ada.Execution_Time.Timers *note D.14.1(4/2): 8604.
125362
125363 Timer_Handler
125364 in Ada.Execution_Time.Timers *note D.14.1(5/2): 8605.
125365
125366 Timing_Event
125367 in Ada.Real_Time.Timing_Events *note D.15(4/2): 8651.
125368
125369 Timing_Event_Handler
125370 in Ada.Real_Time.Timing_Events *note D.15(4/2): 8652.
125371
125372 Tree
125373 in Ada.Containers.Multiway_Trees *note A.18.10(8/3): 7734.
125374
125375 Trim_End
125376 in Ada.Strings *note A.4.1(6): 6235.
125377
125378 Truncation
125379 in Ada.Strings *note A.4.1(6): 6232.
125380
125381 Type_Set
125382 in Ada.Text_IO *note A.10.1(7): 6868.
125383
125384 Unbounded_String
125385 in Ada.Strings.Unbounded *note A.4.5(4/2): 6363.
125386
125387 Uniformly_Distributed subtype of Float
125388 in Ada.Numerics.Float_Random *note A.5.2(8): 6624.
125389
125390 unsigned
125391 in Interfaces.C *note B.3(9): 7995.
125392
125393 unsigned_char
125394 in Interfaces.C *note B.3(10): 7998.
125395
125396 unsigned_long
125397 in Interfaces.C *note B.3(9): 7997.
125398
125399 unsigned_short
125400 in Interfaces.C *note B.3(9): 7996.
125401
125402 UTF_16_Wide_String subtype of Wide_String
125403 in Ada.Strings.UTF_Encoding *note A.4.11(7/3): 6540.
125404
125405 UTF_8_String subtype of String
125406 in Ada.Strings.UTF_Encoding *note A.4.11(6/3): 6539.
125407
125408 UTF_String subtype of String
125409 in Ada.Strings.UTF_Encoding *note A.4.11(5/3): 6538.
125410
125411 Vector
125412 in Ada.Containers.Vectors *note A.18.2(8/3): 7239.
125413
125414 wchar_array
125415 in Interfaces.C *note B.3(33/3): 8019.
125416
125417 wchar_t
125418 in Interfaces.C *note B.3(30/1): 8015.
125419
125420 Wide_Character
125421 in Standard *note A.1(36.1/3): 5885.
125422
125423 Wide_Character_Mapping
125424 in Ada.Strings.Wide_Maps *note A.4.7(20/2): 6463.
125425
125426 Wide_Character_Mapping_Function
125427 in Ada.Strings.Wide_Maps *note A.4.7(26): 6469.
125428
125429 Wide_Character_Range
125430 in Ada.Strings.Wide_Maps *note A.4.7(6): 6452.
125431
125432 Wide_Character_Ranges
125433 in Ada.Strings.Wide_Maps *note A.4.7(7): 6453.
125434
125435 Wide_Character_Sequence subtype of Wide_String
125436 in Ada.Strings.Wide_Maps *note A.4.7(16): 6459.
125437
125438 Wide_Character_Set
125439 in Ada.Strings.Wide_Maps *note A.4.7(4/2): 6450.
125440
125441 Wide_String
125442 in Standard *note A.1(41/3): 5890.
125443
125444 Wide_Wide_Character
125445 in Standard *note A.1(36.2/3): 5886.
125446
125447 Wide_Wide_Character_Mapping
125448 in Ada.Strings.Wide_Wide_Maps *note A.4.8(20/2): 6505.
125449
125450 Wide_Wide_Character_Mapping_Function
125451 in Ada.Strings.Wide_Wide_Maps *note A.4.8(26/2): 6511.
125452
125453 Wide_Wide_Character_Range
125454 in Ada.Strings.Wide_Wide_Maps *note A.4.8(6/2): 6494.
125455
125456 Wide_Wide_Character_Ranges
125457 in Ada.Strings.Wide_Wide_Maps *note A.4.8(7/2): 6495.
125458
125459 Wide_Wide_Character_Sequence subtype of Wide_Wide_String
125460 in Ada.Strings.Wide_Wide_Maps *note A.4.8(16/2): 6501.
125461
125462 Wide_Wide_Character_Set
125463 in Ada.Strings.Wide_Wide_Maps *note A.4.8(4/2): 6492.
125464
125465 Wide_Wide_String
125466 in Standard *note A.1(42.1/3): 5891.
125467
125468 Year_Number subtype of Integer
125469 in Ada.Calendar *note 9.6(11/2): 4460.
125470
125471 \1f
125472 File: aarm2012.info, Node: Q.3, Next: Q.4, Prev: Q.2, Up: Annex Q
125473
125474 Q.3 Language-Defined Subprograms
125475 ================================
125476
125477 1/3
125478 {AI95-00440-01AI95-00440-01} {AI05-0299-1AI05-0299-1} This subclause
125479 lists all language-defined subprograms.
125480
125481
125482
125483 Abort_Task in Ada.Task_Identification *note C.7.1(3/3): 8278.
125484
125485 Activation_Is_Complete
125486 in Ada.Task_Identification *note C.7.1(4/3): 8281.
125487
125488 Actual_Quantum
125489 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8390.
125490
125491 Ada.Unchecked_Deallocate_Subpool
125492 child of Ada *note 13.11.5(3/3): 5725.
125493
125494 Add
125495 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8630.
125496
125497 Add_Task
125498 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8624.
125499
125500 Adjust in Ada.Finalization *note 7.6(6/2): 3930.
125501
125502 Allocate
125503 in System.Storage_Pools *note 13.11(7): 5624.
125504 in System.Storage_Pools.Subpools *note 13.11.4(14/3): 5704.
125505
125506 Allocate_From_Subpool
125507 in System.Storage_Pools.Subpools *note 13.11.4(11/3): 5701.
125508
125509 Ancestor_Find
125510 in Ada.Containers.Multiway_Trees *note A.18.10(40/3): 7765.
125511
125512 Append
125513 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(23/2): 7361.
125514 in Ada.Containers.Vectors *note A.18.2(46/2): 7281, *note
125515 A.18.2(47/2): 7282.
125516 in Ada.Strings.Bounded *note A.4.4(13): 6310, *note A.4.4(14):
125517 6311, *note A.4.4(15): 6312, *note A.4.4(16): 6313, *note A.4.4(17):
125518 6314, *note A.4.4(18): 6315, *note A.4.4(19): 6316, *note A.4.4(20):
125519 6317.
125520 in Ada.Strings.Unbounded *note A.4.5(12): 6372, *note A.4.5(13):
125521 6373, *note A.4.5(14): 6374.
125522
125523 Append_Child
125524 in Ada.Containers.Multiway_Trees *note A.18.10(52/3): 7777.
125525
125526 Arccos
125527 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125528 G.1.2(5): 8904.
125529 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6600.
125530
125531 Arccosh
125532 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125533 G.1.2(7): 8912.
125534 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6611.
125535
125536 Arccot
125537 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125538 G.1.2(5): 8906.
125539 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6605.
125540
125541 Arccoth
125542 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125543 G.1.2(7): 8914.
125544 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6613.
125545
125546 Arcsin
125547 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125548 G.1.2(5): 8903.
125549 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6599.
125550
125551 Arcsinh
125552 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125553 G.1.2(7): 8911.
125554 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6610.
125555
125556 Arctan
125557 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125558 G.1.2(5): 8905.
125559 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6602.
125560
125561 Arctanh
125562 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125563 G.1.2(7): 8913.
125564 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6612.
125565
125566 Argument
125567 in Ada.Command_Line *note A.15(5): 7129.
125568 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(10/2): 9016,
125569 *note G.3.2(31/2): 9028.
125570 in Ada.Numerics.Generic_Complex_Types *note G.1.1(10): 8881.
125571
125572 Argument_Count in Ada.Command_Line *note A.15(4): 7128.
125573
125574 Assert in Ada.Assertions *note 11.4.2(14/2): 4974.
125575
125576 Assign
125577 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.5/3): 7354.
125578 in Ada.Containers.Hashed_Maps *note A.18.5(17.7/3): 7450.
125579 in Ada.Containers.Hashed_Sets *note A.18.8(17.3/3): 7585.
125580 in Ada.Containers.Indefinite_Holders *note A.18.18(20/3): 7838.
125581 in Ada.Containers.Multiway_Trees *note A.18.10(32/3): 7757.
125582 in Ada.Containers.Ordered_Maps *note A.18.6(16.7/3): 7504.
125583 in Ada.Containers.Ordered_Sets *note A.18.9(16.3/3): 7659.
125584 in Ada.Containers.Vectors *note A.18.2(34.7/3): 7268.
125585
125586 Assign_Task
125587 in System.Multiprocessors.Dispatching_Domains *note D.16.1(11/3):
125588 8679.
125589
125590 Attach_Handler in Ada.Interrupts *note C.3.2(7): 8230.
125591
125592 Base_Name in Ada.Directories *note A.16(19/2): 7151.
125593
125594 Blank_When_Zero
125595 in Ada.Text_IO.Editing *note F.3.3(7): 8845.
125596
125597 Bounded_Slice in Ada.Strings.Bounded *note A.4.4(28.1/2): 6321, *note
125598 A.4.4(28.2/2): 6322.
125599
125600 Budget_Has_Expired
125601 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8631.
125602
125603 Budget_Remaining
125604 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8632.
125605
125606 Cancel_Handler
125607 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8635.
125608 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8610.
125609 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8656.
125610
125611 Capacity
125612 in Ada.Containers.Hashed_Maps *note A.18.5(8/2): 7435.
125613 in Ada.Containers.Hashed_Sets *note A.18.8(10/2): 7576.
125614 in Ada.Containers.Vectors *note A.18.2(19/2): 7247.
125615
125616 Ceiling
125617 in Ada.Containers.Ordered_Maps *note A.18.6(41/2): 7530.
125618 in Ada.Containers.Ordered_Sets *note A.18.9(51/2): 7691, *note
125619 A.18.9(71/2): 7704.
125620
125621 Character_Set_Version
125622 in Ada.Wide_Characters.Handling *note A.3.5(4/3): 6199.
125623
125624 Child_Count
125625 in Ada.Containers.Multiway_Trees *note A.18.10(46/3): 7771.
125626
125627 Child_Depth
125628 in Ada.Containers.Multiway_Trees *note A.18.10(47/3): 7772.
125629
125630 Clear
125631 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(13/2): 7346.
125632 in Ada.Containers.Hashed_Maps *note A.18.5(12/2): 7439.
125633 in Ada.Containers.Hashed_Sets *note A.18.8(14/2): 7580.
125634 in Ada.Containers.Indefinite_Holders *note A.18.18(11/3): 7829.
125635 in Ada.Containers.Multiway_Trees *note A.18.10(23/3): 7748.
125636 in Ada.Containers.Ordered_Maps *note A.18.6(11/2): 7493.
125637 in Ada.Containers.Ordered_Sets *note A.18.9(13/2): 7654.
125638 in Ada.Containers.Vectors *note A.18.2(24/2): 7252.
125639 in Ada.Environment_Variables *note A.17(7/2): 7211.
125640
125641 Clock
125642 in Ada.Calendar *note 9.6(12): 4464.
125643 in Ada.Execution_Time *note D.14(5/2): 8591.
125644 in Ada.Execution_Time.Interrupts *note D.14.3(3/3): 8647.
125645 in Ada.Real_Time *note D.8(6): 8532.
125646
125647 Clock_For_Interrupts
125648 in Ada.Execution_Time *note D.14(9.3/3): 8596.
125649
125650 Close
125651 in Ada.Direct_IO *note A.8.4(8): 6814.
125652 in Ada.Sequential_IO *note A.8.1(8): 6786.
125653 in Ada.Streams.Stream_IO *note A.12.1(10): 7073.
125654 in Ada.Text_IO *note A.10.1(11): 6871.
125655
125656 Col in Ada.Text_IO *note A.10.1(37): 6924.
125657
125658 Command_Name in Ada.Command_Line *note A.15(6): 7130.
125659
125660 Compose
125661 in Ada.Directories *note A.16(20/2): 7152.
125662 in Ada.Directories.Hierarchical_File_Names *note A.16.1(14/3):
125663 7202.
125664
125665 Compose_From_Cartesian
125666 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(9/2): 9012,
125667 *note G.3.2(29/2): 9026.
125668 in Ada.Numerics.Generic_Complex_Types *note G.1.1(8): 8879.
125669
125670 Compose_From_Polar
125671 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(11/2): 9018,
125672 *note G.3.2(32/2): 9031.
125673 in Ada.Numerics.Generic_Complex_Types *note G.1.1(11): 8884.
125674
125675 Conjugate
125676 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(13/2): 9019,
125677 *note G.3.2(34/2): 9032.
125678 in Ada.Numerics.Generic_Complex_Types *note G.1.1(12): 8885, *note
125679 G.1.1(15): 8886.
125680
125681 Constant_Reference
125682 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.3/3): 7352.
125683 in Ada.Containers.Hashed_Maps *note A.18.5(17.3/3): 7446, *note
125684 A.18.5(17.5/3): 7448.
125685 in Ada.Containers.Hashed_Sets *note A.18.8(17.2/3): 7584, *note
125686 A.18.8(58.3/3): 7625.
125687 in Ada.Containers.Indefinite_Holders *note A.18.18(18/3): 7836.
125688 in Ada.Containers.Multiway_Trees *note A.18.10(30/3): 7755.
125689 in Ada.Containers.Ordered_Maps *note A.18.6(16.3/3): 7500, *note
125690 A.18.6(16.5/3): 7502.
125691 in Ada.Containers.Ordered_Sets *note A.18.9(16.2/3): 7658, *note
125692 A.18.9(73.3/3): 7709.
125693 in Ada.Containers.Vectors *note A.18.2(34.3/3): 7264, *note
125694 A.18.2(34.5/3): 7266.
125695
125696 Containing_Directory
125697 in Ada.Directories *note A.16(17/2): 7149.
125698 in Ada.Directories.Hierarchical_File_Names *note A.16.1(11/3):
125699 7199.
125700
125701 Contains
125702 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(43/2): 7381.
125703 in Ada.Containers.Hashed_Maps *note A.18.5(32/2): 7466.
125704 in Ada.Containers.Hashed_Sets *note A.18.8(44/2): 7609, *note
125705 A.18.8(57/2): 7621.
125706 in Ada.Containers.Multiway_Trees *note A.18.10(41/3): 7766.
125707 in Ada.Containers.Ordered_Maps *note A.18.6(42/2): 7531.
125708 in Ada.Containers.Ordered_Sets *note A.18.9(52/2): 7692, *note
125709 A.18.9(72/2): 7705.
125710 in Ada.Containers.Vectors *note A.18.2(71/2): 7306.
125711
125712 Continue
125713 in Ada.Asynchronous_Task_Control *note D.11(3/2): 8574.
125714
125715 Convert
125716 in Ada.Strings.UTF_Encoding.Conversions *note A.4.11(16/3): 6548,
125717 *note A.4.11(17/3): 6549, *note A.4.11(18/3): 6550, *note A.4.11(19/3):
125718 6551, *note A.4.11(20/3): 6552.
125719
125720 Copy
125721 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.6/3): 7355.
125722 in Ada.Containers.Hashed_Maps *note A.18.5(17.8/3): 7451.
125723 in Ada.Containers.Hashed_Sets *note A.18.8(17.4/3): 7586.
125724 in Ada.Containers.Indefinite_Holders *note A.18.18(21/3): 7839,
125725 *note A.18.20(10/3): 7853, *note A.18.21(13/3): 7858, *note
125726 A.18.22(10/3): 7862, *note A.18.23(13/3): 7867, *note A.18.24(10/3):
125727 7871.
125728 in Ada.Containers.Multiway_Trees *note A.18.10(33/3): 7758.
125729 in Ada.Containers.Ordered_Maps *note A.18.6(16.8/3): 7505.
125730 in Ada.Containers.Ordered_Sets *note A.18.9(16.4/3): 7660.
125731 in Ada.Containers.Vectors *note A.18.2(34.8/3): 7269.
125732
125733 Copy_Array in Interfaces.C.Pointers *note B.3.2(15): 8085.
125734
125735 Copy_File in Ada.Directories *note A.16(13/2): 7146.
125736
125737 Copy_Subtree
125738 in Ada.Containers.Multiway_Trees *note A.18.10(54/3): 7779.
125739
125740 Copy_Terminated_Array
125741 in Interfaces.C.Pointers *note B.3.2(14): 8084.
125742
125743 Cos
125744 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125745 G.1.2(4): 8900.
125746 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6593.
125747
125748 Cosh
125749 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125750 G.1.2(6): 8908.
125751 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6607.
125752
125753 Cot
125754 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125755 G.1.2(4): 8902.
125756 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6597.
125757
125758 Coth
125759 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
125760 G.1.2(6): 8910.
125761 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6609.
125762
125763 Count
125764 in Ada.Strings.Bounded *note A.4.4(48): 6331, *note A.4.4(49):
125765 6332, *note A.4.4(50): 6333.
125766 in Ada.Strings.Fixed *note A.4.3(13): 6272, *note A.4.3(14): 6273,
125767 *note A.4.3(15): 6274.
125768 in Ada.Strings.Unbounded *note A.4.5(43): 6388, *note A.4.5(44):
125769 6389, *note A.4.5(45): 6390.
125770
125771 Country in Ada.Locales *note A.19(6/3): 7931.
125772
125773 Create
125774 in Ada.Direct_IO *note A.8.4(6): 6812.
125775 in Ada.Sequential_IO *note A.8.1(6): 6784.
125776 in Ada.Streams.Stream_IO *note A.12.1(8): 7071.
125777 in Ada.Text_IO *note A.10.1(9): 6869.
125778 in System.Multiprocessors.Dispatching_Domains *note D.16.1(7/3):
125779 8675.
125780
125781 Create_Directory in Ada.Directories *note A.16(7/2): 7140.
125782
125783 Create_Path in Ada.Directories *note A.16(9/2): 7142.
125784
125785 Create_Subpool
125786 in System.Storage_Pools.Subpools *note 13.11.4(7/3): 5698.
125787
125788 Current_Directory in Ada.Directories *note A.16(5/2): 7138.
125789
125790 Current_Error in Ada.Text_IO *note A.10.1(17): 6887, *note A.10.1(20):
125791 6894.
125792
125793 Current_Handler
125794 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8634.
125795 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8609.
125796 in Ada.Interrupts *note C.3.2(6): 8229.
125797 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8655.
125798
125799 Current_Input in Ada.Text_IO *note A.10.1(17): 6885, *note A.10.1(20):
125800 6892.
125801
125802 Current_Output in Ada.Text_IO *note A.10.1(17): 6886, *note
125803 A.10.1(20): 6893.
125804
125805 Current_State
125806 in Ada.Synchronous_Task_Control *note D.10(4): 8558.
125807
125808 Current_Task
125809 in Ada.Task_Identification *note C.7.1(3/3): 8276.
125810
125811 Current_Task_Fallback_Handler
125812 in Ada.Task_Termination *note C.7.3(5/2): 8309.
125813
125814 Current_Use
125815 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(7/3): 7921.
125816 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(6/3):
125817 7905.
125818 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(7/3):
125819 7890.
125820 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(7/3):
125821 7913.
125822 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(6/3):
125823 7898.
125824
125825 Day
125826 in Ada.Calendar *note 9.6(13): 4467.
125827 in Ada.Calendar.Formatting *note 9.6.1(23/2): 4509.
125828
125829 Day_of_Week
125830 in Ada.Calendar.Formatting *note 9.6.1(18/2): 4502.
125831
125832 Deallocate
125833 in System.Storage_Pools *note 13.11(8): 5625.
125834 in System.Storage_Pools.Subpools *note 13.11.4(15/3): 5705.
125835
125836 Deallocate_Subpool
125837 in System.Storage_Pools.Subpools *note 13.11.4(12/3): 5702.
125838
125839 Decode
125840 in Ada.Strings.UTF_Encoding.Strings *note A.4.11(26/3): 6557, *note
125841 A.4.11(27/3): 6558, *note A.4.11(28/3): 6559.
125842 in Ada.Strings.UTF_Encoding.Wide_Strings *note A.4.11(34/3): 6564,
125843 *note A.4.11(35/3): 6565, *note A.4.11(36/3): 6566.
125844 in Ada.Strings.UTF_Encoding.Wide_Wide_Strings *note A.4.11(42/3):
125845 6571, *note A.4.11(43/3): 6572, *note A.4.11(44/3): 6573.
125846
125847 Decrement in Interfaces.C.Pointers *note B.3.2(11/3): 8082.
125848
125849 Default_Modulus
125850 in Ada.Containers.Indefinite_Holders *note A.18.21(10/3): 7857,
125851 *note A.18.23(10/3): 7866.
125852
125853 Default_Subpool_for_Pool
125854 in System.Storage_Pools.Subpools *note 13.11.4(13/3): 5703.
125855
125856 Delay_Until_And_Set_CPU
125857 in System.Multiprocessors.Dispatching_Domains *note D.16.1(14/3):
125858 8682.
125859
125860 Delay_Until_And_Set_Deadline
125861 in Ada.Dispatching.EDF *note D.2.6(9/2): 8399.
125862
125863 Delete
125864 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(24/2): 7362.
125865 in Ada.Containers.Hashed_Maps *note A.18.5(25/2): 7459, *note
125866 A.18.5(26/2): 7460.
125867 in Ada.Containers.Hashed_Sets *note A.18.8(24/2): 7593, *note
125868 A.18.8(25/2): 7594, *note A.18.8(55/2): 7619.
125869 in Ada.Containers.Ordered_Maps *note A.18.6(24/2): 7513, *note
125870 A.18.6(25/2): 7514.
125871 in Ada.Containers.Ordered_Sets *note A.18.9(23/2): 7667, *note
125872 A.18.9(24/2): 7668, *note A.18.9(68/2): 7701.
125873 in Ada.Containers.Vectors *note A.18.2(50/2): 7285, *note
125874 A.18.2(51/2): 7286.
125875 in Ada.Direct_IO *note A.8.4(8): 6815.
125876 in Ada.Sequential_IO *note A.8.1(8): 6787.
125877 in Ada.Streams.Stream_IO *note A.12.1(10): 7074.
125878 in Ada.Strings.Bounded *note A.4.4(64): 6346, *note A.4.4(65):
125879 6347.
125880 in Ada.Strings.Fixed *note A.4.3(29): 6287, *note A.4.3(30): 6288.
125881 in Ada.Strings.Unbounded *note A.4.5(59): 6403, *note A.4.5(60):
125882 6404.
125883 in Ada.Text_IO *note A.10.1(11): 6872.
125884
125885 Delete_Children
125886 in Ada.Containers.Multiway_Trees *note A.18.10(53/3): 7778.
125887
125888 Delete_Directory in Ada.Directories *note A.16(8/2): 7141.
125889
125890 Delete_File in Ada.Directories *note A.16(11/2): 7144.
125891
125892 Delete_First
125893 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(25/2): 7363.
125894 in Ada.Containers.Ordered_Maps *note A.18.6(26/2): 7515.
125895 in Ada.Containers.Ordered_Sets *note A.18.9(25/2): 7669.
125896 in Ada.Containers.Vectors *note A.18.2(52/2): 7287.
125897
125898 Delete_Last
125899 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(26/2): 7364.
125900 in Ada.Containers.Ordered_Maps *note A.18.6(27/2): 7516.
125901 in Ada.Containers.Ordered_Sets *note A.18.9(26/2): 7670.
125902 in Ada.Containers.Vectors *note A.18.2(53/2): 7288.
125903
125904 Delete_Leaf
125905 in Ada.Containers.Multiway_Trees *note A.18.10(35/3): 7760.
125906
125907 Delete_Subtree
125908 in Ada.Containers.Multiway_Trees *note A.18.10(36/3): 7761.
125909
125910 Delete_Tree in Ada.Directories *note A.16(10/2): 7143.
125911
125912 Depth
125913 in Ada.Containers.Multiway_Trees *note A.18.10(19/3): 7744.
125914
125915 Dequeue
125916 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(5/3): 7919.
125917 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(5/3):
125918 7904.
125919 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(6/3):
125920 7889.
125921 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(5/3):
125922 7911.
125923 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(5/3):
125924 7897.
125925
125926 Dequeue_Only_High_Priority
125927 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(6/3): 7920.
125928 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(6/3):
125929 7912.
125930
125931 Dereference_Error
125932 in Interfaces.C.Strings *note B.3.1(12): 8061.
125933
125934 Descendant_Tag in Ada.Tags *note 3.9(7.1/2): 2237.
125935
125936 Detach_Handler in Ada.Interrupts *note C.3.2(9): 8232.
125937
125938 Determinant
125939 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9037.
125940 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8996.
125941
125942 Difference
125943 in Ada.Calendar.Arithmetic *note 9.6.1(12/2): 4492.
125944 in Ada.Containers.Hashed_Sets *note A.18.8(32/2): 7599, *note
125945 A.18.8(33/2): 7600.
125946 in Ada.Containers.Ordered_Sets *note A.18.9(33/2): 7675, *note
125947 A.18.9(34/2): 7676.
125948
125949 Divide in Ada.Decimal *note F.2(6/3): 8835.
125950
125951 Do_APC in System.RPC *note E.5(10): 8815.
125952
125953 Do_RPC in System.RPC *note E.5(9): 8814.
125954
125955 Eigensystem
125956 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(49/2): 9039.
125957 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(27/2): 8998.
125958
125959 Eigenvalues
125960 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(48/2): 9038.
125961 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(26/2): 8997.
125962
125963 Element
125964 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(14/2): 7347.
125965 in Ada.Containers.Hashed_Maps *note A.18.5(14/2): 7441, *note
125966 A.18.5(31/2): 7465.
125967 in Ada.Containers.Hashed_Sets *note A.18.8(15/2): 7581, *note
125968 A.18.8(52/2): 7616.
125969 in Ada.Containers.Indefinite_Holders *note A.18.18(12/3): 7830.
125970 in Ada.Containers.Multiway_Trees *note A.18.10(24/3): 7749.
125971 in Ada.Containers.Ordered_Maps *note A.18.6(13/2): 7495, *note
125972 A.18.6(39/2): 7528.
125973 in Ada.Containers.Ordered_Sets *note A.18.9(14/2): 7655, *note
125974 A.18.9(65/2): 7698.
125975 in Ada.Containers.Vectors *note A.18.2(27/2): 7255, *note
125976 A.18.2(28/2): 7256.
125977 in Ada.Strings.Bounded *note A.4.4(26): 6318.
125978 in Ada.Strings.Unbounded *note A.4.5(20): 6375.
125979
125980 Encode
125981 in Ada.Strings.UTF_Encoding.Strings *note A.4.11(23/3): 6554, *note
125982 A.4.11(24/3): 6555, *note A.4.11(25/3): 6556.
125983 in Ada.Strings.UTF_Encoding.Wide_Strings *note A.4.11(31/3): 6561,
125984 *note A.4.11(32/3): 6562, *note A.4.11(33/3): 6563.
125985 in Ada.Strings.UTF_Encoding.Wide_Wide_Strings *note A.4.11(39/3):
125986 6568, *note A.4.11(40/3): 6569, *note A.4.11(41/3): 6570.
125987
125988 Encoding in Ada.Strings.UTF_Encoding *note A.4.11(13/3): 6546.
125989
125990 End_Of_File
125991 in Ada.Direct_IO *note A.8.4(16): 6829.
125992 in Ada.Sequential_IO *note A.8.1(13): 6796.
125993 in Ada.Streams.Stream_IO *note A.12.1(12): 7081.
125994 in Ada.Text_IO *note A.10.1(34): 6917.
125995
125996 End_Of_Line in Ada.Text_IO *note A.10.1(30): 6910.
125997
125998 End_Of_Page in Ada.Text_IO *note A.10.1(33): 6915.
125999
126000 End_Search in Ada.Directories *note A.16(33/2): 7165.
126001
126002 Enqueue
126003 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(5/3): 7918.
126004 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(5/3):
126005 7903.
126006 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(5/3):
126007 7888.
126008 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(5/3):
126009 7910.
126010 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(5/3):
126011 7896.
126012
126013 Environment_Task
126014 in Ada.Task_Identification *note C.7.1(3/3): 8277.
126015
126016 Equal_Case_Insensitive
126017 child of Ada.Strings *note A.4.10(2/3): 6527.
126018 child of Ada.Strings.Bounded *note A.4.10(7/3): 6529.
126019 child of Ada.Strings.Fixed *note A.4.10(5/3): 6528.
126020 child of Ada.Strings.Unbounded *note A.4.10(10/3): 6530.
126021
126022 Equal_Subtree
126023 in Ada.Containers.Multiway_Trees *note A.18.10(14/3): 7740.
126024
126025 Equivalent_Elements
126026 in Ada.Containers.Hashed_Sets *note A.18.8(46/2): 7610, *note
126027 A.18.8(47/2): 7611, *note A.18.8(48/2): 7612.
126028 in Ada.Containers.Ordered_Sets *note A.18.9(3/2): 7643.
126029
126030 Equivalent_Keys
126031 in Ada.Containers.Hashed_Maps *note A.18.5(34/2): 7467, *note
126032 A.18.5(35/2): 7468, *note A.18.5(36/2): 7469.
126033 in Ada.Containers.Ordered_Maps *note A.18.6(3/2): 7484.
126034 in Ada.Containers.Ordered_Sets *note A.18.9(63/2): 7696.
126035
126036 Equivalent_Sets
126037 in Ada.Containers.Hashed_Sets *note A.18.8(8/2): 7574.
126038 in Ada.Containers.Ordered_Sets *note A.18.9(9/2): 7650.
126039
126040 Establish_RPC_Receiver in System.RPC *note E.5(12): 8817.
126041
126042 Exception_Identity in Ada.Exceptions *note 11.4.1(5/2): 4939.
126043
126044 Exception_Information
126045 in Ada.Exceptions *note 11.4.1(5/2): 4943.
126046
126047 Exception_Message in Ada.Exceptions *note 11.4.1(4/3): 4937.
126048
126049 Exception_Name in Ada.Exceptions *note 11.4.1(2/2): 4930, *note
126050 11.4.1(5/2): 4940.
126051
126052 Exchange_Handler in Ada.Interrupts *note C.3.2(8): 8231.
126053
126054 Exclude
126055 in Ada.Containers.Hashed_Maps *note A.18.5(24/2): 7458.
126056 in Ada.Containers.Hashed_Sets *note A.18.8(23/2): 7592, *note
126057 A.18.8(54/2): 7618.
126058 in Ada.Containers.Ordered_Maps *note A.18.6(23/2): 7512.
126059 in Ada.Containers.Ordered_Sets *note A.18.9(22/2): 7666, *note
126060 A.18.9(67/2): 7700.
126061
126062 Exists
126063 in Ada.Directories *note A.16(24/2): 7157.
126064 in Ada.Environment_Variables *note A.17(5/2): 7208.
126065
126066 Exp
126067 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
126068 G.1.2(3): 8898.
126069 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6589.
126070
126071 Expanded_Name in Ada.Tags *note 3.9(7/2): 2232.
126072
126073 Extension in Ada.Directories *note A.16(18/2): 7150.
126074
126075 External_Tag in Ada.Tags *note 3.9(7/2): 2235.
126076
126077 Finalize in Ada.Finalization *note 7.6(6/2): 3931, *note 7.6(8/2):
126078 3934.
126079
126080 Find
126081 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(41/2): 7379.
126082 in Ada.Containers.Hashed_Maps *note A.18.5(30/2): 7464.
126083 in Ada.Containers.Hashed_Sets *note A.18.8(43/2): 7608, *note
126084 A.18.8(56/2): 7620.
126085 in Ada.Containers.Multiway_Trees *note A.18.10(38/3): 7763.
126086 in Ada.Containers.Ordered_Maps *note A.18.6(38/2): 7527.
126087 in Ada.Containers.Ordered_Sets *note A.18.9(49/2): 7689, *note
126088 A.18.9(69/2): 7702.
126089 in Ada.Containers.Vectors *note A.18.2(68/2): 7303.
126090
126091 Find_In_Subtree
126092 in Ada.Containers.Multiway_Trees *note A.18.10(39/3): 7764.
126093
126094 Find_Index in Ada.Containers.Vectors *note A.18.2(67/2): 7302.
126095
126096 Find_Token
126097 in Ada.Strings.Bounded *note A.4.4(50.1/3): 6334, *note A.4.4(51):
126098 6335.
126099 in Ada.Strings.Fixed *note A.4.3(15.1/3): 6275, *note A.4.3(16):
126100 6276.
126101 in Ada.Strings.Unbounded *note A.4.5(45.1/3): 6391, *note
126102 A.4.5(46): 6392.
126103
126104 First
126105 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(33/2): 7371.
126106 in Ada.Containers.Hashed_Maps *note A.18.5(27/2): 7461.
126107 in Ada.Containers.Hashed_Sets *note A.18.8(40/2): 7605.
126108 in Ada.Containers.Ordered_Maps *note A.18.6(28/2): 7517.
126109 in Ada.Containers.Ordered_Sets *note A.18.9(41/2): 7681.
126110 in Ada.Containers.Vectors *note A.18.2(58/2): 7293.
126111 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3441.
126112
126113 First_Child
126114 in Ada.Containers.Multiway_Trees *note A.18.10(60/3): 7785.
126115
126116 First_Child_Element
126117 in Ada.Containers.Multiway_Trees *note A.18.10(61/3): 7786.
126118
126119 First_Element
126120 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(34/2): 7372.
126121 in Ada.Containers.Ordered_Maps *note A.18.6(29/2): 7518.
126122 in Ada.Containers.Ordered_Sets *note A.18.9(42/2): 7682.
126123 in Ada.Containers.Vectors *note A.18.2(59/2): 7294.
126124
126125 First_Index in Ada.Containers.Vectors *note A.18.2(57/2): 7292.
126126
126127 First_Key
126128 in Ada.Containers.Ordered_Maps *note A.18.6(30/2): 7519.
126129
126130 Floor
126131 in Ada.Containers.Ordered_Maps *note A.18.6(40/2): 7529.
126132 in Ada.Containers.Ordered_Sets *note A.18.9(50/2): 7690, *note
126133 A.18.9(70/2): 7703.
126134
126135 Flush
126136 in Ada.Streams.Stream_IO *note A.12.1(25/1): 7091.
126137 in Ada.Text_IO *note A.10.1(21/1): 6896.
126138
126139 Form
126140 in Ada.Direct_IO *note A.8.4(9): 6820.
126141 in Ada.Sequential_IO *note A.8.1(9): 6792.
126142 in Ada.Streams.Stream_IO *note A.12.1(11): 7079.
126143 in Ada.Text_IO *note A.10.1(12): 6877.
126144
126145 Free
126146 in Ada.Strings.Unbounded *note A.4.5(7): 6367.
126147 in Interfaces.C.Strings *note B.3.1(11): 8060.
126148
126149 Full_Name in Ada.Directories *note A.16(15/2): 7147, *note A.16(39/2):
126150 7169.
126151
126152 Generic_Array_Sort
126153 child of Ada.Containers *note A.18.26(3/2): 7878.
126154
126155 Generic_Constrained_Array_Sort
126156 child of Ada.Containers *note A.18.26(7/2): 7880.
126157
126158 Generic_Sort
126159 child of Ada.Containers *note A.18.26(9.2/3): 7882.
126160
126161 Get
126162 in Ada.Text_IO *note A.10.1(41): 6929, *note A.10.1(47): 6939,
126163 *note A.10.1(54): 6953, *note A.10.1(55): 6956, *note A.10.1(59): 6961,
126164 *note A.10.1(60): 6965, *note A.10.1(65): 6972, *note A.10.1(67): 6975,
126165 *note A.10.1(70): 6981, *note A.10.1(72): 6985, *note A.10.1(75): 6992,
126166 *note A.10.1(77): 6995, *note A.10.1(81): 7001, *note A.10.1(83): 7004.
126167 in Ada.Text_IO.Complex_IO *note G.1.3(6): 8927, *note G.1.3(8):
126168 8931.
126169
126170 Get_CPU
126171 in Ada.Interrupts *note C.3.2(10.1/3): 8234.
126172 in System.Multiprocessors.Dispatching_Domains *note D.16.1(13/3):
126173 8681.
126174
126175 Get_Deadline in Ada.Dispatching.EDF *note D.2.6(9/2): 8400.
126176
126177 Get_Dispatching_Domain
126178 in System.Multiprocessors.Dispatching_Domains *note D.16.1(10/3):
126179 8678.
126180
126181 Get_First_CPU
126182 in System.Multiprocessors.Dispatching_Domains *note D.16.1(8/3):
126183 8676.
126184
126185 Get_Immediate in Ada.Text_IO *note A.10.1(44): 6936, *note A.10.1(45):
126186 6937.
126187
126188 Get_Last_CPU
126189 in System.Multiprocessors.Dispatching_Domains *note D.16.1(9/3):
126190 8677.
126191
126192 Get_Line
126193 in Ada.Text_IO *note A.10.1(49): 6944, *note A.10.1(49.1/2): 6946.
126194 in Ada.Text_IO.Bounded_IO *note A.10.11(8/2): 7035, *note
126195 A.10.11(9/2): 7036, *note A.10.11(10/2): 7037, *note A.10.11(11/2):
126196 7038.
126197 in Ada.Text_IO.Unbounded_IO *note A.10.12(8/2): 7045, *note
126198 A.10.12(9/2): 7046, *note A.10.12(10/2): 7047, *note A.10.12(11/2):
126199 7048.
126200
126201 Get_Next_Entry in Ada.Directories *note A.16(35/2): 7167.
126202
126203 Get_Priority
126204 in Ada.Dynamic_Priorities *note D.5.1(5): 8445.
126205
126206 Has_Element
126207 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9.1/3): 7342.
126208 in Ada.Containers.Hashed_Maps *note A.18.5(6.1/3): 7433.
126209 in Ada.Containers.Hashed_Sets *note A.18.8(6.1/3): 7572.
126210 in Ada.Containers.Multiway_Trees *note A.18.10(12/3): 7738.
126211 in Ada.Containers.Ordered_Maps *note A.18.6(7.1/3): 7489.
126212 in Ada.Containers.Ordered_Sets *note A.18.9(7.1/3): 7648.
126213 in Ada.Containers.Vectors *note A.18.2(11.1/3): 7243.
126214
126215 Hash
126216 child of Ada.Strings *note A.4.9(2/3): 6518.
126217 child of Ada.Strings.Bounded *note A.4.9(7/3): 6519.
126218 child of Ada.Strings.Unbounded *note A.4.9(10/3): 6520.
126219
126220 Hash_Case_Insensitive
126221 child of Ada.Strings *note A.4.9(11.2/3): 6521.
126222 child of Ada.Strings.Bounded *note A.4.9(11.7/3): 6523.
126223 child of Ada.Strings.Fixed *note A.4.9(11.5/3): 6522.
126224 child of Ada.Strings.Unbounded *note A.4.9(11.10/3): 6524.
126225
126226 Head
126227 in Ada.Strings.Bounded *note A.4.4(70): 6352, *note A.4.4(71):
126228 6353.
126229 in Ada.Strings.Fixed *note A.4.3(35): 6293, *note A.4.3(36): 6294.
126230 in Ada.Strings.Unbounded *note A.4.5(65): 6409, *note A.4.5(66):
126231 6410.
126232
126233 Hold in Ada.Asynchronous_Task_Control *note D.11(3/2): 8573.
126234
126235 Hour in Ada.Calendar.Formatting *note 9.6.1(24/2): 4510.
126236
126237 Im
126238 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(7/2): 9009,
126239 *note G.3.2(27/2): 9022.
126240 in Ada.Numerics.Generic_Complex_Types *note G.1.1(6): 8872.
126241
126242 Image
126243 in Ada.Calendar.Formatting *note 9.6.1(35/2): 4521, *note
126244 9.6.1(37/2): 4523.
126245 in Ada.Numerics.Discrete_Random *note A.5.2(26): 6644.
126246 in Ada.Numerics.Float_Random *note A.5.2(14): 6632.
126247 in Ada.Task_Identification *note C.7.1(3/3): 8275.
126248 in Ada.Text_IO.Editing *note F.3.3(13): 8855.
126249
126250 Include
126251 in Ada.Containers.Hashed_Maps *note A.18.5(22/2): 7456.
126252 in Ada.Containers.Hashed_Sets *note A.18.8(21/2): 7590.
126253 in Ada.Containers.Ordered_Maps *note A.18.6(21/2): 7510.
126254 in Ada.Containers.Ordered_Sets *note A.18.9(20/2): 7664.
126255
126256 Increment in Interfaces.C.Pointers *note B.3.2(11/3): 8081.
126257
126258 Index
126259 in Ada.Direct_IO *note A.8.4(15): 6827.
126260 in Ada.Streams.Stream_IO *note A.12.1(23): 7088.
126261 in Ada.Strings.Bounded *note A.4.4(43.1/2): 6323, *note
126262 A.4.4(43.2/2): 6324, *note A.4.4(44): 6325, *note A.4.4(45): 6326, *note
126263 A.4.4(45.1/2): 6327, *note A.4.4(46): 6328.
126264 in Ada.Strings.Fixed *note A.4.3(8.1/2): 6264, *note A.4.3(8.2/2):
126265 6265, *note A.4.3(9): 6266, *note A.4.3(10): 6267, *note A.4.3(10.1/2):
126266 6268, *note A.4.3(11): 6269.
126267 in Ada.Strings.Unbounded *note A.4.5(38.1/2): 6380, *note
126268 A.4.5(38.2/2): 6381, *note A.4.5(39): 6382, *note A.4.5(40): 6383, *note
126269 A.4.5(40.1/2): 6384, *note A.4.5(41): 6385.
126270
126271 Index_Non_Blank
126272 in Ada.Strings.Bounded *note A.4.4(46.1/2): 6329, *note A.4.4(47):
126273 6330.
126274 in Ada.Strings.Fixed *note A.4.3(11.1/2): 6270, *note A.4.3(12):
126275 6271.
126276 in Ada.Strings.Unbounded *note A.4.5(41.1/2): 6386, *note
126277 A.4.5(42): 6387.
126278
126279 Initial_Directory
126280 in Ada.Directories.Hierarchical_File_Names *note A.16.1(12/3):
126281 7200.
126282
126283 Initialize in Ada.Finalization *note 7.6(6/2): 3929, *note 7.6(8/2):
126284 3933.
126285
126286 Insert
126287 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(19/2): 7357,
126288 *note A.18.3(20/2): 7358, *note A.18.3(21/2): 7359.
126289 in Ada.Containers.Hashed_Maps *note A.18.5(19/2): 7453, *note
126290 A.18.5(20/2): 7454, *note A.18.5(21/2): 7455.
126291 in Ada.Containers.Hashed_Sets *note A.18.8(19/2): 7588, *note
126292 A.18.8(20/2): 7589.
126293 in Ada.Containers.Ordered_Maps *note A.18.6(18/2): 7507, *note
126294 A.18.6(19/2): 7508, *note A.18.6(20/2): 7509.
126295 in Ada.Containers.Ordered_Sets *note A.18.9(18/2): 7662, *note
126296 A.18.9(19/2): 7663.
126297 in Ada.Containers.Vectors *note A.18.2(36/2): 7271, *note
126298 A.18.2(37/2): 7272, *note A.18.2(38/2): 7273, *note A.18.2(39/2): 7274,
126299 *note A.18.2(40/2): 7275, *note A.18.2(41/2): 7276, *note A.18.2(42/2):
126300 7277, *note A.18.2(43/2): 7278.
126301 in Ada.Strings.Bounded *note A.4.4(60): 6342, *note A.4.4(61):
126302 6343.
126303 in Ada.Strings.Fixed *note A.4.3(25): 6283, *note A.4.3(26): 6284.
126304 in Ada.Strings.Unbounded *note A.4.5(55): 6399, *note A.4.5(56):
126305 6400.
126306
126307 Insert_Child
126308 in Ada.Containers.Multiway_Trees *note A.18.10(48/3): 7773, *note
126309 A.18.10(49/3): 7774, *note A.18.10(50/3): 7775.
126310
126311 Insert_Space
126312 in Ada.Containers.Vectors *note A.18.2(48/2): 7283, *note
126313 A.18.2(49/2): 7284.
126314
126315 Interface_Ancestor_Tags in Ada.Tags *note 3.9(7.4/2): 2241.
126316
126317 Internal_Tag in Ada.Tags *note 3.9(7/2): 2236.
126318
126319 Intersection
126320 in Ada.Containers.Hashed_Sets *note A.18.8(29/2): 7597, *note
126321 A.18.8(30/2): 7598.
126322 in Ada.Containers.Ordered_Sets *note A.18.9(30/2): 7673, *note
126323 A.18.9(31/2): 7674.
126324
126325 Inverse
126326 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9036.
126327 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8995.
126328
126329 Is_A_Group_Member
126330 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8627.
126331
126332 Is_Abstract in Ada.Tags *note 3.9(7.5/3): 2242.
126333
126334 Is_Alphanumeric
126335 in Ada.Characters.Handling *note A.3.2(4/3): 5917.
126336 in Ada.Wide_Characters.Handling *note A.3.5(12/3): 6207.
126337
126338 Is_Attached in Ada.Interrupts *note C.3.2(5): 8228.
126339
126340 Is_Basic in Ada.Characters.Handling *note A.3.2(4/3): 5913.
126341
126342 Is_Callable
126343 in Ada.Task_Identification *note C.7.1(4/3): 8280.
126344
126345 Is_Character
126346 in Ada.Characters.Conversions *note A.3.4(3/2): 6181.
126347
126348 Is_Control
126349 in Ada.Characters.Handling *note A.3.2(4/3): 5908.
126350 in Ada.Wide_Characters.Handling *note A.3.5(5/3): 6200.
126351
126352 Is_Current_Directory_Name
126353 in Ada.Directories.Hierarchical_File_Names *note A.16.1(7/3): 7195.
126354
126355 Is_Decimal_Digit
126356 in Ada.Characters.Handling *note A.3.2(4/3): 5915.
126357 in Ada.Wide_Characters.Handling *note A.3.5(10/3): 6205.
126358
126359 Is_Descendant_At_Same_Level
126360 in Ada.Tags *note 3.9(7.1/2): 2238.
126361
126362 Is_Digit
126363 in Ada.Characters.Handling *note A.3.2(4/3): 5914.
126364 in Ada.Wide_Characters.Handling *note A.3.5(9/3): 6204.
126365
126366 Is_Empty
126367 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(12/2): 7345.
126368 in Ada.Containers.Hashed_Maps *note A.18.5(11/2): 7438.
126369 in Ada.Containers.Hashed_Sets *note A.18.8(13/2): 7579.
126370 in Ada.Containers.Indefinite_Holders *note A.18.18(10/3): 7828.
126371 in Ada.Containers.Multiway_Trees *note A.18.10(16/3): 7741.
126372 in Ada.Containers.Ordered_Maps *note A.18.6(10/2): 7492.
126373 in Ada.Containers.Ordered_Sets *note A.18.9(12/2): 7653.
126374 in Ada.Containers.Vectors *note A.18.2(23/2): 7251.
126375
126376 Is_Full_Name
126377 in Ada.Directories.Hierarchical_File_Names *note A.16.1(8/3): 7196.
126378
126379 Is_Graphic
126380 in Ada.Characters.Handling *note A.3.2(4/3): 5909.
126381 in Ada.Wide_Characters.Handling *note A.3.5(19/3): 6214.
126382
126383 Is_Held
126384 in Ada.Asynchronous_Task_Control *note D.11(3/2): 8575.
126385
126386 Is_Hexadecimal_Digit
126387 in Ada.Characters.Handling *note A.3.2(4/3): 5916.
126388 in Ada.Wide_Characters.Handling *note A.3.5(11/3): 6206.
126389
126390 Is_In
126391 in Ada.Strings.Maps *note A.4.2(13): 6245.
126392 in Ada.Strings.Wide_Maps *note A.4.7(13): 6457.
126393 in Ada.Strings.Wide_Wide_Maps *note A.4.8(13/2): 6499.
126394
126395 Is_ISO_646 in Ada.Characters.Handling *note A.3.2(10): 5932.
126396
126397 Is_Leaf
126398 in Ada.Containers.Multiway_Trees *note A.18.10(21/3): 7746.
126399
126400 Is_Letter
126401 in Ada.Characters.Handling *note A.3.2(4/3): 5910.
126402 in Ada.Wide_Characters.Handling *note A.3.5(6/3): 6201.
126403
126404 Is_Line_Terminator
126405 in Ada.Characters.Handling *note A.3.2(4/3): 5919.
126406 in Ada.Wide_Characters.Handling *note A.3.5(14/3): 6209.
126407
126408 Is_Lower
126409 in Ada.Characters.Handling *note A.3.2(4/3): 5911.
126410 in Ada.Wide_Characters.Handling *note A.3.5(7/3): 6202.
126411
126412 Is_Mark
126413 in Ada.Characters.Handling *note A.3.2(4/3): 5920.
126414 in Ada.Wide_Characters.Handling *note A.3.5(15/3): 6210.
126415
126416 Is_Member
126417 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8626.
126418
126419 Is_Nul_Terminated in Interfaces.C *note B.3(24): 8010, *note B.3(35):
126420 8020, *note B.3(39.16/2): 8040, *note B.3(39.7/2): 8030.
126421
126422 Is_Open
126423 in Ada.Direct_IO *note A.8.4(10): 6821.
126424 in Ada.Sequential_IO *note A.8.1(10): 6793.
126425 in Ada.Streams.Stream_IO *note A.12.1(12): 7080.
126426 in Ada.Text_IO *note A.10.1(13): 6878.
126427
126428 Is_Other_Format
126429 in Ada.Characters.Handling *note A.3.2(4/3): 5921.
126430 in Ada.Wide_Characters.Handling *note A.3.5(16/3): 6211.
126431
126432 Is_Parent_Directory_Name
126433 in Ada.Directories.Hierarchical_File_Names *note A.16.1(6/3): 7194.
126434
126435 Is_Punctuation_Connector
126436 in Ada.Characters.Handling *note A.3.2(4/3): 5922.
126437 in Ada.Wide_Characters.Handling *note A.3.5(17/3): 6212.
126438
126439 Is_Relative_Name
126440 in Ada.Directories.Hierarchical_File_Names *note A.16.1(9/3): 7197.
126441
126442 Is_Reserved in Ada.Interrupts *note C.3.2(4): 8227.
126443
126444 Is_Root
126445 in Ada.Containers.Multiway_Trees *note A.18.10(20/3): 7745.
126446
126447 Is_Root_Directory_Name
126448 in Ada.Directories.Hierarchical_File_Names *note A.16.1(5/3): 7193.
126449
126450 Is_Round_Robin
126451 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8391.
126452
126453 Is_Simple_Name
126454 in Ada.Directories.Hierarchical_File_Names *note A.16.1(4/3): 7192.
126455
126456 Is_Sorted
126457 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(48/2): 7385.
126458 in Ada.Containers.Vectors *note A.18.2(76/2): 7310.
126459
126460 Is_Space
126461 in Ada.Characters.Handling *note A.3.2(4/3): 5923.
126462 in Ada.Wide_Characters.Handling *note A.3.5(18/3): 6213.
126463
126464 Is_Special
126465 in Ada.Characters.Handling *note A.3.2(4/3): 5918.
126466 in Ada.Wide_Characters.Handling *note A.3.5(13/3): 6208.
126467
126468 Is_String
126469 in Ada.Characters.Conversions *note A.3.4(3/2): 6182.
126470
126471 Is_Subset
126472 in Ada.Containers.Hashed_Sets *note A.18.8(39/2): 7604.
126473 in Ada.Containers.Ordered_Sets *note A.18.9(40/2): 7680.
126474 in Ada.Strings.Maps *note A.4.2(14): 6246.
126475 in Ada.Strings.Wide_Maps *note A.4.7(14): 6458.
126476 in Ada.Strings.Wide_Wide_Maps *note A.4.8(14/2): 6500.
126477
126478 Is_Terminated
126479 in Ada.Task_Identification *note C.7.1(4/3): 8279.
126480
126481 Is_Upper
126482 in Ada.Characters.Handling *note A.3.2(4/3): 5912.
126483 in Ada.Wide_Characters.Handling *note A.3.5(8/3): 6203.
126484
126485 Is_Wide_Character
126486 in Ada.Characters.Conversions *note A.3.4(3/2): 6183.
126487
126488 Is_Wide_String
126489 in Ada.Characters.Conversions *note A.3.4(3/2): 6184.
126490
126491 Iterate
126492 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(45/2): 7382.
126493 in Ada.Containers.Hashed_Maps *note A.18.5(37/2): 7470.
126494 in Ada.Containers.Hashed_Sets *note A.18.8(49/2): 7613.
126495 in Ada.Containers.Multiway_Trees *note A.18.10(42/3): 7767, *note
126496 A.18.10(44/3): 7769.
126497 in Ada.Containers.Ordered_Maps *note A.18.6(50/2): 7532.
126498 in Ada.Containers.Ordered_Sets *note A.18.9(60/2): 7693.
126499 in Ada.Containers.Vectors *note A.18.2(73/2): 7307.
126500 in Ada.Environment_Variables *note A.17(8/3): 7212.
126501
126502 Iterate_Children
126503 in Ada.Containers.Multiway_Trees *note A.18.10(68/3): 7793, *note
126504 A.18.10(70/3): 7795.
126505
126506 Iterate_Subtree
126507 in Ada.Containers.Multiway_Trees *note A.18.10(43/3): 7768, *note
126508 A.18.10(45/3): 7770.
126509
126510 Key
126511 in Ada.Containers.Hashed_Maps *note A.18.5(13/2): 7440.
126512 in Ada.Containers.Hashed_Sets *note A.18.8(51/2): 7615.
126513 in Ada.Containers.Ordered_Maps *note A.18.6(12/2): 7494.
126514 in Ada.Containers.Ordered_Sets *note A.18.9(64/2): 7697.
126515
126516 Kind in Ada.Directories *note A.16(25/2): 7158, *note A.16(40/2):
126517 7170.
126518
126519 Language in Ada.Locales *note A.19(6/3): 7930.
126520
126521 Last
126522 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(35/2): 7373.
126523 in Ada.Containers.Ordered_Maps *note A.18.6(31/2): 7520.
126524 in Ada.Containers.Ordered_Sets *note A.18.9(43/2): 7683.
126525 in Ada.Containers.Vectors *note A.18.2(61/2): 7296.
126526 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3444.
126527
126528 Last_Child
126529 in Ada.Containers.Multiway_Trees *note A.18.10(62/3): 7787.
126530
126531 Last_Child_Element
126532 in Ada.Containers.Multiway_Trees *note A.18.10(63/3): 7788.
126533
126534 Last_Element
126535 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(36/2): 7374.
126536 in Ada.Containers.Ordered_Maps *note A.18.6(32/2): 7521.
126537 in Ada.Containers.Ordered_Sets *note A.18.9(44/2): 7684.
126538 in Ada.Containers.Vectors *note A.18.2(62/2): 7297.
126539
126540 Last_Index in Ada.Containers.Vectors *note A.18.2(60/2): 7295.
126541
126542 Last_Key
126543 in Ada.Containers.Ordered_Maps *note A.18.6(33/2): 7522.
126544
126545 Length
126546 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(11/2): 7344.
126547 in Ada.Containers.Hashed_Maps *note A.18.5(10/2): 7437.
126548 in Ada.Containers.Hashed_Sets *note A.18.8(12/2): 7578.
126549 in Ada.Containers.Ordered_Maps *note A.18.6(9/2): 7491.
126550 in Ada.Containers.Ordered_Sets *note A.18.9(11/2): 7652.
126551 in Ada.Containers.Vectors *note A.18.2(21/2): 7249.
126552 in Ada.Strings.Bounded *note A.4.4(9): 6306.
126553 in Ada.Strings.Unbounded *note A.4.5(6): 6365.
126554 in Ada.Text_IO.Editing *note F.3.3(11): 8853.
126555 in Interfaces.COBOL *note B.4(34): 8142, *note B.4(39): 8146, *note
126556 B.4(44): 8150.
126557
126558 Less_Case_Insensitive
126559 child of Ada.Strings *note A.4.10(13/3): 6531.
126560 child of Ada.Strings.Bounded *note A.4.10(18/3): 6533.
126561 child of Ada.Strings.Fixed *note A.4.10(16/3): 6532.
126562 child of Ada.Strings.Unbounded *note A.4.10(21/3): 6534.
126563
126564 Line in Ada.Text_IO *note A.10.1(38): 6926.
126565
126566 Line_Length in Ada.Text_IO *note A.10.1(25): 6902.
126567
126568 Log
126569 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
126570 G.1.2(3): 8896.
126571 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6587.
126572
126573 Look_Ahead in Ada.Text_IO *note A.10.1(43): 6933.
126574
126575 Members
126576 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8628.
126577
126578 Merge
126579 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(50/2): 7387.
126580 in Ada.Containers.Vectors *note A.18.2(78/2): 7312.
126581
126582 Microseconds in Ada.Real_Time *note D.8(14/2): 8536.
126583
126584 Milliseconds in Ada.Real_Time *note D.8(14/2): 8537.
126585
126586 Minute in Ada.Calendar.Formatting *note 9.6.1(25/2): 4511.
126587
126588 Minutes in Ada.Real_Time *note D.8(14/2): 8539.
126589
126590 Mode
126591 in Ada.Direct_IO *note A.8.4(9): 6818.
126592 in Ada.Sequential_IO *note A.8.1(9): 6790.
126593 in Ada.Streams.Stream_IO *note A.12.1(11): 7077.
126594 in Ada.Text_IO *note A.10.1(12): 6875.
126595
126596 Modification_Time in Ada.Directories *note A.16(27/2): 7160, *note
126597 A.16(42/2): 7172.
126598
126599 Modulus
126600 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(10/2): 9014,
126601 *note G.3.2(30/2): 9027.
126602 in Ada.Numerics.Generic_Complex_Types *note G.1.1(9): 8880.
126603
126604 Month
126605 in Ada.Calendar *note 9.6(13): 4466.
126606 in Ada.Calendar.Formatting *note 9.6.1(22/2): 4508.
126607
126608 More_Entries in Ada.Directories *note A.16(34/2): 7166.
126609
126610 Move
126611 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(18/2): 7356.
126612 in Ada.Containers.Hashed_Maps *note A.18.5(18/2): 7452.
126613 in Ada.Containers.Hashed_Sets *note A.18.8(18/2): 7587.
126614 in Ada.Containers.Indefinite_Holders *note A.18.18(22/3): 7840.
126615 in Ada.Containers.Multiway_Trees *note A.18.10(34/3): 7759.
126616 in Ada.Containers.Ordered_Maps *note A.18.6(17/2): 7506.
126617 in Ada.Containers.Ordered_Sets *note A.18.9(17/2): 7661.
126618 in Ada.Containers.Vectors *note A.18.2(35/2): 7270.
126619 in Ada.Strings.Fixed *note A.4.3(7): 6263.
126620
126621 Name
126622 in Ada.Direct_IO *note A.8.4(9): 6819.
126623 in Ada.Sequential_IO *note A.8.1(9): 6791.
126624 in Ada.Streams.Stream_IO *note A.12.1(11): 7078.
126625 in Ada.Text_IO *note A.10.1(12): 6876.
126626
126627 Name_Case_Equivalence
126628 in Ada.Directories *note A.16(20.2/3): 7154.
126629
126630 Nanoseconds in Ada.Real_Time *note D.8(14/2): 8535.
126631
126632 New_Char_Array
126633 in Interfaces.C.Strings *note B.3.1(9): 8058.
126634
126635 New_Line in Ada.Text_IO *note A.10.1(28): 6906.
126636
126637 New_Page in Ada.Text_IO *note A.10.1(31): 6911.
126638
126639 New_String in Interfaces.C.Strings *note B.3.1(10): 8059.
126640
126641 Next
126642 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(37/2): 7375,
126643 *note A.18.3(39/2): 7377.
126644 in Ada.Containers.Hashed_Maps *note A.18.5(28/2): 7462, *note
126645 A.18.5(29/2): 7463.
126646 in Ada.Containers.Hashed_Sets *note A.18.8(41/2): 7606, *note
126647 A.18.8(42/2): 7607.
126648 in Ada.Containers.Ordered_Maps *note A.18.6(34/2): 7523, *note
126649 A.18.6(35/2): 7524.
126650 in Ada.Containers.Ordered_Sets *note A.18.9(45/2): 7685, *note
126651 A.18.9(46/2): 7686.
126652 in Ada.Containers.Vectors *note A.18.2(63/2): 7298, *note
126653 A.18.2(64/2): 7299.
126654 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3442.
126655
126656 Next_Sibling
126657 in Ada.Containers.Multiway_Trees *note A.18.10(64/3): 7789, *note
126658 A.18.10(66/3): 7791.
126659
126660 Node_Count
126661 in Ada.Containers.Multiway_Trees *note A.18.10(17/3): 7742.
126662
126663 Null_Task_Id
126664 in Ada.Task_Identification *note C.7.1(2/2): 8274.
126665
126666 Number_Of_CPUs
126667 in System.Multiprocessors *note D.16(5/3): 8667.
126668
126669 Open
126670 in Ada.Direct_IO *note A.8.4(7): 6813.
126671 in Ada.Sequential_IO *note A.8.1(7): 6785.
126672 in Ada.Streams.Stream_IO *note A.12.1(9): 7072.
126673 in Ada.Text_IO *note A.10.1(10): 6870.
126674
126675 Overlap
126676 in Ada.Containers.Hashed_Sets *note A.18.8(38/2): 7603.
126677 in Ada.Containers.Ordered_Sets *note A.18.9(39/2): 7679.
126678
126679 Overwrite
126680 in Ada.Strings.Bounded *note A.4.4(62): 6344, *note A.4.4(63):
126681 6345.
126682 in Ada.Strings.Fixed *note A.4.3(27): 6285, *note A.4.3(28): 6286.
126683 in Ada.Strings.Unbounded *note A.4.5(57): 6401, *note A.4.5(58):
126684 6402.
126685
126686 Page in Ada.Text_IO *note A.10.1(39): 6928.
126687
126688 Page_Length in Ada.Text_IO *note A.10.1(26): 6903.
126689
126690 Parent
126691 in Ada.Containers.Multiway_Trees *note A.18.10(59/3): 7784.
126692
126693 Parent_Tag in Ada.Tags *note 3.9(7.2/2): 2239.
126694
126695 Peak_Use
126696 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(7/3): 7922.
126697 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(6/3):
126698 7906.
126699 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(7/3):
126700 7891.
126701 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(7/3):
126702 7914.
126703 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(6/3):
126704 7899.
126705
126706 Pic_String in Ada.Text_IO.Editing *note F.3.3(7): 8844.
126707
126708 Pool_of_Subpool
126709 in System.Storage_Pools.Subpools *note 13.11.4(9/3): 5699.
126710
126711 Prepend
126712 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(22/2): 7360.
126713 in Ada.Containers.Vectors *note A.18.2(44/2): 7279, *note
126714 A.18.2(45/2): 7280.
126715
126716 Prepend_Child
126717 in Ada.Containers.Multiway_Trees *note A.18.10(51/3): 7776.
126718
126719 Previous
126720 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(38/2): 7376,
126721 *note A.18.3(40/2): 7378.
126722 in Ada.Containers.Ordered_Maps *note A.18.6(36/2): 7525, *note
126723 A.18.6(37/2): 7526.
126724 in Ada.Containers.Ordered_Sets *note A.18.9(47/2): 7687, *note
126725 A.18.9(48/2): 7688.
126726 in Ada.Containers.Vectors *note A.18.2(65/2): 7300, *note
126727 A.18.2(66/2): 7301.
126728 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3445.
126729
126730 Previous_Sibling
126731 in Ada.Containers.Multiway_Trees *note A.18.10(65/3): 7790, *note
126732 A.18.10(67/3): 7792.
126733
126734 Put
126735 in Ada.Text_IO *note A.10.1(42): 6931, *note A.10.1(48): 6941,
126736 *note A.10.1(55): 6957, *note A.10.1(60): 6963, *note A.10.1(66): 6973,
126737 *note A.10.1(67): 6976, *note A.10.1(71): 6984, *note A.10.1(72): 6986,
126738 *note A.10.1(76): 6994, *note A.10.1(77): 6996, *note A.10.1(82): 7002,
126739 *note A.10.1(83): 7005.
126740 in Ada.Text_IO.Bounded_IO *note A.10.11(4/2): 7031, *note
126741 A.10.11(5/2): 7032.
126742 in Ada.Text_IO.Complex_IO *note G.1.3(7): 8930, *note G.1.3(8):
126743 8932.
126744 in Ada.Text_IO.Editing *note F.3.3(14): 8856, *note F.3.3(15):
126745 8857, *note F.3.3(16): 8858.
126746 in Ada.Text_IO.Unbounded_IO *note A.10.12(4/2): 7041, *note
126747 A.10.12(5/2): 7042.
126748
126749 Put_Line
126750 in Ada.Text_IO *note A.10.1(50): 6948.
126751 in Ada.Text_IO.Bounded_IO *note A.10.11(6/2): 7033, *note
126752 A.10.11(7/2): 7034.
126753 in Ada.Text_IO.Unbounded_IO *note A.10.12(6/2): 7043, *note
126754 A.10.12(7/2): 7044.
126755
126756 Query_Element
126757 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(16/2): 7349.
126758 in Ada.Containers.Hashed_Maps *note A.18.5(16/2): 7443.
126759 in Ada.Containers.Hashed_Sets *note A.18.8(17/2): 7583.
126760 in Ada.Containers.Indefinite_Holders *note A.18.18(14/3): 7832.
126761 in Ada.Containers.Multiway_Trees *note A.18.10(26/3): 7751.
126762 in Ada.Containers.Ordered_Maps *note A.18.6(15/2): 7497.
126763 in Ada.Containers.Ordered_Sets *note A.18.9(16/2): 7657.
126764 in Ada.Containers.Vectors *note A.18.2(31/2): 7259, *note
126765 A.18.2(32/2): 7260.
126766
126767 Raise_Exception in Ada.Exceptions *note 11.4.1(4/3): 4936.
126768
126769 Random
126770 in Ada.Numerics.Discrete_Random *note A.5.2(20): 6637.
126771 in Ada.Numerics.Float_Random *note A.5.2(8): 6625.
126772
126773 Re
126774 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(7/2): 9008,
126775 *note G.3.2(27/2): 9021.
126776 in Ada.Numerics.Generic_Complex_Types *note G.1.1(6): 8871.
126777
126778 Read
126779 in Ada.Direct_IO *note A.8.4(12): 6822.
126780 in Ada.Sequential_IO *note A.8.1(12): 6794.
126781 in Ada.Storage_IO *note A.9(6): 6842.
126782 in Ada.Streams *note 13.13.1(5): 5783.
126783 in Ada.Streams.Stream_IO *note A.12.1(15): 7083, *note A.12.1(16):
126784 7084.
126785 in System.RPC *note E.5(7): 8812.
126786
126787 Reference
126788 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.4/3): 7353.
126789 in Ada.Containers.Hashed_Maps *note A.18.5(17.4/3): 7447, *note
126790 A.18.5(17.6/3): 7449.
126791 in Ada.Containers.Indefinite_Holders *note A.18.18(19/3): 7837.
126792 in Ada.Containers.Multiway_Trees *note A.18.10(31/3): 7756.
126793 in Ada.Containers.Ordered_Maps *note A.18.6(16.4/3): 7501, *note
126794 A.18.6(16.6/3): 7503.
126795 in Ada.Containers.Vectors *note A.18.2(34.4/3): 7265, *note
126796 A.18.2(34.6/3): 7267.
126797 in Ada.Interrupts *note C.3.2(10): 8233.
126798 in Ada.Task_Attributes *note C.7.2(5): 8296.
126799
126800 Reference_Preserving_Key
126801 in Ada.Containers.Hashed_Sets *note A.18.8(58.2/3): 7624, *note
126802 A.18.8(58.4/3): 7626.
126803 in Ada.Containers.Ordered_Sets *note A.18.9(73.2/3): 7708, *note
126804 A.18.9(73.4/3): 7710.
126805
126806 Reinitialize in Ada.Task_Attributes *note C.7.2(6): 8298.
126807
126808 Relative_Name
126809 in Ada.Directories.Hierarchical_File_Names *note A.16.1(13/3):
126810 7201.
126811
126812 Remove_Task
126813 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8625.
126814
126815 Rename in Ada.Directories *note A.16(12/2): 7145.
126816
126817 Replace
126818 in Ada.Containers.Hashed_Maps *note A.18.5(23/2): 7457.
126819 in Ada.Containers.Hashed_Sets *note A.18.8(22/2): 7591, *note
126820 A.18.8(53/2): 7617.
126821 in Ada.Containers.Ordered_Maps *note A.18.6(22/2): 7511.
126822 in Ada.Containers.Ordered_Sets *note A.18.9(21/2): 7665, *note
126823 A.18.9(66/2): 7699.
126824
126825 Replace_Element
126826 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(15/2): 7348.
126827 in Ada.Containers.Hashed_Maps *note A.18.5(15/2): 7442.
126828 in Ada.Containers.Hashed_Sets *note A.18.8(16/2): 7582.
126829 in Ada.Containers.Indefinite_Holders *note A.18.18(13/3): 7831.
126830 in Ada.Containers.Multiway_Trees *note A.18.10(25/3): 7750.
126831 in Ada.Containers.Ordered_Maps *note A.18.6(14/2): 7496.
126832 in Ada.Containers.Ordered_Sets *note A.18.9(15/2): 7656.
126833 in Ada.Containers.Vectors *note A.18.2(29/2): 7257, *note
126834 A.18.2(30/2): 7258.
126835 in Ada.Strings.Bounded *note A.4.4(27): 6319.
126836 in Ada.Strings.Unbounded *note A.4.5(21): 6376.
126837
126838 Replace_Slice
126839 in Ada.Strings.Bounded *note A.4.4(58): 6340, *note A.4.4(59):
126840 6341.
126841 in Ada.Strings.Fixed *note A.4.3(23): 6281, *note A.4.3(24): 6282.
126842 in Ada.Strings.Unbounded *note A.4.5(53): 6397, *note A.4.5(54):
126843 6398.
126844
126845 Replenish
126846 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8629.
126847
126848 Replicate in Ada.Strings.Bounded *note A.4.4(78): 6356, *note
126849 A.4.4(79): 6357, *note A.4.4(80): 6358.
126850
126851 Reraise_Occurrence in Ada.Exceptions *note 11.4.1(4/3): 4938.
126852
126853 Reserve_Capacity
126854 in Ada.Containers.Hashed_Maps *note A.18.5(9/2): 7436.
126855 in Ada.Containers.Hashed_Sets *note A.18.8(11/2): 7577.
126856 in Ada.Containers.Vectors *note A.18.2(20/2): 7248.
126857
126858 Reset
126859 in Ada.Direct_IO *note A.8.4(8): 6817.
126860 in Ada.Numerics.Discrete_Random *note A.5.2(21): 6639, *note
126861 A.5.2(24): 6642.
126862 in Ada.Numerics.Float_Random *note A.5.2(9): 6627, *note A.5.2(12):
126863 6630.
126864 in Ada.Sequential_IO *note A.8.1(8): 6788.
126865 in Ada.Streams.Stream_IO *note A.12.1(10): 7076.
126866 in Ada.Text_IO *note A.10.1(11): 6874.
126867
126868 Reverse_Elements
126869 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(27/2): 7365.
126870 in Ada.Containers.Vectors *note A.18.2(54/2): 7289.
126871
126872 Reverse_Find
126873 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(42/2): 7380.
126874 in Ada.Containers.Vectors *note A.18.2(70/2): 7305.
126875
126876 Reverse_Find_Index
126877 in Ada.Containers.Vectors *note A.18.2(69/2): 7304.
126878
126879 Reverse_Iterate
126880 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(46/2): 7383.
126881 in Ada.Containers.Ordered_Maps *note A.18.6(51/2): 7533.
126882 in Ada.Containers.Ordered_Sets *note A.18.9(61/2): 7694.
126883 in Ada.Containers.Vectors *note A.18.2(74/2): 7308.
126884
126885 Reverse_Iterate_Children
126886 in Ada.Containers.Multiway_Trees *note A.18.10(69/3): 7794.
126887
126888 Root in Ada.Containers.Multiway_Trees *note A.18.10(22/3): 7747.
126889
126890 Save
126891 in Ada.Numerics.Discrete_Random *note A.5.2(24): 6641.
126892 in Ada.Numerics.Float_Random *note A.5.2(12): 6629.
126893
126894 Save_Occurrence in Ada.Exceptions *note 11.4.1(6/2): 4944.
126895
126896 Second in Ada.Calendar.Formatting *note 9.6.1(26/2): 4512.
126897
126898 Seconds
126899 in Ada.Calendar *note 9.6(13): 4468.
126900 in Ada.Real_Time *note D.8(14/2): 8538.
126901
126902 Seconds_Of in Ada.Calendar.Formatting *note 9.6.1(28/2): 4514.
126903
126904 Set in Ada.Environment_Variables *note A.17(6/2): 7209.
126905
126906 Set_Bounded_String
126907 in Ada.Strings.Bounded *note A.4.4(12.1/2): 6309.
126908
126909 Set_Col in Ada.Text_IO *note A.10.1(35): 6920.
126910
126911 Set_CPU
126912 in System.Multiprocessors.Dispatching_Domains *note D.16.1(12/3):
126913 8680.
126914
126915 Set_Deadline in Ada.Dispatching.EDF *note D.2.6(9/2): 8398.
126916
126917 Set_Dependents_Fallback_Handler
126918 in Ada.Task_Termination *note C.7.3(5/2): 8308.
126919
126920 Set_Directory in Ada.Directories *note A.16(6/2): 7139.
126921
126922 Set_Error in Ada.Text_IO *note A.10.1(15): 6881.
126923
126924 Set_Exit_Status in Ada.Command_Line *note A.15(9): 7134.
126925
126926 Set_False
126927 in Ada.Synchronous_Task_Control *note D.10(4): 8557.
126928
126929 Set_Handler
126930 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8633.
126931 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8607.
126932 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8654.
126933
126934 Set_Im
126935 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(8/2): 9011,
126936 *note G.3.2(28/2): 9024.
126937 in Ada.Numerics.Generic_Complex_Types *note G.1.1(7): 8876.
126938
126939 Set_Index
126940 in Ada.Direct_IO *note A.8.4(14): 6826.
126941 in Ada.Streams.Stream_IO *note A.12.1(22): 7087.
126942
126943 Set_Input in Ada.Text_IO *note A.10.1(15): 6879.
126944
126945 Set_Length in Ada.Containers.Vectors *note A.18.2(22/2): 7250.
126946
126947 Set_Line in Ada.Text_IO *note A.10.1(36): 6922.
126948
126949 Set_Line_Length in Ada.Text_IO *note A.10.1(23): 6897.
126950
126951 Set_Mode in Ada.Streams.Stream_IO *note A.12.1(24): 7090.
126952
126953 Set_Output in Ada.Text_IO *note A.10.1(15): 6880.
126954
126955 Set_Page_Length in Ada.Text_IO *note A.10.1(24): 6899.
126956
126957 Set_Pool_of_Subpool
126958 in System.Storage_Pools.Subpools *note 13.11.4(10/3): 5700.
126959
126960 Set_Priority
126961 in Ada.Dynamic_Priorities *note D.5.1(4): 8444.
126962
126963 Set_Quantum
126964 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8388.
126965
126966 Set_Re
126967 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(8/2): 9010,
126968 *note G.3.2(28/2): 9023.
126969 in Ada.Numerics.Generic_Complex_Types *note G.1.1(7): 8874.
126970
126971 Set_Specific_Handler
126972 in Ada.Task_Termination *note C.7.3(6/2): 8310.
126973
126974 Set_True
126975 in Ada.Synchronous_Task_Control *note D.10(4): 8556.
126976
126977 Set_Unbounded_String
126978 in Ada.Strings.Unbounded *note A.4.5(11.1/2): 6371.
126979
126980 Set_Value in Ada.Task_Attributes *note C.7.2(6): 8297.
126981
126982 Simple_Name
126983 in Ada.Directories *note A.16(16/2): 7148, *note A.16(38/2): 7168.
126984 in Ada.Directories.Hierarchical_File_Names *note A.16.1(10/3):
126985 7198.
126986
126987 Sin
126988 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
126989 G.1.2(4): 8899.
126990 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6590.
126991
126992 Sinh
126993 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
126994 G.1.2(6): 8907.
126995 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6606.
126996
126997 Size
126998 in Ada.Direct_IO *note A.8.4(15): 6828.
126999 in Ada.Directories *note A.16(26/2): 7159, *note A.16(41/2): 7171.
127000 in Ada.Streams.Stream_IO *note A.12.1(23): 7089.
127001
127002 Skip_Line in Ada.Text_IO *note A.10.1(29): 6908.
127003
127004 Skip_Page in Ada.Text_IO *note A.10.1(32): 6914.
127005
127006 Slice
127007 in Ada.Strings.Bounded *note A.4.4(28): 6320.
127008 in Ada.Strings.Unbounded *note A.4.5(22): 6377.
127009
127010 Solve
127011 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9035.
127012 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8994.
127013
127014 Sort
127015 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(49/2): 7386.
127016 in Ada.Containers.Vectors *note A.18.2(77/2): 7311.
127017
127018 Specific_Handler
127019 in Ada.Task_Termination *note C.7.3(6/2): 8311.
127020
127021 Splice
127022 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(30/2): 7368,
127023 *note A.18.3(31/2): 7369, *note A.18.3(32/2): 7370.
127024
127025 Splice_Children
127026 in Ada.Containers.Multiway_Trees *note A.18.10(57/3): 7782, *note
127027 A.18.10(58/3): 7783.
127028
127029 Splice_Subtree
127030 in Ada.Containers.Multiway_Trees *note A.18.10(55/3): 7780, *note
127031 A.18.10(56/3): 7781.
127032
127033 Split
127034 in Ada.Calendar *note 9.6(14): 4469.
127035 in Ada.Calendar.Formatting *note 9.6.1(29/2): 4515, *note
127036 9.6.1(32/2): 4518, *note 9.6.1(33/2): 4519, *note 9.6.1(34/2): 4520.
127037 in Ada.Execution_Time *note D.14(8/2): 8592.
127038 in Ada.Real_Time *note D.8(16): 8541.
127039
127040 Sqrt
127041 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
127042 G.1.2(3): 8895.
127043 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6586.
127044
127045 Standard_Error in Ada.Text_IO *note A.10.1(16): 6884, *note
127046 A.10.1(19): 6891.
127047
127048 Standard_Input in Ada.Text_IO *note A.10.1(16): 6882, *note
127049 A.10.1(19): 6889.
127050
127051 Standard_Output in Ada.Text_IO *note A.10.1(16): 6883, *note
127052 A.10.1(19): 6890.
127053
127054 Start_Search in Ada.Directories *note A.16(32/2): 7164.
127055
127056 Storage_Size
127057 in System.Storage_Pools *note 13.11(9): 5626.
127058 in System.Storage_Pools.Subpools *note 13.11.4(16/3): 5706.
127059
127060 Stream
127061 in Ada.Streams.Stream_IO *note A.12.1(13): 7082.
127062 in Ada.Text_IO.Text_Streams *note A.12.2(4): 7106.
127063 in Ada.Wide_Text_IO.Text_Streams *note A.12.3(4): 7109.
127064 in Ada.Wide_Wide_Text_IO.Text_Streams *note A.12.4(4/2): 7112.
127065
127066 Strlen in Interfaces.C.Strings *note B.3.1(17): 8066.
127067
127068 Sub_Second in Ada.Calendar.Formatting *note 9.6.1(27/2): 4513.
127069
127070 Subtree_Node_Count
127071 in Ada.Containers.Multiway_Trees *note A.18.10(18/3): 7743.
127072
127073 Supported
127074 in Ada.Execution_Time.Interrupts *note D.14.3(3/3): 8648.
127075
127076 Suspend_Until_True
127077 in Ada.Synchronous_Task_Control *note D.10(4): 8559.
127078
127079 Suspend_Until_True_And_Set_Deadline
127080 in Ada.Synchronous_Task_Control.EDF *note D.10(5.2/3): 8561.
127081
127082 Swap
127083 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(28/2): 7366.
127084 in Ada.Containers.Multiway_Trees *note A.18.10(37/3): 7762.
127085 in Ada.Containers.Vectors *note A.18.2(55/2): 7290, *note
127086 A.18.2(56/2): 7291.
127087
127088 Swap_Links
127089 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(29/2): 7367.
127090
127091 Symmetric_Difference
127092 in Ada.Containers.Hashed_Sets *note A.18.8(35/2): 7601, *note
127093 A.18.8(36/2): 7602.
127094 in Ada.Containers.Ordered_Sets *note A.18.9(36/2): 7677, *note
127095 A.18.9(37/2): 7678.
127096
127097 Tail
127098 in Ada.Strings.Bounded *note A.4.4(72): 6354, *note A.4.4(73):
127099 6355.
127100 in Ada.Strings.Fixed *note A.4.3(37): 6295, *note A.4.3(38): 6296.
127101 in Ada.Strings.Unbounded *note A.4.5(67): 6411, *note A.4.5(68):
127102 6412.
127103
127104 Tan
127105 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
127106 G.1.2(4): 8901.
127107 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6594.
127108
127109 Tanh
127110 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
127111 G.1.2(6): 8909.
127112 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6608.
127113
127114 Time_Of
127115 in Ada.Calendar *note 9.6(15): 4470.
127116 in Ada.Calendar.Formatting *note 9.6.1(30/2): 4516, *note
127117 9.6.1(31/2): 4517.
127118 in Ada.Execution_Time *note D.14(9/2): 8593.
127119 in Ada.Real_Time *note D.8(16): 8542.
127120
127121 Time_Of_Event
127122 in Ada.Real_Time.Timing_Events *note D.15(6/2): 8657.
127123
127124 Time_Remaining
127125 in Ada.Execution_Time.Timers *note D.14.1(8/2): 8611.
127126
127127 To_Ada
127128 in Interfaces.C *note B.3(22): 8008, *note B.3(26): 8012, *note
127129 B.3(28): 8014, *note B.3(32): 8018, *note B.3(37): 8022, *note B.3(39):
127130 8024, *note B.3(39.10/2): 8034, *note B.3(39.13/2): 8038, *note
127131 B.3(39.17/2): 8042, *note B.3(39.19/2): 8044, *note B.3(39.4/2): 8028,
127132 *note B.3(39.8/2): 8032.
127133 in Interfaces.COBOL *note B.4(17): 8120, *note B.4(19): 8122.
127134 in Interfaces.Fortran *note B.5(13): 8173, *note B.5(14): 8175,
127135 *note B.5(16): 8177.
127136
127137 To_Address
127138 in System.Address_To_Access_Conversions *note 13.7.2(3/3): 5574.
127139 in System.Storage_Elements *note 13.7.1(10/3): 5566.
127140
127141 To_Basic in Ada.Characters.Handling *note A.3.2(6): 5926, *note
127142 A.3.2(7): 5929.
127143
127144 To_Binary in Interfaces.COBOL *note B.4(45): 8152, *note B.4(48):
127145 8155.
127146
127147 To_Bounded_String
127148 in Ada.Strings.Bounded *note A.4.4(11): 6307.
127149
127150 To_C in Interfaces.C *note B.3(21): 8007, *note B.3(25): 8011, *note
127151 B.3(27): 8013, *note B.3(32): 8017, *note B.3(36): 8021, *note B.3(38):
127152 8023, *note B.3(39.13/2): 8037, *note B.3(39.16/2): 8041, *note
127153 B.3(39.18/2): 8043, *note B.3(39.4/2): 8027, *note B.3(39.7/2): 8031,
127154 *note B.3(39.9/2): 8033.
127155
127156 To_Character
127157 in Ada.Characters.Conversions *note A.3.4(5/2): 6193.
127158
127159 To_Chars_Ptr in Interfaces.C.Strings *note B.3.1(8): 8057.
127160
127161 To_COBOL in Interfaces.COBOL *note B.4(17): 8119, *note B.4(18): 8121.
127162
127163 To_Cursor in Ada.Containers.Vectors *note A.18.2(25/2): 7253.
127164
127165 To_Decimal in Interfaces.COBOL *note B.4(35): 8143, *note B.4(40):
127166 8147, *note B.4(44): 8151, *note B.4(47): 8153.
127167
127168 To_Display in Interfaces.COBOL *note B.4(36): 8144.
127169
127170 To_Domain
127171 in Ada.Strings.Maps *note A.4.2(24): 6255.
127172 in Ada.Strings.Wide_Maps *note A.4.7(24): 6467.
127173 in Ada.Strings.Wide_Wide_Maps *note A.4.8(24/2): 6509.
127174
127175 To_Duration in Ada.Real_Time *note D.8(13): 8533.
127176
127177 To_Fortran in Interfaces.Fortran *note B.5(13): 8172, *note B.5(14):
127178 8174, *note B.5(15): 8176.
127179
127180 To_Holder
127181 in Ada.Containers.Indefinite_Holders *note A.18.18(9/3): 7827.
127182
127183 To_Index in Ada.Containers.Vectors *note A.18.2(26/2): 7254.
127184
127185 To_Integer in System.Storage_Elements *note 13.7.1(10/3): 5567.
127186
127187 To_ISO_646 in Ada.Characters.Handling *note A.3.2(11): 5933, *note
127188 A.3.2(12): 5934.
127189
127190 To_Long_Binary in Interfaces.COBOL *note B.4(48): 8156.
127191
127192 To_Lower
127193 in Ada.Characters.Handling *note A.3.2(6): 5924, *note A.3.2(7):
127194 5927.
127195 in Ada.Wide_Characters.Handling *note A.3.5(20/3): 6215, *note
127196 A.3.5(21/3): 6217.
127197
127198 To_Mapping
127199 in Ada.Strings.Maps *note A.4.2(23): 6254.
127200 in Ada.Strings.Wide_Maps *note A.4.7(23): 6466.
127201 in Ada.Strings.Wide_Wide_Maps *note A.4.8(23/2): 6508.
127202
127203 To_Packed in Interfaces.COBOL *note B.4(41): 8148.
127204
127205 To_Picture in Ada.Text_IO.Editing *note F.3.3(6): 8843.
127206
127207 To_Pointer
127208 in System.Address_To_Access_Conversions *note 13.7.2(3/3): 5573.
127209
127210 To_Range
127211 in Ada.Strings.Maps *note A.4.2(24): 6256.
127212 in Ada.Strings.Wide_Maps *note A.4.7(25): 6468.
127213 in Ada.Strings.Wide_Wide_Maps *note A.4.8(25/2): 6510.
127214
127215 To_Ranges
127216 in Ada.Strings.Maps *note A.4.2(10): 6244.
127217 in Ada.Strings.Wide_Maps *note A.4.7(10): 6456.
127218 in Ada.Strings.Wide_Wide_Maps *note A.4.8(10/2): 6498.
127219
127220 To_Sequence
127221 in Ada.Strings.Maps *note A.4.2(19): 6250.
127222 in Ada.Strings.Wide_Maps *note A.4.7(19): 6462.
127223 in Ada.Strings.Wide_Wide_Maps *note A.4.8(19/2): 6504.
127224
127225 To_Set
127226 in Ada.Containers.Hashed_Sets *note A.18.8(9/2): 7575.
127227 in Ada.Containers.Ordered_Sets *note A.18.9(10/2): 7651.
127228 in Ada.Strings.Maps *note A.4.2(8): 6242, *note A.4.2(9): 6243,
127229 *note A.4.2(17): 6248, *note A.4.2(18): 6249.
127230 in Ada.Strings.Wide_Maps *note A.4.7(8): 6454, *note A.4.7(9):
127231 6455, *note A.4.7(17): 6460, *note A.4.7(18): 6461.
127232 in Ada.Strings.Wide_Wide_Maps *note A.4.8(8/2): 6496, *note
127233 A.4.8(9/2): 6497, *note A.4.8(17/2): 6502, *note A.4.8(18/2): 6503.
127234
127235 To_String
127236 in Ada.Characters.Conversions *note A.3.4(5/2): 6192.
127237 in Ada.Strings.Bounded *note A.4.4(12): 6308.
127238 in Ada.Strings.Unbounded *note A.4.5(11): 6370.
127239
127240 To_Time_Span in Ada.Real_Time *note D.8(13): 8534.
127241
127242 To_Unbounded_String
127243 in Ada.Strings.Unbounded *note A.4.5(9): 6368, *note A.4.5(10):
127244 6369.
127245
127246 To_Upper
127247 in Ada.Characters.Handling *note A.3.2(6): 5925, *note A.3.2(7):
127248 5928.
127249 in Ada.Wide_Characters.Handling *note A.3.5(20/3): 6216, *note
127250 A.3.5(21/3): 6218.
127251
127252 To_Vector in Ada.Containers.Vectors *note A.18.2(13/2): 7245, *note
127253 A.18.2(14/2): 7246.
127254
127255 To_Wide_Character
127256 in Ada.Characters.Conversions *note A.3.4(4/2): 6185, *note
127257 A.3.4(5/2): 6195.
127258
127259 To_Wide_String
127260 in Ada.Characters.Conversions *note A.3.4(4/2): 6186, *note
127261 A.3.4(5/2): 6196.
127262
127263 To_Wide_Wide_Character
127264 in Ada.Characters.Conversions *note A.3.4(4/2): 6189.
127265
127266 To_Wide_Wide_String
127267 in Ada.Characters.Conversions *note A.3.4(4/2): 6190.
127268
127269 Translate
127270 in Ada.Strings.Bounded *note A.4.4(53): 6336, *note A.4.4(54):
127271 6337, *note A.4.4(55): 6338, *note A.4.4(56): 6339.
127272 in Ada.Strings.Fixed *note A.4.3(18): 6277, *note A.4.3(19): 6278,
127273 *note A.4.3(20): 6279, *note A.4.3(21): 6280.
127274 in Ada.Strings.Unbounded *note A.4.5(48): 6393, *note A.4.5(49):
127275 6394, *note A.4.5(50): 6395, *note A.4.5(51): 6396.
127276
127277 Transpose
127278 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(34/2): 9033.
127279 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(17/2): 8992.
127280
127281 Trim
127282 in Ada.Strings.Bounded *note A.4.4(67): 6348, *note A.4.4(68):
127283 6350, *note A.4.4(69): 6351.
127284 in Ada.Strings.Fixed *note A.4.3(31): 6289, *note A.4.3(32): 6290,
127285 *note A.4.3(33): 6291, *note A.4.3(34): 6292.
127286 in Ada.Strings.Unbounded *note A.4.5(61): 6405, *note A.4.5(62):
127287 6406, *note A.4.5(63): 6407, *note A.4.5(64): 6408.
127288
127289 Unbounded_Slice
127290 in Ada.Strings.Unbounded *note A.4.5(22.1/2): 6378, *note
127291 A.4.5(22.2/2): 6379.
127292
127293 Unchecked_Conversion
127294 child of Ada *note 13.9(3/3): 5590.
127295
127296 Unchecked_Deallocation
127297 child of Ada *note 13.11.2(3/3): 5669.
127298
127299 Union
127300 in Ada.Containers.Hashed_Sets *note A.18.8(26/2): 7595, *note
127301 A.18.8(27/2): 7596.
127302 in Ada.Containers.Ordered_Sets *note A.18.9(27/2): 7671, *note
127303 A.18.9(28/2): 7672.
127304
127305 Unit_Matrix
127306 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(51/2): 9040.
127307 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(29/2): 8999.
127308
127309 Unit_Vector
127310 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(24/2): 9020.
127311 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(14/2): 8991.
127312
127313 Update in Interfaces.C.Strings *note B.3.1(18): 8067, *note B.3.1(19):
127314 8068.
127315
127316 Update_Element
127317 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17/2): 7350.
127318 in Ada.Containers.Hashed_Maps *note A.18.5(17/2): 7444.
127319 in Ada.Containers.Indefinite_Holders *note A.18.18(15/3): 7833.
127320 in Ada.Containers.Multiway_Trees *note A.18.10(27/3): 7752.
127321 in Ada.Containers.Ordered_Maps *note A.18.6(16/2): 7498.
127322 in Ada.Containers.Vectors *note A.18.2(33/2): 7261, *note
127323 A.18.2(34/2): 7262.
127324
127325 Update_Element_Preserving_Key
127326 in Ada.Containers.Hashed_Sets *note A.18.8(58/2): 7622.
127327 in Ada.Containers.Ordered_Sets *note A.18.9(73/2): 7706.
127328
127329 Update_Error in Interfaces.C.Strings *note B.3.1(20): 8069.
127330
127331 UTC_Time_Offset
127332 in Ada.Calendar.Time_Zones *note 9.6.1(6/2): 4488.
127333
127334 Valid
127335 in Ada.Text_IO.Editing *note F.3.3(5): 8842, *note F.3.3(12): 8854.
127336 in Interfaces.COBOL *note B.4(33): 8141, *note B.4(38): 8145, *note
127337 B.4(43): 8149.
127338
127339 Value
127340 in Ada.Calendar.Formatting *note 9.6.1(36/2): 4522, *note
127341 9.6.1(38/2): 4524.
127342 in Ada.Environment_Variables *note A.17(4.1/3): 7207, *note
127343 A.17(4/2): 7206.
127344 in Ada.Numerics.Discrete_Random *note A.5.2(26): 6645.
127345 in Ada.Numerics.Float_Random *note A.5.2(14): 6633.
127346 in Ada.Strings.Maps *note A.4.2(21): 6252.
127347 in Ada.Strings.Wide_Maps *note A.4.7(21): 6464.
127348 in Ada.Strings.Wide_Wide_Maps *note A.4.8(21/2): 6506.
127349 in Ada.Task_Attributes *note C.7.2(4): 8295.
127350 in Interfaces.C.Pointers *note B.3.2(6): 8078, *note B.3.2(7):
127351 8079.
127352 in Interfaces.C.Strings *note B.3.1(13): 8062, *note B.3.1(14):
127353 8063, *note B.3.1(15): 8064, *note B.3.1(16): 8065.
127354
127355 Virtual_Length
127356 in Interfaces.C.Pointers *note B.3.2(13): 8083.
127357
127358 Wait_For_Release
127359 in Ada.Synchronous_Barriers *note D.10.1(6/3): 8570.
127360
127361 Wide_Equal_Case_Insensitive
127362 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6442.
127363 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6441.
127364 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6443.
127365
127366 Wide_Hash
127367 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6438.
127368 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6437.
127369 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6439.
127370
127371 Wide_Hash_Case_Insensitive
127372 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6446.
127373 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6445.
127374 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6447.
127375
127376 Wide_Exception_Name in Ada.Exceptions *note 11.4.1(2/2): 4931, *note
127377 11.4.1(5/2): 4941.
127378
127379 Wide_Expanded_Name in Ada.Tags *note 3.9(7/2): 2233.
127380
127381 Wide_Wide_Equal_Case_Insensitive
127382 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6484.
127383 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6483.
127384 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6485.
127385
127386 Wide_Wide_Hash
127387 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6480.
127388 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6479.
127389 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6481.
127390
127391 Wide_Wide_Hash_Case_Insensitive
127392 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6488.
127393 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6487.
127394 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6489.
127395
127396 Wide_Wide_Exception_Name
127397 in Ada.Exceptions *note 11.4.1(2/2): 4932, *note 11.4.1(5/2): 4942.
127398
127399 Wide_Wide_Expanded_Name in Ada.Tags *note 3.9(7/2): 2234.
127400
127401 Write
127402 in Ada.Direct_IO *note A.8.4(13): 6824.
127403 in Ada.Sequential_IO *note A.8.1(12): 6795.
127404 in Ada.Storage_IO *note A.9(7): 6843.
127405 in Ada.Streams *note 13.13.1(6): 5784.
127406 in Ada.Streams.Stream_IO *note A.12.1(18): 7085, *note A.12.1(19):
127407 7086.
127408 in System.RPC *note E.5(8): 8813.
127409
127410 Year
127411 in Ada.Calendar *note 9.6(13): 4465.
127412 in Ada.Calendar.Formatting *note 9.6.1(21/2): 4507.
127413
127414 Yield in Ada.Dispatching *note D.2.1(1.3/3): 8339.
127415
127416 Yield_To_Higher
127417 in Ada.Dispatching.Non_Preemptive *note D.2.4(2.2/3): 8378.
127418
127419 Yield_To_Same_Or_Higher
127420 in Ada.Dispatching.Non_Preemptive *note D.2.4(2.2/3): 8379.
127421
127422 \1f
127423 File: aarm2012.info, Node: Q.4, Next: Q.5, Prev: Q.3, Up: Annex Q
127424
127425 Q.4 Language-Defined Exceptions
127426 ===============================
127427
127428 1/3
127429 {AI95-00440-01AI95-00440-01} {AI05-0299-1AI05-0299-1} This subclause
127430 lists all language-defined exceptions.
127431
127432
127433
127434 Argument_Error
127435 in Ada.Numerics *note A.5(3/2): 6580.
127436
127437 Assertion_Error
127438 in Ada.Assertions *note 11.4.2(13/2): 4972.
127439
127440 Capacity_Error
127441 in Ada.Containers *note A.18.1(5.1/3): 7228.
127442
127443 Communication_Error
127444 in System.RPC *note E.5(5): 8810.
127445
127446 Constraint_Error
127447 in Standard *note A.1(46): 5893.
127448
127449 Conversion_Error
127450 in Interfaces.COBOL *note B.4(30): 8139.
127451
127452 Data_Error
127453 in Ada.Direct_IO *note A.8.4(18): 6836.
127454 in Ada.IO_Exceptions *note A.13(4): 7121.
127455 in Ada.Sequential_IO *note A.8.1(15): 6803.
127456 in Ada.Storage_IO *note A.9(9): 6844.
127457 in Ada.Streams.Stream_IO *note A.12.1(26): 7098.
127458 in Ada.Text_IO *note A.10.1(85): 7012.
127459
127460 Device_Error
127461 in Ada.Direct_IO *note A.8.4(18): 6834.
127462 in Ada.Directories *note A.16(43/2): 7176.
127463 in Ada.IO_Exceptions *note A.13(4): 7119.
127464 in Ada.Sequential_IO *note A.8.1(15): 6801.
127465 in Ada.Streams.Stream_IO *note A.12.1(26): 7096.
127466 in Ada.Text_IO *note A.10.1(85): 7010.
127467
127468 Dispatching_Domain_Error
127469 in System.Multiprocessors.Dispatching_Domains *note D.16.1(4/3):
127470 8672.
127471
127472 Dispatching_Policy_Error
127473 in Ada.Dispatching *note D.2.1(1.4/3): 8340.
127474
127475 Encoding_Error
127476 in Ada.Strings.UTF_Encoding *note A.4.11(8/3): 6541.
127477
127478 End_Error
127479 in Ada.Direct_IO *note A.8.4(18): 6835.
127480 in Ada.IO_Exceptions *note A.13(4): 7120.
127481 in Ada.Sequential_IO *note A.8.1(15): 6802.
127482 in Ada.Streams.Stream_IO *note A.12.1(26): 7097.
127483 in Ada.Text_IO *note A.10.1(85): 7011.
127484
127485 Group_Budget_Error
127486 in Ada.Execution_Time.Group_Budgets *note D.14.2(11/2): 8636.
127487
127488 Index_Error
127489 in Ada.Strings *note A.4.1(5): 6229.
127490
127491 Layout_Error
127492 in Ada.IO_Exceptions *note A.13(4): 7122.
127493 in Ada.Text_IO *note A.10.1(85): 7013.
127494
127495 Length_Error
127496 in Ada.Strings *note A.4.1(5): 6227.
127497
127498 Mode_Error
127499 in Ada.Direct_IO *note A.8.4(18): 6831.
127500 in Ada.IO_Exceptions *note A.13(4): 7116.
127501 in Ada.Sequential_IO *note A.8.1(15): 6798.
127502 in Ada.Streams.Stream_IO *note A.12.1(26): 7093.
127503 in Ada.Text_IO *note A.10.1(85): 7007.
127504
127505 Name_Error
127506 in Ada.Direct_IO *note A.8.4(18): 6832.
127507 in Ada.Directories *note A.16(43/2): 7174.
127508 in Ada.IO_Exceptions *note A.13(4): 7117.
127509 in Ada.Sequential_IO *note A.8.1(15): 6799.
127510 in Ada.Streams.Stream_IO *note A.12.1(26): 7094.
127511 in Ada.Text_IO *note A.10.1(85): 7008.
127512
127513 Pattern_Error
127514 in Ada.Strings *note A.4.1(5): 6228.
127515
127516 Picture_Error
127517 in Ada.Text_IO.Editing *note F.3.3(9): 8847.
127518
127519 Pointer_Error
127520 in Interfaces.C.Pointers *note B.3.2(8): 8080.
127521
127522 Program_Error
127523 in Standard *note A.1(46): 5894.
127524
127525 Status_Error
127526 in Ada.Direct_IO *note A.8.4(18): 6830.
127527 in Ada.Directories *note A.16(43/2): 7173.
127528 in Ada.IO_Exceptions *note A.13(4): 7115.
127529 in Ada.Sequential_IO *note A.8.1(15): 6797.
127530 in Ada.Streams.Stream_IO *note A.12.1(26): 7092.
127531 in Ada.Text_IO *note A.10.1(85): 7006.
127532
127533 Storage_Error
127534 in Standard *note A.1(46): 5895.
127535
127536 Tag_Error
127537 in Ada.Tags *note 3.9(8): 2243.
127538
127539 Tasking_Error
127540 in Standard *note A.1(46): 5896.
127541
127542 Terminator_Error
127543 in Interfaces.C *note B.3(40): 8045.
127544
127545 Time_Error
127546 in Ada.Calendar *note 9.6(18): 4471.
127547
127548 Timer_Resource_Error
127549 in Ada.Execution_Time.Timers *note D.14.1(9/2): 8612.
127550
127551 Translation_Error
127552 in Ada.Strings *note A.4.1(5): 6230.
127553
127554 Unknown_Zone_Error
127555 in Ada.Calendar.Time_Zones *note 9.6.1(5/2): 4487.
127556
127557 Use_Error
127558 in Ada.Direct_IO *note A.8.4(18): 6833.
127559 in Ada.Directories *note A.16(43/2): 7175.
127560 in Ada.IO_Exceptions *note A.13(4): 7118.
127561 in Ada.Sequential_IO *note A.8.1(15): 6800.
127562 in Ada.Streams.Stream_IO *note A.12.1(26): 7095.
127563 in Ada.Text_IO *note A.10.1(85): 7009.
127564
127565 \1f
127566 File: aarm2012.info, Node: Q.5, Prev: Q.4, Up: Annex Q
127567
127568 Q.5 Language-Defined Objects
127569 ============================
127570
127571 1/3
127572 {AI95-00440-01AI95-00440-01} {AI05-0299-1AI05-0299-1} This subclause
127573 lists all language-defined constants, variables, named numbers, and
127574 enumeration literals.
127575
127576 1.a/2
127577 To be honest: Formally, named numbers and enumeration literals
127578 aren't objects, but it was thought to be too weird to say
127579 "Language-Defined Objects and Values".
127580
127581
127582
127583 ACK in Ada.Characters.Latin_1 *note A.3.3(5): 5955.
127584
127585 Acute in Ada.Characters.Latin_1 *note A.3.3(22): 6101.
127586
127587 Ada_To_COBOL in Interfaces.COBOL *note B.4(14): 8116.
127588
127589 Alphanumeric_Set
127590 in Ada.Strings.Maps.Constants *note A.4.6(4): 6426.
127591
127592 Ampersand in Ada.Characters.Latin_1 *note A.3.3(8): 5987.
127593
127594 APC in Ada.Characters.Latin_1 *note A.3.3(19): 6078.
127595
127596 Apostrophe in Ada.Characters.Latin_1 *note A.3.3(8): 5988.
127597
127598 Asterisk in Ada.Characters.Latin_1 *note A.3.3(8): 5991.
127599
127600 Basic_Map
127601 in Ada.Strings.Maps.Constants *note A.4.6(5): 6431.
127602
127603 Basic_Set
127604 in Ada.Strings.Maps.Constants *note A.4.6(4): 6423.
127605
127606 BEL in Ada.Characters.Latin_1 *note A.3.3(5): 5956.
127607
127608 BOM_16 in Ada.Strings.UTF_Encoding *note A.4.11(12/3): 6545.
127609
127610 BOM_16BE in Ada.Strings.UTF_Encoding *note A.4.11(10/3): 6543.
127611
127612 BOM_16LE in Ada.Strings.UTF_Encoding *note A.4.11(11/3): 6544.
127613
127614 BOM_8 in Ada.Strings.UTF_Encoding *note A.4.11(9/3): 6542.
127615
127616 BPH in Ada.Characters.Latin_1 *note A.3.3(17): 6049.
127617
127618 Broken_Bar in Ada.Characters.Latin_1 *note A.3.3(21/3): 6086.
127619
127620 BS in Ada.Characters.Latin_1 *note A.3.3(5): 5957.
127621
127622 Buffer_Size in Ada.Storage_IO *note A.9(4): 6840.
127623
127624 CAN in Ada.Characters.Latin_1 *note A.3.3(6): 5973.
127625
127626 CCH in Ada.Characters.Latin_1 *note A.3.3(18): 6067.
127627
127628 Cedilla in Ada.Characters.Latin_1 *note A.3.3(22): 6106.
127629
127630 Cent_Sign in Ada.Characters.Latin_1 *note A.3.3(21/3): 6082.
127631
127632 char16_nul in Interfaces.C *note B.3(39.3/2): 8026.
127633
127634 char32_nul in Interfaces.C *note B.3(39.12/2): 8036.
127635
127636 CHAR_BIT in Interfaces.C *note B.3(6): 7987.
127637
127638 Character_Set
127639 in Ada.Strings.Wide_Maps *note A.4.7(46/2): 6470.
127640 in Ada.Strings.Wide_Maps.Wide_Constants *note A.4.8(48/2): 6513.
127641
127642 Circumflex in Ada.Characters.Latin_1 *note A.3.3(12): 6008.
127643
127644 COBOL_To_Ada in Interfaces.COBOL *note B.4(15): 8117.
127645
127646 Colon in Ada.Characters.Latin_1 *note A.3.3(10): 5998.
127647
127648 Comma in Ada.Characters.Latin_1 *note A.3.3(8): 5993.
127649
127650 Commercial_At
127651 in Ada.Characters.Latin_1 *note A.3.3(10): 6004.
127652
127653 Control_Set
127654 in Ada.Strings.Maps.Constants *note A.4.6(4): 6418.
127655
127656 Copyright_Sign
127657 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6089.
127658
127659 Country_Unknown in Ada.Locales *note A.19(5/3): 7929.
127660
127661 CPU_Tick in Ada.Execution_Time *note D.14(4/2): 8590.
127662
127663 CPU_Time_First in Ada.Execution_Time *note D.14(4/2): 8587.
127664
127665 CPU_Time_Last in Ada.Execution_Time *note D.14(4/2): 8588.
127666
127667 CPU_Time_Unit in Ada.Execution_Time *note D.14(4/2): 8589.
127668
127669 CR in Ada.Characters.Latin_1 *note A.3.3(5): 5962.
127670
127671 CSI in Ada.Characters.Latin_1 *note A.3.3(19): 6074.
127672
127673 Currency_Sign
127674 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6084.
127675
127676 DC1 in Ada.Characters.Latin_1 *note A.3.3(6): 5966.
127677
127678 DC2 in Ada.Characters.Latin_1 *note A.3.3(6): 5967.
127679
127680 DC3 in Ada.Characters.Latin_1 *note A.3.3(6): 5968.
127681
127682 DC4 in Ada.Characters.Latin_1 *note A.3.3(6): 5969.
127683
127684 DCS in Ada.Characters.Latin_1 *note A.3.3(18): 6063.
127685
127686 Decimal_Digit_Set
127687 in Ada.Strings.Maps.Constants *note A.4.6(4): 6424.
127688
127689 Default_Aft
127690 in Ada.Text_IO *note A.10.1(64): 6969, *note A.10.1(69): 6979,
127691 *note A.10.1(74): 6989.
127692 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8925.
127693
127694 Default_Base in Ada.Text_IO *note A.10.1(53): 6951, *note A.10.1(58):
127695 6960.
127696
127697 Default_Bit_Order in System *note 13.7(15/2): 5551.
127698
127699 Default_Currency
127700 in Ada.Text_IO.Editing *note F.3.3(10): 8848.
127701
127702 Default_Deadline
127703 in Ada.Dispatching.EDF *note D.2.6(9/2): 8397.
127704
127705 Default_Exp
127706 in Ada.Text_IO *note A.10.1(64): 6970, *note A.10.1(69): 6980,
127707 *note A.10.1(74): 6990.
127708 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8926.
127709
127710 Default_Fill in Ada.Text_IO.Editing *note F.3.3(10): 8849.
127711
127712 Default_Fore
127713 in Ada.Text_IO *note A.10.1(64): 6968, *note A.10.1(69): 6978,
127714 *note A.10.1(74): 6988.
127715 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8924.
127716
127717 Default_Priority in System *note 13.7(17): 5555.
127718
127719 Default_Quantum
127720 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8387.
127721
127722 Default_Radix_Mark
127723 in Ada.Text_IO.Editing *note F.3.3(10): 8851.
127724
127725 Default_Separator
127726 in Ada.Text_IO.Editing *note F.3.3(10): 8850.
127727
127728 Default_Setting in Ada.Text_IO *note A.10.1(80): 6999.
127729
127730 Default_Width in Ada.Text_IO *note A.10.1(53): 6950, *note A.10.1(58):
127731 6959, *note A.10.1(80): 6998.
127732
127733 Degree_Sign in Ada.Characters.Latin_1 *note A.3.3(22): 6096.
127734
127735 DEL in Ada.Characters.Latin_1 *note A.3.3(14): 6041.
127736
127737 Diaeresis in Ada.Characters.Latin_1 *note A.3.3(21/3): 6088.
127738
127739 Division_Sign
127740 in Ada.Characters.Latin_1 *note A.3.3(26): 6169.
127741
127742 DLE in Ada.Characters.Latin_1 *note A.3.3(6): 5965.
127743
127744 Dollar_Sign in Ada.Characters.Latin_1 *note A.3.3(8): 5985.
127745
127746 e in Ada.Numerics *note A.5(3/2): 6582.
127747
127748 EM in Ada.Characters.Latin_1 *note A.3.3(6): 5974.
127749
127750 Empty_Holder
127751 in Ada.Containers.Indefinite_Holders *note A.18.18(7/3): 7826.
127752
127753 Empty_List
127754 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(8/2): 7340.
127755
127756 Empty_Map
127757 in Ada.Containers.Hashed_Maps *note A.18.5(5/2): 7431.
127758 in Ada.Containers.Ordered_Maps *note A.18.6(6/2): 7487.
127759
127760 Empty_Set
127761 in Ada.Containers.Hashed_Sets *note A.18.8(5/2): 7570.
127762 in Ada.Containers.Ordered_Sets *note A.18.9(6/2): 7646.
127763
127764 Empty_Tree
127765 in Ada.Containers.Multiway_Trees *note A.18.10(10/3): 7736.
127766
127767 Empty_Vector
127768 in Ada.Containers.Vectors *note A.18.2(10/2): 7241.
127769
127770 ENQ in Ada.Characters.Latin_1 *note A.3.3(5): 5954.
127771
127772 EOT in Ada.Characters.Latin_1 *note A.3.3(5): 5953.
127773
127774 EPA in Ada.Characters.Latin_1 *note A.3.3(18): 6070.
127775
127776 Equals_Sign in Ada.Characters.Latin_1 *note A.3.3(10): 6001.
127777
127778 ESA in Ada.Characters.Latin_1 *note A.3.3(17): 6054.
127779
127780 ESC in Ada.Characters.Latin_1 *note A.3.3(6): 5976.
127781
127782 ETB in Ada.Characters.Latin_1 *note A.3.3(6): 5972.
127783
127784 ETX in Ada.Characters.Latin_1 *note A.3.3(5): 5952.
127785
127786 Exclamation in Ada.Characters.Latin_1 *note A.3.3(8): 5982.
127787
127788 Failure in Ada.Command_Line *note A.15(8): 7133.
127789
127790 Feminine_Ordinal_Indicator
127791 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6090.
127792
127793 FF in Ada.Characters.Latin_1 *note A.3.3(5): 5961.
127794
127795 Fine_Delta in System *note 13.7(9): 5540.
127796
127797 Fraction_One_Half
127798 in Ada.Characters.Latin_1 *note A.3.3(22): 6111.
127799
127800 Fraction_One_Quarter
127801 in Ada.Characters.Latin_1 *note A.3.3(22): 6110.
127802
127803 Fraction_Three_Quarters
127804 in Ada.Characters.Latin_1 *note A.3.3(22): 6112.
127805
127806 Friday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4499.
127807
127808 FS in Ada.Characters.Latin_1 *note A.3.3(6): 5977.
127809
127810 Full_Stop in Ada.Characters.Latin_1 *note A.3.3(8): 5996.
127811
127812 Graphic_Set
127813 in Ada.Strings.Maps.Constants *note A.4.6(4): 6419.
127814
127815 Grave in Ada.Characters.Latin_1 *note A.3.3(13): 6010.
127816
127817 Greater_Than_Sign
127818 in Ada.Characters.Latin_1 *note A.3.3(10): 6002.
127819
127820 GS in Ada.Characters.Latin_1 *note A.3.3(6): 5978.
127821
127822 Hexadecimal_Digit_Set
127823 in Ada.Strings.Maps.Constants *note A.4.6(4): 6425.
127824
127825 High_Order_First
127826 in Interfaces.COBOL *note B.4(25): 8131.
127827 in System *note 13.7(15/2): 5549.
127828
127829 HT in Ada.Characters.Latin_1 *note A.3.3(5): 5958.
127830
127831 HTJ in Ada.Characters.Latin_1 *note A.3.3(17): 6056.
127832
127833 HTS in Ada.Characters.Latin_1 *note A.3.3(17): 6055.
127834
127835 Hyphen in Ada.Characters.Latin_1 *note A.3.3(8): 5994.
127836
127837 i
127838 in Ada.Numerics.Generic_Complex_Types *note G.1.1(5): 8869.
127839 in Interfaces.Fortran *note B.5(10): 8168.
127840
127841 Identity
127842 in Ada.Strings.Maps *note A.4.2(22): 6253.
127843 in Ada.Strings.Wide_Maps *note A.4.7(22): 6465.
127844 in Ada.Strings.Wide_Wide_Maps *note A.4.8(22/2): 6507.
127845
127846 Interrupt_Clocks_Supported
127847 in Ada.Execution_Time *note D.14(9.1/3): 8594.
127848
127849 Inverted_Exclamation
127850 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6081.
127851
127852 Inverted_Question
127853 in Ada.Characters.Latin_1 *note A.3.3(22): 6113.
127854
127855 IS1 in Ada.Characters.Latin_1 *note A.3.3(16): 6046.
127856
127857 IS2 in Ada.Characters.Latin_1 *note A.3.3(16): 6045.
127858
127859 IS3 in Ada.Characters.Latin_1 *note A.3.3(16): 6044.
127860
127861 IS4 in Ada.Characters.Latin_1 *note A.3.3(16): 6043.
127862
127863 ISO_646_Set
127864 in Ada.Strings.Maps.Constants *note A.4.6(4): 6428.
127865
127866 j
127867 in Ada.Numerics.Generic_Complex_Types *note G.1.1(5): 8870.
127868 in Interfaces.Fortran *note B.5(10): 8169.
127869
127870 Language_Unknown in Ada.Locales *note A.19(5/3): 7928.
127871
127872 LC_A in Ada.Characters.Latin_1 *note A.3.3(13): 6011.
127873
127874 LC_A_Acute in Ada.Characters.Latin_1 *note A.3.3(25): 6147.
127875
127876 LC_A_Circumflex
127877 in Ada.Characters.Latin_1 *note A.3.3(25): 6148.
127878
127879 LC_A_Diaeresis
127880 in Ada.Characters.Latin_1 *note A.3.3(25): 6150.
127881
127882 LC_A_Grave in Ada.Characters.Latin_1 *note A.3.3(25): 6146.
127883
127884 LC_A_Ring in Ada.Characters.Latin_1 *note A.3.3(25): 6151.
127885
127886 LC_A_Tilde in Ada.Characters.Latin_1 *note A.3.3(25): 6149.
127887
127888 LC_AE_Diphthong
127889 in Ada.Characters.Latin_1 *note A.3.3(25): 6152.
127890
127891 LC_B in Ada.Characters.Latin_1 *note A.3.3(13): 6012.
127892
127893 LC_C in Ada.Characters.Latin_1 *note A.3.3(13): 6013.
127894
127895 LC_C_Cedilla
127896 in Ada.Characters.Latin_1 *note A.3.3(25): 6153.
127897
127898 LC_D in Ada.Characters.Latin_1 *note A.3.3(13): 6014.
127899
127900 LC_E in Ada.Characters.Latin_1 *note A.3.3(13): 6015.
127901
127902 LC_E_Acute in Ada.Characters.Latin_1 *note A.3.3(25): 6155.
127903
127904 LC_E_Circumflex
127905 in Ada.Characters.Latin_1 *note A.3.3(25): 6156.
127906
127907 LC_E_Diaeresis
127908 in Ada.Characters.Latin_1 *note A.3.3(25): 6157.
127909
127910 LC_E_Grave in Ada.Characters.Latin_1 *note A.3.3(25): 6154.
127911
127912 LC_F in Ada.Characters.Latin_1 *note A.3.3(13): 6016.
127913
127914 LC_G in Ada.Characters.Latin_1 *note A.3.3(13): 6017.
127915
127916 LC_German_Sharp_S
127917 in Ada.Characters.Latin_1 *note A.3.3(24): 6145.
127918
127919 LC_H in Ada.Characters.Latin_1 *note A.3.3(13): 6018.
127920
127921 LC_I in Ada.Characters.Latin_1 *note A.3.3(13): 6019.
127922
127923 LC_I_Acute in Ada.Characters.Latin_1 *note A.3.3(25): 6159.
127924
127925 LC_I_Circumflex
127926 in Ada.Characters.Latin_1 *note A.3.3(25): 6160.
127927
127928 LC_I_Diaeresis
127929 in Ada.Characters.Latin_1 *note A.3.3(25): 6161.
127930
127931 LC_I_Grave in Ada.Characters.Latin_1 *note A.3.3(25): 6158.
127932
127933 LC_Icelandic_Eth
127934 in Ada.Characters.Latin_1 *note A.3.3(26): 6162.
127935
127936 LC_Icelandic_Thorn
127937 in Ada.Characters.Latin_1 *note A.3.3(26): 6176.
127938
127939 LC_J in Ada.Characters.Latin_1 *note A.3.3(13): 6020.
127940
127941 LC_K in Ada.Characters.Latin_1 *note A.3.3(13): 6021.
127942
127943 LC_L in Ada.Characters.Latin_1 *note A.3.3(13): 6022.
127944
127945 LC_M in Ada.Characters.Latin_1 *note A.3.3(13): 6023.
127946
127947 LC_N in Ada.Characters.Latin_1 *note A.3.3(13): 6024.
127948
127949 LC_N_Tilde in Ada.Characters.Latin_1 *note A.3.3(26): 6163.
127950
127951 LC_O in Ada.Characters.Latin_1 *note A.3.3(13): 6025.
127952
127953 LC_O_Acute in Ada.Characters.Latin_1 *note A.3.3(26): 6165.
127954
127955 LC_O_Circumflex
127956 in Ada.Characters.Latin_1 *note A.3.3(26): 6166.
127957
127958 LC_O_Diaeresis
127959 in Ada.Characters.Latin_1 *note A.3.3(26): 6168.
127960
127961 LC_O_Grave in Ada.Characters.Latin_1 *note A.3.3(26): 6164.
127962
127963 LC_O_Oblique_Stroke
127964 in Ada.Characters.Latin_1 *note A.3.3(26): 6170.
127965
127966 LC_O_Tilde in Ada.Characters.Latin_1 *note A.3.3(26): 6167.
127967
127968 LC_P in Ada.Characters.Latin_1 *note A.3.3(14): 6026.
127969
127970 LC_Q in Ada.Characters.Latin_1 *note A.3.3(14): 6027.
127971
127972 LC_R in Ada.Characters.Latin_1 *note A.3.3(14): 6028.
127973
127974 LC_S in Ada.Characters.Latin_1 *note A.3.3(14): 6029.
127975
127976 LC_T in Ada.Characters.Latin_1 *note A.3.3(14): 6030.
127977
127978 LC_U in Ada.Characters.Latin_1 *note A.3.3(14): 6031.
127979
127980 LC_U_Acute in Ada.Characters.Latin_1 *note A.3.3(26): 6172.
127981
127982 LC_U_Circumflex
127983 in Ada.Characters.Latin_1 *note A.3.3(26): 6173.
127984
127985 LC_U_Diaeresis
127986 in Ada.Characters.Latin_1 *note A.3.3(26): 6174.
127987
127988 LC_U_Grave in Ada.Characters.Latin_1 *note A.3.3(26): 6171.
127989
127990 LC_V in Ada.Characters.Latin_1 *note A.3.3(14): 6032.
127991
127992 LC_W in Ada.Characters.Latin_1 *note A.3.3(14): 6033.
127993
127994 LC_X in Ada.Characters.Latin_1 *note A.3.3(14): 6034.
127995
127996 LC_Y in Ada.Characters.Latin_1 *note A.3.3(14): 6035.
127997
127998 LC_Y_Acute in Ada.Characters.Latin_1 *note A.3.3(26): 6175.
127999
128000 LC_Y_Diaeresis
128001 in Ada.Characters.Latin_1 *note A.3.3(26): 6177.
128002
128003 LC_Z in Ada.Characters.Latin_1 *note A.3.3(14): 6036.
128004
128005 Leading_Nonseparate
128006 in Interfaces.COBOL *note B.4(23): 8128.
128007
128008 Leading_Separate in Interfaces.COBOL *note B.4(23): 8126.
128009
128010 Left_Angle_Quotation
128011 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6091.
128012
128013 Left_Curly_Bracket
128014 in Ada.Characters.Latin_1 *note A.3.3(14): 6037.
128015
128016 Left_Parenthesis
128017 in Ada.Characters.Latin_1 *note A.3.3(8): 5989.
128018
128019 Left_Square_Bracket
128020 in Ada.Characters.Latin_1 *note A.3.3(12): 6005.
128021
128022 Less_Than_Sign
128023 in Ada.Characters.Latin_1 *note A.3.3(10): 6000.
128024
128025 Letter_Set
128026 in Ada.Strings.Maps.Constants *note A.4.6(4): 6420.
128027
128028 LF in Ada.Characters.Latin_1 *note A.3.3(5): 5959.
128029
128030 Low_Line in Ada.Characters.Latin_1 *note A.3.3(12): 6009.
128031
128032 Low_Order_First
128033 in Interfaces.COBOL *note B.4(25): 8132.
128034 in System *note 13.7(15/2): 5550.
128035
128036 Lower_Case_Map
128037 in Ada.Strings.Maps.Constants *note A.4.6(5): 6429.
128038
128039 Lower_Set
128040 in Ada.Strings.Maps.Constants *note A.4.6(4): 6421.
128041
128042 Macron in Ada.Characters.Latin_1 *note A.3.3(21/3): 6095.
128043
128044 Masculine_Ordinal_Indicator
128045 in Ada.Characters.Latin_1 *note A.3.3(22): 6108.
128046
128047 Max_Base_Digits in System *note 13.7(8): 5537.
128048
128049 Max_Binary_Modulus in System *note 13.7(7): 5535.
128050
128051 Max_Decimal_Digits in Ada.Decimal *note F.2(5): 8834.
128052
128053 Max_Delta in Ada.Decimal *note F.2(4): 8833.
128054
128055 Max_Digits in System *note 13.7(8): 5538.
128056
128057 Max_Digits_Binary in Interfaces.COBOL *note B.4(11): 8111.
128058
128059 Max_Digits_Long_Binary
128060 in Interfaces.COBOL *note B.4(11): 8112.
128061
128062 Max_Image_Width
128063 in Ada.Numerics.Discrete_Random *note A.5.2(25): 6643.
128064 in Ada.Numerics.Float_Random *note A.5.2(13): 6631.
128065
128066 Max_Int in System *note 13.7(6): 5534.
128067
128068 Max_Length in Ada.Strings.Bounded *note A.4.4(5): 6302.
128069
128070 Max_Mantissa in System *note 13.7(9): 5539.
128071
128072 Max_Nonbinary_Modulus in System *note 13.7(7): 5536.
128073
128074 Max_Picture_Length
128075 in Ada.Text_IO.Editing *note F.3.3(8): 8846.
128076
128077 Max_Scale in Ada.Decimal *note F.2(3): 8830.
128078
128079 Memory_Size in System *note 13.7(13): 5546.
128080
128081 Micro_Sign in Ada.Characters.Latin_1 *note A.3.3(22): 6102.
128082
128083 Middle_Dot in Ada.Characters.Latin_1 *note A.3.3(22): 6105.
128084
128085 Min_Delta in Ada.Decimal *note F.2(4): 8832.
128086
128087 Min_Handler_Ceiling
128088 in Ada.Execution_Time.Group_Budgets *note D.14.2(7/2): 8623.
128089 in Ada.Execution_Time.Timers *note D.14.1(6/2): 8606.
128090
128091 Min_Int in System *note 13.7(6): 5533.
128092
128093 Min_Scale in Ada.Decimal *note F.2(3): 8831.
128094
128095 Minus_Sign in Ada.Characters.Latin_1 *note A.3.3(8): 5995.
128096
128097 Monday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4495.
128098
128099 Multiplication_Sign
128100 in Ada.Characters.Latin_1 *note A.3.3(24): 6137.
128101
128102 MW in Ada.Characters.Latin_1 *note A.3.3(18): 6068.
128103
128104 NAK in Ada.Characters.Latin_1 *note A.3.3(6): 5970.
128105
128106 Native_Binary in Interfaces.COBOL *note B.4(25): 8133.
128107
128108 NBH in Ada.Characters.Latin_1 *note A.3.3(17): 6050.
128109
128110 NBSP in Ada.Characters.Latin_1 *note A.3.3(21/3): 6080.
128111
128112 NEL in Ada.Characters.Latin_1 *note A.3.3(17): 6052.
128113
128114 No_Break_Space
128115 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6079.
128116
128117 No_Element
128118 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9/2): 7341.
128119 in Ada.Containers.Hashed_Maps *note A.18.5(6/2): 7432.
128120 in Ada.Containers.Hashed_Sets *note A.18.8(6/2): 7571.
128121 in Ada.Containers.Multiway_Trees *note A.18.10(11/3): 7737.
128122 in Ada.Containers.Ordered_Maps *note A.18.6(7/2): 7488.
128123 in Ada.Containers.Ordered_Sets *note A.18.9(7/2): 7647.
128124 in Ada.Containers.Vectors *note A.18.2(11/2): 7242.
128125
128126 No_Index in Ada.Containers.Vectors *note A.18.2(7/2): 7238.
128127
128128 No_Tag in Ada.Tags *note 3.9(6.1/2): 2231.
128129
128130 Not_A_Specific_CPU
128131 in System.Multiprocessors *note D.16(4/3): 8665.
128132
128133 Not_Sign in Ada.Characters.Latin_1 *note A.3.3(21/3): 6092.
128134
128135 NUL
128136 in Ada.Characters.Latin_1 *note A.3.3(5): 5949.
128137 in Interfaces.C *note B.3(20/1): 8006.
128138
128139 Null_Address in System *note 13.7(12): 5543.
128140
128141 Null_Bounded_String
128142 in Ada.Strings.Bounded *note A.4.4(7): 6304.
128143
128144 Null_Id in Ada.Exceptions *note 11.4.1(2/2): 4929.
128145
128146 Null_Occurrence in Ada.Exceptions *note 11.4.1(3/2): 4935.
128147
128148 Null_Ptr in Interfaces.C.Strings *note B.3.1(7): 8056.
128149
128150 Null_Set
128151 in Ada.Strings.Maps *note A.4.2(5): 6239.
128152 in Ada.Strings.Wide_Maps *note A.4.7(5): 6451.
128153 in Ada.Strings.Wide_Wide_Maps *note A.4.8(5/2): 6493.
128154
128155 Null_Unbounded_String
128156 in Ada.Strings.Unbounded *note A.4.5(5): 6364.
128157
128158 Number_Sign in Ada.Characters.Latin_1 *note A.3.3(8): 5984.
128159
128160 OSC in Ada.Characters.Latin_1 *note A.3.3(19): 6076.
128161
128162 Packed_Signed in Interfaces.COBOL *note B.4(27): 8136.
128163
128164 Packed_Unsigned in Interfaces.COBOL *note B.4(27): 8135.
128165
128166 Paragraph_Sign
128167 in Ada.Characters.Latin_1 *note A.3.3(22): 6104.
128168
128169 Percent_Sign
128170 in Ada.Characters.Latin_1 *note A.3.3(8): 5986.
128171
128172 Pi in Ada.Numerics *note A.5(3/2): 6581.
128173
128174 Pilcrow_Sign
128175 in Ada.Characters.Latin_1 *note A.3.3(22): 6103.
128176
128177 PLD in Ada.Characters.Latin_1 *note A.3.3(17): 6058.
128178
128179 PLU in Ada.Characters.Latin_1 *note A.3.3(17): 6059.
128180
128181 Plus_Minus_Sign
128182 in Ada.Characters.Latin_1 *note A.3.3(22): 6098.
128183
128184 Plus_Sign in Ada.Characters.Latin_1 *note A.3.3(8): 5992.
128185
128186 PM in Ada.Characters.Latin_1 *note A.3.3(19): 6077.
128187
128188 Pound_Sign in Ada.Characters.Latin_1 *note A.3.3(21/3): 6083.
128189
128190 PU1 in Ada.Characters.Latin_1 *note A.3.3(18): 6064.
128191
128192 PU2 in Ada.Characters.Latin_1 *note A.3.3(18): 6065.
128193
128194 Question in Ada.Characters.Latin_1 *note A.3.3(10): 6003.
128195
128196 Quotation in Ada.Characters.Latin_1 *note A.3.3(8): 5983.
128197
128198 Registered_Trade_Mark_Sign
128199 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6094.
128200
128201 Reserved_128
128202 in Ada.Characters.Latin_1 *note A.3.3(17): 6047.
128203
128204 Reserved_129
128205 in Ada.Characters.Latin_1 *note A.3.3(17): 6048.
128206
128207 Reserved_132
128208 in Ada.Characters.Latin_1 *note A.3.3(17): 6051.
128209
128210 Reserved_153
128211 in Ada.Characters.Latin_1 *note A.3.3(19): 6072.
128212
128213 Reverse_Solidus
128214 in Ada.Characters.Latin_1 *note A.3.3(12): 6006.
128215
128216 RI in Ada.Characters.Latin_1 *note A.3.3(17): 6060.
128217
128218 Right_Angle_Quotation
128219 in Ada.Characters.Latin_1 *note A.3.3(22): 6109.
128220
128221 Right_Curly_Bracket
128222 in Ada.Characters.Latin_1 *note A.3.3(14): 6039.
128223
128224 Right_Parenthesis
128225 in Ada.Characters.Latin_1 *note A.3.3(8): 5990.
128226
128227 Right_Square_Bracket
128228 in Ada.Characters.Latin_1 *note A.3.3(12): 6007.
128229
128230 Ring_Above in Ada.Characters.Latin_1 *note A.3.3(22): 6097.
128231
128232 RS in Ada.Characters.Latin_1 *note A.3.3(6): 5979.
128233
128234 Saturday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4500.
128235
128236 SCHAR_MAX in Interfaces.C *note B.3(6): 7989.
128237
128238 SCHAR_MIN in Interfaces.C *note B.3(6): 7988.
128239
128240 SCI in Ada.Characters.Latin_1 *note A.3.3(19): 6073.
128241
128242 Section_Sign
128243 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6087.
128244
128245 Semicolon in Ada.Characters.Latin_1 *note A.3.3(10): 5999.
128246
128247 Separate_Interrupt_Clocks_Supported
128248 in Ada.Execution_Time *note D.14(9.2/3): 8595.
128249
128250 SI in Ada.Characters.Latin_1 *note A.3.3(5): 5964.
128251
128252 SO in Ada.Characters.Latin_1 *note A.3.3(5): 5963.
128253
128254 Soft_Hyphen in Ada.Characters.Latin_1 *note A.3.3(21/3): 6093.
128255
128256 SOH in Ada.Characters.Latin_1 *note A.3.3(5): 5950.
128257
128258 Solidus in Ada.Characters.Latin_1 *note A.3.3(8): 5997.
128259
128260 SOS in Ada.Characters.Latin_1 *note A.3.3(19): 6071.
128261
128262 SPA in Ada.Characters.Latin_1 *note A.3.3(18): 6069.
128263
128264 Space
128265 in Ada.Characters.Latin_1 *note A.3.3(8): 5981.
128266 in Ada.Strings *note A.4.1(4/2): 6224.
128267
128268 Special_Set
128269 in Ada.Strings.Maps.Constants *note A.4.6(4): 6427.
128270
128271 SS2 in Ada.Characters.Latin_1 *note A.3.3(17): 6061.
128272
128273 SS3 in Ada.Characters.Latin_1 *note A.3.3(17): 6062.
128274
128275 SSA in Ada.Characters.Latin_1 *note A.3.3(17): 6053.
128276
128277 ST in Ada.Characters.Latin_1 *note A.3.3(19): 6075.
128278
128279 Storage_Unit in System *note 13.7(13): 5544.
128280
128281 STS in Ada.Characters.Latin_1 *note A.3.3(18): 6066.
128282
128283 STX in Ada.Characters.Latin_1 *note A.3.3(5): 5951.
128284
128285 SUB in Ada.Characters.Latin_1 *note A.3.3(6): 5975.
128286
128287 Success in Ada.Command_Line *note A.15(8): 7132.
128288
128289 Sunday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4501.
128290
128291 Superscript_One
128292 in Ada.Characters.Latin_1 *note A.3.3(22): 6107.
128293
128294 Superscript_Three
128295 in Ada.Characters.Latin_1 *note A.3.3(22): 6100.
128296
128297 Superscript_Two
128298 in Ada.Characters.Latin_1 *note A.3.3(22): 6099.
128299
128300 SYN in Ada.Characters.Latin_1 *note A.3.3(6): 5971.
128301
128302 System_Dispatching_Domain
128303 in System.Multiprocessors.Dispatching_Domains *note D.16.1(6/3):
128304 8674.
128305
128306 System_Name in System *note 13.7(4): 5532.
128307
128308 Thursday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4498.
128309
128310 Tick
128311 in Ada.Real_Time *note D.8(6): 8531.
128312 in System *note 13.7(10): 5541.
128313
128314 Tilde in Ada.Characters.Latin_1 *note A.3.3(14): 6040.
128315
128316 Time_First in Ada.Real_Time *note D.8(4): 8523.
128317
128318 Time_Last in Ada.Real_Time *note D.8(4): 8524.
128319
128320 Time_Span_First in Ada.Real_Time *note D.8(5): 8527.
128321
128322 Time_Span_Last in Ada.Real_Time *note D.8(5): 8528.
128323
128324 Time_Span_Unit in Ada.Real_Time *note D.8(5): 8530.
128325
128326 Time_Span_Zero in Ada.Real_Time *note D.8(5): 8529.
128327
128328 Time_Unit in Ada.Real_Time *note D.8(4): 8525.
128329
128330 Trailing_Nonseparate
128331 in Interfaces.COBOL *note B.4(23): 8129.
128332
128333 Trailing_Separate in Interfaces.COBOL *note B.4(23): 8127.
128334
128335 Tuesday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4496.
128336
128337 UC_A_Acute in Ada.Characters.Latin_1 *note A.3.3(23): 6115.
128338
128339 UC_A_Circumflex
128340 in Ada.Characters.Latin_1 *note A.3.3(23): 6116.
128341
128342 UC_A_Diaeresis
128343 in Ada.Characters.Latin_1 *note A.3.3(23): 6118.
128344
128345 UC_A_Grave in Ada.Characters.Latin_1 *note A.3.3(23): 6114.
128346
128347 UC_A_Ring in Ada.Characters.Latin_1 *note A.3.3(23): 6119.
128348
128349 UC_A_Tilde in Ada.Characters.Latin_1 *note A.3.3(23): 6117.
128350
128351 UC_AE_Diphthong
128352 in Ada.Characters.Latin_1 *note A.3.3(23): 6120.
128353
128354 UC_C_Cedilla
128355 in Ada.Characters.Latin_1 *note A.3.3(23): 6121.
128356
128357 UC_E_Acute in Ada.Characters.Latin_1 *note A.3.3(23): 6123.
128358
128359 UC_E_Circumflex
128360 in Ada.Characters.Latin_1 *note A.3.3(23): 6124.
128361
128362 UC_E_Diaeresis
128363 in Ada.Characters.Latin_1 *note A.3.3(23): 6125.
128364
128365 UC_E_Grave in Ada.Characters.Latin_1 *note A.3.3(23): 6122.
128366
128367 UC_I_Acute in Ada.Characters.Latin_1 *note A.3.3(23): 6127.
128368
128369 UC_I_Circumflex
128370 in Ada.Characters.Latin_1 *note A.3.3(23): 6128.
128371
128372 UC_I_Diaeresis
128373 in Ada.Characters.Latin_1 *note A.3.3(23): 6129.
128374
128375 UC_I_Grave in Ada.Characters.Latin_1 *note A.3.3(23): 6126.
128376
128377 UC_Icelandic_Eth
128378 in Ada.Characters.Latin_1 *note A.3.3(24): 6130.
128379
128380 UC_Icelandic_Thorn
128381 in Ada.Characters.Latin_1 *note A.3.3(24): 6144.
128382
128383 UC_N_Tilde in Ada.Characters.Latin_1 *note A.3.3(24): 6131.
128384
128385 UC_O_Acute in Ada.Characters.Latin_1 *note A.3.3(24): 6133.
128386
128387 UC_O_Circumflex
128388 in Ada.Characters.Latin_1 *note A.3.3(24): 6134.
128389
128390 UC_O_Diaeresis
128391 in Ada.Characters.Latin_1 *note A.3.3(24): 6136.
128392
128393 UC_O_Grave in Ada.Characters.Latin_1 *note A.3.3(24): 6132.
128394
128395 UC_O_Oblique_Stroke
128396 in Ada.Characters.Latin_1 *note A.3.3(24): 6138.
128397
128398 UC_O_Tilde in Ada.Characters.Latin_1 *note A.3.3(24): 6135.
128399
128400 UC_U_Acute in Ada.Characters.Latin_1 *note A.3.3(24): 6140.
128401
128402 UC_U_Circumflex
128403 in Ada.Characters.Latin_1 *note A.3.3(24): 6141.
128404
128405 UC_U_Diaeresis
128406 in Ada.Characters.Latin_1 *note A.3.3(24): 6142.
128407
128408 UC_U_Grave in Ada.Characters.Latin_1 *note A.3.3(24): 6139.
128409
128410 UC_Y_Acute in Ada.Characters.Latin_1 *note A.3.3(24): 6143.
128411
128412 UCHAR_MAX in Interfaces.C *note B.3(6): 7990.
128413
128414 Unbounded in Ada.Text_IO *note A.10.1(5): 6865.
128415
128416 Unsigned in Interfaces.COBOL *note B.4(23): 8125.
128417
128418 Upper_Case_Map
128419 in Ada.Strings.Maps.Constants *note A.4.6(5): 6430.
128420
128421 Upper_Set
128422 in Ada.Strings.Maps.Constants *note A.4.6(4): 6422.
128423
128424 US in Ada.Characters.Latin_1 *note A.3.3(6): 5980.
128425
128426 Vertical_Line
128427 in Ada.Characters.Latin_1 *note A.3.3(14): 6038.
128428
128429 VT in Ada.Characters.Latin_1 *note A.3.3(5): 5960.
128430
128431 VTS in Ada.Characters.Latin_1 *note A.3.3(17): 6057.
128432
128433 Wednesday in Ada.Calendar.Formatting *note 9.6.1(17/2): 4497.
128434
128435 Wide_Character_Set
128436 in Ada.Strings.Wide_Maps.Wide_Constants *note A.4.8(48/2): 6514.
128437
128438 wide_nul in Interfaces.C *note B.3(31/1): 8016.
128439
128440 Wide_Space in Ada.Strings *note A.4.1(4/2): 6225.
128441
128442 Wide_Wide_Space in Ada.Strings *note A.4.1(4/2): 6226.
128443
128444 Word_Size in System *note 13.7(13): 5545.
128445
128446 Yen_Sign in Ada.Characters.Latin_1 *note A.3.3(21/3): 6085.
128447
128448 \1f
128449 File: aarm2012.info, Node: Index, Prev: Annex Q, Up: Top
128450
128451 Index
128452 *****
128453
128454 Index entries are given by paragraph number.
128455 * Menu:
128456
128457 * operators::
128458 * A::
128459 * B::
128460 * C::
128461 * D::
128462 * E::
128463 * F::
128464 * G::
128465 * H::
128466 * I::
128467 * J::
128468 * K::
128469 * L::
128470 * M::
128471 * N::
128472 * O::
128473 * P::
128474 * Q::
128475 * R::
128476 * S::
128477 * T::
128478 * U::
128479 * V::
128480 * W::
128481 * X::
128482 * Y::
128483
128484 \1f
128485 File: aarm2012.info, Node: operators, Next: A, Up: Index
128486
128487 operators
128488 =========
128489
128490
128491
128492 & operator *note 4.4(1/3): 2817, *note 4.5.3(3): 3013.
128493
128494 * operator *note 4.4(1/3): 2824, *note 4.5.5(1): 3040.
128495 ** operator *note 4.4(1/3): 2838, *note 4.5.6(7): 3074.
128496
128497 + operator *note 4.4(1/3): 2809, *note 4.5.3(1): 3005, *note 4.5.4(1):
128498 3030.
128499
128500 - operator *note 4.4(1/3): 2813, *note 4.5.3(1): 3009, *note 4.5.4(1):
128501 3034.
128502
128503 / operator *note 4.4(1/3): 2830, *note 4.5.5(1): 3046.
128504 /= operator *note 4.4(1/3): 2787, *note 4.5.2(1): 2962, *note
128505 6.6(6/3): 3796.
128506
128507 10646:2011, ISO/IEC standard *note 1.2(8/3): 1137.
128508 14882:2011, ISO/IEC standard *note 1.2(9/3): 1140.
128509 1539-1:2004, ISO/IEC standard *note 1.2(3/2): 1117.
128510 19769:2004, ISO/IEC technical report *note 1.2(10/2): 1143.
128511 1989:2002, ISO standard *note 1.2(4/2): 1120.
128512
128513 3166-1:2006, ISO/IEC standard *note 1.2(4.1/3): 1123.
128514
128515 639-3:2007, ISO standard *note 1.2(1.1/3): 1111.
128516 6429:1992, ISO/IEC standard *note 1.2(5): 1126.
128517 646:1991, ISO/IEC standard *note 1.2(2): 1114.
128518
128519 8859-1:1998, ISO/IEC standard *note 1.2(6/3): 1131.
128520
128521 9899:2011, ISO/IEC standard *note 1.2(7/3): 1134.
128522
128523 < operator *note 4.4(1/3): 2791, *note 4.5.2(1): 2966.
128524 <= operator *note 4.4(1/3): 2795, *note 4.5.2(1): 2970.
128525
128526 = operator *note 4.4(1/3): 2783, *note 4.5.2(1): 2958.
128527
128528 > operator *note 4.4(1/3): 2799, *note 4.5.2(1): 2974.
128529 >= operator *note 4.4(1/3): 2803, *note 4.5.2(1): 2978.
128530
128531
128532 \1f
128533 File: aarm2012.info, Node: A, Next: B, Prev: operators, Up: Index
128534
128535 A
128536 ==
128537
128538
128539
128540 abnormal completion *note 7.6.1(2/2): 3960.
128541 abnormal state of an object *note 13.9.1(4): 5598.
128542 [partial] *note 9.8(21): 4616, *note 11.6(6/3): 5033, *note
128543 A.13(17): 7125.
128544 abnormal task *note 9.8(4): 4606.
128545 abnormal termination
128546 of a partition *note 10.2(25.c): 4803.
128547 abort
128548 of a partition *note E.1(7): 8697.
128549 of a task *note 9.8(4): 4605.
128550 of the execution of a construct *note 9.8(5): 4609.
128551 abort completion point *note 9.8(15): 4612.
128552 abort-deferred operation *note 9.8(5): 4610.
128553 abort_statement *note 9.8(2): 4599.
128554 used *note 5.1(4/2): 3354, *note P: 9999.
128555 Abort_Task
128556 in Ada.Task_Identification *note C.7.1(3/3): 8278.
128557 abortable_part *note 9.7.4(5): 4584.
128558 used *note 9.7.4(2): 4577, *note P: 10270.
128559 abs operator *note 4.4(1/3): 2842, *note 4.5.6(1): 3063.
128560 absolute value *note 4.4(1/3): 2844, *note 4.5.6(1): 3065.
128561 abstract data type (ADT)
128562 See private types and private extensions *note 7.3(1): 3855.
128563 See also abstract type *note 3.9.3(1/2): 2321.
128564 abstract formal subprogram *note 12.6(8.c/2): 5250.
128565 abstract subprogram *note 3.9.3(1/2): 2324, *note 3.9.3(3/2): 2332.
128566 abstract type *note 3.9.3(1.2/2): 2330, *note 3.9.3(1/2): 2320, *note
128567 N(1.1/2): 9514.
128568 abstract_subprogram_declaration *note 3.9.3(1.1/3): 2326.
128569 used *note 3.1(3/3): 1350, *note P: 9648.
128570 ACATS
128571 Ada Conformity Assessment Test Suite *note 1.3(1.c/3): 1162.
128572 accept_alternative *note 9.7.1(5): 4546.
128573 used *note 9.7.1(4): 4543, *note P: 10254.
128574 accept_statement *note 9.5.2(3): 4353.
128575 used *note 5.1(5/2): 3363, *note 9.7.1(5): 4547, *note P: 10257.
128576 acceptable interpretation *note 8.6(14): 4147.
128577 Access attribute *note 3.10.2(24/1): 2464, *note 3.10.2(32/3): 2474.
128578 See also Unchecked_Access attribute *note 13.10(3): 5616.
128579 access discriminant *note 3.7(9/2): 2100.
128580 access parameter *note 6.1(24/2): 3572.
128581 access paths
128582 distinct *note 6.2(12/3): 3634.
128583 access result type *note 6.1(24/2): 3573.
128584 access type *note 3.10(1): 2367, *note N(2): 9515.
128585 subpool *note 13.11.4(22/3): 5714.
128586 access types
128587 input-output unspecified *note A.7(6): 6767.
128588 access value *note 3.10(1): 2368.
128589 access-to-constant type *note 3.10(10): 2403.
128590 access-to-object type *note 3.10(7/1): 2392.
128591 access-to-subprogram type *note 3.10(7/1): 2393, *note 3.10(11): 2405.
128592 access-to-variable type *note 3.10(10): 2404.
128593 Access_Check *note 11.5(11/2): 5000.
128594 [partial] *note 4.1(13): 2554, *note 4.1.5(8/3): 2629, *note
128595 4.6(51/3): 3211, *note 4.8(10.4/3): 3289.
128596 access_definition *note 3.10(6/2): 2385.
128597 used *note 3.3.1(2/3): 1554, *note 3.6(7/2): 2006, *note 3.7(5/2):
128598 2094, *note 6.1(13/2): 3547, *note 6.1(15/3): 3558, *note 6.5(2.3/2):
128599 3752, *note 8.5.1(2/3): 4088, *note 12.4(2/3): 5137, *note P: 10149.
128600 access_to_object_definition *note 3.10(3): 2377.
128601 used *note 3.10(2/2): 2374, *note P: 9803.
128602 access_to_subprogram_definition *note 3.10(5): 2381.
128603 used *note 3.10(2/2): 2376, *note P: 9805.
128604 access_type_definition *note 3.10(2/2): 2372.
128605 used *note 3.2.1(4/2): 1446, *note 12.5.4(2): 5218, *note P: 9672.
128606 accessibility
128607 distributed *note 3.10.2(32.1/3): 2479.
128608 from shared passive library units *note E.2.1(8): 8722.
128609 accessibility level *note 3.10.2(3/2): 2442.
128610 accessibility rule
128611 Access attribute *note 3.10.2(28/3): 2467, *note 3.10.2(32/3):
128612 2475.
128613 checking in generic units *note 12.3(11.s): 5105.
128614 not part of generic contract *note 3.9.1(4.k): 2279.
128615 requeue statement *note 9.5.4(6/3): 4436.
128616 type conversion *note 4.6(24.17/3): 3161, *note 4.6(24.21/2): 3168.
128617 type conversion, array components *note 4.6(24.6/2): 3156.
128618 accessibility rules
128619 See also Heart of Darkness *note 3.10.2(3.b/3): 2449.
128620 Accessibility_Check *note 11.5(19.1/2): 5009.
128621 [partial] *note 3.10.2(29): 2469, *note 4.6(39.1/2): 3189, *note
128622 4.6(48/3): 3203, *note 4.8(10.1/3): 3280, *note 6.5(8/3): 3770, *note
128623 6.5(21/3): 3776, *note 13.11.4(25/3): 5716, *note 13.11.4(26/3): 5718,
128624 *note E.4(18/1): 8793.
128625 accessible partition *note E.1(7): 8699.
128626 accuracy *note 4.6(32): 3179, *note G.2(1): 8940.
128627 ACID *note 1.3(1.c/3): 1155.
128628 ACK
128629 in Ada.Characters.Latin_1 *note A.3.3(5): 5955.
128630 acquire
128631 execution resource associated with protected object *note 9.5.1(5):
128632 4340.
128633 activation
128634 of a task *note 9.2(1): 4244.
128635 activation failure *note 9.2(1): 4246.
128636 Activation_Is_Complete
128637 in Ada.Task_Identification *note C.7.1(4/3): 8281.
128638 activator
128639 of a task *note 9.2(5): 4247.
128640 active locale *note A.19(8/3): 7932.
128641 active partition *note 10.2(28/3): 4808, *note E.1(2): 8692.
128642 active priority *note D.1(15): 8332.
128643 actual *note 12.3(7/3): 5103.
128644 actual duration *note D.9(12): 8553.
128645 actual parameter
128646 for a formal parameter *note 6.4.1(3): 3719.
128647 actual subtype *note 3.3(23/3): 1533, *note 12.5(4): 5182.
128648 of an object *note 3.3.1(9/2): 1575.
128649 actual type *note 12.5(4): 5184.
128650 actual_parameter_part *note 6.4(4): 3697.
128651 used *note 4.1.6(10/3): 2642, *note 6.4(2): 3692, *note 6.4(3):
128652 3696, *note 9.5.3(2): 4405, *note P: 9867.
128653 Actual_Quantum
128654 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8390.
128655 Acute
128656 in Ada.Characters.Latin_1 *note A.3.3(22): 6101.
128657 ACVC
128658 Ada Compiler Validation Capability *note 1.3(1.c/3): 1160.
128659 Ada *note A.2(2): 5900.
128660 Ada calling convention *note 6.3.1(3/3): 3658.
128661 Ada Commentary Integration Document (ACID) *note 1.3(1.c/3): 1154.
128662 Ada Compiler Validation Capability
128663 ACVC *note 1.3(1.c/3): 1161.
128664 Ada Conformity Assessment Test Suite
128665 ACATS *note 1.3(1.c/3): 1163.
128666 Ada Issue (AI) *note 1.3(1.c/3): 1152.
128667 Ada Rapporteur Group (ARG) *note 1.3(1.c/3): 1150.
128668 Ada.Ada.Unchecked_Deallocate_Subpool *note 13.11.5(3/3): 5725.
128669 Ada.Assertions *note 11.4.2(12/2): 4971.
128670 Ada.Asynchronous_Task_Control *note D.11(3/2): 8572.
128671 Ada.Calendar *note 9.6(10): 4458.
128672 Ada.Calendar.Arithmetic *note 9.6.1(8/2): 4489.
128673 Ada.Calendar.Formatting *note 9.6.1(15/2): 4493.
128674 Ada.Calendar.Time_Zones *note 9.6.1(2/2): 4485.
128675 Ada.Characters *note A.3.1(2): 5903.
128676 Ada.Characters.Conversions *note A.3.4(2/2): 6178.
128677 Ada.Characters.Handling *note A.3.2(2/2): 5907.
128678 Ada.Characters.Latin_1 *note A.3.3(3): 5947.
128679 Ada.Command_Line *note A.15(3): 7127.
128680 Ada.Complex_Text_IO *note G.1.3(9.1/2): 8933.
128681 Ada.Containers *note A.18.1(3/2): 7225.
128682 Ada.Containers.Bounded_Priority_Queues *note A.18.31(2/3): 7916.
128683 Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(2/3): 7901.
128684 Ada.Containers.Doubly_Linked_Lists *note A.18.3(5/3): 7337.
128685 Ada.Containers.Generic_Array_Sort *note A.18.26(3/2): 7878.
128686 Ada.Containers.Generic_Constrained_Array_Sort *note A.18.26(7/2):
128687 7880.
128688 Ada.Containers.Generic_Sort *note A.18.26(9.2/3): 7882.
128689 Ada.Containers.Hashed_Maps *note A.18.5(2/3): 7428.
128690 Ada.Containers.Hashed_Sets *note A.18.8(2/3): 7567.
128691 Ada.Containers.Indefinite_Doubly_Linked_Lists *note A.18.12(2/3):
128692 7811.
128693 Ada.Containers.Indefinite_Hashed_Maps *note A.18.13(2/3): 7813.
128694 Ada.Containers.Indefinite_Hashed_Sets *note A.18.15(2/3): 7817.
128695 Ada.Containers.Indefinite_Holders *note A.18.18(5/3): 7824.
128696 Ada.Containers.Indefinite_Multiway_Trees *note A.18.17(2/3): 7821.
128697 Ada.Containers.Indefinite_Ordered_Maps *note A.18.14(2/3): 7815.
128698 Ada.Containers.Indefinite_Ordered_Sets *note A.18.16(2/3): 7819.
128699 Ada.Containers.Indefinite_Vectors *note A.18.11(2/3): 7809.
128700 Ada.Containers.Multiway_Trees *note A.18.10(7/3): 7733.
128701 Ada.Containers.Ordered_Maps *note A.18.6(2/3): 7483.
128702 Ada.Containers.Ordered_Sets *note A.18.9(2/3): 7642.
128703 Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(3/3): 7886.
128704 Ada.Containers.Unbounded_Priority_Queues *note A.18.30(2/3): 7908.
128705 Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(2/3): 7894.
128706 Ada.Containers.Vectors *note A.18.2(6/3): 7236.
128707 Ada.Decimal *note F.2(2): 8829.
128708 Ada.Direct_IO *note A.8.4(2): 6807.
128709 Ada.Directories *note A.16(3/2): 7137.
128710 Ada.Directories.Hierarchical_File_Names *note A.16.1(3/3): 7191.
128711 Ada.Directories.Information *note A.16(124/2): 7187.
128712 Ada.Dispatching *note D.2.1(1.2/3): 8338.
128713 Ada.Dispatching.EDF *note D.2.6(9/2): 8395.
128714 Ada.Dispatching.Non_Preemptive *note D.2.4(2.2/3): 8377.
128715 Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8386.
128716 Ada.Dynamic_Priorities *note D.5.1(3/2): 8443.
128717 Ada.Environment_Variables *note A.17(3/2): 7205.
128718 Ada.Exceptions *note 11.4.1(2/2): 4927.
128719 Ada.Execution_Time *note D.14(3/2): 8585.
128720 Ada.Execution_Time.Group_Budgets *note D.14.2(3/3): 8619.
128721 Ada.Execution_Time.Interrupts *note D.14.3(3/3): 8646.
128722 Ada.Execution_Time.Timers *note D.14.1(3/2): 8603.
128723 Ada.Finalization *note 7.6(4/3): 3927.
128724 Ada.Float_Text_IO *note A.10.9(33): 7029.
128725 Ada.Float_Wide_Text_IO *note A.11(2/2): 7052.
128726 Ada.Float_Wide_Wide_Text_IO *note A.11(3/2): 7055.
128727 Ada.Integer_Text_IO *note A.10.8(21): 7027.
128728 Ada.Integer_Wide_Text_IO *note A.11(2/2): 7051.
128729 Ada.Integer_Wide_Wide_Text_IO *note A.11(3/2): 7054.
128730 Ada.Interrupts *note C.3.2(2/3): 8224.
128731 Ada.Interrupts.Names *note C.3.2(12): 8235.
128732 Ada.IO_Exceptions *note A.13(3): 7114.
128733 Ada.Iterator_Interfaces *note 5.5.1(2/3): 3439.
128734 Ada.Locales *note A.19(3/3): 7925.
128735 Ada.Numerics *note A.5(3/2): 6579.
128736 Ada.Numerics.Complex_Arrays *note G.3.2(53/2): 9041.
128737 Ada.Numerics.Complex_Elementary_Functions *note G.1.2(9/1): 8915.
128738 Ada.Numerics.Complex_Types *note G.1.1(25/1): 8887.
128739 Ada.Numerics.Discrete_Random *note A.5.2(17): 6635.
128740 Ada.Numerics.Elementary_Functions *note A.5.1(9/1): 6614.
128741 Ada.Numerics.Float_Random *note A.5.2(5): 6622.
128742 Ada.Numerics.Generic_Complex_Arrays *note G.3.2(2/2): 9005.
128743 Ada.Numerics.Generic_Complex_Elementary_Functions *note G.1.2(2/2):
128744 8894.
128745 Ada.Numerics.Generic_Complex_Types *note G.1.1(2/1): 8866.
128746 Ada.Numerics.Generic_Elementary_Functions *note A.5.1(3): 6585.
128747 Ada.Numerics.Generic_Real_Arrays *note G.3.1(2/2): 8988.
128748 Ada.Numerics.Real_Arrays *note G.3.1(31/2): 9000.
128749 Ada.Real_Time *note D.8(3): 8521.
128750 Ada.Real_Time.Timing_Events *note D.15(3/2): 8650.
128751 Ada.Sequential_IO *note A.8.1(2): 6781.
128752 Ada.Storage_IO *note A.9(3): 6839.
128753 Ada.Streams *note 13.13.1(2): 5776.
128754 Ada.Streams.Stream_IO *note A.12.1(3/3): 7065.
128755 Ada.Strings *note A.4.1(3): 6223.
128756 Ada.Strings.Bounded *note A.4.4(3): 6300.
128757 Ada.Strings.Bounded.Equal_Case_Insensitive *note A.4.10(7/3): 6529.
128758 Ada.Strings.Bounded.Hash *note A.4.9(7/3): 6519.
128759 Ada.Strings.Bounded.Hash_Case_Insensitive *note A.4.9(11.7/3): 6523.
128760 Ada.Strings.Bounded.Less_Case_Insensitive *note A.4.10(18/3): 6533.
128761 Ada.Strings.Equal_Case_Insensitive *note A.4.10(2/3): 6527.
128762 Ada.Strings.Fixed *note A.4.3(5): 6262.
128763 Ada.Strings.Fixed.Equal_Case_Insensitive *note A.4.10(5/3): 6528.
128764 Ada.Strings.Fixed.Hash_Case_Insensitive *note A.4.9(11.5/3): 6522.
128765 Ada.Strings.Fixed.Less_Case_Insensitive *note A.4.10(16/3): 6532.
128766 Ada.Strings.Hash *note A.4.9(2/3): 6518.
128767 Ada.Strings.Hash_Case_Insensitive *note A.4.9(11.2/3): 6521.
128768 Ada.Strings.Less_Case_Insensitive *note A.4.10(13/3): 6531.
128769 Ada.Strings.Maps *note A.4.2(3/2): 6237.
128770 Ada.Strings.Maps.Constants *note A.4.6(3/2): 6417.
128771 Ada.Strings.Unbounded *note A.4.5(3): 6362.
128772 Ada.Strings.Unbounded.Equal_Case_Insensitive *note A.4.10(10/3): 6530.
128773 Ada.Strings.Unbounded.Hash *note A.4.9(10/3): 6520.
128774 Ada.Strings.Unbounded.Hash_Case_Insensitive *note A.4.9(11.10/3):
128775 6524.
128776 Ada.Strings.Unbounded.Less_Case_Insensitive *note A.4.10(21/3): 6534.
128777 Ada.Strings.UTF_Encoding *note A.4.11(3/3): 6536.
128778 Ada.Strings.UTF_Encoding.Conversions *note A.4.11(15/3): 6547.
128779 Ada.Strings.UTF_Encoding.Strings *note A.4.11(22/3): 6553.
128780 Ada.Strings.UTF_Encoding.Wide_Strings *note A.4.11(30/3): 6560.
128781 Ada.Strings.UTF_Encoding.Wide_Wide_Strings *note A.4.11(38/3): 6567.
128782 Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6434.
128783 Ada.Strings.Wide_Bounded.Wide_Equal_Case_Insensitive *note A.4.7(1/3):
128784 6442.
128785 Ada.Strings.Wide_Bounded.Wide_Hash *note A.4.7(1/3): 6438.
128786 Ada.Strings.Wide_Bounded.Wide_Hash_Case_Insensitive *note A.4.7(1/3):
128787 6446.
128788 Ada.Strings.Wide_Equal_Case_Insensitive *note A.4.7(1/3): 6440.
128789 Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6433.
128790 Ada.Strings.Wide_Fixed.Wide_Equal_Case_Insensitive *note A.4.7(1/3):
128791 6441.
128792 Ada.Strings.Wide_Fixed.Wide_Hash *note A.4.7(1/3): 6437.
128793 Ada.Strings.Wide_Fixed.Wide_Hash_Case_Insensitive *note A.4.7(1/3):
128794 6445.
128795 Ada.Strings.Wide_Hash *note A.4.7(1/3): 6436.
128796 Ada.Strings.Wide_Hash_Case_Insensitive *note A.4.7(1/3): 6444.
128797 Ada.Strings.Wide_Maps *note A.4.7(3): 6449.
128798 Ada.Strings.Wide_Maps.Wide_Constants *note A.4.7(1/3): 6448, *note
128799 A.4.8(28/2): 6512.
128800 Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6435.
128801 Ada.Strings.Wide_Unbounded.Wide_Equal_Case_Insensitive *note
128802 A.4.7(1/3): 6443.
128803 Ada.Strings.Wide_Unbounded.Wide_Hash *note A.4.7(1/3): 6439.
128804 Ada.Strings.Wide_Unbounded.Wide_Hash_Case_Insensitive *note
128805 A.4.7(1/3): 6447.
128806 Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6476.
128807 Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Equal_Case_Insensitive *note
128808 A.4.8(1/3): 6484.
128809 Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash *note A.4.8(1/3): 6480.
128810 Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash_Case_Insensitive *note
128811 A.4.8(1/3): 6488.
128812 Ada.Strings.Wide_Wide_Equal_Case_Insensitive *note A.4.8(1/3): 6482.
128813 Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6475.
128814 Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Equal_Case_Insensitive *note
128815 A.4.8(1/3): 6483.
128816 Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash *note A.4.8(1/3): 6479.
128817 Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash_Case_Insensitive *note
128818 A.4.8(1/3): 6487.
128819 Ada.Strings.Wide_Wide_Hash *note A.4.8(1/3): 6478.
128820 Ada.Strings.Wide_Wide_Hash_Case_Insensitive *note A.4.8(1/3): 6486.
128821 Ada.Strings.Wide_Wide_Maps *note A.4.8(3/2): 6491.
128822 Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants *note A.4.8(1/3): 6490.
128823 Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6477.
128824 Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Equal_Case_Insensitive *note
128825 A.4.8(1/3): 6485.
128826 Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash *note A.4.8(1/3): 6481.
128827 Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash_Case_Insensitive *note
128828 A.4.8(1/3): 6489.
128829 Ada.Synchronous_Barriers *note D.10.1(3/3): 8567.
128830 Ada.Synchronous_Task_Control *note D.10(3/2): 8554.
128831 Ada.Synchronous_Task_Control.EDF *note D.10(5.2/3): 8560.
128832 Ada.Tags *note 3.9(6/2): 2229.
128833 Ada.Tags.Generic_Dispatching_Constructor *note 3.9(18.2/3): 2254.
128834 Ada.Task_Attributes *note C.7.2(2): 8293.
128835 Ada.Task_Identification *note C.7.1(2/2): 8272.
128836 Ada.Task_Termination *note C.7.3(2/2): 8305.
128837 Ada.Text_IO *note A.10.1(2): 6860.
128838 Ada.Text_IO.Bounded_IO *note A.10.11(3/2): 7030.
128839 Ada.Text_IO.Complex_IO *note G.1.3(3): 8923.
128840 Ada.Text_IO.Editing *note F.3.3(3): 8840.
128841 Ada.Text_IO.Text_Streams *note A.12.2(3): 7104.
128842 Ada.Text_IO.Unbounded_IO *note A.10.12(3/2): 7040.
128843 Ada.Unchecked_Conversion *note 13.9(3/3): 5590.
128844 Ada.Unchecked_Deallocate_Subpool
128845 child of Ada *note 13.11.5(3/3): 5725.
128846 Ada.Unchecked_Deallocation *note 13.11.2(3/3): 5669.
128847 Ada.Wide_Characters *note A.3.1(4/2): 5904.
128848 Ada.Wide_Characters.Handling *note A.3.5(3/3): 6198.
128849 Ada.Wide_Text_IO *note A.11(2/2): 7050.
128850 Ada.Wide_Text_IO.Bounded_IO *note A.11(4/3): 7056.
128851 Ada.Wide_Text_IO.Complex_IO *note G.1.4(1): 8936.
128852 Ada.Wide_Text_IO.Editing *note F.3.4(1): 8859.
128853 Ada.Wide_Text_IO.Text_Streams *note A.12.3(3): 7107.
128854 Ada.Wide_Text_IO.Unbounded_IO *note A.11(5/3): 7058.
128855 Ada.Wide_Wide_Characters *note A.3.1(6/2): 5905.
128856 Ada.Wide_Wide_Characters.Handling *note A.3.6(1/3): 6220.
128857 Ada.Wide_Wide_Text_IO *note A.11(3/2): 7053.
128858 Ada.Wide_Wide_Text_IO.Bounded_IO *note A.11(4/3): 7057.
128859 Ada.Wide_Wide_Text_IO.Complex_IO *note G.1.5(1/2): 8938.
128860 Ada.Wide_Wide_Text_IO.Editing *note F.3.5(1/2): 8862.
128861 Ada.Wide_Wide_Text_IO.Text_Streams *note A.12.4(3/2): 7110.
128862 Ada.Wide_Wide_Text_IO.Unbounded_IO *note A.11(5/3): 7059.
128863 Ada_To_COBOL
128864 in Interfaces.COBOL *note B.4(14): 8116.
128865 adafinal *note B.1(39/3): 7974.
128866 adainit *note B.1(39/3): 7973.
128867 Add
128868 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8630.
128869 Add_Task
128870 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8624.
128871 address
128872 arithmetic *note 13.7.1(6): 5564.
128873 comparison *note 13.7(14/3): 5547.
128874 in System *note 13.7(12): 5542.
128875 Address aspect *note 13.3(12): 5395.
128876 Address attribute *note 13.3(11): 5391, *note J.7.1(5): 9136.
128877 Address clause *note 13.3(7/2): 5369, *note 13.3(12): 5393.
128878 Address_To_Access_Conversions
128879 child of System *note 13.7.2(2): 5572.
128880 Adjacent attribute *note A.5.3(48): 6713.
128881 Adjust *note 7.6(2): 3926.
128882 in Ada.Finalization *note 7.6(6/2): 3930.
128883 adjusting the value of an object *note 7.6(15): 3940, *note 7.6(16/3):
128884 3942.
128885 adjustment *note 7.6(15): 3941, *note 7.6(16/3): 3943.
128886 as part of assignment *note 5.2(14/3): 3394.
128887 ADT (abstract data type)
128888 See private types and private extensions *note 7.3(1): 3856.
128889 See also abstract type *note 3.9.3(1/2): 2322.
128890 advice *note 1.1.2(37): 1047.
128891 Aft attribute *note 3.5.10(5): 1976.
128892 aggregate *note 4.3(1): 2668, *note 4.3(2): 2670.
128893 used *note 4.4(7/3): 2903, *note 4.7(2): 3240, *note P: 9977.
128894 See also composite type *note 3.2(2/2): 1396.
128895 AI *note 1.3(1.c/3): 1153.
128896 aliased *note 3.10(9/3): 2400, *note N(3): 9516.
128897 aliasing
128898 See distinct access paths *note 6.2(12/3): 3635.
128899 Alignment
128900 in Ada.Strings *note A.4.1(6): 6231.
128901 Alignment (subtype) aspect *note 13.3(26.4/2): 5407.
128902 Alignment attribute *note 13.3(23/2): 5399, *note 13.3(26.2/2): 5403.
128903 Alignment clause *note 13.3(7/2): 5370, *note 13.3(25/2): 5401, *note
128904 13.3(26.4/2): 5405.
128905 All_Calls_Remote aspect *note E.2.3(16/3): 8763.
128906 All_Calls_Remote pragma *note E.2.3(5): 8751, *note L(2): 9329.
128907 All_Checks *note 11.5(25/3): 5014.
128908 Allocate
128909 in System.Storage_Pools *note 13.11(7): 5624.
128910 in System.Storage_Pools.Subpools *note 13.11.4(14/3): 5704.
128911 Allocate_From_Subpool
128912 in System.Storage_Pools.Subpools *note 13.11.4(11/3): 5701.
128913 Allocation_Check *note 11.5(19.2/2): 5010.
128914 [partial] *note 4.8(10.2/2): 3283, *note 4.8(10.3/2): 3286, *note
128915 4.8(10.4/3): 3291, *note 13.11.4(30/3): 5721.
128916 allocator *note 4.8(2/3): 3254.
128917 used *note 4.4(7/3): 2905, *note P: 9946.
128918 Alphanumeric
128919 in Interfaces.COBOL *note B.4(16/3): 8118.
128920 alphanumeric character
128921 a category of Character *note A.3.2(31): 5943.
128922 Alphanumeric_Set
128923 in Ada.Strings.Maps.Constants *note A.4.6(4): 6426.
128924 ambiguous *note 8.6(30): 4168.
128925 ambiguous cursor
128926 of a vector *note A.18.2(240/2): 7323.
128927 ambiguous grammar *note 1.1.4(14.a): 1083.
128928 Amendment Correction *note 1.1.2(39.n/3): 1055.
128929 ampersand *note 2.1(15/3): 1190.
128930 in Ada.Characters.Latin_1 *note A.3.3(8): 5987.
128931 ampersand operator *note 4.4(1/3): 2819, *note 4.5.3(3): 3015.
128932 ancestor *note N(3.1/2): 9517.
128933 of a library unit *note 10.1.1(11): 4683.
128934 of a tree node *note A.18.10(4/3): 7730.
128935 of a type *note 3.4.1(10/2): 1658.
128936 ultimate *note 3.4.1(10/2): 1660.
128937 ancestor subtype
128938 of a formal derived type *note 12.5.1(5/3): 5196.
128939 of a private_extension_declaration *note 7.3(8): 3869.
128940 ancestor type
128941 of an extension_aggregate *note 4.3.2(5/3): 2718.
128942 Ancestor_Find
128943 in Ada.Containers.Multiway_Trees *note A.18.10(40/3): 7765.
128944 ancestor_part *note 4.3.2(3): 2713.
128945 used *note 4.3.2(2): 2711, *note P: 9879.
128946 and operator *note 4.4(1/3): 2775, *note 4.5.1(2): 2937.
128947 and then (short-circuit control form) *note 4.4(1/3): 2781, *note
128948 4.5.1(1): 2932.
128949 angle threshold *note G.2.4(10): 8980.
128950 Annex
128951 informative *note 1.1.2(18): 1012.
128952 normative *note 1.1.2(14): 1009.
128953 Specialized Needs *note 1.1.2(7): 1006.
128954 anonymous access type *note 3.10(12/3): 2408.
128955 anonymous allocator *note 3.10.2(14/3): 2457.
128956 anonymous array type *note 3.3.1(1/3): 1545.
128957 anonymous protected type *note 3.3.1(1/3): 1547.
128958 anonymous task type *note 3.3.1(1/3): 1546.
128959 anonymous type *note 3.2.1(7/2): 1451.
128960 Any_Priority subtype of Integer
128961 in System *note 13.7(16): 5552.
128962 APC
128963 in Ada.Characters.Latin_1 *note A.3.3(19): 6078.
128964 apostrophe *note 2.1(15/3): 1191.
128965 in Ada.Characters.Latin_1 *note A.3.3(8): 5988.
128966 Append
128967 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(23/2): 7361.
128968 in Ada.Containers.Vectors *note A.18.2(46/2): 7281, *note
128969 A.18.2(47/2): 7282.
128970 in Ada.Strings.Bounded *note A.4.4(13): 6310, *note A.4.4(14):
128971 6311, *note A.4.4(15): 6312, *note A.4.4(16): 6313, *note A.4.4(17):
128972 6314, *note A.4.4(18): 6315, *note A.4.4(19): 6316, *note A.4.4(20):
128973 6317.
128974 in Ada.Strings.Unbounded *note A.4.5(12): 6372, *note A.4.5(13):
128975 6373, *note A.4.5(14): 6374.
128976 Append_Child
128977 in Ada.Containers.Multiway_Trees *note A.18.10(52/3): 7777.
128978 applicable index constraint *note 4.3.3(10): 2756.
128979 application areas *note 1.1.2(7): 1007.
128980 applies
128981 aspect *note 13.1.1(23/3): 5342, *note 13.1.1(27/3): 5343, *note
128982 13.1.1(29/3): 5344, *note 13.1.1(30/3): 5345.
128983 apply
128984 to a callable construct by a return statement *note 6.5(4/2): 3756.
128985 to a loop_statement by an exit_statement *note 5.7(4): 3501.
128986 to a program unit by a program unit pragma *note 10.1.5(2): 4762.
128987 arbitrary order *note 1.1.4(18): 1089.
128988 allowed *note 2.8(12): 1325, *note 3.3.1(20/2): 1588, *note 3.5(9):
128989 1691, *note 3.6(22/2): 2031, *note 3.11(10/1): 2511, *note 3.11(11/3):
128990 2512, *note 3.11(13): 2513, *note 4.1.1(7): 2567, *note 4.1.2(7): 2578,
128991 *note 4.3(5): 2677, *note 4.3.1(19): 2705, *note 4.3.2(7): 2721, *note
128992 4.3.3(22): 2758, *note 4.3.3(23): 2761, *note 4.5.2(27/3): 2996, *note
128993 4.8(10/2): 3279, *note 5.2(7): 3386, *note 6.1.1(26/3): 3604, *note
128994 6.1.1(34/3): 3613, *note 6.1.1(35/3): 3618, *note 6.4(10/2): 3709, *note
128995 6.4.1(17): 3735, *note 7.6(12): 3938, *note 7.6(16/3): 3944, *note
128996 7.6.1(9/3): 3967, *note 7.6.1(11.1/3): 3973, *note 7.6.1(20.2/3): 3982,
128997 *note 9.7.1(15): 4556, *note 9.8(4): 4604, *note 12.3(20): 5119, *note
128998 13.11.5(7/3): 5726, *note K.2(164.2/3): 9304.
128999 Arccos
129000 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129001 G.1.2(5): 8904.
129002 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6601.
129003 Arccosh
129004 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129005 G.1.2(7): 8912.
129006 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6611.
129007 Arccot
129008 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129009 G.1.2(5): 8906.
129010 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6604.
129011 Arccoth
129012 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129013 G.1.2(7): 8914.
129014 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6613.
129015 Arcsin
129016 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129017 G.1.2(5): 8903.
129018 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6599.
129019 Arcsinh
129020 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129021 G.1.2(7): 8911.
129022 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6610.
129023 Arctan
129024 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129025 G.1.2(5): 8905.
129026 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(6): 6602.
129027 Arctanh
129028 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
129029 G.1.2(7): 8913.
129030 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6612.
129031 ARG *note 1.3(1.c/3): 1151.
129032 Argument
129033 in Ada.Command_Line *note A.15(5): 7129.
129034 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(10/2): 9015,
129035 *note G.3.2(31/2): 9029.
129036 in Ada.Numerics.Generic_Complex_Types *note G.1.1(10): 8882.
129037 argument of a pragma *note 2.8(9): 1320.
129038 Argument_Count
129039 in Ada.Command_Line *note A.15(4): 7128.
129040 Argument_Error
129041 in Ada.Numerics *note A.5(3/2): 6580.
129042 Arithmetic
129043 child of Ada.Calendar *note 9.6.1(8/2): 4489.
129044 array *note 3.6(1): 1986.
129045 array component expression *note 4.3.3(6): 2750.
129046 array component iterator *note 5.5.2(3/3): 3476.
129047 array for a loop *note 5.5.2(11/3): 3486.
129048 array indexing
129049 See indexed_component *note 4.1.1(1): 2559.
129050 array slice *note 4.1.2(1): 2572.
129051 array type *note 3.6(1): 1987, *note N(4): 9518.
129052 array_aggregate *note 4.3.3(2): 2729.
129053 used *note 4.3(2): 2673, *note 13.4(3): 5461, *note P: 10448.
129054 array_component_association *note 4.3.3(5/2): 2744.
129055 used *note 4.3.3(4): 2742, *note P: 9894.
129056 array_type_definition *note 3.6(2): 1988.
129057 used *note 3.2.1(4/2): 1444, *note 3.3.1(2/3): 1558, *note
129058 12.5.3(2): 5213, *note P: 9698.
129059 ASCII
129060 package physically nested within the declaration of Standard *note
129061 A.1(36.3/2): 5888.
129062 in Standard *note A.1(36.3/2): 5887.
129063 aspect *note 13.1(0.1/3): 5276, *note K.1(1/3): 9280, *note N(4.1/3):
129064 9519.
129065 interfacing *note B.1(0.1/3): 7940.
129066 predicate *note 3.2.4(1/3): 1501.
129067 aspect of representation *note 13.1(8/3): 5297.
129068 aspect_clause *note 13.1(2/1): 5281.
129069 used *note 3.8(5/1): 2156, *note 3.11(4/1): 2496, *note 9.1(5/1):
129070 4216, *note 9.4(5/1): 4282, *note 9.4(8/1): 4295, *note P: 10184.
129071 aspect_definition *note 13.1.1(4/3): 5333.
129072 used *note 13.1.1(2/3): 5330, *note P: 10433.
129073 aspect_mark *note 13.1.1(3/3): 5331.
129074 used *note 2.8(3/3): 1313, *note 11.4.2(6.1/3): 4967, *note
129075 13.1.1(2/3): 5327, *note L(2.3/3): 9342, *note P: 9641.
129076 aspect_specification *note 13.1.1(2/3): 5326.
129077 used *note 3.2.1(3/3): 1437, *note 3.2.2(2/3): 1464, *note
129078 3.3.1(2/3): 1552, *note 3.8(6/3): 2161, *note 3.9.3(1.1/3): 2329, *note
129079 6.1(2/3): 3516, *note 6.3(2/3): 3642, *note 6.7(2/3): 3802, *note
129080 6.8(2/3): 3813, *note 7.1(3/3): 3829, *note 7.2(2/3): 3844, *note
129081 7.3(2/3): 3860, *note 7.3(3/3): 3866, *note 8.5.1(2/3): 4090, *note
129082 8.5.2(2/3): 4102, *note 8.5.3(2/3): 4107, *note 8.5.4(2/3): 4115, *note
129083 8.5.5(2/3): 4131, *note 9.1(2/3): 4202, *note 9.1(3/3): 4207, *note
129084 9.1(6/3): 4219, *note 9.4(2/3): 4267, *note 9.4(3/3): 4272, *note
129085 9.4(7/3): 4288, *note 9.5.2(2/3): 4352, *note 10.1.3(3/3): 4731, *note
129086 10.1.3(4): 4734, *note 10.1.3(5): 4737, *note 10.1.3(6): 4740, *note
129087 11.1(2/3): 4873, *note 12.1(3/3): 5046, *note 12.3(2/3): 5075, *note
129088 12.4(2/3): 5139, *note 12.5(2.1/3): 5165, *note 12.6(2.1/3): 5235, *note
129089 12.6(2.2/3): 5239, *note 12.7(2/3): 5261, *note P: 9692.
129090 aspects
129091 Address *note 13.3(12): 5394.
129092 Alignment (subtype) *note 13.3(26.4/2): 5406.
129093 All_Calls_Remote *note E.2.3(16/3): 8762.
129094 Asynchronous *note E.4.1(8.1/3): 8801.
129095 Atomic *note C.6(6.2/3): 8249.
129096 Atomic_Components *note C.6(6.6/3): 8255.
129097 Attach_Handler *note C.3.1(6.3/3): 8205.
129098 Bit_Order *note 13.5.3(4): 5523.
129099 Coding *note 13.4(7): 5465.
129100 Component_Size *note 13.3(70): 5440.
129101 Constant_Indexing *note 4.1.6(2/3): 2633.
129102 Convention *note B.1(2/3): 7954.
129103 CPU *note D.16(8/3): 8668.
129104 Default_Component_Value *note 3.6(22.2/3): 2032.
129105 Default_Iterator *note 5.5.1(8/3): 3454.
129106 Default_Storage_Pool *note 13.11.3(5/3): 5690.
129107 Default_Value *note 3.5(56.3/3): 1761.
129108 Dispatching_Domain *note D.16.1(18/3): 8683.
129109 Dynamic_Predicate *note 3.2.4(1/3): 1504.
129110 Elaborate_Body *note 10.2.1(26.1/3): 4853.
129111 Export *note B.1(1/3): 7943.
129112 External_Name *note B.1(1/3): 7947.
129113 External_Tag *note 13.3(75/3): 5451, *note K.2(65): 9295.
129114 Implicit_Dereference *note 4.1.5(2/3): 2620.
129115 Import *note B.1(1/3): 7941.
129116 Independent *note C.6(6.3/3): 8251.
129117 Independent_Components *note C.6(6.9/3): 8259.
129118 Inline *note 6.3.2(5.1/3): 3685.
129119 Input *note 13.13.2(38/3): 5824.
129120 Interrupt_Handler *note C.3.1(6.2/3): 8203.
129121 Interrupt_Priority *note D.1(6.3/3): 8326.
129122 Iterator_Element *note 5.5.1(9/3): 3457.
129123 Layout *note 13.5(1): 5469.
129124 Link_Name *note B.1(1/3): 7945.
129125 Machine_Radix *note F.1(1): 8827.
129126 No_Return *note 6.5.1(3.2/3): 3787.
129127 Output *note 13.13.2(38/3): 5826.
129128 Pack *note 13.2(5.1/3): 5348.
129129 Post *note 6.1.1(4/3): 3590.
129130 Post'Class *note 6.1.1(5/3): 3594.
129131 Pre *note 6.1.1(2/3): 3582.
129132 Pre'Class *note 6.1.1(3/3): 3586.
129133 Preelaborate *note 10.2.1(11/3): 4822.
129134 Priority *note D.1(6.2/3): 8324.
129135 Pure *note 10.2.1(17/3): 4835.
129136 Read *note 13.13.2(38/3): 5820.
129137 Record layout *note 13.5(1): 5473.
129138 Relative_Deadline *note D.2.6(9.2/3): 8401.
129139 Remote_Call_Interface *note E.2.3(7/3): 8760.
129140 Remote_Types *note E.2.2(4/3): 8735.
129141 Shared_Passive *note E.2.1(4/3): 8720.
129142 Size (object) *note 13.3(41): 5416.
129143 Size (subtype) *note 13.3(48): 5423.
129144 Small *note 3.5.10(2/1): 1969.
129145 Static_Predicate *note 3.2.4(1/3): 1502.
129146 Storage_Pool *note 13.11(15): 5640.
129147 Storage_Size (access) *note 13.11(15): 5642.
129148 Storage_Size (task) *note 13.3(65.2/3): 5431.
129149 Stream_Size *note 13.13.2(1.5/2): 5788.
129150 Synchronization *note 9.5(12/3): 4330.
129151 Type_Invariant *note 7.3.2(2/3): 3892.
129152 Type_Invariant'Class *note 7.3.2(3/3): 3894.
129153 Unchecked_Union *note B.3.3(3.2/3): 8093.
129154 Variable_Indexing *note 4.1.6(3/3): 2635.
129155 Volatile *note C.6(6.4/3): 8253.
129156 Volatile_Components *note C.6(6.7/3): 8257.
129157 Write *note 13.13.2(38/3): 5822.
129158 assembly language *note C.1(4/3): 8189.
129159 Assert
129160 in Ada.Assertions *note 11.4.2(14/2): 4974.
129161 Assert pragma *note 11.4.2(3/2): 4957, *note L(2.1/2): 9332.
129162 assertion *note N(4.2/3): 9520.
129163 assertion expressions *note 11.4.2(1.1/3): 4955.
129164 assertion policy
129165 Assert pragma *note 11.4.2(18/3): 4975.
129166 Assertion_Error
129167 raised by failure of assertion *note 11.4.2(18/3): 4976.
129168 raised by failure of run-time check *note 3.2.4(31/3): 1518, *note
129169 4.6(57/3): 3226, *note 6.1.1(32/3): 3607, *note 6.1.1(33/3): 3610, *note
129170 6.1.1(35/3): 3617, *note 7.3.2(22/3): 3900.
129171 in Ada.Assertions *note 11.4.2(13/2): 4972.
129172 Assertion_Policy pragma *note 11.4.2(6.1/3): 4964, *note 11.4.2(6/2):
129173 4961, *note L(2.2/2): 9336, *note L(2.3/3): 9339.
129174 assertions *note 11.4.2(1.1/3): 4954.
129175 child of Ada *note 11.4.2(12/2): 4971.
129176 Assign
129177 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.5/3): 7354.
129178 in Ada.Containers.Hashed_Maps *note A.18.5(17.7/3): 7450.
129179 in Ada.Containers.Hashed_Sets *note A.18.8(17.3/3): 7585.
129180 in Ada.Containers.Indefinite_Holders *note A.18.18(20/3): 7838.
129181 in Ada.Containers.Multiway_Trees *note A.18.10(32/3): 7757.
129182 in Ada.Containers.Ordered_Maps *note A.18.6(16.7/3): 7504.
129183 in Ada.Containers.Ordered_Sets *note A.18.9(16.3/3): 7659.
129184 in Ada.Containers.Vectors *note A.18.2(34.7/3): 7268.
129185 See assignment operation *note 5.2(3): 3380.
129186 Assign_Task
129187 in System.Multiprocessors.Dispatching_Domains *note D.16.1(11/3):
129188 8679.
129189 assigning back of parameters *note 6.4.1(17): 3732.
129190 assignment
129191 user-defined *note 7.6(1): 3919.
129192 assignment operation *note 5.2(3): 3379, *note 5.2(12): 3392, *note
129193 7.6(13): 3939.
129194 during elaboration of an object_declaration *note 3.3.1(18/2):
129195 1586.
129196 during evaluation of a generic_association for a formal object of
129197 mode in *note 12.4(11): 5153.
129198 during evaluation of a parameter_association *note 6.4.1(11): 3725.
129199 during evaluation of an aggregate *note 4.3(5): 2676.
129200 during evaluation of an initialized allocator *note 4.8(7/2): 3270.
129201 during evaluation of an uninitialized allocator *note 4.8(9/2):
129202 3273.
129203 during evaluation of concatenation *note 4.5.3(10): 3025.
129204 during execution of a for loop *note 5.5(9/3): 3438.
129205 during execution of an assignment_statement *note 5.2(12): 3393.
129206 during parameter copy back *note 6.4.1(17): 3733.
129207 list of uses *note 7.6.1(24.d): 3983.
129208 assignment_statement *note 5.2(2): 3376.
129209 used *note 5.1(4/2): 3346, *note P: 9991.
129210 associated components
129211 of a record_component_association *note 4.3.1(10): 2701.
129212 associated declaration
129213 of an aspect specification *note 13.1.1(1/3): 5325.
129214 associated discriminants
129215 of a named discriminant_association *note 3.7.1(5): 2128.
129216 of a positional discriminant_association *note 3.7.1(5): 2129.
129217 associated entity
129218 of an aspect specification *note 13.1.1(5/3): 5337.
129219 associated object
129220 of a value of a by-reference type *note 6.2(10/3): 3629.
129221 of a value of a limited type *note 6.2(10.f): 3630.
129222 asterisk *note 2.1(15/3): 1195.
129223 in Ada.Characters.Latin_1 *note A.3.3(8): 5991.
129224 asynchronous
129225 remote procedure call *note E.4.1(9/3): 8804.
129226 Asynchronous aspect *note E.4.1(8.1/3): 8802.
129227 Asynchronous pragma *note J.15.13(2/3): 9278, *note L(3.1/3): 9345.
129228 asynchronous remote procedure call *note E.4(1): 8780.
129229 asynchronous_select *note 9.7.4(2): 4575.
129230 used *note 9.7(2): 4531, *note P: 10247.
129231 Asynchronous_Task_Control
129232 child of Ada *note D.11(3/2): 8572.
129233 at-most-once execution *note E.4(11): 8789.
129234 at_clause *note J.7(1): 9130.
129235 used *note 13.1(2/1): 5285, *note P: 10427.
129236 atomic *note C.6(7/3): 8261.
129237 Atomic aspect *note C.6(6.2/3): 8250.
129238 Atomic pragma *note J.15.8(2/3): 9228, *note L(4.1/3): 9348.
129239 Atomic_Components aspect *note C.6(6.6/3): 8256.
129240 Atomic_Components pragma *note J.15.8(5/3): 9237, *note L(5.1/3):
129241 9351.
129242 Attach_Handler
129243 in Ada.Interrupts *note C.3.2(7): 8230.
129244 Attach_Handler aspect *note C.3.1(6.3/3): 8206.
129245 Attach_Handler pragma *note J.15.7(4/3): 9221, *note L(6.1/3): 9354.
129246 attaching
129247 to an interrupt *note C.3(2): 8198.
129248 attribute *note 4.1.4(1): 2602, *note K.2(1/3): 9281.
129249 representation *note 13.3(1/1): 5353.
129250 specifiable *note 13.3(5/3): 5365.
129251 specifying *note 13.3(1/1): 5354.
129252 attribute_definition_clause *note 13.3(2): 5355.
129253 used *note 13.1(2/1): 5282, *note P: 10424.
129254 attribute_designator *note 4.1.4(3/2): 2606.
129255 used *note 4.1.4(2): 2605, *note 13.1(3): 5289, *note 13.3(2):
129256 5360, *note P: 10444.
129257 Attribute_Handle
129258 in Ada.Task_Attributes *note C.7.2(3): 8294.
129259 attribute_reference *note 4.1.4(2): 2603.
129260 used *note 4.1(2/3): 2528, *note P: 9835.
129261 attributes
129262 Access *note 3.10.2(24/1): 2463, *note 3.10.2(32/3): 2473.
129263 Address *note 13.3(11): 5390, *note J.7.1(5): 9135.
129264 Adjacent *note A.5.3(48): 6712.
129265 Aft *note 3.5.10(5): 1975.
129266 Alignment *note 13.3(23/2): 5398, *note 13.3(26.2/2): 5402.
129267 Base *note 3.5(15): 1699.
129268 Bit_Order *note 13.5.3(4): 5519.
129269 Body_Version *note E.3(4): 8772.
129270 Callable *note 9.9(2): 4619.
129271 Caller *note C.7.1(14/3): 8284.
129272 Ceiling *note A.5.3(33): 6696.
129273 Class *note 3.9(14): 2246, *note 7.3.1(9): 3889, *note J.11(2/2):
129274 9151.
129275 Component_Size *note 13.3(69): 5436.
129276 Compose *note A.5.3(24): 6684.
129277 Constrained *note 3.7.2(3/3): 2138, *note J.4(2): 9128.
129278 Copy_Sign *note A.5.3(51): 6717.
129279 Count *note 9.9(5): 4625.
129280 Definite *note 12.5.1(23/3): 5199.
129281 Delta *note 3.5.10(3): 1971.
129282 Denorm *note A.5.3(9): 6666.
129283 Digits *note 3.5.8(2/1): 1919, *note 3.5.10(7): 1977.
129284 Exponent *note A.5.3(18): 6680.
129285 External_Tag *note 13.3(75/3): 5447.
129286 First *note 3.5(12): 1693, *note 3.6.2(3): 2053.
129287 First(N) *note 3.6.2(4): 2055.
129288 First_Bit *note 13.5.2(3/2): 5505.
129289 First_Valid *note 3.5.5(7.2/3): 1871.
129290 Floor *note A.5.3(30): 6694.
129291 Fore *note 3.5.10(4): 1973.
129292 Fraction *note A.5.3(21): 6682.
129293 Has_Same_Storage *note 13.3(73.2/3): 5443.
129294 Identity *note 11.4.1(9): 4946, *note C.7.1(12): 8282.
129295 Image *note 3.5(35): 1729.
129296 Input *note 13.13.2(22): 5801, *note 13.13.2(32): 5805.
129297 Last *note 3.5(13): 1695, *note 3.6.2(5): 2057.
129298 Last(N) *note 3.6.2(6): 2059.
129299 Last_Bit *note 13.5.2(4/2): 5507.
129300 Last_Valid *note 3.5.5(7.3/3): 1873.
129301 Leading_Part *note A.5.3(54): 6722.
129302 Length *note 3.6.2(9): 2065.
129303 Length(N) *note 3.6.2(10): 2067.
129304 Machine *note A.5.3(60): 6727.
129305 Machine_Emax *note A.5.3(8): 6664.
129306 Machine_Emin *note A.5.3(7): 6662.
129307 Machine_Mantissa *note A.5.3(6): 6660.
129308 Machine_Overflows *note A.5.3(12): 6674, *note A.5.4(4): 6755.
129309 Machine_Radix *note A.5.3(2): 6657, *note A.5.4(2): 6751.
129310 Machine_Rounding *note A.5.3(41.1/2): 6702.
129311 Machine_Rounds *note A.5.3(11): 6672, *note A.5.4(3): 6753.
129312 Max *note 3.5(19): 1705.
129313 Max_Alignment_For_Allocation *note 13.11.1(4/3): 5661.
129314 Max_Size_In_Storage_Elements *note 13.11.1(3/3): 5659.
129315 Min *note 3.5(16): 1702.
129316 Mod *note 3.5.4(16.1/2): 1840.
129317 Model *note A.5.3(68): 6741, *note G.2.2(7): 8963.
129318 Model_Emin *note A.5.3(65): 6735, *note G.2.2(4): 8956.
129319 Model_Epsilon *note A.5.3(66): 6737.
129320 Model_Mantissa *note A.5.3(64): 6733, *note G.2.2(3/2): 8954.
129321 Model_Small *note A.5.3(67): 6739.
129322 Modulus *note 3.5.4(17): 1842.
129323 Old *note 6.1.1(26/3): 3602.
129324 Output *note 13.13.2(19): 5799, *note 13.13.2(29): 5803.
129325 Overlaps_Storage *note 13.3(73.6/3): 5445.
129326 Partition_Id *note E.1(9): 8700.
129327 Pos *note 3.5.5(2): 1863.
129328 Position *note 13.5.2(2/2): 5503.
129329 Pred *note 3.5(25): 1714.
129330 Priority *note D.5.2(3/2): 8450.
129331 Range *note 3.5(14): 1697, *note 3.6.2(7): 2061.
129332 Range(N) *note 3.6.2(8): 2063.
129333 Read *note 13.13.2(6): 5793, *note 13.13.2(14): 5797.
129334 Remainder *note A.5.3(45): 6707.
129335 Result *note 6.1.1(29/3): 3605.
129336 Round *note 3.5.10(12): 1983.
129337 Rounding *note A.5.3(36): 6698.
129338 Safe_First *note A.5.3(71): 6743, *note G.2.2(5): 8958.
129339 Safe_Last *note A.5.3(72): 6745, *note G.2.2(6): 8960.
129340 Scale *note 3.5.10(11): 1980.
129341 Scaling *note A.5.3(27): 6689.
129342 Signed_Zeros *note A.5.3(13): 6676.
129343 Size *note 13.3(40): 5412, *note 13.3(45): 5419.
129344 Small *note 3.5.10(2/1): 1965.
129345 Storage_Pool *note 13.11(13): 5632.
129346 Storage_Size *note 13.3(60/3): 5429, *note 13.11(14): 5634, *note
129347 J.9(2): 9144.
129348 Stream_Size *note 13.13.2(1.2/3): 5786.
129349 Succ *note 3.5(22): 1707.
129350 Tag *note 3.9(16): 2250, *note 3.9(18): 2252.
129351 Terminated *note 9.9(3): 4623.
129352 Truncation *note A.5.3(42): 6705.
129353 Unbiased_Rounding *note A.5.3(39): 6700.
129354 Unchecked_Access *note 13.10(3): 5614, *note H.4(18): 9091.
129355 Val *note 3.5.5(5): 1865.
129356 Valid *note 13.9.2(3/3): 5610, *note H(6): 9049.
129357 Value *note 3.5(52): 1755.
129358 Version *note E.3(3): 8770.
129359 Wide_Image *note 3.5(28): 1726.
129360 Wide_Value *note 3.5(40): 1749.
129361 Wide_Wide_Image *note 3.5(27.1/2): 1721.
129362 Wide_Wide_Value *note 3.5(39.1/2): 1737.
129363 Wide_Wide_Width *note 3.5(37.1/2): 1731.
129364 Wide_Width *note 3.5(38): 1733.
129365 Width *note 3.5(39): 1735.
129366 Write *note 13.13.2(3): 5791, *note 13.13.2(11): 5795.
129367 available
129368 stream attribute *note 13.13.2(39/2): 5828.
129369 avoid overspecifying environmental issues *note 10(3.a): 4637.
129370
129371
129372 \1f
129373 File: aarm2012.info, Node: B, Next: C, Prev: A, Up: Index
129374
129375 B
129376 ==
129377
129378
129379
129380 Backus-Naur Form (BNF)
129381 complete listing *note P: 9595.
129382 cross reference *note P: 10475.
129383 notation *note 1.1.4(3): 1080.
129384 under Syntax heading *note 1.1.2(25): 1017.
129385 Barrier_Limit subtype of Positive
129386 in Ada.Synchronous_Barriers *note D.10.1(4/3): 8568.
129387 base *note 2.4.2(3): 1283, *note 2.4.2(6): 1291.
129388 used *note 2.4.2(2): 1279, *note P: 9619.
129389 base 16 literal *note 2.4.2(1): 1276.
129390 base 2 literal *note 2.4.2(1): 1270.
129391 base 8 literal *note 2.4.2(1): 1273.
129392 Base attribute *note 3.5(15): 1700.
129393 base decimal precision
129394 of a floating point type *note 3.5.7(9): 1903.
129395 of a floating point type *note 3.5.7(10): 1905.
129396 base priority *note D.1(15): 8331.
129397 base range
129398 of a decimal fixed point type *note 3.5.9(16): 1952.
129399 of a fixed point type *note 3.5.9(12): 1946.
129400 of a floating point type *note 3.5.7(8): 1902, *note 3.5.7(10):
129401 1907.
129402 of a modular type *note 3.5.4(10): 1828.
129403 of a scalar type *note 3.5(6): 1682.
129404 of a signed integer type *note 3.5.4(9): 1824.
129405 of an enumeration type *note 3.5(6.b): 1683.
129406 of an ordinary fixed point type *note 3.5.9(13): 1947.
129407 base subtype
129408 of a type *note 3.5(15): 1701.
129409 Base_Name
129410 in Ada.Directories *note A.16(19/2): 7151.
129411 based_literal *note 2.4.2(2): 1278.
129412 used *note 2.4(2): 1254, *note P: 9610.
129413 based_numeral *note 2.4.2(4): 1285.
129414 used *note 2.4.2(2): 1281, *note P: 9621.
129415 basic letter
129416 a category of Character *note A.3.2(27): 5940.
129417 basic_declaration *note 3.1(3/3): 1344.
129418 used *note 3.11(4/1): 2495, *note P: 9821.
129419 basic_declarative_item *note 3.11(4/1): 2494.
129420 used *note 3.11(3): 2492, *note 7.1(3/3): 3831, *note P: 10115.
129421 Basic_Map
129422 in Ada.Strings.Maps.Constants *note A.4.6(5): 6431.
129423 Basic_Set
129424 in Ada.Strings.Maps.Constants *note A.4.6(4): 6423.
129425 Beaujolais effect *note 8.4(1.b): 4054.
129426 [partial] *note 3.6(18.b): 2026, *note 8.6(22.a): 4159, *note
129427 8.6(34.a): 4171, *note 8.6(34.k): 4173.
129428 become nonlimited *note 7.3.1(5/1): 3884, *note 7.5(16): 3913.
129429 BEL
129430 in Ada.Characters.Latin_1 *note A.3.3(5): 5956.
129431 belong
129432 to a range *note 3.5(4): 1677.
129433 to a subtype *note 3.2(8/2): 1417.
129434 belongs
129435 subpool to a pool *note 13.11.4(20/3): 5712.
129436 bibliography *note 1.2(1/3): 1109.
129437 big endian *note 13.5.3(2): 5514.
129438 big-O notation *note A.18(3.b/2): 7221.
129439 binary
129440 literal *note 2.4.2(1): 1271.
129441 in Interfaces.COBOL *note B.4(10): 8109.
129442 binary adding operator *note 4.5.3(1): 3003.
129443 binary literal *note 2.4.2(1): 1269.
129444 binary operator *note 4.5(9): 2924.
129445 binary_adding_operator *note 4.5(4): 2918.
129446 used *note 4.4(4): 2889, *note P: 9933.
129447 Binary_Format
129448 in Interfaces.COBOL *note B.4(24): 8130.
129449 bit field
129450 See record_representation_clause *note 13.5.1(1): 5478.
129451 bit ordering *note 13.5.3(2): 5512.
129452 bit string
129453 See logical operators on boolean arrays *note 4.5.1(2): 2943.
129454 Bit_Order
129455 in System *note 13.7(15/2): 5548.
129456 Bit_Order aspect *note 13.5.3(4): 5524.
129457 Bit_Order attribute *note 13.5.3(4): 5520.
129458 Bit_Order clause *note 13.3(7/2): 5375, *note 13.5.3(4): 5522.
129459 blank
129460 in text input for enumeration and numeric types *note A.10.6(5/2):
129461 7020.
129462 Blank_When_Zero
129463 in Ada.Text_IO.Editing *note F.3.3(7): 8845.
129464 block_statement *note 5.6(2): 3492.
129465 used *note 5.1(5/2): 3361, *note P: 10005.
129466 blocked
129467 [partial] *note D.2.1(11/3): 8352.
129468 a task state *note 9(10): 4190.
129469 during an entry call *note 9.5.3(19): 4425.
129470 execution of a selective_accept *note 9.7.1(16): 4557.
129471 on a delay_statement *note 9.6(21): 4476.
129472 on an accept_statement *note 9.5.2(24): 4394.
129473 waiting for activations to complete *note 9.2(5): 4248.
129474 waiting for dependents to terminate *note 9.3(5): 4255.
129475 blocked interrupt *note C.3(2): 8197.
129476 blocking, potentially *note 9.5.1(8): 4345.
129477 Abort_Task *note C.7.1(16): 8288.
129478 delay_statement *note 9.6(34): 4479, *note D.9(5): 8551.
129479 remote subprogram call *note E.4(17): 8792.
129480 RPC operations *note E.5(23): 8821.
129481 Suspend_Until_True *note D.10(10): 8563.
129482 BMP *note 3.5.2(2/3): 1787, *note 3.5.2(3/3): 1793.
129483 BNF (Backus-Naur Form)
129484 complete listing *note P: 9594.
129485 cross reference *note P: 10474.
129486 notation *note 1.1.4(3): 1079.
129487 under Syntax heading *note 1.1.2(25): 1016.
129488 body *note 3.11(5): 2498, *note 3.11.1(1/3): 2518.
129489 used *note 3.11(3): 2493, *note P: 9820.
129490 body_stub *note 10.1.3(2): 4723.
129491 used *note 3.11(5): 2500, *note P: 9825.
129492 Body_Version attribute *note E.3(4): 8773.
129493 BOM_16
129494 in Ada.Strings.UTF_Encoding *note A.4.11(12/3): 6545.
129495 BOM_16BE
129496 in Ada.Strings.UTF_Encoding *note A.4.11(10/3): 6543.
129497 BOM_16LE
129498 in Ada.Strings.UTF_Encoding *note A.4.11(11/3): 6544.
129499 BOM_8
129500 in Ada.Strings.UTF_Encoding *note A.4.11(9/3): 6542.
129501 Boolean *note 3.5.3(1): 1803.
129502 in Standard *note A.1(5): 5879.
129503 boolean type *note 3.5.3(1): 1806.
129504 Bounded
129505 child of Ada.Strings *note A.4.4(3): 6300.
129506 bounded error *note 1.1.2(31): 1038, *note 1.1.5(8): 1098.
129507 cause *note 4.8(11.1/2): 3295, *note 6.2(12/3): 3636, *note
129508 7.6.1(14/1): 3975, *note 9.4(20.1/2): 4316, *note 9.5.1(8): 4343, *note
129509 9.8(20/3): 4613, *note 10.2(26): 4805, *note 13.9.1(9): 5603, *note
129510 13.11.2(11): 5675, *note A.17(25/2): 7213, *note A.18.2(238/3): 7321,
129511 *note A.18.2(239/2): 7322, *note A.18.2(243/2): 7325, *note
129512 A.18.3(152.1/3): 7397, *note A.18.3(152.2/3): 7398, *note A.18.3(152/2):
129513 7396, *note A.18.4(75.1/3): 7421, *note A.18.4(75.2/3): 7422, *note
129514 A.18.7(96.13/3): 7560, *note A.18.7(96.14/3): 7561, *note
129515 A.18.10(220/3): 7803, *note A.18.10(221/3): 7804, *note A.18.18(68/3):
129516 7846, *note A.18.18(69/3): 7847, *note A.18.19(10/3): 7850, *note
129517 A.18.20(14/3): 7854, *note A.18.21(15/3): 7859, *note A.18.22(12/3):
129518 7863, *note A.18.23(15/3): 7868, *note A.18.24(12/3): 7872, *note
129519 A.18.25(14/3): 7875, *note C.7.1(17/3): 8289, *note C.7.2(13.2/1): 8301,
129520 *note D.2.6(30/2): 8403, *note D.3(13.1/2): 8425, *note E.1(10/2): 8702,
129521 *note E.3(6): 8776, *note J.7.1(11): 9141.
129522 Bounded_IO
129523 child of Ada.Text_IO *note A.10.11(3/2): 7030.
129524 child of Ada.Wide_Text_IO *note A.11(4/3): 7056.
129525 child of Ada.Wide_Wide_Text_IO *note A.11(4/3): 7057.
129526 Bounded_Priority_Queues
129527 child of Ada.Containers *note A.18.31(2/3): 7916.
129528 Bounded_Slice
129529 in Ada.Strings.Bounded *note A.4.4(28.1/2): 6321, *note
129530 A.4.4(28.2/2): 6322.
129531 Bounded_String
129532 in Ada.Strings.Bounded *note A.4.4(6): 6303.
129533 Bounded_Synchronized_Queues
129534 child of Ada.Containers *note A.18.29(2/3): 7901.
129535 bounds
129536 of a discrete_range *note 3.6.1(6): 2046.
129537 of an array *note 3.6(13): 2016.
129538 of the index range of an array_aggregate *note 4.3.3(24): 2762.
129539 box
129540 compound delimiter *note 3.6(15): 2021.
129541 BPH
129542 in Ada.Characters.Latin_1 *note A.3.3(17): 6049.
129543 broadcast signal
129544 See protected object *note 9.4(1): 4263.
129545 See requeue *note 9.5.4(1): 4430.
129546 Broken_Bar
129547 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6086.
129548 BS
129549 in Ada.Characters.Latin_1 *note A.3.3(5): 5957.
129550 budget *note D.14.2(14/2): 8638.
129551 Budget_Has_Expired
129552 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8631.
129553 Budget_Remaining
129554 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8632.
129555 Buffer_Size
129556 in Ada.Storage_IO *note A.9(4): 6840.
129557 Buffer_Type subtype of Storage_Array
129558 in Ada.Storage_IO *note A.9(4): 6841.
129559 build-in-place
129560 See built in place
129561 built in place *note 7.6(17.1/3): 3946.
129562 by copy parameter passing *note 6.2(2): 3622.
129563 by reference parameter passing *note 6.2(2): 3625.
129564 by-copy type *note 6.2(3/3): 3627.
129565 by-reference type *note 6.2(4): 3628.
129566 atomic or volatile *note C.6(18): 8267.
129567 Byte
129568 in Interfaces.COBOL *note B.4(29/3): 8137.
129569 See storage element *note 13.3(8): 5387.
129570 byte sex
129571 See ordering of storage elements in a word *note 13.5.3(5): 5525.
129572 Byte_Array
129573 in Interfaces.COBOL *note B.4(29/3): 8138.
129574
129575
129576 \1f
129577 File: aarm2012.info, Node: C, Next: D, Prev: B, Up: Index
129578
129579 C
129580 ==
129581
129582
129583
129584 C
129585 child of Interfaces *note B.3(4): 7986.
129586 C interface *note B.3(1/3): 7985.
129587 C standard *note 1.2(7/3): 1135.
129588 C++ standard *note 1.2(9/3): 1141.
129589 C_float
129590 in Interfaces.C *note B.3(15): 8002.
129591 Calendar
129592 child of Ada *note 9.6(10): 4458.
129593 call *note 6(2/3): 3511.
129594 master of *note 3.10.2(10.1/3): 2453.
129595 call on a dispatching operation *note 3.9.2(2/3): 2297.
129596 callable *note 9.9(2): 4622.
129597 Callable attribute *note 9.9(2): 4620.
129598 callable construct *note 6(2/3): 3512.
129599 callable entity *note 6(2/3): 3510.
129600 called partition *note E.4(1): 8782.
129601 Caller attribute *note C.7.1(14/3): 8285.
129602 calling convention *note 6.3.1(2/1): 3657, *note B.1(11/3): 7962.
129603 Ada *note 6.3.1(3/3): 3659.
129604 associated with a designated profile *note 3.10(11): 2407.
129605 entry *note 6.3.1(13): 3665.
129606 Intrinsic *note 6.3.1(4): 3661.
129607 protected *note 6.3.1(12): 3663.
129608 calling partition *note E.4(1): 8781.
129609 calling stub *note E.4(10): 8787.
129610 CAN
129611 in Ada.Characters.Latin_1 *note A.3.3(6): 5973.
129612 Cancel_Handler
129613 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8635.
129614 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8610.
129615 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8656.
129616 cancellation
129617 of a delay_statement *note 9.6(22/3): 4477.
129618 of an entry call *note 9.5.3(20): 4426.
129619 cancellation of a remote subprogram call *note E.4(13): 8790.
129620 canonical form *note A.5.3(3): 6659.
129621 canonical order of array components *note 5.5.2(11/3): 3487.
129622 canonical semantics *note 11.6(2/3): 5027.
129623 canonical-form representation *note A.5.3(10): 6671.
129624 capacity
129625 of a hashed map *note A.18.5(41/2): 7471.
129626 of a hashed set *note A.18.8(63/2): 7627.
129627 of a queue *note A.18.27(10/3): 7892.
129628 of a vector *note A.18.2(2/2): 7234.
129629 in Ada.Containers.Hashed_Maps *note A.18.5(8/2): 7435.
129630 in Ada.Containers.Hashed_Sets *note A.18.8(10/2): 7576.
129631 in Ada.Containers.Vectors *note A.18.2(19/2): 7247.
129632 Capacity_Error
129633 in Ada.Containers *note A.18.1(5.1/3): 7228.
129634 case insensitive *note 2.3(5/3): 1246.
129635 case_expression *note 4.5.7(5/3): 3093.
129636 used *note 4.5.7(2/3): 3084, *note P: 9951.
129637 case_expression_alternative *note 4.5.7(6/3): 3097.
129638 used *note 4.5.7(5/3): 3096, *note P: 9959.
129639 case_statement *note 5.4(2/3): 3404.
129640 used *note 5.1(5/2): 3359, *note P: 10003.
129641 case_statement_alternative *note 5.4(3): 3408.
129642 used *note 5.4(2/3): 3407, *note P: 10019.
129643 cast
129644 See type conversion *note 4.6(1/3): 3128.
129645 See unchecked type conversion *note 13.9(1): 5589.
129646 catch (an exception)
129647 See handle *note 11(1/3): 4864.
129648 categorization aspect *note E.2(2/3): 8708.
129649 categorization pragma *note E.2(2/3): 8704.
129650 Remote_Call_Interface *note E.2.3(2): 8745.
129651 Remote_Types *note E.2.2(2): 8729.
129652 Shared_Passive *note E.2.1(2): 8714.
129653 categorized library unit *note E.2(2/3): 8709.
129654 category
129655 of types *note 3.2(2/2): 1389, *note 3.4(1.1/2): 1608.
129656 category (of types) *note N(4.3/2): 9521.
129657 category determined for a formal type *note 12.5(6/3): 5190.
129658 catenation operator
129659 See concatenation operator *note 4.4(1/3): 2823.
129660 See concatenation operator *note 4.5.3(3): 3019.
129661 Cause_Of_Termination
129662 in Ada.Task_Termination *note C.7.3(3/2): 8306.
129663 CCH
129664 in Ada.Characters.Latin_1 *note A.3.3(18): 6067.
129665 cease to exist
129666 object *note 7.6.1(11/3): 3970, *note 13.11.2(10/2): 5674.
129667 type *note 7.6.1(11/3): 3971.
129668 Cedilla
129669 in Ada.Characters.Latin_1 *note A.3.3(22): 6106.
129670 Ceiling
129671 in Ada.Containers.Ordered_Maps *note A.18.6(41/2): 7530.
129672 in Ada.Containers.Ordered_Sets *note A.18.9(51/2): 7691, *note
129673 A.18.9(71/2): 7704.
129674 Ceiling attribute *note A.5.3(33): 6697.
129675 ceiling priority
129676 of a protected object *note D.3(8/3): 8421.
129677 Ceiling_Check
129678 [partial] *note C.3.1(11/3): 8214, *note D.3(13): 8422.
129679 Ceiling_Locking locking policy *note D.3(7): 8420.
129680 Cent_Sign
129681 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6082.
129682 change of representation *note 13.6(1/3): 5528.
129683 char
129684 in Interfaces.C *note B.3(19): 8005.
129685 char16_array
129686 in Interfaces.C *note B.3(39.5/3): 8029.
129687 char16_nul
129688 in Interfaces.C *note B.3(39.3/2): 8026.
129689 char16_t
129690 in Interfaces.C *note B.3(39.2/2): 8025.
129691 char32_array
129692 in Interfaces.C *note B.3(39.14/3): 8039.
129693 char32_nul
129694 in Interfaces.C *note B.3(39.12/2): 8036.
129695 char32_t
129696 in Interfaces.C *note B.3(39.11/2): 8035.
129697 char_array
129698 in Interfaces.C *note B.3(23/3): 8009.
129699 char_array_access
129700 in Interfaces.C.Strings *note B.3.1(4): 8053.
129701 CHAR_BIT
129702 in Interfaces.C *note B.3(6): 7987.
129703 Character *note 3.5.2(2/3): 1789.
129704 used *note 2.7(2): 1302, *note P: 9631.
129705 in Standard *note A.1(35/3): 5884.
129706 character encoding *note A.4.11(46/3): 6575.
129707 character plane *note 2.1(1/3): 1166.
129708 character set *note 2.1(1/3): 1164.
129709 character set standard
129710 16 and 32-bit *note 1.2(8/3): 1138.
129711 7-bit *note 1.2(2): 1115.
129712 8-bit *note 1.2(6/3): 1132.
129713 control functions *note 1.2(5): 1127.
129714 character type *note 3.5.2(1): 1785, *note N(5): 9522.
129715 character_literal *note 2.5(2): 1292.
129716 used *note 3.5.1(4): 1777, *note 4.1(2/3): 2531, *note 4.1.3(3):
129717 2589, *note P: 9718.
129718 Character_Mapping
129719 in Ada.Strings.Maps *note A.4.2(20/2): 6251.
129720 Character_Mapping_Function
129721 in Ada.Strings.Maps *note A.4.2(25): 6257.
129722 Character_Range
129723 in Ada.Strings.Maps *note A.4.2(6): 6240.
129724 Character_Ranges
129725 in Ada.Strings.Maps *note A.4.2(7): 6241.
129726 Character_Sequence subtype of String
129727 in Ada.Strings.Maps *note A.4.2(16): 6247.
129728 Character_Set
129729 in Ada.Strings.Maps *note A.4.2(4/2): 6238.
129730 in Ada.Strings.Wide_Maps *note A.4.7(46/2): 6470.
129731 in Ada.Strings.Wide_Maps.Wide_Constants *note A.4.8(48/2): 6513.
129732 in Interfaces.Fortran *note B.5(11): 8170.
129733 Character_Set_Version
129734 in Ada.Wide_Characters.Handling *note A.3.5(4/3): 6199.
129735 characteristics
129736 [partial] *note 3.4(7/3): 1620.
129737 Characters
129738 child of Ada *note A.3.1(2): 5903.
129739 chars_ptr
129740 in Interfaces.C.Strings *note B.3.1(5/2): 8054.
129741 chars_ptr_array
129742 in Interfaces.C.Strings *note B.3.1(6/2): 8055.
129743 check
129744 language-defined *note 11.5(2/3): 4982, *note 11.6(1/3): 5022.
129745 check, language-defined
129746 Access_Check *note 4.1(13): 2555, *note 4.1.5(8/3): 2630, *note
129747 4.6(51/3): 3212, *note 4.8(10.4/3): 3290.
129748 Accessibility_Check *note 3.10.2(29): 2470, *note 4.6(39.1/2):
129749 3190, *note 4.6(48/3): 3204, *note 4.8(10.1/3): 3281, *note 6.5(8/3):
129750 3771, *note 6.5(21/3): 3777, *note 13.11.4(25/3): 5717, *note
129751 13.11.4(26/3): 5719, *note E.4(18/1): 8794.
129752 Allocation_Check *note 4.8(10.2/2): 3284, *note 4.8(10.3/2): 3287,
129753 *note 4.8(10.4/3): 3292, *note 13.11.4(30/3): 5722.
129754 Ceiling_Check *note C.3.1(11/3): 8215, *note D.3(13): 8423.
129755 controlled by assertion policy *note 3.2.4(31/3): 1517, *note
129756 4.6(51/3): 3214, *note 6.1.1(32/3): 3608, *note 6.1.1(33/3): 3611, *note
129757 6.1.1(35/3): 3616, *note 7.3.2(9/3): 3898.
129758 Discriminant_Check *note 4.1.3(15): 2596, *note 4.3(6): 2679, *note
129759 4.3.2(8/3): 2723, *note 4.6(43): 3196, *note 4.6(45): 3198, *note
129760 4.6(51/3): 3208, *note 4.6(52): 3221, *note 4.7(4): 3246, *note
129761 4.8(10/2): 3277, *note 6.5(5.11/3): 3765.
129762 Division_Check *note 3.5.4(20): 1849, *note 4.5.5(22): 3056, *note
129763 A.5.1(28): 6616, *note A.5.3(47): 6711, *note G.1.1(40): 8889, *note
129764 G.1.2(28): 8917, *note K.2(202): 9312.
129765 Elaboration_Check *note 3.11(9): 2510.
129766 Index_Check *note 4.1.1(7): 2570, *note 4.1.2(7): 2580, *note
129767 4.3.3(29/3): 2766, *note 4.3.3(30): 2768, *note 4.5.3(8): 3022, *note
129768 4.6(51/3): 3210, *note 4.7(4): 3248, *note 4.8(10/2): 3275.
129769 Length_Check *note 4.5.1(8): 2947, *note 4.6(37): 3185, *note
129770 4.6(52): 3217.
129771 Overflow_Check *note 3.5.4(20): 1846, *note 4.4(11): 2911, *note
129772 4.5.7(21/3): 3107, *note 5.4(13): 3416, *note G.2.1(11): 8950, *note
129773 G.2.2(7): 8966, *note G.2.3(25): 8972, *note G.2.4(2): 8978, *note
129774 G.2.6(3): 8985.
129775 Partition_Check *note E.4(19): 8797.
129776 Range_Check *note 3.2.2(11): 1485, *note 3.5(24): 1713, *note
129777 3.5(27): 1720, *note 3.5(39.12/3): 1748, *note 3.5(39.4/3): 1742, *note
129778 3.5(39.5/3): 1745, *note 3.5(43/3): 1754, *note 3.5(55/3): 1760, *note
129779 3.5.5(7): 1870, *note 3.5.9(19): 1961, *note 4.2(11): 2663, *note
129780 4.3.3(28): 2764, *note 4.5.1(8): 2949, *note 4.5.6(6): 3070, *note
129781 4.5.6(13): 3079, *note 4.6(28): 3175, *note 4.6(38): 3187, *note
129782 4.6(46): 3200, *note 4.6(51/3): 3206, *note 4.7(4): 3244, *note
129783 13.13.2(35/3): 5808, *note A.5.2(39): 6651, *note A.5.3(26): 6688, *note
129784 A.5.3(29): 6693, *note A.5.3(50): 6716, *note A.5.3(53): 6721, *note
129785 A.5.3(59): 6726, *note A.5.3(62): 6731, *note K.2(11): 9284, *note
129786 K.2(114): 9299, *note K.2(122): 9302, *note K.2(184): 9307, *note
129787 K.2(220): 9316, *note K.2(241): 9319, *note K.2(41): 9289, *note
129788 K.2(47): 9292.
129789 Reserved_Check *note C.3.1(10/3): 8211.
129790 Storage_Check *note 11.1(6): 4881, *note 13.3(67): 5434, *note
129791 13.11(17): 5646, *note D.7(17/1): 8499, *note D.7(18/1): 8504, *note
129792 D.7(19/1): 8509.
129793 Tag_Check *note 3.9.2(16): 2314, *note 4.6(42): 3194, *note
129794 4.6(52): 3219, *note 5.2(10): 3389, *note 6.5(8.1/3): 3773.
129795 checking pragmas *note 11.5(1/2): 4980.
129796 child
129797 of a library unit *note 10.1.1(1): 4647.
129798 Child_Count
129799 in Ada.Containers.Multiway_Trees *note A.18.10(46/3): 7771.
129800 Child_Depth
129801 in Ada.Containers.Multiway_Trees *note A.18.10(47/3): 7772.
129802 choice
129803 of an exception_handler *note 11.2(5.b/3): 4900.
129804 choice parameter *note 11.2(9): 4902.
129805 choice_expression *note 4.4(2.1/3): 2858.
129806 used *note 3.8.1(5/3): 2195, *note 4.4(3.2/3): 2883, *note P: 9792.
129807 choice_parameter_specification *note 11.2(4): 4895.
129808 used *note 11.2(3): 4891, *note P: 10325.
129809 choice_relation *note 4.4(2.2/3): 2869.
129810 used *note 4.4(2.1/3): 2862, *note P: 9916.
129811 Circumflex
129812 in Ada.Characters.Latin_1 *note A.3.3(12): 6008.
129813 class
129814 of types *note 3.2(2/2): 1390, *note 3.4(1.1/2): 1607.
129815 See also package *note 7(1): 3824.
129816 See also tag *note 3.9(3): 2227.
129817 class (of types) *note N(6/2): 9523.
129818 Class attribute *note 3.9(14): 2247, *note 7.3.1(9): 3890, *note
129819 J.11(2/2): 9152.
129820 class factory *note 3.9(30/2): 2263.
129821 class-wide postcondition expression *note 6.1.1(5/3): 3592.
129822 class-wide precondition expression *note 6.1.1(3/3): 3584.
129823 class-wide type *note 3.4.1(4): 1647, *note 3.7(26): 2112.
129824 cleanup
129825 See finalization *note 7.6.1(1): 3954.
129826 clear
129827 execution timer object *note D.14.1(12/2): 8614.
129828 group budget object *note D.14.2(15/2): 8642.
129829 timing event object *note D.15(9/2): 8660.
129830 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(13/2): 7346.
129831 in Ada.Containers.Hashed_Maps *note A.18.5(12/2): 7439.
129832 in Ada.Containers.Hashed_Sets *note A.18.8(14/2): 7580.
129833 in Ada.Containers.Indefinite_Holders *note A.18.18(11/3): 7829.
129834 in Ada.Containers.Multiway_Trees *note A.18.10(23/3): 7748.
129835 in Ada.Containers.Ordered_Maps *note A.18.6(11/2): 7493.
129836 in Ada.Containers.Ordered_Sets *note A.18.9(13/2): 7654.
129837 in Ada.Containers.Vectors *note A.18.2(24/2): 7252.
129838 in Ada.Environment_Variables *note A.17(7/2): 7210.
129839 cleared
129840 termination handler *note C.7.3(9/2): 8319.
129841 clock *note 9.6(6/3): 4457.
129842 in Ada.Calendar *note 9.6(12): 4464.
129843 in Ada.Execution_Time *note D.14(5/2): 8591.
129844 in Ada.Execution_Time.Interrupts *note D.14.3(3/3): 8647.
129845 in Ada.Real_Time *note D.8(6): 8532.
129846 clock jump *note D.8(32): 8547.
129847 clock tick *note D.8(23): 8546.
129848 Clock_For_Interrupts
129849 in Ada.Execution_Time *note D.14(9.3/3): 8596.
129850 Close
129851 in Ada.Direct_IO *note A.8.4(8): 6814.
129852 in Ada.Sequential_IO *note A.8.1(8): 6786.
129853 in Ada.Streams.Stream_IO *note A.12.1(10): 7073.
129854 in Ada.Text_IO *note A.10.1(11): 6871.
129855 close result set *note G.2.3(5): 8970.
129856 closed entry *note 9.5.3(5): 4408.
129857 of a protected object *note 9.5.3(7/3): 4413.
129858 of a task *note 9.5.3(6/3): 4411.
129859 closed under derivation *note 3.2(2.b/2): 1397, *note 3.4(28): 1635,
129860 *note N(6/2): 9524.
129861 closure
129862 downward *note 3.10.2(13.b/2): 2456, *note 3.10.2(37/2): 2483.
129863 COBOL
129864 child of Interfaces *note B.4(7): 8106.
129865 COBOL interface *note B.4(1/3): 8105.
129866 COBOL standard *note 1.2(4/2): 1121.
129867 COBOL_Character
129868 in Interfaces.COBOL *note B.4(13): 8115.
129869 COBOL_To_Ada
129870 in Interfaces.COBOL *note B.4(15): 8117.
129871 code point
129872 for characters *note 3.5.2(2/3): 1791, *note 3.5.2(11.p/3): 1802.
129873 code_statement *note 13.8(2): 5577.
129874 used *note 5.1(4/2): 3356, *note P: 10001.
129875 Coding aspect *note 13.4(7): 5466.
129876 coextension
129877 of an object *note 3.10.2(14.4/3): 2458.
129878 Col
129879 in Ada.Text_IO *note A.10.1(37): 6923.
129880 collection
129881 of an access type *note 7.6.1(11.1/3): 3972.
129882 colon *note 2.1(15/3): 1206.
129883 in Ada.Characters.Latin_1 *note A.3.3(10): 5998.
129884 column number *note A.10(9): 6853.
129885 comma *note 2.1(15/3): 1198.
129886 in Ada.Characters.Latin_1 *note A.3.3(8): 5993.
129887 Command_Line
129888 child of Ada *note A.15(3): 7127.
129889 Command_Name
129890 in Ada.Command_Line *note A.15(6): 7130.
129891 comment *note 2.7(2): 1301.
129892 comments, instructions for submission *note 0.2(58/1): 1002.
129893 Commercial_At
129894 in Ada.Characters.Latin_1 *note A.3.3(10): 6004.
129895 Communication_Error
129896 in System.RPC *note E.5(5): 8810.
129897 comparison operator
129898 See relational operator *note 4.5.2(1): 2953.
129899 compatibility
129900 composite_constraint with an access subtype *note 3.10(15/2): 2416.
129901 constraint with a subtype *note 3.2.2(12): 1486.
129902 delta_constraint with an ordinary fixed point subtype *note J.3(9):
129903 9125.
129904 digits_constraint with a decimal fixed point subtype *note
129905 3.5.9(18): 1958.
129906 digits_constraint with a floating point subtype *note J.3(10):
129907 9126.
129908 discriminant constraint with a subtype *note 3.7.1(10): 2132.
129909 index constraint with a subtype *note 3.6.1(7): 2047.
129910 range with a scalar subtype *note 3.5(8): 1687.
129911 range_constraint with a scalar subtype *note 3.5(8): 1688.
129912 compatible
129913 a type, with a convention *note B.1(12): 7963.
129914 compilation *note 10.1.1(2): 4648.
129915 separate *note 10.1(1): 4642.
129916 Compilation unit *note 10.1(2): 4644, *note 10.1.1(9): 4678, *note
129917 N(7): 9525.
129918 compilation units needed
129919 by a compilation unit *note 10.2(2): 4789.
129920 remote call interface *note E.2.3(18): 8764.
129921 shared passive library unit *note E.2.1(11): 8725.
129922 compilation_unit *note 10.1.1(3): 4650.
129923 used *note 10.1.1(2): 4649, *note P: 10278.
129924 compile-time error *note 1.1.2(27): 1022, *note 1.1.5(4): 1092.
129925 compile-time semantics *note 1.1.2(28): 1027.
129926 complete context *note 8.6(4): 4143.
129927 completely defined *note 3.11.1(8): 2521.
129928 completion
129929 abnormal *note 7.6.1(2/2): 3961.
129930 compile-time concept *note 3.11.1(1/3): 2517.
129931 normal *note 7.6.1(2/2): 3959.
129932 run-time concept *note 7.6.1(2/2): 3957.
129933 completion and leaving (completed and left) *note 7.6.1(2/2): 3956.
129934 completion legality
129935 [partial] *note 3.10.1(13): 2434.
129936 entry_body *note 9.5.2(16): 4382.
129937 Complex
129938 in Ada.Numerics.Generic_Complex_Types *note G.1.1(3): 8867.
129939 in Interfaces.Fortran *note B.5(9): 8166.
129940 Complex_Arrays
129941 child of Ada.Numerics *note G.3.2(53/2): 9041.
129942 Complex_Elementary_Functions
129943 child of Ada.Numerics *note G.1.2(9/1): 8915.
129944 Complex_IO
129945 child of Ada.Text_IO *note G.1.3(3): 8923.
129946 child of Ada.Wide_Text_IO *note G.1.4(1): 8936.
129947 child of Ada.Wide_Wide_Text_IO *note G.1.5(1/2): 8938.
129948 Complex_Matrix
129949 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(4/2): 9007.
129950 Complex_Text_IO
129951 child of Ada *note G.1.3(9.1/2): 8933.
129952 Complex_Types
129953 child of Ada.Numerics *note G.1.1(25/1): 8887.
129954 Complex_Vector
129955 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(4/2): 9006.
129956 component *note 3.2(2/2): 1395.
129957 of a type *note 3.2(6/2): 1409.
129958 component subtype *note 3.6(10): 2011.
129959 component_choice_list *note 4.3.1(5): 2693.
129960 used *note 4.3.1(4/2): 2692, *note P: 9874.
129961 component_clause *note 13.5.1(3): 5483.
129962 used *note 13.5.1(2): 5482, *note P: 10451.
129963 component_declaration *note 3.8(6/3): 2157.
129964 used *note 3.8(5/1): 2155, *note 9.4(6): 4285, *note P: 9779.
129965 component_definition *note 3.6(7/2): 2004.
129966 used *note 3.6(3): 1994, *note 3.6(5): 2000, *note 3.8(6/3): 2159,
129967 *note P: 9743.
129968 component_item *note 3.8(5/1): 2154.
129969 used *note 3.8(4): 2152, *note P: 9777.
129970 component_list *note 3.8(4): 2149.
129971 used *note 3.8(3): 2148, *note 3.8.1(3): 2190, *note P: 9774.
129972 Component_Size aspect *note 13.3(70): 5441.
129973 Component_Size attribute *note 13.3(69): 5437.
129974 Component_Size clause *note 13.3(7/2): 5372, *note 13.3(70): 5439.
129975 components
129976 of a record type *note 3.8(9/2): 2163.
129977 Compose
129978 in Ada.Directories *note A.16(20/2): 7152.
129979 in Ada.Directories.Hierarchical_File_Names *note A.16.1(14/3):
129980 7202.
129981 Compose attribute *note A.5.3(24): 6685.
129982 Compose_From_Cartesian
129983 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(9/2): 9013,
129984 *note G.3.2(29/2): 9025.
129985 in Ada.Numerics.Generic_Complex_Types *note G.1.1(8): 8878.
129986 Compose_From_Polar
129987 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(11/2): 9018,
129988 *note G.3.2(32/2): 9030.
129989 in Ada.Numerics.Generic_Complex_Types *note G.1.1(11): 8883.
129990 composite type *note 3.2(2/2): 1394, *note N(8/2): 9526.
129991 composite_constraint *note 3.2.2(7): 1478.
129992 used *note 3.2.2(5): 1473, *note P: 9683.
129993 compound delimiter *note 2.2(10): 1228.
129994 compound_statement *note 5.1(5/2): 3357.
129995 used *note 5.1(3): 3343, *note P: 9989.
129996 concatenation operator *note 4.4(1/3): 2821, *note 4.5.3(3): 3017.
129997 concrete subprogram
129998 See nonabstract subprogram *note 3.9.3(1/2): 2325.
129999 concrete type
130000 See nonabstract type *note 3.9.3(1/2): 2323.
130001 concurrent processing
130002 See task *note 9(1/3): 4183.
130003 condition *note 4.5.7(4/3): 3091.
130004 used *note 4.5.7(3/3): 3086, *note 5.3(2): 3398, *note 5.5(3/3):
130005 3426, *note 5.7(2): 3500, *note 9.5.2(7): 4372, *note 9.7.1(3): 4541,
130006 *note P: 10253.
130007 See also exception *note 11(1/3): 4861.
130008 conditional_entry_call *note 9.7.3(2): 4571.
130009 used *note 9.7(2): 4530, *note P: 10246.
130010 conditional_expression *note 4.5.7(2/3): 3082.
130011 used *note 4.4(7/3): 2907, *note P: 9948.
130012 configuration
130013 of the partitions of a program *note E(4): 8691.
130014 configuration pragma *note 10.1.5(8): 4767.
130015 Assertion_Policy *note 11.4.2(7/3): 4969.
130016 Detect_Blocking *note H.5(4/2): 9109.
130017 Discard_Names *note C.5(4): 8245.
130018 Locking_Policy *note D.3(5): 8413.
130019 Normalize_Scalars *note H.1(4): 9054.
130020 Partition_Elaboration_Policy *note H.6(5/2): 9115.
130021 Priority_Specific_Dispatching *note D.2.2(5/2): 8364.
130022 Profile *note 13.12(14/3): 5746.
130023 Queuing_Policy *note D.4(5): 8435.
130024 Restrictions *note 13.12(8/3): 5740.
130025 Reviewable *note H.3.1(4): 9059.
130026 Suppress *note 11.5(5/2): 4993.
130027 Task_Dispatching_Policy *note D.2.2(5/2): 8362.
130028 Unsuppress *note 11.5(5/2): 4995.
130029 confirming
130030 aspect specification *note 13.1(18.2/3): 5314.
130031 representation item *note 13.1(18.2/3): 5312.
130032 representation value *note 13.1(18.2/3): 5313.
130033 conformance *note 6.3.1(1): 3651.
130034 of an implementation with the Standard *note 1.1.3(1): 1064.
130035 See also full conformance, mode conformance, subtype conformance,
130036 type conformance
130037 Conjugate
130038 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(13/2): 9019,
130039 *note G.3.2(34/2): 9032.
130040 in Ada.Numerics.Generic_Complex_Types *note G.1.1(12): 8885, *note
130041 G.1.1(15): 8886.
130042 consistency
130043 among compilation units *note 10.1.4(5): 4756.
130044 constant *note 3.3(13/3): 1523.
130045 result of a function_call *note 6.4(12/2): 3712.
130046 See also literal *note 4.2(1): 2650.
130047 See also static *note 4.9(1): 3305.
130048 constant indexing *note 4.1.6(12/3): 2644.
130049 constant object *note 3.3(13/3): 1525.
130050 constant view *note 3.3(13/3): 1527.
130051 Constant_Indexing aspect *note 4.1.6(2/3): 2634.
130052 Constant_Reference
130053 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.3/3): 7352.
130054 in Ada.Containers.Hashed_Maps *note A.18.5(17.3/3): 7446, *note
130055 A.18.5(17.5/3): 7448.
130056 in Ada.Containers.Hashed_Sets *note A.18.8(17.2/3): 7584, *note
130057 A.18.8(58.3/3): 7625.
130058 in Ada.Containers.Indefinite_Holders *note A.18.18(18/3): 7836.
130059 in Ada.Containers.Multiway_Trees *note A.18.10(30/3): 7755.
130060 in Ada.Containers.Ordered_Maps *note A.18.6(16.3/3): 7500, *note
130061 A.18.6(16.5/3): 7502.
130062 in Ada.Containers.Ordered_Sets *note A.18.9(16.2/3): 7658, *note
130063 A.18.9(73.3/3): 7709.
130064 in Ada.Containers.Vectors *note A.18.2(34.3/3): 7264, *note
130065 A.18.2(34.5/3): 7266.
130066 Constant_Reference_Type
130067 in Ada.Containers.Indefinite_Holders *note A.18.18(16/3): 7834.
130068 in Ada.Containers.Multiway_Trees *note A.18.10(28/3): 7753.
130069 Constants
130070 child of Ada.Strings.Maps *note A.4.6(3/2): 6417.
130071 constituent
130072 of a construct *note 1.1.4(17): 1088.
130073 constrained *note 3.2(9): 1420.
130074 known to be *note 3.3(23.1/3): 1538.
130075 object *note 3.3.1(9/2): 1577.
130076 object *note 6.4.1(16): 3727.
130077 subtype *note 3.2(9): 1422, *note 3.4(6): 1617, *note 3.5(7): 1684,
130078 *note 3.5.1(10): 1782, *note 3.5.4(9): 1825, *note 3.5.4(10): 1829,
130079 *note 3.5.7(11): 1908, *note 3.5.9(13): 1948, *note 3.5.9(16): 1953,
130080 *note 3.6(15): 2019, *note 3.6(16): 2022, *note 3.7(26): 2108, *note
130081 3.9(15): 2249.
130082 subtype *note 3.10(14/3): 2414.
130083 subtype *note K.2(33): 9286.
130084 Constrained attribute *note 3.7.2(3/3): 2139, *note J.4(2): 9129.
130085 constrained by its initial value *note 3.3.1(9/2): 1574.
130086 [partial] *note 4.8(6/3): 3267, *note 6.5(5.11/3): 3762.
130087 constrained_array_definition *note 3.6(5): 1997.
130088 used *note 3.6(2): 1990, *note P: 9740.
130089 constraint *note 3.2.2(5): 1471.
130090 [partial] *note 3.2(7/2): 1410.
130091 of a first array subtype *note 3.6(16): 2024.
130092 of a subtype *note 3.2(8/2): 1415.
130093 of an object *note 3.3.1(9/2): 1573.
130094 used *note 3.2.2(3/2): 1468, *note P: 9680.
130095 Constraint_Error
130096 raised by failure of run-time check *note 1.1.5(12.b): 1107, *note
130097 3.2.2(12): 1487, *note 3.5(24): 1709, *note 3.5(27): 1716, *note
130098 3.5(39.12/3): 1746, *note 3.5(39.4/3): 1740, *note 3.5(39.5/3): 1743,
130099 *note 3.5(43/3): 1752, *note 3.5(55/3): 1758, *note 3.5.4(20): 1847,
130100 *note 3.5.5(7): 1868, *note 3.5.9(19): 1962, *note 3.9.2(16): 2315,
130101 *note 4.1(13): 2556, *note 4.1.1(7): 2571, *note 4.1.2(7): 2582, *note
130102 4.1.3(15): 2598, *note 4.1.5(8/3): 2631, *note 4.2(11): 2664, *note
130103 4.3(6): 2680, *note 4.3.2(8/3): 2724, *note 4.3.3(31): 2769, *note
130104 4.4(11): 2912, *note 4.5(10): 2928, *note 4.5(11): 2929, *note 4.5(12):
130105 2930, *note 4.5.1(8): 2950, *note 4.5.3(8): 3023, *note 4.5.5(22): 3057,
130106 *note 4.5.6(6): 3071, *note 4.5.6(12): 3077, *note 4.5.6(13): 3080,
130107 *note 4.5.7(21/3): 3108, *note 4.6(28): 3176, *note 4.6(57/3): 3225,
130108 *note 4.6(60): 3229, *note 4.7(4): 3250, *note 4.8(10.4/3): 3293, *note
130109 4.8(10/2): 3278, *note 5.2(10): 3390, *note 5.4(13): 3417, *note
130110 6.5(5.11/3): 3763, *note 6.5(8.1/3): 3774, *note 11.1(4): 4875, *note
130111 11.4.1(14/2): 4949, *note 11.5(10): 4999, *note 13.9.1(9): 5605, *note
130112 13.13.2(35/3): 5809, *note A.4.3(109): 6297, *note A.4.7(47): 6471,
130113 *note A.4.8(51/2): 6515, *note A.5.1(28): 6617, *note A.5.1(34): 6618,
130114 *note A.5.2(39): 6652, *note A.5.2(40.1/1): 6654, *note A.5.3(26): 6686,
130115 *note A.5.3(29): 6691, *note A.5.3(47): 6709, *note A.5.3(50): 6714,
130116 *note A.5.3(53): 6719, *note A.5.3(59): 6724, *note A.5.3(62): 6729,
130117 *note A.15(14): 7135, *note B.3(53): 8047, *note B.3(54): 8048, *note
130118 B.4(58): 8157, *note E.4(19): 8798, *note E.4(20.u): 8799, *note
130119 E.4(20.v): 8800, *note G.1.1(40): 8890, *note G.1.2(28): 8918, *note
130120 G.2.1(12): 8951, *note G.2.2(7): 8962, *note G.2.3(26): 8973, *note
130121 G.2.4(3): 8979, *note G.2.6(4): 8986, *note K.2(11): 9282, *note
130122 K.2(114): 9297, *note K.2(122): 9300, *note K.2(184): 9305, *note
130123 K.2(202): 9310, *note K.2(220): 9314, *note K.2(241): 9317, *note
130124 K.2(261): 9323, *note K.2(41): 9287, *note K.2(47): 9290.
130125 in Standard *note A.1(46): 5893.
130126 Construct *note 1.1.4(16): 1087, *note N(9): 9527.
130127 constructor
130128 See initialization *note 3.3.1(18/2): 1587.
130129 See initialization *note 7.6(1): 3920.
130130 See initialization expression *note 3.3.1(4): 1568.
130131 See Initialize *note 7.6(1): 3921.
130132 See initialized allocator *note 4.8(4): 3265.
130133 container *note N(9.1/3): 9528.
130134 cursor *note A.18(2/2): 7218.
130135 list *note A.18.3(1/2): 7334.
130136 map *note A.18.4(1/2): 7408.
130137 set *note A.18.7(1/2): 7545.
130138 vector *note A.18.2(1/2): 7232.
130139 container element iterator *note 5.5.2(3/3): 3478.
130140 Containers
130141 child of Ada *note A.18.1(3/2): 7225.
130142 Containing_Directory
130143 in Ada.Directories *note A.16(17/2): 7149.
130144 in Ada.Directories.Hierarchical_File_Names *note A.16.1(11/3):
130145 7199.
130146 Contains
130147 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(43/2): 7381.
130148 in Ada.Containers.Hashed_Maps *note A.18.5(32/2): 7466.
130149 in Ada.Containers.Hashed_Sets *note A.18.8(44/2): 7609, *note
130150 A.18.8(57/2): 7621.
130151 in Ada.Containers.Multiway_Trees *note A.18.10(41/3): 7766.
130152 in Ada.Containers.Ordered_Maps *note A.18.6(42/2): 7531.
130153 in Ada.Containers.Ordered_Sets *note A.18.9(52/2): 7692, *note
130154 A.18.9(72/2): 7705.
130155 in Ada.Containers.Vectors *note A.18.2(71/2): 7306.
130156 context free grammar
130157 complete listing *note P: 9593.
130158 cross reference *note P: 10473.
130159 notation *note 1.1.4(3): 1078.
130160 under Syntax heading *note 1.1.2(25): 1015.
130161 context_clause *note 10.1.2(2): 4698.
130162 used *note 10.1.1(3): 4651, *note P: 10281.
130163 context_item *note 10.1.2(3): 4700.
130164 used *note 10.1.2(2): 4699, *note P: 10296.
130165 contiguous representation
130166 [partial] *note 13.1(7.a/2): 5295, *note 13.5.2(5): 5509, *note
130167 13.7.1(12): 5568, *note 13.9(9): 5591, *note 13.9(17/3): 5594, *note
130168 13.11(17.d): 5648, *note 13.11(21.6/3): 5654.
130169 Continue
130170 in Ada.Asynchronous_Task_Control *note D.11(3/2): 8574.
130171 contract model of generics *note 12.3(1.a/3): 5070.
130172 control character
130173 a category of Character *note A.3.2(22): 5935.
130174 a category of Character *note A.3.3(4): 5948, *note A.3.3(15):
130175 6042.
130176 See also format_effector *note 2.1(13/3): 1183.
130177 Control_Set
130178 in Ada.Strings.Maps.Constants *note A.4.6(4): 6418.
130179 Controlled
130180 in Ada.Finalization *note 7.6(5/2): 3928.
130181 controlled type *note 7.6(2): 3923, *note 7.6(9/2): 3935, *note N(10):
130182 9529.
130183 controlling access result *note 3.9.2(2/3): 2303.
130184 controlling formal parameter *note 3.9.2(2/3): 2300.
130185 controlling operand *note 3.9.2(2/3): 2299.
130186 controlling result *note 3.9.2(2/3): 2301.
130187 controlling tag
130188 for a call on a dispatching operation *note 3.9.2(1/2): 2291.
130189 controlling tag value *note 3.9.2(14): 2311.
130190 for the expression in an assignment_statement *note 5.2(9): 3387.
130191 controlling type
130192 of a formal_abstract_subprogram_declaration *note 12.6(8.4/3):
130193 5249.
130194 convention *note 6.3.1(2/1): 3656, *note B.1(11/3): 7961.
130195 Convention aspect *note B.1(2/3): 7955.
130196 Convention pragma *note J.15.5(4/3): 9206, *note L(8.1/3): 9358.
130197 conversion *note 4.6(1/3): 3127, *note 4.6(28): 3173.
130198 access *note 4.6(24.11/2): 3158, *note 4.6(24.18/2): 3164, *note
130199 4.6(24.19/2): 3166, *note 4.6(47): 3202.
130200 arbitrary order *note 1.1.4(18): 1091.
130201 array *note 4.6(24.2/2): 3153, *note 4.6(36): 3183.
130202 composite (non-array) *note 4.6(21/3): 3147, *note 4.6(40): 3192.
130203 enumeration *note 4.6(21.1/2): 3149, *note 4.6(34): 3181.
130204 numeric *note 4.6(24.1/2): 3151, *note 4.6(29): 3178.
130205 unchecked *note 13.9(1): 5587.
130206 value *note 4.6(5/2): 3143.
130207 view *note 4.6(5/2): 3141.
130208 Conversion_Error
130209 in Interfaces.COBOL *note B.4(30): 8139.
130210 Conversions
130211 child of Ada.Characters *note A.3.4(2/2): 6178.
130212 child of Ada.Strings.UTF_Encoding *note A.4.11(15/3): 6547.
130213 Convert
130214 in Ada.Strings.UTF_Encoding.Conversions *note A.4.11(16/3): 6548,
130215 *note A.4.11(17/3): 6549, *note A.4.11(18/3): 6550, *note A.4.11(19/3):
130216 6551, *note A.4.11(20/3): 6552.
130217 convertible *note 4.6(4/3): 3139.
130218 required *note 4.6(24.13/2): 3159, *note 4.6(24.4/2): 3154, *note
130219 8.6(27.1/3): 4165.
130220 Copy
130221 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.6/3): 7355.
130222 in Ada.Containers.Hashed_Maps *note A.18.5(17.8/3): 7451.
130223 in Ada.Containers.Hashed_Sets *note A.18.8(17.4/3): 7586.
130224 in Ada.Containers.Indefinite_Holders *note A.18.18(21/3): 7839,
130225 *note A.18.20(10/3): 7853, *note A.18.21(13/3): 7858, *note
130226 A.18.22(10/3): 7862, *note A.18.23(13/3): 7867, *note A.18.24(10/3):
130227 7871.
130228 in Ada.Containers.Multiway_Trees *note A.18.10(33/3): 7758.
130229 in Ada.Containers.Ordered_Maps *note A.18.6(16.8/3): 7505.
130230 in Ada.Containers.Ordered_Sets *note A.18.9(16.4/3): 7660.
130231 in Ada.Containers.Vectors *note A.18.2(34.8/3): 7269.
130232 copy back of parameters *note 6.4.1(17): 3730.
130233 copy parameter passing *note 6.2(2): 3623.
130234 Copy_Array
130235 in Interfaces.C.Pointers *note B.3.2(15): 8085.
130236 Copy_File
130237 in Ada.Directories *note A.16(13/2): 7146.
130238 Copy_Sign attribute *note A.5.3(51): 6718.
130239 Copy_Subtree
130240 in Ada.Containers.Multiway_Trees *note A.18.10(54/3): 7779.
130241 Copy_Terminated_Array
130242 in Interfaces.C.Pointers *note B.3.2(14): 8084.
130243 Copyright_Sign
130244 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6089.
130245 core language *note 1.1.2(2): 1004.
130246 Correction *note 1.1.2(39.aa/3): 1060.
130247 corresponding constraint *note 3.4(6): 1619.
130248 corresponding discriminants *note 3.7(18): 2102.
130249 corresponding index
130250 for an array_aggregate *note 4.3.3(8): 2755.
130251 corresponding subtype *note 3.4(18/3): 1629.
130252 corresponding value
130253 of the target type of a conversion *note 4.6(28): 3172.
130254 Corrigendum *note 1.1.2(39.n/3): 1054.
130255 Cos
130256 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
130257 G.1.2(4): 8900.
130258 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6593.
130259 Cosh
130260 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
130261 G.1.2(6): 8908.
130262 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6607.
130263 Cot
130264 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
130265 G.1.2(4): 8902.
130266 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6597.
130267 Coth
130268 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
130269 G.1.2(6): 8910.
130270 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6609.
130271 Count
130272 in Ada.Direct_IO *note A.8.4(4): 6810.
130273 in Ada.Streams.Stream_IO *note A.12.1(7): 7069.
130274 in Ada.Strings.Bounded *note A.4.4(48): 6331, *note A.4.4(49):
130275 6332, *note A.4.4(50): 6333.
130276 in Ada.Strings.Fixed *note A.4.3(13): 6272, *note A.4.3(14): 6273,
130277 *note A.4.3(15): 6274.
130278 in Ada.Strings.Unbounded *note A.4.5(43): 6388, *note A.4.5(44):
130279 6389, *note A.4.5(45): 6390.
130280 in Ada.Text_IO *note A.10.1(5): 6863.
130281 Count attribute *note 9.9(5): 4626.
130282 Count_Type
130283 in Ada.Containers *note A.18.1(5/2): 7227.
130284 Country
130285 in Ada.Locales *note A.19(6/3): 7931.
130286 Country code standard *note 1.2(4.1/3): 1124.
130287 Country_Code
130288 in Ada.Locales *note A.19(4/3): 7927.
130289 Country_Unknown
130290 in Ada.Locales *note A.19(5/3): 7929.
130291 cover
130292 a type *note 3.4.1(9): 1656.
130293 of a choice and an exception *note 11.2(6): 4901.
130294 cover a value *note 3.8.1(1.a): 2183.
130295 by a discrete_choice *note 3.8.1(9): 2200.
130296 by a discrete_choice_list *note 3.8.1(13): 2201.
130297 CPU aspect *note D.16(8/3): 8669.
130298 CPU clock tick *note D.14(15/2): 8599.
130299 CPU pragma *note J.15.9(2/3): 9258, *note L(8.2/3): 9362.
130300 CPU subtype of CPU_Range
130301 in System.Multiprocessors *note D.16(4/3): 8666.
130302 CPU time
130303 of a task *note D.14(11/3): 8598.
130304 CPU_Range
130305 in System.Multiprocessors *note D.16(4/3): 8664.
130306 CPU_Tick
130307 in Ada.Execution_Time *note D.14(4/2): 8590.
130308 CPU_Time
130309 in Ada.Execution_Time *note D.14(4/2): 8586.
130310 CPU_Time_First
130311 in Ada.Execution_Time *note D.14(4/2): 8587.
130312 CPU_Time_Last
130313 in Ada.Execution_Time *note D.14(4/2): 8588.
130314 CPU_Time_Unit
130315 in Ada.Execution_Time *note D.14(4/2): 8589.
130316 CR
130317 in Ada.Characters.Latin_1 *note A.3.3(5): 5962.
130318 create *note 3.1(12): 1384.
130319 in Ada.Direct_IO *note A.8.4(6): 6812.
130320 in Ada.Sequential_IO *note A.8.1(6): 6784.
130321 in Ada.Streams.Stream_IO *note A.12.1(8): 7071.
130322 in Ada.Text_IO *note A.10.1(9): 6869.
130323 in System.Multiprocessors.Dispatching_Domains *note D.16.1(7/3):
130324 8675.
130325 Create_Directory
130326 in Ada.Directories *note A.16(7/2): 7140.
130327 Create_Path
130328 in Ada.Directories *note A.16(9/2): 7142.
130329 Create_Subpool
130330 in System.Storage_Pools.Subpools *note 13.11.4(7/3): 5698.
130331 creation
130332 of a protected object *note C.3.1(10/3): 8208.
130333 of a return object *note 6.5(5.11/3): 3761.
130334 of a tag *note 13.14(20/2): 5868.
130335 of a task object *note D.1(17/3): 8333.
130336 of an object *note 3.3(1): 1521.
130337 critical section
130338 See intertask communication *note 9.5(1): 4322.
130339 CSI
130340 in Ada.Characters.Latin_1 *note A.3.3(19): 6074.
130341 Currency_Sign
130342 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6084.
130343 current column number *note A.10(9): 6854.
130344 current index
130345 of an open direct file *note A.8(4): 6780.
130346 of an open stream file *note A.12.1(1.1/1): 7063.
130347 current instance
130348 of a generic unit *note 8.6(18): 4153.
130349 of a type *note 8.6(17/3): 4152.
130350 current line number *note A.10(9): 6855.
130351 current mode
130352 of an open file *note A.7(7): 6770.
130353 current page number *note A.10(9): 6856.
130354 Current size
130355 of a stream file *note A.12.1(1.1/1): 7064.
130356 of an external file *note A.8(3): 6779.
130357 Current_Directory
130358 in Ada.Directories *note A.16(5/2): 7138.
130359 Current_Error
130360 in Ada.Text_IO *note A.10.1(17): 6887, *note A.10.1(20): 6894.
130361 Current_Handler
130362 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8634.
130363 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8609.
130364 in Ada.Interrupts *note C.3.2(6): 8229.
130365 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8655.
130366 Current_Input
130367 in Ada.Text_IO *note A.10.1(17): 6885, *note A.10.1(20): 6892.
130368 Current_Output
130369 in Ada.Text_IO *note A.10.1(17): 6886, *note A.10.1(20): 6893.
130370 Current_State
130371 in Ada.Synchronous_Task_Control *note D.10(4): 8558.
130372 Current_Task
130373 in Ada.Task_Identification *note C.7.1(3/3): 8276.
130374 Current_Task_Fallback_Handler
130375 in Ada.Task_Termination *note C.7.3(5/2): 8309.
130376 Current_Use
130377 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(7/3): 7921.
130378 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(6/3):
130379 7905.
130380 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(7/3):
130381 7890.
130382 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(7/3):
130383 7913.
130384 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(6/3):
130385 7898.
130386 cursor
130387 ambiguous *note A.18.2(240/2): 7324.
130388 for a container *note A.18(2/2): 7217.
130389 invalid *note A.18.2(248/2): 7327, *note A.18.3(153/2): 7400, *note
130390 A.18.4(76/2): 7424, *note A.18.7(97/2): 7563, *note A.18.10(222/3):
130391 7806.
130392 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(7/2): 7339.
130393 in Ada.Containers.Hashed_Maps *note A.18.5(4/2): 7430.
130394 in Ada.Containers.Hashed_Sets *note A.18.8(4/2): 7569.
130395 in Ada.Containers.Multiway_Trees *note A.18.10(9/3): 7735.
130396 in Ada.Containers.Ordered_Maps *note A.18.6(5/2): 7486.
130397 in Ada.Containers.Ordered_Sets *note A.18.9(5/2): 7645.
130398 in Ada.Containers.Vectors *note A.18.2(9/2): 7240.
130399
130400
130401 \1f
130402 File: aarm2012.info, Node: D, Next: E, Prev: C, Up: Index
130403
130404 D
130405 ==
130406
130407
130408
130409 dangling references
130410 prevention via accessibility rules *note 3.10.2(3/2): 2446.
130411 Data_Error
130412 in Ada.Direct_IO *note A.8.4(18): 6836.
130413 in Ada.IO_Exceptions *note A.13(4): 7121.
130414 in Ada.Sequential_IO *note A.8.1(15): 6803.
130415 in Ada.Storage_IO *note A.9(9): 6844.
130416 in Ada.Streams.Stream_IO *note A.12.1(26): 7098.
130417 in Ada.Text_IO *note A.10.1(85): 7012.
130418 date and time formatting standard *note 1.2(5.1/2): 1129.
130419 Day
130420 in Ada.Calendar *note 9.6(13): 4467.
130421 in Ada.Calendar.Formatting *note 9.6.1(23/2): 4509.
130422 Day_Count
130423 in Ada.Calendar.Arithmetic *note 9.6.1(10/2): 4490.
130424 Day_Duration subtype of Duration
130425 in Ada.Calendar *note 9.6(11/2): 4463.
130426 Day_Name
130427 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4494.
130428 Day_Number subtype of Integer
130429 in Ada.Calendar *note 9.6(11/2): 4462.
130430 Day_of_Week
130431 in Ada.Calendar.Formatting *note 9.6.1(18/2): 4502.
130432 DC1
130433 in Ada.Characters.Latin_1 *note A.3.3(6): 5966.
130434 DC2
130435 in Ada.Characters.Latin_1 *note A.3.3(6): 5967.
130436 DC3
130437 in Ada.Characters.Latin_1 *note A.3.3(6): 5968.
130438 DC4
130439 in Ada.Characters.Latin_1 *note A.3.3(6): 5969.
130440 DCS
130441 in Ada.Characters.Latin_1 *note A.3.3(18): 6063.
130442 Deadline subtype of Time
130443 in Ada.Dispatching.EDF *note D.2.6(9/2): 8396.
130444 Deallocate
130445 in System.Storage_Pools *note 13.11(8): 5625.
130446 in System.Storage_Pools.Subpools *note 13.11.4(15/3): 5705.
130447 Deallocate_Subpool
130448 in System.Storage_Pools.Subpools *note 13.11.4(12/3): 5702.
130449 deallocation of storage *note 13.11.2(1): 5666.
130450 Decimal
130451 child of Ada *note F.2(2): 8829.
130452 decimal digit
130453 a category of Character *note A.3.2(28): 5941.
130454 decimal fixed point type *note 3.5.9(1): 1924, *note 3.5.9(6): 1942.
130455 Decimal_Conversions
130456 in Interfaces.COBOL *note B.4(31): 8140.
130457 Decimal_Digit_Set
130458 in Ada.Strings.Maps.Constants *note A.4.6(4): 6424.
130459 Decimal_Element
130460 in Interfaces.COBOL *note B.4(12/3): 8113.
130461 decimal_fixed_point_definition *note 3.5.9(4): 1932.
130462 used *note 3.5.9(2): 1928, *note P: 9731.
130463 Decimal_IO
130464 in Ada.Text_IO *note A.10.1(73): 6987.
130465 decimal_literal *note 2.4.1(2): 1256.
130466 used *note 2.4(2): 1253, *note P: 9609.
130467 Decimal_Output
130468 in Ada.Text_IO.Editing *note F.3.3(11): 8852.
130469 Declaration *note 3.1(5): 1360, *note 3.1(6/3): 1363, *note N(11):
130470 9530.
130471 declaration list
130472 declarative_part *note 3.11(6.1/2): 2506.
130473 package_specification *note 7.1(6/2): 3838.
130474 declarative region
130475 of a construct *note 8.1(1): 3988.
130476 declarative_item *note 3.11(3): 2491.
130477 used *note 3.11(2): 2490, *note P: 9818.
130478 declarative_part *note 3.11(2): 2489.
130479 used *note 5.6(2): 3494, *note 6.3(2/3): 3643, *note 7.2(2/3):
130480 3845, *note 9.1(6/3): 4220, *note 9.5.2(5): 4365, *note P: 10229.
130481 declare *note 3.1(8): 1372, *note 3.1(12): 1383.
130482 declared pure *note 10.2.1(17/3): 4834.
130483 Decode
130484 in Ada.Strings.UTF_Encoding.Strings *note A.4.11(26/3): 6557, *note
130485 A.4.11(27/3): 6558, *note A.4.11(28/3): 6559.
130486 in Ada.Strings.UTF_Encoding.Wide_Strings *note A.4.11(34/3): 6564,
130487 *note A.4.11(35/3): 6565, *note A.4.11(36/3): 6566.
130488 in Ada.Strings.UTF_Encoding.Wide_Wide_Strings *note A.4.11(42/3):
130489 6571, *note A.4.11(43/3): 6572, *note A.4.11(44/3): 6573.
130490 Decrement
130491 in Interfaces.C.Pointers *note B.3.2(11/3): 8082.
130492 deeper
130493 accessibility level *note 3.10.2(3/2): 2444.
130494 statically *note 3.10.2(4): 2451, *note 3.10.2(17): 2460.
130495 default constant indexing function *note 5.5.1(16/3): 3463.
130496 default cursor subtype *note 5.5.1(8/3): 3453.
130497 default directory *note A.16(48/2): 7184.
130498 default element subtype *note 5.5.1(9/3): 3456.
130499 default entry queuing policy *note 9.5.3(17): 4423.
130500 default iterator function *note 5.5.1(8/3): 3451.
130501 default iterator subtype *note 5.5.1(8/3): 3452.
130502 default pool *note 13.11.3(4.1/3): 5687.
130503 default treatment *note C.3(5): 8202.
130504 default variable indexing function *note 5.5.1(21/3): 3464.
130505 Default_Aft
130506 in Ada.Text_IO *note A.10.1(64): 6969, *note A.10.1(69): 6979,
130507 *note A.10.1(74): 6989.
130508 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8925.
130509 Default_Base
130510 in Ada.Text_IO *note A.10.1(53): 6951, *note A.10.1(58): 6960.
130511 Default_Bit_Order
130512 in System *note 13.7(15/2): 5551.
130513 Default_Component_Value aspect *note 3.6(22.2/3): 2033.
130514 Default_Currency
130515 in Ada.Text_IO.Editing *note F.3.3(10): 8848.
130516 Default_Deadline
130517 in Ada.Dispatching.EDF *note D.2.6(9/2): 8397.
130518 Default_Exp
130519 in Ada.Text_IO *note A.10.1(64): 6970, *note A.10.1(69): 6980,
130520 *note A.10.1(74): 6990.
130521 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8926.
130522 default_expression *note 3.7(6): 2096.
130523 used *note 3.7(5/2): 2092, *note 3.8(6/3): 2160, *note 6.1(15/3):
130524 3556, *note 12.4(2/3): 5138, *note P: 10379.
130525 Default_Fill
130526 in Ada.Text_IO.Editing *note F.3.3(10): 8849.
130527 Default_Fore
130528 in Ada.Text_IO *note A.10.1(64): 6968, *note A.10.1(69): 6978,
130529 *note A.10.1(74): 6988.
130530 in Ada.Text_IO.Complex_IO *note G.1.3(5): 8924.
130531 Default_Iterator aspect *note 5.5.1(8/3): 3455.
130532 Default_Modulus
130533 in Ada.Containers.Indefinite_Holders *note A.18.21(10/3): 7857,
130534 *note A.18.23(10/3): 7866.
130535 default_name *note 12.6(4): 5242.
130536 used *note 12.6(3/2): 5241, *note P: 10413.
130537 Default_Priority
130538 in System *note 13.7(17): 5555.
130539 Default_Quantum
130540 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8387.
130541 Default_Radix_Mark
130542 in Ada.Text_IO.Editing *note F.3.3(10): 8851.
130543 Default_Separator
130544 in Ada.Text_IO.Editing *note F.3.3(10): 8850.
130545 Default_Setting
130546 in Ada.Text_IO *note A.10.1(80): 6999.
130547 Default_Storage_Pool aspect *note 13.11.3(5/3): 5691.
130548 Default_Storage_Pool pragma *note 13.11.3(3/3): 5683, *note L(8.3/3):
130549 9365.
130550 Default_Subpool_for_Pool
130551 in System.Storage_Pools.Subpools *note 13.11.4(13/3): 5703.
130552 Default_Value aspect *note 3.5(56.3/3): 1762.
130553 Default_Width
130554 in Ada.Text_IO *note A.10.1(53): 6950, *note A.10.1(58): 6959,
130555 *note A.10.1(80): 6998.
130556 deferred constant *note 7.4(2/3): 3903.
130557 deferred constant declaration *note 3.3.1(6/3): 1570, *note 7.4(2/3):
130558 3902.
130559 defining name *note 3.1(10): 1373.
130560 defining_character_literal *note 3.5.1(4): 1776.
130561 used *note 3.5.1(3): 1775, *note P: 9717.
130562 defining_designator *note 6.1(6): 3530.
130563 used *note 6.1(4.2/2): 3524, *note 12.3(2/3): 5082, *note P: 10051.
130564 defining_identifier *note 3.1(4): 1358.
130565 used *note 3.2.1(3/3): 1434, *note 3.2.2(2/3): 1462, *note
130566 3.3.1(3): 1564, *note 3.5.1(3): 1774, *note 3.10.1(2/2): 2425, *note
130567 5.5(4): 3430, *note 5.5.2(2/3): 3467, *note 6.1(7): 3535, *note
130568 6.5(2.1/3): 3744, *note 7.3(2/3): 3858, *note 7.3(3/3): 3862, *note
130569 8.5.1(2/3): 4087, *note 8.5.2(2/3): 4100, *note 9.1(2/3): 4200, *note
130570 9.1(3/3): 4206, *note 9.1(6/3): 4218, *note 9.4(2/3): 4265, *note
130571 9.4(3/3): 4271, *note 9.4(7/3): 4287, *note 9.5.2(2/3): 4349, *note
130572 9.5.2(5): 4362, *note 9.5.2(8): 4374, *note 10.1.3(4): 4733, *note
130573 10.1.3(5): 4736, *note 10.1.3(6): 4739, *note 11.2(4): 4896, *note
130574 12.5(2.1/3): 5162, *note 12.5(2.2/3): 5167, *note 12.7(2/3): 5258, *note
130575 P: 10034.
130576 defining_identifier_list *note 3.3.1(3): 1563.
130577 used *note 3.3.1(2/3): 1553, *note 3.3.2(2): 1599, *note 3.7(5/2):
130578 2089, *note 3.8(6/3): 2158, *note 6.1(15/3): 3552, *note 11.1(2/3):
130579 4872, *note 12.4(2/3): 5129, *note P: 10320.
130580 defining_operator_symbol *note 6.1(11): 3538.
130581 used *note 6.1(6): 3532, *note P: 10057.
130582 defining_program_unit_name *note 6.1(7): 3533.
130583 used *note 6.1(4.1/2): 3521, *note 6.1(6): 3531, *note 7.1(3/3):
130584 3828, *note 7.2(2/3): 3843, *note 8.5.3(2/3): 4105, *note 8.5.5(2/3):
130585 4132, *note 12.3(2/3): 5077, *note P: 10168.
130586 Definite attribute *note 12.5.1(23/3): 5200.
130587 definite subtype *note 3.3(23/3): 1536.
130588 definition *note 3.1(7): 1365.
130589 Degree_Sign
130590 in Ada.Characters.Latin_1 *note A.3.3(22): 6096.
130591 DEL
130592 in Ada.Characters.Latin_1 *note A.3.3(14): 6041.
130593 delay_alternative *note 9.7.1(6): 4549.
130594 used *note 9.7.1(4): 4544, *note 9.7.2(2): 4562, *note P: 10262.
130595 delay_relative_statement *note 9.6(4): 4451.
130596 used *note 9.6(2): 4448, *note P: 10241.
130597 delay_statement *note 9.6(2): 4446.
130598 used *note 5.1(4/2): 3353, *note 9.7.1(6): 4550, *note 9.7.4(4/2):
130599 4583, *note P: 10259.
130600 Delay_Until_And_Set_CPU
130601 in System.Multiprocessors.Dispatching_Domains *note D.16.1(14/3):
130602 8682.
130603 Delay_Until_And_Set_Deadline
130604 in Ada.Dispatching.EDF *note D.2.6(9/2): 8399.
130605 delay_until_statement *note 9.6(3): 4449.
130606 used *note 9.6(2): 4447, *note P: 10240.
130607 Delete
130608 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(24/2): 7362.
130609 in Ada.Containers.Hashed_Maps *note A.18.5(25/2): 7459, *note
130610 A.18.5(26/2): 7460.
130611 in Ada.Containers.Hashed_Sets *note A.18.8(24/2): 7593, *note
130612 A.18.8(25/2): 7594, *note A.18.8(55/2): 7619.
130613 in Ada.Containers.Ordered_Maps *note A.18.6(24/2): 7513, *note
130614 A.18.6(25/2): 7514.
130615 in Ada.Containers.Ordered_Sets *note A.18.9(23/2): 7667, *note
130616 A.18.9(24/2): 7668, *note A.18.9(68/2): 7701.
130617 in Ada.Containers.Vectors *note A.18.2(50/2): 7285, *note
130618 A.18.2(51/2): 7286.
130619 in Ada.Direct_IO *note A.8.4(8): 6815.
130620 in Ada.Sequential_IO *note A.8.1(8): 6787.
130621 in Ada.Streams.Stream_IO *note A.12.1(10): 7074.
130622 in Ada.Strings.Bounded *note A.4.4(64): 6346, *note A.4.4(65):
130623 6347.
130624 in Ada.Strings.Fixed *note A.4.3(29): 6287, *note A.4.3(30): 6288.
130625 in Ada.Strings.Unbounded *note A.4.5(59): 6403, *note A.4.5(60):
130626 6404.
130627 in Ada.Text_IO *note A.10.1(11): 6872.
130628 Delete_Children
130629 in Ada.Containers.Multiway_Trees *note A.18.10(53/3): 7778.
130630 Delete_Directory
130631 in Ada.Directories *note A.16(8/2): 7141.
130632 Delete_File
130633 in Ada.Directories *note A.16(11/2): 7144.
130634 Delete_First
130635 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(25/2): 7363.
130636 in Ada.Containers.Ordered_Maps *note A.18.6(26/2): 7515.
130637 in Ada.Containers.Ordered_Sets *note A.18.9(25/2): 7669.
130638 in Ada.Containers.Vectors *note A.18.2(52/2): 7287.
130639 Delete_Last
130640 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(26/2): 7364.
130641 in Ada.Containers.Ordered_Maps *note A.18.6(27/2): 7516.
130642 in Ada.Containers.Ordered_Sets *note A.18.9(26/2): 7670.
130643 in Ada.Containers.Vectors *note A.18.2(53/2): 7288.
130644 Delete_Leaf
130645 in Ada.Containers.Multiway_Trees *note A.18.10(35/3): 7760.
130646 Delete_Subtree
130647 in Ada.Containers.Multiway_Trees *note A.18.10(36/3): 7761.
130648 Delete_Tree
130649 in Ada.Directories *note A.16(10/2): 7143.
130650 delimiter *note 2.2(8/2): 1227.
130651 delivery
130652 of an interrupt *note C.3(2): 8195.
130653 delta
130654 of a fixed point type *note 3.5.9(1): 1925.
130655 Delta attribute *note 3.5.10(3): 1972.
130656 delta_constraint *note J.3(2): 9120.
130657 used *note 3.2.2(6): 1477, *note P: 9686.
130658 Denorm attribute *note A.5.3(9): 6667.
130659 denormalized number *note A.5.3(10): 6668.
130660 denote *note 8.6(16): 4151.
130661 informal definition *note 3.1(8): 1371.
130662 name used as a pragma argument *note 8.6(32): 4169.
130663 depend on a discriminant
130664 for a component *note 3.7(20): 2105.
130665 for a constraint or component_definition *note 3.7(19): 2104.
130666 dependence
130667 elaboration *note 10.2(9): 4794.
130668 of a task on a master *note 9.3(1): 4250.
130669 of a task on another task *note 9.3(4): 4254.
130670 semantic *note 10.1.1(26/2): 4693.
130671 depth
130672 accessibility level *note 3.10.2(3/2): 2445.
130673 in Ada.Containers.Multiway_Trees *note A.18.10(19/3): 7744.
130674 depth-first order *note A.18.10(5/3): 7732.
130675 Dequeue
130676 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(5/3): 7919.
130677 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(5/3):
130678 7904.
130679 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(6/3):
130680 7889.
130681 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(5/3):
130682 7911.
130683 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(5/3):
130684 7897.
130685 Dequeue_Only_High_Priority
130686 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(6/3): 7920.
130687 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(6/3):
130688 7912.
130689 dereference *note 4.1(8): 2545.
130690 Dereference_Error
130691 in Interfaces.C.Strings *note B.3.1(12): 8061.
130692 derivation class
130693 for a type *note 3.4.1(2/2): 1643.
130694 derived from
130695 directly or indirectly *note 3.4.1(2/2): 1642.
130696 derived type *note 3.4(1/2): 1605, *note N(13/2): 9533.
130697 [partial] *note 3.4(24): 1631.
130698 derived_type_definition *note 3.4(2/2): 1609.
130699 used *note 3.2.1(4/2): 1447, *note P: 9673.
130700 descendant *note 10.1.1(11): 4684, *note N(13.1/2): 9534.
130701 at run-time *note 3.9(12.3/3): 2244.
130702 of a tree node *note A.18.10(4/3): 7731.
130703 of a type *note 3.4.1(10/2): 1657.
130704 of an incomplete view *note 7.3.1(5.2/3): 3888.
130705 of the full view of a type *note 7.3.1(5.1/3): 3887.
130706 relationship with scope *note 8.2(4): 3997.
130707 Descendant_Tag
130708 in Ada.Tags *note 3.9(7.1/2): 2237.
130709 designate *note 3.10(1): 2369.
130710 designated profile
130711 of an access-to-subprogram type *note 3.10(11): 2406.
130712 of an anonymous access type *note 3.10(12/3): 2411.
130713 designated subtype
130714 of a named access type *note 3.10(10): 2401.
130715 of an anonymous access type *note 3.10(12/3): 2409.
130716 designated type
130717 of a named access type *note 3.10(10): 2402.
130718 of an anonymous access type *note 3.10(12/3): 2410.
130719 designator *note 6.1(5): 3526.
130720 used *note 6.3(2/3): 3645, *note P: 10083.
130721 destructor
130722 See finalization *note 7.6(1): 3922.
130723 See finalization *note 7.6.1(1): 3955.
130724 Detach_Handler
130725 in Ada.Interrupts *note C.3.2(9): 8232.
130726 Detect_Blocking pragma *note H.5(3/2): 9108, *note L(8.4/2): 9368.
130727 Determinant
130728 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9037.
130729 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8996.
130730 determined category for a formal type *note 12.5(6/3): 5189.
130731 determines
130732 a type by a subtype_mark *note 3.2.2(8): 1481.
130733 Device_Error
130734 in Ada.Direct_IO *note A.8.4(18): 6834.
130735 in Ada.Directories *note A.16(43/2): 7176.
130736 in Ada.IO_Exceptions *note A.13(4): 7119.
130737 in Ada.Sequential_IO *note A.8.1(15): 6801.
130738 in Ada.Streams.Stream_IO *note A.12.1(26): 7096.
130739 in Ada.Text_IO *note A.10.1(85): 7010.
130740 Diaeresis
130741 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6088.
130742 Difference
130743 in Ada.Calendar.Arithmetic *note 9.6.1(12/2): 4492.
130744 in Ada.Containers.Hashed_Sets *note A.18.8(32/2): 7599, *note
130745 A.18.8(33/2): 7600.
130746 in Ada.Containers.Ordered_Sets *note A.18.9(33/2): 7675, *note
130747 A.18.9(34/2): 7676.
130748 digit *note 2.4.1(4.1/2): 1267.
130749 used *note 2.4.1(3): 1261, *note 2.4.2(5): 1290, *note P: 9627.
130750 digits
130751 of a decimal fixed point subtype *note 3.5.9(6): 1941, *note
130752 3.5.10(7): 1979.
130753 Digits attribute *note 3.5.8(2/1): 1920, *note 3.5.10(7): 1978.
130754 digits_constraint *note 3.5.9(5): 1936.
130755 used *note 3.2.2(6): 1476, *note P: 9685.
130756 dimensionality
130757 of an array *note 3.6(12): 2012.
130758 direct access *note A.8(3): 6777.
130759 direct file *note A.8(1/2): 6774.
130760 Direct_IO
130761 child of Ada *note A.8.4(2): 6807.
130762 direct_name *note 4.1(3): 2535.
130763 used *note 3.8.1(2): 2185, *note 4.1(2/3): 2523, *note 5.1(8):
130764 3369, *note 9.5.2(3): 4354, *note 10.2.1(4.2/2): 4818, *note 13.1(3):
130765 5287, *note J.7(1): 9131, *note L(25.2/2): 9444, *note P: 10429.
130766 Direction
130767 in Ada.Strings *note A.4.1(6): 6234.
130768 directly specified
130769 of a representation aspect of an entity *note 13.1(8/3): 5299.
130770 of an operational aspect of an entity *note 13.1(8.1/3): 5305.
130771 directly visible *note 8.3(2): 4011, *note 8.3(21): 4035.
130772 within a pragma in a context_clause *note 10.1.6(3): 4775.
130773 within a pragma that appears at the place of a compilation unit
130774 *note 10.1.6(5): 4779.
130775 within a use_clause in a context_clause *note 10.1.6(3): 4773.
130776 within a with_clause *note 10.1.6(2/2): 4771.
130777 within the parent_unit_name of a library unit *note 10.1.6(2/2):
130778 4769.
130779 within the parent_unit_name of a subunit *note 10.1.6(4): 4777.
130780 Directories
130781 child of Ada *note A.16(3/2): 7137.
130782 directory *note A.16(45/2): 7177.
130783 directory entry *note A.16(49/2): 7185.
130784 directory name *note A.16(46/2): 7180.
130785 Directory_Entry_Type
130786 in Ada.Directories *note A.16(29/2): 7161.
130787 disabled
130788 predicate checks *note 3.2.4(7/3): 1509.
130789 Discard_Names pragma *note C.5(3): 8243, *note L(9): 9370.
130790 discontiguous representation
130791 [partial] *note 13.1(7.a/2): 5296, *note 13.5.2(5): 5510, *note
130792 13.7.1(12): 5569, *note 13.9(9): 5592, *note 13.9(17/3): 5595, *note
130793 13.11(17.d): 5649, *note 13.11(21.6/3): 5655.
130794 discrete array type *note 4.5.2(1): 2982.
130795 discrete type *note 3.2(3): 1399, *note 3.5(1): 1663, *note N(14):
130796 9535.
130797 discrete_choice *note 3.8.1(5/3): 2194.
130798 used *note 3.8.1(4): 2193, *note P: 9790.
130799 discrete_choice_list *note 3.8.1(4): 2191.
130800 used *note 3.8.1(3): 2189, *note 4.3.3(5/2): 2747, *note
130801 4.5.7(6/3): 3098, *note 5.4(3): 3409, *note P: 9895.
130802 Discrete_Random
130803 child of Ada.Numerics *note A.5.2(17): 6635.
130804 discrete_range *note 3.6.1(3): 2041.
130805 used *note 3.6.1(2): 2039, *note 4.1.2(2): 2575, *note P: 9752.
130806 discrete_subtype_definition *note 3.6(6): 2001.
130807 used *note 3.6(5): 1999, *note 5.5(4): 3431, *note 9.5.2(2/3):
130808 4350, *note 9.5.2(8): 4375, *note P: 10236.
130809 discriminant *note 3.2(5/2): 1405, *note 3.7(1/2): 2076, *note
130810 N(15/2): 9536.
130811 of a variant_part *note 3.8.1(6): 2198.
130812 use in a record definition *note 3.8(12/3): 2164.
130813 discriminant_association *note 3.7.1(3): 2122.
130814 used *note 3.7.1(2): 2120, *note P: 9768.
130815 Discriminant_Check *note 11.5(12): 5001.
130816 [partial] *note 4.1.3(15): 2595, *note 4.3(6): 2678, *note
130817 4.3.2(8/3): 2722, *note 4.6(43): 3195, *note 4.6(45): 3197, *note
130818 4.6(51/3): 3207, *note 4.6(52): 3220, *note 4.7(4): 3245, *note
130819 4.8(10/2): 3276, *note 6.5(5.11/3): 3764.
130820 discriminant_constraint *note 3.7.1(2): 2119.
130821 used *note 3.2.2(7): 1480, *note P: 9688.
130822 discriminant_part *note 3.7(2): 2081.
130823 used *note 3.10.1(2/2): 2426, *note 7.3(2/3): 3859, *note 7.3(3/3):
130824 3863, *note 12.5(2.1/3): 5163, *note 12.5(2.2/3): 5168, *note P: 10384.
130825 discriminant_specification *note 3.7(5/2): 2088.
130826 used *note 3.7(4): 2087, *note P: 9759.
130827 discriminants
130828 known *note 3.7(26): 2107.
130829 unknown *note 3.7(1.b/2): 2080.
130830 unknown *note 3.7(26): 2111.
130831 discriminated type *note 3.7(8/2): 2099.
130832 dispatching *note 3.9(3): 2223.
130833 child of Ada *note D.2.1(1.2/3): 8338.
130834 dispatching call
130835 on a dispatching operation *note 3.9.2(1/2): 2285.
130836 dispatching operation *note 3.9.2(1/2): 2284, *note 3.9.2(2/3): 2298.
130837 [partial] *note 3.9(1): 2208.
130838 dispatching point *note D.2.1(4/2): 8344.
130839 [partial] *note D.2.3(8/2): 8372, *note D.2.4(9/3): 8381.
130840 dispatching policy for tasks *note 9(10.a/3): 4197.
130841 [partial] *note D.2.1(5/2): 8350.
130842 dispatching, task *note D.2.1(4/2): 8342.
130843 Dispatching_Domain
130844 in System.Multiprocessors.Dispatching_Domains *note D.16.1(5/3):
130845 8673.
130846 Dispatching_Domain aspect *note D.16.1(18/3): 8684.
130847 Dispatching_Domain pragma *note J.15.10(2/3): 9263, *note L(9.1/3):
130848 9373.
130849 Dispatching_Domain_Error
130850 in System.Multiprocessors.Dispatching_Domains *note D.16.1(4/3):
130851 8672.
130852 Dispatching_Domains
130853 child of System.Multiprocessors *note D.16.1(3/3): 8671.
130854 Dispatching_Policy_Error
130855 in Ada.Dispatching *note D.2.1(1.4/3): 8340.
130856 Display_Format
130857 in Interfaces.COBOL *note B.4(22): 8124.
130858 displayed magnitude (of a decimal value) *note F.3.2(14): 8839.
130859 disruption of an assignment *note 9.8(21): 4617, *note 13.9.1(5):
130860 5599.
130861 [partial] *note 11.6(6/3): 5034.
130862 distinct access paths *note 6.2(12/3): 3633.
130863 distinguished receiver notation *note 4.1.3(19.e/2): 2601.
130864 distributed accessibility *note 3.10.2(32.1/3): 2478.
130865 distributed program *note E(3): 8690.
130866 distributed system *note E(2): 8689.
130867 distributed systems *note C(1): 8182.
130868 divide *note 2.1(15/3): 1205.
130869 in Ada.Decimal *note F.2(6/3): 8835.
130870 divide operator *note 4.4(1/3): 2832, *note 4.5.5(1): 3048.
130871 Division_Check *note 11.5(13/2): 5002.
130872 [partial] *note 3.5.4(20): 1848, *note 4.5.5(22): 3055, *note
130873 A.5.1(28): 6615, *note A.5.3(47): 6710, *note G.1.1(40): 8888, *note
130874 G.1.2(28): 8916, *note K.2(202): 9311.
130875 Division_Sign
130876 in Ada.Characters.Latin_1 *note A.3.3(26): 6169.
130877 DLE
130878 in Ada.Characters.Latin_1 *note A.3.3(6): 5965.
130879 Do_APC
130880 in System.RPC *note E.5(10): 8815.
130881 Do_RPC
130882 in System.RPC *note E.5(9): 8814.
130883 documentation (required of an implementation) *note 1.1.3(18): 1074,
130884 *note M.1(1/2): 9505, *note M.2(1/2): 9507, *note M.3(1/2): 9512.
130885 documentation requirements *note 1.1.2(34): 1043, *note M(1/3): 9503.
130886 summary of requirements *note M.1(1/2): 9504.
130887 Dollar_Sign
130888 in Ada.Characters.Latin_1 *note A.3.3(8): 5985.
130889 dope *note 13.5.1(15.d): 5498.
130890 dot *note 2.1(15/3): 1202.
130891 dot selection
130892 See selected_component *note 4.1.3(1): 2583.
130893 double
130894 in Interfaces.C *note B.3(16): 8003.
130895 Double_Precision
130896 in Interfaces.Fortran *note B.5(6): 8163.
130897 Doubly_Linked_Lists
130898 child of Ada.Containers *note A.18.3(5/3): 7337.
130899 downward closure *note 3.10.2(13.b/2): 2455, *note 3.10.2(37/2): 2482.
130900 drift rate *note D.8(41): 8548.
130901 Duration
130902 in Standard *note A.1(43): 5892.
130903 dynamic binding
130904 See dispatching operation *note 3.9(1): 2210.
130905 dynamic semantics *note 1.1.2(30): 1034.
130906 Dynamic_Predicate aspect *note 3.2.4(1/3): 1505.
130907 Dynamic_Priorities
130908 child of Ada *note D.5.1(3/2): 8443.
130909 dynamically determined tag *note 3.9.2(1/2): 2288.
130910 dynamically enclosing
130911 of one execution by another *note 11.4(2): 4915.
130912 dynamically tagged *note 3.9.2(5/2): 2306.
130913
130914
130915 \1f
130916 File: aarm2012.info, Node: E, Next: F, Prev: D, Up: Index
130917
130918 E
130919 ==
130920
130921
130922
130923 e
130924 in Ada.Numerics *note A.5(3/2): 6582.
130925 EDF
130926 child of Ada.Dispatching *note D.2.6(9/2): 8395.
130927 child of Ada.Synchronous_Task_Control *note D.10(5.2/3): 8560.
130928 EDF_Across_Priorities task dispatching policy *note D.2.6(7/2): 8394.
130929 edited output *note F.3(1/2): 8836.
130930 Editing
130931 child of Ada.Text_IO *note F.3.3(3): 8840.
130932 child of Ada.Wide_Text_IO *note F.3.4(1): 8860.
130933 child of Ada.Wide_Wide_Text_IO *note F.3.5(1/2): 8862.
130934 effect
130935 external *note 1.1.3(8): 1068.
130936 efficiency *note 11.5(29): 5018, *note 11.6(1/3): 5026.
130937 Eigensystem
130938 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(49/2): 9039.
130939 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(27/2): 8998.
130940 Eigenvalues
130941 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(48/2): 9038.
130942 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(26/2): 8997.
130943 elaborable *note 3.1(11.g): 1380.
130944 Elaborate pragma *note 10.2.1(20): 4839, *note L(10): 9375.
130945 Elaborate_All pragma *note 10.2.1(21): 4843, *note L(11): 9379.
130946 Elaborate_Body aspect *note 10.2.1(26.1/3): 4854.
130947 Elaborate_Body pragma *note 10.2.1(22): 4847, *note L(12): 9383.
130948 elaborated *note 3.11(8): 2508.
130949 elaboration *note 3.1(11): 1376, *note 3.1(11.a): 1378, *note
130950 N(15.1/2): 9537, *note N(19): 9545.
130951 abstract_subprogram_declaration *note 3.9.3(11.1/2): 2335.
130952 access_definition *note 3.10(17/2): 2419.
130953 access_type_definition *note 3.10(16): 2418.
130954 array_type_definition *note 3.6(21): 2028.
130955 aspect_clause *note 13.1(19/1): 5318.
130956 choice_parameter_specification *note 11.4(7): 4926.
130957 component_declaration *note 3.8(17): 2172.
130958 component_definition *note 3.6(22/2): 2030, *note 3.8(18/2): 2176.
130959 component_list *note 3.8(17): 2171.
130960 declaration with a True Import aspect *note B.1(38/3): 7970.
130961 declarative_part *note 3.11(7): 2507.
130962 deferred constant declaration *note 7.4(10/3): 3906.
130963 delta_constraint *note J.3(11): 9127.
130964 derived_type_definition *note 3.4(26): 1632.
130965 digits_constraint *note 3.5.9(19): 1959.
130966 discrete_subtype_definition *note 3.6(22/2): 2029.
130967 discriminant_constraint *note 3.7.1(12): 2134.
130968 entry_declaration *note 9.5.2(22/1): 4391.
130969 enumeration_type_definition *note 3.5.1(10): 1781.
130970 exception_declaration *note 11.1(5): 4879.
130971 expression_function_declaration *note 6.8(8/3): 3818.
130972 fixed_point_definition *note 3.5.9(17): 1957.
130973 floating_point_definition *note 3.5.7(13): 1912.
130974 full type definition *note 3.2.1(11): 1459.
130975 full_type_declaration *note 3.2.1(11): 1458.
130976 generic body *note 12.2(2): 5067.
130977 generic_declaration *note 12.1(10): 5063.
130978 generic_instantiation *note 12.3(20): 5118.
130979 incomplete_type_declaration *note 3.10.1(12): 2433.
130980 index_constraint *note 3.6.1(8): 2050.
130981 integer_type_definition *note 3.5.4(18): 1844.
130982 loop_parameter_specification *note 5.5(9/3): 3437.
130983 nongeneric package_body *note 7.2(6): 3850.
130984 nongeneric subprogram_body *note 6.3(6): 3647.
130985 null_procedure_declaration *note 6.7(5/3): 3806.
130986 number_declaration *note 3.3.2(7): 1603.
130987 object_declaration *note 3.3.1(15): 1582.
130988 of library units for a foreign language main subprogram *note
130989 B.1(39/3): 7975.
130990 package_body of Standard *note A.1(50): 5897.
130991 package_declaration *note 7.1(8): 3839.
130992 partition *note E.1(6): 8695.
130993 partition *note E.5(21): 8818.
130994 per-object constraint *note 3.8(18.1/1): 2177.
130995 pragma *note 2.8(12): 1324.
130996 private_extension_declaration *note 7.3(17): 3878.
130997 private_type_declaration *note 7.3(17): 3877.
130998 protected declaration *note 9.4(12): 4308.
130999 protected_body *note 9.4(15): 4312.
131000 protected_definition *note 9.4(13): 4310.
131001 range_constraint *note 3.5(9): 1689.
131002 real_type_definition *note 3.5.6(5): 1887.
131003 record_definition *note 3.8(16): 2170.
131004 record_extension_part *note 3.9.1(5): 2281.
131005 record_type_definition *note 3.8(16): 2169.
131006 renaming_declaration *note 8.5(3): 4078.
131007 single_protected_declaration *note 9.4(12): 4309.
131008 single_task_declaration *note 9.1(10): 4234.
131009 subprogram_declaration *note 6.1(31/2): 3576.
131010 subtype_declaration *note 3.2.2(9): 1482.
131011 subtype_indication *note 3.2.2(9): 1483.
131012 task declaration *note 9.1(10): 4233.
131013 task_body *note 9.1(13): 4237.
131014 task_definition *note 9.1(11): 4235.
131015 use_clause *note 8.4(12): 4069.
131016 variant_part *note 3.8.1(22): 2204.
131017 elaboration control *note 10.2.1(1): 4810.
131018 elaboration dependence
131019 library_item on another *note 10.2(9): 4793.
131020 Elaboration_Check *note 11.5(20): 5011.
131021 [partial] *note 3.11(9): 2509.
131022 element
131023 of a storage pool *note 13.11(11): 5631.
131024 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(14/2): 7347.
131025 in Ada.Containers.Hashed_Maps *note A.18.5(14/2): 7441, *note
131026 A.18.5(31/2): 7465.
131027 in Ada.Containers.Hashed_Sets *note A.18.8(15/2): 7581, *note
131028 A.18.8(52/2): 7616.
131029 in Ada.Containers.Indefinite_Holders *note A.18.18(12/3): 7830.
131030 in Ada.Containers.Multiway_Trees *note A.18.10(24/3): 7749.
131031 in Ada.Containers.Ordered_Maps *note A.18.6(13/2): 7495, *note
131032 A.18.6(39/2): 7528.
131033 in Ada.Containers.Ordered_Sets *note A.18.9(14/2): 7655, *note
131034 A.18.9(65/2): 7698.
131035 in Ada.Containers.Vectors *note A.18.2(27/2): 7255, *note
131036 A.18.2(28/2): 7256.
131037 in Ada.Strings.Bounded *note A.4.4(26): 6318.
131038 in Ada.Strings.Unbounded *note A.4.5(20): 6375.
131039 elementary type *note 3.2(2/2): 1393, *note N(16): 9538.
131040 Elementary_Functions
131041 child of Ada.Numerics *note A.5.1(9/1): 6614.
131042 eligible
131043 a type, for a convention *note B.1(14/3): 7964.
131044 else part
131045 of a selective_accept *note 9.7.1(11): 4553.
131046 EM
131047 in Ada.Characters.Latin_1 *note A.3.3(6): 5974.
131048 embedded systems *note C(1): 8181, *note D(1): 8322.
131049 empty element
131050 of a vector *note A.18.2(4/2): 7235.
131051 empty holder *note A.18.18(3/3): 7823.
131052 Empty_Holder
131053 in Ada.Containers.Indefinite_Holders *note A.18.18(7/3): 7826.
131054 Empty_List
131055 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(8/2): 7340.
131056 Empty_Map
131057 in Ada.Containers.Hashed_Maps *note A.18.5(5/2): 7431.
131058 in Ada.Containers.Ordered_Maps *note A.18.6(6/2): 7487.
131059 Empty_Set
131060 in Ada.Containers.Hashed_Sets *note A.18.8(5/2): 7570.
131061 in Ada.Containers.Ordered_Sets *note A.18.9(6/2): 7646.
131062 Empty_Tree
131063 in Ada.Containers.Multiway_Trees *note A.18.10(10/3): 7736.
131064 Empty_Vector
131065 in Ada.Containers.Vectors *note A.18.2(10/2): 7241.
131066 enabled
131067 invariant expression *note 7.3.2(21/3): 3899.
131068 postcondition expression *note 6.1.1(19/3): 3600.
131069 precondition expression *note 6.1.1(19/3): 3599.
131070 predicate checks *note 3.2.4(7/3): 1508.
131071 encapsulation
131072 See package *note 7(1): 3822.
131073 enclosing
131074 immediately *note 8.1(13): 3993.
131075 Encode
131076 in Ada.Strings.UTF_Encoding.Strings *note A.4.11(23/3): 6554, *note
131077 A.4.11(24/3): 6555, *note A.4.11(25/3): 6556.
131078 in Ada.Strings.UTF_Encoding.Wide_Strings *note A.4.11(31/3): 6561,
131079 *note A.4.11(32/3): 6562, *note A.4.11(33/3): 6563.
131080 in Ada.Strings.UTF_Encoding.Wide_Wide_Strings *note A.4.11(39/3):
131081 6568, *note A.4.11(40/3): 6569, *note A.4.11(41/3): 6570.
131082 Encoding
131083 in Ada.Strings.UTF_Encoding *note A.4.11(13/3): 6546.
131084 encoding scheme *note A.4.11(46/3): 6574.
131085 Encoding_Error
131086 in Ada.Strings.UTF_Encoding *note A.4.11(8/3): 6541.
131087 Encoding_Scheme
131088 in Ada.Strings.UTF_Encoding *note A.4.11(4/3): 6537.
131089 end of a line *note 2.2(2/3): 1225.
131090 End_Error
131091 raised by failure of run-time check *note 13.13.2(37/1): 5811.
131092 in Ada.Direct_IO *note A.8.4(18): 6835.
131093 in Ada.IO_Exceptions *note A.13(4): 7120.
131094 in Ada.Sequential_IO *note A.8.1(15): 6802.
131095 in Ada.Streams.Stream_IO *note A.12.1(26): 7097.
131096 in Ada.Text_IO *note A.10.1(85): 7011.
131097 End_Of_File
131098 in Ada.Direct_IO *note A.8.4(16): 6829.
131099 in Ada.Sequential_IO *note A.8.1(13): 6796.
131100 in Ada.Streams.Stream_IO *note A.12.1(12): 7081.
131101 in Ada.Text_IO *note A.10.1(34): 6917.
131102 End_Of_Line
131103 in Ada.Text_IO *note A.10.1(30): 6910.
131104 End_Of_Page
131105 in Ada.Text_IO *note A.10.1(33): 6915.
131106 End_Search
131107 in Ada.Directories *note A.16(33/2): 7165.
131108 endian
131109 big *note 13.5.3(2): 5515.
131110 little *note 13.5.3(2): 5518.
131111 ENQ
131112 in Ada.Characters.Latin_1 *note A.3.3(5): 5954.
131113 Enqueue
131114 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(5/3): 7918.
131115 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(5/3):
131116 7903.
131117 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(5/3):
131118 7888.
131119 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(5/3):
131120 7910.
131121 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(5/3):
131122 7896.
131123 entity *note 3.1(12.b): 1385.
131124 [partial] *note 3.1(1): 1342.
131125 entry
131126 closed *note 9.5.3(5): 4409.
131127 open *note 9.5.3(5): 4407.
131128 single *note 9.5.2(20): 4389.
131129 entry call *note 9.5.3(1): 4400.
131130 simple *note 9.5.3(1): 4402.
131131 entry calling convention *note 6.3.1(13): 3664.
131132 entry family *note 9.5.2(20): 4386.
131133 entry index subtype *note 3.8(18/2): 2175, *note 9.5.2(20): 4387.
131134 entry queue *note 9.5.3(12): 4418.
131135 entry queuing policy *note 9.5.3(17): 4422.
131136 default policy *note 9.5.3(17): 4424.
131137 entry_barrier *note 9.5.2(7): 4371.
131138 used *note 9.5.2(5): 4364, *note P: 10228.
131139 entry_body *note 9.5.2(5): 4361.
131140 used *note 9.4(8/1): 4294, *note P: 10213.
131141 entry_body_formal_part *note 9.5.2(6): 4368.
131142 used *note 9.5.2(5): 4363, *note P: 10227.
131143 entry_call_alternative *note 9.7.2(3/2): 4563.
131144 used *note 9.7.2(2): 4561, *note 9.7.3(2): 4572, *note P: 10267.
131145 entry_call_statement *note 9.5.3(2): 4403.
131146 used *note 5.1(4/2): 3351, *note 9.7.2(3.1/2): 4568, *note P: 9996.
131147 entry_declaration *note 9.5.2(2/3): 4347.
131148 used *note 9.1(5/1): 4215, *note 9.4(5/1): 4281, *note P: 10203.
131149 entry_index *note 9.5.2(4): 4359.
131150 used *note 9.5.2(3): 4355, *note P: 10221.
131151 entry_index_specification *note 9.5.2(8): 4373.
131152 used *note 9.5.2(6): 4369, *note P: 10232.
131153 enumeration literal *note 3.5.1(6/3): 1778.
131154 enumeration type *note 3.2(3): 1400, *note 3.5.1(1): 1769, *note
131155 N(17): 9539.
131156 enumeration_aggregate *note 13.4(3): 5460.
131157 used *note 13.4(2): 5459, *note P: 10447.
131158 Enumeration_IO
131159 in Ada.Text_IO *note A.10.1(79): 6997.
131160 enumeration_literal_specification *note 3.5.1(3): 1773.
131161 used *note 3.5.1(2): 1771, *note P: 9714.
131162 enumeration_representation_clause *note 13.4(2): 5457.
131163 used *note 13.1(2/1): 5283, *note P: 10425.
131164 enumeration_type_definition *note 3.5.1(2): 1770.
131165 used *note 3.2.1(4/2): 1441, *note P: 9667.
131166 environment *note 10.1.4(1): 4753.
131167 environment declarative_part *note 10.1.4(1): 4754.
131168 for the environment task of a partition *note 10.2(13): 4795.
131169 environment task *note 10.2(8): 4792.
131170 environment variable *note A.17(1/2): 7204.
131171 Environment_Task
131172 in Ada.Task_Identification *note C.7.1(3/3): 8277.
131173 Environment_Variables
131174 child of Ada *note A.17(3/2): 7205.
131175 EOT
131176 in Ada.Characters.Latin_1 *note A.3.3(5): 5953.
131177 EPA
131178 in Ada.Characters.Latin_1 *note A.3.3(18): 6070.
131179 epoch *note D.8(19): 8544.
131180 equal operator *note 4.4(1/3): 2785, *note 4.5.2(1): 2960.
131181 Equal_Case_Insensitive
131182 child of Ada.Strings *note A.4.10(2/3): 6527.
131183 child of Ada.Strings.Bounded *note A.4.10(7/3): 6529.
131184 child of Ada.Strings.Fixed *note A.4.10(5/3): 6528.
131185 child of Ada.Strings.Unbounded *note A.4.10(10/3): 6530.
131186 Equal_Subtree
131187 in Ada.Containers.Multiway_Trees *note A.18.10(14/3): 7740.
131188 equality operator *note 4.5.2(1): 2954.
131189 special inheritance rule for tagged types *note 3.4(17/2): 1627,
131190 *note 4.5.2(14/3): 2990.
131191 equals sign *note 2.1(15/3): 1209.
131192 Equals_Sign
131193 in Ada.Characters.Latin_1 *note A.3.3(10): 6001.
131194 equivalence of use_clauses and selected_components *note 8.4(1.a):
131195 4053.
131196 equivalent element
131197 of a hashed set *note A.18.8(64/2): 7628.
131198 of an ordered set *note A.18.9(78/2): 7711.
131199 equivalent key
131200 of a hashed map *note A.18.5(42/2): 7472.
131201 of an ordered map *note A.18.6(55/2): 7534.
131202 Equivalent_Elements
131203 in Ada.Containers.Hashed_Sets *note A.18.8(46/2): 7610, *note
131204 A.18.8(47/2): 7611, *note A.18.8(48/2): 7612.
131205 in Ada.Containers.Ordered_Sets *note A.18.9(3/2): 7643.
131206 Equivalent_Keys
131207 in Ada.Containers.Hashed_Maps *note A.18.5(34/2): 7467, *note
131208 A.18.5(35/2): 7468, *note A.18.5(36/2): 7469.
131209 in Ada.Containers.Ordered_Maps *note A.18.6(3/2): 7484.
131210 in Ada.Containers.Ordered_Sets *note A.18.9(63/2): 7696.
131211 Equivalent_Sets
131212 in Ada.Containers.Hashed_Sets *note A.18.8(8/2): 7574.
131213 in Ada.Containers.Ordered_Sets *note A.18.9(9/2): 7650.
131214 erroneous execution *note 1.1.2(32): 1040, *note 1.1.5(10): 1100.
131215 cause *note 3.7.2(4): 2140, *note 3.9(25.3/2): 2261, *note
131216 6.4.1(18/3): 3736, *note 9.8(21): 4618, *note 9.10(11): 4631, *note
131217 11.5(26): 5015, *note 13.3(13/3): 5396, *note 13.3(27): 5408, *note
131218 13.3(28/2): 5409, *note 13.9.1(8): 5601, *note 13.9.1(12/3): 5606, *note
131219 13.9.1(13/3): 5607, *note 13.11(21): 5652, *note 13.11.2(16/3): 5681,
131220 *note 13.13.2(53/2): 5831, *note A.10.3(22/1): 7018, *note
131221 A.12.1(36.1/1): 7100, *note A.13(17): 7123, *note A.17(28/2): 7214,
131222 *note A.18.2(252/2): 7329, *note A.18.3(157/2): 7402, *note
131223 A.18.4(80/2): 7426, *note A.18.7(101/2): 7565, *note A.18.18(70/3):
131224 7848, *note A.18.19(11/3): 7851, *note A.18.20(15/3): 7855, *note
131225 A.18.21(16/3): 7860, *note A.18.22(13/3): 7864, *note A.18.23(16/3):
131226 7869, *note A.18.24(13/3): 7873, *note A.18.25(15/3): 7876, *note
131227 B.1(38.1/3): 7972, *note B.3.1(51): 8070, *note B.3.1(55): 8071, *note
131228 B.3.1(56): 8072, *note B.3.1(57): 8073, *note B.3.2(35): 8086, *note
131229 B.3.2(36): 8087, *note B.3.2(37): 8088, *note B.3.2(38): 8089, *note
131230 B.3.2(39): 8090, *note B.3.2(42): 8091, *note C.3.1(14): 8218, *note
131231 C.3.1(14.1/3): 8219, *note C.7.1(18): 8291, *note C.7.2(14): 8302, *note
131232 C.7.2(15): 8303, *note C.7.2(15.1/2): 8304, *note D.2.6(31/2): 8404,
131233 *note D.5.1(12): 8448, *note D.11(9): 8581, *note D.14(19/2): 8600,
131234 *note D.14.1(25/2): 8617, *note D.14.2(35/2): 8643, *note H.4(26): 9103,
131235 *note H.4(27): 9104.
131236 error
131237 compile-time *note 1.1.2(27): 1023, *note 1.1.5(4): 1093.
131238 link-time *note 1.1.2(29): 1031, *note 1.1.5(4): 1095.
131239 run-time *note 1.1.2(30): 1037, *note 1.1.5(6): 1097, *note
131240 11.5(2/3): 4985, *note 11.6(1/3): 5024.
131241 See also bounded error, erroneous execution
131242 ESA
131243 in Ada.Characters.Latin_1 *note A.3.3(17): 6054.
131244 ESC
131245 in Ada.Characters.Latin_1 *note A.3.3(6): 5976.
131246 Establish_RPC_Receiver
131247 in System.RPC *note E.5(12): 8817.
131248 ETB
131249 in Ada.Characters.Latin_1 *note A.3.3(6): 5972.
131250 ETX
131251 in Ada.Characters.Latin_1 *note A.3.3(5): 5952.
131252 evaluable *note 3.1(11.g): 1381.
131253 evaluation *note 3.1(11): 1377, *note 3.1(11.a): 1379, *note
131254 N(17.1/2): 9540, *note N(19): 9546.
131255 aggregate *note 4.3(5): 2675.
131256 allocator *note 4.8(7/2): 3268.
131257 array_aggregate *note 4.3.3(21): 2757.
131258 attribute_reference *note 4.1.4(11): 2616.
131259 case_expression *note 4.5.7(21/3): 3109.
131260 concatenation *note 4.5.3(5): 3020.
131261 dereference *note 4.1(13): 2553.
131262 discrete_range *note 3.6.1(8): 2051.
131263 extension_aggregate *note 4.3.2(7): 2720.
131264 generalized_reference *note 4.1.5(8/3): 2628.
131265 generic_association *note 12.3(21): 5120.
131266 generic_association for a formal object of mode in *note 12.4(11):
131267 5152.
131268 if_expression *note 4.5.7(20/3): 3105.
131269 indexed_component *note 4.1.1(7): 2566.
131270 initialized allocator *note 4.8(7/2): 3269.
131271 membership test *note 4.5.2(27/3): 2995.
131272 name *note 4.1(11/2): 2550.
131273 name that has a prefix *note 4.1(12): 2551.
131274 null literal *note 4.2(9): 2658.
131275 numeric literal *note 4.2(9): 2657.
131276 parameter_association *note 6.4.1(7): 3723.
131277 prefix *note 4.1(12): 2552.
131278 primary that is a name *note 4.4(10): 2909.
131279 qualified_expression *note 4.7(4): 3242.
131280 quantified_expression *note 4.5.8(6/3): 3123.
131281 range *note 3.5(9): 1690.
131282 range_attribute_reference *note 4.1.4(11): 2617.
131283 record_aggregate *note 4.3.1(18): 2702.
131284 record_component_association_list *note 4.3.1(19): 2703.
131285 selected_component *note 4.1.3(14): 2594.
131286 short-circuit control form *note 4.5.1(7): 2945.
131287 slice *note 4.1.2(7): 2577.
131288 string_literal *note 4.2(10): 2661.
131289 uninitialized allocator *note 4.8(8): 3272.
131290 Val *note 3.5.5(7): 1867, *note K.2(261): 9322.
131291 Value *note 3.5(55/3): 1757.
131292 value conversion *note 4.6(28): 3171.
131293 view conversion *note 4.6(52): 3215.
131294 Wide_Value *note 3.5(43/3): 1751.
131295 Wide_Wide_Value *note 3.5(39.4/3): 1739.
131296 Exception *note 11(1/3): 4865, *note 11.1(1): 4870, *note N(18): 9541.
131297 exception function *note 6.8(6/3): 3816.
131298 exception occurrence *note 11(1/3): 4860.
131299 exception_choice *note 11.2(5): 4897.
131300 used *note 11.2(3): 4892, *note P: 10327.
131301 exception_declaration *note 11.1(2/3): 4871.
131302 used *note 3.1(3/3): 1355, *note P: 9653.
131303 exception_handler *note 11.2(3): 4890.
131304 used *note 11.2(2): 4888, *note P: 10323.
131305 Exception_Id
131306 in Ada.Exceptions *note 11.4.1(2/2): 4928.
131307 Exception_Identity
131308 in Ada.Exceptions *note 11.4.1(5/2): 4939.
131309 Exception_Information
131310 in Ada.Exceptions *note 11.4.1(5/2): 4943.
131311 Exception_Message
131312 in Ada.Exceptions *note 11.4.1(4/3): 4937.
131313 Exception_Name
131314 in Ada.Exceptions *note 11.4.1(2/2): 4930, *note 11.4.1(5/2): 4940.
131315 Exception_Occurrence
131316 in Ada.Exceptions *note 11.4.1(3/2): 4933.
131317 Exception_Occurrence_Access
131318 in Ada.Exceptions *note 11.4.1(3/2): 4934.
131319 exception_renaming_declaration *note 8.5.2(2/3): 4099.
131320 used *note 8.5(2): 4074, *note P: 10139.
131321 Exceptions
131322 child of Ada *note 11.4.1(2/2): 4927.
131323 Exchange_Handler
131324 in Ada.Interrupts *note C.3.2(8): 8231.
131325 Exclamation
131326 in Ada.Characters.Latin_1 *note A.3.3(8): 5982.
131327 exclamation point *note 2.1(15/3): 1214.
131328 Exclude
131329 in Ada.Containers.Hashed_Maps *note A.18.5(24/2): 7458.
131330 in Ada.Containers.Hashed_Sets *note A.18.8(23/2): 7592, *note
131331 A.18.8(54/2): 7618.
131332 in Ada.Containers.Ordered_Maps *note A.18.6(23/2): 7512.
131333 in Ada.Containers.Ordered_Sets *note A.18.9(22/2): 7666, *note
131334 A.18.9(67/2): 7700.
131335 excludes null
131336 subtype *note 3.10(13.1/2): 2413.
131337 executable *note 3.1(11.g): 1382.
131338 execution *note 3.1(11): 1375, *note N(19): 9544.
131339 abort_statement *note 9.8(4): 4603.
131340 aborting the execution of a construct *note 9.8(5): 4608.
131341 accept_statement *note 9.5.2(24): 4392.
131342 Ada program *note 9(1/3): 4178.
131343 assignment_statement *note 5.2(7): 3385, *note 7.6(17): 3945, *note
131344 7.6.1(12/2): 3974.
131345 asynchronous_select with a delay_statement trigger *note 9.7.4(7):
131346 4588.
131347 asynchronous_select with a procedure call trigger *note 9.7.4(6/2):
131348 4587.
131349 asynchronous_select with an entry call trigger *note 9.7.4(6/2):
131350 4586.
131351 block_statement *note 5.6(5): 3497.
131352 call on a dispatching operation *note 3.9.2(14): 2310.
131353 call on an inherited subprogram *note 3.4(27/2): 1633.
131354 case_statement *note 5.4(11/3): 3414.
131355 conditional_entry_call *note 9.7.3(3): 4574.
131356 delay_statement *note 9.6(20): 4472.
131357 dynamically enclosing *note 11.4(2): 4916.
131358 entry_body *note 9.5.2(26): 4397.
131359 entry_call_statement *note 9.5.3(8): 4415.
131360 exit_statement *note 5.7(5): 3502.
131361 extended_return_statement *note 6.5(5.11/3): 3759.
131362 goto_statement *note 5.8(5): 3506.
131363 handled_sequence_of_statements *note 11.2(10): 4903.
131364 handler *note 11.4(7): 4925.
131365 if_statement *note 5.3(5/3): 3403.
131366 included by another execution *note 11.4(2.a): 4919.
131367 instance of Unchecked_Deallocation *note 7.6.1(10): 3968.
131368 loop_statement *note 5.5(7): 3434.
131369 loop_statement with a for iteration_scheme *note 5.5(9/3): 3436.
131370 loop_statement with a while iteration_scheme *note 5.5(8): 3435.
131371 null_statement *note 5.1(13): 3370.
131372 partition *note 10.2(25): 4799.
131373 pragma *note 2.8(12): 1323.
131374 program *note 10.2(25): 4798.
131375 protected subprogram call *note 9.5.1(3): 4337.
131376 raise_statement with an exception_name *note 11.3(4/2): 4910.
131377 re-raise statement *note 11.3(4/2): 4911.
131378 remote subprogram call *note E.4(9): 8786.
131379 requeue protected entry *note 9.5.4(9): 4439.
131380 requeue task entry *note 9.5.4(8): 4438.
131381 requeue_statement *note 9.5.4(7/3): 4437.
131382 selective_accept *note 9.7.1(15): 4555.
131383 sequence_of_statements *note 5.1(15): 3372.
131384 simple_return_statement *note 6.5(6/2): 3766.
131385 subprogram call *note 6.4(10/2): 3708.
131386 subprogram_body *note 6.3(7): 3648.
131387 task *note 9.2(1): 4241.
131388 task_body *note 9.2(1): 4242.
131389 timed_entry_call *note 9.7.2(4/2): 4569.
131390 execution resource
131391 associated with a protected object *note 9.4(18): 4313.
131392 required for a task to run *note 9(10): 4195.
131393 execution time
131394 of a task *note D.14(11/3): 8597.
131395 Execution_Time
131396 child of Ada *note D.14(3/2): 8585.
131397 exhaust
131398 a budget *note D.14.2(14/2): 8639.
131399 exist
131400 cease to *note 7.6.1(11/3): 3969, *note 13.11.2(10/2): 5673.
131401 Exists
131402 in Ada.Directories *note A.16(24/2): 7157.
131403 in Ada.Environment_Variables *note A.17(5/2): 7208.
131404 exit_statement *note 5.7(2): 3498.
131405 used *note 5.1(4/2): 3347, *note P: 9992.
131406 Exit_Status
131407 in Ada.Command_Line *note A.15(7): 7131.
131408 Exp
131409 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
131410 G.1.2(3): 8897.
131411 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6589.
131412 expanded name *note 4.1.3(4): 2591.
131413 Expanded_Name
131414 in Ada.Tags *note 3.9(7/2): 2232.
131415 expected profile *note 8.6(26): 4160.
131416 accept_statement entry_direct_name *note 9.5.2(11): 4376.
131417 Access attribute_reference prefix *note 3.10.2(2.3/2): 2440.
131418 attribute_definition_clause name *note 13.3(4): 5363.
131419 character_literal *note 4.2(3): 2652.
131420 formal subprogram actual *note 12.6(6): 5245.
131421 formal subprogram default_name *note 12.6(5): 5244.
131422 name in an aspect_specification *note 13.1.1(8/3): 5341.
131423 subprogram_renaming_declaration *note 8.5.4(3): 4116.
131424 expected type *note 8.6(20/2): 4154.
131425 abort_statement task_name *note 9.8(3): 4602.
131426 access attribute_reference *note 3.10.2(2/2): 2439.
131427 Access attribute_reference prefix *note 3.10.2(2.3/2): 2441.
131428 actual parameter *note 6.4.1(3): 3720.
131429 aggregate *note 4.3(3/2): 2674.
131430 allocator *note 4.8(3/3): 3261.
131431 array_aggregate *note 4.3.3(7/2): 2752.
131432 array_aggregate component expression *note 4.3.3(7/2): 2753.
131433 array_aggregate discrete_choice *note 4.3.3(8): 2754.
131434 assignment_statement expression *note 5.2(4/2): 3384.
131435 assignment_statement variable_name *note 5.2(4/2): 3383.
131436 Attach_Handler pragma second argument *note J.15.7(6/3): 9224.
131437 attribute_definition_clause expression or name *note 13.3(4): 5362.
131438 attribute_designator expression *note 4.1.4(7): 2614.
131439 case_expression selecting_expression *note 4.5.7(15/3): 3102.
131440 case_expression_alternative discrete_choice *note 4.5.7(15/3):
131441 3103.
131442 case_statement selecting_expression *note 5.4(4/3): 3411.
131443 case_statement_alternative discrete_choice *note 5.4(4/3): 3413.
131444 character_literal *note 4.2(3): 2651.
131445 code_statement *note 13.8(4): 5579.
131446 component_clause expressions *note 13.5.1(7): 5494.
131447 component_declaration default_expression *note 3.8(7): 2162.
131448 condition *note 4.5.7(14/3): 3101.
131449 CPU pragma argument *note J.15.9(3/3): 9260.
131450 decimal fixed point type digits *note 3.5.9(6): 1940.
131451 delay_relative_statement expression *note 9.6(5): 4453.
131452 delay_until_statement expression *note 9.6(5): 4454.
131453 delta_constraint expression *note J.3(3): 9123.
131454 dependent_expression *note 4.5.7(8/3): 3100.
131455 dereference name *note 4.1(8): 2546.
131456 discrete_subtype_definition range *note 3.6(8): 2007.
131457 discriminant default_expression *note 3.7(7): 2098.
131458 discriminant_association expression *note 3.7.1(6): 2130.
131459 Dispatching_Domains pragma argument *note J.15.10(3/3): 9264.
131460 entry_index *note 9.5.2(11): 4377.
131461 enumeration_representation_clause expressions *note 13.4(4): 5462.
131462 expression in an aspect_specification *note 13.1.1(7/3): 5340.
131463 expression of a Default_Component_Value aspect *note 3.6(22.4/3):
131464 2034.
131465 expression of a Default_Value aspect *note 3.5(56.5/3): 1763.
131466 expression of a predicate aspect *note 3.2.4(2/3): 1506.
131467 expression of expression function *note 6.8(3/3): 3814.
131468 expression of extended_return_statement *note 6.5(3/2): 3755.
131469 expression of simple_return_statement *note 6.5(3/2): 3754.
131470 extension_aggregate *note 4.3.2(4/2): 2716.
131471 extension_aggregate ancestor expression *note 4.3.2(4/2): 2717.
131472 external name *note J.15.5(6/3): 9210.
131473 first_bit *note 13.5.1(7): 5496.
131474 fixed point type delta *note 3.5.9(6): 1939.
131475 generic formal in object actual *note 12.4(4): 5141.
131476 generic formal object default_expression *note 12.4(3): 5140.
131477 index_constraint discrete_range *note 3.6.1(4): 2045.
131478 indexable_container_object_prefix *note 4.1.6(11/3): 2643.
131479 indexed_component expression *note 4.1.1(4): 2564.
131480 Interrupt_Priority pragma argument *note J.15.11(5/3): 9271.
131481 invariant expression *note 7.3.2(4/3): 3896.
131482 iterable_name *note 5.5.2(3/3): 3475.
131483 iterator_name *note 5.5.2(3/3): 3474.
131484 last_bit *note 13.5.1(7): 5497.
131485 link name *note J.15.5(6/3): 9209.
131486 linker options *note B.1(10.1/3): 7959.
131487 membership test simple_expression *note 4.5.2(3/3): 2986.
131488 modular_type_definition expression *note 3.5.4(5): 1820.
131489 name in an aspect_specification *note 13.1.1(7/3): 5339.
131490 number_declaration expression *note 3.3.2(3): 1601.
131491 object in an aspect_specification *note 13.1.1(6/3): 5338.
131492 object_declaration initialization expression *note 3.3.1(4): 1566.
131493 parameter default_expression *note 6.1(17): 3562.
131494 position *note 13.5.1(7): 5495.
131495 postcondition expression *note 6.1.1(6/3): 3597.
131496 precondition expression *note 6.1.1(6/3): 3596.
131497 Priority pragma argument *note J.15.11(5/3): 9270.
131498 quantified_expression *note 4.5.8(5/3): 3121.
131499 range simple_expressions *note 3.5(5): 1681.
131500 range_attribute_designator expression *note 4.1.4(7): 2615.
131501 range_constraint range *note 3.5(5): 1680.
131502 real_range_specification bounds *note 3.5.7(5): 1898.
131503 record_aggregate *note 4.3.1(8/2): 2698.
131504 record_component_association expression *note 4.3.1(10): 2700.
131505 reference_object_name *note 4.1.5(5/3): 2627.
131506 Relative_Deadline pragma argument *note J.15.12(3/3): 9274.
131507 requested decimal precision *note 3.5.7(4): 1897.
131508 restriction parameter expression *note 13.12(5): 5739.
131509 selecting_expression case_expression *note 4.5.7(15/3): 3104.
131510 selecting_expression case_statement *note 5.4(4/3): 3412.
131511 short-circuit control form relation *note 4.5.1(1): 2934.
131512 signed_integer_type_definition simple_expression *note 3.5.4(5):
131513 1819.
131514 slice discrete_range *note 4.1.2(4): 2576.
131515 Storage_Size pragma argument *note J.15.4(4/3): 9179.
131516 string_literal *note 4.2(4): 2653.
131517 subpool_handle_name *note 4.8(3/3): 3262.
131518 type_conversion operand *note 4.6(6): 3145.
131519 Unchecked_Access attribute *note 13.10(4.a): 5617.
131520 variant_part discrete_choice *note 3.8.1(6): 2199.
131521 expiration time
131522 [partial] *note 9.6(1): 4444.
131523 for a delay_relative_statement *note 9.6(20): 4474.
131524 for a delay_until_statement *note 9.6(20): 4473.
131525 expires
131526 execution timer *note D.14.1(15/3): 8616.
131527 explicit declaration *note 3.1(5): 1361, *note N(11): 9531.
131528 explicit initial value *note 3.3.1(1/3): 1543.
131529 explicit_actual_parameter *note 6.4(6): 3703.
131530 used *note 6.4(5): 3702, *note P: 10093.
131531 explicit_dereference *note 4.1(5): 2541.
131532 used *note 4.1(2/3): 2524, *note P: 9831.
131533 explicit_generic_actual_parameter *note 12.3(5): 5092.
131534 used *note 12.3(4): 5091, *note P: 10363.
131535 explicitly aliased parameter *note 6.1(23.1/3): 3570.
131536 explicitly assign *note 10.2(2): 4787.
131537 explicitly limited record *note 3.8(13.1/3): 2165.
131538 exponent *note 2.4.1(4): 1264, *note 4.5.6(11/3): 3076.
131539 used *note 2.4.1(2): 1259, *note 2.4.2(2): 1282, *note P: 9622.
131540 Exponent attribute *note A.5.3(18): 6681.
131541 exponentiation operator *note 4.4(1/3): 2840, *note 4.5.6(7): 3072.
131542 Export aspect *note B.1(1/3): 7944.
131543 Export pragma *note J.15.5(3/3): 9200, *note L(13.1/3): 9386.
131544 exported entity *note B.1(23/3): 7967.
131545 expression *note 4.4(1/3): 2774, *note 4.4(2): 2847.
131546 predicate-static *note 3.2.4(15/3): 1512.
131547 used *note 2.8(3/3): 1316, *note 3.3.1(2/3): 1551, *note 3.3.2(2):
131548 1600, *note 3.5.4(4): 1818, *note 3.5.7(2): 1891, *note 3.5.9(3): 1930,
131549 *note 3.5.9(4): 1933, *note 3.5.9(5): 1937, *note 3.7(6): 2097, *note
131550 3.7.1(3): 2125, *note 4.1.1(2): 2562, *note 4.1.4(3/2): 2608, *note
131551 4.1.4(5): 2613, *note 4.3.1(4/2): 2691, *note 4.3.2(3): 2714, *note
131552 4.3.3(3/2): 2735, *note 4.3.3(5/2): 2746, *note 4.4(7/3): 2906, *note
131553 4.5.7(3/3): 3089, *note 4.5.7(4/3): 3092, *note 4.5.7(5/3): 3094, *note
131554 4.5.7(6/3): 3099, *note 4.5.8(3/3): 3120, *note 4.6(2): 3133, *note
131555 4.7(2): 3238, *note 5.2(2): 3378, *note 5.4(2/3): 3405, *note 6.4(6):
131556 3704, *note 6.5(2.1/3): 3746, *note 6.5(2/2): 3742, *note 6.8(2/3):
131557 3812, *note 9.5.2(4): 4360, *note 9.6(3): 4450, *note 9.6(4): 4452,
131558 *note 11.3(2/2): 4907, *note 11.4.2(3/2): 4959, *note 12.3(5): 5093,
131559 *note 13.1.1(4/3): 5335, *note 13.3(2): 5358, *note 13.5.1(4): 5489,
131560 *note 13.12(4.1/2): 5738, *note B.1(8): 7958, *note B.1(10.1/3): 7960,
131561 *note D.2.2(3.2/2): 8361, *note J.3(2): 9121, *note J.7(1): 9132, *note
131562 J.8(1): 9143, *note J.15.4(2/3): 9178, *note J.15.5(2/3): 9197, *note
131563 J.15.5(3/3): 9204, *note J.15.7(4/3): 9223, *note J.15.9(2/3): 9259,
131564 *note L(2.1/2): 9334, *note L(6.1/3): 9356, *note L(8.2/3): 9363, *note
131565 L(13.1/3): 9390, *note L(14.1/3): 9396, *note L(19): 9418, *note
131566 L(27.2/2): 9454, *note L(35.1/3): 9484, *note P: 9889.
131567 expression_function_declaration *note 6.8(2/3): 3809.
131568 used *note 3.1(3/3): 1352, *note P: 9650.
131569 extended_digit *note 2.4.2(5): 1289.
131570 used *note 2.4.2(4): 1286, *note P: 9626.
131571 Extended_Index subtype of Index_Type'Base
131572 in Ada.Containers.Vectors *note A.18.2(7/2): 7237.
131573 extended_return_object_declaration *note 6.5(2.1/3): 3743.
131574 used *note 6.5(2.2/3): 3748, *note P: 10100.
131575 extended_return_statement *note 6.5(2.2/3): 3747.
131576 used *note 5.1(5/2): 3362, *note P: 10006.
131577 extension
131578 of a private type *note 3.9(2.1/2): 2221, *note 3.9.1(1/2): 2275.
131579 of a record type *note 3.9(2.1/2): 2219, *note 3.9.1(1/2): 2273.
131580 of a type *note 3.9(2/2): 2218, *note 3.9.1(1/2): 2271.
131581 in Ada.Directories *note A.16(18/2): 7150.
131582 extension_aggregate *note 4.3.2(2): 2710.
131583 used *note 4.3(2): 2672, *note P: 9869.
131584 extensions to Ada 2005 *note 1.1.2(39.ff/3): 1062, *note 2.2(14.d/3):
131585 1229, *note 2.8(19.f/3): 1328, *note 3.2.1(16.g/3): 1460, *note
131586 3.2.2(15.e/3): 1490, *note 3.2.4(35.a/3): 1520, *note 3.3(26.j/3): 1541,
131587 *note 3.3.1(33.l/3): 1596, *note 3.5(63.n/3): 1768, *note 3.5.5(17.b/3):
131588 1878, *note 3.6(30.j/3): 2037, *note 3.7(37.m/3): 2118, *note
131589 3.8(31.j/3): 2182, *note 3.8.1(29.f/3): 2207, *note 3.9.3(16.l/3): 2338,
131590 *note 3.10.1(23.m/3): 2438, *note 3.10.2(41.r/3): 2488, *note
131591 4.1(17.h/3): 2558, *note 4.1.5(15.a/3): 2632, *note 4.1.6(21.a/3): 2648,
131592 *note 4.3.1(31.f/3): 2709, *note 4.5.2(39.l/3): 3002, *note
131593 4.5.7(21.a/3): 3110, *note 4.5.8(13.a/3): 3124, *note 4.8(20.q/3): 3303,
131594 *note 5.1(19.e/3): 3375, *note 5.5.1(21.a/3): 3465, *note 5.5.2(15.a/3):
131595 3491, *note 6.1(42.m/3): 3579, *note 6.1.1(40.a/3): 3620, *note
131596 6.3(11.g/3): 3650, *note 6.3.2(7.d/3): 3687, *note 6.5(28.s/3): 3784,
131597 *note 6.5.1(10.b/3): 3792, *note 6.7(6.b/3): 3808, *note 6.8(9.a/3):
131598 3819, *note 7.1(17.e/3): 3841, *note 7.2(15.f/3): 3851, *note
131599 7.3(24.g/3): 3882, *note 7.3.2(24.b/3): 3901, *note 7.6(27.l/3): 3953,
131600 *note 8.4(16.h/3): 4071, *note 8.5.1(8.h/3): 4098, *note 8.5.2(6.a/3):
131601 4103, *note 8.5.3(6.b/3): 4108, *note 8.5.4(21.g/3): 4127, *note
131602 8.5.5(7.c/3): 4139, *note 8.6(34.w/3): 4177, *note 9.1(32.j/3): 4240,
131603 *note 9.4(35.h/3): 4320, *note 9.5(18.b/3): 4333, *note 9.5.2(37.e/3):
131604 4399, *note 9.5.4(20.b/3): 4443, *note 10.1.3(24.d/3): 4752, *note
131605 10.2.1(28.m/3): 4859, *note 11.1(8.c/3): 4885, *note 11.4.2(28.c/3):
131606 4979, *note 12.1(24.d/3): 5065, *note 12.3(29.j/3): 5125, *note
131607 12.4(12.i/3): 5157, *note 12.5(16.g/3): 5191, *note 12.5.1(28.j/3):
131608 5205, *note 12.6(24.e/3): 5254, *note 12.7(25.f/3): 5275, *note
131609 13.1.1(38.b/3): 5346, *note 13.2(9.d/3): 5351, *note 13.3(85.o/3): 5456,
131610 *note 13.11.1(5.d/3): 5663, *note 13.11.3(9.c/3): 5693, *note
131611 13.11.4(35.a/3): 5724, *note 13.11.5(10.f/3): 5727, *note
131612 13.12.1(13.c/3): 5772, *note 13.13.2(60.v/3): 5835, *note A.3.5(64.a/3):
131613 6219, *note A.3.6(1.a/3): 6221, *note A.4.7(48.g/3): 6474, *note
131614 A.4.8(51.b/3): 6517, *note A.4.9(12.d/3): 6526, *note A.4.10(22.a/3):
131615 6535, *note A.4.11(108.a/3): 6578, *note A.12.1(36.g/3): 7103, *note
131616 A.16.1(38.b/3): 7203, *note A.18.2(264.d/3): 7332, *note
131617 A.18.3(164.d/3): 7406, *note A.18.4(84.d/3): 7427, *note A.18.5(62.e/3):
131618 7482, *note A.18.6(95.f/3): 7543, *note A.18.7(105.d/3): 7566, *note
131619 A.18.8(88.e/3): 7641, *note A.18.9(116.e/3): 7722, *note
131620 A.18.10(233.c/3): 7808, *note A.18.17(7.a/3): 7822, *note
131621 A.18.18(74.b/3): 7849, *note A.18.19(17.a/3): 7852, *note
131622 A.18.20(20.a/3): 7856, *note A.18.21(22.a/3): 7861, *note
131623 A.18.22(19.a/3): 7865, *note A.18.23(21.a/3): 7870, *note
131624 A.18.24(18.a/3): 7874, *note A.18.25(20.a/3): 7877, *note
131625 A.18.26(13.b/3): 7885, *note A.18.27(17.b/3): 7893, *note
131626 A.18.28(12.c/3): 7900, *note A.18.29(13.a/3): 7907, *note
131627 A.18.30(17.c/3): 7915, *note A.18.31(14.a/3): 7923, *note A.19(12.a/3):
131628 7934, *note B.1(51.e/3): 7979, *note B.3.3(32.c/3): 8103, *note
131629 C.3.1(25.d/3): 8222, *note C.6(24.e/3): 8271, *note D.1(29.g/3): 8337,
131630 *note D.2.4(11.b/3): 8383, *note D.2.6(34.c/3): 8406, *note D.7(22.j/3):
131631 8520, *note D.10(12.b/3): 8566, *note D.10.1(15.a/3): 8571, *note
131632 D.14.3(7.a/3): 8649, *note D.16(14.a/3): 8670, *note D.16.1(33.a/3):
131633 8685, *note E.2.1(11.b/3): 8728, *note E.2.2(20.k/3): 8743, *note
131634 E.2.2(20.m/3): 8744, *note E.2.3(20.f/3): 8769, *note E.4.1(10.b/3):
131635 8805, *note J.15.9(6.a/3): 9261, *note J.15.10(5.a/3): 9265.
131636 extensions to Ada 83 *note 1.1.2(39.g): 1051, *note 2.1(19.b): 1218,
131637 *note 2.8(19.d): 1327, *note 2.8(29.a): 1337, *note 3.2.3(8.b): 1498,
131638 *note 3.3(26.a): 1540, *note 3.3.1(33.a): 1592, *note 3.3.2(10.a): 1604,
131639 *note 3.4(38.d): 1639, *note 3.5(63.b): 1765, *note 3.5.2(11.f): 1799,
131640 *note 3.5.4(36.a): 1861, *note 3.5.5(17.a): 1877, *note 3.5.9(28.b/3):
131641 1964, *note 3.6(30.a): 2035, *note 3.6.1(18.a): 2052, *note 3.6.3(8.e):
131642 2073, *note 3.7(37.a): 2116, *note 3.7.2(4.b/1): 2141, *note 3.8(31.a):
131643 2179, *note 3.8.1(29.a): 2205, *note 3.9(33.a): 2264, *note 3.9.1(17.a):
131644 2282, *note 3.9.2(24.a): 2317, *note 3.10(26.a): 2420, *note
131645 3.10.1(23.a): 2435, *note 3.10.2(41.a): 2484, *note 3.11(14.a/2): 2515,
131646 *note 4.1(17.a): 2557, *note 4.1.3(19.a): 2599, *note 4.1.4(16.a): 2619,
131647 *note 4.2(14.b): 2666, *note 4.3(6.b): 2681, *note 4.3.1(31.a): 2706,
131648 *note 4.3.2(13.a): 2725, *note 4.3.3(45.a): 2771, *note 4.4(15.a): 2913,
131649 *note 4.5.2(39.a): 2998, *note 4.5.3(14.d): 3027, *note 4.5.5(35.a):
131650 3059, *note 4.6(71.d): 3231, *note 4.8(20.b): 3298, *note 4.9(44.a):
131651 3325, *note 5.1(19.a): 3373, *note 5.2(28.a): 3395, *note 5.4(18.a):
131652 3419, *note 6.1(42.a): 3577, *note 6.2(13.a): 3638, *note 6.3(11.a):
131653 3649, *note 6.3.1(25.a): 3683, *note 6.4.1(18.a): 3737, *note 6.6(9.a):
131654 3798, *note 7.3(24.a): 3880, *note 7.4(14.a): 3907, *note 7.5(23.a):
131655 3916, *note 7.6(27.b): 3951, *note 8.2(12.b): 4008, *note 8.3(29.p):
131656 4048, *note 8.4(16.e): 4070, *note 8.5.5(7.a): 4138, *note 8.6(34.b):
131657 4172, *note 9.1(32.a/1): 4238, *note 9.4(35.a/3): 4317, *note
131658 9.5.2(37.a): 4398, *note 9.5.4(20.a): 4442, *note 9.6(40.b): 4483, *note
131659 9.7(4.a): 4532, *note 9.7.4(13.a): 4597, *note 10.1.1(35.n): 4694, *note
131660 10.1.2(31.a): 4718, *note 10.1.3(24.a): 4750, *note 10.1.4(10.b/2):
131661 4759, *note 10.2(34.d): 4809, *note 10.2.1(28.c): 4855, *note
131662 11.2(12.a): 4904, *note 11.4.1(19.x): 4950, *note 11.5(31.a): 5019,
131663 *note 12.1(24.a): 5064, *note 12.3(29.c): 5123, *note 12.4(12.b): 5155,
131664 *note 12.5.4(13.b): 5222, *note 12.7(25.a): 5272, *note 13.1(29.b/1):
131665 5322, *note 13.3(85.a): 5453, *note 13.4(14.a): 5468, *note 13.5.3(9.a):
131666 5527, *note 13.7(38.a.1/1): 5557, *note 13.8(14.a): 5582, *note
131667 13.9.2(13.d): 5613, *note 13.11(43.a): 5656, *note 13.12(17.b): 5748,
131668 *note 13.13(1.b): 5775, *note 13.14(20.e): 5870, *note A.1(56.d): 5898,
131669 *note A.2(4.e/3): 5901, *note A.3(1.a/3): 5902, *note A.4(1.a/3): 6222,
131670 *note A.5(5.b): 6583, *note A.5.3(72.g): 6748, *note A.5.4(4.c): 6758,
131671 *note A.6(1.b): 6762, *note A.9(11.a/3): 6845, *note A.10(11.a): 6859,
131672 *note A.10.1(86.b): 7016, *note A.11(5.a): 7060, *note A.15(22.b/3):
131673 7136, *note B(2.b): 7938, *note B.1(51.a): 7977, *note C(1.a): 8184,
131674 *note D(6.a): 8323, *note D.1(29.b): 8336, *note E(1.a): 8686, *note
131675 F(7.b): 8824, *note G(7.a): 8865, *note G.2(3.a): 8943, *note
131676 G.2.1(16.g): 8953, *note H(6.b): 9051, *note J.7(2.c): 9133, *note
131677 J.15.1(6.b/3): 9163.
131678 extensions to Ada 95 *note 1.1.2(39.s/2): 1057, *note 2.1(19.f/2):
131679 1219, *note 2.3(8.c/2): 1247, *note 3.2.2(15.d/2): 1489, *note
131680 3.3.1(33.g/2): 1594, *note 3.3.1(33.h/2): 1595, *note 3.4(38.i/2): 1640,
131681 *note 3.5(63.j/2): 1766, *note 3.5.2(11.l/2): 1801, *note 3.5.4(36.k/2):
131682 1862, *note 3.6(30.g/2): 2036, *note 3.6.3(8.h/2): 2075, *note
131683 3.8(31.e/2): 2180, *note 3.8(31.f/2): 2181, *note 3.9(33.e/2): 2267,
131684 *note 3.9.1(17.b/2): 2283, *note 3.9.2(24.c/2): 2319, *note
131685 3.9.3(16.d/2): 2336, *note 3.9.4(36.a/2): 2366, *note 3.10(26.f/2):
131686 2423, *note 3.10.1(23.j/2): 2437, *note 3.10.2(41.g/2): 2486, *note
131687 4.1.3(19.e/2): 2600, *note 4.2(14.d/2): 2667, *note 4.3(6.k/2): 2683,
131688 *note 4.3.1(31.c/2): 2707, *note 4.3.3(45.f/2): 2772, *note
131689 4.5.2(39.f/2): 2999, *note 4.6(71.l/2): 3233, *note 4.8(20.h/2): 3301,
131690 *note 5.1(19.d/2): 3374, *note 6.1(42.f/2): 3578, *note 6.4(31.d/2):
131691 3713, *note 6.5(28.i/2): 3781, *note 6.5.1(10.a/2): 3791, *note
131692 6.7(6.a/2): 3807, *note 7.3(24.d/2): 3881, *note 7.4(14.j/2): 3908,
131693 *note 7.5(23.c/2): 3917, *note 7.6(27.c/2): 3952, *note 8.3.1(16.b/2):
131694 4052, *note 8.5.1(8.d/2): 4096, *note 8.5.4(21.a/2): 4125, *note
131695 8.6(34.q/2): 4175, *note 9.1(32.e/2): 4239, *note 9.4(35.b/2): 4318,
131696 *note 9.6.1(91.b/2): 4525, *note 9.7.4(13.b/2): 4598, *note
131697 10.1.1(35.r/2): 4695, *note 10.1.2(31.g/2): 4720, *note 10.1.2(31.h/3):
131698 4721, *note 10.1.3(24.b/2): 4751, *note 10.2.1(28.g/2): 4857, *note
131699 11.3(7.b/2): 4912, *note 11.4.1(19.cc/2): 4953, *note 11.4.2(28.a/2):
131700 4977, *note 11.5(31.g/2): 5020, *note 12.3(29.i/2): 5124, *note
131701 12.4(12.e/2): 5156, *note 12.5.1(28.c/2): 5203, *note 12.5.5(7.a/2):
131702 5226, *note 12.6(24.a/2): 5252, *note 12.7(25.b/2): 5273, *note
131703 13.1(29.i/2): 5323, *note 13.5.1(31.e/2): 5501, *note 13.7(38.e/2):
131704 5558, *note 13.7.1(16.d/2): 5571, *note 13.11(43.e/2): 5658, *note
131705 13.12(17.c/3): 5749, *note 13.12.1(13.a/2): 5771, *note 13.13.1(11.b/2):
131706 5785, *note 13.13.2(60.i/2): 5833, *note A.1(56.h/2): 5899, *note
131707 A.3.1(7.b/2): 5906, *note A.3.2(60.c/2): 5945, *note A.3.4(35.a/2):
131708 6197, *note A.4.2(67.a/2): 6261, *note A.4.5(88.d/2): 6415, *note
131709 A.4.6(8.b/2): 6432, *note A.4.7(48.b/2): 6473, *note A.4.8(51.a/2):
131710 6516, *note A.4.9(12.c/2): 6525, *note A.5(5.c/2): 6584, *note
131711 A.5.3(72.i/2): 6749, *note A.10.7(26.b/2): 7026, *note A.10.11(29.a/2):
131712 7039, *note A.10.12(29.a/2): 7049, *note A.11(5.b/2): 7061, *note
131713 A.12.4(5.a/2): 7113, *note A.16(131.c/2): 7188, *note A.17(33.b/2):
131714 7215, *note A.18(5.w/3): 7224, *note A.18.1(8.c/2): 7229, *note
131715 A.18.2(264.b/2): 7330, *note A.18.3(164.a/2): 7403, *note
131716 A.18.5(62.c/2): 7480, *note A.18.6(95.d/2): 7541, *note A.18.8(88.c/2):
131717 7639, *note A.18.9(116.c/2): 7720, *note A.18.11(8.a/2): 7810, *note
131718 A.18.12(7.a/2): 7812, *note A.18.13(8.a/2): 7814, *note A.18.14(8.a/2):
131719 7816, *note A.18.15(4.a/2): 7818, *note A.18.16(4.a/2): 7820, *note
131720 A.18.26(13.a/2): 7884, *note B.3(84.b/2): 8050, *note B.3.1(60.b/2):
131721 8075, *note B.3.3(32.a/2): 8101, *note C.7.3(17.a/2): 8320, *note
131722 D.2.2(22.a/2): 8368, *note D.2.4(11.a/2): 8382, *note D.2.5(19.a/2):
131723 8392, *note D.2.6(34.b/2): 8405, *note D.3(23.a/2): 8428, *note
131724 D.5.1(19.a/2): 8449, *note D.5.2(11.a/2): 8453, *note D.7(22.b/2): 8518,
131725 *note D.10(12.a/2): 8565, *note D.11(19.a/2): 8582, *note D.13(10.a/3):
131726 8584, *note D.14(29.b/2): 8601, *note D.14.1(29.a/2): 8618, *note
131727 D.14.2(38.a/2): 8644, *note D.15(27.a/2): 8662, *note E.2.2(20.c/3):
131728 8741, *note F.3.5(6.a/2): 8863, *note G.1.1(58.g/2): 8893, *note
131729 G.1.3(35.a/2): 8934, *note G.1.5(1.a/2): 8939, *note G.3(1.c/3): 8987,
131730 *note G.3.1(91.b/2): 9004, *note G.3.2(161.b/2): 9045, *note
131731 H.4(28.c/2): 9105, *note H.4(28.h/3): 9106, *note H.5(7.a/2): 9111,
131732 *note H.6(17.a/2): 9118, *note J.15.1(6.c/3): 9164.
131733 external call *note 9.5(4/3): 4325.
131734 external effect
131735 of the execution of an Ada program *note 1.1.3(8): 1067.
131736 volatile/atomic objects *note C.6(20): 8268.
131737 external file *note A.7(1): 6763.
131738 external interaction *note 1.1.3(8): 1069.
131739 external name *note B.1(34): 7968.
131740 external requeue *note 9.5(7): 4328.
131741 external streaming
131742 type supports *note 13.13.2(52/3): 5830.
131743 External_Name aspect *note B.1(1/3): 7948.
131744 External_Tag
131745 in Ada.Tags *note 3.9(7/2): 2235.
131746 External_Tag aspect *note 13.3(75/3): 5452, *note K.2(65): 9296.
131747 External_Tag attribute *note 13.3(75/3): 5448.
131748 External_Tag clause *note 13.3(7/2): 5373, *note 13.3(75/3): 5449,
131749 *note K.2(65): 9293.
131750 extra permission to avoid raising exceptions *note 11.6(5): 5028.
131751 extra permission to reorder actions *note 11.6(6/3): 5030.
131752
131753
131754 \1f
131755 File: aarm2012.info, Node: F, Next: G, Prev: E, Up: Index
131756
131757 F
131758 ==
131759
131760
131761
131762 factor *note 4.4(6): 2895.
131763 used *note 4.4(5): 2892, *note P: 9935.
131764 factory *note 3.9(30/2): 2262.
131765 failure
131766 of a language-defined check *note 11.5(2/3): 4986.
131767 in Ada.Command_Line *note A.15(8): 7133.
131768 fall-back handler *note C.7.3(9/2): 8314.
131769 False *note 3.5.3(1): 1804.
131770 family
131771 entry *note 9.5.2(20): 4385.
131772 Feminine_Ordinal_Indicator
131773 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6090.
131774 FF
131775 in Ada.Characters.Latin_1 *note A.3.3(5): 5961.
131776 Field subtype of Integer
131777 in Ada.Text_IO *note A.10.1(6): 6866.
131778 FIFO_Queuing queuing policy *note D.4(7/2): 8439.
131779 FIFO_Within_Priorities task dispatching policy *note D.2.3(2/2): 8370.
131780 file
131781 as file object *note A.7(2/3): 6766.
131782 file name *note A.16(46/2): 7181.
131783 file terminator *note A.10(7): 6851.
131784 File_Access
131785 in Ada.Text_IO *note A.10.1(18): 6888.
131786 File_Kind
131787 in Ada.Directories *note A.16(22/2): 7155.
131788 File_Mode
131789 in Ada.Direct_IO *note A.8.4(4): 6809.
131790 in Ada.Sequential_IO *note A.8.1(4): 6783.
131791 in Ada.Streams.Stream_IO *note A.12.1(6): 7068.
131792 in Ada.Text_IO *note A.10.1(4): 6862.
131793 File_Size
131794 in Ada.Directories *note A.16(23/2): 7156.
131795 File_Type
131796 in Ada.Direct_IO *note A.8.4(3): 6808.
131797 in Ada.Sequential_IO *note A.8.1(3): 6782.
131798 in Ada.Streams.Stream_IO *note A.12.1(5): 7067.
131799 in Ada.Text_IO *note A.10.1(3): 6861.
131800 Filter_Type
131801 in Ada.Directories *note A.16(30/2): 7162.
131802 finalization
131803 of a master *note 7.6.1(4): 3965.
131804 of a protected object *note 9.4(20): 4314.
131805 of a protected object *note C.3.1(12/3): 8217.
131806 of a task object *note J.7.1(8): 9140.
131807 of an object *note 7.6.1(5): 3966.
131808 of environment task for a foreign language main subprogram *note
131809 B.1(39/3): 7976.
131810 child of Ada *note 7.6(4/3): 3927.
131811 Finalize *note 7.6(2): 3925.
131812 in Ada.Finalization *note 7.6(6/2): 3931, *note 7.6(8/2): 3934.
131813 Find
131814 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(41/2): 7379.
131815 in Ada.Containers.Hashed_Maps *note A.18.5(30/2): 7464.
131816 in Ada.Containers.Hashed_Sets *note A.18.8(43/2): 7608, *note
131817 A.18.8(56/2): 7620.
131818 in Ada.Containers.Multiway_Trees *note A.18.10(38/3): 7763.
131819 in Ada.Containers.Ordered_Maps *note A.18.6(38/2): 7527.
131820 in Ada.Containers.Ordered_Sets *note A.18.9(49/2): 7689, *note
131821 A.18.9(69/2): 7702.
131822 in Ada.Containers.Vectors *note A.18.2(68/2): 7303.
131823 Find_In_Subtree
131824 in Ada.Containers.Multiway_Trees *note A.18.10(39/3): 7764.
131825 Find_Index
131826 in Ada.Containers.Vectors *note A.18.2(67/2): 7302.
131827 Find_Token
131828 in Ada.Strings.Bounded *note A.4.4(50.1/3): 6334, *note A.4.4(51):
131829 6335.
131830 in Ada.Strings.Fixed *note A.4.3(15.1/3): 6275, *note A.4.3(16):
131831 6276.
131832 in Ada.Strings.Unbounded *note A.4.5(45.1/3): 6391, *note
131833 A.4.5(46): 6392.
131834 Fine_Delta
131835 in System *note 13.7(9): 5540.
131836 First
131837 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(33/2): 7371.
131838 in Ada.Containers.Hashed_Maps *note A.18.5(27/2): 7461.
131839 in Ada.Containers.Hashed_Sets *note A.18.8(40/2): 7605.
131840 in Ada.Containers.Ordered_Maps *note A.18.6(28/2): 7517.
131841 in Ada.Containers.Ordered_Sets *note A.18.9(41/2): 7681.
131842 in Ada.Containers.Vectors *note A.18.2(58/2): 7293.
131843 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3441.
131844 First attribute *note 3.5(12): 1694, *note 3.6.2(3): 2054.
131845 first element
131846 of a hashed set *note A.18.8(68/2): 7633.
131847 of a set *note A.18.7(6/2): 7549.
131848 of an ordered set *note A.18.9(81/3): 7715.
131849 first node
131850 of a hashed map *note A.18.5(46/2): 7476.
131851 of a map *note A.18.4(6/2): 7413.
131852 of an ordered map *note A.18.6(58/3): 7537.
131853 first subtype *note 3.2.1(6): 1449, *note 3.4.1(5): 1648.
131854 First(N) attribute *note 3.6.2(4): 2056.
131855 first_bit *note 13.5.1(5): 5490.
131856 used *note 13.5.1(3): 5486, *note P: 10454.
131857 First_Bit attribute *note 13.5.2(3/2): 5506.
131858 First_Child
131859 in Ada.Containers.Multiway_Trees *note A.18.10(60/3): 7785.
131860 First_Child_Element
131861 in Ada.Containers.Multiway_Trees *note A.18.10(61/3): 7786.
131862 First_Element
131863 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(34/2): 7372.
131864 in Ada.Containers.Ordered_Maps *note A.18.6(29/2): 7518.
131865 in Ada.Containers.Ordered_Sets *note A.18.9(42/2): 7682.
131866 in Ada.Containers.Vectors *note A.18.2(59/2): 7294.
131867 First_Index
131868 in Ada.Containers.Vectors *note A.18.2(57/2): 7292.
131869 First_Key
131870 in Ada.Containers.Ordered_Maps *note A.18.6(30/2): 7519.
131871 First_Valid attribute *note 3.5.5(7.2/3): 1872.
131872 Fixed
131873 child of Ada.Strings *note A.4.3(5): 6262.
131874 fixed point type *note 3.5.9(1): 1922.
131875 Fixed_IO
131876 in Ada.Text_IO *note A.10.1(68): 6977.
131877 fixed_point_definition *note 3.5.9(2): 1926.
131878 used *note 3.5.6(2): 1882, *note P: 9725.
131879 Float *note 3.5.7(12): 1911, *note 3.5.7(14): 1913.
131880 in Standard *note A.1(21): 5883.
131881 Float_IO
131882 in Ada.Text_IO *note A.10.1(63): 6967.
131883 Float_Random
131884 child of Ada.Numerics *note A.5.2(5): 6622.
131885 Float_Text_IO
131886 child of Ada *note A.10.9(33): 7029.
131887 Float_Wide_Text_IO
131888 child of Ada *note A.11(2/2): 7052.
131889 Float_Wide_Wide_Text_IO
131890 child of Ada *note A.11(3/2): 7055.
131891 Floating
131892 in Interfaces.COBOL *note B.4(9): 8107.
131893 floating point type *note 3.5.7(1): 1889.
131894 floating_point_definition *note 3.5.7(2): 1890.
131895 used *note 3.5.6(2): 1881, *note P: 9724.
131896 Floor
131897 in Ada.Containers.Ordered_Maps *note A.18.6(40/2): 7529.
131898 in Ada.Containers.Ordered_Sets *note A.18.9(50/2): 7690, *note
131899 A.18.9(70/2): 7703.
131900 Floor attribute *note A.5.3(30): 6695.
131901 Flush
131902 in Ada.Streams.Stream_IO *note A.12.1(25/1): 7091.
131903 in Ada.Text_IO *note A.10.1(21/1): 6895.
131904 Fore attribute *note 3.5.10(4): 1974.
131905 form
131906 of an external file *note A.7(1): 6765.
131907 in Ada.Direct_IO *note A.8.4(9): 6820.
131908 in Ada.Sequential_IO *note A.8.1(9): 6792.
131909 in Ada.Streams.Stream_IO *note A.12.1(11): 7079.
131910 in Ada.Text_IO *note A.10.1(12): 6877.
131911 formal object, generic *note 12.4(1): 5127.
131912 formal package, generic *note 12.7(1): 5256.
131913 formal parameter
131914 of a subprogram *note 6.1(17): 3561.
131915 formal subprogram, generic *note 12.6(1): 5228.
131916 formal subtype *note 12.5(5): 5188.
131917 formal type *note 12.5(5): 5186.
131918 formal_abstract_subprogram_declaration *note 12.6(2.2/3): 5236.
131919 used *note 12.6(2/2): 5231, *note P: 10406.
131920 formal_access_type_definition *note 12.5.4(2): 5217.
131921 used *note 12.5(3/2): 5179, *note P: 10398.
131922 formal_array_type_definition *note 12.5.3(2): 5212.
131923 used *note 12.5(3/2): 5178, *note P: 10397.
131924 formal_complete_type_declaration *note 12.5(2.1/3): 5161.
131925 used *note 12.5(2/3): 5159, *note P: 10381.
131926 formal_concrete_subprogram_declaration *note 12.6(2.1/3): 5232.
131927 used *note 12.6(2/2): 5230, *note P: 10405.
131928 formal_decimal_fixed_point_definition *note 12.5.2(7): 5211.
131929 used *note 12.5(3/2): 5177, *note P: 10396.
131930 formal_derived_type_definition *note 12.5.1(3/2): 5193.
131931 used *note 12.5(3/2): 5171, *note P: 10390.
131932 formal_discrete_type_definition *note 12.5.2(2): 5206.
131933 used *note 12.5(3/2): 5172, *note P: 10391.
131934 formal_floating_point_definition *note 12.5.2(5): 5209.
131935 used *note 12.5(3/2): 5175, *note P: 10394.
131936 formal_incomplete_type_declaration *note 12.5(2.2/3): 5166.
131937 used *note 12.5(2/3): 5160, *note P: 10382.
131938 formal_interface_type_definition *note 12.5.5(2/2): 5224.
131939 used *note 12.5(3/2): 5180, *note P: 10399.
131940 formal_modular_type_definition *note 12.5.2(4): 5208.
131941 used *note 12.5(3/2): 5174, *note P: 10393.
131942 formal_object_declaration *note 12.4(2/3): 5128.
131943 used *note 12.1(6): 5054, *note P: 10342.
131944 formal_ordinary_fixed_point_definition *note 12.5.2(6): 5210.
131945 used *note 12.5(3/2): 5176, *note P: 10395.
131946 formal_package_actual_part *note 12.7(3/2): 5262.
131947 used *note 12.7(2/3): 5260, *note P: 10417.
131948 formal_package_association *note 12.7(3.1/2): 5266.
131949 used *note 12.7(3/2): 5265, *note P: 10420.
131950 formal_package_declaration *note 12.7(2/3): 5257.
131951 used *note 12.1(6): 5057, *note P: 10345.
131952 formal_part *note 6.1(14): 3548.
131953 used *note 6.1(12): 3541, *note 6.1(13/2): 3543, *note P: 10063.
131954 formal_private_type_definition *note 12.5.1(2): 5192.
131955 used *note 12.5(3/2): 5170, *note P: 10389.
131956 formal_signed_integer_type_definition *note 12.5.2(3): 5207.
131957 used *note 12.5(3/2): 5173, *note P: 10392.
131958 formal_subprogram_declaration *note 12.6(2/2): 5229.
131959 used *note 12.1(6): 5056, *note P: 10344.
131960 formal_type_declaration *note 12.5(2/3): 5158.
131961 used *note 12.1(6): 5055, *note P: 10343.
131962 formal_type_definition *note 12.5(3/2): 5169.
131963 used *note 12.5(2.1/3): 5164, *note P: 10385.
131964 format_effector *note 2.1(13/3): 1182.
131965 Formatting
131966 child of Ada.Calendar *note 9.6.1(15/2): 4493.
131967 Fortran
131968 child of Interfaces *note B.5(4): 8160.
131969 Fortran interface *note B.5(1/3): 8159.
131970 Fortran standard *note 1.2(3/2): 1118.
131971 Fortran_Character
131972 in Interfaces.Fortran *note B.5(12/3): 8171.
131973 Fortran_Integer
131974 in Interfaces.Fortran *note B.5(5): 8161.
131975 forward iterator *note 5.5.2(4/3): 3482.
131976 Forward_Iterator
131977 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3440.
131978 Fraction attribute *note A.5.3(21): 6683.
131979 Fraction_One_Half
131980 in Ada.Characters.Latin_1 *note A.3.3(22): 6111.
131981 Fraction_One_Quarter
131982 in Ada.Characters.Latin_1 *note A.3.3(22): 6110.
131983 Fraction_Three_Quarters
131984 in Ada.Characters.Latin_1 *note A.3.3(22): 6112.
131985 Free
131986 in Ada.Strings.Unbounded *note A.4.5(7): 6367.
131987 in Interfaces.C.Strings *note B.3.1(11): 8060.
131988 freed
131989 See nonexistent *note 13.11.2(10/2): 5671.
131990 freeing storage *note 13.11.2(1): 5668.
131991 freezing
131992 by a constituent of a construct *note 13.14(4/1): 5842.
131993 by an expression *note 13.14(8/3): 5846.
131994 by an implicit call *note 13.14(8.1/3): 5848.
131995 by an object name *note 13.14(8/3): 5847.
131996 class-wide type caused by the freezing of the specific type *note
131997 13.14(15): 5865.
131998 constituents of a full type definition *note 13.14(15): 5863.
131999 designated subtype caused by an allocator *note 13.14(13): 5860.
132000 entity *note 13.14(2): 5836.
132001 entity caused by a body *note 13.14(3/3): 5840.
132002 entity caused by a construct *note 13.14(4/1): 5841.
132003 entity caused by a name *note 13.14(11): 5856.
132004 entity caused by the end of an enclosing construct *note
132005 13.14(3/3): 5839.
132006 expression of an expression function by a call *note 13.14(10.1/3):
132007 5852.
132008 expression of an expression function by Access attribute *note
132009 13.14(10.3/3): 5855.
132010 expression of an expression function by an instantiation *note
132011 13.14(10.2/3): 5854.
132012 first subtype caused by the freezing of the type *note 13.14(15):
132013 5864.
132014 generic_instantiation *note 13.14(5/3): 5843.
132015 nominal subtype caused by a name *note 13.14(11): 5857.
132016 object_declaration *note 13.14(6): 5844.
132017 profile *note 13.14(2.1/3): 5838.
132018 profile of a callable entity by an instantiation *note
132019 13.14(10.2/3): 5853.
132020 profile of a function call *note 13.14(10.1/3): 5851.
132021 specific type caused by the freezing of the class-wide type *note
132022 13.14(15): 5866.
132023 subtype caused by a record extension *note 13.14(7): 5845.
132024 subtype caused by an implicit conversion *note 13.14(8.2/1): 5849.
132025 subtype caused by an implicit dereference *note 13.14(11.1/1):
132026 5858.
132027 subtypes of the profile of a callable entity *note 13.14(14/3):
132028 5861.
132029 type caused by a range *note 13.14(12): 5859.
132030 type caused by an expression *note 13.14(10): 5850.
132031 type caused by the freezing of a subtype *note 13.14(15): 5862.
132032 freezing points
132033 entity *note 13.14(2): 5837.
132034 Friday
132035 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4499.
132036 FS
132037 in Ada.Characters.Latin_1 *note A.3.3(6): 5977.
132038 full conformance
132039 for discrete_subtype_definitions *note 6.3.1(24): 3681.
132040 for expressions *note 6.3.1(19): 3678.
132041 for known_discriminant_parts *note 6.3.1(23): 3679.
132042 for profiles *note 6.3.1(18/3): 3676.
132043 required *note 3.10.1(4/3): 2432, *note 6.3(4): 3646, *note
132044 6.7(2.1/3): 3803, *note 6.8(4/3): 3815, *note 7.3(9): 3871, *note
132045 8.3(12.3/2): 4027, *note 8.5.4(5/3): 4119, *note 9.5.2(14): 4379, *note
132046 9.5.2(16): 4383, *note 9.5.2(17): 4384, *note 10.1.3(11): 4747, *note
132047 10.1.3(12): 4748.
132048 full constant declaration *note 3.3.1(6/3): 1569.
132049 corresponding to a formal object of mode in *note 12.4(10/2): 5148.
132050 full declaration *note 7.4(2/3): 3905.
132051 full name
132052 of a file *note A.16(47/2): 7182.
132053 full stop *note 2.1(15/3): 1201.
132054 full type *note 3.2.1(8/2): 1453.
132055 full type definition *note 3.2.1(8/2): 1454.
132056 full view
132057 of a type *note 3.2.1(8/2): 1455.
132058 Full_Name
132059 in Ada.Directories *note A.16(15/2): 7147, *note A.16(39/2): 7169.
132060 Full_Stop
132061 in Ada.Characters.Latin_1 *note A.3.3(8): 5996.
132062 full_type_declaration *note 3.2.1(3/3): 1433.
132063 used *note 3.2.1(2): 1429, *note P: 9657.
132064 function *note 6(1): 3509, *note N(19.1/2): 9547.
132065 expression *note 6.8(6/3): 3817.
132066 with a controlling access result *note 3.9.2(2/3): 2304.
132067 with a controlling result *note 3.9.2(2/3): 2302.
132068 function call
132069 master of *note 3.10.2(10.1/3): 2454.
132070 function instance *note 12.3(13): 5112.
132071 function_call *note 6.4(3): 3693.
132072 used *note 4.1(2/3): 2530, *note P: 9837.
132073 function_specification *note 6.1(4.2/2): 3523.
132074 used *note 6.1(4/2): 3519, *note 6.8(2/3): 3811, *note P: 10048.
132075
132076
132077 \1f
132078 File: aarm2012.info, Node: G, Next: H, Prev: F, Up: Index
132079
132080 G
132081 ==
132082
132083
132084
132085 gaps *note 13.3(52.d/2): 5425.
132086 general access type *note 3.10(7/1): 2395, *note 3.10(8): 2399.
132087 general_access_modifier *note 3.10(4): 2380.
132088 used *note 3.10(3): 2378, *note P: 9806.
132089 generalized iterator *note 5.5.2(3/3): 3472.
132090 generalized_indexing *note 4.1.6(10/3): 2640.
132091 used *note 4.1(2/3): 2534, *note P: 9841.
132092 generalized_reference *note 4.1.5(4/3): 2625.
132093 used *note 4.1(2/3): 2533, *note P: 9840.
132094 generation
132095 of an interrupt *note C.3(2): 8194.
132096 Generator
132097 in Ada.Numerics.Discrete_Random *note A.5.2(19): 6636.
132098 in Ada.Numerics.Float_Random *note A.5.2(7): 6623.
132099 generic actual *note 12.3(7/3): 5102.
132100 generic actual parameter *note 12.3(7/3): 5101.
132101 generic actual subtype *note 12.5(4): 5181.
132102 generic actual type *note 12.5(4): 5183.
132103 generic body *note 12.2(1): 5066.
132104 generic contract issue *note 10.2.1(10/2): 4820, *note 12.3(11.y):
132105 5106.
132106 [partial] *note 3.2.4(29/3): 1513, *note 3.4(5.1/3): 1616, *note
132107 3.7(10/3): 2101, *note 3.7.1(7/3): 2131, *note 3.9.1(3/2): 2278, *note
132108 3.9.4(17/2): 2365, *note 3.10.2(28.1/3): 2468, *note 3.10.2(32/3): 2476,
132109 *note 4.1.6(9/3): 2639, *note 4.5.2(9.8/3): 2988, *note 4.6(24.17/3):
132110 3162, *note 4.6(24.21/2): 3169, *note 4.8(5.6/3): 3266, *note 4.9(37/2):
132111 3324, *note 6.3.1(17.a): 3675, *note 6.5.1(6/2): 3789, *note 7.3(8):
132112 3870, *note 8.3(26/2): 4046, *note 8.3.1(7/2): 4051, *note 8.5.1(4.6/2):
132113 4093, *note 8.5.1(5/3): 4094, *note 8.5.4(4.3/2): 4118, *note
132114 9.1(9.9/2): 4232, *note 9.4(11.13/2): 4307, *note 9.4(11.8/2): 4306,
132115 *note 9.5(17/3): 4332, *note 9.5.2(13.4/2): 4378, *note 10.2.1(11.7/3):
132116 4827, *note 10.2.1(11/3): 4824, *note 10.2.1(17/3): 4837, *note
132117 12.4(8.5/2): 5145, *note 12.6(8.3/2): 5248, *note 13.11.2(3.1/3): 5670,
132118 *note 13.11.4(23/3): 5715, *note B.3.3(10/3): 8098, *note C.3.1(7/3):
132119 8207, *note J.15.7(7/3): 9225.
132120 generic contract model *note 12.3(1.a/3): 5069.
132121 generic contract/private type contract analogy *note 7.3(19.a): 3879.
132122 generic formal *note 12.1(9): 5062.
132123 generic formal object *note 12.4(1): 5126.
132124 generic formal package *note 12.7(1): 5255.
132125 generic formal subprogram *note 12.6(1): 5227.
132126 generic formal subtype *note 12.5(5): 5187.
132127 generic formal type *note 12.5(5): 5185.
132128 generic function *note 12.1(8/2): 5061.
132129 generic package *note 12.1(8/2): 5058.
132130 generic procedure *note 12.1(8/2): 5060.
132131 generic subprogram *note 12.1(8/2): 5059.
132132 generic unit *note 12(1): 5035, *note N(20): 9548.
132133 See also dispatching operation *note 3.9(1): 2211.
132134 generic_actual_part *note 12.3(3): 5086.
132135 used *note 12.3(2/3): 5079, *note 12.7(3/2): 5263, *note P: 10348.
132136 Generic_Array_Sort
132137 child of Ada.Containers *note A.18.26(3/2): 7878.
132138 generic_association *note 12.3(4): 5089.
132139 used *note 12.3(3): 5087, *note 12.7(3.1/2): 5267, *note P: 10361.
132140 Generic_Bounded_Length
132141 in Ada.Strings.Bounded *note A.4.4(4): 6301.
132142 Generic_Complex_Arrays
132143 child of Ada.Numerics *note G.3.2(2/2): 9005.
132144 Generic_Complex_Elementary_Functions
132145 child of Ada.Numerics *note G.1.2(2/2): 8894.
132146 Generic_Complex_Types
132147 child of Ada.Numerics *note G.1.1(2/1): 8866.
132148 Generic_Constrained_Array_Sort
132149 child of Ada.Containers *note A.18.26(7/2): 7880.
132150 generic_declaration *note 12.1(2): 5040.
132151 used *note 3.1(3/3): 1356, *note 10.1.1(5): 4662, *note P: 9654.
132152 Generic_Dispatching_Constructor
132153 child of Ada.Tags *note 3.9(18.2/3): 2254.
132154 Generic_Elementary_Functions
132155 child of Ada.Numerics *note A.5.1(3): 6585.
132156 generic_formal_parameter_declaration *note 12.1(6): 5053.
132157 used *note 12.1(5): 5051, *note P: 10340.
132158 generic_formal_part *note 12.1(5): 5050.
132159 used *note 12.1(3/3): 5044, *note 12.1(4): 5048, *note P: 10338.
132160 generic_instantiation *note 12.3(2/3): 5071.
132161 used *note 3.1(3/3): 1357, *note 10.1.1(5): 4663, *note P: 10289.
132162 Generic_Keys
132163 in Ada.Containers.Hashed_Sets *note A.18.8(50/2): 7614.
132164 in Ada.Containers.Ordered_Sets *note A.18.9(62/2): 7695.
132165 generic_package_declaration *note 12.1(4): 5047.
132166 used *note 12.1(2): 5042, *note P: 10334.
132167 Generic_Real_Arrays
132168 child of Ada.Numerics *note G.3.1(2/2): 8988.
132169 generic_renaming_declaration *note 8.5.5(2/3): 4128.
132170 used *note 8.5(2): 4077, *note 10.1.1(6): 4666, *note P: 10291.
132171 Generic_Sort
132172 child of Ada.Containers *note A.18.26(9.2/3): 7882.
132173 Generic_Sorting
132174 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(47/2): 7384.
132175 in Ada.Containers.Vectors *note A.18.2(75/2): 7309.
132176 generic_subprogram_declaration *note 12.1(3/3): 5043.
132177 used *note 12.1(2): 5041, *note P: 10333.
132178 Get
132179 in Ada.Text_IO *note A.10.1(41): 6929, *note A.10.1(47): 6940,
132180 *note A.10.1(54): 6952, *note A.10.1(55): 6956, *note A.10.1(59): 6962,
132181 *note A.10.1(60): 6965, *note A.10.1(65): 6971, *note A.10.1(67): 6975,
132182 *note A.10.1(70): 6981, *note A.10.1(72): 6985, *note A.10.1(75): 6992,
132183 *note A.10.1(77): 6995, *note A.10.1(81): 7001, *note A.10.1(83): 7004.
132184 in Ada.Text_IO.Complex_IO *note G.1.3(6): 8928, *note G.1.3(8):
132185 8931.
132186 Get_CPU
132187 in Ada.Interrupts *note C.3.2(10.1/3): 8234.
132188 in System.Multiprocessors.Dispatching_Domains *note D.16.1(13/3):
132189 8681.
132190 Get_Deadline
132191 in Ada.Dispatching.EDF *note D.2.6(9/2): 8400.
132192 Get_Dispatching_Domain
132193 in System.Multiprocessors.Dispatching_Domains *note D.16.1(10/3):
132194 8678.
132195 Get_First_CPU
132196 in System.Multiprocessors.Dispatching_Domains *note D.16.1(8/3):
132197 8676.
132198 Get_Immediate
132199 in Ada.Text_IO *note A.10.1(44): 6936, *note A.10.1(45): 6937.
132200 Get_Last_CPU
132201 in System.Multiprocessors.Dispatching_Domains *note D.16.1(9/3):
132202 8677.
132203 Get_Line
132204 in Ada.Text_IO *note A.10.1(49): 6943, *note A.10.1(49.1/2): 6946.
132205 in Ada.Text_IO.Bounded_IO *note A.10.11(8/2): 7035, *note
132206 A.10.11(9/2): 7036, *note A.10.11(10/2): 7037, *note A.10.11(11/2):
132207 7038.
132208 in Ada.Text_IO.Unbounded_IO *note A.10.12(8/2): 7045, *note
132209 A.10.12(9/2): 7046, *note A.10.12(10/2): 7047, *note A.10.12(11/2):
132210 7048.
132211 Get_Next_Entry
132212 in Ada.Directories *note A.16(35/2): 7167.
132213 Get_Priority
132214 in Ada.Dynamic_Priorities *note D.5.1(5): 8445.
132215 global to *note 8.1(15): 3995.
132216 Glossary *note N(1/2): 9513.
132217 glyphs *note 2.1(15.a/3): 1217.
132218 goto_statement *note 5.8(2): 3503.
132219 used *note 5.1(4/2): 3348, *note P: 9993.
132220 govern a variant *note 3.8.1(20): 2203.
132221 govern a variant_part *note 3.8.1(20): 2202.
132222 grammar
132223 ambiguous *note 1.1.4(14.a): 1085.
132224 complete listing *note P: 9592.
132225 cross reference *note P: 10472.
132226 notation *note 1.1.4(3): 1077.
132227 resolution of ambiguity *note 1.1.4(14.a): 1084, *note 8.6(3):
132228 4142.
132229 under Syntax heading *note 1.1.2(25): 1014.
132230 graphic character
132231 a category of Character *note A.3.2(23): 5936.
132232 graphic symbols *note 2.1(15.a/3): 1216.
132233 graphic_character *note 2.1(14/3): 1187.
132234 used *note 2.5(2): 1293, *note 2.6(3): 1298, *note P: 9628.
132235 Graphic_Set
132236 in Ada.Strings.Maps.Constants *note A.4.6(4): 6419.
132237 Grave
132238 in Ada.Characters.Latin_1 *note A.3.3(13): 6010.
132239 greater than operator *note 4.4(1/3): 2801, *note 4.5.2(1): 2976.
132240 greater than or equal operator *note 4.4(1/3): 2805, *note 4.5.2(1):
132241 2980.
132242 greater-than sign *note 2.1(15/3): 1210.
132243 Greater_Than_Sign
132244 in Ada.Characters.Latin_1 *note A.3.3(10): 6002.
132245 Group_Budget
132246 in Ada.Execution_Time.Group_Budgets *note D.14.2(4/3): 8620.
132247 Group_Budget_Error
132248 in Ada.Execution_Time.Group_Budgets *note D.14.2(11/2): 8636.
132249 Group_Budget_Handler
132250 in Ada.Execution_Time.Group_Budgets *note D.14.2(5/2): 8621.
132251 Group_Budgets
132252 child of Ada.Execution_Time *note D.14.2(3/3): 8619.
132253 GS
132254 in Ada.Characters.Latin_1 *note A.3.3(6): 5978.
132255 guard *note 9.7.1(3): 4540.
132256 used *note 9.7.1(2): 4535, *note P: 10248.
132257
132258
132259 \1f
132260 File: aarm2012.info, Node: H, Next: I, Prev: G, Up: Index
132261
132262 H
132263 ==
132264
132265
132266
132267 handle
132268 an exception *note 11(1/3): 4867, *note N(18): 9543.
132269 an exception occurrence *note 11(1.a): 4868.
132270 an exception occurrence *note 11.4(1): 4913, *note 11.4(7): 4924.
132271 subpool *note 13.11.4(18/3): 5710.
132272 handled_sequence_of_statements *note 11.2(2): 4886.
132273 used *note 5.6(2): 3495, *note 6.3(2/3): 3644, *note 6.5(2.2/3):
132274 3749, *note 7.2(2/3): 3846, *note 9.1(6/3): 4221, *note 9.5.2(3): 4357,
132275 *note 9.5.2(5): 4366, *note P: 10039.
132276 handler *note 11.2(5.a): 4899.
132277 execution timer *note D.14.1(13/2): 8615.
132278 group budget *note D.14.2(14/2): 8640.
132279 interrupt *note C.3(2): 8201.
132280 termination *note C.7.3(8/3): 8313.
132281 timing event *note D.15(10/2): 8661.
132282 Handling
132283 child of Ada.Characters *note A.3.2(2/2): 5907.
132284 child of Ada.Wide_Characters *note A.3.5(3/3): 6198.
132285 child of Ada.Wide_Wide_Characters *note A.3.6(1/3): 6220.
132286 Has_Element
132287 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9.1/3): 7342.
132288 in Ada.Containers.Hashed_Maps *note A.18.5(6.1/3): 7433.
132289 in Ada.Containers.Hashed_Sets *note A.18.8(6.1/3): 7572.
132290 in Ada.Containers.Multiway_Trees *note A.18.10(12/3): 7738.
132291 in Ada.Containers.Ordered_Maps *note A.18.6(7.1/3): 7489.
132292 in Ada.Containers.Ordered_Sets *note A.18.9(7.1/3): 7648.
132293 in Ada.Containers.Vectors *note A.18.2(11.1/3): 7243.
132294 Has_Same_Storage attribute *note 13.3(73.2/3): 5444.
132295 Hash
132296 child of Ada.Strings *note A.4.9(2/3): 6518.
132297 child of Ada.Strings.Bounded *note A.4.9(7/3): 6519.
132298 child of Ada.Strings.Unbounded *note A.4.9(10/3): 6520.
132299 Hash_Case_Insensitive
132300 child of Ada.Strings *note A.4.9(11.2/3): 6521.
132301 child of Ada.Strings.Bounded *note A.4.9(11.7/3): 6523.
132302 child of Ada.Strings.Fixed *note A.4.9(11.5/3): 6522.
132303 child of Ada.Strings.Unbounded *note A.4.9(11.10/3): 6524.
132304 Hash_Type
132305 in Ada.Containers *note A.18.1(4/2): 7226.
132306 Hashed_Maps
132307 child of Ada.Containers *note A.18.5(2/3): 7428.
132308 Hashed_Sets
132309 child of Ada.Containers *note A.18.8(2/3): 7567.
132310 Head
132311 in Ada.Strings.Bounded *note A.4.4(70): 6352, *note A.4.4(71):
132312 6353.
132313 in Ada.Strings.Fixed *note A.4.3(35): 6293, *note A.4.3(36): 6294.
132314 in Ada.Strings.Unbounded *note A.4.5(65): 6409, *note A.4.5(66):
132315 6410.
132316 head (of a queue) *note D.2.1(5/2): 8346.
132317 heap management
132318 user-defined *note 13.11(1): 5621.
132319 See also allocator *note 4.8(1): 3253.
132320 Heart of Darkness *note 3.10.2(3.b/3): 2448.
132321 held priority *note D.11(4/2): 8577.
132322 heterogeneous input-output *note A.12.1(1): 7062.
132323 hexadecimal
132324 literal *note 2.4.2(1): 1277.
132325 hexadecimal digit
132326 a category of Character *note A.3.2(30): 5942.
132327 hexadecimal literal *note 2.4.2(1): 1275.
132328 Hexadecimal_Digit_Set
132329 in Ada.Strings.Maps.Constants *note A.4.6(4): 6425.
132330 hidden from all visibility *note 8.3(5): 4019, *note 8.3(14): 4030.
132331 by lack of a with_clause *note 8.3(20/2): 4034.
132332 for a declaration completed by a subsequent declaration *note
132333 8.3(19): 4033.
132334 for overridden declaration *note 8.3(15): 4031.
132335 within the declaration itself *note 8.3(16): 4032.
132336 hidden from direct visibility *note 8.3(5): 4020, *note 8.3(21): 4039.
132337 by an inner homograph *note 8.3(22): 4040.
132338 where hidden from all visibility *note 8.3(23): 4041.
132339 hiding *note 8.3(5): 4018.
132340 Hierarchical_File_Names
132341 child of Ada.Directories *note A.16.1(3/3): 7191.
132342 High_Order_First *note 13.5.3(2): 5513.
132343 in Interfaces.COBOL *note B.4(25): 8131.
132344 in System *note 13.7(15/2): 5549.
132345 highest precedence operator *note 4.5.6(1): 3061.
132346 highest_precedence_operator *note 4.5(7): 2921.
132347 Hold
132348 in Ada.Asynchronous_Task_Control *note D.11(3/2): 8573.
132349 Holder
132350 in Ada.Containers.Indefinite_Holders *note A.18.18(6/3): 7825.
132351 homograph *note 8.3(8): 4023.
132352 Hour
132353 in Ada.Calendar.Formatting *note 9.6.1(24/2): 4510.
132354 Hour_Number subtype of Natural
132355 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4503.
132356 HT
132357 in Ada.Characters.Latin_1 *note A.3.3(5): 5958.
132358 HTJ
132359 in Ada.Characters.Latin_1 *note A.3.3(17): 6056.
132360 HTS
132361 in Ada.Characters.Latin_1 *note A.3.3(17): 6055.
132362 Hyphen
132363 in Ada.Characters.Latin_1 *note A.3.3(8): 5994.
132364 hyphen-minus *note 2.1(15/3): 1199.
132365
132366
132367 \1f
132368 File: aarm2012.info, Node: I, Next: J, Prev: H, Up: Index
132369
132370 I
132371 ==
132372
132373
132374
132375 i
132376 in Ada.Numerics.Generic_Complex_Types *note G.1.1(5): 8869.
132377 in Interfaces.Fortran *note B.5(10): 8168.
132378 identifier *note 2.3(2/2): 1230.
132379 used *note 2.8(2): 1305, *note 2.8(3/3): 1311, *note 2.8(21): 1331,
132380 *note 2.8(23): 1336, *note 3.1(4): 1359, *note 4.1(3): 2536, *note
132381 4.1.3(3): 2588, *note 4.1.4(3/2): 2607, *note 5.5(2): 3424, *note
132382 5.6(2): 3496, *note 6.1(5): 3528, *note 7.1(3/3): 3833, *note 7.2(2/3):
132383 3848, *note 9.1(4): 4213, *note 9.1(6/3): 4222, *note 9.4(4): 4278,
132384 *note 9.4(7/3): 4290, *note 9.5.2(3): 4358, *note 9.5.2(5): 4367, *note
132385 11.4.2(6.1/3): 4966, *note 11.4.2(6/2): 4962, *note 11.5(4.1/2): 4992,
132386 *note 11.5(4/2): 4989, *note 13.1.1(3/3): 5332, *note 13.1.1(4/3): 5336,
132387 *note 13.12(4/2): 5734, *note 13.12(11/3): 5744, *note D.2.2(3): 8356,
132388 *note D.2.2(3.2/2): 8359, *note D.3(3): 8409, *note D.3(4): 8410, *note
132389 D.3(4.a): 8412, *note D.4(3): 8432, *note D.4(4): 8434, *note H.6(3/2):
132390 9114, *note J.10(3/2): 9149, *note J.15.5(2/3): 9195, *note J.15.5(3/3):
132391 9201, *note J.15.5(4/3): 9207, *note L(2.2/2): 9337, *note L(2.3/3):
132392 9341, *note L(8.1/3): 9359, *note L(13.1/3): 9387, *note L(14.1/3):
132393 9393, *note L(20): 9421, *note L(21): 9424, *note L(23): 9433, *note
132394 L(25.1/2): 9441, *note L(27.2/2): 9452, *note L(27.3/3): 9457, *note
132395 L(29): 9464, *note L(36): 9487, *note L(37): 9490, *note L(37.3/2):
132396 9496, *note M.2(98): 9510, *note P: 9842.
132397 identifier specific to a pragma *note 2.8(10/3): 1321.
132398 identifier_extend *note 2.3(3.1/3): 1241.
132399 used *note 2.3(2/2): 1233, *note P: 9598.
132400 identifier_start *note 2.3(3/2): 1234.
132401 used *note 2.3(2/2): 1232, *note P: 9596.
132402 Identity
132403 in Ada.Strings.Maps *note A.4.2(22): 6253.
132404 in Ada.Strings.Wide_Maps *note A.4.7(22): 6465.
132405 in Ada.Strings.Wide_Wide_Maps *note A.4.8(22/2): 6507.
132406 Identity attribute *note 11.4.1(9): 4947, *note C.7.1(12): 8283.
132407 idle task *note D.11(4/2): 8578.
132408 IEC 559:1989 *note G.2.2(11.a): 8968.
132409 IEEE floating point arithmetic *note B.2(10.a): 7983, *note
132410 G.2.2(11.a): 8967.
132411 if_expression *note 4.5.7(3/3): 3085.
132412 used *note 4.5.7(2/3): 3083, *note P: 9950.
132413 if_statement *note 5.3(2): 3397.
132414 used *note 5.1(5/2): 3358, *note P: 10002.
132415 illegal
132416 construct *note 1.1.2(27): 1025.
132417 partition *note 1.1.2(29): 1033.
132418 Im
132419 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(7/2): 9009,
132420 *note G.3.2(27/2): 9022.
132421 in Ada.Numerics.Generic_Complex_Types *note G.1.1(6): 8872.
132422 image
132423 of a value *note 3.5(27.3/2): 1723, *note 3.5(30/3): 1728, *note
132424 K.2(273/3): 9325, *note K.2(277.4/2): 9326.
132425 in Ada.Calendar.Formatting *note 9.6.1(35/2): 4521, *note
132426 9.6.1(37/2): 4523.
132427 in Ada.Numerics.Discrete_Random *note A.5.2(26): 6644.
132428 in Ada.Numerics.Float_Random *note A.5.2(14): 6632.
132429 in Ada.Task_Identification *note C.7.1(3/3): 8275.
132430 in Ada.Text_IO.Editing *note F.3.3(13): 8855.
132431 Image attribute *note 3.5(35): 1730.
132432 Imaginary
132433 in Ada.Numerics.Generic_Complex_Types *note G.1.1(4/2): 8868.
132434 Imaginary subtype of Imaginary
132435 in Interfaces.Fortran *note B.5(10): 8167.
132436 immediate scope
132437 of (a view of) an entity *note 8.2(11): 4006.
132438 of a declaration *note 8.2(2): 3996.
132439 Immediate_Reclamation restriction *note H.4(10): 9080.
132440 immediately enclosing *note 8.1(13): 3992.
132441 immediately visible *note 8.3(4): 4016, *note 8.3(21): 4036.
132442 immediately within *note 8.1(13): 3990.
132443 immutably limited *note 7.5(8.1/3): 3911.
132444 implementation *note 1.1.3(1.a): 1065.
132445 implementation advice *note 1.1.2(37): 1046.
132446 summary of advice *note M.3(1/2): 9511.
132447 implementation defined *note 1.1.3(18): 1070.
132448 summary of characteristics *note M.2(1/2): 9506.
132449 implementation permissions *note 1.1.2(36): 1045.
132450 implementation requirements *note 1.1.2(33): 1042.
132451 implementation-dependent
132452 See unspecified *note 1.1.3(18): 1073.
132453 implemented
132454 by a protected entry *note 9.4(11.1/3): 4300.
132455 by a protected subprogram *note 9.4(11.1/3): 4299.
132456 by a task entry *note 9.1(9.2/3): 4226.
132457 implicit conversion
132458 legality *note 8.6(27.1/3): 4164.
132459 implicit declaration *note 3.1(5): 1362, *note N(11): 9532.
132460 implicit initial values
132461 for a subtype *note 3.3.1(10): 1579.
132462 implicit subtype conversion *note 4.6(59): 3227, *note 4.6(60): 3228.
132463 Access attribute *note 3.10.2(30): 2472.
132464 access discriminant *note 3.7(27/2): 2114.
132465 array bounds *note 4.6(38): 3188.
132466 array index *note 4.1.1(7): 2568.
132467 assignment to view conversion *note 4.6(55): 3222.
132468 assignment_statement *note 5.2(11): 3391.
132469 bounds of a decimal fixed point type *note 3.5.9(16): 1955.
132470 bounds of a fixed point type *note 3.5.9(14): 1950.
132471 bounds of a range *note 3.5(9): 1692, *note 3.6(18): 2025.
132472 choices of aggregate *note 4.3.3(22): 2759.
132473 component defaults *note 3.3.1(13/3): 1581.
132474 default value of a scalar *note 3.3.1(11.1/3): 1580.
132475 delay expression *note 9.6(20): 4475.
132476 derived type discriminants *note 3.4(21): 1630.
132477 discriminant values *note 3.7.1(12): 2135.
132478 entry index *note 9.5.2(24): 4393.
132479 expressions in aggregate *note 4.3.1(19): 2704.
132480 expressions of aggregate *note 4.3.3(23): 2760.
132481 function return *note 6.5(5.11/3): 3760, *note 6.5(6/2): 3768.
132482 generic formal object of mode in *note 12.4(11): 5154.
132483 inherited enumeration literal *note 3.4(29): 1636.
132484 initialization expression *note 3.3.1(17): 1583.
132485 initialization expression of allocator *note 4.8(7/2): 3271.
132486 Interrupt_Priority aspect *note D.1(17/3): 8335, *note D.3(6.1/3):
132487 8418.
132488 named number value *note 3.3.2(6): 1602.
132489 operand of concatenation *note 4.5.3(9): 3024.
132490 parameter passing *note 6.4.1(10): 3724, *note 6.4.1(11): 3726,
132491 *note 6.4.1(17): 3734.
132492 Priority aspect *note D.1(17/3): 8334, *note D.3(6.1/3): 8417.
132493 qualified_expression *note 4.7(4): 3249.
132494 reading a view conversion *note 4.6(56): 3223.
132495 result of inherited function *note 3.4(27/2): 1634.
132496 implicit_dereference *note 4.1(6): 2543.
132497 used *note 4.1(4): 2540, *note P: 9845.
132498 Implicit_Dereference aspect *note 4.1.5(2/3): 2621.
132499 Import aspect *note B.1(1/3): 7942.
132500 Import pragma *note J.15.5(2/3): 9194, *note L(14.1/3): 9392.
132501 imported entity *note B.1(23/3): 7966.
132502 in (membership test) *note 4.4(1/3): 2807, *note 4.5.2(2/3): 2984.
132503 inaccessible partition *note E.1(7): 8698.
132504 inactive
132505 a task state *note 9(10): 4188.
132506 Include
132507 in Ada.Containers.Hashed_Maps *note A.18.5(22/2): 7456.
132508 in Ada.Containers.Hashed_Sets *note A.18.8(21/2): 7590.
132509 in Ada.Containers.Ordered_Maps *note A.18.6(21/2): 7510.
132510 in Ada.Containers.Ordered_Sets *note A.18.9(20/2): 7664.
132511 included
132512 one execution by another *note 11.4(2.a): 4918.
132513 one range in another *note 3.5(4): 1679.
132514 incompatibilities with Ada 2005 *note 1.1.2(39.cc/3): 1061, *note
132515 2.3(8.d/3): 1248, *note 2.9(3.e/3): 1341, *note 3.4(38.m/3): 1641, *note
132516 3.5.1(16.c/3): 1784, *note 3.7(37.l/3): 2117, *note 3.8.1(29.e/3): 2206,
132517 *note 3.9(33.j/3): 2269, *note 3.9.3(16.j/3): 2337, *note
132518 3.10.2(41.p/3): 2487, *note 4.3.1(31.e/3): 2708, *note 4.3.2(13.e/3):
132519 2728, *note 4.5.2(39.k/3): 3001, *note 4.8(20.o/3): 3302, *note
132520 4.9.1(10.d/3): 3334, *note 6.3.1(25.h/3): 3684, *note 6.4.1(18.d/3):
132521 3739, *note 6.5(28.q/3): 3783, *note 8.5.1(8.g/3): 4097, *note
132522 8.6(34.v/3): 4176, *note 9.4(35.g/3): 4319, *note 10.1.2(31.i/3): 4722,
132523 *note 10.2.1(28.k/3): 4858, *note 11.4.2(28.b/3): 4978, *note
132524 12.5.1(28.i/3): 5204, *note 12.5.4(13.e/3): 5223, *note 12.6(24.d/3):
132525 5253, *note 12.7(25.e/3): 5274, *note 13.1(29.p/3): 5324, *note
132526 13.3(85.n/3): 5455, *note 13.13.2(60.u/3): 5834, *note A.3.2(60.d/3):
132527 5946, *note A.4.3(109.d/3): 6299, *note A.4.4(106.i/3): 6361, *note
132528 A.4.5(88.e/3): 6416, *note A.16(131.e/3): 7190, *note A.17(33.c/3):
132529 7216, *note A.18.1(8.d/3): 7230, *note A.18.2(264.c/3): 7331, *note
132530 A.18.3(164.c/3): 7405, *note A.18.5(62.d/3): 7481, *note A.18.6(95.e/3):
132531 7542, *note A.18.8(88.d/3): 7640, *note A.18.9(116.d/3): 7721, *note
132532 B.1(51.d/3): 7978, *note B.3(84.i/3): 8051, *note B.3.3(32.b/3): 8102,
132533 *note C.3.1(25.e/3): 8223, *note C.3.2(28.b/3): 8240, *note C.6(24.d/3):
132534 8270, *note C.7.1(21.d/3): 8292, *note D.2.1(17.b/3): 8353, *note
132535 D.7(22.g/3): 8519, *note D.14(29.c/3): 8602, *note E.2.2(20.j/3): 8742,
132536 *note E.2.3(20.e/3): 8768, *note J.15.7(8.a/3): 9226.
132537 incompatibilities with Ada 83 *note 1.1.2(39.e): 1050, *note
132538 2.8(19.c): 1326, *note 2.9(3.a): 1339, *note 3.2.2(15.a): 1488, *note
132539 3.2.3(8.a): 1497, *note 3.4(38.b): 1638, *note 3.5(63.a/1): 1764, *note
132540 3.5.2(11.b): 1798, *note 3.6.3(8.b): 2072, *note 4.2(14.a): 2665, *note
132541 4.3.3(45.a.1/1): 2770, *note 4.5.5(35.a.1/2): 3058, *note 4.6(71.a):
132542 3230, *note 4.8(20.a/1): 3297, *note 4.9(44.m): 3326, *note
132543 5.4(18.a.1/1): 3418, *note 6.5(28.a/2): 3778, *note 7.1(17.a): 3840,
132544 *note 8.6(34.a): 4170, *note 12.3(29.b): 5122, *note 12.5.1(28.a): 5202,
132545 *note 12.5.3(16.a): 5216, *note 12.5.4(13.a): 5221, *note 13.1(29.a):
132546 5321, *note 13.14(20.a): 5869, *note A.5.3(72.d): 6747, *note
132547 A.5.4(4.a): 6757, *note A.8.1(17.a): 6805, *note A.10.1(86.a): 7015,
132548 *note C.6(24.a): 8269, *note J.15.1(6.a/3): 9162.
132549 incompatibilities with Ada 95 *note 1.1.2(39.p/2): 1056, *note
132550 2.9(3.c/2): 1340, *note 3.7.1(15.c/2): 2137, *note 3.9(33.d/3): 2266,
132551 *note 3.9.2(24.b/2): 2318, *note 3.10(26.e/2): 2422, *note
132552 3.10.1(23.h/2): 2436, *note 3.10.2(41.b/2): 2485, *note 4.3(6.e/2):
132553 2682, *note 4.3.2(13.b/2): 2726, *note 4.5.5(35.d/2): 3060, *note
132554 4.6(71.j/2): 3232, *note 4.8(20.g/2): 3300, *note 5.2(28.d/2): 3396,
132555 *note 6.5(28.g/2): 3780, *note 8.3(29.s/2): 4049, *note 8.5.1(8.b/2):
132556 4095, *note 8.6(34.n/2): 4174, *note 9.7.2(7.b/3): 4570, *note
132557 10.1.2(31.f/2): 4719, *note 10.2.1(28.e/2): 4856, *note 11.4.1(19.bb/3):
132558 4952, *note 13.5.1(31.d/2): 5500, *note 13.5.2(5.c/2): 5511, *note
132559 13.11(43.d/2): 5657, *note 13.11.3(9.b/3): 5692, *note 13.14(20.p/2):
132560 5871, *note 13.14(20.t/3): 5872, *note A.4.1(6.a/3): 6236, *note
132561 A.4.3(109.a/3): 6298, *note A.4.4(106.f/3): 6360, *note A.4.5(88.b/2):
132562 6414, *note A.4.7(48.a/2): 6472, *note A.5.2(61.a/2): 6655, *note
132563 A.8.1(17.b/2): 6806, *note A.8.4(20.a/2): 6838, *note A.10.1(86.c/2):
132564 7017, *note A.10.7(26.a/3): 7025, *note A.12.1(36.b/2): 7102, *note
132565 B.3(84.a/3): 8049, *note C.3.1(25.a/2): 8221, *note D.7(22.a/2): 8517,
132566 *note D.8(51.a/3): 8549, *note E.2.2(20.b/3): 8740, *note E.2.3(20.b/3):
132567 8767, *note E.5(30.a/2): 8822.
132568 incomplete type *note 3.2(4.1/2): 1402, *note 3.10.1(2.1/2): 2427,
132569 *note N(20.1/2): 9549.
132570 incomplete view *note 3.10.1(2.1/2): 2428.
132571 tagged *note 3.10.1(2.1/2): 2429.
132572 incomplete_type_declaration *note 3.10.1(2/2): 2424.
132573 used *note 3.2.1(2): 1430, *note P: 9658.
132574 inconsistencies with Ada 2005 *note 1.1.2(39.z/3): 1059, *note
132575 2.1(19.g/3): 1220, *note 3.5(63.l/3): 1767, *note 3.9(33.i/3): 2268,
132576 *note 4.3.2(13.d/3): 2727, *note 4.3.3(45.i/3): 2773, *note
132577 4.5.2(39.i/3): 3000, *note 4.6(71.u/3): 3234, *note 6.4.1(18.c/3): 3738,
132578 *note 6.5(28.n/3): 3782, *note 7.6.1(24.cc/3): 3987, *note
132579 8.5.4(21.f.1/3): 4126, *note 9.6.1(91.c/3): 4526, *note 13.3(85.l/3):
132580 5454, *note A.10.5(52.a/3): 7019, *note A.10.8(27.a/3): 7028, *note
132581 A.16(131.d/3): 7189, *note A.18.3(164.b/3): 7404, *note D.14.2(38.b/3):
132582 8645.
132583 inconsistencies with Ada 83 *note 1.1.2(39.b): 1049, *note 3.4(38.a):
132584 1637, *note 3.5.2(11.a): 1797, *note 3.5.7(22.a): 1918, *note
132585 3.5.9(28.a): 1963, *note 3.6.3(8.a): 2071, *note 3.7.1(15.a): 2136,
132586 *note 4.5.3(14.a): 3026, *note 4.5.6(13.a.1/1): 3081, *note 9.6(40.a):
132587 4482, *note 11.1(8.a): 4884, *note 12.3(29.a): 5121, *note
132588 13.3(58.a.1/2): 5428, *note A.6(1.a): 6761, *note G.2.1(16.c): 8952,
132589 *note G.2.3(27.b): 8974.
132590 inconsistencies with Ada 95 *note 1.1.2(39.m/2): 1053, *note
132591 3.3.1(33.f/2): 1593, *note 3.5.2(11.h/2): 1800, *note 3.6.3(8.g/2):
132592 2074, *note 3.9(33.b/2): 2265, *note 3.10(26.c/2): 2421, *note
132593 4.8(20.f/2): 3299, *note 4.9(44.s/2): 3327, *note 6.5(28.f.1/3): 3779,
132594 *note 7.6.1(24.v.1/3): 3986, *note 9.6(40.e/2): 4484, *note
132595 11.4.1(19.y/2): 4951, *note 13.13.2(60.g/2): 5832, *note A.4.4(106.e/2):
132596 6359, *note A.12.1(36.a/3): 7101, *note B.3.1(60.a/2): 8074.
132597 Increment
132598 in Interfaces.C.Pointers *note B.3.2(11/3): 8081.
132599 indefinite subtype *note 3.3(23/3): 1535, *note 3.7(26): 2113.
132600 Indefinite_Doubly_Linked_Lists
132601 child of Ada.Containers *note A.18.12(2/3): 7811.
132602 Indefinite_Hashed_Maps
132603 child of Ada.Containers *note A.18.13(2/3): 7813.
132604 Indefinite_Hashed_Sets
132605 child of Ada.Containers *note A.18.15(2/3): 7817.
132606 Indefinite_Holders
132607 child of Ada.Containers *note A.18.18(5/3): 7824.
132608 Indefinite_Multiway_Trees
132609 child of Ada.Containers *note A.18.17(2/3): 7821.
132610 Indefinite_Ordered_Maps
132611 child of Ada.Containers *note A.18.14(2/3): 7815.
132612 Indefinite_Ordered_Sets
132613 child of Ada.Containers *note A.18.16(2/3): 7819.
132614 Indefinite_Vectors
132615 child of Ada.Containers *note A.18.11(2/3): 7809.
132616 Independent aspect *note C.6(6.3/3): 8252.
132617 Independent pragma *note J.15.8(4/3): 9234, *note L(14.2/3): 9398.
132618 independent subprogram *note 11.6(6/3): 5031.
132619 Independent_Components aspect *note C.6(6.9/3): 8260.
132620 Independent_Components pragma *note J.15.8(7/3): 9243, *note
132621 L(14.3/3): 9401.
132622 independently addressable *note 9.10(1/3): 4628.
132623 specified *note C.6(8.1/3): 8264.
132624 index
132625 of an array *note 3.6(9.a): 2010.
132626 of an element of an open direct file *note A.8(3): 6778.
132627 in Ada.Direct_IO *note A.8.4(15): 6827.
132628 in Ada.Streams.Stream_IO *note A.12.1(23): 7088.
132629 in Ada.Strings.Bounded *note A.4.4(43.1/2): 6323, *note
132630 A.4.4(43.2/2): 6324, *note A.4.4(44): 6325, *note A.4.4(45): 6326, *note
132631 A.4.4(45.1/2): 6327, *note A.4.4(46): 6328.
132632 in Ada.Strings.Fixed *note A.4.3(8.1/2): 6264, *note A.4.3(8.2/2):
132633 6265, *note A.4.3(9): 6266, *note A.4.3(10): 6267, *note A.4.3(10.1/2):
132634 6268, *note A.4.3(11): 6269.
132635 in Ada.Strings.Unbounded *note A.4.5(38.1/2): 6380, *note
132636 A.4.5(38.2/2): 6381, *note A.4.5(39): 6382, *note A.4.5(40): 6383, *note
132637 A.4.5(40.1/2): 6384, *note A.4.5(41): 6385.
132638 index range *note 3.6(13): 2015.
132639 index subtype *note 3.6(9): 2008.
132640 index type *note 3.6(9): 2009.
132641 Index_Check *note 11.5(14): 5003.
132642 [partial] *note 4.1.1(7): 2569, *note 4.1.2(7): 2579, *note
132643 4.3.3(29/3): 2765, *note 4.3.3(30): 2767, *note 4.5.3(8): 3021, *note
132644 4.6(51/3): 3209, *note 4.7(4): 3247, *note 4.8(10/2): 3274.
132645 index_constraint *note 3.6.1(2): 2038.
132646 used *note 3.2.2(7): 1479, *note P: 9687.
132647 Index_Error
132648 in Ada.Strings *note A.4.1(5): 6229.
132649 Index_Non_Blank
132650 in Ada.Strings.Bounded *note A.4.4(46.1/2): 6329, *note A.4.4(47):
132651 6330.
132652 in Ada.Strings.Fixed *note A.4.3(11.1/2): 6270, *note A.4.3(12):
132653 6271.
132654 in Ada.Strings.Unbounded *note A.4.5(41.1/2): 6386, *note
132655 A.4.5(42): 6387.
132656 index_subtype_definition *note 3.6(4): 1995.
132657 used *note 3.6(3): 1992, *note P: 9742.
132658 indexable container object *note 4.1.6(5/3): 2638.
132659 indexable container type *note 4.1.6(5/3): 2637, *note N(20.2/3):
132660 9550.
132661 indexed_component *note 4.1.1(2): 2560.
132662 used *note 4.1(2/3): 2525, *note P: 9832.
132663 indexing
132664 constant *note 4.1.6(12/3): 2645.
132665 variable *note 4.1.6(16/3): 2647.
132666 individual membership test *note 4.5.2(26.1/3): 2994.
132667 indivisible *note C.6(10/3): 8265.
132668 inferable discriminants *note B.3.3(20/2): 8099.
132669 Information
132670 child of Ada.Directories *note A.16(124/2): 7187.
132671 information hiding
132672 See package *note 7(1): 3821.
132673 See private types and private extensions *note 7.3(1): 3853.
132674 information systems *note C(1): 8183, *note F(1): 8823.
132675 informative *note 1.1.2(18): 1010.
132676 inherently mutable object *note 3.3(13/3): 1529.
132677 inheritance
132678 See derived types and classes *note 3.4(1/2): 1606.
132679 See also tagged types and type extension *note 3.9(1): 2215.
132680 inherited
132681 from an ancestor type *note 3.4.1(11): 1661.
132682 inherited component *note 3.4(11): 1622, *note 3.4(12): 1623.
132683 inherited discriminant *note 3.4(11): 1621.
132684 inherited entry *note 3.4(12): 1625.
132685 inherited protected subprogram *note 3.4(12): 1624.
132686 inherited subprogram *note 3.4(17/2): 1626.
132687 Initial_Directory
132688 in Ada.Directories.Hierarchical_File_Names *note A.16.1(12/3):
132689 7200.
132690 initialization
132691 of a protected object *note 9.4(14): 4311.
132692 of a protected object *note C.3.1(10/3): 8209, *note C.3.1(11/3):
132693 8213.
132694 of a task object *note 9.1(12/1): 4236, *note J.7.1(7): 9138.
132695 of an object *note 3.3.1(18/2): 1585.
132696 initialization expression *note 3.3.1(1/3): 1544, *note 3.3.1(4):
132697 1567.
132698 Initialize *note 7.6(2): 3924.
132699 in Ada.Finalization *note 7.6(6/2): 3929, *note 7.6(8/2): 3933.
132700 initialized allocator *note 4.8(4): 3263.
132701 initialized by default *note 3.3.1(18/2): 1584.
132702 Inline aspect *note 6.3.2(5.1/3): 3686.
132703 Inline pragma *note J.15.1(2/3): 9159, *note L(15.1/3): 9404.
132704 innermost dynamically enclosing *note 11.4(2): 4917.
132705 input *note A.6(1/2): 6759.
132706 Input aspect *note 13.13.2(38/3): 5825.
132707 Input attribute *note 13.13.2(22): 5802, *note 13.13.2(32): 5806.
132708 Input clause *note 13.3(7/2): 5381, *note 13.13.2(38/3): 5818.
132709 input-output
132710 unspecified for access types *note A.7(6): 6768.
132711 Insert
132712 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(19/2): 7357,
132713 *note A.18.3(20/2): 7358, *note A.18.3(21/2): 7359.
132714 in Ada.Containers.Hashed_Maps *note A.18.5(19/2): 7453, *note
132715 A.18.5(20/2): 7454, *note A.18.5(21/2): 7455.
132716 in Ada.Containers.Hashed_Sets *note A.18.8(19/2): 7588, *note
132717 A.18.8(20/2): 7589.
132718 in Ada.Containers.Ordered_Maps *note A.18.6(18/2): 7507, *note
132719 A.18.6(19/2): 7508, *note A.18.6(20/2): 7509.
132720 in Ada.Containers.Ordered_Sets *note A.18.9(18/2): 7662, *note
132721 A.18.9(19/2): 7663.
132722 in Ada.Containers.Vectors *note A.18.2(36/2): 7271, *note
132723 A.18.2(37/2): 7272, *note A.18.2(38/2): 7273, *note A.18.2(39/2): 7274,
132724 *note A.18.2(40/2): 7275, *note A.18.2(41/2): 7276, *note A.18.2(42/2):
132725 7277, *note A.18.2(43/2): 7278.
132726 in Ada.Strings.Bounded *note A.4.4(60): 6342, *note A.4.4(61):
132727 6343.
132728 in Ada.Strings.Fixed *note A.4.3(25): 6283, *note A.4.3(26): 6284.
132729 in Ada.Strings.Unbounded *note A.4.5(55): 6399, *note A.4.5(56):
132730 6400.
132731 Insert_Child
132732 in Ada.Containers.Multiway_Trees *note A.18.10(48/3): 7773, *note
132733 A.18.10(49/3): 7774, *note A.18.10(50/3): 7775.
132734 Insert_Space
132735 in Ada.Containers.Vectors *note A.18.2(48/2): 7283, *note
132736 A.18.2(49/2): 7284.
132737 inspectable object *note H.3.2(5/2): 9066.
132738 inspection point *note H.3.2(5/2): 9065.
132739 Inspection_Point pragma *note H.3.2(3): 9062, *note L(16): 9408.
132740 instance
132741 of a generic function *note 12.3(13): 5116.
132742 of a generic package *note 12.3(13): 5113.
132743 of a generic procedure *note 12.3(13): 5115.
132744 of a generic subprogram *note 12.3(13): 5114.
132745 of a generic unit *note 12.3(1): 5068.
132746 instructions for comment submission *note 0.2(58/1): 1001.
132747 int
132748 in Interfaces.C *note B.3(7): 7991.
132749 Integer *note 3.5.4(11): 1831, *note 3.5.4(21): 1851.
132750 in Standard *note A.1(12): 5880.
132751 integer literal *note 2.4(1): 1251.
132752 integer literals *note 3.5.4(14): 1838, *note 3.5.4(30): 1860.
132753 integer type *note 3.5.4(1): 1807, *note N(21): 9551.
132754 Integer_Address
132755 in System.Storage_Elements *note 13.7.1(10/3): 5565.
132756 Integer_IO
132757 in Ada.Text_IO *note A.10.1(52): 6949.
132758 Integer_Text_IO
132759 child of Ada *note A.10.8(21): 7027.
132760 integer_type_definition *note 3.5.4(2): 1811.
132761 used *note 3.2.1(4/2): 1442, *note P: 9668.
132762 Integer_Wide_Text_IO
132763 child of Ada *note A.11(2/2): 7051.
132764 Integer_Wide_Wide_Text_IO
132765 child of Ada *note A.11(3/2): 7054.
132766 interaction
132767 between tasks *note 9(1/3): 4180.
132768 interface *note 3.9.4(4/2): 2344.
132769 limited *note 3.9.4(5/2): 2349.
132770 nonlimited *note 3.9.4(5/2): 2350.
132771 protected *note 3.9.4(5/2): 2347.
132772 synchronized *note 3.9.4(5/2): 2346.
132773 task *note 3.9.4(5/2): 2348.
132774 type *note 3.9.4(4/2): 2345.
132775 interface to assembly language *note C.1(4/3): 8186.
132776 interface to C *note B.3(1/3): 7984.
132777 interface to COBOL *note B.4(1/3): 8104.
132778 interface to Fortran *note B.5(1/3): 8158.
132779 interface to other languages *note B(1): 7935.
132780 interface type *note N(21.1/2): 9552.
132781 Interface_Ancestor_Tags
132782 in Ada.Tags *note 3.9(7.4/2): 2241.
132783 interface_list *note 3.9.4(3/2): 2341.
132784 used *note 3.4(2/2): 1611, *note 3.9.4(2/2): 2340, *note 7.3(3/3):
132785 3865, *note 9.1(2/3): 4203, *note 9.1(3/3): 4208, *note 9.4(2/3): 4268,
132786 *note 9.4(3/3): 4273, *note 12.5.1(3/2): 5195, *note P: 9799.
132787 interface_type_definition *note 3.9.4(2/2): 2339.
132788 used *note 3.2.1(4/2): 1448, *note 12.5.5(2/2): 5225, *note P:
132789 10404.
132790 Interfaces *note B.2(3): 7980.
132791 Interfaces.C *note B.3(4): 7986.
132792 Interfaces.C.Pointers *note B.3.2(4): 8076.
132793 Interfaces.C.Strings *note B.3.1(3): 8052.
132794 Interfaces.COBOL *note B.4(7): 8106.
132795 Interfaces.Fortran *note B.5(4): 8160.
132796 interfacing aspect *note B.1(0.1/3): 7939.
132797 interfacing pragma *note J.15.5(1/3): 9180.
132798 Convention *note J.15.5(1/3): 9185.
132799 Export *note J.15.5(1/3): 9183.
132800 Import *note J.15.5(1/3): 9181.
132801 internal call *note 9.5(3/3): 4324.
132802 internal code *note 13.4(7): 5464.
132803 internal requeue *note 9.5(7): 4327.
132804 Internal_Tag
132805 in Ada.Tags *note 3.9(7/2): 2236.
132806 interpretation
132807 of a complete context *note 8.6(10): 4144.
132808 of a constituent of a complete context *note 8.6(15): 4150.
132809 overload resolution *note 8.6(14): 4149.
132810 interrupt *note C.3(2): 8192.
132811 example using asynchronous_select *note 9.7.4(10): 4590, *note
132812 9.7.4(12): 4595.
132813 interrupt entry *note J.7.1(5): 9134.
132814 interrupt handler *note C.3(2): 8200.
132815 Interrupt_Clocks_Supported
132816 in Ada.Execution_Time *note D.14(9.1/3): 8594.
132817 Interrupt_Handler aspect *note C.3.1(6.2/3): 8204.
132818 Interrupt_Handler pragma *note J.15.7(2/3): 9218, *note L(17.1/3):
132819 9412.
132820 Interrupt_Id
132821 in Ada.Interrupts *note C.3.2(2/3): 8225.
132822 Interrupt_Priority aspect *note D.1(6.3/3): 8327.
132823 Interrupt_Priority pragma *note J.15.11(4/3): 9269, *note L(18.1/3):
132824 9415.
132825 Interrupt_Priority subtype of Any_Priority
132826 in System *note 13.7(16): 5554.
132827 Interrupts
132828 child of Ada *note C.3.2(2/3): 8224.
132829 child of Ada.Execution_Time *note D.14.3(3/3): 8646.
132830 Intersection
132831 in Ada.Containers.Hashed_Sets *note A.18.8(29/2): 7597, *note
132832 A.18.8(30/2): 7598.
132833 in Ada.Containers.Ordered_Sets *note A.18.9(30/2): 7673, *note
132834 A.18.9(31/2): 7674.
132835 intertask communication *note 9.5(1): 4321.
132836 See also task *note 9(1/3): 4184.
132837 Intrinsic calling convention *note 6.3.1(4): 3660.
132838 invalid cursor
132839 of a list container *note A.18.3(153/2): 7399.
132840 of a map *note A.18.4(76/2): 7423.
132841 of a set *note A.18.7(97/2): 7562.
132842 of a tree *note A.18.10(222/3): 7805.
132843 of a vector *note A.18.2(248/2): 7326.
132844 invalid representation *note 13.9.1(9): 5602.
132845 invariant *note N(21.2/3): 9553.
132846 invariant check *note 7.3.2(9/3): 3897.
132847 invariant expression *note 7.3.2(2/3): 3891.
132848 Inverse
132849 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9036.
132850 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8995.
132851 Inverted_Exclamation
132852 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6081.
132853 Inverted_Question
132854 in Ada.Characters.Latin_1 *note A.3.3(22): 6113.
132855 involve an inner product
132856 complex *note G.3.2(56/2): 9042.
132857 real *note G.3.1(34/2): 9001.
132858 IO_Exceptions
132859 child of Ada *note A.13(3): 7114.
132860 IS1
132861 in Ada.Characters.Latin_1 *note A.3.3(16): 6046.
132862 IS2
132863 in Ada.Characters.Latin_1 *note A.3.3(16): 6045.
132864 IS3
132865 in Ada.Characters.Latin_1 *note A.3.3(16): 6044.
132866 IS4
132867 in Ada.Characters.Latin_1 *note A.3.3(16): 6043.
132868 Is_A_Group_Member
132869 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8627.
132870 Is_Abstract
132871 in Ada.Tags *note 3.9(7.5/3): 2242.
132872 Is_Alphanumeric
132873 in Ada.Characters.Handling *note A.3.2(4/3): 5917.
132874 in Ada.Wide_Characters.Handling *note A.3.5(12/3): 6207.
132875 Is_Attached
132876 in Ada.Interrupts *note C.3.2(5): 8228.
132877 Is_Basic
132878 in Ada.Characters.Handling *note A.3.2(4/3): 5913.
132879 Is_Callable
132880 in Ada.Task_Identification *note C.7.1(4/3): 8280.
132881 Is_Character
132882 in Ada.Characters.Conversions *note A.3.4(3/2): 6181.
132883 Is_Control
132884 in Ada.Characters.Handling *note A.3.2(4/3): 5908.
132885 in Ada.Wide_Characters.Handling *note A.3.5(5/3): 6200.
132886 Is_Current_Directory_Name
132887 in Ada.Directories.Hierarchical_File_Names *note A.16.1(7/3): 7195.
132888 Is_Decimal_Digit
132889 in Ada.Characters.Handling *note A.3.2(4/3): 5915.
132890 in Ada.Wide_Characters.Handling *note A.3.5(10/3): 6205.
132891 Is_Descendant_At_Same_Level
132892 in Ada.Tags *note 3.9(7.1/2): 2238.
132893 Is_Digit
132894 in Ada.Characters.Handling *note A.3.2(4/3): 5914.
132895 in Ada.Wide_Characters.Handling *note A.3.5(9/3): 6204.
132896 Is_Empty
132897 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(12/2): 7345.
132898 in Ada.Containers.Hashed_Maps *note A.18.5(11/2): 7438.
132899 in Ada.Containers.Hashed_Sets *note A.18.8(13/2): 7579.
132900 in Ada.Containers.Indefinite_Holders *note A.18.18(10/3): 7828.
132901 in Ada.Containers.Multiway_Trees *note A.18.10(16/3): 7741.
132902 in Ada.Containers.Ordered_Maps *note A.18.6(10/2): 7492.
132903 in Ada.Containers.Ordered_Sets *note A.18.9(12/2): 7653.
132904 in Ada.Containers.Vectors *note A.18.2(23/2): 7251.
132905 Is_Full_Name
132906 in Ada.Directories.Hierarchical_File_Names *note A.16.1(8/3): 7196.
132907 Is_Graphic
132908 in Ada.Characters.Handling *note A.3.2(4/3): 5909.
132909 in Ada.Wide_Characters.Handling *note A.3.5(19/3): 6214.
132910 Is_Held
132911 in Ada.Asynchronous_Task_Control *note D.11(3/2): 8575.
132912 Is_Hexadecimal_Digit
132913 in Ada.Characters.Handling *note A.3.2(4/3): 5916.
132914 in Ada.Wide_Characters.Handling *note A.3.5(11/3): 6206.
132915 Is_In
132916 in Ada.Strings.Maps *note A.4.2(13): 6245.
132917 in Ada.Strings.Wide_Maps *note A.4.7(13): 6457.
132918 in Ada.Strings.Wide_Wide_Maps *note A.4.8(13/2): 6499.
132919 Is_ISO_646
132920 in Ada.Characters.Handling *note A.3.2(10): 5932.
132921 Is_Leaf
132922 in Ada.Containers.Multiway_Trees *note A.18.10(21/3): 7746.
132923 Is_Letter
132924 in Ada.Characters.Handling *note A.3.2(4/3): 5910.
132925 in Ada.Wide_Characters.Handling *note A.3.5(6/3): 6201.
132926 Is_Line_Terminator
132927 in Ada.Characters.Handling *note A.3.2(4/3): 5919.
132928 in Ada.Wide_Characters.Handling *note A.3.5(14/3): 6209.
132929 Is_Lower
132930 in Ada.Characters.Handling *note A.3.2(4/3): 5911.
132931 in Ada.Wide_Characters.Handling *note A.3.5(7/3): 6202.
132932 Is_Mark
132933 in Ada.Characters.Handling *note A.3.2(4/3): 5920.
132934 in Ada.Wide_Characters.Handling *note A.3.5(15/3): 6210.
132935 Is_Member
132936 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8626.
132937 Is_Nul_Terminated
132938 in Interfaces.C *note B.3(24): 8010, *note B.3(35): 8020, *note
132939 B.3(39.16/2): 8040, *note B.3(39.7/2): 8030.
132940 Is_Open
132941 in Ada.Direct_IO *note A.8.4(10): 6821.
132942 in Ada.Sequential_IO *note A.8.1(10): 6793.
132943 in Ada.Streams.Stream_IO *note A.12.1(12): 7080.
132944 in Ada.Text_IO *note A.10.1(13): 6878.
132945 Is_Other_Format
132946 in Ada.Characters.Handling *note A.3.2(4/3): 5921.
132947 in Ada.Wide_Characters.Handling *note A.3.5(16/3): 6211.
132948 Is_Parent_Directory_Name
132949 in Ada.Directories.Hierarchical_File_Names *note A.16.1(6/3): 7194.
132950 Is_Punctuation_Connector
132951 in Ada.Characters.Handling *note A.3.2(4/3): 5922.
132952 in Ada.Wide_Characters.Handling *note A.3.5(17/3): 6212.
132953 Is_Relative_Name
132954 in Ada.Directories.Hierarchical_File_Names *note A.16.1(9/3): 7197.
132955 Is_Reserved
132956 in Ada.Interrupts *note C.3.2(4): 8227.
132957 Is_Root
132958 in Ada.Containers.Multiway_Trees *note A.18.10(20/3): 7745.
132959 Is_Root_Directory_Name
132960 in Ada.Directories.Hierarchical_File_Names *note A.16.1(5/3): 7193.
132961 Is_Round_Robin
132962 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8391.
132963 Is_Simple_Name
132964 in Ada.Directories.Hierarchical_File_Names *note A.16.1(4/3): 7192.
132965 Is_Sorted
132966 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(48/2): 7385.
132967 in Ada.Containers.Vectors *note A.18.2(76/2): 7310.
132968 Is_Space
132969 in Ada.Characters.Handling *note A.3.2(4/3): 5923.
132970 in Ada.Wide_Characters.Handling *note A.3.5(18/3): 6213.
132971 Is_Special
132972 in Ada.Characters.Handling *note A.3.2(4/3): 5918.
132973 in Ada.Wide_Characters.Handling *note A.3.5(13/3): 6208.
132974 Is_String
132975 in Ada.Characters.Conversions *note A.3.4(3/2): 6180.
132976 Is_Subset
132977 in Ada.Containers.Hashed_Sets *note A.18.8(39/2): 7604.
132978 in Ada.Containers.Ordered_Sets *note A.18.9(40/2): 7680.
132979 in Ada.Strings.Maps *note A.4.2(14): 6246.
132980 in Ada.Strings.Wide_Maps *note A.4.7(14): 6458.
132981 in Ada.Strings.Wide_Wide_Maps *note A.4.8(14/2): 6500.
132982 Is_Terminated
132983 in Ada.Task_Identification *note C.7.1(4/3): 8279.
132984 Is_Upper
132985 in Ada.Characters.Handling *note A.3.2(4/3): 5912.
132986 in Ada.Wide_Characters.Handling *note A.3.5(8/3): 6203.
132987 Is_Wide_Character
132988 in Ada.Characters.Conversions *note A.3.4(3/2): 6183.
132989 Is_Wide_String
132990 in Ada.Characters.Conversions *note A.3.4(3/2): 6184.
132991 ISO 1989:2002 *note 1.2(4/2): 1119.
132992 ISO 639-3:2007 *note 1.2(1.1/3): 1110.
132993 ISO 8601:2004 *note 1.2(5.1/2): 1128.
132994 ISO/IEC 10646:2011 *note 1.2(8/3): 1136, *note 3.5.2(2/3): 1788, *note
132995 3.5.2(3/3): 1794, *note 3.5.2(4/3): 1796.
132996 ISO/IEC 14882:2011 *note 1.2(9/3): 1139.
132997 ISO/IEC 1539-1:2004 *note 1.2(3/2): 1116.
132998 ISO/IEC 3166-1:2006 *note 1.2(4.1/3): 1122.
132999 ISO/IEC 6429:1992 *note 1.2(5): 1125.
133000 ISO/IEC 646:1991 *note 1.2(2): 1113.
133001 ISO/IEC 8859-1:1998 *note 1.2(6/3): 1130.
133002 ISO/IEC 9899:2011 *note 1.2(7/3): 1133.
133003 ISO/IEC TR 19769:2004 *note 1.2(10/2): 1142.
133004 ISO_646 subtype of Character
133005 in Ada.Characters.Handling *note A.3.2(9): 5930.
133006 ISO_646_Set
133007 in Ada.Strings.Maps.Constants *note A.4.6(4): 6428.
133008 issue
133009 an entry call *note 9.5.3(8): 4416.
133010 italics
133011 formal parameters of attribute functions *note 3.5(18.a): 1704.
133012 implementation-defined *note 1.1.3(5.c): 1066.
133013 nongraphic characters *note 3.5.2(2/3): 1790.
133014 pseudo-names of anonymous types *note 3.2.1(7/2): 1452, *note
133015 A.1(2): 5877.
133016 syntax rules *note 1.1.4(14): 1081.
133017 terms introduced or defined *note 1.3(1/2): 1145.
133018 italics, like this *note 1(2.mm): 1003.
133019 iterable container object *note 5.5.1(11/3): 3461.
133020 iterable container object for a loop *note 5.5.2(12/3): 3488.
133021 iterable container type *note 5.5.1(11/3): 3459, *note N(21.3/3):
133022 9554.
133023 Iterate
133024 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(45/2): 7382.
133025 in Ada.Containers.Hashed_Maps *note A.18.5(37/2): 7470.
133026 in Ada.Containers.Hashed_Sets *note A.18.8(49/2): 7613.
133027 in Ada.Containers.Multiway_Trees *note A.18.10(42/3): 7767, *note
133028 A.18.10(44/3): 7769.
133029 in Ada.Containers.Ordered_Maps *note A.18.6(50/2): 7532.
133030 in Ada.Containers.Ordered_Sets *note A.18.9(60/2): 7693.
133031 in Ada.Containers.Vectors *note A.18.2(73/2): 7307.
133032 in Ada.Environment_Variables *note A.17(8/3): 7212.
133033 Iterate_Children
133034 in Ada.Containers.Multiway_Trees *note A.18.10(68/3): 7793, *note
133035 A.18.10(70/3): 7795.
133036 Iterate_Subtree
133037 in Ada.Containers.Multiway_Trees *note A.18.10(43/3): 7768, *note
133038 A.18.10(45/3): 7770.
133039 iteration cursor subtype *note 5.5.1(6/3): 3450.
133040 iteration_scheme *note 5.5(3/3): 3425.
133041 used *note 5.5(2): 3422, *note P: 10024.
133042 iterator *note N(21.4/3): 9555.
133043 array component *note 5.5.2(3/3): 3477.
133044 container element *note 5.5.2(3/3): 3479.
133045 forward *note 5.5.2(4/3): 3483.
133046 generalized *note 5.5.2(3/3): 3473.
133047 reverse *note 5.5.2(4/3): 3481.
133048 iterator object *note 5.5.1(6/3): 3448.
133049 iterator type *note 5.5.1(6/3): 3446.
133050 Iterator_Element aspect *note 5.5.1(9/3): 3458.
133051 Iterator_Interfaces
133052 child of Ada *note 5.5.1(2/3): 3439.
133053 iterator_specification *note 5.5.2(2/3): 3466.
133054 used *note 4.5.8(1/3): 3116, *note 5.5(3/3): 3428, *note P: 9967.
133055
133056
133057 \1f
133058 File: aarm2012.info, Node: J, Next: K, Prev: I, Up: Index
133059
133060 J
133061 ==
133062
133063
133064
133065 j
133066 in Ada.Numerics.Generic_Complex_Types *note G.1.1(5): 8870.
133067 in Interfaces.Fortran *note B.5(10): 8169.
133068
133069
133070 \1f
133071 File: aarm2012.info, Node: K, Next: L, Prev: J, Up: Index
133072
133073 K
133074 ==
133075
133076
133077
133078 Key
133079 in Ada.Containers.Hashed_Maps *note A.18.5(13/2): 7440.
133080 in Ada.Containers.Hashed_Sets *note A.18.8(51/2): 7615.
133081 in Ada.Containers.Ordered_Maps *note A.18.6(12/2): 7494.
133082 in Ada.Containers.Ordered_Sets *note A.18.9(64/2): 7697.
133083 Kind
133084 in Ada.Directories *note A.16(25/2): 7158, *note A.16(40/2): 7170.
133085 known discriminants *note 3.7(26): 2106.
133086 known to be constrained *note 3.3(23.1/3): 1537.
133087 known to denote the same object *note 6.4.1(6.4/3): 3721.
133088 known to refer to the same object *note 6.4.1(6.11/3): 3722.
133089 known_discriminant_part *note 3.7(4): 2085.
133090 used *note 3.2.1(3/3): 1435, *note 3.7(2): 2083, *note 9.1(2/3):
133091 4201, *note 9.4(2/3): 4266, *note P: 9757.
133092
133093
133094 \1f
133095 File: aarm2012.info, Node: L, Next: M, Prev: K, Up: Index
133096
133097 L
133098 ==
133099
133100
133101
133102 label *note 5.1(7): 3366.
133103 used *note 5.1(2/3): 3338, *note 5.1(3): 3340, *note P: 9985.
133104 Landau symbol O(X) *note A.18(3/2): 7219.
133105 language
133106 interface to assembly *note C.1(4/3): 8187.
133107 interface to non-Ada *note B(1): 7936.
133108 in Ada.Locales *note A.19(6/3): 7930.
133109 Language code standard *note 1.2(1.1/3): 1112.
133110 language-defined categories
133111 [partial] *note 3.2(10/2): 1425.
133112 language-defined category
133113 of types *note 3.2(2/2): 1392.
133114 language-defined check *note 11.5(2/3): 4981, *note 11.6(1/3): 5021.
133115 language-defined class
133116 [partial] *note 3.2(10/2): 1424.
133117 of types *note 3.2(2/2): 1391.
133118 Language-defined constants *note Q.5(1/3): 10482.
133119 Language-defined exceptions *note Q.4(1/3): 10480.
133120 Language-Defined Library Units *note A(1): 5873.
133121 Language-defined objects *note Q.5(1/3): 10481.
133122 Language-defined packages *note Q.1(1/3): 10476.
133123 Language-defined subprograms *note Q.3(1/3): 10479.
133124 Language-defined subtypes *note Q.2(1/3): 10478.
133125 Language-defined types *note Q.2(1/3): 10477.
133126 Language-defined values *note Q.5(1/3): 10483.
133127 Language_Code
133128 in Ada.Locales *note A.19(4/3): 7926.
133129 Language_Unknown
133130 in Ada.Locales *note A.19(5/3): 7928.
133131 Last
133132 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(35/2): 7373.
133133 in Ada.Containers.Ordered_Maps *note A.18.6(31/2): 7520.
133134 in Ada.Containers.Ordered_Sets *note A.18.9(43/2): 7683.
133135 in Ada.Containers.Vectors *note A.18.2(61/2): 7296.
133136 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3444.
133137 Last attribute *note 3.5(13): 1696, *note 3.6.2(5): 2058.
133138 last element
133139 of a hashed set *note A.18.8(68/2): 7634.
133140 of a set *note A.18.7(6/2): 7550.
133141 of an ordered set *note A.18.9(81/3): 7716.
133142 last node
133143 of a hashed map *note A.18.5(46/2): 7477.
133144 of a map *note A.18.4(6/2): 7414.
133145 of an ordered map *note A.18.6(58/3): 7538.
133146 Last(N) attribute *note 3.6.2(6): 2060.
133147 last_bit *note 13.5.1(6): 5492.
133148 used *note 13.5.1(3): 5487, *note P: 10455.
133149 Last_Bit attribute *note 13.5.2(4/2): 5508.
133150 Last_Child
133151 in Ada.Containers.Multiway_Trees *note A.18.10(62/3): 7787.
133152 Last_Child_Element
133153 in Ada.Containers.Multiway_Trees *note A.18.10(63/3): 7788.
133154 Last_Element
133155 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(36/2): 7374.
133156 in Ada.Containers.Ordered_Maps *note A.18.6(32/2): 7521.
133157 in Ada.Containers.Ordered_Sets *note A.18.9(44/2): 7684.
133158 in Ada.Containers.Vectors *note A.18.2(62/2): 7297.
133159 Last_Index
133160 in Ada.Containers.Vectors *note A.18.2(60/2): 7295.
133161 Last_Key
133162 in Ada.Containers.Ordered_Maps *note A.18.6(33/2): 7522.
133163 Last_Valid attribute *note 3.5.5(7.3/3): 1874.
133164 lateness *note D.9(12): 8552.
133165 Latin-1 *note 3.5.2(2/3): 1786.
133166 Latin_1
133167 child of Ada.Characters *note A.3.3(3): 5947.
133168 Layout aspect *note 13.5(1): 5470.
133169 Layout_Error
133170 in Ada.IO_Exceptions *note A.13(4): 7122.
133171 in Ada.Text_IO *note A.10.1(85): 7013.
133172 LC_A
133173 in Ada.Characters.Latin_1 *note A.3.3(13): 6011.
133174 LC_A_Acute
133175 in Ada.Characters.Latin_1 *note A.3.3(25): 6147.
133176 LC_A_Circumflex
133177 in Ada.Characters.Latin_1 *note A.3.3(25): 6148.
133178 LC_A_Diaeresis
133179 in Ada.Characters.Latin_1 *note A.3.3(25): 6150.
133180 LC_A_Grave
133181 in Ada.Characters.Latin_1 *note A.3.3(25): 6146.
133182 LC_A_Ring
133183 in Ada.Characters.Latin_1 *note A.3.3(25): 6151.
133184 LC_A_Tilde
133185 in Ada.Characters.Latin_1 *note A.3.3(25): 6149.
133186 LC_AE_Diphthong
133187 in Ada.Characters.Latin_1 *note A.3.3(25): 6152.
133188 LC_B
133189 in Ada.Characters.Latin_1 *note A.3.3(13): 6012.
133190 LC_C
133191 in Ada.Characters.Latin_1 *note A.3.3(13): 6013.
133192 LC_C_Cedilla
133193 in Ada.Characters.Latin_1 *note A.3.3(25): 6153.
133194 LC_D
133195 in Ada.Characters.Latin_1 *note A.3.3(13): 6014.
133196 LC_E
133197 in Ada.Characters.Latin_1 *note A.3.3(13): 6015.
133198 LC_E_Acute
133199 in Ada.Characters.Latin_1 *note A.3.3(25): 6155.
133200 LC_E_Circumflex
133201 in Ada.Characters.Latin_1 *note A.3.3(25): 6156.
133202 LC_E_Diaeresis
133203 in Ada.Characters.Latin_1 *note A.3.3(25): 6157.
133204 LC_E_Grave
133205 in Ada.Characters.Latin_1 *note A.3.3(25): 6154.
133206 LC_F
133207 in Ada.Characters.Latin_1 *note A.3.3(13): 6016.
133208 LC_G
133209 in Ada.Characters.Latin_1 *note A.3.3(13): 6017.
133210 LC_German_Sharp_S
133211 in Ada.Characters.Latin_1 *note A.3.3(24): 6145.
133212 LC_H
133213 in Ada.Characters.Latin_1 *note A.3.3(13): 6018.
133214 LC_I
133215 in Ada.Characters.Latin_1 *note A.3.3(13): 6019.
133216 LC_I_Acute
133217 in Ada.Characters.Latin_1 *note A.3.3(25): 6159.
133218 LC_I_Circumflex
133219 in Ada.Characters.Latin_1 *note A.3.3(25): 6160.
133220 LC_I_Diaeresis
133221 in Ada.Characters.Latin_1 *note A.3.3(25): 6161.
133222 LC_I_Grave
133223 in Ada.Characters.Latin_1 *note A.3.3(25): 6158.
133224 LC_Icelandic_Eth
133225 in Ada.Characters.Latin_1 *note A.3.3(26): 6162.
133226 LC_Icelandic_Thorn
133227 in Ada.Characters.Latin_1 *note A.3.3(26): 6176.
133228 LC_J
133229 in Ada.Characters.Latin_1 *note A.3.3(13): 6020.
133230 LC_K
133231 in Ada.Characters.Latin_1 *note A.3.3(13): 6021.
133232 LC_L
133233 in Ada.Characters.Latin_1 *note A.3.3(13): 6022.
133234 LC_M
133235 in Ada.Characters.Latin_1 *note A.3.3(13): 6023.
133236 LC_N
133237 in Ada.Characters.Latin_1 *note A.3.3(13): 6024.
133238 LC_N_Tilde
133239 in Ada.Characters.Latin_1 *note A.3.3(26): 6163.
133240 LC_O
133241 in Ada.Characters.Latin_1 *note A.3.3(13): 6025.
133242 LC_O_Acute
133243 in Ada.Characters.Latin_1 *note A.3.3(26): 6165.
133244 LC_O_Circumflex
133245 in Ada.Characters.Latin_1 *note A.3.3(26): 6166.
133246 LC_O_Diaeresis
133247 in Ada.Characters.Latin_1 *note A.3.3(26): 6168.
133248 LC_O_Grave
133249 in Ada.Characters.Latin_1 *note A.3.3(26): 6164.
133250 LC_O_Oblique_Stroke
133251 in Ada.Characters.Latin_1 *note A.3.3(26): 6170.
133252 LC_O_Tilde
133253 in Ada.Characters.Latin_1 *note A.3.3(26): 6167.
133254 LC_P
133255 in Ada.Characters.Latin_1 *note A.3.3(14): 6026.
133256 LC_Q
133257 in Ada.Characters.Latin_1 *note A.3.3(14): 6027.
133258 LC_R
133259 in Ada.Characters.Latin_1 *note A.3.3(14): 6028.
133260 LC_S
133261 in Ada.Characters.Latin_1 *note A.3.3(14): 6029.
133262 LC_T
133263 in Ada.Characters.Latin_1 *note A.3.3(14): 6030.
133264 LC_U
133265 in Ada.Characters.Latin_1 *note A.3.3(14): 6031.
133266 LC_U_Acute
133267 in Ada.Characters.Latin_1 *note A.3.3(26): 6172.
133268 LC_U_Circumflex
133269 in Ada.Characters.Latin_1 *note A.3.3(26): 6173.
133270 LC_U_Diaeresis
133271 in Ada.Characters.Latin_1 *note A.3.3(26): 6174.
133272 LC_U_Grave
133273 in Ada.Characters.Latin_1 *note A.3.3(26): 6171.
133274 LC_V
133275 in Ada.Characters.Latin_1 *note A.3.3(14): 6032.
133276 LC_W
133277 in Ada.Characters.Latin_1 *note A.3.3(14): 6033.
133278 LC_X
133279 in Ada.Characters.Latin_1 *note A.3.3(14): 6034.
133280 LC_Y
133281 in Ada.Characters.Latin_1 *note A.3.3(14): 6035.
133282 LC_Y_Acute
133283 in Ada.Characters.Latin_1 *note A.3.3(26): 6175.
133284 LC_Y_Diaeresis
133285 in Ada.Characters.Latin_1 *note A.3.3(26): 6177.
133286 LC_Z
133287 in Ada.Characters.Latin_1 *note A.3.3(14): 6036.
133288 Leading_Nonseparate
133289 in Interfaces.COBOL *note B.4(23): 8128.
133290 Leading_Part attribute *note A.5.3(54): 6723.
133291 Leading_Separate
133292 in Interfaces.COBOL *note B.4(23): 8126.
133293 leaf node
133294 of a tree *note A.18.10(4/3): 7729.
133295 Leap_Seconds_Count subtype of Integer
133296 in Ada.Calendar.Arithmetic *note 9.6.1(11/2): 4491.
133297 leaving *note 7.6.1(3/2): 3962.
133298 left *note 7.6.1(3/2): 3963.
133299 left parenthesis *note 2.1(15/3): 1193.
133300 Left_Angle_Quotation
133301 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6091.
133302 Left_Curly_Bracket
133303 in Ada.Characters.Latin_1 *note A.3.3(14): 6037.
133304 Left_Parenthesis
133305 in Ada.Characters.Latin_1 *note A.3.3(8): 5989.
133306 Left_Square_Bracket
133307 in Ada.Characters.Latin_1 *note A.3.3(12): 6005.
133308 legal
133309 construct *note 1.1.2(27): 1024.
133310 partition *note 1.1.2(29): 1032.
133311 legality determinable via semantic dependences *note 10(3.c): 4640.
133312 legality rules *note 1.1.2(27): 1021.
133313 length
133314 of a dimension of an array *note 3.6(13): 2017.
133315 of a list container *note A.18.3(3/2): 7336.
133316 of a map *note A.18.4(5/2): 7412.
133317 of a one-dimensional array *note 3.6(13): 2018.
133318 of a set *note A.18.7(5/2): 7548.
133319 of a vector container *note A.18.2(2/2): 7233.
133320 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(11/2): 7344.
133321 in Ada.Containers.Hashed_Maps *note A.18.5(10/2): 7437.
133322 in Ada.Containers.Hashed_Sets *note A.18.8(12/2): 7578.
133323 in Ada.Containers.Ordered_Maps *note A.18.6(9/2): 7491.
133324 in Ada.Containers.Ordered_Sets *note A.18.9(11/2): 7652.
133325 in Ada.Containers.Vectors *note A.18.2(21/2): 7249.
133326 in Ada.Strings.Bounded *note A.4.4(9): 6306.
133327 in Ada.Strings.Unbounded *note A.4.5(6): 6365.
133328 in Ada.Text_IO.Editing *note F.3.3(11): 8853.
133329 in Interfaces.COBOL *note B.4(34): 8142, *note B.4(39): 8146, *note
133330 B.4(44): 8150.
133331 Length attribute *note 3.6.2(9): 2066.
133332 Length(N) attribute *note 3.6.2(10): 2068.
133333 Length_Check *note 11.5(15): 5004.
133334 [partial] *note 4.5.1(8): 2946, *note 4.6(37): 3184, *note 4.6(52):
133335 3216.
133336 Length_Error
133337 in Ada.Strings *note A.4.1(5): 6227.
133338 Length_Range subtype of Natural
133339 in Ada.Strings.Bounded *note A.4.4(8): 6305.
133340 less than operator *note 4.4(1/3): 2793, *note 4.5.2(1): 2968.
133341 less than or equal operator *note 4.4(1/3): 2797, *note 4.5.2(1):
133342 2972.
133343 less-than sign *note 2.1(15/3): 1208.
133344 Less_Case_Insensitive
133345 child of Ada.Strings *note A.4.10(13/3): 6531.
133346 child of Ada.Strings.Bounded *note A.4.10(18/3): 6533.
133347 child of Ada.Strings.Fixed *note A.4.10(16/3): 6532.
133348 child of Ada.Strings.Unbounded *note A.4.10(21/3): 6534.
133349 Less_Than_Sign
133350 in Ada.Characters.Latin_1 *note A.3.3(10): 6000.
133351 letter
133352 a category of Character *note A.3.2(24): 5937.
133353 letter_lowercase *note 2.1(9/2): 1169.
133354 used *note 2.3(3/2): 1236, *note P: 9600.
133355 letter_modifier *note 2.1(9.2/2): 1171.
133356 used *note 2.3(3/2): 1238, *note P: 9602.
133357 letter_other *note 2.1(9.3/2): 1172.
133358 used *note 2.3(3/2): 1239, *note P: 9603.
133359 Letter_Set
133360 in Ada.Strings.Maps.Constants *note A.4.6(4): 6420.
133361 letter_titlecase *note 2.1(9.1/2): 1170.
133362 used *note 2.3(3/2): 1237, *note P: 9601.
133363 letter_uppercase *note 2.1(8/2): 1168.
133364 used *note 2.3(3/2): 1235, *note P: 9599.
133365 level
133366 accessibility *note 3.10.2(3/2): 2443.
133367 library *note 3.10.2(22): 2462.
133368 lexical element *note 2.2(1): 1222.
133369 lexicographic order *note 4.5.2(26/3): 2993.
133370 LF
133371 in Ada.Characters.Latin_1 *note A.3.3(5): 5959.
133372 library *note 10.1.4(9): 4757.
133373 [partial] *note 10.1.1(9): 4674.
133374 informal introduction *note 10(2): 4635.
133375 See also library level, library unit, library_item
133376 library level *note 3.10.2(22): 2461.
133377 Library unit *note 10.1(3): 4645, *note 10.1.1(9): 4673, *note N(22):
133378 9556.
133379 informal introduction *note 10(2): 4633.
133380 See also language-defined library units
133381 library unit pragma *note 10.1.5(7/3): 4763.
133382 All_Calls_Remote *note E.2.3(6): 8753.
133383 categorization pragmas *note E.2(2/3): 8706.
133384 Elaborate_Body *note 10.2.1(24): 4849.
133385 Preelaborate *note 10.2.1(4): 4814.
133386 Pure *note 10.2.1(15): 4831.
133387 library_item *note 10.1.1(4): 4655.
133388 informal introduction *note 10(2): 4634.
133389 used *note 10.1.1(3): 4652, *note P: 10280.
133390 library_unit_body *note 10.1.1(7): 4668.
133391 used *note 10.1.1(4): 4657, *note P: 10284.
133392 library_unit_declaration *note 10.1.1(5): 4659.
133393 used *note 10.1.1(4): 4656, *note P: 10283.
133394 library_unit_renaming_declaration *note 10.1.1(6): 4664.
133395 used *note 10.1.1(4): 4658, *note P: 10285.
133396 lifetime *note 3.10.2(3/2): 2447.
133397 limited interface *note 3.9.4(5/2): 2354.
133398 limited type *note 7.5(3/3): 3909, *note N(23/2): 9558.
133399 becoming nonlimited *note 7.3.1(5/1): 3886, *note 7.5(16): 3915.
133400 immutably *note 7.5(8.1/3): 3912.
133401 limited view *note 10.1.1(12.1/2): 4691.
133402 Limited_Controlled
133403 in Ada.Finalization *note 7.6(7/2): 3932.
133404 limited_with_clause *note 10.1.2(4.1/2): 4706.
133405 used *note 10.1.2(4/2): 4704, *note P: 10299.
133406 line *note 2.2(2/3): 1224.
133407 in Ada.Text_IO *note A.10.1(38): 6925.
133408 line terminator *note A.10(7): 6849.
133409 Line_Length
133410 in Ada.Text_IO *note A.10.1(25): 6902.
133411 link name *note B.1(35): 7969.
133412 link-time error
133413 See post-compilation error *note 1.1.2(29): 1030.
133414 See post-compilation error *note 1.1.5(4): 1094.
133415 Link_Name aspect *note B.1(1/3): 7946.
133416 Linker_Options pragma *note B.1(8): 7957, *note L(19): 9417.
133417 linking
133418 See partition building *note 10.2(2): 4788.
133419 List
133420 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(6/3): 7338.
133421 list container *note A.18.3(1/2): 7333.
133422 List pragma *note 2.8(21): 1330, *note L(20): 9420.
133423 List_Iterator_Interfaces
133424 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9.2/3): 7343.
133425 literal *note 4.2(1): 2649.
133426 based *note 2.4.2(1): 1268.
133427 decimal *note 2.4.1(1): 1255.
133428 numeric *note 2.4(1): 1249.
133429 See also aggregate *note 4.3(1): 2669.
133430 little endian *note 13.5.3(2): 5517.
133431 load time *note C.4(3): 8241.
133432 local to *note 8.1(14): 3994.
133433 local_name *note 13.1(3): 5286.
133434 used *note 13.3(2): 5359, *note 13.4(2): 5458, *note 13.5.1(2):
133435 5480, *note 13.5.1(3): 5484, *note C.5(3): 8244, *note J.15.2(2/3):
133436 9169, *note J.15.3(2/3): 9175, *note J.15.5(2/3): 9196, *note
133437 J.15.5(3/3): 9202, *note J.15.5(4/3): 9208, *note J.15.6(2/3): 9216,
133438 *note J.15.8(2/3): 9229, *note J.15.8(3/3): 9232, *note J.15.8(4/3):
133439 9235, *note J.15.8(5/3): 9238, *note J.15.8(6/3): 9241, *note
133440 J.15.8(7/3): 9244, *note J.15.13(2/3): 9279, *note L(3.1/3): 9346, *note
133441 L(4.1/3): 9349, *note L(5.1/3): 9352, *note L(8.1/3): 9360, *note L(9):
133442 9371, *note L(13.1/3): 9388, *note L(14.1/3): 9394, *note L(14.2/3):
133443 9399, *note L(14.3/3): 9402, *note L(21.2/3): 9428, *note L(24.1/3):
133444 9436, *note L(37.2/3): 9493, *note L(38.1/3): 9499, *note L(39.1/3):
133445 9502, *note P: 10446.
133446 locale *note A.19(1/3): 7924.
133447 active *note A.19(8/3): 7933.
133448 Locales
133449 child of Ada *note A.19(3/3): 7925.
133450 locking policy *note D.3(6/2): 8415.
133451 Ceiling_Locking *note D.3(7): 8419.
133452 Locking_Policy pragma *note D.3(3): 8408, *note L(21): 9423.
133453 Log
133454 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
133455 G.1.2(3): 8896.
133456 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6588.
133457 Logical
133458 in Interfaces.Fortran *note B.5(7): 8164.
133459 logical operator *note 4.5.1(2): 2935.
133460 See also not operator *note 4.5.6(3): 3068.
133461 logical_operator *note 4.5(2): 2916.
133462 long
133463 in Interfaces.C *note B.3(7): 7993.
133464 Long_Binary
133465 in Interfaces.COBOL *note B.4(10): 8110.
133466 long_double
133467 in Interfaces.C *note B.3(17): 8004.
133468 Long_Float *note 3.5.7(15): 1914, *note 3.5.7(16): 1916, *note
133469 3.5.7(17): 1917.
133470 Long_Floating
133471 in Interfaces.COBOL *note B.4(9): 8108.
133472 Long_Integer *note 3.5.4(22): 1852, *note 3.5.4(25): 1853, *note
133473 3.5.4(28): 1857.
133474 Look_Ahead
133475 in Ada.Text_IO *note A.10.1(43): 6934.
133476 loop cursor *note 5.5.2(12/3): 3490.
133477 loop iterator *note 5.5.2(10/3): 3485.
133478 container element iterator *note 5.5.2(12/3): 3489.
133479 loop parameter *note 5.5(6): 3432, *note 5.5.2(7/3): 3484.
133480 loop_parameter_specification *note 5.5(4): 3429.
133481 used *note 4.5.8(1/3): 3113, *note 5.5(3/3): 3427, *note P: 10028.
133482 loop_statement *note 5.5(2): 3420.
133483 used *note 5.1(5/2): 3360, *note P: 10004.
133484 low line *note 2.1(15/3): 1211.
133485 low-level programming *note C(1): 8179.
133486 Low_Line
133487 in Ada.Characters.Latin_1 *note A.3.3(12): 6009.
133488 Low_Order_First *note 13.5.3(2): 5516.
133489 in Interfaces.COBOL *note B.4(25): 8132.
133490 in System *note 13.7(15/2): 5550.
133491 lower bound
133492 of a range *note 3.5(4): 1673.
133493 lower-case letter
133494 a category of Character *note A.3.2(25): 5938.
133495 Lower_Case_Map
133496 in Ada.Strings.Maps.Constants *note A.4.6(5): 6429.
133497 Lower_Set
133498 in Ada.Strings.Maps.Constants *note A.4.6(4): 6421.
133499 LR(1) *note 1.1.4(14.a): 1082.
133500
133501
133502 \1f
133503 File: aarm2012.info, Node: M, Next: N, Prev: L, Up: Index
133504
133505 M
133506 ==
133507
133508
133509
133510 Machine attribute *note A.5.3(60): 6728.
133511 machine code insertion *note 13.8(1): 5576, *note C.1(2): 8185.
133512 machine numbers
133513 of a fixed point type *note 3.5.9(8/2): 1944.
133514 of a floating point type *note 3.5.7(8): 1901.
133515 machine scalar *note 13.3(8.1/3): 5389.
133516 Machine_Code
133517 child of System *note 13.8(7): 5581.
133518 Machine_Emax attribute *note A.5.3(8): 6665.
133519 Machine_Emin attribute *note A.5.3(7): 6663.
133520 Machine_Mantissa attribute *note A.5.3(6): 6661.
133521 Machine_Overflows attribute *note A.5.3(12): 6675, *note A.5.4(4):
133522 6756.
133523 Machine_Radix aspect *note F.1(1): 8828.
133524 Machine_Radix attribute *note A.5.3(2): 6658, *note A.5.4(2): 6752.
133525 Machine_Radix clause *note 13.3(7/2): 5383, *note F.1(1): 8826.
133526 Machine_Rounding attribute *note A.5.3(41.1/2): 6703.
133527 Machine_Rounds attribute *note A.5.3(11): 6673, *note A.5.4(3): 6754.
133528 macro
133529 See generic unit *note 12(1): 5038.
133530 Macron
133531 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6095.
133532 main subprogram
133533 for a partition *note 10.2(7): 4791.
133534 malloc
133535 See allocator *note 4.8(1): 3252.
133536 Map
133537 in Ada.Containers.Hashed_Maps *note A.18.5(3/3): 7429.
133538 in Ada.Containers.Ordered_Maps *note A.18.6(4/3): 7485.
133539 map container *note A.18.4(1/2): 7407.
133540 Map_Iterator_Interfaces
133541 in Ada.Containers.Hashed_Maps *note A.18.5(6.2/3): 7434.
133542 in Ada.Containers.Ordered_Maps *note A.18.6(7.2/3): 7490.
133543 Maps
133544 child of Ada.Strings *note A.4.2(3/2): 6237.
133545 mark_non_spacing *note 2.1(9.4/2): 1173, *note 2.1(9.5/2): 1174.
133546 used *note 2.3(3.1/3): 1242, *note P: 9605.
133547 mark_spacing_combining
133548 used *note 2.3(3.1/3): 1243, *note P: 9606.
133549 marshalling *note E.4(9): 8784.
133550 Masculine_Ordinal_Indicator
133551 in Ada.Characters.Latin_1 *note A.3.3(22): 6108.
133552 master *note 7.6.1(3/2): 3964.
133553 master of a call *note 3.10.2(10.1/3): 2452.
133554 match
133555 a character to a pattern character *note A.4.2(54): 6258.
133556 a character to a pattern character, with respect to a character
133557 mapping function *note A.4.2(64): 6260.
133558 a string to a pattern string *note A.4.2(54): 6259.
133559 matching components *note 4.5.2(16): 2991.
133560 Max attribute *note 3.5(19): 1706.
133561 Max_Alignment_For_Allocation attribute *note 13.11.1(4/3): 5662.
133562 Max_Asynchronous_Select_Nesting restriction *note D.7(18/1): 8502.
133563 Max_Base_Digits *note 3.5.7(6): 1899.
133564 in System *note 13.7(8): 5537.
133565 Max_Binary_Modulus *note 3.5.4(7): 1822.
133566 in System *note 13.7(7): 5535.
133567 Max_Decimal_Digits
133568 in Ada.Decimal *note F.2(5): 8834.
133569 Max_Delta
133570 in Ada.Decimal *note F.2(4): 8833.
133571 Max_Digits *note 3.5.7(6): 1900.
133572 in System *note 13.7(8): 5538.
133573 Max_Digits_Binary
133574 in Interfaces.COBOL *note B.4(11): 8111.
133575 Max_Digits_Long_Binary
133576 in Interfaces.COBOL *note B.4(11): 8112.
133577 Max_Entry_Queue_Length restriction *note D.7(19.1/2): 8512.
133578 Max_Image_Width
133579 in Ada.Numerics.Discrete_Random *note A.5.2(25): 6643.
133580 in Ada.Numerics.Float_Random *note A.5.2(13): 6631.
133581 Max_Int *note 3.5.4(14): 1836.
133582 in System *note 13.7(6): 5534.
133583 Max_Length
133584 in Ada.Strings.Bounded *note A.4.4(5): 6302.
133585 Max_Mantissa
133586 in System *note 13.7(9): 5539.
133587 Max_Nonbinary_Modulus *note 3.5.4(7): 1823.
133588 in System *note 13.7(7): 5536.
133589 Max_Picture_Length
133590 in Ada.Text_IO.Editing *note F.3.3(8): 8846.
133591 Max_Protected_Entries restriction *note D.7(14): 8493.
133592 Max_Scale
133593 in Ada.Decimal *note F.2(3): 8830.
133594 Max_Select_Alternatives restriction *note D.7(12): 8489.
133595 Max_Size_In_Storage_Elements attribute *note 13.11.1(3/3): 5660.
133596 Max_Storage_At_Blocking restriction *note D.7(17/1): 8497.
133597 Max_Task_Entries restriction *note D.7(13): 8491.
133598 Max_Tasks restriction *note D.7(19/1): 8507.
133599 maximum box error
133600 for a component of the result of evaluating a complex function
133601 *note G.2.6(3): 8983.
133602 maximum line length *note A.10(11): 6857.
133603 maximum page length *note A.10(11): 6858.
133604 maximum relative error
133605 for a component of the result of evaluating a complex function
133606 *note G.2.6(3): 8982.
133607 for the evaluation of an elementary function *note G.2.4(2): 8976.
133608 Members
133609 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8628.
133610 Membership
133611 in Ada.Strings *note A.4.1(6): 6233.
133612 membership test *note 4.5.2(2/3): 2983.
133613 membership_choice *note 4.4(3.2/3): 2882.
133614 used *note 4.4(3.1/3): 2881, *note P: 9927.
133615 membership_choice_list *note 4.4(3.1/3): 2879.
133616 used *note 4.4(3/3): 2878, *note P: 9925.
133617 Memory_Size
133618 in System *note 13.7(13): 5546.
133619 mentioned
133620 in a with_clause *note 10.1.2(6/2): 4714.
133621 Merge
133622 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(50/2): 7387.
133623 in Ada.Containers.Vectors *note A.18.2(78/2): 7312.
133624 message
133625 See dispatching call *note 3.9.2(1/2): 2294.
133626 method
133627 See dispatching subprogram *note 3.9.2(1/2): 2295.
133628 methodological restriction *note 10.1.3(13.a): 4749.
133629 metrics *note 1.1.2(35): 1044.
133630 Micro_Sign
133631 in Ada.Characters.Latin_1 *note A.3.3(22): 6102.
133632 Microseconds
133633 in Ada.Real_Time *note D.8(14/2): 8536.
133634 Middle_Dot
133635 in Ada.Characters.Latin_1 *note A.3.3(22): 6105.
133636 Milliseconds
133637 in Ada.Real_Time *note D.8(14/2): 8537.
133638 Min attribute *note 3.5(16): 1703.
133639 Min_Delta
133640 in Ada.Decimal *note F.2(4): 8832.
133641 Min_Handler_Ceiling
133642 in Ada.Execution_Time.Group_Budgets *note D.14.2(7/2): 8623.
133643 in Ada.Execution_Time.Timers *note D.14.1(6/2): 8606.
133644 Min_Int *note 3.5.4(14): 1835.
133645 in System *note 13.7(6): 5533.
133646 Min_Scale
133647 in Ada.Decimal *note F.2(3): 8831.
133648 minus *note 2.1(15/3): 1200.
133649 minus operator *note 4.4(1/3): 2815, *note 4.5.3(1): 3011, *note
133650 4.5.4(1): 3036.
133651 Minus_Sign
133652 in Ada.Characters.Latin_1 *note A.3.3(8): 5995.
133653 Minute
133654 in Ada.Calendar.Formatting *note 9.6.1(25/2): 4511.
133655 Minute_Number subtype of Natural
133656 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4504.
133657 Minutes
133658 in Ada.Real_Time *note D.8(14/2): 8539.
133659 mixed-language programs *note B(1): 7937, *note C.1(4/3): 8188.
133660 Mod attribute *note 3.5.4(16.1/2): 1841.
133661 mod operator *note 4.4(1/3): 2834, *note 4.5.5(1): 3050.
133662 mod_clause *note J.8(1): 9142.
133663 used *note 13.5.1(2): 5481, *note P: 10450.
133664 mode *note 6.1(16): 3560.
133665 used *note 6.1(15/3): 3553, *note 12.4(2/3): 5136, *note P: 10071.
133666 in Ada.Direct_IO *note A.8.4(9): 6818.
133667 in Ada.Sequential_IO *note A.8.1(9): 6790.
133668 in Ada.Streams.Stream_IO *note A.12.1(11): 7077.
133669 in Ada.Text_IO *note A.10.1(12): 6875.
133670 mode conformance *note 6.3.1(16/3): 3669.
133671 required *note 8.5.4(4/3): 4117, *note 8.5.4(5/3): 4120, *note
133672 12.6(7/3): 5246, *note 12.6(8/3): 5247, *note 13.3(6): 5368.
133673 mode of operation
133674 nonstandard *note 1.1.5(11): 1101.
133675 standard *note 1.1.5(11): 1103.
133676 Mode_Error
133677 in Ada.Direct_IO *note A.8.4(18): 6831.
133678 in Ada.IO_Exceptions *note A.13(4): 7116.
133679 in Ada.Sequential_IO *note A.8.1(15): 6798.
133680 in Ada.Streams.Stream_IO *note A.12.1(26): 7093.
133681 in Ada.Text_IO *note A.10.1(85): 7007.
133682 Model attribute *note A.5.3(68): 6742, *note G.2.2(7): 8964.
133683 model interval *note G.2.1(4): 8945.
133684 associated with a value *note G.2.1(4): 8946.
133685 model number *note G.2.1(3): 8944.
133686 model-oriented attributes
133687 of a floating point subtype *note A.5.3(63): 6732.
133688 Model_Emin attribute *note A.5.3(65): 6736, *note G.2.2(4): 8957.
133689 Model_Epsilon attribute *note A.5.3(66): 6738.
133690 Model_Mantissa attribute *note A.5.3(64): 6734, *note G.2.2(3/2):
133691 8955.
133692 Model_Small attribute *note A.5.3(67): 6740.
133693 Modification_Time
133694 in Ada.Directories *note A.16(27/2): 7160, *note A.16(42/2): 7172.
133695 modular type *note 3.5.4(1): 1809.
133696 Modular_IO
133697 in Ada.Text_IO *note A.10.1(57): 6958.
133698 modular_type_definition *note 3.5.4(4): 1817.
133699 used *note 3.5.4(2): 1813, *note P: 9720.
133700 module
133701 See package *note 7(1): 3823.
133702 modulus
133703 of a modular type *note 3.5.4(7): 1821.
133704 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(10/2): 9014,
133705 *note G.3.2(30/2): 9027.
133706 in Ada.Numerics.Generic_Complex_Types *note G.1.1(9): 8880.
133707 Modulus attribute *note 3.5.4(17): 1843.
133708 Monday
133709 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4495.
133710 Month
133711 in Ada.Calendar *note 9.6(13): 4466.
133712 in Ada.Calendar.Formatting *note 9.6.1(22/2): 4508.
133713 Month_Number subtype of Integer
133714 in Ada.Calendar *note 9.6(11/2): 4461.
133715 More_Entries
133716 in Ada.Directories *note A.16(34/2): 7166.
133717 Move
133718 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(18/2): 7356.
133719 in Ada.Containers.Hashed_Maps *note A.18.5(18/2): 7452.
133720 in Ada.Containers.Hashed_Sets *note A.18.8(18/2): 7587.
133721 in Ada.Containers.Indefinite_Holders *note A.18.18(22/3): 7840.
133722 in Ada.Containers.Multiway_Trees *note A.18.10(34/3): 7759.
133723 in Ada.Containers.Ordered_Maps *note A.18.6(17/2): 7506.
133724 in Ada.Containers.Ordered_Sets *note A.18.9(17/2): 7661.
133725 in Ada.Containers.Vectors *note A.18.2(35/2): 7270.
133726 in Ada.Strings.Fixed *note A.4.3(7): 6263.
133727 multi-dimensional array *note 3.6(12): 2014.
133728 Multiplication_Sign
133729 in Ada.Characters.Latin_1 *note A.3.3(24): 6137.
133730 multiply *note 2.1(15/3): 1196.
133731 multiply operator *note 4.4(1/3): 2826, *note 4.5.5(1): 3042.
133732 multiplying operator *note 4.5.5(1): 3038.
133733 multiplying_operator *note 4.5(6): 2920.
133734 used *note 4.4(5): 2893, *note P: 9936.
133735 Multiprocessors
133736 child of System *note D.16(3/3): 8663.
133737 Multiway_Trees
133738 child of Ada.Containers *note A.18.10(7/3): 7733.
133739 mutable *note 3.7(28.b): 2115.
133740 mutates *note 7.6(17.6/3): 3950.
133741 MW
133742 in Ada.Characters.Latin_1 *note A.3.3(18): 6068.
133743
133744
133745 \1f
133746 File: aarm2012.info, Node: N, Next: O, Prev: M, Up: Index
133747
133748 N
133749 ==
133750
133751
133752
133753 n-dimensional array_aggregate *note 4.3.3(6): 2748.
133754 NAK
133755 in Ada.Characters.Latin_1 *note A.3.3(6): 5970.
133756 name *note 4.1(2/3): 2522.
133757 [partial] *note 3.1(1): 1343.
133758 of (a view of) an entity *note 3.1(8): 1370.
133759 of a pragma *note 2.8(9): 1317.
133760 of an external file *note A.7(1): 6764.
133761 used *note 2.8(3/3): 1314, *note 3.2.2(4): 1470, *note 4.1(4):
133762 2539, *note 4.1(5): 2542, *note 4.1(6): 2544, *note 4.1.5(4/3): 2626,
133763 *note 4.4(7/3): 2904, *note 4.6(2): 3135, *note 4.8(2.1/3): 3260, *note
133764 5.2(2): 3377, *note 5.5.2(2/3): 3471, *note 5.7(2): 3499, *note 5.8(2):
133765 3504, *note 6.4(2): 3690, *note 6.4(3): 3694, *note 6.4(6): 3705, *note
133766 8.4(3): 4059, *note 8.5.1(2/3): 4085, *note 8.5.2(2/3): 4101, *note
133767 8.5.3(2/3): 4106, *note 8.5.4(2/3): 4114, *note 8.5.5(2/3): 4130, *note
133768 9.5.3(2): 4404, *note 9.5.4(2/3): 4432, *note 9.8(2): 4601, *note
133769 10.1.1(8): 4672, *note 10.1.2(4.1/2): 4707, *note 10.1.2(4.2/2): 4710,
133770 *note 10.2.1(3): 4813, *note 10.2.1(14): 4830, *note 10.2.1(20): 4841,
133771 *note 10.2.1(21): 4845, *note 10.2.1(22): 4848, *note 11.2(5): 4898,
133772 *note 11.3(2/2): 4906, *note 12.3(2/3): 5083, *note 12.3(5): 5098, *note
133773 12.6(4): 5243, *note 12.7(2/3): 5259, *note 13.1(3): 5290, *note
133774 13.1.1(4/3): 5334, *note 13.3(2): 5361, *note 13.11.3(3.1/3): 5686,
133775 *note 13.12(4.1/2): 5737, *note E.2.1(3): 8718, *note E.2.2(3): 8733,
133776 *note E.2.3(3): 8749, *note E.2.3(5): 8752, *note H.3.2(3): 9064, *note
133777 J.10(3/2): 9150, *note J.15.1(2/3): 9160, *note J.15.7(2/3): 9219, *note
133778 J.15.7(4/3): 9222, *note L(2): 9330, *note L(6.1/3): 9355, *note L(10):
133779 9376, *note L(11): 9381, *note L(12): 9384, *note L(15.1/3): 9405, *note
133780 L(16): 9409, *note L(17.1/3): 9413, *note L(26): 9447, *note L(28):
133781 9461, *note L(30): 9469, *note L(31): 9472, *note L(34): 9481, *note P:
133782 9846.
133783 in Ada.Direct_IO *note A.8.4(9): 6819.
133784 in Ada.Sequential_IO *note A.8.1(9): 6791.
133785 in Ada.Streams.Stream_IO *note A.12.1(11): 7078.
133786 in Ada.Text_IO *note A.10.1(12): 6876.
133787 in System *note 13.7(4): 5531.
133788 name resolution rules *note 1.1.2(26/3): 1018.
133789 Name_Case_Equivalence
133790 in Ada.Directories *note A.16(20.2/3): 7154.
133791 Name_Case_Kind
133792 in Ada.Directories *note A.16(20.1/3): 7153.
133793 Name_Error
133794 in Ada.Direct_IO *note A.8.4(18): 6832.
133795 in Ada.Directories *note A.16(43/2): 7174.
133796 in Ada.IO_Exceptions *note A.13(4): 7117.
133797 in Ada.Sequential_IO *note A.8.1(15): 6799.
133798 in Ada.Streams.Stream_IO *note A.12.1(26): 7094.
133799 in Ada.Text_IO *note A.10.1(85): 7008.
133800 named
133801 in a use clause *note 8.4(7.1/2): 4065.
133802 in a with_clause *note 10.1.2(6/2): 4716.
133803 named association *note 6.4(7): 3706, *note 6.4.1(2/3): 3715, *note
133804 12.3(6): 5099.
133805 named component association *note 4.3.1(6): 2696.
133806 named discriminant association *note 3.7.1(4): 2126.
133807 named entry index *note 9.5.2(21): 4390.
133808 named number *note 3.3(24): 1539.
133809 named parameter association *note 6.4.1(2/3): 3717.
133810 named type *note 3.2.1(7/2): 1450.
133811 named_array_aggregate *note 4.3.3(4): 2741.
133812 used *note 4.3.3(2): 2731, *note P: 9884.
133813 Names
133814 child of Ada.Interrupts *note C.3.2(12): 8235.
133815 Nanoseconds
133816 in Ada.Real_Time *note D.8(14/2): 8535.
133817 Native_Binary
133818 in Interfaces.COBOL *note B.4(25): 8133.
133819 Natural *note 3.5.4(12): 1832.
133820 Natural subtype of Integer
133821 in Standard *note A.1(13): 5881.
133822 NBH
133823 in Ada.Characters.Latin_1 *note A.3.3(17): 6050.
133824 NBSP
133825 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6080.
133826 needed
133827 of a compilation unit by another *note 10.2(2): 4790.
133828 remote call interface *note E.2.3(18): 8765.
133829 shared passive library unit *note E.2.1(11): 8726.
133830 needed component
133831 extension_aggregate record_component_association_list *note
133832 4.3.2(6): 2719.
133833 record_aggregate record_component_association_list *note 4.3.1(9):
133834 2699.
133835 needs finalization *note 7.6(9.1/2): 3936.
133836 language-defined type *note A.4.5(72.1/2): 6413, *note
133837 A.5.2(15.1/2): 6634, *note A.5.2(27.1/2): 6646, *note A.8.1(17/2): 6804,
133838 *note A.8.4(20/2): 6837, *note A.10.1(86/2): 7014, *note A.12.1(27.1/2):
133839 7099, *note A.16(102/2): 7186, *note A.18.2(147.3/3): 7319, *note
133840 A.18.2(84/2): 7314, *note A.18.3(56/2): 7389, *note A.18.3(86.3/3):
133841 7394, *note A.18.4(4/2): 7410, *note A.18.4(41.3/3): 7420, *note
133842 A.18.7(4/2): 7547, *note A.18.7(36.2/3): 7556, *note A.18.7(96.2/3):
133843 7559, *note A.18.10(124/3): 7802, *note A.18.10(73/3): 7797, *note
133844 A.18.18(27/3): 7841, *note A.18.18(54/3): 7845, *note D.14.2(13/2):
133845 8637, *note D.15(8/2): 8658.
133846 NEL
133847 in Ada.Characters.Latin_1 *note A.3.3(17): 6052.
133848 new
133849 See allocator *note 4.8(1): 3251.
133850 New_Char_Array
133851 in Interfaces.C.Strings *note B.3.1(9): 8058.
133852 New_Line
133853 in Ada.Text_IO *note A.10.1(28): 6906.
133854 New_Page
133855 in Ada.Text_IO *note A.10.1(31): 6912.
133856 New_String
133857 in Interfaces.C.Strings *note B.3.1(10): 8059.
133858 Next
133859 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(37/2): 7375,
133860 *note A.18.3(39/2): 7377.
133861 in Ada.Containers.Hashed_Maps *note A.18.5(28/2): 7462, *note
133862 A.18.5(29/2): 7463.
133863 in Ada.Containers.Hashed_Sets *note A.18.8(41/2): 7606, *note
133864 A.18.8(42/2): 7607.
133865 in Ada.Containers.Ordered_Maps *note A.18.6(34/2): 7523, *note
133866 A.18.6(35/2): 7524.
133867 in Ada.Containers.Ordered_Sets *note A.18.9(45/2): 7685, *note
133868 A.18.9(46/2): 7686.
133869 in Ada.Containers.Vectors *note A.18.2(63/2): 7298, *note
133870 A.18.2(64/2): 7299.
133871 in Ada.Iterator_Interfaces *note 5.5.1(3/3): 3442.
133872 Next_Sibling
133873 in Ada.Containers.Multiway_Trees *note A.18.10(64/3): 7789, *note
133874 A.18.10(66/3): 7791.
133875 No_Abort_Statements restriction *note D.7(5/3): 8459.
133876 No_Access_Parameter_Allocators restriction *note H.4(8.3/3): 9078.
133877 No_Access_Subprograms restriction *note H.4(17): 9088.
133878 No_Allocators restriction *note H.4(7): 9070.
133879 No_Anonymous_Allocators restriction *note H.4(8.1/3): 9074.
133880 No_Break_Space
133881 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6079.
133882 No_Coextensions restriction *note H.4(8.2/3): 9076.
133883 No_Delay restriction *note H.4(21): 9098.
133884 No_Dependence restriction *note 13.12.1(6/2): 5763.
133885 No_Deposit aspect *note 6.5.1(1.a/3): 3785.
133886 No_Dispatch restriction *note H.4(19): 9094.
133887 No_Dynamic_Attachment restriction *note D.7(10/3): 8470.
133888 No_Dynamic_Priorities restriction *note D.7(9/2): 8468.
133889 No_Element
133890 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(9/2): 7341.
133891 in Ada.Containers.Hashed_Maps *note A.18.5(6/2): 7432.
133892 in Ada.Containers.Hashed_Sets *note A.18.8(6/2): 7571.
133893 in Ada.Containers.Multiway_Trees *note A.18.10(11/3): 7737.
133894 in Ada.Containers.Ordered_Maps *note A.18.6(7/2): 7488.
133895 in Ada.Containers.Ordered_Sets *note A.18.9(7/2): 7647.
133896 in Ada.Containers.Vectors *note A.18.2(11/2): 7242.
133897 No_Exceptions restriction *note H.4(12): 9082.
133898 No_Fixed_Point restriction *note H.4(15): 9086.
133899 No_Floating_Point restriction *note H.4(14): 9084.
133900 No_Implementation_Aspect_Specifications restriction *note
133901 13.12.1(1.1/3): 5751.
133902 No_Implementation_Attributes restriction *note 13.12.1(2/2): 5753.
133903 No_Implementation_Identifiers restriction *note 13.12.1(2.1/3): 5755.
133904 No_Implementation_Pragmas restriction *note 13.12.1(3/2): 5757.
133905 No_Implementation_Units restriction *note 13.12.1(3.1/3): 5759.
133906 No_Implicit_Heap_Allocations restriction *note D.7(8): 8466.
133907 No_Index
133908 in Ada.Containers.Vectors *note A.18.2(7/2): 7238.
133909 No_IO restriction *note H.4(20/2): 9096.
133910 No_Local_Allocators restriction *note H.4(8/1): 9072.
133911 No_Local_Protected_Objects restriction *note D.7(10.1/3): 8472.
133912 No_Local_Timing_Events restriction *note D.7(10.2/3): 8474.
133913 No_Nested_Finalization restriction *note D.7(4/3): 8457.
133914 No_Obsolescent_Features restriction *note 13.12.1(4/3): 5761.
133915 No_Protected_Type_Allocators restriction *note D.7(10.3/2): 8476.
133916 No_Protected_Types restriction *note H.4(5): 9068.
133917 No_Recursion restriction *note H.4(22): 9100.
133918 No_Reentrancy restriction *note H.4(23): 9102.
133919 No_Relative_Delay restriction *note D.7(10.5/3): 8479.
133920 No_Requeue_Statements restriction *note D.7(10.6/3): 8481.
133921 No_Return aspect *note 6.5.1(3.2/3): 3788.
133922 No_Return pragma *note J.15.2(2/3): 9168, *note L(21.2/3): 9426.
133923 No_Select_Statements restriction *note D.7(10.7/3): 8483.
133924 No_Specific_Termination_Handlers restriction *note D.7(10.8/3): 8485.
133925 No_Specification_of_Aspect restriction *note 13.12.1(6.1/3): 5765.
133926 No_Standard_Allocators_After_Elaboration restriction *note
133927 D.7(19.2/3): 8515.
133928 No_Tag
133929 in Ada.Tags *note 3.9(6.1/2): 2231.
133930 No_Task_Allocators restriction *note D.7(7): 8463.
133931 No_Task_Hierarchy restriction *note D.7(3/3): 8455.
133932 No_Task_Termination restriction *note D.7(15.1/2): 8495.
133933 No_Terminate_Alternatives restriction *note D.7(6): 8461.
133934 No_Unchecked_Access restriction *note H.4(18): 9090.
133935 No_Use_Of_Attribute restriction *note 13.12.1(6.2/3): 5767.
133936 No_Use_Of_Pragma restriction *note 13.12.1(6.3/3): 5769.
133937 node
133938 of a list *note A.18.3(2/2): 7335.
133939 of a map *note A.18.4(5/2): 7411.
133940 of a tree *note A.18.10(2/3): 7723.
133941 Node_Count
133942 in Ada.Containers.Multiway_Trees *note A.18.10(17/3): 7742.
133943 nominal subtype *note 3.3(23/3): 1532, *note 3.3.1(8/2): 1571.
133944 associated with a dereference *note 4.1(9/3): 2547.
133945 associated with a type_conversion *note 4.6(27): 3170.
133946 associated with an indexed_component *note 4.1.1(5): 2565.
133947 of a component *note 3.6(20): 2027.
133948 of a formal parameter *note 6.1(23/2): 3568.
133949 of a function result *note 6.1(23/2): 3569.
133950 of a generic formal object *note 12.4(9/2): 5146.
133951 of a name *note 4.1(9.b): 2548.
133952 of a record component *note 3.8(14): 2167.
133953 of the result of a function_call *note 6.4(12/2): 3711.
133954 Non_Preemptive
133955 child of Ada.Dispatching *note D.2.4(2.2/3): 8377.
133956 Non_Preemptive_FIFO_Within_Priorities task disp. policy *note
133957 D.2.4(2/2): 8376.
133958 nonconfirming
133959 aspect specification *note 13.1(18.2/3): 5317.
133960 representation item *note 13.1(18.2/3): 5316.
133961 representation value *note 13.1(18.2/3): 5315.
133962 nondispatching call
133963 on a dispatching operation *note 3.9.2(1/2): 2286.
133964 nonexistent *note 13.11.2(10/2): 5672, *note 13.11.2(16/3): 5680.
133965 nongraphic character *note 3.5(27.5/2): 1724.
133966 nonlimited interface *note 3.9.4(5/2): 2355.
133967 nonlimited type *note 7.5(7): 3910.
133968 becoming nonlimited *note 7.3.1(5/1): 3885, *note 7.5(16): 3914.
133969 nonlimited_with_clause *note 10.1.2(4.2/2): 4709.
133970 used *note 10.1.2(4/2): 4705, *note P: 10300.
133971 nonnormative
133972 See informative *note 1.1.2(18): 1011.
133973 nonreturning *note 6.5.1(3.2/3): 3786.
133974 nonstandard integer type *note 3.5.4(26): 1855.
133975 nonstandard mode *note 1.1.5(11): 1102.
133976 nonstandard real type *note 3.5.6(8): 1888.
133977 normal completion *note 7.6.1(2/2): 3958.
133978 normal library unit *note E.2(4/3): 8713.
133979 normal state of an object *note 11.6(6/3): 5032, *note 13.9.1(4):
133980 5597.
133981 [partial] *note 9.8(21): 4615, *note A.13(17): 7124.
133982 normal termination
133983 of a partition *note 10.2(25.c): 4801.
133984 Normalize_Scalars pragma *note H.1(3): 9053, *note L(22): 9430.
133985 normalized exponent *note A.5.3(14): 6678.
133986 normalized number *note A.5.3(10): 6669.
133987 normative *note 1.1.2(14): 1008.
133988 not equal operator *note 4.4(1/3): 2789, *note 4.5.2(1): 2964.
133989 not in (membership test) *note 4.4(1/3): 2808, *note 4.5.2(2/3): 2985.
133990 not operator *note 4.4(1/3): 2845, *note 4.5.6(3): 3066.
133991 Not_A_Specific_CPU
133992 in System.Multiprocessors *note D.16(4/3): 8665.
133993 Not_Sign
133994 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6092.
133995 notes *note 1.1.2(38): 1048.
133996 notwithstanding *note 7.6(17.5/3): 3949, *note 10.1.6(6/2): 4781,
133997 *note 10.2(18.c): 4797, *note B.1(22/3): 7965, *note B.1(38/3): 7971,
133998 *note C.3.1(19/3): 8220, *note E.2.1(8): 8723, *note E.2.1(11): 8727,
133999 *note E.2.3(18): 8766, *note H.6(7/2): 9117, *note J.3(6): 9124.
134000 [partial] *note J.15.5(8/3): 9211.
134001 NUL
134002 in Ada.Characters.Latin_1 *note A.3.3(5): 5949.
134003 in Interfaces.C *note B.3(20/1): 8006.
134004 null access value *note 4.2(9): 2659.
134005 null array *note 3.6.1(7): 2048.
134006 null constraint *note 3.2(7/2): 1411.
134007 null extension *note 3.9.1(4.1/2): 2280.
134008 null pointer
134009 See null access value *note 4.2(9): 2660.
134010 null procedure *note 6.7(3/3): 3804.
134011 null range *note 3.5(4): 1676.
134012 null record *note 3.8(15): 2168.
134013 null slice *note 4.1.2(7): 2581.
134014 null string literal *note 2.6(6): 1300.
134015 null value
134016 of an access type *note 3.10(13/2): 2412.
134017 Null_Address
134018 in System *note 13.7(12): 5543.
134019 Null_Bounded_String
134020 in Ada.Strings.Bounded *note A.4.4(7): 6304.
134021 null_exclusion *note 3.10(5.1/2): 2384.
134022 used *note 3.2.2(3/2): 1466, *note 3.7(5/2): 2090, *note 3.10(2/2):
134023 2375, *note 3.10(6/2): 2388, *note 6.1(13/2): 3544, *note 6.1(15/3):
134024 3554, *note 8.5.1(2/3): 4083, *note 12.4(2/3): 5131, *note P: 10372.
134025 Null_Id
134026 in Ada.Exceptions *note 11.4.1(2/2): 4929.
134027 Null_Occurrence
134028 in Ada.Exceptions *note 11.4.1(3/2): 4935.
134029 null_procedure_declaration *note 6.7(2/3): 3799.
134030 used *note 3.1(3/3): 1351, *note P: 9649.
134031 Null_Ptr
134032 in Interfaces.C.Strings *note B.3.1(7): 8056.
134033 Null_Set
134034 in Ada.Strings.Maps *note A.4.2(5): 6239.
134035 in Ada.Strings.Wide_Maps *note A.4.7(5): 6451.
134036 in Ada.Strings.Wide_Wide_Maps *note A.4.8(5/2): 6493.
134037 null_statement *note 5.1(6): 3365.
134038 used *note 5.1(4/2): 3345, *note P: 9990.
134039 Null_Task_Id
134040 in Ada.Task_Identification *note C.7.1(2/2): 8274.
134041 Null_Unbounded_String
134042 in Ada.Strings.Unbounded *note A.4.5(5): 6364.
134043 Number of the Beast *note 6.6(6.a/3): 3797.
134044 number sign *note 2.1(15/3): 1189.
134045 Number_Base subtype of Integer
134046 in Ada.Text_IO *note A.10.1(6): 6867.
134047 number_decimal *note 2.1(10/2): 1175.
134048 used *note 2.3(3.1/3): 1244, *note P: 9607.
134049 number_declaration *note 3.3.2(2): 1598.
134050 used *note 3.1(3/3): 1348, *note P: 9646.
134051 number_letter *note 2.1(10.1/2): 1176.
134052 used *note 2.3(3/2): 1240, *note P: 9604.
134053 Number_Of_CPUs
134054 in System.Multiprocessors *note D.16(5/3): 8667.
134055 Number_Sign
134056 in Ada.Characters.Latin_1 *note A.3.3(8): 5984.
134057 numeral *note 2.4.1(3): 1260.
134058 used *note 2.4.1(2): 1258, *note 2.4.1(4): 1265, *note 2.4.2(3):
134059 1284, *note P: 9611.
134060 Numeric
134061 in Interfaces.COBOL *note B.4(20/3): 8123.
134062 numeric type *note 3.5(1): 1665.
134063 numeric_literal *note 2.4(2): 1252.
134064 used *note 4.4(7/3): 2901, *note P: 9942.
134065 numerics *note G(1): 8864.
134066 child of Ada *note A.5(3/2): 6579.
134067
134068
134069 \1f
134070 File: aarm2012.info, Node: O, Next: P, Prev: N, Up: Index
134071
134072 O
134073 ==
134074
134075
134076
134077 O(f(N)) *note A.18(3/2): 7220.
134078 object *note 3.3(2): 1522, *note N(24): 9559.
134079 [partial] *note 3.2(1): 1388.
134080 object-oriented programming (OOP)
134081 See dispatching operations of tagged types *note 3.9.2(1/2): 2292.
134082 See tagged types and type extensions *note 3.9(1): 2213.
134083 object_declaration *note 3.3.1(2/3): 1548.
134084 used *note 3.1(3/3): 1347, *note P: 9645.
134085 object_renaming_declaration *note 8.5.1(2/3): 4081.
134086 used *note 8.5(2): 4073, *note P: 10138.
134087 obsolescent feature *note J(1/2): 9119.
134088 occur immediately within *note 8.1(13): 3989.
134089 occurrence
134090 of an interrupt *note C.3(2): 8193.
134091 occurrence (of an exception) *note 11(1.c): 4869.
134092 octal
134093 literal *note 2.4.2(1): 1274.
134094 octal literal *note 2.4.2(1): 1272.
134095 Old attribute *note 6.1.1(26/3): 3603.
134096 one's complement
134097 modular types *note 3.5.4(27): 1856.
134098 one-dimensional array *note 3.6(12): 2013.
134099 one-pass context_clauses *note 10.1.2(1.a): 4696.
134100 only as a completion
134101 entry_body *note 9.5.2(16): 4381.
134102 OOP (object-oriented programming)
134103 See dispatching operations of tagged types *note 3.9.2(1/2): 2293.
134104 See tagged types and type extensions *note 3.9(1): 2214.
134105 opaque type
134106 See private types and private extensions *note 7.3(1): 3854.
134107 Open
134108 in Ada.Direct_IO *note A.8.4(7): 6813.
134109 in Ada.Sequential_IO *note A.8.1(7): 6785.
134110 in Ada.Streams.Stream_IO *note A.12.1(9): 7072.
134111 in Ada.Text_IO *note A.10.1(10): 6870.
134112 open alternative *note 9.7.1(14): 4554.
134113 open entry *note 9.5.3(5): 4406.
134114 of a protected object *note 9.5.3(7/3): 4412.
134115 of a task *note 9.5.3(6/3): 4410.
134116 operand
134117 of a qualified_expression *note 4.7(3): 3241.
134118 of a type_conversion *note 4.6(3): 3137.
134119 operand interval *note G.2.1(6): 8947.
134120 operand type
134121 of a type_conversion *note 4.6(3): 3138.
134122 operates on a type *note 3.2.3(1/2): 1491.
134123 operation *note 3.2(10.a): 1427.
134124 operational aspect *note 13.1(8.1/3): 5304.
134125 specifiable attributes *note 13.3(5/3): 5367.
134126 operational item *note 13.1(1.1/1): 5280.
134127 operator *note 6.6(1): 3793.
134128 & *note 4.4(1/3): 2818, *note 4.5.3(3): 3014.
134129 * *note 4.4(1/3): 2825, *note 4.5.5(1): 3041.
134130 ** *note 4.4(1/3): 2839, *note 4.5.6(7): 3075.
134131 + *note 4.4(1/3): 2810, *note 4.5.3(1): 3006, *note 4.5.4(1): 3031.
134132 - *note 4.4(1/3): 2814, *note 4.5.3(1): 3010, *note 4.5.4(1): 3035.
134133 / *note 4.4(1/3): 2831, *note 4.5.5(1): 3047.
134134 /= *note 4.4(1/3): 2788, *note 4.5.2(1): 2963.
134135 < *note 4.4(1/3): 2792, *note 4.5.2(1): 2967.
134136 <= *note 4.4(1/3): 2796, *note 4.5.2(1): 2971.
134137 = *note 4.4(1/3): 2784, *note 4.5.2(1): 2959.
134138 > *note 4.4(1/3): 2800, *note 4.5.2(1): 2975.
134139 >= *note 4.4(1/3): 2804, *note 4.5.2(1): 2979.
134140 abs *note 4.4(1/3): 2843, *note 4.5.6(1): 3064.
134141 ampersand *note 4.4(1/3): 2820, *note 4.5.3(3): 3016.
134142 and *note 4.4(1/3): 2776, *note 4.5.1(2): 2938.
134143 binary *note 4.5(9): 2925.
134144 binary adding *note 4.5.3(1): 3004.
134145 concatenation *note 4.4(1/3): 2822, *note 4.5.3(3): 3018.
134146 divide *note 4.4(1/3): 2833, *note 4.5.5(1): 3049.
134147 equal *note 4.4(1/3): 2786, *note 4.5.2(1): 2961.
134148 equality *note 4.5.2(1): 2955.
134149 exponentiation *note 4.4(1/3): 2841, *note 4.5.6(7): 3073.
134150 greater than *note 4.4(1/3): 2802, *note 4.5.2(1): 2977.
134151 greater than or equal *note 4.4(1/3): 2806, *note 4.5.2(1): 2981.
134152 highest precedence *note 4.5.6(1): 3062.
134153 less than *note 4.4(1/3): 2794, *note 4.5.2(1): 2969.
134154 less than or equal *note 4.4(1/3): 2798, *note 4.5.2(1): 2973.
134155 logical *note 4.5.1(2): 2936.
134156 minus *note 4.4(1/3): 2816, *note 4.5.3(1): 3012, *note 4.5.4(1):
134157 3037.
134158 mod *note 4.4(1/3): 2835, *note 4.5.5(1): 3051.
134159 multiply *note 4.4(1/3): 2827, *note 4.5.5(1): 3043.
134160 multiplying *note 4.5.5(1): 3039.
134161 not *note 4.4(1/3): 2846, *note 4.5.6(3): 3067.
134162 not equal *note 4.4(1/3): 2790, *note 4.5.2(1): 2965.
134163 or *note 4.4(1/3): 2778, *note 4.5.1(2): 2940.
134164 ordering *note 4.5.2(1): 2957.
134165 plus *note 4.4(1/3): 2812, *note 4.5.3(1): 3008, *note 4.5.4(1):
134166 3033.
134167 predefined *note 4.5(9): 2923.
134168 relational *note 4.5.2(1): 2952.
134169 rem *note 4.4(1/3): 2837, *note 4.5.5(1): 3053.
134170 times *note 4.4(1/3): 2829, *note 4.5.5(1): 3045.
134171 unary *note 4.5(9): 2927.
134172 unary adding *note 4.5.4(1): 3029.
134173 user-defined *note 6.6(1): 3795.
134174 xor *note 4.4(1/3): 2780, *note 4.5.1(2): 2942.
134175 operator precedence *note 4.5(1): 2915.
134176 operator_symbol *note 6.1(9): 3536.
134177 used *note 4.1(3): 2537, *note 4.1.3(3): 2590, *note 6.1(5): 3529,
134178 *note 6.1(11): 3539, *note P: 10055.
134179 optimization *note 11.5(29): 5017, *note 11.6(1/3): 5025.
134180 Optimize pragma *note 2.8(23): 1335, *note L(23): 9432.
134181 or else (short-circuit control form) *note 4.4(1/3): 2782, *note
134182 4.5.1(1): 2933.
134183 or operator *note 4.4(1/3): 2777, *note 4.5.1(2): 2939.
134184 Ordered_Maps
134185 child of Ada.Containers *note A.18.6(2/3): 7483.
134186 Ordered_Sets
134187 child of Ada.Containers *note A.18.9(2/3): 7642.
134188 ordering operator *note 4.5.2(1): 2956.
134189 ordinary file *note A.16(45/2): 7179.
134190 ordinary fixed point type *note 3.5.9(1): 1923, *note 3.5.9(8/2):
134191 1945.
134192 ordinary_fixed_point_definition *note 3.5.9(3): 1929.
134193 used *note 3.5.9(2): 1927, *note P: 9730.
134194 OSC
134195 in Ada.Characters.Latin_1 *note A.3.3(19): 6076.
134196 other_control *note 2.1(13.1/2): 1184.
134197 other_format *note 2.1(10.3/2): 1178.
134198 other_private_use *note 2.1(13.2/2): 1185.
134199 other_surrogate *note 2.1(13.3/2): 1186.
134200 others choice *note 4.3.3(6.b): 2751.
134201 output *note A.6(1/2): 6760.
134202 Output aspect *note 13.13.2(38/3): 5827.
134203 Output attribute *note 13.13.2(19): 5800, *note 13.13.2(29): 5804.
134204 Output clause *note 13.3(7/2): 5382, *note 13.13.2(38/3): 5819.
134205 overall interpretation
134206 of a complete context *note 8.6(10): 4145.
134207 Overflow_Check *note 11.5(16): 5005.
134208 [partial] *note 3.5.4(20): 1845, *note 4.4(11): 2910, *note
134209 4.5.7(21/3): 3106, *note 5.4(13): 3415, *note G.2.1(11): 8949, *note
134210 G.2.2(7): 8965, *note G.2.3(25): 8971, *note G.2.4(2): 8977, *note
134211 G.2.6(3): 8984.
134212 Overlap
134213 in Ada.Containers.Hashed_Sets *note A.18.8(38/2): 7603.
134214 in Ada.Containers.Ordered_Sets *note A.18.9(39/2): 7679.
134215 Overlaps_Storage attribute *note 13.3(73.6/3): 5446.
134216 overload resolution *note 8.6(1/3): 4140.
134217 overloadable *note 8.3(7): 4022.
134218 overloaded *note 8.3(6): 4021.
134219 enumeration literal *note 3.5.1(9): 1780.
134220 overloading rules *note 1.1.2(26/3): 1019, *note 8.6(2): 4141.
134221 overridable *note 8.3(9/1): 4026.
134222 override *note 8.3(9/1): 4025, *note 12.3(17): 5117.
134223 a primitive subprogram *note 3.2.3(7/2): 1495.
134224 when implemented by *note 8.3(13.b/3): 4028, *note 9.1(9.2/3):
134225 4225, *note 9.4(11.1/3): 4298.
134226 overriding operation *note N(24.1/2): 9560.
134227 overriding_indicator *note 8.3.1(2/2): 4050.
134228 used *note 3.9.3(1.1/3): 2327, *note 6.1(2/3): 3514, *note
134229 6.3(2/3): 3640, *note 6.7(2/3): 3800, *note 6.8(2/3): 3810, *note
134230 8.5.4(2/3): 4112, *note 9.5.2(2/3): 4348, *note 10.1.3(3/3): 4729, *note
134231 12.3(2/3): 5081, *note P: 10355.
134232 Overwrite
134233 in Ada.Strings.Bounded *note A.4.4(62): 6344, *note A.4.4(63):
134234 6345.
134235 in Ada.Strings.Fixed *note A.4.3(27): 6285, *note A.4.3(28): 6286.
134236 in Ada.Strings.Unbounded *note A.4.5(57): 6401, *note A.4.5(58):
134237 6402.
134238
134239
134240 \1f
134241 File: aarm2012.info, Node: P, Next: Q, Prev: O, Up: Index
134242
134243 P
134244 ==
134245
134246
134247
134248 Pack aspect *note 13.2(5.1/3): 5349.
134249 Pack pragma *note J.15.3(2/3): 9174, *note L(24.1/3): 9435.
134250 Package *note 7(1): 3820, *note N(25): 9561.
134251 package instance *note 12.3(13): 5109.
134252 package-private extension *note 7.3(14.a): 3876.
134253 package-private type *note 7.3(14.a): 3875.
134254 package_body *note 7.2(2/3): 3842.
134255 used *note 3.11(6): 2503, *note 10.1.1(7): 4670, *note P: 9827.
134256 package_body_stub *note 10.1.3(4): 4732.
134257 used *note 10.1.3(2): 4725, *note P: 10306.
134258 package_declaration *note 7.1(2): 3825.
134259 used *note 3.1(3/3): 1353, *note 10.1.1(5): 4661, *note P: 10287.
134260 package_renaming_declaration *note 8.5.3(2/3): 4104.
134261 used *note 8.5(2): 4075, *note 10.1.1(6): 4665, *note P: 10140.
134262 package_specification *note 7.1(3/3): 3827.
134263 used *note 7.1(2): 3826, *note 12.1(4): 5049, *note P: 10111.
134264 packed *note 13.2(5.1/3): 5347.
134265 Packed_Decimal
134266 in Interfaces.COBOL *note B.4(12/3): 8114.
134267 Packed_Format
134268 in Interfaces.COBOL *note B.4(26): 8134.
134269 Packed_Signed
134270 in Interfaces.COBOL *note B.4(27): 8136.
134271 Packed_Unsigned
134272 in Interfaces.COBOL *note B.4(27): 8135.
134273 padding bits *note 13.1(7/2): 5294.
134274 Page
134275 in Ada.Text_IO *note A.10.1(39): 6927.
134276 Page pragma *note 2.8(22): 1333, *note L(25): 9438.
134277 page terminator *note A.10(7): 6850.
134278 Page_Length
134279 in Ada.Text_IO *note A.10.1(26): 6904.
134280 Paragraph_Sign
134281 in Ada.Characters.Latin_1 *note A.3.3(22): 6104.
134282 parallel processing
134283 See task *note 9(1/3): 4181.
134284 parameter
134285 explicitly aliased *note 6.1(23.1/3): 3571.
134286 See formal parameter *note 6.1(17): 3563.
134287 See generic formal parameter *note 12(1): 5039.
134288 See also discriminant *note 3.7(1/2): 2078.
134289 See also loop parameter *note 5.5(6): 3433.
134290 parameter assigning back *note 6.4.1(17): 3731.
134291 parameter copy back *note 6.4.1(17): 3729.
134292 parameter mode *note 6.1(18/3): 3564.
134293 parameter passing *note 6.4.1(1): 3714.
134294 parameter_and_result_profile *note 6.1(13/2): 3542.
134295 used *note 3.10(5): 2383, *note 3.10(6/2): 2391, *note 6.1(4.2/2):
134296 3525, *note P: 9815.
134297 parameter_association *note 6.4(5): 3700.
134298 used *note 6.4(4): 3698, *note P: 10091.
134299 parameter_profile *note 6.1(12): 3540.
134300 used *note 3.10(5): 2382, *note 3.10(6/2): 2389, *note 6.1(4.1/2):
134301 3522, *note 9.5.2(2/3): 4351, *note 9.5.2(3): 4356, *note 9.5.2(6):
134302 4370, *note P: 9808.
134303 parameter_specification *note 6.1(15/3): 3551.
134304 used *note 6.1(14): 3549, *note P: 10068.
134305 Parameterless_Handler
134306 in Ada.Interrupts *note C.3.2(2/3): 8226.
134307 Params_Stream_Type
134308 in System.RPC *note E.5(6): 8811.
134309 parent *note N(25.1/2): 9562.
134310 in Ada.Containers.Multiway_Trees *note A.18.10(59/3): 7784.
134311 parent body
134312 of a subunit *note 10.1.3(8/2): 4744.
134313 parent declaration
134314 of a library unit *note 10.1.1(10): 4680.
134315 of a library_item *note 10.1.1(10): 4679.
134316 parent subtype *note 3.4(3/2): 1613.
134317 parent type *note 3.4(3/2): 1614.
134318 parent unit
134319 of a library unit *note 10.1.1(10): 4682.
134320 Parent_Tag
134321 in Ada.Tags *note 3.9(7.2/2): 2239.
134322 parent_unit_name *note 10.1.1(8): 4671.
134323 used *note 6.1(5): 3527, *note 6.1(7): 3534, *note 7.1(3/3): 3832,
134324 *note 7.2(2/3): 3847, *note 10.1.3(7): 4742, *note P: 10116.
134325 part
134326 of a type *note 3.2(6/2): 1408.
134327 of an object or value *note 3.2(6/2): 1407.
134328 partial view
134329 of a type *note 7.3(4): 3867.
134330 partition *note 10.2(2): 4785, *note N(26): 9563.
134331 partition building *note 10.2(2): 4786.
134332 partition communication subsystem (PCS) *note E.5(1/2): 8806.
134333 Partition_Check
134334 [partial] *note E.4(19): 8796.
134335 Partition_Elaboration_Policy pragma *note H.6(3/2): 9113, *note
134336 L(25.1/2): 9440.
134337 Partition_Id
134338 in System.RPC *note E.5(4): 8809.
134339 Partition_Id attribute *note E.1(9): 8701.
134340 pass by copy *note 6.2(2): 3621.
134341 pass by reference *note 6.2(2): 3624.
134342 passive partition *note E.1(2): 8693.
134343 Pattern_Error
134344 in Ada.Strings *note A.4.1(5): 6228.
134345 PC-map approach to finalization *note 7.6.1(24.s): 3984.
134346 PCS (partition communication subsystem) *note E.5(1/2): 8807.
134347 Peak_Use
134348 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(7/3): 7922.
134349 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(6/3):
134350 7906.
134351 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(7/3):
134352 7891.
134353 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(7/3):
134354 7914.
134355 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(6/3):
134356 7899.
134357 pending interrupt occurrence *note C.3(2): 8196.
134358 per-object constraint *note 3.8(18/2): 2174.
134359 per-object expression *note 3.8(18/2): 2173.
134360 percent sign *note 2.1(15/3): 1215.
134361 Percent_Sign
134362 in Ada.Characters.Latin_1 *note A.3.3(8): 5986.
134363 perfect result set *note G.2.3(5): 8969.
134364 periodic task
134365 example *note 9.6(39): 4480.
134366 See delay_until_statement *note 9.6(39): 4481.
134367 Pi
134368 in Ada.Numerics *note A.5(3/2): 6581.
134369 Pic_String
134370 in Ada.Text_IO.Editing *note F.3.3(7): 8844.
134371 Picture
134372 in Ada.Text_IO.Editing *note F.3.3(4): 8841.
134373 picture String
134374 for edited output *note F.3.1(1/3): 8837.
134375 Picture_Error
134376 in Ada.Text_IO.Editing *note F.3.3(9): 8847.
134377 Pilcrow_Sign
134378 in Ada.Characters.Latin_1 *note A.3.3(22): 6103.
134379 plain_char
134380 in Interfaces.C *note B.3(11): 7999.
134381 plane
134382 character *note 2.1(1/3): 1165.
134383 PLD
134384 in Ada.Characters.Latin_1 *note A.3.3(17): 6058.
134385 PLU
134386 in Ada.Characters.Latin_1 *note A.3.3(17): 6059.
134387 plus operator *note 4.4(1/3): 2811, *note 4.5.3(1): 3007, *note
134388 4.5.4(1): 3032.
134389 plus sign *note 2.1(15/3): 1197.
134390 Plus_Minus_Sign
134391 in Ada.Characters.Latin_1 *note A.3.3(22): 6098.
134392 Plus_Sign
134393 in Ada.Characters.Latin_1 *note A.3.3(8): 5992.
134394 PM
134395 in Ada.Characters.Latin_1 *note A.3.3(19): 6077.
134396 point *note 2.1(15/3): 1203.
134397 Pointer
134398 in Interfaces.C.Pointers *note B.3.2(5): 8077.
134399 See access value *note 3.10(1): 2370.
134400 See type System.Address *note 13.7(34/2): 5556.
134401 pointer type
134402 See access type *note 3.10(1): 2371.
134403 Pointer_Error
134404 in Interfaces.C.Pointers *note B.3.2(8): 8080.
134405 Pointers
134406 child of Interfaces.C *note B.3.2(4): 8076.
134407 polymorphism *note 3.9(1): 2209, *note 3.9.2(1/2): 2289.
134408 pool
134409 default *note 13.11.3(4.1/3): 5689.
134410 subpool *note 13.11.4(18/3): 5708.
134411 pool element *note 3.10(7/1): 2397, *note 13.11(11): 5630.
134412 pool type *note 13.11(11): 5628.
134413 pool-specific access type *note 3.10(7/1): 2394, *note 3.10(8): 2398.
134414 Pool_of_Subpool
134415 in System.Storage_Pools.Subpools *note 13.11.4(9/3): 5699.
134416 Pos attribute *note 3.5.5(2): 1864.
134417 position *note 13.5.1(4): 5488.
134418 used *note 13.5.1(3): 5485, *note P: 10453.
134419 Position attribute *note 13.5.2(2/2): 5504.
134420 position number *note 3.5(1): 1664.
134421 of an enumeration value *note 3.5.1(7): 1779.
134422 of an integer value *note 3.5.4(15): 1839.
134423 positional association *note 6.4(7): 3707, *note 6.4.1(2/3): 3716,
134424 *note 12.3(6): 5100.
134425 positional component association *note 4.3.1(6): 2697.
134426 positional discriminant association *note 3.7.1(4): 2127.
134427 positional parameter association *note 6.4.1(2/3): 3718.
134428 positional_array_aggregate *note 4.3.3(3/2): 2732.
134429 used *note 4.3.3(2): 2730, *note P: 9883.
134430 Positive *note 3.5.4(12): 1833.
134431 Positive subtype of Integer
134432 in Standard *note A.1(13): 5882.
134433 Positive_Count subtype of Count
134434 in Ada.Direct_IO *note A.8.4(4): 6811.
134435 in Ada.Streams.Stream_IO *note A.12.1(7): 7070.
134436 in Ada.Text_IO *note A.10.1(5): 6864.
134437 POSIX *note 1.2(10.a): 1144.
134438 possible interpretation *note 8.6(14): 4146.
134439 for direct_names *note 8.3(24): 4044.
134440 for selector_names *note 8.3(24): 4045.
134441 Post aspect *note 6.1.1(4/3): 3591.
134442 Post'Class aspect *note 6.1.1(5/3): 3595.
134443 post-compilation error *note 1.1.2(29): 1028.
134444 post-compilation rules *note 1.1.2(29): 1029.
134445 postcondition *note N(26.1/3): 9564.
134446 postcondition check *note 6.1.1(35/3): 3615.
134447 postcondition expression
134448 class-wide *note 6.1.1(5/3): 3593.
134449 specific *note 6.1.1(4/3): 3589.
134450 potentially blocking operation *note 9.5.1(8): 4344.
134451 Abort_Task *note C.7.1(16): 8287.
134452 delay_statement *note 9.6(34): 4478, *note D.9(5): 8550.
134453 remote subprogram call *note E.4(17): 8791.
134454 RPC operations *note E.5(23): 8820.
134455 Suspend_Until_True *note D.10(10): 8562.
134456 potentially unevaluated expression *note 6.1.1(20/3): 3601.
134457 potentially use-visible *note 8.4(8/3): 4066.
134458 [partial] *note 12.6(9.2/3): 5251.
134459 Pound_Sign
134460 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6083.
134461 Pragma *note 2.8(1): 1303, *note 2.8(2): 1304, *note L(1): 9327, *note
134462 N(27): 9565.
134463 pragma argument *note 2.8(9): 1319.
134464 pragma name *note 2.8(9): 1318.
134465 pragma, categorization *note E.2(2/3): 8705.
134466 Remote_Call_Interface *note E.2.3(2): 8746.
134467 Remote_Types *note E.2.2(2): 8730.
134468 Shared_Passive *note E.2.1(2): 8715.
134469 pragma, configuration *note 10.1.5(8): 4768.
134470 Assertion_Policy *note 11.4.2(7/3): 4970.
134471 Detect_Blocking *note H.5(4/2): 9110.
134472 Discard_Names *note C.5(4): 8246.
134473 Locking_Policy *note D.3(5): 8414.
134474 Normalize_Scalars *note H.1(4): 9055.
134475 Partition_Elaboration_Policy *note H.6(5/2): 9116.
134476 Priority_Specific_Dispatching *note D.2.2(5/2): 8365.
134477 Profile *note 13.12(14/3): 5747.
134478 Queuing_Policy *note D.4(5): 8436.
134479 Restrictions *note 13.12(8/3): 5741.
134480 Reviewable *note H.3.1(4): 9060.
134481 Suppress *note 11.5(5/2): 4994.
134482 Task_Dispatching_Policy *note D.2.2(5/2): 8363.
134483 Unsuppress *note 11.5(5/2): 4996.
134484 pragma, identifier specific to *note 2.8(10/3): 1322.
134485 pragma, interfacing
134486 Convention *note J.15.5(1/3): 9186.
134487 Export *note J.15.5(1/3): 9184.
134488 Import *note J.15.5(1/3): 9182.
134489 pragma, library unit *note 10.1.5(7/3): 4764.
134490 All_Calls_Remote *note E.2.3(6): 8754.
134491 categorization pragmas *note E.2(2/3): 8707.
134492 Elaborate_Body *note 10.2.1(24): 4850.
134493 Preelaborate *note 10.2.1(4): 4815.
134494 Pure *note 10.2.1(15): 4832.
134495 pragma, program unit *note 10.1.5(2): 4761.
134496 Inline *note J.15.1(1/3): 9157.
134497 library unit pragmas *note 10.1.5(7/3): 4766.
134498 pragma, representation *note 13.1(1/1): 5279.
134499 Asynchronous *note J.15.13(1/3): 9276.
134500 Atomic *note J.15.8(9/3): 9246.
134501 Atomic_Components *note J.15.8(9/3): 9250.
134502 Convention *note J.15.5(1/3): 9192.
134503 Discard_Names *note C.5(6): 8248.
134504 Export *note J.15.5(1/3): 9190.
134505 Import *note J.15.5(1/3): 9188.
134506 Independent *note J.15.8(9/3): 9254.
134507 Independent_Components *note J.15.8(9/3): 9256.
134508 No_Return *note J.15.2(1/3): 9166.
134509 Pack *note J.15.3(1/3): 9172.
134510 Unchecked_Union *note J.15.6(1/3): 9213.
134511 Volatile *note J.15.8(9/3): 9248.
134512 Volatile_Components *note J.15.8(9/3): 9252.
134513 pragma_argument_association *note 2.8(3/3): 1308.
134514 used *note 2.8(2): 1306, *note 13.12(11/3): 5745, *note L(27.3/3):
134515 9458, *note P: 9633.
134516 pragmas
134517 All_Calls_Remote *note E.2.3(5): 8750, *note L(2): 9328.
134518 Assert *note 11.4.2(3/2): 4956, *note L(2.1/2): 9331.
134519 Assertion_Policy *note 11.4.2(6.1/3): 4963, *note 11.4.2(6/2):
134520 4960, *note L(2.2/2): 9335, *note L(2.3/3): 9338.
134521 Asynchronous *note J.15.13(2/3): 9277, *note L(3.1/3): 9344.
134522 Atomic *note J.15.8(2/3): 9227, *note L(4.1/3): 9347.
134523 Atomic_Components *note J.15.8(5/3): 9236, *note L(5.1/3): 9350.
134524 Attach_Handler *note J.15.7(4/3): 9220, *note L(6.1/3): 9353.
134525 Convention *note J.15.5(4/3): 9205, *note L(8.1/3): 9357.
134526 CPU *note J.15.9(2/3): 9257, *note L(8.2/3): 9361.
134527 Default_Storage_Pool *note 13.11.3(3/3): 5682, *note L(8.3/3):
134528 9364.
134529 Detect_Blocking *note H.5(3/2): 9107, *note L(8.4/2): 9367.
134530 Discard_Names *note C.5(3): 8242, *note L(9): 9369.
134531 Dispatching_Domain *note J.15.10(2/3): 9262, *note L(9.1/3): 9372.
134532 Elaborate *note 10.2.1(20): 4838, *note L(10): 9374.
134533 Elaborate_All *note 10.2.1(21): 4842, *note L(11): 9378.
134534 Elaborate_Body *note 10.2.1(22): 4846, *note L(12): 9382.
134535 Export *note J.15.5(3/3): 9199, *note L(13.1/3): 9385.
134536 Import *note J.15.5(2/3): 9193, *note L(14.1/3): 9391.
134537 Independent *note J.15.8(4/3): 9233, *note L(14.2/3): 9397.
134538 Independent_Components *note J.15.8(7/3): 9242, *note L(14.3/3):
134539 9400.
134540 Inline *note J.15.1(2/3): 9158, *note L(15.1/3): 9403.
134541 Inspection_Point *note H.3.2(3): 9061, *note L(16): 9407.
134542 Interrupt_Handler *note J.15.7(2/3): 9217, *note L(17.1/3): 9411.
134543 Interrupt_Priority *note J.15.11(4/3): 9268, *note L(18.1/3): 9414.
134544 Linker_Options *note B.1(8): 7956, *note L(19): 9416.
134545 List *note 2.8(21): 1329, *note L(20): 9419.
134546 Locking_Policy *note D.3(3): 8407, *note L(21): 9422.
134547 No_Return *note J.15.2(2/3): 9167, *note L(21.2/3): 9425.
134548 Normalize_Scalars *note H.1(3): 9052, *note L(22): 9429.
134549 Optimize *note 2.8(23): 1334, *note L(23): 9431.
134550 Pack *note J.15.3(2/3): 9173, *note L(24.1/3): 9434.
134551 Page *note 2.8(22): 1332, *note L(25): 9437.
134552 Partition_Elaboration_Policy *note H.6(3/2): 9112, *note L(25.1/2):
134553 9439.
134554 Preelaborable_Initialization *note 10.2.1(4.2/2): 4816, *note
134555 L(25.2/2): 9442.
134556 Preelaborate *note 10.2.1(3): 4811, *note L(26): 9445.
134557 Priority *note J.15.11(2/3): 9266, *note L(27.1/3): 9448.
134558 Priority_Specific_Dispatching *note D.2.2(3.2/2): 8357, *note
134559 L(27.2/2): 9450.
134560 Profile *note 13.12(11/3): 5742, *note L(27.3/3): 9455.
134561 Pure *note 10.2.1(14): 4828, *note L(28): 9459.
134562 Queuing_Policy *note D.4(3): 8430, *note L(29): 9462.
134563 Relative_Deadline *note J.15.12(2/3): 9272, *note L(29.2/3): 9465.
134564 Remote_Call_Interface *note E.2.3(3): 8747, *note L(30): 9467.
134565 Remote_Types *note E.2.2(3): 8731, *note L(31): 9470.
134566 Restrictions *note 13.12(3): 5728, *note L(32): 9473.
134567 Reviewable *note H.3.1(3): 9057, *note L(33): 9477.
134568 Shared_Passive *note E.2.1(3): 8716, *note L(34): 9479.
134569 Storage_Size *note J.15.4(2/3): 9176, *note L(35.1/3): 9482.
134570 Suppress *note 11.5(4/2): 4987, *note J.10(3/2): 9147, *note L(36):
134571 9485.
134572 Task_Dispatching_Policy *note D.2.2(3): 8354, *note L(37): 9488.
134573 Unchecked_Union *note J.15.6(2/3): 9214, *note L(37.2/3): 9491.
134574 Unsuppress *note 11.5(4.1/2): 4990, *note L(37.3/2): 9494.
134575 Volatile *note J.15.8(3/3): 9230, *note L(38.1/3): 9497.
134576 Volatile_Components *note J.15.8(6/3): 9239, *note L(39.1/3): 9500.
134577 Pre aspect *note 6.1.1(2/3): 3583.
134578 Pre'Class aspect *note 6.1.1(3/3): 3587.
134579 precedence of operators *note 4.5(1): 2914.
134580 precondition *note N(27.1/3): 9566.
134581 precondition check
134582 class-wide *note 6.1.1(33/3): 3612.
134583 specific *note 6.1.1(32/3): 3609.
134584 precondition expression
134585 class-wide *note 6.1.1(3/3): 3585.
134586 specific *note 6.1.1(2/3): 3581.
134587 Pred attribute *note 3.5(25): 1715.
134588 predecessor element
134589 of an ordered set *note A.18.9(81/3): 7718.
134590 predecessor node
134591 of an ordered map *note A.18.6(58/3): 7540.
134592 predefined environment *note A(1): 5874.
134593 predefined exception *note 11.1(4): 4874.
134594 predefined library unit
134595 See language-defined library units
134596 predefined operation
134597 of a type *note 3.2.3(1/2): 1492.
134598 predefined operations
134599 of a discrete type *note 3.5.5(10/3): 1876.
134600 of a fixed point type *note 3.5.10(17): 1985.
134601 of a floating point type *note 3.5.8(3): 1921.
134602 of a record type *note 3.8(24): 2178.
134603 of an access type *note 3.10.2(34/2): 2480.
134604 of an array type *note 3.6.2(15): 2069.
134605 predefined operator *note 4.5(9): 2922.
134606 [partial] *note 3.2.1(9): 1456.
134607 predefined type *note 3.2.1(10): 1457.
134608 See language-defined types
134609 predicate *note 4.5.8(3/3): 3119, *note N(27.2/3): 9567.
134610 of a subtype *note 3.2.4(6/3): 1507.
134611 used *note 4.5.8(1/3): 3114, *note P: 9965.
134612 predicate aspect *note 3.2.4(1/3): 1499.
134613 predicate check
134614 allocator *note 3.2.4(31/3): 1516.
134615 enabled *note 3.2.4(7/3): 1510.
134616 in out parameters *note 3.2.4(31/3): 1514.
134617 object_declaration *note 3.2.4(31/3): 1515.
134618 subtype conversion *note 4.6(51/3): 3213.
134619 predicate evaluated
134620 membership *note 4.5.2(29/3): 2997.
134621 Valid attribute *note 13.9.2(3/3): 5612, *note K.2(263/3): 9324.
134622 predicate specification *note 3.2.4(1/3): 1500.
134623 predicate-static *note 3.2.4(15/3): 1511.
134624 preelaborable
134625 of an elaborable construct *note 10.2.1(5): 4819.
134626 preelaborable initialization *note 10.2.1(11.1/2): 4826.
134627 Preelaborable_Initialization pragma *note 10.2.1(4.2/2): 4817, *note
134628 L(25.2/2): 9443.
134629 Preelaborate aspect *note 10.2.1(11/3): 4823.
134630 Preelaborate pragma *note 10.2.1(3): 4812, *note L(26): 9446.
134631 preelaborated *note 10.2.1(11/3): 4825.
134632 [partial] *note 10.2.1(11/3): 4821, *note E.2.1(9): 8724.
134633 preempt
134634 a running task *note D.2.3(9/2): 8373.
134635 preference
134636 for root numeric operators and ranges *note 8.6(29): 4166.
134637 for universal access equality operators *note 8.6(29.1/3): 4167.
134638 preference control
134639 See requeue *note 9.5.4(1): 4429.
134640 prefix *note 4.1(4): 2538.
134641 of a prefixed view *note 4.1.3(9.2/3): 2593.
134642 used *note 4.1.1(2): 2561, *note 4.1.2(2): 2574, *note 4.1.3(2):
134643 2585, *note 4.1.4(2): 2604, *note 4.1.4(4): 2610, *note 4.1.6(10/3):
134644 2641, *note 6.4(2): 3691, *note 6.4(3): 3695, *note P: 9862.
134645 prefixed view *note 4.1.3(9.2/3): 2592.
134646 prefixed view profile *note 6.3.1(24.1/2): 3682.
134647 Prepend
134648 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(22/2): 7360.
134649 in Ada.Containers.Vectors *note A.18.2(44/2): 7279, *note
134650 A.18.2(45/2): 7280.
134651 Prepend_Child
134652 in Ada.Containers.Multiway_Trees *note A.18.10(51/3): 7776.
134653 prescribed result
134654 for the evaluation of a complex arithmetic operation *note
134655 G.1.1(42): 8892.
134656 for the evaluation of a complex elementary function *note
134657 G.1.2(35): 8920.
134658 for the evaluation of an elementary function *note A.5.1(37): 6620.
134659 Previous
134660 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(38/2): 7376,
134661 *note A.18.3(40/2): 7378.
134662 in Ada.Containers.Ordered_Maps *note A.18.6(36/2): 7525, *note
134663 A.18.6(37/2): 7526.
134664 in Ada.Containers.Ordered_Sets *note A.18.9(47/2): 7687, *note
134665 A.18.9(48/2): 7688.
134666 in Ada.Containers.Vectors *note A.18.2(65/2): 7300, *note
134667 A.18.2(66/2): 7301.
134668 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3445.
134669 Previous_Sibling
134670 in Ada.Containers.Multiway_Trees *note A.18.10(65/3): 7790, *note
134671 A.18.10(67/3): 7792.
134672 primary *note 4.4(7/3): 2900.
134673 used *note 4.4(6): 2896, *note P: 9938.
134674 primitive function *note A.5.3(17): 6679.
134675 primitive operation
134676 [partial] *note 3.2(1): 1387.
134677 primitive operations *note N(28): 9568.
134678 of a type *note 3.2.3(1/2): 1493.
134679 primitive operator
134680 of a type *note 3.2.3(8): 1496.
134681 primitive subprograms
134682 of a type *note 3.2.3(2): 1494.
134683 priority *note D.1(15): 8329.
134684 of a protected object *note D.3(6/2): 8416.
134685 Priority aspect *note D.1(6.2/3): 8325.
134686 Priority attribute *note D.5.2(3/2): 8451.
134687 priority inheritance *note D.1(15): 8330.
134688 priority inversion *note D.2.3(11/2): 8374.
134689 priority of an entry call *note D.4(9): 8442.
134690 Priority pragma *note J.15.11(2/3): 9267, *note L(27.1/3): 9449.
134691 Priority subtype of Any_Priority
134692 in System *note 13.7(16): 5553.
134693 Priority_Queuing queuing policy *note D.4(8): 8441.
134694 Priority_Specific_Dispatching pragma *note D.2.2(3.2/2): 8358, *note
134695 L(27.2/2): 9451.
134696 private declaration of a library unit *note 10.1.1(12): 4688.
134697 private descendant
134698 of a library unit *note 10.1.1(12): 4690.
134699 private extension *note 3.2(4.1/2): 1404, *note 3.9(2.1/2): 2220,
134700 *note 3.9.1(1/2): 2274, *note N(29/2): 9569.
134701 [partial] *note 7.3(14): 3874, *note 12.5.1(5/3): 5197.
134702 private library unit *note 10.1.1(12): 4687.
134703 private operations *note 7.3.1(1): 3883.
134704 private part *note 8.2(5): 3999.
134705 of a package *note 7.1(6/2): 3837, *note 12.3(12.b): 5108.
134706 of a protected unit *note 9.4(11/2): 4297.
134707 of a task unit *note 9.1(9): 4224.
134708 private type *note 3.2(4.1/2): 1403, *note N(30/2): 9570.
134709 [partial] *note 7.3(14): 3873.
134710 private types and private extensions *note 7.3(1): 3852.
134711 private with_clause *note 10.1.2(4.b/2): 4712.
134712 private_extension_declaration *note 7.3(3/3): 3861.
134713 used *note 3.2.1(2): 1432, *note P: 9660.
134714 private_type_declaration *note 7.3(2/3): 3857.
134715 used *note 3.2.1(2): 1431, *note P: 9659.
134716 procedure *note 6(1): 3508, *note N(30.1/2): 9571.
134717 null *note 6.7(3/3): 3805.
134718 procedure instance *note 12.3(13): 5111.
134719 procedure_call_statement *note 6.4(2): 3689.
134720 used *note 5.1(4/2): 3349, *note 9.7.2(3.1/2): 4567, *note P: 9994.
134721 procedure_or_entry_call *note 9.7.2(3.1/2): 4566.
134722 used *note 9.7.2(3/2): 4564, *note 9.7.4(4/2): 4582, *note P:
134723 10263.
134724 procedure_specification *note 6.1(4.1/2): 3520.
134725 used *note 6.1(4/2): 3518, *note 6.7(2/3): 3801, *note P: 10047.
134726 processing node *note E(2): 8687.
134727 profile *note 6.1(22): 3567.
134728 associated with a dereference *note 4.1(10): 2549.
134729 fully conformant *note 6.3.1(18/3): 3677.
134730 mode conformant *note 6.3.1(16/3): 3670.
134731 No_Implementation_Extensions *note 13.12.1(10/3): 5770.
134732 subtype conformant *note 6.3.1(17/3): 3673.
134733 type conformant *note 6.3.1(15/2): 3667.
134734 Profile pragma *note 13.12(11/3): 5743, *note L(27.3/3): 9456.
134735 profile resolution rule
134736 name with a given expected profile *note 8.6(26): 4161.
134737 progenitor *note N(30.2/2): 9572.
134738 progenitor subtype *note 3.9.4(9/2): 2363.
134739 progenitor type *note 3.9.4(9/2): 2364.
134740 program *note 10.2(1): 4782, *note N(31): 9573.
134741 program execution *note 10.2(1): 4783.
134742 program library
134743 See library *note 10(2): 4636.
134744 See library *note 10.1.4(9): 4758.
134745 Program unit *note 10.1(1): 4643, *note N(32): 9574.
134746 program unit pragma *note 10.1.5(2): 4760.
134747 Inline *note J.15.1(1/3): 9156.
134748 library unit pragmas *note 10.1.5(7/3): 4765.
134749 program-counter-map approach to finalization *note 7.6.1(24.s): 3985.
134750 Program_Error
134751 raised by failure of run-time check *note 1.1.3(20): 1075, *note
134752 1.1.5(8): 1099, *note 1.1.5(12): 1105, *note 1.1.5(12.b): 1106, *note
134753 3.5(27.c/2): 1725, *note 3.5.5(8): 1875, *note 3.10.2(29): 2471, *note
134754 3.11(14): 2514, *note 4.6(57/3): 3224, *note 4.8(10.1/3): 3282, *note
134755 4.8(10.2/2): 3285, *note 4.8(10.3/2): 3288, *note 4.8(10.4/3): 3294,
134756 *note 6.2(12/3): 3637, *note 6.4(11/2): 3710, *note 6.5(8/3): 3769,
134757 *note 6.5(21/3): 3775, *note 6.5.1(9/2): 3790, *note 7.6.1(15): 3976,
134758 *note 7.6.1(16/2): 3977, *note 7.6.1(17): 3978, *note 7.6.1(17.2/1):
134759 3979, *note 7.6.1(18/2): 3980, *note 7.6.1(20.b): 3981, *note
134760 8.5.4(8.1/1): 4123, *note 9.4(20): 4315, *note 9.5.1(17): 4346, *note
134761 9.5.3(7/3): 4414, *note 9.7.1(21): 4558, *note 9.8(20/3): 4614, *note
134762 10.2(26): 4806, *note 11.1(4): 4876, *note 11.5(8.a): 4998, *note
134763 11.5(19): 5008, *note 12.5.1(23.3/2): 5201, *note 13.7.1(16): 5570,
134764 *note 13.9.1(9): 5604, *note 13.11.2(13): 5676, *note 13.11.2(14): 5678,
134765 *note 13.11.4(27/3): 5720, *note 13.11.4(30/3): 5723, *note
134766 A.5.2(40.1/1): 6653, *note A.7(14/3): 6772, *note B.3.3(22/2): 8100,
134767 *note C.3.1(10/3): 8212, *note C.3.1(11/3): 8216, *note C.3.2(17/3):
134768 8236, *note C.3.2(20): 8237, *note C.3.2(21/3): 8238, *note C.3.2(22/2):
134769 8239, *note C.7.1(15): 8286, *note C.7.1(17/3): 8290, *note C.7.2(13):
134770 8300, *note D.3(13): 8424, *note D.3(13.2/2): 8426, *note D.3(13.4/2):
134771 8427, *note D.5.1(9): 8447, *note D.5.2(6/3): 8452, *note D.7(7.1/3):
134772 8464, *note D.7(10.4/3): 8477, *note D.7(19.1/2): 8513, *note D.10(10):
134773 8564, *note D.11(8): 8580, *note E.1(10/2): 8703, *note E.3(6): 8778,
134774 *note E.4(18/1): 8795, *note J.7.1(7): 9139.
134775 in Standard *note A.1(46): 5894.
134776 prohibited
134777 tampering with a holder *note A.18.18(35/3): 7843.
134778 tampering with a list *note A.18.3(69.1/3): 7392.
134779 tampering with a map *note A.18.4(15.1/3): 7418.
134780 tampering with a set *note A.18.7(14.1/3): 7554.
134781 tampering with a tree *note A.18.10(90/3): 7800.
134782 tampering with a vector *note A.18.2(97.1/3): 7317.
134783 propagate *note 11.4(1): 4914.
134784 an exception by a construct *note 11.4(6.a): 4923.
134785 an exception by an execution *note 11.4(6.a): 4922.
134786 an exception occurrence by an execution, to a dynamically enclosing
134787 execution *note 11.4(6): 4921.
134788 proper_body *note 3.11(6): 2501.
134789 used *note 3.11(5): 2499, *note 10.1.3(7): 4743, *note P: 10319.
134790 protected action *note 9.5.1(4): 4338.
134791 complete *note 9.5.1(6): 4341.
134792 start *note 9.5.1(5): 4339.
134793 protected calling convention *note 6.3.1(12): 3662.
134794 protected declaration *note 9.4(1): 4260.
134795 protected entry *note 9.4(1): 4259.
134796 protected function *note 9.5.1(1): 4336.
134797 protected interface *note 3.9.4(5/2): 2352.
134798 protected object *note 9(3): 4185, *note 9.4(1): 4256.
134799 protected operation *note 9.4(1): 4257.
134800 protected procedure *note 9.5.1(1): 4335.
134801 protected subprogram *note 9.4(1): 4258, *note 9.5.1(1): 4334.
134802 protected tagged type *note 3.9.4(6/2): 2362.
134803 protected type *note N(33/2): 9575.
134804 protected unit *note 9.4(1): 4261.
134805 protected_body *note 9.4(7/3): 4286.
134806 used *note 3.11(6): 2505, *note P: 9829.
134807 protected_body_stub *note 10.1.3(6): 4738.
134808 used *note 10.1.3(2): 4727, *note P: 10308.
134809 protected_definition *note 9.4(4): 4275.
134810 used *note 9.4(2/3): 4269, *note 9.4(3/3): 4274, *note P: 10198.
134811 protected_element_declaration *note 9.4(6): 4283.
134812 used *note 9.4(4): 4277, *note P: 10200.
134813 protected_operation_declaration *note 9.4(5/1): 4279.
134814 used *note 9.4(4): 4276, *note 9.4(6): 4284, *note P: 10199.
134815 protected_operation_item *note 9.4(8/1): 4291.
134816 used *note 9.4(7/3): 4289, *note P: 10209.
134817 protected_type_declaration *note 9.4(2/3): 4264.
134818 used *note 3.2.1(3/3): 1439, *note P: 9666.
134819 ptrdiff_t
134820 in Interfaces.C *note B.3(12): 8000.
134821 PU1
134822 in Ada.Characters.Latin_1 *note A.3.3(18): 6064.
134823 PU2
134824 in Ada.Characters.Latin_1 *note A.3.3(18): 6065.
134825 public declaration of a library unit *note 10.1.1(12): 4686.
134826 public descendant
134827 of a library unit *note 10.1.1(12): 4689.
134828 public library unit *note 10.1.1(12): 4685.
134829 punctuation_connector *note 2.1(10.2/2): 1177.
134830 used *note 2.3(3.1/3): 1245, *note P: 9608.
134831 pure *note 10.2.1(15.1/3): 4833.
134832 Pure aspect *note 10.2.1(17/3): 4836.
134833 Pure pragma *note 10.2.1(14): 4829, *note L(28): 9460.
134834 Put
134835 in Ada.Text_IO *note A.10.1(42): 6932, *note A.10.1(48): 6941,
134836 *note A.10.1(55): 6954, *note A.10.1(60): 6963, *note A.10.1(66): 6973,
134837 *note A.10.1(67): 6976, *note A.10.1(71): 6983, *note A.10.1(72): 6986,
134838 *note A.10.1(76): 6993, *note A.10.1(77): 6996, *note A.10.1(82): 7002,
134839 *note A.10.1(83): 7005.
134840 in Ada.Text_IO.Bounded_IO *note A.10.11(4/2): 7031, *note
134841 A.10.11(5/2): 7032.
134842 in Ada.Text_IO.Complex_IO *note G.1.3(7): 8930, *note G.1.3(8):
134843 8932.
134844 in Ada.Text_IO.Editing *note F.3.3(14): 8856, *note F.3.3(15):
134845 8857, *note F.3.3(16): 8858.
134846 in Ada.Text_IO.Unbounded_IO *note A.10.12(4/2): 7041, *note
134847 A.10.12(5/2): 7042.
134848 Put_Line
134849 in Ada.Text_IO *note A.10.1(50): 6948.
134850 in Ada.Text_IO.Bounded_IO *note A.10.11(6/2): 7033, *note
134851 A.10.11(7/2): 7034.
134852 in Ada.Text_IO.Unbounded_IO *note A.10.12(6/2): 7043, *note
134853 A.10.12(7/2): 7044.
134854
134855
134856 \1f
134857 File: aarm2012.info, Node: Q, Next: R, Prev: P, Up: Index
134858
134859 Q
134860 ==
134861
134862
134863
134864 qualified_expression *note 4.7(2): 3236.
134865 used *note 4.1(2/3): 2532, *note 4.8(2/3): 3258, *note 13.8(2):
134866 5578, *note P: 10459.
134867 quantified expressions *note 4.5.8(5/3): 3122.
134868 quantified_expression *note 4.5.8(1/3): 3111.
134869 used *note 4.4(7/3): 2908, *note P: 9949.
134870 quantifier *note 4.5.8(2/3): 3118.
134871 used *note 4.5.8(1/3): 3112, *note P: 9963.
134872 Query_Element
134873 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(16/2): 7349.
134874 in Ada.Containers.Hashed_Maps *note A.18.5(16/2): 7443.
134875 in Ada.Containers.Hashed_Sets *note A.18.8(17/2): 7583.
134876 in Ada.Containers.Indefinite_Holders *note A.18.18(14/3): 7832.
134877 in Ada.Containers.Multiway_Trees *note A.18.10(26/3): 7751.
134878 in Ada.Containers.Ordered_Maps *note A.18.6(15/2): 7497.
134879 in Ada.Containers.Ordered_Sets *note A.18.9(16/2): 7657.
134880 in Ada.Containers.Vectors *note A.18.2(31/2): 7259, *note
134881 A.18.2(32/2): 7260.
134882 Question
134883 in Ada.Characters.Latin_1 *note A.3.3(10): 6003.
134884 Queue
134885 in Ada.Containers.Bounded_Priority_Queues *note A.18.31(4/3): 7917.
134886 in Ada.Containers.Bounded_Synchronized_Queues *note A.18.29(4/3):
134887 7902.
134888 in Ada.Containers.Synchronized_Queue_Interfaces *note A.18.27(4/3):
134889 7887.
134890 in Ada.Containers.Unbounded_Priority_Queues *note A.18.30(4/3):
134891 7909.
134892 in Ada.Containers.Unbounded_Synchronized_Queues *note A.18.28(4/3):
134893 7895.
134894 queuing policy *note D.4(1/3): 8429, *note D.4(6): 8437.
134895 FIFO_Queuing *note D.4(7/2): 8438.
134896 Priority_Queuing *note D.4(8): 8440.
134897 Queuing_Policy pragma *note D.4(3): 8431, *note L(29): 9463.
134898 Quotation
134899 in Ada.Characters.Latin_1 *note A.3.3(8): 5983.
134900 quotation mark *note 2.1(15/3): 1188.
134901 quoted string
134902 See string_literal *note 2.6(1): 1294.
134903
134904
134905 \1f
134906 File: aarm2012.info, Node: R, Next: S, Prev: Q, Up: Index
134907
134908 R
134909 ==
134910
134911
134912
134913 raise
134914 an exception *note 11(1/3): 4866.
134915 an exception *note 11.3(4/2): 4909.
134916 an exception *note N(18): 9542.
134917 an exception occurrence *note 11.4(3): 4920.
134918 Raise_Exception
134919 in Ada.Exceptions *note 11.4.1(4/3): 4936.
134920 raise_statement *note 11.3(2/2): 4905.
134921 used *note 5.1(4/2): 3355, *note P: 10000.
134922 Random
134923 in Ada.Numerics.Discrete_Random *note A.5.2(20): 6637.
134924 in Ada.Numerics.Float_Random *note A.5.2(8): 6625.
134925 random number *note A.5.2(1): 6621.
134926 range *note 3.5(3): 1668, *note 3.5(4): 1672.
134927 of a scalar subtype *note 3.5(7): 1686.
134928 used *note 3.5(2): 1667, *note 3.6(6): 2003, *note 3.6.1(3): 2043,
134929 *note 3.8.1(5/3): 2197, *note 4.4(3.2/3): 2884, *note P: 9929.
134930 Range attribute *note 3.5(14): 1698, *note 3.6.2(7): 2062.
134931 Range(N) attribute *note 3.6.2(8): 2064.
134932 range_attribute_designator *note 4.1.4(5): 2612.
134933 used *note 4.1.4(4): 2611, *note P: 9863.
134934 range_attribute_reference *note 4.1.4(4): 2609.
134935 used *note 3.5(3): 1669, *note P: 9711.
134936 Range_Check *note 11.5(17): 5006.
134937 [partial] *note 3.2.2(11): 1484, *note 3.5(24): 1712, *note
134938 3.5(27): 1717, *note 3.5(39.12/3): 1747, *note 3.5(39.4/3): 1741, *note
134939 3.5(39.5/3): 1744, *note 3.5(43/3): 1753, *note 3.5(55/3): 1759, *note
134940 3.5.5(7): 1869, *note 3.5.9(19): 1960, *note 4.2(11): 2662, *note
134941 4.3.3(28): 2763, *note 4.5.1(8): 2948, *note 4.5.6(6): 3069, *note
134942 4.5.6(13): 3078, *note 4.6(28): 3174, *note 4.6(38): 3186, *note
134943 4.6(46): 3199, *note 4.6(51/3): 3205, *note 4.7(4): 3243, *note
134944 13.13.2(35/3): 5807, *note A.5.2(39): 6650, *note A.5.3(26): 6687, *note
134945 A.5.3(29): 6692, *note A.5.3(50): 6715, *note A.5.3(53): 6720, *note
134946 A.5.3(59): 6725, *note A.5.3(62): 6730, *note K.2(11): 9283, *note
134947 K.2(114): 9298, *note K.2(122): 9301, *note K.2(184): 9308, *note
134948 K.2(220): 9315, *note K.2(241): 9320, *note K.2(41): 9288, *note
134949 K.2(47): 9291.
134950 range_constraint *note 3.5(2): 1666.
134951 used *note 3.2.2(6): 1475, *note 3.5.9(5): 1938, *note J.3(2):
134952 9122, *note P: 9738.
134953 Ravenscar *note D.13(1/3): 8583.
134954 RCI
134955 generic *note E.2.3(7/3): 8758.
134956 library unit *note E.2.3(7/3): 8756.
134957 package *note E.2.3(7/3): 8757.
134958 Re
134959 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(7/2): 9008,
134960 *note G.3.2(27/2): 9021.
134961 in Ada.Numerics.Generic_Complex_Types *note G.1.1(6): 8871.
134962 re-raise statement *note 11.3(3): 4908.
134963 read
134964 the value of an object *note 3.3(14): 1530.
134965 in Ada.Direct_IO *note A.8.4(12): 6822.
134966 in Ada.Sequential_IO *note A.8.1(12): 6794.
134967 in Ada.Storage_IO *note A.9(6): 6842.
134968 in Ada.Streams *note 13.13.1(5): 5783.
134969 in Ada.Streams.Stream_IO *note A.12.1(15): 7083, *note A.12.1(16):
134970 7084.
134971 in System.RPC *note E.5(7): 8812.
134972 Read aspect *note 13.13.2(38/3): 5821.
134973 Read attribute *note 13.13.2(6): 5794, *note 13.13.2(14): 5798.
134974 Read clause *note 13.3(7/2): 5379, *note 13.13.2(38/3): 5816.
134975 ready
134976 a task state *note 9(10): 4192.
134977 ready queue *note D.2.1(5/2): 8345.
134978 ready task *note D.2.1(5/2): 8348.
134979 Real
134980 in Interfaces.Fortran *note B.5(6): 8162.
134981 real literal *note 2.4(1): 1250.
134982 real literals *note 3.5.6(4): 1885.
134983 real time *note D.8(18): 8543.
134984 real type *note 3.2(3): 1401, *note 3.5.6(1): 1879, *note N(34): 9576.
134985 real-time systems *note C(1): 8180, *note D(1): 8321.
134986 Real_Arrays
134987 child of Ada.Numerics *note G.3.1(31/2): 9000.
134988 Real_Matrix
134989 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(4/2): 8990.
134990 real_range_specification *note 3.5.7(3): 1893.
134991 used *note 3.5.7(2): 1892, *note 3.5.9(3): 1931, *note 3.5.9(4):
134992 1935, *note P: 9736.
134993 Real_Time
134994 child of Ada *note D.8(3): 8521.
134995 real_type_definition *note 3.5.6(2): 1880.
134996 used *note 3.2.1(4/2): 1443, *note P: 9669.
134997 Real_Vector
134998 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(4/2): 8989.
134999 receiving stub *note E.4(10): 8788.
135000 reclamation of storage *note 13.11.2(1): 5667.
135001 recommended level of support *note 13.1(20/3): 5319.
135002 Address attribute *note 13.3(15): 5397.
135003 Alignment attribute for objects *note 13.3(33): 5411.
135004 Alignment attribute for subtypes *note 13.3(29): 5410.
135005 aspect Pack *note 13.2(7/3): 5350.
135006 bit ordering *note 13.5.3(7): 5526.
135007 Component_Size attribute *note 13.3(71): 5442.
135008 enumeration_representation_clause *note 13.4(9): 5467.
135009 record_representation_clause *note 13.5.1(17): 5499.
135010 required in Systems Programming Annex *note C.2(2/3): 8190.
135011 Size attribute *note 13.3(42/2): 5418, *note 13.3(54): 5426.
135012 Stream_Size attribute *note 13.13.2(1.7/2): 5790.
135013 unchecked conversion *note 13.9(16): 5593.
135014 with respect to nonstatic expressions *note 13.1(21/3): 5320.
135015 record *note 3.8(1): 2142.
135016 explicitly limited *note 3.8(13.1/3): 2166.
135017 record extension *note 3.4(5/2): 1615, *note 3.9.1(1/2): 2272, *note
135018 N(35): 9577.
135019 Record layout aspect *note 13.5(1): 5474.
135020 record type *note 3.8(1): 2143, *note N(36): 9578.
135021 record_aggregate *note 4.3.1(2): 2684.
135022 used *note 4.3(2): 2671, *note 13.8(14.b): 5584, *note P: 9868.
135023 record_component_association *note 4.3.1(4/2): 2689.
135024 used *note 4.3.1(3): 2688, *note P: 9873.
135025 record_component_association_list *note 4.3.1(3): 2686.
135026 used *note 4.3.1(2): 2685, *note 4.3.2(2): 2712, *note P: 9871.
135027 record_definition *note 3.8(3): 2147.
135028 used *note 3.8(2): 2146, *note 3.9.1(2): 2277, *note P: 9795.
135029 record_extension_part *note 3.9.1(2): 2276.
135030 used *note 3.4(2/2): 1612, *note P: 9709.
135031 record_representation_clause *note 13.5.1(2): 5479.
135032 used *note 13.1(2/1): 5284, *note P: 10426.
135033 record_type_definition *note 3.8(2): 2145.
135034 used *note 3.2.1(4/2): 1445, *note P: 9671.
135035 reentrant *note A(3/2): 5875.
135036 Reference
135037 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.4/3): 7353.
135038 in Ada.Containers.Hashed_Maps *note A.18.5(17.4/3): 7447, *note
135039 A.18.5(17.6/3): 7449.
135040 in Ada.Containers.Indefinite_Holders *note A.18.18(19/3): 7837.
135041 in Ada.Containers.Multiway_Trees *note A.18.10(31/3): 7756.
135042 in Ada.Containers.Ordered_Maps *note A.18.6(16.4/3): 7501, *note
135043 A.18.6(16.6/3): 7503.
135044 in Ada.Containers.Vectors *note A.18.2(34.4/3): 7265, *note
135045 A.18.2(34.6/3): 7267.
135046 in Ada.Interrupts *note C.3.2(10): 8233.
135047 in Ada.Task_Attributes *note C.7.2(5): 8296.
135048 reference discriminant *note 4.1.5(3/3): 2624.
135049 reference object *note 4.1.5(3/3): 2623.
135050 reference parameter passing *note 6.2(2): 3626.
135051 reference type *note 4.1.5(3/3): 2622, *note N(36.1/3): 9579.
135052 Reference_Preserving_Key
135053 in Ada.Containers.Hashed_Sets *note A.18.8(58.2/3): 7624, *note
135054 A.18.8(58.4/3): 7626.
135055 in Ada.Containers.Ordered_Sets *note A.18.9(73.2/3): 7708, *note
135056 A.18.9(73.4/3): 7710.
135057 Reference_Type
135058 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17.2/3): 7351.
135059 in Ada.Containers.Hashed_Maps *note A.18.5(17.2/3): 7445.
135060 in Ada.Containers.Hashed_Sets *note A.18.8(58.1/3): 7623.
135061 in Ada.Containers.Indefinite_Holders *note A.18.18(17/3): 7835.
135062 in Ada.Containers.Multiway_Trees *note A.18.10(29/3): 7754.
135063 in Ada.Containers.Ordered_Maps *note A.18.6(16.2/3): 7499.
135064 in Ada.Containers.Ordered_Sets *note A.18.9(73.1/3): 7707.
135065 in Ada.Containers.Vectors *note A.18.2(34.2/3): 7263.
135066 references *note 1.2(1/3): 1108.
135067 Registered_Trade_Mark_Sign
135068 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6094.
135069 Reinitialize
135070 in Ada.Task_Attributes *note C.7.2(6): 8298.
135071 relation *note 4.4(3/3): 2873.
135072 used *note 4.4(2): 2852, *note P: 9898.
135073 relational operator *note 4.5.2(1): 2951.
135074 relational_operator *note 4.5(3): 2917.
135075 used *note 4.4(2.2/3): 2871, *note 4.4(3/3): 2875, *note P: 9919.
135076 Relative_Deadline aspect *note D.2.6(9.2/3): 8402.
135077 Relative_Deadline pragma *note J.15.12(2/3): 9273, *note L(29.2/3):
135078 9466.
135079 Relative_Name
135080 in Ada.Directories.Hierarchical_File_Names *note A.16.1(13/3):
135081 7201.
135082 relaxed mode *note G.2(1): 8942.
135083 release
135084 execution resource associated with protected object *note 9.5.1(6):
135085 4342.
135086 rem operator *note 4.4(1/3): 2836, *note 4.5.5(1): 3052.
135087 Remainder attribute *note A.5.3(45): 6708.
135088 remote access *note E.1(5): 8694.
135089 remote access type *note E.2.2(9/3): 8737.
135090 remote access-to-class-wide type *note E.2.2(9/3): 8739.
135091 remote access-to-subprogram type *note E.2.2(9/3): 8738.
135092 remote call interface *note E.2(4/3): 8712, *note E.2.3(7/3): 8755.
135093 remote procedure call
135094 asynchronous *note E.4.1(9/3): 8803.
135095 remote subprogram *note E.2.3(7/3): 8759.
135096 remote subprogram binding *note E.4(1): 8783.
135097 remote subprogram call *note E.4(1): 8779.
135098 remote types library unit *note E.2(4/3): 8711, *note E.2.2(4/3):
135099 8734.
135100 Remote_Call_Interface aspect *note E.2.3(7/3): 8761.
135101 Remote_Call_Interface pragma *note E.2.3(3): 8748, *note L(30): 9468.
135102 Remote_Types aspect *note E.2.2(4/3): 8736.
135103 Remote_Types pragma *note E.2.2(3): 8732, *note L(31): 9471.
135104 Remove_Task
135105 in Ada.Execution_Time.Group_Budgets *note D.14.2(8/2): 8625.
135106 Rename
135107 in Ada.Directories *note A.16(12/2): 7145.
135108 renamed entity *note 8.5(3): 4080.
135109 renamed view *note 8.5(3): 4079.
135110 renaming *note N(36.2/2): 9580.
135111 renaming-as-body *note 8.5.4(1/3): 4109.
135112 renaming-as-declaration *note 8.5.4(1/3): 4110.
135113 renaming_declaration *note 8.5(2): 4072.
135114 used *note 3.1(3/3): 1354, *note P: 9652.
135115 rendezvous *note 9.5.2(25): 4396.
135116 Replace
135117 in Ada.Containers.Hashed_Maps *note A.18.5(23/2): 7457.
135118 in Ada.Containers.Hashed_Sets *note A.18.8(22/2): 7591, *note
135119 A.18.8(53/2): 7617.
135120 in Ada.Containers.Ordered_Maps *note A.18.6(22/2): 7511.
135121 in Ada.Containers.Ordered_Sets *note A.18.9(21/2): 7665, *note
135122 A.18.9(66/2): 7699.
135123 Replace_Element
135124 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(15/2): 7348.
135125 in Ada.Containers.Hashed_Maps *note A.18.5(15/2): 7442.
135126 in Ada.Containers.Hashed_Sets *note A.18.8(16/2): 7582.
135127 in Ada.Containers.Indefinite_Holders *note A.18.18(13/3): 7831.
135128 in Ada.Containers.Multiway_Trees *note A.18.10(25/3): 7750.
135129 in Ada.Containers.Ordered_Maps *note A.18.6(14/2): 7496.
135130 in Ada.Containers.Ordered_Sets *note A.18.9(15/2): 7656.
135131 in Ada.Containers.Vectors *note A.18.2(29/2): 7257, *note
135132 A.18.2(30/2): 7258.
135133 in Ada.Strings.Bounded *note A.4.4(27): 6319.
135134 in Ada.Strings.Unbounded *note A.4.5(21): 6376.
135135 Replace_Slice
135136 in Ada.Strings.Bounded *note A.4.4(58): 6340, *note A.4.4(59):
135137 6341.
135138 in Ada.Strings.Fixed *note A.4.3(23): 6281, *note A.4.3(24): 6282.
135139 in Ada.Strings.Unbounded *note A.4.5(53): 6397, *note A.4.5(54):
135140 6398.
135141 Replenish
135142 in Ada.Execution_Time.Group_Budgets *note D.14.2(9/2): 8629.
135143 Replicate
135144 in Ada.Strings.Bounded *note A.4.4(78): 6356, *note A.4.4(79):
135145 6357, *note A.4.4(80): 6358.
135146 representation
135147 change of *note 13.6(1/3): 5529.
135148 representation aspect *note 13.1(8/3): 5298.
135149 coding *note 13.4(7): 5463.
135150 convention, calling convention *note B.1(1/3): 7949.
135151 export *note B.1(1/3): 7951.
135152 external_name *note B.1(1/3): 7952.
135153 import *note B.1(1/3): 7950.
135154 layout *note 13.5(1): 5471.
135155 link_name *note B.1(1/3): 7953.
135156 record layout *note 13.5(1): 5472.
135157 specifiable attributes *note 13.3(5/3): 5366.
135158 storage place *note 13.5(1): 5475.
135159 representation attribute *note 13.3(1/1): 5352.
135160 representation item *note 13.1(1/1): 5277.
135161 representation of an object *note 13.1(7/2): 5292.
135162 representation pragma *note 13.1(1/1): 5278.
135163 Asynchronous *note J.15.13(1/3): 9275.
135164 Atomic *note J.15.8(9/3): 9245.
135165 Atomic_Components *note J.15.8(9/3): 9249.
135166 Convention *note J.15.5(1/3): 9191.
135167 Discard_Names *note C.5(6): 8247.
135168 Export *note J.15.5(1/3): 9189.
135169 Import *note J.15.5(1/3): 9187.
135170 Independent *note J.15.8(9/3): 9253.
135171 Independent_Components *note J.15.8(9/3): 9255.
135172 No_Return *note J.15.2(1/3): 9165.
135173 Pack *note J.15.3(1/3): 9171.
135174 Unchecked_Union *note J.15.6(1/3): 9212.
135175 Volatile *note J.15.8(9/3): 9247.
135176 Volatile_Components *note J.15.8(9/3): 9251.
135177 representation-oriented attributes
135178 of a fixed point subtype *note A.5.4(1): 6750.
135179 of a floating point subtype *note A.5.3(1): 6656.
135180 representation_clause
135181 See aspect_clause *note 13.1(4/1): 5291.
135182 represented in canonical form *note A.5.3(10): 6670.
135183 requested decimal precision
135184 of a floating point type *note 3.5.7(4): 1896.
135185 requeue *note 9.5.4(1): 4428.
135186 requeue target *note 9.5.4(3/3): 4433.
135187 requeue-with-abort *note 9.5.4(13): 4440.
135188 requeue_statement *note 9.5.4(2/3): 4431.
135189 used *note 5.1(4/2): 3352, *note P: 9997.
135190 require overriding *note 3.9.3(6/2): 2334.
135191 requires a completion *note 3.11.1(1/3): 2516, *note 3.11.1(6/3):
135192 2520.
135193 declaration for which aspect Elaborate_Body is True *note
135194 10.2.1(25/3): 4852.
135195 declaration of a partial view *note 7.3(4): 3868.
135196 declaration to which a pragma Elaborate_Body applies *note
135197 10.2.1(25/3): 4851.
135198 deferred constant declaration *note 7.4(2/3): 3904.
135199 generic_package_declaration *note 7.1(5/2): 3835.
135200 generic_subprogram_declaration *note 6.1(20/3): 3566.
135201 incomplete_type_declaration *note 3.10.1(3/3): 2431.
135202 library_unit_declaration *note 10.2(18.c): 4796.
135203 package_declaration *note 7.1(5/2): 3834.
135204 protected entry_declaration *note 9.5.2(16): 4380.
135205 protected_declaration *note 9.4(11.2/2): 4302.
135206 subprogram_declaration *note 6.1(20/3): 3565.
135207 task_declaration *note 9.1(9.3/2): 4228.
135208 requires late initialization *note 3.3.1(8.1/2): 1572.
135209 requires overriding
135210 [partial] *note 6.1.1(16/3): 3598.
135211 Reraise_Occurrence
135212 in Ada.Exceptions *note 11.4.1(4/3): 4938.
135213 Reserve_Capacity
135214 in Ada.Containers.Hashed_Maps *note A.18.5(9/2): 7436.
135215 in Ada.Containers.Hashed_Sets *note A.18.8(11/2): 7577.
135216 in Ada.Containers.Vectors *note A.18.2(20/2): 7248.
135217 reserved interrupt *note C.3(2): 8199.
135218 reserved word *note 2.9(2/3): 1338.
135219 Reserved_128
135220 in Ada.Characters.Latin_1 *note A.3.3(17): 6047.
135221 Reserved_129
135222 in Ada.Characters.Latin_1 *note A.3.3(17): 6048.
135223 Reserved_132
135224 in Ada.Characters.Latin_1 *note A.3.3(17): 6051.
135225 Reserved_153
135226 in Ada.Characters.Latin_1 *note A.3.3(19): 6072.
135227 Reserved_Check
135228 [partial] *note C.3.1(10/3): 8210.
135229 Reset
135230 in Ada.Direct_IO *note A.8.4(8): 6817.
135231 in Ada.Numerics.Discrete_Random *note A.5.2(21): 6639, *note
135232 A.5.2(24): 6642.
135233 in Ada.Numerics.Float_Random *note A.5.2(9): 6626, *note A.5.2(12):
135234 6630.
135235 in Ada.Sequential_IO *note A.8.1(8): 6789.
135236 in Ada.Streams.Stream_IO *note A.12.1(10): 7076.
135237 in Ada.Text_IO *note A.10.1(11): 6874.
135238 resolution rules *note 1.1.2(26/3): 1020.
135239 resolve
135240 overload resolution *note 8.6(14): 4148.
135241 restriction *note 13.12(4/2): 5732.
135242 used *note 13.12(3): 5730, *note L(32): 9476.
135243 restriction_parameter_argument *note 13.12(4.1/2): 5736.
135244 used *note 13.12(4/2): 5735, *note P: 10463.
135245 restrictions
135246 Immediate_Reclamation *note H.4(10): 9079.
135247 Max_Asynchronous_Select_Nesting *note D.7(18/1): 8501.
135248 Max_Entry_Queue_Length *note D.7(19.1/2): 8511.
135249 Max_Protected_Entries *note D.7(14): 8492.
135250 Max_Select_Alternatives *note D.7(12): 8488.
135251 Max_Storage_At_Blocking *note D.7(17/1): 8496.
135252 Max_Task_Entries *note D.7(13): 8490.
135253 Max_Tasks *note D.7(19/1): 8506.
135254 No_Abort_Statements *note D.7(5/3): 8458.
135255 No_Access_Parameter_Allocators *note H.4(8.3/3): 9077.
135256 No_Access_Subprograms *note H.4(17): 9087.
135257 No_Allocators *note H.4(7): 9069.
135258 No_Anonymous_Allocators *note H.4(8.1/3): 9073.
135259 No_Asynchronous_Control *note J.13(3/2): 9153.
135260 No_Coextensions *note H.4(8.2/3): 9075.
135261 No_Delay *note H.4(21): 9097.
135262 No_Dependence *note 13.12.1(6/2): 5762.
135263 No_Dispatch *note H.4(19): 9093.
135264 No_Dynamic_Attachment *note D.7(10/3): 8469.
135265 No_Dynamic_Priorities *note D.7(9/2): 8467.
135266 No_Exceptions *note H.4(12): 9081.
135267 No_Fixed_Point *note H.4(15): 9085.
135268 No_Floating_Point *note H.4(14): 9083.
135269 No_Implementation_Aspect_Specifications *note 13.12.1(1.1/3): 5750.
135270 No_Implementation_Attributes *note 13.12.1(2/2): 5752.
135271 No_Implementation_Identifiers *note 13.12.1(2.1/3): 5754.
135272 No_Implementation_Pragmas *note 13.12.1(3/2): 5756.
135273 No_Implementation_Units *note 13.12.1(3.1/3): 5758.
135274 No_Implicit_Heap_Allocations *note D.7(8): 8465.
135275 No_IO *note H.4(20/2): 9095.
135276 No_Local_Allocators *note H.4(8/1): 9071.
135277 No_Local_Protected_Objects *note D.7(10.1/3): 8471.
135278 No_Local_Timing_Events *note D.7(10.2/3): 8473.
135279 No_Nested_Finalization *note D.7(4/3): 8456.
135280 No_Obsolescent_Features *note 13.12.1(4/3): 5760.
135281 No_Protected_Type_Allocators *note D.7(10.3/2): 8475.
135282 No_Protected_Types *note H.4(5): 9067.
135283 No_Recursion *note H.4(22): 9099.
135284 No_Reentrancy *note H.4(23): 9101.
135285 No_Relative_Delay *note D.7(10.5/3): 8478.
135286 No_Requeue_Statements *note D.7(10.6/3): 8480.
135287 No_Select_Statements *note D.7(10.7/3): 8482.
135288 No_Specific_Termination_Handlers *note D.7(10.8/3): 8484.
135289 No_Specification_of_Aspect *note 13.12.1(6.1/3): 5764.
135290 No_Standard_Allocators_After_Elaboration *note D.7(19.2/3): 8514.
135291 No_Task_Allocators *note D.7(7): 8462.
135292 No_Task_Hierarchy *note D.7(3/3): 8454.
135293 No_Task_Termination *note D.7(15.1/2): 8494.
135294 No_Terminate_Alternatives *note D.7(6): 8460.
135295 No_Unchecked_Access *note H.4(18): 9089.
135296 No_Unchecked_Conversion *note J.13(4/2): 9154.
135297 No_Unchecked_Deallocation *note J.13(5/2): 9155.
135298 No_Use_Of_Attribute *note 13.12.1(6.2/3): 5766.
135299 No_Use_Of_Pragma *note 13.12.1(6.3/3): 5768.
135300 Simple_Barriers *note D.7(10.9/3): 8486.
135301 Restrictions pragma *note 13.12(3): 5729, *note L(32): 9474.
135302 Result attribute *note 6.1.1(29/3): 3606.
135303 result interval
135304 for a component of the result of evaluating a complex function
135305 *note G.2.6(3): 8981.
135306 for the evaluation of a predefined arithmetic operation *note
135307 G.2.1(8): 8948.
135308 for the evaluation of an elementary function *note G.2.4(2): 8975.
135309 result subtype
135310 of a function *note 6.5(3/2): 3753.
135311 return object
135312 extended_return_statement *note 6.5(5.10/3): 3758.
135313 simple_return_statement *note 6.5(6/2): 3767.
135314 return statement *note 6.5(1/2): 3740.
135315 return_subtype_indication *note 6.5(2.3/2): 3750.
135316 used *note 6.5(2.1/3): 3745, *note P: 10098.
135317 reverse iterator *note 5.5.2(4/3): 3480.
135318 Reverse_Elements
135319 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(27/2): 7365.
135320 in Ada.Containers.Vectors *note A.18.2(54/2): 7289.
135321 Reverse_Find
135322 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(42/2): 7380.
135323 in Ada.Containers.Vectors *note A.18.2(70/2): 7305.
135324 Reverse_Find_Index
135325 in Ada.Containers.Vectors *note A.18.2(69/2): 7304.
135326 Reverse_Iterate
135327 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(46/2): 7383.
135328 in Ada.Containers.Ordered_Maps *note A.18.6(51/2): 7533.
135329 in Ada.Containers.Ordered_Sets *note A.18.9(61/2): 7694.
135330 in Ada.Containers.Vectors *note A.18.2(74/2): 7308.
135331 Reverse_Iterate_Children
135332 in Ada.Containers.Multiway_Trees *note A.18.10(69/3): 7794.
135333 Reverse_Solidus
135334 in Ada.Characters.Latin_1 *note A.3.3(12): 6006.
135335 reversible iterable container object *note 5.5.1(11/3): 3462.
135336 reversible iterable container type *note 5.5.1(11/3): 3460.
135337 reversible iterator object *note 5.5.1(6/3): 3449.
135338 reversible iterator type *note 5.5.1(6/3): 3447.
135339 Reversible_Iterator
135340 in Ada.Iterator_Interfaces *note 5.5.1(4/3): 3443.
135341 Reviewable pragma *note H.3.1(3): 9058, *note L(33): 9478.
135342 RI
135343 in Ada.Characters.Latin_1 *note A.3.3(17): 6060.
135344 right parenthesis *note 2.1(15/3): 1194.
135345 Right_Angle_Quotation
135346 in Ada.Characters.Latin_1 *note A.3.3(22): 6109.
135347 Right_Curly_Bracket
135348 in Ada.Characters.Latin_1 *note A.3.3(14): 6039.
135349 Right_Parenthesis
135350 in Ada.Characters.Latin_1 *note A.3.3(8): 5990.
135351 Right_Square_Bracket
135352 in Ada.Characters.Latin_1 *note A.3.3(12): 6007.
135353 Ring_Above
135354 in Ada.Characters.Latin_1 *note A.3.3(22): 6097.
135355 ripple effect *note 10.1.2(1.b/2): 4697.
135356 root
135357 of a tree *note A.18.10(3/3): 7727.
135358 in Ada.Containers.Multiway_Trees *note A.18.10(22/3): 7747.
135359 root library unit *note 10.1.1(10): 4681.
135360 root node
135361 of a tree *note A.18.10(3/3): 7728.
135362 root type
135363 of a class *note 3.4.1(2/2): 1644.
135364 root_integer *note 3.5.4(14): 1834.
135365 [partial] *note 3.4.1(8): 1654.
135366 root_real *note 3.5.6(3): 1883.
135367 [partial] *note 3.4.1(8): 1655.
135368 Root_Storage_Pool
135369 in System.Storage_Pools *note 13.11(6/2): 5623.
135370 Root_Storage_Pool_With_Subpools
135371 in System.Storage_Pools.Subpools *note 13.11.4(4/3): 5695.
135372 Root_Stream_Type
135373 in Ada.Streams *note 13.13.1(3/2): 5778.
135374 Root_Subpool
135375 in System.Storage_Pools.Subpools *note 13.11.4(5/3): 5696.
135376 rooted at a type *note 3.4.1(2/2): 1645.
135377 roots the subtree *note A.18.10(3/3): 7725.
135378 Rosen trick *note 13.9.1(14.e/3): 5609.
135379 rotate *note B.2(9): 7982.
135380 Round attribute *note 3.5.10(12): 1984.
135381 Round_Robin
135382 child of Ada.Dispatching *note D.2.5(4/2): 8386.
135383 Round_Robin_Within_Priorities task dispatching policy *note
135384 D.2.5(2/2): 8385.
135385 Rounding attribute *note A.5.3(36): 6699.
135386 RPC
135387 child of System *note E.5(3): 8808.
135388 RPC-receiver *note E.5(21): 8819.
135389 RPC_Receiver
135390 in System.RPC *note E.5(11): 8816.
135391 RS
135392 in Ada.Characters.Latin_1 *note A.3.3(6): 5979.
135393 run-time check
135394 See language-defined check *note 11.5(2/3): 4983.
135395 run-time error *note 1.1.2(30): 1036, *note 1.1.5(6): 1096, *note
135396 11.5(2/3): 4984, *note 11.6(1/3): 5023.
135397 run-time polymorphism *note 3.9.2(1/2): 2290.
135398 run-time semantics *note 1.1.2(30): 1035.
135399 run-time type
135400 See tag *note 3.9(3): 2225.
135401 running a program
135402 See program execution *note 10.2(1): 4784.
135403 running task *note D.2.1(6/2): 8351.
135404
135405
135406 \1f
135407 File: aarm2012.info, Node: S, Next: T, Prev: R, Up: Index
135408
135409 S
135410 ==
135411
135412
135413
135414 safe range
135415 of a floating point type *note 3.5.7(9): 1904.
135416 of a floating point type *note 3.5.7(10): 1906.
135417 safe separate compilation *note 10(3.b): 4638.
135418 Safe_First attribute *note A.5.3(71): 6744, *note G.2.2(5): 8959.
135419 Safe_Last attribute *note A.5.3(72): 6746, *note G.2.2(6): 8961.
135420 safety-critical systems *note H(1/2): 9046.
135421 same value
135422 for a limited type *note 6.2(10.f): 3631.
135423 satisfies
135424 a discriminant constraint *note 3.7.1(11): 2133.
135425 a range constraint *note 3.5(4): 1678.
135426 a subtype predicate *note 3.2.4(32/3): 1519.
135427 an index constraint *note 3.6.1(7): 2049.
135428 for an access value *note 3.10(15/2): 2417.
135429 Saturday
135430 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4500.
135431 Save
135432 in Ada.Numerics.Discrete_Random *note A.5.2(24): 6641.
135433 in Ada.Numerics.Float_Random *note A.5.2(12): 6629.
135434 Save_Occurrence
135435 in Ada.Exceptions *note 11.4.1(6/2): 4944.
135436 scalar type *note 3.2(3): 1398, *note 3.5(1): 1662, *note N(37): 9581.
135437 scalar_constraint *note 3.2.2(6): 1474.
135438 used *note 3.2.2(5): 1472, *note P: 9682.
135439 scale
135440 of a decimal fixed point subtype *note 3.5.10(11): 1982, *note
135441 K.2(216): 9313.
135442 Scale attribute *note 3.5.10(11): 1981.
135443 Scaling attribute *note A.5.3(27): 6690.
135444 SCHAR_MAX
135445 in Interfaces.C *note B.3(6): 7989.
135446 SCHAR_MIN
135447 in Interfaces.C *note B.3(6): 7988.
135448 SCI
135449 in Ada.Characters.Latin_1 *note A.3.3(19): 6073.
135450 scope
135451 informal definition *note 3.1(8): 1369.
135452 of (a view of) an entity *note 8.2(11): 4007.
135453 of a declaration *note 8.2(10): 4003.
135454 of a use_clause *note 8.4(6): 4064.
135455 of a with_clause *note 10.1.2(5): 4713.
135456 of an aspect_specification *note 8.2(10.1/3): 4005.
135457 of an attribute_definition_clause *note 8.2(10.1/3): 4004.
135458 Search_Type
135459 in Ada.Directories *note A.16(31/2): 7163.
135460 Second
135461 in Ada.Calendar.Formatting *note 9.6.1(26/2): 4512.
135462 Second_Duration subtype of Day_Duration
135463 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4506.
135464 Second_Number subtype of Natural
135465 in Ada.Calendar.Formatting *note 9.6.1(20/2): 4505.
135466 Seconds
135467 in Ada.Calendar *note 9.6(13): 4468.
135468 in Ada.Real_Time *note D.8(14/2): 8538.
135469 Seconds_Count
135470 in Ada.Real_Time *note D.8(15): 8540.
135471 Seconds_Of
135472 in Ada.Calendar.Formatting *note 9.6.1(28/2): 4514.
135473 Section_Sign
135474 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6087.
135475 secure systems *note H(1/2): 9047.
135476 select an entry call
135477 from an entry queue *note 9.5.3(13): 4420, *note 9.5.3(16): 4421.
135478 immediately *note 9.5.3(8): 4417.
135479 select_alternative *note 9.7.1(4): 4542.
135480 used *note 9.7.1(2): 4538, *note P: 10251.
135481 select_statement *note 9.7(2): 4527.
135482 used *note 5.1(5/2): 3364, *note P: 10008.
135483 selected_component *note 4.1.3(2): 2584.
135484 used *note 4.1(2/3): 2527, *note P: 9834.
135485 selection
135486 of an entry caller *note 9.5.2(24): 4395.
135487 selective_accept *note 9.7.1(2): 4534.
135488 used *note 9.7(2): 4528, *note P: 10244.
135489 selector_name *note 4.1.3(3): 2587.
135490 used *note 3.7.1(3): 2123, *note 4.1.3(2): 2586, *note 4.3.1(5):
135491 2695, *note 6.4(5): 3701, *note 12.3(4): 5090, *note 12.7(3.1/2): 5268,
135492 *note P: 10362.
135493 semantic dependence
135494 of one compilation unit upon another *note 10.1.1(26/2): 4692.
135495 semicolon *note 2.1(15/3): 1207.
135496 in Ada.Characters.Latin_1 *note A.3.3(10): 5999.
135497 separate compilation *note 10.1(1): 4641.
135498 safe *note 10(3.b): 4639.
135499 Separate_Interrupt_Clocks_Supported
135500 in Ada.Execution_Time *note D.14(9.2/3): 8595.
135501 separator *note 2.2(3/2): 1226.
135502 separator_line *note 2.1(12/2): 1180.
135503 separator_paragraph *note 2.1(12.1/2): 1181.
135504 separator_space *note 2.1(11/2): 1179.
135505 sequence of characters
135506 of a string_literal *note 2.6(5): 1299.
135507 sequence_of_statements *note 5.1(2/3): 3335.
135508 used *note 5.3(2): 3402, *note 5.4(3): 3410, *note 5.5(2): 3423,
135509 *note 9.7.1(2): 4539, *note 9.7.1(5): 4548, *note 9.7.1(6): 4551, *note
135510 9.7.2(3/2): 4565, *note 9.7.3(2): 4573, *note 9.7.4(3): 4580, *note
135511 9.7.4(5): 4585, *note 11.2(2): 4887, *note 11.2(3): 4894, *note P:
135512 10025.
135513 sequential
135514 actions *note 9.10(11): 4632, *note C.6(17): 8266.
135515 sequential access *note A.8(2): 6776.
135516 sequential file *note A.8(1/2): 6773.
135517 Sequential_IO
135518 child of Ada *note A.8.1(2): 6781.
135519 service
135520 an entry queue *note 9.5.3(13): 4419.
135521 set
135522 execution timer object *note D.14.1(12/2): 8613.
135523 group budget object *note D.14.2(15/2): 8641.
135524 termination handler *note C.7.3(9/2): 8318.
135525 timing event object *note D.15(9/2): 8659.
135526 in Ada.Containers.Hashed_Sets *note A.18.8(3/3): 7568.
135527 in Ada.Containers.Ordered_Sets *note A.18.9(4/3): 7644.
135528 in Ada.Environment_Variables *note A.17(6/2): 7209.
135529 set container *note A.18.7(1/2): 7544.
135530 Set_Bounded_String
135531 in Ada.Strings.Bounded *note A.4.4(12.1/2): 6309.
135532 Set_Col
135533 in Ada.Text_IO *note A.10.1(35): 6919.
135534 Set_CPU
135535 in System.Multiprocessors.Dispatching_Domains *note D.16.1(12/3):
135536 8680.
135537 Set_Deadline
135538 in Ada.Dispatching.EDF *note D.2.6(9/2): 8398.
135539 Set_Dependents_Fallback_Handler
135540 in Ada.Task_Termination *note C.7.3(5/2): 8308.
135541 Set_Directory
135542 in Ada.Directories *note A.16(6/2): 7139.
135543 Set_Error
135544 in Ada.Text_IO *note A.10.1(15): 6881.
135545 Set_Exit_Status
135546 in Ada.Command_Line *note A.15(9): 7134.
135547 Set_False
135548 in Ada.Synchronous_Task_Control *note D.10(4): 8557.
135549 Set_Handler
135550 in Ada.Execution_Time.Group_Budgets *note D.14.2(10/2): 8633.
135551 in Ada.Execution_Time.Timers *note D.14.1(7/2): 8608.
135552 in Ada.Real_Time.Timing_Events *note D.15(5/2): 8653.
135553 Set_Im
135554 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(8/2): 9011,
135555 *note G.3.2(28/2): 9024.
135556 in Ada.Numerics.Generic_Complex_Types *note G.1.1(7): 8876.
135557 Set_Index
135558 in Ada.Direct_IO *note A.8.4(14): 6826.
135559 in Ada.Streams.Stream_IO *note A.12.1(22): 7087.
135560 Set_Input
135561 in Ada.Text_IO *note A.10.1(15): 6879.
135562 Set_Iterator_Interfaces
135563 in Ada.Containers.Hashed_Sets *note A.18.8(6.2/3): 7573.
135564 in Ada.Containers.Ordered_Sets *note A.18.9(7.2/3): 7649.
135565 Set_Length
135566 in Ada.Containers.Vectors *note A.18.2(22/2): 7250.
135567 Set_Line
135568 in Ada.Text_IO *note A.10.1(36): 6921.
135569 Set_Line_Length
135570 in Ada.Text_IO *note A.10.1(23): 6898.
135571 Set_Mode
135572 in Ada.Streams.Stream_IO *note A.12.1(24): 7090.
135573 Set_Output
135574 in Ada.Text_IO *note A.10.1(15): 6880.
135575 Set_Page_Length
135576 in Ada.Text_IO *note A.10.1(24): 6899.
135577 Set_Pool_of_Subpool
135578 in System.Storage_Pools.Subpools *note 13.11.4(10/3): 5700.
135579 Set_Priority
135580 in Ada.Dynamic_Priorities *note D.5.1(4): 8444.
135581 Set_Quantum
135582 in Ada.Dispatching.Round_Robin *note D.2.5(4/2): 8388.
135583 Set_Re
135584 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(8/2): 9010,
135585 *note G.3.2(28/2): 9023.
135586 in Ada.Numerics.Generic_Complex_Types *note G.1.1(7): 8874.
135587 Set_Specific_Handler
135588 in Ada.Task_Termination *note C.7.3(6/2): 8310.
135589 Set_True
135590 in Ada.Synchronous_Task_Control *note D.10(4): 8556.
135591 Set_Unbounded_String
135592 in Ada.Strings.Unbounded *note A.4.5(11.1/2): 6371.
135593 Set_Value
135594 in Ada.Task_Attributes *note C.7.2(6): 8297.
135595 shared passive library unit *note E.2(4/3): 8710, *note E.2.1(4/3):
135596 8719.
135597 shared variable
135598 protection of *note 9.10(1/3): 4627.
135599 Shared_Passive aspect *note E.2.1(4/3): 8721.
135600 Shared_Passive pragma *note E.2.1(3): 8717, *note L(34): 9480.
135601 shift *note B.2(9): 7981.
135602 short
135603 in Interfaces.C *note B.3(7): 7992.
135604 short-circuit control form *note 4.5.1(1): 2931.
135605 Short_Float *note 3.5.7(16): 1915.
135606 Short_Integer *note 3.5.4(25): 1854.
135607 SI
135608 in Ada.Characters.Latin_1 *note A.3.3(5): 5964.
135609 signal
135610 as defined between actions *note 9.10(2): 4630.
135611 See interrupt *note C.3(1/3): 8191.
135612 signal (an exception)
135613 See raise *note 11(1/3): 4862.
135614 signal handling
135615 example *note 9.7.4(10): 4589.
135616 signed integer type *note 3.5.4(1): 1808.
135617 signed_char
135618 in Interfaces.C *note B.3(8): 7994.
135619 signed_integer_type_definition *note 3.5.4(3): 1814.
135620 used *note 3.5.4(2): 1812, *note P: 9719.
135621 Signed_Zeros attribute *note A.5.3(13): 6677.
135622 simple entry call *note 9.5.3(1): 4401.
135623 simple name
135624 of a file *note A.16(47/2): 7183.
135625 Simple_Barriers restriction *note D.7(10.9/3): 8487.
135626 simple_expression *note 4.4(4): 2886.
135627 used *note 3.5(3): 1670, *note 3.5.4(3): 1816, *note 3.5.7(3):
135628 1895, *note 4.4(2.2/3): 2872, *note 4.4(3/3): 2874, *note 13.5.1(5):
135629 5491, *note 13.5.1(6): 5493, *note P: 9924.
135630 Simple_Name
135631 in Ada.Directories *note A.16(16/2): 7148, *note A.16(38/2): 7168.
135632 in Ada.Directories.Hierarchical_File_Names *note A.16.1(10/3):
135633 7198.
135634 simple_return_statement *note 6.5(2/2): 3741.
135635 used *note 5.1(4/2): 3350, *note P: 9995.
135636 simple_statement *note 5.1(4/2): 3344.
135637 used *note 5.1(3): 3341, *note P: 9987.
135638 Sin
135639 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
135640 G.1.2(4): 8899.
135641 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6591.
135642 single
135643 class expected type *note 8.6(27/2): 4163.
135644 single entry *note 9.5.2(20): 4388.
135645 Single_Precision_Complex_Types
135646 in Interfaces.Fortran *note B.5(8): 8165.
135647 single_protected_declaration *note 9.4(3/3): 4270.
135648 used *note 3.3.1(2/3): 1562, *note P: 9702.
135649 single_task_declaration *note 9.1(3/3): 4205.
135650 used *note 3.3.1(2/3): 1561, *note P: 9701.
135651 Sinh
135652 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
135653 G.1.2(6): 8907.
135654 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6606.
135655 size
135656 of an object *note 13.1(7/2): 5293.
135657 in Ada.Direct_IO *note A.8.4(15): 6828.
135658 in Ada.Directories *note A.16(26/2): 7159, *note A.16(41/2): 7171.
135659 in Ada.Streams.Stream_IO *note A.12.1(23): 7089.
135660 Size (object) aspect *note 13.3(41): 5417.
135661 Size (subtype) aspect *note 13.3(48): 5424.
135662 Size attribute *note 13.3(40): 5413, *note 13.3(45): 5420.
135663 Size clause *note 13.3(7/2): 5371, *note 13.3(41): 5415, *note
135664 13.3(48): 5422.
135665 size_t
135666 in Interfaces.C *note B.3(13): 8001.
135667 Skip_Line
135668 in Ada.Text_IO *note A.10.1(29): 6907.
135669 Skip_Page
135670 in Ada.Text_IO *note A.10.1(32): 6913.
135671 slice *note 4.1.2(2): 2573.
135672 used *note 4.1(2/3): 2526, *note P: 9833.
135673 in Ada.Strings.Bounded *note A.4.4(28): 6320.
135674 in Ada.Strings.Unbounded *note A.4.5(22): 6377.
135675 small
135676 of a fixed point type *note 3.5.9(8/2): 1943.
135677 Small aspect *note 3.5.10(2/1): 1970.
135678 Small attribute *note 3.5.10(2/1): 1966.
135679 Small clause *note 3.5.10(2/1): 1968, *note 13.3(7/2): 5374.
135680 SO
135681 in Ada.Characters.Latin_1 *note A.3.3(5): 5963.
135682 Soft_Hyphen
135683 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6093.
135684 SOH
135685 in Ada.Characters.Latin_1 *note A.3.3(5): 5950.
135686 solidus *note 2.1(15/3): 1204.
135687 in Ada.Characters.Latin_1 *note A.3.3(8): 5997.
135688 Solve
135689 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(46/2): 9035.
135690 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(24/2): 8993.
135691 Sort
135692 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(49/2): 7386.
135693 in Ada.Containers.Vectors *note A.18.2(77/2): 7311.
135694 SOS
135695 in Ada.Characters.Latin_1 *note A.3.3(19): 6071.
135696 SPA
135697 in Ada.Characters.Latin_1 *note A.3.3(18): 6069.
135698 Space
135699 in Ada.Characters.Latin_1 *note A.3.3(8): 5981.
135700 in Ada.Strings *note A.4.1(4/2): 6224.
135701 special file *note A.16(45/2): 7178.
135702 special graphic character
135703 a category of Character *note A.3.2(32): 5944.
135704 Special_Set
135705 in Ada.Strings.Maps.Constants *note A.4.6(4): 6427.
135706 Specialized Needs Annexes *note 1.1.2(7): 1005.
135707 specifiable
135708 of Address for entries *note J.7.1(6): 9137.
135709 of Address for stand-alone objects and for program units *note
135710 13.3(12): 5392.
135711 of Alignment for first subtypes *note 13.3(26.4/2): 5404.
135712 of Alignment for objects *note 13.3(25/2): 5400.
135713 of Bit_Order for record types and record extensions *note
135714 13.5.3(4): 5521.
135715 of Component_Size for array types *note 13.3(70): 5438.
135716 of External_Tag for a tagged type *note 13.3(75/3): 5450, *note
135717 K.2(65): 9294.
135718 of Input for a type *note 13.13.2(38/3): 5814.
135719 of Machine_Radix for decimal first subtypes *note F.1(1): 8825.
135720 of Output for a type *note 13.13.2(38/3): 5815.
135721 of Read for a type *note 13.13.2(38/3): 5812.
135722 of Size for first subtypes *note 13.3(48): 5421.
135723 of Size for stand-alone objects *note 13.3(41): 5414.
135724 of Small for fixed point types *note 3.5.10(2/1): 1967.
135725 of Storage_Pool for a nonderived access-to-object type *note
135726 13.11(15): 5637.
135727 of Storage_Size for a nonderived access-to-object type *note
135728 13.11(15): 5636.
135729 of Storage_Size for a task first subtype *note J.9(3/3): 9146.
135730 of Write for a type *note 13.13.2(38/3): 5813.
135731 specifiable (of an attribute and for an entity) *note 13.3(5/3): 5364.
135732 specific handler *note C.7.3(9/2): 8316.
135733 specific postcondition expression *note 6.1.1(4/3): 3588.
135734 specific precondition expression *note 6.1.1(2/3): 3580.
135735 specific type *note 3.4.1(3/2): 1646.
135736 Specific_Handler
135737 in Ada.Task_Termination *note C.7.3(6/2): 8311.
135738 specified
135739 of an aspect of representation of an entity *note 13.1(17): 5309.
135740 of an operational aspect of an entity *note 13.1(18.1/1): 5311.
135741 specified (not!) *note 1.1.3(18): 1072, *note M.2(1.a): 9509.
135742 specified as independently addressable *note C.6(8.1/3): 8263.
135743 specified discriminant *note 3.7(18): 2103.
135744 Splice
135745 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(30/2): 7368,
135746 *note A.18.3(31/2): 7369, *note A.18.3(32/2): 7370.
135747 Splice_Children
135748 in Ada.Containers.Multiway_Trees *note A.18.10(57/3): 7782, *note
135749 A.18.10(58/3): 7783.
135750 Splice_Subtree
135751 in Ada.Containers.Multiway_Trees *note A.18.10(55/3): 7780, *note
135752 A.18.10(56/3): 7781.
135753 Split
135754 in Ada.Calendar *note 9.6(14): 4469.
135755 in Ada.Calendar.Formatting *note 9.6.1(29/2): 4515, *note
135756 9.6.1(32/2): 4518, *note 9.6.1(33/2): 4519, *note 9.6.1(34/2): 4520.
135757 in Ada.Execution_Time *note D.14(8/2): 8592.
135758 in Ada.Real_Time *note D.8(16): 8541.
135759 Sqrt
135760 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
135761 G.1.2(3): 8895.
135762 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(4): 6586.
135763 squirrel away *note 8.5.4(8.g): 4122, *note 13.9.1(14.e/3): 5608.
135764 SS2
135765 in Ada.Characters.Latin_1 *note A.3.3(17): 6061.
135766 SS3
135767 in Ada.Characters.Latin_1 *note A.3.3(17): 6062.
135768 SSA
135769 in Ada.Characters.Latin_1 *note A.3.3(17): 6053.
135770 ST
135771 in Ada.Characters.Latin_1 *note A.3.3(19): 6075.
135772 stand-alone constant *note 3.3.1(23/3): 1590.
135773 corresponding to a formal object of mode in *note 12.4(10/2): 5149.
135774 stand-alone object *note 3.3.1(1/3): 1542.
135775 [partial] *note 12.4(10/2): 5150.
135776 stand-alone variable *note 3.3.1(23/3): 1591.
135777 Standard *note A.1(4): 5878.
135778 standard error file *note A.10(6): 6848.
135779 standard input file *note A.10(5): 6846.
135780 standard mode *note 1.1.5(11): 1104.
135781 standard output file *note A.10(5): 6847.
135782 standard storage pool *note 13.11(17): 5644.
135783 Standard_Error
135784 in Ada.Text_IO *note A.10.1(16): 6884, *note A.10.1(19): 6891.
135785 Standard_Input
135786 in Ada.Text_IO *note A.10.1(16): 6882, *note A.10.1(19): 6889.
135787 Standard_Output
135788 in Ada.Text_IO *note A.10.1(16): 6883, *note A.10.1(19): 6890.
135789 Start_Search
135790 in Ada.Directories *note A.16(32/2): 7164.
135791 State
135792 in Ada.Numerics.Discrete_Random *note A.5.2(23): 6640.
135793 in Ada.Numerics.Float_Random *note A.5.2(11): 6628.
135794 statement *note 5.1(3): 3339.
135795 used *note 5.1(2/3): 3336, *note P: 9983.
135796 statement_identifier *note 5.1(8): 3368.
135797 used *note 5.1(7): 3367, *note 5.5(2): 3421, *note 5.6(2): 3493,
135798 *note P: 10023.
135799 static *note 3.3.2(1.a/3): 1597, *note 4.9(1): 3304.
135800 constant *note 4.9(24): 3310.
135801 constraint *note 4.9(27): 3316.
135802 delta constraint *note 4.9(29): 3319.
135803 digits constraint *note 4.9(29): 3318.
135804 discrete_range *note 4.9(25): 3312.
135805 discriminant constraint *note 4.9(31): 3321.
135806 expression *note 4.9(2): 3306.
135807 function *note 4.9(18): 3309.
135808 index constraint *note 4.9(30): 3320.
135809 range *note 4.9(25): 3311.
135810 range constraint *note 4.9(29): 3317.
135811 scalar subtype *note 4.9(26/3): 3314.
135812 string subtype *note 4.9(26/3): 3315.
135813 subtype *note 4.9(26/3): 3313.
135814 subtype *note 12.4(9/2): 5147.
135815 value *note 4.9(13.a): 3307.
135816 static semantics *note 1.1.2(28): 1026.
135817 Static_Predicate aspect *note 3.2.4(1/3): 1503.
135818 statically
135819 constrained *note 4.9(32): 3322.
135820 denote *note 4.9(14): 3308.
135821 statically compatible
135822 for a constraint and a scalar subtype *note 4.9.1(4/3): 3331.
135823 for a constraint and an access or composite subtype *note
135824 4.9.1(4/3): 3332.
135825 for two subtypes *note 4.9.1(5/3): 3333.
135826 statically deeper *note 3.10.2(4): 2450, *note 3.10.2(17): 2459.
135827 statically determined tag *note 3.9.2(1/2): 2287.
135828 [partial] *note 3.9.2(15): 2312, *note 3.9.2(19): 2316.
135829 statically matching
135830 effect on subtype-specific aspects *note 13.1(14): 5308.
135831 for constraints *note 4.9.1(1/2): 3328.
135832 for ranges *note 4.9.1(3): 3330.
135833 for subtypes *note 4.9.1(2/3): 3329.
135834 required *note 3.9.2(10/2): 2308, *note 3.10.2(27.1/2): 2466, *note
135835 4.6(24.15/2): 3160, *note 4.6(24.5/2): 3155, *note 6.3.1(16.3/3): 3671,
135836 *note 6.3.1(17/3): 3674, *note 6.3.1(23): 3680, *note 6.5(5.2/3): 3757,
135837 *note 7.3(13): 3872, *note 8.5.1(4.2/2): 4091, *note 12.4(8.1/2): 5143,
135838 *note 12.5.1(14): 5198, *note 12.5.3(6): 5214, *note 12.5.3(7): 5215,
135839 *note 12.5.4(3): 5219, *note 12.7(7): 5270.
135840 statically tagged *note 3.9.2(4/2): 2305.
135841 statically unevaluated *note 4.9(32.1/3): 3323.
135842 Status_Error
135843 in Ada.Direct_IO *note A.8.4(18): 6830.
135844 in Ada.Directories *note A.16(43/2): 7173.
135845 in Ada.IO_Exceptions *note A.13(4): 7115.
135846 in Ada.Sequential_IO *note A.8.1(15): 6797.
135847 in Ada.Streams.Stream_IO *note A.12.1(26): 7092.
135848 in Ada.Text_IO *note A.10.1(85): 7006.
135849 storage deallocation
135850 unchecked *note 13.11.2(1): 5665.
135851 storage element *note 13.3(8): 5386.
135852 storage management
135853 user-defined *note 13.11(1): 5619.
135854 storage node *note E(2): 8688.
135855 storage place
135856 of a component *note 13.5(1): 5477.
135857 representation aspect *note 13.5(1): 5476.
135858 storage place attributes
135859 of a component *note 13.5.2(1): 5502.
135860 storage pool *note 3.10(7/1): 2396, *note N(37.1/3): 9582.
135861 default *note 13.11.3(4.1/3): 5688.
135862 storage pool element *note 13.11(11): 5629.
135863 storage pool that supports subpools *note 13.11.4(18/3): 5711.
135864 storage pool type *note 13.11(11): 5627.
135865 Storage_Array
135866 in System.Storage_Elements *note 13.7.1(5): 5563.
135867 Storage_Check *note 11.5(23): 5012.
135868 [partial] *note 11.1(6): 4880, *note 13.3(67): 5433, *note
135869 13.11(17): 5645, *note D.7(17/1): 8498, *note D.7(18/1): 8503, *note
135870 D.7(19/1): 8508.
135871 Storage_Count subtype of Storage_Offset
135872 in System.Storage_Elements *note 13.7.1(4): 5561.
135873 Storage_Element
135874 in System.Storage_Elements *note 13.7.1(5): 5562.
135875 Storage_Elements
135876 child of System *note 13.7.1(2/2): 5559.
135877 Storage_Error
135878 raised by failure of run-time check *note 4.8(14): 3296, *note
135879 8.5.4(8.1/1): 4124, *note 11.1(4): 4877, *note 11.1(6): 4882, *note
135880 11.5(23): 5013, *note 13.3(67): 5435, *note 13.11(17): 5647, *note
135881 13.11(18): 5650, *note A.7(14/3): 6771, *note D.7(17/1): 8500, *note
135882 D.7(18/1): 8505, *note D.7(19.3/3): 8516, *note D.7(19/1): 8510.
135883 in Standard *note A.1(46): 5895.
135884 Storage_IO
135885 child of Ada *note A.9(3): 6839.
135886 Storage_Offset
135887 in System.Storage_Elements *note 13.7.1(3): 5560.
135888 Storage_Pool aspect *note 13.11(15): 5641.
135889 Storage_Pool attribute *note 13.11(13): 5633.
135890 Storage_Pool clause *note 13.3(7/2): 5376, *note 13.11(15): 5638.
135891 storage_pool_indicator *note 13.11.3(3.1/3): 5685.
135892 used *note 13.11.3(3/3): 5684, *note L(8.3/3): 9366.
135893 Storage_Pools
135894 child of System *note 13.11(5): 5622.
135895 Storage_Size
135896 in System.Storage_Pools *note 13.11(9): 5626.
135897 in System.Storage_Pools.Subpools *note 13.11.4(16/3): 5706.
135898 Storage_Size (access) aspect *note 13.11(15): 5643.
135899 Storage_Size (task) aspect *note 13.3(65.2/3): 5432.
135900 Storage_Size attribute *note 13.3(60/3): 5430, *note 13.11(14): 5635,
135901 *note J.9(2): 9145.
135902 Storage_Size clause *note 13.3(7/2): 5377, *note 13.11(15): 5639.
135903 Storage_Size pragma *note J.15.4(2/3): 9177, *note L(35.1/3): 9483.
135904 Storage_Unit
135905 in System *note 13.7(13): 5544.
135906 stream *note 13.13(1): 5773, *note N(37.2/3): 9583.
135907 in Ada.Streams.Stream_IO *note A.12.1(13): 7082.
135908 in Ada.Text_IO.Text_Streams *note A.12.2(4): 7106.
135909 in Ada.Wide_Text_IO.Text_Streams *note A.12.3(4): 7109.
135910 in Ada.Wide_Wide_Text_IO.Text_Streams *note A.12.4(4/2): 7112.
135911 stream file *note A.8(1/2): 6775.
135912 stream type *note 13.13(1): 5774.
135913 Stream_Access
135914 in Ada.Streams.Stream_IO *note A.12.1(4): 7066.
135915 in Ada.Text_IO.Text_Streams *note A.12.2(3): 7105.
135916 in Ada.Wide_Text_IO.Text_Streams *note A.12.3(3): 7108.
135917 in Ada.Wide_Wide_Text_IO.Text_Streams *note A.12.4(3/2): 7111.
135918 Stream_Element
135919 in Ada.Streams *note 13.13.1(4/1): 5779.
135920 Stream_Element_Array
135921 in Ada.Streams *note 13.13.1(4/1): 5782.
135922 Stream_Element_Count subtype of Stream_Element_Offset
135923 in Ada.Streams *note 13.13.1(4/1): 5781.
135924 Stream_Element_Offset
135925 in Ada.Streams *note 13.13.1(4/1): 5780.
135926 Stream_IO
135927 child of Ada.Streams *note A.12.1(3/3): 7065.
135928 Stream_Size aspect *note 13.13.2(1.5/2): 5789.
135929 Stream_Size attribute *note 13.13.2(1.2/3): 5787.
135930 Stream_Size clause *note 13.3(7/2): 5378.
135931 Streams
135932 child of Ada *note 13.13.1(2): 5776.
135933 strict mode *note G.2(1): 8941.
135934 strict weak ordering *note A.18(5/3): 7222.
135935 String
135936 in Standard *note A.1(37/3): 5889.
135937 string type *note 3.6.3(1): 2070.
135938 String_Access
135939 in Ada.Strings.Unbounded *note A.4.5(7): 6366.
135940 string_element *note 2.6(3): 1297.
135941 used *note 2.6(2): 1296, *note P: 9629.
135942 string_literal *note 2.6(2): 1295.
135943 used *note 4.4(7/3): 2902, *note 6.1(9): 3537, *note P: 10060.
135944 Strings
135945 child of Ada *note A.4.1(3): 6223.
135946 child of Ada.Strings.UTF_Encoding *note A.4.11(22/3): 6553.
135947 child of Interfaces.C *note B.3.1(3): 8052.
135948 Strlen
135949 in Interfaces.C.Strings *note B.3.1(17): 8066.
135950 structure
135951 See record type *note 3.8(1): 2144.
135952 STS
135953 in Ada.Characters.Latin_1 *note A.3.3(18): 6066.
135954 STX
135955 in Ada.Characters.Latin_1 *note A.3.3(5): 5951.
135956 SUB
135957 in Ada.Characters.Latin_1 *note A.3.3(6): 5975.
135958 Sub_Second
135959 in Ada.Calendar.Formatting *note 9.6.1(27/2): 4513.
135960 subaggregate
135961 of an array_aggregate *note 4.3.3(6): 2749.
135962 subcomponent *note 3.2(6/2): 1406.
135963 subpool *note 13.11.4(18/3): 5707.
135964 subpool access type *note 13.11.4(22/3): 5713.
135965 subpool handle *note 13.11.4(18/3): 5709.
135966 Subpool_Handle
135967 in System.Storage_Pools.Subpools *note 13.11.4(6/3): 5697.
135968 subpool_specification *note 4.8(2.1/3): 3259.
135969 used *note 4.8(2/3): 3255, *note P: 9978.
135970 Subpools
135971 child of System.Storage_Pools *note 13.11.4(3/3): 5694.
135972 subprogram *note 6(1): 3507, *note N(37.3/2): 9584.
135973 abstract *note 3.9.3(3/2): 2333.
135974 subprogram call *note 6.4(1): 3688.
135975 subprogram instance *note 12.3(13): 5110.
135976 subprogram_body *note 6.3(2/3): 3639.
135977 used *note 3.11(6): 2502, *note 9.4(8/1): 4293, *note 10.1.1(7):
135978 4669, *note P: 10212.
135979 subprogram_body_stub *note 10.1.3(3/3): 4728.
135980 used *note 10.1.3(2): 4724, *note P: 10305.
135981 subprogram_declaration *note 6.1(2/3): 3513.
135982 used *note 3.1(3/3): 1349, *note 9.4(5/1): 4280, *note 9.4(8/1):
135983 4292, *note 10.1.1(5): 4660, *note P: 10202.
135984 subprogram_default *note 12.6(3/2): 5240.
135985 used *note 12.6(2.1/3): 5234, *note 12.6(2.2/3): 5238, *note P:
135986 10408.
135987 subprogram_renaming_declaration *note 8.5.4(2/3): 4111.
135988 used *note 8.5(2): 4076, *note 10.1.1(6): 4667, *note P: 10292.
135989 subprogram_specification *note 6.1(4/2): 3517.
135990 used *note 3.9.3(1.1/3): 2328, *note 6.1(2/3): 3515, *note
135991 6.3(2/3): 3641, *note 8.5.4(2/3): 4113, *note 10.1.3(3/3): 4730, *note
135992 12.1(3/3): 5045, *note 12.6(2.1/3): 5233, *note 12.6(2.2/3): 5237, *note
135993 P: 10407.
135994 subsystem *note 10.1(3): 4646, *note N(22): 9557.
135995 subtree
135996 node which roots *note A.18.10(3/3): 7726.
135997 of a tree *note A.18.10(3/3): 7724.
135998 Subtree_Node_Count
135999 in Ada.Containers.Multiway_Trees *note A.18.10(18/3): 7743.
136000 subtype *note 3.2(8/2): 1412, *note N(38/3): 9585.
136001 constraint of *note 3.2(8/2): 1416.
136002 of a generic formal object *note 12.4(10.c): 5151.
136003 type of *note 3.2(8/2): 1414.
136004 values belonging to *note 3.2(8/2): 1419.
136005 subtype (of an object)
136006 See actual subtype of an object *note 3.3(23/3): 1534.
136007 See actual subtype of an object *note 3.3.1(9/2): 1576.
136008 subtype conformance *note 6.3.1(17/3): 3672, *note 12.3(11.j/3): 5104.
136009 [partial] *note 3.10.2(34/2): 2481, *note 9.5.4(17): 4441.
136010 required *note 3.9.2(10/2): 2309, *note 3.10.2(32/3): 2477, *note
136011 4.6(24.20/3): 3167, *note 8.5.1(4.3/2): 4092, *note 8.5.4(5/3): 4121,
136012 *note 9.1(9.7/2): 4230, *note 9.1(9.8/2): 4231, *note 9.4(11.6/2): 4304,
136013 *note 9.4(11.7/2): 4305, *note 9.5.4(5/3): 4435, *note 12.4(8.2/2):
136014 5144, *note 12.5.4(5/3): 5220.
136015 subtype conversion
136016 bounds of a decimal fixed point type *note 3.5.9(16.a.1/1): 1956.
136017 bounds of a fixed point type *note 3.5.9(14.a.1/1): 1951.
136018 bounds of a floating point type *note 3.5.7(11.a.1/1): 1910.
136019 bounds of signed integer type *note 3.5.4(9.a.1/1): 1827.
136020 See type conversion *note 4.6(1/3): 3125.
136021 See also implicit subtype conversion *note 4.6(1/3): 3129.
136022 subtype-specific
136023 attribute_definition_clause *note 13.3(7.a): 5385.
136024 of a representation item *note 13.1(8/3): 5301.
136025 of an aspect *note 13.1(8/3): 5303.
136026 subtype_declaration *note 3.2.2(2/3): 1461.
136027 used *note 3.1(3/3): 1346, *note P: 9644.
136028 subtype_indication *note 3.2.2(3/2): 1465.
136029 used *note 3.2.2(2/3): 1463, *note 3.3.1(2/3): 1550, *note
136030 3.4(2/2): 1610, *note 3.6(6): 2002, *note 3.6(7/2): 2005, *note
136031 3.6.1(3): 2042, *note 3.8.1(5/3): 2196, *note 3.10(3): 2379, *note
136032 4.8(2/3): 3256, *note 5.5.2(2/3): 3470, *note 6.5(2.3/2): 3751, *note
136033 7.3(3/3): 3864, *note P: 9807.
136034 subtype_mark *note 3.2.2(4): 1469.
136035 used *note 3.2.2(3/2): 1467, *note 3.6(4): 1996, *note 3.7(5/2):
136036 2091, *note 3.9.4(3/2): 2343, *note 3.10(6/2): 2387, *note 4.3.2(3):
136037 2715, *note 4.4(3.2/3): 2885, *note 4.6(2): 3132, *note 4.7(2): 3239,
136038 *note 6.1(13/2): 3545, *note 6.1(15/3): 3555, *note 8.4(4/3): 4062,
136039 *note 8.5.1(2/3): 4084, *note 12.3(5): 5097, *note 12.4(2/3): 5132,
136040 *note 12.5.1(3/2): 5194, *note 13.8(14.b): 5583, *note P: 9762.
136041 subtypes
136042 of a profile *note 6.1(25): 3574.
136043 subunit *note 10.1.3(7): 4741, *note 10.1.3(8/2): 4745.
136044 of a program unit *note 10.1.3(8/2): 4746.
136045 used *note 10.1.1(3): 4654, *note P: 10282.
136046 Succ attribute *note 3.5(22): 1708.
136047 Success
136048 in Ada.Command_Line *note A.15(8): 7132.
136049 successor element
136050 of a hashed set *note A.18.8(68/2): 7635.
136051 of a set *note A.18.7(6/2): 7551.
136052 of an ordered set *note A.18.9(81/3): 7717.
136053 successor node
136054 of a hashed map *note A.18.5(46/2): 7478.
136055 of a map *note A.18.4(6/2): 7415.
136056 of an ordered map *note A.18.6(58/3): 7539.
136057 Sunday
136058 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4501.
136059 super
136060 See view conversion *note 4.6(5/2): 3144.
136061 Superscript_One
136062 in Ada.Characters.Latin_1 *note A.3.3(22): 6107.
136063 Superscript_Three
136064 in Ada.Characters.Latin_1 *note A.3.3(22): 6100.
136065 Superscript_Two
136066 in Ada.Characters.Latin_1 *note A.3.3(22): 6099.
136067 support external streaming *note 13.13.2(52/3): 5829.
136068 Supported
136069 in Ada.Execution_Time.Interrupts *note D.14.3(3/3): 8648.
136070 Suppress pragma *note 11.5(4/2): 4988, *note J.10(3/2): 9148, *note
136071 L(36): 9486.
136072 suppressed check *note 11.5(8/2): 4997.
136073 Suspend_Until_True
136074 in Ada.Synchronous_Task_Control *note D.10(4): 8559.
136075 Suspend_Until_True_And_Set_Deadline
136076 in Ada.Synchronous_Task_Control.EDF *note D.10(5.2/3): 8561.
136077 Suspension_Object
136078 in Ada.Synchronous_Task_Control *note D.10(4): 8555.
136079 Swap
136080 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(28/2): 7366.
136081 in Ada.Containers.Multiway_Trees *note A.18.10(37/3): 7762.
136082 in Ada.Containers.Vectors *note A.18.2(55/2): 7290, *note
136083 A.18.2(56/2): 7291.
136084 Swap_Links
136085 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(29/2): 7367.
136086 Symmetric_Difference
136087 in Ada.Containers.Hashed_Sets *note A.18.8(35/2): 7601, *note
136088 A.18.8(36/2): 7602.
136089 in Ada.Containers.Ordered_Sets *note A.18.9(36/2): 7677, *note
136090 A.18.9(37/2): 7678.
136091 SYN
136092 in Ada.Characters.Latin_1 *note A.3.3(6): 5971.
136093 synchronization *note 9(1/3): 4182.
136094 Synchronization aspect *note 9.5(12/3): 4331.
136095 synchronization_kind *note 9.5(10/3): 4329.
136096 synchronized *note N(38.1/2): 9586.
136097 synchronized interface *note 3.9.4(5/2): 2351.
136098 synchronized tagged type *note 3.9.4(6/2): 2356.
136099 Synchronized_Queue_Interfaces
136100 child of Ada.Containers *note A.18.27(3/3): 7886.
136101 Synchronous_Barrier
136102 in Ada.Synchronous_Barriers *note D.10.1(5/3): 8569.
136103 Synchronous_Barriers
136104 child of Ada *note D.10.1(3/3): 8567.
136105 Synchronous_Task_Control
136106 child of Ada *note D.10(3/2): 8554.
136107 syntactic category *note 1.1.4(15): 1086.
136108 syntax
136109 complete listing *note P(1): 9591.
136110 cross reference *note P(1): 10471.
136111 notation *note 1.1.4(3): 1076.
136112 under Syntax heading *note 1.1.2(25): 1013.
136113 System *note 13.7(3/2): 5530.
136114 System.Address_To_Access_Conversions *note 13.7.2(2): 5572.
136115 System.Machine_Code *note 13.8(7): 5580.
136116 System.Multiprocessors *note D.16(3/3): 8663.
136117 System.Multiprocessors.Dispatching_Domains *note D.16.1(3/3): 8671.
136118 System.RPC *note E.5(3): 8808.
136119 System.Storage_Elements *note 13.7.1(2/2): 5559.
136120 System.Storage_Pools *note 13.11(5): 5622.
136121 System.Storage_Pools.Subpools *note 13.11.4(3/3): 5694.
136122 System_Dispatching_Domain
136123 in System.Multiprocessors.Dispatching_Domains *note D.16.1(6/3):
136124 8674.
136125 System_Name
136126 in System *note 13.7(4): 5532.
136127 systems programming *note C(1): 8178.
136128
136129
136130 \1f
136131 File: aarm2012.info, Node: T, Next: U, Prev: S, Up: Index
136132
136133 T
136134 ==
136135
136136
136137
136138 T
136139 italicized *note 4.5.1(3.b/2): 2944.
136140 Tag
136141 in Ada.Tags *note 3.9(6/2): 2230.
136142 Tag attribute *note 3.9(16): 2251, *note 3.9(18): 2253.
136143 tag indeterminate *note 3.9.2(6/2): 2307.
136144 tag of an object *note 3.9(3): 2222.
136145 class-wide object *note 3.9(22): 2257.
136146 object created by an allocator *note 3.9(21): 2256.
136147 preserved by type conversion and parameter passing *note 3.9(25):
136148 2260.
136149 returned by a function *note 3.9(23): 2258, *note 3.9(24/2): 2259.
136150 stand-alone object, component, or aggregate *note 3.9(20): 2255.
136151 Tag_Array
136152 in Ada.Tags *note 3.9(7.3/2): 2240.
136153 Tag_Check *note 11.5(18): 5007.
136154 [partial] *note 3.9.2(16): 2313, *note 4.6(42): 3193, *note
136155 4.6(52): 3218, *note 5.2(10): 3388, *note 6.5(8.1/3): 3772.
136156 Tag_Error
136157 in Ada.Tags *note 3.9(8): 2243.
136158 tagged incomplete view *note 3.10.1(2.1/2): 2430.
136159 tagged type *note 3.9(2/2): 2216, *note N(39): 9587.
136160 protected *note 3.9.4(6/2): 2360.
136161 synchronized *note 3.9.4(6/2): 2358.
136162 task *note 3.9.4(6/2): 2359.
136163 Tags
136164 child of Ada *note 3.9(6/2): 2229.
136165 Tail
136166 in Ada.Strings.Bounded *note A.4.4(72): 6354, *note A.4.4(73):
136167 6355.
136168 in Ada.Strings.Fixed *note A.4.3(37): 6295, *note A.4.3(38): 6296.
136169 in Ada.Strings.Unbounded *note A.4.5(67): 6411, *note A.4.5(68):
136170 6412.
136171 tail (of a queue) *note D.2.1(5/2): 8347.
136172 tamper with cursors
136173 of a list *note A.18.3(62/2): 7390.
136174 of a map *note A.18.4(8/2): 7416.
136175 of a set *note A.18.7(8/2): 7552.
136176 of a tree *note A.18.10(81/3): 7798.
136177 of a vector *note A.18.2(91/2): 7315.
136178 tamper with elements
136179 of a holder *note A.18.18(30/3): 7842.
136180 of a list *note A.18.3(67/2): 7391.
136181 of a map *note A.18.4(13/2): 7417.
136182 of a set *note A.18.7(13/2): 7553.
136183 of a tree *note A.18.10(87/3): 7799.
136184 of a vector *note A.18.2(95/2): 7316.
136185 tampering
136186 prohibited for a holder *note A.18.18(35/3): 7844.
136187 prohibited for a list *note A.18.3(69.1/3): 7393.
136188 prohibited for a map *note A.18.4(15.1/3): 7419.
136189 prohibited for a set *note A.18.7(14.1/3): 7555.
136190 prohibited for a tree *note A.18.10(90/3): 7801.
136191 prohibited for a vector *note A.18.2(97.1/3): 7318.
136192 Tan
136193 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
136194 G.1.2(4): 8901.
136195 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(5): 6595.
136196 Tanh
136197 in Ada.Numerics.Generic_Complex_Elementary_Functions *note
136198 G.1.2(6): 8909.
136199 in Ada.Numerics.Generic_Elementary_Functions *note A.5.1(7): 6608.
136200 target
136201 of an assignment operation *note 5.2(3): 3381.
136202 of an assignment_statement *note 5.2(3): 3382.
136203 target object
136204 of a requeue_statement *note 9.5(7): 4326.
136205 of the name of an entry or a protected subprogram *note 9.5(2/3):
136206 4323.
136207 target statement
136208 of a goto_statement *note 5.8(3): 3505.
136209 target subtype
136210 of a type_conversion *note 4.6(3): 3136.
136211 task *note 9(1/3): 4179.
136212 activation *note 9.2(1): 4245.
136213 completion *note 9.3(1): 4252.
136214 dependence *note 9.3(1): 4251.
136215 execution *note 9.2(1): 4243.
136216 termination *note 9.3(1): 4253.
136217 task declaration *note 9.1(1): 4198.
136218 task dispatching *note D.2.1(4/2): 8341.
136219 task dispatching point *note D.2.1(4/2): 8343.
136220 [partial] *note D.2.3(8/2): 8371, *note D.2.4(9/3): 8380.
136221 task dispatching policy *note 9(10.a/3): 4196, *note D.2.2(7/2): 8366.
136222 [partial] *note D.2.1(5/2): 8349.
136223 EDF_Across_Priorities *note D.2.6(7/2): 8393.
136224 FIFO_Within_Priorities *note D.2.3(2/2): 8369.
136225 Non_Preemptive_FIFO_Within_Priorities *note D.2.4(2/2): 8375.
136226 Round_Robin_Within_Priorities *note D.2.5(2/2): 8384.
136227 task interface *note 3.9.4(5/2): 2353.
136228 task priority *note D.1(15): 8328.
136229 task state
136230 abnormal *note 9.8(4): 4607.
136231 blocked *note 9(10): 4189.
136232 callable *note 9.9(2): 4621.
136233 held *note D.11(4/2): 8576.
136234 inactive *note 9(10): 4187.
136235 ready *note 9(10): 4191.
136236 terminated *note 9(10): 4193.
136237 task tagged type *note 3.9.4(6/2): 2361.
136238 task type *note N(40/2): 9588.
136239 task unit *note 9(9): 4186.
136240 Task_Array
136241 in Ada.Execution_Time.Group_Budgets *note D.14.2(6/2): 8622.
136242 Task_Attributes
136243 child of Ada *note C.7.2(2): 8293.
136244 task_body *note 9.1(6/3): 4217.
136245 used *note 3.11(6): 2504, *note P: 9828.
136246 task_body_stub *note 10.1.3(5): 4735.
136247 used *note 10.1.3(2): 4726, *note P: 10307.
136248 task_definition *note 9.1(4): 4210.
136249 used *note 9.1(2/3): 4204, *note 9.1(3/3): 4209, *note P: 10179.
136250 Task_Dispatching_Policy pragma *note D.2.2(3): 8355, *note L(37):
136251 9489.
136252 Task_Id
136253 in Ada.Task_Identification *note C.7.1(2/2): 8273.
136254 Task_Identification
136255 child of Ada *note C.7.1(2/2): 8272.
136256 task_item *note 9.1(5/1): 4214.
136257 used *note 9.1(4): 4212, *note P: 10181.
136258 Task_Termination
136259 child of Ada *note C.7.3(2/2): 8305.
136260 task_type_declaration *note 9.1(2/3): 4199.
136261 used *note 3.2.1(3/3): 1438, *note P: 9665.
136262 Tasking_Error
136263 raised by failure of run-time check *note 9.2(5): 4249, *note
136264 9.5.3(21): 4427, *note 11.1(4): 4878, *note 13.11.2(13): 5677, *note
136265 13.11.2(14): 5679, *note C.7.2(13): 8299, *note D.5.1(8): 8446, *note
136266 D.11(8): 8579.
136267 in Standard *note A.1(46): 5896.
136268 template *note 12(1): 5036.
136269 for a formal package *note 12.7(4): 5269.
136270 See generic unit *note 12(1): 5037.
136271 term *note 4.4(5): 2891.
136272 used *note 4.4(4): 2890, *note P: 9934.
136273 terminal interrupt
136274 example *note 9.7.4(10): 4591.
136275 terminate_alternative *note 9.7.1(7): 4552.
136276 used *note 9.7.1(4): 4545, *note P: 10256.
136277 terminated
136278 a task state *note 9(10): 4194.
136279 Terminated attribute *note 9.9(3): 4624.
136280 termination
136281 abnormal *note 10.2(25.c): 4804.
136282 normal *note 10.2(25.c): 4802.
136283 of a partition *note 10.2(25.c): 4800.
136284 of a partition *note E.1(7): 8696.
136285 termination handler *note C.7.3(8/3): 8312.
136286 fall-back *note C.7.3(9/2): 8315.
136287 specific *note C.7.3(9/2): 8317.
136288 Termination_Handler
136289 in Ada.Task_Termination *note C.7.3(4/2): 8307.
136290 Terminator_Error
136291 in Interfaces.C *note B.3(40): 8045.
136292 tested type
136293 of a membership test *note 4.5.2(3/3): 2987.
136294 text of a program *note 2.2(1): 1221.
136295 Text_IO
136296 child of Ada *note A.10.1(2): 6860.
136297 Text_Streams
136298 child of Ada.Text_IO *note A.12.2(3): 7104.
136299 child of Ada.Wide_Text_IO *note A.12.3(3): 7107.
136300 child of Ada.Wide_Wide_Text_IO *note A.12.4(3/2): 7110.
136301 throw (an exception)
136302 See raise *note 11(1/3): 4863.
136303 thunk *note 13.14(19.i): 5867.
136304 Thursday
136305 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4498.
136306 tick *note 2.1(15/3): 1192.
136307 in Ada.Real_Time *note D.8(6): 8531.
136308 in System *note 13.7(10): 5541.
136309 Tilde
136310 in Ada.Characters.Latin_1 *note A.3.3(14): 6040.
136311 Time
136312 in Ada.Calendar *note 9.6(10): 4459.
136313 in Ada.Real_Time *note D.8(4): 8522.
136314 time base *note 9.6(6/3): 4456.
136315 time limit
136316 example *note 9.7.4(12): 4594.
136317 time type *note 9.6(6/3): 4455.
136318 Time-dependent Reset procedure
136319 of the random number generator *note A.5.2(34): 6649.
136320 time-out
136321 example *note 9.7.4(12): 4593.
136322 See asynchronous_select *note 9.7.4(12): 4592.
136323 See selective_accept *note 9.7.1(1): 4533.
136324 See timed_entry_call *note 9.7.2(1/2): 4559.
136325 Time_Error
136326 in Ada.Calendar *note 9.6(18): 4471.
136327 Time_First
136328 in Ada.Real_Time *note D.8(4): 8523.
136329 Time_Last
136330 in Ada.Real_Time *note D.8(4): 8524.
136331 Time_Of
136332 in Ada.Calendar *note 9.6(15): 4470.
136333 in Ada.Calendar.Formatting *note 9.6.1(30/2): 4516, *note
136334 9.6.1(31/2): 4517.
136335 in Ada.Execution_Time *note D.14(9/2): 8593.
136336 in Ada.Real_Time *note D.8(16): 8542.
136337 Time_Of_Event
136338 in Ada.Real_Time.Timing_Events *note D.15(6/2): 8657.
136339 Time_Offset
136340 in Ada.Calendar.Time_Zones *note 9.6.1(4/2): 4486.
136341 Time_Remaining
136342 in Ada.Execution_Time.Timers *note D.14.1(8/2): 8611.
136343 Time_Span
136344 in Ada.Real_Time *note D.8(5): 8526.
136345 Time_Span_First
136346 in Ada.Real_Time *note D.8(5): 8527.
136347 Time_Span_Last
136348 in Ada.Real_Time *note D.8(5): 8528.
136349 Time_Span_Unit
136350 in Ada.Real_Time *note D.8(5): 8530.
136351 Time_Span_Zero
136352 in Ada.Real_Time *note D.8(5): 8529.
136353 Time_Unit
136354 in Ada.Real_Time *note D.8(4): 8525.
136355 Time_Zones
136356 child of Ada.Calendar *note 9.6.1(2/2): 4485.
136357 timed_entry_call *note 9.7.2(2): 4560.
136358 used *note 9.7(2): 4529, *note P: 10245.
136359 Timer
136360 in Ada.Execution_Time.Timers *note D.14.1(4/2): 8604.
136361 timer interrupt
136362 example *note 9.7.4(12): 4596.
136363 Timer_Handler
136364 in Ada.Execution_Time.Timers *note D.14.1(5/2): 8605.
136365 Timer_Resource_Error
136366 in Ada.Execution_Time.Timers *note D.14.1(9/2): 8612.
136367 Timers
136368 child of Ada.Execution_Time *note D.14.1(3/2): 8603.
136369 times operator *note 4.4(1/3): 2828, *note 4.5.5(1): 3044.
136370 timing
136371 See delay_statement *note 9.6(1): 4445.
136372 Timing_Event
136373 in Ada.Real_Time.Timing_Events *note D.15(4/2): 8651.
136374 Timing_Event_Handler
136375 in Ada.Real_Time.Timing_Events *note D.15(4/2): 8652.
136376 Timing_Events
136377 child of Ada.Real_Time *note D.15(3/2): 8650.
136378 To_Ada
136379 in Interfaces.C *note B.3(22): 8008, *note B.3(26): 8012, *note
136380 B.3(28): 8014, *note B.3(32): 8018, *note B.3(37): 8022, *note B.3(39):
136381 8024, *note B.3(39.10/2): 8034, *note B.3(39.13/2): 8038, *note
136382 B.3(39.17/2): 8042, *note B.3(39.19/2): 8044, *note B.3(39.4/2): 8028,
136383 *note B.3(39.8/2): 8032.
136384 in Interfaces.COBOL *note B.4(17): 8120, *note B.4(19): 8122.
136385 in Interfaces.Fortran *note B.5(13): 8173, *note B.5(14): 8175,
136386 *note B.5(16): 8177.
136387 To_Address
136388 in System.Address_To_Access_Conversions *note 13.7.2(3/3): 5574.
136389 in System.Storage_Elements *note 13.7.1(10/3): 5566.
136390 To_Basic
136391 in Ada.Characters.Handling *note A.3.2(6): 5926, *note A.3.2(7):
136392 5929.
136393 To_Binary
136394 in Interfaces.COBOL *note B.4(45): 8152, *note B.4(48): 8155.
136395 To_Bounded_String
136396 in Ada.Strings.Bounded *note A.4.4(11): 6307.
136397 To_C
136398 in Interfaces.C *note B.3(21): 8007, *note B.3(25): 8011, *note
136399 B.3(27): 8013, *note B.3(32): 8017, *note B.3(36): 8021, *note B.3(38):
136400 8023, *note B.3(39.13/2): 8037, *note B.3(39.16/2): 8041, *note
136401 B.3(39.18/2): 8043, *note B.3(39.4/2): 8027, *note B.3(39.7/2): 8031,
136402 *note B.3(39.9/2): 8033.
136403 To_Character
136404 in Ada.Characters.Conversions *note A.3.4(5/2): 6191.
136405 To_Chars_Ptr
136406 in Interfaces.C.Strings *note B.3.1(8): 8057.
136407 To_COBOL
136408 in Interfaces.COBOL *note B.4(17): 8119, *note B.4(18): 8121.
136409 To_Cursor
136410 in Ada.Containers.Vectors *note A.18.2(25/2): 7253.
136411 To_Decimal
136412 in Interfaces.COBOL *note B.4(35): 8143, *note B.4(40): 8147, *note
136413 B.4(44): 8151, *note B.4(47): 8154.
136414 To_Display
136415 in Interfaces.COBOL *note B.4(36): 8144.
136416 To_Domain
136417 in Ada.Strings.Maps *note A.4.2(24): 6255.
136418 in Ada.Strings.Wide_Maps *note A.4.7(24): 6467.
136419 in Ada.Strings.Wide_Wide_Maps *note A.4.8(24/2): 6509.
136420 To_Duration
136421 in Ada.Real_Time *note D.8(13): 8533.
136422 To_Fortran
136423 in Interfaces.Fortran *note B.5(13): 8172, *note B.5(14): 8174,
136424 *note B.5(15): 8176.
136425 To_Holder
136426 in Ada.Containers.Indefinite_Holders *note A.18.18(9/3): 7827.
136427 To_Index
136428 in Ada.Containers.Vectors *note A.18.2(26/2): 7254.
136429 To_Integer
136430 in System.Storage_Elements *note 13.7.1(10/3): 5567.
136431 To_ISO_646
136432 in Ada.Characters.Handling *note A.3.2(11): 5933, *note A.3.2(12):
136433 5934.
136434 To_Long_Binary
136435 in Interfaces.COBOL *note B.4(48): 8156.
136436 To_Lower
136437 in Ada.Characters.Handling *note A.3.2(6): 5924, *note A.3.2(7):
136438 5927.
136439 in Ada.Wide_Characters.Handling *note A.3.5(20/3): 6215, *note
136440 A.3.5(21/3): 6217.
136441 To_Mapping
136442 in Ada.Strings.Maps *note A.4.2(23): 6254.
136443 in Ada.Strings.Wide_Maps *note A.4.7(23): 6466.
136444 in Ada.Strings.Wide_Wide_Maps *note A.4.8(23/2): 6508.
136445 To_Packed
136446 in Interfaces.COBOL *note B.4(41): 8148.
136447 To_Picture
136448 in Ada.Text_IO.Editing *note F.3.3(6): 8843.
136449 To_Pointer
136450 in System.Address_To_Access_Conversions *note 13.7.2(3/3): 5573.
136451 To_Range
136452 in Ada.Strings.Maps *note A.4.2(24): 6256.
136453 in Ada.Strings.Wide_Maps *note A.4.7(25): 6468.
136454 in Ada.Strings.Wide_Wide_Maps *note A.4.8(25/2): 6510.
136455 To_Ranges
136456 in Ada.Strings.Maps *note A.4.2(10): 6244.
136457 in Ada.Strings.Wide_Maps *note A.4.7(10): 6456.
136458 in Ada.Strings.Wide_Wide_Maps *note A.4.8(10/2): 6498.
136459 To_Sequence
136460 in Ada.Strings.Maps *note A.4.2(19): 6250.
136461 in Ada.Strings.Wide_Maps *note A.4.7(19): 6462.
136462 in Ada.Strings.Wide_Wide_Maps *note A.4.8(19/2): 6504.
136463 To_Set
136464 in Ada.Containers.Hashed_Sets *note A.18.8(9/2): 7575.
136465 in Ada.Containers.Ordered_Sets *note A.18.9(10/2): 7651.
136466 in Ada.Strings.Maps *note A.4.2(8): 6242, *note A.4.2(9): 6243,
136467 *note A.4.2(17): 6248, *note A.4.2(18): 6249.
136468 in Ada.Strings.Wide_Maps *note A.4.7(8): 6454, *note A.4.7(9):
136469 6455, *note A.4.7(17): 6460, *note A.4.7(18): 6461.
136470 in Ada.Strings.Wide_Wide_Maps *note A.4.8(8/2): 6496, *note
136471 A.4.8(9/2): 6497, *note A.4.8(17/2): 6502, *note A.4.8(18/2): 6503.
136472 To_String
136473 in Ada.Characters.Conversions *note A.3.4(5/2): 6194.
136474 in Ada.Strings.Bounded *note A.4.4(12): 6308.
136475 in Ada.Strings.Unbounded *note A.4.5(11): 6370.
136476 To_Time_Span
136477 in Ada.Real_Time *note D.8(13): 8534.
136478 To_Unbounded_String
136479 in Ada.Strings.Unbounded *note A.4.5(9): 6368, *note A.4.5(10):
136480 6369.
136481 To_Upper
136482 in Ada.Characters.Handling *note A.3.2(6): 5925, *note A.3.2(7):
136483 5928.
136484 in Ada.Wide_Characters.Handling *note A.3.5(20/3): 6216, *note
136485 A.3.5(21/3): 6218.
136486 To_Vector
136487 in Ada.Containers.Vectors *note A.18.2(13/2): 7245, *note
136488 A.18.2(14/2): 7246.
136489 To_Wide_Character
136490 in Ada.Characters.Conversions *note A.3.4(4/2): 6185, *note
136491 A.3.4(5/2): 6195.
136492 To_Wide_String
136493 in Ada.Characters.Conversions *note A.3.4(4/2): 6186, *note
136494 A.3.4(5/2): 6196.
136495 To_Wide_Wide_Character
136496 in Ada.Characters.Conversions *note A.3.4(4/2): 6189.
136497 To_Wide_Wide_String
136498 in Ada.Characters.Conversions *note A.3.4(4/2): 6190.
136499 token
136500 See lexical element *note 2.2(1): 1223.
136501 Trailing_Nonseparate
136502 in Interfaces.COBOL *note B.4(23): 8129.
136503 Trailing_Separate
136504 in Interfaces.COBOL *note B.4(23): 8127.
136505 transfer of control *note 5.1(14/2): 3371.
136506 Translate
136507 in Ada.Strings.Bounded *note A.4.4(53): 6336, *note A.4.4(54):
136508 6337, *note A.4.4(55): 6338, *note A.4.4(56): 6339.
136509 in Ada.Strings.Fixed *note A.4.3(18): 6277, *note A.4.3(19): 6278,
136510 *note A.4.3(20): 6279, *note A.4.3(21): 6280.
136511 in Ada.Strings.Unbounded *note A.4.5(48): 6393, *note A.4.5(49):
136512 6394, *note A.4.5(50): 6395, *note A.4.5(51): 6396.
136513 Translation_Error
136514 in Ada.Strings *note A.4.1(5): 6230.
136515 Transpose
136516 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(34/2): 9033.
136517 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(17/2): 8992.
136518 Tree
136519 in Ada.Containers.Multiway_Trees *note A.18.10(8/3): 7734.
136520 Tree_Iterator_Interfaces
136521 in Ada.Containers.Multiway_Trees *note A.18.10(13/3): 7739.
136522 triggering_alternative *note 9.7.4(3): 4578.
136523 used *note 9.7.4(2): 4576, *note P: 10269.
136524 triggering_statement *note 9.7.4(4/2): 4581.
136525 used *note 9.7.4(3): 4579, *note P: 10271.
136526 Trim
136527 in Ada.Strings.Bounded *note A.4.4(67): 6348, *note A.4.4(68):
136528 6350, *note A.4.4(69): 6351.
136529 in Ada.Strings.Fixed *note A.4.3(31): 6289, *note A.4.3(32): 6290,
136530 *note A.4.3(33): 6291, *note A.4.3(34): 6292.
136531 in Ada.Strings.Unbounded *note A.4.5(61): 6405, *note A.4.5(62):
136532 6406, *note A.4.5(63): 6407, *note A.4.5(64): 6408.
136533 Trim_End
136534 in Ada.Strings *note A.4.1(6): 6235.
136535 True *note 3.5.3(1): 1805.
136536 Truncation
136537 in Ada.Strings *note A.4.1(6): 6232.
136538 Truncation attribute *note A.5.3(42): 6706.
136539 Tuesday
136540 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4496.
136541 two's complement
136542 modular types *note 3.5.4(29): 1858.
136543 type *note 3.2(1): 1386, *note N(41/2): 9589.
136544 abstract *note 3.9.3(1.2/2): 2331.
136545 needs finalization *note 7.6(9.1/2): 3937.
136546 of a subtype *note 3.2(8/2): 1413.
136547 synchronized tagged *note 3.9.4(6/2): 2357.
136548 See also tag *note 3.9(3): 2226.
136549 See also language-defined types
136550 type conformance *note 6.3.1(15/2): 3666.
136551 [partial] *note 3.4(17/2): 1628, *note 8.3(8): 4024, *note
136552 8.3(26/2): 4047, *note 10.1.4(4/3): 4755.
136553 required *note 3.11.1(5): 2519, *note 4.1.4(14/2): 2618, *note
136554 8.6(26): 4162, *note 9.1(9.2/3): 4227, *note 9.1(9.5/3): 4229, *note
136555 9.4(11.1/3): 4301, *note 9.4(11.4/3): 4303, *note 9.5.4(3/3): 4434,
136556 *note 12.4(5/2): 5142.
136557 type conversion *note 4.6(1/3): 3126.
136558 access *note 4.6(24.11/2): 3157, *note 4.6(24.18/2): 3163, *note
136559 4.6(24.19/2): 3165, *note 4.6(47): 3201.
136560 arbitrary order *note 1.1.4(18): 1090.
136561 array *note 4.6(24.2/2): 3152, *note 4.6(36): 3182.
136562 composite (non-array) *note 4.6(21/3): 3146, *note 4.6(40): 3191.
136563 enumeration *note 4.6(21.1/2): 3148, *note 4.6(34): 3180.
136564 numeric *note 4.6(24.1/2): 3150, *note 4.6(29): 3177.
136565 unchecked *note 13.9(1): 5586.
136566 See also qualified_expression *note 4.7(1): 3235.
136567 type conversion, implicit
136568 See implicit subtype conversion *note 4.6(1/3): 3130.
136569 type extension *note 3.9(2/2): 2217, *note 3.9.1(1/2): 2270.
136570 type of a discrete_range *note 3.6.1(4): 2044.
136571 type of a range *note 3.5(4): 1675.
136572 type parameter
136573 See discriminant *note 3.7(1/2): 2077.
136574 type profile
136575 See profile, type conformant *note 6.3.1(15/2): 3668.
136576 type resolution rules *note 8.6(20/2): 4155.
136577 if any type in a specified class of types is expected *note
136578 8.6(21): 4156.
136579 if expected type is specific *note 8.6(22): 4158.
136580 if expected type is universal or class-wide *note 8.6(21): 4157.
136581 type tag
136582 See tag *note 3.9(3): 2224.
136583 type-related
136584 aspect *note 13.1(8.1/3): 5307.
136585 aspect *note 13.1(8/3): 5302.
136586 attribute_definition_clause *note 13.3(7.a): 5384.
136587 operational item *note 13.1(8.1/3): 5306.
136588 representation item *note 13.1(8/3): 5300.
136589 type_conversion *note 4.6(2): 3131.
136590 used *note 4.1(2/3): 2529, *note P: 9836.
136591 See also unchecked type conversion *note 13.9(1): 5588.
136592 type_declaration *note 3.2.1(2): 1428.
136593 used *note 3.1(3/3): 1345, *note P: 9643.
136594 type_definition *note 3.2.1(4/2): 1440.
136595 used *note 3.2.1(3/3): 1436, *note P: 9663.
136596 Type_Invariant aspect *note 7.3.2(2/3): 3893.
136597 Type_Invariant'Class aspect *note 7.3.2(3/3): 3895.
136598 Type_Set
136599 in Ada.Text_IO *note A.10.1(7): 6868.
136600 types
136601 of a profile *note 6.1(29): 3575.
136602
136603
136604 \1f
136605 File: aarm2012.info, Node: U, Next: V, Prev: T, Up: Index
136606
136607 U
136608 ==
136609
136610
136611
136612 UC_A_Acute
136613 in Ada.Characters.Latin_1 *note A.3.3(23): 6115.
136614 UC_A_Circumflex
136615 in Ada.Characters.Latin_1 *note A.3.3(23): 6116.
136616 UC_A_Diaeresis
136617 in Ada.Characters.Latin_1 *note A.3.3(23): 6118.
136618 UC_A_Grave
136619 in Ada.Characters.Latin_1 *note A.3.3(23): 6114.
136620 UC_A_Ring
136621 in Ada.Characters.Latin_1 *note A.3.3(23): 6119.
136622 UC_A_Tilde
136623 in Ada.Characters.Latin_1 *note A.3.3(23): 6117.
136624 UC_AE_Diphthong
136625 in Ada.Characters.Latin_1 *note A.3.3(23): 6120.
136626 UC_C_Cedilla
136627 in Ada.Characters.Latin_1 *note A.3.3(23): 6121.
136628 UC_E_Acute
136629 in Ada.Characters.Latin_1 *note A.3.3(23): 6123.
136630 UC_E_Circumflex
136631 in Ada.Characters.Latin_1 *note A.3.3(23): 6124.
136632 UC_E_Diaeresis
136633 in Ada.Characters.Latin_1 *note A.3.3(23): 6125.
136634 UC_E_Grave
136635 in Ada.Characters.Latin_1 *note A.3.3(23): 6122.
136636 UC_I_Acute
136637 in Ada.Characters.Latin_1 *note A.3.3(23): 6127.
136638 UC_I_Circumflex
136639 in Ada.Characters.Latin_1 *note A.3.3(23): 6128.
136640 UC_I_Diaeresis
136641 in Ada.Characters.Latin_1 *note A.3.3(23): 6129.
136642 UC_I_Grave
136643 in Ada.Characters.Latin_1 *note A.3.3(23): 6126.
136644 UC_Icelandic_Eth
136645 in Ada.Characters.Latin_1 *note A.3.3(24): 6130.
136646 UC_Icelandic_Thorn
136647 in Ada.Characters.Latin_1 *note A.3.3(24): 6144.
136648 UC_N_Tilde
136649 in Ada.Characters.Latin_1 *note A.3.3(24): 6131.
136650 UC_O_Acute
136651 in Ada.Characters.Latin_1 *note A.3.3(24): 6133.
136652 UC_O_Circumflex
136653 in Ada.Characters.Latin_1 *note A.3.3(24): 6134.
136654 UC_O_Diaeresis
136655 in Ada.Characters.Latin_1 *note A.3.3(24): 6136.
136656 UC_O_Grave
136657 in Ada.Characters.Latin_1 *note A.3.3(24): 6132.
136658 UC_O_Oblique_Stroke
136659 in Ada.Characters.Latin_1 *note A.3.3(24): 6138.
136660 UC_O_Tilde
136661 in Ada.Characters.Latin_1 *note A.3.3(24): 6135.
136662 UC_U_Acute
136663 in Ada.Characters.Latin_1 *note A.3.3(24): 6140.
136664 UC_U_Circumflex
136665 in Ada.Characters.Latin_1 *note A.3.3(24): 6141.
136666 UC_U_Diaeresis
136667 in Ada.Characters.Latin_1 *note A.3.3(24): 6142.
136668 UC_U_Grave
136669 in Ada.Characters.Latin_1 *note A.3.3(24): 6139.
136670 UC_Y_Acute
136671 in Ada.Characters.Latin_1 *note A.3.3(24): 6143.
136672 UCHAR_MAX
136673 in Interfaces.C *note B.3(6): 7990.
136674 UI *note 1.3(1.c/3): 1159.
136675 ultimate ancestor
136676 of a type *note 3.4.1(10/2): 1659.
136677 unary adding operator *note 4.5.4(1): 3028.
136678 unary operator *note 4.5(9): 2926.
136679 unary_adding_operator *note 4.5(5): 2919.
136680 used *note 4.4(4): 2887, *note P: 9931.
136681 Unbiased_Rounding attribute *note A.5.3(39): 6701.
136682 Unbounded
136683 child of Ada.Strings *note A.4.5(3): 6362.
136684 in Ada.Text_IO *note A.10.1(5): 6865.
136685 Unbounded_IO
136686 child of Ada.Text_IO *note A.10.12(3/2): 7040.
136687 child of Ada.Wide_Text_IO *note A.11(5/3): 7058.
136688 child of Ada.Wide_Wide_Text_IO *note A.11(5/3): 7059.
136689 Unbounded_Priority_Queues
136690 child of Ada.Containers *note A.18.30(2/3): 7908.
136691 Unbounded_Slice
136692 in Ada.Strings.Unbounded *note A.4.5(22.1/2): 6378, *note
136693 A.4.5(22.2/2): 6379.
136694 Unbounded_String
136695 in Ada.Strings.Unbounded *note A.4.5(4/2): 6363.
136696 Unbounded_Synchronized_Queues
136697 child of Ada.Containers *note A.18.28(2/3): 7894.
136698 unchecked storage deallocation *note 13.11.2(1): 5664.
136699 unchecked type conversion *note 13.9(1): 5585.
136700 unchecked union object *note B.3.3(6/3): 8097.
136701 unchecked union subtype *note B.3.3(6/3): 8096.
136702 unchecked union type *note B.3.3(6/3): 8095.
136703 Unchecked_Access attribute *note 13.10(3): 5615, *note H.4(18): 9092.
136704 See also Access attribute *note 3.10.2(24/1): 2465.
136705 Unchecked_Conversion
136706 child of Ada *note 13.9(3/3): 5590.
136707 Unchecked_Deallocation
136708 child of Ada *note 13.11.2(3/3): 5669.
136709 Unchecked_Union aspect *note B.3.3(3.2/3): 8094.
136710 Unchecked_Union pragma *note J.15.6(2/3): 9215, *note L(37.2/3): 9492.
136711 unconstrained *note 3.2(9): 1421.
136712 object *note 3.3.1(9/2): 1578.
136713 object *note 6.4.1(16): 3728.
136714 subtype *note 3.2(9): 1423, *note 3.4(6): 1618, *note 3.5(7): 1685,
136715 *note 3.5.1(10): 1783, *note 3.5.4(9): 1826, *note 3.5.4(10): 1830,
136716 *note 3.5.7(11): 1909, *note 3.5.9(13): 1949, *note 3.5.9(16): 1954,
136717 *note 3.6(15): 2020, *note 3.6(16): 2023, *note 3.7(26): 2109, *note
136718 3.9(15): 2248.
136719 subtype *note 3.10(14/3): 2415.
136720 subtype *note K.2(33): 9285.
136721 unconstrained_array_definition *note 3.6(3): 1991.
136722 used *note 3.6(2): 1989, *note P: 9739.
136723 undefined result *note 11.6(5): 5029.
136724 underline *note 2.1(15/3): 1212.
136725 used *note 2.4.1(3): 1262, *note 2.4.2(4): 1287, *note P: 9615.
136726 Uniformity Issue (UI) *note 1.3(1.c/3): 1158.
136727 Uniformity Rapporteur Group (URG) *note 1.3(1.c/3): 1156.
136728 Uniformly_Distributed subtype of Float
136729 in Ada.Numerics.Float_Random *note A.5.2(8): 6624.
136730 uninitialized allocator *note 4.8(4): 3264.
136731 uninitialized variables *note 13.9.1(2): 5596.
136732 [partial] *note 3.3.1(21/3): 1589, *note 13.3(55.i): 5427.
136733 union
136734 C *note B.3.3(1/3): 8092.
136735 in Ada.Containers.Hashed_Sets *note A.18.8(26/2): 7595, *note
136736 A.18.8(27/2): 7596.
136737 in Ada.Containers.Ordered_Sets *note A.18.9(27/2): 7671, *note
136738 A.18.9(28/2): 7672.
136739 unit consistency *note E.3(6): 8777.
136740 unit matrix
136741 complex matrix *note G.3.2(148/2): 9044.
136742 real matrix *note G.3.1(80/2): 9003.
136743 unit vector
136744 complex vector *note G.3.2(90/2): 9043.
136745 real vector *note G.3.1(48/2): 9002.
136746 Unit_Matrix
136747 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(51/2): 9040.
136748 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(29/2): 8999.
136749 Unit_Vector
136750 in Ada.Numerics.Generic_Complex_Arrays *note G.3.2(24/2): 9020.
136751 in Ada.Numerics.Generic_Real_Arrays *note G.3.1(14/2): 8991.
136752 universal type *note 3.4.1(6/2): 1649.
136753 universal_access
136754 [partial] *note 3.4.1(6/2): 1653, *note 4.2(8/2): 2656.
136755 universal_fixed
136756 [partial] *note 3.4.1(6/2): 1652, *note 3.5.6(4): 1886.
136757 universal_integer
136758 [partial] *note 3.4.1(6/2): 1650, *note 3.5.4(14): 1837, *note
136759 3.5.4(30): 1859, *note 4.2(8/2): 2654.
136760 universal_real
136761 [partial] *note 3.4.1(6/2): 1651, *note 3.5.6(4): 1884, *note
136762 4.2(8/2): 2655.
136763 unknown discriminants *note 3.7(26): 2110.
136764 [partial] *note 3.7(1.b/2): 2079.
136765 unknown_discriminant_part *note 3.7(3): 2084.
136766 used *note 3.7(2): 2082, *note P: 9756.
136767 Unknown_Zone_Error
136768 in Ada.Calendar.Time_Zones *note 9.6.1(5/2): 4487.
136769 unmarshalling *note E.4(9): 8785.
136770 unpolluted *note 13.13.1(2): 5777.
136771 unsigned
136772 in Interfaces.C *note B.3(9): 7995.
136773 in Interfaces.COBOL *note B.4(23): 8125.
136774 unsigned type
136775 See modular type *note 3.5.4(1): 1810.
136776 unsigned_char
136777 in Interfaces.C *note B.3(10): 7998.
136778 unsigned_long
136779 in Interfaces.C *note B.3(9): 7997.
136780 unsigned_short
136781 in Interfaces.C *note B.3(9): 7996.
136782 unspecified *note 1.1.3(18): 1071, *note M.2(1.a): 9508.
136783 [partial] *note 2.1(5/3): 1167, *note 3.9(4/2): 2228, *note
136784 3.9(12.5/3): 2245, *note 4.5.2(13): 2989, *note 4.5.2(24.2/1): 2992,
136785 *note 4.5.5(21): 3054, *note 6.1.1(34/3): 3614, *note 6.1.1(35/3): 3619,
136786 *note 6.2(11/3): 3632, *note 7.2(5/3): 3849, *note 7.6(17.4/3): 3948,
136787 *note 9.8(14): 4611, *note 9.10(1/3): 4629, *note 10.2(26): 4807, *note
136788 11.1(6): 4883, *note 11.4.1(10.1/3): 4948, *note 11.5(27/2): 5016, *note
136789 13.1(18): 5310, *note 13.7.2(5/2): 5575, *note 13.9.1(7): 5600, *note
136790 13.11(20): 5651, *note 13.11(21.6/3): 5653, *note 13.13.2(36/2): 5810,
136791 *note A.1(1/3): 5876, *note A.5.1(34): 6619, *note A.5.2(28): 6647,
136792 *note A.5.2(34): 6648, *note A.5.3(41.3/2): 6704, *note A.7(6): 6769,
136793 *note A.10(8): 6852, *note A.10.7(8/3): 7021, *note A.10.7(12/3): 7022,
136794 *note A.10.7(17.3/2): 7023, *note A.10.7(19): 7024, *note A.14(1): 7126,
136795 *note A.18(5.v/2): 7223, *note A.18.2(231/3): 7320, *note A.18.2(252/2):
136796 7328, *note A.18.2(83/2): 7313, *note A.18.3(145/3): 7395, *note
136797 A.18.3(157/2): 7401, *note A.18.3(55/2): 7388, *note A.18.4(3/2): 7409,
136798 *note A.18.4(80/2): 7425, *note A.18.5(43/2): 7473, *note A.18.5(44/2):
136799 7474, *note A.18.5(45/2): 7475, *note A.18.5(46/2): 7479, *note
136800 A.18.6(56/3): 7535, *note A.18.6(57/2): 7536, *note A.18.7(3/2): 7546,
136801 *note A.18.7(101/2): 7564, *note A.18.7(87/2): 7557, *note A.18.7(88/2):
136802 7558, *note A.18.8(65/2): 7629, *note A.18.8(66.1/3): 7631, *note
136803 A.18.8(66/2): 7630, *note A.18.8(67/2): 7632, *note A.18.8(68/2): 7636,
136804 *note A.18.8(86/2): 7637, *note A.18.8(87/2): 7638, *note A.18.9(114/2):
136805 7719, *note A.18.9(79.1/3): 7713, *note A.18.9(79/3): 7712, *note
136806 A.18.9(80/2): 7714, *note A.18.10(227/3): 7807, *note A.18.10(72/3):
136807 7796, *note A.18.26(5/3): 7879, *note A.18.26(9.4/3): 7883, *note
136808 A.18.26(9/3): 7881, *note B.3(46.a.1/1): 8046, *note D.2.2(7.1/2): 8367,
136809 *note D.8(19): 8545, *note E.3(5/1): 8775, *note G.1.1(40): 8891, *note
136810 G.1.2(33): 8919, *note G.1.2(48): 8921, *note H(4.1): 9048, *note
136811 H.2(1): 9056, *note K.2(136.4/2): 9303.
136812 Unsuppress pragma *note 11.5(4.1/2): 4991, *note L(37.3/2): 9495.
136813 update
136814 the value of an object *note 3.3(14): 1531.
136815 in Interfaces.C.Strings *note B.3.1(18): 8067, *note B.3.1(19):
136816 8068.
136817 Update_Element
136818 in Ada.Containers.Doubly_Linked_Lists *note A.18.3(17/2): 7350.
136819 in Ada.Containers.Hashed_Maps *note A.18.5(17/2): 7444.
136820 in Ada.Containers.Indefinite_Holders *note A.18.18(15/3): 7833.
136821 in Ada.Containers.Multiway_Trees *note A.18.10(27/3): 7752.
136822 in Ada.Containers.Ordered_Maps *note A.18.6(16/2): 7498.
136823 in Ada.Containers.Vectors *note A.18.2(33/2): 7261, *note
136824 A.18.2(34/2): 7262.
136825 Update_Element_Preserving_Key
136826 in Ada.Containers.Hashed_Sets *note A.18.8(58/2): 7622.
136827 in Ada.Containers.Ordered_Sets *note A.18.9(73/2): 7706.
136828 Update_Error
136829 in Interfaces.C.Strings *note B.3.1(20): 8069.
136830 upper bound
136831 of a range *note 3.5(4): 1674.
136832 upper-case letter
136833 a category of Character *note A.3.2(26): 5939.
136834 Upper_Case_Map
136835 in Ada.Strings.Maps.Constants *note A.4.6(5): 6430.
136836 Upper_Set
136837 in Ada.Strings.Maps.Constants *note A.4.6(4): 6422.
136838 URG *note 1.3(1.c/3): 1157.
136839 US
136840 in Ada.Characters.Latin_1 *note A.3.3(6): 5980.
136841 usage name *note 3.1(10): 1374.
136842 use-visible *note 8.3(4): 4017, *note 8.4(9): 4067.
136843 use_clause *note 8.4(2): 4055.
136844 used *note 3.11(4/1): 2497, *note 10.1.2(3): 4702, *note 12.1(5):
136845 5052, *note P: 9823.
136846 Use_Error
136847 in Ada.Direct_IO *note A.8.4(18): 6833.
136848 in Ada.Directories *note A.16(43/2): 7175.
136849 in Ada.IO_Exceptions *note A.13(4): 7118.
136850 in Ada.Sequential_IO *note A.8.1(15): 6800.
136851 in Ada.Streams.Stream_IO *note A.12.1(26): 7095.
136852 in Ada.Text_IO *note A.10.1(85): 7009.
136853 use_package_clause *note 8.4(3): 4058.
136854 used *note 8.4(2): 4056, *note P: 10132.
136855 use_type_clause *note 8.4(4/3): 4061.
136856 used *note 8.4(2): 4057, *note P: 10133.
136857 user-defined assignment *note 7.6(1): 3918.
136858 user-defined heap management *note 13.11(1): 5620.
136859 user-defined operator *note 6.6(1): 3794.
136860 user-defined storage management *note 13.11(1): 5618.
136861 UTC_Time_Offset
136862 in Ada.Calendar.Time_Zones *note 9.6.1(6/2): 4488.
136863 UTF-16 *note A.4.11(46/3): 6577.
136864 UTF-8 *note A.4.11(46/3): 6576.
136865 UTF_16_Wide_String subtype of Wide_String
136866 in Ada.Strings.UTF_Encoding *note A.4.11(7/3): 6540.
136867 UTF_8_String subtype of String
136868 in Ada.Strings.UTF_Encoding *note A.4.11(6/3): 6539.
136869 UTF_Encoding
136870 child of Ada.Strings *note A.4.11(3/3): 6536.
136871 UTF_String subtype of String
136872 in Ada.Strings.UTF_Encoding *note A.4.11(5/3): 6538.
136873
136874
136875 \1f
136876 File: aarm2012.info, Node: V, Next: W, Prev: U, Up: Index
136877
136878 V
136879 ==
136880
136881
136882
136883 Val attribute *note 3.5.5(5): 1866.
136884 Valid
136885 in Ada.Text_IO.Editing *note F.3.3(5): 8842, *note F.3.3(12): 8854.
136886 in Interfaces.COBOL *note B.4(33): 8141, *note B.4(38): 8145, *note
136887 B.4(43): 8149.
136888 Valid attribute *note 13.9.2(3/3): 5611, *note H(6): 9050.
136889 value *note 3.2(10.a): 1426.
136890 in Ada.Calendar.Formatting *note 9.6.1(36/2): 4522, *note
136891 9.6.1(38/2): 4524.
136892 in Ada.Environment_Variables *note A.17(4.1/3): 7207, *note
136893 A.17(4/2): 7206.
136894 in Ada.Numerics.Discrete_Random *note A.5.2(26): 6645.
136895 in Ada.Numerics.Float_Random *note A.5.2(14): 6633.
136896 in Ada.Strings.Maps *note A.4.2(21): 6252.
136897 in Ada.Strings.Wide_Maps *note A.4.7(21): 6464.
136898 in Ada.Strings.Wide_Wide_Maps *note A.4.8(21/2): 6506.
136899 in Ada.Task_Attributes *note C.7.2(4): 8295.
136900 in Interfaces.C.Pointers *note B.3.2(6): 8078, *note B.3.2(7):
136901 8079.
136902 in Interfaces.C.Strings *note B.3.1(13): 8062, *note B.3.1(14):
136903 8063, *note B.3.1(15): 8064, *note B.3.1(16): 8065.
136904 Value attribute *note 3.5(52): 1756.
136905 value conversion *note 4.6(5/2): 3142.
136906 values
136907 belonging to a subtype *note 3.2(8/2): 1418.
136908 variable *note 3.3(13/3): 1524.
136909 variable indexing *note 4.1.6(16/3): 2646.
136910 variable object *note 3.3(13/3): 1526.
136911 variable view *note 3.3(13/3): 1528.
136912 Variable_Indexing aspect *note 4.1.6(3/3): 2636.
136913 variant *note 3.8.1(3): 2188.
136914 used *note 3.8.1(2): 2187, *note P: 9787.
136915 See also tagged type *note 3.9(1): 2212.
136916 variant_part *note 3.8.1(2): 2184.
136917 used *note 3.8(4): 2153, *note P: 9778.
136918 Vector
136919 in Ada.Containers.Vectors *note A.18.2(8/3): 7239.
136920 vector container *note A.18.2(1/2): 7231.
136921 Vector_Iterator_Interfaces
136922 in Ada.Containers.Vectors *note A.18.2(11.2/3): 7244.
136923 Vectors
136924 child of Ada.Containers *note A.18.2(6/3): 7236.
136925 version
136926 of a compilation unit *note E.3(5/1): 8774.
136927 Version attribute *note E.3(3): 8771.
136928 vertical line *note 2.1(15/3): 1213.
136929 Vertical_Line
136930 in Ada.Characters.Latin_1 *note A.3.3(14): 6038.
136931 view *note 3.1(7): 1364, *note N(42/2): 9590.
136932 of a subtype (implied) *note 3.1(7.1/3): 1368.
136933 of a type (implied) *note 3.1(7.1/3): 1367.
136934 of an object (implied) *note 3.1(7.1/3): 1366.
136935 view conversion *note 4.6(5/2): 3140.
136936 virtual function
136937 See dispatching subprogram *note 3.9.2(1/2): 2296.
136938 Virtual_Length
136939 in Interfaces.C.Pointers *note B.3.2(13): 8083.
136940 visibility
136941 direct *note 8.3(2): 4010, *note 8.3(21): 4037.
136942 immediate *note 8.3(4): 4014, *note 8.3(21): 4038.
136943 use clause *note 8.3(4): 4015, *note 8.4(9): 4068.
136944 visibility rules *note 8.3(1): 4009.
136945 visible *note 8.3(2): 4013, *note 8.3(14): 4029.
136946 aspect_specification *note 8.3(23.1/3): 4043.
136947 attribute_definition_clause *note 8.3(23.1/3): 4042.
136948 within a pragma in a context_clause *note 10.1.6(3): 4776.
136949 within a pragma that appears at the place of a compilation unit
136950 *note 10.1.6(5): 4780.
136951 within a use_clause in a context_clause *note 10.1.6(3): 4774.
136952 within a with_clause *note 10.1.6(2/2): 4772.
136953 within the parent_unit_name of a library unit *note 10.1.6(2/2):
136954 4770.
136955 within the parent_unit_name of a subunit *note 10.1.6(4): 4778.
136956 visible part *note 8.2(5): 3998.
136957 of a formal package *note 12.7(10/2): 5271.
136958 of a generic unit *note 8.2(8): 4002.
136959 of a package (other than a generic formal package) *note 7.1(6/2):
136960 3836.
136961 of a protected unit *note 9.4(11/2): 4296.
136962 of a task unit *note 9.1(9): 4223.
136963 of a view of a callable entity *note 8.2(6): 4000.
136964 of a view of a composite type *note 8.2(7): 4001.
136965 of an instance *note 12.3(12.b): 5107.
136966 volatile *note C.6(8/3): 8262.
136967 Volatile aspect *note C.6(6.4/3): 8254.
136968 Volatile pragma *note J.15.8(3/3): 9231, *note L(38.1/3): 9498.
136969 Volatile_Components aspect *note C.6(6.7/3): 8258.
136970 Volatile_Components pragma *note J.15.8(6/3): 9240, *note L(39.1/3):
136971 9501.
136972 VT
136973 in Ada.Characters.Latin_1 *note A.3.3(5): 5960.
136974 VTS
136975 in Ada.Characters.Latin_1 *note A.3.3(17): 6057.
136976
136977
136978 \1f
136979 File: aarm2012.info, Node: W, Next: X, Prev: V, Up: Index
136980
136981 W
136982 ==
136983
136984
136985
136986 Wait_For_Release
136987 in Ada.Synchronous_Barriers *note D.10.1(6/3): 8570.
136988 wchar_array
136989 in Interfaces.C *note B.3(33/3): 8019.
136990 wchar_t
136991 in Interfaces.C *note B.3(30/1): 8015.
136992 Wednesday
136993 in Ada.Calendar.Formatting *note 9.6.1(17/2): 4497.
136994 well-formed picture String
136995 for edited output *note F.3.1(1/3): 8838.
136996 Wide_Bounded
136997 child of Ada.Strings *note A.4.7(1/3): 6434.
136998 Wide_Character *note 3.5.2(3/3): 1792.
136999 in Standard *note A.1(36.1/3): 5885.
137000 Wide_Character_Mapping
137001 in Ada.Strings.Wide_Maps *note A.4.7(20/2): 6463.
137002 Wide_Character_Mapping_Function
137003 in Ada.Strings.Wide_Maps *note A.4.7(26): 6469.
137004 Wide_Character_Range
137005 in Ada.Strings.Wide_Maps *note A.4.7(6): 6452.
137006 Wide_Character_Ranges
137007 in Ada.Strings.Wide_Maps *note A.4.7(7): 6453.
137008 Wide_Character_Sequence subtype of Wide_String
137009 in Ada.Strings.Wide_Maps *note A.4.7(16): 6459.
137010 Wide_Character_Set
137011 in Ada.Strings.Wide_Maps *note A.4.7(4/2): 6450.
137012 in Ada.Strings.Wide_Maps.Wide_Constants *note A.4.8(48/2): 6514.
137013 Wide_Characters
137014 child of Ada *note A.3.1(4/2): 5904.
137015 Wide_Constants
137016 child of Ada.Strings.Wide_Maps *note A.4.7(1/3): 6448, *note
137017 A.4.8(28/2): 6512.
137018 Wide_Equal_Case_Insensitive
137019 child of Ada.Strings *note A.4.7(1/3): 6440.
137020 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6442.
137021 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6441.
137022 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6443.
137023 Wide_Exception_Name
137024 in Ada.Exceptions *note 11.4.1(2/2): 4931, *note 11.4.1(5/2): 4941.
137025 Wide_Expanded_Name
137026 in Ada.Tags *note 3.9(7/2): 2233.
137027 Wide_Fixed
137028 child of Ada.Strings *note A.4.7(1/3): 6433.
137029 Wide_Hash
137030 child of Ada.Strings *note A.4.7(1/3): 6436.
137031 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6438.
137032 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6437.
137033 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6439.
137034 Wide_Hash_Case_Insensitive
137035 child of Ada.Strings *note A.4.7(1/3): 6444.
137036 child of Ada.Strings.Wide_Bounded *note A.4.7(1/3): 6446.
137037 child of Ada.Strings.Wide_Fixed *note A.4.7(1/3): 6445.
137038 child of Ada.Strings.Wide_Unbounded *note A.4.7(1/3): 6447.
137039 Wide_Image attribute *note 3.5(28): 1727.
137040 Wide_Maps
137041 child of Ada.Strings *note A.4.7(3): 6449.
137042 wide_nul
137043 in Interfaces.C *note B.3(31/1): 8016.
137044 Wide_Space
137045 in Ada.Strings *note A.4.1(4/2): 6225.
137046 Wide_String
137047 in Standard *note A.1(41/3): 5890.
137048 Wide_Strings
137049 child of Ada.Strings.UTF_Encoding *note A.4.11(30/3): 6560.
137050 Wide_Text_IO
137051 child of Ada *note A.11(2/2): 7050.
137052 Wide_Unbounded
137053 child of Ada.Strings *note A.4.7(1/3): 6435.
137054 Wide_Value attribute *note 3.5(40): 1750.
137055 Wide_Wide_Bounded
137056 child of Ada.Strings *note A.4.8(1/3): 6476.
137057 Wide_Wide_Character *note 3.5.2(4/3): 1795.
137058 in Standard *note A.1(36.2/3): 5886.
137059 Wide_Wide_Character_Mapping
137060 in Ada.Strings.Wide_Wide_Maps *note A.4.8(20/2): 6505.
137061 Wide_Wide_Character_Mapping_Function
137062 in Ada.Strings.Wide_Wide_Maps *note A.4.8(26/2): 6511.
137063 Wide_Wide_Character_Range
137064 in Ada.Strings.Wide_Wide_Maps *note A.4.8(6/2): 6494.
137065 Wide_Wide_Character_Ranges
137066 in Ada.Strings.Wide_Wide_Maps *note A.4.8(7/2): 6495.
137067 Wide_Wide_Character_Sequence subtype of Wide_Wide_String
137068 in Ada.Strings.Wide_Wide_Maps *note A.4.8(16/2): 6501.
137069 Wide_Wide_Character_Set
137070 in Ada.Strings.Wide_Wide_Maps *note A.4.8(4/2): 6492.
137071 Wide_Wide_Characters
137072 child of Ada *note A.3.1(6/2): 5905.
137073 Wide_Wide_Constants
137074 child of Ada.Strings.Wide_Wide_Maps *note A.4.8(1/3): 6490.
137075 Wide_Wide_Equal_Case_Insensitive
137076 child of Ada.Strings *note A.4.8(1/3): 6482.
137077 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6484.
137078 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6483.
137079 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6485.
137080 Wide_Wide_Exception_Name
137081 in Ada.Exceptions *note 11.4.1(2/2): 4932, *note 11.4.1(5/2): 4942.
137082 Wide_Wide_Expanded_Name
137083 in Ada.Tags *note 3.9(7/2): 2234.
137084 Wide_Wide_Fixed
137085 child of Ada.Strings *note A.4.8(1/3): 6475.
137086 Wide_Wide_Hash
137087 child of Ada.Strings *note A.4.8(1/3): 6478.
137088 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6480.
137089 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6479.
137090 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6481.
137091 Wide_Wide_Hash_Case_Insensitive
137092 child of Ada.Strings *note A.4.8(1/3): 6486.
137093 child of Ada.Strings.Wide_Wide_Bounded *note A.4.8(1/3): 6488.
137094 child of Ada.Strings.Wide_Wide_Fixed *note A.4.8(1/3): 6487.
137095 child of Ada.Strings.Wide_Wide_Unbounded *note A.4.8(1/3): 6489.
137096 Wide_Wide_Image attribute *note 3.5(27.1/2): 1722.
137097 Wide_Wide_Maps
137098 child of Ada.Strings *note A.4.8(3/2): 6491.
137099 Wide_Wide_Space
137100 in Ada.Strings *note A.4.1(4/2): 6226.
137101 Wide_Wide_String
137102 in Standard *note A.1(42.1/3): 5891.
137103 Wide_Wide_Strings
137104 child of Ada.Strings.UTF_Encoding *note A.4.11(38/3): 6567.
137105 Wide_Wide_Text_IO
137106 child of Ada *note A.11(3/2): 7053.
137107 Wide_Wide_Unbounded
137108 child of Ada.Strings *note A.4.8(1/3): 6477.
137109 Wide_Wide_Value attribute *note 3.5(39.1/2): 1738.
137110 Wide_Wide_Width attribute *note 3.5(37.1/2): 1732.
137111 Wide_Width attribute *note 3.5(38): 1734.
137112 Width attribute *note 3.5(39): 1736.
137113 with_clause *note 10.1.2(4/2): 4703.
137114 mentioned in *note 10.1.2(6/2): 4715.
137115 named in *note 10.1.2(6/2): 4717.
137116 used *note 10.1.2(3): 4701, *note P: 10297.
137117 within
137118 immediately *note 8.1(13): 3991.
137119 word *note 13.3(8): 5388.
137120 Word_Size
137121 in System *note 13.7(13): 5545.
137122 wording changes from Ada 2005 *note 1.1.2(39.jj/3): 1063.
137123 wording changes from Ada 83 *note 1.1.2(39.j/2): 1052.
137124 wording changes from Ada 95 *note 1.1.2(39.w/2): 1058.
137125 Write
137126 in Ada.Direct_IO *note A.8.4(13): 6825.
137127 in Ada.Sequential_IO *note A.8.1(12): 6795.
137128 in Ada.Storage_IO *note A.9(7): 6843.
137129 in Ada.Streams *note 13.13.1(6): 5784.
137130 in Ada.Streams.Stream_IO *note A.12.1(18): 7085, *note A.12.1(19):
137131 7086.
137132 in System.RPC *note E.5(8): 8813.
137133 Write aspect *note 13.13.2(38/3): 5823.
137134 Write attribute *note 13.13.2(3): 5792, *note 13.13.2(11): 5796.
137135 Write clause *note 13.3(7/2): 5380, *note 13.13.2(38/3): 5817.
137136
137137
137138 \1f
137139 File: aarm2012.info, Node: X, Next: Y, Prev: W, Up: Index
137140
137141 X
137142 ==
137143
137144
137145
137146 xor operator *note 4.4(1/3): 2779, *note 4.5.1(2): 2941.
137147
137148
137149 \1f
137150 File: aarm2012.info, Node: Y, Prev: X, Up: Index
137151
137152 Y
137153 ==
137154
137155
137156
137157 Year
137158 in Ada.Calendar *note 9.6(13): 4465.
137159 in Ada.Calendar.Formatting *note 9.6.1(21/2): 4507.
137160 Year_Number subtype of Integer
137161 in Ada.Calendar *note 9.6(11/2): 4460.
137162 Yen_Sign
137163 in Ada.Characters.Latin_1 *note A.3.3(21/3): 6085.
137164 Yield
137165 in Ada.Dispatching *note D.2.1(1.3/3): 8339.
137166 Yield_To_Higher
137167 in Ada.Dispatching.Non_Preemptive *note D.2.4(2.2/3): 8378.
137168 Yield_To_Same_Or_Higher
137169 in Ada.Dispatching.Non_Preemptive *note D.2.4(2.2/3): 8379.
137170
137171 \1f
137172 Tag Table:
137173 Node: Top\7f215
137174 Node: Front Matter\7f1585
137175 Node: 0.1\7f7498
137176 Node: 0.2\7f9939
137177 Ref: 1001\7f33867
137178 Ref: 1002\7f33867
137179 Node: 0.99\7f49528
137180 Node: 1\7f49737
137181 Ref: 1003\7f55805
137182 Node: 1.1\7f56365
137183 Node: 1.1.1\7f58378
137184 Node: 1.1.2\7f59943
137185 Ref: 1004\7f60655
137186 Ref: 1005\7f60967
137187 Ref: 1006\7f60967
137188 Ref: 1007\7f60967
137189 Ref: 1008\7f61445
137190 Ref: 1009\7f61445
137191 Ref: 1010\7f61911
137192 Ref: 1011\7f61911
137193 Ref: 1012\7f61911
137194 Ref: 1013\7f66406
137195 Ref: 1014\7f66411
137196 Ref: 1015\7f66411
137197 Ref: 1016\7f66411
137198 Ref: 1017\7f66411
137199 Ref: 1018\7f66515
137200 Ref: 1019\7f66516
137201 Ref: 1020\7f66516
137202 Ref: 1021\7f67607
137203 Ref: 1022\7f67607
137204 Ref: 1023\7f67607
137205 Ref: 1024\7f67647
137206 Ref: 1025\7f67649
137207 Ref: 1026\7f68014
137208 Ref: 1027\7f68014
137209 Ref: 1028\7f68865
137210 Ref: 1029\7f68865
137211 Ref: 1030\7f68865
137212 Ref: 1031\7f68865
137213 Ref: 1032\7f68916
137214 Ref: 1033\7f68918
137215 Ref: 1034\7f69669
137216 Ref: 1035\7f69669
137217 Ref: 1036\7f69669
137218 Ref: 1037\7f69669
137219 Ref: 1038\7f70202
137220 Ref: 1039\7f70202
137221 Ref: 1040\7f70548
137222 Ref: 1041\7f70548
137223 Ref: 1042\7f70671
137224 Ref: 1043\7f71303
137225 Ref: 1044\7f71862
137226 Ref: 1045\7f72023
137227 Ref: 1046\7f72708
137228 Ref: 1047\7f72708
137229 Ref: 1048\7f74133
137230 Ref: 1049\7f74925
137231 Ref: 1050\7f75957
137232 Ref: 1051\7f76595
137233 Ref: 1052\7f77214
137234 Ref: 1053\7f77965
137235 Ref: 1054\7f78305
137236 Ref: 1055\7f78455
137237 Ref: 1056\7f79437
137238 Ref: 1057\7f80988
137239 Ref: 1058\7f82661
137240 Ref: 1059\7f83619
137241 Ref: 1060\7f83928
137242 Ref: 1061\7f84933
137243 Ref: 1062\7f86333
137244 Ref: 1063\7f87871
137245 Node: 1.1.3\7f88413
137246 Ref: 1064\7f88655
137247 Ref: 1065\7f88716
137248 Ref: 1066\7f91827
137249 Ref: 1067\7f93516
137250 Ref: 1068\7f93516
137251 Ref: 1069\7f93641
137252 Ref: 1070\7f101798
137253 Ref: 1071\7f101798
137254 Ref: 1072\7f101798
137255 Ref: 1073\7f101798
137256 Ref: 1074\7f101798
137257 Ref: 1075\7f104278
137258 Node: 1.1.4\7f106535
137259 Ref: 1076\7f107019
137260 Ref: 1077\7f107019
137261 Ref: 1078\7f107019
137262 Ref: 1079\7f107019
137263 Ref: 1080\7f107019
137264 Ref: 1081\7f108328
137265 Ref: 1082\7f108657
137266 Ref: 1083\7f108658
137267 Ref: 1084\7f108658
137268 Ref: 1085\7f108658
137269 Ref: 1086\7f111496
137270 Ref: 1087\7f111655
137271 Ref: 1088\7f112347
137272 Ref: 1089\7f112443
137273 Ref: 1090\7f113018
137274 Ref: 1091\7f113020
137275 Node: 1.1.5\7f116204
137276 Ref: 1092\7f117044
137277 Ref: 1093\7f117049
137278 Ref: 1094\7f117049
137279 Ref: 1095\7f117049
137280 Ref: 1096\7f117798
137281 Ref: 1097\7f117803
137282 Ref: 1098\7f118483
137283 Ref: 1099\7f118544
137284 Ref: 1100\7f118777
137285 Ref: 1101\7f120410
137286 Ref: 1102\7f120410
137287 Ref: 1103\7f121035
137288 Ref: 1104\7f121037
137289 Ref: 1105\7f121832
137290 Ref: 1106\7f122559
137291 Ref: 1107\7f122748
137292 Node: 1.2\7f123829
137293 Ref: 1108\7f123975
137294 Ref: 1109\7f123976
137295 Ref: 1110\7f124326
137296 Ref: 1111\7f124327
137297 Ref: 1112\7f124327
137298 Ref: 1113\7f124462
137299 Ref: 1114\7f124462
137300 Ref: 1115\7f124462
137301 Ref: 1116\7f124598
137302 Ref: 1117\7f124599
137303 Ref: 1118\7f124599
137304 Ref: 1119\7f124738
137305 Ref: 1120\7f124739
137306 Ref: 1121\7f124739
137307 Ref: 1122\7f124872
137308 Ref: 1123\7f124873
137309 Ref: 1124\7f124873
137310 Ref: 1125\7f124997
137311 Ref: 1126\7f124997
137312 Ref: 1127\7f124997
137313 Ref: 1128\7f125129
137314 Ref: 1129\7f125130
137315 Ref: 1130\7f125277
137316 Ref: 1131\7f125278
137317 Ref: 1132\7f125278
137318 Ref: 1133\7f125464
137319 Ref: 1134\7f125465
137320 Ref: 1135\7f125465
137321 Ref: 1136\7f125646
137322 Ref: 1137\7f125647
137323 Ref: 1138\7f125647
137324 Ref: 1139\7f125938
137325 Ref: 1140\7f125939
137326 Ref: 1141\7f125939
137327 Ref: 1142\7f126049
137328 Ref: 1143\7f126050
137329 Ref: 1144\7f126281
137330 Node: 1.3\7f127107
137331 Ref: 1145\7f127247
137332 Ref: 1146\7f127891
137333 Ref: 1147\7f127893
137334 Ref: 1148\7f127893
137335 Ref: 1149\7f127893
137336 Ref: 1150\7f128422
137337 Ref: 1151\7f128423
137338 Ref: 1152\7f128500
137339 Ref: 1153\7f128502
137340 Ref: 1154\7f128800
137341 Ref: 1155\7f128801
137342 Ref: 1156\7f129010
137343 Ref: 1157\7f129012
137344 Ref: 1158\7f129218
137345 Ref: 1159\7f129219
137346 Ref: 1160\7f129641
137347 Ref: 1161\7f129643
137348 Ref: 1162\7f129643
137349 Ref: 1163\7f129643
137350 Node: 2\7f129915
137351 Node: 2.1\7f130652
137352 Ref: 1164\7f130830
137353 Ref: 1165\7f131087
137354 Ref: 1166\7f131087
137355 Ref: 1167\7f133902
137356 Ref: 1168\7f134648
137357 Ref: 1169\7f134804
137358 Ref: 1170\7f135066
137359 Ref: 1171\7f135224
137360 Ref: 1172\7f135380
137361 Ref: 1173\7f135530
137362 Ref: 1174\7f135688
137363 Ref: 1175\7f135857
137364 Ref: 1176\7f136012
137365 Ref: 1177\7f136165
137366 Ref: 1178\7f136334
137367 Ref: 1179\7f136483
137368 Ref: 1180\7f136638
137369 Ref: 1181\7f136793
137370 Ref: 1182\7f136981
137371 Ref: 1183\7f137325
137372 Ref: 1184\7f137582
137373 Ref: 1185\7f137800
137374 Ref: 1186\7f137961
137375 Ref: 1187\7f138170
137376 Ref: 1188\7f141636
137377 Ref: 1189\7f141637
137378 Ref: 1190\7f141637
137379 Ref: 1191\7f141637
137380 Ref: 1192\7f141637
137381 Ref: 1193\7f141637
137382 Ref: 1194\7f141637
137383 Ref: 1195\7f141637
137384 Ref: 1196\7f141637
137385 Ref: 1197\7f141637
137386 Ref: 1198\7f141637
137387 Ref: 1199\7f141637
137388 Ref: 1200\7f141637
137389 Ref: 1201\7f141637
137390 Ref: 1202\7f141637
137391 Ref: 1203\7f141637
137392 Ref: 1204\7f141637
137393 Ref: 1205\7f141637
137394 Ref: 1206\7f141637
137395 Ref: 1207\7f141637
137396 Ref: 1208\7f141637
137397 Ref: 1209\7f141637
137398 Ref: 1210\7f141637
137399 Ref: 1211\7f141637
137400 Ref: 1212\7f141637
137401 Ref: 1213\7f141637
137402 Ref: 1214\7f141637
137403 Ref: 1215\7f141637
137404 Ref: 1216\7f141731
137405 Ref: 1217\7f141732
137406 Ref: 1218\7f146147
137407 Ref: 1219\7f147624
137408 Ref: 1220\7f147995
137409 Node: 2.2\7f149733
137410 Ref: 1221\7f149947
137411 Ref: 1222\7f150020
137412 Ref: 1223\7f150020
137413 Ref: 1224\7f150521
137414 Ref: 1225\7f150528
137415 Ref: 1226\7f150882
137416 Ref: 1227\7f151950
137417 Ref: 1228\7f152095
137418 Ref: 1229\7f153695
137419 Node: 2.3\7f153906
137420 Ref: 1230\7f154163
137421 Ref: S0002\7f154163
137422 Ref: 1231\7f154176
137423 Ref: 1232\7f154194
137424 Ref: 1233\7f154213
137425 Ref: 1234\7f154321
137426 Ref: S0003\7f154321
137427 Ref: S0004\7f154321
137428 Ref: 1235\7f154336
137429 Ref: 1236\7f154363
137430 Ref: 1237\7f154390
137431 Ref: 1238\7f154417
137432 Ref: 1239\7f154443
137433 Ref: 1240\7f154466
137434 Ref: 1241\7f154597
137435 Ref: S0005\7f154597
137436 Ref: 1242\7f154612
137437 Ref: 1243\7f154639
137438 Ref: 1244\7f154672
137439 Ref: 1245\7f154697
137440 Ref: 1246\7f155462
137441 Ref: 1247\7f161072
137442 Ref: 1248\7f161358
137443 Node: 2.4\7f162331
137444 Ref: 1249\7f162443
137445 Ref: 1250\7f162519
137446 Ref: 1251\7f162579
137447 Ref: 1252\7f162701
137448 Ref: S0006\7f162701
137449 Ref: 1253\7f162705
137450 Ref: 1254\7f162724
137451 Node: 2.4.1\7f162937
137452 Ref: 1255\7f163047
137453 Ref: 1256\7f163215
137454 Ref: S0007\7f163215
137455 Ref: 1257\7f163219
137456 Ref: 1258\7f163230
137457 Ref: 1259\7f163240
137458 Ref: 1260\7f163265
137459 Ref: S0008\7f163265
137460 Ref: 1261\7f163269
137461 Ref: 1262\7f163278
137462 Ref: 1263\7f163289
137463 Ref: 1264\7f163312
137464 Ref: S0009\7f163312
137465 Ref: 1265\7f163323
137466 Ref: 1266\7f163337
137467 Ref: 1267\7f163391
137468 Ref: S0010\7f163391
137469 Node: 2.4.2\7f164726
137470 Ref: 1268\7f164833
137471 Ref: 1269\7f164834
137472 Ref: 1270\7f164834
137473 Ref: 1271\7f164834
137474 Ref: 1272\7f164834
137475 Ref: 1273\7f164834
137476 Ref: 1274\7f164834
137477 Ref: 1275\7f164834
137478 Ref: 1276\7f164834
137479 Ref: 1277\7f164834
137480 Ref: 1278\7f164990
137481 Ref: S0011\7f164990
137482 Ref: 1279\7f165003
137483 Ref: 1280\7f165010
137484 Ref: 1281\7f165026
137485 Ref: 1282\7f165044
137486 Ref: 1283\7f165066
137487 Ref: S0012\7f165066
137488 Ref: 1284\7f165070
137489 Ref: 1285\7f165100
137490 Ref: S0013\7f165100
137491 Ref: 1286\7f165113
137492 Ref: 1287\7f165130
137493 Ref: 1288\7f165141
137494 Ref: 1289\7f165179
137495 Ref: S0014\7f165179
137496 Ref: 1290\7f165183
137497 Ref: 1291\7f165262
137498 Node: 2.5\7f166536
137499 Ref: 1292\7f166818
137500 Ref: S0015\7f166818
137501 Ref: 1293\7f166824
137502 Node: 2.6\7f167499
137503 Ref: 1294\7f167902
137504 Ref: 1295\7f167969
137505 Ref: S0016\7f167969
137506 Ref: 1296\7f167976
137507 Ref: 1297\7f168015
137508 Ref: S0017\7f168015
137509 Ref: 1298\7f168044
137510 Ref: 1299\7f168242
137511 Ref: 1300\7f168559
137512 Node: 2.7\7f169973
137513 Ref: 1301\7f170207
137514 Ref: S0018\7f170207
137515 Ref: 1302\7f170231
137516 Node: 2.8\7f170899
137517 Ref: 1303\7f170993
137518 Ref: 1304\7f172007
137519 Ref: S0019\7f172007
137520 Ref: 1305\7f172027
137521 Ref: 1306\7f172040
137522 Ref: 1307\7f172071
137523 Ref: 1308\7f172171
137524 Ref: S0020\7f172171
137525 Ref: 1309\7f172203
137526 Ref: 1310\7f172218
137527 Ref: 1311\7f172250
137528 Ref: 1312\7f172265
137529 Ref: 1313\7f172302
137530 Ref: 1314\7f172318
137531 Ref: 1315\7f172349
137532 Ref: 1316\7f172365
137533 Ref: 1317\7f173910
137534 Ref: 1318\7f173910
137535 Ref: 1319\7f173984
137536 Ref: 1320\7f173986
137537 Ref: 1321\7f174339
137538 Ref: 1322\7f174340
137539 Ref: 1323\7f178494
137540 Ref: 1324\7f178494
137541 Ref: 1325\7f178722
137542 Ref: 1326\7f183959
137543 Ref: 1327\7f184207
137544 Ref: 1328\7f184753
137545 Ref: 1329\7f185552
137546 Ref: 1330\7f185553
137547 Ref: 1331\7f185558
137548 Ref: 1332\7f185588
137549 Ref: 1333\7f185589
137550 Ref: 1334\7f185612
137551 Ref: 1335\7f185613
137552 Ref: 1336\7f185622
137553 Ref: 1337\7f188497
137554 Node: 2.9\7f189444
137555 Ref: 1338\7f189713
137556 Ref: 1339\7f191810
137557 Ref: 1340\7f192317
137558 Ref: 1341\7f193148
137559 Node: 3\7f193807
137560 Node: 3.1\7f194432
137561 Ref: 1342\7f194524
137562 Ref: 1343\7f194611
137563 Ref: 1344\7f195069
137564 Ref: S0021\7f195069
137565 Ref: 1345\7f195084
137566 Ref: 1346\7f195105
137567 Ref: 1347\7f195135
137568 Ref: 1348\7f195158
137569 Ref: 1349\7f195187
137570 Ref: 1350\7f195214
137571 Ref: 1351\7f195256
137572 Ref: 1352\7f195287
137573 Ref: 1353\7f195329
137574 Ref: 1354\7f195353
137575 Ref: 1355\7f195384
137576 Ref: 1356\7f195410
137577 Ref: 1357\7f195440
137578 Ref: 1358\7f195489
137579 Ref: S0022\7f195489
137580 Ref: 1359\7f195493
137581 Ref: 1360\7f195554
137582 Ref: 1361\7f195642
137583 Ref: 1362\7f195644
137584 Ref: 1363\7f196268
137585 Ref: 1364\7f197690
137586 Ref: 1365\7f197690
137587 Ref: 1366\7f199214
137588 Ref: 1367\7f199214
137589 Ref: 1368\7f199214
137590 Ref: 1369\7f199856
137591 Ref: 1370\7f200290
137592 Ref: 1371\7f200392
137593 Ref: 1372\7f200491
137594 Ref: 1373\7f200811
137595 Ref: 1374\7f201046
137596 Ref: 1375\7f201678
137597 Ref: 1376\7f201760
137598 Ref: 1377\7f201762
137599 Ref: 1378\7f202120
137600 Ref: 1379\7f202122
137601 Ref: 1380\7f204583
137602 Ref: 1381\7f204653
137603 Ref: 1382\7f204722
137604 Ref: 1383\7f206178
137605 Ref: 1384\7f206249
137606 Ref: 1385\7f206527
137607 Node: 3.2\7f212286
137608 Ref: 1386\7f212448
137609 Ref: 1387\7f212448
137610 Ref: 1388\7f212583
137611 Ref: 1389\7f213331
137612 Ref: 1390\7f213332
137613 Ref: 1391\7f213376
137614 Ref: 1392\7f213519
137615 Ref: 1393\7f213570
137616 Ref: 1394\7f213637
137617 Ref: 1395\7f213638
137618 Ref: 1396\7f213712
137619 Ref: 1397\7f213876
137620 Ref: 1398\7f217805
137621 Ref: 1399\7f217944
137622 Ref: 1400\7f217946
137623 Ref: 1401\7f218053
137624 Ref: 1402\7f218415
137625 Ref: 1403\7f218416
137626 Ref: 1404\7f218416
137627 Ref: 1405\7f219117
137628 Ref: 1406\7f219385
137629 Ref: 1407\7f219626
137630 Ref: 1408\7f219894
137631 Ref: 1409\7f219894
137632 Ref: 1410\7f220796
137633 Ref: 1411\7f220914
137634 Ref: 1412\7f221398
137635 Ref: 1413\7f221589
137636 Ref: 1414\7f221589
137637 Ref: 1415\7f221668
137638 Ref: 1416\7f221668
137639 Ref: 1417\7f221801
137640 Ref: 1418\7f221837
137641 Ref: 1419\7f221837
137642 Ref: 1420\7f223261
137643 Ref: 1421\7f223261
137644 Ref: 1422\7f223261
137645 Ref: 1423\7f223261
137646 Ref: 1424\7f224810
137647 Ref: 1425\7f225414
137648 Ref: 1426\7f225506
137649 Ref: 1427\7f225647
137650 Node: 3.2.1\7f231668
137651 Ref: 1428\7f231903
137652 Ref: S0023\7f231903
137653 Ref: 1429\7f231909
137654 Ref: 1430\7f231941
137655 Ref: 1431\7f231979
137656 Ref: 1432\7f232014
137657 Ref: 1433\7f232100
137658 Ref: S0024\7f232100
137659 Ref: 1434\7f232120
137660 Ref: 1435\7f232141
137661 Ref: 1436\7f232169
137662 Ref: 1437\7f232205
137663 Ref: 1438\7f232238
137664 Ref: 1439\7f232270
137665 Ref: 1440\7f232351
137666 Ref: S0025\7f232351
137667 Ref: 1441\7f232366
137668 Ref: 1442\7f232398
137669 Ref: 1443\7f232432
137670 Ref: 1444\7f232457
137671 Ref: 1445\7f232489
137672 Ref: 1446\7f232516
137673 Ref: 1447\7f232549
137674 Ref: 1448\7f232577
137675 Ref: 1449\7f232780
137676 Ref: 1450\7f233210
137677 Ref: 1451\7f233333
137678 Ref: 1452\7f233526
137679 Ref: 1453\7f234334
137680 Ref: 1454\7f234545
137681 Ref: 1455\7f234618
137682 Ref: 1456\7f235283
137683 Ref: 1457\7f235772
137684 Ref: 1458\7f236707
137685 Ref: 1459\7f236806
137686 Ref: 1460\7f240319
137687 Node: 3.2.2\7f240452
137688 Ref: 1461\7f240790
137689 Ref: S0026\7f240790
137690 Ref: 1462\7f240811
137691 Ref: 1463\7f240834
137692 Ref: 1464\7f240867
137693 Ref: 1465\7f240947
137694 Ref: S0027\7f240947
137695 Ref: 1466\7f240954
137696 Ref: 1467\7f240976
137697 Ref: 1468\7f240990
137698 Ref: 1469\7f241022
137699 Ref: S0028\7f241022
137700 Ref: 1470\7f241035
137701 Ref: 1471\7f241356
137702 Ref: S0029\7f241356
137703 Ref: 1472\7f241360
137704 Ref: 1473\7f241381
137705 Ref: 1474\7f241427
137706 Ref: S0030\7f241427
137707 Ref: 1475\7f241442
137708 Ref: 1476\7f241461
137709 Ref: 1477\7f241481
137710 Ref: 1478\7f241526
137711 Ref: S0031\7f241526
137712 Ref: 1479\7f241541
137713 Ref: 1480\7f241560
137714 Ref: 1481\7f241685
137715 Ref: 1482\7f242144
137716 Ref: 1483\7f242239
137717 Ref: 1484\7f242598
137718 Ref: 1485\7f242598
137719 Ref: 1486\7f243049
137720 Ref: 1487\7f243347
137721 Ref: 1488\7f244820
137722 Ref: 1489\7f245649
137723 Ref: 1490\7f245861
137724 Node: 3.2.3\7f245992
137725 Ref: 1491\7f246216
137726 Ref: 1492\7f246435
137727 Ref: 1493\7f246606
137728 Ref: 1494\7f247844
137729 Ref: 1495\7f248700
137730 Ref: 1496\7f250161
137731 Ref: 1497\7f250313
137732 Ref: 1498\7f250703
137733 Node: 3.2.4\7f252114
137734 Ref: 1499\7f252520
137735 Ref: 1500\7f252520
137736 Ref: 1501\7f252520
137737 Ref: 1502\7f252520
137738 Ref: 1503\7f252520
137739 Ref: 1504\7f252520
137740 Ref: 1505\7f252520
137741 Ref: 1506\7f253139
137742 Ref: 1507\7f253934
137743 Ref: 1508\7f254051
137744 Ref: 1509\7f254051
137745 Ref: 1510\7f254051
137746 Ref: 1511\7f256401
137747 Ref: 1512\7f256401
137748 Ref: 1513\7f260444
137749 Ref: 1514\7f261618
137750 Ref: 1515\7f261618
137751 Ref: 1516\7f261618
137752 Ref: 1517\7f261618
137753 Ref: 1518\7f261618
137754 Ref: 1519\7f262026
137755 Ref: 1520\7f263296
137756 Node: 3.3\7f263347
137757 Ref: 1521\7f263546
137758 Ref: 1522\7f263860
137759 Ref: 1523\7f264908
137760 Ref: 1524\7f264909
137761 Ref: 1525\7f264909
137762 Ref: 1526\7f264909
137763 Ref: 1527\7f264909
137764 Ref: 1528\7f264909
137765 Ref: 1529\7f265370
137766 Ref: 1530\7f265538
137767 Ref: 1531\7f265678
137768 Ref: 1532\7f268142
137769 Ref: 1533\7f268240
137770 Ref: 1534\7f268242
137771 Ref: 1535\7f268416
137772 Ref: 1536\7f268418
137773 Ref: 1537\7f269133
137774 Ref: 1538\7f269133
137775 Ref: 1539\7f271337
137776 Ref: 1540\7f272201
137777 Ref: 1541\7f274558
137778 Node: 3.3.1\7f275925
137779 Ref: 1542\7f276067
137780 Ref: 1543\7f276068
137781 Ref: 1544\7f276068
137782 Ref: 1545\7f276230
137783 Ref: 1546\7f276232
137784 Ref: 1547\7f276232
137785 Ref: 1548\7f276527
137786 Ref: S0032\7f276527
137787 Ref: 1549\7f276541
137788 Ref: 1550\7f276589
137789 Ref: 1551\7f276618
137790 Ref: 1552\7f276644
137791 Ref: 1553\7f276676
137792 Ref: 1554\7f276724
137793 Ref: 1555\7f276752
137794 Ref: 1556\7f276778
137795 Ref: 1557\7f276810
137796 Ref: 1558\7f276858
137797 Ref: 1559\7f276890
137798 Ref: 1560\7f276916
137799 Ref: 1561\7f276948
137800 Ref: 1562\7f276981
137801 Ref: 1563\7f277042
137802 Ref: S0033\7f277042
137803 Ref: 1564\7f277054
137804 Ref: 1565\7f277077
137805 Ref: 1566\7f277150
137806 Ref: 1567\7f277291
137807 Ref: 1568\7f277349
137808 Ref: 1569\7f277844
137809 Ref: 1570\7f277932
137810 Ref: 1571\7f278640
137811 Ref: 1572\7f279081
137812 Ref: 1573\7f279636
137813 Ref: 1574\7f279933
137814 Ref: 1575\7f279992
137815 Ref: 1576\7f279994
137816 Ref: 1577\7f280096
137817 Ref: 1578\7f280098
137818 Ref: 1579\7f280183
137819 Ref: 1580\7f280793
137820 Ref: 1581\7f281688
137821 Ref: 1582\7f282656
137822 Ref: 1583\7f283401
137823 Ref: 1584\7f283624
137824 Ref: 1585\7f283865
137825 Ref: 1586\7f283867
137826 Ref: 1587\7f284091
137827 Ref: 1588\7f285924
137828 Ref: 1589\7f289663
137829 Ref: 1590\7f291219
137830 Ref: 1591\7f291220
137831 Ref: 1592\7f293166
137832 Ref: 1593\7f295241
137833 Ref: 1594\7f296064
137834 Ref: 1595\7f296270
137835 Ref: 1596\7f297040
137836 Node: 3.3.2\7f297530
137837 Ref: 1597\7f297745
137838 Ref: 1598\7f298225
137839 Ref: S0034\7f298225
137840 Ref: 1599\7f298240
137841 Ref: 1600\7f298286
137842 Ref: 1601\7f298350
137843 Ref: 1602\7f299038
137844 Ref: 1603\7f299091
137845 Ref: 1604\7f299814
137846 Node: 3.4\7f300698
137847 Ref: 1605\7f300887
137848 Ref: 1606\7f301059
137849 Ref: 1607\7f301721
137850 Ref: 1608\7f301722
137851 Ref: 1609\7f302528
137852 Ref: S0035\7f302528
137853 Ref: 1610\7f302574
137854 Ref: 1611\7f302599
137855 Ref: 1612\7f302621
137856 Ref: 1613\7f302780
137857 Ref: 1614\7f302781
137858 Ref: 1615\7f304248
137859 Ref: 1616\7f306837
137860 Ref: 1617\7f308544
137861 Ref: 1618\7f308544
137862 Ref: 1619\7f308722
137863 Ref: 1620\7f309514
137864 Ref: 1621\7f312489
137865 Ref: 1622\7f312490
137866 Ref: 1623\7f312864
137867 Ref: 1624\7f312865
137868 Ref: 1625\7f312865
137869 Ref: 1626\7f316297
137870 Ref: 1627\7f316641
137871 Ref: 1628\7f317210
137872 Ref: 1629\7f319685
137873 Ref: 1630\7f320637
137874 Ref: 1631\7f322712
137875 Ref: 1632\7f323188
137876 Ref: 1633\7f323918
137877 Ref: 1634\7f324622
137878 Ref: 1635\7f325065
137879 Ref: 1636\7f325555
137880 Ref: 1637\7f329067
137881 Ref: 1638\7f329635
137882 Ref: 1639\7f330727
137883 Ref: 1640\7f331692
137884 Ref: 1641\7f332743
137885 Node: 3.4.1\7f333765
137886 Ref: 1642\7f334081
137887 Ref: 1643\7f334392
137888 Ref: 1644\7f334394
137889 Ref: 1645\7f334394
137890 Ref: 1646\7f335298
137891 Ref: 1647\7f335755
137892 Ref: 1648\7f336376
137893 Ref: 1649\7f337367
137894 Ref: 1650\7f337687
137895 Ref: 1651\7f337687
137896 Ref: 1652\7f337687
137897 Ref: 1653\7f337687
137898 Ref: 1654\7f340557
137899 Ref: 1655\7f340557
137900 Ref: 1656\7f340712
137901 Ref: 1657\7f340891
137902 Ref: 1658\7f341236
137903 Ref: 1659\7f341317
137904 Ref: 1660\7f341319
137905 Ref: 1661\7f343414
137906 Node: 3.5\7f345171
137907 Ref: 1662\7f345275
137908 Ref: 1663\7f345346
137909 Ref: 1664\7f345409
137910 Ref: 1665\7f345488
137911 Ref: 1666\7f345710
137912 Ref: S0036\7f345710
137913 Ref: 1667\7f345722
137914 Ref: 1668\7f345741
137915 Ref: S0037\7f345741
137916 Ref: 1669\7f345747
137917 Ref: 1670\7f345783
137918 Ref: 1671\7f345804
137919 Ref: 1672\7f346068
137920 Ref: 1673\7f346068
137921 Ref: 1674\7f346068
137922 Ref: 1675\7f346068
137923 Ref: 1676\7f346267
137924 Ref: 1677\7f346465
137925 Ref: 1678\7f346583
137926 Ref: 1679\7f346660
137927 Ref: 1680\7f346819
137928 Ref: 1681\7f347048
137929 Ref: 1682\7f348768
137930 Ref: 1683\7f349466
137931 Ref: 1684\7f350255
137932 Ref: 1685\7f350255
137933 Ref: 1686\7f350329
137934 Ref: 1687\7f350566
137935 Ref: 1688\7f350714
137936 Ref: 1689\7f351531
137937 Ref: 1690\7f351609
137938 Ref: 1691\7f351863
137939 Ref: 1692\7f351863
137940 Ref: 1693\7f352092
137941 Ref: 1694\7f352107
137942 Ref: 1695\7f352323
137943 Ref: 1696\7f352338
137944 Ref: 1697\7f352543
137945 Ref: 1698\7f352558
137946 Ref: 1699\7f352624
137947 Ref: 1700\7f352639
137948 Ref: 1701\7f352793
137949 Ref: 1702\7f352806
137950 Ref: 1703\7f352821
137951 Ref: 1704\7f353122
137952 Ref: 1705\7f353472
137953 Ref: 1706\7f353487
137954 Ref: 1707\7f353773
137955 Ref: 1708\7f353788
137956 Ref: 1709\7f353957
137957 Ref: 1710\7f354122
137958 Ref: 1711\7f354123
137959 Ref: 1712\7f354609
137960 Ref: 1713\7f354610
137961 Ref: 1714\7f355084
137962 Ref: 1715\7f355099
137963 Ref: 1716\7f355268
137964 Ref: 1717\7f355433
137965 Ref: 1718\7f355434
137966 Ref: 1719\7f355935
137967 Ref: 1720\7f355936
137968 Ref: 1721\7f356428
137969 Ref: 1722\7f356443
137970 Ref: 1723\7f356681
137971 Ref: 1724\7f357573
137972 Ref: 1725\7f358401
137973 Ref: 1726\7f360821
137974 Ref: 1727\7f360836
137975 Ref: 1728\7f361132
137976 Ref: 1729\7f361946
137977 Ref: 1730\7f361961
137978 Ref: 1731\7f362948
137979 Ref: 1732\7f362963
137980 Ref: 1733\7f363285
137981 Ref: 1734\7f363300
137982 Ref: 1735\7f363557
137983 Ref: 1736\7f363572
137984 Ref: 1737\7f363829
137985 Ref: 1738\7f363844
137986 Ref: 1739\7f364296
137987 Ref: 1740\7f364297
137988 Ref: 1741\7f364803
137989 Ref: 1742\7f364804
137990 Ref: 1743\7f365649
137991 Ref: 1744\7f366170
137992 Ref: 1745\7f366171
137993 Ref: 1746\7f367493
137994 Ref: 1747\7f367709
137995 Ref: 1748\7f367710
137996 Ref: 1749\7f367915
137997 Ref: 1750\7f367930
137998 Ref: 1751\7f368352
137999 Ref: 1752\7f368353
138000 Ref: 1753\7f368834
138001 Ref: 1754\7f368835
138002 Ref: 1755\7f369967
138003 Ref: 1756\7f369982
138004 Ref: 1757\7f370369
138005 Ref: 1758\7f370370
138006 Ref: 1759\7f370841
138007 Ref: 1760\7f370842
138008 Ref: 1761\7f373102
138009 Ref: 1762\7f373102
138010 Ref: 1763\7f374294
138011 Ref: 1764\7f376142
138012 Ref: 1765\7f377242
138013 Ref: 1766\7f378718
138014 Ref: 1767\7f379382
138015 Ref: 1768\7f380889
138016 Node: 3.5.1\7f381376
138017 Ref: 1769\7f381489
138018 Ref: 1770\7f381627
138019 Ref: S0038\7f381627
138020 Ref: 1771\7f381641
138021 Ref: 1772\7f381678
138022 Ref: 1773\7f381761
138023 Ref: S0039\7f381761
138024 Ref: 1774\7f381767
138025 Ref: 1775\7f381789
138026 Ref: 1776\7f381856
138027 Ref: S0040\7f381856
138028 Ref: 1777\7f381860
138029 Ref: 1778\7f382612
138030 Ref: 1779\7f383743
138031 Ref: 1780\7f384084
138032 Ref: 1781\7f384528
138033 Ref: 1782\7f384528
138034 Ref: 1783\7f384528
138035 Ref: 1784\7f386546
138036 Node: 3.5.2\7f387446
138037 Ref: 1785\7f387614
138038 Ref: 1786\7f387841
138039 Ref: 1787\7f387842
138040 Ref: 1788\7f387842
138041 Ref: 1789\7f387842
138042 Ref: 1790\7f388519
138043 Ref: 1791\7f388521
138044 Ref: 1792\7f388689
138045 Ref: 1793\7f388690
138046 Ref: 1794\7f388690
138047 Ref: 1795\7f389203
138048 Ref: 1796\7f389204
138049 Ref: 1797\7f391491
138050 Ref: 1798\7f391950
138051 Ref: 1799\7f392517
138052 Ref: 1800\7f393152
138053 Ref: 1801\7f395453
138054 Ref: 1802\7f396719
138055 Node: 3.5.3\7f396721
138056 Ref: 1803\7f396885
138057 Ref: 1804\7f396990
138058 Ref: 1805\7f396992
138059 Ref: 1806\7f397082
138060 Node: 3.5.4\7f397592
138061 Ref: 1807\7f397710
138062 Ref: 1808\7f397710
138063 Ref: 1809\7f397710
138064 Ref: 1810\7f398086
138065 Ref: 1811\7f398161
138066 Ref: S0041\7f398161
138067 Ref: 1812\7f398165
138068 Ref: 1813\7f398199
138069 Ref: 1814\7f398267
138070 Ref: S0042\7f398267
138071 Ref: 1815\7f398285
138072 Ref: 1816\7f398319
138073 Ref: 1817\7f399125
138074 Ref: S0043\7f399125
138075 Ref: 1818\7f399141
138076 Ref: 1819\7f399204
138077 Ref: 1820\7f399336
138078 Ref: 1821\7f399630
138079 Ref: 1822\7f399630
138080 Ref: 1823\7f399630
138081 Ref: 1824\7f400530
138082 Ref: 1825\7f400731
138083 Ref: 1826\7f400733
138084 Ref: 1827\7f401529
138085 Ref: 1828\7f401536
138086 Ref: 1829\7f401650
138087 Ref: 1830\7f401652
138088 Ref: 1831\7f401796
138089 Ref: 1832\7f403255
138090 Ref: 1833\7f403255
138091 Ref: 1834\7f403468
138092 Ref: 1835\7f403468
138093 Ref: 1836\7f403468
138094 Ref: 1837\7f403826
138095 Ref: 1838\7f403828
138096 Ref: 1839\7f405711
138097 Ref: 1840\7f405890
138098 Ref: 1841\7f405905
138099 Ref: 1842\7f406235
138100 Ref: 1843\7f406250
138101 Ref: 1844\7f406405
138102 Ref: 1845\7f406747
138103 Ref: 1846\7f406747
138104 Ref: 1847\7f406747
138105 Ref: 1848\7f406939
138106 Ref: 1849\7f406939
138107 Ref: 1850\7f406939
138108 Ref: 1851\7f407115
138109 Ref: 1852\7f407209
138110 Ref: 1853\7f407818
138111 Ref: 1854\7f407818
138112 Ref: 1855\7f408660
138113 Ref: 1856\7f409614
138114 Ref: 1857\7f410721
138115 Ref: 1858\7f412168
138116 Ref: 1859\7f413340
138117 Ref: 1860\7f413340
138118 Ref: 1861\7f414896
138119 Ref: 1862\7f417513
138120 Node: 3.5.5\7f417980
138121 Ref: 1863\7f418251
138122 Ref: 1864\7f418266
138123 Ref: 1865\7f418582
138124 Ref: 1866\7f418597
138125 Ref: 1867\7f418773
138126 Ref: 1868\7f418788
138127 Ref: 1869\7f418896
138128 Ref: 1870\7f418898
138129 Ref: 1871\7f419767
138130 Ref: 1872\7f419782
138131 Ref: 1873\7f420014
138132 Ref: 1874\7f420029
138133 Ref: 1875\7f421499
138134 Ref: 1876\7f422422
138135 Ref: 1877\7f424078
138136 Ref: 1878\7f424360
138137 Node: 3.5.6\7f424427
138138 Ref: 1879\7f424539
138139 Ref: 1880\7f424768
138140 Ref: S0044\7f424768
138141 Ref: 1881\7f424781
138142 Ref: 1882\7f424809
138143 Ref: 1883\7f424881
138144 Ref: 1884\7f425776
138145 Ref: 1885\7f425776
138146 Ref: 1886\7f425957
138147 Ref: 1887\7f426268
138148 Ref: 1888\7f427859
138149 Node: 3.5.7\7f430007
138150 Ref: 1889\7f430139
138151 Ref: 1890\7f430361
138152 Ref: S0045\7f430361
138153 Ref: 1891\7f430387
138154 Ref: 1892\7f430399
138155 Ref: 1893\7f430457
138156 Ref: S0046\7f430457
138157 Ref: 1894\7f430482
138158 Ref: 1895\7f430510
138159 Ref: 1896\7f430580
138160 Ref: 1897\7f430790
138161 Ref: 1898\7f430850
138162 Ref: 1899\7f431021
138163 Ref: 1900\7f431238
138164 Ref: 1901\7f432267
138165 Ref: 1902\7f432417
138166 Ref: 1903\7f433079
138167 Ref: 1904\7f433213
138168 Ref: 1905\7f433785
138169 Ref: 1906\7f433920
138170 Ref: 1907\7f433922
138171 Ref: 1908\7f434539
138172 Ref: 1909\7f434541
138173 Ref: 1910\7f435200
138174 Ref: 1911\7f435207
138175 Ref: 1912\7f435384
138176 Ref: 1913\7f435544
138177 Ref: 1914\7f435703
138178 Ref: 1915\7f435868
138179 Ref: 1916\7f435868
138180 Ref: 1917\7f436761
138181 Ref: 1918\7f438545
138182 Node: 3.5.8\7f440614
138183 Ref: 1919\7f440905
138184 Ref: 1920\7f440920
138185 Ref: 1921\7f441530
138186 Node: 3.5.9\7f442373
138187 Ref: 1922\7f442500
138188 Ref: 1923\7f442500
138189 Ref: 1924\7f442500
138190 Ref: 1925\7f442589
138191 Ref: 1926\7f442777
138192 Ref: S0047\7f442777
138193 Ref: 1927\7f442781
138194 Ref: 1928\7f442816
138195 Ref: 1929\7f442892
138196 Ref: S0048\7f442892
138197 Ref: 1930\7f442918
138198 Ref: 1931\7f442930
138199 Ref: 1932\7f442993
138200 Ref: S0049\7f442993
138201 Ref: 1933\7f443019
138202 Ref: 1934\7f443044
138203 Ref: 1935\7f443056
138204 Ref: 1936\7f443113
138205 Ref: S0050\7f443113
138206 Ref: 1937\7f443140
138207 Ref: 1938\7f443152
138208 Ref: 1939\7f443222
138209 Ref: 1940\7f443424
138210 Ref: 1941\7f443426
138211 Ref: 1942\7f443426
138212 Ref: 1943\7f443976
138213 Ref: 1944\7f444090
138214 Ref: 1945\7f444237
138215 Ref: 1946\7f445537
138216 Ref: 1947\7f445691
138217 Ref: 1948\7f445981
138218 Ref: 1949\7f445983
138219 Ref: 1950\7f446285
138220 Ref: 1951\7f446682
138221 Ref: 1952\7f446741
138222 Ref: 1953\7f446901
138223 Ref: 1954\7f446903
138224 Ref: 1955\7f447154
138225 Ref: 1956\7f447644
138226 Ref: 1957\7f447698
138227 Ref: 1958\7f448029
138228 Ref: 1959\7f449937
138229 Ref: 1960\7f450036
138230 Ref: 1961\7f450038
138231 Ref: 1962\7f450261
138232 Ref: 1963\7f452799
138233 Ref: 1964\7f453149
138234 Node: 3.5.10\7f454185
138235 Ref: 1965\7f454457
138236 Ref: 1966\7f454472
138237 Ref: 1967\7f454654
138238 Ref: 1968\7f454656
138239 Ref: 1969\7f454905
138240 Ref: 1970\7f454905
138241 Ref: 1971\7f455011
138242 Ref: 1972\7f455026
138243 Ref: 1973\7f455354
138244 Ref: 1974\7f455369
138245 Ref: 1975\7f455918
138246 Ref: 1976\7f455933
138247 Ref: 1977\7f456515
138248 Ref: 1978\7f456530
138249 Ref: 1979\7f456854
138250 Ref: 1980\7f457965
138251 Ref: 1981\7f457980
138252 Ref: 1982\7f458093
138253 Ref: 1983\7f458462
138254 Ref: 1984\7f458477
138255 Ref: 1985\7f459155
138256 Node: 3.6\7f459971
138257 Ref: 1986\7f460073
138258 Ref: 1987\7f460073
138259 Ref: 1988\7f460441
138260 Ref: S0051\7f460441
138261 Ref: 1989\7f460454
138262 Ref: 1990\7f460487
138263 Ref: 1991\7f460554
138264 Ref: S0052\7f460554
138265 Ref: 1992\7f460573
138266 Ref: 1993\7f460601
138267 Ref: 1994\7f460631
138268 Ref: 1995\7f460690
138269 Ref: S0053\7f460690
138270 Ref: 1996\7f460694
138271 Ref: 1997\7f460753
138272 Ref: S0054\7f460753
138273 Ref: 1998\7f460773
138274 Ref: 1999\7f460804
138275 Ref: 2000\7f460843
138276 Ref: 2001\7f460899
138277 Ref: S0055\7f460899
138278 Ref: 2002\7f460913
138279 Ref: 2003\7f460934
138280 Ref: 2004\7f461033
138281 Ref: S0056\7f461033
138282 Ref: 2005\7f461056
138283 Ref: 2006\7f461093
138284 Ref: 2007\7f461163
138285 Ref: 2008\7f461493
138286 Ref: 2009\7f461607
138287 Ref: 2010\7f461679
138288 Ref: 2011\7f461873
138289 Ref: 2012\7f462274
138290 Ref: 2013\7f462274
138291 Ref: 2014\7f462274
138292 Ref: 2015\7f462887
138293 Ref: 2016\7f462935
138294 Ref: 2017\7f462995
138295 Ref: 2018\7f463119
138296 Ref: 2019\7f463592
138297 Ref: 2020\7f463592
138298 Ref: 2021\7f463847
138299 Ref: 2022\7f464018
138300 Ref: 2023\7f464018
138301 Ref: 2024\7f464275
138302 Ref: 2025\7f465138
138303 Ref: 2026\7f465448
138304 Ref: 2027\7f465751
138305 Ref: 2028\7f466033
138306 Ref: 2029\7f466345
138307 Ref: 2030\7f466711
138308 Ref: 2031\7f467098
138309 Ref: 2032\7f467648
138310 Ref: 2033\7f467648
138311 Ref: 2034\7f468929
138312 Ref: 2035\7f470742
138313 Ref: 2036\7f472399
138314 Ref: 2037\7f473104
138315 Node: 3.6.1\7f473382
138316 Ref: 2038\7f473740
138317 Ref: S0057\7f473740
138318 Ref: 2039\7f473747
138319 Ref: 2040\7f473765
138320 Ref: 2041\7f473804
138321 Ref: S0058\7f473804
138322 Ref: 2042\7f473818
138323 Ref: 2043\7f473839
138324 Ref: 2044\7f473897
138325 Ref: 2045\7f474013
138326 Ref: 2046\7f474711
138327 Ref: 2047\7f474897
138328 Ref: 2048\7f475098
138329 Ref: 2049\7f475217
138330 Ref: 2050\7f475536
138331 Ref: 2051\7f475650
138332 Ref: 2052\7f477077
138333 Node: 3.6.2\7f478060
138334 Ref: 2053\7f478955
138335 Ref: 2054\7f478970
138336 Ref: 2055\7f479099
138337 Ref: 2056\7f479114
138338 Ref: 2057\7f479241
138339 Ref: 2058\7f479256
138340 Ref: 2059\7f479383
138341 Ref: 2060\7f479398
138342 Ref: 2061\7f479525
138343 Ref: 2062\7f479540
138344 Ref: 2063\7f479673
138345 Ref: 2064\7f479688
138346 Ref: 2065\7f479842
138347 Ref: 2066\7f479857
138348 Ref: 2067\7f480022
138349 Ref: 2068\7f480037
138350 Ref: 2069\7f481296
138351 Node: 3.6.3\7f482424
138352 Ref: 2070\7f482572
138353 Ref: 2071\7f484198
138354 Ref: 2072\7f484487
138355 Ref: 2073\7f484791
138356 Ref: 2074\7f485155
138357 Ref: 2075\7f485654
138358 Node: 3.7\7f485690
138359 Ref: 2076\7f485857
138360 Ref: 2077\7f485857
138361 Ref: 2078\7f485858
138362 Ref: 2079\7f486729
138363 Ref: 2080\7f486730
138364 Ref: 2081\7f489095
138365 Ref: S0059\7f489095
138366 Ref: 2082\7f489099
138367 Ref: 2083\7f489128
138368 Ref: 2084\7f489191
138369 Ref: S0060\7f489191
138370 Ref: 2085\7f489232
138371 Ref: S0061\7f489232
138372 Ref: 2086\7f489246
138373 Ref: 2087\7f489276
138374 Ref: 2088\7f489370
138375 Ref: S0062\7f489370
138376 Ref: 2089\7f489383
138377 Ref: 2090\7f489411
138378 Ref: 2091\7f489427
138379 Ref: 2092\7f489444
138380 Ref: 2093\7f489478
138381 Ref: 2094\7f489505
138382 Ref: 2095\7f489527
138383 Ref: 2096\7f489579
138384 Ref: S0063\7f489579
138385 Ref: 2097\7f489583
138386 Ref: 2098\7f489647
138387 Ref: 2099\7f490130
138388 Ref: 2100\7f491500
138389 Ref: 2101\7f494198
138390 Ref: 2102\7f501162
138391 Ref: 2103\7f501464
138392 Ref: 2104\7f501910
138393 Ref: 2105\7f502534
138394 Ref: 2106\7f505202
138395 Ref: 2107\7f505202
138396 Ref: 2108\7f505202
138397 Ref: 2109\7f505202
138398 Ref: 2110\7f505321
138399 Ref: 2111\7f505323
138400 Ref: 2112\7f505684
138401 Ref: 2113\7f505686
138402 Ref: 2114\7f508059
138403 Ref: 2115\7f509396
138404 Ref: 2116\7f513757
138405 Ref: 2117\7f516320
138406 Ref: 2118\7f516916
138407 Node: 3.7.1\7f517266
138408 Ref: 2119\7f517800
138409 Ref: S0064\7f517800
138410 Ref: 2120\7f517814
138411 Ref: 2121\7f517842
138412 Ref: 2122\7f517901
138413 Ref: S0065\7f517901
138414 Ref: 2123\7f517928
138415 Ref: 2124\7f517958
138416 Ref: 2125\7f517977
138417 Ref: 2126\7f517997
138418 Ref: 2127\7f518104
138419 Ref: 2128\7f518452
138420 Ref: 2129\7f518538
138421 Ref: 2130\7f518820
138422 Ref: 2131\7f519687
138423 Ref: 2132\7f522091
138424 Ref: 2133\7f522642
138425 Ref: 2134\7f522810
138426 Ref: 2135\7f523164
138427 Ref: 2136\7f524744
138428 Ref: 2137\7f525601
138429 Node: 3.7.2\7f527137
138430 Ref: 2138\7f527838
138431 Ref: 2139\7f527853
138432 Ref: 2140\7f530215
138433 Ref: 2141\7f531123
138434 Node: 3.8\7f532571
138435 Ref: 2142\7f532675
138436 Ref: 2143\7f532675
138437 Ref: 2144\7f532838
138438 Ref: 2145\7f532912
138439 Ref: S0066\7f532912
138440 Ref: 2146\7f532947
138441 Ref: 2147\7f532996
138442 Ref: S0067\7f532996
138443 Ref: 2148\7f533029
138444 Ref: 2149\7f533107
138445 Ref: S0068\7f533107
138446 Ref: 2150\7f533123
138447 Ref: 2151\7f533139
138448 Ref: 2152\7f533166
138449 Ref: 2153\7f533182
138450 Ref: 2154\7f533286
138451 Ref: S0069\7f533286
138452 Ref: 2155\7f533295
138453 Ref: 2156\7f533320
138454 Ref: 2157\7f533390
138455 Ref: S0070\7f533390
138456 Ref: 2158\7f533403
138457 Ref: 2159\7f533430
138458 Ref: 2160\7f533455
138459 Ref: 2161\7f533495
138460 Ref: 2162\7f533570
138461 Ref: 2163\7f533820
138462 Ref: 2164\7f535402
138463 Ref: 2165\7f537656
138464 Ref: 2166\7f537657
138465 Ref: 2167\7f537779
138466 Ref: 2168\7f538000
138467 Ref: 2169\7f538469
138468 Ref: 2170\7f538617
138469 Ref: 2171\7f538721
138470 Ref: 2172\7f538868
138471 Ref: 2173\7f539404
138472 Ref: 2174\7f539405
138473 Ref: 2175\7f539405
138474 Ref: 2176\7f539817
138475 Ref: 2177\7f540778
138476 Ref: 2178\7f542665
138477 Ref: 2179\7f543677
138478 Ref: 2180\7f545448
138479 Ref: 2181\7f545558
138480 Ref: 2182\7f546392
138481 Node: 3.8.1\7f546584
138482 Ref: 2183\7f546937
138483 Ref: 2184\7f547651
138484 Ref: S0071\7f547651
138485 Ref: 2185\7f547682
138486 Ref: 2186\7f547709
138487 Ref: 2187\7f547729
138488 Ref: 2188\7f547771
138489 Ref: S0072\7f547771
138490 Ref: 2189\7f547789
138491 Ref: 2190\7f547824
138492 Ref: 2191\7f547867
138493 Ref: S0073\7f547867
138494 Ref: 2192\7f547871
138495 Ref: 2193\7f547891
138496 Ref: 2194\7f547983
138497 Ref: S0074\7f547983
138498 Ref: 2195\7f547992
138499 Ref: 2196\7f548022
138500 Ref: 2197\7f548043
138501 Ref: 2198\7f548116
138502 Ref: 2199\7f548331
138503 Ref: 2200\7f549183
138504 Ref: 2201\7f550808
138505 Ref: 2202\7f552781
138506 Ref: 2203\7f552781
138507 Ref: 2204\7f555020
138508 Ref: 2205\7f556003
138509 Ref: 2206\7f557142
138510 Ref: 2207\7f557544
138511 Node: 3.9\7f558464
138512 Ref: 2208\7f558610
138513 Ref: 2209\7f558610
138514 Ref: 2210\7f558611
138515 Ref: 2211\7f558611
138516 Ref: 2212\7f558611
138517 Ref: 2213\7f558770
138518 Ref: 2214\7f558772
138519 Ref: 2215\7f558772
138520 Ref: 2216\7f564762
138521 Ref: 2217\7f565164
138522 Ref: 2218\7f565166
138523 Ref: 2219\7f565293
138524 Ref: 2220\7f565294
138525 Ref: 2221\7f565294
138526 Ref: 2222\7f567269
138527 Ref: 2223\7f567602
138528 Ref: 2224\7f567671
138529 Ref: 2225\7f567673
138530 Ref: 2226\7f567673
138531 Ref: 2227\7f567673
138532 Ref: 2228\7f568344
138533 Ref: 2229\7f571267
138534 Ref: 2230\7f571337
138535 Ref: 2231\7f571449
138536 Ref: 2232\7f571524
138537 Ref: 2233\7f571580
138538 Ref: 2234\7f571646
138539 Ref: 2235\7f571722
138540 Ref: 2236\7f571777
138541 Ref: 2237\7f571875
138542 Ref: 2238\7f571955
138543 Ref: 2239\7f572094
138544 Ref: 2240\7f572177
138545 Ref: 2241\7f572278
138546 Ref: 2242\7f572380
138547 Ref: 2243\7f572425
138548 Ref: 2244\7f579284
138549 Ref: 2245\7f580440
138550 Ref: 2246\7f581175
138551 Ref: 2247\7f581190
138552 Ref: 2248\7f581441
138553 Ref: 2249\7f581456
138554 Ref: 2250\7f582552
138555 Ref: 2251\7f582567
138556 Ref: 2252\7f583085
138557 Ref: 2253\7f583100
138558 Ref: 2254\7f583666
138559 Ref: 2255\7f584835
138560 Ref: 2256\7f585125
138561 Ref: 2257\7f585459
138562 Ref: 2258\7f585876
138563 Ref: 2259\7f586430
138564 Ref: 2260\7f586550
138565 Ref: 2261\7f588225
138566 Ref: 2262\7f594684
138567 Ref: 2263\7f594684
138568 Ref: 2264\7f595011
138569 Ref: 2265\7f595151
138570 Ref: 2266\7f596949
138571 Ref: 2267\7f597618
138572 Ref: 2268\7f598475
138573 Ref: 2269\7f599168
138574 Node: 3.9.1\7f599976
138575 Ref: 2270\7f600116
138576 Ref: 2271\7f600116
138577 Ref: 2272\7f600117
138578 Ref: 2273\7f600117
138579 Ref: 2274\7f600117
138580 Ref: 2275\7f600117
138581 Ref: 2276\7f600773
138582 Ref: S0075\7f600773
138583 Ref: 2277\7f600783
138584 Ref: 2278\7f601201
138585 Ref: 2279\7f605514
138586 Ref: 2280\7f606378
138587 Ref: 2281\7f606584
138588 Ref: 2282\7f610411
138589 Ref: 2283\7f610548
138590 Node: 3.9.2\7f611044
138591 Ref: 2284\7f611271
138592 Ref: 2285\7f611272
138593 Ref: 2286\7f611272
138594 Ref: 2287\7f611272
138595 Ref: 2288\7f611272
138596 Ref: 2289\7f611272
138597 Ref: 2290\7f611272
138598 Ref: 2291\7f611272
138599 Ref: 2292\7f612257
138600 Ref: 2293\7f612259
138601 Ref: 2294\7f612259
138602 Ref: 2295\7f612259
138603 Ref: 2296\7f612259
138604 Ref: 2297\7f613500
138605 Ref: 2298\7f613501
138606 Ref: 2299\7f613618
138607 Ref: 2300\7f613810
138608 Ref: 2301\7f614063
138609 Ref: 2302\7f614065
138610 Ref: 2303\7f614486
138611 Ref: 2304\7f614486
138612 Ref: 2305\7f615447
138613 Ref: 2306\7f615883
138614 Ref: 2307\7f616141
138615 Ref: 2308\7f619527
138616 Ref: 2309\7f619654
138617 Ref: 2310\7f624778
138618 Ref: 2311\7f624778
138619 Ref: 2312\7f624977
138620 Ref: 2313\7f625322
138621 Ref: 2314\7f625324
138622 Ref: 2315\7f625448
138623 Ref: 2316\7f628789
138624 Ref: 2317\7f636440
138625 Ref: 2318\7f636595
138626 Ref: 2319\7f637530
138627 Node: 3.9.3\7f640207
138628 Ref: 2320\7f640391
138629 Ref: 2321\7f640391
138630 Ref: 2322\7f640392
138631 Ref: 2323\7f640392
138632 Ref: 2324\7f640526
138633 Ref: 2325\7f640528
138634 Ref: 2326\7f641856
138635 Ref: S0076\7f641856
138636 Ref: 2327\7f641871
138637 Ref: 2328\7f641902
138638 Ref: 2329\7f641953
138639 Ref: 2330\7f642057
138640 Ref: 2331\7f642058
138641 Ref: 2332\7f643186
138642 Ref: 2333\7f643187
138643 Ref: 2334\7f648433
138644 Ref: 2335\7f659037
138645 Ref: 2336\7f661966
138646 Ref: 2337\7f663219
138647 Ref: 2338\7f663964
138648 Node: 3.9.4\7f664851
138649 Ref: 2339\7f666388
138650 Ref: S0077\7f666388
138651 Ref: 2340\7f666461
138652 Ref: 2341\7f666570
138653 Ref: S0078\7f666570
138654 Ref: 2342\7f666585
138655 Ref: 2343\7f666613
138656 Ref: 2344\7f666760
138657 Ref: 2345\7f666760
138658 Ref: 2346\7f667101
138659 Ref: 2347\7f667101
138660 Ref: 2348\7f667102
138661 Ref: 2349\7f667102
138662 Ref: 2350\7f667102
138663 Ref: 2351\7f667102
138664 Ref: 2352\7f667102
138665 Ref: 2353\7f667102
138666 Ref: 2354\7f667102
138667 Ref: 2355\7f667102
138668 Ref: 2356\7f667584
138669 Ref: 2357\7f667585
138670 Ref: 2358\7f667585
138671 Ref: 2359\7f667585
138672 Ref: 2360\7f667585
138673 Ref: 2361\7f667585
138674 Ref: 2362\7f667585
138675 Ref: 2363\7f669557
138676 Ref: 2364\7f669558
138677 Ref: 2365\7f673143
138678 Ref: 2366\7f678577
138679 Node: 3.10\7f679002
138680 Ref: 2367\7f679110
138681 Ref: 2368\7f679110
138682 Ref: 2369\7f679110
138683 Ref: 2370\7f679402
138684 Ref: 2371\7f679404
138685 Ref: 2372\7f680061
138686 Ref: S0079\7f680061
138687 Ref: 2373\7f680076
138688 Ref: 2374\7f680092
138689 Ref: 2375\7f680130
138690 Ref: 2376\7f680146
138691 Ref: 2377\7f680213
138692 Ref: S0080\7f680213
138693 Ref: 2378\7f680235
138694 Ref: 2379\7f680260
138695 Ref: 2380\7f680310
138696 Ref: S0081\7f680310
138697 Ref: 2381\7f680369
138698 Ref: S0082\7f680369
138699 Ref: 2382\7f680412
138700 Ref: 2383\7f680468
138701 Ref: 2384\7f680552
138702 Ref: S0083\7f680552
138703 Ref: 2385\7f680685
138704 Ref: S0084\7f680685
138705 Ref: 2386\7f680700
138706 Ref: 2387\7f680734
138707 Ref: 2388\7f680757
138708 Ref: 2389\7f680802
138709 Ref: 2390\7f680830
138710 Ref: 2391\7f680874
138711 Ref: 2392\7f681009
138712 Ref: 2393\7f681010
138713 Ref: 2394\7f681010
138714 Ref: 2395\7f681010
138715 Ref: 2396\7f681170
138716 Ref: 2397\7f681348
138717 Ref: 2398\7f681571
138718 Ref: 2399\7f681571
138719 Ref: 2400\7f682389
138720 Ref: 2401\7f686806
138721 Ref: 2402\7f686807
138722 Ref: 2403\7f687009
138723 Ref: 2404\7f687174
138724 Ref: 2405\7f689317
138725 Ref: 2406\7f689411
138726 Ref: 2407\7f689516
138727 Ref: 2408\7f694237
138728 Ref: 2409\7f694238
138729 Ref: 2410\7f694238
138730 Ref: 2411\7f694735
138731 Ref: 2412\7f694799
138732 Ref: 2413\7f695719
138733 Ref: 2414\7f697441
138734 Ref: 2415\7f697442
138735 Ref: 2416\7f700435
138736 Ref: 2417\7f700642
138737 Ref: 2418\7f700933
138738 Ref: 2419\7f701226
138739 Ref: 2420\7f702977
138740 Ref: 2421\7f703793
138741 Ref: 2422\7f705117
138742 Ref: 2423\7f705853
138743 Node: 3.10.1\7f708449
138744 Ref: 2424\7f709127
138745 Ref: S0085\7f709127
138746 Ref: 2425\7f709137
138747 Ref: 2426\7f709164
138748 Ref: 2427\7f709277
138749 Ref: 2428\7f709278
138750 Ref: 2429\7f709568
138751 Ref: 2430\7f709568
138752 Ref: 2431\7f711912
138753 Ref: 2432\7f714146
138754 Ref: 2433\7f719913
138755 Ref: 2434\7f720366
138756 Ref: 2435\7f722425
138757 Ref: 2436\7f724765
138758 Ref: 2437\7f725898
138759 Ref: 2438\7f726923
138760 Node: 3.10.2\7f728168
138761 Ref: 2439\7f729403
138762 Ref: 2440\7f730069
138763 Ref: 2441\7f730071
138764 Ref: 2442\7f731922
138765 Ref: 2443\7f731923
138766 Ref: 2444\7f731923
138767 Ref: 2445\7f731923
138768 Ref: 2446\7f731923
138769 Ref: 2447\7f731923
138770 Ref: 2448\7f733409
138771 Ref: 2449\7f733411
138772 Ref: 2450\7f733415
138773 Ref: 2451\7f733415
138774 Ref: 2452\7f738361
138775 Ref: 2453\7f738361
138776 Ref: 2454\7f738361
138777 Ref: 2455\7f748785
138778 Ref: 2456\7f748786
138779 Ref: 2457\7f750205
138780 Ref: 2458\7f751732
138781 Ref: 2459\7f754332
138782 Ref: 2460\7f754332
138783 Ref: 2461\7f758790
138784 Ref: 2462\7f758790
138785 Ref: 2463\7f776748
138786 Ref: 2464\7f776763
138787 Ref: 2465\7f777082
138788 Ref: 2466\7f781241
138789 Ref: 2467\7f782939
138790 Ref: 2468\7f784042
138791 Ref: 2469\7f784047
138792 Ref: 2470\7f784062
138793 Ref: 2471\7f784062
138794 Ref: 2472\7f785287
138795 Ref: 2473\7f785707
138796 Ref: 2474\7f785722
138797 Ref: 2475\7f786035
138798 Ref: 2476\7f786127
138799 Ref: 2477\7f786469
138800 Ref: 2478\7f788291
138801 Ref: 2479\7f788291
138802 Ref: 2480\7f790050
138803 Ref: 2481\7f790409
138804 Ref: 2482\7f791671
138805 Ref: 2483\7f791672
138806 Ref: 2484\7f793384
138807 Ref: 2485\7f793847
138808 Ref: 2486\7f796649
138809 Ref: 2487\7f798313
138810 Ref: 2488\7f799458
138811 Node: 3.11\7f801754
138812 Ref: 2489\7f801990
138813 Ref: S0086\7f801990
138814 Ref: 2490\7f801996
138815 Ref: 2491\7f802038
138816 Ref: S0087\7f802038
138817 Ref: 2492\7f802052
138818 Ref: 2493\7f802077
138819 Ref: 2494\7f802169
138820 Ref: S0088\7f802169
138821 Ref: 2495\7f802183
138822 Ref: 2496\7f802203
138823 Ref: 2497\7f802219
138824 Ref: 2498\7f802242
138825 Ref: S0089\7f802242
138826 Ref: 2499\7f802246
138827 Ref: 2500\7f802261
138828 Ref: 2501\7f802290
138829 Ref: S0090\7f802290
138830 Ref: 2502\7f802304
138831 Ref: 2503\7f802322
138832 Ref: 2504\7f802337
138833 Ref: 2505\7f802349
138834 Ref: 2506\7f802553
138835 Ref: 2507\7f802604
138836 Ref: 2508\7f802769
138837 Ref: 2509\7f803417
138838 Ref: 2510\7f803417
138839 Ref: 2511\7f803820
138840 Ref: 2512\7f805060
138841 Ref: 2513\7f807090
138842 Ref: 2514\7f807095
138843 Ref: 2515\7f807257
138844 Node: 3.11.1\7f809589
138845 Ref: 2516\7f809829
138846 Ref: 2517\7f809903
138847 Ref: 2518\7f810052
138848 Ref: 2519\7f812375
138849 Ref: 2520\7f812505
138850 Ref: 2521\7f814343
138851 Node: 4\7f816436
138852 Node: 4.1\7f816998
138853 Ref: 2522\7f817608
138854 Ref: S0091\7f817608
138855 Ref: 2523\7f817623
138856 Ref: 2524\7f817639
138857 Ref: 2525\7f817670
138858 Ref: 2526\7f817692
138859 Ref: 2527\7f817708
138860 Ref: 2528\7f817731
138861 Ref: 2529\7f817761
138862 Ref: 2530\7f817781
138863 Ref: 2531\7f817805
138864 Ref: 2532\7f817827
138865 Ref: 2533\7f817858
138866 Ref: 2534\7f817884
138867 Ref: 2535\7f817924
138868 Ref: S0092\7f817924
138869 Ref: 2536\7f817928
138870 Ref: 2537\7f817942
138871 Ref: 2538\7f818228
138872 Ref: S0093\7f818228
138873 Ref: 2539\7f818232
138874 Ref: 2540\7f818240
138875 Ref: 2541\7f818289
138876 Ref: S0094\7f818289
138877 Ref: 2542\7f818293
138878 Ref: 2543\7f818331
138879 Ref: S0095\7f818331
138880 Ref: 2544\7f818335
138881 Ref: 2545\7f818686
138882 Ref: 2546\7f818686
138883 Ref: 2547\7f818885
138884 Ref: 2548\7f819787
138885 Ref: 2549\7f821142
138886 Ref: 2550\7f821813
138887 Ref: 2551\7f821980
138888 Ref: 2552\7f822063
138889 Ref: 2553\7f822244
138890 Ref: 2554\7f822409
138891 Ref: 2555\7f822411
138892 Ref: 2556\7f822483
138893 Ref: 2557\7f823561
138894 Ref: 2558\7f827828
138895 Node: 4.1.1\7f829159
138896 Ref: 2559\7f829369
138897 Ref: 2560\7f829439
138898 Ref: S0096\7f829439
138899 Ref: 2561\7f829443
138900 Ref: 2562\7f829451
138901 Ref: 2563\7f829465
138902 Ref: 2564\7f829844
138903 Ref: 2565\7f830089
138904 Ref: 2566\7f830377
138905 Ref: 2567\7f830488
138906 Ref: 2568\7f830564
138907 Ref: 2569\7f830566
138908 Ref: 2570\7f830566
138909 Ref: 2571\7f830696
138910 Node: 4.1.2\7f831809
138911 Ref: 2572\7f831914
138912 Ref: 2573\7f832191
138913 Ref: S0097\7f832191
138914 Ref: 2574\7f832195
138915 Ref: 2575\7f832203
138916 Ref: 2576\7f832378
138917 Ref: 2577\7f832871
138918 Ref: 2578\7f832972
138919 Ref: 2579\7f832972
138920 Ref: 2580\7f832974
138921 Ref: 2581\7f832974
138922 Ref: 2582\7f833179
138923 Node: 4.1.3\7f834703
138924 Ref: 2583\7f835019
138925 Ref: 2584\7f835090
138926 Ref: S0098\7f835090
138927 Ref: 2585\7f835094
138928 Ref: 2586\7f835104
138929 Ref: 2587\7f835139
138930 Ref: S0099\7f835139
138931 Ref: 2588\7f835143
138932 Ref: 2589\7f835157
138933 Ref: 2590\7f835177
138934 Ref: 2591\7f835245
138935 Ref: 2592\7f839446
138936 Ref: 2593\7f839448
138937 Ref: 2594\7f843107
138938 Ref: 2595\7f843189
138939 Ref: 2596\7f843189
138940 Ref: 2597\7f843381
138941 Ref: 2598\7f843383
138942 Ref: 2599\7f845005
138943 Ref: 2600\7f846238
138944 Ref: 2601\7f846513
138945 Node: 4.1.4\7f847411
138946 Ref: 2602\7f847523
138947 Ref: 2603\7f847762
138948 Ref: S0100\7f847762
138949 Ref: 2604\7f847766
138950 Ref: 2605\7f847774
138951 Ref: 2606\7f847850
138952 Ref: S0101\7f847850
138953 Ref: 2607\7f847864
138954 Ref: 2608\7f847883
138955 Ref: 2609\7f847968
138956 Ref: S0102\7f847968
138957 Ref: 2610\7f847972
138958 Ref: 2611\7f847980
138959 Ref: 2612\7f848041
138960 Ref: S0103\7f848041
138961 Ref: 2613\7f848060
138962 Ref: 2614\7f851086
138963 Ref: 2615\7f851086
138964 Ref: 2616\7f854056
138965 Ref: 2617\7f854056
138966 Ref: 2618\7f856022
138967 Ref: 2619\7f857274
138968 Node: 4.1.5\7f859923
138969 Ref: 2620\7f860379
138970 Ref: 2621\7f860379
138971 Ref: 2622\7f860608
138972 Ref: 2623\7f860662
138973 Ref: 2624\7f860794
138974 Ref: 2625\7f861234
138975 Ref: S0104\7f861234
138976 Ref: 2626\7f861261
138977 Ref: 2627\7f861467
138978 Ref: 2628\7f862372
138979 Ref: 2629\7f862590
138980 Ref: 2630\7f862592
138981 Ref: 2631\7f862682
138982 Ref: 2632\7f863958
138983 Node: 4.1.6\7f864041
138984 Ref: 2633\7f864777
138985 Ref: 2634\7f864777
138986 Ref: 2635\7f865539
138987 Ref: 2636\7f865539
138988 Ref: 2637\7f866678
138989 Ref: 2638\7f866754
138990 Ref: 2639\7f867424
138991 Ref: 2640\7f868176
138992 Ref: S0105\7f868176
138993 Ref: 2641\7f868208
138994 Ref: 2642\7f868215
138995 Ref: 2643\7f868466
138996 Ref: 2644\7f868751
138997 Ref: 2645\7f868751
138998 Ref: 2646\7f869559
138999 Ref: 2647\7f869559
139000 Ref: 2648\7f871384
139001 Node: 4.2\7f871500
139002 Ref: 2649\7f871597
139003 Ref: 2650\7f871788
139004 Ref: 2651\7f872250
139005 Ref: 2652\7f872250
139006 Ref: 2653\7f872959
139007 Ref: 2654\7f873742
139008 Ref: 2655\7f873742
139009 Ref: 2656\7f873742
139010 Ref: 2657\7f873793
139011 Ref: 2658\7f873793
139012 Ref: 2659\7f873793
139013 Ref: 2660\7f873793
139014 Ref: 2661\7f873885
139015 Ref: 2662\7f874300
139016 Ref: 2663\7f874300
139017 Ref: 2664\7f874610
139018 Ref: 2665\7f875576
139019 Ref: 2666\7f875934
139020 Ref: 2667\7f876662
139021 Node: 4.3\7f876803
139022 Ref: 2668\7f876904
139023 Ref: 2669\7f877019
139024 Ref: 2670\7f877080
139025 Ref: S0106\7f877080
139026 Ref: 2671\7f877084
139027 Ref: 2672\7f877104
139028 Ref: 2673\7f877126
139029 Ref: 2674\7f877230
139030 Ref: 2675\7f878853
139031 Ref: 2676\7f879142
139032 Ref: 2677\7f879213
139033 Ref: 2678\7f880316
139034 Ref: 2679\7f880316
139035 Ref: 2680\7f880425
139036 Ref: 2681\7f880930
139037 Ref: 2682\7f881519
139038 Ref: 2683\7f882618
139039 Node: 4.3.1\7f882775
139040 Ref: 2684\7f883108
139041 Ref: S0107\7f883108
139042 Ref: 2685\7f883114
139043 Ref: 2686\7f883190
139044 Ref: S0108\7f883190
139045 Ref: 2687\7f883204
139046 Ref: 2688\7f883236
139047 Ref: 2689\7f883354
139048 Ref: S0109\7f883354
139049 Ref: 2690\7f883369
139050 Ref: 2691\7f883395
139051 Ref: 2692\7f883416
139052 Ref: 2693\7f883473
139053 Ref: S0110\7f883473
139054 Ref: 2694\7f883498
139055 Ref: 2695\7f883525
139056 Ref: 2696\7f883560
139057 Ref: 2697\7f883690
139058 Ref: 2698\7f885277
139059 Ref: 2699\7f885625
139060 Ref: 2700\7f887159
139061 Ref: 2701\7f887295
139062 Ref: 2702\7f892914
139063 Ref: 2703\7f893046
139064 Ref: 2704\7f893327
139065 Ref: 2705\7f893707
139066 Ref: 2706\7f896448
139067 Ref: 2707\7f896991
139068 Ref: 2708\7f897434
139069 Ref: 2709\7f898010
139070 Node: 4.3.2\7f898592
139071 Ref: 2710\7f899471
139072 Ref: S0111\7f899471
139073 Ref: 2711\7f899486
139074 Ref: 2712\7f899505
139075 Ref: 2713\7f899561
139076 Ref: S0112\7f899561
139077 Ref: 2714\7f899565
139078 Ref: 2715\7f899579
139079 Ref: 2716\7f899674
139080 Ref: 2717\7f899770
139081 Ref: 2718\7f901293
139082 Ref: 2719\7f903179
139083 Ref: 2720\7f903663
139084 Ref: 2721\7f904276
139085 Ref: 2722\7f904306
139086 Ref: 2723\7f904307
139087 Ref: 2724\7f904745
139088 Ref: 2725\7f906304
139089 Ref: 2726\7f906452
139090 Ref: 2727\7f907164
139091 Ref: 2728\7f908145
139092 Node: 4.3.3\7f909028
139093 Ref: 2729\7f909934
139094 Ref: S0113\7f909934
139095 Ref: 2730\7f909946
139096 Ref: 2731\7f909975
139097 Ref: 2732\7f910062
139098 Ref: S0114\7f910062
139099 Ref: 2733\7f910077
139100 Ref: 2734\7f910089
139101 Ref: 2735\7f910103
139102 Ref: 2736\7f910126
139103 Ref: 2737\7f910140
139104 Ref: 2738\7f910163
139105 Ref: 2739\7f910185
139106 Ref: 2740\7f910199
139107 Ref: 2741\7f910255
139108 Ref: S0115\7f910255
139109 Ref: 2742\7f910270
139110 Ref: 2743\7f910301
139111 Ref: 2744\7f910397
139112 Ref: S0116\7f910397
139113 Ref: 2745\7f910411
139114 Ref: 2746\7f910435
139115 Ref: 2747\7f910455
139116 Ref: 2748\7f910485
139117 Ref: 2749\7f910633
139118 Ref: 2750\7f910824
139119 Ref: 2751\7f911395
139120 Ref: 2752\7f911688
139121 Ref: 2753\7f911788
139122 Ref: 2754\7f912243
139123 Ref: 2755\7f912380
139124 Ref: 2756\7f913106
139125 Ref: 2757\7f918015
139126 Ref: 2758\7f918267
139127 Ref: 2759\7f918267
139128 Ref: 2760\7f918535
139129 Ref: 2761\7f918537
139130 Ref: 2762\7f919607
139131 Ref: 2763\7f920728
139132 Ref: 2764\7f920728
139133 Ref: 2765\7f921295
139134 Ref: 2766\7f921296
139135 Ref: 2767\7f921973
139136 Ref: 2768\7f921973
139137 Ref: 2769\7f922378
139138 Ref: 2770\7f924609
139139 Ref: 2771\7f925341
139140 Ref: 2772\7f926979
139141 Ref: 2773\7f927768
139142 Node: 4.4\7f928406
139143 Ref: 2774\7f928584
139144 Ref: 2775\7f928953
139145 Ref: 2776\7f928955
139146 Ref: 2777\7f928955
139147 Ref: 2778\7f928955
139148 Ref: 2779\7f928955
139149 Ref: 2780\7f928955
139150 Ref: 2781\7f928955
139151 Ref: 2782\7f928955
139152 Ref: 2783\7f928955
139153 Ref: 2784\7f928955
139154 Ref: 2785\7f928955
139155 Ref: 2786\7f928955
139156 Ref: 2787\7f928955
139157 Ref: 2788\7f928955
139158 Ref: 2789\7f928955
139159 Ref: 2790\7f928955
139160 Ref: 2791\7f928955
139161 Ref: 2792\7f928955
139162 Ref: 2793\7f928955
139163 Ref: 2794\7f928955
139164 Ref: 2795\7f928955
139165 Ref: 2796\7f928955
139166 Ref: 2797\7f928955
139167 Ref: 2798\7f928955
139168 Ref: 2799\7f928955
139169 Ref: 2800\7f928955
139170 Ref: 2801\7f928955
139171 Ref: 2802\7f928955
139172 Ref: 2803\7f928955
139173 Ref: 2804\7f928955
139174 Ref: 2805\7f928955
139175 Ref: 2806\7f928955
139176 Ref: 2807\7f928955
139177 Ref: 2808\7f928955
139178 Ref: 2809\7f928955
139179 Ref: 2810\7f928955
139180 Ref: 2811\7f928955
139181 Ref: 2812\7f928955
139182 Ref: 2813\7f928955
139183 Ref: 2814\7f928955
139184 Ref: 2815\7f928955
139185 Ref: 2816\7f928955
139186 Ref: 2817\7f928955
139187 Ref: 2818\7f928955
139188 Ref: 2819\7f928955
139189 Ref: 2820\7f928955
139190 Ref: 2821\7f928955
139191 Ref: 2822\7f928955
139192 Ref: 2823\7f928955
139193 Ref: 2824\7f928955
139194 Ref: 2825\7f928955
139195 Ref: 2826\7f928955
139196 Ref: 2827\7f928955
139197 Ref: 2828\7f928955
139198 Ref: 2829\7f928955
139199 Ref: 2830\7f928955
139200 Ref: 2831\7f928955
139201 Ref: 2832\7f928955
139202 Ref: 2833\7f928955
139203 Ref: 2834\7f928955
139204 Ref: 2835\7f928955
139205 Ref: 2836\7f928955
139206 Ref: 2837\7f928955
139207 Ref: 2838\7f928955
139208 Ref: 2839\7f928955
139209 Ref: 2840\7f928955
139210 Ref: 2841\7f928955
139211 Ref: 2842\7f928955
139212 Ref: 2843\7f928955
139213 Ref: 2844\7f928955
139214 Ref: 2845\7f928955
139215 Ref: 2846\7f928955
139216 Ref: 2847\7f929015
139217 Ref: S0117\7f929015
139218 Ref: 2848\7f929030
139219 Ref: 2849\7f929044
139220 Ref: 2850\7f929059
139221 Ref: 2851\7f929078
139222 Ref: 2852\7f929098
139223 Ref: 2853\7f929111
139224 Ref: 2854\7f929126
139225 Ref: 2855\7f929144
139226 Ref: 2856\7f929164
139227 Ref: 2857\7f929178
139228 Ref: 2858\7f929242
139229 Ref: S0118\7f929242
139230 Ref: 2859\7f929257
139231 Ref: 2860\7f929278
139232 Ref: 2861\7f929305
139233 Ref: 2862\7f929325
139234 Ref: 2863\7f929352
139235 Ref: 2864\7f929373
139236 Ref: 2865\7f929400
139237 Ref: 2866\7f929426
139238 Ref: 2867\7f929453
139239 Ref: 2868\7f929478
139240 Ref: 2869\7f929547
139241 Ref: S0119\7f929547
139242 Ref: 2870\7f929562
139243 Ref: 2871\7f929581
139244 Ref: 2872\7f929601
139245 Ref: 2873\7f929663
139246 Ref: S0120\7f929663
139247 Ref: 2874\7f929678
139248 Ref: 2875\7f929697
139249 Ref: 2876\7f929717
139250 Ref: 2877\7f929746
139251 Ref: 2878\7f929773
139252 Ref: 2879\7f929855
139253 Ref: S0121\7f929855
139254 Ref: 2880\7f929859
139255 Ref: 2881\7f929886
139256 Ref: 2882\7f929959
139257 Ref: S0122\7f929959
139258 Ref: 2883\7f929963
139259 Ref: 2884\7f929984
139260 Ref: 2885\7f929998
139261 Ref: 2886\7f930036
139262 Ref: S0123\7f930036
139263 Ref: 2887\7f930042
139264 Ref: 2888\7f930065
139265 Ref: 2889\7f930071
139266 Ref: 2890\7f930100
139267 Ref: 2891\7f930118
139268 Ref: S0124\7f930118
139269 Ref: 2892\7f930122
139270 Ref: 2893\7f930131
139271 Ref: 2894\7f930152
139272 Ref: 2895\7f930174
139273 Ref: S0125\7f930174
139274 Ref: 2896\7f930178
139275 Ref: 2897\7f930191
139276 Ref: 2898\7f930206
139277 Ref: 2899\7f930220
139278 Ref: 2900\7f930325
139279 Ref: S0126\7f930325
139280 Ref: 2901\7f930338
139281 Ref: 2902\7f930363
139282 Ref: 2903\7f930380
139283 Ref: 2904\7f930398
139284 Ref: 2905\7f930405
139285 Ref: 2906\7f930418
139286 Ref: 2907\7f930439
139287 Ref: 2908\7f930466
139288 Ref: 2909\7f931653
139289 Ref: 2910\7f931793
139290 Ref: 2911\7f931793
139291 Ref: 2912\7f931793
139292 Ref: 2913\7f934564
139293 Node: 4.5\7f936134
139294 Ref: 2914\7f936285
139295 Ref: 2915\7f936285
139296 Ref: 2916\7f936653
139297 Ref: S0127\7f936653
139298 Ref: 2917\7f936705
139299 Ref: S0128\7f936705
139300 Ref: 2918\7f936774
139301 Ref: S0129\7f936774
139302 Ref: 2919\7f936826
139303 Ref: S0130\7f936826
139304 Ref: 2920\7f936871
139305 Ref: S0131\7f936871
139306 Ref: 2921\7f936937
139307 Ref: S0132\7f936937
139308 Ref: 2922\7f937935
139309 Ref: 2923\7f937935
139310 Ref: 2924\7f938092
139311 Ref: 2925\7f938094
139312 Ref: 2926\7f938094
139313 Ref: 2927\7f938094
139314 Ref: 2928\7f938661
139315 Ref: 2929\7f939244
139316 Ref: 2930\7f939441
139317 Node: 4.5.1\7f942218
139318 Ref: 2931\7f942443
139319 Ref: 2932\7f942443
139320 Ref: 2933\7f942443
139321 Ref: 2934\7f942590
139322 Ref: 2935\7f943015
139323 Ref: 2936\7f943015
139324 Ref: 2937\7f943015
139325 Ref: 2938\7f943015
139326 Ref: 2939\7f943015
139327 Ref: 2940\7f943015
139328 Ref: 2941\7f943015
139329 Ref: 2942\7f943015
139330 Ref: 2943\7f943196
139331 Ref: 2944\7f943879
139332 Ref: 2945\7f945941
139333 Ref: 2946\7f946244
139334 Ref: 2947\7f946244
139335 Ref: 2948\7f946408
139336 Ref: 2949\7f946410
139337 Ref: 2950\7f946499
139338 Node: 4.5.2\7f947415
139339 Ref: 2951\7f947590
139340 Ref: 2952\7f947590
139341 Ref: 2953\7f947590
139342 Ref: 2954\7f947591
139343 Ref: 2955\7f947591
139344 Ref: 2956\7f947681
139345 Ref: 2957\7f947683
139346 Ref: 2958\7f947830
139347 Ref: 2959\7f947832
139348 Ref: 2960\7f947832
139349 Ref: 2961\7f947832
139350 Ref: 2962\7f947832
139351 Ref: 2963\7f947832
139352 Ref: 2964\7f947832
139353 Ref: 2965\7f947832
139354 Ref: 2966\7f947832
139355 Ref: 2967\7f947832
139356 Ref: 2968\7f947832
139357 Ref: 2969\7f947832
139358 Ref: 2970\7f947832
139359 Ref: 2971\7f947832
139360 Ref: 2972\7f947832
139361 Ref: 2973\7f947832
139362 Ref: 2974\7f947832
139363 Ref: 2975\7f947832
139364 Ref: 2976\7f947832
139365 Ref: 2977\7f947832
139366 Ref: 2978\7f947832
139367 Ref: 2979\7f947832
139368 Ref: 2980\7f947832
139369 Ref: 2981\7f947832
139370 Ref: 2982\7f947832
139371 Ref: 2983\7f948187
139372 Ref: 2984\7f948188
139373 Ref: 2985\7f948188
139374 Ref: 2986\7f948636
139375 Ref: 2987\7f948637
139376 Ref: 2988\7f956231
139377 Ref: 2989\7f957757
139378 Ref: 2990\7f958158
139379 Ref: 2991\7f960479
139380 Ref: 2992\7f965747
139381 Ref: 2993\7f966149
139382 Ref: 2994\7f966960
139383 Ref: 2995\7f966991
139384 Ref: 2996\7f967272
139385 Ref: 2997\7f968818
139386 Ref: 2998\7f973490
139387 Ref: 2999\7f974540
139388 Ref: 3000\7f975394
139389 Ref: 3001\7f976430
139390 Ref: 3002\7f976806
139391 Node: 4.5.3\7f977552
139392 Ref: 3003\7f977736
139393 Ref: 3004\7f977736
139394 Ref: 3005\7f977736
139395 Ref: 3006\7f977736
139396 Ref: 3007\7f977736
139397 Ref: 3008\7f977736
139398 Ref: 3009\7f977736
139399 Ref: 3010\7f977736
139400 Ref: 3011\7f977736
139401 Ref: 3012\7f977736
139402 Ref: 3013\7f978014
139403 Ref: 3014\7f978014
139404 Ref: 3015\7f978014
139405 Ref: 3016\7f978014
139406 Ref: 3017\7f978014
139407 Ref: 3018\7f978014
139408 Ref: 3019\7f978014
139409 Ref: 3020\7f978418
139410 Ref: 3021\7f979469
139411 Ref: 3022\7f979471
139412 Ref: 3023\7f979620
139413 Ref: 3024\7f979987
139414 Ref: 3025\7f980270
139415 Ref: 3026\7f982010
139416 Ref: 3027\7f982753
139417 Node: 4.5.4\7f983089
139418 Ref: 3028\7f983271
139419 Ref: 3029\7f983271
139420 Ref: 3030\7f983271
139421 Ref: 3031\7f983271
139422 Ref: 3032\7f983271
139423 Ref: 3033\7f983271
139424 Ref: 3034\7f983271
139425 Ref: 3035\7f983271
139426 Ref: 3036\7f983271
139427 Ref: 3037\7f983271
139428 Node: 4.5.5\7f983773
139429 Ref: 3038\7f983953
139430 Ref: 3039\7f983953
139431 Ref: 3040\7f983953
139432 Ref: 3041\7f983953
139433 Ref: 3042\7f983953
139434 Ref: 3043\7f983953
139435 Ref: 3044\7f983953
139436 Ref: 3045\7f983953
139437 Ref: 3046\7f983953
139438 Ref: 3047\7f983953
139439 Ref: 3048\7f983953
139440 Ref: 3049\7f983953
139441 Ref: 3050\7f983953
139442 Ref: 3051\7f983953
139443 Ref: 3052\7f983953
139444 Ref: 3053\7f983953
139445 Ref: 3054\7f990755
139446 Ref: 3055\7f990763
139447 Ref: 3056\7f990763
139448 Ref: 3057\7f990763
139449 Ref: 3058\7f993751
139450 Ref: 3059\7f994263
139451 Ref: 3060\7f995147
139452 Node: 4.5.6\7f996445
139453 Ref: 3061\7f996639
139454 Ref: 3062\7f996639
139455 Ref: 3063\7f996639
139456 Ref: 3064\7f996639
139457 Ref: 3065\7f996639
139458 Ref: 3066\7f996827
139459 Ref: 3067\7f996827
139460 Ref: 3068\7f996827
139461 Ref: 3069\7f997705
139462 Ref: 3070\7f997707
139463 Ref: 3071\7f997707
139464 Ref: 3072\7f997952
139465 Ref: 3073\7f997952
139466 Ref: 3074\7f997952
139467 Ref: 3075\7f997952
139468 Ref: 3076\7f998418
139469 Ref: 3077\7f999225
139470 Ref: 3078\7f999621
139471 Ref: 3079\7f999621
139472 Ref: 3080\7f999764
139473 Ref: 3081\7f999935
139474 Node: 4.5.7\7f1000904
139475 Ref: 3082\7f1002495
139476 Ref: S0133\7f1002495
139477 Ref: 3083\7f1002499
139478 Ref: 3084\7f1002516
139479 Ref: 3085\7f1002611
139480 Ref: S0134\7f1002611
139481 Ref: 3086\7f1002628
139482 Ref: 3087\7f1002653
139483 Ref: 3088\7f1002679
139484 Ref: 3089\7f1002704
139485 Ref: 3090\7f1002740
139486 Ref: 3091\7f1002796
139487 Ref: S0135\7f1002796
139488 Ref: 3092\7f1002809
139489 Ref: 3093\7f1002870
139490 Ref: S0136\7f1002870
139491 Ref: 3094\7f1002899
139492 Ref: 3095\7f1002922
139493 Ref: 3096\7f1002962
139494 Ref: 3097\7f1003053
139495 Ref: S0137\7f1003053
139496 Ref: 3098\7f1003072
139497 Ref: 3099\7f1003119
139498 Ref: 3100\7f1006632
139499 Ref: 3101\7f1008064
139500 Ref: 3102\7f1008264
139501 Ref: 3103\7f1008264
139502 Ref: 3104\7f1008266
139503 Ref: 3105\7f1010820
139504 Ref: 3106\7f1011430
139505 Ref: 3107\7f1011430
139506 Ref: 3108\7f1011430
139507 Ref: 3109\7f1011570
139508 Ref: 3110\7f1011662
139509 Node: 4.5.8\7f1011719
139510 Ref: 3111\7f1011935
139511 Ref: S0138\7f1011935
139512 Ref: 3112\7f1011944
139513 Ref: 3113\7f1011955
139514 Ref: 3114\7f1011993
139515 Ref: 3115\7f1012016
139516 Ref: 3116\7f1012027
139517 Ref: 3117\7f1012053
139518 Ref: 3118\7f1012083
139519 Ref: S0139\7f1012083
139520 Ref: 3119\7f1012118
139521 Ref: S0140\7f1012118
139522 Ref: 3120\7f1012131
139523 Ref: 3121\7f1012887
139524 Ref: 3122\7f1013031
139525 Ref: 3123\7f1013496
139526 Ref: 3124\7f1015174
139527 Node: 4.6\7f1015208
139528 Ref: 3125\7f1015639
139529 Ref: 3126\7f1015641
139530 Ref: 3127\7f1015641
139531 Ref: 3128\7f1015641
139532 Ref: 3129\7f1015642
139533 Ref: 3130\7f1015642
139534 Ref: 3131\7f1015707
139535 Ref: S0141\7f1015707
139536 Ref: 3132\7f1015721
139537 Ref: 3133\7f1015734
139538 Ref: 3134\7f1015755
139539 Ref: 3135\7f1015768
139540 Ref: 3136\7f1015777
139541 Ref: 3137\7f1015860
139542 Ref: 3138\7f1015944
139543 Ref: 3139\7f1016004
139544 Ref: 3140\7f1016565
139545 Ref: 3141\7f1016566
139546 Ref: 3142\7f1016776
139547 Ref: 3143\7f1016777
139548 Ref: 3144\7f1016829
139549 Ref: 3145\7f1017659
139550 Ref: 3146\7f1019705
139551 Ref: 3147\7f1019706
139552 Ref: 3148\7f1019955
139553 Ref: 3149\7f1019956
139554 Ref: 3150\7f1022117
139555 Ref: 3151\7f1022118
139556 Ref: 3152\7f1022249
139557 Ref: 3153\7f1022250
139558 Ref: 3154\7f1022575
139559 Ref: 3155\7f1022690
139560 Ref: 3156\7f1022949
139561 Ref: 3157\7f1025399
139562 Ref: 3158\7f1025400
139563 Ref: 3159\7f1026592
139564 Ref: 3160\7f1026936
139565 Ref: 3161\7f1028872
139566 Ref: 3162\7f1029332
139567 Ref: 3163\7f1030082
139568 Ref: 3164\7f1030083
139569 Ref: 3165\7f1030665
139570 Ref: 3166\7f1030666
139571 Ref: 3167\7f1031013
139572 Ref: 3168\7f1031068
139573 Ref: 3169\7f1031203
139574 Ref: 3170\7f1032599
139575 Ref: 3171\7f1032714
139576 Ref: 3172\7f1032714
139577 Ref: 3173\7f1032714
139578 Ref: 3174\7f1032907
139579 Ref: 3175\7f1032909
139580 Ref: 3176\7f1032909
139581 Ref: 3177\7f1033186
139582 Ref: 3178\7f1033186
139583 Ref: 3179\7f1033700
139584 Ref: 3180\7f1035632
139585 Ref: 3181\7f1035632
139586 Ref: 3182\7f1035806
139587 Ref: 3183\7f1035806
139588 Ref: 3184\7f1035847
139589 Ref: 3185\7f1035847
139590 Ref: 3186\7f1036194
139591 Ref: 3187\7f1036194
139592 Ref: 3188\7f1036443
139593 Ref: 3189\7f1037253
139594 Ref: 3190\7f1037255
139595 Ref: 3191\7f1037460
139596 Ref: 3192\7f1037460
139597 Ref: 3193\7f1037810
139598 Ref: 3194\7f1037812
139599 Ref: 3195\7f1038564
139600 Ref: 3196\7f1038565
139601 Ref: 3197\7f1039460
139602 Ref: 3198\7f1039460
139603 Ref: 3199\7f1039783
139604 Ref: 3200\7f1039783
139605 Ref: 3201\7f1039899
139606 Ref: 3202\7f1039899
139607 Ref: 3203\7f1040657
139608 Ref: 3204\7f1040659
139609 Ref: 3205\7f1042075
139610 Ref: 3206\7f1042076
139611 Ref: 3207\7f1042076
139612 Ref: 3208\7f1042076
139613 Ref: 3209\7f1042076
139614 Ref: 3210\7f1042076
139615 Ref: 3211\7f1042076
139616 Ref: 3212\7f1042076
139617 Ref: 3213\7f1042480
139618 Ref: 3214\7f1042480
139619 Ref: 3215\7f1042930
139620 Ref: 3216\7f1043096
139621 Ref: 3217\7f1043097
139622 Ref: 3218\7f1043097
139623 Ref: 3219\7f1043097
139624 Ref: 3220\7f1043097
139625 Ref: 3221\7f1043097
139626 Ref: 3222\7f1044157
139627 Ref: 3223\7f1044627
139628 Ref: 3224\7f1044779
139629 Ref: 3225\7f1044780
139630 Ref: 3226\7f1044780
139631 Ref: 3227\7f1045670
139632 Ref: 3228\7f1046241
139633 Ref: 3229\7f1046246
139634 Ref: 3230\7f1048251
139635 Ref: 3231\7f1048944
139636 Ref: 3232\7f1051312
139637 Ref: 3233\7f1052596
139638 Ref: 3234\7f1055703
139639 Node: 4.7\7f1056584
139640 Ref: 3235\7f1056854
139641 Ref: 3236\7f1056927
139642 Ref: S0142\7f1056927
139643 Ref: 3237\7f1056940
139644 Ref: 3238\7f1056954
139645 Ref: 3239\7f1056968
139646 Ref: 3240\7f1056981
139647 Ref: 3241\7f1057043
139648 Ref: 3242\7f1057633
139649 Ref: 3243\7f1057633
139650 Ref: 3244\7f1057633
139651 Ref: 3245\7f1057633
139652 Ref: 3246\7f1057633
139653 Ref: 3247\7f1057633
139654 Ref: 3248\7f1057633
139655 Ref: 3249\7f1057858
139656 Ref: 3250\7f1057860
139657 Node: 4.8\7f1059662
139658 Ref: 3251\7f1059866
139659 Ref: 3252\7f1059868
139660 Ref: 3253\7f1059868
139661 Ref: 3254\7f1059955
139662 Ref: S0143\7f1059955
139663 Ref: 3255\7f1059973
139664 Ref: 3256\7f1059996
139665 Ref: 3257\7f1060028
139666 Ref: 3258\7f1060051
139667 Ref: 3259\7f1060130
139668 Ref: S0144\7f1060130
139669 Ref: 3260\7f1060151
139670 Ref: 3261\7f1060789
139671 Ref: 3262\7f1061319
139672 Ref: 3263\7f1061746
139673 Ref: 3264\7f1061815
139674 Ref: 3265\7f1062113
139675 Ref: 3266\7f1066507
139676 Ref: 3267\7f1067367
139677 Ref: 3268\7f1068690
139678 Ref: 3269\7f1068801
139679 Ref: 3270\7f1068803
139680 Ref: 3271\7f1068955
139681 Ref: 3272\7f1069035
139682 Ref: 3273\7f1069192
139683 Ref: 3274\7f1069730
139684 Ref: 3275\7f1069732
139685 Ref: 3276\7f1069732
139686 Ref: 3277\7f1069732
139687 Ref: 3278\7f1069821
139688 Ref: 3279\7f1069966
139689 Ref: 3280\7f1070871
139690 Ref: 3281\7f1070871
139691 Ref: 3282\7f1070871
139692 Ref: 3283\7f1072784
139693 Ref: 3284\7f1072784
139694 Ref: 3285\7f1072784
139695 Ref: 3286\7f1073912
139696 Ref: 3287\7f1073912
139697 Ref: 3288\7f1073912
139698 Ref: 3289\7f1074364
139699 Ref: 3290\7f1074364
139700 Ref: 3291\7f1074364
139701 Ref: 3292\7f1074364
139702 Ref: 3293\7f1074364
139703 Ref: 3294\7f1074366
139704 Ref: 3295\7f1075344
139705 Ref: 3296\7f1076115
139706 Ref: 3297\7f1077843
139707 Ref: 3298\7f1078178
139708 Ref: 3299\7f1079027
139709 Ref: 3300\7f1079737
139710 Ref: 3301\7f1080122
139711 Ref: 3302\7f1081985
139712 Ref: 3303\7f1082761
139713 Node: 4.9\7f1083597
139714 Ref: 3304\7f1083951
139715 Ref: 3305\7f1084060
139716 Ref: 3306\7f1084912
139717 Ref: 3307\7f1088216
139718 Ref: 3308\7f1088715
139719 Ref: 3309\7f1089263
139720 Ref: 3310\7f1089912
139721 Ref: 3311\7f1091353
139722 Ref: 3312\7f1091506
139723 Ref: 3313\7f1091839
139724 Ref: 3314\7f1091918
139725 Ref: 3315\7f1092137
139726 Ref: 3316\7f1093711
139727 Ref: 3317\7f1093830
139728 Ref: 3318\7f1093830
139729 Ref: 3319\7f1093830
139730 Ref: 3320\7f1093933
139731 Ref: 3321\7f1094077
139732 Ref: 3322\7f1094361
139733 Ref: 3323\7f1094709
139734 Ref: 3324\7f1098778
139735 Ref: 3325\7f1104866
139736 Ref: 3326\7f1107630
139737 Ref: 3327\7f1109441
139738 Node: 4.9.1\7f1111796
139739 Ref: 3328\7f1112024
139740 Ref: 3329\7f1112648
139741 Ref: 3330\7f1113787
139742 Ref: 3331\7f1114251
139743 Ref: 3332\7f1114440
139744 Ref: 3333\7f1115086
139745 Ref: 3334\7f1116532
139746 Node: 5\7f1117151
139747 Node: 5.1\7f1118721
139748 Ref: 3335\7f1119175
139749 Ref: S0145\7f1119175
139750 Ref: 3336\7f1119179
139751 Ref: 3337\7f1119191
139752 Ref: 3338\7f1119209
139753 Ref: 3339\7f1119233
139754 Ref: S0146\7f1119233
139755 Ref: 3340\7f1119247
139756 Ref: 3341\7f1119254
139757 Ref: 3342\7f1119274
139758 Ref: 3343\7f1119281
139759 Ref: 3344\7f1119355
139760 Ref: S0147\7f1119355
139761 Ref: 3345\7f1119359
139762 Ref: 3346\7f1119385
139763 Ref: 3347\7f1119410
139764 Ref: 3348\7f1119435
139765 Ref: 3349\7f1119454
139766 Ref: 3350\7f1119489
139767 Ref: 3351\7f1119517
139768 Ref: 3352\7f1119548
139769 Ref: 3353\7f1119570
139770 Ref: 3354\7f1119596
139771 Ref: 3355\7f1119616
139772 Ref: 3356\7f1119642
139773 Ref: 3357\7f1119714
139774 Ref: S0148\7f1119714
139775 Ref: 3358\7f1119729
139776 Ref: 3359\7f1119746
139777 Ref: 3360\7f1119771
139778 Ref: 3361\7f1119790
139779 Ref: 3362\7f1119816
139780 Ref: 3363\7f1119852
139781 Ref: 3364\7f1119873
139782 Ref: 3365\7f1119912
139783 Ref: S0149\7f1119912
139784 Ref: 3366\7f1119936
139785 Ref: S0150\7f1119936
139786 Ref: 3367\7f1119949
139787 Ref: 3368\7f1120000
139788 Ref: S0151\7f1120000
139789 Ref: 3369\7f1120004
139790 Ref: 3370\7f1123807
139791 Ref: 3371\7f1123890
139792 Ref: 3372\7f1124381
139793 Ref: 3373\7f1126853
139794 Ref: 3374\7f1127440
139795 Ref: 3375\7f1127624
139796 Node: 5.2\7f1127803
139797 Ref: 3376\7f1128106
139798 Ref: S0152\7f1128106
139799 Ref: 3377\7f1128128
139800 Ref: 3378\7f1128136
139801 Ref: 3379\7f1128300
139802 Ref: 3380\7f1128302
139803 Ref: 3381\7f1128490
139804 Ref: 3382\7f1128492
139805 Ref: 3383\7f1129567
139806 Ref: 3384\7f1129643
139807 Ref: 3385\7f1131416
139808 Ref: 3386\7f1131541
139809 Ref: 3387\7f1131876
139810 Ref: 3388\7f1132145
139811 Ref: 3389\7f1132145
139812 Ref: 3390\7f1132145
139813 Ref: 3391\7f1132486
139814 Ref: 3392\7f1133177
139815 Ref: 3393\7f1133177
139816 Ref: 3394\7f1133724
139817 Ref: 3395\7f1136239
139818 Ref: 3396\7f1137299
139819 Node: 5.3\7f1138395
139820 Ref: 3397\7f1138727
139821 Ref: S0153\7f1138727
139822 Ref: 3398\7f1138744
139823 Ref: 3399\7f1138770
139824 Ref: 3400\7f1138808
139825 Ref: 3401\7f1138834
139826 Ref: 3402\7f1138883
139827 Ref: 3403\7f1139034
139828 Node: 5.4\7f1140307
139829 Ref: 3404\7f1140669
139830 Ref: S0154\7f1140669
139831 Ref: 3405\7f1140697
139832 Ref: 3406\7f1140723
139833 Ref: 3407\7f1140762
139834 Ref: 3408\7f1140842
139835 Ref: S0155\7f1140842
139836 Ref: 3409\7f1140860
139837 Ref: 3410\7f1140895
139838 Ref: 3411\7f1140996
139839 Ref: 3412\7f1140997
139840 Ref: 3413\7f1141061
139841 Ref: 3414\7f1146179
139842 Ref: 3415\7f1146541
139843 Ref: 3416\7f1146541
139844 Ref: 3417\7f1146541
139845 Ref: 3418\7f1147917
139846 Ref: 3419\7f1149025
139847 Node: 5.5\7f1151999
139848 Ref: 3420\7f1152280
139849 Ref: S0156\7f1152280
139850 Ref: 3421\7f1152299
139851 Ref: 3422\7f1152334
139852 Ref: 3423\7f1152371
139853 Ref: 3424\7f1152421
139854 Ref: 3425\7f1152485
139855 Ref: S0157\7f1152485
139856 Ref: 3426\7f1152496
139857 Ref: 3427\7f1152520
139858 Ref: 3428\7f1152563
139859 Ref: 3429\7f1152622
139860 Ref: S0158\7f1152622
139861 Ref: 3430\7f1152635
139862 Ref: 3431\7f1152668
139863 Ref: 3432\7f1152938
139864 Ref: 3433\7f1153081
139865 Ref: 3434\7f1153131
139866 Ref: 3435\7f1153448
139867 Ref: 3436\7f1153849
139868 Ref: 3437\7f1153850
139869 Ref: 3438\7f1154594
139870 Node: 5.5.1\7f1158768
139871 Ref: 3439\7f1159041
139872 Ref: 3440\7f1159246
139873 Ref: 3441\7f1159302
139874 Ref: 3442\7f1159380
139875 Ref: 3443\7f1159488
139876 Ref: 3444\7f1159568
139877 Ref: 3445\7f1159648
139878 Ref: 3446\7f1159933
139879 Ref: 3447\7f1160067
139880 Ref: 3448\7f1160121
139881 Ref: 3449\7f1160195
139882 Ref: 3450\7f1160333
139883 Ref: 3451\7f1161065
139884 Ref: 3452\7f1161138
139885 Ref: 3453\7f1161267
139886 Ref: 3454\7f1161267
139887 Ref: 3455\7f1161267
139888 Ref: 3456\7f1161532
139889 Ref: 3457\7f1161532
139890 Ref: 3458\7f1161532
139891 Ref: 3459\7f1161908
139892 Ref: 3460\7f1162041
139893 Ref: 3461\7f1162115
139894 Ref: 3462\7f1162209
139895 Ref: 3463\7f1163162
139896 Ref: 3464\7f1164304
139897 Ref: 3465\7f1164396
139898 Node: 5.5.2\7f1164457
139899 Ref: 3466\7f1164821
139900 Ref: S0159\7f1164821
139901 Ref: 3467\7f1164835
139902 Ref: 3468\7f1164877
139903 Ref: 3469\7f1164891
139904 Ref: 3470\7f1164914
139905 Ref: 3471\7f1164962
139906 Ref: 3472\7f1165147
139907 Ref: 3473\7f1165147
139908 Ref: 3474\7f1165209
139909 Ref: 3475\7f1165338
139910 Ref: 3476\7f1165451
139911 Ref: 3477\7f1165451
139912 Ref: 3478\7f1165504
139913 Ref: 3479\7f1165504
139914 Ref: 3480\7f1165932
139915 Ref: 3481\7f1165932
139916 Ref: 3482\7f1165968
139917 Ref: 3483\7f1165968
139918 Ref: 3484\7f1166949
139919 Ref: 3485\7f1168481
139920 Ref: 3486\7f1169445
139921 Ref: 3487\7f1169708
139922 Ref: 3488\7f1170626
139923 Ref: 3489\7f1170796
139924 Ref: 3490\7f1170867
139925 Ref: 3491\7f1172660
139926 Node: 5.6\7f1172717
139927 Ref: 3492\7f1172998
139928 Ref: S0160\7f1172998
139929 Ref: 3493\7f1173018
139930 Ref: 3494\7f1173079
139931 Ref: 3495\7f1173133
139932 Ref: 3496\7f1173188
139933 Ref: 3497\7f1173701
139934 Node: 5.7\7f1174763
139935 Ref: 3498\7f1175096
139936 Ref: S0161\7f1175096
139937 Ref: 3499\7f1175120
139938 Ref: 3500\7f1175132
139939 Ref: 3501\7f1175330
139940 Ref: 3502\7f1176117
139941 Node: 5.8\7f1176972
139942 Ref: 3503\7f1177256
139943 Ref: S0162\7f1177256
139944 Ref: 3504\7f1177272
139945 Ref: 3505\7f1177330
139946 Ref: 3506\7f1178067
139947 Node: 6\7f1178943
139948 Ref: 3507\7f1179037
139949 Ref: 3508\7f1179037
139950 Ref: 3509\7f1179037
139951 Ref: 3510\7f1180307
139952 Ref: 3511\7f1180367
139953 Ref: 3512\7f1180450
139954 Node: 6.1\7f1181162
139955 Ref: 3513\7f1181469
139956 Ref: S0163\7f1181469
139957 Ref: 3514\7f1181484
139958 Ref: 3515\7f1181515
139959 Ref: 3516\7f1181554
139960 Ref: 3517\7f1181706
139961 Ref: S0164\7f1181706
139962 Ref: 3518\7f1181720
139963 Ref: 3519\7f1181753
139964 Ref: 3520\7f1181840
139965 Ref: S0165\7f1181840
139966 Ref: 3521\7f1181855
139967 Ref: 3522\7f1181888
139968 Ref: 3523\7f1181969
139969 Ref: S0166\7f1181969
139970 Ref: 3524\7f1181983
139971 Ref: 3525\7f1182009
139972 Ref: 3526\7f1182056
139973 Ref: S0167\7f1182056
139974 Ref: 3527\7f1182062
139975 Ref: 3528\7f1182082
139976 Ref: 3529\7f1182095
139977 Ref: 3530\7f1182138
139978 Ref: S0168\7f1182138
139979 Ref: 3531\7f1182142
139980 Ref: 3532\7f1182172
139981 Ref: 3533\7f1182237
139982 Ref: S0169\7f1182237
139983 Ref: 3534\7f1182243
139984 Ref: 3535\7f1182263
139985 Ref: 3536\7f1182413
139986 Ref: S0170\7f1182413
139987 Ref: 3537\7f1182417
139988 Ref: 3538\7f1183241
139989 Ref: S0171\7f1183241
139990 Ref: 3539\7f1183245
139991 Ref: 3540\7f1183288
139992 Ref: S0172\7f1183288
139993 Ref: 3541\7f1183294
139994 Ref: 3542\7f1183409
139995 Ref: S0173\7f1183409
139996 Ref: 3543\7f1183424
139997 Ref: 3544\7f1183445
139998 Ref: 3545\7f1183461
139999 Ref: 3546\7f1183484
140000 Ref: 3547\7f1183504
140001 Ref: 3548\7f1183542
140002 Ref: S0174\7f1183542
140003 Ref: 3549\7f1183556
140004 Ref: 3550\7f1183583
140005 Ref: 3551\7f1183702
140006 Ref: S0175\7f1183702
140007 Ref: 3552\7f1183716
140008 Ref: 3553\7f1183753
140009 Ref: 3554\7f1183759
140010 Ref: 3555\7f1183775
140011 Ref: 3556\7f1183798
140012 Ref: 3557\7f1183827
140013 Ref: 3558\7f1183854
140014 Ref: 3559\7f1183876
140015 Ref: 3560\7f1183915
140016 Ref: S0176\7f1183915
140017 Ref: 3561\7f1183993
140018 Ref: 3562\7f1184186
140019 Ref: 3563\7f1184298
140020 Ref: 3564\7f1184376
140021 Ref: 3565\7f1184859
140022 Ref: 3566\7f1184860
140023 Ref: 3567\7f1186512
140024 Ref: 3568\7f1187201
140025 Ref: 3569\7f1187586
140026 Ref: 3570\7f1187621
140027 Ref: 3571\7f1187622
140028 Ref: 3572\7f1187834
140029 Ref: 3573\7f1187914
140030 Ref: 3574\7f1188528
140031 Ref: 3575\7f1189483
140032 Ref: 3576\7f1190454
140033 Ref: 3577\7f1192229
140034 Ref: 3578\7f1193434
140035 Ref: 3579\7f1194866
140036 Node: 6.1.1\7f1195537
140037 Ref: 3580\7f1196056
140038 Ref: 3581\7f1196056
140039 Ref: 3582\7f1196219
140040 Ref: 3583\7f1196219
140041 Ref: 3584\7f1197035
140042 Ref: 3585\7f1197035
140043 Ref: 3586\7f1197264
140044 Ref: 3587\7f1197264
140045 Ref: 3588\7f1198265
140046 Ref: 3589\7f1198265
140047 Ref: 3590\7f1198429
140048 Ref: 3591\7f1198429
140049 Ref: 3592\7f1198837
140050 Ref: 3593\7f1198837
140051 Ref: 3594\7f1198988
140052 Ref: 3595\7f1198988
140053 Ref: 3596\7f1199259
140054 Ref: 3597\7f1199259
140055 Ref: 3598\7f1201442
140056 Ref: 3599\7f1205605
140057 Ref: 3600\7f1205605
140058 Ref: 3601\7f1205997
140059 Ref: 3602\7f1206409
140060 Ref: 3603\7f1206424
140061 Ref: 3604\7f1207117
140062 Ref: 3605\7f1212584
140063 Ref: 3606\7f1212599
140064 Ref: 3607\7f1214091
140065 Ref: 3608\7f1214091
140066 Ref: 3609\7f1214091
140067 Ref: 3610\7f1214390
140068 Ref: 3611\7f1214390
140069 Ref: 3612\7f1214390
140070 Ref: 3613\7f1215588
140071 Ref: 3614\7f1215588
140072 Ref: 3615\7f1216933
140073 Ref: 3616\7f1216933
140074 Ref: 3617\7f1216933
140075 Ref: 3618\7f1216933
140076 Ref: 3619\7f1216933
140077 Ref: 3620\7f1222850
140078 Node: 6.2\7f1222882
140079 Ref: 3621\7f1223139
140080 Ref: 3622\7f1223139
140081 Ref: 3623\7f1223139
140082 Ref: 3624\7f1223139
140083 Ref: 3625\7f1223139
140084 Ref: 3626\7f1223139
140085 Ref: 3627\7f1223677
140086 Ref: 3628\7f1223914
140087 Ref: 3629\7f1224484
140088 Ref: 3630\7f1226477
140089 Ref: 3631\7f1226714
140090 Ref: 3632\7f1227069
140091 Ref: 3633\7f1227806
140092 Ref: 3634\7f1227807
140093 Ref: 3635\7f1227807
140094 Ref: 3636\7f1227807
140095 Ref: 3637\7f1228477
140096 Ref: 3638\7f1233738
140097 Node: 6.3\7f1234740
140098 Ref: 3639\7f1235040
140099 Ref: S0177\7f1235040
140100 Ref: 3640\7f1235055
140101 Ref: 3641\7f1235086
140102 Ref: 3642\7f1235124
140103 Ref: 3643\7f1235161
140104 Ref: 3644\7f1235206
140105 Ref: 3645\7f1235251
140106 Ref: 3646\7f1235838
140107 Ref: 3647\7f1236091
140108 Ref: 3648\7f1236561
140109 Ref: 3649\7f1237464
140110 Ref: 3650\7f1238337
140111 Node: 6.3.1\7f1238552
140112 Ref: 3651\7f1238664
140113 Ref: 3652\7f1238664
140114 Ref: 3653\7f1238664
140115 Ref: 3654\7f1238664
140116 Ref: 3655\7f1238664
140117 Ref: 3656\7f1238953
140118 Ref: 3657\7f1238954
140119 Ref: 3658\7f1239357
140120 Ref: 3659\7f1239358
140121 Ref: 3660\7f1239659
140122 Ref: 3661\7f1239659
140123 Ref: 3662\7f1244024
140124 Ref: 3663\7f1244024
140125 Ref: 3664\7f1244204
140126 Ref: 3665\7f1244204
140127 Ref: 3666\7f1245869
140128 Ref: 3667\7f1245870
140129 Ref: 3668\7f1246192
140130 Ref: 3669\7f1246964
140131 Ref: 3670\7f1246965
140132 Ref: 3671\7f1247507
140133 Ref: 3672\7f1247540
140134 Ref: 3673\7f1247541
140135 Ref: 3674\7f1247808
140136 Ref: 3675\7f1247840
140137 Ref: 3676\7f1247897
140138 Ref: 3677\7f1247898
140139 Ref: 3678\7f1249458
140140 Ref: 3679\7f1252087
140141 Ref: 3680\7f1252342
140142 Ref: 3681\7f1252349
140143 Ref: 3682\7f1253200
140144 Ref: 3683\7f1254318
140145 Ref: 3684\7f1255932
140146 Node: 6.3.2\7f1257824
140147 Ref: 3685\7f1258700
140148 Ref: 3686\7f1258700
140149 Ref: 3687\7f1260520
140150 Node: 6.4\7f1260588
140151 Ref: 3688\7f1260700
140152 Ref: 3689\7f1261011
140153 Ref: S0178\7f1261011
140154 Ref: 3690\7f1261035
140155 Ref: 3691\7f1261060
140156 Ref: 3692\7f1261067
140157 Ref: 3693\7f1261111
140158 Ref: S0179\7f1261111
140159 Ref: 3694\7f1261134
140160 Ref: 3695\7f1261157
140161 Ref: 3696\7f1261164
140162 Ref: 3697\7f1261398
140163 Ref: S0180\7f1261398
140164 Ref: 3698\7f1261413
140165 Ref: 3699\7f1261438
140166 Ref: 3700\7f1261491
140167 Ref: S0181\7f1261491
140168 Ref: 3701\7f1261522
140169 Ref: 3702\7f1261540
140170 Ref: 3703\7f1261599
140171 Ref: S0182\7f1261599
140172 Ref: 3704\7f1261603
140173 Ref: 3705\7f1261626
140174 Ref: 3706\7f1261634
140175 Ref: 3707\7f1261639
140176 Ref: 3708\7f1263678
140177 Ref: 3709\7f1264330
140178 Ref: 3710\7f1266387
140179 Ref: 3711\7f1267141
140180 Ref: 3712\7f1267143
140181 Ref: 3713\7f1270032
140182 Node: 6.4.1\7f1271055
140183 Ref: 3714\7f1271164
140184 Ref: 3715\7f1272453
140185 Ref: 3716\7f1272454
140186 Ref: 3717\7f1272454
140187 Ref: 3718\7f1272454
140188 Ref: 3719\7f1272872
140189 Ref: 3720\7f1273098
140190 Ref: 3721\7f1277635
140191 Ref: 3722\7f1283322
140192 Ref: 3723\7f1288117
140193 Ref: 3724\7f1288584
140194 Ref: 3725\7f1288709
140195 Ref: 3726\7f1288961
140196 Ref: 3727\7f1293037
140197 Ref: 3728\7f1293037
140198 Ref: 3729\7f1293186
140199 Ref: 3730\7f1293186
140200 Ref: 3731\7f1293186
140201 Ref: 3732\7f1293186
140202 Ref: 3733\7f1293186
140203 Ref: 3734\7f1293423
140204 Ref: 3735\7f1293487
140205 Ref: 3736\7f1294696
140206 Ref: 3737\7f1295087
140207 Ref: 3738\7f1295724
140208 Ref: 3739\7f1296276
140209 Node: 6.5\7f1298648
140210 Ref: 3740\7f1298928
140211 Ref: 3741\7f1299208
140212 Ref: S0183\7f1299208
140213 Ref: S0184\7f1299208
140214 Ref: 3742\7f1299221
140215 Ref: 3743\7f1299311
140216 Ref: S0185\7f1299311
140217 Ref: 3744\7f1299325
140218 Ref: 3745\7f1299367
140219 Ref: 3746\7f1299403
140220 Ref: 3747\7f1299591
140221 Ref: S0186\7f1299591
140222 Ref: 3748\7f1299612
140223 Ref: 3749\7f1299664
140224 Ref: 3750\7f1299783
140225 Ref: S0187\7f1299783
140226 Ref: 3751\7f1299787
140227 Ref: 3752\7f1299814
140228 Ref: 3753\7f1299914
140229 Ref: 3754\7f1300091
140230 Ref: 3755\7f1300237
140231 Ref: 3756\7f1300516
140232 Ref: 3757\7f1302899
140233 Ref: 3758\7f1306227
140234 Ref: 3759\7f1306704
140235 Ref: 3760\7f1307005
140236 Ref: 3761\7f1307328
140237 Ref: 3762\7f1307328
140238 Ref: 3763\7f1307470
140239 Ref: 3764\7f1307470
140240 Ref: 3765\7f1307472
140241 Ref: 3766\7f1308768
140242 Ref: 3767\7f1308966
140243 Ref: 3768\7f1308968
140244 Ref: 3769\7f1310536
140245 Ref: 3770\7f1310536
140246 Ref: 3771\7f1310538
140247 Ref: 3772\7f1312200
140248 Ref: 3773\7f1312201
140249 Ref: 3774\7f1312427
140250 Ref: 3775\7f1313569
140251 Ref: 3776\7f1313571
140252 Ref: 3777\7f1313571
140253 Ref: 3778\7f1324150
140254 Ref: 3779\7f1326174
140255 Ref: 3780\7f1327025
140256 Ref: 3781\7f1328168
140257 Ref: 3782\7f1329703
140258 Ref: 3783\7f1331800
140259 Ref: 3784\7f1333271
140260 Node: 6.5.1\7f1334549
140261 Ref: 3785\7f1334941
140262 Ref: 3786\7f1335453
140263 Ref: 3787\7f1335453
140264 Ref: 3788\7f1335453
140265 Ref: 3789\7f1336892
140266 Ref: 3790\7f1337756
140267 Ref: 3791\7f1339621
140268 Ref: 3792\7f1339748
140269 Node: 6.6\7f1339822
140270 Ref: 3793\7f1339950
140271 Ref: 3794\7f1339950
140272 Ref: 3795\7f1339950
140273 Ref: 3796\7f1342533
140274 Ref: 3797\7f1342868
140275 Ref: 3798\7f1343440
140276 Node: 6.7\7f1344290
140277 Ref: 3799\7f1344660
140278 Ref: S0188\7f1344660
140279 Ref: 3800\7f1344674
140280 Ref: 3801\7f1344704
140281 Ref: 3802\7f1344749
140282 Ref: 3803\7f1345109
140283 Ref: 3804\7f1345295
140284 Ref: 3805\7f1345295
140285 Ref: 3806\7f1346259
140286 Ref: 3807\7f1346766
140287 Ref: 3808\7f1346882
140288 Node: 6.8\7f1347126
140289 Ref: 3809\7f1347496
140290 Ref: S0189\7f1347496
140291 Ref: 3810\7f1347510
140292 Ref: 3811\7f1347540
140293 Ref: 3812\7f1347579
140294 Ref: 3813\7f1347604
140295 Ref: 3814\7f1347854
140296 Ref: 3815\7f1348242
140297 Ref: 3816\7f1349466
140298 Ref: 3817\7f1349466
140299 Ref: 3818\7f1350283
140300 Ref: 3819\7f1350751
140301 Node: 7\7f1350805
140302 Ref: 3820\7f1350894
140303 Ref: 3821\7f1351264
140304 Ref: 3822\7f1351266
140305 Ref: 3823\7f1351266
140306 Ref: 3824\7f1351266
140307 Node: 7.1\7f1351516
140308 Ref: 3825\7f1351908
140309 Ref: S0190\7f1351908
140310 Ref: 3826\7f1351912
140311 Ref: 3827\7f1351992
140312 Ref: S0191\7f1351992
140313 Ref: 3828\7f1352014
140314 Ref: 3829\7f1352055
140315 Ref: 3830\7f1352092
140316 Ref: 3831\7f1352145
140317 Ref: 3832\7f1352185
140318 Ref: 3833\7f1352203
140319 Ref: 3834\7f1352490
140320 Ref: 3835\7f1352491
140321 Ref: 3836\7f1353073
140322 Ref: 3837\7f1353236
140323 Ref: 3838\7f1353589
140324 Ref: 3839\7f1354679
140325 Ref: 3840\7f1356433
140326 Ref: 3841\7f1357918
140327 Node: 7.2\7f1358051
140328 Ref: 3842\7f1358629
140329 Ref: S0192\7f1358629
140330 Ref: 3843\7f1358656
140331 Ref: 3844\7f1358697
140332 Ref: 3845\7f1358734
140333 Ref: 3846\7f1358779
140334 Ref: 3847\7f1358826
140335 Ref: 3848\7f1358844
140336 Ref: 3849\7f1360589
140337 Ref: 3850\7f1361504
140338 Ref: 3851\7f1364551
140339 Node: 7.3\7f1364675
140340 Ref: 3852\7f1365229
140341 Ref: 3853\7f1365231
140342 Ref: 3854\7f1365231
140343 Ref: 3855\7f1365231
140344 Ref: 3856\7f1365231
140345 Ref: 3857\7f1365918
140346 Ref: S0193\7f1365918
140347 Ref: 3858\7f1365936
140348 Ref: 3859\7f1365957
140349 Ref: 3860\7f1366035
140350 Ref: 3861\7f1366219
140351 Ref: S0194\7f1366219
140352 Ref: 3862\7f1366237
140353 Ref: 3863\7f1366258
140354 Ref: 3864\7f1366339
140355 Ref: 3865\7f1366379
140356 Ref: 3866\7f1366421
140357 Ref: 3867\7f1366492
140358 Ref: 3868\7f1366492
140359 Ref: 3869\7f1379322
140360 Ref: 3870\7f1379809
140361 Ref: 3871\7f1380547
140362 Ref: 3872\7f1383628
140363 Ref: 3873\7f1385307
140364 Ref: 3874\7f1385380
140365 Ref: 3875\7f1385524
140366 Ref: 3876\7f1385680
140367 Ref: 3877\7f1387599
140368 Ref: 3878\7f1387678
140369 Ref: 3879\7f1388446
140370 Ref: 3880\7f1392130
140371 Ref: 3881\7f1394007
140372 Ref: 3882\7f1394821
140373 Node: 7.3.1\7f1395382
140374 Ref: 3883\7f1395692
140375 Ref: 3884\7f1398398
140376 Ref: 3885\7f1398399
140377 Ref: 3886\7f1398399
140378 Ref: 3887\7f1398857
140379 Ref: 3888\7f1400042
140380 Ref: 3889\7f1408266
140381 Ref: 3890\7f1408281
140382 Node: 7.3.2\7f1413568
140383 Ref: 3891\7f1414031
140384 Ref: 3892\7f1414367
140385 Ref: 3893\7f1414367
140386 Ref: 3894\7f1414844
140387 Ref: 3895\7f1414844
140388 Ref: 3896\7f1415609
140389 Ref: 3897\7f1417021
140390 Ref: 3898\7f1417021
140391 Ref: 3899\7f1420306
140392 Ref: 3900\7f1420941
140393 Ref: 3901\7f1424244
140394 Node: 7.4\7f1424288
140395 Ref: 3902\7f1424764
140396 Ref: 3903\7f1424888
140397 Ref: 3904\7f1424977
140398 Ref: 3905\7f1425225
140399 Ref: 3906\7f1428176
140400 Ref: 3907\7f1430505
140401 Ref: 3908\7f1433429
140402 Node: 7.5\7f1433954
140403 Ref: 3909\7f1439057
140404 Ref: 3910\7f1441752
140405 Ref: 3911\7f1441945
140406 Ref: 3912\7f1441945
140407 Ref: 3913\7f1444627
140408 Ref: 3914\7f1444627
140409 Ref: 3915\7f1444627
140410 Ref: 3916\7f1447765
140411 Ref: 3917\7f1448367
140412 Node: 7.6\7f1450797
140413 Ref: 3918\7f1450920
140414 Ref: 3919\7f1450920
140415 Ref: 3920\7f1451490
140416 Ref: 3921\7f1451492
140417 Ref: 3922\7f1451492
140418 Ref: 3923\7f1451588
140419 Ref: 3924\7f1451672
140420 Ref: 3925\7f1451674
140421 Ref: 3926\7f1451674
140422 Ref: 3927\7f1453691
140423 Ref: 3928\7f1453776
140424 Ref: 3929\7f1453926
140425 Ref: 3930\7f1453994
140426 Ref: 3931\7f1454062
140427 Ref: 3932\7f1454159
140428 Ref: 3933\7f1454333
140429 Ref: 3934\7f1454409
140430 Ref: 3935\7f1454585
140431 Ref: 3936\7f1456978
140432 Ref: 3937\7f1456978
140433 Ref: 3938\7f1460145
140434 Ref: 3939\7f1461336
140435 Ref: 3940\7f1461583
140436 Ref: 3941\7f1461583
140437 Ref: 3942\7f1461784
140438 Ref: 3943\7f1461785
140439 Ref: 3944\7f1461980
140440 Ref: 3945\7f1463036
140441 Ref: 3946\7f1465742
140442 Ref: 3947\7f1465742
140443 Ref: 3948\7f1470328
140444 Ref: 3949\7f1470693
140445 Ref: 3950\7f1471025
140446 Ref: 3951\7f1479919
140447 Ref: 3952\7f1480173
140448 Ref: 3953\7f1482371
140449 Node: 7.6.1\7f1484034
140450 Ref: 3954\7f1484498
140451 Ref: 3955\7f1484500
140452 Ref: 3956\7f1484582
140453 Ref: 3957\7f1484583
140454 Ref: 3958\7f1484757
140455 Ref: 3959\7f1484759
140456 Ref: 3960\7f1484759
140457 Ref: 3961\7f1484759
140458 Ref: 3962\7f1485349
140459 Ref: 3963\7f1485350
140460 Ref: 3964\7f1485521
140461 Ref: 3965\7f1487572
140462 Ref: 3966\7f1490101
140463 Ref: 3967\7f1491262
140464 Ref: 3968\7f1492878
140465 Ref: 3969\7f1493601
140466 Ref: 3970\7f1493601
140467 Ref: 3971\7f1493603
140468 Ref: 3972\7f1495007
140469 Ref: 3973\7f1495356
140470 Ref: 3974\7f1498254
140471 Ref: 3975\7f1502962
140472 Ref: 3976\7f1503857
140473 Ref: 3977\7f1504399
140474 Ref: 3978\7f1506259
140475 Ref: 3979\7f1506970
140476 Ref: 3980\7f1507545
140477 Ref: 3981\7f1511659
140478 Ref: 3982\7f1512908
140479 Ref: 3983\7f1516907
140480 Ref: 3984\7f1521078
140481 Ref: 3985\7f1521088
140482 Ref: 3986\7f1522701
140483 Ref: 3987\7f1525111
140484 Node: 8\7f1526811
140485 Node: 8.1\7f1529142
140486 Ref: 3988\7f1529292
140487 Ref: 3989\7f1531354
140488 Ref: 3990\7f1531354
140489 Ref: 3991\7f1531354
140490 Ref: 3992\7f1531354
140491 Ref: 3993\7f1531354
140492 Ref: 3994\7f1531796
140493 Ref: 3995\7f1532533
140494 Node: 8.2\7f1538228
140495 Ref: 3996\7f1538814
140496 Ref: 3997\7f1541368
140497 Ref: 3998\7f1542419
140498 Ref: 3999\7f1542561
140499 Ref: 4000\7f1542920
140500 Ref: 4001\7f1542992
140501 Ref: 4002\7f1543197
140502 Ref: 4003\7f1544583
140503 Ref: 4004\7f1545647
140504 Ref: 4005\7f1545895
140505 Ref: 4006\7f1545900
140506 Ref: 4007\7f1546015
140507 Ref: 4008\7f1549529
140508 Node: 8.3\7f1552571
140509 Ref: 4009\7f1552672
140510 Ref: 4010\7f1552924
140511 Ref: 4011\7f1552924
140512 Ref: 4012\7f1552924
140513 Ref: 4013\7f1553232
140514 Ref: 4014\7f1553640
140515 Ref: 4015\7f1553640
140516 Ref: 4016\7f1553722
140517 Ref: 4017\7f1553846
140518 Ref: 4018\7f1553977
140519 Ref: 4019\7f1554095
140520 Ref: 4020\7f1554206
140521 Ref: 4021\7f1554333
140522 Ref: 4022\7f1554874
140523 Ref: 4023\7f1555580
140524 Ref: 4024\7f1555715
140525 Ref: 4025\7f1556195
140526 Ref: 4026\7f1556227
140527 Ref: 4027\7f1560050
140528 Ref: 4028\7f1563810
140529 Ref: 4029\7f1563815
140530 Ref: 4030\7f1563815
140531 Ref: 4031\7f1563920
140532 Ref: 4032\7f1564343
140533 Ref: 4033\7f1566050
140534 Ref: 4034\7f1567075
140535 Ref: 4035\7f1568715
140536 Ref: 4036\7f1568715
140537 Ref: 4037\7f1568715
140538 Ref: 4038\7f1568715
140539 Ref: 4039\7f1568864
140540 Ref: 4040\7f1568931
140541 Ref: 4041\7f1569119
140542 Ref: 4042\7f1569300
140543 Ref: 4043\7f1569358
140544 Ref: 4044\7f1569452
140545 Ref: 4045\7f1569572
140546 Ref: 4046\7f1571406
140547 Ref: 4047\7f1571752
140548 Ref: 4048\7f1582475
140549 Ref: 4049\7f1583229
140550 Node: 8.3.1\7f1586398
140551 Ref: 4050\7f1586762
140552 Ref: S0195\7f1586762
140553 Ref: 4051\7f1588172
140554 Ref: 4052\7f1591142
140555 Node: 8.4\7f1591523
140556 Ref: 4053\7f1591876
140557 Ref: 4054\7f1592256
140558 Ref: 4055\7f1592636
140559 Ref: S0196\7f1592636
140560 Ref: 4056\7f1592640
140561 Ref: 4057\7f1592662
140562 Ref: 4058\7f1592704
140563 Ref: S0197\7f1592704
140564 Ref: 4059\7f1592721
140565 Ref: 4060\7f1592737
140566 Ref: 4061\7f1592794
140567 Ref: S0198\7f1592794
140568 Ref: 4062\7f1592814
140569 Ref: 4063\7f1592836
140570 Ref: 4064\7f1593123
140571 Ref: 4065\7f1595002
140572 Ref: 4066\7f1595061
140573 Ref: 4067\7f1597576
140574 Ref: 4068\7f1597576
140575 Ref: 4069\7f1598578
140576 Ref: 4070\7f1600759
140577 Ref: 4071\7f1601528
140578 Node: 8.5\7f1601904
140579 Ref: 4072\7f1602521
140580 Ref: S0199\7f1602521
140581 Ref: 4073\7f1602537
140582 Ref: 4074\7f1602576
140583 Ref: 4075\7f1602618
140584 Ref: 4076\7f1602658
140585 Ref: 4077\7f1602701
140586 Ref: 4078\7f1602780
140587 Ref: 4079\7f1602943
140588 Ref: 4080\7f1602944
140589 Node: 8.5.1\7f1605000
140590 Ref: 4081\7f1605362
140591 Ref: S0200\7f1605362
140592 Ref: 4082\7f1605376
140593 Ref: 4083\7f1605399
140594 Ref: 4084\7f1605415
140595 Ref: 4085\7f1605449
140596 Ref: 4086\7f1605468
140597 Ref: 4087\7f1605500
140598 Ref: 4088\7f1605522
140599 Ref: 4089\7f1605555
140600 Ref: 4090\7f1605574
140601 Ref: 4091\7f1607665
140602 Ref: 4092\7f1607798
140603 Ref: 4093\7f1608344
140604 Ref: 4094\7f1610115
140605 Ref: 4095\7f1614141
140606 Ref: 4096\7f1615304
140607 Ref: 4097\7f1616261
140608 Ref: 4098\7f1616996
140609 Node: 8.5.2\7f1617136
140610 Ref: 4099\7f1617464
140611 Ref: S0201\7f1617464
140612 Ref: 4100\7f1617468
140613 Ref: 4101\7f1617524
140614 Ref: 4102\7f1617538
140615 Ref: 4103\7f1618032
140616 Node: 8.5.3\7f1618175
140617 Ref: 4104\7f1618491
140618 Ref: S0202\7f1618491
140619 Ref: 4105\7f1618504
140620 Ref: 4106\7f1618553
140621 Ref: 4107\7f1618567
140622 Ref: 4108\7f1620462
140623 Node: 8.5.4\7f1620602
140624 Ref: 4109\7f1620875
140625 Ref: 4110\7f1620933
140626 Ref: 4111\7f1621391
140627 Ref: S0203\7f1621391
140628 Ref: 4112\7f1621406
140629 Ref: 4113\7f1621437
140630 Ref: 4114\7f1621486
140631 Ref: 4115\7f1621505
140632 Ref: 4116\7f1621580
140633 Ref: 4117\7f1621867
140634 Ref: 4118\7f1622559
140635 Ref: 4119\7f1623311
140636 Ref: 4120\7f1623445
140637 Ref: 4121\7f1623728
140638 Ref: 4122\7f1631234
140639 Ref: 4123\7f1631342
140640 Ref: 4124\7f1631343
140641 Ref: 4125\7f1635309
140642 Ref: 4126\7f1636462
140643 Ref: 4127\7f1637196
140644 Node: 8.5.5\7f1637339
140645 Ref: 4128\7f1637646
140646 Ref: S0204\7f1637646
140647 Ref: 4129\7f1637678
140648 Ref: 4130\7f1637735
140649 Ref: 4131\7f1637754
140650 Ref: 4132\7f1637806
140651 Ref: 4133\7f1637865
140652 Ref: 4134\7f1637884
140653 Ref: 4135\7f1637935
140654 Ref: 4136\7f1637993
140655 Ref: 4137\7f1638012
140656 Ref: 4138\7f1638893
140657 Ref: 4139\7f1639667
140658 Node: 8.6\7f1639807
140659 Ref: 4140\7f1639971
140660 Ref: 4141\7f1640248
140661 Ref: 4142\7f1640851
140662 Ref: 4143\7f1641500
140663 Ref: 4144\7f1642261
140664 Ref: 4145\7f1642261
140665 Ref: 4146\7f1644640
140666 Ref: 4147\7f1644726
140667 Ref: 4148\7f1644728
140668 Ref: 4149\7f1644728
140669 Ref: 4150\7f1645498
140670 Ref: 4151\7f1645801
140671 Ref: 4152\7f1646259
140672 Ref: 4153\7f1647990
140673 Ref: 4154\7f1648910
140674 Ref: 4155\7f1649108
140675 Ref: 4156\7f1649683
140676 Ref: 4157\7f1649683
140677 Ref: 4158\7f1650417
140678 Ref: 4159\7f1650572
140679 Ref: 4160\7f1652445
140680 Ref: 4161\7f1652584
140681 Ref: 4162\7f1652715
140682 Ref: 4163\7f1653178
140683 Ref: 4164\7f1655155
140684 Ref: 4165\7f1655155
140685 Ref: 4166\7f1656985
140686 Ref: 4167\7f1658231
140687 Ref: 4168\7f1658845
140688 Ref: 4169\7f1659247
140689 Ref: 4170\7f1661959
140690 Ref: 4171\7f1661969
140691 Ref: 4172\7f1662236
140692 Ref: 4173\7f1666749
140693 Ref: 4174\7f1667805
140694 Ref: 4175\7f1668764
140695 Ref: 4176\7f1670031
140696 Ref: 4177\7f1670775
140697 Node: 9\7f1671329
140698 Ref: 4178\7f1671478
140699 Ref: 4179\7f1671558
140700 Ref: 4180\7f1671560
140701 Ref: 4181\7f1671792
140702 Ref: 4182\7f1671793
140703 Ref: 4183\7f1671793
140704 Ref: 4184\7f1671793
140705 Ref: 4185\7f1672113
140706 Ref: 4186\7f1673274
140707 Ref: 4187\7f1673518
140708 Ref: 4188\7f1673520
140709 Ref: 4189\7f1673520
140710 Ref: 4190\7f1673520
140711 Ref: 4191\7f1673520
140712 Ref: 4192\7f1673520
140713 Ref: 4193\7f1673520
140714 Ref: 4194\7f1673520
140715 Ref: 4195\7f1673668
140716 Ref: 4196\7f1673816
140717 Ref: 4197\7f1673817
140718 Node: 9.1\7f1675593
140719 Ref: 4198\7f1675715
140720 Ref: 4199\7f1676183
140721 Ref: S0205\7f1676183
140722 Ref: 4200\7f1676206
140723 Ref: 4201\7f1676227
140724 Ref: 4202\7f1676266
140725 Ref: 4203\7f1676307
140726 Ref: 4204\7f1676338
140727 Ref: 4205\7f1676448
140728 Ref: S0206\7f1676448
140729 Ref: 4206\7f1676466
140730 Ref: 4207\7f1676501
140731 Ref: 4208\7f1676541
140732 Ref: 4209\7f1676572
140733 Ref: 4210\7f1676613
140734 Ref: S0207\7f1676613
140735 Ref: 4211\7f1676629
140736 Ref: 4212\7f1676668
140737 Ref: 4213\7f1676697
140738 Ref: 4214\7f1676778
140739 Ref: S0208\7f1676778
140740 Ref: 4215\7f1676782
140741 Ref: 4216\7f1676808
140742 Ref: 4217\7f1676866
140743 Ref: S0209\7f1676866
140744 Ref: 4218\7f1676889
140745 Ref: 4219\7f1676923
140746 Ref: 4220\7f1676958
140747 Ref: 4221\7f1676999
140748 Ref: 4222\7f1677048
140749 Ref: 4223\7f1677370
140750 Ref: 4224\7f1677561
140751 Ref: 4225\7f1678896
140752 Ref: 4226\7f1678897
140753 Ref: 4227\7f1678897
140754 Ref: 4228\7f1679741
140755 Ref: 4229\7f1681139
140756 Ref: 4230\7f1682267
140757 Ref: 4231\7f1682525
140758 Ref: 4232\7f1682959
140759 Ref: 4233\7f1683429
140760 Ref: 4234\7f1683499
140761 Ref: 4235\7f1683780
140762 Ref: 4236\7f1683998
140763 Ref: 4237\7f1684904
140764 Ref: 4238\7f1688383
140765 Ref: 4239\7f1689502
140766 Ref: 4240\7f1690779
140767 Node: 9.2\7f1691343
140768 Ref: 4241\7f1691534
140769 Ref: 4242\7f1691636
140770 Ref: 4243\7f1691638
140771 Ref: 4244\7f1691638
140772 Ref: 4245\7f1691638
140773 Ref: 4246\7f1691783
140774 Ref: 4247\7f1694975
140775 Ref: 4248\7f1694975
140776 Ref: 4249\7f1695132
140777 Node: 9.3\7f1699330
140778 Ref: 4250\7f1699533
140779 Ref: 4251\7f1699533
140780 Ref: 4252\7f1699533
140781 Ref: 4253\7f1699533
140782 Ref: 4254\7f1700716
140783 Ref: 4255\7f1701428
140784 Node: 9.4\7f1705849
140785 Ref: 4256\7f1706003
140786 Ref: 4257\7f1706003
140787 Ref: 4258\7f1706003
140788 Ref: 4259\7f1706003
140789 Ref: 4260\7f1706173
140790 Ref: 4261\7f1706175
140791 Ref: 4262\7f1706175
140792 Ref: 4263\7f1706556
140793 Ref: 4264\7f1706695
140794 Ref: S0210\7f1706695
140795 Ref: 4265\7f1706722
140796 Ref: 4266\7f1706743
140797 Ref: 4267\7f1706782
140798 Ref: 4268\7f1706822
140799 Ref: 4269\7f1706853
140800 Ref: 4270\7f1706972
140801 Ref: S0211\7f1706972
140802 Ref: 4271\7f1706994
140803 Ref: 4272\7f1707028
140804 Ref: 4273\7f1707068
140805 Ref: 4274\7f1707099
140806 Ref: 4275\7f1707149
140807 Ref: S0212\7f1707149
140808 Ref: 4276\7f1707165
140809 Ref: 4277\7f1707225
140810 Ref: 4278\7f1707281
140811 Ref: 4279\7f1707389
140812 Ref: S0213\7f1707389
140813 Ref: 4280\7f1707393
140814 Ref: 4281\7f1707429
140815 Ref: 4282\7f1707459
140816 Ref: 4283\7f1707510
140817 Ref: S0214\7f1707510
140818 Ref: 4284\7f1707514
140819 Ref: 4285\7f1707559
140820 Ref: 4286\7f1707913
140821 Ref: S0215\7f1707913
140822 Ref: 4287\7f1707940
140823 Ref: 4288\7f1707974
140824 Ref: 4289\7f1708009
140825 Ref: 4290\7f1708058
140826 Ref: 4291\7f1708160
140827 Ref: S0216\7f1708160
140828 Ref: 4292\7f1708164
140829 Ref: 4293\7f1708200
140830 Ref: 4294\7f1708228
140831 Ref: 4295\7f1708251
140832 Ref: 4296\7f1708667
140833 Ref: 4297\7f1708903
140834 Ref: 4298\7f1710210
140835 Ref: 4299\7f1710211
140836 Ref: 4300\7f1710211
140837 Ref: 4301\7f1710211
140838 Ref: 4302\7f1711079
140839 Ref: 4303\7f1712614
140840 Ref: 4304\7f1713775
140841 Ref: 4305\7f1714087
140842 Ref: 4306\7f1714169
140843 Ref: 4307\7f1715919
140844 Ref: 4308\7f1716578
140845 Ref: 4309\7f1716657
140846 Ref: 4310\7f1716949
140847 Ref: 4311\7f1717168
140848 Ref: 4312\7f1717400
140849 Ref: 4313\7f1717957
140850 Ref: 4314\7f1718415
140851 Ref: 4315\7f1718415
140852 Ref: 4316\7f1720187
140853 Ref: 4317\7f1725988
140854 Ref: 4318\7f1726299
140855 Ref: 4319\7f1727569
140856 Ref: 4320\7f1728052
140857 Node: 9.5\7f1728646
140858 Ref: 4321\7f1728772
140859 Ref: 4322\7f1728772
140860 Ref: 4323\7f1729330
140861 Ref: 4324\7f1730278
140862 Ref: 4325\7f1730547
140863 Ref: 4326\7f1732318
140864 Ref: 4327\7f1732318
140865 Ref: 4328\7f1732318
140866 Ref: 4329\7f1734979
140867 Ref: S0217\7f1734979
140868 Ref: 4330\7f1735427
140869 Ref: 4331\7f1735427
140870 Ref: 4332\7f1737044
140871 Ref: 4333\7f1738084
140872 Node: 9.5.1\7f1738813
140873 Ref: 4334\7f1738977
140874 Ref: 4335\7f1738977
140875 Ref: 4336\7f1738977
140876 Ref: 4337\7f1740420
140877 Ref: 4338\7f1741087
140878 Ref: 4339\7f1741396
140879 Ref: 4340\7f1741396
140880 Ref: 4341\7f1741708
140881 Ref: 4342\7f1741708
140882 Ref: 4343\7f1742100
140883 Ref: 4344\7f1742201
140884 Ref: 4345\7f1742203
140885 Ref: 4346\7f1743479
140886 Node: 9.5.2\7f1747927
140887 Ref: 4347\7f1748363
140888 Ref: S0218\7f1748363
140889 Ref: 4348\7f1748377
140890 Ref: 4349\7f1748413
140891 Ref: 4350\7f1748435
140892 Ref: 4351\7f1748465
140893 Ref: 4352\7f1748501
140894 Ref: 4353\7f1748548
140895 Ref: S0219\7f1748548
140896 Ref: 4354\7f1748574
140897 Ref: 4355\7f1748588
140898 Ref: 4356\7f1748602
140899 Ref: 4357\7f1748634
140900 Ref: 4358\7f1748684
140901 Ref: 4359\7f1749004
140902 Ref: S0220\7f1749004
140903 Ref: 4360\7f1749008
140904 Ref: 4361\7f1749038
140905 Ref: S0221\7f1749038
140906 Ref: 4362\7f1749056
140907 Ref: 4363\7f1749077
140908 Ref: 4364\7f1749101
140909 Ref: 4365\7f1749133
140910 Ref: 4366\7f1749172
140911 Ref: 4367\7f1749221
140912 Ref: 4368\7f1749619
140913 Ref: S0222\7f1749619
140914 Ref: 4369\7f1749626
140915 Ref: 4370\7f1749654
140916 Ref: 4371\7f1749699
140917 Ref: S0223\7f1749699
140918 Ref: 4372\7f1749709
140919 Ref: 4373\7f1749752
140920 Ref: S0224\7f1749752
140921 Ref: 4374\7f1749761
140922 Ref: 4375\7f1749784
140923 Ref: 4376\7f1750639
140924 Ref: 4377\7f1750765
140925 Ref: 4378\7f1753892
140926 Ref: 4379\7f1754867
140927 Ref: 4380\7f1757109
140928 Ref: 4381\7f1757204
140929 Ref: 4382\7f1757338
140930 Ref: 4383\7f1757453
140931 Ref: 4384\7f1758764
140932 Ref: 4385\7f1759234
140933 Ref: 4386\7f1759234
140934 Ref: 4387\7f1759234
140935 Ref: 4388\7f1759694
140936 Ref: 4389\7f1759696
140937 Ref: 4390\7f1759975
140938 Ref: 4391\7f1760584
140939 Ref: 4392\7f1761430
140940 Ref: 4393\7f1761630
140941 Ref: 4394\7f1761632
140942 Ref: 4395\7f1761632
140943 Ref: 4396\7f1762930
140944 Ref: 4397\7f1763318
140945 Ref: 4398\7f1766609
140946 Ref: 4399\7f1767203
140947 Node: 9.5.3\7f1767333
140948 Ref: 4400\7f1767447
140949 Ref: 4401\7f1767520
140950 Ref: 4402\7f1767522
140951 Ref: 4403\7f1767807
140952 Ref: S0225\7f1767807
140953 Ref: 4404\7f1767818
140954 Ref: 4405\7f1767824
140955 Ref: 4406\7f1768379
140956 Ref: 4407\7f1768379
140957 Ref: 4408\7f1768379
140958 Ref: 4409\7f1768379
140959 Ref: 4410\7f1768546
140960 Ref: 4411\7f1768547
140961 Ref: 4412\7f1768858
140962 Ref: 4413\7f1768859
140963 Ref: 4414\7f1769021
140964 Ref: 4415\7f1770187
140965 Ref: 4416\7f1770336
140966 Ref: 4417\7f1770533
140967 Ref: 4418\7f1771827
140968 Ref: 4419\7f1771970
140969 Ref: 4420\7f1771970
140970 Ref: 4421\7f1772585
140971 Ref: 4422\7f1772876
140972 Ref: 4423\7f1772980
140973 Ref: 4424\7f1772982
140974 Ref: 4425\7f1774051
140975 Ref: 4426\7f1774626
140976 Ref: 4427\7f1775752
140977 Node: 9.5.4\7f1784509
140978 Ref: 4428\7f1784785
140979 Ref: 4429\7f1784931
140980 Ref: 4430\7f1784933
140981 Ref: 4431\7f1785028
140982 Ref: S0226\7f1785028
140983 Ref: 4432\7f1785065
140984 Ref: 4433\7f1785187
140985 Ref: 4434\7f1785583
140986 Ref: 4435\7f1786036
140987 Ref: 4436\7f1786524
140988 Ref: 4437\7f1789135
140989 Ref: 4438\7f1789508
140990 Ref: 4439\7f1789780
140991 Ref: 4440\7f1791306
140992 Ref: 4441\7f1792909
140993 Ref: 4442\7f1793313
140994 Ref: 4443\7f1793469
140995 Node: 9.6\7f1793595
140996 Ref: 4444\7f1793748
140997 Ref: 4445\7f1794222
140998 Ref: 4446\7f1794290
140999 Ref: S0227\7f1794290
141000 Ref: 4447\7f1794294
141001 Ref: 4448\7f1794319
141002 Ref: 4449\7f1794379
141003 Ref: S0228\7f1794379
141004 Ref: 4450\7f1794402
141005 Ref: 4451\7f1794446
141006 Ref: S0229\7f1794446
141007 Ref: 4452\7f1794463
141008 Ref: 4453\7f1794527
141009 Ref: 4454\7f1794632
141010 Ref: 4455\7f1794798
141011 Ref: 4456\7f1794799
141012 Ref: 4457\7f1794799
141013 Ref: 4458\7f1795830
141014 Ref: 4459\7f1795872
141015 Ref: 4460\7f1795939
141016 Ref: 4461\7f1795998
141017 Ref: 4462\7f1796052
141018 Ref: 4463\7f1796106
141019 Ref: 4464\7f1796581
141020 Ref: 4465\7f1796620
141021 Ref: 4466\7f1796677
141022 Ref: 4467\7f1796735
141023 Ref: 4468\7f1796791
141024 Ref: 4469\7f1796854
141025 Ref: 4470\7f1797104
141026 Ref: 4471\7f1797811
141027 Ref: 4472\7f1797976
141028 Ref: 4473\7f1798056
141029 Ref: 4474\7f1798219
141030 Ref: 4475\7f1798469
141031 Ref: 4476\7f1798976
141032 Ref: 4477\7f1799543
141033 Ref: 4478\7f1806946
141034 Ref: 4479\7f1806946
141035 Ref: 4480\7f1808096
141036 Ref: 4481\7f1808096
141037 Ref: 4482\7f1808560
141038 Ref: 4483\7f1809030
141039 Ref: 4484\7f1810492
141040 Node: 9.6.1\7f1811396
141041 Ref: 4485\7f1811732
141042 Ref: 4486\7f1811830
141043 Ref: 4487\7f1812524
141044 Ref: 4488\7f1812583
141045 Ref: 4489\7f1812686
141046 Ref: 4490\7f1812782
141047 Ref: 4491\7f1812948
141048 Ref: 4492\7f1813364
141049 Ref: 4493\7f1813888
141050 Ref: 4494\7f1814017
141051 Ref: 4495\7f1814030
141052 Ref: 4496\7f1814038
141053 Ref: 4497\7f1814047
141054 Ref: 4498\7f1814058
141055 Ref: 4499\7f1814075
141056 Ref: 4500\7f1814088
141057 Ref: 4501\7f1814098
141058 Ref: 4502\7f1814130
141059 Ref: 4503\7f1814242
141060 Ref: 4504\7f1814304
141061 Ref: 4505\7f1814366
141062 Ref: 4506\7f1814428
141063 Ref: 4507\7f1814505
141064 Ref: 4508\7f1814676
141065 Ref: 4509\7f1814848
141066 Ref: 4510\7f1815018
141067 Ref: 4511\7f1815189
141068 Ref: 4512\7f1815362
141069 Ref: 4513\7f1815464
141070 Ref: 4514\7f1815568
141071 Ref: 4515\7f1815837
141072 Ref: 4516\7f1816126
141073 Ref: 4517\7f1816683
141074 Ref: 4518\7f1817078
141075 Ref: 4519\7f1817595
141076 Ref: 4520\7f1818163
141077 Ref: 4521\7f1818593
141078 Ref: 4522\7f1818783
141079 Ref: 4523\7f1818907
141080 Ref: 4524\7f1819043
141081 Ref: 4525\7f1840599
141082 Ref: 4526\7f1840799
141083 Node: 9.7\7f1841316
141084 Ref: 4527\7f1841719
141085 Ref: S0230\7f1841719
141086 Ref: 4528\7f1841732
141087 Ref: 4529\7f1841758
141088 Ref: 4530\7f1841784
141089 Ref: 4531\7f1841816
141090 Ref: 4532\7f1842093
141091 Node: 9.7.1\7f1842290
141092 Ref: 4533\7f1842615
141093 Ref: 4534\7f1842683
141094 Ref: S0231\7f1842683
141095 Ref: 4535\7f1842711
141096 Ref: 4536\7f1842728
141097 Ref: 4537\7f1842766
141098 Ref: 4538\7f1842783
141099 Ref: 4539\7f1842824
141100 Ref: 4540\7f1842881
141101 Ref: S0232\7f1842881
141102 Ref: 4541\7f1842891
141103 Ref: 4542\7f1842930
141104 Ref: S0233\7f1842930
141105 Ref: 4543\7f1842943
141106 Ref: 4544\7f1842971
141107 Ref: 4545\7f1842998
141108 Ref: 4546\7f1843046
141109 Ref: S0234\7f1843046
141110 Ref: 4547\7f1843058
141111 Ref: 4548\7f1843076
141112 Ref: 4549\7f1843125
141113 Ref: S0235\7f1843125
141114 Ref: 4550\7f1843137
141115 Ref: 4551\7f1843154
141116 Ref: 4552\7f1843207
141117 Ref: S0236\7f1843207
141118 Ref: 4553\7f1843446
141119 Ref: 4554\7f1844010
141120 Ref: 4555\7f1844187
141121 Ref: 4556\7f1844832
141122 Ref: 4557\7f1845481
141123 Ref: 4558\7f1847315
141124 Node: 9.7.2\7f1848546
141125 Ref: 4559\7f1848985
141126 Ref: 4560\7f1849054
141127 Ref: S0237\7f1849054
141128 Ref: 4561\7f1849081
141129 Ref: 4562\7f1849122
141130 Ref: 4563\7f1849220
141131 Ref: S0238\7f1849220
141132 Ref: 4564\7f1849232
141133 Ref: 4565\7f1849257
141134 Ref: 4566\7f1849345
141135 Ref: S0239\7f1849345
141136 Ref: 4567\7f1849357
141137 Ref: 4568\7f1849384
141138 Ref: 4569\7f1850506
141139 Ref: 4570\7f1852427
141140 Node: 9.7.3\7f1852959
141141 Ref: 4571\7f1853824
141142 Ref: S0240\7f1853824
141143 Ref: 4572\7f1853851
141144 Ref: 4573\7f1853894
141145 Ref: 4574\7f1853986
141146 Node: 9.7.4\7f1855179
141147 Ref: 4575\7f1855529
141148 Ref: S0241\7f1855529
141149 Ref: 4576\7f1855556
141150 Ref: 4577\7f1855605
141151 Ref: 4578\7f1855669
141152 Ref: S0242\7f1855669
141153 Ref: 4579\7f1855673
141154 Ref: 4580\7f1855696
141155 Ref: 4581\7f1855785
141156 Ref: S0243\7f1855785
141157 Ref: 4582\7f1855789
141158 Ref: 4583\7f1855821
141159 Ref: 4584\7f1855859
141160 Ref: S0244\7f1855859
141161 Ref: 4585\7f1855863
141162 Ref: 4586\7f1855967
141163 Ref: 4587\7f1855968
141164 Ref: 4588\7f1856850
141165 Ref: 4589\7f1859503
141166 Ref: 4590\7f1859503
141167 Ref: 4591\7f1859503
141168 Ref: 4592\7f1859933
141169 Ref: 4593\7f1859934
141170 Ref: 4594\7f1859934
141171 Ref: 4595\7f1859934
141172 Ref: 4596\7f1859934
141173 Ref: 4597\7f1860267
141174 Ref: 4598\7f1860399
141175 Node: 9.8\7f1860577
141176 Ref: 4599\7f1861105
141177 Ref: S0245\7f1861105
141178 Ref: 4600\7f1861121
141179 Ref: 4601\7f1861134
141180 Ref: 4602\7f1861193
141181 Ref: 4603\7f1861340
141182 Ref: 4604\7f1861438
141183 Ref: 4605\7f1861438
141184 Ref: 4606\7f1861440
141185 Ref: 4607\7f1861440
141186 Ref: 4608\7f1862303
141187 Ref: 4609\7f1862303
141188 Ref: 4610\7f1862729
141189 Ref: 4611\7f1864660
141190 Ref: 4612\7f1865646
141191 Ref: 4613\7f1867039
141192 Ref: 4614\7f1867322
141193 Ref: 4615\7f1868558
141194 Ref: 4616\7f1868558
141195 Ref: 4617\7f1868558
141196 Ref: 4618\7f1868558
141197 Node: 9.9\7f1869393
141198 Ref: 4619\7f1869697
141199 Ref: 4620\7f1869712
141200 Ref: 4621\7f1869809
141201 Ref: 4622\7f1869810
141202 Ref: 4623\7f1869975
141203 Ref: 4624\7f1869990
141204 Ref: 4625\7f1870494
141205 Ref: 4626\7f1870509
141206 Node: 9.10\7f1871550
141207 Ref: 4627\7f1871813
141208 Ref: 4628\7f1871814
141209 Ref: 4629\7f1872505
141210 Ref: 4630\7f1874519
141211 Ref: 4631\7f1877783
141212 Ref: 4632\7f1878045
141213 Node: 9.11\7f1881977
141214 Node: 10\7f1885820
141215 Ref: 4633\7f1886863
141216 Ref: 4634\7f1886863
141217 Ref: 4635\7f1886863
141218 Ref: 4636\7f1887168
141219 Ref: 4637\7f1887661
141220 Ref: 4638\7f1888142
141221 Ref: 4639\7f1888152
141222 Ref: 4640\7f1888333
141223 Node: 10.1\7f1889473
141224 Ref: 4641\7f1889587
141225 Ref: 4642\7f1889587
141226 Ref: 4643\7f1889588
141227 Ref: 4644\7f1889903
141228 Ref: 4645\7f1890983
141229 Ref: 4646\7f1891230
141230 Node: 10.1.1\7f1893163
141231 Ref: 4647\7f1893523
141232 Ref: 4648\7f1893773
141233 Ref: S0246\7f1893773
141234 Ref: 4649\7f1893779
141235 Ref: 4650\7f1893821
141236 Ref: S0247\7f1893821
141237 Ref: 4651\7f1893835
141238 Ref: 4652\7f1893850
141239 Ref: 4653\7f1893872
141240 Ref: 4654\7f1893887
141241 Ref: 4655\7f1893915
141242 Ref: S0248\7f1893915
141243 Ref: 4656\7f1893930
141244 Ref: 4657\7f1893964
141245 Ref: 4658\7f1894001
141246 Ref: 4659\7f1894067
141247 Ref: S0249\7f1894067
141248 Ref: 4660\7f1894082
141249 Ref: 4661\7f1894109
141250 Ref: 4662\7f1894139
141251 Ref: 4663\7f1894163
141252 Ref: 4664\7f1894226
141253 Ref: S0250\7f1894226
141254 Ref: 4665\7f1894239
141255 Ref: 4666\7f1894276
141256 Ref: 4667\7f1894313
141257 Ref: 4668\7f1894370
141258 Ref: S0251\7f1894370
141259 Ref: 4669\7f1894374
141260 Ref: 4670\7f1894393
141261 Ref: 4671\7f1894430
141262 Ref: S0252\7f1894430
141263 Ref: 4672\7f1894434
141264 Ref: 4673\7f1894935
141265 Ref: 4674\7f1894935
141266 Ref: 4675\7f1894935
141267 Ref: 4676\7f1894935
141268 Ref: 4677\7f1894935
141269 Ref: 4678\7f1895242
141270 Ref: 4679\7f1896415
141271 Ref: 4680\7f1896415
141272 Ref: 4681\7f1896639
141273 Ref: 4682\7f1896932
141274 Ref: 4683\7f1897927
141275 Ref: 4684\7f1898067
141276 Ref: 4685\7f1898436
141277 Ref: 4686\7f1898436
141278 Ref: 4687\7f1898436
141279 Ref: 4688\7f1898436
141280 Ref: 4689\7f1898699
141281 Ref: 4690\7f1898821
141282 Ref: 4691\7f1901454
141283 Ref: 4692\7f1910812
141284 Ref: 4693\7f1910813
141285 Ref: 4694\7f1923288
141286 Ref: 4695\7f1924257
141287 Node: 10.1.2\7f1924945
141288 Ref: 4696\7f1925265
141289 Ref: 4697\7f1925677
141290 Ref: 4698\7f1926405
141291 Ref: S0253\7f1926405
141292 Ref: 4699\7f1926411
141293 Ref: 4700\7f1926445
141294 Ref: S0254\7f1926445
141295 Ref: 4701\7f1926449
141296 Ref: 4702\7f1926464
141297 Ref: 4703\7f1926559
141298 Ref: S0255\7f1926559
141299 Ref: 4704\7f1926563
141300 Ref: 4705\7f1926586
141301 Ref: 4706\7f1926640
141302 Ref: S0256\7f1926640
141303 Ref: 4707\7f1926681
141304 Ref: 4708\7f1926708
141305 Ref: 4709\7f1926749
141306 Ref: S0257\7f1926749
141307 Ref: 4710\7f1926782
141308 Ref: 4711\7f1926809
141309 Ref: 4712\7f1926991
141310 Ref: 4713\7f1927520
141311 Ref: 4714\7f1929225
141312 Ref: 4715\7f1929226
141313 Ref: 4716\7f1929286
141314 Ref: 4717\7f1929287
141315 Ref: 4718\7f1943976
141316 Ref: 4719\7f1945260
141317 Ref: 4720\7f1945697
141318 Ref: 4721\7f1946010
141319 Ref: 4722\7f1946422
141320 Node: 10.1.3\7f1947314
141321 Ref: 4723\7f1947847
141322 Ref: S0258\7f1947847
141323 Ref: 4724\7f1947851
141324 Ref: 4725\7f1947875
141325 Ref: 4726\7f1947895
141326 Ref: 4727\7f1947918
141327 Ref: 4728\7f1948027
141328 Ref: S0259\7f1948027
141329 Ref: 4729\7f1948041
141330 Ref: 4730\7f1948071
141331 Ref: 4731\7f1948120
141332 Ref: 4732\7f1948353
141333 Ref: S0260\7f1948353
141334 Ref: 4733\7f1948379
141335 Ref: 4734\7f1948423
141336 Ref: 4735\7f1948468
141337 Ref: S0261\7f1948468
141338 Ref: 4736\7f1948491
141339 Ref: 4737\7f1948535
141340 Ref: 4738\7f1948585
141341 Ref: S0262\7f1948585
141342 Ref: 4739\7f1948613
141343 Ref: 4740\7f1948657
141344 Ref: 4741\7f1948695
141345 Ref: S0263\7f1948695
141346 Ref: 4742\7f1948710
141347 Ref: 4743\7f1948728
141348 Ref: 4744\7f1948818
141349 Ref: 4745\7f1948912
141350 Ref: 4746\7f1949176
141351 Ref: 4747\7f1950368
141352 Ref: 4748\7f1950800
141353 Ref: 4749\7f1950991
141354 Ref: 4750\7f1954032
141355 Ref: 4751\7f1954322
141356 Ref: 4752\7f1954668
141357 Node: 10.1.4\7f1954779
141358 Ref: 4753\7f1954923
141359 Ref: 4754\7f1954923
141360 Ref: 4755\7f1957998
141361 Ref: 4756\7f1959177
141362 Ref: 4757\7f1965511
141363 Ref: 4758\7f1965928
141364 Ref: 4759\7f1967350
141365 Node: 10.1.5\7f1968597
141366 Ref: 4760\7f1968891
141367 Ref: 4761\7f1968891
141368 Ref: 4762\7f1968946
141369 Ref: 4763\7f1971439
141370 Ref: 4764\7f1971440
141371 Ref: 4765\7f1971440
141372 Ref: 4766\7f1971440
141373 Ref: 4767\7f1972388
141374 Ref: 4768\7f1972388
141375 Node: 10.1.6\7f1975249
141376 Ref: 4769\7f1975732
141377 Ref: 4770\7f1975733
141378 Ref: 4771\7f1975733
141379 Ref: 4772\7f1975733
141380 Ref: 4773\7f1977451
141381 Ref: 4774\7f1977451
141382 Ref: 4775\7f1977451
141383 Ref: 4776\7f1977451
141384 Ref: 4777\7f1978324
141385 Ref: 4778\7f1978324
141386 Ref: 4779\7f1978697
141387 Ref: 4780\7f1978697
141388 Ref: 4781\7f1978924
141389 Node: 10.2\7f1980865
141390 Ref: 4782\7f1980972
141391 Ref: 4783\7f1980972
141392 Ref: 4784\7f1980972
141393 Ref: 4785\7f1981197
141394 Ref: 4786\7f1981197
141395 Ref: 4787\7f1981404
141396 Ref: 4788\7f1981889
141397 Ref: 4789\7f1981890
141398 Ref: 4790\7f1981890
141399 Ref: 4791\7f1984383
141400 Ref: 4792\7f1986043
141401 Ref: 4793\7f1986647
141402 Ref: 4794\7f1986649
141403 Ref: 4795\7f1989054
141404 Ref: 4796\7f1992339
141405 Ref: 4797\7f1992340
141406 Ref: 4798\7f1994211
141407 Ref: 4799\7f1994332
141408 Ref: 4800\7f1995364
141409 Ref: 4801\7f1995365
141410 Ref: 4802\7f1995365
141411 Ref: 4803\7f1995365
141412 Ref: 4804\7f1995365
141413 Ref: 4805\7f1995584
141414 Ref: 4806\7f1995584
141415 Ref: 4807\7f1995848
141416 Ref: 4808\7f1998138
141417 Ref: 4809\7f2004450
141418 Node: 10.2.1\7f2005342
141419 Ref: 4810\7f2005449
141420 Ref: 4811\7f2007708
141421 Ref: 4812\7f2007709
141422 Ref: 4813\7f2007736
141423 Ref: 4814\7f2007747
141424 Ref: 4815\7f2007752
141425 Ref: 4816\7f2007931
141426 Ref: 4817\7f2007932
141427 Ref: 4818\7f2007961
141428 Ref: 4819\7f2008023
141429 Ref: 4820\7f2010630
141430 Ref: 4821\7f2012479
141431 Ref: 4822\7f2012624
141432 Ref: 4823\7f2012624
141433 Ref: 4824\7f2013009
141434 Ref: 4825\7f2013172
141435 Ref: 4826\7f2014123
141436 Ref: 4827\7f2016711
141437 Ref: 4828\7f2018942
141438 Ref: 4829\7f2018943
141439 Ref: 4830\7f2018962
141440 Ref: 4831\7f2018974
141441 Ref: 4832\7f2018979
141442 Ref: 4833\7f2019126
141443 Ref: 4834\7f2023982
141444 Ref: 4835\7f2024081
141445 Ref: 4836\7f2024081
141446 Ref: 4837\7f2024513
141447 Ref: 4838\7f2029414
141448 Ref: 4839\7f2029415
141449 Ref: 4840\7f2029438
141450 Ref: 4841\7f2029458
141451 Ref: 4842\7f2029483
141452 Ref: 4843\7f2029484
141453 Ref: 4844\7f2029511
141454 Ref: 4845\7f2029531
141455 Ref: 4846\7f2029556
141456 Ref: 4847\7f2029557
141457 Ref: 4848\7f2029586
141458 Ref: 4849\7f2029898
141459 Ref: 4850\7f2029903
141460 Ref: 4851\7f2030305
141461 Ref: 4852\7f2030465
141462 Ref: 4853\7f2031905
141463 Ref: 4854\7f2031905
141464 Ref: 4855\7f2034558
141465 Ref: 4856\7f2035009
141466 Ref: 4857\7f2036674
141467 Ref: 4858\7f2037829
141468 Ref: 4859\7f2039035
141469 Node: 11\7f2041160
141470 Ref: 4860\7f2041413
141471 Ref: 4861\7f2041415
141472 Ref: 4862\7f2041415
141473 Ref: 4863\7f2041415
141474 Ref: 4864\7f2041415
141475 Ref: 4865\7f2041415
141476 Ref: 4866\7f2041557
141477 Ref: 4867\7f2041699
141478 Ref: 4868\7f2041833
141479 Ref: 4869\7f2042180
141480 Node: 11.1\7f2043958
141481 Ref: 4870\7f2044075
141482 Ref: 4871\7f2044231
141483 Ref: S0264\7f2044231
141484 Ref: 4872\7f2044235
141485 Ref: 4873\7f2044287
141486 Ref: 4874\7f2045922
141487 Ref: 4875\7f2045922
141488 Ref: 4876\7f2045922
141489 Ref: 4877\7f2045922
141490 Ref: 4878\7f2045922
141491 Ref: 4879\7f2046331
141492 Ref: 4880\7f2046393
141493 Ref: 4881\7f2046393
141494 Ref: 4882\7f2046393
141495 Ref: 4883\7f2046497
141496 Ref: 4884\7f2046995
141497 Ref: 4885\7f2048153
141498 Node: 11.2\7f2048286
141499 Ref: 4886\7f2048566
141500 Ref: S0265\7f2048566
141501 Ref: 4887\7f2048581
141502 Ref: 4888\7f2048632
141503 Ref: 4889\7f2048660
141504 Ref: 4890\7f2048705
141505 Ref: S0266\7f2048705
141506 Ref: 4891\7f2048723
141507 Ref: 4892\7f2048756
141508 Ref: 4893\7f2048776
141509 Ref: 4894\7f2048813
141510 Ref: 4895\7f2048874
141511 Ref: S0267\7f2048874
141512 Ref: 4896\7f2048878
141513 Ref: 4897\7f2048923
141514 Ref: S0268\7f2048923
141515 Ref: 4898\7f2048938
141516 Ref: 4899\7f2048980
141517 Ref: 4900\7f2049086
141518 Ref: 4901\7f2049221
141519 Ref: 4902\7f2050637
141520 Ref: 4903\7f2050980
141521 Ref: 4904\7f2051635
141522 Node: 11.3\7f2052757
141523 Ref: 4905\7f2053011
141524 Ref: S0269\7f2053011
141525 Ref: 4906\7f2053052
141526 Ref: 4907\7f2053070
141527 Ref: 4908\7f2053196
141528 Ref: 4909\7f2053591
141529 Ref: 4910\7f2053693
141530 Ref: 4911\7f2053914
141531 Ref: 4912\7f2055491
141532 Node: 11.4\7f2055792
141533 Ref: 4913\7f2056063
141534 Ref: 4914\7f2056138
141535 Ref: 4915\7f2056794
141536 Ref: 4916\7f2056794
141537 Ref: 4917\7f2057039
141538 Ref: 4918\7f2057203
141539 Ref: 4919\7f2057204
141540 Ref: 4920\7f2058550
141541 Ref: 4921\7f2059901
141542 Ref: 4922\7f2060094
141543 Ref: 4923\7f2060095
141544 Ref: 4924\7f2060284
141545 Ref: 4925\7f2060284
141546 Ref: 4926\7f2060284
141547 Node: 11.4.1\7f2062021
141548 Ref: 4927\7f2062346
141549 Ref: 4928\7f2062451
141550 Ref: 4929\7f2062540
141551 Ref: 4930\7f2062596
141552 Ref: 4931\7f2062663
141553 Ref: 4932\7f2062740
141554 Ref: 4933\7f2062870
141555 Ref: 4934\7f2062993
141556 Ref: 4935\7f2063061
141557 Ref: 4936\7f2063193
141558 Ref: 4937\7f2063339
141559 Ref: 4938\7f2063417
141560 Ref: 4939\7f2063518
141561 Ref: 4940\7f2063639
141562 Ref: 4941\7f2063776
141563 Ref: 4942\7f2063941
141564 Ref: 4943\7f2064121
141565 Ref: 4944\7f2064237
141566 Ref: 4945\7f2064376
141567 Ref: 4946\7f2065654
141568 Ref: 4947\7f2065669
141569 Ref: 4948\7f2067049
141570 Ref: 4949\7f2070678
141571 Ref: 4950\7f2083017
141572 Ref: 4951\7f2083210
141573 Ref: 4952\7f2085115
141574 Ref: 4953\7f2085762
141575 Node: 11.4.2\7f2086713
141576 Ref: 4954\7f2087356
141577 Ref: 4955\7f2087356
141578 Ref: 4956\7f2088670
141579 Ref: 4957\7f2088671
141580 Ref: 4958\7f2088697
141581 Ref: 4959\7f2088735
141582 Ref: 4960\7f2088971
141583 Ref: 4961\7f2088972
141584 Ref: 4962\7f2088996
141585 Ref: 4963\7f2089054
141586 Ref: 4964\7f2089055
141587 Ref: 4965\7f2089097
141588 Ref: 4966\7f2089119
141589 Ref: 4967\7f2089153
141590 Ref: 4968\7f2089175
141591 Ref: 4969\7f2089223
141592 Ref: 4970\7f2089224
141593 Ref: 4971\7f2093117
141594 Ref: 4972\7f2093190
141595 Ref: 4973\7f2093248
141596 Ref: 4974\7f2093294
141597 Ref: 4975\7f2094127
141598 Ref: 4976\7f2094127
141599 Ref: 4977\7f2098468
141600 Ref: 4978\7f2098644
141601 Ref: 4979\7f2099532
141602 Node: 11.4.3\7f2099671
141603 Node: 11.5\7f2102495
141604 Ref: 4980\7f2102664
141605 Ref: 4981\7f2102934
141606 Ref: 4982\7f2102935
141607 Ref: 4983\7f2102935
141608 Ref: 4984\7f2102935
141609 Ref: 4985\7f2102935
141610 Ref: 4986\7f2103136
141611 Ref: 4987\7f2103550
141612 Ref: 4988\7f2103551
141613 Ref: 4989\7f2103560
141614 Ref: 4990\7f2103622
141615 Ref: 4991\7f2103623
141616 Ref: 4992\7f2103634
141617 Ref: 4993\7f2103685
141618 Ref: 4994\7f2103686
141619 Ref: 4995\7f2103686
141620 Ref: 4996\7f2103686
141621 Ref: 4997\7f2105321
141622 Ref: 4998\7f2105548
141623 Ref: 4999\7f2106191
141624 Ref: 5000\7f2106392
141625 Ref: 5001\7f2106666
141626 Ref: 5002\7f2106985
141627 Ref: 5003\7f2107114
141628 Ref: 5004\7f2107682
141629 Ref: 5005\7f2107892
141630 Ref: 5006\7f2108155
141631 Ref: 5007\7f2108748
141632 Ref: 5008\7f2109034
141633 Ref: 5009\7f2109178
141634 Ref: 5010\7f2109298
141635 Ref: 5011\7f2109592
141636 Ref: 5012\7f2110071
141637 Ref: 5013\7f2110071
141638 Ref: 5014\7f2110945
141639 Ref: 5015\7f2112310
141640 Ref: 5016\7f2112807
141641 Ref: 5017\7f2114513
141642 Ref: 5018\7f2114513
141643 Ref: 5019\7f2115374
141644 Ref: 5020\7f2117316
141645 Node: 11.6\7f2119584
141646 Ref: 5021\7f2119739
141647 Ref: 5022\7f2119739
141648 Ref: 5023\7f2119740
141649 Ref: 5024\7f2119740
141650 Ref: 5025\7f2119740
141651 Ref: 5026\7f2119740
141652 Ref: 5027\7f2119964
141653 Ref: 5028\7f2122285
141654 Ref: 5029\7f2122285
141655 Ref: 5030\7f2125402
141656 Ref: 5031\7f2126142
141657 Ref: 5032\7f2126314
141658 Ref: 5033\7f2126316
141659 Ref: 5034\7f2126316
141660 Node: 12\7f2132534
141661 Ref: 5035\7f2132637
141662 Ref: 5036\7f2132727
141663 Ref: 5037\7f2132955
141664 Ref: 5038\7f2132957
141665 Ref: 5039\7f2132957
141666 Node: 12.1\7f2134796
141667 Ref: 5040\7f2135324
141668 Ref: S0270\7f2135324
141669 Ref: 5041\7f2135328
141670 Ref: 5042\7f2135362
141671 Ref: 5043\7f2135461
141672 Ref: S0271\7f2135461
141673 Ref: 5044\7f2135476
141674 Ref: 5045\7f2135497
141675 Ref: 5046\7f2135536
141676 Ref: 5047\7f2135594
141677 Ref: S0272\7f2135594
141678 Ref: 5048\7f2135609
141679 Ref: 5049\7f2135630
141680 Ref: 5050\7f2135947
141681 Ref: S0273\7f2135947
141682 Ref: 5051\7f2135961
141683 Ref: 5052\7f2136006
141684 Ref: 5053\7f2136062
141685 Ref: S0274\7f2136062
141686 Ref: 5054\7f2136078
141687 Ref: 5055\7f2136115
141688 Ref: 5056\7f2136150
141689 Ref: 5057\7f2136191
141690 Ref: 5058\7f2136902
141691 Ref: 5059\7f2136903
141692 Ref: 5060\7f2136903
141693 Ref: 5061\7f2136903
141694 Ref: 5062\7f2137030
141695 Ref: 5063\7f2137480
141696 Ref: 5064\7f2140228
141697 Ref: 5065\7f2141597
141698 Node: 12.2\7f2141792
141699 Ref: 5066\7f2141906
141700 Ref: 5067\7f2142231
141701 Node: 12.3\7f2144158
141702 Ref: 5068\7f2144287
141703 Ref: 5069\7f2144451
141704 Ref: 5070\7f2144452
141705 Ref: 5071\7f2145659
141706 Ref: S0275\7f2145659
141707 Ref: 5072\7f2145682
141708 Ref: 5073\7f2145746
141709 Ref: 5074\7f2145752
141710 Ref: 5075\7f2145791
141711 Ref: 5076\7f2145825
141712 Ref: 5077\7f2145867
141713 Ref: 5078\7f2145933
141714 Ref: 5079\7f2145939
141715 Ref: 5080\7f2145978
141716 Ref: 5081\7f2146012
141717 Ref: 5082\7f2146053
141718 Ref: 5083\7f2146111
141719 Ref: 5084\7f2146117
141720 Ref: 5085\7f2146156
141721 Ref: 5086\7f2146206
141722 Ref: S0276\7f2146206
141723 Ref: 5087\7f2146220
141724 Ref: 5088\7f2146243
141725 Ref: 5089\7f2146292
141726 Ref: S0277\7f2146292
141727 Ref: 5090\7f2146331
141728 Ref: 5091\7f2146349
141729 Ref: 5092\7f2146430
141730 Ref: S0278\7f2146430
141731 Ref: 5093\7f2146434
141732 Ref: 5094\7f2146457
141733 Ref: 5095\7f2146483
141734 Ref: 5096\7f2146496
141735 Ref: 5097\7f2146503
141736 Ref: 5098\7f2146543
141737 Ref: 5099\7f2146551
141738 Ref: 5100\7f2146556
141739 Ref: 5101\7f2146819
141740 Ref: 5102\7f2146820
141741 Ref: 5103\7f2146820
141742 Ref: 5104\7f2151867
141743 Ref: 5105\7f2154223
141744 Ref: 5106\7f2155972
141745 Ref: 5107\7f2160258
141746 Ref: 5108\7f2160259
141747 Ref: 5109\7f2160766
141748 Ref: 5110\7f2160768
141749 Ref: 5111\7f2160768
141750 Ref: 5112\7f2160768
141751 Ref: 5113\7f2160768
141752 Ref: 5114\7f2160768
141753 Ref: 5115\7f2160768
141754 Ref: 5116\7f2160768
141755 Ref: 5117\7f2170516
141756 Ref: 5118\7f2174974
141757 Ref: 5119\7f2175357
141758 Ref: 5120\7f2175597
141759 Ref: 5121\7f2181134
141760 Ref: 5122\7f2181421
141761 Ref: 5123\7f2181935
141762 Ref: 5124\7f2184444
141763 Ref: 5125\7f2184632
141764 Node: 12.4\7f2184984
141765 Ref: 5126\7f2185099
141766 Ref: 5127\7f2185099
141767 Ref: 5128\7f2185676
141768 Ref: S0279\7f2185676
141769 Ref: 5129\7f2185690
141770 Ref: 5130\7f2185717
141771 Ref: 5131\7f2185723
141772 Ref: 5132\7f2185739
141773 Ref: 5133\7f2185762
141774 Ref: 5134\7f2185796
141775 Ref: 5135\7f2185829
141776 Ref: 5136\7f2185856
141777 Ref: 5137\7f2185861
141778 Ref: 5138\7f2185883
141779 Ref: 5139\7f2185923
141780 Ref: 5140\7f2185998
141781 Ref: 5141\7f2186108
141782 Ref: 5142\7f2186796
141783 Ref: 5143\7f2188163
141784 Ref: 5144\7f2188296
141785 Ref: 5145\7f2188933
141786 Ref: 5146\7f2189736
141787 Ref: 5147\7f2189883
141788 Ref: 5148\7f2191168
141789 Ref: 5149\7f2191169
141790 Ref: 5150\7f2191169
141791 Ref: 5151\7f2192058
141792 Ref: 5152\7f2192373
141793 Ref: 5153\7f2192373
141794 Ref: 5154\7f2192651
141795 Ref: 5155\7f2193613
141796 Ref: 5156\7f2194945
141797 Ref: 5157\7f2195843
141798 Node: 12.5\7f2195980
141799 Ref: 5158\7f2196845
141800 Ref: S0280\7f2196845
141801 Ref: 5159\7f2196861
141802 Ref: 5160\7f2196905
141803 Ref: 5161\7f2197039
141804 Ref: S0281\7f2197039
141805 Ref: 5162\7f2197058
141806 Ref: 5163\7f2197078
141807 Ref: 5164\7f2197100
141808 Ref: 5165\7f2197143
141809 Ref: 5166\7f2197237
141810 Ref: S0282\7f2197237
141811 Ref: 5167\7f2197256
141812 Ref: 5168\7f2197276
141813 Ref: 5169\7f2197369
141814 Ref: S0283\7f2197369
141815 Ref: 5170\7f2197385
141816 Ref: 5171\7f2197427
141817 Ref: 5172\7f2197469
141818 Ref: 5173\7f2197512
141819 Ref: 5174\7f2197561
141820 Ref: 5175\7f2197603
141821 Ref: 5176\7f2197647
141822 Ref: 5177\7f2197697
141823 Ref: 5178\7f2197746
141824 Ref: 5179\7f2197786
141825 Ref: 5180\7f2197827
141826 Ref: 5181\7f2197908
141827 Ref: 5182\7f2197908
141828 Ref: 5183\7f2197908
141829 Ref: 5184\7f2197908
141830 Ref: 5185\7f2198390
141831 Ref: 5186\7f2198390
141832 Ref: 5187\7f2198390
141833 Ref: 5188\7f2198390
141834 Ref: 5189\7f2198699
141835 Ref: 5190\7f2198700
141836 Ref: 5191\7f2208074
141837 Node: 12.5.1\7f2208881
141838 Ref: 5192\7f2210224
141839 Ref: S0284\7f2210224
141840 Ref: 5193\7f2210404
141841 Ref: S0285\7f2210404
141842 Ref: 5194\7f2210459
141843 Ref: 5195\7f2210478
141844 Ref: 5196\7f2211113
141845 Ref: 5197\7f2211114
141846 Ref: 5198\7f2218620
141847 Ref: 5199\7f2222625
141848 Ref: 5200\7f2222640
141849 Ref: 5201\7f2224605
141850 Ref: 5202\7f2227348
141851 Ref: 5203\7f2228267
141852 Ref: 5204\7f2229680
141853 Ref: 5205\7f2230044
141854 Node: 12.5.2\7f2231432
141855 Ref: 5206\7f2232424
141856 Ref: S0286\7f2232424
141857 Ref: 5207\7f2232479
141858 Ref: S0287\7f2232479
141859 Ref: 5208\7f2232531
141860 Ref: S0288\7f2232531
141861 Ref: 5209\7f2232583
141862 Ref: S0289\7f2232583
141863 Ref: 5210\7f2232644
141864 Ref: S0290\7f2232644
141865 Ref: 5211\7f2232703
141866 Ref: S0291\7f2232703
141867 Node: 12.5.3\7f2233918
141868 Ref: 5212\7f2234584
141869 Ref: S0292\7f2234584
141870 Ref: 5213\7f2234588
141871 Ref: 5214\7f2235431
141872 Ref: 5215\7f2235530
141873 Ref: 5216\7f2236583
141874 Node: 12.5.4\7f2237334
141875 Ref: 5217\7f2238005
141876 Ref: S0293\7f2238005
141877 Ref: 5218\7f2238009
141878 Ref: 5219\7f2238195
141879 Ref: 5220\7f2240007
141880 Ref: 5221\7f2240697
141881 Ref: 5222\7f2241128
141882 Ref: 5223\7f2241703
141883 Node: 12.5.5\7f2242358
141884 Ref: 5224\7f2243414
141885 Ref: S0294\7f2243414
141886 Ref: 5225\7f2243418
141887 Ref: 5226\7f2244877
141888 Node: 12.6\7f2244923
141889 Ref: 5227\7f2245046
141890 Ref: 5228\7f2245046
141891 Ref: 5229\7f2245395
141892 Ref: S0295\7f2245395
141893 Ref: 5230\7f2245399
141894 Ref: 5231\7f2245455
141895 Ref: 5232\7f2245603
141896 Ref: S0296\7f2245603
141897 Ref: 5233\7f2245623
141898 Ref: 5234\7f2245652
141899 Ref: 5235\7f2245686
141900 Ref: 5236\7f2245818
141901 Ref: S0297\7f2245818
141902 Ref: 5237\7f2245838
141903 Ref: 5238\7f2245876
141904 Ref: 5239\7f2245910
141905 Ref: 5240\7f2245990
141906 Ref: S0298\7f2245990
141907 Ref: 5241\7f2245994
141908 Ref: 5242\7f2246045
141909 Ref: S0299\7f2246045
141910 Ref: 5243\7f2246049
141911 Ref: 5244\7f2247170
141912 Ref: 5245\7f2247650
141913 Ref: 5246\7f2247902
141914 Ref: 5247\7f2248173
141915 Ref: 5248\7f2248941
141916 Ref: 5249\7f2250270
141917 Ref: 5250\7f2250971
141918 Ref: 5251\7f2256260
141919 Ref: 5252\7f2262500
141920 Ref: 5253\7f2263101
141921 Ref: 5254\7f2263714
141922 Node: 12.7\7f2264442
141923 Ref: 5255\7f2264559
141924 Ref: 5256\7f2264559
141925 Ref: 5257\7f2264922
141926 Ref: S0300\7f2264922
141927 Ref: 5258\7f2264949
141928 Ref: 5259\7f2264992
141929 Ref: 5260\7f2264998
141930 Ref: 5261\7f2265045
141931 Ref: 5262\7f2265133
141932 Ref: S0301\7f2265133
141933 Ref: 5263\7f2265174
141934 Ref: 5264\7f2265205
141935 Ref: 5265\7f2265235
141936 Ref: 5266\7f2265354
141937 Ref: S0302\7f2265354
141938 Ref: 5267\7f2265368
141939 Ref: 5268\7f2265422
141940 Ref: 5269\7f2265637
141941 Ref: 5270\7f2269264
141942 Ref: 5271\7f2269739
141943 Ref: 5272\7f2273737
141944 Ref: 5273\7f2273905
141945 Ref: 5274\7f2274806
141946 Ref: 5275\7f2275499
141947 Node: 12.8\7f2275637
141948 Node: 13\7f2278141
141949 Node: 13.1\7f2279293
141950 Ref: 5276\7f2279522
141951 Ref: 5277\7f2280429
141952 Ref: 5278\7f2280430
141953 Ref: 5279\7f2280430
141954 Ref: 5280\7f2280960
141955 Ref: 5281\7f2282831
141956 Ref: S0303\7f2282831
141957 Ref: S0304\7f2282831
141958 Ref: 5282\7f2282836
141959 Ref: 5283\7f2282882
141960 Ref: 5284\7f2282929
141961 Ref: 5285\7f2282971
141962 Ref: 5286\7f2282999
141963 Ref: S0305\7f2282999
141964 Ref: 5287\7f2283003
141965 Ref: 5288\7f2283029
141966 Ref: 5289\7f2283041
141967 Ref: 5290\7f2283088
141968 Ref: 5291\7f2283267
141969 Ref: 5292\7f2287271
141970 Ref: 5293\7f2287272
141971 Ref: 5294\7f2287781
141972 Ref: 5295\7f2288074
141973 Ref: 5296\7f2288075
141974 Ref: 5297\7f2291995
141975 Ref: 5298\7f2291996
141976 Ref: 5299\7f2291996
141977 Ref: 5300\7f2292268
141978 Ref: 5301\7f2292270
141979 Ref: 5302\7f2292270
141980 Ref: 5303\7f2292270
141981 Ref: 5304\7f2297567
141982 Ref: 5305\7f2297569
141983 Ref: 5306\7f2297569
141984 Ref: 5307\7f2297569
141985 Ref: 5308\7f2308846
141986 Ref: 5309\7f2314491
141987 Ref: 5310\7f2314945
141988 Ref: 5311\7f2316405
141989 Ref: 5312\7f2316909
141990 Ref: 5313\7f2317142
141991 Ref: 5314\7f2317142
141992 Ref: 5315\7f2317144
141993 Ref: 5316\7f2317144
141994 Ref: 5317\7f2317144
141995 Ref: 5318\7f2317247
141996 Ref: 5319\7f2317800
141997 Ref: 5320\7f2318912
141998 Ref: 5321\7f2325688
141999 Ref: 5322\7f2326347
142000 Ref: 5323\7f2328780
142001 Ref: 5324\7f2331188
142002 Node: 13.1.1\7f2333092
142003 Ref: 5325\7f2333514
142004 Ref: 5326\7f2333611
142005 Ref: S0306\7f2333611
142006 Ref: 5327\7f2333629
142007 Ref: 5328\7f2333645
142008 Ref: 5329\7f2333683
142009 Ref: 5330\7f2333699
142010 Ref: 5331\7f2333766
142011 Ref: S0307\7f2333766
142012 Ref: 5332\7f2333778
142013 Ref: 5333\7f2333849
142014 Ref: S0308\7f2333849
142015 Ref: 5334\7f2333853
142016 Ref: 5335\7f2333861
142017 Ref: 5336\7f2333874
142018 Ref: 5337\7f2338964
142019 Ref: 5338\7f2339284
142020 Ref: 5339\7f2339495
142021 Ref: 5340\7f2339495
142022 Ref: 5341\7f2339690
142023 Ref: 5342\7f2344642
142024 Ref: 5343\7f2345009
142025 Ref: 5344\7f2345199
142026 Ref: 5345\7f2345384
142027 Ref: 5346\7f2349512
142028 Node: 13.2\7f2349545
142029 Ref: 5347\7f2350484
142030 Ref: 5348\7f2350486
142031 Ref: 5349\7f2350486
142032 Ref: 5350\7f2352156
142033 Ref: 5351\7f2354190
142034 Node: 13.3\7f2354530
142035 Ref: 5352\7f2354751
142036 Ref: 5353\7f2354751
142037 Ref: 5354\7f2354901
142038 Ref: 5355\7f2355334
142039 Ref: S0309\7f2355334
142040 Ref: 5356\7f2355354
142041 Ref: 5357\7f2355365
142042 Ref: 5358\7f2355390
142043 Ref: 5359\7f2355417
142044 Ref: 5360\7f2355428
142045 Ref: 5361\7f2355453
142046 Ref: 5362\7f2355690
142047 Ref: 5363\7f2355858
142048 Ref: 5364\7f2357090
142049 Ref: 5365\7f2357091
142050 Ref: 5366\7f2357293
142051 Ref: 5367\7f2357336
142052 Ref: 5368\7f2358390
142053 Ref: 5369\7f2358724
142054 Ref: 5370\7f2358725
142055 Ref: 5371\7f2358725
142056 Ref: 5372\7f2358725
142057 Ref: 5373\7f2358725
142058 Ref: 5374\7f2358725
142059 Ref: 5375\7f2358725
142060 Ref: 5376\7f2358725
142061 Ref: 5377\7f2358725
142062 Ref: 5378\7f2358725
142063 Ref: 5379\7f2358725
142064 Ref: 5380\7f2358725
142065 Ref: 5381\7f2358725
142066 Ref: 5382\7f2358725
142067 Ref: 5383\7f2358725
142068 Ref: 5384\7f2358901
142069 Ref: 5385\7f2358902
142070 Ref: 5386\7f2359088
142071 Ref: 5387\7f2359088
142072 Ref: 5388\7f2359158
142073 Ref: 5389\7f2360459
142074 Ref: 5390\7f2361658
142075 Ref: 5391\7f2361673
142076 Ref: 5392\7f2362455
142077 Ref: 5393\7f2362470
142078 Ref: 5394\7f2362591
142079 Ref: 5395\7f2362591
142080 Ref: 5396\7f2365090
142081 Ref: 5397\7f2366569
142082 Ref: 5398\7f2370689
142083 Ref: 5399\7f2370704
142084 Ref: 5400\7f2371811
142085 Ref: 5401\7f2371812
142086 Ref: 5402\7f2372309
142087 Ref: 5403\7f2372324
142088 Ref: 5404\7f2372809
142089 Ref: 5405\7f2372810
142090 Ref: 5406\7f2373033
142091 Ref: 5407\7f2373033
142092 Ref: 5408\7f2373182
142093 Ref: 5409\7f2373516
142094 Ref: 5410\7f2374801
142095 Ref: 5411\7f2376982
142096 Ref: 5412\7f2384229
142097 Ref: 5413\7f2384244
142098 Ref: 5414\7f2384593
142099 Ref: 5415\7f2384608
142100 Ref: 5416\7f2384796
142101 Ref: 5417\7f2384796
142102 Ref: 5418\7f2385210
142103 Ref: 5419\7f2385562
142104 Ref: 5420\7f2385577
142105 Ref: 5421\7f2386185
142106 Ref: 5422\7f2386187
142107 Ref: 5423\7f2386622
142108 Ref: 5424\7f2386622
142109 Ref: 5425\7f2391323
142110 Ref: 5426\7f2392737
142111 Ref: 5427\7f2396686
142112 Ref: 5428\7f2403389
142113 Ref: 5429\7f2404199
142114 Ref: 5430\7f2404214
142115 Ref: 5431\7f2406236
142116 Ref: 5432\7f2406236
142117 Ref: 5433\7f2408047
142118 Ref: 5434\7f2408047
142119 Ref: 5435\7f2408047
142120 Ref: 5436\7f2408385
142121 Ref: 5437\7f2408400
142122 Ref: 5438\7f2408534
142123 Ref: 5439\7f2408549
142124 Ref: 5440\7f2408774
142125 Ref: 5441\7f2408774
142126 Ref: 5442\7f2409342
142127 Ref: 5443\7f2410937
142128 Ref: 5444\7f2410952
142129 Ref: 5445\7f2412019
142130 Ref: 5446\7f2412034
142131 Ref: 5447\7f2413403
142132 Ref: 5448\7f2413418
142133 Ref: 5449\7f2413507
142134 Ref: 5450\7f2413508
142135 Ref: 5451\7f2413830
142136 Ref: 5452\7f2413830
142137 Ref: 5453\7f2420786
142138 Ref: 5454\7f2423752
142139 Ref: 5455\7f2424863
142140 Ref: 5456\7f2425387
142141 Node: 13.4\7f2426080
142142 Ref: 5457\7f2426410
142143 Ref: S0310\7f2426410
142144 Ref: 5458\7f2426442
142145 Ref: 5459\7f2426457
142146 Ref: 5460\7f2426509
142147 Ref: S0311\7f2426509
142148 Ref: 5461\7f2426513
142149 Ref: 5462\7f2426582
142150 Ref: 5463\7f2428151
142151 Ref: 5464\7f2428234
142152 Ref: 5465\7f2428377
142153 Ref: 5466\7f2428377
142154 Ref: 5467\7f2429638
142155 Ref: 5468\7f2432283
142156 Node: 13.5\7f2433246
142157 Ref: 5469\7f2433358
142158 Ref: 5470\7f2433358
142159 Ref: 5471\7f2433358
142160 Ref: 5472\7f2433358
142161 Ref: 5473\7f2433358
142162 Ref: 5474\7f2433358
142163 Ref: 5475\7f2433358
142164 Ref: 5476\7f2433358
142165 Ref: 5477\7f2433358
142166 Node: 13.5.1\7f2433725
142167 Ref: 5478\7f2434056
142168 Ref: 5479\7f2434583
142169 Ref: S0312\7f2434583
142170 Ref: 5480\7f2434615
142171 Ref: 5481\7f2434649
142172 Ref: 5482\7f2434675
142173 Ref: 5483\7f2434740
142174 Ref: S0313\7f2434740
142175 Ref: 5484\7f2434764
142176 Ref: 5485\7f2434778
142177 Ref: 5486\7f2434793
142178 Ref: 5487\7f2434806
142179 Ref: 5488\7f2434832
142180 Ref: S0314\7f2434832
142181 Ref: 5489\7f2434844
142182 Ref: 5490\7f2434872
142183 Ref: S0315\7f2434872
142184 Ref: 5491\7f2434884
142185 Ref: 5492\7f2434918
142186 Ref: S0316\7f2434918
142187 Ref: 5493\7f2434930
142188 Ref: 5494\7f2435196
142189 Ref: 5495\7f2435196
142190 Ref: 5496\7f2435196
142191 Ref: 5497\7f2435196
142192 Ref: 5498\7f2441774
142193 Ref: 5499\7f2442488
142194 Ref: 5500\7f2449436
142195 Ref: 5501\7f2450183
142196 Node: 13.5.2\7f2450398
142197 Ref: 5502\7f2450590
142198 Ref: 5503\7f2450898
142199 Ref: 5504\7f2450913
142200 Ref: 5505\7f2452025
142201 Ref: 5506\7f2452040
142202 Ref: 5507\7f2452687
142203 Ref: 5508\7f2452702
142204 Ref: 5509\7f2453832
142205 Ref: 5510\7f2453832
142206 Ref: 5511\7f2455343
142207 Node: 13.5.3\7f2455726
142208 Ref: 5512\7f2456676
142209 Ref: 5513\7f2456763
142210 Ref: 5514\7f2456765
142211 Ref: 5515\7f2456765
142212 Ref: 5516\7f2457000
142213 Ref: 5517\7f2457002
142214 Ref: 5518\7f2457002
142215 Ref: 5519\7f2457216
142216 Ref: 5520\7f2457231
142217 Ref: 5521\7f2457346
142218 Ref: 5522\7f2457348
142219 Ref: 5523\7f2457530
142220 Ref: 5524\7f2457530
142221 Ref: 5525\7f2457879
142222 Ref: 5526\7f2459019
142223 Ref: 5527\7f2460358
142224 Node: 13.6\7f2460593
142225 Ref: 5528\7f2460755
142226 Ref: 5529\7f2460755
142227 Node: 13.7\7f2462431
142228 Ref: 5530\7f2462949
142229 Ref: 5531\7f2463012
142230 Ref: 5532\7f2463064
142231 Ref: 5533\7f2463176
142232 Ref: 5534\7f2463240
142233 Ref: 5535\7f2463306
142234 Ref: 5536\7f2463374
142235 Ref: 5537\7f2463445
142236 Ref: 5538\7f2463507
142237 Ref: 5539\7f2463578
142238 Ref: 5540\7f2463646
142239 Ref: 5541\7f2463718
142240 Ref: 5542\7f2463845
142241 Ref: 5543\7f2463883
142242 Ref: 5544\7f2463928
142243 Ref: 5545\7f2463987
142244 Ref: 5546\7f2464061
142245 Ref: 5547\7f2464159
142246 Ref: 5548\7f2464880
142247 Ref: 5549\7f2464894
142248 Ref: 5550\7f2464912
142249 Ref: 5551\7f2464933
142250 Ref: 5552\7f2465084
142251 Ref: 5553\7f2465154
142252 Ref: 5554\7f2465265
142253 Ref: 5555\7f2465369
142254 Ref: 5556\7f2469982
142255 Ref: 5557\7f2473183
142256 Ref: 5558\7f2474950
142257 Node: 13.7.1\7f2475810
142258 Ref: 5559\7f2476103
142259 Ref: 5560\7f2476193
142260 Ref: 5561\7f2476260
142261 Ref: 5562\7f2476338
142262 Ref: 5563\7f2476449
142263 Ref: 5564\7f2476609
142264 Ref: 5565\7f2477374
142265 Ref: 5566\7f2477434
142266 Ref: 5567\7f2477543
142267 Ref: 5568\7f2478343
142268 Ref: 5569\7f2478345
142269 Ref: 5570\7f2479464
142270 Ref: 5571\7f2481209
142271 Node: 13.7.2\7f2481378
142272 Ref: 5572\7f2481669
142273 Ref: 5573\7f2481937
142274 Ref: 5574\7f2482045
142275 Ref: 5575\7f2482497
142276 Node: 13.8\7f2485478
142277 Ref: 5576\7f2485611
142278 Ref: 5577\7f2485798
142279 Ref: S0317\7f2485798
142280 Ref: 5578\7f2485802
142281 Ref: 5579\7f2486499
142282 Ref: 5580\7f2487171
142283 Ref: 5581\7f2487171
142284 Ref: 5582\7f2489444
142285 Ref: 5583\7f2489712
142286 Ref: 5584\7f2489725
142287 Node: 13.9\7f2489848
142288 Ref: 5585\7f2489988
142289 Ref: 5586\7f2489988
142290 Ref: 5587\7f2489989
142291 Ref: 5588\7f2489989
142292 Ref: 5589\7f2489989
142293 Ref: 5590\7f2490350
142294 Ref: 5591\7f2491593
142295 Ref: 5592\7f2491593
142296 Ref: 5593\7f2496363
142297 Ref: 5594\7f2496592
142298 Ref: 5595\7f2496592
142299 Node: 13.9.1\7f2497779
142300 Ref: 5596\7f2498238
142301 Ref: 5597\7f2498444
142302 Ref: 5598\7f2498444
142303 Ref: 5599\7f2498742
142304 Ref: 5600\7f2500564
142305 Ref: 5601\7f2500810
142306 Ref: 5602\7f2502319
142307 Ref: 5603\7f2502319
142308 Ref: 5604\7f2502578
142309 Ref: 5605\7f2502580
142310 Ref: 5606\7f2504314
142311 Ref: 5607\7f2510376
142312 Ref: 5608\7f2513001
142313 Ref: 5609\7f2513147
142314 Node: 13.9.2\7f2513723
142315 Ref: 5610\7f2514171
142316 Ref: 5611\7f2514186
142317 Ref: 5612\7f2514348
142318 Ref: 5613\7f2517070
142319 Node: 13.10\7f2517735
142320 Ref: 5614\7f2518207
142321 Ref: 5615\7f2518222
142322 Ref: 5616\7f2518514
142323 Ref: 5617\7f2519585
142324 Node: 13.11\7f2521535
142325 Ref: 5618\7f2521663
142326 Ref: 5619\7f2521664
142327 Ref: 5620\7f2521664
142328 Ref: 5621\7f2521664
142329 Ref: 5622\7f2524029
142330 Ref: 5623\7f2524166
142331 Ref: 5624\7f2524350
142332 Ref: 5625\7f2524612
142333 Ref: 5626\7f2524874
142334 Ref: 5627\7f2525256
142335 Ref: 5628\7f2525256
142336 Ref: 5629\7f2525329
142337 Ref: 5630\7f2525329
142338 Ref: 5631\7f2525329
142339 Ref: 5632\7f2525873
142340 Ref: 5633\7f2525888
142341 Ref: 5634\7f2526020
142342 Ref: 5635\7f2526035
142343 Ref: 5636\7f2526709
142344 Ref: 5637\7f2526709
142345 Ref: 5638\7f2526709
142346 Ref: 5639\7f2526709
142347 Ref: 5640\7f2526909
142348 Ref: 5641\7f2526909
142349 Ref: 5642\7f2526909
142350 Ref: 5643\7f2526909
142351 Ref: 5644\7f2528660
142352 Ref: 5645\7f2528846
142353 Ref: 5646\7f2528848
142354 Ref: 5647\7f2528848
142355 Ref: 5648\7f2529794
142356 Ref: 5649\7f2529804
142357 Ref: 5650\7f2530227
142358 Ref: 5651\7f2531463
142359 Ref: 5652\7f2532150
142360 Ref: 5653\7f2536197
142361 Ref: 5654\7f2536197
142362 Ref: 5655\7f2536199
142363 Ref: 5656\7f2550521
142364 Ref: 5657\7f2551665
142365 Ref: 5658\7f2552253
142366 Node: 13.11.1\7f2554198
142367 Ref: 5659\7f2554671
142368 Ref: 5660\7f2554686
142369 Ref: 5661\7f2555291
142370 Ref: 5662\7f2555306
142371 Ref: 5663\7f2557092
142372 Node: 13.11.2\7f2557155
142373 Ref: 5664\7f2557320
142374 Ref: 5665\7f2557320
142375 Ref: 5666\7f2557321
142376 Ref: 5667\7f2557321
142377 Ref: 5668\7f2557321
142378 Ref: 5669\7f2557732
142379 Ref: 5670\7f2558379
142380 Ref: 5671\7f2560089
142381 Ref: 5672\7f2560090
142382 Ref: 5673\7f2560090
142383 Ref: 5674\7f2560090
142384 Ref: 5675\7f2560303
142385 Ref: 5676\7f2560632
142386 Ref: 5677\7f2560632
142387 Ref: 5678\7f2560721
142388 Ref: 5679\7f2560721
142389 Ref: 5680\7f2561421
142390 Ref: 5681\7f2561422
142391 Node: 13.11.3\7f2565710
142392 Ref: 5682\7f2566141
142393 Ref: 5683\7f2566142
142394 Ref: 5684\7f2566170
142395 Ref: 5685\7f2566254
142396 Ref: S0318\7f2566254
142397 Ref: 5686\7f2566272
142398 Ref: 5687\7f2566971
142399 Ref: 5688\7f2566971
142400 Ref: 5689\7f2566971
142401 Ref: 5690\7f2568462
142402 Ref: 5691\7f2568462
142403 Ref: 5692\7f2572381
142404 Ref: 5693\7f2573297
142405 Node: 13.11.4\7f2574071
142406 Ref: 5694\7f2574651
142407 Ref: 5695\7f2574755
142408 Ref: 5696\7f2574864
142409 Ref: 5697\7f2574931
142410 Ref: 5698\7f2575049
142411 Ref: 5699\7f2575291
142412 Ref: 5700\7f2575431
142413 Ref: 5701\7f2575589
142414 Ref: 5702\7f2576001
142415 Ref: 5703\7f2576256
142416 Ref: 5704\7f2576430
142417 Ref: 5705\7f2576716
142418 Ref: 5706\7f2577035
142419 Ref: 5707\7f2577329
142420 Ref: 5708\7f2577330
142421 Ref: 5709\7f2577330
142422 Ref: 5710\7f2577330
142423 Ref: 5711\7f2577330
142424 Ref: 5712\7f2578325
142425 Ref: 5713\7f2580273
142426 Ref: 5714\7f2580273
142427 Ref: 5715\7f2580768
142428 Ref: 5716\7f2581429
142429 Ref: 5717\7f2581429
142430 Ref: 5718\7f2581540
142431 Ref: 5719\7f2581540
142432 Ref: 5720\7f2581627
142433 Ref: 5721\7f2582954
142434 Ref: 5722\7f2582954
142435 Ref: 5723\7f2582954
142436 Ref: 5724\7f2586726
142437 Node: 13.11.5\7f2586802
142438 Ref: 5725\7f2587226
142439 Ref: 5726\7f2587767
142440 Ref: 5727\7f2589385
142441 Node: 13.11.6\7f2589424
142442 Node: 13.12\7f2595947
142443 Ref: 5728\7f2596532
142444 Ref: 5729\7f2596533
142445 Ref: 5730\7f2596546
142446 Ref: 5731\7f2596559
142447 Ref: 5732\7f2596625
142448 Ref: S0319\7f2596625
142449 Ref: 5733\7f2596642
142450 Ref: 5734\7f2596686
142451 Ref: 5735\7f2596700
142452 Ref: 5736\7f2596808
142453 Ref: S0320\7f2596808
142454 Ref: 5737\7f2596812
142455 Ref: 5738\7f2596825
142456 Ref: 5739\7f2596888
142457 Ref: 5740\7f2597321
142458 Ref: 5741\7f2597322
142459 Ref: 5742\7f2600867
142460 Ref: 5743\7f2600868
142461 Ref: 5744\7f2600885
142462 Ref: 5745\7f2600907
142463 Ref: 5746\7f2601548
142464 Ref: 5747\7f2601549
142465 Ref: 5748\7f2602963
142466 Ref: 5749\7f2603130
142467 Node: 13.12.1\7f2604506
142468 Ref: 5750\7f2604901
142469 Ref: 5751\7f2604902
142470 Ref: 5752\7f2605612
142471 Ref: 5753\7f2605613
142472 Ref: 5754\7f2605891
142473 Ref: 5755\7f2605892
142474 Ref: 5756\7f2608345
142475 Ref: 5757\7f2608346
142476 Ref: 5758\7f2608613
142477 Ref: 5759\7f2608614
142478 Ref: 5760\7f2608995
142479 Ref: 5761\7f2608996
142480 Ref: 5762\7f2610377
142481 Ref: 5763\7f2610378
142482 Ref: 5764\7f2610522
142483 Ref: 5765\7f2610523
142484 Ref: 5766\7f2610716
142485 Ref: 5767\7f2610717
142486 Ref: 5768\7f2610896
142487 Ref: 5769\7f2610897
142488 Ref: 5770\7f2613881
142489 Ref: 5771\7f2614477
142490 Ref: 5772\7f2614872
142491 Node: 13.13\7f2615201
142492 Ref: 5773\7f2615306
142493 Ref: 5774\7f2615306
142494 Ref: 5775\7f2616050
142495 Node: 13.13.1\7f2616173
142496 Ref: 5776\7f2617020
142497 Ref: 5777\7f2617077
142498 Ref: 5778\7f2617127
142499 Ref: 5779\7f2617313
142500 Ref: 5780\7f2617373
142501 Ref: 5781\7f2617445
142502 Ref: 5782\7f2617555
142503 Ref: 5783\7f2617679
142504 Ref: 5784\7f2617858
142505 Ref: 5785\7f2620923
142506 Node: 13.13.2\7f2621396
142507 Ref: 5786\7f2621960
142508 Ref: 5787\7f2621975
142509 Ref: 5788\7f2622746
142510 Ref: 5789\7f2622746
142511 Ref: 5790\7f2624656
142512 Ref: 5791\7f2626270
142513 Ref: 5792\7f2626285
142514 Ref: 5793\7f2626627
142515 Ref: 5794\7f2626642
142516 Ref: 5795\7f2632557
142517 Ref: 5796\7f2632572
142518 Ref: 5797\7f2633041
142519 Ref: 5798\7f2633056
142520 Ref: 5799\7f2633947
142521 Ref: 5800\7f2633962
142522 Ref: 5801\7f2634498
142523 Ref: 5802\7f2634513
142524 Ref: 5803\7f2637684
142525 Ref: 5804\7f2637699
142526 Ref: 5805\7f2638771
142527 Ref: 5806\7f2638786
142528 Ref: 5807\7f2640007
142529 Ref: 5808\7f2640008
142530 Ref: 5809\7f2640255
142531 Ref: 5810\7f2641984
142532 Ref: 5811\7f2642284
142533 Ref: 5812\7f2642595
142534 Ref: 5813\7f2642596
142535 Ref: 5814\7f2642596
142536 Ref: 5815\7f2642596
142537 Ref: 5816\7f2642596
142538 Ref: 5817\7f2642596
142539 Ref: 5818\7f2642596
142540 Ref: 5819\7f2642596
142541 Ref: 5820\7f2643006
142542 Ref: 5821\7f2643008
142543 Ref: 5822\7f2643008
142544 Ref: 5823\7f2643008
142545 Ref: 5824\7f2643008
142546 Ref: 5825\7f2643008
142547 Ref: 5826\7f2643008
142548 Ref: 5827\7f2643008
142549 Ref: 5828\7f2646648
142550 Ref: 5829\7f2651847
142551 Ref: 5830\7f2651848
142552 Ref: 5831\7f2652898
142553 Ref: 5832\7f2658743
142554 Ref: 5833\7f2659951
142555 Ref: 5834\7f2663686
142556 Ref: 5835\7f2664147
142557 Node: 13.14\7f2666014
142558 Ref: 5836\7f2674659
142559 Ref: 5837\7f2674659
142560 Ref: 5838\7f2675381
142561 Ref: 5839\7f2675780
142562 Ref: 5840\7f2675985
142563 Ref: 5841\7f2678828
142564 Ref: 5842\7f2678968
142565 Ref: 5843\7f2679304
142566 Ref: 5844\7f2679995
142567 Ref: 5845\7f2680202
142568 Ref: 5846\7f2682205
142569 Ref: 5847\7f2682302
142570 Ref: 5848\7f2682779
142571 Ref: 5849\7f2683017
142572 Ref: 5850\7f2683265
142573 Ref: 5851\7f2685282
142574 Ref: 5852\7f2685283
142575 Ref: 5853\7f2686817
142576 Ref: 5854\7f2686818
142577 Ref: 5855\7f2687443
142578 Ref: 5856\7f2688460
142579 Ref: 5857\7f2688603
142580 Ref: 5858\7f2689187
142581 Ref: 5859\7f2689587
142582 Ref: 5860\7f2689889
142583 Ref: 5861\7f2690842
142584 Ref: 5862\7f2691105
142585 Ref: 5863\7f2691164
142586 Ref: 5864\7f2691166
142587 Ref: 5865\7f2691409
142588 Ref: 5866\7f2691411
142589 Ref: 5867\7f2698076
142590 Ref: 5868\7f2699823
142591 Ref: 5869\7f2699883
142592 Ref: 5870\7f2700883
142593 Ref: 5871\7f2705158
142594 Ref: 5872\7f2706530
142595 Node: Annex A\7f2707540
142596 Ref: 5873\7f2707700
142597 Ref: 5874\7f2707700
142598 Ref: 5875\7f2719186
142599 Node: A.1\7f2724137
142600 Ref: 5876\7f2724398
142601 Ref: 5877\7f2724606
142602 Ref: 5878\7f2725119
142603 Ref: 5879\7f2725191
142604 Ref: 5880\7f2726481
142605 Ref: 5881\7f2726542
142606 Ref: 5882\7f2726603
142607 Ref: 5883\7f2728498
142608 Ref: 5884\7f2731254
142609 Ref: 5885\7f2734999
142610 Ref: 5886\7f2735389
142611 Ref: 5887\7f2735524
142612 Ref: 5888\7f2735580
142613 Ref: 5889\7f2735663
142614 Ref: 5890\7f2736573
142615 Ref: 5891\7f2736814
142616 Ref: 5892\7f2737055
142617 Ref: 5893\7f2737296
142618 Ref: 5894\7f2737333
142619 Ref: 5895\7f2737370
142620 Ref: 5896\7f2737407
142621 Ref: 5897\7f2738401
142622 Ref: 5898\7f2742604
142623 Ref: 5899\7f2743414
142624 Node: A.2\7f2744290
142625 Ref: 5900\7f2744510
142626 Ref: 5901\7f2745975
142627 Node: A.3\7f2746010
142628 Ref: 5902\7f2746774
142629 Node: A.3.1\7f2747378
142630 Ref: 5903\7f2747699
142631 Ref: 5904\7f2747893
142632 Ref: 5905\7f2748107
142633 Ref: 5906\7f2749056
142634 Node: A.3.2\7f2749131
142635 Ref: 5907\7f2749542
142636 Ref: 5908\7f2749664
142637 Ref: 5909\7f2749739
142638 Ref: 5910\7f2749814
142639 Ref: 5911\7f2749889
142640 Ref: 5912\7f2749964
142641 Ref: 5913\7f2750039
142642 Ref: 5914\7f2750114
142643 Ref: 5915\7f2750189
142644 Ref: 5916\7f2750307
142645 Ref: 5917\7f2750382
142646 Ref: 5918\7f2750457
142647 Ref: 5919\7f2750532
142648 Ref: 5920\7f2750607
142649 Ref: 5921\7f2750682
142650 Ref: 5922\7f2750757
142651 Ref: 5923\7f2750836
142652 Ref: 5924\7f2750970
142653 Ref: 5925\7f2751035
142654 Ref: 5926\7f2751100
142655 Ref: 5927\7f2751168
142656 Ref: 5928\7f2751227
142657 Ref: 5929\7f2751286
142658 Ref: 5930\7f2751422
142659 Ref: 5931\7f2751518
142660 Ref: 5932\7f2751583
142661 Ref: 5933\7f2751652
142662 Ref: 5934\7f2751796
142663 Ref: 5935\7f2752959
142664 Ref: 5936\7f2753150
142665 Ref: 5937\7f2753343
142666 Ref: 5938\7f2753594
142667 Ref: 5939\7f2753820
142668 Ref: 5940\7f2754063
142669 Ref: 5941\7f2754322
142670 Ref: 5942\7f2754513
142671 Ref: 5943\7f2754747
142672 Ref: 5944\7f2754941
142673 Ref: 5945\7f2760290
142674 Ref: 5946\7f2760463
142675 Node: A.3.3\7f2761730
142676 Ref: 5947\7f2762490
142677 Ref: 5948\7f2762552
142678 Ref: 5949\7f2762560
142679 Ref: 5950\7f2762632
142680 Ref: 5951\7f2762704
142681 Ref: 5952\7f2762776
142682 Ref: 5953\7f2762848
142683 Ref: 5954\7f2762920
142684 Ref: 5955\7f2762992
142685 Ref: 5956\7f2763064
142686 Ref: 5957\7f2763136
142687 Ref: 5958\7f2763208
142688 Ref: 5959\7f2763280
142689 Ref: 5960\7f2763353
142690 Ref: 5961\7f2763426
142691 Ref: 5962\7f2763499
142692 Ref: 5963\7f2763572
142693 Ref: 5964\7f2763645
142694 Ref: 5965\7f2763721
142695 Ref: 5966\7f2763794
142696 Ref: 5967\7f2763867
142697 Ref: 5968\7f2763940
142698 Ref: 5969\7f2764013
142699 Ref: 5970\7f2764086
142700 Ref: 5971\7f2764159
142701 Ref: 5972\7f2764232
142702 Ref: 5973\7f2764305
142703 Ref: 5974\7f2764378
142704 Ref: 5975\7f2764451
142705 Ref: 5976\7f2764524
142706 Ref: 5977\7f2764597
142707 Ref: 5978\7f2764670
142708 Ref: 5979\7f2764743
142709 Ref: 5980\7f2764816
142710 Ref: 5981\7f2764931
142711 Ref: 5982\7f2765012
142712 Ref: 5983\7f2765093
142713 Ref: 5984\7f2765174
142714 Ref: 5985\7f2765255
142715 Ref: 5986\7f2765336
142716 Ref: 5987\7f2765417
142717 Ref: 5988\7f2765498
142718 Ref: 5989\7f2765579
142719 Ref: 5990\7f2765660
142720 Ref: 5991\7f2765741
142721 Ref: 5992\7f2765822
142722 Ref: 5993\7f2765903
142723 Ref: 5994\7f2765984
142724 Ref: 5995\7f2766065
142725 Ref: 5996\7f2766123
142726 Ref: 5997\7f2766204
142727 Ref: 5998\7f2766365
142728 Ref: 5999\7f2766446
142729 Ref: 6000\7f2766527
142730 Ref: 6001\7f2766608
142731 Ref: 6002\7f2766689
142732 Ref: 6003\7f2766770
142733 Ref: 6004\7f2766851
142734 Ref: 6005\7f2767007
142735 Ref: 6006\7f2767088
142736 Ref: 6007\7f2767169
142737 Ref: 6008\7f2767250
142738 Ref: 6009\7f2767331
142739 Ref: 6010\7f2767416
142740 Ref: 6011\7f2767497
142741 Ref: 6012\7f2767578
142742 Ref: 6013\7f2767659
142743 Ref: 6014\7f2767740
142744 Ref: 6015\7f2767822
142745 Ref: 6016\7f2767904
142746 Ref: 6017\7f2767986
142747 Ref: 6018\7f2768068
142748 Ref: 6019\7f2768150
142749 Ref: 6020\7f2768232
142750 Ref: 6021\7f2768314
142751 Ref: 6022\7f2768396
142752 Ref: 6023\7f2768478
142753 Ref: 6024\7f2768560
142754 Ref: 6025\7f2768642
142755 Ref: 6026\7f2768728
142756 Ref: 6027\7f2768810
142757 Ref: 6028\7f2768892
142758 Ref: 6029\7f2768974
142759 Ref: 6030\7f2769056
142760 Ref: 6031\7f2769138
142761 Ref: 6032\7f2769220
142762 Ref: 6033\7f2769302
142763 Ref: 6034\7f2769384
142764 Ref: 6035\7f2769466
142765 Ref: 6036\7f2769548
142766 Ref: 6037\7f2769630
142767 Ref: 6038\7f2769712
142768 Ref: 6039\7f2769794
142769 Ref: 6040\7f2769876
142770 Ref: 6041\7f2769958
142771 Ref: 6042\7f2770068
142772 Ref: 6043\7f2770077
142773 Ref: 6044\7f2770131
142774 Ref: 6045\7f2770185
142775 Ref: 6046\7f2770239
142776 Ref: 6047\7f2770297
142777 Ref: 6048\7f2770371
142778 Ref: 6049\7f2770445
142779 Ref: 6050\7f2770519
142780 Ref: 6051\7f2770593
142781 Ref: 6052\7f2770667
142782 Ref: 6053\7f2770741
142783 Ref: 6054\7f2770815
142784 Ref: 6055\7f2770889
142785 Ref: 6056\7f2770963
142786 Ref: 6057\7f2771037
142787 Ref: 6058\7f2771111
142788 Ref: 6059\7f2771185
142789 Ref: 6060\7f2771259
142790 Ref: 6061\7f2771333
142791 Ref: 6062\7f2771407
142792 Ref: 6063\7f2771485
142793 Ref: 6064\7f2771559
142794 Ref: 6065\7f2771633
142795 Ref: 6066\7f2771707
142796 Ref: 6067\7f2771781
142797 Ref: 6068\7f2771855
142798 Ref: 6069\7f2771929
142799 Ref: 6070\7f2772003
142800 Ref: 6071\7f2772081
142801 Ref: 6072\7f2772155
142802 Ref: 6073\7f2772229
142803 Ref: 6074\7f2772303
142804 Ref: 6075\7f2772377
142805 Ref: 6076\7f2772451
142806 Ref: 6077\7f2772525
142807 Ref: 6078\7f2772599
142808 Ref: 6079\7f2772800
142809 Ref: 6080\7f2772886
142810 Ref: 6081\7f2772958
142811 Ref: 6082\7f2773044
142812 Ref: 6083\7f2773130
142813 Ref: 6084\7f2773216
142814 Ref: 6085\7f2773302
142815 Ref: 6086\7f2773388
142816 Ref: 6087\7f2773474
142817 Ref: 6088\7f2773560
142818 Ref: 6089\7f2773646
142819 Ref: 6090\7f2773732
142820 Ref: 6091\7f2773818
142821 Ref: 6092\7f2773904
142822 Ref: 6093\7f2773990
142823 Ref: 6094\7f2774070
142824 Ref: 6095\7f2774156
142825 Ref: 6096\7f2774304
142826 Ref: 6097\7f2774390
142827 Ref: 6098\7f2774459
142828 Ref: 6099\7f2774545
142829 Ref: 6100\7f2774631
142830 Ref: 6101\7f2774717
142831 Ref: 6102\7f2774803
142832 Ref: 6103\7f2774889
142833 Ref: 6104\7f2774975
142834 Ref: 6105\7f2775045
142835 Ref: 6106\7f2775131
142836 Ref: 6107\7f2775217
142837 Ref: 6108\7f2775303
142838 Ref: 6109\7f2775389
142839 Ref: 6110\7f2775475
142840 Ref: 6111\7f2775561
142841 Ref: 6112\7f2775647
142842 Ref: 6113\7f2775733
142843 Ref: 6114\7f2775881
142844 Ref: 6115\7f2775967
142845 Ref: 6116\7f2776053
142846 Ref: 6117\7f2776139
142847 Ref: 6118\7f2776225
142848 Ref: 6119\7f2776311
142849 Ref: 6120\7f2776397
142850 Ref: 6121\7f2776483
142851 Ref: 6122\7f2776569
142852 Ref: 6123\7f2776655
142853 Ref: 6124\7f2776741
142854 Ref: 6125\7f2776827
142855 Ref: 6126\7f2776913
142856 Ref: 6127\7f2776999
142857 Ref: 6128\7f2777085
142858 Ref: 6129\7f2777171
142859 Ref: 6130\7f2777319
142860 Ref: 6131\7f2777405
142861 Ref: 6132\7f2777491
142862 Ref: 6133\7f2777577
142863 Ref: 6134\7f2777663
142864 Ref: 6135\7f2777749
142865 Ref: 6136\7f2777835
142866 Ref: 6137\7f2777921
142867 Ref: 6138\7f2778007
142868 Ref: 6139\7f2778093
142869 Ref: 6140\7f2778179
142870 Ref: 6141\7f2778265
142871 Ref: 6142\7f2778351
142872 Ref: 6143\7f2778437
142873 Ref: 6144\7f2778523
142874 Ref: 6145\7f2778609
142875 Ref: 6146\7f2778757
142876 Ref: 6147\7f2778843
142877 Ref: 6148\7f2778929
142878 Ref: 6149\7f2779015
142879 Ref: 6150\7f2779101
142880 Ref: 6151\7f2779187
142881 Ref: 6152\7f2779273
142882 Ref: 6153\7f2779359
142883 Ref: 6154\7f2779445
142884 Ref: 6155\7f2779531
142885 Ref: 6156\7f2779617
142886 Ref: 6157\7f2779703
142887 Ref: 6158\7f2779789
142888 Ref: 6159\7f2779875
142889 Ref: 6160\7f2779961
142890 Ref: 6161\7f2780047
142891 Ref: 6162\7f2780195
142892 Ref: 6163\7f2780281
142893 Ref: 6164\7f2780367
142894 Ref: 6165\7f2780453
142895 Ref: 6166\7f2780539
142896 Ref: 6167\7f2780625
142897 Ref: 6168\7f2780711
142898 Ref: 6169\7f2780797
142899 Ref: 6170\7f2780883
142900 Ref: 6171\7f2780969
142901 Ref: 6172\7f2781055
142902 Ref: 6173\7f2781141
142903 Ref: 6174\7f2781227
142904 Ref: 6175\7f2781313
142905 Ref: 6176\7f2781399
142906 Ref: 6177\7f2781485
142907 Node: A.3.4\7f2782144
142908 Ref: 6178\7f2782502
142909 Ref: 6179\7f2782559
142910 Ref: 6180\7f2782637
142911 Ref: 6181\7f2782715
142912 Ref: 6182\7f2782793
142913 Ref: 6183\7f2782871
142914 Ref: 6184\7f2782965
142915 Ref: 6185\7f2783061
142916 Ref: 6186\7f2783141
142917 Ref: 6187\7f2783218
142918 Ref: 6188\7f2783319
142919 Ref: 6189\7f2783414
142920 Ref: 6190\7f2783520
142921 Ref: 6191\7f2783625
142922 Ref: 6192\7f2783781
142923 Ref: 6193\7f2783932
142924 Ref: 6194\7f2784094
142925 Ref: 6195\7f2784250
142926 Ref: 6196\7f2784432
142927 Ref: 6197\7f2789349
142928 Node: A.3.5\7f2789475
142929 Ref: 6198\7f2790044
142930 Ref: 6199\7f2790123
142931 Ref: 6200\7f2790182
142932 Ref: 6201\7f2790255
142933 Ref: 6202\7f2790327
142934 Ref: 6203\7f2790398
142935 Ref: 6204\7f2790469
142936 Ref: 6205\7f2790541
142937 Ref: 6206\7f2790649
142938 Ref: 6207\7f2790733
142939 Ref: 6208\7f2790812
142940 Ref: 6209\7f2790886
142941 Ref: 6210\7f2790968
142942 Ref: 6211\7f2791039
142943 Ref: 6212\7f2791118
142944 Ref: 6213\7f2791206
142945 Ref: 6214\7f2791278
142946 Ref: 6215\7f2791352
142947 Ref: 6216\7f2791425
142948 Ref: 6217\7f2791504
142949 Ref: 6218\7f2791571
142950 Ref: 6219\7f2799870
142951 Node: A.3.6\7f2799927
142952 Ref: 6220\7f2800155
142953 Ref: 6221\7f2800446
142954 Node: A.4\7f2800508
142955 Ref: 6222\7f2801291
142956 Node: A.4.1\7f2801986
142957 Ref: 6223\7f2802295
142958 Ref: 6224\7f2802395
142959 Ref: 6225\7f2802443
142960 Ref: 6226\7f2802496
142961 Ref: 6227\7f2802562
142962 Ref: 6228\7f2802581
142963 Ref: 6229\7f2802596
142964 Ref: 6230\7f2802609
142965 Ref: 6231\7f2802656
142966 Ref: 6232\7f2802706
142967 Ref: 6233\7f2802755
142968 Ref: 6234\7f2802801
142969 Ref: 6235\7f2802849
142970 Ref: 6236\7f2803029
142971 Node: A.4.2\7f2803438
142972 Ref: 6237\7f2803868
142973 Ref: 6238\7f2804027
142974 Ref: 6239\7f2804119
142975 Ref: 6240\7f2804175
142976 Ref: 6241\7f2804359
142977 Ref: 6242\7f2804445
142978 Ref: 6243\7f2804527
142979 Ref: 6244\7f2804609
142980 Ref: 6245\7f2805164
142981 Ref: 6246\7f2805295
142982 Ref: 6247\7f2805655
142983 Ref: 6248\7f2805706
142984 Ref: 6249\7f2805791
142985 Ref: 6250\7f2805872
142986 Ref: 6251\7f2806049
142987 Ref: 6252\7f2806164
142988 Ref: 6253\7f2806287
142989 Ref: 6254\7f2806352
142990 Ref: 6255\7f2806456
142991 Ref: 6256\7f2806550
142992 Ref: 6257\7f2806644
142993 Ref: 6258\7f2810659
142994 Ref: 6259\7f2810776
142995 Ref: 6260\7f2812929
142996 Ref: 6261\7f2813683
142997 Node: A.4.3\7f2814291
142998 Ref: 6262\7f2816070
142999 Ref: 6263\7f2816231
143000 Ref: 6264\7f2816565
143001 Ref: 6265\7f2816902
143002 Ref: 6266\7f2817198
143003 Ref: 6267\7f2817497
143004 Ref: 6268\7f2817784
143005 Ref: 6269\7f2818082
143006 Ref: 6270\7f2818363
143007 Ref: 6271\7f2818572
143008 Ref: 6272\7f2818725
143009 Ref: 6273\7f2818965
143010 Ref: 6274\7f2819159
143011 Ref: 6275\7f2819324
143012 Ref: 6276\7f2819652
143013 Ref: 6277\7f2819970
143014 Ref: 6278\7f2820115
143015 Ref: 6279\7f2820239
143016 Ref: 6280\7f2820393
143017 Ref: 6281\7f2820572
143018 Ref: 6282\7f2820822
143019 Ref: 6283\7f2821256
143020 Ref: 6284\7f2821430
143021 Ref: 6285\7f2821645
143022 Ref: 6286\7f2821828
143023 Ref: 6287\7f2822055
143024 Ref: 6288\7f2822227
143025 Ref: 6289\7f2822532
143026 Ref: 6290\7f2822651
143027 Ref: 6291\7f2822864
143028 Ref: 6292\7f2823048
143029 Ref: 6293\7f2823336
143030 Ref: 6294\7f2823509
143031 Ref: 6295\7f2823721
143032 Ref: 6296\7f2823894
143033 Ref: 6297\7f2844263
143034 Ref: 6298\7f2844515
143035 Ref: 6299\7f2845555
143036 Node: A.4.4\7f2846169
143037 Ref: 6300\7f2847738
143038 Ref: 6301\7f2847917
143039 Ref: 6302\7f2847952
143040 Ref: 6303\7f2848015
143041 Ref: 6304\7f2848051
143042 Ref: 6305\7f2848125
143043 Ref: 6306\7f2848195
143044 Ref: 6307\7f2848342
143045 Ref: 6308\7f2848514
143046 Ref: 6309\7f2848626
143047 Ref: 6310\7f2848808
143048 Ref: 6311\7f2848977
143049 Ref: 6312\7f2849180
143050 Ref: 6313\7f2849383
143051 Ref: 6314\7f2849589
143052 Ref: 6315\7f2849796
143053 Ref: 6316\7f2849988
143054 Ref: 6317\7f2850172
143055 Ref: 6318\7f2850907
143056 Ref: 6319\7f2851052
143057 Ref: 6320\7f2851247
143058 Ref: 6321\7f2851465
143059 Ref: 6322\7f2851694
143060 Ref: 6323\7f2853441
143061 Ref: 6324\7f2853805
143062 Ref: 6325\7f2854128
143063 Ref: 6326\7f2854451
143064 Ref: 6327\7f2854761
143065 Ref: 6328\7f2855085
143066 Ref: 6329\7f2855389
143067 Ref: 6330\7f2855618
143068 Ref: 6331\7f2855788
143069 Ref: 6332\7f2856050
143070 Ref: 6333\7f2856264
143071 Ref: 6334\7f2856446
143072 Ref: 6335\7f2856800
143073 Ref: 6336\7f2857144
143074 Ref: 6337\7f2857314
143075 Ref: 6338\7f2857452
143076 Ref: 6339\7f2857631
143077 Ref: 6340\7f2857827
143078 Ref: 6341\7f2858178
143079 Ref: 6342\7f2858500
143080 Ref: 6343\7f2858765
143081 Ref: 6344\7f2859000
143082 Ref: 6345\7f2859281
143083 Ref: 6346\7f2859532
143084 Ref: 6347\7f2859732
143085 Ref: 6348\7f2859943
143086 Ref: 6349\7f2860083
143087 Ref: 6350\7f2860195
143088 Ref: 6351\7f2860407
143089 Ref: 6352\7f2860588
143090 Ref: 6353\7f2860849
143091 Ref: 6354\7f2861080
143092 Ref: 6355\7f2861341
143093 Ref: 6356\7f2862018
143094 Ref: 6357\7f2862226
143095 Ref: 6358\7f2862431
143096 Ref: 6359\7f2870209
143097 Ref: 6360\7f2870736
143098 Ref: 6361\7f2871901
143099 Node: A.4.5\7f2872379
143100 Ref: 6362\7f2873652
143101 Ref: 6363\7f2873777
143102 Ref: 6364\7f2873875
143103 Ref: 6365\7f2873951
143104 Ref: 6366\7f2874021
143105 Ref: 6367\7f2874075
143106 Ref: 6368\7f2874190
143107 Ref: 6369\7f2874288
143108 Ref: 6370\7f2874387
143109 Ref: 6371\7f2874498
143110 Ref: 6372\7f2874622
143111 Ref: 6373\7f2874747
143112 Ref: 6374\7f2874862
143113 Ref: 6375\7f2875518
143114 Ref: 6376\7f2875656
143115 Ref: 6377\7f2875844
143116 Ref: 6378\7f2876052
143117 Ref: 6379\7f2876272
143118 Ref: 6380\7f2877935
143119 Ref: 6381\7f2878283
143120 Ref: 6382\7f2878590
143121 Ref: 6383\7f2878899
143122 Ref: 6384\7f2879196
143123 Ref: 6385\7f2879505
143124 Ref: 6386\7f2879785
143125 Ref: 6387\7f2880004
143126 Ref: 6388\7f2880167
143127 Ref: 6389\7f2880416
143128 Ref: 6390\7f2880620
143129 Ref: 6391\7f2880795
143130 Ref: 6392\7f2881133
143131 Ref: 6393\7f2881461
143132 Ref: 6394\7f2881626
143133 Ref: 6395\7f2881760
143134 Ref: 6396\7f2881934
143135 Ref: 6397\7f2882123
143136 Ref: 6398\7f2882393
143137 Ref: 6399\7f2882634
143138 Ref: 6400\7f2882828
143139 Ref: 6401\7f2882992
143140 Ref: 6402\7f2883198
143141 Ref: 6403\7f2883374
143142 Ref: 6404\7f2883566
143143 Ref: 6405\7f2883728
143144 Ref: 6406\7f2883867
143145 Ref: 6407\7f2883975
143146 Ref: 6408\7f2884179
143147 Ref: 6409\7f2884353
143148 Ref: 6410\7f2884546
143149 Ref: 6411\7f2884709
143150 Ref: 6412\7f2884902
143151 Ref: 6413\7f2885601
143152 Ref: 6414\7f2889712
143153 Ref: 6415\7f2890956
143154 Ref: 6416\7f2891261
143155 Node: A.4.6\7f2891688
143156 Ref: 6417\7f2892478
143157 Ref: 6418\7f2892554
143158 Ref: 6419\7f2892610
143159 Ref: 6420\7f2892666
143160 Ref: 6421\7f2892722
143161 Ref: 6422\7f2892778
143162 Ref: 6423\7f2892834
143163 Ref: 6424\7f2892890
143164 Ref: 6425\7f2892946
143165 Ref: 6426\7f2893002
143166 Ref: 6427\7f2893058
143167 Ref: 6428\7f2893114
143168 Ref: 6429\7f2893173
143169 Ref: 6430\7f2893291
143170 Ref: 6431\7f2893409
143171 Ref: 6432\7f2894385
143172 Node: A.4.7\7f2894708
143173 Ref: 6433\7f2895750
143174 Ref: 6434\7f2895752
143175 Ref: 6435\7f2895752
143176 Ref: 6436\7f2895752
143177 Ref: 6437\7f2895752
143178 Ref: 6438\7f2895752
143179 Ref: 6439\7f2895752
143180 Ref: 6440\7f2895752
143181 Ref: 6441\7f2895752
143182 Ref: 6442\7f2895752
143183 Ref: 6443\7f2895752
143184 Ref: 6444\7f2895752
143185 Ref: 6445\7f2895752
143186 Ref: 6446\7f2895752
143187 Ref: 6447\7f2895752
143188 Ref: 6448\7f2895752
143189 Ref: 6449\7f2895866
143190 Ref: 6450\7f2896053
143191 Ref: 6451\7f2896155
143192 Ref: 6452\7f2896216
143193 Ref: 6453\7f2896422
143194 Ref: 6454\7f2896529
143195 Ref: 6455\7f2896633
143196 Ref: 6456\7f2896737
143197 Ref: 6457\7f2897416
143198 Ref: 6458\7f2897557
143199 Ref: 6459\7f2897942
143200 Ref: 6460\7f2898003
143201 Ref: 6461\7f2898110
143202 Ref: 6462\7f2898208
143203 Ref: 6463\7f2898416
143204 Ref: 6464\7f2898541
143205 Ref: 6465\7f2898679
143206 Ref: 6466\7f2898749
143207 Ref: 6467\7f2898863
143208 Ref: 6468\7f2898971
143209 Ref: 6469\7f2899075
143210 Ref: 6470\7f2901365
143211 Ref: 6471\7f2902028
143212 Ref: 6472\7f2902269
143213 Ref: 6473\7f2902851
143214 Ref: 6474\7f2903988
143215 Node: A.4.8\7f2904849
143216 Ref: 6475\7f2906070
143217 Ref: 6476\7f2906072
143218 Ref: 6477\7f2906072
143219 Ref: 6478\7f2906072
143220 Ref: 6479\7f2906072
143221 Ref: 6480\7f2906072
143222 Ref: 6481\7f2906072
143223 Ref: 6482\7f2906072
143224 Ref: 6483\7f2906072
143225 Ref: 6484\7f2906072
143226 Ref: 6485\7f2906072
143227 Ref: 6486\7f2906072
143228 Ref: 6487\7f2906072
143229 Ref: 6488\7f2906072
143230 Ref: 6489\7f2906072
143231 Ref: 6490\7f2906072
143232 Ref: 6491\7f2906274
143233 Ref: 6492\7f2906405
143234 Ref: 6493\7f2906519
143235 Ref: 6494\7f2906587
143236 Ref: 6495\7f2906817
143237 Ref: 6496\7f2906939
143238 Ref: 6497\7f2907055
143239 Ref: 6498\7f2907169
143240 Ref: 6499\7f2907929
143241 Ref: 6500\7f2908085
143242 Ref: 6501\7f2908505
143243 Ref: 6502\7f2908578
143244 Ref: 6503\7f2908699
143245 Ref: 6504\7f2908812
143246 Ref: 6505\7f2909024
143247 Ref: 6506\7f2909161
143248 Ref: 6507\7f2909319
143249 Ref: 6508\7f2909396
143250 Ref: 6509\7f2909525
143251 Ref: 6510\7f2909648
143252 Ref: 6511\7f2909766
143253 Ref: 6512\7f2910045
143254 Ref: 6513\7f2912286
143255 Ref: 6514\7f2912475
143256 Ref: 6515\7f2913238
143257 Ref: 6516\7f2913519
143258 Ref: 6517\7f2913960
143259 Node: A.4.9\7f2914911
143260 Ref: 6518\7f2915304
143261 Ref: 6519\7f2916081
143262 Ref: 6520\7f2916672
143263 Ref: 6521\7f2917097
143264 Ref: 6522\7f2917800
143265 Ref: 6523\7f2918234
143266 Ref: 6524\7f2918713
143267 Ref: 6525\7f2919674
143268 Ref: 6526\7f2919892
143269 Node: A.4.10\7f2920098
143270 Ref: 6527\7f2920510
143271 Ref: 6528\7f2921989
143272 Ref: 6529\7f2922440
143273 Ref: 6530\7f2922936
143274 Ref: 6531\7f2923390
143275 Ref: 6532\7f2923855
143276 Ref: 6533\7f2924305
143277 Ref: 6534\7f2924798
143278 Ref: 6535\7f2925151
143279 Node: A.4.11\7f2925555
143280 Ref: 6536\7f2926154
143281 Ref: 6537\7f2926307
143282 Ref: 6538\7f2926376
143283 Ref: 6539\7f2926419
143284 Ref: 6540\7f2926464
143285 Ref: 6541\7f2926507
143286 Ref: 6542\7f2926548
143287 Ref: 6543\7f2926732
143288 Ref: 6544\7f2926869
143289 Ref: 6545\7f2927006
143290 Ref: 6546\7f2927133
143291 Ref: 6547\7f2927340
143292 Ref: 6548\7f2927502
143293 Ref: 6549\7f2927759
143294 Ref: 6550\7f2927976
143295 Ref: 6551\7f2928136
143296 Ref: 6552\7f2928342
143297 Ref: 6553\7f2928557
143298 Ref: 6554\7f2928730
143299 Ref: 6555\7f2928922
143300 Ref: 6556\7f2929052
143301 Ref: 6557\7f2929199
143302 Ref: 6558\7f2929329
143303 Ref: 6559\7f2929396
143304 Ref: 6560\7f2929531
143305 Ref: 6561\7f2929719
143306 Ref: 6562\7f2929916
143307 Ref: 6563\7f2930051
143308 Ref: 6564\7f2930203
143309 Ref: 6565\7f2930338
143310 Ref: 6566\7f2930410
143311 Ref: 6567\7f2930555
143312 Ref: 6568\7f2930758
143313 Ref: 6569\7f2930960
143314 Ref: 6570\7f2931100
143315 Ref: 6571\7f2931257
143316 Ref: 6572\7f2931397
143317 Ref: 6573\7f2931474
143318 Ref: 6574\7f2931986
143319 Ref: 6575\7f2931986
143320 Ref: 6576\7f2931986
143321 Ref: 6577\7f2931986
143322 Ref: 6578\7f2943173
143323 Node: A.5\7f2943401
143324 Ref: 6579\7f2944119
143325 Ref: 6580\7f2944154
143326 Ref: 6581\7f2944190
143327 Ref: 6582\7f2944323
143328 Ref: 6583\7f2945167
143329 Ref: 6584\7f2945327
143330 Node: A.5.1\7f2945560
143331 Ref: 6585\7f2946304
143332 Ref: 6586\7f2946434
143333 Ref: 6587\7f2946515
143334 Ref: 6588\7f2946596
143335 Ref: 6589\7f2946677
143336 Ref: 6590\7f2946842
143337 Ref: 6591\7f2946923
143338 Ref: 6592\7f2947004
143339 Ref: 6593\7f2947085
143340 Ref: 6594\7f2947166
143341 Ref: 6595\7f2947247
143342 Ref: 6596\7f2947328
143343 Ref: 6597\7f2947409
143344 Ref: 6598\7f2947493
143345 Ref: 6599\7f2947574
143346 Ref: 6600\7f2947655
143347 Ref: 6601\7f2947736
143348 Ref: 6602\7f2947817
143349 Ref: 6603\7f2948019
143350 Ref: 6604\7f2948221
143351 Ref: 6605\7f2948423
143352 Ref: 6606\7f2948628
143353 Ref: 6607\7f2948709
143354 Ref: 6608\7f2948790
143355 Ref: 6609\7f2948871
143356 Ref: 6610\7f2948952
143357 Ref: 6611\7f2949033
143358 Ref: 6612\7f2949114
143359 Ref: 6613\7f2949195
143360 Ref: 6614\7f2949368
143361 Ref: 6615\7f2953829
143362 Ref: 6616\7f2953829
143363 Ref: 6617\7f2953829
143364 Ref: 6618\7f2954625
143365 Ref: 6619\7f2954875
143366 Ref: 6620\7f2957046
143367 Node: A.5.2\7f2961830
143368 Ref: 6621\7f2962257
143369 Ref: 6622\7f2963550
143370 Ref: 6623\7f2963598
143371 Ref: 6624\7f2963647
143372 Ref: 6625\7f2963713
143373 Ref: 6626\7f2963789
143374 Ref: 6627\7f2963890
143375 Ref: 6628\7f2963976
143376 Ref: 6629\7f2964016
143377 Ref: 6630\7f2964119
143378 Ref: 6631\7f2964211
143379 Ref: 6632\7f2964305
143380 Ref: 6633\7f2964366
143381 Ref: 6634\7f2964581
143382 Ref: 6635\7f2964693
143383 Ref: 6636\7f2964838
143384 Ref: 6637\7f2964889
143385 Ref: 6638\7f2964959
143386 Ref: 6639\7f2965060
143387 Ref: 6640\7f2965146
143388 Ref: 6641\7f2965186
143389 Ref: 6642\7f2965289
143390 Ref: 6643\7f2965381
143391 Ref: 6644\7f2965475
143392 Ref: 6645\7f2965536
143393 Ref: 6646\7f2967084
143394 Ref: 6647\7f2967395
143395 Ref: 6648\7f2969953
143396 Ref: 6649\7f2970189
143397 Ref: 6650\7f2971738
143398 Ref: 6651\7f2971738
143399 Ref: 6652\7f2971738
143400 Ref: 6653\7f2972118
143401 Ref: 6654\7f2972118
143402 Ref: 6655\7f2981290
143403 Node: A.5.3\7f2982811
143404 Ref: 6656\7f2983017
143405 Ref: 6657\7f2983145
143406 Ref: 6658\7f2983160
143407 Ref: 6659\7f2983318
143408 Ref: 6660\7f2983850
143409 Ref: 6661\7f2983865
143410 Ref: 6662\7f2984507
143411 Ref: 6663\7f2984522
143412 Ref: 6664\7f2984907
143413 Ref: 6665\7f2984922
143414 Ref: 6666\7f2985584
143415 Ref: 6667\7f2985599
143416 Ref: 6668\7f2986115
143417 Ref: 6669\7f2986213
143418 Ref: 6670\7f2986297
143419 Ref: 6671\7f2986299
143420 Ref: 6672\7f2986825
143421 Ref: 6673\7f2986840
143422 Ref: 6674\7f2988292
143423 Ref: 6675\7f2988307
143424 Ref: 6676\7f2988658
143425 Ref: 6677\7f2988673
143426 Ref: 6678\7f2989117
143427 Ref: 6679\7f2989707
143428 Ref: 6680\7f2989824
143429 Ref: 6681\7f2989839
143430 Ref: 6682\7f2990101
143431 Ref: 6683\7f2990116
143432 Ref: 6684\7f2991269
143433 Ref: 6685\7f2991284
143434 Ref: 6686\7f2991525
143435 Ref: 6687\7f2991895
143436 Ref: 6688\7f2991897
143437 Ref: 6689\7f2992529
143438 Ref: 6690\7f2992544
143439 Ref: 6691\7f2992780
143440 Ref: 6692\7f2993080
143441 Ref: 6693\7f2993082
143442 Ref: 6694\7f2993696
143443 Ref: 6695\7f2993711
143444 Ref: 6696\7f2994152
143445 Ref: 6697\7f2994167
143446 Ref: 6698\7f2994662
143447 Ref: 6699\7f2994677
143448 Ref: 6700\7f2995114
143449 Ref: 6701\7f2995129
143450 Ref: 6702\7f2995596
143451 Ref: 6703\7f2995611
143452 Ref: 6704\7f2996283
143453 Ref: 6705\7f2996709
143454 Ref: 6706\7f2996724
143455 Ref: 6707\7f2997106
143456 Ref: 6708\7f2997121
143457 Ref: 6709\7f2997292
143458 Ref: 6710\7f2997609
143459 Ref: 6711\7f2997611
143460 Ref: 6712\7f2998146
143461 Ref: 6713\7f2998161
143462 Ref: 6714\7f2998336
143463 Ref: 6715\7f2998547
143464 Ref: 6716\7f2998549
143465 Ref: 6717\7f2999087
143466 Ref: 6718\7f2999102
143467 Ref: 6719\7f2999280
143468 Ref: 6720\7f2999489
143469 Ref: 6721\7f2999491
143470 Ref: 6722\7f3000391
143471 Ref: 6723\7f3000406
143472 Ref: 6724\7f3001056
143473 Ref: 6725\7f3001071
143474 Ref: 6726\7f3001071
143475 Ref: 6727\7f3001797
143476 Ref: 6728\7f3001812
143477 Ref: 6729\7f3001976
143478 Ref: 6730\7f3002227
143479 Ref: 6731\7f3002228
143480 Ref: 6732\7f3004556
143481 Ref: 6733\7f3004675
143482 Ref: 6734\7f3004690
143483 Ref: 6735\7f3005281
143484 Ref: 6736\7f3005296
143485 Ref: 6737\7f3005715
143486 Ref: 6738\7f3005730
143487 Ref: 6739\7f3006232
143488 Ref: 6740\7f3006247
143489 Ref: 6741\7f3007054
143490 Ref: 6742\7f3007069
143491 Ref: 6743\7f3007503
143492 Ref: 6744\7f3007518
143493 Ref: 6745\7f3007954
143494 Ref: 6746\7f3007969
143495 Ref: 6747\7f3008960
143496 Ref: 6748\7f3010606
143497 Ref: 6749\7f3011177
143498 Node: A.5.4\7f3011228
143499 Ref: 6750\7f3011414
143500 Ref: 6751\7f3011539
143501 Ref: 6752\7f3011554
143502 Ref: 6753\7f3011729
143503 Ref: 6754\7f3011744
143504 Ref: 6755\7f3012056
143505 Ref: 6756\7f3012071
143506 Ref: 6757\7f3012461
143507 Ref: 6758\7f3012898
143508 Node: A.6\7f3013072
143509 Ref: 6759\7f3013214
143510 Ref: 6760\7f3013214
143511 Ref: 6761\7f3013964
143512 Ref: 6762\7f3014290
143513 Node: A.7\7f3014984
143514 Ref: 6763\7f3015178
143515 Ref: 6764\7f3015178
143516 Ref: 6765\7f3015178
143517 Ref: 6766\7f3015778
143518 Ref: 6767\7f3017530
143519 Ref: 6768\7f3017532
143520 Ref: 6769\7f3017532
143521 Ref: 6770\7f3017595
143522 Ref: 6771\7f3018942
143523 Ref: 6772\7f3018944
143524 Node: A.8\7f3020226
143525 Ref: 6773\7f3020442
143526 Ref: 6774\7f3020443
143527 Ref: 6775\7f3020443
143528 Ref: 6776\7f3020872
143529 Ref: 6777\7f3022762
143530 Ref: 6778\7f3022762
143531 Ref: 6779\7f3022762
143532 Ref: 6780\7f3023318
143533 Node: A.8.1\7f3023996
143534 Ref: 6781\7f3024379
143535 Ref: 6782\7f3024396
143536 Ref: 6783\7f3024442
143537 Ref: 6784\7f3024540
143538 Ref: 6785\7f3024750
143539 Ref: 6786\7f3024942
143540 Ref: 6787\7f3024993
143541 Ref: 6788\7f3025044
143542 Ref: 6789\7f3025116
143543 Ref: 6790\7f3025169
143544 Ref: 6791\7f3025233
143545 Ref: 6792\7f3025294
143546 Ref: 6793\7f3025359
143547 Ref: 6794\7f3025469
143548 Ref: 6795\7f3025541
143549 Ref: 6796\7f3025615
143550 Ref: 6797\7f3025697
143551 Ref: 6798\7f3025766
143552 Ref: 6799\7f3025833
143553 Ref: 6800\7f3025900
143554 Ref: 6801\7f3025966
143555 Ref: 6802\7f3026035
143556 Ref: 6803\7f3026101
143557 Ref: 6804\7f3026327
143558 Ref: 6805\7f3026446
143559 Ref: 6806\7f3026998
143560 Node: A.8.2\7f3027531
143561 Node: A.8.3\7f3036485
143562 Node: A.8.4\7f3039678
143563 Ref: 6807\7f3040055
143564 Ref: 6808\7f3040072
143565 Ref: 6809\7f3040118
143566 Ref: 6810\7f3040177
143567 Ref: 6811\7f3040241
143568 Ref: 6812\7f3040339
143569 Ref: 6813\7f3040551
143570 Ref: 6814\7f3040743
143571 Ref: 6815\7f3040794
143572 Ref: 6816\7f3040845
143573 Ref: 6817\7f3040917
143574 Ref: 6818\7f3040970
143575 Ref: 6819\7f3041034
143576 Ref: 6820\7f3041095
143577 Ref: 6821\7f3041160
143578 Ref: 6822\7f3041270
143579 Ref: 6823\7f3041412
143580 Ref: 6824\7f3041487
143581 Ref: 6825\7f3041629
143582 Ref: 6826\7f3041703
143583 Ref: 6827\7f3041780
143584 Ref: 6828\7f3041847
143585 Ref: 6829\7f3041909
143586 Ref: 6830\7f3041991
143587 Ref: 6831\7f3042060
143588 Ref: 6832\7f3042127
143589 Ref: 6833\7f3042194
143590 Ref: 6834\7f3042260
143591 Ref: 6835\7f3042329
143592 Ref: 6836\7f3042395
143593 Ref: 6837\7f3042877
143594 Ref: 6838\7f3043168
143595 Node: A.8.5\7f3043686
143596 Node: A.9\7f3047066
143597 Ref: 6839\7f3048476
143598 Ref: 6840\7f3048524
143599 Ref: 6841\7f3048644
143600 Ref: 6842\7f3048788
143601 Ref: 6843\7f3048867
143602 Ref: 6844\7f3048956
143603 Ref: 6845\7f3050390
143604 Node: A.10\7f3050421
143605 Ref: 6846\7f3052697
143606 Ref: 6847\7f3052697
143607 Ref: 6848\7f3053692
143608 Ref: 6849\7f3054016
143609 Ref: 6850\7f3054016
143610 Ref: 6851\7f3054016
143611 Ref: 6852\7f3055310
143612 Ref: 6853\7f3055316
143613 Ref: 6854\7f3055316
143614 Ref: 6855\7f3055316
143615 Ref: 6856\7f3055316
143616 Ref: 6857\7f3056129
143617 Ref: 6858\7f3056129
143618 Ref: 6859\7f3057066
143619 Node: A.10.1\7f3057668
143620 Ref: 6860\7f3057953
143621 Ref: 6861\7f3057970
143622 Ref: 6862\7f3058016
143623 Ref: 6863\7f3058079
143624 Ref: 6864\7f3058139
143625 Ref: 6865\7f3058189
143626 Ref: 6866\7f3058270
143627 Ref: 6867\7f3058344
143628 Ref: 6868\7f3058398
143629 Ref: 6869\7f3058487
143630 Ref: 6870\7f3058708
143631 Ref: 6871\7f3058905
143632 Ref: 6872\7f3058957
143633 Ref: 6873\7f3059009
143634 Ref: 6874\7f3059082
143635 Ref: 6875\7f3059138
143636 Ref: 6876\7f3059203
143637 Ref: 6877\7f3059265
143638 Ref: 6878\7f3059331
143639 Ref: 6879\7f3059455
143640 Ref: 6880\7f3059506
143641 Ref: 6881\7f3059557
143642 Ref: 6882\7f3059611
143643 Ref: 6883\7f3059662
143644 Ref: 6884\7f3059713
143645 Ref: 6885\7f3059768
143646 Ref: 6886\7f3059819
143647 Ref: 6887\7f3059870
143648 Ref: 6888\7f3059921
143649 Ref: 6889\7f3059984
143650 Ref: 6890\7f3060037
143651 Ref: 6891\7f3060090
143652 Ref: 6892\7f3060147
143653 Ref: 6893\7f3060200
143654 Ref: 6894\7f3060253
143655 Ref: 6895\7f3060385
143656 Ref: 6896\7f3060432
143657 Ref: 6897\7f3060515
143658 Ref: 6898\7f3060586
143659 Ref: 6899\7f3060642
143660 Ref: 6900\7f3060713
143661 Ref: 6901\7f3060769
143662 Ref: 6902\7f3060834
143663 Ref: 6903\7f3060882
143664 Ref: 6904\7f3060947
143665 Ref: 6905\7f3061041
143666 Ref: 6906\7f3061160
143667 Ref: 6907\7f3061229
143668 Ref: 6908\7f3061348
143669 Ref: 6909\7f3061417
143670 Ref: 6910\7f3061484
143671 Ref: 6911\7f3061534
143672 Ref: 6912\7f3061586
143673 Ref: 6913\7f3061618
143674 Ref: 6914\7f3061670
143675 Ref: 6915\7f3061703
143676 Ref: 6916\7f3061770
143677 Ref: 6917\7f3061820
143678 Ref: 6918\7f3061887
143679 Ref: 6919\7f3061937
143680 Ref: 6920\7f3062010
143681 Ref: 6921\7f3062068
143682 Ref: 6922\7f3062141
143683 Ref: 6923\7f3062198
143684 Ref: 6924\7f3062264
143685 Ref: 6925\7f3062313
143686 Ref: 6926\7f3062379
143687 Ref: 6927\7f3062428
143688 Ref: 6928\7f3062494
143689 Ref: 6929\7f3062582
143690 Ref: 6930\7f3062649
143691 Ref: 6931\7f3062698
143692 Ref: 6932\7f3062764
143693 Ref: 6933\7f3062813
143694 Ref: 6934\7f3062989
143695 Ref: 6935\7f3063110
143696 Ref: 6936\7f3063229
143697 Ref: 6937\7f3063293
143698 Ref: 6938\7f3063469
143699 Ref: 6939\7f3063625
143700 Ref: 6940\7f3063689
143701 Ref: 6941\7f3063735
143702 Ref: 6942\7f3063798
143703 Ref: 6943\7f3063844
143704 Ref: 6944\7f3063987
143705 Ref: 6945\7f3064090
143706 Ref: 6946\7f3064153
143707 Ref: 6947\7f3064199
143708 Ref: 6948\7f3064267
143709 Ref: 6949\7f3064428
143710 Ref: 6950\7f3064452
143711 Ref: 6951\7f3064499
143712 Ref: 6952\7f3064564
143713 Ref: 6953\7f3064703
143714 Ref: 6954\7f3064799
143715 Ref: 6955\7f3065013
143716 Ref: 6956\7f3065180
143717 Ref: 6957\7f3065312
143718 Ref: 6958\7f3065535
143719 Ref: 6959\7f3065559
143720 Ref: 6960\7f3065606
143721 Ref: 6961\7f3065671
143722 Ref: 6962\7f3065810
143723 Ref: 6963\7f3065906
143724 Ref: 6964\7f3066120
143725 Ref: 6965\7f3066287
143726 Ref: 6966\7f3066419
143727 Ref: 6967\7f3066708
143728 Ref: 6968\7f3066730
143729 Ref: 6969\7f3066768
143730 Ref: 6970\7f3066817
143731 Ref: 6971\7f3066874
143732 Ref: 6972\7f3067014
143733 Ref: 6973\7f3067110
143734 Ref: 6974\7f3067369
143735 Ref: 6975\7f3067586
143736 Ref: 6976\7f3067717
143737 Ref: 6977\7f3067986
143738 Ref: 6978\7f3068008
143739 Ref: 6979\7f3068053
143740 Ref: 6980\7f3068097
143741 Ref: 6981\7f3068154
143742 Ref: 6982\7f3068294
143743 Ref: 6983\7f3068390
143744 Ref: 6984\7f3068649
143745 Ref: 6985\7f3068866
143746 Ref: 6986\7f3068998
143747 Ref: 6987\7f3069277
143748 Ref: 6988\7f3069301
143749 Ref: 6989\7f3069346
143750 Ref: 6990\7f3069390
143751 Ref: 6991\7f3069447
143752 Ref: 6992\7f3069587
143753 Ref: 6993\7f3069683
143754 Ref: 6994\7f3069942
143755 Ref: 6995\7f3070159
143756 Ref: 6996\7f3070291
143757 Ref: 6997\7f3070628
143758 Ref: 6998\7f3070656
143759 Ref: 6999\7f3070697
143760 Ref: 7000\7f3070769
143761 Ref: 7001\7f3070859
143762 Ref: 7002\7f3070906
143763 Ref: 7003\7f3071124
143764 Ref: 7004\7f3071299
143765 Ref: 7005\7f3071432
143766 Ref: 7006\7f3071621
143767 Ref: 7007\7f3071690
143768 Ref: 7008\7f3071757
143769 Ref: 7009\7f3071824
143770 Ref: 7010\7f3071890
143771 Ref: 7011\7f3071959
143772 Ref: 7012\7f3072025
143773 Ref: 7013\7f3072092
143774 Ref: 7014\7f3072310
143775 Ref: 7015\7f3072389
143776 Ref: 7016\7f3072513
143777 Ref: 7017\7f3072851
143778 Node: A.10.2\7f3073795
143779 Node: A.10.3\7f3077164
143780 Ref: 7018\7f3080651
143781 Node: A.10.4\7f3082123
143782 Node: A.10.5\7f3084833
143783 Ref: 7019\7f3095064
143784 Node: A.10.6\7f3095394
143785 Ref: 7020\7f3097509
143786 Node: A.10.7\7f3101718
143787 Ref: 7021\7f3103540
143788 Ref: 7022\7f3104954
143789 Ref: 7023\7f3106886
143790 Ref: 7024\7f3108011
143791 Ref: 7025\7f3110392
143792 Ref: 7026\7f3110867
143793 Node: A.10.8\7f3111119
143794 Ref: 7027\7f3115668
143795 Ref: 7028\7f3116665
143796 Node: A.10.9\7f3117342
143797 Ref: 7029\7f3124049
143798 Node: A.10.10\7f3126231
143799 Node: A.10.11\7f3131889
143800 Ref: 7030\7f3132540
143801 Ref: 7031\7f3132564
143802 Ref: 7032\7f3132671
143803 Ref: 7033\7f3132745
143804 Ref: 7034\7f3132857
143805 Ref: 7035\7f3132935
143806 Ref: 7036\7f3133041
143807 Ref: 7037\7f3133116
143808 Ref: 7038\7f3133218
143809 Ref: 7039\7f3135049
143810 Node: A.10.12\7f3135096
143811 Ref: 7040\7f3135613
143812 Ref: 7041\7f3135637
143813 Ref: 7042\7f3135756
143814 Ref: 7043\7f3135842
143815 Ref: 7044\7f3135966
143816 Ref: 7045\7f3136056
143817 Ref: 7046\7f3136174
143818 Ref: 7047\7f3136261
143819 Ref: 7048\7f3136375
143820 Ref: 7049\7f3138382
143821 Node: A.11\7f3138431
143822 Ref: 7050\7f3139051
143823 Ref: 7051\7f3139335
143824 Ref: 7052\7f3139335
143825 Ref: 7053\7f3139666
143826 Ref: 7054\7f3139964
143827 Ref: 7055\7f3139966
143828 Ref: 7056\7f3140377
143829 Ref: 7057\7f3140378
143830 Ref: 7058\7f3141175
143831 Ref: 7059\7f3141176
143832 Ref: 7060\7f3141774
143833 Ref: 7061\7f3141952
143834 Node: A.12\7f3142759
143835 Node: A.12.1\7f3143468
143836 Ref: 7062\7f3143609
143837 Ref: 7063\7f3144621
143838 Ref: 7064\7f3144621
143839 Ref: 7065\7f3144876
143840 Ref: 7066\7f3144973
143841 Ref: 7067\7f3145042
143842 Ref: 7068\7f3145089
143843 Ref: 7069\7f3145156
143844 Ref: 7070\7f3145226
143845 Ref: 7071\7f3145346
143846 Ref: 7072\7f3145570
143847 Ref: 7073\7f3145763
143848 Ref: 7074\7f3145816
143849 Ref: 7075\7f3145869
143850 Ref: 7076\7f3145943
143851 Ref: 7077\7f3145999
143852 Ref: 7078\7f3146062
143853 Ref: 7079\7f3146122
143854 Ref: 7080\7f3146186
143855 Ref: 7081\7f3146254
143856 Ref: 7082\7f3146326
143857 Ref: 7083\7f3146562
143858 Ref: 7084\7f3146783
143859 Ref: 7085\7f3147044
143860 Ref: 7086\7f3147206
143861 Ref: 7087\7f3147412
143862 Ref: 7088\7f3147490
143863 Ref: 7089\7f3147558
143864 Ref: 7090\7f3147622
143865 Ref: 7091\7f3147753
143866 Ref: 7092\7f3147812
143867 Ref: 7093\7f3147882
143868 Ref: 7094\7f3147950
143869 Ref: 7095\7f3148018
143870 Ref: 7096\7f3148085
143871 Ref: 7097\7f3148155
143872 Ref: 7098\7f3148222
143873 Ref: 7099\7f3148454
143874 Ref: 7100\7f3153819
143875 Ref: 7101\7f3154659
143876 Ref: 7102\7f3155607
143877 Ref: 7103\7f3157117
143878 Node: A.12.2\7f3157384
143879 Ref: 7104\7f3157783
143880 Ref: 7105\7f3157838
143881 Ref: 7106\7f3157918
143882 Node: A.12.3\7f3158542
143883 Ref: 7107\7f3158966
143884 Ref: 7108\7f3159026
143885 Ref: 7109\7f3159106
143886 Node: A.12.4\7f3159293
143887 Ref: 7110\7f3159791
143888 Ref: 7111\7f3159856
143889 Ref: 7112\7f3159938
143890 Ref: 7113\7f3160253
143891 Node: A.13\7f3160312
143892 Ref: 7114\7f3160702
143893 Ref: 7115\7f3160745
143894 Ref: 7116\7f3160779
143895 Ref: 7117\7f3160813
143896 Ref: 7118\7f3160847
143897 Ref: 7119\7f3160881
143898 Ref: 7120\7f3160915
143899 Ref: 7121\7f3160949
143900 Ref: 7122\7f3160983
143901 Ref: 7123\7f3165667
143902 Ref: 7124\7f3165999
143903 Ref: 7125\7f3166001
143904 Node: A.14\7f3166004
143905 Ref: 7126\7f3166166
143906 Node: A.15\7f3167232
143907 Ref: 7127\7f3167864
143908 Ref: 7128\7f3167926
143909 Ref: 7129\7f3167976
143910 Ref: 7130\7f3168042
143911 Ref: 7131\7f3168085
143912 Ref: 7132\7f3168142
143913 Ref: 7133\7f3168181
143914 Ref: 7134\7f3168238
143915 Ref: 7135\7f3169065
143916 Ref: 7136\7f3171511
143917 Node: A.16\7f3171546
143918 Ref: 7137\7f3172534
143919 Ref: 7138\7f3172604
143920 Ref: 7139\7f3172660
143921 Ref: 7140\7f3172722
143922 Ref: 7141\7f3172860
143923 Ref: 7142\7f3172925
143924 Ref: 7143\7f3173054
143925 Ref: 7144\7f3173115
143926 Ref: 7145\7f3173171
143927 Ref: 7146\7f3173236
143928 Ref: 7147\7f3173451
143929 Ref: 7148\7f3173518
143930 Ref: 7149\7f3173587
143931 Ref: 7150\7f3173665
143932 Ref: 7151\7f3173732
143933 Ref: 7152\7f3173799
143934 Ref: 7153\7f3174035
143935 Ref: 7154\7f3174176
143936 Ref: 7155\7f3174304
143937 Ref: 7156\7f3174378
143938 Ref: 7157\7f3174449
143939 Ref: 7158\7f3174514
143940 Ref: 7159\7f3174579
143941 Ref: 7160\7f3174644
143942 Ref: 7161\7f3174764
143943 Ref: 7162\7f3174824
143944 Ref: 7163\7f3174888
143945 Ref: 7164\7f3174944
143946 Ref: 7165\7f3175205
143947 Ref: 7166\7f3175270
143948 Ref: 7167\7f3175349
143949 Ref: 7168\7f3175817
143950 Ref: 7169\7f3175923
143951 Ref: 7170\7f3176027
143952 Ref: 7171\7f3176129
143953 Ref: 7172\7f3176231
143954 Ref: 7173\7f3176340
143955 Ref: 7174\7f3176413
143956 Ref: 7175\7f3176484
143957 Ref: 7176\7f3176554
143958 Ref: 7177\7f3177136
143959 Ref: 7178\7f3177138
143960 Ref: 7179\7f3177138
143961 Ref: 7180\7f3177845
143962 Ref: 7181\7f3177847
143963 Ref: 7182\7f3178644
143964 Ref: 7183\7f3178646
143965 Ref: 7184\7f3179566
143966 Ref: 7185\7f3180022
143967 Ref: 7186\7f3199199
143968 Ref: 7187\7f3207068
143969 Ref: 7188\7f3217820
143970 Ref: 7189\7f3217949
143971 Ref: 7190\7f3218818
143972 Node: A.16.1\7f3219715
143973 Ref: 7191\7f3220328
143974 Ref: 7192\7f3220351
143975 Ref: 7193\7f3220423
143976 Ref: 7194\7f3220503
143977 Ref: 7195\7f3220585
143978 Ref: 7196\7f3220668
143979 Ref: 7197\7f3220738
143980 Ref: 7198\7f3220813
143981 Ref: 7199\7f3220929
143982 Ref: 7200\7f3221063
143983 Ref: 7201\7f3221138
143984 Ref: 7202\7f3221209
143985 Ref: 7203\7f3229678
143986 Node: A.17\7f3229746
143987 Ref: 7204\7f3229933
143988 Ref: 7205\7f3230547
143989 Ref: 7206\7f3230622
143990 Ref: 7207\7f3230711
143991 Ref: 7208\7f3230794
143992 Ref: 7209\7f3230859
143993 Ref: 7210\7f3230925
143994 Ref: 7211\7f3230969
143995 Ref: 7212\7f3231024
143996 Ref: 7213\7f3234798
143997 Ref: 7214\7f3235203
143998 Ref: 7215\7f3237614
143999 Ref: 7216\7f3237759
144000 Node: A.18\7f3238169
144001 Ref: 7217\7f3239119
144002 Ref: 7218\7f3239119
144003 Ref: 7219\7f3239842
144004 Ref: 7220\7f3239843
144005 Ref: 7221\7f3240232
144006 Ref: 7222\7f3240801
144007 Ref: 7223\7f3248250
144008 Ref: 7224\7f3249297
144009 Node: A.18.1\7f3251502
144010 Ref: 7225\7f3251901
144011 Ref: 7226\7f3251953
144012 Ref: 7227\7f3252012
144013 Ref: 7228\7f3252101
144014 Ref: 7229\7f3253278
144015 Ref: 7230\7f3253405
144016 Node: A.18.2\7f3253806
144017 Ref: 7231\7f3254376
144018 Ref: 7232\7f3254376
144019 Ref: 7233\7f3254384
144020 Ref: 7234\7f3254384
144021 Ref: 7235\7f3254907
144022 Ref: 7236\7f3255959
144023 Ref: 7237\7f3256057
144024 Ref: 7238\7f3256225
144025 Ref: 7239\7f3256333
144026 Ref: 7240\7f3256631
144027 Ref: 7241\7f3256712
144028 Ref: 7242\7f3256758
144029 Ref: 7243\7f3256843
144030 Ref: 7244\7f3256940
144031 Ref: 7245\7f3257122
144032 Ref: 7246\7f3257192
144033 Ref: 7247\7f3257653
144034 Ref: 7248\7f3257726
144035 Ref: 7249\7f3257862
144036 Ref: 7250\7f3257933
144037 Ref: 7251\7f3258057
144038 Ref: 7252\7f3258127
144039 Ref: 7253\7f3258185
144040 Ref: 7254\7f3258310
144041 Ref: 7255\7f3258386
144042 Ref: 7256\7f3258520
144043 Ref: 7257\7f3258593
144044 Ref: 7258\7f3258796
144045 Ref: 7259\7f3258995
144046 Ref: 7260\7f3259184
144047 Ref: 7261\7f3259333
144048 Ref: 7262\7f3259562
144049 Ref: 7263\7f3260003
144050 Ref: 7264\7f3260169
144051 Ref: 7265\7f3260377
144052 Ref: 7266\7f3260562
144053 Ref: 7267\7f3260766
144054 Ref: 7268\7f3260948
144055 Ref: 7269\7f3261051
144056 Ref: 7270\7f3261152
144057 Ref: 7271\7f3261255
144058 Ref: 7272\7f3261429
144059 Ref: 7273\7f3261595
144060 Ref: 7274\7f3261814
144061 Ref: 7275\7f3262056
144062 Ref: 7276\7f3262290
144063 Ref: 7277\7f3262577
144064 Ref: 7278\7f3262760
144065 Ref: 7279\7f3262988
144066 Ref: 7280\7f3263103
144067 Ref: 7281\7f3263287
144068 Ref: 7282\7f3263400
144069 Ref: 7283\7f3263581
144070 Ref: 7284\7f3263782
144071 Ref: 7285\7f3264034
144072 Ref: 7286\7f3264217
144073 Ref: 7287\7f3264392
144074 Ref: 7288\7f3264526
144075 Ref: 7289\7f3264658
144076 Ref: 7290\7f3264728
144077 Ref: 7291\7f3264841
144078 Ref: 7292\7f3264949
144079 Ref: 7293\7f3265024
144080 Ref: 7294\7f3265089
144081 Ref: 7295\7f3265179
144082 Ref: 7296\7f3265257
144083 Ref: 7297\7f3265321
144084 Ref: 7298\7f3265410
144085 Ref: 7299\7f3265474
144086 Ref: 7300\7f3265530
144087 Ref: 7301\7f3265598
144088 Ref: 7302\7f3265658
144089 Ref: 7303\7f3265875
144090 Ref: 7304\7f3266056
144091 Ref: 7305\7f3266296
144092 Ref: 7306\7f3266501
144093 Ref: 7307\7f3266688
144094 Ref: 7308\7f3266828
144095 Ref: 7309\7f3267411
144096 Ref: 7310\7f3267456
144097 Ref: 7311\7f3267530
144098 Ref: 7312\7f3267591
144099 Ref: 7313\7f3268307
144100 Ref: 7314\7f3269217
144101 Ref: 7315\7f3273281
144102 Ref: 7316\7f3274410
144103 Ref: 7317\7f3275128
144104 Ref: 7318\7f3275129
144105 Ref: 7319\7f3290707
144106 Ref: 7320\7f3323132
144107 Ref: 7321\7f3326606
144108 Ref: 7322\7f3327723
144109 Ref: 7323\7f3328903
144110 Ref: 7324\7f3328904
144111 Ref: 7325\7f3329525
144112 Ref: 7326\7f3331104
144113 Ref: 7327\7f3331104
144114 Ref: 7328\7f3332211
144115 Ref: 7329\7f3332334
144116 Ref: 7330\7f3340001
144117 Ref: 7331\7f3340148
144118 Ref: 7332\7f3340717
144119 Node: A.18.3\7f3342136
144120 Ref: 7333\7f3342586
144121 Ref: 7334\7f3342588
144122 Ref: 7335\7f3342622
144123 Ref: 7336\7f3343163
144124 Ref: 7337\7f3343613
144125 Ref: 7338\7f3343757
144126 Ref: 7339\7f3344051
144127 Ref: 7340\7f3344131
144128 Ref: 7341\7f3344172
144129 Ref: 7342\7f3344256
144130 Ref: 7343\7f3344352
144131 Ref: 7344\7f3344530
144132 Ref: 7345\7f3344598
144133 Ref: 7346\7f3344666
144134 Ref: 7347\7f3344722
144135 Ref: 7348\7f3344806
144136 Ref: 7349\7f3345003
144137 Ref: 7350\7f3345152
144138 Ref: 7351\7f3345591
144139 Ref: 7352\7f3345757
144140 Ref: 7353\7f3345959
144141 Ref: 7354\7f3346139
144142 Ref: 7355\7f3346238
144143 Ref: 7356\7f3346296
144144 Ref: 7357\7f3346395
144145 Ref: 7358\7f3346627
144146 Ref: 7359\7f3346912
144147 Ref: 7360\7f3347138
144148 Ref: 7361\7f3347320
144149 Ref: 7362\7f3347499
144150 Ref: 7363\7f3347672
144151 Ref: 7364\7f3347804
144152 Ref: 7365\7f3347934
144153 Ref: 7366\7f3348002
144154 Ref: 7367\7f3348109
144155 Ref: 7368\7f3348228
144156 Ref: 7369\7f3348387
144157 Ref: 7370\7f3348598
144158 Ref: 7371\7f3348758
144159 Ref: 7372\7f3348821
144160 Ref: 7373\7f3348909
144161 Ref: 7374\7f3348971
144162 Ref: 7375\7f3349058
144163 Ref: 7376\7f3349121
144164 Ref: 7377\7f3349189
144165 Ref: 7378\7f3349246
144166 Ref: 7379\7f3349306
144167 Ref: 7380\7f3349485
144168 Ref: 7381\7f3349688
144169 Ref: 7382\7f3349872
144170 Ref: 7383\7f3350010
144171 Ref: 7384\7f3350583
144172 Ref: 7385\7f3350628
144173 Ref: 7386\7f3350700
144174 Ref: 7387\7f3350759
144175 Ref: 7388\7f3351534
144176 Ref: 7389\7f3352254
144177 Ref: 7390\7f3354611
144178 Ref: 7391\7f3355923
144179 Ref: 7392\7f3356544
144180 Ref: 7393\7f3356545
144181 Ref: 7394\7f3362415
144182 Ref: 7395\7f3385720
144183 Ref: 7396\7f3388097
144184 Ref: 7397\7f3388441
144185 Ref: 7398\7f3388856
144186 Ref: 7399\7f3389418
144187 Ref: 7400\7f3389418
144188 Ref: 7401\7f3391104
144189 Ref: 7402\7f3391106
144190 Ref: 7403\7f3397175
144191 Ref: 7404\7f3397366
144192 Ref: 7405\7f3397822
144193 Ref: 7406\7f3398427
144194 Node: A.18.4\7f3399951
144195 Ref: 7407\7f3400482
144196 Ref: 7408\7f3400482
144197 Ref: 7409\7f3401333
144198 Ref: 7410\7f3402032
144199 Ref: 7411\7f3402085
144200 Ref: 7412\7f3402534
144201 Ref: 7413\7f3402568
144202 Ref: 7414\7f3402569
144203 Ref: 7415\7f3402569
144204 Ref: 7416\7f3403567
144205 Ref: 7417\7f3404773
144206 Ref: 7418\7f3405396
144207 Ref: 7419\7f3405397
144208 Ref: 7420\7f3413733
144209 Ref: 7421\7f3426968
144210 Ref: 7422\7f3427380
144211 Ref: 7423\7f3427923
144212 Ref: 7424\7f3427923
144213 Ref: 7425\7f3428719
144214 Ref: 7426\7f3428873
144215 Ref: 7427\7f3432967
144216 Node: A.18.5\7f3434063
144217 Ref: 7428\7f3434861
144218 Ref: 7429\7f3434989
144219 Ref: 7430\7f3435281
144220 Ref: 7431\7f3435361
144221 Ref: 7432\7f3435400
144222 Ref: 7433\7f3435484
144223 Ref: 7434\7f3435580
144224 Ref: 7435\7f3435754
144225 Ref: 7436\7f3435823
144226 Ref: 7437\7f3435956
144227 Ref: 7438\7f3436023
144228 Ref: 7439\7f3436090
144229 Ref: 7440\7f3436145
144230 Ref: 7441\7f3436209
144231 Ref: 7442\7f3436282
144232 Ref: 7443\7f3436478
144233 Ref: 7444\7f3436699
144234 Ref: 7445\7f3437192
144235 Ref: 7446\7f3437358
144236 Ref: 7447\7f3437559
144237 Ref: 7448\7f3437737
144238 Ref: 7449\7f3437940
144239 Ref: 7450\7f3438121
144240 Ref: 7451\7f3438218
144241 Ref: 7452\7f3438302
144242 Ref: 7453\7f3438399
144243 Ref: 7454\7f3438677
144244 Ref: 7455\7f3438896
144245 Ref: 7456\7f3439067
144246 Ref: 7457\7f3439241
144247 Ref: 7458\7f3439415
144248 Ref: 7459\7f3439529
144249 Ref: 7460\7f3439641
144250 Ref: 7461\7f3439750
144251 Ref: 7462\7f3439823
144252 Ref: 7463\7f3439888
144253 Ref: 7464\7f3439945
144254 Ref: 7465\7f3440062
144255 Ref: 7466\7f3440191
144256 Ref: 7467\7f3440369
144257 Ref: 7468\7f3440458
144258 Ref: 7469\7f3440593
144259 Ref: 7470\7f3440729
144260 Ref: 7471\7f3441392
144261 Ref: 7472\7f3442231
144262 Ref: 7473\7f3442790
144263 Ref: 7474\7f3443882
144264 Ref: 7475\7f3444540
144265 Ref: 7476\7f3445471
144266 Ref: 7477\7f3445472
144267 Ref: 7478\7f3445472
144268 Ref: 7479\7f3445658
144269 Ref: 7480\7f3455276
144270 Ref: 7481\7f3455434
144271 Ref: 7482\7f3456014
144272 Node: A.18.6\7f3456328
144273 Ref: 7483\7f3457040
144274 Ref: 7484\7f3457149
144275 Ref: 7485\7f3457249
144276 Ref: 7486\7f3457541
144277 Ref: 7487\7f3457621
144278 Ref: 7488\7f3457660
144279 Ref: 7489\7f3457744
144280 Ref: 7490\7f3457840
144281 Ref: 7491\7f3458014
144282 Ref: 7492\7f3458081
144283 Ref: 7493\7f3458148
144284 Ref: 7494\7f3458203
144285 Ref: 7495\7f3458267
144286 Ref: 7496\7f3458340
144287 Ref: 7497\7f3458536
144288 Ref: 7498\7f3458757
144289 Ref: 7499\7f3459250
144290 Ref: 7500\7f3459416
144291 Ref: 7501\7f3459617
144292 Ref: 7502\7f3459795
144293 Ref: 7503\7f3459998
144294 Ref: 7504\7f3460179
144295 Ref: 7505\7f3460276
144296 Ref: 7506\7f3460332
144297 Ref: 7507\7f3460429
144298 Ref: 7508\7f3460707
144299 Ref: 7509\7f3460926
144300 Ref: 7510\7f3461097
144301 Ref: 7511\7f3461271
144302 Ref: 7512\7f3461445
144303 Ref: 7513\7f3461559
144304 Ref: 7514\7f3461671
144305 Ref: 7515\7f3461781
144306 Ref: 7516\7f3461844
144307 Ref: 7517\7f3461905
144308 Ref: 7518\7f3461967
144309 Ref: 7519\7f3462043
144310 Ref: 7520\7f3462111
144311 Ref: 7521\7f3462172
144312 Ref: 7522\7f3462247
144313 Ref: 7523\7f3462314
144314 Ref: 7524\7f3462378
144315 Ref: 7525\7f3462434
144316 Ref: 7526\7f3462502
144317 Ref: 7527\7f3462562
144318 Ref: 7528\7f3462668
144319 Ref: 7529\7f3462786
144320 Ref: 7530\7f3462894
144321 Ref: 7531\7f3463006
144322 Ref: 7532\7f3463625
144323 Ref: 7533\7f3463762
144324 Ref: 7534\7f3464346
144325 Ref: 7535\7f3465062
144326 Ref: 7536\7f3465842
144327 Ref: 7537\7f3466922
144328 Ref: 7538\7f3466923
144329 Ref: 7539\7f3466923
144330 Ref: 7540\7f3466923
144331 Ref: 7541\7f3476345
144332 Ref: 7542\7f3476504
144333 Ref: 7543\7f3477087
144334 Node: A.18.7\7f3477640
144335 Ref: 7544\7f3478152
144336 Ref: 7545\7f3478152
144337 Ref: 7546\7f3479006
144338 Ref: 7547\7f3479709
144339 Ref: 7548\7f3480050
144340 Ref: 7549\7f3480084
144341 Ref: 7550\7f3480085
144342 Ref: 7551\7f3480085
144343 Ref: 7552\7f3481113
144344 Ref: 7553\7f3482532
144345 Ref: 7554\7f3483387
144346 Ref: 7555\7f3483388
144347 Ref: 7556\7f3491699
144348 Ref: 7557\7f3505297
144349 Ref: 7558\7f3505533
144350 Ref: 7559\7f3508331
144351 Ref: 7560\7f3510992
144352 Ref: 7561\7f3511405
144353 Ref: 7562\7f3511948
144354 Ref: 7563\7f3511948
144355 Ref: 7564\7f3512933
144356 Ref: 7565\7f3513087
144357 Ref: 7566\7f3517188
144358 Node: A.18.8\7f3518290
144359 Ref: 7567\7f3519070
144360 Ref: 7568\7f3519198
144361 Ref: 7569\7f3519442
144362 Ref: 7570\7f3519522
144363 Ref: 7571\7f3519561
144364 Ref: 7572\7f3519645
144365 Ref: 7573\7f3519741
144366 Ref: 7574\7f3519915
144367 Ref: 7575\7f3519989
144368 Ref: 7576\7f3520057
144369 Ref: 7577\7f3520127
144370 Ref: 7578\7f3520260
144371 Ref: 7579\7f3520327
144372 Ref: 7580\7f3520394
144373 Ref: 7581\7f3520449
144374 Ref: 7582\7f3520522
144375 Ref: 7583\7f3520718
144376 Ref: 7584\7f3521087
144377 Ref: 7585\7f3521289
144378 Ref: 7586\7f3521386
144379 Ref: 7587\7f3521470
144380 Ref: 7588\7f3521567
144381 Ref: 7589\7f3521790
144382 Ref: 7590\7f3521906
144383 Ref: 7591\7f3522024
144384 Ref: 7592\7f3522142
144385 Ref: 7593\7f3522260
144386 Ref: 7594\7f3522376
144387 Ref: 7595\7f3522486
144388 Ref: 7596\7f3522584
144389 Ref: 7597\7f3522720
144390 Ref: 7598\7f3522832
144391 Ref: 7599\7f3522983
144392 Ref: 7600\7f3523091
144393 Ref: 7601\7f3523236
144394 Ref: 7602\7f3523364
144395 Ref: 7603\7f3523540
144396 Ref: 7604\7f3523607
144397 Ref: 7605\7f3523713
144398 Ref: 7606\7f3523775
144399 Ref: 7607\7f3523839
144400 Ref: 7608\7f3523895
144401 Ref: 7609\7f3524005
144402 Ref: 7610\7f3524187
144403 Ref: 7611\7f3524279
144404 Ref: 7612\7f3524425
144405 Ref: 7613\7f3524572
144406 Ref: 7614\7f3525170
144407 Ref: 7615\7f3525212
144408 Ref: 7616\7f3525279
144409 Ref: 7617\7f3525417
144410 Ref: 7618\7f3525600
144411 Ref: 7619\7f3525720
144412 Ref: 7620\7f3525837
144413 Ref: 7621\7f3525963
144414 Ref: 7622\7f3526099
144415 Ref: 7623\7f3526373
144416 Ref: 7624\7f3526562
144417 Ref: 7625\7f3526779
144418 Ref: 7626\7f3526991
144419 Ref: 7627\7f3527336
144420 Ref: 7628\7f3527636
144421 Ref: 7629\7f3528205
144422 Ref: 7630\7f3528735
144423 Ref: 7631\7f3528944
144424 Ref: 7632\7f3529199
144425 Ref: 7633\7f3529566
144426 Ref: 7634\7f3529567
144427 Ref: 7635\7f3529567
144428 Ref: 7636\7f3529768
144429 Ref: 7637\7f3534704
144430 Ref: 7638\7f3535109
144431 Ref: 7639\7f3536357
144432 Ref: 7640\7f3536515
144433 Ref: 7641\7f3537095
144434 Node: A.18.9\7f3537578
144435 Ref: 7642\7f3538261
144436 Ref: 7643\7f3538370
144437 Ref: 7644\7f3538478
144438 Ref: 7645\7f3538722
144439 Ref: 7646\7f3538802
144440 Ref: 7647\7f3538841
144441 Ref: 7648\7f3538925
144442 Ref: 7649\7f3539021
144443 Ref: 7650\7f3539195
144444 Ref: 7651\7f3539270
144445 Ref: 7652\7f3539338
144446 Ref: 7653\7f3539405
144447 Ref: 7654\7f3539472
144448 Ref: 7655\7f3539527
144449 Ref: 7656\7f3539600
144450 Ref: 7657\7f3539796
144451 Ref: 7658\7f3540165
144452 Ref: 7659\7f3540367
144453 Ref: 7660\7f3540464
144454 Ref: 7661\7f3540520
144455 Ref: 7662\7f3540617
144456 Ref: 7663\7f3540840
144457 Ref: 7664\7f3540956
144458 Ref: 7665\7f3541074
144459 Ref: 7666\7f3541192
144460 Ref: 7667\7f3541310
144461 Ref: 7668\7f3541426
144462 Ref: 7669\7f3541536
144463 Ref: 7670\7f3541599
144464 Ref: 7671\7f3541661
144465 Ref: 7672\7f3541759
144466 Ref: 7673\7f3541895
144467 Ref: 7674\7f3542007
144468 Ref: 7675\7f3542158
144469 Ref: 7676\7f3542266
144470 Ref: 7677\7f3542411
144471 Ref: 7678\7f3542539
144472 Ref: 7679\7f3542716
144473 Ref: 7680\7f3542783
144474 Ref: 7681\7f3542889
144475 Ref: 7682\7f3542951
144476 Ref: 7683\7f3543027
144477 Ref: 7684\7f3543088
144478 Ref: 7685\7f3543163
144479 Ref: 7686\7f3543227
144480 Ref: 7687\7f3543283
144481 Ref: 7688\7f3543351
144482 Ref: 7689\7f3543411
144483 Ref: 7690\7f3543532
144484 Ref: 7691\7f3543655
144485 Ref: 7692\7f3543782
144486 Ref: 7693\7f3544465
144487 Ref: 7694\7f3544602
144488 Ref: 7695\7f3545279
144489 Ref: 7696\7f3545322
144490 Ref: 7697\7f3545421
144491 Ref: 7698\7f3545489
144492 Ref: 7699\7f3545631
144493 Ref: 7700\7f3545817
144494 Ref: 7701\7f3545939
144495 Ref: 7702\7f3546058
144496 Ref: 7703\7f3546187
144497 Ref: 7704\7f3546318
144498 Ref: 7705\7f3546453
144499 Ref: 7706\7f3546577
144500 Ref: 7707\7f3546855
144501 Ref: 7708\7f3547044
144502 Ref: 7709\7f3547261
144503 Ref: 7710\7f3547473
144504 Ref: 7711\7f3547951
144505 Ref: 7712\7f3548551
144506 Ref: 7713\7f3548760
144507 Ref: 7714\7f3548998
144508 Ref: 7715\7f3549374
144509 Ref: 7716\7f3549375
144510 Ref: 7717\7f3549375
144511 Ref: 7718\7f3549375
144512 Ref: 7719\7f3557091
144513 Ref: 7720\7f3558785
144514 Ref: 7721\7f3558945
144515 Ref: 7722\7f3559529
144516 Node: A.18.10\7f3560254
144517 Ref: 7723\7f3561344
144518 Ref: 7724\7f3561814
144519 Ref: 7725\7f3561816
144520 Ref: 7726\7f3561816
144521 Ref: 7727\7f3562049
144522 Ref: 7728\7f3562049
144523 Ref: 7729\7f3562155
144524 Ref: 7730\7f3562299
144525 Ref: 7731\7f3562419
144526 Ref: 7732\7f3562757
144527 Ref: 7733\7f3563391
144528 Ref: 7734\7f3563550
144529 Ref: 7735\7f3563844
144530 Ref: 7736\7f3563925
144531 Ref: 7737\7f3563967
144532 Ref: 7738\7f3564025
144533 Ref: 7739\7f3564120
144534 Ref: 7740\7f3564233
144535 Ref: 7741\7f3564431
144536 Ref: 7742\7f3564498
144537 Ref: 7743\7f3564570
144538 Ref: 7744\7f3564651
144539 Ref: 7745\7f3564719
144540 Ref: 7746\7f3564786
144541 Ref: 7747\7f3564853
144542 Ref: 7748\7f3564916
144543 Ref: 7749\7f3564972
144544 Ref: 7750\7f3565045
144545 Ref: 7751\7f3565242
144546 Ref: 7752\7f3565391
144547 Ref: 7753\7f3565634
144548 Ref: 7754\7f3565826
144549 Ref: 7755\7f3565990
144550 Ref: 7756\7f3566190
144551 Ref: 7757\7f3566343
144552 Ref: 7758\7f3566415
144553 Ref: 7759\7f3566473
144554 Ref: 7760\7f3566572
144555 Ref: 7761\7f3566693
144556 Ref: 7762\7f3566820
144557 Ref: 7763\7f3566926
144558 Ref: 7764\7f3567048
144559 Ref: 7765\7f3567192
144560 Ref: 7766\7f3567332
144561 Ref: 7767\7f3567453
144562 Ref: 7768\7f3567591
144563 Ref: 7769\7f3567763
144564 Ref: 7770\7f3567908
144565 Ref: 7771\7f3568037
144566 Ref: 7772\7f3568109
144567 Ref: 7773\7f3568189
144568 Ref: 7774\7f3568504
144569 Ref: 7775\7f3568878
144570 Ref: 7776\7f3569187
144571 Ref: 7777\7f3569447
144572 Ref: 7778\7f3569703
144573 Ref: 7779\7f3569832
144574 Ref: 7780\7f3570069
144575 Ref: 7781\7f3570372
144576 Ref: 7782\7f3570617
144577 Ref: 7783\7f3570960
144578 Ref: 7784\7f3571236
144579 Ref: 7785\7f3571301
144580 Ref: 7786\7f3571369
144581 Ref: 7787\7f3571451
144582 Ref: 7788\7f3571518
144583 Ref: 7789\7f3571599
144584 Ref: 7790\7f3571670
144585 Ref: 7791\7f3571746
144586 Ref: 7792\7f3571811
144587 Ref: 7793\7f3571880
144588 Ref: 7794\7f3572025
144589 Ref: 7795\7f3572202
144590 Ref: 7796\7f3572998
144591 Ref: 7797\7f3573105
144592 Ref: 7798\7f3575148
144593 Ref: 7799\7f3576433
144594 Ref: 7800\7f3577452
144595 Ref: 7801\7f3577453
144596 Ref: 7802\7f3588025
144597 Ref: 7803\7f3629015
144598 Ref: 7804\7f3629428
144599 Ref: 7805\7f3629981
144600 Ref: 7806\7f3629981
144601 Ref: 7807\7f3631004
144602 Ref: 7808\7f3636448
144603 Node: A.18.11\7f3636514
144604 Ref: 7809\7f3637211
144605 Ref: 7810\7f3638445
144606 Node: A.18.12\7f3638515
144607 Ref: 7811\7f3639295
144608 Ref: 7812\7f3640593
144609 Node: A.18.13\7f3640675
144610 Ref: 7813\7f3641363
144611 Ref: 7814\7f3642685
144612 Node: A.18.14\7f3642759
144613 Ref: 7815\7f3643452
144614 Ref: 7816\7f3644775
144615 Node: A.18.15\7f3644850
144616 Ref: 7817\7f3645523
144617 Ref: 7818\7f3645913
144618 Node: A.18.16\7f3645987
144619 Ref: 7819\7f3646665
144620 Ref: 7820\7f3647056
144621 Node: A.18.17\7f3647131
144622 Ref: 7821\7f3647792
144623 Ref: 7822\7f3649148
144624 Node: A.18.18\7f3649225
144625 Ref: 7823\7f3649933
144626 Ref: 7824\7f3650336
144627 Ref: 7825\7f3650453
144628 Ref: 7826\7f3650541
144629 Ref: 7827\7f3650665
144630 Ref: 7828\7f3650739
144631 Ref: 7829\7f3650809
144632 Ref: 7830\7f3650867
144633 Ref: 7831\7f3650941
144634 Ref: 7832\7f3651078
144635 Ref: 7833\7f3651273
144636 Ref: 7834\7f3651447
144637 Ref: 7835\7f3651633
144638 Ref: 7836\7f3651794
144639 Ref: 7837\7f3651933
144640 Ref: 7838\7f3652059
144641 Ref: 7839\7f3652160
144642 Ref: 7840\7f3652222
144643 Ref: 7841\7f3653575
144644 Ref: 7842\7f3654244
144645 Ref: 7843\7f3655020
144646 Ref: 7844\7f3655021
144647 Ref: 7845\7f3659495
144648 Ref: 7846\7f3663281
144649 Ref: 7847\7f3663727
144650 Ref: 7848\7f3664449
144651 Ref: 7849\7f3667706
144652 Node: A.18.19\7f3667777
144653 Ref: 7850\7f3669781
144654 Ref: 7851\7f3670543
144655 Ref: 7852\7f3673027
144656 Node: A.18.20\7f3673095
144657 Ref: 7853\7f3674999
144658 Ref: 7854\7f3675853
144659 Ref: 7855\7f3676609
144660 Ref: 7856\7f3678971
144661 Node: A.18.21\7f3679051
144662 Ref: 7857\7f3681047
144663 Ref: 7858\7f3681369
144664 Ref: 7859\7f3682260
144665 Ref: 7860\7f3683013
144666 Ref: 7861\7f3685538
144667 Node: A.18.22\7f3685610
144668 Ref: 7862\7f3687473
144669 Ref: 7863\7f3688016
144670 Ref: 7864\7f3688769
144671 Ref: 7865\7f3691299
144672 Node: A.18.23\7f3691372
144673 Ref: 7866\7f3693351
144674 Ref: 7867\7f3693673
144675 Ref: 7868\7f3694560
144676 Ref: 7869\7f3695313
144677 Ref: 7870\7f3697708
144678 Node: A.18.24\7f3697780
144679 Ref: 7871\7f3699641
144680 Ref: 7872\7f3700180
144681 Ref: 7873\7f3700933
144682 Ref: 7874\7f3703333
144683 Node: A.18.25\7f3703406
144684 Ref: 7875\7f3706365
144685 Ref: 7876\7f3707121
144686 Ref: 7877\7f3709438
144687 Node: A.18.26\7f3709512
144688 Ref: 7878\7f3710382
144689 Ref: 7879\7f3711301
144690 Ref: 7880\7f3712607
144691 Ref: 7881\7f3713628
144692 Ref: 7882\7f3713969
144693 Ref: 7883\7f3715388
144694 Ref: 7884\7f3717623
144695 Ref: 7885\7f3717868
144696 Node: A.18.27\7f3718221
144697 Ref: 7886\7f3718967
144698 Ref: 7887\7f3719038
144699 Ref: 7888\7f3719094
144700 Ref: 7889\7f3719264
144701 Ref: 7890\7f3719433
144702 Ref: 7891\7f3719513
144703 Ref: 7892\7f3719941
144704 Ref: 7893\7f3722342
144705 Node: A.18.28\7f3722424
144706 Ref: 7894\7f3723222
144707 Ref: 7895\7f3723426
144708 Ref: 7896\7f3723629
144709 Ref: 7897\7f3723723
144710 Ref: 7898\7f3723825
144711 Ref: 7899\7f3723898
144712 Ref: 7900\7f3725184
144713 Node: A.18.29\7f3725266
144714 Ref: 7901\7f3726096
144715 Ref: 7902\7f3726298
144716 Ref: 7903\7f3726559
144717 Ref: 7904\7f3726653
144718 Ref: 7905\7f3726755
144719 Ref: 7906\7f3726828
144720 Ref: 7907\7f3727821
144721 Node: A.18.30\7f3727901
144722 Ref: 7908\7f3728931
144723 Ref: 7909\7f3729131
144724 Ref: 7910\7f3729334
144725 Ref: 7911\7f3729428
144726 Ref: 7912\7f3729585
144727 Ref: 7913\7f3729812
144728 Ref: 7914\7f3729885
144729 Ref: 7915\7f3732382
144730 Node: A.18.31\7f3732460
144731 Ref: 7916\7f3733522
144732 Ref: 7917\7f3733720
144733 Ref: 7918\7f3733979
144734 Ref: 7919\7f3734073
144735 Ref: 7920\7f3734230
144736 Ref: 7921\7f3734457
144737 Ref: 7922\7f3734530
144738 Ref: 7923\7f3735569
144739 Node: A.18.32\7f3735645
144740 Node: A.19\7f3740789
144741 Ref: 7924\7f3740965
144742 Ref: 7925\7f3741287
144743 Ref: 7926\7f3741382
144744 Ref: 7927\7f3741458
144745 Ref: 7928\7f3741528
144746 Ref: 7929\7f3741588
144747 Ref: 7930\7f3741664
144748 Ref: 7931\7f3741712
144749 Ref: 7932\7f3741840
144750 Ref: 7933\7f3741840
144751 Ref: 7934\7f3744067
144752 Node: Annex B\7f3744103
144753 Ref: 7935\7f3744261
144754 Ref: 7936\7f3744261
144755 Ref: 7937\7f3744261
144756 Ref: 7938\7f3745885
144757 Node: B.1\7f3746520
144758 Ref: 7939\7f3746793
144759 Ref: 7940\7f3746793
144760 Ref: 7941\7f3746848
144761 Ref: 7942\7f3746849
144762 Ref: 7943\7f3747116
144763 Ref: 7944\7f3747117
144764 Ref: 7945\7f3747687
144765 Ref: 7946\7f3747687
144766 Ref: 7947\7f3747687
144767 Ref: 7948\7f3747687
144768 Ref: 7949\7f3747687
144769 Ref: 7950\7f3747689
144770 Ref: 7951\7f3747689
144771 Ref: 7952\7f3747689
144772 Ref: 7953\7f3747689
144773 Ref: 7954\7f3748182
144774 Ref: 7955\7f3748182
144775 Ref: 7956\7f3749094
144776 Ref: 7957\7f3749095
144777 Ref: 7958\7f3749117
144778 Ref: 7959\7f3749964
144779 Ref: 7960\7f3749998
144780 Ref: 7961\7f3750120
144781 Ref: 7962\7f3750566
144782 Ref: 7963\7f3751259
144783 Ref: 7964\7f3751689
144784 Ref: 7965\7f3753717
144785 Ref: 7966\7f3754494
144786 Ref: 7967\7f3754495
144787 Ref: 7968\7f3756643
144788 Ref: 7969\7f3756839
144789 Ref: 7970\7f3758339
144790 Ref: 7971\7f3758340
144791 Ref: 7972\7f3759267
144792 Ref: 7973\7f3760138
144793 Ref: 7974\7f3760140
144794 Ref: 7975\7f3760140
144795 Ref: 7976\7f3760140
144796 Ref: 7977\7f3765646
144797 Ref: 7978\7f3766491
144798 Ref: 7979\7f3767339
144799 Node: B.2\7f3767495
144800 Ref: 7980\7f3768186
144801 Ref: 7981\7f3769786
144802 Ref: 7982\7f3769786
144803 Ref: 7983\7f3771433
144804 Node: B.3\7f3774295
144805 Ref: 7984\7f3774538
144806 Ref: 7985\7f3774539
144807 Ref: 7986\7f3775282
144808 Ref: 7987\7f3775364
144809 Ref: 7988\7f3775436
144810 Ref: 7989\7f3775511
144811 Ref: 7990\7f3775585
144812 Ref: 7991\7f3775712
144813 Ref: 7992\7f3775764
144814 Ref: 7993\7f3775816
144815 Ref: 7994\7f3775871
144816 Ref: 7995\7f3775975
144817 Ref: 7996\7f3776034
144818 Ref: 7997\7f3776093
144819 Ref: 7998\7f3776156
144820 Ref: 7999\7f3776257
144821 Ref: 8000\7f3776312
144822 Ref: 8001\7f3776372
144823 Ref: 8002\7f3776457
144824 Ref: 8003\7f3776520
144825 Ref: 8004\7f3776583
144826 Ref: 8005\7f3776685
144827 Ref: 8006\7f3776798
144828 Ref: 8007\7f3776866
144829 Ref: 8008\7f3776929
144830 Ref: 8009\7f3777040
144831 Ref: 8010\7f3777189
144832 Ref: 8011\7f3777267
144833 Ref: 8012\7f3777408
144834 Ref: 8013\7f3777546
144835 Ref: 8014\7f3777760
144836 Ref: 8015\7f3778068
144837 Ref: 8016\7f3778184
144838 Ref: 8017\7f3778260
144839 Ref: 8018\7f3778327
144840 Ref: 8019\7f3778428
144841 Ref: 8020\7f3778592
144842 Ref: 8021\7f3778671
144843 Ref: 8022\7f3778818
144844 Ref: 8023\7f3778962
144845 Ref: 8024\7f3779182
144846 Ref: 8025\7f3779549
144847 Ref: 8026\7f3779613
144848 Ref: 8027\7f3779701
144849 Ref: 8028\7f3779767
144850 Ref: 8029\7f3779864
144851 Ref: 8030\7f3780036
144852 Ref: 8031\7f3780112
144853 Ref: 8032\7f3780260
144854 Ref: 8033\7f3780409
144855 Ref: 8034\7f3780635
144856 Ref: 8035\7f3780886
144857 Ref: 8036\7f3780951
144858 Ref: 8037\7f3781040
144859 Ref: 8038\7f3781111
144860 Ref: 8039\7f3781214
144861 Ref: 8040\7f3781388
144862 Ref: 8041\7f3781464
144863 Ref: 8042\7f3781618
144864 Ref: 8043\7f3781773
144865 Ref: 8044\7f3782004
144866 Ref: 8045\7f3782216
144867 Ref: 8046\7f3784127
144868 Ref: 8047\7f3786936
144869 Ref: 8048\7f3787378
144870 Ref: 8049\7f3801747
144871 Ref: 8050\7f3802344
144872 Ref: 8051\7f3803521
144873 Node: B.3.1\7f3804214
144874 Ref: 8052\7f3804980
144875 Ref: 8053\7f3805035
144876 Ref: 8054\7f3805126
144877 Ref: 8055\7f3805251
144878 Ref: 8056\7f3805322
144879 Ref: 8057\7f3805378
144880 Ref: 8058\7f3805539
144881 Ref: 8059\7f3805619
144882 Ref: 8060\7f3805688
144883 Ref: 8061\7f3805727
144884 Ref: 8062\7f3805784
144885 Ref: 8063\7f3805852
144886 Ref: 8064\7f3805951
144887 Ref: 8065\7f3806015
144888 Ref: 8066\7f3806110
144889 Ref: 8067\7f3806176
144890 Ref: 8068\7f3806381
144891 Ref: 8069\7f3806567
144892 Ref: 8070\7f3813171
144893 Ref: 8071\7f3813436
144894 Ref: 8072\7f3813548
144895 Ref: 8073\7f3813605
144896 Ref: 8074\7f3814315
144897 Ref: 8075\7f3814874
144898 Node: B.3.2\7f3816021
144899 Ref: 8076\7f3817302
144900 Ref: 8077\7f3817358
144901 Ref: 8078\7f3817409
144902 Ref: 8079\7f3817563
144903 Ref: 8080\7f3817675
144904 Ref: 8081\7f3818312
144905 Ref: 8082\7f3818404
144906 Ref: 8083\7f3818562
144907 Ref: 8084\7f3818734
144908 Ref: 8085\7f3818970
144909 Ref: 8086\7f3822292
144910 Ref: 8087\7f3822485
144911 Ref: 8088\7f3822629
144912 Ref: 8089\7f3822847
144913 Ref: 8090\7f3823000
144914 Ref: 8091\7f3823327
144915 Node: B.3.3\7f3825138
144916 Ref: 8092\7f3825338
144917 Ref: 8093\7f3826185
144918 Ref: 8094\7f3826185
144919 Ref: 8095\7f3826435
144920 Ref: 8096\7f3826436
144921 Ref: 8097\7f3826436
144922 Ref: 8098\7f3827554
144923 Ref: 8099\7f3830766
144924 Ref: 8100\7f3831094
144925 Ref: 8101\7f3832887
144926 Ref: 8102\7f3833015
144927 Ref: 8103\7f3833433
144928 Node: B.4\7f3833749
144929 Ref: 8104\7f3833905
144930 Ref: 8105\7f3833906
144931 Ref: 8106\7f3834917
144932 Ref: 8107\7f3835036
144933 Ref: 8108\7f3835097
144934 Ref: 8109\7f3835162
144935 Ref: 8110\7f3835220
144936 Ref: 8111\7f3835272
144937 Ref: 8112\7f3835341
144938 Ref: 8113\7f3835451
144939 Ref: 8114\7f3835512
144940 Ref: 8115\7f3835614
144941 Ref: 8116\7f3835679
144942 Ref: 8117\7f3835770
144943 Ref: 8118\7f3835898
144944 Ref: 8119\7f3836002
144945 Ref: 8120\7f3836068
144946 Ref: 8121\7f3836139
144947 Ref: 8122\7f3836309
144948 Ref: 8123\7f3836489
144949 Ref: 8124\7f3836635
144950 Ref: 8125\7f3836669
144951 Ref: 8126\7f3836725
144952 Ref: 8127\7f3836781
144953 Ref: 8128\7f3836837
144954 Ref: 8129\7f3836893
144955 Ref: 8130\7f3836963
144956 Ref: 8131\7f3836996
144957 Ref: 8132\7f3837048
144958 Ref: 8133\7f3837100
144959 Ref: 8134\7f3837166
144960 Ref: 8135\7f3837199
144961 Ref: 8136\7f3837251
144962 Ref: 8137\7f3837411
144963 Ref: 8138\7f3837461
144964 Ref: 8139\7f3837538
144965 Ref: 8140\7f3837652
144966 Ref: 8141\7f3837773
144967 Ref: 8142\7f3837896
144968 Ref: 8143\7f3837972
144969 Ref: 8144\7f3838101
144970 Ref: 8145\7f3838310
144971 Ref: 8146\7f3838439
144972 Ref: 8147\7f3838514
144973 Ref: 8148\7f3838649
144974 Ref: 8149\7f3838867
144975 Ref: 8150\7f3838992
144976 Ref: 8151\7f3839063
144977 Ref: 8152\7f3839194
144978 Ref: 8153\7f3839410
144979 Ref: 8154\7f3839477
144980 Ref: 8155\7f3839548
144981 Ref: 8156\7f3839615
144982 Ref: 8157\7f3841776
144983 Node: B.5\7f3859524
144984 Ref: 8158\7f3859672
144985 Ref: 8159\7f3859673
144986 Ref: 8160\7f3860488
144987 Ref: 8161\7f3860535
144988 Ref: 8162\7f3860600
144989 Ref: 8163\7f3860664
144990 Ref: 8164\7f3860731
144991 Ref: 8165\7f3860774
144992 Ref: 8166\7f3860882
144993 Ref: 8167\7f3860957
144994 Ref: 8168\7f3861015
144995 Ref: 8169\7f3861079
144996 Ref: 8170\7f3861157
144997 Ref: 8171\7f3861257
144998 Ref: 8172\7f3861364
144999 Ref: 8173\7f3861436
145000 Ref: 8174\7f3861508
145001 Ref: 8175\7f3861581
145002 Ref: 8176\7f3861659
145003 Ref: 8177\7f3861840
145004 Node: Annex C\7f3867023
145005 Ref: 8178\7f3867164
145006 Ref: 8179\7f3867164
145007 Ref: 8180\7f3867165
145008 Ref: 8181\7f3867165
145009 Ref: 8182\7f3867165
145010 Ref: 8183\7f3867165
145011 Ref: 8184\7f3867424
145012 Node: C.1\7f3867741
145013 Ref: 8185\7f3868152
145014 Ref: 8186\7f3869215
145015 Ref: 8187\7f3869216
145016 Ref: 8188\7f3869216
145017 Ref: 8189\7f3869216
145018 Node: C.2\7f3873083
145019 Ref: 8190\7f3873476
145020 Node: C.3\7f3873605
145021 Ref: 8191\7f3873880
145022 Ref: 8192\7f3873933
145023 Ref: 8193\7f3874034
145024 Ref: 8194\7f3874139
145025 Ref: 8195\7f3874267
145026 Ref: 8196\7f3874365
145027 Ref: 8197\7f3874453
145028 Ref: 8198\7f3874593
145029 Ref: 8199\7f3874595
145030 Ref: 8200\7f3874871
145031 Ref: 8201\7f3874873
145032 Ref: 8202\7f3875699
145033 Node: C.3.1\7f3882505
145034 Ref: 8203\7f3883214
145035 Ref: 8204\7f3883214
145036 Ref: 8205\7f3883528
145037 Ref: 8206\7f3883528
145038 Ref: 8207\7f3884073
145039 Ref: 8208\7f3885526
145040 Ref: 8209\7f3885527
145041 Ref: 8210\7f3885853
145042 Ref: 8211\7f3885855
145043 Ref: 8212\7f3885920
145044 Ref: 8213\7f3886086
145045 Ref: 8214\7f3886087
145046 Ref: 8215\7f3886087
145047 Ref: 8216\7f3886442
145048 Ref: 8217\7f3886569
145049 Ref: 8218\7f3888219
145050 Ref: 8219\7f3888560
145051 Ref: 8220\7f3891937
145052 Ref: 8221\7f3894092
145053 Ref: 8222\7f3895367
145054 Ref: 8223\7f3895603
145055 Node: C.3.2\7f3895730
145056 Ref: 8224\7f3895992
145057 Ref: 8225\7f3896071
145058 Ref: 8226\7f3896124
145059 Ref: 8227\7f3896246
145060 Ref: 8228\7f3896332
145061 Ref: 8229\7f3896418
145062 Ref: 8230\7f3896523
145063 Ref: 8231\7f3896655
145064 Ref: 8232\7f3896842
145065 Ref: 8233\7f3896920
145066 Ref: 8234\7f3897041
145067 Ref: 8235\7f3897255
145068 Ref: 8236\7f3898352
145069 Ref: 8237\7f3899900
145070 Ref: 8238\7f3900218
145071 Ref: 8239\7f3900568
145072 Ref: 8240\7f3903541
145073 Node: C.4\7f3903922
145074 Ref: 8241\7f3904816
145075 Node: C.5\7f3909005
145076 Ref: 8242\7f3909357
145077 Ref: 8243\7f3909358
145078 Ref: 8244\7f3909381
145079 Ref: 8245\7f3909565
145080 Ref: 8246\7f3909567
145081 Ref: 8247\7f3910116
145082 Ref: 8248\7f3910116
145083 Node: C.6\7f3914003
145084 Ref: 8249\7f3914651
145085 Ref: 8250\7f3914651
145086 Ref: 8251\7f3914839
145087 Ref: 8252\7f3914839
145088 Ref: 8253\7f3915045
145089 Ref: 8254\7f3915045
145090 Ref: 8255\7f3915467
145091 Ref: 8256\7f3915467
145092 Ref: 8257\7f3915696
145093 Ref: 8258\7f3915696
145094 Ref: 8259\7f3916135
145095 Ref: 8260\7f3916135
145096 Ref: 8261\7f3916596
145097 Ref: 8262\7f3917238
145098 Ref: 8263\7f3918047
145099 Ref: 8264\7f3918047
145100 Ref: 8265\7f3919087
145101 Ref: 8266\7f3924724
145102 Ref: 8267\7f3924831
145103 Ref: 8268\7f3926040
145104 Ref: 8269\7f3930135
145105 Ref: 8270\7f3931008
145106 Ref: 8271\7f3931442
145107 Node: C.7\7f3932594
145108 Node: C.7.1\7f3933444
145109 Ref: 8272\7f3933758
145110 Ref: 8273\7f3933822
145111 Ref: 8274\7f3933900
145112 Ref: 8275\7f3934098
145113 Ref: 8276\7f3934168
145114 Ref: 8277\7f3934219
145115 Ref: 8278\7f3934270
145116 Ref: 8279\7f3934359
145117 Ref: 8280\7f3934430
145118 Ref: 8281\7f3934501
145119 Ref: 8282\7f3936757
145120 Ref: 8283\7f3936772
145121 Ref: 8284\7f3936966
145122 Ref: 8285\7f3936981
145123 Ref: 8286\7f3937338
145124 Ref: 8287\7f3937465
145125 Ref: 8288\7f3937465
145126 Ref: 8289\7f3937643
145127 Ref: 8290\7f3937775
145128 Ref: 8291\7f3938488
145129 Ref: 8292\7f3940197
145130 Node: C.7.2\7f3940689
145131 Ref: 8293\7f3941132
145132 Ref: 8294\7f3941149
145133 Ref: 8295\7f3941211
145134 Ref: 8296\7f3941294
145135 Ref: 8297\7f3941389
145136 Ref: 8298\7f3941498
145137 Ref: 8299\7f3942793
145138 Ref: 8300\7f3942908
145139 Ref: 8301\7f3943952
145140 Ref: 8302\7f3944437
145141 Ref: 8303\7f3944804
145142 Ref: 8304\7f3945082
145143 Node: C.7.3\7f3954064
145144 Ref: 8305\7f3954432
145145 Ref: 8306\7f3954498
145146 Ref: 8307\7f3954581
145147 Ref: 8308\7f3954813
145148 Ref: 8309\7f3954907
145149 Ref: 8310\7f3954988
145150 Ref: 8311\7f3955129
145151 Ref: 8312\7f3955364
145152 Ref: 8313\7f3955365
145153 Ref: 8314\7f3956490
145154 Ref: 8315\7f3956491
145155 Ref: 8316\7f3956491
145156 Ref: 8317\7f3956491
145157 Ref: 8318\7f3956491
145158 Ref: 8319\7f3956491
145159 Ref: 8320\7f3959885
145160 Node: Annex D\7f3960535
145161 Ref: 8321\7f3960671
145162 Ref: 8322\7f3960671
145163 Ref: 8323\7f3964320
145164 Node: D.1\7f3964939
145165 Ref: 8324\7f3965737
145166 Ref: 8325\7f3965737
145167 Ref: 8326\7f3966065
145168 Ref: 8327\7f3966065
145169 Ref: 8328\7f3968374
145170 Ref: 8329\7f3968374
145171 Ref: 8330\7f3968374
145172 Ref: 8331\7f3968374
145173 Ref: 8332\7f3968374
145174 Ref: 8333\7f3969496
145175 Ref: 8334\7f3969915
145176 Ref: 8335\7f3969917
145177 Ref: 8336\7f3973219
145178 Ref: 8337\7f3974175
145179 Node: D.2\7f3974307
145180 Node: D.2.1\7f3975129
145181 Ref: 8338\7f3975597
145182 Ref: 8339\7f3975688
145183 Ref: 8340\7f3975734
145184 Ref: 8341\7f3976547
145185 Ref: 8342\7f3976548
145186 Ref: 8343\7f3976548
145187 Ref: 8344\7f3976548
145188 Ref: 8345\7f3977158
145189 Ref: 8346\7f3977159
145190 Ref: 8347\7f3977159
145191 Ref: 8348\7f3977159
145192 Ref: 8349\7f3977159
145193 Ref: 8350\7f3977159
145194 Ref: 8351\7f3978146
145195 Ref: 8352\7f3980494
145196 Ref: 8353\7f3982740
145197 Node: D.2.2\7f3983119
145198 Ref: 8354\7f3983636
145199 Ref: 8355\7f3983637
145200 Ref: 8356\7f3983668
145201 Ref: 8357\7f3983813
145202 Ref: 8358\7f3983814
145203 Ref: 8359\7f3983863
145204 Ref: 8360\7f3983890
145205 Ref: 8361\7f3983916
145206 Ref: 8362\7f3986283
145207 Ref: 8363\7f3986284
145208 Ref: 8364\7f3986410
145209 Ref: 8365\7f3986412
145210 Ref: 8366\7f3986891
145211 Ref: 8367\7f3987336
145212 Ref: 8368\7f3990008
145213 Node: D.2.3\7f3991101
145214 Ref: 8369\7f3991510
145215 Ref: 8370\7f3991510
145216 Ref: 8371\7f3992825
145217 Ref: 8372\7f3992826
145218 Ref: 8373\7f3993267
145219 Ref: 8374\7f3993837
145220 Node: D.2.4\7f3995871
145221 Ref: 8375\7f3996336
145222 Ref: 8376\7f3996336
145223 Ref: 8377\7f3996477
145224 Ref: 8378\7f3996539
145225 Ref: 8379\7f3996573
145226 Ref: 8380\7f3999627
145227 Ref: 8381\7f3999627
145228 Ref: 8382\7f4002531
145229 Ref: 8383\7f4002686
145230 Node: D.2.5\7f4002741
145231 Ref: 8384\7f4003208
145232 Ref: 8385\7f4003208
145233 Ref: 8386\7f4003389
145234 Ref: 8387\7f4003392
145235 Ref: 8388\7f4003510
145236 Ref: 8389\7f4003639
145237 Ref: 8390\7f4003771
145238 Ref: 8391\7f4003876
145239 Ref: 8392\7f4008680
145240 Node: D.2.6\7f4008784
145241 Ref: 8393\7f4011417
145242 Ref: 8394\7f4011417
145243 Ref: 8395\7f4011607
145244 Ref: 8396\7f4011623
145245 Ref: 8397\7f4011657
145246 Ref: 8398\7f4011763
145247 Ref: 8399\7f4011930
145248 Ref: 8400\7f4012104
145249 Ref: 8401\7f4012600
145250 Ref: 8402\7f4012600
145251 Ref: 8403\7f4018573
145252 Ref: 8404\7f4018968
145253 Ref: 8405\7f4020634
145254 Ref: 8406\7f4020802
145255 Node: D.3\7f4021108
145256 Ref: 8407\7f4021582
145257 Ref: 8408\7f4021583
145258 Ref: 8409\7f4021605
145259 Ref: 8410\7f4021677
145260 Ref: 8411\7f4021748
145261 Ref: 8412\7f4021830
145262 Ref: 8413\7f4021941
145263 Ref: 8414\7f4021941
145264 Ref: 8415\7f4022122
145265 Ref: 8416\7f4022931
145266 Ref: 8417\7f4023616
145267 Ref: 8418\7f4023618
145268 Ref: 8419\7f4023713
145269 Ref: 8420\7f4023713
145270 Ref: 8421\7f4023777
145271 Ref: 8422\7f4025349
145272 Ref: 8423\7f4025349
145273 Ref: 8424\7f4025349
145274 Ref: 8425\7f4025852
145275 Ref: 8426\7f4026005
145276 Ref: 8427\7f4026301
145277 Ref: 8428\7f4031557
145278 Node: D.4\7f4032826
145279 Ref: 8429\7f4033034
145280 Ref: 8430\7f4033405
145281 Ref: 8431\7f4033406
145282 Ref: 8432\7f4033428
145283 Ref: 8433\7f4033500
145284 Ref: 8434\7f4033586
145285 Ref: 8435\7f4033651
145286 Ref: 8436\7f4033651
145287 Ref: 8437\7f4033752
145288 Ref: 8438\7f4034507
145289 Ref: 8439\7f4034507
145290 Ref: 8440\7f4034638
145291 Ref: 8441\7f4034638
145292 Ref: 8442\7f4034647
145293 Node: D.5\7f4042481
145294 Node: D.5.1\7f4043091
145295 Ref: 8443\7f4043601
145296 Ref: 8444\7f4043674
145297 Ref: 8445\7f4043888
145298 Ref: 8446\7f4044380
145299 Ref: 8447\7f4045437
145300 Ref: 8448\7f4048656
145301 Ref: 8449\7f4052495
145302 Node: D.5.2\7f4053497
145303 Ref: 8450\7f4053994
145304 Ref: 8451\7f4054009
145305 Ref: 8452\7f4055249
145306 Ref: 8453\7f4056490
145307 Node: D.6\7f4056599
145308 Node: D.7\7f4060362
145309 Ref: 8454\7f4060857
145310 Ref: 8455\7f4060858
145311 Ref: 8456\7f4061780
145312 Ref: 8457\7f4061781
145313 Ref: 8458\7f4062852
145314 Ref: 8459\7f4062853
145315 Ref: 8460\7f4063008
145316 Ref: 8461\7f4063008
145317 Ref: 8462\7f4063127
145318 Ref: 8463\7f4063127
145319 Ref: 8464\7f4063603
145320 Ref: 8465\7f4063607
145321 Ref: 8466\7f4063607
145322 Ref: 8467\7f4064226
145323 Ref: 8468\7f4064228
145324 Ref: 8469\7f4064342
145325 Ref: 8470\7f4064343
145326 Ref: 8471\7f4064874
145327 Ref: 8472\7f4064875
145328 Ref: 8473\7f4065033
145329 Ref: 8474\7f4065034
145330 Ref: 8475\7f4065159
145331 Ref: 8476\7f4065160
145332 Ref: 8477\7f4065683
145333 Ref: 8478\7f4065745
145334 Ref: 8479\7f4065746
145335 Ref: 8480\7f4066001
145336 Ref: 8481\7f4066002
145337 Ref: 8482\7f4066108
145338 Ref: 8483\7f4066109
145339 Ref: 8484\7f4066238
145340 Ref: 8485\7f4066239
145341 Ref: 8486\7f4066493
145342 Ref: 8487\7f4066494
145343 Ref: 8488\7f4066789
145344 Ref: 8489\7f4066789
145345 Ref: 8490\7f4066915
145346 Ref: 8491\7f4066915
145347 Ref: 8492\7f4067592
145348 Ref: 8493\7f4067594
145349 Ref: 8494\7f4067850
145350 Ref: 8495\7f4067851
145351 Ref: 8496\7f4068464
145352 Ref: 8497\7f4068465
145353 Ref: 8498\7f4068773
145354 Ref: 8499\7f4068774
145355 Ref: 8500\7f4068774
145356 Ref: 8501\7f4069017
145357 Ref: 8502\7f4069018
145358 Ref: 8503\7f4069527
145359 Ref: 8504\7f4069528
145360 Ref: 8505\7f4069528
145361 Ref: 8506\7f4069778
145362 Ref: 8507\7f4069779
145363 Ref: 8508\7f4070254
145364 Ref: 8509\7f4070255
145365 Ref: 8510\7f4070255
145366 Ref: 8511\7f4070844
145367 Ref: 8512\7f4070845
145368 Ref: 8513\7f4071123
145369 Ref: 8514\7f4071156
145370 Ref: 8515\7f4071157
145371 Ref: 8516\7f4071917
145372 Ref: 8517\7f4072891
145373 Ref: 8518\7f4073759
145374 Ref: 8519\7f4074962
145375 Ref: 8520\7f4076930
145376 Node: D.8\7f4077679
145377 Ref: 8521\7f4078027
145378 Ref: 8522\7f4078043
145379 Ref: 8523\7f4078062
145380 Ref: 8524\7f4078097
145381 Ref: 8525\7f4078131
145382 Ref: 8526\7f4078211
145383 Ref: 8527\7f4078235
145384 Ref: 8528\7f4078280
145385 Ref: 8529\7f4078324
145386 Ref: 8530\7f4078368
145387 Ref: 8531\7f4078415
145388 Ref: 8532\7f4078463
145389 Ref: 8533\7f4079827
145390 Ref: 8534\7f4079889
145391 Ref: 8535\7f4079986
145392 Ref: 8536\7f4080048
145393 Ref: 8537\7f4080110
145394 Ref: 8538\7f4080172
145395 Ref: 8539\7f4080234
145396 Ref: 8540\7f4080296
145397 Ref: 8541\7f4080364
145398 Ref: 8542\7f4080444
145399 Ref: 8543\7f4080637
145400 Ref: 8544\7f4081720
145401 Ref: 8545\7f4081720
145402 Ref: 8546\7f4083870
145403 Ref: 8547\7f4087058
145404 Ref: 8548\7f4089785
145405 Ref: 8549\7f4093954
145406 Node: D.9\7f4094827
145407 Ref: 8550\7f4095854
145408 Ref: 8551\7f4095854
145409 Ref: 8552\7f4098225
145410 Ref: 8553\7f4098225
145411 Node: D.10\7f4100336
145412 Ref: 8554\7f4100880
145413 Ref: 8555\7f4100950
145414 Ref: 8556\7f4101005
145415 Ref: 8557\7f4101062
145416 Ref: 8558\7f4101119
145417 Ref: 8559\7f4101189
145418 Ref: 8560\7f4101746
145419 Ref: 8561\7f4101765
145420 Ref: 8562\7f4103028
145421 Ref: 8563\7f4103028
145422 Ref: 8564\7f4103028
145423 Ref: 8565\7f4104254
145424 Ref: 8566\7f4104445
145425 Node: D.10.1\7f4104557
145426 Ref: 8567\7f4105055
145427 Ref: 8568\7f4105128
145428 Ref: 8569\7f4105317
145429 Ref: 8570\7f4105416
145430 Ref: 8571\7f4107472
145431 Node: D.11\7f4107529
145432 Ref: 8572\7f4108092
145433 Ref: 8573\7f4108165
145434 Ref: 8574\7f4108228
145435 Ref: 8575\7f4108294
145436 Ref: 8576\7f4108483
145437 Ref: 8577\7f4108484
145438 Ref: 8578\7f4108484
145439 Ref: 8579\7f4110475
145440 Ref: 8580\7f4110520
145441 Ref: 8581\7f4110631
145442 Ref: 8582\7f4113648
145443 Node: D.12\7f4114330
145444 Node: D.13\7f4117843
145445 Ref: 8583\7f4118103
145446 Ref: 8584\7f4122055
145447 Node: D.14\7f4122299
145448 Ref: 8585\7f4122806
145449 Ref: 8586\7f4122825
145450 Ref: 8587\7f4122849
145451 Ref: 8588\7f4122893
145452 Ref: 8589\7f4122937
145453 Ref: 8590\7f4123010
145454 Ref: 8591\7f4123068
145455 Ref: 8592\7f4123794
145456 Ref: 8593\7f4123895
145457 Ref: 8594\7f4124041
145458 Ref: 8595\7f4124154
145459 Ref: 8596\7f4124295
145460 Ref: 8597\7f4124510
145461 Ref: 8598\7f4124511
145462 Ref: 8599\7f4126628
145463 Ref: 8600\7f4128173
145464 Ref: 8601\7f4131016
145465 Ref: 8602\7f4131158
145466 Node: D.14.1\7f4132196
145467 Ref: 8603\7f4132726
145468 Ref: 8604\7f4132745
145469 Ref: 8605\7f4132898
145470 Ref: 8606\7f4132982
145471 Ref: 8607\7f4133096
145472 Ref: 8608\7f4133266
145473 Ref: 8609\7f4133434
145474 Ref: 8610\7f4133503
145475 Ref: 8611\7f4133630
145476 Ref: 8612\7f4133684
145477 Ref: 8613\7f4134295
145478 Ref: 8614\7f4134297
145479 Ref: 8615\7f4134498
145480 Ref: 8616\7f4136327
145481 Ref: 8617\7f4138737
145482 Ref: 8618\7f4140278
145483 Node: D.14.2\7f4140332
145484 Ref: 8619\7f4140912
145485 Ref: 8620\7f4140980
145486 Ref: 8621\7f4141150
145487 Ref: 8622\7f4141258
145488 Ref: 8623\7f4141380
145489 Ref: 8624\7f4141613
145490 Ref: 8625\7f4141735
145491 Ref: 8626\7f4141861
145492 Ref: 8627\7f4141987
145493 Ref: 8628\7f4142085
145494 Ref: 8629\7f4142154
145495 Ref: 8630\7f4142228
145496 Ref: 8631\7f4142301
145497 Ref: 8632\7f4142372
145498 Ref: 8633\7f4142450
145499 Ref: 8634\7f4142576
145500 Ref: 8635\7f4142668
145501 Ref: 8636\7f4142784
145502 Ref: 8637\7f4143092
145503 Ref: 8638\7f4143579
145504 Ref: 8639\7f4143579
145505 Ref: 8640\7f4143579
145506 Ref: 8641\7f4143868
145507 Ref: 8642\7f4143870
145508 Ref: 8643\7f4149144
145509 Ref: 8644\7f4150486
145510 Ref: 8645\7f4150641
145511 Node: D.14.3\7f4151167
145512 Ref: 8646\7f4151686
145513 Ref: 8647\7f4151704
145514 Ref: 8648\7f4151799
145515 Ref: 8649\7f4153412
145516 Node: D.15\7f4153470
145517 Ref: 8650\7f4154006
145518 Ref: 8651\7f4154024
145519 Ref: 8652\7f4154076
145520 Ref: 8653\7f4154192
145521 Ref: 8654\7f4154368
145522 Ref: 8655\7f4154548
145523 Ref: 8656\7f4154645
145524 Ref: 8657\7f4154774
145525 Ref: 8658\7f4155080
145526 Ref: 8659\7f4155324
145527 Ref: 8660\7f4155326
145528 Ref: 8661\7f4155540
145529 Ref: 8662\7f4162638
145530 Node: D.16\7f4163498
145531 Ref: 8663\7f4163944
145532 Ref: 8664\7f4164009
145533 Ref: 8665\7f4164060
145534 Ref: 8666\7f4164127
145535 Ref: 8667\7f4164301
145536 Ref: 8668\7f4164878
145537 Ref: 8669\7f4164878
145538 Ref: 8670\7f4166969
145539 Node: D.16.1\7f4167103
145540 Ref: 8671\7f4167687
145541 Ref: 8672\7f4167696
145542 Ref: 8673\7f4167757
145543 Ref: 8674\7f4167809
145544 Ref: 8675\7f4167893
145545 Ref: 8676\7f4167969
145546 Ref: 8677\7f4168047
145547 Ref: 8678\7f4168126
145548 Ref: 8679\7f4168329
145549 Ref: 8680\7f4168598
145550 Ref: 8681\7f4168778
145551 Ref: 8682\7f4168957
145552 Ref: 8683\7f4170042
145553 Ref: 8684\7f4170042
145554 Ref: 8685\7f4175780
145555 Node: Annex E\7f4175901
145556 Ref: 8686\7f4176264
145557 Ref: 8687\7f4176355
145558 Ref: 8688\7f4176355
145559 Ref: 8689\7f4176355
145560 Ref: 8690\7f4176656
145561 Ref: 8691\7f4176797
145562 Node: E.1\7f4178202
145563 Ref: 8692\7f4178434
145564 Ref: 8693\7f4178434
145565 Ref: 8694\7f4179626
145566 Ref: 8695\7f4180465
145567 Ref: 8696\7f4180862
145568 Ref: 8697\7f4180862
145569 Ref: 8698\7f4180862
145570 Ref: 8699\7f4180862
145571 Ref: 8700\7f4181565
145572 Ref: 8701\7f4181580
145573 Ref: 8702\7f4181985
145574 Ref: 8703\7f4182117
145575 Node: E.2\7f4184678
145576 Ref: 8704\7f4185118
145577 Ref: 8705\7f4185119
145578 Ref: 8706\7f4185119
145579 Ref: 8707\7f4185119
145580 Ref: 8708\7f4185119
145581 Ref: 8709\7f4185119
145582 Ref: 8710\7f4185909
145583 Ref: 8711\7f4186044
145584 Ref: 8712\7f4186177
145585 Ref: 8713\7f4186286
145586 Node: E.2.1\7f4189499
145587 Ref: 8714\7f4190405
145588 Ref: 8715\7f4190410
145589 Ref: 8716\7f4190477
145590 Ref: 8717\7f4190478
145591 Ref: 8718\7f4190507
145592 Ref: 8719\7f4190589
145593 Ref: 8720\7f4190724
145594 Ref: 8721\7f4190724
145595 Ref: 8722\7f4192697
145596 Ref: 8723\7f4192697
145597 Ref: 8724\7f4193652
145598 Ref: 8725\7f4193854
145599 Ref: 8726\7f4193854
145600 Ref: 8727\7f4193854
145601 Ref: 8728\7f4194485
145602 Node: E.2.2\7f4194673
145603 Ref: 8729\7f4195460
145604 Ref: 8730\7f4195465
145605 Ref: 8731\7f4195530
145606 Ref: 8732\7f4195531
145607 Ref: 8733\7f4195558
145608 Ref: 8734\7f4195640
145609 Ref: 8735\7f4195769
145610 Ref: 8736\7f4195769
145611 Ref: 8737\7f4198348
145612 Ref: 8738\7f4198485
145613 Ref: 8739\7f4198487
145614 Ref: 8740\7f4203120
145615 Ref: 8741\7f4204033
145616 Ref: 8742\7f4206144
145617 Ref: 8743\7f4206854
145618 Ref: 8744\7f4207363
145619 Node: E.2.3\7f4207539
145620 Ref: 8745\7f4208183
145621 Ref: 8746\7f4208188
145622 Ref: 8747\7f4208262
145623 Ref: 8748\7f4208263
145624 Ref: 8749\7f4208299
145625 Ref: 8750\7f4208384
145626 Ref: 8751\7f4208385
145627 Ref: 8752\7f4208416
145628 Ref: 8753\7f4208427
145629 Ref: 8754\7f4208432
145630 Ref: 8755\7f4208608
145631 Ref: 8756\7f4208609
145632 Ref: 8757\7f4208609
145633 Ref: 8758\7f4208609
145634 Ref: 8759\7f4208609
145635 Ref: 8760\7f4208757
145636 Ref: 8761\7f4208757
145637 Ref: 8762\7f4213133
145638 Ref: 8763\7f4213134
145639 Ref: 8764\7f4214187
145640 Ref: 8765\7f4214187
145641 Ref: 8766\7f4214187
145642 Ref: 8767\7f4216603
145643 Ref: 8768\7f4217884
145644 Ref: 8769\7f4218400
145645 Node: E.3\7f4219010
145646 Ref: 8770\7f4219829
145647 Ref: 8771\7f4219844
145648 Ref: 8772\7f4220040
145649 Ref: 8773\7f4220055
145650 Ref: 8774\7f4220318
145651 Ref: 8775\7f4220660
145652 Ref: 8776\7f4221143
145653 Ref: 8777\7f4221143
145654 Ref: 8778\7f4221555
145655 Node: E.4\7f4223054
145656 Ref: 8779\7f4223186
145657 Ref: 8780\7f4223186
145658 Ref: 8781\7f4223186
145659 Ref: 8782\7f4223186
145660 Ref: 8783\7f4223186
145661 Ref: 8784\7f4225008
145662 Ref: 8785\7f4225008
145663 Ref: 8786\7f4225008
145664 Ref: 8787\7f4225699
145665 Ref: 8788\7f4225699
145666 Ref: 8789\7f4226271
145667 Ref: 8790\7f4226711
145668 Ref: 8791\7f4227860
145669 Ref: 8792\7f4227860
145670 Ref: 8793\7f4228229
145671 Ref: 8794\7f4228230
145672 Ref: 8795\7f4228521
145673 Ref: 8796\7f4230066
145674 Ref: 8797\7f4230066
145675 Ref: 8798\7f4230421
145676 Ref: 8799\7f4237819
145677 Ref: 8800\7f4238919
145678 Node: E.4.1\7f4241331
145679 Ref: 8801\7f4242120
145680 Ref: 8802\7f4242120
145681 Ref: 8803\7f4243254
145682 Ref: 8804\7f4243255
145683 Ref: 8805\7f4244072
145684 Node: E.4.2\7f4244152
145685 Node: E.5\7f4248558
145686 Ref: 8806\7f4248728
145687 Ref: 8807\7f4248729
145688 Ref: 8808\7f4249273
145689 Ref: 8809\7f4249290
145690 Ref: 8810\7f4249347
145691 Ref: 8811\7f4249401
145692 Ref: 8812\7f4249564
145693 Ref: 8813\7f4249752
145694 Ref: 8814\7f4249911
145695 Ref: 8815\7f4250114
145696 Ref: 8816\7f4250273
145697 Ref: 8817\7f4250432
145698 Ref: 8818\7f4252514
145699 Ref: 8819\7f4252889
145700 Ref: 8820\7f4254620
145701 Ref: 8821\7f4254620
145702 Ref: 8822\7f4261509
145703 Node: Annex F\7f4262003
145704 Ref: 8823\7f4262143
145705 Ref: 8824\7f4264230
145706 Node: F.1\7f4264623
145707 Ref: 8825\7f4264825
145708 Ref: 8826\7f4264825
145709 Ref: 8827\7f4265107
145710 Ref: 8828\7f4265107
145711 Node: F.2\7f4266661
145712 Ref: 8829\7f4266920
145713 Ref: 8830\7f4266957
145714 Ref: 8831\7f4267013
145715 Ref: 8832\7f4267072
145716 Ref: 8833\7f4267124
145717 Ref: 8834\7f4267179
145718 Ref: 8835\7f4267521
145719 Node: F.3\7f4269491
145720 Ref: 8836\7f4269811
145721 Node: F.3.1\7f4275020
145722 Ref: 8837\7f4275172
145723 Ref: 8838\7f4275173
145724 Node: F.3.2\7f4282621
145725 Ref: 8839\7f4284030
145726 Node: F.3.3\7f4295253
145727 Ref: 8840\7f4296009
145728 Ref: 8841\7f4296026
145729 Ref: 8842\7f4296066
145730 Ref: 8843\7f4296201
145731 Ref: 8844\7f4296357
145732 Ref: 8845\7f4296424
145733 Ref: 8846\7f4296481
145734 Ref: 8847\7f4296550
145735 Ref: 8848\7f4296595
145736 Ref: 8849\7f4296652
145737 Ref: 8850\7f4296709
145738 Ref: 8851\7f4296766
145739 Ref: 8852\7f4297296
145740 Ref: 8853\7f4297334
145741 Ref: 8854\7f4297489
145742 Ref: 8855\7f4297688
145743 Ref: 8856\7f4298117
145744 Ref: 8857\7f4298564
145745 Ref: 8858\7f4298958
145746 Node: F.3.4\7f4307948
145747 Ref: 8859\7f4308150
145748 Ref: 8860\7f4308150
145749 Node: F.3.5\7f4308904
145750 Ref: 8861\7f4309132
145751 Ref: 8862\7f4309133
145752 Ref: 8863\7f4310065
145753 Node: Annex G\7f4310223
145754 Ref: 8864\7f4310341
145755 Ref: 8865\7f4312195
145756 Node: G.1\7f4312370
145757 Node: G.1.1\7f4313687
145758 Ref: 8866\7f4313994
145759 Ref: 8867\7f4314138
145760 Ref: 8868\7f4314271
145761 Ref: 8869\7f4314355
145762 Ref: 8870\7f4314387
145763 Ref: 8871\7f4314436
145764 Ref: 8872\7f4314490
145765 Ref: 8873\7f4314544
145766 Ref: 8874\7f4314602
145767 Ref: 8875\7f4314699
145768 Ref: 8876\7f4314796
145769 Ref: 8877\7f4314897
145770 Ref: 8878\7f4314974
145771 Ref: 8879\7f4315051
145772 Ref: 8880\7f4315131
145773 Ref: 8881\7f4315273
145774 Ref: 8882\7f4315337
145775 Ref: 8883\7f4315449
145776 Ref: 8884\7f4315551
145777 Ref: 8885\7f4315779
145778 Ref: 8886\7f4316298
145779 Ref: 8887\7f4319089
145780 Ref: 8888\7f4327554
145781 Ref: 8889\7f4327554
145782 Ref: 8890\7f4327554
145783 Ref: 8891\7f4327896
145784 Ref: 8892\7f4329557
145785 Ref: 8893\7f4338327
145786 Node: G.1.2\7f4338719
145787 Ref: 8894\7f4339110
145788 Ref: 8895\7f4339380
145789 Ref: 8896\7f4339434
145790 Ref: 8897\7f4339488
145791 Ref: 8898\7f4339542
145792 Ref: 8899\7f4339827
145793 Ref: 8900\7f4339878
145794 Ref: 8901\7f4339929
145795 Ref: 8902\7f4339980
145796 Ref: 8903\7f4340034
145797 Ref: 8904\7f4340088
145798 Ref: 8905\7f4340142
145799 Ref: 8906\7f4340196
145800 Ref: 8907\7f4340253
145801 Ref: 8908\7f4340305
145802 Ref: 8909\7f4340357
145803 Ref: 8910\7f4340409
145804 Ref: 8911\7f4340464
145805 Ref: 8912\7f4340519
145806 Ref: 8913\7f4340574
145807 Ref: 8914\7f4340629
145808 Ref: 8915\7f4340784
145809 Ref: 8916\7f4346803
145810 Ref: 8917\7f4346803
145811 Ref: 8918\7f4346803
145812 Ref: 8919\7f4347755
145813 Ref: 8920\7f4349793
145814 Ref: 8921\7f4353041
145815 Ref: 8922\7f4353843
145816 Node: G.1.3\7f4356531
145817 Ref: 8923\7f4357763
145818 Ref: 8924\7f4357936
145819 Ref: 8925\7f4357971
145820 Ref: 8926\7f4358020
145821 Ref: 8927\7f4358073
145822 Ref: 8928\7f4358211
145823 Ref: 8929\7f4358306
145824 Ref: 8930\7f4358559
145825 Ref: 8931\7f4358771
145826 Ref: 8932\7f4358901
145827 Ref: 8933\7f4359152
145828 Ref: 8934\7f4368828
145829 Node: G.1.4\7f4369237
145830 Ref: 8935\7f4369445
145831 Ref: 8936\7f4369445
145832 Node: G.1.5\7f4369856
145833 Ref: 8937\7f4370090
145834 Ref: 8938\7f4370091
145835 Ref: 8939\7f4370614
145836 Node: G.2\7f4370763
145837 Ref: 8940\7f4370965
145838 Ref: 8941\7f4370965
145839 Ref: 8942\7f4371445
145840 Ref: 8943\7f4373502
145841 Node: G.2.1\7f4373971
145842 Ref: 8944\7f4374994
145843 Ref: 8945\7f4377083
145844 Ref: 8946\7f4377184
145845 Ref: 8947\7f4377995
145846 Ref: 8948\7f4378384
145847 Ref: 8949\7f4379460
145848 Ref: 8950\7f4379460
145849 Ref: 8951\7f4379739
145850 Ref: 8952\7f4381585
145851 Ref: 8953\7f4383665
145852 Node: G.2.2\7f4383959
145853 Ref: 8954\7f4384528
145854 Ref: 8955\7f4384528
145855 Ref: 8956\7f4385625
145856 Ref: 8957\7f4385625
145857 Ref: 8958\7f4386161
145858 Ref: 8959\7f4386161
145859 Ref: 8960\7f4386958
145860 Ref: 8961\7f4386958
145861 Ref: 8962\7f4387755
145862 Ref: 8963\7f4387757
145863 Ref: 8964\7f4387757
145864 Ref: 8965\7f4388093
145865 Ref: 8966\7f4388094
145866 Ref: 8967\7f4389603
145867 Ref: 8968\7f4389604
145868 Node: G.2.3\7f4392447
145869 Ref: 8969\7f4394006
145870 Ref: 8970\7f4394174
145871 Ref: 8971\7f4400913
145872 Ref: 8972\7f4400915
145873 Ref: 8973\7f4401066
145874 Ref: 8974\7f4401541
145875 Node: G.2.4\7f4403496
145876 Ref: 8975\7f4403848
145877 Ref: 8976\7f4403848
145878 Ref: 8977\7f4404310
145879 Ref: 8978\7f4404312
145880 Ref: 8979\7f4404464
145881 Ref: 8980\7f4405673
145882 Node: G.2.5\7f4411183
145883 Node: G.2.6\7f4423841
145884 Ref: 8981\7f4424510
145885 Ref: 8982\7f4424975
145886 Ref: 8983\7f4425249
145887 Ref: 8984\7f4425635
145888 Ref: 8985\7f4425637
145889 Ref: 8986\7f4427514
145890 Node: G.3\7f4434812
145891 Ref: 8987\7f4436600
145892 Node: G.3.1\7f4436792
145893 Ref: 8988\7f4437212
145894 Ref: 8989\7f4437295
145895 Ref: 8990\7f4437362
145896 Ref: 8991\7f4438505
145897 Ref: 8992\7f4438987
145898 Ref: 8993\7f4439938
145899 Ref: 8994\7f4440016
145900 Ref: 8995\7f4440080
145901 Ref: 8996\7f4440143
145902 Ref: 8997\7f4440282
145903 Ref: 8998\7f4440356
145904 Ref: 8999\7f4440582
145905 Ref: 9000\7f4440839
145906 Ref: 9001\7f4442659
145907 Ref: 9002\7f4446099
145908 Ref: 9003\7f4455124
145909 Ref: 9004\7f4461122
145910 Node: G.3.2\7f4461393
145911 Ref: 9005\7f4462086
145912 Ref: 9006\7f4462172
145913 Ref: 9007\7f4462240
145914 Ref: 9008\7f4462506
145915 Ref: 9009\7f4462567
145916 Ref: 9010\7f4462634
145917 Ref: 9011\7f4462740
145918 Ref: 9012\7f4462850
145919 Ref: 9013\7f4462947
145920 Ref: 9014\7f4463050
145921 Ref: 9015\7f4463262
145922 Ref: 9016\7f4463333
145923 Ref: 9017\7f4463461
145924 Ref: 9018\7f4463565
145925 Ref: 9019\7f4463949
145926 Ref: 9020\7f4465888
145927 Ref: 9021\7f4466199
145928 Ref: 9022\7f4466260
145929 Ref: 9023\7f4466328
145930 Ref: 9024\7f4466434
145931 Ref: 9025\7f4466545
145932 Ref: 9026\7f4466642
145933 Ref: 9027\7f4466745
145934 Ref: 9028\7f4466963
145935 Ref: 9029\7f4467034
145936 Ref: 9030\7f4467162
145937 Ref: 9031\7f4467266
145938 Ref: 9032\7f4467648
145939 Ref: 9033\7f4467723
145940 Ref: 9034\7f4470614
145941 Ref: 9035\7f4470712
145942 Ref: 9036\7f4470782
145943 Ref: 9037\7f4470851
145944 Ref: 9038\7f4470986
145945 Ref: 9039\7f4471062
145946 Ref: 9040\7f4471294
145947 Ref: 9041\7f4471557
145948 Ref: 9042\7f4473404
145949 Ref: 9043\7f4482321
145950 Ref: 9044\7f4499770
145951 Ref: 9045\7f4505726
145952 Node: Annex H\7f4506001
145953 Ref: 9046\7f4506177
145954 Ref: 9047\7f4506178
145955 Ref: 9048\7f4506839
145956 Ref: 9049\7f4506969
145957 Ref: 9050\7f4506970
145958 Ref: 9051\7f4507745
145959 Node: H.1\7f4508578
145960 Ref: 9052\7f4509216
145961 Ref: 9053\7f4509217
145962 Ref: 9054\7f4509288
145963 Ref: 9055\7f4509288
145964 Node: H.2\7f4512931
145965 Ref: 9056\7f4513150
145966 Node: H.3\7f4515348
145967 Node: H.3.1\7f4515651
145968 Ref: 9057\7f4516475
145969 Ref: 9058\7f4516476
145970 Ref: 9059\7f4516540
145971 Ref: 9060\7f4516540
145972 Node: H.3.2\7f4525303
145973 Ref: 9061\7f4525948
145974 Ref: 9062\7f4525949
145975 Ref: 9063\7f4525974
145976 Ref: 9064\7f4525989
145977 Ref: 9065\7f4526475
145978 Ref: 9066\7f4526611
145979 Node: H.4\7f4531965
145980 Ref: 9067\7f4533132
145981 Ref: 9068\7f4533132
145982 Ref: 9069\7f4533294
145983 Ref: 9070\7f4533294
145984 Ref: 9071\7f4533413
145985 Ref: 9072\7f4533414
145986 Ref: 9073\7f4533883
145987 Ref: 9074\7f4533884
145988 Ref: 9075\7f4534006
145989 Ref: 9076\7f4534007
145990 Ref: 9077\7f4534117
145991 Ref: 9078\7f4534118
145992 Ref: 9079\7f4534666
145993 Ref: 9080\7f4534668
145994 Ref: 9081\7f4534911
145995 Ref: 9082\7f4534911
145996 Ref: 9083\7f4535826
145997 Ref: 9084\7f4535826
145998 Ref: 9085\7f4536700
145999 Ref: 9086\7f4536700
146000 Ref: 9087\7f4537518
146001 Ref: 9088\7f4537520
146002 Ref: 9089\7f4538018
146003 Ref: 9090\7f4538018
146004 Ref: 9091\7f4538056
146005 Ref: 9092\7f4538057
146006 Ref: 9093\7f4538104
146007 Ref: 9094\7f4538104
146008 Ref: 9095\7f4538248
146009 Ref: 9096\7f4538249
146010 Ref: 9097\7f4538774
146011 Ref: 9098\7f4538774
146012 Ref: 9099\7f4539139
146013 Ref: 9100\7f4539139
146014 Ref: 9101\7f4539264
146015 Ref: 9102\7f4539264
146016 Ref: 9103\7f4543753
146017 Ref: 9104\7f4544170
146018 Ref: 9105\7f4545853
146019 Ref: 9106\7f4546840
146020 Node: H.5\7f4547865
146021 Ref: 9107\7f4548299
146022 Ref: 9108\7f4548300
146023 Ref: 9109\7f4548399
146024 Ref: 9110\7f4548400
146025 Ref: 9111\7f4549249
146026 Node: H.6\7f4549282
146027 Ref: 9112\7f4549724
146028 Ref: 9113\7f4549725
146029 Ref: 9114\7f4549762
146030 Ref: 9115\7f4550519
146031 Ref: 9116\7f4550520
146032 Ref: 9117\7f4551005
146033 Ref: 9118\7f4553893
146034 Node: Annex J\7f4553949
146035 Ref: 9119\7f4554123
146036 Node: J.1\7f4556879
146037 Node: J.2\7f4558181
146038 Node: J.3\7f4560896
146039 Ref: 9120\7f4561603
146040 Ref: S0321\7f4561603
146041 Ref: 9121\7f4561621
146042 Ref: 9122\7f4561633
146043 Ref: 9123\7f4561703
146044 Ref: 9124\7f4561997
146045 Ref: 9125\7f4563252
146046 Ref: 9126\7f4563465
146047 Ref: 9127\7f4563697
146048 Node: J.4\7f4564658
146049 Ref: 9128\7f4564984
146050 Ref: 9129\7f4564984
146051 Node: J.5\7f4566409
146052 Node: J.6\7f4569014
146053 Node: J.7\7f4570146
146054 Ref: 9130\7f4570307
146055 Ref: S0322\7f4570307
146056 Ref: 9131\7f4570316
146057 Ref: 9132\7f4570335
146058 Ref: 9133\7f4571089
146059 Node: J.7.1\7f4571636
146060 Ref: 9134\7f4572166
146061 Ref: 9135\7f4572168
146062 Ref: 9136\7f4572168
146063 Ref: 9137\7f4572570
146064 Ref: 9138\7f4572905
146065 Ref: 9139\7f4573182
146066 Ref: 9140\7f4573332
146067 Ref: 9141\7f4574001
146068 Node: J.8\7f4577416
146069 Ref: 9142\7f4577580
146070 Ref: S0323\7f4577580
146071 Ref: 9143\7f4577599
146072 Node: J.9\7f4578668
146073 Ref: 9144\7f4578918
146074 Ref: 9145\7f4578918
146075 Ref: 9146\7f4579813
146076 Node: J.10\7f4580957
146077 Ref: 9147\7f4581364
146078 Ref: 9148\7f4581365
146079 Ref: 9149\7f4581374
146080 Ref: 9150\7f4581393
146081 Node: J.11\7f4584135
146082 Ref: 9151\7f4584570
146083 Ref: 9152\7f4584570
146084 Node: J.12\7f4585510
146085 Node: J.13\7f4586656
146086 Ref: 9153\7f4587185
146087 Ref: 9154\7f4587361
146088 Ref: 9155\7f4587541
146089 Node: J.14\7f4587950
146090 Node: J.15\7f4589487
146091 Node: J.15.1\7f4590466
146092 Ref: 9156\7f4590749
146093 Ref: 9157\7f4590749
146094 Ref: 9158\7f4590769
146095 Ref: 9159\7f4590770
146096 Ref: 9160\7f4590778
146097 Ref: 9161\7f4590784
146098 Ref: 9162\7f4592987
146099 Ref: 9163\7f4593460
146100 Ref: 9164\7f4593771
146101 Node: J.15.2\7f4594136
146102 Ref: 9165\7f4594443
146103 Ref: 9166\7f4594443
146104 Ref: 9167\7f4594463
146105 Ref: 9168\7f4594464
146106 Ref: 9169\7f4594485
146107 Ref: 9170\7f4594508
146108 Node: J.15.3\7f4595265
146109 Ref: 9171\7f4595557
146110 Ref: 9172\7f4595557
146111 Ref: 9173\7f4595577
146112 Ref: 9174\7f4595578
146113 Ref: 9175\7f4595598
146114 Node: J.15.4\7f4596213
146115 Ref: 9176\7f4596494
146116 Ref: 9177\7f4596495
146117 Ref: 9178\7f4596509
146118 Ref: 9179\7f4596795
146119 Node: J.15.5\7f4597311
146120 Ref: 9180\7f4597519
146121 Ref: 9181\7f4597520
146122 Ref: 9182\7f4597520
146123 Ref: 9183\7f4597520
146124 Ref: 9184\7f4597520
146125 Ref: 9185\7f4597520
146126 Ref: 9186\7f4597520
146127 Ref: 9187\7f4597520
146128 Ref: 9188\7f4597520
146129 Ref: 9189\7f4597520
146130 Ref: 9190\7f4597520
146131 Ref: 9191\7f4597520
146132 Ref: 9192\7f4597520
146133 Ref: 9193\7f4597683
146134 Ref: 9194\7f4597684
146135 Ref: 9195\7f4597729
146136 Ref: 9196\7f4597752
146137 Ref: 9197\7f4597814
146138 Ref: 9198\7f4597868
146139 Ref: 9199\7f4597900
146140 Ref: 9200\7f4597901
146141 Ref: 9201\7f4597946
146142 Ref: 9202\7f4597969
146143 Ref: 9203\7f4598031
146144 Ref: 9204\7f4598085
146145 Ref: 9205\7f4598117
146146 Ref: 9206\7f4598118
146147 Ref: 9207\7f4598156
146148 Ref: 9208\7f4598183
146149 Ref: 9209\7f4598489
146150 Ref: 9210\7f4598490
146151 Ref: 9211\7f4598884
146152 Node: J.15.6\7f4600872
146153 Ref: 9212\7f4601197
146154 Ref: 9213\7f4601198
146155 Ref: 9214\7f4601222
146156 Ref: 9215\7f4601223
146157 Ref: 9216\7f4601254
146158 Node: J.15.7\7f4601976
146159 Ref: 9217\7f4602312
146160 Ref: 9218\7f4602313
146161 Ref: 9219\7f4602340
146162 Ref: 9220\7f4602456
146163 Ref: 9221\7f4602457
146164 Ref: 9222\7f4602481
146165 Ref: 9223\7f4602486
146166 Ref: 9224\7f4602871
146167 Ref: 9225\7f4603295
146168 Ref: 9226\7f4604850
146169 Node: J.15.8\7f4605444
146170 Ref: 9227\7f4605827
146171 Ref: 9228\7f4605828
146172 Ref: 9229\7f4605836
146173 Ref: 9230\7f4605867
146174 Ref: 9231\7f4605868
146175 Ref: 9232\7f4605878
146176 Ref: 9233\7f4605934
146177 Ref: 9234\7f4605935
146178 Ref: 9235\7f4605958
146179 Ref: 9236\7f4605995
146180 Ref: 9237\7f4605996
146181 Ref: 9238\7f4606021
146182 Ref: 9239\7f4606052
146183 Ref: 9240\7f4606053
146184 Ref: 9241\7f4606080
146185 Ref: 9242\7f4606136
146186 Ref: 9243\7f4606137
146187 Ref: 9244\7f4606161
146188 Ref: 9245\7f4607793
146189 Ref: 9246\7f4607795
146190 Ref: 9247\7f4607795
146191 Ref: 9248\7f4607795
146192 Ref: 9249\7f4607795
146193 Ref: 9250\7f4607795
146194 Ref: 9251\7f4607795
146195 Ref: 9252\7f4607795
146196 Ref: 9253\7f4607795
146197 Ref: 9254\7f4607795
146198 Ref: 9255\7f4607795
146199 Ref: 9256\7f4607795
146200 Node: J.15.9\7f4608237
146201 Ref: 9257\7f4608794
146202 Ref: 9258\7f4608795
146203 Ref: 9259\7f4608800
146204 Ref: 9260\7f4608981
146205 Ref: 9261\7f4609852
146206 Node: J.15.10\7f4609873
146207 Ref: 9262\7f4610483
146208 Ref: 9263\7f4610484
146209 Ref: 9264\7f4610698
146210 Ref: 9265\7f4611289
146211 Node: J.15.11\7f4611325
146212 Ref: 9266\7f4611647
146213 Ref: 9267\7f4611648
146214 Ref: 9268\7f4611784
146215 Ref: 9269\7f4611785
146216 Ref: 9270\7f4611990
146217 Ref: 9271\7f4611990
146218 Node: J.15.12\7f4613836
146219 Ref: 9272\7f4614137
146220 Ref: 9273\7f4614138
146221 Ref: 9274\7f4614343
146222 Node: J.15.13\7f4615295
146223 Ref: 9275\7f4615600
146224 Ref: 9276\7f4615600
146225 Ref: 9277\7f4615620
146226 Ref: 9278\7f4615621
146227 Ref: 9279\7f4615635
146228 Node: Annex K\7f4616362
146229 Node: K.1\7f4616818
146230 Ref: 9280\7f4616991
146231 Node: K.2\7f4626268
146232 Ref: 9281\7f4626447
146233 Ref: 9282\7f4628061
146234 Ref: 9283\7f4628272
146235 Ref: 9284\7f4628274
146236 Ref: 9285\7f4632660
146237 Ref: 9286\7f4632675
146238 Ref: 9287\7f4634052
146239 Ref: 9288\7f4634422
146240 Ref: 9289\7f4634424
146241 Ref: 9290\7f4635229
146242 Ref: 9291\7f4635438
146243 Ref: 9292\7f4635440
146244 Ref: 9293\7f4638376
146245 Ref: 9294\7f4638391
146246 Ref: 9295\7f4638697
146247 Ref: 9296\7f4638697
146248 Ref: 9297\7f4648499
146249 Ref: 9298\7f4648514
146250 Ref: 9299\7f4648514
146251 Ref: 9300\7f4649698
146252 Ref: 9301\7f4649949
146253 Ref: 9302\7f4649950
146254 Ref: 9303\7f4653997
146255 Ref: 9304\7f4660006
146256 Ref: 9305\7f4663975
146257 Ref: 9306\7f4664140
146258 Ref: 9307\7f4664141
146259 Ref: 9308\7f4664642
146260 Ref: 9309\7f4664643
146261 Ref: 9310\7f4667346
146262 Ref: 9311\7f4667663
146263 Ref: 9312\7f4667665
146264 Ref: 9313\7f4670933
146265 Ref: 9314\7f4671527
146266 Ref: 9315\7f4671827
146267 Ref: 9316\7f4671829
146268 Ref: 9317\7f4675855
146269 Ref: 9318\7f4676020
146270 Ref: 9319\7f4676021
146271 Ref: 9320\7f4676507
146272 Ref: 9321\7f4676508
146273 Ref: 9322\7f4679313
146274 Ref: 9323\7f4679328
146275 Ref: 9324\7f4679737
146276 Ref: 9325\7f4680927
146277 Ref: 9326\7f4681797
146278 Node: Annex L\7f4684524
146279 Ref: 9327\7f4684674
146280 Ref: 9328\7f4684770
146281 Ref: 9329\7f4684771
146282 Ref: 9330\7f4684802
146283 Ref: 9331\7f4684845
146284 Ref: 9332\7f4684846
146285 Ref: 9333\7f4684872
146286 Ref: 9334\7f4684905
146287 Ref: 9335\7f4684956
146288 Ref: 9336\7f4684957
146289 Ref: 9337\7f4684981
146290 Ref: 9338\7f4685030
146291 Ref: 9339\7f4685031
146292 Ref: 9340\7f4685068
146293 Ref: 9341\7f4685090
146294 Ref: 9342\7f4685119
146295 Ref: 9343\7f4685141
146296 Ref: 9344\7f4685225
146297 Ref: 9345\7f4685226
146298 Ref: 9346\7f4685240
146299 Ref: 9347\7f4685324
146300 Ref: 9348\7f4685325
146301 Ref: 9349\7f4685333
146302 Ref: 9350\7f4685416
146303 Ref: 9351\7f4685417
146304 Ref: 9352\7f4685442
146305 Ref: 9353\7f4685525
146306 Ref: 9354\7f4685526
146307 Ref: 9355\7f4685550
146308 Ref: 9356\7f4685555
146309 Ref: 9357\7f4685673
146310 Ref: 9358\7f4685674
146311 Ref: 9359\7f4685712
146312 Ref: 9360\7f4685734
146313 Ref: 9361\7f4685784
146314 Ref: 9362\7f4685785
146315 Ref: 9363\7f4685790
146316 Ref: 9364\7f4685839
146317 Ref: 9365\7f4685840
146318 Ref: 9366\7f4685862
146319 Ref: 9367\7f4685924
146320 Ref: 9368\7f4685925
146321 Ref: 9369\7f4685971
146322 Ref: 9370\7f4685972
146323 Ref: 9371\7f4685995
146324 Ref: 9372\7f4686043
146325 Ref: 9373\7f4686044
146326 Ref: 9374\7f4686111
146327 Ref: 9375\7f4686112
146328 Ref: 9376\7f4686135
146329 Ref: 9377\7f4686155
146330 Ref: 9378\7f4686196
146331 Ref: 9379\7f4686197
146332 Ref: 9380\7f4686224
146333 Ref: 9381\7f4686244
146334 Ref: 9382\7f4686285
146335 Ref: 9383\7f4686286
146336 Ref: 9384\7f4686315
146337 Ref: 9385\7f4686395
146338 Ref: 9386\7f4686396
146339 Ref: 9387\7f4686436
146340 Ref: 9388\7f4686459
146341 Ref: 9389\7f4686516
146342 Ref: 9390\7f4686565
146343 Ref: 9391\7f4686651
146344 Ref: 9392\7f4686652
146345 Ref: 9393\7f4686692
146346 Ref: 9394\7f4686715
146347 Ref: 9395\7f4686772
146348 Ref: 9396\7f4686821
146349 Ref: 9397\7f4686872
146350 Ref: 9398\7f4686873
146351 Ref: 9399\7f4686896
146352 Ref: 9400\7f4686946
146353 Ref: 9401\7f4686947
146354 Ref: 9402\7f4686971
146355 Ref: 9403\7f4687056
146356 Ref: 9404\7f4687057
146357 Ref: 9405\7f4687065
146358 Ref: 9406\7f4687071
146359 Ref: 9407\7f4687113
146360 Ref: 9408\7f4687114
146361 Ref: 9409\7f4687139
146362 Ref: 9410\7f4687154
146363 Ref: 9411\7f4687234
146364 Ref: 9412\7f4687235
146365 Ref: 9413\7f4687262
146366 Ref: 9414\7f4687341
146367 Ref: 9415\7f4687342
146368 Ref: 9416\7f4687411
146369 Ref: 9417\7f4687412
146370 Ref: 9418\7f4687434
146371 Ref: 9419\7f4687477
146372 Ref: 9420\7f4687478
146373 Ref: 9421\7f4687483
146374 Ref: 9422\7f4687526
146375 Ref: 9423\7f4687527
146376 Ref: 9424\7f4687549
146377 Ref: 9425\7f4687633
146378 Ref: 9426\7f4687634
146379 Ref: 9427\7f4687655
146380 Ref: 9428\7f4687678
146381 Ref: 9429\7f4687725
146382 Ref: 9430\7f4687726
146383 Ref: 9431\7f4687775
146384 Ref: 9432\7f4687776
146385 Ref: 9433\7f4687785
146386 Ref: 9434\7f4687867
146387 Ref: 9435\7f4687868
146388 Ref: 9436\7f4687888
146389 Ref: 9437\7f4687934
146390 Ref: 9438\7f4687935
146391 Ref: 9439\7f4687975
146392 Ref: 9440\7f4687976
146393 Ref: 9441\7f4688013
146394 Ref: 9442\7f4688060
146395 Ref: 9443\7f4688061
146396 Ref: 9444\7f4688090
146397 Ref: 9445\7f4688137
146398 Ref: 9446\7f4688138
146399 Ref: 9447\7f4688165
146400 Ref: 9448\7f4688245
146401 Ref: 9449\7f4688246
146402 Ref: 9450\7f4688307
146403 Ref: 9451\7f4688308
146404 Ref: 9452\7f4688352
146405 Ref: 9453\7f4688379
146406 Ref: 9454\7f4688405
146407 Ref: 9455\7f4688455
146408 Ref: 9456\7f4688456
146409 Ref: 9457\7f4688473
146410 Ref: 9458\7f4688495
146411 Ref: 9459\7f4688596
146412 Ref: 9460\7f4688597
146413 Ref: 9461\7f4688616
146414 Ref: 9462\7f4688657
146415 Ref: 9463\7f4688658
146416 Ref: 9464\7f4688680
146417 Ref: 9465\7f4688764
146418 Ref: 9466\7f4688765
146419 Ref: 9467\7f4688849
146420 Ref: 9468\7f4688850
146421 Ref: 9469\7f4688886
146422 Ref: 9470\7f4688926
146423 Ref: 9471\7f4688927
146424 Ref: 9472\7f4688954
146425 Ref: 9473\7f4688994
146426 Ref: 9474\7f4688995
146427 Ref: 9475\7f4689008
146428 Ref: 9476\7f4689021
146429 Ref: 9477\7f4689069
146430 Ref: 9478\7f4689070
146431 Ref: 9479\7f4689114
146432 Ref: 9480\7f4689115
146433 Ref: 9481\7f4689144
146434 Ref: 9482\7f4689223
146435 Ref: 9483\7f4689224
146436 Ref: 9484\7f4689238
146437 Ref: 9485\7f4689284
146438 Ref: 9486\7f4689285
146439 Ref: 9487\7f4689294
146440 Ref: 9488\7f4689338
146441 Ref: 9489\7f4689339
146442 Ref: 9490\7f4689370
146443 Ref: 9491\7f4689456
146444 Ref: 9492\7f4689457
146445 Ref: 9493\7f4689488
146446 Ref: 9494\7f4689538
146447 Ref: 9495\7f4689539
146448 Ref: 9496\7f4689550
146449 Ref: 9497\7f4689633
146450 Ref: 9498\7f4689634
146451 Ref: 9499\7f4689644
146452 Ref: 9500\7f4689729
146453 Ref: 9501\7f4689730
146454 Ref: 9502\7f4689757
146455 Node: Annex M\7f4689971
146456 Ref: 9503\7f4690173
146457 Node: M.1\7f4690918
146458 Ref: 9504\7f4691064
146459 Ref: 9505\7f4691064
146460 Node: M.2\7f4698505
146461 Ref: 9506\7f4698669
146462 Ref: 9507\7f4698748
146463 Ref: 9508\7f4698860
146464 Ref: 9509\7f4698861
146465 Ref: 9510\7f4713077
146466 Node: M.3\7f4719609
146467 Ref: 9511\7f4719727
146468 Ref: 9512\7f4719727
146469 Node: Annex N\7f4750293
146470 Ref: 9513\7f4750441
146471 Ref: 9514\7f4750664
146472 Ref: 9515\7f4750818
146473 Ref: 9516\7f4750982
146474 Ref: 9517\7f4751299
146475 Ref: 9518\7f4751542
146476 Ref: 9519\7f4751677
146477 Ref: 9520\7f4751877
146478 Ref: 9521\7f4752161
146479 Ref: 9522\7f4752369
146480 Ref: 9523\7f4752464
146481 Ref: 9524\7f4752481
146482 Ref: 9525\7f4752746
146483 Ref: 9526\7f4753006
146484 Ref: 9527\7f4753064
146485 Ref: 9528\7f4753205
146486 Ref: 9529\7f4753435
146487 Ref: 9530\7f4753580
146488 Ref: 9531\7f4753682
146489 Ref: 9532\7f4753684
146490 Ref: 9533\7f4753946
146491 Ref: 9534\7f4754481
146492 Ref: 9535\7f4754648
146493 Ref: 9536\7f4754819
146494 Ref: 9537\7f4755086
146495 Ref: 9538\7f4755238
146496 Ref: 9539\7f4755305
146497 Ref: 9540\7f4755453
146498 Ref: 9541\7f4755602
146499 Ref: 9542\7f4755753
146500 Ref: 9543\7f4755896
146501 Ref: 9544\7f4756003
146502 Ref: 9545\7f4756097
146503 Ref: 9546\7f4756099
146504 Ref: 9547\7f4756217
146505 Ref: 9548\7f4756333
146506 Ref: 9549\7f4756976
146507 Ref: 9550\7f4757229
146508 Ref: 9551\7f4757396
146509 Ref: 9552\7f4757859
146510 Ref: 9553\7f4758201
146511 Ref: 9554\7f4758364
146512 Ref: 9555\7f4758533
146513 Ref: 9556\7f4758748
146514 Ref: 9557\7f4759010
146515 Ref: 9558\7f4759113
146516 Ref: 9559\7f4759287
146517 Ref: 9560\7f4759535
146518 Ref: 9561\7f4759711
146519 Ref: 9562\7f4760100
146520 Ref: 9563\7f4760278
146521 Ref: 9564\7f4760610
146522 Ref: 9565\7f4760732
146523 Ref: 9566\7f4760957
146524 Ref: 9567\7f4761074
146525 Ref: 9568\7f4761182
146526 Ref: 9569\7f4761799
146527 Ref: 9570\7f4761938
146528 Ref: 9571\7f4762217
146529 Ref: 9572\7f4762342
146530 Ref: 9573\7f4762586
146531 Ref: 9574\7f4762771
146532 Ref: 9575\7f4763104
146533 Ref: 9576\7f4763294
146534 Ref: 9577\7f4763432
146535 Ref: 9578\7f4763543
146536 Ref: 9579\7f4763673
146537 Ref: 9580\7f4763809
146538 Ref: 9581\7f4763949
146539 Ref: 9582\7f4764027
146540 Ref: 9583\7f4764332
146541 Ref: 9584\7f4764511
146542 Ref: 9585\7f4764826
146543 Ref: 9586\7f4765071
146544 Ref: 9587\7f4765319
146545 Ref: 9588\7f4765768
146546 Ref: 9589\7f4765997
146547 Ref: 9590\7f4766273
146548 Node: Annex P\7f4766396
146549 Ref: 9591\7f4766524
146550 Ref: 9592\7f4766524
146551 Ref: 9593\7f4766524
146552 Ref: 9594\7f4766524
146553 Ref: 9595\7f4766524
146554 Ref: 9596\7f4766690
146555 Ref: 9597\7f4766708
146556 Ref: 9598\7f4766727
146557 Ref: 9599\7f4766802
146558 Ref: 9600\7f4766829
146559 Ref: 9601\7f4766856
146560 Ref: 9602\7f4766883
146561 Ref: 9603\7f4766909
146562 Ref: 9604\7f4766932
146563 Ref: 9605\7f4767003
146564 Ref: 9606\7f4767030
146565 Ref: 9607\7f4767063
146566 Ref: 9608\7f4767088
146567 Ref: 9609\7f4767154
146568 Ref: 9610\7f4767172
146569 Ref: 9611\7f4767232
146570 Ref: 9612\7f4767242
146571 Ref: 9613\7f4767252
146572 Ref: 9614\7f4767300
146573 Ref: 9615\7f4767308
146574 Ref: 9616\7f4767319
146575 Ref: 9617\7f4767371
146576 Ref: 9618\7f4767385
146577 Ref: 9619\7f4767520
146578 Ref: 9620\7f4767527
146579 Ref: 9621\7f4767543
146580 Ref: 9622\7f4767561
146581 Ref: 9623\7f4767606
146582 Ref: 9624\7f4767667
146583 Ref: 9625\7f4767684
146584 Ref: 9626\7f4767695
146585 Ref: 9627\7f4767756
146586 Ref: 9628\7f4767833
146587 Ref: 9629\7f4767897
146588 Ref: 9630\7f4767981
146589 Ref: 9631\7f4768054
146590 Ref: 9632\7f4768116
146591 Ref: 9633\7f4768129
146592 Ref: 9634\7f4768160
146593 Ref: 9635\7f4768282
146594 Ref: 9636\7f4768297
146595 Ref: 9637\7f4768329
146596 Ref: 9638\7f4768344
146597 Ref: 9639\7f4768381
146598 Ref: 9640\7f4768397
146599 Ref: 9641\7f4768428
146600 Ref: 9642\7f4768444
146601 Ref: 9643\7f4768512
146602 Ref: 9644\7f4768533
146603 Ref: 9645\7f4768563
146604 Ref: 9646\7f4768586
146605 Ref: 9647\7f4768615
146606 Ref: 9648\7f4768642
146607 Ref: 9649\7f4768684
146608 Ref: 9650\7f4768715
146609 Ref: 9651\7f4768757
146610 Ref: 9652\7f4768781
146611 Ref: 9653\7f4768812
146612 Ref: 9654\7f4768838
146613 Ref: 9655\7f4768868
146614 Ref: 9656\7f4768938
146615 Ref: 9657\7f4768997
146616 Ref: 9658\7f4769029
146617 Ref: 9659\7f4769067
146618 Ref: 9660\7f4769102
146619 Ref: 9661\7f4769200
146620 Ref: 9662\7f4769221
146621 Ref: 9663\7f4769249
146622 Ref: 9664\7f4769285
146623 Ref: 9665\7f4769318
146624 Ref: 9666\7f4769350
146625 Ref: 9667\7f4769434
146626 Ref: 9668\7f4769466
146627 Ref: 9669\7f4769500
146628 Ref: 9670\7f4769525
146629 Ref: 9671\7f4769557
146630 Ref: 9672\7f4769584
146631 Ref: 9673\7f4769617
146632 Ref: 9674\7f4769645
146633 Ref: 9675\7f4769738
146634 Ref: 9676\7f4769761
146635 Ref: 9677\7f4769794
146636 Ref: 9678\7f4769868
146637 Ref: 9679\7f4769884
146638 Ref: 9680\7f4769898
146639 Ref: 9681\7f4769961
146640 Ref: 9682\7f4770007
146641 Ref: 9683\7f4770027
146642 Ref: 9684\7f4770107
146643 Ref: 9685\7f4770126
146644 Ref: 9686\7f4770146
146645 Ref: 9687\7f4770225
146646 Ref: 9688\7f4770244
146647 Ref: 9689\7f4770327
146648 Ref: 9690\7f4770375
146649 Ref: 9691\7f4770404
146650 Ref: 9692\7f4770430
146651 Ref: 9693\7f4770462
146652 Ref: 9694\7f4770510
146653 Ref: 9695\7f4770538
146654 Ref: 9696\7f4770564
146655 Ref: 9697\7f4770596
146656 Ref: 9698\7f4770644
146657 Ref: 9699\7f4770676
146658 Ref: 9700\7f4770702
146659 Ref: 9701\7f4770734
146660 Ref: 9702\7f4770767
146661 Ref: 9703\7f4770859
146662 Ref: 9704\7f4770882
146663 Ref: 9705\7f4770963
146664 Ref: 9706\7f4771009
146665 Ref: 9707\7f4771115
146666 Ref: 9708\7f4771140
146667 Ref: 9709\7f4771162
146668 Ref: 9710\7f4771237
146669 Ref: 9711\7f4771278
146670 Ref: 9712\7f4771314
146671 Ref: 9713\7f4771335
146672 Ref: 9714\7f4771421
146673 Ref: 9715\7f4771458
146674 Ref: 9716\7f4771565
146675 Ref: 9717\7f4771587
146676 Ref: 9718\7f4771677
146677 Ref: 9719\7f4771749
146678 Ref: 9720\7f4771782
146679 Ref: 9721\7f4771886
146680 Ref: 9722\7f4771920
146681 Ref: 9723\7f4772003
146682 Ref: 9724\7f4772074
146683 Ref: 9725\7f4772102
146684 Ref: 9726\7f4772203
146685 Ref: 9727\7f4772215
146686 Ref: 9728\7f4772317
146687 Ref: 9729\7f4772345
146688 Ref: 9730\7f4772416
146689 Ref: 9731\7f4772450
146690 Ref: 9732\7f4772571
146691 Ref: 9733\7f4772583
146692 Ref: 9734\7f4772691
146693 Ref: 9735\7f4772716
146694 Ref: 9736\7f4772728
146695 Ref: 9737\7f4772831
146696 Ref: 9738\7f4772843
146697 Ref: 9739\7f4772920
146698 Ref: 9740\7f4772953
146699 Ref: 9741\7f4773056
146700 Ref: 9742\7f4773084
146701 Ref: 9743\7f4773114
146702 Ref: 9744\7f4773194
146703 Ref: 9745\7f4773289
146704 Ref: 9746\7f4773320
146705 Ref: 9747\7f4773359
146706 Ref: 9748\7f4773445
146707 Ref: 9749\7f4773466
146708 Ref: 9750\7f4773540
146709 Ref: 9751\7f4773577
146710 Ref: 9752\7f4773644
146711 Ref: 9753\7f4773662
146712 Ref: 9754\7f4773733
146713 Ref: 9755\7f4773754
146714 Ref: 9756\7f4773806
146715 Ref: 9757\7f4773834
146716 Ref: 9758\7f4773985
146717 Ref: 9759\7f4774015
146718 Ref: 9760\7f4774108
146719 Ref: 9761\7f4774136
146720 Ref: 9762\7f4774152
146721 Ref: 9763\7f4774169
146722 Ref: 9764\7f4774203
146723 Ref: 9765\7f4774230
146724 Ref: 9766\7f4774252
146725 Ref: 9767\7f4774325
146726 Ref: 9768\7f4774400
146727 Ref: 9769\7f4774428
146728 Ref: 9770\7f4774533
146729 Ref: 9771\7f4774563
146730 Ref: 9772\7f4774582
146731 Ref: 9773\7f4774680
146732 Ref: 9774\7f4774779
146733 Ref: 9775\7f4774890
146734 Ref: 9776\7f4774906
146735 Ref: 9777\7f4774933
146736 Ref: 9778\7f4774949
146737 Ref: 9779\7f4775022
146738 Ref: 9780\7f4775046
146739 Ref: 9781\7f4775119
146740 Ref: 9782\7f4775146
146741 Ref: 9783\7f4775171
146742 Ref: 9784\7f4775211
146743 Ref: 9785\7f4775304
146744 Ref: 9786\7f4775331
146745 Ref: 9787\7f4775351
146746 Ref: 9788\7f4775430
146747 Ref: 9789\7f4775465
146748 Ref: 9790\7f4775531
146749 Ref: 9791\7f4775550
146750 Ref: 9792\7f4775613
146751 Ref: 9793\7f4775642
146752 Ref: 9794\7f4775669
146753 Ref: 9795\7f4775741
146754 Ref: 9796\7f4775832
146755 Ref: 9797\7f4775863
146756 Ref: 9798\7f4775914
146757 Ref: 9799\7f4776062
146758 Ref: 9800\7f4776139
146759 Ref: 9801\7f4776167
146760 Ref: 9802\7f4776250
146761 Ref: 9803\7f4776266
146762 Ref: 9804\7f4776304
146763 Ref: 9805\7f4776320
146764 Ref: 9806\7f4776427
146765 Ref: 9807\7f4776452
146766 Ref: 9808\7f4776639
146767 Ref: 9809\7f4776695
146768 Ref: 9810\7f4776835
146769 Ref: 9811\7f4776869
146770 Ref: 9812\7f4776892
146771 Ref: 9813\7f4776937
146772 Ref: 9814\7f4776965
146773 Ref: 9815\7f4777009
146774 Ref: 9816\7f4777108
146775 Ref: 9817\7f4777129
146776 Ref: 9818\7f4777214
146777 Ref: 9819\7f4777288
146778 Ref: 9820\7f4777313
146779 Ref: 9821\7f4777380
146780 Ref: 9822\7f4777400
146781 Ref: 9823\7f4777416
146782 Ref: 9824\7f4777461
146783 Ref: 9825\7f4777475
146784 Ref: 9826\7f4777536
146785 Ref: 9827\7f4777554
146786 Ref: 9828\7f4777569
146787 Ref: 9829\7f4777581
146788 Ref: 9830\7f4777640
146789 Ref: 9831\7f4777656
146790 Ref: 9832\7f4777687
146791 Ref: 9833\7f4777709
146792 Ref: 9834\7f4777725
146793 Ref: 9835\7f4777748
146794 Ref: 9836\7f4777778
146795 Ref: 9837\7f4777798
146796 Ref: 9838\7f4777822
146797 Ref: 9839\7f4777844
146798 Ref: 9840\7f4777875
146799 Ref: 9841\7f4777901
146800 Ref: 9842\7f4777962
146801 Ref: 9843\7f4777975
146802 Ref: 9844\7f4778026
146803 Ref: 9845\7f4778033
146804 Ref: 9846\7f4778103
146805 Ref: 9847\7f4778161
146806 Ref: 9848\7f4778214
146807 Ref: 9849\7f4778221
146808 Ref: 9850\7f4778235
146809 Ref: 9851\7f4778284
146810 Ref: 9852\7f4778291
146811 Ref: 9853\7f4778356
146812 Ref: 9854\7f4778365
146813 Ref: 9855\7f4778423
146814 Ref: 9856\7f4778436
146815 Ref: 9857\7f4778456
146816 Ref: 9858\7f4778522
146817 Ref: 9859\7f4778529
146818 Ref: 9860\7f4778611
146819 Ref: 9861\7f4778630
146820 Ref: 9862\7f4778738
146821 Ref: 9863\7f4778745
146822 Ref: 9864\7f4778843
146823 Ref: 9865\7f4778925
146824 Ref: 9866\7f4779008
146825 Ref: 9867\7f4779015
146826 Ref: 9868\7f4779081
146827 Ref: 9869\7f4779100
146828 Ref: 9870\7f4779122
146829 Ref: 9871\7f4779192
146830 Ref: 9872\7f4779301
146831 Ref: 9873\7f4779333
146832 Ref: 9874\7f4779454
146833 Ref: 9875\7f4779480
146834 Ref: 9876\7f4779501
146835 Ref: 9877\7f4779602
146836 Ref: 9878\7f4779629
146837 Ref: 9879\7f4779722
146838 Ref: 9880\7f4779741
146839 Ref: 9881\7f4779820
146840 Ref: 9882\7f4779833
146841 Ref: 9883\7f4779900
146842 Ref: 9884\7f4779929
146843 Ref: 9885\7f4780019
146844 Ref: 9886\7f4780031
146845 Ref: 9887\7f4780045
146846 Ref: 9888\7f4780068
146847 Ref: 9889\7f4780082
146848 Ref: 9890\7f4780105
146849 Ref: 9891\7f4780127
146850 Ref: 9892\7f4780141
146851 Ref: 9893\7f4780231
146852 Ref: 9894\7f4780262
146853 Ref: 9895\7f4780360
146854 Ref: 9896\7f4780384
146855 Ref: 9897\7f4780404
146856 Ref: 9898\7f4780481
146857 Ref: 9899\7f4780495
146858 Ref: 9900\7f4780510
146859 Ref: 9901\7f4780529
146860 Ref: 9902\7f4780549
146861 Ref: 9903\7f4780562
146862 Ref: 9904\7f4780577
146863 Ref: 9905\7f4780595
146864 Ref: 9906\7f4780615
146865 Ref: 9907\7f4780629
146866 Ref: 9908\7f4780696
146867 Ref: 9909\7f4780717
146868 Ref: 9910\7f4780744
146869 Ref: 9911\7f4780764
146870 Ref: 9912\7f4780791
146871 Ref: 9913\7f4780812
146872 Ref: 9914\7f4780839
146873 Ref: 9915\7f4780865
146874 Ref: 9916\7f4780892
146875 Ref: 9917\7f4780917
146876 Ref: 9918\7f4780989
146877 Ref: 9919\7f4781008
146878 Ref: 9920\7f4781028
146879 Ref: 9921\7f4781095
146880 Ref: 9922\7f4781114
146881 Ref: 9923\7f4781134
146882 Ref: 9924\7f4781163
146883 Ref: 9925\7f4781190
146884 Ref: 9926\7f4781264
146885 Ref: 9927\7f4781285
146886 Ref: 9928\7f4781350
146887 Ref: 9929\7f4781370
146888 Ref: 9930\7f4781378
146889 Ref: 9931\7f4781438
146890 Ref: 9932\7f4781461
146891 Ref: 9933\7f4781467
146892 Ref: 9934\7f4781496
146893 Ref: 9935\7f4781535
146894 Ref: 9936\7f4781543
146895 Ref: 9937\7f4781564
146896 Ref: 9938\7f4781607
146897 Ref: 9939\7f4781619
146898 Ref: 9940\7f4781634
146899 Ref: 9941\7f4781648
146900 Ref: 9942\7f4781701
146901 Ref: 9943\7f4781726
146902 Ref: 9944\7f4781743
146903 Ref: 9945\7f4781761
146904 Ref: 9946\7f4781768
146905 Ref: 9947\7f4781781
146906 Ref: 9948\7f4781802
146907 Ref: 9949\7f4781829
146908 Ref: 9950\7f4782334
146909 Ref: 9951\7f4782350
146910 Ref: 9952\7f4782422
146911 Ref: 9953\7f4782447
146912 Ref: 9954\7f4782473
146913 Ref: 9955\7f4782498
146914 Ref: 9956\7f4782534
146915 Ref: 9957\7f4782594
146916 Ref: 9958\7f4782676
146917 Ref: 9959\7f4782699
146918 Ref: 9960\7f4782739
146919 Ref: 9961\7f4782841
146920 Ref: 9962\7f4782888
146921 Ref: 9963\7f4782955
146922 Ref: 9964\7f4782966
146923 Ref: 9965\7f4783004
146924 Ref: 9966\7f4783027
146925 Ref: 9967\7f4783038
146926 Ref: 9968\7f4783064
146927 Ref: 9969\7f4783174
146928 Ref: 9970\7f4783239
146929 Ref: 9971\7f4783252
146930 Ref: 9972\7f4783273
146931 Ref: 9973\7f4783286
146932 Ref: 9974\7f4783350
146933 Ref: 9975\7f4783364
146934 Ref: 9976\7f4783378
146935 Ref: 9977\7f4783391
146936 Ref: 9978\7f4783453
146937 Ref: 9979\7f4783476
146938 Ref: 9980\7f4783508
146939 Ref: 9981\7f4783531
146940 Ref: 9982\7f4783618
146941 Ref: 9983\7f4783675
146942 Ref: 9984\7f4783686
146943 Ref: 9985\7f4783698
146944 Ref: 9986\7f4783753
146945 Ref: 9987\7f4783760
146946 Ref: 9988\7f4783780
146947 Ref: 9989\7f4783787
146948 Ref: 9990\7f4783851
146949 Ref: 9991\7f4783876
146950 Ref: 9992\7f4783901
146951 Ref: 9993\7f4783926
146952 Ref: 9994\7f4783945
146953 Ref: 9995\7f4783980
146954 Ref: 9996\7f4784008
146955 Ref: 9997\7f4784039
146956 Ref: 9998\7f4784061
146957 Ref: 9999\7f4784087
146958 Ref: 10000\7f4784107
146959 Ref: 10001\7f4784133
146960 Ref: 10002\7f4784206
146961 Ref: 10003\7f4784223
146962 Ref: 10004\7f4784248
146963 Ref: 10005\7f4784267
146964 Ref: 10006\7f4784293
146965 Ref: 10007\7f4784329
146966 Ref: 10008\7f4784350
146967 Ref: 10009\7f4784458
146968 Ref: 10010\7f4784530
146969 Ref: 10011\7f4784609
146970 Ref: 10012\7f4784617
146971 Ref: 10013\7f4784683
146972 Ref: 10014\7f4784709
146973 Ref: 10015\7f4784747
146974 Ref: 10016\7f4784773
146975 Ref: 10017\7f4784822
146976 Ref: 10018\7f4784930
146977 Ref: 10019\7f4784956
146978 Ref: 10020\7f4784995
146979 Ref: 10021\7f4785110
146980 Ref: 10022\7f4785145
146981 Ref: 10023\7f4785226
146982 Ref: 10024\7f4785261
146983 Ref: 10025\7f4785298
146984 Ref: 10026\7f4785348
146985 Ref: 10027\7f4785412
146986 Ref: 10028\7f4785436
146987 Ref: 10029\7f4785479
146988 Ref: 10030\7f4785568
146989 Ref: 10031\7f4785601
146990 Ref: 10032\7f4785692
146991 Ref: 10033\7f4785734
146992 Ref: 10034\7f4785748
146993 Ref: 10035\7f4785771
146994 Ref: 10036\7f4785819
146995 Ref: 10037\7f4785884
146996 Ref: 10038\7f4785945
146997 Ref: 10039\7f4785999
146998 Ref: 10040\7f4786054
146999 Ref: 10041\7f4786130
147000 Ref: 10042\7f4786142
147001 Ref: 10043\7f4786208
147002 Ref: 10044\7f4786276
147003 Ref: 10045\7f4786307
147004 Ref: 10046\7f4786346
147005 Ref: 10047\7f4786432
147006 Ref: 10048\7f4786465
147007 Ref: 10049\7f4786550
147008 Ref: 10050\7f4786577
147009 Ref: 10051\7f4786661
147010 Ref: 10052\7f4786681
147011 Ref: 10053\7f4786756
147012 Ref: 10054\7f4786776
147013 Ref: 10055\7f4786789
147014 Ref: 10056\7f4786853
147015 Ref: 10057\7f4786882
147016 Ref: 10058\7f4786969
147017 Ref: 10059\7f4786989
147018 Ref: 10060\7f4787059
147019 Ref: 10061\7f4787127
147020 Ref: 10062\7f4787190
147021 Ref: 10063\7f4787271
147022 Ref: 10064\7f4787292
147023 Ref: 10065\7f4787308
147024 Ref: 10066\7f4787331
147025 Ref: 10067\7f4787351
147026 Ref: 10068\7f4787419
147027 Ref: 10069\7f4787446
147028 Ref: 10070\7f4787534
147029 Ref: 10071\7f4787571
147030 Ref: 10072\7f4787577
147031 Ref: 10073\7f4787593
147032 Ref: 10074\7f4787616
147033 Ref: 10075\7f4787645
147034 Ref: 10076\7f4787672
147035 Ref: 10077\7f4787694
147036 Ref: 10078\7f4787828
147037 Ref: 10079\7f4787859
147038 Ref: 10080\7f4787897
147039 Ref: 10081\7f4787934
147040 Ref: 10082\7f4787979
147041 Ref: 10083\7f4788024
147042 Ref: 10084\7f4788110
147043 Ref: 10085\7f4788135
147044 Ref: 10086\7f4788142
147045 Ref: 10087\7f4788226
147046 Ref: 10088\7f4788249
147047 Ref: 10089\7f4788256
147048 Ref: 10090\7f4788339
147049 Ref: 10091\7f4788364
147050 Ref: 10092\7f4788465
147051 Ref: 10093\7f4788483
147052 Ref: 10094\7f4788563
147053 Ref: 10095\7f4788585
147054 Ref: 10096\7f4788650
147055 Ref: 10097\7f4788736
147056 Ref: 10098\7f4788778
147057 Ref: 10099\7f4788814
147058 Ref: 10100\7f4788897
147059 Ref: 10101\7f4788949
147060 Ref: 10102\7f4789056
147061 Ref: 10103\7f4789077
147062 Ref: 10104\7f4789166
147063 Ref: 10105\7f4789196
147064 Ref: 10106\7f4789241
147065 Ref: 10107\7f4789334
147066 Ref: 10108\7f4789364
147067 Ref: 10109\7f4789403
147068 Ref: 10110\7f4789428
147069 Ref: 10111\7f4789499
147070 Ref: 10112\7f4789590
147071 Ref: 10113\7f4789631
147072 Ref: 10114\7f4789668
147073 Ref: 10115\7f4789721
147074 Ref: 10116\7f4789761
147075 Ref: 10117\7f4789779
147076 Ref: 10118\7f4789855
147077 Ref: 10119\7f4789896
147078 Ref: 10120\7f4789933
147079 Ref: 10121\7f4789978
147080 Ref: 10122\7f4790025
147081 Ref: 10123\7f4790043
147082 Ref: 10124\7f4790123
147083 Ref: 10125\7f4790144
147084 Ref: 10126\7f4790222
147085 Ref: 10127\7f4790317
147086 Ref: 10128\7f4790338
147087 Ref: 10129\7f4790419
147088 Ref: 10130\7f4790459
147089 Ref: 10131\7f4790501
147090 Ref: 10132\7f4790631
147091 Ref: 10133\7f4790652
147092 Ref: 10134\7f4790727
147093 Ref: 10135\7f4790743
147094 Ref: 10136\7f4790809
147095 Ref: 10137\7f4790825
147096 Ref: 10138\7f4790901
147097 Ref: 10139\7f4790940
147098 Ref: 10140\7f4790982
147099 Ref: 10141\7f4791022
147100 Ref: 10142\7f4791065
147101 Ref: 10143\7f4791162
147102 Ref: 10144\7f4791185
147103 Ref: 10145\7f4791201
147104 Ref: 10146\7f4791235
147105 Ref: 10147\7f4791254
147106 Ref: 10148\7f4791286
147107 Ref: 10149\7f4791308
147108 Ref: 10150\7f4791341
147109 Ref: 10151\7f4791360
147110 Ref: 10152\7f4791444
147111 Ref: 10153\7f4791500
147112 Ref: 10154\7f4791514
147113 Ref: 10155\7f4791604
147114 Ref: 10156\7f4791653
147115 Ref: 10157\7f4791667
147116 Ref: 10158\7f4791763
147117 Ref: 10159\7f4791794
147118 Ref: 10160\7f4791843
147119 Ref: 10161\7f4791862
147120 Ref: 10162\7f4791972
147121 Ref: 10163\7f4792029
147122 Ref: 10164\7f4792048
147123 Ref: 10165\7f4792100
147124 Ref: 10166\7f4792159
147125 Ref: 10167\7f4792178
147126 Ref: 10168\7f4792229
147127 Ref: 10169\7f4792287
147128 Ref: 10170\7f4792306
147129 Ref: 10171\7f4792398
147130 Ref: 10172\7f4792419
147131 Ref: 10173\7f4792458
147132 Ref: 10174\7f4792499
147133 Ref: 10175\7f4792530
147134 Ref: 10176\7f4792614
147135 Ref: 10177\7f4792649
147136 Ref: 10178\7f4792689
147137 Ref: 10179\7f4792720
147138 Ref: 10180\7f4792794
147139 Ref: 10181\7f4792833
147140 Ref: 10182\7f4792862
147141 Ref: 10183\7f4792912
147142 Ref: 10184\7f4792932
147143 Ref: 10185\7f4793003
147144 Ref: 10186\7f4793037
147145 Ref: 10187\7f4793072
147146 Ref: 10188\7f4793113
147147 Ref: 10189\7f4793162
147148 Ref: 10190\7f4793253
147149 Ref: 10191\7f4793274
147150 Ref: 10192\7f4793313
147151 Ref: 10193\7f4793353
147152 Ref: 10194\7f4793384
147153 Ref: 10195\7f4793481
147154 Ref: 10196\7f4793515
147155 Ref: 10197\7f4793555
147156 Ref: 10198\7f4793586
147157 Ref: 10199\7f4793669
147158 Ref: 10200\7f4793729
147159 Ref: 10201\7f4793785
147160 Ref: 10202\7f4793857
147161 Ref: 10203\7f4793892
147162 Ref: 10204\7f4793922
147163 Ref: 10205\7f4793994
147164 Ref: 10206\7f4794038
147165 Ref: 10207\7f4794126
147166 Ref: 10208\7f4794160
147167 Ref: 10209\7f4794195
147168 Ref: 10210\7f4794244
147169 Ref: 10211\7f4794310
147170 Ref: 10212\7f4794345
147171 Ref: 10213\7f4794373
147172 Ref: 10214\7f4794396
147173 Ref: 10215\7f4794562
147174 Ref: 10216\7f4794598
147175 Ref: 10217\7f4794620
147176 Ref: 10218\7f4794650
147177 Ref: 10219\7f4794686
147178 Ref: 10220\7f4794778
147179 Ref: 10221\7f4794792
147180 Ref: 10222\7f4794806
147181 Ref: 10223\7f4794838
147182 Ref: 10224\7f4794888
147183 Ref: 10225\7f4794944
147184 Ref: 10226\7f4795010
147185 Ref: 10227\7f4795031
147186 Ref: 10228\7f4795055
147187 Ref: 10229\7f4795087
147188 Ref: 10230\7f4795126
147189 Ref: 10231\7f4795175
147190 Ref: 10232\7f4795243
147191 Ref: 10233\7f4795271
147192 Ref: 10234\7f4795344
147193 Ref: 10235\7f4795414
147194 Ref: 10236\7f4795437
147195 Ref: 10237\7f4795528
147196 Ref: 10238\7f4795534
147197 Ref: 10239\7f4795633
147198 Ref: 10240\7f4795696
147199 Ref: 10241\7f4795720
147200 Ref: 10242\7f4795819
147201 Ref: 10243\7f4795896
147202 Ref: 10244\7f4795962
147203 Ref: 10245\7f4795988
147204 Ref: 10246\7f4796014
147205 Ref: 10247\7f4796046
147206 Ref: 10248\7f4796137
147207 Ref: 10249\7f4796154
147208 Ref: 10250\7f4796192
147209 Ref: 10251\7f4796209
147210 Ref: 10252\7f4796250
147211 Ref: 10253\7f4796335
147212 Ref: 10254\7f4796406
147213 Ref: 10255\7f4796434
147214 Ref: 10256\7f4796461
147215 Ref: 10257\7f4796540
147216 Ref: 10258\7f4796558
147217 Ref: 10259\7f4796638
147218 Ref: 10260\7f4796655
147219 Ref: 10261\7f4796812
147220 Ref: 10262\7f4796853
147221 Ref: 10263\7f4796951
147222 Ref: 10264\7f4796976
147223 Ref: 10265\7f4797062
147224 Ref: 10266\7f4797089
147225 Ref: 10267\7f4797186
147226 Ref: 10268\7f4797229
147227 Ref: 10269\7f4797344
147228 Ref: 10270\7f4797393
147229 Ref: 10271\7f4797480
147230 Ref: 10272\7f4797502
147231 Ref: 10273\7f4797583
147232 Ref: 10274\7f4797609
147233 Ref: 10275\7f4797670
147234 Ref: 10276\7f4797748
147235 Ref: 10277\7f4797761
147236 Ref: 10278\7f4797812
147237 Ref: 10279\7f4797888
147238 Ref: 10280\7f4797903
147239 Ref: 10281\7f4797925
147240 Ref: 10282\7f4797940
147241 Ref: 10283\7f4798002
147242 Ref: 10284\7f4798036
147243 Ref: 10285\7f4798073
147244 Ref: 10286\7f4798174
147245 Ref: 10287\7f4798201
147246 Ref: 10288\7f4798231
147247 Ref: 10289\7f4798255
147248 Ref: 10290\7f4798351
147249 Ref: 10291\7f4798388
147250 Ref: 10292\7f4798425
147251 Ref: 10293\7f4798506
147252 Ref: 10294\7f4798524
147253 Ref: 10295\7f4798585
147254 Ref: 10296\7f4798637
147255 Ref: 10297\7f4798695
147256 Ref: 10298\7f4798709
147257 Ref: 10299\7f4798763
147258 Ref: 10300\7f4798785
147259 Ref: 10301\7f4798895
147260 Ref: 10302\7f4798922
147261 Ref: 10303\7f4799011
147262 Ref: 10304\7f4799038
147263 Ref: 10305\7f4799086
147264 Ref: 10306\7f4799109
147265 Ref: 10307\7f4799129
147266 Ref: 10308\7f4799152
147267 Ref: 10309\7f4799234
147268 Ref: 10310\7f4799264
147269 Ref: 10311\7f4799313
147270 Ref: 10312\7f4799407
147271 Ref: 10313\7f4799451
147272 Ref: 10314\7f4799539
147273 Ref: 10315\7f4799583
147274 Ref: 10316\7f4799681
147275 Ref: 10317\7f4799725
147276 Ref: 10318\7f4799797
147277 Ref: 10319\7f4799815
147278 Ref: 10320\7f4799878
147279 Ref: 10321\7f4799924
147280 Ref: 10322\7f4800018
147281 Ref: 10323\7f4800069
147282 Ref: 10324\7f4800097
147283 Ref: 10325\7f4800178
147284 Ref: 10326\7f4800211
147285 Ref: 10327\7f4800231
147286 Ref: 10328\7f4800268
147287 Ref: 10329\7f4800351
147288 Ref: 10330\7f4800427
147289 Ref: 10331\7f4800522
147290 Ref: 10332\7f4800540
147291 Ref: 10333\7f4800602
147292 Ref: 10334\7f4800635
147293 Ref: 10335\7f4800740
147294 Ref: 10336\7f4800761
147295 Ref: 10337\7f4800800
147296 Ref: 10338\7f4800891
147297 Ref: 10339\7f4800912
147298 Ref: 10340\7f4800993
147299 Ref: 10341\7f4801038
147300 Ref: 10342\7f4801128
147301 Ref: 10343\7f4801165
147302 Ref: 10344\7f4801200
147303 Ref: 10345\7f4801241
147304 Ref: 10346\7f4801338
147305 Ref: 10347\7f4801402
147306 Ref: 10348\7f4801408
147307 Ref: 10349\7f4801447
147308 Ref: 10350\7f4801481
147309 Ref: 10351\7f4801523
147310 Ref: 10352\7f4801589
147311 Ref: 10353\7f4801595
147312 Ref: 10354\7f4801634
147313 Ref: 10355\7f4801668
147314 Ref: 10356\7f4801709
147315 Ref: 10357\7f4801767
147316 Ref: 10358\7f4801773
147317 Ref: 10359\7f4801812
147318 Ref: 10360\7f4801894
147319 Ref: 10361\7f4801917
147320 Ref: 10362\7f4802023
147321 Ref: 10363\7f4802041
147322 Ref: 10364\7f4802144
147323 Ref: 10365\7f4802166
147324 Ref: 10366\7f4802192
147325 Ref: 10367\7f4802205
147326 Ref: 10368\7f4802212
147327 Ref: 10369\7f4802252
147328 Ref: 10370\7f4802322
147329 Ref: 10371\7f4802349
147330 Ref: 10372\7f4802355
147331 Ref: 10373\7f4802371
147332 Ref: 10374\7f4802394
147333 Ref: 10375\7f4802428
147334 Ref: 10376\7f4802461
147335 Ref: 10377\7f4802488
147336 Ref: 10378\7f4802493
147337 Ref: 10379\7f4802515
147338 Ref: 10380\7f4802555
147339 Ref: 10381\7f4802643
147340 Ref: 10382\7f4802687
147341 Ref: 10383\7f4802799
147342 Ref: 10384\7f4802819
147343 Ref: 10385\7f4802841
147344 Ref: 10386\7f4802884
147345 Ref: 10387\7f4802986
147346 Ref: 10388\7f4803006
147347 Ref: 10389\7f4803102
147348 Ref: 10390\7f4803144
147349 Ref: 10391\7f4803186
147350 Ref: 10392\7f4803229
147351 Ref: 10393\7f4803278
147352 Ref: 10394\7f4803320
147353 Ref: 10395\7f4803364
147354 Ref: 10396\7f4803414
147355 Ref: 10397\7f4803463
147356 Ref: 10398\7f4803503
147357 Ref: 10399\7f4803544
147358 Ref: 10400\7f4803790
147359 Ref: 10401\7f4803809
147360 Ref: 10402\7f4804360
147361 Ref: 10403\7f4804443
147362 Ref: 10404\7f4804530
147363 Ref: 10405\7f4804615
147364 Ref: 10406\7f4804671
147365 Ref: 10407\7f4804794
147366 Ref: 10408\7f4804823
147367 Ref: 10409\7f4804857
147368 Ref: 10410\7f4804964
147369 Ref: 10411\7f4805002
147370 Ref: 10412\7f4805036
147371 Ref: 10413\7f4805107
147372 Ref: 10414\7f4805174
147373 Ref: 10415\7f4805258
147374 Ref: 10416\7f4805301
147375 Ref: 10417\7f4805307
147376 Ref: 10418\7f4805354
147377 Ref: 10419\7f4805470
147378 Ref: 10420\7f4805501
147379 Ref: 10421\7f4805531
147380 Ref: 10422\7f4805649
147381 Ref: 10423\7f4805703
147382 Ref: 10424\7f4805766
147383 Ref: 10425\7f4805807
147384 Ref: 10426\7f4805854
147385 Ref: 10427\7f4805896
147386 Ref: 10428\7f4805946
147387 Ref: 10429\7f4805971
147388 Ref: 10430\7f4805983
147389 Ref: 10431\7f4806030
147390 Ref: 10432\7f4806101
147391 Ref: 10433\7f4806117
147392 Ref: 10434\7f4806155
147393 Ref: 10435\7f4806171
147394 Ref: 10436\7f4806242
147395 Ref: 10437\7f4806310
147396 Ref: 10438\7f4806317
147397 Ref: 10439\7f4806330
147398 Ref: 10440\7f4806414
147399 Ref: 10441\7f4806425
147400 Ref: 10442\7f4806450
147401 Ref: 10443\7f4806477
147402 Ref: 10444\7f4806488
147403 Ref: 10445\7f4806513
147404 Ref: 10446\7f4806610
147405 Ref: 10447\7f4806625
147406 Ref: 10448\7f4806699
147407 Ref: 10449\7f4806803
147408 Ref: 10450\7f4806837
147409 Ref: 10451\7f4806863
147410 Ref: 10452\7f4806972
147411 Ref: 10453\7f4806986
147412 Ref: 10454\7f4807001
147413 Ref: 10455\7f4807014
147414 Ref: 10456\7f4807071
147415 Ref: 10457\7f4807130
147416 Ref: 10458\7f4807195
147417 Ref: 10459\7f4807257
147418 Ref: 10460\7f4807347
147419 Ref: 10461\7f4807413
147420 Ref: 10462\7f4807457
147421 Ref: 10463\7f4807471
147422 Ref: 10464\7f4807569
147423 Ref: 10465\7f4807576
147424 Ref: 10466\7f4807645
147425 Ref: 10467\7f4807657
147426 Ref: 10468\7f4807717
147427 Ref: 10469\7f4807736
147428 Ref: 10470\7f4807801
147429 Ref: 10471\7f4807838
147430 Ref: 10472\7f4807838
147431 Ref: 10473\7f4807838
147432 Ref: 10474\7f4807838
147433 Ref: 10475\7f4807838
147434 Node: Annex Q\7f4853110
147435 Node: Q.1\7f4853706
147436 Ref: 10476\7f4853937
147437 Node: Q.2\7f4865286
147438 Ref: 10477\7f4865559
147439 Ref: 10478\7f4865559
147440 Node: Q.3\7f4881397
147441 Ref: 10479\7f4881649
147442 Node: Q.4\7f4948507
147443 Ref: 10480\7f4948756
147444 Node: Q.5\7f4952409
147445 Ref: 10481\7f4952691
147446 Ref: 10482\7f4952691
147447 Ref: 10483\7f4952691
147448 Node: Index\7f4976590
147449 Node: operators\7f4976885
147450 Node: A\7f4978334
147451 Node: B\7f5016672
147452 Node: C\7f5024631
147453 Node: D\7f5059752
147454 Node: E\7f5081170
147455 Node: F\7f5122858
147456 Node: G\7f5136219
147457 Node: H\7f5143952
147458 Node: I\7f5148220
147459 Node: J\7f5179755
147460 Node: K\7f5179946
147461 Node: L\7f5180725
147462 Node: M\7f5196235
147463 Node: N\7f5205752
147464 Node: O\7f5220146
147465 Node: P\7f5227509
147466 Node: Q\7f5254501
147467 Node: R\7f5256304
147468 Node: S\7f5278070
147469 Node: T\7f5307831
147470 Node: U\7f5326014
147471 Node: V\7f5337217
147472 Node: W\7f5341300
147473 Node: X\7f5347563
147474 Node: Y\7f5347698
147475 \1f
147476 End Tag Table