List.hd divs) div in
{p with div=option_map cast_to_i_var div; ps=List.map cast_to_i_n_var ps; conv=List.map cast_to_i_n_var conv}
+let cast_to_ps =
+ function
+ #i_num_var as y -> (y : i_num_var)
+ | `Bottom | `Pacman -> raise (Backtrack "foo")
+ | t ->
+ prerr_endline (print (t :> nf));
+ assert false (* algorithm failed *)
+
let subst_in_problem x inst ({freshno; div; conv; ps; sigma} as p) =
let len_ps = List.length ps in
(*(let l = Array.to_list (Array.init (freshno + 1) string_of_var) in
match u with
| `N i -> acc_new_ps,i
| _ ->
- let ps = List.map (fun t -> cast_to_i_num_var (subst false false x inst (t:> nf))) (acc_ps@acc_new_ps) in
+ let ps = List.map (fun t -> cast_to_ps (subst false false x inst (t:> nf))) (acc_ps@acc_new_ps) in
let super_simplified_ps = super_simplify_ps ps ps in
(*prerr_endline ("CERCO u:" ^ print (fst u :> nf));
List.iter (fun x -> prerr_endline ("IN: " ^ print (fst x :> nf))) ps;
(* ************************************************************************** *)
-(* let o1 () = magic_conv (Some"BOT") [] [] ["*"];; *)
-
-let o1 () = magic_conv None [] ["x BOT"] ["*"];;
-
let o1 () = magic_conv None [] ["x a b"; "x (_. BOT) c"] ["*"];;
+let o2 () = magic_conv None [] ["x (y (_. BOT) a) c"; "x (y a PAC) d"] ["*"];;
-main [o1() ];;
+main [o1() ; o2() ];;
(* main ([
p2 ; p4 ; p5 ; p6 ; p7 ; p8 ; p9 ; p10 ; p11 ; p12 ; p13 ;