AI22-0073-1
!standard 1.1.4(14.2/5) 23-08-25 AI22-0073-1/03
!standard 1.2(8/5)
!standard 2.1(5/5)
!standard 2.1(17/3)
!standard 2.3(5/5)
!standard A.3.5(55/5)
!standard A.3.5(59/5)
!standard A.4.10(3/5)
!class binding interpretation 23-06-02
!status Amendment 1-2022 23-06-27
!status WG9 Approved 23-10-12
!status ARG Approved 8-0-0 23-06-12
!status work item 23-06-02
!status received 23-06-01
!submitter Robin Leroy (Unicode Liaison to SC 22)
!priority Low
!difficulty Easy
!qualifier Clarification
!subject Referencing the Unicode Standard
Replace the normative reference hidden under “documents referenced” by an actual reference to Unicode, and correct the referenced terms.
Ada has a normative reference to the Unicode Standard, but does not name it nor list it in Subclause 1.2. Since other Working Groups under SC 22 are happy with normatively referencing the Unicode Standard, this is unnecessarily abstruse for implementers, and it makes it difficult to draft changes to align with Unicode recommendations.
In addition, the references to terms defined in the Unicode Standard are sometimes outdated or otherwise incorrect.
(See Summary.)
Modify 1.1.4(14.2/5):
When this document mentions the conversion of some character or sequence of characters to upper case, it means the character or sequence of characters obtained by using simple upper case mapping, as defined by{ the Unicode Character Database}[ documents referenced in Clause 2 of ISO/IEC 10646:2020].
Modify AARM 1.1.4(14.f):
Implementation Note: [The “documents referenced” means Unicode, Chapter 4 (specifically, section 4.2 — Case). ]Machine-readable versions of Simple Uppercase Mapping and Simple Lowercase Mapping can be found in http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt. Data for older Unicode versions can be found on this site as well; start at http://www.unicode.org/Public/ and find the appropriate version number. Simple Uppercase Mapping is the 12th field in this file (the 13th element of each line, since Unicode counts from 0); the Simple Lowercase Mapping is the 13th field in this file. In both cases, if no character is present in the field, the character maps to itself.
Add after 1.2(8/5):
The Unicode Consortium. The Unicode Standard, Version 15.0.0, (Mountain View, CA: The Unicode Consortium, 2022. ISBN 978-1-936213-32-0) Available at: https://www.unicode.org/versions/Unicode15.0.0/
Unicode Standard Annex #44, "Unicode Character Database", edited by Ken Whistler, an integral part of The Unicode Standard. Available at: https://www.unicode.org/reports/tr44/
AARM Discussion: The directives say that we can reference a standard that does not come from ISO or IEC if no ISO or IEC standard “is appropriate”. Various properties that we use are only found in the Unicode standard; they are not included in any version of ISO/IEC 10646 as of this writing. For instance, ISO/IEC 10646:2020 does not include complete case mappings, so we need to get the case mappings from the Unicode Standard.
[ Liaison representative’s note: reference wording after https://www.unicode.org/versions/index.html#References. The reference is versioned for the Unicode Standard so that we can use stable reference specific section and table numbers, and versionless for the Unicode Character Database because of the implementation permission 2.1(17). Versionless references (called “undated references”) are allowed by the ISO/IEC Directives, Ninth edition, Part 2, Subclause 10.4. ]
Modify 2.1(5/5):
The description of the language definition in this document uses the character properties General Category, Simple Uppercase Mapping, [Uppercase Mapping, ]and {Simple Case Folding}[Special Case Condition] of the {Unicode Character Database}[documents referenced by Clause 2 of ISO/IEC 10646:2020]. {The values of the General Category are referenced by their description in Table 4-4 of the Unicode Standard. }The actual set of graphic symbols used by an implementation for the visual representation of the text of an Ada program is not specified.
Modify AARM 2.1(5.a/5):
Discussion: [The “documents referenced” means Unicode, Chapter 4. ]See the Discussion after the [the ]character categorization definition for a source for machine-readable definitions of these properties.
Delete AARM 2.1(14.k/5):
The actual text of the standard only makes specific references to the corresponding clauses of ISO/IEC 10646, not to Unicode.
Modify 2.1(17/3):
The categories defined above, as well as case mapping and folding, may be based on an implementation-defined version of {the Unicode Character Database (4.0 or later)}[ISO/IEC 10646 (2003 edition or later)].
[ Liaison representative’s notes: ]
[ 1. The canonical property names have underscores, but UAX44-LM3 in Unicode Standard Annex #44 allows for spaces, so there is no need to change that. ]
[ 2. The property Uppercase_Mapping is not referenced in the RM, only Simple_Uppercase_Mapping is. ]
[ 3. Special Case Condition is not actually a property, although it erroneously had a property alias until Unicode 5.0 (see Section 5.6 of UAX #44). It is not referenced in the RM, as it is only used in full case mapping. ]
[ 4. The General_Category values have aliases such as Uppercase_Letter or Lu; the phrase “Letter, Uppercase” only appears in Table 4-4 within the Unicode Standard. Referencing the table gives the reader a way to get to the values actually used in the machine-readable data files, while being minimally disruptive to the text in 2.1(7-13). ]
Modify 2.3(5/5):
Two identifiers are considered the same if they consist of the same sequence of characters after applying [locale-independent ]simple case folding, as defined by {Section 3.13 of Unicode Version 15.0}[documents referenced in the note in Clause 2 of ISO/IEC 10646:2020].
Modify AARM 2.3(5.a.1/5):
[The “documents referenced” means Unicode, Chapter 4 (specifically, section 4.2 — Case). ]Note that simple case folding{ of strings in Normalization Form KC} is supposed to be compatible between Unicode versions, so the Unicode version used doesn't matter. A machine-readable version of the needed mapping can be found at: http://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt.
[ Liaison representative’s note: As of this writing, only full case folding is covered by a stability policy, but I have been given an action item to propose a stability policy for simple case folding, see https://www.unicode.org/cgi-bin/GetL2Ref.pl?174-A11. ]
Modify A.3.5(55/5):
Returns the Simple Lowercase Mapping as defined by{ the Unicode Character Database}[ documents referenced in Clause 2 of ISO/IEC 10646:2020] of the Wide_Character designated by Item.[ If the Simple Lowercase Mapping does not exist for the Wide_Character designated by Item, then the value of Item is returned.]
Modify AARM A.3.5(55.a/5):
Discussion: [The “documents referenced” means Unicode, Chapter 4 (specifically, section 4.2 — Case). ]The case mappings come from Unicode as ISO/IEC 10646:2020 does not include complete case mappings. See the Implementation Notes in subclause 1.1.4 for machine-readable versions of both Uppercase and Lowercase mappings.
Modify A.3.5(59/5):
Returns the Simple Uppercase Mapping as defined by{ the Unicode Character Database}[ documents referenced in Clause 2 of ISO/IEC 10646:2020] of the Wide_Character designated by Item.[ If the Simple Uppercase Mapping does not exist for the Wide_Character designated by Item, then the value of Item is returned.]
Modify A.4.10(3/5):
Returns True if the strings consist of the same sequence of characters after applying [locale-independent ]simple case folding, as defined by {Section 3.13 of Unicode Version 15.0}[documents referenced in Clause 2 of ISO/IEC 10646:2020]. Otherwise, returns False. This function uses the same method as is used to determine whether two identifiers are the same.
Modify AARM A.4.10(3.a/3):
Discussion: For String, this is equivalent to converting to lower case and comparing. Not so for other string types. For Wide_Strings and Wide_Wide_Strings, note that this result is a more accurate comparison than converting the strings to lower case and comparing the results; it is possible that the lower case conversions are the same but this routine will report the strings as different{, and vice versa}. Additionally, Unicode says that the result of this function will never change for strings{ in Normalization Form KC} made up solely of defined code points; there is no such guarantee for case conversion to lower case.
[ Liaison representative’s note: Again Unicode doesn’t actually say that yet, but see https://www.unicode.org/cgi-bin/GetL2Ref.pl?174-A11. ]
Modify AARM A.4.10(3.b/5):
[The “documents referenced” means Unicode, Chapter 4 (specifically, section 4.2 — Case). ]See the Implementation Notes in 2.3 for a source for machine-readable definitions of these properties.
In Ada 2005, it was found necessary to sneak in the Unicode reference as “documents referenced” to address concerns about referencing non-ISO standards.
The situation has evolved in the past two decades. ISO/IEC 10646 itself now has a normative reference to the Unicode Standard (which is why this went from “documents referenced in the note” to “documents referenced in Clause 2”). Closer to Ada, both C23 (ISO/IEC CD 9899.2) and C++23 (ISO/IEC CD 14882) have normative references to the Unicode Standard, with no objections from National Bodies; further, the Consortium that published the documents referenced in the note in Section 1 of ISO/IEC 10646:2003 now has a category A liaison relationship with ISO/IEC JTC 1/SC 22.
In terms of the ISO/IEC Directives, normative references to non-ISO or IEC documents are allowed “in the absence of appropriate ISO or IEC documents”, (see ISO/IEC Directives, Ninth edition, Part 2, Subclause 10.2). This absence and the inappropriateness of 10646 alone are discussed in AARM A.3.5(55.a/5).
Some of the references to Unicode spelled out in the AARM lead the reader to strange places; for instance, to Section 4.2, Case, which explains the general handling of case in Unicode, but does not define any of the case mappings and foldings (those are defined in Section 3.13, Default Case Algorithms, for the “full” default versions, but the “simple” tailorings are also mentioned there).
@drepl
When this document mentions the conversion of some character or sequence of characters to upper case, it means the character or sequence of characters obtained by using simple upper case mapping, as defined by documents referenced in Clause 2 of ISO/IEC 10646:2020.
@dby
When this document mentions the conversion of some character or sequence of characters to upper case, it means the character or sequence of characters obtained by using simple upper case mapping, as defined by the Unicode Character Database.
@dinsa
ISO/IEC 10646:2020, @i{Information technology @emdash Universal coded character set (UCS)}
@dinss
The Unicode Consortium. The Unicode Standard, Version 15.0.0, (Mountain View, CA: The Unicode Consortium, 2022. ISBN 978-1-936213-32-0) Available at: https://www.unicode.org/versions/Unicode15.0.0/
Unicode Standard Annex #44, "Unicode Character Database", edited by Ken Whistler, an integral part of The Unicode Standard. Available at: https://www.unicode.org/reports/tr44/
@drepl
The description of the language definition in this document uses the character properties General Category, Simple Uppercase Mapping, Uppercase Mapping, and Special Case Condition of the documents referenced by Clause 2 of ISO/IEC 10646:2020. The actual set of graphic symbols used by an implementation for the visual representation of the text of an Ada program is not specified.
@dby
The description of the language definition in this document uses the character properties General Category, Simple Uppercase Mapping, and Simple Case Folding of the Unicode Character Database. The values of the General Category are referenced by their description in Table 4-4 of the Unicode Standard. The actual set of graphic symbols used by an implementation for the visual representation of the text of an Ada program is not specified.
@drepl
The categories defined above, as well as case mapping and folding, may be based on an implementation-defined version of ISO/IEC 10646 (2003 edition or later).
@dby
The categories defined above, as well as case mapping and folding, may be based on an implementation-defined version of the Unicode Character Database (4.0 or later).
@drepl
Two @fa{identifier}s are considered the same if they consist of the same sequence of characters after applying locale-independent simple case folding, as defined by documents referenced in the note in Clause 2 of ISO/IEC 10646:2020.
@dby
Two @fa{identifier}s are considered the same if they consist of the same sequence of characters after applying simple case folding, as defined by Section 3.13 of Unicode Version 15.0.
@drepl
Returns the Simple Lowercase Mapping as defined by documents referenced in Clause 2 of ISO/IEC 10646:2020 of the Wide_Character designated by Item. If the Simple Lowercase Mapping does not exist for the Wide_Character designated by Item, then the value of Item is returned.
@dby
Returns the Simple Lowercase Mapping as defined by the Unicode Character Database of the Wide_Character designated by Item.
@drepl
Returns the Simple Uppercase Mapping as defined by documents referenced in Clause 2 of ISO/IEC 10646:2020 of the Wide_Character designated by Item. If the Simple Uppercase Mapping does not exist for the Wide_Character designated by Item, then the value of Item is returned.
@dby
Returns the Simple Uppercase Mapping as defined by the Unicode Character Database of the Wide_Character designated by Item.
@drepl
Returns True if the strings consist of the same sequence of characters after applying locale-independent simple case folding, as defined by documents referenced in Clause 2 of ISO/IEC 10646:2020. Otherwise, returns False. This function uses the same method as is used to determine whether two identifiers are the same.
@dby
Returns True if the strings consist of the same sequence of characters after applying simple case folding, as defined by Section 3.13 of Unicode Version 15.0. Otherwise, returns False. This function uses the same method as is used to determine whether two identifiers are the same.
This AI does not change the language, so it does not entail changes to ACATS tests.