1 let three = Array.length Sys.argv = 1;;
5 then (module Lambda3 : Discriminator.Discriminator)
6 else (module Lambda4);;
8 module Pippo = (val discriminator);;
12 let n = Random.int (List.length l) in
17 let n1 = List.length l1 in
18 let n = Random.int (n1 + List.length l2) in
19 if n >= n1 then List.nth l2 (n - n1) else List.nth l1 n
26 | x::xs -> x :: (take xs (n-1))
30 let rec aux n inerts lams =
31 if n = 0 then take (Util.sort_uniq inerts) 5
32 else let inerts, lams = if Random.int 2 = 0
33 then inerts, ("(" ^ acaso vars ^ ". " ^ acaso2 inerts lams ^ ")") :: lams
34 else ("(" ^ acaso inerts ^ " " ^ acaso2 inerts lams^ ")") :: inerts, lams
35 in aux (n-1) inerts lams
45 | x1::x2::xs -> let a, b = take' xs (n-1) in x1::a,x2::b in
46 let rec aux n inerts lams =
47 if n = 0 then List.hd inerts, take' (Util.sort_uniq (List.tl inerts)) 5
48 else let inerts, lams = if Random.int 2 = 0
49 then inerts, ("(" ^ acaso vars ^ ". " ^ acaso2 inerts lams ^ ")") :: lams
50 else ("(" ^ acaso inerts ^ " " ^ acaso2 inerts lams^ ")") :: inerts, lams
51 in aux (n-1) inerts lams
57 prerr_endline "\n*************************** NEW TEST ***************************";
59 if n > 0 then repeat f (n-1)
64 List.iter prerr_endline tms; prerr_newline ();
65 ) in Lambda3.main [Lambda3.magic tms ["*"]]
67 let call_main4 div convs nums =
69 (match div with Some div -> prerr_endline ("DIV: " ^ div) | None -> ());
70 print_endline "CONV:"; List.iter prerr_endline convs;
71 print_endline "NUMS:"; List.iter prerr_endline nums;
73 ) in Lambda4.main [Lambda4.magic_conv div convs nums ["*"]]
80 let vars = ["x"; "y"; "z"; "v" ; "w"; "a"; "b"; "c"] in
82 (* let open Parser in *)
84 if three then repeat (fun _ ->
85 let tms = test3 complex vars in
89 let div, (conv, nums) = test4 complex vars in
90 call_main4 (Some div) conv nums
94 prerr_endline "\n---- ALL TESTS COMPLETED ----"