The Valid attribute can be used to check the validity
of data produced by unchecked conversion, input, interface to foreign
languages, and the like.
Yields True if and only if the
object denoted by X is normal and has a valid representation. The value
of this attribute is of the predefined type Boolean.
19 Invalid
data can be created in the following cases (not counting erroneous or
unpredictable execution):
20 X'Valid is not considered to be a read
of X; hence, it is not an error to check the validity of invalid data.
21 The Valid attribute may be used to check
the result of calling an instance of Unchecked_Conversion (or any other
operation that can return invalid values). However, an exception handler
should also be provided because implementations are permitted to raise
Constraint_Error or Program_Error if they detect the use of an invalid
representation (see
13.9.1).