The CONVECS team is pleased to announce
that version 3.16 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.15 became part of CADP 2024-j, TRAIAN 3.16 beta-5 became part of CADP 2024-k, and TRAIAN 3.16 beta-7 became part of CADP 2024-l.
TRAIAN 3.16 brings five language changes, eight static-semantics changes, four compiler changes, and four bug fixes (see below their description).
forbidden function val in "with" clause of type TSee item 707 in the HISTORY.txt file.
error: modified "in" parameter X forbidden in "ensure" clause (should be an "in var" parameter)See item 711 in the HISTORY.txt file.
type T is X:T' end typeis permitted, and is equivalent to:
type T is X:T' where true end typebut does not trigger the warning mentioned at item #708. Such a type definition introduces a new type T that is identical to the existing type T', except that values of type T and T' are not compatible and cannot be mixed together without explicit type conversions. This is similar to the concept of "derived types" in Ada. See item 716 in the HISTORY.txt file.
Otherwise, TRAIAN now emits warnings to report identifiers used in a module but declared in another module that is not transitively imported or included by M:
channel C is declared in non-imported module M' function F is declared in non-imported module M' process P is declared in non-imported module M' type T is declared in non-imported module M'Each warning is displayed only once, even if the identifier is used multiple times.
Such warnings promote a clearer, DAG-like organization of LNT modules as self-contained collections of definitions. See item 719 in the HISTORY.txt file.
Any module M can now declare processes containing a new "!virtual" pragma. The body of such processes must be empty. The value parameters of virtual processes should not be declared with modes "in var" or "out var", but "in" or "out", respectively. Otherwise, TRAIAN issues the following warnings:
"in var" parameter X of virtual process P should be an "in" parameter "out var" parameter Y of virtual process P should be an "out" parameterEach virtual process can later be instantiated with another "actual" process having the same name and the same profile, i.e., parameters with the same names, types or channels, and modes; however, the "in" and "out" parameters of a virtual processs may be matched by the corresponding "in var" and "out var" parameters of a real process.
This actual process may be defined in a module that is not transitively imported or included by M, and does not trigger any warning (see item #719 above). See item 721 in the HISTORY.txt file.
FILE.lnt:177: error: event Input is not declared FILE.lnt:180: error: event Input is not declared FILE.lnt:178: error: event Input is not declared FILE.lnt:178: error: event actionA is not declared FILE.lnt:178: error: event actionB is not declaredare now displayed in a correct order:
FILE.lnt:177: error: event Input is not declared FILE.lnt:178: error: event Input is not declared FILE.lnt:178: error: event actionA is not declared FILE.lnt:178: error: event actionB is not declared FILE.lnt:180: error: event Input is not declaredSee item 704 in the HISTORY.txt file.
1st event parameter of process P has channel D instead of C 2nd value parameter of function F has type T2 instead of T1 3rd parameter of event E has type T2 instead of T1 required by channel Cas it was unclear whether these messages referred to formal or actual parameters. From now on, TRAIAN displays clearer error messages:
1st event parameter of process P supplied with channel D instead of C 2nd value parameter of function F supplied with type T2 instead of T1 3rd parameter of event E supplied with type T2 instead of T1 required by channel CSee item 705 in the HISTORY.txt file.
FILE.lnt:6: error: event E accessed with incorrect channel in behaviour: E (X -> "false") channel C cannot match the profile: (X : String)now displays as:
FILE.lnt:6: error: 1st parameter X of event E supplied with type String instead of Bool required by channel CAlso, the former error message:
FILE.lnt:9: error: function F called with incorrect profile in pattern: F (X -> 1.0, Y -> 2, Z -> -1) no function exists with the requested profile: F (X : real, Y : NAT|INT, Z : int) : any but other functions exist with the same name and different profiles: F (X : int, Y : int, Z : int) : Point at FILE.lnt:19now displays as:
FILE.lnt:9: error: 1st value parameter X of function F supplied with type real instead of intSimilarly, the former error message:
FILE.lnt:37: error: process P called with incorrect profile in behaviour P [E -> E'] the call uses process profile: P [E : D] but the called process has profile: P [E : C]now displays as:
FILE.lnt:37: error: 1st event parameter E of process P supplied with channel D instead of CSee item 706 in the HISTORY.txt file.
warning: condition always falseor
warning: condition always trueSee item 708 in the HISTORY.txt file.
unknown function get in "with" clause of type T unknown function set in "with" clause of type Twhich could be confusing, since "with get" and "with set" are known clauses. From now on, TRAIAN displays better messages:
forbidden function get in "with" clause of type T forbidden function set in "with" clause of type TSee item 709 in the HISTORY.txt file.
case X var N: NAT in C (N where N < Y, Y) -> return N + Y ... end casetriggers the new warning:
variable Y assigned after being used in "where" conditionSee item 717 in the HISTORY.txt file.
true and false or true true or false == false false == false or true not (true == false) true or B, where B is a Boolean variableThis leads to more warnings. Also, certain LNT programs that were formerly accepted are now rejected, e.g.:
function F (in var X : Int) : Int is while not (false [...] ()) loop X := X - 1 end loop; return X end functionSee item 722 in the HISTORY.txt file.
This modifies the result of the "-depend" option of TRAIAN. For instance, the command:
traian -depend /CADP/demos/demo_38/DES.lntnow displays:
/CADP/lib/lotosnt_predefined.lnt /CADP/demos/demo_38/CONTROLLER.lnt /CADP/demos/demo_38/CHANNELS.lnt /CADP/demos/demo_38/TYPES.lnt /CADP/lib/BIT.lnt /CADP/demos/demo_38/DATA_PATH.lnt /CADP/demos/demo_38/PERMUTATION_FUNCTIONS.lnt /CADP/demos/demo_38/CIPHER.lnt /CADP/demos/demo_38/S_BOX_FUNCTIONS.lnt /CADP/demos/demo_38/KEY_PATH.lntFormerly, the same command would display nothing and stop with the exit code 1, unless it was launched from the directory /CADP/demos/demo_38. In such case, the commands:
cd /CADP/demos/demo_38 traian -depend DES.lntwould display:
/CADP/lib/lotosnt_predefined.lnt CONTROLLER.lnt CHANNELS.lnt TYPES.lnt /CADP/lib/BIT.lnt DATA_PATH.lnt PERMUTATION_FUNCTIONS.lnt CIPHER.lnt S_BOX_FUNCTIONS.lnt KEY_PATH.lntSee item 712 in the HISTORY.txt file.
... traian: - type checking bin.sol64/lotosnt.c:12840: "UNEXPECTED" event raised routine call stack: CHECK_TYPE [check_type.lnt:21] CHECK_TYPE_M1_Mn [check_type.lnt:1108] CHECK_TYPE_P1_Pn [check_type.lnt:1139] CHECK_TYPE_B [check_type.lnt:98] CHECK_TYPE_DDD1_DDDn [check_type.lnt:772] CHECK_TYPE_DD1_DDn [check_type.lnt:756] CHECK_TYPE_D1_Dn [check_type.lnt:729] CHECK_TYPE_D [check_type.lnt:687] SYNTHESIS_D [check_type.lnt:1301] SYNTHESIS_F_CALL [check_type.lnt:1468]See item 703 in the HISTORY.txt file.
function F (X: Bool, Z: T) : Bool is case Z in A | B (X) -> X := not (X) | C (X) -> null end case; return X end functionTRAIAN emitted the warning:
"in" parameter X modified before used (should be a local variable)which was incorrect, since the first branch (with pattern A) of the "case" reads X before assigning it. From now on, TRAIAN displays the following warning:
"in" parameter X modified (should be an "in var" parameter)See item 710 in the HISTORY.txt file.
traian DIR/FILE.lntit would search the libraries included by FILE.lnt (using the "library" clause) in the current directory rather than in directory DIR. See item 723 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.16 can be freely downloaded from the TRAIAN Web Page located at: