On Wed, 17 Jul 2002, Paul Long wrote:

> I have questions about inner subtyping. Given these two type definitions:
>
>     Parent ::= SEQUENCE
>     {
>         anOptionalThing INTEGER OPTIONAL,
>         anotherOptionalThing INTEGER OPTIONAL,
>         aRequiredThing INTEGER
>     }
>
>     Child ::= Parent WITH COMPONENTS { ..., anOptionalThing ABSENT }
>
> does the WITH-COMPONENTS construct essentially create a new type, i.e.,
>
>     SEQUENCE
>     {
>         anotherOptionalThing INTEGER OPTIONAL,
>         aRequiredThing INTEGER
>     }

No.

> or does it merely apply a semantic constraint to the existing type, i.e.,
> the anOptionalThing is still syntactically OPTIONAL  but its _value_ is
> constrained to not be present?

The latter.

> For a PER encoding, the question could be stated as, is there a
> presence bit (set to 0) in the bit-map preamble for the
> anOptionalThing component, or is even its presence bit absent?

Inner type constraint is not PER-visible, so it has no effect on the
structure of PER encodings.  However, in the example above the presence
bit for anOptionalThing always being zero.

> Likewise, would this:
>
>     Child ::= Parent WITH COMPONENTS { ..., anOptionalThing PRESENT }
>
> result in this new type:
>
>     SEQUENCE
>     {
>         anOptionalThing INTEGER,
>         anotherOptionalThing INTEGER OPTIONAL,
>         aRequiredThing INTEGER
>     }

No.  It would, however, result in the presence bit for anOptionalThing
always being set to 1.

BTW, "WITH ... }" should be in parentheses.

-------------------------------------------------------------------------
Bancroft Scott                               Toll Free    :1-888-OSS-ASN1
OSS Nokalva                                  International:1-732-302-0750
[EMAIL PROTECTED]                                 Tech Support :1-732-302-9669 x-1
1-732-302-9669 x-200                         Fax          :1-732-302-0023
http://www.oss.com

Reply via email to