diff options
author | Camil Staps | 2016-03-31 19:37:22 +0200 |
---|---|---|
committer | Camil Staps | 2016-03-31 19:37:22 +0200 |
commit | 926318dc6938a55df4658f8af46b069352ccb458 (patch) | |
tree | 119ca9da7c7bd507bd5129b56816ecb8aa0f3da8 /Logic.icl | |
parent | Fixed bug where atom options were duplicated (diff) |
Fixed issue where truth tables had too many options
Diffstat (limited to 'Logic.icl')
-rw-r--r-- | Logic.icl | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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`) |