[netmod] false() vs 'false' in 'when' statements

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Tue, 07 August 2018 17:37 UTC

Return-Path: <jason.sterne@nokia.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D0604130E0F for <netmod@ietfa.amsl.com>; Tue, 7 Aug 2018 10:37:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com
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 mBmeFnD7PvyH for <netmod@ietfa.amsl.com>; Tue, 7 Aug 2018 10:37:03 -0700 (PDT)
Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0136.outbound.protection.outlook.com [104.47.0.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D7651277BB for <netmod@ietf.org>; Tue, 7 Aug 2018 10:37:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F2YErPuZlSbWYszfnq6Nf/VCmTj/9GGTyr3+uaRGOg4=; b=hS9us3Xo5rYQvS88PEbuLFhyP41PvIl3gfMwBJFjJnmC3xkx8Qtmh2/g15sjkOh9h/HlJbWyMOICRoiOZKHtMBj0B6eqGATv9N/DyjlnArMFgf18kwuT2suZses5w26FmhIaq4ru40c1LsW9X5dpygCZuLCgLXoQ7b63rT4okJs=
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com (52.134.28.141) by VI1PR07MB4061.eurprd07.prod.outlook.com (52.134.20.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.13; Tue, 7 Aug 2018 17:36:59 +0000
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::dd01:b567:f507:8f07]) by VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::dd01:b567:f507:8f07%4]) with mapi id 15.20.1038.013; Tue, 7 Aug 2018 17:36:59 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: false() vs 'false' in 'when' statements
Thread-Index: AdQudRPPuaY7IZR/R5mIg6eZugDJwA==
Date: Tue, 07 Aug 2018 17:36:59 +0000
Message-ID: <VI1PR07MB3981A0DC1F7069AFC5BE72AD9B270@VI1PR07MB3981.eurprd07.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=jason.sterne@nokia.com;
x-originating-ip: [135.245.20.4]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR07MB4061; 6:WwqDTGqPLa7iD7Ua/rW123af1R5qMCEPQdllFgrutacqHdNnS9xq4OCetxcQyzj35tboWJ2G8udw4RGhE0RNARCt+QBGXMC3dNL2jaRRYRN3ubEW21hQQF0kYsq2aWFMwq/hzNtJGXczBI9LjbSC3idhxx2pY+OCONaaIx0JIivdpxnVTTNAm7Ef7hiRbx0VXdH2S+7lGVRO/JQWAD/dIhD4GEhZGPOvydpgY/snCQrPalrm+6rEp1df7HJEwYYWRyn0RyyIEB0ooJss1HYhY8oh0eqY1aKP2GVL99fi3cYDT7i0PKIf3GBtdfWmB4BfnBTt9lthFD8xyDsZLeWQTcKpSFYf57p23WEi5P5xFT3CywOFn6BLiC90ct/hVtv9S/Dfx98T2NzuS1QCBM/qwLPDMnaPlZuDCnYswzsUf1wW6dU+DEDwuNxgBsSuzC9mp7Q0sIYdtHGtDyD9X6RJdA==; 5:dJvWZ1KdiYpxpNC1lILDtTG7LTifokNuEI9W6ZiiMfiDJCSxIVrtlFce6TKJXdDT+Ywx4FFJ+wNhXVuth1WSddkfkKc/ADypAlKsc70PkAgWZdOSSNukRSh+b7JVZLGPi0gf3rsL1k1ZxJyBcCip+BVuaoSpNIM8kEKQSUObPO4=; 7:6IbLyPMiNh89waJnl3TGGjAhsIODMQE5Kczor0hwK8o8RJE0p/VquTEIrrX6btYSd4TW6s6TRwfI8OdPtRFxXVEcFeXNfYOmnU6FBntCuScu9a2al6pDSSRCS+GVUk9CMH9F6ixXIbeIApeSB6374AfOWJ9QoiFhDDa9q+qrk3xX3mvihX4v/A08CknPveRY2ha+2rfeWwV75xA5EFxjxXLwLIHuYO4gxWBOAjGqER+VPTymPeeAhn+v9ZEuuoaK
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 9d2bb2ac-67bc-4315-923c-08d5fc8c6127
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:VI1PR07MB4061;
x-ms-traffictypediagnostic: VI1PR07MB4061:
x-microsoft-antispam-prvs: <VI1PR07MB40613908F512187726EE262F9B270@VI1PR07MB4061.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(788757137089)(21748063052155);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231311)(11241501184)(806099)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR07MB4061; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB4061;
x-forefront-prvs: 0757EEBDCA
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(39860400002)(136003)(366004)(396003)(189003)(199004)(53754006)(102836004)(8676002)(5660300001)(256004)(33656002)(2906002)(99286004)(8936002)(105586002)(81166006)(81156014)(106356001)(2501003)(6916009)(26005)(478600001)(25786009)(5250100002)(14454004)(316002)(186003)(6436002)(5640700003)(54896002)(6306002)(66066001)(9686003)(5630700001)(68736007)(2900100001)(55016002)(7696005)(97736004)(74316002)(2351001)(53936002)(486006)(7736002)(6506007)(6116002)(1730700003)(86362001)(476003)(790700001)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB4061; H:VI1PR07MB3981.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: 2ckFxZfMa+HLxAvzeOLBGZsXYANlSGvbjHTuW79uKbSL275sv6cdvkm0H+Bm2grrCQl1dzWlIc00pIiQAKJZ67wFfGM4vair6Zf1hwuXc5dhAP9zxqdxSQR4ewXK1dwjclEcDJvqQ+rIEAxXkj4rgN3MAeRmEPpQJWSNPUyMMUh2Ff0gqHcvcifeD51IT5680aW0wJ7pwtHpV3jQC769Z7kNFHh4AvXS0Qa+tW6v0f80HQeUVro4cxyh7zeuIOeo0GF10yXBV2x7mbrpPFTnJmTZuLZI8KwTzNUjr+muTadqPRM2qSGMYyG6FpQ/qX7LgKXZDexXAGdPzPvqmkRbgOvyNrU7ZRuWIdK4AXu7MXS0jjvhEWztwNI+/uEEIBfvWV27b5I/NfMPnVGovXqQgA==
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_VI1PR07MB3981A0DC1F7069AFC5BE72AD9B270VI1PR07MB3981eurp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9d2bb2ac-67bc-4315-923c-08d5fc8c6127
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2018 17:36:59.7416 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB4061
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/guIa38N0eEOJwebNeg5KtW6gHv8>
Subject: [netmod] false() vs 'false' in 'when' statements
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Aug 2018 17:37:06 -0000

Hi all,

When comparing the value of a boolean leaf in a 'when' statement (or a 'must' statement), is an equality comparison to 'true' or 'false' the same as a check against true() or false() ?

For example:

leaf a {
    type boolean;
}
leaf b {
    type uint32;
    when "../a = 'true'";
}
leaf c {
    type uint32;
    when "../a = 'false'";
}
(note that neither b nor c can be configured if leaf a isn't explicitly configured with a value since there is no default)

If I replace the two 'when' statements above with the following instead, is the behavior the same ?
    ...
    when "../a = true()";
    ...
    when "../a = false()";
    ...

Or does "../a = true()" behave as an existence check on leaf a and would be enabled whether a is configured as true or false ?

Regards,
Jason