let compare_proof p1 p2 =
  let n1 = List.length p1.p_pending in
  let n2 = List.length p2.p_pending in
  let c = Datatype.Int.compare n1 n2 in
  if c<>0 then c else String.compare p1.p_emitter p2.p_emitter