+let rec dangerous_for_showstoppers_eat arities =
+ function
+ `N _
+ | `Var _
+ | `Lam _
+ | `Pacman -> []
+ | `Match(t,_,liftno,bs,args) ->
+ (* CSC: XXX partial dependency on the encoding *)
+ (match t with
+ `N _ -> []
+ | `Match _ as t -> dangerous_for_showstoppers_eat arities t
+ | `Var(x,_) -> dangerous_for_showstoppers_eat_inert arities x [] true
+ | `I((x,_),args') -> dangerous_for_showstoppers_eat_inert arities x (Listx.to_list args') true
+ ) @ List.concat (List.map (dangerous_for_showstoppers_eat arities ) args)
+ | `I((k,_),args) -> dangerous_for_showstoppers_eat_inert arities k (Listx.to_list args) false
+
+and dangerous_for_showstoppers_eat_inert arities k args in_match =
+ List.concat (List.map (dangerous_for_showstoppers_eat arities ) args) @
+ try
+ let arity = arity_of arities k in
+ if in_match && List.length args <> arity then [k]
+ else if List.length args > arity then [k]
+ else []
+ with
+ Not_found -> []
+
+let multiple_arities p arities =
+ List.concat (List.map (dangerous_for_showstoppers_eat arities) ((p.ps :> nf_nob list) @ (p.conv :> nf_nob list)))
+