Logo etsi

ETSI's Bug Tracker

Notice: information submitted on the ETSI issue Tracker may be incorporated in ETSI publication(s) and therefore subject to the ETSI IPR policy.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002152Part 01: TTCN-3 Core LanguageClarificationpublic15-10-2007 13:4409-12-2008 16:29
ReporterGyorgy Rethy 
Assigned ToIna Schieferdecker 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Versionv4.1.1 (published 2009-06)Fixed in Versionv4.1.1 (published 2009-06) 
Summary0002152: Initialisation of constants using internal/external functions
DescriptionAccording to the current version of the TTCN-3 spec, functions are not allowed for initialisation of constants. Nevertheless some compilers allow even external functions. On the other hand at least build-in functions seem to be useful within constant definitions (e.g. to initialise long bitstrings with ‘0’). Also the usage of TTCN-3 functions considering restrictions according to clause 16.1.4 “Restrictions for functions called from specific places” seem to be suitable.
Anyway it would be helpful to give examples of constant definitions to illustrate what shall be allowed and what is not allowed.
Compilers should generate at least a warning, when a constant declaration contains not allowed parts.
Additional InformationThe TTCN-3 standard core language is stating that the constant value shall be known at compile time. While this may be a clear requirement for compiler experts, may not be sufficient for most of the users. It shall explicitly be stated that in constant expressions only the following elements are allowed:
• literal values,
• constants,
• predefined conversion functions (int2unichar, int2bit, int2hex, int2oct, int2str, int2float, float2int, char2int, char2oct, unichar2int, bit2int, bit2hex, bit2oct, bit2str, hex2int, hex2bit, hex2oct, hex2str, oct2int, oct2bit, oct2hex, oct2str, oct2char, str2int, str2oct, str2float), provided all their parameters are either literal values or constants;
• predefined functions lengthof, sizeof, ispresent, ischosen, regexp, substr, replace and (decomp) provided their parameters are either literal values or constants.

Thus, the predefined functions rnd and sizeoftype are not allowed. In principle, valueof could be considered BUT we think the gained feature does NOT pays of the complexity of the implementation (valueof non-parameterized templates that are using at maximum the above predefined functions and other non-parameterized templates or templates parameterized with literal or constant values and again using…).
TagsNo tags attached.
Clause Reference(s)$10
Source (company - Author)     
Attached Filesdoc file icon CR2152_SolutionOutline.doc [^] (39,424 bytes) 13-03-2008 15:02
zip file icon es_20187301v040100_CR2152.zip [^] (874,214 bytes) 13-03-2008 15:06
zip file icon es_20187301v040000_CR2152_v2.zip [^] (875,567 bytes) 25-04-2008 13:06
zip file icon es_20187301v040000_CR2152_v3.zip [^] (874,114 bytes) 14-08-2008 13:46
zip file icon es_20187301v040000_CR2152_v4.zip [^] (851,675 bytes) 14-08-2008 15:24
zip file icon es_20187301v040000_CR2152_v5.zip [^] (878,202 bytes) 17-08-2008 10:01
zip file icon es_20187301v040000_CR2152_v6.zip [^] (859,685 bytes) 25-11-2008 13:51
zip file icon es_20187301v040000_CR2152_v7.zip [^] (881,332 bytes) 26-11-2008 08:59

- Relationships
related to 0004270closedIna Schieferdecker Initialization expressions within component types 

-  Notes
(0004226)
Jens Grabowski (manager)
03-12-2007 12:28

Cannot be fixed in Version 3.3.1. Either test suites are invalidated or requires major changes in part 1 and part 4.
(0005580)
Ina Schieferdecker (reporter)
25-04-2008 13:05

We propose to ease the constant handling by making constants run-time constants in general and to impose compile-time constant limitations only for those constants which are used in type definitions.
(0006530)
Ina Schieferdecker (reporter)
14-08-2008 13:47

One more run through the resolution: the external contant BNF productions have to be kept - external constants are deprecated only.
(0006536)
Gyorgy Rethy (reporter)
14-08-2008 15:30

There are some changes of the wording in ~v4, to be cross-checked.
(0006540)
Ina Schieferdecker (reporter)
15-08-2008 09:22
edited on: 17-08-2008 10:00

See resolution v5:

Extended sentence for clause 6.2.7 Arrays: "Constants used in the constant expressions shall meet with the restrictions in clause 10, see in particular restriction c)"

Restr. g in 8.2.1: "g) Module parameters shall not be used in type or array definitions."

Constant explaination in 10: "A value is assigned only once to a constant, which does not change its value during test execution."

(0006834)
Thomas Deiß (reporter)
18-09-2008 04:06

clause 10, restriction b) The value of the ConstantExpression assigned to a constant shall be of the same type as the stated type for the constants.

Isn't this too strict? Compatibility of the value with the type of the constant would be sufficient.
(0007411)
Gyorgy Rethy (reporter)
25-11-2008 13:50

