DEVELOPMENT EDITION · 769442725406
Language Reference
On this page

Attribute reference

An attribute is a compiler-recognized property or operation associated with a prefix. Vada uses an apostrophe, for example A'Length; Varc normally uses ::, for example A::Length. Vibe exposes selected properties/helpers, not a general spelling for every Ada attribute. The syntax references define those frontend forms.

This catalog covers every attribute name Verada recognizes, including the names it recognizes only to reject them. A type/subtype prefix and an object prefix are not interchangeable for every operation. Use subtype prefixes for scalar limits and operations, and actual array values for runtime array bounds.

Bounds, positions, and numeric properties

Name Prefix and arguments Meaning and restrictions
First Scalar subtype, or array with optional dimension Lowest scalar value or array lower bound
Last Scalar subtype, or array with optional dimension Highest scalar value or array upper bound. A null array can have last below first.
Length Array with optional dimension Number of components along that dimension; zero for a null dimension. This is not a general container length attribute.
Range Array/subtype in a range position, optional dimension Supplies a discrete range. It is not an ordinary scalar expression; use First/Last when scalar bounds are needed.
Base Type/subtype mark Selects the supported base subtype in a type context. It is not a runtime scalar property.
Pos Scalar subtype with one value Gives the value's discrete/representation position in the supported scalar domain. Use concrete enumeration/integer operands.
Val Scalar subtype with one position Produces a value from a position, with the applicable range obligation.
Succ Scalar subtype with one value Successor; the input cannot be the final permitted value.
Pred Scalar subtype with one value Predecessor; the input cannot be the first permitted value.
Min Scalar type/subtype with two values The smaller compatible value. It is also usable as the supported named reducer.
Max Scalar type/subtype with two values The larger compatible value.
Modulus Modular type/subtype, no value arguments Static declared modulus. Ordinary signed types do not have a modulus.
Digits Floating or decimal fixed type/subtype Static declared decimal digits: a floating type's precision (1–15), a decimal type's number of digits (1–18), or a decimal subtype's from its digits constraint.
Scale Decimal fixed type/subtype Static N where the delta is 10 ** (−N): 2 for delta 0.01.
Round Decimal fixed type/subtype, one real value The value rounded to the nearest value of the type, halves away from zero, where a conversion truncates toward zero.
Small Ordinary fixed type/subtype Static implementation-selected power-of-two step.
Delta Ordinary fixed type/subtype Static declared delta. It can differ from Small.
Small_Numerator, Small_Denominator Fixed-point subtype The small as a fraction in lowest terms, static universal_integers: Volts'Small_Denominator is 8 for a small of 0.125. A Verada addition, not in the RM (GNAT has both)
Aft Ordinary fixed type/subtype Static decimal fractional-digit property derived from delta.
Width Scalar subtype Length of the longest Image of a value of the subtype: from its static bounds for a discrete or fixed-point subtype, from its digits and exponent range for a floating-point one (Float'Width is 12)
Wide_Width, Wide_Wide_Width Scalar subtype The same as Width: Verada's images are the same text whatever the character type
Fore Ordinary or decimal fixed subtype with static bounds Static: the characters before the point in the image of its widest value, a sign or space among them, at least 2 (Fore of delta 0.125 range -100.0 .. 100.0 is 4)

For arrays, bounds can be queried even before every component is initialized; querying a bound is different from reading an unset component. For dynamic values use the value's actual bounds, rather than an unconstrained type mark that does not supply a particular object's shape.

The dimension argument of First, Last, Length and Range is a static integer from 1 through the array's rank; without it the attribute describes dimension 1. Any other dimension is an error (B2005): on a one-dimensional array, A'First (0) and A'Length (2) are both rejected, and a dimension that is not static is rejected as well. Vibe numbers dimensions from zero in its own shape helpers; see the Vibe reference.

The scalar numeric properties describe Verada's implementation, not host C type sizes. Fixed Delta and Small are universal-real constants in the permitted context. An attribute that produces an integer position or bound still needs to fit a concrete target when assigned to one.

Images and rounding

Name Form Result
Image Subtype plus one value (Integer'Image (X)), or an object (X'Image) A String image of the value, as Ada writes it: a leading space or minus sign on numbers (" 5"), upper-case enumeration and Boolean literals ("GREEN"), floating values in exponent form (" 1.50000E+00"); of a record (Ada 2022) its components' images by name, (X => 1, Y => -2) with a line break before it and after each comma (nested ones indented), (NULL RECORD) for a null record; of an array its components' images, [ 1, 2] after a line break, [] for an empty one: as GNAT writes them
Enum_Rep, Enum_Val Enumeration subtype plus one value (Speed'Enum_Rep (Fast), Speed'Enum_Val (200)), or an object (X'Enum_Rep) The code of a value, its position where the type has no representation clause; the value of a code, which must be one of the type's
Img A scalar object (X'Img) GNAT's name for X'Image, accepted with the same result
Wide_Image, Wide_Wide_Image As Image The image as a Wide_String or a Wide_Wide_String, character for character
Value Scalar subtype plus one String (Integer'Value (S)) The value the string writes, as Ada reads it: spaces around it; for a number an optional sign and a literal, decimal or based (16#FF#), with an exponent (12E3); for an enumeration type one of its literals, an identifier in any case or a character literal as written ('x'), or a control character's name for a character type (NUL)
Wide_Value, Wide_Wide_Value Scalar subtype plus one Wide_String or Wide_Wide_String As Value, of a wider string
Valid_Value Scalar subtype plus one string of any of the three types Whether Value would read the string: its form, and a value in the subtype. A Verada addition for every scalar type, not in the RM (GNAT has it for enumeration types)
Floor Floating subtype and one floating value Floating value rounded toward negative infinity to an integral value
Ceiling Floating subtype and one floating value Floating value rounded toward positive infinity to an integral value
Rounding Floating subtype and one floating value Floating value rounded to nearest integral value, halves away from zero
Truncation Floating subtype and one floating value Floating value rounded toward zero to an integral value

Value's precondition is that the string is a value of the subtype: a call is proved, never a failed check. A string that comes from outside the program, a line of input or a command-line argument, is tested first:

if Natural'Valid_Value (Argument) then
   Count := Natural'Value (Argument);
else
   Put_Line ("not a count: " & Argument);
end if;

The value of an integer string is exact, and must be in the subtype's range. A real string's value is its literal's exact value correctly rounded to the type's precision (to nearest, a half to the even one), as the run time reads it. A fixed-point string's value is its literal's exact value divided by the type's small and truncated toward zero, as a conversion to the type is: Volts'Value ("-3.3") of a type whose small is 0.125 is -26 smalls, -3.25. Valid_Value and Value are calls of Verada.Scanning, whose functions a program may call itself; Text_IO's numeric Get reads its numbers with them.

Rounding attributes return the floating type, not an integer result type. A later integer conversion has its own checks. Vada Integer(X) for real X and Vibe's recognized int(X) helper have different rounding rules, as described in types.

An image is not arbitrary Python repr, a configurable internationalized formatter, or a serialization protocol. Vibe's floating images and f-string format specifications are described in the Vibe reference.

Representation

These attributes give the layout Verada stores values in, the one that Unchecked_Conversion and objects at an address use: a record representation clause's, or the natural one (each component at its alignment, in order). They are static where the type's size is.

Name Form Result
Size Subtype, or object Of a discrete subtype, the fewest bits its values need; of another subtype or of an object, the bits it is stored in (of an array with run-time bounds, its length times its component's)
Object_Size Subtype The bits an object of the subtype is stored in
Component_Size Array subtype or object The bits each component is stored in
Alignment Subtype or object The storage units a value is aligned to
Max_Size_In_Storage_Elements Subtype The storage units a value takes
Position, First_Bit, Last_Bit A record component (R.C'Position) The component's storage unit within the record, and its first and last bits within that unit's word

Floating-point model

A floating type of up to 6 digits is IEEE binary32 (Float), and one of more is IEEE binary64 (Long_Float). Its model numbers are its normal machine numbers. These attributes take a floating subtype as their prefix, and those with arguments take values of that type.

Name Form Result
Machine_Radix, Machine_Mantissa, Machine_Emax, Machine_Emin Floating subtype Static: 2; 24 or 53 binary digits; 128 or 1024; -125 or -1021
Model_Mantissa, Model_Emin, Model_Epsilon, Model_Small Floating subtype Static: as the machine's mantissa and lowest exponent; 2.0 ** (1 - Model_Mantissa); the smallest normal value
Safe_First, Safe_Last, Safe_Emax Floating subtype Static: the type's most negative and largest values, and its highest exponent
Denorm, Signed_Zeros, Machine_Rounds, Machine_Overflows Floating subtype Static Booleans: True, True, True, False
Exponent, Fraction One value Ada's exponent and fraction, X = Fraction * 2.0 ** Exponent with the fraction's magnitude in [0.5, 1); 0 and 0.0 for zero
Compose, Scaling A value and an integer The value's fraction, or the value, times 2 raised to the integer; an overflow is a checked error
Copy_Sign Two values The first value's magnitude with the second's sign, a zero's sign included
Adjacent Two values The machine number next to the first in the direction of the second, or the first when they are equal
Leading_Part A value and a positive count The value with only its leading binary digits kept, as many as the count
Machine, Model One value The value; for Model, zero below the smallest normal value
Unbiased_Rounding, Machine_Rounding One value Rounded to the nearest integral value, a half to the even one
Remainder Two values Exactly X - N * Y, with N the quotient X / Y rounded to the nearest integer, a half to the even one; Y = 0.0 is a checked error

The prover knows these values exactly, as the code computes them, except Remainder. For Remainder, the prover knows only that the result is a value of the type.

Proof-state attributes

Name Context Meaning
Old Postcondition/accepted exceptional post-state expression Entry snapshot; prefix and conditional-evaluation restrictions apply, including ownership-copy restrictions
Result Function postcondition The operation's result; supported array-result indexing is permitted
Loop_Entry Enclosing loop context, optionally named loop Snapshot at loop entry, distinct from operation-entry Old
Initialized Object, or a part of an object with Relaxed_Initialization Whether the object or part has been initialized. It is ghost: write it in contracts and assertions, not in compiled code (B3013)
Valid Scalar object Whether the object holds a value of its subtype. Every scalar object of a Verada program does, so Valid is always true; it does not inspect foreign memory

Initialized does not make reading an unset value legal elsewhere; flow analysis still checks every read. Neither Valid nor Initialized makes memory written by foreign code safe: check such data at the interface (see concurrency and devices).

See contracts for exact Old/Result/Loop_Entry placement. A prefix referencing an end-only variable or nested result cannot be evaluated on entry by simply attaching Old.

Access, class, and address attributes

Name Meaning
Access Contextually typed borrower/observer of an object, or a compatible subprogram designation; mutability, lifetime, and callback-contract rules apply
Unchecked_Access Recognized and rejected because it escapes ownership
Unrestricted_Access Recognized and rejected for the same reason
Class A class-wide type mark for a tagged root; the supported conversion form checks tags/compatibility as required
Address A directly named object's System.Address, with System visible; not arbitrary selected-composite pointer arithmetic

Access needs a suitable expected anonymous access or callback type. It cannot invent an unconstrained owner type without context. Nested subprogram designations are excluded. Object access, allocation of a new owner, and importing a device address are distinct operations.

Reduction attribute

Reduce(Reducer, Initial) consumes a supported array/container or bracketed value sequence using the reducer and initial accumulator. It requires exactly two reduction arguments, appropriate result typing, safe reducer calls, and finite supported iteration. It is described completely in pipelines, including empty results, ordering, lockstep extensions, and generated proof invariants.

Scan(Reducer, Initial), Verada's extension under pragma Extensions_Allowed (On), is the twin of Reduce: it gives an array of each position's reduction of the elements up to it, as long as its prefix: for an array X holding (3, 1, 4), X'Scan ("+", 0) is (3, 4, 8). Its prefix is an array object. APL's f\ is the same scan.

Update attribute

X'Update (C => V, ...) is the older spelling of the delta aggregate (X with delta C => V, ...): a copy of X with the named components replaced. Verada accepts it and treats it exactly as the aggregate, described in aggregates and updates.

Unknown names

Unknown attributes produce B2007, often with a spelling suggestion. A recognized name with the wrong prefix or in the wrong context produces the corresponding legality diagnostic. Attributes not in this catalog, such as GNAT's implementation-defined attributes, are not part of the language.