let add_proof pf p hs =
  begin
    if not (Property.equal (WpPropId.property_of_id p) pf.target)
    then Wp_parameters.fatal "Partial proof inconsistency" ;
    List.iter
      (fun iph ->
         if not (WpPropId.is_requires iph) then
           pf.dependencies <- Property.Set.add iph pf.dependencies
      ) hs ;
    let k = WpPropId.subproof_idx p in
    match WpPropId.parts_of_id p with
      | None -> pf.proved.(k) <- Complete
      | Some(p,n) ->
          match pf.proved.(k) with
            | Complete -> ()
            | Noproof ->
                let bv = Bitvector.create n in
                Bitvector.set_range bv 0 (p-1) ;
                Bitvector.set_range bv (p+1) (n-1) ;
                pf.proved.(k) <- Parts bv
            | Parts bv ->
                Bitvector.clear bv p ;
                if Bitvector.is_empty bv
                then pf.proved.(k) <- Complete
  end