Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
 
Annotated Ada Reference Manual (Ada 202x Draft 22)Legal Information
Contents   Index   References   Search   Previous   Next 

Annex A

(normative)

Predefined Language Environment

1
[ This Annex contains the specifications of library units that shall be provided by every implementation. There are three root library units: Ada, Interfaces, and System; other library units are children of these:]
2/5
{8652/0047} {AI95-00081-01} {AI95-00424-01} {AI05-0001-1} {AI05-0049-1} {AI05-0069-1} {AI05-0111-3} {AI05-0136-1} {AI05-0137-1} {AI05-0166-1} {AI05-0168-1} {AI12-0021-1} {AI12-0208-1} {AI12-0234-1} {AI12-0254-1} {AI12-0293-1} {AI12-0321-1}  
 
[Standard — A.1
  Ada — A.2
    Assertions — 11.4.2
    Asynchronous_Task_Control — D.11
    Calendar — 9.6
      Arithmetic — 9.6.1
      Formatting — 9.6.1
      Time_Zones — 9.6.1
    Characters — A.3.1
      Conversions — A.3.4
      Handling — A.3.2
      Latin_1 — A.3.3
    Command_Line — A.15
    Complex_Text_IO — G.1.3
    Containers — A.18.1
      Bounded_Doubly_Linked_Lists
            — A.18.20
      Bounded_Hashed_Maps — A.18.21
      Bounded_Hashed_Sets — A.18.23
      Bounded_Indefinite_Holders — A.18.32
      Bounded_Multiway_Trees — A.18.25
      Bounded_Ordered_Maps — A.18.22
      Bounded_Ordered_Sets — A.18.24
      Bounded_Priority_Queues — A.18.31
      Bounded_Synchronized_Queues
             — A.18.29
      Bounded_Vectors — A.18.19
      Doubly_Linked_Lists — A.18.3
      Generic_Array_Sort — A.18.26
      Generic_Constrained_Array_Sort
            — A.18.26
      Generic_Sort — A.18.26
      Hashed_Maps — A.18.5
      Hashed_Sets — A.18.8
      Indefinite_Doubly_Linked_Lists
            — A.18.12
      Indefinite_Hashed_Maps — A.18.13
      Indefinite_Hashed_Sets — A.18.15
      Indefinite_Holders — A.18.18
      Indefinite_Multiway_Trees — A.18.17
      Indefinite_Ordered_Maps — A.18.14
      Indefinite_Ordered_Sets — A.18.16
Standard (...continued)
  Ada (...continued)
    Containers (...continued)
      Indefinite_Vectors — A.18.11Standard (...continued)
  Ada (...continued)
    Containers (...continued)

      Multiway_Trees — A.18.10
      Ordered_Maps — A.18.6
      Ordered_Sets — A.18.9
      Synchronized_Queue_Interfaces
            — A.18.27
      Unbounded_Priority_Queues
            — A.18.30
      Unbounded_Synchronized_Queues
            — A.18.28
      Vectors — A.18.2
    Decimal — F.2
    Direct_IO — A.8.4
    Directories — A.16
      Hierarchical_File_Names — A.16.1
      Information — A.16
    Dispatching — D.2.1
      EDF — D.2.6
      Non_Preemptive — D.2.4
      Round_Robin — D.2.5
    Dynamic_Priorities — D.5.1
    Environment_Variables — A.17
    Exceptions — 11.4.1
    Execution_Time — D.14
      Group_Budgets — D.14.2
      Interrupts — D.14.3
      Timers — D.14.1
    Finalization — 7.6
    Float_Text_IO — A.10.9
    Float_Wide_Text_IO — A.11
    Float_Wide_Wide_Text_IO — A.11
    Integer_Text_IO — A.10.8
    Integer_Wide_Text_IO — A.11
    Integer_Wide_Wide_Text_IO — A.11
    Interrupts — C.3.2
      Names — C.3.2
    IO_Exceptions — A.13
    Iterator_Interfaces — 5.5.1
    Locales — A.19
Standard (...continued)
  Ada (...continued)
    Numerics — A.5
      Big_Numbers — A.5.5
        Big_Integers — A.5.6
        Big_Reals — A.5.7
      Complex_Arrays — G.3.2
      Complex_Elementary_Functions — G.1.2
      Complex_Types — G.1.1
      Discrete_Random — A.5.2
      Elementary_Functions — A.5.1
      Float_Random — A.5.2
      Generic_Complex_Arrays — G.3.2
      Generic_Complex_Elementary_Functions
            — G.1.2
      Generic_Complex_Types — G.1.1
      Generic_Elementary_Functions — A.5.1
      Generic_Real_Arrays — G.3.1
      Real_Arrays — G.3.1
    Real_Time — D.8
      Timing_Events — D.15
    Sequential_IO — A.8.1
    Storage_IO — A.9
    Streams — 13.13.1
      Storage_Streams — 13.13.1
        Bounded_FIFO_Streams — 13.13.1
        FIFO_Streams — 13.13.1
      Stream_IO — A.12.1
    Strings — A.4.1
      Bounded — A.4.4
        Equal_Case_Insensitive — A.4.10
        Hash — A.4.9
        Hash_Case_Insensitive — A.4.9
        Less_Case_Insensitive — A.4.10
      Equal_Case_Insensitive — A.4.10
      Fixed — A.4.3
        Equal_Case_Insensitive — A.4.10
        Hash — A.4.9
        Hash_Case_Insensitive — A.4.9
        Less_Case_Insensitive — A.4.10
      Hash — A.4.9
      Hash_Case_Insensitive — A.4.9
      Less_Case_Insensitive — A.4.10
      Maps — A.4.2
        Constants — A.4.6
      Unbounded — A.4.5
        Equal_Case_Insensitive — A.4.10
        Hash — A.4.9
        Hash_Case_Insensitive — A.4.9
        Less_Case_Insensitive — A.4.10
Standard (...continued)
  Ada (...continued)
    Strings (...continued)
      UTF_Encoding — A.4.11
        Conversions — A.4.11
        Strings — A.4.11
        Wide_Strings — A.4.11
        Wide_Wide_Strings — A.4.11
Standard (...continued)
  Ada (...continued)
    Strings (...continued)
      Wide_Bounded — A.4.7
        Wide_Equal_Case_Insensitive
              — A.4.7
        Wide_Hash — A.4.7
        Wide_Hash_Case_Insensitive — A.4.7
      Wide_Equal_Case_Insensitive — A.4.7
      Wide_Fixed — A.4.7
        Wide_Equal_Case_Insensitive
              — A.4.7
        Wide_Hash — A.4.7
        Wide_Hash_Case_Insensitive — A.4.7
      Wide_Hash — A.4.7
      Wide_Hash_Case_Insensitive — A.4.7
      Wide_Maps — A.4.7
        Wide_Constants — A.4.7
      Wide_Unbounded — A.4.7
        Wide_Equal_Case_Insensitive
              — A.4.7
        Wide_Hash — A.4.7
        Wide_Hash_Case_Insensitive — A.4.7
      Wide_Wide_Bounded — A.4.8
        Wide_Wide_Equal_Case_Insensitive
              — A.4.8
        Wide_Wide_Hash — A.4.8
        Wide_Wide_Hash_Case_Insensitive
              — A.4.8
      Wide_Wide_Equal_Case_Insensitive
            — A.4.8
      Wide_Wide_Fixed — A.4.8
        Wide_Wide_Equal_Case_Insensitive
              — A.4.8
        Wide_Wide_Hash — A.4.8
        Wide_Wide_Hash_Case_Insensitive
              — A.4.8
      Wide_Wide_Hash — A.4.8
      Wide_Wide_Hash_Case_Insensitive
              — A.4.8
      Wide_Wide_Maps — A.4.8
        Wide_Wide_Constants — A.4.8
      Wide_Wide_Unbounded — A.4.8
        Wide_Wide_Equal_Case_Insensitive
              — A.4.8
        Wide_Wide_Hash — A.4.8
        Wide_Wide_Hash_Case_Insensitive
              — A.4.8
Standard (...continued)
  Ada (...continued)
    Synchronous_Barriers — D.10.1
    Synchronous_Task_Control — D.10
      EDF — D.10
Standard (...continued)
  Ada (...continued)
    Tags — 3.9
      Generic_Dispatching_Constructor — 3.9
    Task_Attributes — C.7.2
    Task_Identification — C.7.1
    Task_Termination — C.7.3

    Text_IO — A.10.1
      Bounded_IO — A.10.11
      Complex_IO — G.1.3
      Editing — F.3.3
      Text_Streams — A.12.2
      Unbounded_IO — A.10.12
    Unchecked_Conversion — 13.9
    Unchecked_Deallocate_Subpool — 13.11.5
    Unchecked_Deallocation — 13.11.2
    Wide_Characters — A.3.1
      Handling — A.3.5
    Wide_Command_Line — A.15.1
    Wide_Directories — A.16.2
    Wide_Environment_Variables — A.17.1
    Wide_Text_IO — A.11
      Complex_IO — G.1.4
      Editing — F.3.4
      Text_Streams — A.12.3
      Wide_Bounded_IO — A.11
      Wide_Unbounded_IO — A.11
Standard (...continued)
  Ada (...continued)
    Wide_Wide_Characters — A.3.1
      Handling — A.3.6
    Wide_Wide_Command_Line — A.15.1
    Wide_Wide_Directories — A.16.2
    Wide_Wide_Environment_Variables —
            A.17.1
    Wide_Wide_Text_IO — A.11
      Complex_IO — G.1.5
      Editing — F.3.5
      Text_Streams — A.12.4
      Wide_Wide_Bounded_IO — A.11
      Wide_Wide_Unbounded_IO — A.11
  Interfaces — B.2
    C — B.3
      Pointers — B.3.2
      Strings — B.3.1
    COBOL — B.4
    Fortran — B.5
  System — 13.7
    Address_To_Access_Conversions — 13.7.2
    Atomic_Operations — C.6.1
      Arithmetic — C.6.4
      Exchange — C.6.2
      Test_And_Set — C.6.3
    Machine_Code — 13.8
    Multiprocessors — D.16
      Dispatching_Domains — D.16.1
    RPC — E.5
    Storage_Elements — 13.7.1
    Storage_Pools — 13.11
      Subpools — 13.11.4
]
2.a
Discussion: In running text, we generally leave out the “Ada.” when referring to a child of Ada. 
2.b
Reason: We had no strict rule for which of Ada, Interfaces, or System should be the parent of a given library unit. However, we have tried to place as many things as possible under Ada, except that interfacing is a separate category, and we have tried to place library units whose use is highly nonportable under System.

