src/HOL/SMT/Tools/smt_normalize.ML
changeset 33355 ee5b5ef5e970
parent 33299 73af7831ba1e
child 33664 d62805a237ef
equal deleted inserted replaced
33354:1f70087cdef5 33355:ee5b5ef5e970
   316   fun add_def ct thm = Termtab.update (Thm.term_of ct, (serial (), thm))
   316   fun add_def ct thm = Termtab.update (Thm.term_of ct, (serial (), thm))
   317 
   317 
   318   fun replace ctxt cvs ct (cx as (nctxt, defs)) =
   318   fun replace ctxt cvs ct (cx as (nctxt, defs)) =
   319     let
   319     let
   320       val cvs' = used_vars cvs ct
   320       val cvs' = used_vars cvs ct
   321       val ct' = fold Thm.cabs cvs' ct
   321       val ct' = fold_rev Thm.cabs cvs' ct
   322       val mk_repl = fold (fn ct => fn cu => Thm.capply cu ct) cvs'
   322       val mk_repl = fold (fn ct => fn cu => Thm.capply cu ct) cvs'
   323     in
   323     in
   324       (case Termtab.lookup defs (Thm.term_of ct') of
   324       (case Termtab.lookup defs (Thm.term_of ct') of
   325         SOME (_, eq) => (make_def cvs' eq, cx)
   325         SOME (_, eq) => (make_def cvs' eq, cx)
   326       | NONE =>
   326       | NONE =>