-let pp_proof names goalproof proof =
- String.concat "\n" (List.map (string_of_id names) (wfo goalproof proof)) ^
- "\ngoal is demodulated with " ^
- (String.concat " "
- ((List.map (fun (_,i,_,_) -> string_of_int i) goalproof)))
+let pp_proof names goalproof proof subst id initial_goal =
+ prerr_endline ("AAAAA" ^ string_of_int id);
+ prerr_endline (String.concat "+" (List.map string_of_int (wfo goalproof proof
+ id)));
+ String.concat "\n" (List.map (string_of_id names) (wfo goalproof proof id)) ^
+ "\ngoal:\n " ^
+ (String.concat "\n "
+ (fst (List.fold_right
+ (fun (r,pos,i,s,pred) (acc,g) ->
+ let _,_,left,right = open_eq g in
+ let ty =
+ match pos with
+ | Utils.Left -> CicReduction.head_beta_reduce (Cic.Appl[pred;right])
+ | Utils.Right -> CicReduction.head_beta_reduce (Cic.Appl[pred;left])
+ in
+ let ty = Subst.apply_subst s ty in
+ ("("^ string_of_rule r ^ " " ^ string_of_int i^") -> "
+ ^ CicPp.pp ty names) :: acc,ty) goalproof ([],initial_goal)))) ^
+ "\nand then subsumed by " ^ string_of_int id ^ " when " ^ Subst.ppsubst subst