From 83c44bfcf857d3b2f81c2d93e4ecd06afef2d41d Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 3 Jul 2015 23:58:46 +0200 Subject: Limit on number of atoms --- LogicParser.icl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'LogicParser.icl') 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] \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 -- cgit v1.2.3