### isabelle

#### Inner syntax error when using `o` as a variable/function name

While playing around with Isabelle (version 2016-1), I encountered the following strange situation: I cannot use the letter o as a variable or function name in various (most/all?) contexts. The following examples all fail despite working for most (all?) other letters of the English alphabet: value o (* quoted version doesn't work either *) definition invert :: ‹bool ⇒ bool› where ‹invert o = (¬ o)› definition o :: ‹bool ⇒ bool› where ‹o a = (¬ a)› fun default_int :: ‹int option ⇒ int› where ‹default_int None = 0› | ‹default_int o = the o› fun default_int :: ‹int option ⇒ int› where ‹default_int None = 0› | ‹default_int (Some o) = o› fun o :: ‹int option ⇒ int› where ‹o None = 0› | ‹o (Some i) = i› I cannot seem to find any information documenting o being a reserved name, so is this a bug or is there some other usage of o that precludes it as a variable/function name? The error message for all cases is "Inner syntax error⌂ Failed to parse term", which is not very helpful other than noting that the error seems to be inner-syntax-related (the error messages for the third and last cases appear on the lines using o inside quotes rather than on the definition/fun lines, too).

o is the ASCII notation for the function composition operator ∘. You can see that the o is interpreted as syntax because it is printed in a kind of dark turquoise colour, whereas other identifiers are blue, black, green, or orange (depending on what they are precisely). You get the same thing with other pre-defined syntax like O, OO, powr, has_derivative, etc. You can disable that for your purposes using the command no_notation Fun.comp (infixl "o" 55) You should, however, only do this for experimentation; in production use, it would be considered bad to disable such a global pre-defined notation. I for one think that these days, these old ASCII notations are mostly unnecessary and, in case of o, actually harmful (e.g. how it confused you). I'll suggest removing this particular notation on the Isabelle mailing list.

### Related Links

Error message in Isabelle/HOL

What happens during function proofs

Inner syntax error when using `o` as a variable/function name

Constraining type variables in locales

Defining Primtive Recursion for multiplication in Isabelle

Is there a lemma like “∃x. a^x = b” proved in Isabelle?

Given a theorem “P(t) ⟶ (∃x . P(x))” with an object logic implication, why is the proof goal “P(t) ⟹ (∃x . P(x))” given with meta-logic implication?

Lists and simplification rules: More difficult when using # rather than #?

Isabelle's Simplifier: How does it choose which rules to apply? [Specific Example]

Proof by induction with three base cases (Isabelle)

Limit of c^n (with ¦c¦<1) is 0 (Isabelle)

Why won't the 'linordered_field_class.frac_le' rule work? (Isabelle)

Usage of “also have…finally have” in Isabelle

Free type variables in proof by induction

Very simple lemma in Isabelle

Definition of Prime in Isabelle