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

ID | Project | Category | View Status | Date Submitted | Last Update
0003946 | Part 01: TTCN-3 Core Language | Technical | public | 11-08-2008 11:46 | 09-12-2008 14:36

Reporter | Gyorgy Rethy |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | always
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.1.1 (published 2009-06) | Fixed in Version | v4.1.1 (published 2009-06) |
Clause Reference(s) | L.M.Ericsson
Source (company - Author) |

Summary | 0003946: Harmonize the semantics of assignments and parameterization

Description

The definition of out formal parameters says:
" kind of parameterization where the value of the actual parameter (the argument) is not bound to the formal parameter when the parameterized object is invoked, but the value of the formal parameter is passed back to the actual parameter when the invoked object completes
...
NOTE 2: An out formal parameter is uninitialized (unbound) when the invoked object is entered."
Therefore, if no value is assigned to the out formal parameter, it should make the content of the actual parameter uninitialized.
On the other hand, note 1 of 5.4.1 says:
"NOTE 1: Although out parameters can be read within the parameterized object, they do not inherit the value of their actual parameter; i.e. they should be set before they are read."
There are two observations regarding this:
1) Writing back the content of the out parameter to the actual parameter can be considered as reading the parameter
2) Writing back the content of the out parameter is a kind of assignment; thus the two semantics should be harmonized (no unbound value is allowed on the right hand side of assignments); except language consistency this would simplify the language
3) In TTCN-3 an already initialized variable should never be done uninitialized again, as this is increasing the probability of test case errors.
Clarify the semantics of out formal parameters.

Steps To Reproduce |

Additional Information

In practical terms the only possible use of out parameterization is identical to inout parameterization plus new value assignment.
EXAMPLE 1:
function f(out integer p_int) runs oc Comp_CT {
//trying to use p_int inside the function before initializition would
//lead to an error (except passing on as actual parameter to an inout
//or our parameter of another function, but this just shifts the problem
p_int := 5;
v_compVar := 2*5;
}
This results the same behaviour as:
function f1(inout integer p_int) runs oc Comp_CT {
p_int := 5;
v_compVar := 2*5;
}
EXAMPLE 2:
function f2(out integer p_int) runs oc Comp_CT {
//p_int left unitialized
}
function f3(){
var integer vl_int := 5;//initializetion here does not change the example;
f2(vl_int);
//at this point vl_int should be uninitialized; hence it shall be intialized (again) before using it in an expression
vl_int := 10;
...
}
This results the same behaviour as:
function f4(inout integer p_int) runs oc Comp_CT {
//p_int left unchanged
}
function f3(){
var integer vl_int := 5;//initializetion here does not change the example;
f2(vl_int);
vl_int := 10;
...
}

Tags | No tags attached.
Relationships |
Attached Files | CR3946_OutParameterization.doc (24,576) 28-11-2008 08:24 http://oldforge.etsi.org/mantis/file_download.php?file_id=1828&type=bug CR3946_OutParameterization v2.doc (24,576) 28-11-2008 10:21 http://oldforge.etsi.org/mantis/file_download.php?file_id=1833&type=bug

Issue History
Date Modified | Username | Field | Change
11-08-2008 11:46 | Gyorgy Rethy | New Issue |
11-08-2008 11:46 | Gyorgy Rethy | Status | new => assigned
11-08-2008 11:46 | Gyorgy Rethy | Assigned To | => Ina Schieferdecker
11-08-2008 11:46 | Gyorgy Rethy | Clause Reference(s) | => L.M.Ericsson
11-08-2008 11:46 | Gyorgy Rethy | Source (company - Author) | =>
11-08-2008 12:12 | Gyorgy Rethy | Description Updated |
17-08-2008 09:11 | Ina Schieferdecker | Target Version | => Edition 4.1.1 (not yet published)
28-11-2008 08:24 | Ina Schieferdecker | File Added: CR3946_OutParameterization.doc |
28-11-2008 08:24 | Ina Schieferdecker | Assigned To | Ina Schieferdecker => Gyorgy Rethy
28-11-2008 08:24 | Ina Schieferdecker | Resolution | open => fixed
28-11-2008 10:21 | Gyorgy Rethy | File Added: CR3946_OutParameterization v2.doc |
28-11-2008 10:21 | Gyorgy Rethy | Note Added: 0007497 |
28-11-2008 10:22 | Gyorgy Rethy | Note Edited: 0007497 |
28-11-2008 10:22 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Ina Schieferdecker
09-12-2008 14:36 | Ina Schieferdecker | Status | assigned => resolved
09-12-2008 14:36 | Ina Schieferdecker | Fixed in Version | => Edition 4.1.1 (not yet published)
09-12-2008 14:36 | Ina Schieferdecker | Status | resolved => closed

Notes

(0007497)
Gyorgy Rethy
28-11-2008 10:21 (edited on: 28-11-2008 10:22)

Just minor editorial changes. OK with me. From my side it is OK to be implemented.