|


The CONVECS team is pleased to announce
that version 3.17 of the TRAIAN compiler for LNT is available.
TRAIAN 3.17 brings five language changes, twelve static-semantics changes, six compiler changes, five code-generation changes, thirteen library changes, five release changes, and seven bug fixes (see below their description).
These changes have been progressively integrated in the successive versions of TRAIAN distributed as part of the CADP toolbox between January and August 2025.

for ... until ... by ... loop
...
end loop
and the breakable one:
for ... until ... by ... loop ... in
...
end loop
These loops can be used both in functions and processes. They are useful to
enumerate the domain of enumerated types and range types. For instance, given
the following definition:
type T is
range 1 .. 99 of NAT
with =, SUCC
end type
one can easily enumerate all values of type T using a "for-until"
loop:
var N: T in
for N := 1 of T until N = 99 of T by N := SUCC (N) loop
...
end loop
end var
whereas the following "for-while" loop:
var N: T in
for N := 1 of T while N <= 99 of T by N := SUCC (N) loop
...
end loop
end var
would raise an overflow when computing SUCC (N) for N = 99.
Consequently, "until" becomes a new reserved keyword of LNT. Users are thus advised to update their LNT programs. This can be done automatically by typing the following command:
traian_upc 2025-LNT-UNTIL <directory>which will recursively explore the contents of the specified <directory>, look for ".lnt" files, and automatically rename identifiers named "until".
The C code generator of TRAIAN, the LNT User's Manual, and the editor style files have been updated to handle these new "for-until" loops. See item 746 in the HISTORY.txt file (related to CADP HISTORY item #3126).
".." is deprecated and should be replaced by "..."Users are thus advised to update their LNT programs. This can be done automatically by typing the following command:
traian_upc 2025-LNT-DOT-DOT <directory>which will recursively explore the contents of the specified <directory>, look for ".lnt" files, and automatically replace ".." with "...". See item 747 in the HISTORY.txt file (related to CADP HISTORY item #3133).
X += V X += [E1, ..., En] V X -= V X -=[E1, ..., En] V X [V0] += V X [V0] +=[E1, ..., En] V X [V0] -= V X [V0] -=[E1, ..., En] VThe instructions work for numeric types (NAT, INT, and REAL) but also for any type with binary functions named "+" or "-". These functions may raise exceptions (hence, the presence of event lists E1, ..., En).
Semantically, these instructions can be seen as shorthands. "X += V" means "X := X + V", "X += [E1, ..., En] V" means "X := X +[E1, ..., En] V", etc.
This change is backward compatible, except for existing LNT specifications containing functions named "+=" or "-=". In such case, the functions must be renamed, since "+=" and "-=" are now reserved keywords.
Contrary to the C language, other shorthands than "+=" and "-=" (e.g., "*=", "/=", or even "and=", "or=", "mod=", "rem=", etc.) have not been added to LNT, since they would be much less used than "+=" and "-=".
The C code generator of TRAIAN was extended to handle these new increment/decrement constructs in function definitions. See item 748 in the HISTORY.txt file (related to CADP HISTORY item #3135).
"!?X" for in-out parameters is deprecated and should be replaced by "X?" (79 occurrences)Users are thus advised to update their LNT programs. This can be done automatically by typing the following command:
traian_upc 2025-LNT-EXCLAIM-QUERY <directory>which will recursively explore the contents of the specified <directory>, look for ".lnt" files, and replace "!?X" by "X?" automatically. See item 753 in the HISTORY.txt file (related to CADP HISTORY item #3148).

pragma "!int_bits" should be at the start of module pragma "!nat_bits" should be at the start of module etc.Notice also that "!version" pragmas may appear everywhere, especially in files included using the "library" directive. See item 727 in the HISTORY.txt file (related to CADP HISTORY item #3093).
virtual declaration without actual process PSee item 736 in the HISTORY.txt file (related to CADP HISTORY item #3103).
useless virtual for actual process P declared at FILE:LINESee item 739 in the HISTORY.txt file (related to CADP HISTORY item #3108).
error: module file "F.lnt" is readable neither in "." nor "/opt/TRAIAN/lib" error: library file "F.lnt" is readable neither in "." nor "/opt/TRAIAN/lib"whereas, formerly, it would only report that "F.lnt" was not readable.
type T is
set of NAT
with == !external !implementedby "EQ"
end type
TRAIAN now emits a specific error message:
forbidden pragma !external for "with" function ==which is clearer than the formerly emitted message:
non-empty, non-null definition for external function ==
"select" is deprecated and should be replaced by "alt" (12 occurrences found)The replacement of "select" by "alt" can be performed automatically by calling the shell script "traian_upc" with its 2024-LOTNT-SELECT key.
type T is array [0 ... 1] of Nat end type
function F () is
var A : T in
-- in this function, A is assigned twice but not used
A := T (0, 0); -- new warning "useless assignment"
A [0] := 1 -- old warning "useless assignment" remains
end var
end function
See item 751 in the HISTORY.txt file (related to CADP HISTORY item #3145).
"require" clause for process P with no "in" parameter (should be an "assert") "require" clause irrelevant to the "in" parameter of process P (should be an "assert") "require" clause irrelevant to the "in" parameters of process P (should be an "assert") "require" clause for function F with no "in" parameter (should be an "assert") "require" clause irrelevant to the "in" parameter of function F (should be an "assert") "require" clause irrelevant to the "in" parameters of function F (should be an "assert")The case where the Boolean expression is constant ("false" or "true") is already covered by a specific warning message. See item 755 in the HISTORY.txt file (related to CADP HISTORY item #3151).
"ensure" clause for process P with no "out" parameter (should be an "assert") "ensure" clause irrelevant to the "out" parameter of process P (should be an "assert") "ensure" clause irrelevant to the "out" parameters of process P (should be an "assert") "ensure" clause for function F with no "out" parameter and no result (should be an "assert") "ensure" clause irrelevant to the result of function F (should be an "assert") "ensure" clause irrelevant to the "out" parameter of function F (should be an "assert") "ensure" clause irrelevant to the "out" parameter and result of function F (should be an "assert") "ensure" clause irrelevant to the "out" parameters of function F (should be an "assert") "ensure" clause irrelevant to the "out" parameters and result of function F (should be an "assert")The case where the Boolean expression is constant ("false" or "true") is already covered by a specific warning message. See item 757 in the HISTORY.txt file (related to CADP HISTORY item #3152).
error: variable X is uninitializedmay be changed to:
warning: variable X may be uninitializedand:
error: function F may return without assigning "out" parameter Xmay be changed to:
warning: function F may return without assigning "out" parameter XConsequently, certain LNT programs formerly rejected by TRAIAN are now accepted (with warnings).
variable X may be uninitializedor:
"in var" parameter X modified before used (should be a local variable)since TRAIAN now excludes dead paths from its analysis of branching points ("alt", "case", and "if").
variable X may be uninitializedor:
function F may return without assigning "out" parameter X
event E is already accessed (superfluous "access")See item 764 in the HISTORY.txt file (related to CADP HISTORY item #3164).
loop body is never executedSee item 767 in the HISTORY.txt file (related to CADP HISTORY item #3169).

no main process found (define one or use "-main" option)Consequently, TRAIAN has been equipped with a "-main" option. Syntactic and semantic checks have been added, which verify that the argument of this option is correct (binding, type checking, parameter checking, etc.). See item 729 in the HISTORY.txt file (related to CADP HISTORY item #3096).
limitation: processes not yet fully implementedno longer refer to the first line of the second process defined in the LNT process, but to the first line on which a behaviour construct not yet supported by TRAIAN (e.g., "alt" operator, "par" operator, process call, etc.) occurs. See item 733 in the HISTORY.txt file.
Therefore, this change is not backward compatible, as the new version of TRAIAN is less permissive. In LNT programs that contain a single process, this process should be renamed to "MAIN" manually. See item 734 in the HISTORY.txt file.


MIN : NAT, NAT -> NAT MAX : NAT, NAT -> NAT MIN : INT, INT -> INT MAX : INT, INT -> INTthe following new functions have been added:
MIN : BOOL, BOOL -> BOOL MAX : BOOL, BOOL -> BOOL MIN : REAL, REAL -> REAL MAX : REAL, REAL -> REAL MIN : CHAR, CHAR -> CHAR MAX : CHAR, CHAR -> CHAR MIN : STRING, STRING -> STRING MAX : STRING, STRING -> STRINGThis change is likely to break existing LNT programs that already define MIN or MAX functions with the same profiles. In such case, the user-defined functions should be removed if they are identical to the new library functions, or renamed if their semantics is different. See item 758 in the HISTORY.txt file (related to CADP HISTORY item #3153).
FIRST : -> BOOL LAST : -> BOOL FIRST : -> NAT LAST : -> NAT FIRST : -> INT LAST : -> INT FIRST : -> CHAR LAST : -> CHARIn a few cases, this change is not backward compatible. For instance, if E is an event declared with channel "any" and if FIRST denotes a nullary function of some user-defined type T, then the following behaviour:
E (FIRST)is no longer accepted, since FIRST is now overloaded, and should be replaced with:
E (FIRST of T)See item 766 in the HISTORY.txt file (related to CADP HISTORY item #3168).
type T1 is range ... of T2a conversion function:
T1 : T2 -> T1was already generated automatically. From now on, another conversion function:
T1 : [Exit] T2 -> T1is generated, which takes an explicit event parameter that denotes the exception to be triggered if the conversion fails. See item 770 in the HISTORY.txt file (related to CADP HISTORY item #3181).
& : STRING, STRING -> STRINGthe library now supports:
& : BOOL, STRING -> STRING is & : NAT, STRING -> STRING is & : INT, STRING -> STRING is & : REAL, STRING -> STRING is & : CHAR, STRING -> STRING isand:
& : STRING, BOOL -> STRING is & : STRING, NAT -> STRING is & : STRING, INT -> STRING is & : STRING, REAL -> STRING is & : STRING, CHAR -> STRING isThese new functions make it easier to display output messages such as:
PRINT ("the probability for " & N & " elements is " & P)
Formerly, one had to write String (N) and String (P) instead
of N and P.
See item 771 in the HISTORY.txt file (related to CADP HISTORY item #3182).
+ : [Exit] Nat, Nat -> Nat - : [Exit] Int -> Int + : [Exit] Int, Int -> Int - : [Exit] Int, Int -> IntThis change might not be backward compatible. For instance, the following process definition:
process MAIN [UNDERFLOW : Exit, PRINT : any] is
PRINT (1 -[UNDERFLOW] 2)
end process
was formerly accepted, but is now rejected:
in behaviour: PRINT (1 -[UNDERFLOW] 2) offer 1 -[UNDERFLOW] 2 may have several types NAT|INT, one of which should be chosen using an "of" coercionIndeed, one must insert either "of Nat" or "of Int" after constants 1 and/or 2. See item 773 in the HISTORY.txt file (related to CADP HISTORY item #3187).
Real : [Exit] Nat -> Real Real : [Exit] Int -> Realwhich were indeed useless, given that Reals are implemented using the "double" type of C, so that no exception may occur when converting Nats or Ints to Reals. See item 774 in the HISTORY.txt file (related to CADP HISTORY item #3190).
+ : Nat, Nat -> Nat + : [Exit] Nat, Nat -> Nat * : Nat, Nat -> Nat * : [Exit] Nat, Nat -> Nat ** : Nat, Nat -> Nat ** : [Exit] Nat, Nat -> Nat + : Int, Int -> Int + : [Exit] Int, Int -> Int - : Int -> Int - : [Exit] Int -> Int - : Int, Int -> Int - : [Exit] Int, Int -> Int * : Int, Int -> Int * : [Exit] Int, Int -> Int ** : Int, Nat -> Int ** : [Exit] Int, Nat -> IntFormerly, these operations did not check for overflow or underflow (as usual with the C language) and, thus, never raised the corresponding events. At present, some partial overflow/underflow checks have been implemented.
A more precise implementation will be provided when as the "checked" arithmetic operations of the recent C23 standard will be available on all platforms and compilers. See item 775 in the HISTORY.txt file.
For any type T defined as "range ... of Char", the following predefined functions are now available:
+ : T, Nat -> T + : [Exit] T, Nat -> T - : T, Nat -> T - : [Exit] T, Nat -> TFor any type T defined as "range ... of Nat", the following predefined functions are now available:
+ : T, T -> T + : [Exit] T, T -> T - : T, T -> T - : [Exit] T, T -> TFor any type T defined as "range ... of Int", the following predefined functions are now available:
+ : T -> T + : T, T -> T + : [Exit] T, T -> T - : T -> T - : [Exit] T -> T - : T, T -> T - : [Exit] T, T -> TSee item 776 in the HISTORY.txt file (related to CADP HISTORY item #3192).


P [Z -> C, X -> A, Y -> B] (0, 1)
instead of:
P [Z -> C, X -> A, Y -> B, ...] (0, 1)See item #740 in the HISTORY.txt file (related to CADP HISTORY item #3109).
limitation: too long ".lnt" file name in list of included modules (maximum length is 1023)See item #752 in the HISTORY.txt file (related to CADP HISTORY item #3147).
library FILE end libraryinstead of the correct directive:
library "FILE" end librarythe error recovery mechanism of SYNTAX would replace the 'F' of 'FILE' with '"', triggering the following error message:
library FILE end library
^
warning: the invalid character "F" is replaced by "\""
Then, TRAIAN would try to open a file named 'ILE', which did not
exist. To avoid this situation, which proved to be confusing for end users,
the error recovery mechanism is now disabled when parsing "library"
directives.
See item #754 in the HISTORY.txt file (related to CADP HISTORY item #3150).

For many years, TRAIAN has been used to develop compilers, including those of the CADP toolbox.
Since October 2023, it also serves to analyze formal specifications of concurrent systems, as part of the CADP toolbox.
We are working to further deepen the co-operation between TRAIAN and the
LNT2LOTOS
translator of CADP.

TRAIAN 3.17 can be freely downloaded from the TRAIAN Web Page located at:
