Subject: SET vs SET OF

From: "Kurt D. Zeilenga" <[email-masked]>
Date: Sun, 17 Oct 1999 20:47:20 -0700

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.

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.

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.)

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.

	Kurt

---

From: Harald Tveit Alvestrand <[email-masked]>
Date: Mon, 18 Oct 1999 06:16:51 +0200

>are a particularly good aid where only the BNF is quoted.

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

>the inline comment would help readers of RFC2251 as well.

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

>         -- 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.

>or more values, that actually need inline clarification.
Agreed.

                  Harald

--
Harald Tveit Alvestrand, Maxware, Norway
[email-masked]

---

From: "Kurt D. Zeilenga" <[email-masked]>
Date: Mon, 18 Oct 1999 02:55:15 -0700

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

I wasn't referring to the CHOICE but to an empty SET OF
after choosing 0 or 1 that appears allowed by the ASN.1.

----
Kurt D. Zeilenga		<[email-masked]>
Net Boolean Incorporated	<http://www.boolean.net/>