# HG changeset patch # User wenzelm # Date 1163362492 -3600 # Node ID be2669fe83634a9d0f7c5a15f02659cecdc691f1 # Parent 6d709b9bea1a46f7c4a30318769c47110ac82f96 instantiate: tuned indentity case; diff -r 6d709b9bea1a -r be2669fe8363 src/Pure/term_subst.ML --- a/src/Pure/term_subst.ML Sun Nov 12 21:14:51 2006 +0100 +++ b/src/Pure/term_subst.ML Sun Nov 12 21:14:52 2006 +0100 @@ -133,17 +133,21 @@ let val maxidx = ref i in (instantiate_same maxidx insts tm handle SAME => tm, ! maxidx) end; -fun instantiateT instT ty = - instantiateT_same (ref ~1) (no_indexes1 instT) ty handle SAME => ty; +fun instantiateT [] ty = ty + | instantiateT instT ty = + (instantiateT_same (ref ~1) (no_indexes1 instT) ty handle SAME => ty); -fun instantiate insts tm = - instantiate_same (ref ~1) (no_indexes2 insts) tm handle SAME => tm; +fun instantiate ([], []) tm = tm + | instantiate insts tm = + (instantiate_same (ref ~1) (no_indexes2 insts) tm handle SAME => tm); -fun instantiateT_option instT ty = - SOME (instantiateT_same (ref ~1) (no_indexes1 instT) ty) handle SAME => NONE; +fun instantiateT_option [] _ = NONE + | instantiateT_option instT ty = + (SOME (instantiateT_same (ref ~1) (no_indexes1 instT) ty) handle SAME => NONE); -fun instantiate_option insts tm = - SOME (instantiate_same (ref ~1) (no_indexes2 insts) tm) handle SAME => NONE; +fun instantiate_option ([], []) _ = NONE + | instantiate_option insts tm = + (SOME (instantiate_same (ref ~1) (no_indexes2 insts) tm) handle SAME => NONE); end;