ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0004270Part 01: TTCN-3 Core LanguageClarificationpublic13-10-2008 13:3409-12-2008 20:08
Thomas Deiß 
Ina Schieferdecker 
normalminorhave not tried
closedfixed 
v3.3.2 (published 2008-04) 
v4.1.1 (published 2009-06)v4.1.1 (published 2009-06) 
6.1.2.1, 6.1.2.2, 6.2.3, 6.2.4, 6.2.7, 6.2.10.1
Nokia Siemens Networks, Thomas Deiß
0004270: Initialization expressions within component types
Component type definitions may contain declarations of ports, timers, constants, and variables. Constants must have an initial value, timers and variables may have an initial value. The only kind of restriction on the expressions for these initial values is the limitation to 'ConstantExpression' in the BNF for the value of constants.

For the default duration of timers and for the initial values of variables no restriction is given, neither in the next, nor in the BNF. When arbitrary expressions are allowed, this raises the question when the expressions are evaluated: at compile time, when 'loading' a module, when starting a test case, or when creating an instance of a component type.

To resolve such questions, it is suggested that any value used in a type definition, is described by a constant expression (see CR2152). Such constant expression always evaluate to the same value.

To each of the clauses for type definitions that contain values
6.1.2.1 Lists of values
6.1.2.2 Ranges
6.2.3 Records and sets of single types
6.2.4 enumerations
6.2.7 Arrays
6.2.10.1 Component types
a restriction should be added that the values have to be defined by constant expressions.
No tags attached.
related to 0002152closed Ina Schieferdecker Initialisation of constants using internal/external functions 
doc CR4270_ConstantsInTypes.doc (59,392) 25-11-2008 12:27
http://oldforge.etsi.org/mantis/file_download.php?file_id=1776&type=bug
doc CR4270_ConstantsInTypes_v2.doc (62,464) 26-11-2008 08:25
http://oldforge.etsi.org/mantis/file_download.php?file_id=1785&type=bug
Issue History
13-10-2008 13:34Thomas DeißNew Issue
13-10-2008 13:34Thomas DeißStatusnew => assigned
13-10-2008 13:34Thomas DeißAssigned To => Ina Schieferdecker
13-10-2008 13:34Thomas DeißClause Reference(s) => 6.1.2.1, 6.1.2.2, 6.2.3, 6.2.4, 6.2.7, 6.2.10.1
13-10-2008 13:34Thomas DeißSource (company - Author) => Nokia Siemens Networks, Thomas Deiß
25-11-2008 10:26Ina SchieferdeckerRelationship addedrelated to 0002152
25-11-2008 11:21Ina SchieferdeckerNote Added: 0007403
25-11-2008 12:27Ina SchieferdeckerFile Added: CR4270_ConstantsInTypes.doc
25-11-2008 12:28Ina SchieferdeckerAssigned ToIna Schieferdecker => Thomas Deiß
25-11-2008 12:28Ina SchieferdeckerResolutionopen => fixed
25-11-2008 12:28Ina SchieferdeckerTarget Version => Edition 4.1.1 (not yet published)
25-11-2008 14:17Gyorgy RethyNote Added: 0007413
26-11-2008 08:25Thomas DeißFile Added: CR4270_ConstantsInTypes_v2.doc
26-11-2008 08:26Thomas DeißNote Added: 0007436
26-11-2008 08:26Thomas DeißAssigned ToThomas Deiß => Ina Schieferdecker
09-12-2008 20:08Ina SchieferdeckerStatusassigned => resolved
09-12-2008 20:08Ina SchieferdeckerFixed in Version => Edition 4.1.1 (not yet published)
09-12-2008 20:08Ina SchieferdeckerStatusresolved => closed

Notes
(0007403)
Ina Schieferdecker   
25-11-2008 11:21   
Indeed in the BNF all relevant grammar rules go down to constant expression or literals:

arrays: singleconstexpr

allowed values: constantexpr

range: singleconstexpr

length: singleconstexpr

enumeration: literal

In addition, the restrictions in clause 10 on the usage of constant expression within imply what is request by this CR - except for initial values within component type definitions - these however do not need to be further restricted.

Some clarifying sentences could be added as it has been done already in CR2152 for arrays ... see uploaded solution.
(0007413)
Gyorgy Rethy   
25-11-2008 14:17   
In clause 6.2.10.1 "Constants used in the constant expressions of type declarations for variables, constants or ports ..." is unclear as formally no types are declared within components. I propose changing it to "Constants used in the constant expressions declaring sizes of variable, constant, port and timer arrays shall follow the restrictions in clause 10 specified for type and array declarations, however..."

I propose not to add ", see in particular restriction c)"; it is sufficient to refer to "restrictions in clause 10" but item c) may change later to other letter while the reference is unchanged in the types clauses.

Fine with me otherwise.
(0007436)
Thomas Deiß   
26-11-2008 08:26   
proposed solution as such is ok.
Solution extended to remove also the restriction that subtypes have to be true subtypes (relevant for value list, pattern subtyping).
v2 uploaded, please crosscheck extension.