Ada Programming/Attributes/'Enum Val

Description
Return the enumeration literal represented by a given number.

For every enumeration subtype,   denotes a function with the following spec: The function returns the enumeration value whose representation matches the argument, or raises Constraint_Error if no enumeration literal of the type has the matching value. This will be equal to the value of the  attribute in the absence of an enumeration representation clause. This is a static attribute (i.e., the result is static if the argument is static).

Example
Enum_Type (Enum1, Enum2, Enum3);

(Enum_Type'Enum_Val(0) = Enum1);

Wikibook

 * Ada Programming
 * Ada Programming/Attributes
 * Ada Programming/Attributes/'Enum_Rep

Ada 2022 Overview

 * 7.13 Getting the representation of an enumeration value