let rec get_proofs hmap ip : proof list =
  try Hip.find hmap ip
  with Not_found ->
    Hip.add hmap ip [] ;
    (* Force dependencies to be computed *)
    ignore (Properties_status.strongest ip) ;
    (* Now report *)
    let ctree = Consolidation_tree.get ip in
    let proofs =
      List.fold_left
        (fun ps s ->
           match s.Consolidation_tree.value with
             | Checked {valid=True;emitter=e} , _ ->
                 let hs =
                   List.filter
                     (fun s -> not (is_complete hmap s))
                     s.Consolidation_tree.hypothesis
                 in
                 let hips =
                   List.sort
                     Property.compare
                     (List.map (fun h -> h.Consolidation_tree.property) hs)
                 in
                 { p_emitter=e ; p_pending=hips } :: ps
             | _ -> ps
        ) [] ctree.Consolidation_tree.status in
    let ordered = List.sort compare_proof proofs in
    Hip.replace hmap ip ordered ; ordered

and is_complete hmap (s : Consolidation_tree.t) =
  List.exists
    (fun p -> p.p_pending=[])
    (get_proofs hmap s.Consolidation_tree.property)