aux showstoppers xs
with
Dangerous ->
- aux (sort_uniq (h::showstoppers)) ps
- in
- let showstoppers = sort_uniq (aux showstoppers ps) in
- let dangerous_conv =
- List.map (dangerous_conv p arities showstoppers) (conv :> nf list) in
+ aux (sort_uniq (h::showstoppers)) ps in
+
+ let showstoppers = sort_uniq (aux showstoppers ps) in
+ let dangerous_conv =
+ List.map (dangerous_conv p arities showstoppers) (conv :> nf list) in
prerr_endline ("dangerous_conv lenght:" ^ string_of_int (List.length dangerous_conv));
List.iter (fun l -> prerr_endline (String.concat " " (List.map (string_of_var p.var_names) l))) dangerous_conv;
- let showstoppers' = showstoppers @ List.concat dangerous_conv in
- let showstoppers' = sort_uniq (match div with
- | None -> showstoppers'
- | Some div ->
- if List.exists ((=) (hd_of_i_var div)) showstoppers'
- then showstoppers' @ free_vars (div :> nf) else showstoppers') in
- if showstoppers <> showstoppers' then edible p arities showstoppers' else showstoppers', dangerous_conv
+ let showstoppers' = showstoppers @ List.concat dangerous_conv in
+ let showstoppers' = sort_uniq (match div with
+ | None -> showstoppers'
+ | Some div ->
+ if List.exists ((=) (hd_of_i_var div)) showstoppers'
+ then showstoppers' @ free_vars (div :> nf) else showstoppers') in
+ if showstoppers <> showstoppers' then edible p arities showstoppers' else showstoppers', dangerous_conv
;;
let precompute_edible_data {ps; div} xs =
) xs)
;;
+(** Returns (p, showstoppers_step, showstoppers_eat) where:
+ - showstoppers_step are the heads occurring twice
+ in the same discriminating set
+ - showstoppers_eat are the heads in ps having different number
+ of arguments *)
let critical_showstoppers p =
let p = super_simplify p in
let hd_of_div = match p.div with None -> [] | Some t -> [hd_of_i_var t] in
let showstoppers_eat = List.filter
(fun x -> not (List.mem x showstoppers_step))
showstoppers_eat in
- List.iter (fun v -> prerr_endline ("DANGEROUS STEP: " ^ (string_of_var p.var_names) v)) showstoppers_step;
- List.iter (fun v -> prerr_endline ("DANGEROUS EAT: " ^ (string_of_var p.var_names) v)) showstoppers_eat;
+List.iter (fun v -> prerr_endline ("DANGEROUS STEP: " ^ (string_of_var p.var_names) v)) showstoppers_step;
+List.iter (fun v -> prerr_endline ("DANGEROUS EAT: " ^ (string_of_var p.var_names) v)) showstoppers_eat;
p, showstoppers_step, showstoppers_eat
;;