# Static expression

## Definition

There are two categories of static expressions.

An expression is called *locally static* if every operator in the expression is an implicit defined operator, if both operands and results are scalar and every primary in the expression is a *locally static primary* ; *locally static primaries* are:

- Variables of any type other then type
**TIME**. - Constants which are explicitly declared by a constant declaration and initialized by a locally static expression. (
**NOT**(deferred) Konstanten). - An alias whose aliased name is a locally static name.
- Function calls whose names represent a predefined operator and whose current parameters are locally static expressions.
- Predefined attributes that are values, other than '
**PATH_NAME**, and whose prefix is either a locally static subtype or is an object name that is of a locally static subtype. - Predefined attributes, except `
**LAST_EVENT**, `**LAST_ACTIVE**, `**LAST_VALUE**, `**DRIVING**und `**DIRIVNG_VALUE**, of locally static subtypes, which are function and which actual parameters are locally statics. - User-defined attributes whose values are defined by locally static expressions.
- Qualified expression whose results are locally static subtypes and whose operands are locally static expressions.
- A type conversion whose expression is a locally static expression.
- locally static expression enclosed in parentheses.

An expression is called *global static* (not dynamically elaborated) if every in the expression is a pure function and every primary in the expression is a *global static primary* ; *global static primaries* are:

- Literals of type
**TIME** - Locally static primaries
- Generic constants
- Generic parameters
- Constants including (deferred) Konstanten.
- Alias whose aliased name is a globally static primary.
- Array aggregates of global static subtypes whose elements consist only of global static expressions and whose elements have only globally static ranges.
- Record aggregates, if all elements are globally static expressions.
- Function calls whose names represent a pure function and whose actual parameters are global static expressions.
- Predefined attributes which are values and whose prefix is either a globally static subtype or is an object or function call that is of a globally static subtype.
- Predefined attributes which are functions other than `EVENT, `ACTIVE, `LAST_EVENT, `LAST_ACTIVE, `LAST_VALUE, `DRIVING or `DRIVING_VALUE, whose prefix is either a globally static subtype or is an object or function call that is of a globally static subtype, and whose actual parameter (if any) is a globally static expression.
- User-defined attributes whose values are defined by global static expressions.
- Qualified expressions whose operand is a global static expression.
- Type conversion whose expression is a globally static expression.
- Allocator of the first form (See Allocator) whose subtype indication denotes a globally static subtype.
- Allocator of the second form whose qualified expression is a globally static expression.
- Global static expressions enclosed in parentheses.
- Subelement or a slice of a globally static primary, provided that any index expression are globally static expression and any discrete ranges used in slice names are globally static discrete ranges.

## Comment

On text places where only “static” is used, locally or globally static can be inserted.

The rules for locally and globally static expressions imply that a constant or a generic may be initialised with a nonstatic expression; the constant itself may be a locally or globally static. Only interface constants, variables and signal declarations require static initialisation expressions.