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

ID | Project | Category | View Status | Date Submitted | Last Update
0007114 | Part 01: TTCN-3 Core Language | Technical | public | 28-07-2015 13:36 | 10-12-2015 16:04

Reporter | Tomas Urban |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.7.1 (published 2015-06) |
Target Version | v4.8.1 (published 2016-07) | Fixed in Version | v4.8.1 (published 2016-07) |
Clause Reference(s) | 5.4.2
Source (company - Author) | STF 487

Summary | 0007114: Actual parameters of out formal value parameters not defined

Description

In the last version of the standard, the following rule no longer includes out formal value parameters and as a result, the actual parameters of out formal value parameters are no longer defined:
Actual parameters that are passed to inout formal value parameters shall be variables or formal value parameters (of in, inout or out parameterization) or references to elements of variables or formal value parameters of structured types.
Proposal: Restore the original text: Actual parameters that are passed to inout or out formal value parameters shall be variables or formal value parameters (of in, inout or out parameterization) or references to elements of variables or formal value parameters of structured types.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

related to | 0007113 | closed | Gyorgy Rethy | Wording issues in rules on actual values of in formal parameters
related to | 0007118 | closed | Gyorgy Rethy | Not clear when actual parameter passing occurs
related to | 0007119 | closed | Gyorgy Rethy | Out parameter rule inside a note
related to | 0007116 | closed | Gyorgy Rethy | Actual parameters of out formal template parameters
related to | 0007149 | closed | Gyorgy Rethy | Allow to skip actual out parameters
related to | 0007115 | closed | Gyorgy Rethy | Actual parameters of inout formal template parameters

Attached Files

CR7114.docx (216,870) 06-08-2015 16:45
http://oldforge.etsi.org/mantis/file_download.php?file_id=3249&type=bug
CR7114_resolution_v2.docx (221,266) 13-10-2015 15:26
http://oldforge.etsi.org/mantis/file_download.php?file_id=3303&type=bug
CR7114_resolution_v3.docx (222,266) 14-10-2015 11:07
http://oldforge.etsi.org/mantis/file_download.php?file_id=3307&type=bug
CR7114_resolution_v4.docx (222,598) 03-11-2015 10:29
http://oldforge.etsi.org/mantis/file_download.php?file_id=3345&type=bug

