fun t -> match t with `Var _ -> None | x -> if arity_of_hd x <= 0 then None else hd_of x
) ((match p.div with Some t -> [(t :> i_n_var)] | _ -> []) @ p.ps)) in
(match heads with
- [] ->
- assert false
+ [] -> (
+ try
+ fst (List.find (((<) 0) ++ snd) (concat_map free_vars' (p.conv :> nf list)))
+ with
+ Not_found -> assert false
+ )
| x::_ ->
prerr_endline ("INSTANTIATING TO EAT " ^ string_of_var x);
x)