From bcfc5aa7b45e40547ceacef9267bc40827d87e84 Mon Sep 17 00:00:00 2001 From: Robbert Krebbers <mail@robbertkrebbers.nl> Date: Tue, 12 Jul 2016 10:43:33 +0200 Subject: [PATCH] Notations for short-circuit Boolean connectives && and ||. --- heap_lang/notation.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/heap_lang/notation.v b/heap_lang/notation.v index 0ebbc77e5..faed72775 100644 --- a/heap_lang/notation.v +++ b/heap_lang/notation.v @@ -100,6 +100,10 @@ Notation "'let:' x := e1 'in' e2" := (LamV x%bind e2%E e1%E) Notation "e1 ;; e2" := (LamV BAnon e2%E e1%E) (at level 100, e2 at level 200, format "e1 ;; e2") : val_scope. +(* Shortcircuit Boolean connectives *) +Notation "e1 && e2" := (If e1%E e2%E (Lit (LitBool false))) : expr_scope. +Notation "e1 || e2" := (If e1%E (Lit (LitBool true)) e2%E) : expr_scope. + (** Notations for option *) Notation NONE := (InjL #()). Notation SOME x := (InjR x). -- GitLab