From 6e922f4eb4a947f1e3a9a957f465102e143164f1 Mon Sep 17 00:00:00 2001 From: acondolu Date: Sun, 10 Jun 2018 17:27:16 +0200 Subject: [PATCH] Improved definition of eta_eq Probably still not just right --- ocaml/simple.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ocaml/simple.ml b/ocaml/simple.ml index 079774e..34f9f72 100644 --- a/ocaml/simple.ml +++ b/ocaml/simple.ml @@ -23,8 +23,11 @@ let rec is_stuck = function ;; let eta_eq' = - let rec aux l1 l2 t1 t2 = match t1, t2 with - | _, _ when is_stuck t1 || is_stuck t2 -> true + let rec aux l1 l2 t1 t2 = + let stuck1, stuck2 = is_stuck t1, is_stuck t2 in + match t1, t2 with + | _, _ when not stuck1 && stuck2 -> false + | _, _ when stuck1 -> true | L t1, L t2 -> aux l1 l2 (fst t1) (fst t2) | L t1, t2 -> aux l1 (l2+1) (fst t1) t2 | t1, L t2 -> aux (l1+1) l2 t1 (fst t2) -- 2.39.2