Re: [abnf-discuss] constrained-01 - advantage?

Sean Leonard <dev+ietf@seantek.com> Mon, 14 November 2016 04:46 UTC

Return-Path: <dev+ietf@seantek.com>
X-Original-To: abnf-discuss@ietfa.amsl.com
Delivered-To: abnf-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 69C2D1295EA for <abnf-discuss@ietfa.amsl.com>; Sun, 13 Nov 2016 20:46:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qEOg8-XpPPlg for <abnf-discuss@ietfa.amsl.com>; Sun, 13 Nov 2016 20:46:08 -0800 (PST)
Received: from fallback-in2.mxes.net (fallback-out2.mxes.net [216.86.168.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4A8F1127058 for <abnf-discuss@ietf.org>; Sun, 13 Nov 2016 20:46:08 -0800 (PST)
Received: from mxout-07.mxes.net (mxout-07.mxes.net [216.86.168.182]) by fallback-in2.mxes.net (Postfix) with ESMTP id 52C6A2FD7D7 for <abnf-discuss@ietf.org>; Sun, 13 Nov 2016 23:46:03 -0500 (EST)
Received: from dhcp-898b.meeting.ietf.org (unknown [31.133.137.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 576BD22E1F3; Sun, 13 Nov 2016 23:45:47 -0500 (EST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Sean Leonard <dev+ietf@seantek.com>
In-Reply-To: <58292EE9.2040308@gmail.com>
Date: Mon, 14 Nov 2016 13:45:44 +0900
Content-Transfer-Encoding: quoted-printable
Message-Id: <1A928BF2-22AB-4EA1-9DCD-58B6F646259F@seantek.com>
References: <5828DD42.8010009@gmail.com> <36FC0A35-2ADA-4710-ABFB-08E8B916718E@seantek.com> <58292EE9.2040308@gmail.com>
To: Doug Royer <douglasroyer@gmail.com>
X-Mailer: Apple Mail (2.3124)
Archived-At: <https://mailarchive.ietf.org/arch/msg/abnf-discuss/CMj36X3v433rZkU1Waw7D4SsZzM>
Cc: abnf-discuss@ietf.org
Subject: Re: [abnf-discuss] constrained-01 - advantage?
X-BeenThere: abnf-discuss@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "General discussion about tools, activities and capabilities involving the ABNF meta-language" <abnf-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/abnf-discuss/>
List-Post: <mailto:abnf-discuss@ietf.org>
List-Help: <mailto:abnf-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Nov 2016 04:46:09 -0000

> On Nov 14, 2016, at 12:26 PM, Doug Royer <douglasroyer@gmail.com> wrote:
> 
> On 11/13/2016 04:21 PM, Sean Leonard wrote:
> 
>>> …
>> 
>> Well:
>> 
>>> resent-field    = "Resent-" field-name ":" unstructured CRLF
>> 
>> 
>> Is simpler than:
>> 
>>> resent-field  = resent-unstructured / resent-date / resent-from / resent-sender / ...
>> 
>> 
>> First of all, it looks simpler, because it is.
>> 
>> Second of all, <resent-date>, <resent-from>, <resent-sender> etc. are all “subsumed” in <resent-unstructured>, leading to an intentionally ambiguous grammar. The problem with the existing way of writing things out, is that the former are all superfluous when the latter is present. Another way to write it tends to be:
>> 
>>  field = date / from / sender / … / extension-field
>> 
>>  extension-field = field-name ":" unstructured CRLF
>> 
>> Well it makes perfect sense when you read it, of course,
> > but when a computer / parser parses productions, every <date> is going
> > to match with <extension-field> as well. The point being
> > <extension-field> is not really doing what you think it’s doing in ABNF:
> > it’s really <any-and-every-field>.
> > ...
>> There is nothing “wrong” with creating an ambiguous grammar,
> > but it can lead to subtle parsing errors if you are not careful.
> > Usually ambiguous grammars are undesirable because you want your
> > code to go down one, and only one, path. An automated ABNF validator
> > should be able to detect ambiguous grammars and inform you about that.
> 
> If your talking about replacing ABNF with new syntax. then I would agree. To a person reading the ABNF, they mean the same thing.
> At no point is one path more important than another.
> 
> Unless you deprecate the old method, its not going to help.
> Because people will use which ever makes sense to them.

I suppose that deprecating the old method would be something on the table to discuss. I believe it is desirable to avoid ambiguous grammars. At the same time, a sufficiently sophisticated tool could be written to identify these sorts of cases (of intentionally ambiguous grammars for parameterized names and values).

> Is the goal of this draft to make all future ABNF in RFC's parsable by a computer program? To mandate it?  I did not understand that after reading the draft.
> 
> If this keeps going, it will be a new ASN.1

We don’t want that. But the idea of “Table Constraints” is an ASN.1 term. (It is also a SQL concept, because, surprise, it’s about constraining data to tables of values.)

One thing is that none of the drafts that are being proposed change the context-free nature of ABNF.

I would say that a goal is that ABNF in RFCs should be easy to validate, and this would include by means of computer programs. This increases document quality. I recognize that there is a spectrum of views around here about how “formal” ABNF ought to be.

Regards,

Sean