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

ID | Project | Category | View Status | Date Submitted | Last Update
0007126 | Part 01: TTCN-3 Core Language | Technical | public | 05-08-2015 13:02 | 16-11-2016 09:47

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 | v4.7.1 (published 2015-06) |
Target Version | v4.8.1 (published 2016-07) | Fixed in Version | v4.8.1 (published 2016-07) |
Clause Reference(s) | 6, A.1.6.8.3
Source (company - Author) | Testing Technologies - Jacob Wieland

Summary | 0007126: Semantics of anytype not really usable

Description

The anytype in its current semantic definition includes only those top-level types that are visible at the place of its usage, i.e. all imported top-level types and all locally defined top-level types. This makes it quite unusable for any kind of library function defined on objects of type anytype. Also, this restrictive semantics is very dissimilar to the semantics of the same concept in imported external languages which are normally mapped to anytype.
Its semantic should be changed that it can contain a value of any top-level type and that only the syntax of anytype values/template and referencing anytype value/template-contents shall be restricted to the types known in the context of usage.
The reason for this is that the anytype in TTCN-3 should be a similar concept the open types in other languages mapped to it (which include ASN.1 ANY, IDL any, XSD any/anyType (possibly)).
Additionally, one could think of special restrictions for anytype:
- restriction by module(s) or module exceptions
- restriction by language(s)
- restriction by types
With these restriction concepts, it would be possible to model the semantics of the different constructs in the external languages.
ASN.1 ANY: anytype(octetstring, language "ASN.1:1997") (or whatever language the module defining the ANY was imported as)
XSD:
any ##other => anytype(XSD.String, language "XSD" except M) (where M would be name of the mapped-to module)
any A, B, C => anytype(XSD.String, from A, B, C)
Finally, it should be possible to access anytype with a type T even in a context where T is ambiguous (imported from different sources) or where a local T is defined in the module but an imported T should be accessed.
For value-notation, this would change the syntactical structure to:
'{' [ModuleName '.'] TypeIdentifier ":=" Expression '}'
For anytype field access, this would need to be changed to:
AnyTypeReference ['.' ModuleName] '.' TypeIdentifier
The latter would seem to be a syntactical clash with
AnyTypeReference '.' TypeIdentifier '.' FieldIdentifier
but since no TypeIdentifier M can be used in a module named M or importing from M, this can always be resolved via the first identifier after the AnyTypeReference.
This syntactical ambiguity is also the reason why only top-level types are allowed to be used in the anytype.
If non-top-level (inner types inside a record/set type) were also allowed, then the following expression would be ambiguous:
AnyTypeRef.Type.Field
This has (at the moment) the semantics of (AnyTypeRef.Type).Field and not of
AnyTypeRef.(Type.Field).
If we also want to allow any inner types in anytype, the additional syntax
AnyType '.' '(' TypeReference ')'
needs to be allowed and the value-notation can be generalized to
'{' TypeReference ":=" Expression '}'

Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

related to | 0007057 | closed | Gyorgy Rethy | Part 09: Using XML with TTCN-3 | Extend the mapping of XSD any element and anyAttribute element to TTCN-3 anytype

Attached Files

Anytype – what does it mean.pptx (68,192) 22-09-2015 08:34
http://oldforge.etsi.org/mantis/file_download.php?file_id=3260&type=bug
CR7126.docx (235,380) 23-09-2015 11:53
http://oldforge.etsi.org/mantis/file_download.php?file_id=3267&type=bug
CR7126_resolution_v2.docx (241,718) 04-11-2015 13:34
http://oldforge.etsi.org/mantis/file_download.php?file_id=3358&type=bug
CR7126_resolution_v3.docx (452,475) 04-11-2015 21:35
http://oldforge.etsi.org/mantis/file_download.php?file_id=3365&type=bug

