X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=ocaml%2Fproblems.ml;h=28edcebd64cdffb4a1c8c8c0301aa74f071753c1;hb=dc6b7a6afe8b1fcf4f5998089ed2ef28f255da0a;hp=5f86177db4e18de320e94239a4f80d4fcf1744c0;hpb=38ecafd7f8a1b5137f642bfa433d27cef8de2908;p=fireball-separation.git diff --git a/ocaml/problems.ml b/ocaml/problems.ml index 5f86177..28edceb 100644 --- a/ocaml/problems.ml +++ b/ocaml/problems.ml @@ -1,4 +1,3 @@ -open Lambda4;; open Util;; (* Syntax for problem files in problem/ folder: @@ -17,33 +16,12 @@ open Util;; *) -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 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 ++ problem_of) (Parser.from_file filename) - ) Sys.argv +let main f = + print_endline Sys.executable_name; + try ignore (Str.search_forward (Str.regexp_string "test") Sys.executable_name 0) + with Not_found -> + (if Array.length Sys.argv = 1 + then failwith "no command line args. Please use e.g. ./cmd.out problems/*" + else Array.iteri (fun i filename -> if i > 0 then + List.iter f (Parser.from_file filename)) Sys.argv) ;;