# HG changeset patch # User paulson # Date 846670827 -3600 # Node ID 2c59b204b5406162d3a9e1d5b1a2f3f0936cbd86 # Parent 056dead45ae84d2eed7fb0f397fc67a92e4d009b Only calls nodup_Vars if really necessary. We get a speedup of nearly 6% diff -r 056dead45ae8 -r 2c59b204b540 src/Pure/thm.ML --- a/src/Pure/thm.ML Wed Oct 30 11:19:09 1996 +0100 +++ b/src/Pure/thm.ML Wed Oct 30 11:20:27 1996 +0100 @@ -681,7 +681,11 @@ shyps = [], hyps = hyps, prop = betapply(A,t)}) - in nodup_Vars thm "forall_elim"; thm end + in if maxt >= 0 andalso maxidx >= 0 + then nodup_Vars thm "forall_elim" + else () (*no new Vars: no expensive check!*) ; + thm + end | _ => raise THM("forall_elim: not quantified", 0, [th]) end handle TERM _ => @@ -749,7 +753,11 @@ shyps = [], hyps = hyps1 union hyps2, prop = eq$t1$t2}) - in nodup_Vars thm "transitive"; thm end + in if max1 >= 0 andalso max2 >= 0 + then nodup_Vars thm "transitive" + else () (*no new Vars: no expensive check!*) ; + thm + end | _ => err"premises" end; @@ -851,7 +859,11 @@ shyps = shyps1 union shyps2, hyps = hyps1 union hyps2, prop = Logic.mk_equals(f$t, g$u)} - in nodup_Vars thm "combination"; thm end + in if max1 >= 0 andalso max2 >= 0 + then nodup_Vars thm "combination" + else () (*no new Vars: no expensive check!*) ; + thm + end | _ => raise THM("combination: premises", 0, [th1,th2]) end;