Implementation Requirements

3/5
{AI95-00434-01} {AI12-0052-1} {AI12-0114-1} {AI12-0200-1} The implementation shall ensure that each language-defined subprogram is reentrant in the sense that concurrent calls on any two (possibly the same) language-defined the same subprograms subprogram perform as specified, so long as all pairs of objects (one from each call) that are either denoted by parameters that could be passed by reference, or are designated by parameters of an access type, are denote nonoverlapping objects
3.a.1/4
Ramification: {AI12-0052-1} {AI12-0114-1} So long as the parameters are disjoint, concurrent calls on the same language-defined subprogram, and concurrent calls on two different language-defined subprograms are required to work. But concurrent calls operating on overlapping objects (be they of the same or different language-defined subprograms) are not required to work (being an erroneous use of shared variables) unless both subprograms are required to pass the associated parameter by-copy.
3.a
For example, simultaneous calls to Text_IO.Put will work properly, so long as they are going to two different files. On the other hand, simultaneous output to the same file constitutes erroneous use of shared variables. 
3.b
To be honest: Here, “language defined subprogram” means a language defined library subprogram, a subprogram declared in the visible part of a language defined library package, an instance of a language defined generic library subprogram, or a subprogram declared in the visible part of an instance of a language defined generic library package. 
3.b.1/4
Ramification: {AI12-0052-1} This rule applies to all language-defined subprograms, including those defined in packages that manage some global state (like environment variables or the current directory). Unless specified above, such subprograms need to work when the explicit parameters are not overlapping; in particular, the existence of the global state is not considered.
3.c/4
{AI12-0052-1} The rule implies that any data local to the private part or body of the package (including global state as described above) has to be somehow protected against simultaneous access. 
3.1/4
 {AI12-0052-1} {AI12-0159-1} For the purpose of determining whether concurrent calls on text input-output subprograms are required to perform as specified above, when calling a subprogram within Text_IO or its children that implicitly operates on one of the default input-output files, the subprogram is considered to have a parameter of Current_Input or Current_Output (as appropriate).
