ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0005490 | Part 01: TTCN-3 Core Language | Clarification | public | 23-03-2010 08:42 | 30-04-2010 10:48

Reporter | Jacob Wieland - Spirent |
Assigned To | Ina Schieferdecker |
Priority | high | Severity | major | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.2.1 (published 2010-07) | Fixed in Version | v4.2.1 (published 2010-07) |
Clause Reference(s) | 5.4
Source (company - Author) | Testing Technologies

Summary | 0005490: Actual Parameter Lists for Templates with Formal Parameter List should be mandatory

Description

Templates are the only entities which can be defined with or without a formal parameter list. Thus, the BNF allows template instances with and without actual parameter lists.
It should be clarified that a template instance of a template with a formal parameter list NEEDS an actual parameter list, even if all formal parameters have a default value (i.e. if the parameter list can remain empty).

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | Resolution-Jens-CR5490.zip (30,708) 25-03-2010 12:22 http://oldforge.etsi.org/mantis/file_download.php?file_id=2366&type=bug

Issue History
Date Modified | Username | Field | Change
23-03-2010 08:42 | Jacob Wieland - Spirent | New Issue |
23-03-2010 08:42 | Jacob Wieland - Spirent | Clause Reference(s) | => 5.4
23-03-2010 08:42 | Jacob Wieland - Spirent | Source (company - Author) | => Testing Technologies
23-03-2010 12:34 | Gyorgy Rethy | Note Added: 0009255 |
23-03-2010 12:34 | Gyorgy Rethy | Assigned To | => Jens Grabowski
23-03-2010 12:34 | Gyorgy Rethy | Status | new => assigned
23-03-2010 12:34 | Gyorgy Rethy | Target Version | => Edition 4.2.1 (not yet published)
23-03-2010 12:34 | Gyorgy Rethy | Note Edited: 0009255 |
23-03-2010 14:19 | Gyorgy Rethy | Priority | normal => high
23-03-2010 15:31 | Jacob Wieland - Spirent | Note Added: 0009264 |
25-03-2010 11:35 | Jens Grabowski | Note Added: 0009305 |
25-03-2010 12:22 | Jens Grabowski | File Added: Resolution-Jens-CR5490.zip |
25-03-2010 12:24 | Jens Grabowski | Assigned To | Jens Grabowski => Ina Schieferdecker
25-03-2010 15:11 | Jacob Wieland - Spirent | Note Added: 0009312 |
25-03-2010 15:21 | Gyorgy Rethy | Note Added: 0009313 |
25-03-2010 15:27 | Gyorgy Rethy | Status | assigned => resolved
25-03-2010 15:27 | Gyorgy Rethy | Resolution | open => fixed
25-03-2010 15:57 | Ina Schieferdecker | Note Added: 0009317 |
25-03-2010 15:57 | Ina Schieferdecker | Status | resolved => closed
25-03-2010 15:57 | Ina Schieferdecker | Fixed in Version | => Edition 4.2.1 (not yet published)
11-04-2010 15:42 | Ina Schieferdecker | Status | closed => feedback
11-04-2010 15:42 | Ina Schieferdecker | Resolution | fixed => reopened
11-04-2010 15:42 | Ina Schieferdecker | Note Added: 0009327 |
14-04-2010 09:10 | Ina Schieferdecker | Note Added: 0009330 |
15-04-2010 16:53 | Gyorgy Rethy | Note Added: 0009331 |
15-04-2010 16:54 | Gyorgy Rethy | Note Edited: 0009331 |
30-04-2010 10:47 | Ina Schieferdecker | Note Added: 0009345 |
30-04-2010 10:48 | Ina Schieferdecker | Status | feedback => closed
30-04-2010 10:48 | Ina Schieferdecker | Resolution | reopened => fixed

Notes

(0009255)
Gyorgy Rethy
23-03-2010 12:34

In the proposed solution take into account also the original purpose of formal paramaters with default values: make a library code extendable without the need to touch the library-user code.

(0009264)
Jacob Wieland - Spirent
23-03-2010 15:31

If the ibrary is updated, and a parameter-less template shall be parameterized with formal parameters which all have default values (which is the only case in which no updating of the using code is necessary),
the following simple work-around works without change to existing using code:
template T <oldName> := <oldRHS>
is changed to:
template T <newName>(<new formal parameters with default values>) := <newRHS>
template T <oldName> := <newName>(); // <newName>() must resolve to <oldRHS>
That way, the requirement that all entities with formal parameters are also instantiated with actual parameters is met and the requirement that the template-using code is not broken also.
Since the solution is simple, an unnecessary complication of the type-inference algorithm and therefore additional unnecessary workload for the static checking can be avoided. The only drawback/burden for the implementor of the library is the introduction of a new name (which, given that the new template has a new semantics, is probably a good idea anyway, otherwise, it could lead to confusion for the user of the library who does not expect the semantics of the used entities to change from one version to another).

(0009305)
Jens Grabowski
25-03-2010 11:35

Unfortunately, this ambiguity of the standard has already extensively used by TTCN-3 users (e.g., ETSI STF 160). Therefore, mandatory empty brackets for instances of parameterized templates when no actual parameters are provided (i.e. all formal parameters use their default values) lead to problems. The proposed workaround was also not accepted.
As a consequence, the STF decided to make the empty brackets for the case above explicitly optional. A corresponding sentence will be added in the standard. See resolution in the attachment.

(0009312)
Jacob Wieland - Spirent
25-03-2010 15:11

I would change the sentence to: The empty brackets for instances of parameterized templates that have only parameters with default values are optional when no actual parameters are provided, i.e. all formal parameters use their default values.

(0009313)
Gyorgy Rethy
25-03-2010 15:21

I propose to add the sentence to the actual parameters clause instead of the formal parameter clause: - it has, in fact, not much to do with the formalparameters - everyone will search it in the actual parameter lists clause (me for sure after a few months)

(0009317)
Ina Schieferdecker
25-03-2010 15:57

Put into 5.4.2 Actual parameters

(0009327)
Ina Schieferdecker
11-04-2010 15:42

Andrus Lehmets, Elvior:
we found that there is still little mismatch in latest core language specification chapter 5.4.2 and BNF.
5.4.2 says
The empty brackets for instances of parameterized templates that have only parameters with default values are optional when no actual parameters are provided, i.e. all formal parameters use their default values.
this means that you can use template with parameters without brackets or template with empty brackets ().
But BNF does not allow empty brackets for templates:
TemplateActualParList ::= "(" ( TemplateActualPar {"," TemplateActualPar}) |
( TemplateActualParAssignment {"," TemplateActualParAssignment })")"
And if there is mismatch between explanation and BNF, then BNF is the correct one.
BR,
Andrus

(0009330)
Ina Schieferdecker
14-04-2010 09:10

BNF rule 157 has to be changed to TemplateActualParList ::= "(" [( TemplateActualPar {"," TemplateActualPar}) | ( TemplateActualParAssignment {"," TemplateActualParAssignment })] ")"

(0009331)
Gyorgy Rethy
15-04-2010 16:53 (edited on: 15-04-2010 16:54)

Elvior has ACK-ed that he agrees with the proposed BNF solution on the MTS mailing list, therefore if no comment is received untill 19th April, I propose to implement the proposed BNF change, close the CR, upload an updated version to MTS's drafts area and notify MTS-GEN about the availability of the new version.

(0009345)
Ina Schieferdecker
30-04-2010 10:47

Implemented in V.4.2.1 as agreed in AbC