src/HOL/Option.thy
changeset 61799 4cf66f21b764
parent 61630 608520e0e8e2
child 63194 0b7bdb75f451
equal deleted inserted replaced
61798:27f3c10b0b50 61799:4cf66f21b764
    13   | Some (the: 'a)
    13   | Some (the: 'a)
    14 
    14 
    15 datatype_compat option
    15 datatype_compat option
    16 
    16 
    17 lemma [case_names None Some, cases type: option]:
    17 lemma [case_names None Some, cases type: option]:
    18   -- \<open>for backward compatibility -- names of variables differ\<close>
    18   \<comment> \<open>for backward compatibility -- names of variables differ\<close>
    19   "(y = None \<Longrightarrow> P) \<Longrightarrow> (\<And>a. y = Some a \<Longrightarrow> P) \<Longrightarrow> P"
    19   "(y = None \<Longrightarrow> P) \<Longrightarrow> (\<And>a. y = Some a \<Longrightarrow> P) \<Longrightarrow> P"
    20   by (rule option.exhaust)
    20   by (rule option.exhaust)
    21 
    21 
    22 lemma [case_names None Some, induct type: option]:
    22 lemma [case_names None Some, induct type: option]:
    23   -- \<open>for backward compatibility -- names of variables differ\<close>
    23   \<comment> \<open>for backward compatibility -- names of variables differ\<close>
    24   "P None \<Longrightarrow> (\<And>option. P (Some option)) \<Longrightarrow> P option"
    24   "P None \<Longrightarrow> (\<And>option. P (Some option)) \<Longrightarrow> P option"
    25   by (rule option.induct)
    25   by (rule option.induct)
    26 
    26 
    27 text \<open>Compatibility:\<close>
    27 text \<open>Compatibility:\<close>
    28 setup \<open>Sign.mandatory_path "option"\<close>
    28 setup \<open>Sign.mandatory_path "option"\<close>