The CONVECS team is pleased to announce that version 3.1 of the TRAIAN compiler for LOTOS NT is available.
On the one hand, TRAIAN 3.1 is a consolidation release, which brings five general enhancements and eight bug fixes (see below their description).
On the other hand, TRAIAN 3.1 is also a transition release, which introduces various changes to the LOTOS NT language, in order to progressively align it with the LNT language supported by the CADP toolbox. Indeed, the syntax of LOTOS NT is non-intuitive, and even confusing, at various places. For instance, there are much too many brackets in the syntax of LOTOS NT, with different meanings (Boolean guards, sets of values, lists of values, lists of gates, and lists of exceptions). This defect inherited from LOTOS is properly solved in LNT, where brackets are exclusively used to denote event lists.
To do so, seventeen language changes have been introduced with TRAIAN 3.0 (see below their description). All but one of these changes are backward compatible. Only the 10th change listed below is not. Thus, all existing LOTOS NT programs that compiled using TRAIAN 3.0 and do not use the list notation "[x, y, z]", will still compile using TRAIAN 3.1.
However, end-users are advised to upgrade all their source LOTOS NT programs in order to only use the new notations introduced by TRAIAN 3.1. Even if the old notations are still supported by TRAIAN 3.1, they are deprecated, meaning that they will be removed from future versions of TRAIAN, most likely as soon as TRAIAN 3.2.
To ease the upgrade of LOTOS NT source code, a conversion tool named
"traian_upc" has been developed and is provided with TRAIAN 3.1.
Using this tool, the CONVECS team was able to swiftly upgrade seven
compilers written using LOTOS NT (namely, EXP2C, FSP2LOTOS, GRL2LNT,
MCL_EXPAND, PIC2LNT, SVL, and TRAIAN itself) totalling 168,000 lines
of LOTOS NT code, as well as the LOTOS NT test suites totalling
1,940,000 lines of code.
superfluous "..." after all parameters have been listedif the ellipsis notation "..." is used (in a function call, a constructor call, or a field update) where there is no missing element in the parameter list.
empty field updatewhen an expression of the form "V.{}" or "V.{...}" is used.
loop L in ... loop L in -- this loop should have a different name ... break L -- risk of confusion between both loops end loop end loop
This decision was dictated by four reasons: (i) Useless "raises" clauses confuse those who read the LOTOS NT code; (ii) TRAIAN 3.0 already forbad invoking "F (...) raises [X]" if function F was not declared to raise an exception; (iii) TRAIAN 3.0 also forbad redundant "raises" clauses, as in "V raises [X1] raises [X2]"; and (iv) TRAIAN 3.1 now behaves like TRAIAN 2.x, which already emitted a fatal error for useless "raises" clauses.
traian_upc 2020-LOTNT-INOUT [<file> or <directory>]
traian_upc 2020-LOTNT-CASE-IS [<file> or <directory>]
traian_upc 2020-LOTNT-FOR-DO [<file> or <directory>]
traian_upc 2020-LOTNT-WHILE-DO [<file> or <directory>]
traian_upc 2020-LOTNT-VALUE-LIST [<file> or <directory>] traian_upc 2020-LOTNT-PATTERN-LIST [<file> or <directory>]Beware that these commands may modify comments and character strings.
function F (B: BOOL) : BOOL raises [E: none] is ... function F (X, Y : NAT) : NAT raises [ZDIV, UFLOW : none] is ...and with the new syntax:
function F [E: none] (B: BOOL) : BOOL is ... function F [ZDIV, UFLOW : none] (X, Y : NAT) : NAT is ...TRAIAN 3.1 still accepts both syntaxes, but the former syntax is deprecated. End-users are advised to upgrade their LOTOS NT files:
traian_upc 2020-LOTNT-FUNCTION-RAISES [<file> or <directory>]
(V0.{X => V}) raises [E]was replaced by a new, more readable syntax aligned on that of LNT:
V0 .[E] {X => V}TRAIAN 3.1 still accepts both syntaxes, but the former syntax is deprecated. End-users are advised to upgrade their LOTOS NT files:
traian_upc 2020-LOTNT-UPDATE-RAISES [<file> or <directory>]
F raises [E] F () raises [E] F (V1, ..., Vm) raises [E1, ..., En]was replaced by a new, more concise syntax aligned on that of LNT:
F [E] F [E] () F [E1, ..., En] (V1, ..., Vm)TRAIAN 3.1 still accepts both syntaxes, but the former syntax is deprecated. End-users are advised to upgrade their LOTOS NT files:
traian_upc 2020-LOTNT-PREFIX-RAISES [<file> or <directory>]
(V1 F V2) raises [E1, ..., En] (V1 - V2) raises [E] (V1 / V2) raises [E]was replaced by a new, more concise syntax aligned on that of LNT:
V1 F[E1, ..., En] V2 V1 -[E] V2 V1 /[E] V2This change also concerns field selection, whose old syntax:
V.F raises [E]becomes:
V .[E] FTRAIAN 3.1 still accepts both syntaxes, but the former syntax is deprecated. End-users are advised to upgrade their LOTOS NT files:
traian_upc 2020-LOTNT-INFIX-RAISES [<file> or <directory>]In some rare, complex cases, the elimination of "raises" is better done manually, especially in presence of expressions with "raises" nested at various levels.
P1 | ... | Pn [V]was confusing, as the Boolean guard V applies, not only to Pn, but also to P1, ..., P(n-1). TRAIAN 3.1 supports a new syntax inspired from that of LNT:
P1 where V | ... | Pn where VTRAIAN 3.1 still accepts both syntaxes, but the former syntax is deprecated. Mixing both syntaxes is possible, yet not commendable (see item 200 in the HISTORY.txt file for details). End-users are advised to upgrade their LOTOS NT files:
traian_upc 2020-LOTNT-CASE-CONDITIONS [<file> or <directory>]
traian_upc 2020-LOTNT-ACTUAL-INOUT [<file> or <directory>]
raise UNEXPECTEDwhere a "return" is missing, especially after calling an external function that never returns.
TRAIAN 3.1 can be freely downloaded from the TRAIAN Web Page located at: