src/HOL/Library/simps_case_conv.ML
changeset 59621 291934bac95e
parent 59582 0fbed69ff081
child 59650 ba26118128b7
equal deleted inserted replaced
59620:92d7d8e4f1bf 59621:291934bac95e
    95 
    95 
    96 fun import [] ctxt = ([], ctxt)
    96 fun import [] ctxt = ([], ctxt)
    97   | import (thm :: thms) ctxt =
    97   | import (thm :: thms) ctxt =
    98     let
    98     let
    99       val fun_ct = strip_eq #> fst #> strip_comb #> fst #> Logic.mk_term
    99       val fun_ct = strip_eq #> fst #> strip_comb #> fst #> Logic.mk_term
   100         #> Proof_Context.cterm_of ctxt
   100         #> Thm.cterm_of ctxt
   101       val ct = fun_ct thm
   101       val ct = fun_ct thm
   102       val cts = map fun_ct thms
   102       val cts = map fun_ct thms
   103       val pairs = map (fn s => (s,ct)) cts
   103       val pairs = map (fn s => (s,ct)) cts
   104       val thms' = map (fn (th,p) => Thm.instantiate (Thm.match p) th) (thms ~~ pairs)
   104       val thms' = map (fn (th,p) => Thm.instantiate (Thm.match p) th) (thms ~~ pairs)
   105     in Variable.import true (thm :: thms') ctxt |> apfst snd end
   105     in Variable.import true (thm :: thms') ctxt |> apfst snd end