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

Using syntax/translations wiith locales
Quotienting a mutually recursive family of datatypes
L2Norm with Integration
Error defining dataype in Isabelle
Defining a function which returns functions in Isabelle
Defining functions between constants in Isabelle
Using the ordering locale with partial maps
Avoiding assumption with sledgehammer
Discriminant with Inequalities
Instances in locale declaration for Isabelle
How to interactively simplify a formula in a relational theory in Isabelle
Nonnegative Interval Integration
Widening the domain of a partial function
Automatically unfolding a record definition when accessor is used
Creating a datatype with inequalities in Isabelle
Isabelle Logic simple natural deduction test

Categories

HOME
pandas
openlayers
urbancode
activiti
reserved
path-finding
lodash
cplex
mean-stack
at-command
google-oauth
blueprintjs
acquia
session-variables
adobe-analytics
node-pdfkit
volttron
windows-azure-storage
gz
windows-phone-7
interop
dbext
chromium-embedded
tibco-mdm
trading
dxf
crosstab
smb
centos6.5
facet
fluentvalidation
strncpy
replaceall
large-file-upload
jaxb2
http-get
copying
kendo-ui-grid
android-nestedscrollview
io-redirection
devextreme
web-mining
multilingual
swift3.0.2
elasticsearch-plugin
awt
fedex
powershell-dsc
checkboxlist
gpx
acoustics
thin
skeleton-css-boilerplate
hls.js
pebble-watch
idisposable
boost-preprocessor
capacity
objective-c-swift-bridge
multi-level
underscore.js-templating
pcf
angstrom-linux
packagist
apachebench
historian
freedesktop.org
unity-networking
pervasive-sql
wso2cloud
prerequisites
interrupted-exception
iiviewdeckcontroller
apache-commons-net
gwidgets
android-imagebutton
document-classification
terminfo
valuechangelistener
comexception
undefined-reference
jboss-weld
message-driven-bean
terminal-services
quantlib-swig
ftps
easy-install
mylyn
rabl
yui-compressor
sqlperformance
smtp-auth
ocunit
clipper
free-variable
dmoz
coderush
pysimplesoap
windows-phone-7.1.1
jquery-ui-layout
boost-filesystem
subgurim-maps
locationlistener
recent-documents
yui-datatable
h.323
asp.net-profiles
mtj
noscript
gacutil
ugc
ajax-forms

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App