Issue History
Date Modified | Username | Field | Change
28-07-2015 13:36 | Tomas Urban | New Issue |
28-07-2015 14:24 | Tomas Urban | Note Added: 0013008 |
03-08-2015 10:56 | Gyorgy Rethy | Note Added: 0013022 |
03-08-2015 10:57 | Gyorgy Rethy | Assigned To | => Jacob Wieland - Spirent
03-08-2015 10:57 | Gyorgy Rethy | Status | new => assigned
03-08-2015 11:01 | Gyorgy Rethy | Relationship added | related to 0007113
04-08-2015 14:10 | Jacob Wieland - Spirent | Note Added: 0013061 |
04-08-2015 14:10 | Jacob Wieland - Spirent | Status | assigned => confirmed
04-08-2015 14:36 | Jacob Wieland - Spirent | Relationship added | related to 0007118
04-08-2015 14:37 | Jacob Wieland - Spirent | Relationship added | related to 0007119
04-08-2015 14:38 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
04-08-2015 14:38 | Jacob Wieland - Spirent | Status | confirmed => assigned
04-08-2015 14:38 | Jacob Wieland - Spirent | Status | assigned => confirmed
04-08-2015 15:20 | Gyorgy Rethy | Note Added: 0013072 |
06-08-2015 09:55 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
06-08-2015 09:55 | Gyorgy Rethy | Status | confirmed => assigned
06-08-2015 10:16 | Gyorgy Rethy | Relationship added | related to 0007116
06-08-2015 13:05 | Jacob Wieland - Spirent | Target Version | => v4.8.1 (published 2016-07)
06-08-2015 16:45 | Jacob Wieland - Spirent | File Added: CR7114.docx |
07-08-2015 09:04 | Jacob Wieland - Spirent | Note Added: 0013123 |
07-08-2015 09:04 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
07-08-2015 09:04 | Jacob Wieland - Spirent | Status | assigned => confirmed
07-08-2015 09:46 | Tomas Urban | Note Added: 0013128 |
10-08-2015 09:16 | Jacob Wieland - Spirent | Note Added: 0013152 |
12-10-2015 14:39 | Gyorgy Rethy | Note Added: 0013355 |
12-10-2015 14:39 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
12-10-2015 14:39 | Gyorgy Rethy | Status | confirmed => assigned
12-10-2015 14:46 | Gyorgy Rethy | Note Edited: 0013355 | bug_revision_view_page.php?bugnote_id=13355#r179
12-10-2015 14:47 | Gyorgy Rethy | Note Edited: 0013355 | bug_revision_view_page.php?bugnote_id=13355#r180
12-10-2015 16:04 | Jacob Wieland - Spirent | Note Added: 0013360 |
12-10-2015 17:21 | Jacob Wieland - Spirent | Note Edited: 0013360 | bug_revision_view_page.php?bugnote_id=13360#r182
13-10-2015 12:25 | Gyorgy Rethy | Relationship added | related to 0007149
13-10-2015 12:26 | Gyorgy Rethy | Relationship deleted | related to 0007149
13-10-2015 12:36 | Gyorgy Rethy | Note Added: 0013367 |
13-10-2015 12:36 | Gyorgy Rethy | Status | assigned => confirmed
13-10-2015 12:39 | Gyorgy Rethy | Relationship added | related to 0007149
13-10-2015 14:54 | Jacob Wieland - Spirent | Note Added: 0013371 |
13-10-2015 15:26 | Jacob Wieland - Spirent | File Added: CR7114_resolution_v2.docx |
13-10-2015 15:31 | Jacob Wieland - Spirent | Note Added: 0013373 |
13-10-2015 15:32 | Jacob Wieland - Spirent | Note Deleted: 0013371 |
13-10-2015 15:32 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent =>
13-10-2015 15:33 | Jacob Wieland - Spirent | Assigned To | => Jacob Wieland - Spirent
13-10-2015 15:33 | Jacob Wieland - Spirent | Status | confirmed => assigned
13-10-2015 15:33 | Jacob Wieland - Spirent | Note Added: 0013374 |
13-10-2015 15:33 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
13-10-2015 15:33 | Jacob Wieland - Spirent | Status | assigned => confirmed
14-10-2015 11:07 | Gyorgy Rethy | File Added: CR7114_resolution_v3.docx |
14-10-2015 11:07 | Gyorgy Rethy | Status | confirmed => resolved
14-10-2015 11:07 | Gyorgy Rethy | Fixed in Version | => v4.8.1 (published 2016-07)
14-10-2015 11:07 | Gyorgy Rethy | Resolution | open => fixed
15-10-2015 12:51 | Jacob Wieland - Spirent | Relationship added | related to 0007115
03-11-2015 10:28 | Gyorgy Rethy | Status | resolved => feedback
03-11-2015 10:29 | Gyorgy Rethy | File Added: CR7114_resolution_v4.docx |
03-11-2015 10:30 | Gyorgy Rethy | Note Added: 0013458 |
03-11-2015 10:30 | Gyorgy Rethy | Status | feedback => resolved
10-12-2015 16:04 | Gyorgy Rethy | Note Added: 0013578 |
10-12-2015 16:04 | Gyorgy Rethy | Status | resolved => closed

Notes

(0013008)
Tomas Urban
28-07-2015 14:24

The original proposal is actually not correct. There's actually a difference between inout and out parameters, because out parameters as assignment target can be template variables as well. Therefore a new rule should be added saying that:
Actual parameters that are passed to out formal value parameters shall be variables, template variables, formal value parameters, formal template parameters or references to elements of variables, template variables, formal value parameters or formal template parameters of structured types.

(0013022)
Gyorgy Rethy
03-08-2015 10:56

STF discussion 03-08-2015: Comment correct. Add rule for out value parameter and check if formal template parameters need separate paragraphs for out and inout parameters.

(0013061)
Jacob Wieland - Spirent
04-08-2015 14:10

please review, this proposal addresses CRS 7113, 7114, 7118, 7119

