+ let rec orphan_murder bag acc i =
+ match Terms.M.find i bag with
+ | (_,_,_,Terms.Exact _),discarded -> (discarded,acc)
+ | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),true -> (true,acc)
+ | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),false ->
+ if (List.mem i acc) then (false,acc)
+ else match orphan_murder bag acc i1 with
+ | (true,acc) -> (true,acc)
+ | (false,acc) ->
+ let (res,acc) = orphan_murder bag acc i2 in
+ if res then res,acc else res,i::acc
+;;
+
+ let orphan_murder bag cl =
+ let (id,_,_,_) = cl in
+ let (res,_) = orphan_murder bag [] id in
+ if res then debug "Orphan murdered"; res
+;;
+