src/HOL/Decision_Procs/langford.ML
changeset 74614 c496550dd2c2
parent 74570 7625b5d7cfe2
child 78808 64973b03b778
equal deleted inserted replaced
74613:6676bf189852 74614:c496550dd2c2
    45           in (Thm.dest_arg1 q |> Thm.dest_arg1, Thm.dest_arg q |> Thm.dest_arg1) end
    45           in (Thm.dest_arg1 q |> Thm.dest_arg1, Thm.dest_arg q |> Thm.dest_arg1) end
    46         fun proveneF S =
    46         fun proveneF S =
    47           let
    47           let
    48             val (a, A) = Thm.dest_comb S |>> Thm.dest_arg
    48             val (a, A) = Thm.dest_comb S |>> Thm.dest_arg
    49             val cT = Thm.ctyp_of_cterm a
    49             val cT = Thm.ctyp_of_cterm a
    50             val ne = Thm.instantiate' [SOME cT] [SOME a, SOME A] @{thm insert_not_empty}
    50             val ne = \<^instantiate>\<open>'a = cT and a and A in lemma \<open>insert a A \<noteq> {}\<close> by simp\<close>
    51             val f = prove_finite cT (dest_set S)
    51             val f = prove_finite cT (dest_set S)
    52          in (ne, f) end
    52          in (ne, f) end
    53 
    53 
    54         val qe =
    54         val qe =
    55           (case (Thm.term_of L, Thm.term_of U) of
    55           (case (Thm.term_of L, Thm.term_of U) of
   110     fun tabr c = the (Termtab.lookup (mk_conj_tab (Thm.assume r)) (Thm.term_of c))
   110     fun tabr c = the (Termtab.lookup (mk_conj_tab (Thm.assume r)) (Thm.term_of c))
   111     val ll = Thm.dest_arg l
   111     val ll = Thm.dest_arg l
   112     val rr = Thm.dest_arg r
   112     val rr = Thm.dest_arg r
   113     val thl  = prove_conj tabl (conjuncts rr) |> Drule.implies_intr_hyps
   113     val thl  = prove_conj tabl (conjuncts rr) |> Drule.implies_intr_hyps
   114     val thr  = prove_conj tabr (conjuncts ll) |> Drule.implies_intr_hyps
   114     val thr  = prove_conj tabr (conjuncts ll) |> Drule.implies_intr_hyps
   115     val eqI = Thm.instantiate' [] [SOME ll, SOME rr] @{thm iffI}
   115     val eqI =
       
   116       \<^instantiate>\<open>P = ll and Q = rr in lemma \<open>(P \<Longrightarrow> Q) \<Longrightarrow> (Q \<Longrightarrow> P) \<Longrightarrow> P \<longleftrightarrow> Q\<close> by (rule iffI)\<close>
   116   in Thm.implies_elim (Thm.implies_elim eqI thl) thr |> mk_meta_eq end;
   117   in Thm.implies_elim (Thm.implies_elim eqI thl) thr |> mk_meta_eq end;
   117 
   118 
   118 fun contains x ct =
   119 fun contains x ct =
   119   member (op aconv) (Misc_Legacy.term_frees (Thm.term_of ct)) (Thm.term_of x);
   120   member (op aconv) (Misc_Legacy.term_frees (Thm.term_of ct)) (Thm.term_of x);
   120 
   121