3.2/3
 {AI05-0048-1} If a descendant of a language-defined tagged type is declared, the implementation shall ensure that each inherited language-defined subprogram behaves as described in this International Standard. In particular, overriding a language-defined subprogram shall not alter the effect of any inherited language-defined subprogram. 
3.d/3
Reason: This means that internally the implementation must not do redispatching unless it is required by the Standard. So when we say that some subprogram Bar is equivalent to Foo, overriding Foo for a derived type doesn't change the semantics of Bar, and in particular it means that Bar may no longer be equivalent to Foo. The word “equivalent” is always a bit of a lie anyway. 

Implementation Permissions

4
The implementation may restrict the replacement of language-defined compilation units. The implementation may restrict children of language-defined library units (other than Standard). 
4.a
Ramification: For example, the implementation may say, “you cannot compile a library unit called System” or “you cannot compile a child of package System” or “if you compile a library unit called System, it has to be a package, and it has to contain at least the following declarations: ...”. 
5/5
{AI12-0112-1} The implementation may add specifications of synchronized entities of implementation-defined packages to the global specification (see 6.1.2) for any language-defined entity that is not declared pure or has a global specification of null.
5.a/5
Reason: Ada runtime libraries often use implementation-defined helper packages to implement the language-defined units. For instance, it is common to use a common low-level package to implement I/O; if that package includes support for Current Input and Current Output, then it is likely to have state that needs to be reflected in the packages that use it such as Ada.Text_IO.
5.b/5
We want to allow such packages, so we have defined this permission to allow them to include state if necessary. We require that any such state is synchronized to ensure that appropriate use (as defined above) is allowed in parallel operations.
5.c/5
We exclude units that are declared pure from this permission since this is a declaration that the unit doesn't have any global state, so specifying otherwise would defeat the purpose. Similarly, entities that explicitly specify Global as null are supposed to have no side-effects, and we don't want implementations to add any. 
5.d/5
Ramification: Implementations are of course allowed to make other changes to the specifications of language-defined units, so long as those changes are semantically neutral (that is, no program could change legality or effect because of the changes). In particular, an implementation would need to add implementation-defined units to the context clause in order to use the previous permission; this is allowed and does not need a separate permission.
5.e/5
Similarly, an implementation can add postconditions to language-defined subprograms, so long as those postconditions always evaluate to True. This is useful if the implementation can use those postconditions for optimization. 