(0013072)
Gyorgy Rethy
04-08-2015 15:20

Jacob, pls. upload the file :-)

(0013123)
Jacob Wieland - Spirent
07-08-2015 09:04

done, please review

(0013128)
Tomas Urban
07-08-2015 09:46

I like the proposed solution, it solves the issues raised in this CR and 7113, 7116, 7119.
However, there still several things for discussion:
1. The problem described in CR 7118 doesn't seem to be addressed.
2. I would prefer to use a different expression than the term "applications of value returning functions", mostly because the term is not consistent with the terminology used in the current specification (invocation of functions, function call).
3. I propose to move the proposed rules that concern template restrictions from the restriction d to the restriction e so that all rules related to template restriction are in one paragraph.

(0013152)
Jacob Wieland - Spirent
10-08-2015 09:16

CR 7118 is addressed in the definitions section for out parameterization by the following:
"content of the formal parameter is passed back to the evaluation of the actual parameter at the time of the invocation of the parameterized object"
We probably need a better description than "evaluation of the actual parameter" for out parameters as the variable reference that the actual parameter expression evaluates to is meant here and not its content.

(0013355)
Gyorgy Rethy
12-10-2015 14:39 (edited on: 12-10-2015 14:47)

Reading the whole sentence it tends to become hardly readable. I make a try to rewording it:
out parameterization: kind of parameterization by value, where the actual parameter's content (the argument) is not passed to the formal parameter when the parameterized object is invoked, but the content of the formal parameter is passed back to the actual parameter when the invoked object completes, if the formal parameter has been initialized during the invocation. The actual parameter is the object evaluated at the time of the invocation.
If the "by value" in the first line is acceptable, we do not need note 1.
I also propose to add Tomas's example to clause 5.4.2, it would clarify what the last sentence refers to.
I don't agree with the new clause in 5.4.2, semantic desription: template variables (formal parameters etc.) shall not be passed to a *value* formal parameter.
Why value variables, formal parameters etc. are not allowed to be passed to template formal parameters? (clauses 5 and 6 of 5.4.2, semantic desription)

(0013360)
Jacob Wieland - Spirent
12-10-2015 16:04 (edited on: 12-10-2015 17:21)

The reason is the contravariance of out parameters. For an out parameter, the formal parameter type must be assignment-compatible to the actual parameter type (the reverse as for in parameters which are co-variant, where the actual parameter type must be assignment-compatible to the formal parameter type).
If a template formal parameter could take a value-actual parameter, this would violate the rule that a value cannot be assigned a template without using valueof (and thus, back-assignment would need an implicit valueof and could fail, if the out parameter was assigned a non-value template).
Likewise, it is no problem to pass a template actual parameter (variable) to an out-value-formal parameter, as an assignment of a value to a template is always allowed (all values are automatically templates).
The rules as they are in the proposal reflect exactly this contravariance.

(0013367)
Gyorgy Rethy
13-10-2015 12:36

Jacob, regarding (template) actual pars for out formal parameters you are rigth. Please check the proposed text for the definition (in my previous comment and add to the resolution file if you agree. I think that in the new example swapping the order of e := v; and i := i + 1; would better demontrate that the index value of v_roi[i] doesn't change by changing i within the called function.

(0013373)
Jacob Wieland - Spirent
13-10-2015 15:31

I have changed 'object evaluated' to 'variable reference evaluated' as I thought this was slightly less ambiguous (though I'm still not 100% happy with it as "evaluated" still suggests reading the content of the variable).
What I would like to express is that the "expression describing the variable that the out-parameter result shall be assigned to is resolved to a variable before the invocation takes place". But since expression has a different meaning in the standard, I'm at a loss for words. Also, this is rather unwieldy. Anyway.
I have also changed the example as you have asked.

(0013374)
Jacob Wieland - Spirent
13-10-2015 15:33

pls review again and close

(0013458)
Gyorgy Rethy
03-11-2015 10:30

CR7114_resolution_v4.docx: minor editorials in 5.4.2 in parameterization.

(0013578)
Gyorgy Rethy
10-12-2015 16:04

Added to draft V4.7.4