The CONVECS team is pleased to announce
that version 3.15 of the TRAIAN compiler for LNT is available.
In October 2023, TRAIAN found its way into the CADP toolbox, where it supplements the LNT2LOTOS translator with the features of a full-fledged compiler front-end for LNT. Recently, TRAIAN 3.14 became part of CADP 2024-g, TRAIAN 3.15 beta-4 became part of CADP 2024-h, and TRAIAN 3.15 beta-6 became part of CADP 2024-i.
TRAIAN 3.15 brings four language changes, thirty-three static-semantics changes, one release change, and six bug fixes (see below their description).
From now on, when an "ensure" clause refers to an "in var" parameter X, it must either specify X.in (i.e., the actual parameter value of X when the function or process was called) or X.out (i.e., the value of X when the function or process terminates). Using merely X in an "ensure" clause was ambiguous and is no longer permitted (this restriction already applied to "in out" parameters).
Since "ensure" clauses express guarantees given to the caller of a function or process, it is a bit awkward for them to use the modified value of an "in var" parameter, as the caller is not aware of this value. For this reason, TRAIAN now emits a warning if an "ensure" clause refers to X.out, where X is an "in var" parameter:
dubious ".out" qualifier for "in var" parameter XSee item 699 in the HISTORY.txt file.
Indeed, assigning an "in" parameter is already forbidden, and triggers a warning mentioning that the parameter should be declared "in var" instead of "in". Furthermore, it is ambiguous to use a modified "in" parameter X in an "ensure" clause, because one does not know if X refers to the value of X at the beginning or at the end of the function or process. For "in var" parameters, this ambiguity is now resolved by using ".in" or ".out" qualifiers, but such qualifiers would be meaningless for "in" parameters; thus, a fatal error is now emitted if a modified "in" parameter occurs in an "ensure" clause. See item 701 in the HISTORY.txt file.
function C (X : nat) : bool is return X > 0 end function function F (out X : nat) is ensure C (...); X := 1 end functionno longer trigger, in function F, the warning:
"out" parameter X both used and modified (should be an "out var" parameter)See item 702 in the HISTORY.txt file.
!card 1and/or:
!num_card 1From now on, TRAIAN accept the value 1 for these pragmas, as it makes sense in theory. However, LNT2LOTOS was not designed to handle this case, and will reject (as a "limitation") these pragmas if they come with a value less than two. See item 660 in the HISTORY.txt file.
variable X is uninitializedhave been replaced by:
variable X may be uninitializedwhere it was not fully certain that X was not initialized. This change especially occurred with array elements and when assigning variables in loops containing tests. See item 661 in the HISTORY.txt file.
!nat_inf value greater than !nat_sup valueSimilar checks are done for pragmas !int_inf and !int_sup, leading to the following error message:
!int_inf value greater than !int_sup valueConsequently, TRAIAN 3.15 may reject LNT programs accepted by former versions of TRAIAN. See item 662 in the HISTORY.txt file.
function F (N : nat) : nat is var X : nat in use X; X := 0; ... return X end var end functionTRAIAN now emits the following warning for the "use" clause:
variable X is uninitialized (superfluous "use")See item 663 in the HISTORY.txt file.
access i raise i X .[i] Yhas been enhanced. The former error message of TRAIAN, namely:
event i is not declaredwas replaced by more explicative messages emitted during the event-checking or type-checking phases of TRAIAN:
predefined event "i" forbidden in "access" clauseor:
event i has non-"raise" channel NONESee item 665 in the HISTORY.txt file.
a) The message:
array type T with empty index rangewas replaced by:
invalid bounds for array type T (5 greater than 1)b) The message
range type T with empty rangewas replaced by:
invalid bounds for range type T (2 greater than -1) invalid bounds for range type T ('z' greater than 'a') etc.See item 666 in the HISTORY.txt file.
"X.in" allowed only in "ensure" clauses "X.out" allowed only in "ensure" clauses "result" allowed only in "ensure" clauses "result" only allowed in functions that return a resultare now displayed sooner by TRAIAN. This also avoids superfluous error messages when the ".in" or ".out" qualifiers were used out of "ensure" clauses. See item 668 in the HISTORY.txt file.
invalid ".in" qualifier for "out" parameter X invalid ".out" qualifier for "in" parameter X missing ".in" or ".out" after "in out" parameter Xare now detected sooner by TRAIAN during variable binding. See item 669 in the HISTORY.txt file.
!int_bits 10 ... !int_bits 10or even:
!int_bits 10 ... !int_bits 13From now on, TRAIAN emits a warning in the former case:
pragma !int_bits already present (with same value) for this moduleand a (fatal) error in the latter case:
pragma !int_bits already present for this moduleSee item 670 in the HISTORY.txt file.
process P called with incorrect profile in behaviour P [E1 -> E2, E1 -> E3] the call uses process profile: P [E1 : any, E1 : any] but the called process has profile: P [E1 : any, E2 : any]From now on, TRAIAN emits a clearer error message:
multiple occurrences of event parameter E1 before "->"which is the same message, for processes, as the message already emitted for functions in presence of similar errors. See item 671 in the HISTORY.txt file.
error: process P called with incorrect profile in behaviour P [E1 -> E3] the call uses process profile: P [E1 : any] but the called process has profile: P [E2 : any]From now on, TRAIAN emits a clearer error message:
process P has no event parameter named E1See item 672 in the HISTORY.txt file.
function F called with incorrect profile in value: F [E1 -> E3] (X) no function exists with the requested profile: F [E1 : exit] (T1) : any but other functions exist with the same name and different profiles: F [E2 : exit] (X : T1) : T2From now on, TRAIAN emits a clearer error message:
function F has no parameter named E1or, in the case where function F is overloaded:
no function F has a parameter named E1See item 673 in the HISTORY.txt file.
type T is F1 !implementedby "C:F1" !implementedby "LOTOS:F1", F2 !implementedby "C:F2" !implementedby "LOTOS:F2" end typeSee item 674 in the HISTORY.txt file.
function F called with incorrect profile in instruction: V := F (X -> V1, Z -> V2) no function exists with the requested profile: F (X : T, X : T) : T but other functions exist with the same name and different profiles: F (X : T, Y : T) : TFrom now on, TRAIAN emits clearer error messages:
function F has no value parameter named Z process F has no value parameter named Zor, in the case where function F is overloaded:
no function F has a value parameter named ZSee item 676 in the HISTORY.txt file.
!nat_card 0 ^ TEST.lnt:3: error: "a" is deleted !nat_card 0 ^ TEST.lnt:3: error: "r" is deleted !nat_card 0 ^ TEST.lnt:3: error: "d" is deleted etc.From now on, TRAIAN emits a more intuitive error message:
unknown module pragma !nat_cardSee item 678 in the HISTORY.txt file.
forbidden declaration of predefined channel "any" forbidden declaration of predefined channel "Any" forbidden declaration of predefined channel "ANY"Former versions of TRAIAN tolerated the definition of "Any" or "ANY" but later considered these channels as different from "any". They rejected the definition of "any", but with a cryptic internal error message:
redundant binding for channel anySee item 679 in the HISTORY.txt file.
predefined channel noted "Any" instead of "any" predefined channel noted "ANY" instead of "any"See item 680 in the HISTORY.txt file.
unknown type pragma !enumeratedby unknown function pragma !revertedby unknown process pragma !iterated forbidden pragma !external for constructorSee item 681 in the HISTORY.txt file.
pragma name !ComparedBy contains uppercase charactersSee item 682 in the HISTORY.txt file.
variable X may be uninitializedinto:
variable X is uninitializedwhen TRAIAN is absolutely sure that X is not initialized. See item 683 in the HISTORY.txt file.
variable X is used later (superfluous "use")See item 686 in the HISTORY.txt file.
X is modified in the 1st, 2nd, and 3rd parallel branches but used in the 1st and 3rd parallel brancheswhich were too detailed, since the existence of a write-write conflict is enough to reject the LNT program. From now on, when a "par" operators contains both write-write and read-write conflicts on the same variable, TRAIAN will only display the write-write conflicts, e.g.:
X is modified in the 1st, 2nd, and 3rd parallel branchesSee item 688 in the HISTORY.txt file.
X is modified in the 1st parallel branch but used in the 1st and 2nd parallel branchesThe information that X is both read and written in the 1st branch was not useful. From now on, TRAIAN displays shorter messages such as:
X is modified in the 1st parallel branch but used in the 2nd parallel branchSee item 689 in the HISTORY.txt file.
X is modified in the 1st and 2nd parallel branchesand:
X is modified in the 1st parallel branch but used in the 2nd parallel branchbecome, respectively:
X is modified in the 1st (line 13) and 2nd (line 18) parallel branchesand:
X is modified in the 1st (line 11) parallel branch but used in the 2nd (line 24) parallel branchSee item 690 in the HISTORY.txt file.
function F called with incorrect profile process P called with incorrect profileFrom now on, TRAIAN emits more precise error messages:
function F called with 0 instead of 1 event parameter(s) function F called with 2 instead of 1 value parameter(s) process P called with 1 instead of 2 event parameter(s) process P called with 2 instead of 3 value parameter(s)For overloaded functions, TRAIAN emits slightly different error messages:
function F called with 1 instead of at least 2 event parameter(s) function F called with 4 instead of at most 3 value parameter(s)In all cases, these messages are followed by a detailed explanation about the permitted profiles for the function or process. See item 691 in the HISTORY.txt file.
event E used with incorrect channelFrom now on, TRAIAN emits a more precise message, such as:
event E accessed with 1 instead of 2 parameter(s)If the channel has several profiles, the message emitted by TRAIAN may be slightly different, depending whether there are too few or too many parameters:
event E accessed with 1 instead of at least 2 parameter(s) event E accessed with 5 instead of at most 4 parameter(s)In all cases, these messages are followed by a detailed explanation about the permitted profiles for the event. See item 692 in the HISTORY.txt file.
event E is already accessed (superfluous "access")See item 693 in the HISTORY.txt file.
Nth event parameter of process P has channel C1 instead of C2or:
Nth value parameter of process P has type T1 instead of T2See item 694 in the HISTORY.txt file.
Nth event parameter of function F has channel C1 instead of C2or:
Nth value parameter of function F has type T1 instead of T2See item 696 in the HISTORY.txt file.
event E has non-"raise" channel Cthat TRAIAN emitted when a function was called with an event parameter whose channel is not a "raise" channel (i.e., an exception) was removed. This message was a bit obscure and is now replaced with TRAIAN's default error message when a function is called with an event parameter having the wrong channel. See item 697 in the HISTORY.txt file.
Nth parameter of event E has type T1 instead of T2 required by channel Cinstead of the default (more detailed, but more verbose) error message for incorrect events. See item 698 in the HISTORY.txt file.
variable X not usedemitted when some variable X was assigned by an "eval" and not used later, was removed. Yet, in such case, a warning:
useless assignmentis still displayed for variable X. See item 659 in the HISTORY.txt file.
"pragma !... already present for this function"See item 667 in the HISTORY.txt file.
process P (X: bool, out var Y: bool, out Z: bool) is case X in false -> Y := true | true -> stop end case; Z := Y end processtriggered an error message:
process P may return without assigning "out" parameter YThis issue has been solved by ignoring, when determining whether "out" variables are assigned or not, all "case" branches that do not terminate. See item 684 in the HISTORY.txt file.
For instance, given the following definition:
function F (in out X : nat, Y : nat) is ensure Y == X.in; X := Y end functionTRAIAN no longer display a warning:
"in out" parameter X modified before used (should be an "out var" parameter)Also, given the following definition:
function F (in var X : nat, Y : nat) is ensure X.in > 0; case Y in 0 -> X := 1 | X -> null end case end functionTRAIAN now displays two warnings:
useless assignment to XSee item 700 in the HISTORY.txt file.
For many years, TRAIAN has been used to develop compilers, including those of the CADP toolbox.
At present, TRAIAN is also part of the CADP toolbox, in which it serves to analyze formal specifications of concurrent systems.
We plan to further deepen the co-operation between TRAIAN and the LNT2LOTOS
translator.
TRAIAN 3.15 can be freely downloaded from the TRAIAN Web Page located at: