Re: [Cellar] math in IETF specifications

Dave Rice <dave@dericed.com> Sat, 18 March 2017 17:25 UTC

Return-Path: <dave@dericed.com>
X-Original-To: cellar@ietfa.amsl.com
Delivered-To: cellar@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1262E12896F for <cellar@ietfa.amsl.com>; Sat, 18 Mar 2017 10:25:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.12
X-Spam-Level:
X-Spam-Status: No, score=-1.12 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_NEUTRAL=0.779] autolearn=no 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 UffQGtVMMBI2 for <cellar@ietfa.amsl.com>; Sat, 18 Mar 2017 10:25:36 -0700 (PDT)
Received: from s172.web-hosting.com (s172.web-hosting.com [68.65.122.110]) (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 5006D128BE1 for <cellar@ietf.org>; Sat, 18 Mar 2017 10:25:36 -0700 (PDT)
Received: from cpe-104-162-86-103.nyc.res.rr.com ([104.162.86.103]:44848 helo=[10.0.1.4]) by server172.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from <dave@dericed.com>) id 1cpI6c-0040XK-18; Sat, 18 Mar 2017 13:25:33 -0400
From: Dave Rice <dave@dericed.com>
Message-Id: <61FBB363-8FDE-49B3-8ECC-5A39A8AC7415@dericed.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_91DA78AF-0D70-43FB-81DE-BDD795E9A659"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Date: Sat, 18 Mar 2017 13:25:27 -0400
In-Reply-To: <565FC9A9.1050604@xiph.org>
Cc: Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>, Yaakov Stein <yaakov_s@rad.com>
To: "Timothy B. Terriberry" <tterribe@xiph.org>, Michael Niedermayer <michael@niedermayer.cc>
References: <D99E7E07-C087-4D97-A36B-9F59C8C0FBE4@dericed.com> <565F46D9.90801@nostrum.com> <565F4C10.9040705@xiph.org> <AE5B0635-E61D-4306-BE3F-4675B08F8F71@dericed.com> <565FC9A9.1050604@xiph.org>
X-Mailer: Apple Mail (2.3259)
X-OutGoing-Spam-Status: No, score=-2.9
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server172.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - dericed.com
X-Get-Message-Sender-Via: server172.web-hosting.com: authenticated_id: dave@dericed.com
X-Authenticated-Sender: server172.web-hosting.com: dave@dericed.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/xmVkyGnt2rc76fc8IueEWD1zB3k>
Subject: Re: [Cellar] math in IETF specifications
X-BeenThere: cellar@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Codec Encoding for LossLess Archiving and Realtime transmission <cellar.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cellar>, <mailto:cellar-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cellar/>
List-Post: <mailto:cellar@ietf.org>
List-Help: <mailto:cellar-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cellar>, <mailto:cellar-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Mar 2017 17:25:40 -0000

Hi all,

> On Dec 2, 2015, at 11:48 PM, Timothy B. Terriberry <tterribe@xiph.org> wrote:
> 
> Dave Rice wrote:
>> Thanks, it’s good to see the options in action. Given what is available in the timeline of the project it may be easiest to leave the math in LaTeX form and cite the PDF version for reference. The ASCII Art equations of RFC 6716 are impressive but I’d worry that in this effort that it would compromise legibility. In the current FFV1 LaTeX there are some examples with subscripts of subscripts of subscripts.
> 
> Yes, in 6716 we probably would have done that as C-style arrays (our syntax closer to C than traditional mathematical notation, on the whole). But doing that conversion for a bunch of existing equations would be a lot of work.

[…]

I’ve prepared a patch at https://github.com/FFmpeg/FFV1/pull/50 <https://github.com/FFmpeg/FFV1/pull/50>. This adds a method to the markdown draft to store alternatives of the same expression for use in the current PDF output (a non-RFC output used by FFmpeg) and for use in the RFC output. This is primarily because the PDF output supports LaTex but the RFC output must be in much simpler ASCII. So the patch proposes expressions such as:


PDF:$$Q_{i}[a-b]=Table_{i}[(a-b)\&255]$$      
RFC:```      
RFC:Q_{i}[a − b] = Table_{i}[(a − b)&255]      
RFC:```

And then the Makefile strips the prefixes (PDF: and RFC:) and uses the appropriate lines for the appropriate output. This comment on the PR, https://github.com/FFmpeg/FFV1/pull/50#issuecomment-287559570 <https://github.com/FFmpeg/FFV1/pull/50#issuecomment-287559570>, demonstrates what the most complex equations of the FFV1 specification look like in the RFC output of this patch. It was a challenge to replicate the PDF’s use of multi-level subscripting to depict complex sequences within an RFC. In the PR I accommodate that in a single-line expression using a locally defined syntax that is similar to how subscripts are used in LaTeX. I also worked with text alignment in the equations of the RFC to better imply line-wrapping since many of the equations are far too long to fit on a single RFC line.

   a_{b} the b-th value of a sequence of a
   a_{b,c} the 'b,c'-th value of a sequence of a

A fully rendered output of the PR is available at https://gist.github.com/dericed/273ce52640b716d763d49bc955b4bead <https://gist.github.com/dericed/273ce52640b716d763d49bc955b4bead>.
Comments?

Best Regards,
Dave Rice