From 926318dc6938a55df4658f8af46b069352ccb458 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 31 Mar 2016 19:37:22 +0200 Subject: Fixed issue where truth tables had too many options --- Logic.icl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Logic.icl') 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`) -- cgit v1.2.3