aboutsummaryrefslogtreecommitdiff
path: root/Logic.icl
diff options
context:
space:
mode:
authorCamil Staps2016-11-27 23:28:01 +0100
committerCamil Staps2016-11-27 23:28:01 +0100
commit2e3a521ae5428891f03ccea9913915b5590a28fb (patch)
tree08b28d57a6790b2f78a54735d722eda69fba7113 /Logic.icl
parentReally fix #1 (diff)
Fix usage string and removeSubOptions
Diffstat (limited to 'Logic.icl')
-rw-r--r--Logic.icl9
1 files changed, 8 insertions, 1 deletions
diff --git a/Logic.icl b/Logic.icl
index bd87bf0..7438e82 100644
--- a/Logic.icl
+++ b/Logic.icl
@@ -226,7 +226,14 @@ all_atoms (App1 _ e) = all_atoms e
all_atoms (App2 e1 _ e2) = removeDup (all_atoms e1 ++ all_atoms e2)
removeSubOptions :: [[AtomOption]] -> [[AtomOption]]
-removeSubOptions opts = filter (\this -> not (any (\that -> all (flip isMember that) this) (removeMember this opts))) opts
+removeSubOptions opts = remove opts opts
+where
+ remove :: [[AtomOption]] [[AtomOption]] -> [[AtomOption]]
+ remove [] _ = []
+ remove [opt:opts] list
+ | any (\x -> all (flip isMember x) opt) list` = remove opts list`
+ | otherwise = [opt:remove opts list]
+ where list` = removeMember opt list
all_atom_options :: Expr -> [[AtomOption]]
all_atom_options e = removeSubOptions [opt \\ opt <- all_opts (sort (all_atoms e)) []]