Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000807Taste[All Projects] ASN.1 Compiler v4public2018-09-19 13:422019-03-18 17:20
Reportermaxime 
Assigned Togmamais 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000807:

Optional field and ACN size determinant

Description

Consider this grammar :

1   │ D DEFINITIONS ::=
2   │ BEGIN
3   │  T1 ::= SEQUENCE {
4   │     a SEQUENCE (SIZE (1..10)) OF BOOLEAN OPTIONAL,
5   │     b BOOLEAN
6   │  }
7   │  T2 ::= T1 (WITH COMPONENTS { a ABSENT })
8   │ END

And the corresponding ACN :

1   │ D DEFINITIONS ::= BEGIN
2   │ 
3   │     T1[] {
4   │         length INTEGER [size 32, encoding pos-int],
5   │         a      [size length],
6   │         b      []
7   │     }
8   │ 
9   │     T2[]

The field "length" added in T1 to act as length determinant of the field "a" is inherited by T2. However T2 has no field "a" as it is optional in T1 and absent in T2.
That's an issue: how can we exclude the "length" field from T2 ?

TagsNo tags attached.
Attached Files

- Relationships
related to 0000543closedgmamais 

"WITH COMPONENTS" and ACN

 

-  Notes
(0003472)
gmamais (developer)
2018-09-22 12:31
edited on: 2018-09-22 17:27

Issue fixed.
What I did is not to copy the ACN spec information for reference types that have with components constraints. Before this fix, T2 copied T1 encoding spec (i.e. it had the length ACN field etc).
Now, T2 does not copy the T1 ACN information. In this case, T2 will be encoded using the default behavior. It is possible to redefine T2 ACN spec by providing information e.g.

T2[] {
   a          []
   dummy NULL [pattern '0100'B]
   b          [true-value '1111'B]
}
(0003474)
maxime (administrator)
2018-09-22 17:21
edited on: 2018-09-22 17:26

Amazing. Thanks. How about this grammar:

1  │  Non-Generic ::= SEQUENCE {
2  │      cmds SEQUENCE (SIZE (0 .. 10)) OF BOOLEAN
3  │  }
4  │ 
5  │ Another-One ::= Non-Generic (WITH COMPONENTS { cmds (SIZE (1)) })
6  │ 

in uPER the subtype constraint is ignored, but in ACN, it should replace the one of the super-type.
If the size is fixed to size 1, the subtype Another-One should have no "length" field when encoded in ACN.

(0003477)
gmamais (developer)
2018-09-23 05:50

The fact is that when we initially designed ACN we introduced a "single basic rule" that when no ACN encoding properties are provided in a given type then this type should be encoded as in uPER.
Then we discovered some issues with the above rule when using WITH COMPONENT constraints that restrict some fields to be always absent or present. Therefore ACN deviates from "single basic rule" that with component constraints that affect the presence/absence of fields are visible in ACN (although are not visible in uPER).
However, the other type of WITH COMPONENT constraints that affect the type (not presence/absence) like the one you provide are still ignored by the current implementation of ACN.
Probably, we should change this and make all WITH COMPONENT constraints visible to ACN (and not just the absence/presence). In this case, the encoding would behave exactly as you suggest.

Please tell me if you wish to proceed with the above change.

I realize that WITH COMPONENT constraints are used a lot in the real world grammars since they a provide a layer of abstraction and therefore are very important.

(0003478)
maxime (administrator)
2018-09-23 09:15
edited on: 2018-09-23 09:15

Agreed (with history and way forward). Let's go for it.

This brings a lot of added value to ACN, which then can be used to produce encodings that are better than PER with no additional effort for the user.

In the same spirit, CHOICE constraints could handle this case:

18   │ Choice-Generic ::= CHOICE {
19   │   a BOOLEAN,
20   │   b Non-Generic,
21   │   c Another-One
22   │ }
23   │ 
24   │ Sub-Choice ::= Choice-Generic (WITH COMPONENTS { a ABSENT, c ABSENT })

Sub-Choice could have no determinant field (only one possible choice here), and if only a subset of choices is kept, the choice determinant would take it into account (this is not the case in the ICD right now).

(0003591)
gmamais (developer)
2019-03-18 17:20

all new issues are OK.
Please see the new test case

v4Tests/test-cases/acn/16-mantis/0000807b.asn1

which demonstrates the new features


- Issue History
Date Modified Username Field Change
2018-09-19 13:42 maxime New Issue
2018-09-19 13:42 maxime Status

new => assigned

2018-09-19 13:42 maxime Assigned To

=> gmamais

2018-09-22 12:31 gmamais Note Added: 0003472
2018-09-22 12:31 gmamais Status

assigned => resolved

2018-09-22 12:31 gmamais Resolution

open => fixed

2018-09-22 17:21 maxime Note Added: 0003474
2018-09-22 17:21 maxime Note Edited: 0003474 View Revisions
2018-09-22 17:22 maxime Note Edited: 0003474 View Revisions
2018-09-22 17:23 maxime Note Edited: 0003474 View Revisions
2018-09-22 17:26 maxime Note Edited: 0003474 View Revisions
2018-09-22 17:27 maxime Note Edited: 0003472 View Revisions
2018-09-22 17:27 maxime Note Edited: 0003472 View Revisions
2018-09-23 05:50 gmamais Note Added: 0003477
2018-09-23 05:50 gmamais Status

resolved => assigned

2018-09-23 09:15 maxime Note Added: 0003478
2018-09-23 09:15 maxime Note Edited: 0003478 View Revisions
2018-09-23 09:22 maxime Relationship added

related to 0000543

2019-03-18 17:20 gmamais Note Added: 0003591
2019-03-18 17:20 gmamais Status

assigned => resolved



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker