]> matita.cs.unibo.it Git - fireball-separation.git/blobdiff - ocaml/problems.ml
Updated simple with current parser
[fireball-separation.git] / ocaml / problems.ml
index 9ff47787f995e34bf7222d6d495dc7c1ba7a9da9..28edcebd64cdffb4a1c8c8c0301aa74f071753c1 100644 (file)
@@ -1,4 +1,3 @@
-open Lambda4;;
 open Util;;
 
 (* Syntax for problem files in problem/ folder:
@@ -17,23 +16,12 @@ open Util;;
 
 *)
 
-(* assert_depends solves the problem, and checks if the result was expected *)
-let assert_depends x =
- let c = String.sub (label_of_problem x) 0 1 in
- match solve x with
- | `Unseparable s when c = "!" ->
-    failwith ("assert_depends: unseparable because: " ^ s ^ ".")
- | `Separable _  when c = "?" ->
-    failwith ("assert_depends: separable.")
- | _ -> ()
-;;
-
-(* 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)
 ;;