diff options
author | Camil Staps | 2015-07-03 23:58:46 +0200 |
---|---|---|
committer | Camil Staps | 2015-07-03 23:58:46 +0200 |
commit | 83c44bfcf857d3b2f81c2d93e4ecd06afef2d41d (patch) | |
tree | 1c62a2084b3273f72de685570ed00e1255bde502 | |
parent | Readme (diff) |
Limit on number of atoms
-rw-r--r-- | LogicParser.icl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LogicParser.icl b/LogicParser.icl index fbf19ef..a47ffa5 100644 --- a/LogicParser.icl +++ b/LogicParser.icl @@ -27,12 +27,13 @@ import StdEnv, StdMaybe, ArgEnv, Logic Start | isEmpty exprs = abort ("Usage: " +++ argv.[0] +++ " -b -nt [-e] [-html|-latex] <string>\n") -| otherwise = show outputoption (compute (if extended truthtable_n simple_truthtable_n (map parse exprs))) +| length (foldr (++) [] (map all_atoms exprs)) > 8 = abort "You don't need more than 8 atomic expressions." +| otherwise = show outputoption (compute (if extended truthtable_n simple_truthtable_n exprs)) where argc = size argv - 1 argv = getCommandLine - exprs = filter (\s . s.[0] <> '-') [argv.[n] \\ n <- [1..argc]] + exprs = map parse (filter (\s . s.[0] <> '-') [argv.[n] \\ n <- [1..argc]]) extended = hasArg "-e" outputoption |