]> matita.cs.unibo.it Git - fireball-separation.git/blob - ocaml/problems.ml
New interesting example
[fireball-separation.git] / ocaml / problems.ml
1 open Util;;
2
3 (* Syntax for problem files in problem/ folder:
4
5 - dollar ($) on newline
6   begin new problem
7   $! means that the problem is expected to be separable,
8   $? means that it is expected to be unseparable
9
10 - (#) on new line
11   comment line
12
13 - (D) (C) (N) stand respectively for divergent, convergent, numeric
14
15 - lines starting with spaces inherit the type from the last line
16
17 *)
18
19 let main f =
20  print_endline Sys.executable_name;
21  try ignore (Str.search_forward (Str.regexp_string "test") Sys.executable_name 0)
22  with Not_found ->
23   (if Array.length Sys.argv = 1
24    then failwith "no command line args. Please use e.g. ./cmd.out problems/*"
25    else Array.iteri (fun i filename -> if i > 0 then
26     List.iter f (Parser.from_file filename)) Sys.argv)
27 ;;