instantiate: tuned indentity case;
authorwenzelm
Sun, 12 Nov 2006 21:14:52 +0100
changeset 21315 be2669fe8363
parent 21314 6d709b9bea1a
child 21316 4d913b8bccf1
instantiate: tuned indentity case;
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;