[Cbor] Use of cuts in maps

Jim Schaad <ietf@augustcellars.com> Wed, 07 August 2019 21:50 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9AC0A120232 for <cbor@ietfa.amsl.com>; Wed, 7 Aug 2019 14:50:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] 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 7KTzCD5CbXen for <cbor@ietfa.amsl.com>; Wed, 7 Aug 2019 14:50:09 -0700 (PDT)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6910B12007A for <cbor@ietf.org>; Wed, 7 Aug 2019 14:50:09 -0700 (PDT)
Received: from Jude (192.168.0.11) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 7 Aug 2019 14:45:34 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: 'Carsten Bormann' <cabocabo@gmail.com>
CC: cbor@ietf.org
Date: Wed, 07 Aug 2019 14:45:33 -0700
Message-ID: <001301d54d69$722a3050$567e90f0$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdVNX+VPSR6jybaZRwWJKW5K0t0toA==
Content-Language: en-us
X-Originating-IP: [192.168.0.11]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/cctj-tgzuhLvVGzXN8wLwWtEL7Q>
Subject: [Cbor] Use of cuts in maps
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Aug 2019 21:50:12 -0000

One of the issues that I have always had with the way that cuts are
specified in CDDL is that they don't behave the way that I think they should
in terms of going from the most specific to the most general.  I think that
I have found a way around this problem and want to verify that it would
work.


Start I start with

map-example = {
   ? "optional-key" : int,
   map-example-extensions,
   * tstr => any
}

map-example-extensions = ()

The next document comes along and does

map-example-extensions /= (
   "another-optional-key" : tstr,
  "and a third": bstr
)

If I compile the two modules together, do you believe that this would be a
match or not?
 
{ "and a third" : 15 }

Jim