Deleted "dynamic" from 1st sentence of clause 10. Added, that constants shall be initialized at declaration to the "semantic description". BNF rule 576: static semantic rule is removed. My changes are in es_20187301v040000_CR2152_v6.zip. Otherwise OK with me.
(0007438)
Thomas Deiß (reporter)
26-11-2008 09:00

one typo found.
restriction that expression to initialize constant has to be of the same type removed. This is obvious.
v7 uploaded.
(0007470)
Thomas Deiß (reporter)
27-11-2008 13:26

Clause 6.2.1 contains the following sentence (end of first paragraph)

"A constant that is of record type shall contain no variables or module parameters as field values, either directly or indirectly."

This will be too strict. How a constant can be initialized will be defined anyway. This specific sentence can be removed.

- Issue History
Date Modified Username Field Change
15-10-2007 13:44 Gyorgy Rethy New Issue
15-10-2007 13:44 Gyorgy Rethy Status new => assigned
15-10-2007 13:44 Gyorgy Rethy Assigned To => Gyorgy Rethy
15-10-2007 13:44 Gyorgy Rethy Clause Reference(s) => $10
15-10-2007 13:44 Gyorgy Rethy Source (company - Author) =>
15-10-2007 19:36 Ina Schieferdecker Assigned To Gyorgy Rethy => developer_u
17-10-2007 12:42 user10 Assigned To developer_u => Thomas Deiß
18-10-2007 13:44 Ina Schieferdecker Project TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
18-10-2007 13:57 Ina Schieferdecker Target Version => Edition 3.3.1 (not yet published)
03-12-2007 12:28 Jens Grabowski Note Added: 0004226
03-12-2007 12:29 Jens Grabowski Target Version Edition 3.3.1 (not yet published) => Edition 4.1.1 (not yet published)
12-03-2008 14:45 Ina Schieferdecker Assigned To Thomas Deiß => Ina Schieferdecker
13-03-2008 15:02 Ina Schieferdecker File Added: CR2152_SolutionOutline.doc
13-03-2008 15:06 Ina Schieferdecker File Added: es_20187301v040100_CR2152.zip
13-03-2008 15:06 Ina Schieferdecker Assigned To Ina Schieferdecker => Thomas Deiß
21-04-2008 08:51 Ina Schieferdecker Target Version Edition 4.1.1 (not yet published) => Edition 3.4.1 (not yet published)
25-04-2008 13:05 Ina Schieferdecker Note Added: 0005580
25-04-2008 13:06 Ina Schieferdecker File Added: es_20187301v040000_CR2152_v2.zip
25-04-2008 13:07 Ina Schieferdecker Target Version Edition 3.4.1 (not yet published) => Edition 4.1.1 (not yet published)
25-04-2008 13:07 Ina Schieferdecker Assigned To Thomas Deiß => Gyorgy Rethy
14-08-2008 13:46 Ina Schieferdecker File Added: es_20187301v040000_CR2152_v3.zip
14-08-2008 13:47 Ina Schieferdecker Note Added: 0006530
14-08-2008 15:24 Gyorgy Rethy File Added: es_20187301v040000_CR2152_v4.zip
14-08-2008 15:30 Gyorgy Rethy Note Added: 0006536
14-08-2008 15:30 Gyorgy Rethy Assigned To Gyorgy Rethy => Ina Schieferdecker
15-08-2008 09:22 Ina Schieferdecker Note Added: 0006540
15-08-2008 09:22 Ina Schieferdecker Status assigned => resolved
15-08-2008 09:22 Ina Schieferdecker Resolution open => fixed
15-08-2008 09:22 Ina Schieferdecker Fixed in Version => Edition 4.1.1 (not yet published)
17-08-2008 10:00 Ina Schieferdecker Note Edited: 0006540
17-08-2008 10:01 Ina Schieferdecker File Added: es_20187301v040000_CR2152_v5.zip
17-08-2008 10:02 Ina Schieferdecker Assigned To Ina Schieferdecker => Gyorgy Rethy
17-08-2008 10:02 Ina Schieferdecker Status resolved => assigned
18-09-2008 04:06 Thomas Deiß Note Added: 0006834
25-11-2008 10:26 Ina Schieferdecker Relationship added related to 0004270
25-11-2008 13:50 Gyorgy Rethy Note Added: 0007411
25-11-2008 13:51 Gyorgy Rethy File Added: es_20187301v040000_CR2152_v6.zip
25-11-2008 13:51 Gyorgy Rethy Assigned To Gyorgy Rethy => Ina Schieferdecker
26-11-2008 08:58 Thomas Deiß File Added: CR4270_ConstantsInTypes_v2.doc
26-11-2008 08:58 Thomas Deiß File Deleted: CR4270_ConstantsInTypes_v2.doc
26-11-2008 08:59 Thomas Deiß File Added: es_20187301v040000_CR2152_v7.zip
26-11-2008 09:00 Thomas Deiß Note Added: 0007438
27-11-2008 13:26 Thomas Deiß Note Added: 0007470
09-12-2008 16:28 Ina Schieferdecker Status assigned => resolved
09-12-2008 16:29 Ina Schieferdecker Status resolved => closed


MantisBT 1.2.14 [^]
Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker