src/HOL/Import/replay.ML
changeset 19068 04b302f2902d
parent 19067 c0321d7d6b3d
child 19203 778507520684
equal deleted inserted replaced
19067:c0321d7d6b3d 19068:04b302f2902d
   326 	val _ = writeln ("Replaying (from cache) "^thmname^" ...")
   326 	val _ = writeln ("Replaying (from cache) "^thmname^" ...")
   327 	fun rps [] thy = thy
   327 	fun rps [] thy = thy
   328 	  | rps (t::ts) thy = rps ts (rp t thy)
   328 	  | rps (t::ts) thy = rps ts (rp t thy)
   329 	and rp (ThmEntry (thyname', thmname', aborted, History history)) thy = rps history thy	    
   329 	and rp (ThmEntry (thyname', thmname', aborted, History history)) thy = rps history thy	    
   330 	  | rp (DeltaEntry ds) thy = fold delta ds thy
   330 	  | rp (DeltaEntry ds) thy = fold delta ds thy
   331 (*    datatype deltastate = Consts of (string * typ * mixfix) list
       
   332 			| Specification of (string * string * bool) list * term
       
   333 			| Hol_mapping of string * string * string
       
   334 			| Hol_pending of string * string * term
       
   335 			| Hol_const_mapping of string * string * string
       
   336 			| Hol_move of string * string
       
   337 			| Defs of string * term
       
   338 			| Hol_theorem of string * string * term
       
   339 			| Typedef of string option * (string * string list * mixfix) * term * (string * string) option * term 
       
   340 			| Hol_type_mapping of string * string * string
       
   341 			| Indexed_theorem of int * term
       
   342 *)
       
   343 	and delta (Specification (names, th)) thy = 
   331 	and delta (Specification (names, th)) thy = 
   344 	    fst (SpecificationPackage.add_specification NONE names (thy,th_of thy th))
   332 	    fst (SpecificationPackage.add_specification NONE names (thy,th_of thy th))
   345 	  | delta (Hol_mapping (thyname, thmname, isaname)) thy = 
   333 	  | delta (Hol_mapping (thyname, thmname, isaname)) thy = 
   346 	    add_hol4_mapping thyname thmname isaname thy
   334 	    add_hol4_mapping thyname thmname isaname thy
   347 	  | delta (Hol_pending (thyname, thmname, th)) thy = 
   335 	  | delta (Hol_pending (thyname, thmname, th)) thy = 
   359 	    fst(TypedefPackage.add_typedef_i false thmname typ c repabs (rtac (th_of thy th) 1) thy)
   347 	    fst(TypedefPackage.add_typedef_i false thmname typ c repabs (rtac (th_of thy th) 1) thy)
   360 	  | delta (Hol_type_mapping (thyname, tycname, fulltyname)) thy =  
   348 	  | delta (Hol_type_mapping (thyname, tycname, fulltyname)) thy =  
   361 	    add_hol4_type_mapping thyname tycname true fulltyname thy
   349 	    add_hol4_type_mapping thyname tycname true fulltyname thy
   362 	  | delta (Indexed_theorem (i, th)) thy = 
   350 	  | delta (Indexed_theorem (i, th)) thy = 
   363 	    (Array.update (int_thms,i-1,SOME (P.to_hol_thm (th_of thy th))); thy)	    	    
   351 	    (Array.update (int_thms,i-1,SOME (P.to_hol_thm (th_of thy th))); thy)	    	    
   364           | delta (Protect_varname (s,t)) thy =
   352           | delta (Protect_varname (s,t)) thy = (P.replay_protect_varname s t; thy)
   365 	    (P.replay_protect_varname s t; thy)
   353 	  | delta (Dump s) thy = P.replay_add_dump s thy
   366     in
   354     in
   367 	rps
   355 	rps
   368     end
   356     end
   369 
   357 
   370 fun import_thms thyname int_thms thmnames thy =
   358 fun import_thms thyname int_thms thmnames thy =