aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Logic.icl9
1 files changed, 5 insertions, 4 deletions
diff --git a/Logic.icl b/Logic.icl
index 0406d1f..0b5c0cf 100644
--- a/Logic.icl
+++ b/Logic.icl
@@ -226,11 +226,12 @@ all_atoms (App1 _ e) = all_atoms e
all_atoms (App2 e1 _ e2) = removeDup (all_atoms e1 ++ all_atoms e2)
all_atom_options :: Expr -> [[AtomOption]]
-all_atom_options e = [opt \\ opt <- all_options (all_atoms e) []]
+all_atom_options e = removeDup [opt \\ opt <- all_opts (sort (all_atoms e)) []]
where
- all_options :: [AtomName] [AtomOption] -> [[AtomOption]]
- all_options [] opts = [opts]
- all_options [a:as] opts = all_options as (opts ++ [(a,False)]) ++ all_options as (opts ++ [(a,True)])
+ all_opts :: [AtomName] [AtomOption] -> [[AtomOption]]
+ all_opts [] opts = [opts]
+ all_opts [a:as] opts
+ = all_opts as (opts ++ [(a,False)]) ++ all_opts as (opts ++ [(a,True)])
substitute :: AtomOption Expr -> Expr
substitute (a,b) (Atom a`)