ETSI's Bug Tracker - Ext Pack: Advanced Matching (ES 203 022)
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007742 | Ext Pack: Advanced Matching (ES 203 022) | New Feature | public | 25-01-2018 17:03 | 05-01-2019 12:26

Reporter | Jacob Wieland - Spirent |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version | v1.3.1 (ongoing) |
Clause Reference(s) | ?
Source (company - Author) | Spirent - Jacob Wieland
TS version | 1

Summary | 0007742: Allow passing instances of templates with out parameters/value redirects as specially marked actual template in parameters

Description

At the moment, instances of templates with out parameters or inline templates with value redirects are allowed to be used only in a match operation, select case or receive operation template.
They cannot be assigned to variables or returned from a function.
The reason for this is that if that were allowed, it cannot be controlled where the template ends up and whether the variables bound to it are still valid at the point when the template is used for matching.
This restriction should be lessened to allow passing such template instances to template-in-parameters of functions with a special modifier (e.g. @redirect or @match). Such in parameters would be subject to the same restriction as these instances have, i.e. they can be used only for matching or as @match-in-parameters of called functions.
Any template instance using a @match-parameter automatically becomes a redirect template and thus is also limited to these restrictions.

Steps To Reproduce

We had a use-case with a deeply nested template with several decmatch-layers where each layer potentially could contribute redirected values.
At the moment, it is not possible to pass an instance of such a template to a general-purpose function which tries to receive a message matching the template and deal with timeouts or other messages in a different way.
Since that template-instance lives only as long (or shorter) as the variables it uses as its out parameters, there is no harm in such a usage and thus it should be allowed.

Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7742.docx (374,856) 11-10-2018 11:34 http://oldforge.etsi.org/mantis/file_download.php?file_id=3801&type=bug CR7742-v2.docx (427,898) 11-10-2018 15:15 http://oldforge.etsi.org/mantis/file_download.php?file_id=3803&type=bug

Issue History
Date Modified | Username | Field | Change
25-01-2018 17:03 | Jacob Wieland - Spirent | New Issue |
16-07-2018 13:40 | Jens Grabowski | Note Added: 0015129 |
16-07-2018 13:41 | Jens Grabowski | Assigned To | => Jacob Wieland - Spirent
16-07-2018 13:41 | Jens Grabowski | Status | new => assigned
11-10-2018 09:15 | Jacob Wieland - Spirent | Note Added: 0015246 |
11-10-2018 11:34 | Jacob Wieland - Spirent | File Added: CR7742.docx |
11-10-2018 11:36 | Jacob Wieland - Spirent | Note Added: 0015252 |
11-10-2018 11:36 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
11-10-2018 11:36 | Jacob Wieland - Spirent | Status | assigned => confirmed
11-10-2018 15:15 | Tomas Urban | File Added: CR7742-v2.docx |
11-10-2018 15:16 | Tomas Urban | Note Added: 0015257 |
11-10-2018 15:16 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
11-10-2018 16:48 | Jacob Wieland - Spirent | Note Added: 0015261 |
11-10-2018 16:48 | Jacob Wieland - Spirent | Status | confirmed => resolved
11-10-2018 16:48 | Jacob Wieland - Spirent | Resolution | open => fixed
11-10-2018 16:48 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
11-10-2018 16:48 | Jacob Wieland - Spirent | Assigned To | Tomas Urban => Jens Grabowski
11-10-2018 16:48 | Jacob Wieland - Spirent | Status | resolved => feedback
11-10-2018 16:48 | Jacob Wieland - Spirent | Resolution | fixed => reopened
11-10-2018 16:48 | Jacob Wieland - Spirent | Status | feedback => resolved
11-10-2018 16:48 | Jacob Wieland - Spirent | Resolution | reopened => fixed
05-01-2019 12:26 | Gyorgy Rethy | Note Added: 0015320 |
05-01-2019 12:26 | Gyorgy Rethy | Status | resolved => closed
05-01-2019 12:26 | Gyorgy Rethy | Assigned To | Jens Grabowski => Gyorgy Rethy
05-01-2019 12:26 | Gyorgy Rethy | Fixed in Version | => v1.3.1 (ongoing)

Notes

(0015129)
Jens Grabowski
16-07-2018 13:40

STF discussion: Some examples are needed.

(0015246)
Jacob Wieland - Spirent
11-10-2018 09:15

Suppose you have a general purpose function
function f_receiveMessage(template(present) MsgType p_expectedMsg, out MsgType p_result) runs on Mtc return MsgType {
timer t := 5.0;
t.start;
alt {
[] msgPort.receive(p_expectedMsg) -> value p_result { }
[] msgPort.receive { setverdict(fail); }
[] t.timeout { setverdict(inconc); }
}
}
You then have a template with variable assignments of type MsgType
template MsgType mySpecialTemplate(out integer p_deepNestedField) := {
... ... ... ... ? -> p_deepNestedField
... ... ... ...
}
Now, because of the out parameter, it's not possible to call
f_receiveMessage(mySpecialTemplate(v_fieldresult), v_msg)
even though the template instance mySpecialTemplate(v_fieldresult) lives only as long as the function call (and never longer than the scope of v_fieldResult, if it is a local variable because you cannot return such an inline template).
The purpose of the CR is to allow adding a @match modifier in front of parameters and variables so that they are allowed to store templates that can only be used for matching and assignment to variables/parameters that also have the @match modifier and nothing else.
The restriction that templates with out parameters/contained redirect symbols cannot be used as actual parameters can be lessened with the exception that they can be used as in parameters with modifier @match.

(0015252)
Jacob Wieland - Spirent
11-10-2018 11:36

I have uploaded a proposal which both restricts the general passing around of value-retrieval templates (which wasn't done properly before now) and allows special cases when the newly introduced @match modifier is used. Please review

(0015257)
Tomas Urban
11-10-2018 15:16

I made some modifications to the first proposal. Please check.

(0015261)
Jacob Wieland - Spirent
11-10-2018 16:48

Changes are fine. I consider this resolved.

(0015320)
Gyorgy Rethy
05-01-2019 12:26

Added to draft v1.2.2