From fbcba8c580adbee9414fdd2d299d3740313abe11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szynwelski?= Date: Fri, 17 Jun 2016 13:23:14 +0200 Subject: [PATCH] Optimization of incompleteness function. --- src/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Main.hs b/src/Main.hs index c6b631d..fc906dc 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -19,8 +19,9 @@ import Prelude hiding (and, curry, filter, lookup, map, not, incompleteness :: NominalType i => State i -> Set [i] incompleteness State{..} = filter (not . hasEqRow) ssa where + sss = map (row t) ss -- true if the sequence sa has an equivalent row in ss - hasEqRow sa = exists (\s2 -> eq (row t sa) (row t s2)) ss + hasEqRow = contains sss . row t -- We can determine its consistency with the following -- Returns equivalent rows (fst) with all inequivalent extensions (snd)