Ada 2012 Static Predicates
1. Subtypes Every Ada type is associated with a subtype. A subtype is a subset of the base type, commonly with some restriction in the set of values valid for the subtype. For instance, Ada provides a pre-defined type named Integer. Integer is a signed type representing all the values in the range of -2**31..2**31 – 1. Ada also provides two pre-defined subtypes of Integer: Natural, which is an integer with a minimum value of 0, and Positive which is an integer with a minimum value of 1. Every instance of Natural or Positive is also an instance of Integer. This capability to define subtypes has been a part of Ada since the first Ada language standard in 1983. While this subtype capability has been very useful, it had some restrictions. Subtype ranges were always restricted to contiguous ranges. For instance, the syntax for defining the Natural subtype mentioned above is: subtype Natural is Integer range 0..Integer’Last; Integer’Last evaluates to ...