src/HOL/Import/proof_kernel.ML
changeset 39159 0dec18004e75
parent 39137 ccb53edd59f0
child 39236 2ec7afadc344
equal deleted inserted replaced
39158:e6b96b4cde7e 39159:0dec18004e75
   975                                    SOME _ => raise ERR "uniq_compose" "Not unique!"
   975                                    SOME _ => raise ERR "uniq_compose" "Not unique!"
   976                                  | NONE => th)
   976                                  | NONE => th)
   977           | NONE => raise ERR "uniq_compose" "No result"
   977           | NONE => raise ERR "uniq_compose" "No result"
   978     end
   978     end
   979 
   979 
   980 val reflexivity_thm = thm "refl"
   980 val reflexivity_thm = @{thm refl}
   981 val substitution_thm = thm "subst"
   981 val substitution_thm = @{thm subst}
   982 val mp_thm = thm "mp"
   982 val mp_thm = @{thm mp}
   983 val imp_antisym_thm = thm "light_imp_as"
   983 val imp_antisym_thm = @{thm light_imp_as}
   984 val disch_thm = thm "impI"
   984 val disch_thm = @{thm impI}
   985 val ccontr_thm = thm "ccontr"
   985 val ccontr_thm = @{thm ccontr}
   986 
   986 
   987 val meta_eq_to_obj_eq_thm = thm "meta_eq_to_obj_eq"
   987 val meta_eq_to_obj_eq_thm = @{thm meta_eq_to_obj_eq}
   988 
   988 
   989 val gen_thm = thm "HOLallI"
   989 val gen_thm = @{thm HOLallI}
   990 val choose_thm = thm "exE"
   990 val choose_thm = @{thm exE}
   991 val exists_thm = thm "exI"
   991 val exists_thm = @{thm exI}
   992 val conj_thm = thm "conjI"
   992 val conj_thm = @{thm conjI}
   993 val conjunct1_thm = thm "conjunct1"
   993 val conjunct1_thm = @{thm conjunct1}
   994 val conjunct2_thm = thm "conjunct2"
   994 val conjunct2_thm = @{thm conjunct2}
   995 val spec_thm = thm "spec"
   995 val spec_thm = @{thm spec}
   996 val disj_cases_thm = thm "disjE"
   996 val disj_cases_thm = @{thm disjE}
   997 val disj1_thm = thm "disjI1"
   997 val disj1_thm = @{thm disjI1}
   998 val disj2_thm = thm "disjI2"
   998 val disj2_thm = @{thm disjI2}
   999 
   999 
  1000 local
  1000 local
  1001     val th = thm "not_def"
  1001     val th = @{thm not_def}
  1002     val thy = theory_of_thm th
  1002     val thy = theory_of_thm th
  1003     val pp = Thm.reflexive (cterm_of thy (Const(@{const_name Trueprop},HOLogic.boolT-->propT)))
  1003     val pp = Thm.reflexive (cterm_of thy (Const(@{const_name Trueprop},HOLogic.boolT-->propT)))
  1004 in
  1004 in
  1005 val not_elim_thm = Thm.combination pp th
  1005 val not_elim_thm = Thm.combination pp th
  1006 end
  1006 end
  1007 
  1007 
  1008 val not_intro_thm = Thm.symmetric not_elim_thm
  1008 val not_intro_thm = Thm.symmetric not_elim_thm
  1009 val abs_thm = thm "ext"
  1009 val abs_thm = @{thm ext}
  1010 val trans_thm = thm "trans"
  1010 val trans_thm = @{thm trans}
  1011 val symmetry_thm = thm "sym"
  1011 val symmetry_thm = @{thm sym}
  1012 val transitivity_thm = thm "trans"
  1012 val transitivity_thm = @{thm trans}
  1013 val eqmp_thm = thm "iffD1"
  1013 val eqmp_thm = @{thm iffD1}
  1014 val eqimp_thm = thm "HOL4Setup.eq_imp"
  1014 val eqimp_thm = @{thm HOL4Setup.eq_imp}
  1015 val comb_thm = thm "cong"
  1015 val comb_thm = @{thm cong}
  1016 
  1016 
  1017 (* Beta-eta normalizes a theorem (only the conclusion, not the *
  1017 (* Beta-eta normalizes a theorem (only the conclusion, not the *
  1018 hypotheses!)  *)
  1018 hypotheses!)  *)
  1019 
  1019 
  1020 fun beta_eta_thm th =
  1020 fun beta_eta_thm th =
  1969         val _ = if_debug pth hth
  1969         val _ = if_debug pth hth
  1970     in
  1970     in
  1971         (thy22',hth)
  1971         (thy22',hth)
  1972     end
  1972     end
  1973 
  1973 
  1974 local
       
  1975     val helper = thm "termspec_help"
       
  1976 in
       
  1977 fun new_specification thyname thmname names hth thy =
  1974 fun new_specification thyname thmname names hth thy =
  1978     case HOL4DefThy.get thy of
  1975     case HOL4DefThy.get thy of
  1979         Replaying _ => (thy,hth)
  1976         Replaying _ => (thy,hth)
  1980       | _ =>
  1977       | _ =>
  1981         let
  1978         let
  2052             val _ = if_debug pth hth
  2049             val _ = if_debug pth hth
  2053         in
  2050         in
  2054             intern_store_thm false thyname thmname hth thy''
  2051             intern_store_thm false thyname thmname hth thy''
  2055         end
  2052         end
  2056 
  2053 
  2057 end
       
  2058 
       
  2059 fun new_axiom name tm thy = raise ERR "new_axiom" ("Oh, no you don't! (" ^ name ^ ")")
  2054 fun new_axiom name tm thy = raise ERR "new_axiom" ("Oh, no you don't! (" ^ name ^ ")")
  2060 
  2055 
  2061 fun to_isa_thm (hth as HOLThm(_,th)) =
  2056 fun to_isa_thm (hth as HOLThm(_,th)) =
  2062     let
  2057     let
  2063         val (HOLThm args) = norm_hthm (theory_of_thm th) hth
  2058         val (HOLThm args) = norm_hthm (theory_of_thm th) hth
  2066     end
  2061     end
  2067 
  2062 
  2068 fun to_isa_term tm = tm
  2063 fun to_isa_term tm = tm
  2069 
  2064 
  2070 local
  2065 local
  2071     val light_nonempty = thm "light_ex_imp_nonempty"
  2066     val light_nonempty = @{thm light_ex_imp_nonempty}
  2072     val ex_imp_nonempty = thm "ex_imp_nonempty"
  2067     val ex_imp_nonempty = @{thm ex_imp_nonempty}
  2073     val typedef_hol2hol4 = thm "typedef_hol2hol4"
  2068     val typedef_hol2hol4 = @{thm typedef_hol2hol4}
  2074     val typedef_hol2hollight = thm "typedef_hol2hollight"
  2069     val typedef_hol2hollight = @{thm typedef_hol2hollight}
  2075 in
  2070 in
  2076 fun new_type_definition thyname thmname tycname hth thy =
  2071 fun new_type_definition thyname thmname tycname hth thy =
  2077     case HOL4DefThy.get thy of
  2072     case HOL4DefThy.get thy of
  2078         Replaying _ => (thy,hth)
  2073         Replaying _ => (thy,hth)
  2079       | _ =>
  2074       | _ =>