Issue History
Date Modified | Username | Field | Change
05-08-2015 13:02 | Jacob Wieland - Spirent | New Issue |
07-08-2015 09:19 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
07-08-2015 09:21 | Gyorgy Rethy | Note Added: 0013126 |
07-08-2015 09:21 | Gyorgy Rethy | Assigned To | => Jacob Wieland - Spirent
07-08-2015 09:21 | Gyorgy Rethy | Status | new => assigned
07-08-2015 09:21 | Gyorgy Rethy | Product Version | => v4.7.1 (published 2015-06)
07-08-2015 09:21 | Gyorgy Rethy | Target Version | => v4.8.1 (published 2016-07)
07-08-2015 12:13 | Jacob Wieland - Spirent | File Added: Anytype – what does it mean.pptx |
07-08-2015 12:14 | Jacob Wieland - Spirent | Note Added: 0013139 |
22-09-2015 08:34 | Jacob Wieland - Spirent | File Deleted: Anytype – what does it mean.pptx |
22-09-2015 08:34 | Jacob Wieland - Spirent | File Added: Anytype – what does it mean.pptx |
23-09-2015 11:53 | Jacob Wieland - Spirent | File Added: CR7126.docx |
23-09-2015 11:57 | Jacob Wieland - Spirent | Note Added: 0013256 |
23-09-2015 11:57 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
23-09-2015 11:57 | Jacob Wieland - Spirent | Status | assigned => confirmed
04-11-2015 13:34 | Gyorgy Rethy | File Added: CR7126_resolution_v2.docx |
04-11-2015 13:42 | Gyorgy Rethy | Note Added: 0013485 |
04-11-2015 13:43 | Gyorgy Rethy | Note Edited: 0013485 | bug_revision_view_page.php?bugnote_id=13485#r206
04-11-2015 13:43 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
04-11-2015 14:07 | Jacob Wieland - Spirent | Note Added: 0013488 |
04-11-2015 14:13 | Jacob Wieland - Spirent | Note Added: 0013489 |
04-11-2015 14:13 | Jacob Wieland - Spirent | Status | confirmed => resolved
04-11-2015 14:13 | Jacob Wieland - Spirent | Fixed in Version | => v4.8.1 (published 2016-07)
04-11-2015 14:13 | Jacob Wieland - Spirent | Resolution | open => fixed
04-11-2015 14:13 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
04-11-2015 21:35 | Jacob Wieland - Spirent | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
04-11-2015 21:35 | Jacob Wieland - Spirent | Status | resolved => feedback
04-11-2015 21:35 | Jacob Wieland - Spirent | Resolution | fixed => reopened
04-11-2015 21:35 | Jacob Wieland - Spirent | File Added: CR7126_resolution_v3.docx |
04-11-2015 21:36 | Jacob Wieland - Spirent | Note Added: 0013496 |
04-11-2015 21:36 | Jacob Wieland - Spirent | Status | feedback => assigned
04-11-2015 21:36 | Jacob Wieland - Spirent | Status | assigned => resolved
04-11-2015 21:36 | Jacob Wieland - Spirent | Resolution | reopened => fixed
04-11-2015 21:36 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
11-12-2015 14:25 | Gyorgy Rethy | Note Added: 0013589 |
11-12-2015 14:25 | Gyorgy Rethy | Status | resolved => closed
16-11-2016 09:47 | KristÃ³f Szabados | Relationship added | related to 0007057

Notes

(0013126)
Gyorgy Rethy
07-08-2015 09:21

Please prepare an analysis comparing current and proposed new syntax and semantics, what are the potential backward co mpatibility issues we need to consider.

(0013139)
Jacob Wieland - Spirent
07-08-2015 12:14

uploaded discussion of the different anytype aspects as powerpoint slides

(0013256)
Jacob Wieland - Spirent
23-09-2015 11:57

added proposal for anytype changes.
decided to not add the capability of using nested type references as anytype variants (only type names and module-prefixed type names are allowed) because it does not really add any additional power to the language (the root type can be used in the anytype variable as a container). It just adds unnecessary complications to the language which are hard to explain, hard to implement and they would probably have to be restricted in some way.
In the advanced parameterization package, we should add also change it so that type parameters can be given for TypeReference.

(0013485)
Gyorgy Rethy
04-11-2015 13:42 (edited on: 04-11-2015 13:43)

CR7126_resolution_v2.docx: I basically agree (and though it's not noted here, my memory says we have agreed already on the conclusions in the .ppt analysis).
I have made using anytype with ischosen more explicit in clause C.3.2, please check. I'm concerned about possible name clashes in the case of
ischosen(t_a1.M.U)
if: type union M (MyUType U) is defined in the same module, where t_a1 is defined (which, in this case is not module M);

(0013488)
Jacob Wieland - Spirent
04-11-2015 14:07

I have already thought about that problem, and as far as I have understood, it is not allowed to have a type M in a module which also imports module M. Therefore, t_a1.M.U refers to type M.U in the anytype if U is imported from M or to field U in the union type M in the anytype if nothing from module M is imported.

(0013489)
Jacob Wieland - Spirent
04-11-2015 14:13

I'm happy with the additions, the NOTE about strong typing for ischosen is correct, as well.

(0013496)
Jacob Wieland - Spirent
04-11-2015 21:36

made some corrections to the anytype ischosen example

(0013589)
Gyorgy Rethy
11-12-2015 14:25

Added to draft V4.7.4