We define here the syntax of the structured derivation language. At the same time, we also explain the meaning of each of these constructs.
Structured derivations
A (structured) derivation consists of a title followed by a (possibly empty) sequence of derivation steps:

The title is just some alphanumeric text. The title is ignored by the checker.
A derivation step is either

A constant declaration introduces a new mathematical entity that we can reason about. It is of the form

where are constant names (.) These constants all have the same type, like Integer, real number, truth value, or functions over reals and integer.
We also allow constant declarations of the form

where x us a constant name and e is an expression. The type of x is then inferred from the expression e.
A function definition is of the form

Here f is a function name, are function parameters () and is an expression, that gives the value of the function for arguments .
A type denotes a set of values. A type is either a basic type, like (the real numbers), (the integers), or (the truth values), or a function type of the form where are all basic types ().
An assumption is of the form

where is a logical expression (i.e., an expression of type ). The assumption states that the logical property holds for the constants introduced earlier in the derivation.
A conclusion step is of the form

Here is a logical expression about the constants and functions introduced earlier in the derivation. The conclusion step says that property can be proved to hold, based on the assumptions and conclusion steps that preceed in the derivation. The checker checks that this is indeed the case.
A justification explains why a conclusion step is true. it is of the form

where is an alphanumeric text that gives the reason for why the step is correct. This is followed by a (possibly empty) sequence of nestd derivations. The nested derivations prove auxiliary facts, that together esttablish that the main conclusion is true.
The checker checks that the nested derivations are all correct, and that the results of these nested derivations imply that the main conclusion is true. The textual explanation is ignored by the checker.
A nested derivation is just a derivation. It is of the form

A calculation is a sequence of calculation steps, and is of the form

where are expression, and are binary relations, .
A calculation step is of the form

It says that the relation holds between the two expressions and . The binary relations between the expressions are usual arithmetic relations like, or logical relations like . The checker checks that the relation holds for each calculation step.
A comment is of the form

where is some alphanumeric text (with pink background) that clarifies some aspect of the derivation. A comment is ignored by the checker.
Note that this definition is recursive:
- a derivation is defined in term of justifications, and
- a justification is defined in terms of derivations.
Note that we allow declarations, definitions, assumptions, …, calculations and comments to occur in any order. The checker will reorganise the derivation before checking correctness so that all declarations and definitions come first, then all assumptions and finally all conclusion steps and calculations, while ignoring all comments. The internal order of declarations and definitions is preserved, as is the internal order of the assumptions and the internal order of conclusion steps and calculations.
Restrictions
- The constants declared must be unique at each level in a derivation, i.e., we cannot declare a constant name twice at the same level
- The expression $e$ that defines the value of a constant or function may only refer to
- constants and functions defined in the underlying theories of real numbers, integers, or truth values, or
- constants and functions that have been declared or defined earlier in the derivation, or
- constants that are given as parameters in the function defined by $e$.