4 (* Syntax for problem files in problem/ folder:
6 - dollar ($) on newline
8 $! means that the problem is expected to be separable,
9 $? means that it is expected to be unseparable
14 - (D) (C) (N) stand respectively for divergent, convergent, numeric
16 - lines starting with spaces inherit the type from the last line
20 (* assert_depends solves the problem, and checks if the result was expected *)
21 let assert_depends x =
22 let c = String.sub (label_of_problem (fst x)) 0 1 in
24 | _, `Unseparable s when c = "!" ->
25 failwith ("assert_depends: unseparable because: " ^ s ^ ".")
26 | _, `Unseparable _ -> prerr_endline "Problem failed correctly."
27 | _, `Separable _ when c = "?" ->
28 failwith ("assert_depends: separable.")
33 (* div under a lambda in conv *)
35 if Array.length Sys.argv = 1
36 then failwith "no command line args. Please use e.g. ./a.out problems/*"
37 else Array.iteri (fun i filename -> if i > 0 then
38 List.iter (assert_depends ++ problem_of) (Parser.from_file filename)