failwith ("assert_unseparable: separable.")
;;
-let solve_many = List.iter assert_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; ())
+;;
+
+let main () =
+((* <main> *)
+
+let solve_many = List.iter assert_separable in
(* TODO *)
(* div under a lambda in conv *)
(* assert_unseparable (problem_of (Some"`y y") ["x (_. y y)"] []);; *)
-List.iter (assert_separable ++ Lambda4.tmp) (Parser.from_file "problems/p");;
+List.iter (assert_separable ++ Lambda4.tmp) (Parser.from_file "problems/p");
(* q-series problems *)
None
["a d e"]
["a b"; "a c"]
- ;;
+ in
let q2 () = problem_of
None
["a d e"]
["a b" ]
- ;;
+ in
let q3 () = problem_of
(Some "x y")
["a d e f"]
["a b" ]
- ;;
+ in
let q4 () = problem_of
None
["f (x.a b c d)"]
["a b" ]
- ;;
+ in
let q5 () = problem_of
(Some"x y")
["(y. x)"]
["x"]
- ;;
+ in
let q6 () = problem_of
(Some"x w")
["(y. x z)"]
["y"]
- ;;
+ in
let q7 () = problem_of
(Some "(b (c d (e f f k.(g e))) f)")
["(f d (e f) k.e k.l.(c d) (b (g e) k.h) (i b k.l.m.e b) a)";
"(f d (e f) k.e k.l.(c d) (b (g e) k.h) (d k.e) (f d (e f) k.e) a)";
"(g (e f) (g e h) (f d (e f) k.e) k.(c d l.(c d)) (g e h) (g f (e f f (e f f k.(g e))) (g (e f)) (b (c d (e f f k.(g e))) (b (g (e f)) (e f)) (b (g (e f)) k.l.e))) a)"]
- ;;
+ in
(**********************)
let q8 () = problem_of
(Some"x a")
["y (x b c)"] ["j"]
-;;
+in
let q9 () = problem_of
(Some"x a")
["y x"] ["a (y a b b b)"]
-;;
+in
let q11 () = problem_of
(Some "x y")
- ["a (x z)"] [] ;;
+ ["a (x z)"] [] in
let q10 () = problem_of
(Some "b (k. c) d (e (f g) (k. g)) (k. l. c) (k. l. b (m. c)) (k. l. c) (b (k. c) (k. l. b (m. c)) (k. c f)
"b (k. c) d (e (f g) (k. g)) (k. l. c) (k. l. b (m. c)) (k. l. m. n. o. p. o) (e (f g) (k. g) (c f) (k. i) f)";
"b (k. c) d (e (f g) (k. g)) (k. l. c) (k. l. b (m. c)) (k. l. c) (k. b)";
"e (f g) (k. g) (c f) (k. e) (k. b (l. c)) (c f (k. b (l. c)) (k. l. b (m. k))) (k. b (l. k)) (e (f g) (k. g) (c f) (c f (k. b (l. c)) (k. e)))";
-] ;;
+] in
let m1 () = problem_of None []
["y z"; "x z"; "x (a k) u"; "x (a r)"; "x (a k) v"]
-;;
+in
let m2 () = problem_of None []
["y z"; "x z"; "x (a k) u"; "x (a r)"; "x (a k) v"]
-;;
+in
let n1 () = problem_of (Some"b (c b) (k. l. c b d) (c e) (k. l. m. f) (g (k. c e) (b (c b) (k. l. c b d) (c e) b)) (f c (h (k. c c g))) (g (k. c e) (k. i) f e (g (k. c e) (k. i) (c b) (c (c e)) (k. l. c b d)) (k. e c (k (l. f))) (g (k. c e) (k. i) e)) (g (k. c e) (k. i) (c b) (f c) b)")
"d h (b (c b) (k. l. c b d) (c e)) (k. g (l. c e) (l. i) (c b) (k c) b) d b (b (c b) (k. l. c b d) (c e) b (g (k. c e) (k. i) (c b)) (k. c)) a";
"g (k. c e) (k. d d) (k. k k) (e c (d d (d c)) i) (k. g (l. k e) (l. d d)) (g i (b (c b) (k. l. c b d) (e c (d d (d c)) (k. c e (f c)) (k. k (c k) (l. m. c k d) (c e) k (g (l. c e) (l. i) (c k)) (l. c))))) (c b) a";
"g (k. c e) (k. i) f e (g (k. c e) (k. i) (c b) (c (c e)) (k. l. c b d)) (k. e c (k (l. f))) (g (k. c e) (k. i) e) a"
-] ;;
+] in
let n2 () = problem_of
(Some"b b (c d) (k. d e) (k. k) (k. l. b)")
"f (g (k. e)) (k. b b) (c d (k. k d) (k. l. l) c) (k. c d) (k. c) (k. l. m. b b) a";
"f (g (k. e)) (k. b b) (c d (k. k d) (k. l. l) c) (k. c d) (b (b b) (d (g(d e) (g (k. e)) h) (b b (c d) (k. l. b)) (b (k. h))) (e (b b (c d))) (d (g (d e) (g (k. e)) h) (b b (c d) (k. l. b)) (g (k. e) (k. k)))) (k. d e (l. d e) f) a";
]
-;;
+in
let n3 () = problem_of
(Some"b (k. c (c d e f)) (k. l. f (m. f) (m. f) (m. n. n))")
"e e (k. k d e (l. l)) (g e) (c d e b (e e (c (c d e f)))) (d (e e (k. k d e (l. l))) (k. k i)) (k. i (l. c (c d e f))) (k. h) a";
"f (k. f) (k. f) (f h) (f h (c d e (f i))) (k. b) (f i (c d e)) (k. h) a";
"g e f (f (k. f) (f (k. f) (k. l. f)) (c d e b)) (f (k. f) (k. f) (k. l. l) b) (f (k. h)) (c d e (f i) (e e) (g e) (k. l. e)) (f (k. f) f) (f (k. f) (k. f) (k. l. l) (c (k. i (l. c (c d e f))))) a";
-] ;;
+] in
(* ************************************************************************** *)
-let o1 () = problem_of None [] ["x a b"; "x (_. BOT) c"] ;;
-let o2 () = problem_of None [] ["x (y (_. BOT) a) c"; "x (y a PAC) d"] ;;
-let o3 () = problem_of
- (Some"y (x a1 BOMB c) (x BOMB b1 d)")
- [ "y (x a2 BOMB c) (x BOMB b1 d)";
- "y (x a1 BOMB c) (x BOMB b2 d)";] [] ;;
-let o4 () = problem_of (Some"x BOMB a1 c")
- [ "x y BOMB d"; "x BOMB a2 c" ] [] ;;
-let o5 () = problem_of (Some"BOT") [] [] ;;
-let o6 () = problem_of (Some"x BOMB") ["x y"] [];;
-
-solve_many (List.map ((|>) ()) [
- o1; o2; o3; o4; o5; o6
-]);;
-
-assert_unseparable(problem_of None ["BOT"] []);;
-assert_unseparable(problem_of (Some"x y") ["x BOMB"] []);;
-assert_unseparable(problem_of (Some"x y z") ["x BOMB z"; "x y y"] []);;
+List.iter (assert_separable ++ Lambda4.tmp) (Parser.from_file "problems/o");
+
+assert_unseparable(problem_of (Some"x y") ["x BOMB"] []);
+assert_unseparable(problem_of (Some"x y z") ["x BOMB z"; "x y y"] []);
solve_many [
problem_of
(* 3 *) "e f (k. k) (g e) (e f (k. e)) (h (k. g e (g e)) (h (k. g e (g e)))) (k. d) (k. l. m. c k) a";
(* 4 *) "g (k. e f g) (k. h c) (b (g e) h (k. c (l. m. m k l))) (k. c b g) (k. e f (l. l) (g e) (e f (l. e))) f a";
]
-];;
+];
(* This fails *)
(* solve (problem_of
n1 ;
n2 ;
n3
-]));;
+]));
+
+(* </main> *));;
+
+if Array.length Sys.argv = 1
+ then main ()
+else Array.iteri (fun i filename -> if i > 0 then
+ List.iter (assert_depends ++ Lambda4.tmp) (Parser.from_file filename)
+ ) Sys.argv
+;;