[
Lists Home |
Date Index |
Thread Index
]
Bob Wyman wrote:
>
> Bob Foster wrote:
> > In ASN.1, does SET mean that order is both lexically
> > and semantically insignificant (as it does in
> > mathematics)?
> For more information on ASN.1, I suggest you take a look at:
> X.680. You can find it at:
> http://www.itu.int/ITU-T/studygroups/com17/languages/
>
> The definition of Sequence and Set types from that document
> are below:
> "3.6.60 sequence types: Types defined by referencing a
> fixed, ordered list of types (some of which may be declared
> to be optional); each value of the sequence type is an
> ordered list of values, one from each component type.
> NOTE – Where a component type is declared to be optional, a
> value of the sequence type need not contain a value of that
> component type."
> "3.6.64 set types: Types defined by referencing a fixed,
> unordered, list of types (some of which may be declared to be
> optional); each value in the set type is an unordered list of
> values, one from each component type. NOTE – Where a
> component type is declared to be optional, a value of the set
> type need not contain a value of that component type."
>
> SET and SEQUENCE in ASN.1 are statements about the permited
> lexical order of elements. In such cases that I've seen
> significance given to order, it has been done in
> specifications that accompany or incorporate the ASN.1
> definitions. However, the rules for Canonical and
> Distinguished encoding both require that the elements of SETs
> are, in fact, ordered according to their tag numbers. Thus,
> any semantic significance of order would be discarded if SETs
> were encoded with CER or DER.
I disagree on this particular view.
There cannot be any significance in the order of a SET (OF). The fact that DER/CER "remove" the freedom of order of BER indicates precisely that a SET (OF) is inherently unordered at the abstract level. Encoder's options (such as the SET component order in BER or the attribute order in EXTENDED-XER) cannot be used to convey any semantic significance. They are there just for convenience. They carry zero bits of information, they are pure entropy.
Alessandro
> For instance, X.690 says, in
> defining CER:
>
> "9.3 Set components: The encodings of the component values of
> a set value shall appear in an order determined by their tags
> as specified in 8.6 of ITU-T Rec. X.680 | ISO/IEC 8824-1.
> Additionally, for the purposes of determining the order in
> which components are encoded when one or more component is an
> untagged choice type, each untagged choice type is ordered
> as though it has a tag equal to that of the smallest tag in
> that choice type or any untagged choice types nested within."
>
> >Finally, if SET does mean that order is lexically and semantically
> >insignificant, how does one specify in ASN.1 that order is
> lexically
> >insignificant but semantically significant?
> I'm not aware of any schema languages that allow the
> specification semantic signifance to order independent of
> lexical significance. Can you provide an example of one that
> does? I am curious to see how this concept is used and
> expressed.
>
> bob wyman
>
|