Wording Changes from Ada 83

5.f
Many of Ada 83's language-defined library units are now children of Ada or System. For upward compatibility, these are renamed as root library units (see J.1).
5.g
The order and lettering of the annexes has been changed. 

Wording Changes from Ada 95

5.h/2
{8652/0047} {AI95-00081-01} Corrigendum: Units missing from the list of predefined units were added.
5.i/2
{AI95-00424-01} Added new units to the list of predefined units. 

Wording Changes from Ada 2005

5.j/3
{AI05-0048-1} Correction: Added wording to ban redispatching unless it is explicitly required, in order to safeguard portability when overriding language-defined routines.
5.k/3
{AI05-0060-1} {AI05-0206-1} Correction: Added a permission to omit pragma Remote_Types from language-defined units if Annex E is not supported. This was later removed, as a better method of supporting the reason is now available. Note that this requires all implementations to provide minimal support for the Remote_Types categorization even if Annex E is not supported; being unable to compile language-defined units is not allowed.
5.l/3
{AI05-0001-1} {AI05-0049-1} {AI05-0069-1} {AI05-0111-3} {AI05-0136-1} {AI05-0137-1} {AI05-0166-1} {AI05-0168-1} Added various new units to the list of predefined units. 

Wording Changes from Ada 2012

5.l.1/4
{AI12-0052-1} {AI12-0114-1} {AI12-0159-1} Corrigendum: The rules requiring concurrent access of language-defined subprograms were expanded to include implicit Text_IO objects, overlapping objects designated by parameters of an access type, and simultaneous calls on different language-defined subprograms. While this might change behavior of some programs, it would do so by eliminating erroneous execution, so we don't consider this an inconsistency.
5.l.2/5
{AI12-0112-1} Added an Implementation Permissions to allow implementation-defined units to appear in most language-defined global specifications.
5.l.3/5
{AI12-0200-1} Correction: The rules requiring concurrent access of language-defined subprograms were clarified further.

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe