From 0400abcbb0cb6e188e86873148c84a92b75d3a82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20M=C3=B6rtberg?= Date: Thu, 16 Apr 2015 11:17:12 +0200 Subject: [PATCH] Change gensym --- Connections.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Connections.hs b/Connections.hs index e5c4565..da48162 100644 --- a/Connections.hs +++ b/Connections.hs @@ -240,10 +240,14 @@ propInvFormulaIncomp phi b = incomparables (invFormula phi b) -- | Nominal gensym :: [Name] -> Name -gensym xs = Name ('?' : show max) - where max = maximum' [ read x | Name ('?':x) <- xs ] - maximum' [] = 0 - maximum' xs = maximum xs + 1 +gensym xs = head (ys \\ xs) + where ys = map Name $ ["i","j","k","l"] ++ map (('i':) . show) [0..] + +-- gensym :: [Name] -> Name +-- gensym xs = Name ('?' : show max) +-- where max = maximum' [ read x | Name ('?':x) <- xs ] +-- maximum' [] = 0 +-- maximum' xs = maximum xs + 1 gensyms :: [Name] -> [Name] gensyms d = let x = gensym d in x : gensyms (x : d) -- 2.34.1