src/FOL/FOL.thy
changeset 22139 539a63b98f76
parent 21539 c5cf9243ad62
child 23154 5126551e378b
equal deleted inserted replaced
22138:b9cbcd8be40f 22139:539a63b98f76
    53   apply assumption
    53   apply assumption
    54   done
    54   done
    55 
    55 
    56 (*For disjunctive case analysis*)
    56 (*For disjunctive case analysis*)
    57 ML {*
    57 ML {*
    58   local
    58   fun excluded_middle_tac sP =
    59     val excluded_middle = thm "excluded_middle"
    59     res_inst_tac [("Q",sP)] (@{thm excluded_middle} RS @{thm disjE})
    60     val disjE = thm "disjE"
       
    61   in
       
    62     fun excluded_middle_tac sP =
       
    63       res_inst_tac [("Q",sP)] (excluded_middle RS disjE)
       
    64   end
       
    65 *}
    60 *}
    66 
    61 
    67 lemma case_split_thm:
    62 lemma case_split_thm:
    68   assumes r1: "P ==> Q"
    63   assumes r1: "P ==> Q"
    69     and r2: "~P ==> Q"
    64     and r2: "~P ==> Q"
    75 
    70 
    76 lemmas case_split = case_split_thm [case_names True False, cases type: o]
    71 lemmas case_split = case_split_thm [case_names True False, cases type: o]
    77 
    72 
    78 (*HOL's more natural case analysis tactic*)
    73 (*HOL's more natural case analysis tactic*)
    79 ML {*
    74 ML {*
    80   local
    75   fun case_tac a = res_inst_tac [("P",a)] @{thm case_split_thm}
    81     val case_split_thm = thm "case_split_thm"
       
    82   in
       
    83     fun case_tac a = res_inst_tac [("P",a)] case_split_thm
       
    84   end
       
    85 *}
    76 *}
    86 
    77 
    87 
    78 
    88 (*** Special elimination rules *)
    79 (*** Special elimination rules *)
    89 
    80 
   276 text {* Method setup. *}
   267 text {* Method setup. *}
   277 
   268 
   278 ML {*
   269 ML {*
   279   structure InductMethod = InductMethodFun
   270   structure InductMethod = InductMethodFun
   280   (struct
   271   (struct
   281     val cases_default = thm "case_split";
   272     val cases_default = @{thm case_split}
   282     val atomize = thms "induct_atomize";
   273     val atomize = @{thms induct_atomize}
   283     val rulify = thms "induct_rulify";
   274     val rulify = @{thms induct_rulify}
   284     val rulify_fallback = thms "induct_rulify_fallback";
   275     val rulify_fallback = @{thms induct_rulify_fallback}
   285   end);
   276   end);
   286 *}
   277 *}
   287 
   278 
   288 setup InductMethod.setup
   279 setup InductMethod.setup
   289 
   280