equal
deleted
inserted
replaced
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 => |