Compatibility of constraint defined by discret 86-12-01 AI-00282/06 1
| !standard 03.06.01 (04) 86-12-01 AI-00282/06
| !class confirmation 86-05-12
| !status approved by WG9/AJPO 86-11-26
| !status approved by Director, AJPO 86-11-26
| !status approved by WG9/Ada Board 86-11-18
!status panel/committee-approved 86-08-07 (reviewed)
!status committee-approved (10-0-0) 86-05-12 (pending editorial review)
!status committee-approved (7-0-1) 86-02-20 (pending editorial review)
!status work-item 86-01-24
!status received 84-09-28
!references 83-00417
!topic Compatibility of constraint defined by discrete range
!summary 86-06-24
The constraint defined by a discrete range is compatible with a subtype if
each bound of the discrete range belongs to the subtype, or if the discrete
range defines a null range; otherwise the constraint is not compatible with
the subtype.
!question 86-06-27
3.6.1(4) says:
An index constraint is compatible with the type denoted by the
type mark if and only if the constraint defined by each
discrete range is compatible with the corresponding index
subtype.
The Standard does not, however, explicitly define what it means for a
discrete range to be compatible with a subtype. The closest thing to a
definition comes in 3.5(4):
A range constraint is compatible with a subtype if each bound
of the range belongs to the subtype, or if the range constraint
defines a null range; otherwise the range constraint is not
compatible with the subtype.
Since a discrete range is not, syntactically, a range constraint, the
definition in 3.5(4) does not, strictly speaking, define compatibility of a
discrete range with an index subtype.
Should compatibility of a discrete range with an index subtype be defined in
essentially the same way as compatibility of a range constraint?
!response 86-06-27
There is no gap in the language if we consider the following points:
a) The notion of compatibility is defined for constraints,
3.3.2(9).
Compatibility of constraint defined by discret 86-12-01 AI-00282/06 2
b) The "missing" notion is the compatibility of:
a constraint defined by the discrete range with the
corresponding index subtype,
and not the compatibility of
a discrete range with the corresponding index subtype.
The above "missing" notion is due to a misunderstanding of the definition of
"a constraint defined by a discrete range." If the word "defined" is used in
the ordinary English sense of "specified" or "determined," then we realize
that the compatibility is of:
a constraint that is specified (or determined) by the bounds of
the discrete range.
Hence, a discrete range defines a constraint in the same way as a range
constraint (considered as a syntactic term) defines a constraint.