5 let n = Random.int (List.length l) in
10 let n1 = List.length l1 in
11 let n = Random.int (n1 + List.length l2) in
12 if n >= n1 then List.nth l2 (n - n1) else List.nth l1 n
21 | x::_::xs -> x :: take' xs (n-1) in
22 let rec aux n inerts lams =
23 if n = 0 then List.hd inerts, take' (Util.sort_uniq (List.tl inerts)) 5
24 else let inerts, lams = if Random.int 2 = 0
25 then inerts, ("(" ^ acaso vars ^ ". " ^ acaso2 inerts lams ^ ")") :: lams
26 else ("(" ^ acaso inerts ^ " " ^ acaso2 inerts lams^ ")") :: inerts, lams
27 in aux (n-1) inerts lams
33 prerr_endline "\n########################### NEW TEST ###########################";
35 if n > 0 then repeat f (n-1)
42 let no_bound_vars = 10 in
43 let vars = Array.to_list
44 (Array.init no_bound_vars (fun x -> "x" ^ string_of_int x)) in
47 let div, convs = gen complex vars in
48 let str = "$ random simple test \nD " ^ div ^ String.concat "\nC " convs ^ "\n" in
51 (solve ++ problem_of ++ Parser.problem_of_string) str
54 prerr_endline "\n---- ALL TESTS COMPLETED ----"