src/Pure/Proof/reconstruct.ML
changeset 64986 b81a048960a3
parent 64556 851ae0e7b09c
child 67649 1e1782c1aedf
equal deleted inserted replaced
64985:69592ac04836 64986:b81a048960a3
    11   val prop_of' : term list -> Proofterm.proof -> term
    11   val prop_of' : term list -> Proofterm.proof -> term
    12   val prop_of : Proofterm.proof -> term
    12   val prop_of : Proofterm.proof -> term
    13   val proof_of : Proof.context -> thm -> Proofterm.proof
    13   val proof_of : Proof.context -> thm -> Proofterm.proof
    14   val expand_proof : Proof.context -> (string * term option) list ->
    14   val expand_proof : Proof.context -> (string * term option) list ->
    15     Proofterm.proof -> Proofterm.proof
    15     Proofterm.proof -> Proofterm.proof
       
    16   val clean_proof_of : Proof.context -> bool -> thm -> Proofterm.proof
    16 end;
    17 end;
    17 
    18 
    18 structure Reconstruct : RECONSTRUCT =
    19 structure Reconstruct : RECONSTRUCT =
    19 struct
    20 struct
    20 
    21 
   386           end
   387           end
   387       | expand maxidx prfs prf = (maxidx, prfs, prf);
   388       | expand maxidx prfs prf = (maxidx, prfs, prf);
   388 
   389 
   389   in #3 (expand (Proofterm.maxidx_proof prf ~1) [] prf) end;
   390   in #3 (expand (Proofterm.maxidx_proof prf ~1) [] prf) end;
   390 
   391 
       
   392 
       
   393 (* cleanup for output etc. *)
       
   394 
       
   395 fun clean_proof_of ctxt full thm =
       
   396   let
       
   397     val (_, prop) =
       
   398       Logic.unconstrainT (Thm.shyps_of thm)
       
   399         (Logic.list_implies (Thm.hyps_of thm, Thm.prop_of thm));
       
   400   in
       
   401     Proofterm.proof_of (Proofterm.strip_thm (Thm.proof_body_of thm))
       
   402     |> reconstruct_proof ctxt prop
       
   403     |> expand_proof ctxt [("", NONE)]
       
   404     |> Proofterm.rew_proof (Proof_Context.theory_of ctxt)
       
   405     |> Proofterm.no_thm_proofs
       
   406     |> not full ? Proofterm.shrink_proof
       
   407   end;
       
   408 
   391 end;
   409 end;