State annotations

Annotations are currently an experimental work-in-progress language feature. Their design may change in a backward incompatible manner.

A state annotation adds state information to a location in an automaton. For basic information on state annotations, see the language tutorial. Here we discuss further details.

State annotations (@state) can be added to the following elements in CIF specifications:

The annotation has the following additional constraints, in addition to the general constraints that apply to all annotations:

Most values can thus be represented as literals, but there are some exceptions. The following overview indicates how to represent locations and different types of values:

Location / value Represented as

Location of an automaton

String literal with the non-escaped name of the location, or "*" for a nameless location.

Boolean value

true or false boolean literal.

Integer value

Integer literal, such as 0, 1 or 1234. Note that negative integer values are represented as a negation (unary operator) applied to a positive integer literal. And -2147483648 is represented as -(2147483647) - 1.

Real value

Real literal, such as 0.0, 1e5 or 0.5e-3. Note that negative real values are represented as a negation (unary operator) applied to a positive real literal.

Enumeration value

String literal with the non-escaped name of the enumeration literal.

String value

String literal, such as "some text".

Tuple value

Tuple literal, such as (1, 2) or (true, (1, 2)).

List value

List literal, such as [1, 2] or [[1, 2], [3, 4]]. Note that empty lists typically require a type hint in the form of a type cast, such as <list[0] int>[].

Set value

Set literal, such as {1, 2} or {{1, 2}, {3, 4}}. Note that empty sets typically require a type hint in the form of a type cast, such as <set int>{}.

Dictionary value

Dictionary literal, such as {1: 2, 3: 4} or {1: {2: 3}, 2: {4, 5}}. Note that empty dictionaries typically require a type hint in the form of a type cast, such as <dict(int:int)>{}.

Function value

String literal with the non-escaped absolute name of the function, or "*" for functions that represent a default initial value of a variable with a function type.