src/HOL/HOL.thy
changeset 59507 b468e0f8da2a
parent 59504 8c6747dba731
parent 59499 14095f771781
child 59582 0fbed69ff081
equal deleted inserted replaced
59506:4af607652318 59507:b468e0f8da2a
   844   assumes major: "\<exists>!x. P x"
   844   assumes major: "\<exists>!x. P x"
   845       and prem: "\<And>x. \<lbrakk> P x; \<forall>y y'. P y \<and> P y' \<longrightarrow> y = y' \<rbrakk> \<Longrightarrow> R"
   845       and prem: "\<And>x. \<lbrakk> P x; \<forall>y y'. P y \<and> P y' \<longrightarrow> y = y' \<rbrakk> \<Longrightarrow> R"
   846   shows R
   846   shows R
   847 apply (rule ex1E [OF major])
   847 apply (rule ex1E [OF major])
   848 apply (rule prem)
   848 apply (rule prem)
   849 apply (tactic {* ares_tac @{thms allI} 1 *})+
   849 apply assumption
   850 apply (tactic {* eresolve_tac [Classical.dup_elim NONE @{thm allE}] 1 *})
   850 apply (rule allI)+
       
   851 apply (tactic {* eresolve_tac @{context} [Classical.dup_elim NONE @{thm allE}] 1 *})
   851 apply iprover
   852 apply iprover
   852 done
   853 done
   853 
   854 
   854 ML {*
   855 ML {*
   855   structure Blast = Blast
   856   structure Blast = Blast
  1794 
  1795 
  1795 lemma equal_alias_cert: "OFCLASS('a, equal_class) \<equiv> ((op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool) \<equiv> equal)" (is "?ofclass \<equiv> ?equal")
  1796 lemma equal_alias_cert: "OFCLASS('a, equal_class) \<equiv> ((op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool) \<equiv> equal)" (is "?ofclass \<equiv> ?equal")
  1796 proof
  1797 proof
  1797   assume "PROP ?ofclass"
  1798   assume "PROP ?ofclass"
  1798   show "PROP ?equal"
  1799   show "PROP ?equal"
  1799     by (tactic {* ALLGOALS (resolve_tac [Thm.unconstrainT @{thm eq_equal}]) *})
  1800     by (tactic {* ALLGOALS (resolve_tac @{context} [Thm.unconstrainT @{thm eq_equal}]) *})
  1800       (fact `PROP ?ofclass`)
  1801       (fact `PROP ?ofclass`)
  1801 next
  1802 next
  1802   assume "PROP ?equal"
  1803   assume "PROP ?equal"
  1803   show "PROP ?ofclass" proof
  1804   show "PROP ?ofclass" proof
  1804   qed (simp add: `PROP ?equal`)
  1805   qed (simp add: `PROP ?equal`)
  1895   let
  1896   let
  1896     fun eval_tac ctxt =
  1897     fun eval_tac ctxt =
  1897       let val conv = Code_Runtime.dynamic_holds_conv ctxt
  1898       let val conv = Code_Runtime.dynamic_holds_conv ctxt
  1898       in
  1899       in
  1899         CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 conv)) ctxt) THEN'
  1900         CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 conv)) ctxt) THEN'
  1900         resolve_tac [TrueI]
  1901         resolve_tac ctxt [TrueI]
  1901       end
  1902       end
  1902   in
  1903   in
  1903     Scan.succeed (SIMPLE_METHOD' o eval_tac)
  1904     Scan.succeed (SIMPLE_METHOD' o eval_tac)
  1904   end
  1905   end
  1905 *} "solve goal by evaluation"
  1906 *} "solve goal by evaluation"
  1907 method_setup normalization = {*
  1908 method_setup normalization = {*
  1908   Scan.succeed (fn ctxt =>
  1909   Scan.succeed (fn ctxt =>
  1909     SIMPLE_METHOD'
  1910     SIMPLE_METHOD'
  1910       (CHANGED_PROP o
  1911       (CHANGED_PROP o
  1911         (CONVERSION (Nbe.dynamic_conv ctxt)
  1912         (CONVERSION (Nbe.dynamic_conv ctxt)
  1912           THEN_ALL_NEW (TRY o resolve_tac [TrueI]))))
  1913           THEN_ALL_NEW (TRY o resolve_tac ctxt [TrueI]))))
  1913 *} "solve goal by normalization"
  1914 *} "solve goal by normalization"
  1914 
  1915 
  1915 
  1916 
  1916 subsection {* Counterexample Search Units *}
  1917 subsection {* Counterexample Search Units *}
  1917 
  1918 
  1947       | wrong_prem (Bound _) = true
  1948       | wrong_prem (Bound _) = true
  1948       | wrong_prem _ = false;
  1949       | wrong_prem _ = false;
  1949     val filter_right = filter (not o wrong_prem o HOLogic.dest_Trueprop o hd o Thm.prems_of);
  1950     val filter_right = filter (not o wrong_prem o HOLogic.dest_Trueprop o hd o Thm.prems_of);
  1950   in
  1951   in
  1951     fun smp i = funpow i (fn m => filter_right ([spec] RL m)) ([mp]);
  1952     fun smp i = funpow i (fn m => filter_right ([spec] RL m)) ([mp]);
  1952     fun smp_tac ctxt j = EVERY'[dresolve_tac (smp j), assume_tac ctxt];
  1953     fun smp_tac ctxt j = EVERY' [dresolve_tac ctxt (smp j), assume_tac ctxt];
  1953   end;
  1954   end;
  1954 
  1955 
  1955   local
  1956   local
  1956     val nnf_ss =
  1957     val nnf_ss =
  1957       simpset_of (put_simpset HOL_basic_ss @{context} addsimps @{thms simp_thms nnf_simps});
  1958       simpset_of (put_simpset HOL_basic_ss @{context} addsimps @{thms simp_thms nnf_simps});