How to use complex patterns in functions?
问题 Here is a sample function: fun divide :: "enat option ⇒ enat option ⇒ real option" where "divide (Some ∞) _ = None" | "divide _ (Some ∞) = None" | "divide _ (Some 0) = None" | "divide (Some a) (Some b) = Some (a / b)" | "divide _ _ = None" Isabelle HOL shows me the following error: Malformed definition: Non-constructor pattern not allowed in sequential mode. ⋀uw_. divide uw_ (Some 0) = None Why pattern-matching works fine for Some ∞ and doesn't work for Some 0 ? ∞ is a constant for class