open Lambda4;; open Util;; (* Syntax for problem files in problem/ folder: - dollar ($) on newline begin new problem $! means that the problem is expected to be separable, $? means that it is expected to be unseparable - (#) on new line comment line - (D) (C) (N) stand respectively for divergent, convergent, numeric - lines starting with spaces inherit the type from the last line *) let assert_separable x = match solve x with | _, `Separable _ -> () | _, `Unseparable s -> failwith ("assert_separable: unseparable because: " ^ s ^ ".") ;; let assert_unseparable x = match solve x with | _, `Unseparable _ -> () | _, `Separable _ -> failwith ("assert_unseparable: separable.") ;; let assert_depends x = let c = String.sub (Lambda4.label_of_problem (fst x)) 0 1 in if c = "!" then assert_separable x else if c = "?" then assert_unseparable x else (solve x; ()) ;; (* TODO *) (* div under a lambda in conv *) if Array.length Sys.argv = 1 then failwith "no command line args. Please use e.g. ./a.out problems/*" else Array.iteri (fun i filename -> if i > 0 then List.iter (assert_depends ++ Lambda4.tmp) (Parser.from_file filename) ) Sys.argv ;;