src/Doc/JEdit/JEdit.thy
changeset 54372 2d61935eed4a
parent 54362 c5d6cd7ab132
child 54373 232cf1e475da
equal deleted inserted replaced
54371:52ed202464a5 54372:2d61935eed4a
    35 
    35 
    36   \item [Isabelle/Scala] is the system programming language of
    36   \item [Isabelle/Scala] is the system programming language of
    37   Isabelle. It extends the pure logical environment of Isabelle/ML
    37   Isabelle. It extends the pure logical environment of Isabelle/ML
    38   towards the ``real world'' of graphical user interfaces, text
    38   towards the ``real world'' of graphical user interfaces, text
    39   editors, IDE frameworks, web services etc.  Special infrastructure
    39   editors, IDE frameworks, web services etc.  Special infrastructure
    40   allows to transfer algebraic datatype values and formatted text
    40   allows to transfer algebraic datatypes and formatted text easily
    41   easily between ML and Scala, using asynchronous protocol commands.
    41   between ML and Scala, using asynchronous protocol commands.
    42 
    42 
    43   \item [jEdit] is a sophisticated text editor implemented in
    43   \item [jEdit] is a sophisticated text editor implemented in
    44   Java.\footnote{\url{http://www.jedit.org}} It is easily extensible
    44   Java.\footnote{\url{http://www.jedit.org}} It is easily extensible
    45   by plugins written in languages that work on the JVM, e.g.\
    45   by plugins written in languages that work on the JVM, e.g.\
    46   Scala\footnote{\url{http://www.scala-lang.org/}}.
    46   Scala\footnote{\url{http://www.scala-lang.org/}}.
    47 
    47 
    48   \item [Isabelle/jEdit] is the main example application of the PIDE
    48   \item [Isabelle/jEdit] is the main example application of the PIDE
    49   framework and the default user-interface for Isabelle. It targets
    49   framework and the default user-interface for Isabelle. It targets
    50   both beginners and experts. Technically, Isabelle/jEdit combines a
    50   both beginners and experts. Technically, Isabelle/jEdit combines a
    51   slightly modified version of the official jEdit code base with a
    51   slightly modified version of the jEdit code base with a special
    52   special plugin for Isabelle, integrated as standalone application
    52   plugin for Isabelle, integrated as standalone application for the
    53   for the main operating system platforms: Linux, Windows, Mac OS X.
    53   main operating system platforms: Linux, Windows, Mac OS X.
    54 
    54 
    55   \end{description}
    55   \end{description}
    56 
    56 
    57   The subtle differences of Isabelle/ML versus Standard ML,
    57   The subtle differences of Isabelle/ML versus Standard ML,
    58   Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be
    58   Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be
   134 
   134 
   135 subsection {* Plugins *}
   135 subsection {* Plugins *}
   136 
   136 
   137 text {* The \emph{Plugin Manager} of jEdit allows to augment editor
   137 text {* The \emph{Plugin Manager} of jEdit allows to augment editor
   138   functionality by JVM modules (jars) that are provided by the central
   138   functionality by JVM modules (jars) that are provided by the central
   139   plugin repository, which is accessible by various mirror sites.
   139   plugin repository, which is accessible via various mirror sites.
   140 
   140 
   141   Connecting to the plugin server infrastructure of the jEdit project
   141   Connecting to the plugin server infrastructure of the jEdit project
   142   allows to update bundled plugins or to add further functionality.
   142   allows to update bundled plugins or to add further functionality.
   143   This needs to be done with the usual care for such an open bazaar of
   143   This needs to be done with the usual care for such an open bazaar of
   144   contributions. Arbitrary combinations of add-on features are apt to
   144   contributions. Arbitrary combinations of add-on features are apt to
   160 subsection {* Options *}
   160 subsection {* Options *}
   161 
   161 
   162 text {* Both jEdit and Isabelle have distinctive management of
   162 text {* Both jEdit and Isabelle have distinctive management of
   163   persistent options.
   163   persistent options.
   164 
   164 
   165   Regular jEdit options are accessible via the dialogs for
   165   Regular jEdit options are accessible via the dialog for
   166   \emph{Global Options} and \emph{Plugin Options}.  Changed properties
   166   \emph{Plugins / Plugin Options}, which is also accessible via
   167   are stored eventually in @{verbatim
   167   \emph{Utilities / Global Options}.  Changed properties are stored in
   168   "$ISABELLE_HOME_USER/jedit/properties"}.  In contrast, Isabelle
   168   @{file_unchecked "$ISABELLE_HOME_USER/jedit/properties"}.  In
   169   system options are managed by Isabelle/Scala and changes stored in
   169   contrast, Isabelle system options are managed by Isabelle/Scala and
   170   @{verbatim "$ISABELLE_HOME_USER/etc/preferences"}, independently of
   170   changed values stored in @{file_unchecked
   171   the jEdit properties.  See also \cite{isabelle-sys}, especially the
   171   "$ISABELLE_HOME_USER/etc/preferences"}, independently of the jEdit
   172   coverage of sessions and command-line tools like @{tool build} or
   172   properties.  See also \cite{isabelle-sys}, especially the coverage
   173   @{tool options}.
   173   of sessions and command-line tools like @{tool build} or @{tool
       
   174   options}.
   174 
   175 
   175   Those Isabelle options that are declared as \textbf{public} are
   176   Those Isabelle options that are declared as \textbf{public} are
   176   configurable in jEdit via \emph{Plugin Options / Isabelle /
   177   configurable in jEdit via \emph{Plugin Options / Isabelle /
   177   General}.  Moreover, there are various options for rendering of
   178   General}.  Moreover, there are various options for rendering of
   178   document content, which are configurable via \emph{Plugin Options /
   179   document content, which are configurable via \emph{Plugin Options /
   179   Isabelle / Rendering}.  Thus \emph{Plugin Options / Isabelle} in
   180   Isabelle / Rendering}.  Thus \emph{Plugin Options / Isabelle} in
   180   jEdit provides a view on certain Isabelle options.  Note that some
   181   jEdit provides a view on a subset of Isabelle system options.  Note
   181   of these options affect general parameters that are relevant outside
   182   that some of these options affect general parameters that are
   182   Isabelle/jEdit as well, e.g.\ @{system_option threads} or
   183   relevant outside Isabelle/jEdit as well, e.g.\ @{system_option
   183   @{system_option parallel_proofs} for the Isabelle build tool
   184   threads} or @{system_option parallel_proofs} for the Isabelle build
   184   \cite{isabelle-sys}.
   185   tool \cite{isabelle-sys}.
   185 
   186 
   186   \medskip All options are loaded on startup and saved on shutdown of
   187   \medskip All options are loaded on startup and saved on shutdown of
   187   Isabelle/jEdit.  Editing the machine-generated files @{verbatim
   188   Isabelle/jEdit.  Editing the machine-generated @{file_unchecked
   188   "$ISABELLE_HOME_USER/jedit/properties"} or @{verbatim
   189   "$ISABELLE_HOME_USER/jedit/properties"} or @{file_unchecked
   189   "$ISABELLE_HOME_USER/etc/preferences"} manually while the
   190   "$ISABELLE_HOME_USER/etc/preferences"} manually while the
   190   application is running is likely to cause surprise due to lost
   191   application is running is likely to cause surprise due to lost
   191   update!  *}
   192   update!  *}
   192 
   193 
   193 
   194 
   200   initial environment of properties that is available at the first
   201   initial environment of properties that is available at the first
   201   start of the editor; afterwards the keymap file takes precedence.
   202   start of the editor; afterwards the keymap file takes precedence.
   202 
   203 
   203   This is relevant for Isabelle/jEdit due to various fine-tuning of
   204   This is relevant for Isabelle/jEdit due to various fine-tuning of
   204   default properties, and additional keyboard shortcuts for Isabelle
   205   default properties, and additional keyboard shortcuts for Isabelle
   205   specific functionality. Users may change their keymap, but need to
   206   specific functionality. Users may change their keymap later, but
   206   copy Isabelle-specific key bindings manually.  *}
   207   need to copy Isabelle-specific key bindings manually (see also
       
   208   @{file_unchecked "$ISABELLE_HOME_USER/jedit/keymaps"}).  *}
   207 
   209 
   208 
   210 
   209 subsection {* Look-and-feel *}
   211 subsection {* Look-and-feel *}
   210 
   212 
   211 text {* jEdit is a Java/AWT/Swing application with some ambition to
   213 text {* jEdit is a Java/AWT/Swing application with some ambition to
   217   follows:
   219   follows:
   218 
   220 
   219   \begin{description}
   221   \begin{description}
   220 
   222 
   221   \item[Linux] The platform-independent \emph{Nimbus} is used by
   223   \item[Linux] The platform-independent \emph{Nimbus} is used by
   222   default, but the classic \emph{Metal} also works.  \emph{GTK+} works
   224   default.
   223   under the side-condition that the overall GTK theme is selected in a
   225 
   224   Swing-friendly way.\footnote{GTK support in Java/Swing was once
   226   \emph{GTK+} works under the side-condition that the overall GTK
   225   marketed aggressively by Sun, but never quite finished, and is today
   227   theme is selected in a Swing-friendly way.\footnote{GTK support in
   226   (2013) lagging a bit behind further development of Swing and GTK.}
   228   Java/Swing was once marketed aggressively by Sun, but never quite
   227 
   229   finished, and is today (2013) lagging a bit behind further
   228   \item[Windows] Regular \emph{Windows} is used by default, but
   230   development of Swing and GTK.}
   229   platform-independent \emph{Nimbus} and \emph{Metal} also work.
   231 
   230 
   232   \item[Windows] Regular \emph{Windows} is used by default.
   231   \item[Mac OS X] Regular \emph{Mac OS X} is used by default, but
   233 
   232   platform-independent \emph{Nimbus} and \emph{Metal} also work.
   234   \item[Mac OS X] Regular \emph{Mac OS X} is used by default.
       
   235 
   233   Moreover the bundled \emph{MacOSX} plugin provides various functions
   236   Moreover the bundled \emph{MacOSX} plugin provides various functions
   234   that are expected from applications on that particular platform:
   237   that are expected from applications on that particular platform:
   235   quit from menu or dock, preferences menu, drag-and-drop of text
   238   quit from menu or dock, preferences menu, drag-and-drop of text
   236   files on the application, full-screen mode for main editor windows
   239   files on the application, full-screen mode for main editor windows
   237   etc.
   240   etc.
   238 
   241 
   239   \end{description}
   242   \end{description}
   240 
   243 
   241   Users may experiment with different look-and-feels, but need to keep
   244   Users may experiment with different look-and-feels, but need to keep
   242   in mind that this extra variance of GUI functionality is unlikely to
   245   in mind that this extra variance of GUI functionality is unlikely to
   243   work in arbitrary combinations.  The historic \emph{CDE/Motif} is
   246   work in arbitrary combinations.  The platform-independent
   244   better avoided.  After changing the look-and-feel in \emph{Global
   247   \emph{Nimbus} and \emph{Metal} should always work.  The historic
   245   Options / Appearance}, it is advisable to restart Isabelle/jEdit in
   248   \emph{CDE/Motif} is better avoided.
   246   order to take full effect.  *}
   249 
   247 
   250   After changing the look-and-feel in \emph{Global Options /
   248 
   251   Appearance}, it is advisable to restart Isabelle/jEdit in order to
   249 subsection {* File-system access *}
   252   take full effect.  *}
       
   253 
       
   254 
       
   255 chapter {* Prover IDE functionality *}
       
   256 
       
   257 section {* File-system access *}
   250 
   258 
   251 text {* File specifications in jEdit follow various formats and
   259 text {* File specifications in jEdit follow various formats and
   252   conventions according to \emph{Virtual File Systems}, which may be
   260   conventions according to \emph{Virtual File Systems}, which may be
   253   also provided by additional plugins.  This allows to access remote
   261   also provided by additional plugins.  This allows to access remote
   254   files via the @{verbatim "http:"} protocol prefix, for example.
   262   files via the @{verbatim "http:"} protocol prefix, for example.
   269   \emph{all} platforms.\footnote{Isabelle on Windows uses Cygwin
   277   \emph{all} platforms.\footnote{Isabelle on Windows uses Cygwin
   270   file-system access.}  Moreover, environment variables from the
   278   file-system access.}  Moreover, environment variables from the
   271   Isabelle process may be used freely, e.g.\ @{file
   279   Isabelle process may be used freely, e.g.\ @{file
   272   "$ISABELLE_HOME/etc/symbols"} or @{file
   280   "$ISABELLE_HOME/etc/symbols"} or @{file
   273   "$ISABELLE_JDK_HOME/README.html"}.  There are special shortcuts:
   281   "$ISABELLE_JDK_HOME/README.html"}.  There are special shortcuts:
   274   @{verbatim "~"} for @{file "$USER_HOME"}, and @{verbatim "~~"} for
   282   @{file "~"} for @{file "$USER_HOME"} and @{file "~~"} for @{file
   275   @{file "$ISABELLE_HOME"}.
   283   "$ISABELLE_HOME"}.
   276 
   284 
   277   \medskip Since jEdit happens to support environment variables within
   285   \medskip Since jEdit happens to support environment variables within
   278   file specifications as well, it is natural to use similar notation
   286   file specifications as well, it is natural to use similar notation
   279   within the editor, e.g.\ in the file-browser.  This does not work in
   287   within the editor, e.g.\ in the file-browser.  This does not work in
   280   full generality, though, due to the bias of jEdit towards
   288   full generality, though, due to the bias of jEdit towards
   293   also \secref{sec:tooltips-hyperlinks}).  This allows to open the
   301   also \secref{sec:tooltips-hyperlinks}).  This allows to open the
   294   corresponding file in the text editor, independently of the path
   302   corresponding file in the text editor, independently of the path
   295   notation.  *}
   303   notation.  *}
   296 
   304 
   297 
   305 
   298 chapter {* Prover IDE functionality *}
       
   299 
       
   300 section {* Text buffers and theories \label{sec:buffers-theories} *}
   306 section {* Text buffers and theories \label{sec:buffers-theories} *}
   301 
   307 
   302 text {* As regular text editor, jEdit maintains a collection of open
   308 text {* As regular text editor, jEdit maintains a collection of open
   303   \emph{text buffers} to store source files; each buffer may be
   309   \emph{text buffers} to store source files; each buffer may be
   304   associated with any number of visible \emph{text areas}.  Buffers
   310   associated with any number of visible \emph{text areas}.  Buffers
   319   Isabelle/jEdit to resolve dependencies of \emph{theory imports}.
   325   Isabelle/jEdit to resolve dependencies of \emph{theory imports}.
   320   The system requests to load additional files into editor buffers, in
   326   The system requests to load additional files into editor buffers, in
   321   order to be included in the theory document model for further
   327   order to be included in the theory document model for further
   322   checking.  It is also possible to resolve dependencies
   328   checking.  It is also possible to resolve dependencies
   323   automatically, depending on \emph{Plugin Options / Isabelle /
   329   automatically, depending on \emph{Plugin Options / Isabelle /
   324   General / Auto load} (Isabelle system option @{system_option
   330   General / Auto load}.
   325   jedit_auto_load}).
       
   326 
   331 
   327   \medskip The open text area views on theory buffers define the
   332   \medskip The open text area views on theory buffers define the
   328   visible \emph{perspective} of Isabelle/jEdit.  This is taken as a
   333   visible \emph{perspective} of Isabelle/jEdit.  This is taken as a
   329   hint for document processing: the prover ensures that those parts of
   334   hint for document processing: the prover ensures that those parts of
   330   a theory where the user is looking are checked, while other parts
   335   a theory where the user is looking are checked, while other parts
   331   that are presently not required are ignored.  The perspective is
   336   that are presently not required are ignored.  The perspective is
   332   changed by opening or closing text area windows, or scrolling within
   337   changed by opening or closing text area windows, or scrolling within
   333   some window.
   338   an editor window.
   334 
   339 
   335   The \emph{Theories} panel provides some further options to influence
   340   The \emph{Theories} panel provides some further options to influence
   336   the process of continuous checking: it may be switched off globally
   341   the process of continuous checking: it may be switched off globally
   337   to restrict the prover to superficial processing of command syntax.
   342   to restrict the prover to superficial processing of command syntax.
   338   It is also possible to indicate theory nodes as \emph{required} for
   343   It is also possible to indicate theory nodes as \emph{required} for
   364   original source text, and visualized in the text area, e.g.\ as text
   369   original source text, and visualized in the text area, e.g.\ as text
   365   colours for free and bound variables, or as squiggly underline for
   370   colours for free and bound variables, or as squiggly underline for
   366   warnings, errors etc.\ (see also \figref{fig:output}).  In the
   371   warnings, errors etc.\ (see also \figref{fig:output}).  In the
   367   latter case, the corresponding messages are shown by hovering with
   372   latter case, the corresponding messages are shown by hovering with
   368   the mouse over the highlighted text --- although in many situations
   373   the mouse over the highlighted text --- although in many situations
   369   the user should already get some clue by looking at the text
   374   the user should already get some clue by looking at the position of
   370   highlighting alone.
   375   the text highlighting.
   371 
   376 
   372   \begin{figure}[htb]
   377   \begin{figure}[htb]
   373   \begin{center}
   378   \begin{center}
   374   \includegraphics[scale=0.3]{output}
   379   \includegraphics[scale=0.3]{output}
   375   \end{center}
   380   \end{center}
   376   \caption{Multiple views on prover output: gutter area, text area
   381   \caption{Multiple views on prover output: gutter area with icon,
   377     with popup, overview area, Theories panel, Output panel}
   382     text area with popup, overview area, Theories panel, Output panel}
   378   \label{fig:output}
   383   \label{fig:output}
   379   \end{figure}
   384   \end{figure}
   380 
   385 
   381   The ``gutter area'' on the left-hand-side of the text area uses
   386   The ``gutter area'' on the left-hand-side of the text area uses
   382   icons to provide a summary of the messages within the corresponding
   387   icons to provide a summary of the messages within the adjacent
   383   line of text.  Message priorities are used to prefer errors over
   388   line of text.  Message priorities are used to prefer errors over
   384   warnings, warnings over information messages etc.  Plain output is
   389   warnings, warnings over information messages etc.  Plain output is
   385   ignored here.
   390   ignored here.
   386 
   391 
   387   The ``overview area'' on the right-hand-side of the text area uses
   392   The ``overview area'' on the right-hand-side of the text area uses
   388   similar information to paint small rectangles for the overall status
   393   similar information to paint small rectangles for the overall status
   389   of the whole text buffer.  The graphics is scaled to fit the logical
   394   of the whole text buffer.  The graphics is scaled to fit the logical
   390   buffer length into the given window height.  Mouse clicks on the
   395   buffer length into the given window height.  Mouse clicks on the
   391   overview area position the cursor approximately to the corresponding
   396   overview area position the cursor approximately to the corresponding
   392   line of text in the buffer.
   397   line of text in the buffer.  Repainting the overview in real-time
       
   398   causes problems with big theories, so it is restricted to part of
       
   399   the text according to \emph{Plugin Options / Isabelle / General /
       
   400   Text Overview Limit} (in characters).
   393 
   401 
   394   Another course-grained overview is provided by the \emph{Theories}
   402   Another course-grained overview is provided by the \emph{Theories}
   395   panel (\secref{sec:buffers-theories}), but without direct
   403   panel, but without direct correspondence to text positions.  A
   396   correspondence to text positions.  A double-click on one of the
   404   double-click on one of the theory entries with their status overview
   397   theory entries with their status overview opens the corresponding
   405   opens the corresponding text buffer, without changing the cursor
   398   text buffer, without changing the cursor position.
   406   position.
   399 
   407 
   400   \medskip In addition, the \emph{Output} panel displays prover
   408   \medskip In addition, the \emph{Output} panel displays prover
   401   messages that correspond to a given command, within a separate
   409   messages that correspond to a given command, within a separate
   402   window.
   410   window.
   403 
   411 
   404   The cursor position in the presently active text area determines the
   412   The cursor position in the presently active text area determines the
   405   prover commands whose cumulative message output is appended an shown
   413   prover commands whose cumulative message output is appended and
   406   in that window (in canonical order according to the processing of
   414   shown in that window (in canonical order according to the processing
   407   the command).  There are also control elements to modify the update
   415   of the command).  There are also control elements to modify the
   408   policy of the output wrt.\ continued editor movements.  This is
   416   update policy of the output wrt.\ continued editor movements.  This
   409   particularly useful with several independent instances of the
   417   is particularly useful with several independent instances of the
   410   \emph{Output} panel, which the Dockable Window Manager of jEdit can
   418   \emph{Output} panel, which the Dockable Window Manager of jEdit can
   411   handle conveniently.
   419   handle conveniently.
   412 
   420 
   413   Former users of the old TTY interaction model (e.g.\ Proof~General)
   421   Former users of the old TTY interaction model (e.g.\ Proof~General)
   414   might find a separate window for prover messages familiar, but it is
   422   might find a separate window for prover messages familiar, but it is
   415   important to understand that the main Prover IDE feedback happens
   423   important to understand that the main Prover IDE feedback happens
   416   elsewhere.  It is possible to do meaningful proof editing
   424   elsewhere.  It is possible to do meaningful proof editing
   417   efficiently while using the secondary window only rarely.
   425   efficiently, using secondary output windows only rarely.
   418 
   426 
   419   The main purpose of the output window is to ``debug'' unclear
   427   The main purpose of the output window is to ``debug'' unclear
   420   situations by inspecting internal state of the prover.\footnote{In
   428   situations by inspecting internal state of the prover.\footnote{In
   421   that sense, unstructured tactic scripts depend on continuous
   429   that sense, unstructured tactic scripts depend on continuous
   422   debugging with internal state inspection.} Consequently, some
   430   debugging with internal state inspection.} Consequently, some
   460   \label{fig:nested-tooltips}
   468   \label{fig:nested-tooltips}
   461   \end{figure}
   469   \end{figure}
   462 
   470 
   463   The tooltip popup window provides some controls to \emph{close} or
   471   The tooltip popup window provides some controls to \emph{close} or
   464   \emph{detach} the window, turning it into a separate \emph{Info}
   472   \emph{detach} the window, turning it into a separate \emph{Info}
   465   dockable window managed by jEdit.  The @{verbatim ESCAPE} key closes
   473   window managed by jEdit.  The @{verbatim ESCAPE} key closes
   466   \emph{all} popups, which is particularly relevant when nested
   474   \emph{all} popups, which is particularly relevant when nested
   467   tooltips are stacking up.
   475   tooltips are stacking up.
   468 
   476 
   469   \medskip A black rectangle in the text indicates a hyperlink that
   477   \medskip A black rectangle in the text indicates a hyperlink that
   470   may be followed by a mouse click (while the @{verbatim CONTROL} or
   478   may be followed by a mouse click (while the @{verbatim CONTROL} or
   471   @{verbatim COMMAND} modifier key is still pressed). Presently
   479   @{verbatim COMMAND} modifier key is still pressed). Presently
   472   (Isabelle2013-1) there is no systematic way to return to the
   480   (Isabelle2013-1) there is no systematic navigation within the
   473   original location within the editor.
   481   editor to return to the original location.
   474 
   482 
   475   Also note that the link target may be a file that is itself not
   483   Also note that the link target may be a file that is itself not
   476   subject to formal document processing of the editor session and thus
   484   subject to formal document processing of the editor session and thus
   477   prevents further exploration: the chain of hyperlinks may end in
   485   prevents further exploration: the chain of hyperlinks may end in
   478   some source file of the underlying logic image, even within the
   486   some source file of the underlying logic image, or within the
   479   Isabelle/ML bootstrap sources of Isabelle/Pure, where the formal
   487   Isabelle/ML bootstrap sources of Isabelle/Pure. *}
   480   markup is less detailed. *}
       
   481 
   488 
   482 
   489 
   483 section {* Text completion \label{sec:completion} *}
   490 section {* Text completion \label{sec:completion} *}
   484 
   491 
   485 text {* \paragraph{Completion tables} are determined statically from
   492 text {* \paragraph{Completion tables} are determined statically from
   486   the ``outer syntax'' of the underlying edit mode (for theory files
   493   the ``outer syntax'' of the underlying edit mode (for theory files
   487   this is the syntax of Isar commands) and specifications of Isabelle
   494   this is the syntax of Isar commands), and specifications of Isabelle
   488   symbols (see also \secref{sec:symbols}).
   495   symbols (see also \secref{sec:symbols}).
   489 
   496 
   490   Symbols are completed in backslashed forms, e.g.\ @{verbatim
   497   Symbols are completed in backslashed forms, e.g.\ @{verbatim
   491   "\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the
   498   "\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the
   492   Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The
   499   Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The
   493   extra backslash avoids overlap with keywords of the buffer syntax,
   500   extra backslash avoids overlap with keywords of the buffer syntax,
   494   and facilitates to produce Isabelle symbols in arbitrary syntactic
   501   and allows to produce Isabelle symbols robustly in most syntactic
   495   contexts.}  Alternatively, symbol abbreviations may be used as
   502   contexts.}  Alternatively, symbol abbreviations may be used as
   496   specified in @{file "$ISABELLE_HOME/etc/symbols"}.
   503   specified in @{file "$ISABELLE_HOME/etc/symbols"}.
   497 
   504 
   498   \paragraph{Completion popups} are required in situations of
   505   \paragraph{Completion popups} are required in situations of
   499   ambiguous completion results or where explicit confirmation is
   506   ambiguous completion results or where explicit confirmation is
   508 
   515 
   509   The meaning of special keys is as follows:
   516   The meaning of special keys is as follows:
   510 
   517 
   511   \medskip
   518   \medskip
   512   \begin{tabular}{ll}
   519   \begin{tabular}{ll}
       
   520   \textbf{key} & \textbf{action} \\\hline
   513   @{verbatim "TAB"} & select completion \\
   521   @{verbatim "TAB"} & select completion \\
   514   @{verbatim "ESCAPE"} & dismiss popup \\
   522   @{verbatim "ESCAPE"} & dismiss popup \\
   515   @{verbatim "UP"} & move up one item \\
   523   @{verbatim "UP"} & move up one item \\
   516   @{verbatim "DOWN"} & move down one item \\
   524   @{verbatim "DOWN"} & move down one item \\
   517   @{verbatim "PAGE_UP"} & move up one page of items \\
   525   @{verbatim "PAGE_UP"} & move up one page of items \\
   521 
   529 
   522   Movement within the popup is only active for multiple items.
   530   Movement within the popup is only active for multiple items.
   523   Otherwise the corresponding key event retains its standard meaning
   531   Otherwise the corresponding key event retains its standard meaning
   524   within the underlying text area.
   532   within the underlying text area.
   525 
   533 
   526   \paragraph{Explicit completion} is triggered by the keyword shortcut
   534   \paragraph{Explicit completion} is triggered by the keyboard
   527   @{verbatim "C+b"} for action @{verbatim "isabelle.complete"}.  This
   535   shortcut @{verbatim "C+b"} (action @{verbatim "isabelle.complete"}).
   528   overrides the original jEdit action @{verbatim "complete-word"} on
   536   This overrides the original jEdit binding for action @{verbatim
   529   that key sequence, but the latter is used as fall-back for
   537   "complete-word"}, but the latter is used as fall-back for
   530   non-Isabelle edit modes.  It is also possible to restore the
   538   non-Isabelle edit modes.  It is also possible to restore the
   531   original jEdit keyboard mapping of @{verbatim "complete-word"}.
   539   original jEdit keyboard mapping of @{verbatim "complete-word"} via
       
   540   \emph{Global Options / Shortcuts}.
   532 
   541 
   533   Replacement text is inserted immediately into the buffer, unless
   542   Replacement text is inserted immediately into the buffer, unless
   534   ambiguous results demand an explicit popup.
   543   ambiguous results demand an explicit popup.
   535 
   544 
   536   \paragraph{Implicit completion} is triggered by regular keyboard
   545   \paragraph{Implicit completion} is triggered by regular keyboard
   537   input events during of the editing process in the main jEdit text
   546   input events during of the editing process in the main jEdit text
   538   area (and a few additional text fields like the search criterium of
   547   area (and a few additional text fields like the search criteria of
   539   the Find panel, see \secref{sec:find}).  Implicit completion depends
   548   the Find panel, see \secref{sec:find}).  Implicit completion depends
   540   on on further side-conditions:
   549   on on further side-conditions:
   541 
   550 
   542   \begin{enumerate}
   551   \begin{enumerate}
   543 
   552 
   544   \item The system option @{system_option jedit_completion} needs to
   553   \item The system option @{system_option jedit_completion} needs to
   545   be enabled (default).
   554   be enabled (default).
   546 
   555 
   547   \item Completion of syntax keywords requires at least 3 characters
   556   \item Completion of syntax keywords requires at least 3 relevant
   548   in the text.
   557   characters in the text.
   549 
   558 
   550   \item The system option @{system_option jedit_completion} determines
   559   \item The system option @{system_option jedit_completion_delay}
   551   an additional delay (0.0 by default), before opening a completion
   560   determines an additional delay (0.0 by default), before opening a
   552   popup.
   561   completion popup.
   553 
   562 
   554   \item The system option @{system_option jedit_completion_immediate}
   563   \item The system option @{system_option jedit_completion_immediate}
   555   (disabled by default) controls whether replacement text should be
   564   (disabled by default) controls whether replacement text should be
   556   inserted immediately without popup, if possible.  This only works
   565   inserted immediately without popup.  This is restricted to Isabelle
   557   for Isabelle symbols (\secref{sec:symbols}).
   566   symbols and their abbreviations (\secref{sec:symbols}) --- plain
   558 
   567   keywords always demand a popup for clarity.
   559   \item Completion of symbol abbreviations with only 1 character in
   568 
   560   the text always enforces and explicit popup, independently of
   569   \item Completion of symbol abbreviations with only one relevant
   561   @{system_option jedit_completion_immediate}.
   570   character in the text always enforces an explicit popup,
       
   571   independently of @{system_option jedit_completion_immediate}.
   562 
   572 
   563   \end{enumerate}
   573   \end{enumerate}
   564 
   574 
   565   These completion options may be configured in \emph{Plugin Options /
   575   These completion options may be configured in \emph{Plugin Options /
   566   Isabelle / General / Completion}.  The default is quite moderate in
   576   Isabelle / General / Completion}.  The default is quite moderate in
   567   showing occasional popups and refraining from immediate insertion.
   577   showing occasional popups and refraining from immediate insertion.
   568   An additional of e.g.\ 0.3 seconds will make it even less ambitious.
   578   An additional completion delay of 0.3 seconds will make it even less
   569 
   579   ambitious.
   570   A more aggressive configuration is @{system_option
   580 
       
   581   In contrast, more aggressive completion works via @{system_option
   571   jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option
   582   jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option
   572   jedit_completion_immediate}~@{verbatim "= true"}.  Thus the editing
   583   jedit_completion_immediate}~@{verbatim "= true"}.  Thus the editing
   573   process becomes more dependent on the system guessing correctly what
   584   process becomes dependent on the system guessing correctly what the
   574   the user had in mind.  It requires some practice and study of the
   585   user had in mind.  It requires some practice (and study of the
   575   symbol abbreviation tables to be productive in this mode.
   586   symbol abbreviation tables) to become productive in this advanced
   576 
   587   mode.
   577   Unintended completions can be reverted by the regular @{verbatim
   588 
   578   undo} operation of jEdit.  When editing embedded languages such as
   589   In any case, unintended completions can be reverted by the regular
   579   ML works, it is better to disable either @{system_option
   590   @{verbatim undo} operation of jEdit.  When editing embedded
       
   591   languages such as ML, it is better to disable either @{system_option
   580   jedit_completion} or @{system_option jedit_completion_immediate}
   592   jedit_completion} or @{system_option jedit_completion_immediate}
   581   temporarily.
   593   temporarily.  *}
   582 *}
       
   583 
   594 
   584 
   595 
   585 section {* Isabelle symbols \label{sec:symbols} *}
   596 section {* Isabelle symbols \label{sec:symbols} *}
   586 
   597 
   587 text {* Isabelle sources consist of \emph{symbols} that extend plain
   598 text {* Isabelle sources consist of \emph{symbols} that extend plain
   588   ASCII to allow infinitely many mathematical symbols within the
   599   ASCII to allow infinitely many mathematical symbols within the
   589   formal sources.  This works without depending on particular
   600   formal sources.  This works without depending on particular
   590   encodings or varying Unicode standards
   601   encodings and varying Unicode standards
   591   \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within
   602   \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within
   592   formal sources would compromise portability and reliability in the
   603   formal sources would compromise portability and reliability in the
   593   face of changing interpretation of various unexpected features of
   604   face of changing interpretation of special features of Unicode, such
   594   Unicode.}
   605   as Combining Characters or Bi-directional Text.}
   595 
   606 
   596   For the prover back-end, formal text consists of ASCII characters
   607   For the prover back-end, formal text consists of ASCII characters
   597   that are grouped according to some simple rules, e.g.\ as plain
   608   that are grouped according to some simple rules, e.g.\ as plain
   598   ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''.
   609   ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''.
   599 
   610 
   600   For the editor front-end, a certain subset of symbols is rendered
   611   For the editor front-end, a certain subset of symbols is rendered
   601   physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}''
   612   physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}''
   602   as ``@{text "\<alpha>"}'', for example.  This symbol interpretation is
   613   as ``@{text "\<alpha>"}'', for example.  This symbol interpretation is
   603   specified by the Isabelle system distribution in @{file
   614   specified by the Isabelle system distribution in @{file
   604   "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
   615   "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
   605   @{verbatim "$ISABELLE_HOME_USER/etc/symbols"}.
   616   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
   606 
   617 
   607   The appendix of \cite{isabelle-isar-ref} gives an overview of the
   618   The appendix of \cite{isabelle-isar-ref} gives an overview of the
   608   standard interpretation of finitely many symbols from the infinite
   619   standard interpretation of finitely many symbols from the infinite
   609   collection.  Uninterpreted symbols are displayed literally, e.g.\
   620   collection.  Uninterpreted symbols are displayed literally, e.g.\
   610   ``@{verbatim "\<foobar>"}''.  Overlap of Unicode characters used in
   621   ``@{verbatim "\<foobar>"}''.  Overlap of Unicode characters used in
   611   symbol interpretation with informal ones that might appear e.g.\ in
   622   symbol interpretation with informal ones (which might appear e.g.\
   612   comments needs to be avoided!
   623   in comments) needs to be avoided!  Raw Unicode characters within
       
   624   prover source files should be restricted to informal parts, e.g.\ to
       
   625   write text in non-latin alphabets in comments.
   613 
   626 
   614   \medskip \paragraph{Encoding.} Technically, the Unicode view on
   627   \medskip \paragraph{Encoding.} Technically, the Unicode view on
   615   Isabelle symbols is an \emph{encoding} in jEdit (not in the
   628   Isabelle symbols is an \emph{encoding} in jEdit (not in the
   616   underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}.  It is
   629   underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}.  It is
   617   provided by the Isabelle/jEdit plugin and enabled by default for all
   630   provided by the Isabelle/jEdit plugin and enabled by default for all
   630   application font @{verbatim IsabelleText}, which ensures that
   643   application font @{verbatim IsabelleText}, which ensures that
   631   standard collection of Isabelle symbols are actually seen on the
   644   standard collection of Isabelle symbols are actually seen on the
   632   screen (or printer).
   645   screen (or printer).
   633 
   646 
   634   Note that a Java/AWT/Swing application can load additional fonts
   647   Note that a Java/AWT/Swing application can load additional fonts
   635   only if they are not installed as system font already!  This means
   648   only if they are not installed on the operating system already!
   636   some old version of @{verbatim IsabelleText} that happens to be
   649   Some old version of @{verbatim IsabelleText} that happens to be
   637   already present prevents Isabelle/jEdit from using its current
   650   provided by the operating system would prevents Isabelle/jEdit from
   638   bundled version.  This results in missing glyphs (black rectangles),
   651   its bundled version.  This could lead to missing glyphs (black
   639   when some obsolete version of @{verbatim IsabelleText} is used by
   652   rectangles), when the system version of @{verbatim IsabelleText} is
   640   accident.  This problem can be avoided by refraining to ``install''
   653   older than the application version.  This problem can be avoided by
   641   any version of @{verbatim IsabelleText} in the first place.
   654   refraining to ``install'' any version of @{verbatim IsabelleText} in
       
   655   the first place (although it might be occasionally tempting to use
       
   656   the same font in other applications).
   642 
   657 
   643   \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit
   658   \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit
   644   could delegate the problem to produce Isabelle symbols in their
   659   could delegate the problem to produce Isabelle symbols in their
   645   Unicode rendering to the underlying operating system and its
   660   Unicode rendering to the underlying operating system and its
   646   \emph{input methods}.  Regular jEdit also provides various ways to
   661   \emph{input methods}.  Regular jEdit also provides various ways to
   654 
   669 
   655   \begin{enumerate}
   670   \begin{enumerate}
   656 
   671 
   657   \item The \emph{Symbols} panel with some GUI buttons to insert
   672   \item The \emph{Symbols} panel with some GUI buttons to insert
   658   certain symbols in the text buffer.  There are also tooltips to
   673   certain symbols in the text buffer.  There are also tooltips to
   659   reveal to official Isabelle representation with some additional
   674   reveal the official Isabelle representation with some additional
   660   information about \emph{symbol abbreviations} (see below).
   675   information about \emph{symbol abbreviations} (see below).
   661 
   676 
   662   \item Copy / paste from decoded source files: text that is rendered
   677   \item Copy / paste from decoded source files: text that is rendered
   663   as Unicode already can be re-used to produce further text.  This
   678   as Unicode already can be re-used to produce further text.  This
   664   also works between different applications, e.g.\ Isabelle/jEdit and
   679   also works between different applications, e.g.\ Isabelle/jEdit and
   666   Isabelle symbols is used uniformly.
   681   Isabelle symbols is used uniformly.
   667 
   682 
   668   \item Copy / paste from prover output within Isabelle/jEdit.  The
   683   \item Copy / paste from prover output within Isabelle/jEdit.  The
   669   same principles as for text buffers apply, but note that \emph{copy}
   684   same principles as for text buffers apply, but note that \emph{copy}
   670   in secondary Isabelle/jEdit windows works via the keyboard shortcut
   685   in secondary Isabelle/jEdit windows works via the keyboard shortcut
   671   @{verbatim "C+c"}.  The jEdit menu actions always refer to the
   686   @{verbatim "C+c"}, while jEdit menu actions always refer to the
   672   primary text area!
   687   primary text area!
   673 
   688 
   674   \item Completion provided by Isabelle plugin (see
   689   \item Completion provided by Isabelle plugin (see
   675   \secref{sec:completion}).  Isabelle symbols have a canonical name
   690   \secref{sec:completion}).  Isabelle symbols have a canonical name
   676   and optional abbreviations.  This can be used with the text
   691   and optional abbreviations.  This can be used with the text
   682   The following table is an extract of the information provided by the
   697   The following table is an extract of the information provided by the
   683   standard @{file "$ISABELLE_HOME/etc/symbols"} file:
   698   standard @{file "$ISABELLE_HOME/etc/symbols"} file:
   684 
   699 
   685   \medskip
   700   \medskip
   686   \begin{tabular}{lll}
   701   \begin{tabular}{lll}
   687     \textbf{symbol} & \textbf{abbreviation} & \textbf{backslashed name} \\\hline
   702     \textbf{symbol} & \textbf{backslashed name} & \textbf{abbreviation} \\\hline
   688     @{text "\<lambda>"}   & @{verbatim "%"}     &  @{verbatim "\\lambda"}         \\
   703     @{text "\<lambda>"} & @{verbatim "\\lambda"} & @{verbatim "%"} \\
   689     @{text "\<Rightarrow>"}  & @{verbatim "=>"}    &  @{verbatim "\\Rightarrow"}     \\
   704     @{text "\<Rightarrow>"} & @{verbatim "\\Rightarrow"} & @{verbatim "=>"} \\
   690     @{text "\<Longrightarrow>"} & @{verbatim "==>"}   &  @{verbatim "\\Longrightarrow"} \\
   705     @{text "\<Longrightarrow>"} & @{verbatim "\\Longrightarrow"} & @{verbatim "==>"} \\[0.5ex]
   691 
   706     @{text "\<And>"} & @{verbatim "\\And"} & @{verbatim "!!"} \\
   692     @{text "\<And>"}  & @{verbatim "!!"}    &  @{verbatim "\\And"}            \\
   707     @{text "\<equiv>"} & @{verbatim "\\equiv"} & @{verbatim "=="} \\[0.5ex]
   693     @{text "\<equiv>"}  & @{verbatim "=="}    &  @{verbatim "\\equiv"}          \\
   708     @{text "\<forall>"} & @{verbatim "\\forall"} & @{verbatim "!"} \\
   694 
   709     @{text "\<exists>"} & @{verbatim "\\exists"} & @{verbatim "?"} \\
   695     @{text "\<forall>"}   & @{verbatim "!"}     &  @{verbatim "\\forall"}         \\
   710     @{text "\<longrightarrow>"} & @{verbatim "\\longrightarrow"} & @{verbatim "-->"} \\
   696     @{text "\<exists>"}   & @{verbatim "?"}     &  @{verbatim "\\exists"}         \\
   711     @{text "\<and>"} & @{verbatim "\\and"} & @{verbatim "&"} \\
   697     @{text "\<longrightarrow>"} & @{verbatim "-->"}   &  @{verbatim "\\longrightarrow"} \\
   712     @{text "\<or>"} & @{verbatim "\\or"} & @{verbatim "|"} \\
   698     @{text "\<and>"}   & @{verbatim "&"}     &  @{verbatim "\\and"}            \\
   713     @{text "\<not>"} & @{verbatim "\\not"} & @{verbatim "~"} \\
   699     @{text "\<or>"}   & @{verbatim "|"}     &  @{verbatim "\\or"}             \\
   714     @{text "\<noteq>"} & @{verbatim "\\noteq"} & @{verbatim "~="} \\
   700     @{text "\<not>"}   & @{verbatim "~"}     &  @{verbatim "\\not"}            \\
   715     @{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\
   701     @{text "\<noteq>"}   & @{verbatim "~="}    &  @{verbatim "\\noteq"}          \\
   716     @{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\
   702     @{text "\<in>"}   & @{verbatim ":"}     &  @{verbatim "\\in"}             \\
       
   703     @{text "\<notin>"}   & @{verbatim "~:"}    &  @{verbatim "\\notin"}          \\
       
   704   \end{tabular}
   717   \end{tabular}
   705   \medskip
   718   \medskip
   706 
   719 
   707   Note that the above abbreviations refer to the input method. The
   720   Note that the above abbreviations refer to the input method. The
   708   logical notation provides ASCII alternatives that often coincide,
   721   logical notation provides ASCII alternatives that often coincide,
   709   but deviate occasionally.  This occasionally causes user confusion
   722   but deviate occasionally.  This occasionally causes user confusion
   710   with very old-fashioned Isabelle source that use ASCII replacement
   723   with very old-fashioned Isabelle source that use ASCII replacement
   711   notation like @{verbatim "!"} or @{verbatim "ALL"} directly.
   724   notation like @{verbatim "!"} or @{verbatim "ALL"} directly in the
       
   725   text.
       
   726 
       
   727   On the other hand, coincidence of symbol abbreviations with ASCII
       
   728   replacement syntax syntax helps to update old theory sources via
       
   729   explicit completion (see also @{verbatim "C+b"} explained in
       
   730   \secref{sec:completion}).
   712 
   731 
   713   \end{enumerate}
   732   \end{enumerate}
   714 
   733 
   715   Raw Unicode characters within prover source files should be
       
   716   restricted to informal parts, e.g.\ to write text in non-latin
       
   717   alphabets.  Mathematical symbols should be defined via the official
       
   718   rendering tables, to avoid problems with portability and long-term
       
   719   storage of formal text.
       
   720 
       
   721   \paragraph{Control symbols.} There are some special control symbols
   734   \paragraph{Control symbols.} There are some special control symbols
   722   to modify the style of a single symbol (without nesting). Control
   735   to modify the display style of a single symbol (without
   723   symbols may be applied to a region of selected text, either using
   736   nesting). Control symbols may be applied to a region of selected
   724   the \emph{Symbols} panel or keyboard shortcuts or jEdit actions.
   737   text, either using the \emph{Symbols} panel or keyboard shortcuts or
   725   These editor operations produce a separate control symbol for each
   738   jEdit actions.  These editor operations produce a separate control
   726   symbol in the text, in order to make the whole text appear in a
   739   symbol for each symbol in the text, in order to make the whole text
   727   certain style.
   740   appear in a certain style.
   728 
   741 
   729   \medskip
   742   \medskip
   730   \begin{tabular}{llll}
   743   \begin{tabular}{llll}
   731     style & \textbf{symbol} & shortcut & action \\\hline
   744     \textbf{style} & \textbf{symbol} & \textbf{shortcut} & \textbf{action} \\\hline
   732     superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{verbatim "isabelle.control-sup"} \\
   745     superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{verbatim "isabelle.control-sup"} \\
   733     subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{verbatim "isabelle.control-sub"} \\
   746     subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{verbatim "isabelle.control-sub"} \\
   734     bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{verbatim "isabelle.control-bold"} \\
   747     bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{verbatim "isabelle.control-bold"} \\
   735     reset & & @{verbatim "C+e LEFT"} & @{verbatim "isabelle.control-reset"} \\
   748     reset & & @{verbatim "C+e LEFT"} & @{verbatim "isabelle.control-reset"} \\
   736   \end{tabular}
   749   \end{tabular}
   756   theorem}), independently of the state of the current proof attempt.
   769   theorem}), independently of the state of the current proof attempt.
   757   They work implicitly without any arguments.  Results are output as
   770   They work implicitly without any arguments.  Results are output as
   758   \emph{information messages}, which are indicated in the text area by
   771   \emph{information messages}, which are indicated in the text area by
   759   blue squiggles and a blue information sign in the gutter (see
   772   blue squiggles and a blue information sign in the gutter (see
   760   \figref{fig:auto-tools}).  The message content may be shown as for
   773   \figref{fig:auto-tools}).  The message content may be shown as for
   761   any other message, see also \secref{sec:prover-output}.  Some tools
   774   other output (see also \secref{sec:prover-output}).  Some tools
   762   produce output with \emph{sendback} markup, which means that
   775   produce output with \emph{sendback} markup, which means that
   763   clicking on certain parts of the output inserts that text into the
   776   clicking on certain parts of the output inserts that text into the
   764   source in the proper place.
   777   source in the proper place.
   765 
   778 
   766   \begin{figure}[htb]
   779   \begin{figure}[htb]
   769   \end{center}
   782   \end{center}
   770   \caption{Results of automatically tried tools}
   783   \caption{Results of automatically tried tools}
   771   \label{fig:auto-tools}
   784   \label{fig:auto-tools}
   772   \end{figure}
   785   \end{figure}
   773 
   786 
   774   \medskip The following Isabelle system options control the behaviour
   787   \medskip The following Isabelle system options control the behavior
   775   of automatically tried tools (see also the jEdit dialog window
   788   of automatically tried tools (see also the jEdit dialog window
   776   \emph{Plugin Options / Isabelle / General / Automatically tried
   789   \emph{Plugin Options / Isabelle / General / Automatically tried
   777   tools}):
   790   tools}):
   778 
   791 
   779   \begin{itemize}
   792   \begin{itemize}
   780 
   793 
   781   \item @{system_option auto_methods} controls automatic use of a
   794   \item @{system_option auto_methods} controls automatic use of a
   782   combination of standard proof methods (@{method auto}, @{method
   795   combination of standard proof methods (@{method auto}, @{method
   783   simp}, @{method blast}, etc.).  This corresponds to the command
   796   simp}, @{method blast}, etc.).  This corresponds to the Isar command
   784   @{command "try0"}.
   797   @{command "try0"}.
   785 
   798 
   786   The tool is disabled by default, since unparameterized invocation of
   799   The tool is disabled by default, since unparameterized invocation of
   787   standard proof methods often consumes substantial CPU resources
   800   standard proof methods often consumes substantial CPU resources
   788   without leading to success.
   801   without leading to success.
   824   policies of parallel execution, which may be configured as follows:
   837   policies of parallel execution, which may be configured as follows:
   825 
   838 
   826   \begin{itemize}
   839   \begin{itemize}
   827 
   840 
   828   \item @{system_option auto_time_limit} (default 2.0) determines the
   841   \item @{system_option auto_time_limit} (default 2.0) determines the
   829   timeout (in seconds) for each tool execution individually.
   842   timeout (in seconds) for each tool execution.
   830 
   843 
   831   \item @{system_option auto_time_start} (default 1.0) determines the
   844   \item @{system_option auto_time_start} (default 1.0) determines the
   832   start delay (in seconds) for automatically tried tools, after the
   845   start delay (in seconds) for automatically tried tools, after the
   833   main command evaluation is finished.
   846   main command evaluation is finished.
   834 
   847 
   841   tool is not canceled and may thus reduce reactivity of proof
   854   tool is not canceled and may thus reduce reactivity of proof
   842   document processing.
   855   document processing.
   843 
   856 
   844   Users should experiment how the available CPU resources (number of
   857   Users should experiment how the available CPU resources (number of
   845   cores) are best invested to get additional feedback from prover in
   858   cores) are best invested to get additional feedback from prover in
   846   the background, by using weaker or stronger tools.  *}
   859   the background, by using a selection of weaker or stronger tools.
       
   860 *}
   847 
   861 
   848 
   862 
   849 section {* Sledgehammer \label{sec:sledgehammer} *}
   863 section {* Sledgehammer \label{sec:sledgehammer} *}
   850 
   864 
   851 text {* The \emph{Sledgehammer} panel (\figref{fig:sledgehammer})
   865 text {* The \emph{Sledgehammer} panel (\figref{fig:sledgehammer})
   852   provides a view on some independent execution of @{command
   866   provides a view on some independent execution of the Isar command
   853   sledgehammer}, with process indicator (spinning wheel) and GUI
   867   @{command sledgehammer}, with process indicator (spinning wheel) and
   854   elements for important Sledgehammer arguments and options.  Any
   868   GUI elements for important Sledgehammer arguments and options.  Any
   855   number of Sledgehammer panels may be active, according to the
   869   number of Sledgehammer panels may be active, according to the
   856   standard policies of Dockable Window Management in jEdit.  Closing a
   870   standard policies of Dockable Window Management in jEdit.  Closing
   857   window also cancels the corresponding prover tasks.
   871   such windows also cancels the corresponding prover tasks.
   858 
   872 
   859   \begin{figure}[htb]
   873   \begin{figure}[htb]
   860   \begin{center}
   874   \begin{center}
   861   \includegraphics[scale=0.3]{sledgehammer}
   875   \includegraphics[scale=0.3]{sledgehammer}
   862   \end{center}
   876   \end{center}
   869   text --- this should be some pending proof problem.  Further buttons
   883   text --- this should be some pending proof problem.  Further buttons
   870   like \emph{Cancel} and \emph{Locate} help to manage the running
   884   like \emph{Cancel} and \emph{Locate} help to manage the running
   871   process.
   885   process.
   872 
   886 
   873   Results appear incrementally in the output window of the panel.
   887   Results appear incrementally in the output window of the panel.
   874   Proposed proof snippets are marked up as \emph{sendback}, which
   888   Proposed proof snippets are marked-up as \emph{sendback}, which
   875   means a single mouse click inserts the text into a suitable place of
   889   means a single mouse click inserts the text into a suitable place of
   876   the original source.  Some manual editing may be required
   890   the original source.  Some manual editing may be required
   877   nonetheless, say to remove earlier proof attempts. *}
   891   nonetheless, say to remove earlier proof attempts. *}
   878 
   892 
   879 
   893 
   880 section {* Find theorems \label{sec:find} *}
   894 section {* Find theorems \label{sec:find} *}
   881 
   895 
   882 text {* The \emph{Find} panel (\figref{fig:find}) provides an
   896 text {* The \emph{Find} panel (\figref{fig:find}) provides an
   883   independent view for @{command find_theorems}.  The main text field
   897   independent view for the Isar command @{command find_theorems}.  The
   884   accepts search criteria according to the syntax @{syntax
   898   main text field accepts search criteria according to the syntax
   885   thmcriterium} given in \cite{isabelle-isar-ref}.  Further options of
   899   @{syntax thmcriterium} given in \cite{isabelle-isar-ref}.  Further
   886   @{command find_theorems} are available via GUI elements.
   900   options of @{command find_theorems} are available via GUI elements.
   887 
   901 
   888   \begin{figure}[htb]
   902   \begin{figure}[htb]
   889   \begin{center}
   903   \begin{center}
   890   \includegraphics[scale=0.3]{find}
   904   \includegraphics[scale=0.3]{find}
   891   \end{center}
   905   \end{center}
   906 text {* The \emph{SideKick} plugin of jEdit provides some general
   920 text {* The \emph{SideKick} plugin of jEdit provides some general
   907   services to display buffer structure in a tree view.
   921   services to display buffer structure in a tree view.
   908 
   922 
   909   Isabelle/jEdit provides SideKick parsers for its main mode for
   923   Isabelle/jEdit provides SideKick parsers for its main mode for
   910   theory files, as well as some minor modes for the @{verbatim NEWS}
   924   theory files, as well as some minor modes for the @{verbatim NEWS}
   911   file, session @{verbatim ROOT} files, and @{verbatim options}.
   925   file, session @{verbatim ROOT} files, and system @{verbatim
       
   926   options}.
   912 
   927 
   913   Moreover, the special SideKick parser @{verbatim "isabelle-markup"}
   928   Moreover, the special SideKick parser @{verbatim "isabelle-markup"}
   914   provides access to the full (uninterpreted) markup tree of the PIDE
   929   provides access to the full (uninterpreted) markup tree of the PIDE
   915   document model of the current buffer.  This is occasionally useful
   930   document model of the current buffer.  This is occasionally useful
   916   for informative purposes, but the amount of displayed information
   931   for informative purposes, but the amount of displayed information
   951   display is continuously updated according to @{system_option
   966   display is continuously updated according to @{system_option
   952   editor_chart_delay}.  Note that the painting of the chart takes
   967   editor_chart_delay}.  Note that the painting of the chart takes
   953   considerable runtime itself --- on the Java Virtual Machine that
   968   considerable runtime itself --- on the Java Virtual Machine that
   954   runs Isabelle/Scala, not Isabelle/ML.  Internally, the
   969   runs Isabelle/Scala, not Isabelle/ML.  Internally, the
   955   Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides
   970   Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides
   956   further access runtime statistics of Isabelle/ML.  *}
   971   further access to statistics of Isabelle/ML.  *}
   957 
   972 
   958 
   973 
   959 section {* Isabelle/Scala console *}
   974 section {* Isabelle/Scala console *}
   960 
   975 
   961 text {* The \emph{Console} plugin of jEdit manages various shells
   976 text {* The \emph{Console} plugin of jEdit manages various shells
   962   (command interpreters), e.g.\ \emph{BeanShell}, which is the
   977   (command interpreters), e.g.\ \emph{BeanShell}, which is the
   963   official jEdit scripting language, and the somewhat
   978   official jEdit scripting language, and the cross-platform
   964   platform-independent \emph{System} shell.  Thus the console provides
   979   \emph{System} shell.  Thus the console provides similar
   965   similar functionality than the special buffers @{verbatim
   980   functionality than the special buffers @{verbatim "*scratch*"} and
   966   "*scratch*"} and @{verbatim "*shell*"} in Emacs.
   981   @{verbatim "*shell*"} in Emacs.
   967 
   982 
   968   Isabelle/jEdit extends the repertoire of the console by
   983   Isabelle/jEdit extends the repertoire of the console by
   969   \emph{Scala}, which is the regular Scala toplevel loop running
   984   \emph{Scala}, which is the regular Scala toplevel loop running
   970   inside the \emph{same} JVM process as Isabelle/jEdit itself.  This
   985   inside the \emph{same} JVM process as Isabelle/jEdit itself.  This
   971   means the Scala command interpreter has access to the JVM name space
   986   means the Scala command interpreter has access to the JVM name space
   986 
  1001 
   987 
  1002 
   988 section {* Low-level output *}
  1003 section {* Low-level output *}
   989 
  1004 
   990 text {* Prover output is normally shown directly in the main text area
  1005 text {* Prover output is normally shown directly in the main text area
   991   or adjacent \emph{Output} panels, as explained in
  1006   or secondary \emph{Output} panels, as explained in
   992   \secref{sec:prover-output}.
  1007   \secref{sec:prover-output}.
   993 
  1008 
   994   Beyond this, it is occasionally useful to inspect low-level output
  1009   Beyond this, it is occasionally useful to inspect low-level output
   995   channels via some of the following additional panels:
  1010   channels via some of the following additional panels:
   996 
  1011 
  1000   Isabelle/Scala and Isabelle/ML side of the PIDE editing protocol.
  1015   Isabelle/Scala and Isabelle/ML side of the PIDE editing protocol.
  1001   Recording of messages starts with the first activation of the
  1016   Recording of messages starts with the first activation of the
  1002   corresponding dockable window; earlier messages are lost.
  1017   corresponding dockable window; earlier messages are lost.
  1003 
  1018 
  1004   Actual display of protocol messages causes considerable slowdown, so
  1019   Actual display of protocol messages causes considerable slowdown, so
  1005   it is important to ``undock'' the \emph{Protocol} panel for
  1020   it is important to undock all \emph{Protocol} panels for production
  1006   production work.
  1021   work.
  1007 
  1022 
  1008   \item \emph{Raw Output} shows chunks of text from the @{verbatim
  1023   \item \emph{Raw Output} shows chunks of text from the @{verbatim
  1009   stdout} and @{verbatim stderr} channels of the prover process.
  1024   stdout} and @{verbatim stderr} channels of the prover process.
  1010   Recording of output starts with the first activation of the
  1025   Recording of output starts with the first activation of the
  1011   corresponding dockable window; earlier output is lost.
  1026   corresponding dockable window; earlier output is lost.
  1049   editing corresponding command in the text.
  1064   editing corresponding command in the text.
  1050 
  1065 
  1051   \item \textbf{Problem:} Odd behavior of some diagnostic commands with
  1066   \item \textbf{Problem:} Odd behavior of some diagnostic commands with
  1052   global side-effects, like writing a physical file.
  1067   global side-effects, like writing a physical file.
  1053 
  1068 
  1054   \textbf{Workaround:} Avoid such commands.
  1069   \textbf{Workaround:} Copy / paste complete command text from
       
  1070   elsewhere, or discontinue continuous checking temporarily.
  1055 
  1071 
  1056   \item \textbf{Problem:} No way to delete document nodes from the overall
  1072   \item \textbf{Problem:} No way to delete document nodes from the overall
  1057   collection of theories.
  1073   collection of theories.
  1058 
  1074 
  1059   \textbf{Workaround:} Ignore unused files.  Restart whole
  1075   \textbf{Workaround:} Ignore unused files.  Restart whole
  1061 
  1077 
  1062   \item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and
  1078   \item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and
  1063   @{verbatim "C+MINUS"} for adjusting the editor font size depend on
  1079   @{verbatim "C+MINUS"} for adjusting the editor font size depend on
  1064   platform details and national keyboards.
  1080   platform details and national keyboards.
  1065 
  1081 
  1066   \textbf{Workaround:} Use numeric keypad or rebind keys in the
  1082   \textbf{Workaround:} Rebind keys via \emph{Global Options /
  1067   jEdit Shortcuts options dialog.
  1083   Shortcuts}.
  1068 
  1084 
  1069   \item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim
  1085   \item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim
  1070   "COMMAND+COMMA"} for application \emph{Preferences} is in conflict
  1086   "COMMAND+COMMA"} for application \emph{Preferences} is in conflict
  1071   with the jEdit default shortcut for \emph{Incremental Search Bar}
  1087   with the jEdit default shortcut for \emph{Incremental Search Bar}
  1072   (action @{verbatim "quick-search"}).
  1088   (action @{verbatim "quick-search"}).
  1073 
  1089 
  1074   \textbf{Workaround:} Remap in jEdit manually according to national
  1090   \textbf{Workaround:} Rebind key via \emph{Global Options /
  1075   keyboard, e.g.\ @{verbatim "COMMAND+SLASH"} on English ones.
  1091   Shortcuts} according to national keyboard, e.g.\ @{verbatim
       
  1092   "COMMAND+SLASH"} on English ones.
  1076 
  1093 
  1077   \item \textbf{Problem:} Mac OS X system fonts sometimes lead to
  1094   \item \textbf{Problem:} Mac OS X system fonts sometimes lead to
  1078   character drop-outs in the main text area.
  1095   character drop-outs in the main text area.
  1079 
  1096 
  1080   \textbf{Workaround:} Use the default @{verbatim IsabelleText} font.
  1097   \textbf{Workaround:} Use the default @{verbatim IsabelleText} font.
  1103   \item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim
  1120   \item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim
  1104   "toggle-full-screen"} (default shortcut @{verbatim F11}) works on
  1121   "toggle-full-screen"} (default shortcut @{verbatim F11}) works on
  1105   Windows, but not on Mac OS X or various Linux / X11 window managers.
  1122   Windows, but not on Mac OS X or various Linux / X11 window managers.
  1106 
  1123 
  1107   \textbf{Workaround:} Use native full-screen control of the window
  1124   \textbf{Workaround:} Use native full-screen control of the window
  1108   manager, if available (notably on Mac OS X).
  1125   manager (notably on Mac OS X).
  1109 
  1126 
  1110   \item \textbf{Problem:} Full-screen mode and dockable windows in
  1127   \item \textbf{Problem:} Full-screen mode and dockable windows in
  1111   \emph{floating} state may lead to confusion about window placement
  1128   \emph{floating} state may lead to confusion about window placement
  1112   (depending on platform characteristics).
  1129   (depending on platform characteristics).
  1113 
  1130