Declarations

Declarations are either global or local (to a process) and can contain declarations of clocks, bounded integers, constants and channels (although local channels are useless). The syntax is described by the grammar for Declarations:

Declarations  ::= (VariableDecl | ConstantDecls)*
ConstantDecls ::= 'const' ConstantDecl (',' ConstantDecl)* ';'
ConstantDecl  ::= ID ArrayDecl* [ Initialiser ]
VariableDecls ::= Type VariableDecl (',' VariableDecl)* ';'
VariableDecl  ::= ID ArrayDecl* [ ':=' Initialiser ]
Initialiser   ::= Expression
               |  '{' Initialiser (',' Initialiser)* '}'
ArrayDecl     ::= '[' Expression ']'
Type          ::= Prefix TypeId [ Range ]
Prefix        ::= 'urgent' | 'broadcast'
TypeId        ::= 'int' | 'clock' | 'chan' | 'bool'
Range         ::= '[' Expression ',' Expression ']'

The default range of an integer is [-32768, 32767]. Any assignment out of range will cause the successor state to be invalid, see also the sections on expressions and the semantics.

The boolean type bool can have the values false and true, which are equivalent to the the integer values 0 and 1. Like in C, any non-zero integer value evalutes to true and 0 evaluates to false.

Channels can be declared as urgent and/or broadcast channels. See under Synchronisations for information about the meaning of urgent and broadcast channels.

Examples