The lexical syntax for identifiers used for sorts, operation symbols, and variables is as follows, using conventional notation for character classes in the productions for WORD and SIGNS.
ID ::= MIX-ID | MIX-ID [ ID,...,ID ]
MIX-ID ::= TOKEN | TOKEN __ | __
| TOKEN __ MIX-ID | __ MIX-ID
TOKEN-ID ::= TOKEN | TOKEN [ ID,...,ID ]
SIMPLE-ID ::= WORDS
TOKEN ::= WORDS | SIGNS | .WORDS
WORDS ::= WORD_..._WORD
WORD ::= [A-Za-z0-9'À-ÖØ-öø-ÿ]+
SIGNS ::= [+-*/&^#$~>=<@?!|\\:.{}\[\]!`-?`×÷]+
! VERSION ::= ... (not yet decided)
The following characters are not allowed to occur at all in a TOKEN:
( ) ; , ` " %
The following restrictions are not captured by the grammar above:
They may however be used together with other words in a complete WORDS sequence, or as part of a single WORD.
: :? ::= = => <=> . · | |-> \/ /\ ¬ { } [ ]
They may however be used together with other characters in a complete TOKEN. E.g., `==', `:=', `||', `{|' are all recognized as complete TOKENs. The single characters `<', `*', `?', `!', and `/' are also recognized as complete TOKENs, despite their use elsewhere as terminal symbols.
See Section 6 for the proposed lexical syntax of comments and annotations.