src/HOL/Import/import_rule.ML
changeset 47371 4193098c4ec1
parent 47363 c7fc95e722ff
child 48881 46e053eda5dd
equal deleted inserted replaced
47370:eabfb53cfca8 47371:4193098c4ec1
   337     val thm' = Thm.instantiate ((ctvs ~~ cvs), []) thm
   337     val thm' = Thm.instantiate ((ctvs ~~ cvs), []) thm
   338   in
   338   in
   339     snd (Global_Theory.add_thm ((binding, thm'), []) thy)
   339     snd (Global_Theory.add_thm ((binding, thm'), []) thy)
   340   end
   340   end
   341 
   341 
       
   342 fun log_timestamp () =
       
   343   let
       
   344     val time = Time.now ()
       
   345     val millis = nth (space_explode "." (Time.fmt 3 time)) 1
       
   346   in
       
   347     Date.fmt "%d.%m.%Y %H:%M:%S." (Date.fromTimeLocal time) ^ millis
       
   348   end
       
   349 
   342 fun process_line str tstate =
   350 fun process_line str tstate =
   343   let
   351   let
   344     fun process tstate (#"R", [t]) = gettm t tstate |>> refl |-> setth
   352     fun process tstate (#"R", [t]) = gettm t tstate |>> refl |-> setth
   345       | process tstate (#"B", [t]) = gettm t tstate |>> beta |-> setth
   353       | process tstate (#"B", [t]) = gettm t tstate |>> beta |-> setth
   346       | process tstate (#"1", [th]) = getth th tstate |>> conj1 |-> setth
   354       | process tstate (#"1", [th]) = getth th tstate |>> conj1 |-> setth
   414           gettm t1 tstate ||>> gettm t2 |>> (fn (t1, t2) => Thm.apply t1 t2) |-> settm
   422           gettm t1 tstate ||>> gettm t2 |>> (fn (t1, t2) => Thm.apply t1 t2) |-> settm
   415       | process tstate (#"l", [t1, t2]) =
   423       | process tstate (#"l", [t1, t2]) =
   416           gettm t1 tstate ||>> gettm t2 |>> (fn (t1, t2) => Thm.lambda t1 t2) |-> settm
   424           gettm t1 tstate ||>> gettm t2 |>> (fn (t1, t2) => Thm.lambda t1 t2) |-> settm
   417       | process (thy, state) (#"+", [s]) =
   425       | process (thy, state) (#"+", [s]) =
   418           let
   426           let
   419             val _ = tracing ("Noting: " ^ s)
   427             val _ = tracing ("NOTING " ^ log_timestamp () ^ ": " ^ s)
   420           in
   428           in
   421             (store_thm (Binding.name (transl_dot s)) (last_thm state) thy, state)
   429             (store_thm (Binding.name (transl_dot s)) (last_thm state) thy, state)
   422           end
   430           end
   423       | process _ (c, _) = error ("process: unknown command: " ^ String.implode [c])
   431       | process _ (c, _) = error ("process: unknown command: " ^ String.implode [c])
   424 
   432