From 0c2f070e30e80810236099f3a9dcfb6edca0f783 Mon Sep 17 00:00:00 2001 From: acondolu Date: Mon, 24 Jul 2017 15:38:50 +0200 Subject: [PATCH] Fixed bug in Scott.mk_match when no branches (Fixes problem 1 in solved) --- ocaml/problems/solved | 3 +++ ocaml/pure.ml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 ocaml/problems/solved diff --git a/ocaml/problems/solved b/ocaml/problems/solved new file mode 100644 index 0000000..6ea3dd2 --- /dev/null +++ b/ocaml/problems/solved @@ -0,0 +1,3 @@ +$! Scott mk_math with empty bs +D b (_. _. BOT) +C b diff --git a/ocaml/pure.ml b/ocaml/pure.ml index 95dae15..51d1feb 100644 --- a/ocaml/pure.ml +++ b/ocaml/pure.ml @@ -118,7 +118,7 @@ let mk_match t bs = let bs = List.sort (fun (n1,_) (n2,_) -> compare n1 n2) bs in let rec aux m t = function - [] -> dummy + [] -> A (L dummy, t) | (n,p)::tl as l -> if n = m then A (A (t, L (lift (m+1) p)), L (aux (m+1) (V 0) tl)) -- 2.39.2