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

ID | Project | Category | View Status | Date Submitted | Last Update
0006429 | Part 01: TTCN-3 Core Language | Clarification | public | 27-02-2013 15:52 | 04-01-2015 20:06

Reporter | Jacob Wieland - Spirent |
Assigned To | Gyorgy Rethy |
Priority | urgent | Severity | major | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.5.1 (published 2013-04) |
Target Version | v4.7.1 (published 2015-06) | Fixed in Version | v4.7.1 (published 2015-06) |
Clause Reference(s) | Section 15.5.
Source (company - Author) | Testing Technologies - Jacob Wieland

Summary | 0006429: modifies of 'record of' fields still seems to be ambiguous

Description

Having a record type with a record of field
type record R {
record of record {
integer a,
integer b
} list
}
and a template of that type
template R r1 := {
list := {
{
a := 1,
b := 2
},
{
a := 3,
b := 4
}
}
}
the question arises what the meaning of the following modified template is:
template R r2 modifies r1 := {
list := {
{
a := 0
}
}
}
Because the standard says that matching mechanisms in fields are replaced (unless inside records), I think the correct interpretation of this would be
error or partially defined template, as the { { a := 0 } } tries to replace the whole { { a := 1, b := 2 }, { a := 3, b := 4 } } list (and because b is not optional).
To get the desired result of just replacing the a-field in element 0, the correct syntax would be
template R r2 modifies r1 := {
list := {
[0] := {
a := 0
}
}
}
Unfortunately, the standard only "allows" this with a "may" clause but does not explicitly state that this is the only way of doing this, thus making people think that using partially defined list-notation to partially modify some elements of the original would also be okay.
But, if the replacement-syntax also is interpreted as an by-element-modification syntax (as some people seem to interpret the standard), then
there is no possibility of writing down a modification of the whole list-field with a totally different list that is shorter than the original.
If the replacement is equally long or longer, there is of course no problem as then all existing fields are overwritten anyway. But how can one get rid of superfluous elements at the end? In my opinion, this would not be possible, if the list notation can be used for modification instead of replacement.
If allowing the list notation for modification, then it should be clarified that the length of the resulting list is the length of the list notation in the modifying template (i.e. all trailing unchanged elements that shall be kept in the list need to be specified with the unchanged symbol explicitly).
Then, we would have a clear distinction between
template R r2 modifies r1 := {
list := {
{
a := 0
}
}
}
and
template R r3 modified r1 := {
list := {
{
a := 0
},
-
}
}
The r3 template would keep the second element of the list, the r2 template would delete it. Both would modify the first element.
This solution would be especially beneficial as it seems to be consistent with the record-of-modification-interpretation of the standard people have and thus would not create backward compatibility issues with the tools employing this interpretation. Only the tools not accepting this interpretation at the moment would need to be changed to allow it.

Steps To Reproduce |
Additional Information | The problem came up in STF 160 in the context of the LTE test suite.
Tags | No tags attached.

Relationships

related to | 0006411 | closed | Gyorgy Rethy | Example to clarify Modified Template semantics

Attached Files | draft-res-6429.docx (25,579) 07-10-2014 11:21 http://oldforge.etsi.org/mantis/file_download.php?file_id=3094&type=bug draft-res-6429-V2.docx (20,735) 08-10-2014 10:58 http://oldforge.etsi.org/mantis/file_download.php?file_id=3108&type=bug

