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

ID | Project | Category | View Status | Date Submitted | Last Update
0007620 | Part 01: TTCN-3 Core Language | Technical | public | 16-02-2017 15:08 | 30-12-2017 19:48

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.9.1 (published 2017-05) |
Target Version | v4.10.1 (published 2018-05) | Fixed in Version | v4.10.1 (published 2018-05) |
Clause Reference(s) | 6.2.13
Source (company - Author) | STF 521

Summary | 0007620: Constraining of array types

Description

The core language (in particular the BNF section) allows to add a constraint definition to an array type. However, it does not specify if the constraint is related to the member type (as it is the case of the record of and set of) or to the whole array.
My opinion is that the former is the case, since list subtyping of structured types should be possible only "when defining a new type based on an existing parent type, but not directly at the declaration of the first parent type" (6.2.13.2). However, it would still be better to explicitly describe the behaviour of the contraint in this case. Besides, the array type is missing from the table 3 and it should be listed in 6.2.13.2 as a legal target of a list constraint.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR_7620.docx (268,985) 25-06-2017 14:33 http://oldforge.etsi.org/mantis/file_download.php?file_id=3642&type=bug

Issue History
Date Modified | Username | Field | Change
16-02-2017 15:08 | Tomas Urban | New Issue |
19-04-2017 11:21 | Gyorgy Rethy | Note Added: 0014578 |
24-04-2017 12:25 | szabados | Note Added: 0014601 |
02-05-2017 09:27 | Jacob Wieland - Spirent | Note Added: 0014610 |
06-06-2017 11:50 | Jens Grabowski | Note Added: 0014623 |
06-06-2017 11:50 | Jens Grabowski | Assigned To | => KristÃ³f Szabados
06-06-2017 11:50 | Jens Grabowski | Status | new => assigned
25-06-2017 14:33 | KristÃ³f Szabados | File Added: CR_7620.docx |
25-06-2017 14:35 | KristÃ³f Szabados | Note Added: 0014712 |
25-06-2017 14:35 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Tomas Urban
25-06-2017 14:35 | KristÃ³f Szabados | Status | assigned => confirmed
24-07-2017 16:12 | Tomas Urban | Assigned To | Tomas Urban => KristÃ³f Szabados
24-07-2017 16:12 | Tomas Urban | Status | confirmed => assigned
24-07-2017 16:12 | Tomas Urban | Note Added: 0014743 |
25-07-2017 08:51 | Jacob Wieland - Spirent | Note Added: 0014747 |
25-07-2017 15:28 | KristÃ³f Szabados | File Added: CR_7620_v2.docx |
25-07-2017 15:31 | KristÃ³f Szabados | Note Added: 0014755 |
25-07-2017 15:31 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Tomas Urban
25-07-2017 15:31 | KristÃ³f Szabados | Status | assigned => confirmed
25-07-2017 15:54 | Tomas Urban | File Deleted: CR_7620_v2.docx |
25-07-2017 15:55 | Tomas Urban | Note Added: 0014757 |
25-07-2017 15:55 | Tomas Urban | Status | confirmed => resolved
25-07-2017 15:55 | Tomas Urban | Resolution | open => fixed
25-07-2017 15:55 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
30-12-2017 19:48 | Gyorgy Rethy | Note Added: 0014967 |
30-12-2017 19:48 | Gyorgy Rethy | Status | resolved => closed
30-12-2017 19:48 | Gyorgy Rethy | Fixed in Version | => v4.10.1 (published 2018-05)
30-12-2017 19:48 | Gyorgy Rethy | Target Version | => v4.10.1 (published 2018-05)

Notes

(0014578)
Gyorgy Rethy
19-04-2017 11:21

test note, please ignore.

(0014601)
szabados
24-04-2017 12:25

yes, arrays are generally described as shorthand of record of descriptions, so they should behave similarly.

(0014610)
Jacob Wieland - Spirent
02-05-2017 09:27

agreed, in direct definitions with trailing constraints, always the element type is constrained.

(0014623)
Jens Grabowski
06-06-2017 11:50

STF discussion: Agreed

(0014712)
KristÃ³f Szabados
25-06-2017 14:35

Please review the uploaded proposal document

(0014743)
Tomas Urban
24-07-2017 16:12

I am fine with most of the changes in the proposal, but it ignores the fact that constraints can appear directly in the array type definition, e.g:
type charstring MyArray[1..2] ({"aa", "bb"}, { "cc", "dd"})
The BNF allows it in the rule 41:
41.SubTypeDef ::= Type (Identifier | AddressKeyword) [ArrayDef] [SubTypeSpec]
We could also disallow such a constraint by changing the rule to:
41.SubTypeDef ::= Type (Identifier | AddressKeyword) [ ArrayDef | SubTypeSpec ]

(0014747)
Jacob Wieland - Spirent
25-07-2017 08:51

But for record of, the subtype constraint directly in the definition is applied to the element type and not the array type itself, so type charstring MyArray[1..2] ({"aa", "bb"}, { "cc", "dd"}) wouldn't be semantically valid. To achieve that you need to use a subtype definition of the unconstrained charstring array type.

(0014755)
KristÃ³f Szabados
25-07-2017 15:31

updated the BNF rule 41 too. Please check.

(0014757)
Tomas Urban
25-07-2017 15:55

After discussion, we returned back to the first resolution which should resolve the raised issue completely.

(0014967)
Gyorgy Rethy
30-12-2017 19:48

Added to draft V4.9.2