Variable and function (method) identifiers are of the following regular expression form:
[a-zA-Z][a-zA-Z0-9_]*, i.e., a letter followed by zero of more letters, digits, or
underscores. A valid identifier should not be the same as any of Logika operators,
literals, and keywords.

Identifiers containing an underscore cannot be used in the programming context (i.e.,
underscore cannot be a part of a user-declared variable/function identifier).

Below are a table of Logika operators and literals in both programming and proof context,
listed with a decreasing precedence order (first is highest) along with Math Unicode LIVE Shortcuts.
Note that the proof context operators and literals include the ones in the programming
context, NUM is either 0 or [1-9][0-9]*, STRING is
Java’s string literal
without the octal escape.
The prepend (+:) and implication operators (->, implies, →)
are right-associative.

Scala is a line-oriented language where newline characters are treated specially in some cases.
For example, newline characters can separate expressions in a code block.
The actual rules of when newlines are treated specially
are not immediately obvious but they behave “intuitively” (resulting in rare surprises when
programming).

Logika follows Scala’s line-orientation (otherwise, it is not a subset language),
even inside proof context (e.g., proof steps have to be separated by newlines).
For clarity sake, instead of explicitly listing newlines in the Logika context-free grammars
that go beyond Scala’s, special situations are described in the relevant sections.
Interested readers are referred to the full
Logika’s ANTLR4 grammar
(NL token) if such details are preferred.
(A separate lexical analysis is done after the ANTLR4-generated lexer tokenize an input text
to implement Scala’s newline rules, thus, it is not directly specified in the ANTLR4 grammar.)

Other than the special newline rules that Logika follows in proof context,
Logika whitespaces are similar to Scala’s.