\r
let print_hline = Console.print_hline;;\r
\r
+open Pure\r
+\r
type var = int;;\r
type t =\r
| V of var\r
in aux 0\r
;;\r
\r
+let rec purify = function\r
+ | L t -> Pure.L (purify t)\r
+ | A (t1,t2) -> Pure.A (purify t1, purify t2)\r
+ | V n -> Pure.V n\r
+ | B -> Pure.B\r
+;;\r
+\r
+let check p sigma =\r
+ let div = purify p.div in\r
+ let conv = purify p.conv in\r
+ let sigma = List.map (fun (v,t) -> v, purify t) sigma in\r
+ let freshno = List.fold_right (fun (x,_) -> max x) sigma 0 in\r
+ let env = Pure.env_of_sigma freshno sigma in\r
+ assert (Pure.diverged (Pure.mwhd (env,div,[])));\r
+ assert (not (Pure.diverged (Pure.mwhd (env,conv,[]))));\r
+ ()\r
+;;\r
+\r
let sanity p =\r
print_endline (string_of_problem p); (* non cancellare *)\r
if p.conv = B then problem_fail p "p.conv diverged";\r
let hd_var, n_args = get_inert p.div in\r
match get_subterm_with_head_and_args hd_var n_args p.conv with\r
| None ->\r
- (try problem_fail (eat p) "Auto did not complete the problem" with Done _ -> ())\r
+ (try problem_fail (eat p) "Auto did not complete the problem" with Done sigma -> sigma)\r
| Some t ->\r
let j = find_eta_difference p t n_args - 1 in\r
let k = 1 + max\r
| x::xs -> conv_join xs ^ " ("^ x ^")"\r
;;\r
\r
-let auto' a b = auto (problem_of a (conv_join b));;\r
+let auto' a b =\r
+ let p = problem_of a (conv_join b) in\r
+ let sigma = auto p in\r
+ check p sigma\r
+;;\r
\r
(* Example usage of exec, interactive:\r
\r