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

ID | Project | Category | View Status | Date Submitted | Last Update
0008067 | Part 01: TTCN-3 Core Language | Technical | public | 08-11-2021 13:14 | 20-12-2021 09:57

Reporter | Tomas Urban |
Assigned To | Jens Grabowski |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version |  |
Clause Reference(s) | 15.10
Source (company - Author) | TTF T014

Summary | 0008067: Postfix value notation for templates
Description | The valueof operation could be extended and support the following the features: - it converts patterns into their textual representation: valueof (pattern "a?b") would yield "a?b" - it removes matching attributes if the matching symbol that contains these attributes can be converted into a value: valueof ("abc" ifpresent) would yield "abc"
Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

related to | 0008006 | closed | Jens Grabowski | Unnecessary Restriction 15.6.1 should be removed.
related to | 0008032 | closed | Jens Grabowski | BNF links and formatting

Attached Files | CR8067.docx (181,714) 12-11-2021 15:15 http://oldforge.etsi.org/mantis/file_download.php?file_id=4062&type=bug CR8067-2.docx (208,894) 15-11-2021 07:35 http://oldforge.etsi.org/mantis/file_download.php?file_id=4065&type=bug

Issue History
Date Modified | Username | Field | Change
08-11-2021 13:14 | Tomas Urban | New Issue |
08-11-2021 13:14 | Tomas Urban | Status | new => assigned
08-11-2021 13:14 | Tomas Urban | Assigned To | => Jacob Wieland - Spirent
08-11-2021 13:14 | Tomas Urban | Relationship added | related to 0008017
08-11-2021 13:15 | Tomas Urban | Relationship deleted | related to 0008017
08-11-2021 13:16 | Tomas Urban | Relationship added | related to 0008006
08-11-2021 14:07 | Martin Hauch | Note Added: 0016004 |
08-11-2021 15:05 | Jacob Wieland - Spirent | Note Added: 0016006 |
08-11-2021 15:26 | Jacob Wieland - Spirent | Note Added: 0016009 |
09-11-2021 07:13 | Tomas Urban | Note Added: 0016023 |
09-11-2021 07:13 | Tomas Urban | Summary | Extended functionality of the valuof operation => Postfix value notation for templates
09-11-2021 07:14 | Tomas Urban | Note Edited: 0016023 | bug_revision_view_page.php?bugnote_id=16023#r563
09-11-2021 07:14 | Tomas Urban | Note Edited: 0016023 | bug_revision_view_page.php?bugnote_id=16023#r564
12-11-2021 14:54 | Jacob Wieland - Spirent | File Added: CR8067.docx |
12-11-2021 15:15 | Jacob Wieland - Spirent | File Deleted: CR8067.docx |
12-11-2021 15:15 | Jacob Wieland - Spirent | File Added: CR8067.docx |
12-11-2021 15:16 | Jacob Wieland - Spirent | Note Added: 0016080 |
12-11-2021 15:16 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
12-11-2021 15:16 | Jacob Wieland - Spirent | Status | assigned => confirmed
15-11-2021 07:32 | Tomas Urban | File Added: CR8067-2.docx |
15-11-2021 07:34 | Tomas Urban | File Deleted: CR8067-2.docx |
15-11-2021 07:35 | Tomas Urban | File Added: CR8067-2.docx |
15-11-2021 07:39 | Tomas Urban | Note Added: 0016083 |
15-11-2021 07:39 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
15-11-2021 07:58 | Martin Hauch | Note Added: 0016084 |
30-11-2021 16:45 | Jacob Wieland - Spirent | Note Added: 0016129 |
01-12-2021 07:39 | Axel Rennoch | Relationship added | related to 0008032
09-12-2021 08:59 | Jacob Wieland - Spirent | Status | confirmed => resolved
09-12-2021 08:59 | Jacob Wieland - Spirent | Resolution | open => fixed
09-12-2021 08:59 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Jens Grabowski
20-12-2021 09:57 | Jens Grabowski | Note Added: 0016148 |
20-12-2021 09:57 | Jens Grabowski | Status | resolved => closed

Notes

(0016004)
Martin Hauch
08-11-2021 14:07

This would change the semantic of valueof-operation. In my opinion the current version would cause an error for both examples above. Further question: How should regular expressions be handled, e.g. pattern "ab?#(1,1)" pattern "ab\?#(1,1)"

(0016006)
Jacob Wieland - Spirent
08-11-2021 15:05

Yes, this would change the semantics of the valueof operation for cases where at the moment it has no valid semantics, i.e. would cause a runtime-error. So, this would not cause a backwards incompatible change. In regard to your question, for the first expression the result would be "ab?#(1,1)" and for the second it would be "ab\?#(1,1)", following the idea that valueof(pattern X) == X.

(0016009)
Jacob Wieland - Spirent
08-11-2021 15:26

What is problematic with this proposal is that the current relationship that isvalue(X) == true iff valueof(X) is a valid expression is not true anymore.
(but it is still true that if isvalue(X) is true, then valueof(X) == X)
Alternative proposal could be to allow .value as a dotted postif notation. The value keyword is already used in other places, so this does not introduce a new keyword.
It would then need to be defined for what kind of template expressions the .value operation would yield what.

(0016023)
Tomas Urban
09-11-2021 07:13 (edited on: 09-11-2021 07:14)

Jacob's proposal for using the postfix value notation for this functionality seems better than overloading the valueof function. I renamed the CR accordingly.
As regards Martin's question, the conversion would just remove the pattern keyword, thus the backslash character would be kept:
template charstring mw_tmp := pattern "ab\?#(1,1)";
var charstring v_str := mw_tmp.value; // v_str will be equal to "ab\?#(1,1)" after the assignment

(0016080)
Jacob Wieland - Spirent
12-11-2021 15:16

please review

(0016083)
Tomas Urban
15-11-2021 07:39

I am fine with the proposed changes, but I added one additional rule concerning removal of matching attributes from patterns so that the following would work:
var template charstring v_pattern := pattern "[abc]+" length(3..5);
var charstring v_patternValue := v_pattern.value; // assigns "[abc]+"
v_pattern := pattern "[abc]+" ifpresent;
v_patternValue := v_pattern.value; // assigns "[abc]+"
Please review.

(0016084)
Martin Hauch
15-11-2021 07:58

Question: Is ".value" only allowed for types charstring and universal charstring or also for other types (structured-types, union-types,other basic-types) ? Should ".value" always be the last element of an ExtendedFieldReference? If it's also allowed for structured types, I think an example might be helpful.

(0016129)
Jacob Wieland - Spirent
30-11-2021 16:45

The ifpresent removal is also applicable to other types than charstring and universal charstring, therefore, the .value can appear anywhere inside an ExtendedFieldReference, the type of the operand to .value and the type of the resulting value are the same (just template-ness is removed).

(0016148)
Jens Grabowski
20-12-2021 09:57

Implemented