src/Pure/Tools/find_theorems.ML
changeset 56467 8d7d6f17c6a7
parent 56159 39f7b7690de6
child 56613 3518ea9f5200
equal deleted inserted replaced
56466:08982abdcdad 56467:8d7d6f17c6a7
   204       |> Context_Position.set_visible_global (Context_Position.is_visible ctxt);
   204       |> Context_Position.set_visible_global (Context_Position.is_visible ctxt);
   205     val ctxt' = Proof_Context.transfer thy' ctxt;
   205     val ctxt' = Proof_Context.transfer thy' ctxt;
   206     val goal' = Thm.transfer thy' goal;
   206     val goal' = Thm.transfer thy' goal;
   207 
   207 
   208     fun limited_etac thm i =
   208     fun limited_etac thm i =
   209       Seq.take (Options.default_int @{option find_theorems_tac_limit}) o etac thm i;
   209       Seq.take (Options.default_int @{system_option find_theorems_tac_limit}) o etac thm i;
   210     fun try_thm thm =
   210     fun try_thm thm =
   211       if Thm.no_prems thm then rtac thm 1 goal'
   211       if Thm.no_prems thm then rtac thm 1 goal'
   212       else
   212       else
   213         (limited_etac thm THEN_ALL_NEW (Goal.norm_hhf_tac ctxt' THEN' Method.assm_tac ctxt'))
   213         (limited_etac thm THEN_ALL_NEW (Goal.norm_hhf_tac ctxt' THEN' Method.assm_tac ctxt'))
   214           1 goal';
   214           1 goal';
   403           if rem_dups
   403           if rem_dups
   404           then rem_thm_dups (nicer_shortest ctxt) raw_matches
   404           then rem_thm_dups (nicer_shortest ctxt) raw_matches
   405           else raw_matches;
   405           else raw_matches;
   406 
   406 
   407         val len = length matches;
   407         val len = length matches;
   408         val lim = the_default (Options.default_int @{option find_theorems_limit}) opt_limit;
   408         val lim = the_default (Options.default_int @{system_option find_theorems_limit}) opt_limit;
   409       in (SOME len, drop (Int.max (len - lim, 0)) matches) end;
   409       in (SOME len, drop (Int.max (len - lim, 0)) matches) end;
   410 
   410 
   411     val find =
   411     val find =
   412       if rem_dups orelse is_none opt_limit
   412       if rem_dups orelse is_none opt_limit
   413       then find_all
   413       then find_all