src/Pure/Proof/reconstruct.ML
changeset 13342 915d4d004643
parent 13256 cf85c4f7dcf2
child 13610 d4a2ac255447
equal deleted inserted replaced
13341:f15ed50d16cf 13342:915d4d004643
    10 sig
    10 sig
    11   val quiet_mode : bool ref
    11   val quiet_mode : bool ref
    12   val reconstruct_proof : Sign.sg -> term -> Proofterm.proof -> Proofterm.proof
    12   val reconstruct_proof : Sign.sg -> term -> Proofterm.proof -> Proofterm.proof
    13   val prop_of' : term list -> Proofterm.proof -> term
    13   val prop_of' : term list -> Proofterm.proof -> term
    14   val prop_of : Proofterm.proof -> term
    14   val prop_of : Proofterm.proof -> term
    15   val expand_proof : Sign.sg -> string list -> Proofterm.proof -> Proofterm.proof
    15   val expand_proof : Sign.sg -> (string * term option) list ->
       
    16     Proofterm.proof -> Proofterm.proof
    16 end;
    17 end;
    17 
    18 
    18 structure Reconstruct : RECONSTRUCT =
    19 structure Reconstruct : RECONSTRUCT =
    19 struct
    20 struct
    20 
    21 
   328 
   329 
   329 (********************************************************************************
   330 (********************************************************************************
   330   expand and reconstruct subproofs
   331   expand and reconstruct subproofs
   331 *********************************************************************************)
   332 *********************************************************************************)
   332 
   333 
   333 fun expand_proof sg names prf =
   334 fun expand_proof sg thms prf =
   334   let
   335   let
   335     fun expand maxidx prfs (AbsP (s, t, prf)) = 
   336     fun expand maxidx prfs (AbsP (s, t, prf)) = 
   336           let val (maxidx', prfs', prf') = expand maxidx prfs prf
   337           let val (maxidx', prfs', prf') = expand maxidx prfs prf
   337           in (maxidx', prfs', AbsP (s, t, prf')) end
   338           in (maxidx', prfs', AbsP (s, t, prf')) end
   338       | expand maxidx prfs (Abst (s, T, prf)) = 
   339       | expand maxidx prfs (Abst (s, T, prf)) = 
   345           in (maxidx'', prfs'', prf1' %% prf2') end
   346           in (maxidx'', prfs'', prf1' %% prf2') end
   346       | expand maxidx prfs (prf % t) =
   347       | expand maxidx prfs (prf % t) =
   347           let val (maxidx', prfs', prf') = expand maxidx prfs prf
   348           let val (maxidx', prfs', prf') = expand maxidx prfs prf
   348           in (maxidx', prfs', prf' % t) end
   349           in (maxidx', prfs', prf' % t) end
   349       | expand maxidx prfs (prf as PThm ((a, _), cprf, prop, Some Ts)) =
   350       | expand maxidx prfs (prf as PThm ((a, _), cprf, prop, Some Ts)) =
   350           if not (a mem names) then (maxidx, prfs, prf) else
   351           if not (exists
       
   352             (fn (b, None) => a = b
       
   353               | (b, Some prop') => a = b andalso prop = prop') thms)
       
   354           then (maxidx, prfs, prf) else
   351           let
   355           let
   352             val (maxidx', (i, prf), prfs') = (case assoc (prfs, (a, prop)) of
   356             val (maxidx', (i, prf), prfs') = (case assoc (prfs, (a, prop)) of
   353                 None =>
   357                 None =>
   354                   let
   358                   let
   355                     val _ = message ("Reconstructing proof of " ^ a);
   359                     val _ = message ("Reconstructing proof of " ^ a);