[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: SET vs SET OF



At 20:47 17.10.99 -0700, Kurt D. Zeilenga wrote:
I believe we should amend the BDF to include a comment on
each use of SET OF or SEQUENCE OF where zero elements are
disallowed elsewhere by the specification.  Such comments
are a particularly good aid where only the BNF is quoted.

actually it's ASN.1 type notation, not ABNF.....


For example, RFC2254 quotes RFC2251's filter BNF:
        Filter ::= CHOICE {
                and                [0] SET OF Filter,
                or                 [1] SET OF Filter,
                ...
        }

but fails to quote: "At least one filter element MUST be present in
an 'and' or 'or' choice."  Hence, the reader of RFC2254 might
be get confused by "filterlist = 1*filter" requirement.  In fact,
the inline comment would help readers of RFC2251 as well.

In a CHOICE, one of the choices MUST be taken.


I believe the BNF should amended in a similar manner that
was used for Referral:
        Referral ::= SEQUENCE OF LDAPURL  -- one or more

Also confusing (RFC2251) is:
        AttributeList ::= SEQUENCE OF SEQUENCE {
                type    AttributeDescription,
                vals    SET OF AttributeValue }

vs:
        PartialAttributeList ::= SEQUENCE OF SEQUENCE {
                type    AttributeDescription,
                vals    SET OF AttributeValue }
        -- implementors should note that the PartialAttributeList may
        -- have zero elements (if none of the attributes of that entry
        -- were requested, or could be returned), and that the vals set
        -- may also have zero elements (if types only was requested, or
        -- all values were excluded from the result.)

The ASN.1 notation for this would be

AttributeList::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
          type AttributeDescription,
          vals SET SIZE(1..MAX) OF AttributeValue }

or something like it (I haven't written ASN.1 in a while), but the authors seem reluctant to use the SIZE operator. (Note that ASN.1 doesn't have an "infinite upper bound" specification; MAX is defined by convention to be "a rather large number".)

Not sure the specs actually intend this.


In terms of the BNF, this clarification isn't needed as
SEQUENCE OF and SET OF both allow zero elements.   It's
AttributeList, per 4.1.8, where SET OF must contain one
or more values, that actually need inline clarification.
Agreed.

                 Harald

--
Harald Tveit Alvestrand, Maxware, Norway
Harald.Alvestrand@maxware.no