Issue History
Date Modified | Username | Field | Change
27-02-2013 15:52 | Jacob Wieland - Spirent | New Issue |
27-02-2013 15:52 | Jacob Wieland - Spirent | Clause Reference(s) | => Section 15.5.
27-02-2013 15:52 | Jacob Wieland - Spirent | Source (company - Author) | => Testing Technologies - Jacob Wieland
08-07-2013 15:32 | Jens Grabowski | Status | new => assigned
08-07-2013 15:32 | Jens Grabowski | Assigned To | => Gyorgy Rethy
08-07-2013 15:51 | Jens Grabowski | Relationship added | related to 0006411
08-07-2013 18:09 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
08-07-2013 18:13 | Gyorgy Rethy | Target Version | => v4.6.1 (published 2014-06)
26-08-2013 11:25 | Gyorgy Rethy | Note Added: 0011590 |
26-08-2013 13:36 | Jacob Wieland - Spirent | Note Added: 0011595 |
28-08-2013 10:44 | Gyorgy Rethy | Note Added: 0011617 |
28-08-2013 10:47 | Gyorgy Rethy | Note Added: 0011618 |
28-08-2013 10:47 | Gyorgy Rethy | Status | assigned => closed
28-08-2013 10:47 | Gyorgy Rethy | Resolution | open => fixed
28-08-2013 10:47 | Gyorgy Rethy | Fixed in Version | => v4.6.1 (published 2014-06)
19-06-2014 14:30 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Axel Rennoch
19-06-2014 14:30 | Gyorgy Rethy | Status | closed => assigned
20-06-2014 11:39 | Gyorgy Rethy | Product Version | => v4.5.1 (published 2013-04)
20-06-2014 11:39 | Gyorgy Rethy | Target Version | v4.6.1 (published 2014-06) => v4.7.1 (published 2015-06)
27-06-2014 13:43 | Gyorgy Rethy | Priority | normal => urgent
07-10-2014 11:21 | Axel Rennoch | File Added: draft-res-6429.docx |
07-10-2014 11:23 | Axel Rennoch | Note Added: 0012251 |
07-10-2014 11:24 | Axel Rennoch | Assigned To | Axel Rennoch => Gyorgy Rethy
07-10-2014 11:24 | Axel Rennoch | Status | assigned => confirmed
08-10-2014 07:53 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jens Grabowski
08-10-2014 10:58 | Jens Grabowski | File Added: draft-res-6429-V2.docx |
08-10-2014 10:58 | Jens Grabowski | Note Added: 0012274 |
08-10-2014 10:58 | Jens Grabowski | Assigned To | Jens Grabowski => Gyorgy Rethy
08-10-2014 10:58 | Jens Grabowski | Status | confirmed => assigned
08-10-2014 10:59 | Jens Grabowski | Status | assigned => resolved
04-01-2015 20:06 | Gyorgy Rethy | Note Added: 0012608 |
04-01-2015 20:06 | Gyorgy Rethy | Status | resolved => closed
04-01-2015 20:06 | Gyorgy Rethy | Fixed in Version | v4.6.1 (published 2014-06) => v4.7.1 (published 2015-06)

Notes

(0011590)
Gyorgy Rethy
26-08-2013 11:25

I think the example first_r2 is more tricky: I agree, that a complete record_of (i.e. not using the index notation) shall replace the complete record_of of the parent. But the first element is a record, where a:=0 replaces field "a" of the parent, but field b remains unchanged. Hence first_r2 should be {{a:=0, b:=2}}. Otherwise we are in conflict with the general rule of modifying records.
To avoid split the discussion over the two related CRs (6411 and 6429), I switch to 6411 now and let further discuss further the topic at that CR.

(0011595)
Jacob Wieland - Spirent
26-08-2013 13:36

Isn't that exactly what I have proposed?

(0011617)
Gyorgy Rethy
28-08-2013 10:44

In that case we are on the same side. Anyway we have agreed at the STF discussion yesterday (see note to CR6411) :-)

(0011618)
Gyorgy Rethy
28-08-2013 10:47

This CR is closed, because it is merged with CR6411, pls. find the discussion and resolution at that CR.

(0012251)
Axel Rennoch
07-10-2014 11:23

clarifications added regarding list notation for modification, following the "solution" proposed by Jacob

(0012274)
Jens Grabowski
08-10-2014 10:58

changed cp. to cf.

(0012608)
Gyorgy Rethy
04-01-2015 20:06

Added to draft V4.6.3