src/Doc/JEdit/JEdit.thy
author wenzelm
Wed, 20 Nov 2013 17:00:49 +0100
changeset 55906 05738b7d8191
parent 55287 46adb57c89db
child 56013 d64a4ef26edb
permissions -rw-r--r--
NEWS;
     1 (*:wrap=hard:maxLineLen=78:*)
     2 
     3 theory JEdit
     4 imports Base
     5 begin
     6 
     7 chapter {* Introduction *}
     8 
     9 section {* Concepts and terminology *}
    10 
    11 text {* Isabelle/jEdit is a Prover IDE that integrates \emph{parallel
    12   proof checking} \cite{Wenzel:2009,Wenzel:2013:ITP} with
    13   \emph{asynchronous user interaction}
    14   \cite{Wenzel:2010,Wenzel:2012:UITP-EPTCS}, based on a
    15   document-oriented approach to \emph{continuous proof processing}
    16   \cite{Wenzel:2011:CICM,Wenzel:2012}. Many concepts and system
    17   components are fit together in order to make this work. The main
    18   building blocks are as follows.
    19 
    20   \begin{description}
    21 
    22   \item [PIDE] is a general framework for Prover IDEs based on
    23   Isabelle/Scala. It is built around a concept of parallel and
    24   asynchronous document processing, which is supported natively by the
    25   parallel proof engine that is implemented in Isabelle/ML. The prover
    26   discontinues the traditional TTY-based command loop, and supports
    27   direct editing of formal source text with rich formal markup for GUI
    28   rendering.
    29 
    30   \item [Isabelle/ML] is the implementation and extension language of
    31   Isabelle, see also \cite{isabelle-implementation}. It is integrated
    32   into the logical context of Isabelle/Isar and allows to manipulate
    33   logical entities directly. Arbitrary add-on tools may be implemented
    34   for object-logics such as Isabelle/HOL.
    35 
    36   \item [Isabelle/Scala] is the system programming language of
    37   Isabelle. It extends the pure logical environment of Isabelle/ML
    38   towards the ``real world'' of graphical user interfaces, text
    39   editors, IDE frameworks, web services etc.  Special infrastructure
    40   allows to transfer algebraic datatypes and formatted text easily
    41   between ML and Scala, using asynchronous protocol commands.
    42 
    43   \item [jEdit] is a sophisticated text editor implemented in
    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.\
    46   Scala\footnote{\url{http://www.scala-lang.org/}}.
    47 
    48   \item [Isabelle/jEdit] is the main example application of the PIDE
    49   framework and the default user-interface for Isabelle. It targets
    50   both beginners and experts. Technically, Isabelle/jEdit combines a
    51   slightly modified version of the jEdit code base with a special
    52   plugin for Isabelle, integrated as standalone application for the
    53   main operating system platforms: Linux, Windows, Mac OS X.
    54 
    55   \end{description}
    56 
    57   The subtle differences of Isabelle/ML versus Standard ML,
    58   Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be
    59   taken into account when discussing any of these PIDE building blocks
    60   in public forums, mailing lists, or even scientific publications.
    61   *}
    62 
    63 
    64 section {* The Isabelle/jEdit Prover IDE *}
    65 
    66 text {*
    67   \begin{figure}[htb]
    68   \begin{center}
    69   \includegraphics[width=\textwidth]{isabelle-jedit}
    70   \end{center}
    71   \caption{The Isabelle/jEdit Prover IDE}
    72   \label{fig:isabelle-jedit}
    73   \end{figure}
    74 
    75   Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some
    76   plugins for the well-known jEdit text editor
    77   \url{http://www.jedit.org}, according to the following principles.
    78 
    79   \begin{itemize}
    80 
    81   \item The original jEdit look-and-feel is generally preserved,
    82   although some default properties are changed to accommodate Isabelle
    83   (e.g.\ the text area font).
    84 
    85   \item Formal Isabelle/Isar text is checked asynchronously while
    86   editing.  The user is in full command of the editor, and the prover
    87   refrains from locking portions of the buffer.
    88 
    89   \item Prover feedback works via colors, boxes, squiggly underline,
    90   hyperlinks, popup windows, icons, clickable output --- all based on
    91   semantic markup produced by Isabelle in the background.
    92 
    93   \item Using the mouse together with the modifier key @{verbatim
    94   CONTROL} (Linux, Windows) or @{verbatim COMMAND} (Mac OS X) exposes
    95   additional formal content via tooltips and/or hyperlinks.
    96 
    97   \item Formal output (in popups etc.) may be explored recursively,
    98   using the same techniques as in the editor source buffer.
    99 
   100   \item Additional panels (e.g.\ \emph{Output}, \emph{Symbols}) are
   101   organized by the Dockable Window Manager of jEdit, which also allows
   102   multiple floating instances of each window class.
   103 
   104   \item The prover process and source files are managed on the editor
   105   side.  The prover operates on timeless and stateless document
   106   content as provided via Isabelle/Scala.
   107 
   108   \item Plugin options of jEdit (for the \emph{Isabelle} plugin) give
   109   access to a selection of Isabelle/Scala options and its persistent
   110   preferences, usually with immediate effect on the prover back-end or
   111   editor front-end.
   112 
   113   \item The logic image of the prover session may be specified within
   114   Isabelle/jEdit.  The new image is provided automatically by the
   115   Isabelle build tool after restart of the application.
   116 
   117   \end{itemize}
   118 *}
   119 
   120 
   121 subsection {* Documentation *}
   122 
   123 text {* Regular jEdit documentation is accessible via its @{verbatim
   124   Help} menu or @{verbatim F1} keyboard shortcut. This includes a full
   125   \emph{User's Guide} and \emph{Frequently Asked Questions} for this
   126   sophisticated text editor.
   127 
   128   Most of this information about jEdit is relevant for Isabelle/jEdit
   129   as well, but one needs to keep in mind that defaults sometimes
   130   differ, and the official jEdit documentation does not know about the
   131   Isabelle plugin with its special support for theory editing.
   132 *}
   133 
   134 
   135 subsection {* Plugins *}
   136 
   137 text {* The \emph{Plugin Manager} of jEdit allows to augment editor
   138   functionality by JVM modules (jars) that are provided by the central
   139   plugin repository, which is accessible via various mirror sites.
   140 
   141   Connecting to the plugin server infrastructure of the jEdit project
   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
   144   contributions. Arbitrary combinations of add-on features are apt to
   145   cause problems.  It is advisable to start with the default
   146   configuration of Isabelle/jEdit and develop some understanding how
   147   it is supposed to work, before loading additional plugins at a grand
   148   scale.
   149 
   150   \medskip The main \emph{Isabelle} plugin is an integral part of
   151   Isabelle/jEdit and needs to remain active at all times! A few
   152   additional plugins are bundled with Isabelle/jEdit for convenience
   153   or out of necessity, notably \emph{Console} with its Isabelle/Scala
   154   sub-plugin and \emph{SideKick} with some Isabelle-specific parsers
   155   for document tree structure.  The \emph{ErrorList} plugin is
   156   required by \emph{SideKick}, but not used specifically in
   157   Isabelle/jEdit. *}
   158 
   159 
   160 subsection {* Options *}
   161 
   162 text {* Both jEdit and Isabelle have distinctive management of
   163   persistent options.
   164 
   165   Regular jEdit options are accessible via the dialog for
   166   \emph{Plugins / Plugin Options}, which is also accessible via
   167   \emph{Utilities / Global Options}.  Changed properties are stored in
   168   @{file_unchecked "$ISABELLE_HOME_USER/jedit/properties"}.  In
   169   contrast, Isabelle system options are managed by Isabelle/Scala and
   170   changed values stored in @{file_unchecked
   171   "$ISABELLE_HOME_USER/etc/preferences"}, independently of the jEdit
   172   properties.  See also \cite{isabelle-sys}, especially the coverage
   173   of sessions and command-line tools like @{tool build} or @{tool
   174   options}.
   175 
   176   Those Isabelle options that are declared as \textbf{public} are
   177   configurable in jEdit via \emph{Plugin Options / Isabelle /
   178   General}.  Moreover, there are various options for rendering of
   179   document content, which are configurable via \emph{Plugin Options /
   180   Isabelle / Rendering}.  Thus \emph{Plugin Options / Isabelle} in
   181   jEdit provides a view on a subset of Isabelle system options.  Note
   182   that some of these options affect general parameters that are
   183   relevant outside Isabelle/jEdit as well, e.g.\ @{system_option
   184   threads} or @{system_option parallel_proofs} for the Isabelle build
   185   tool \cite{isabelle-sys}.
   186 
   187   \medskip All options are loaded on startup and saved on shutdown of
   188   Isabelle/jEdit.  Editing the machine-generated @{file_unchecked
   189   "$ISABELLE_HOME_USER/jedit/properties"} or @{file_unchecked
   190   "$ISABELLE_HOME_USER/etc/preferences"} manually while the
   191   application is running is likely to cause surprise due to lost
   192   update!  *}
   193 
   194 
   195 subsection {* Keymaps *}
   196 
   197 text {* Keyboard shortcuts used to be managed as jEdit properties in
   198   the past, but recent versions (2013) have a separate concept of
   199   \emph{keymap} that is configurable via \emph{Global Options /
   200   Shortcuts}.  The @{verbatim imported} keymap is derived from the
   201   initial environment of properties that is available at the first
   202   start of the editor; afterwards the keymap file takes precedence.
   203 
   204   This is relevant for Isabelle/jEdit due to various fine-tuning of
   205   default properties, and additional keyboard shortcuts for Isabelle
   206   specific functionality. Users may change their keymap later, but
   207   need to copy Isabelle-specific key bindings manually (see also
   208   @{file_unchecked "$ISABELLE_HOME_USER/jedit/keymaps"}).  *}
   209 
   210 
   211 subsection {* Look-and-feel *}
   212 
   213 text {* jEdit is a Java/AWT/Swing application with some ambition to
   214   support ``native'' look-and-feel on all platforms, within the limits
   215   of what Oracle as Java provider and major operating system
   216   distributors allow (see also \secref{sec:problems}).
   217 
   218   Isabelle/jEdit enables platform-specific look-and-feel by default as
   219   follows:
   220 
   221   \begin{description}
   222 
   223   \item[Linux] The platform-independent \emph{Nimbus} is used by
   224   default.
   225 
   226   \emph{GTK+} works under the side-condition that the overall GTK
   227   theme is selected in a Swing-friendly way.\footnote{GTK support in
   228   Java/Swing was once marketed aggressively by Sun, but never quite
   229   finished, and is today (2013) lagging a bit behind further
   230   development of Swing and GTK.}
   231 
   232   \item[Windows] Regular \emph{Windows} is used by default, but
   233   \emph{Windows Classic} also works.
   234 
   235   \item[Mac OS X] Regular \emph{Mac OS X} is used by default.
   236 
   237   Moreover the bundled \emph{MacOSX} plugin provides various functions
   238   that are expected from applications on that particular platform:
   239   quit from menu or dock, preferences menu, drag-and-drop of text
   240   files on the application, full-screen mode for main editor windows
   241   etc.
   242 
   243   \end{description}
   244 
   245   Users may experiment with different look-and-feels, but need to keep
   246   in mind that this extra variance of GUI functionality is unlikely to
   247   work in arbitrary combinations.  The platform-independent
   248   \emph{Nimbus} and \emph{Metal} should always work.  The historic
   249   \emph{CDE/Motif} is better avoided.
   250 
   251   After changing the look-and-feel in \emph{Global Options /
   252   Appearance}, it is advisable to restart Isabelle/jEdit in order to
   253   take full effect.  *}
   254 
   255 
   256 chapter {* Prover IDE functionality *}
   257 
   258 section {* File-system access *}
   259 
   260 text {* File specifications in jEdit follow various formats and
   261   conventions according to \emph{Virtual File Systems}, which may be
   262   also provided by additional plugins.  This allows to access remote
   263   files via the @{verbatim "http:"} protocol prefix, for example.
   264   Isabelle/jEdit attempts to work with the file-system access model of
   265   jEdit as far as possible.  In particular, theory sources are passed
   266   directly from the editor to the prover, without indirection via
   267   files.
   268 
   269   Despite the flexibility of URLs in jEdit, local files are
   270   particularly important and are accessible without protocol prefix.
   271   Here the path notation is that of the Java Virtual Machine on the
   272   underlying platform.  On Windows the preferred form uses
   273   backslashes, but happens to accept Unix/POSIX forward slashes, too.
   274   Further differences arise due to drive letters and network shares.
   275 
   276   The Java notation for files needs to be distinguished from the one
   277   of Isabelle, which uses POSIX notation with forward slashes on
   278   \emph{all} platforms.\footnote{Isabelle on Windows uses Cygwin
   279   file-system access.}  Moreover, environment variables from the
   280   Isabelle process may be used freely, e.g.\ @{file
   281   "$ISABELLE_HOME/etc/symbols"} or @{file "$POLYML_HOME/README"}.
   282   There are special shortcuts: @{file "~"} for @{file "$USER_HOME"}
   283   and @{file "~~"} for @{file "$ISABELLE_HOME"}.
   284 
   285   \medskip Since jEdit happens to support environment variables within
   286   file specifications as well, it is natural to use similar notation
   287   within the editor, e.g.\ in the file-browser.  This does not work in
   288   full generality, though, due to the bias of jEdit towards
   289   platform-specific notation and of Isabelle towards POSIX.  Moreover,
   290   the Isabelle settings environment is not yet active when starting
   291   Isabelle/jEdit via its standard application wrapper (in contrast to
   292   @{verbatim "isabelle jedit"} run from the command line).
   293 
   294   For convenience, Isabelle/jEdit imitates at least @{verbatim
   295   "$ISABELLE_HOME"} and @{verbatim "$ISABELLE_HOME_USER"} within the
   296   Java process environment, in order to allow easy access to these
   297   important places from the editor.
   298 
   299   Moreover note that path specifications in prover input or output
   300   usually include formal markup that turns it into a hyperlink (see
   301   also \secref{sec:tooltips-hyperlinks}).  This allows to open the
   302   corresponding file in the text editor, independently of the path
   303   notation.  *}
   304 
   305 
   306 section {* Text buffers and theories \label{sec:buffers-theories} *}
   307 
   308 text {* As regular text editor, jEdit maintains a collection of open
   309   \emph{text buffers} to store source files; each buffer may be
   310   associated with any number of visible \emph{text areas}.  Buffers
   311   are subject to an \emph{edit mode} that is determined from the file
   312   type.  Files with extension \texttt{.thy} are assigned to the mode
   313   \emph{isabelle} and treated specifically.
   314 
   315   \medskip Isabelle theory files are automatically added to the formal
   316   document model of Isabelle/Scala, which maintains a family of
   317   versions of all sources for the prover.  The \emph{Theories} panel
   318   provides an overview of the status of continuous checking of theory
   319   sources.  Unlike batch sessions \cite{isabelle-sys}, theory nodes
   320   are identified by full path names; this allows to work with multiple
   321   (disjoint) Isabelle sessions simultaneously within the same editor
   322   session.
   323 
   324   Certain events to open or update buffers with theory files cause
   325   Isabelle/jEdit to resolve dependencies of \emph{theory imports}.
   326   The system requests to load additional files into editor buffers, in
   327   order to be included in the theory document model for further
   328   checking.  It is also possible to resolve dependencies
   329   automatically, depending on \emph{Plugin Options / Isabelle /
   330   General / Auto load}.
   331 
   332   \medskip The open text area views on theory buffers define the
   333   visible \emph{perspective} of Isabelle/jEdit.  This is taken as a
   334   hint for document processing: the prover ensures that those parts of
   335   a theory where the user is looking are checked, while other parts
   336   that are presently not required are ignored.  The perspective is
   337   changed by opening or closing text area windows, or scrolling within
   338   an editor window.
   339 
   340   The \emph{Theories} panel provides some further options to influence
   341   the process of continuous checking: it may be switched off globally
   342   to restrict the prover to superficial processing of command syntax.
   343   It is also possible to indicate theory nodes as \emph{required} for
   344   continuous checking: this means such nodes and all their imports are
   345   always processed independently of the visibility status (if
   346   continuous checking is enabled).  Big theory libraries that are
   347   marked as required can have significant impact on performance,
   348   though.
   349 
   350   \medskip Formal markup of checked theory content is turned into GUI
   351   rendering, based on a standard repertoire known from IDEs for
   352   programming languages: colors, icons, highlighting, squiggly
   353   underline, tooltips, hyperlinks etc.  For outer syntax of
   354   Isabelle/Isar there is some traditional syntax-highlighting via
   355   static keyword tables and tokenization within the editor.  In
   356   contrast, the painting of inner syntax (term language etc.)\ uses
   357   semantic information that is reported dynamically from the logical
   358   context.  Thus the prover can provide additional markup to help the
   359   user to understand the meaning of formal text, and to produce more
   360   text with some add-on tools (e.g.\ information messages by automated
   361   provers or disprovers running in the background).
   362 *}
   363 
   364 
   365 section {* Prover output \label{sec:prover-output} *}
   366 
   367 text {* Prover output consists of \emph{markup} and \emph{messages}.
   368   Both are directly attached to the corresponding positions in the
   369   original source text, and visualized in the text area, e.g.\ as text
   370   colours for free and bound variables, or as squiggly underline for
   371   warnings, errors etc.\ (see also \figref{fig:output}).  In the
   372   latter case, the corresponding messages are shown by hovering with
   373   the mouse over the highlighted text --- although in many situations
   374   the user should already get some clue by looking at the position of
   375   the text highlighting.
   376 
   377   \begin{figure}[htb]
   378   \begin{center}
   379   \includegraphics[width=\textwidth]{output}
   380   \end{center}
   381   \caption{Multiple views on prover output: gutter area with icon,
   382     text area with popup, overview area, Theories panel, Output panel}
   383   \label{fig:output}
   384   \end{figure}
   385 
   386   The ``gutter area'' on the left-hand-side of the text area uses
   387   icons to provide a summary of the messages within the adjacent
   388   line of text.  Message priorities are used to prefer errors over
   389   warnings, warnings over information messages etc.  Plain output is
   390   ignored here.
   391 
   392   The ``overview area'' on the right-hand-side of the text area uses
   393   similar information to paint small rectangles for the overall status
   394   of the whole text buffer.  The graphics is scaled to fit the logical
   395   buffer length into the given window height.  Mouse clicks on the
   396   overview area position the cursor approximately to the corresponding
   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).
   401 
   402   Another course-grained overview is provided by the \emph{Theories}
   403   panel, but without direct correspondence to text positions.  A
   404   double-click on one of the theory entries with their status overview
   405   opens the corresponding text buffer, without changing the cursor
   406   position.
   407 
   408   \medskip In addition, the \emph{Output} panel displays prover
   409   messages that correspond to a given command, within a separate
   410   window.
   411 
   412   The cursor position in the presently active text area determines the
   413   prover commands whose cumulative message output is appended and
   414   shown in that window (in canonical order according to the processing
   415   of the command).  There are also control elements to modify the
   416   update policy of the output wrt.\ continued editor movements.  This
   417   is particularly useful with several independent instances of the
   418   \emph{Output} panel, which the Dockable Window Manager of jEdit can
   419   handle conveniently.
   420 
   421   Former users of the old TTY interaction model (e.g.\ Proof~General)
   422   might find a separate window for prover messages familiar, but it is
   423   important to understand that the main Prover IDE feedback happens
   424   elsewhere.  It is possible to do meaningful proof editing
   425   efficiently, using secondary output windows only rarely.
   426 
   427   The main purpose of the output window is to ``debug'' unclear
   428   situations by inspecting internal state of the prover.\footnote{In
   429   that sense, unstructured tactic scripts depend on continuous
   430   debugging with internal state inspection.} Consequently, some
   431   special messages for \emph{tracing} or \emph{proof state} only
   432   appear here, and are not attached to the original source.
   433 
   434   \medskip In any case, prover messages also contain markup that may
   435   be explored recursively via tooltips or hyperlinks (see
   436   \secref{sec:tooltips-hyperlinks}), or clicked directly to initiate
   437   certain actions (see \secref{sec:auto-tools} and
   438   \secref{sec:sledgehammer}).  *}
   439 
   440 
   441 section {* Tooltips and hyperlinks \label{sec:tooltips-hyperlinks} *}
   442 
   443 text {* Formally processed text (prover input or output) contains rich
   444   markup information that can be explored further by using the
   445   @{verbatim CONTROL} modifier key on Linux and Windows, or @{verbatim
   446   COMMAND} on Mac OS X.  Hovering with the mouse while the modifier is
   447   pressed reveals a \emph{tooltip} (grey box over the text with a
   448   yellow popup) and/or a \emph{hyperlink} (black rectangle over the
   449   text); see also \figref{fig:tooltip}.
   450 
   451   \begin{figure}[htb]
   452   \begin{center}
   453   \includegraphics[scale=0.3]{popup1}
   454   \end{center}
   455   \caption{Tooltip and hyperlink for some formal entity}
   456   \label{fig:tooltip}
   457   \end{figure}
   458 
   459   Tooltip popups use the same rendering principles as the main text
   460   area, and further tooltips and/or hyperlinks may be exposed
   461   recursively by the same mechanism; see \figref{fig:nested-tooltips}.
   462 
   463   \begin{figure}[htb]
   464   \begin{center}
   465   \includegraphics[scale=0.3]{popup2}
   466   \end{center}
   467   \caption{Nested tooltips over formal entities}
   468   \label{fig:nested-tooltips}
   469   \end{figure}
   470 
   471   The tooltip popup window provides some controls to \emph{close} or
   472   \emph{detach} the window, turning it into a separate \emph{Info}
   473   window managed by jEdit.  The @{verbatim ESCAPE} key closes
   474   \emph{all} popups, which is particularly relevant when nested
   475   tooltips are stacking up.
   476 
   477   \medskip A black rectangle in the text indicates a hyperlink that
   478   may be followed by a mouse click (while the @{verbatim CONTROL} or
   479   @{verbatim COMMAND} modifier key is still pressed). Presently
   480   (Isabelle2013-1) there is no systematic navigation within the
   481   editor to return to the original location.
   482 
   483   Also note that the link target may be a file that is itself not
   484   subject to formal document processing of the editor session and thus
   485   prevents further exploration: the chain of hyperlinks may end in
   486   some source file of the underlying logic image, or within the
   487   Isabelle/ML bootstrap sources of Isabelle/Pure. *}
   488 
   489 
   490 section {* Text completion \label{sec:completion} *}
   491 
   492 text {* \paragraph{Completion tables} are determined statically from
   493   the ``outer syntax'' of the underlying edit mode (for theory files
   494   this is the syntax of Isar commands), and specifications of Isabelle
   495   symbols (see also \secref{sec:symbols}).
   496 
   497   Symbols are completed in backslashed forms, e.g.\ @{verbatim
   498   "\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the
   499   Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The
   500   extra backslash avoids overlap with keywords of the buffer syntax,
   501   and allows to produce Isabelle symbols robustly in most syntactic
   502   contexts.}  Alternatively, symbol abbreviations may be used as
   503   specified in @{file "$ISABELLE_HOME/etc/symbols"}.
   504 
   505   \paragraph{Completion popups} are required in situations of
   506   ambiguous completion results or where explicit confirmation is
   507   demanded before inserting completed text into the buffer.
   508 
   509   The popup is some minimally invasive GUI component over the text
   510   area.  It interprets special keys @{verbatim TAB}, @{verbatim
   511   ESCAPE}, @{verbatim UP}, @{verbatim DOWN}, @{verbatim PAGE_UP},
   512   @{verbatim PAGE_DOWN}, but all other key events are passed to the
   513   underlying text area.  This allows to ignore unwanted completions
   514   most of the time and continue typing quickly.
   515 
   516   The meaning of special keys is as follows:
   517 
   518   \medskip
   519   \begin{tabular}{ll}
   520   \textbf{key} & \textbf{action} \\\hline
   521   @{verbatim "TAB"} & select completion \\
   522   @{verbatim "ESCAPE"} & dismiss popup \\
   523   @{verbatim "UP"} & move up one item \\
   524   @{verbatim "DOWN"} & move down one item \\
   525   @{verbatim "PAGE_UP"} & move up one page of items \\
   526   @{verbatim "PAGE_DOWN"} & move down one page of items \\
   527   \end{tabular}
   528   \medskip
   529 
   530   Movement within the popup is only active for multiple items.
   531   Otherwise the corresponding key event retains its standard meaning
   532   within the underlying text area.
   533 
   534   \paragraph{Explicit completion} is triggered by the keyboard
   535   shortcut @{verbatim "C+b"} (action @{verbatim "isabelle.complete"}).
   536   This overrides the original jEdit binding for action @{verbatim
   537   "complete-word"}, but the latter is used as fall-back for
   538   non-Isabelle edit modes.  It is also possible to restore the
   539   original jEdit keyboard mapping of @{verbatim "complete-word"} via
   540   \emph{Global Options / Shortcuts}.
   541 
   542   Replacement text is inserted immediately into the buffer, unless
   543   ambiguous results demand an explicit popup.
   544 
   545   \paragraph{Implicit completion} is triggered by regular keyboard
   546   input events during of the editing process in the main jEdit text
   547   area (and a few additional text fields like the search criteria of
   548   the Find panel, see \secref{sec:find}).  Implicit completion depends
   549   on on further side-conditions:
   550 
   551   \begin{enumerate}
   552 
   553   \item The system option @{system_option jedit_completion} needs to
   554   be enabled (default).
   555 
   556   \item Completion of syntax keywords requires at least 3 relevant
   557   characters in the text.
   558 
   559   \item The system option @{system_option jedit_completion_delay}
   560   determines an additional delay (0.0 by default), before opening a
   561   completion popup.
   562 
   563   \item The system option @{system_option
   564   jedit_completion_dismiss_delay} determines an additional delay (0.0
   565   by default), before dismissing an earlier completion popup.  A value
   566   like 0.1 is occasionally useful to reduce the chance of loosing key
   567   strokes when the speed of typing exceeds that of repainting GUI
   568   components.
   569 
   570   \item The system option @{system_option jedit_completion_immediate}
   571   (disabled by default) controls whether replacement text should be
   572   inserted immediately without popup.  This is restricted to Isabelle
   573   symbols and their abbreviations (\secref{sec:symbols}) --- plain
   574   keywords always demand a popup for clarity.
   575 
   576   \item Completion of symbol abbreviations with only one relevant
   577   character in the text always enforces an explicit popup,
   578   independently of @{system_option jedit_completion_immediate}.
   579 
   580   \end{enumerate}
   581 
   582   These completion options may be configured in \emph{Plugin Options /
   583   Isabelle / General / Completion}.  The default is quite moderate in
   584   showing occasional popups and refraining from immediate insertion.
   585   An additional completion delay of 0.3 seconds will make it even less
   586   ambitious.
   587 
   588   In contrast, more aggressive completion works via @{system_option
   589   jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option
   590   jedit_completion_immediate}~@{verbatim "= true"}.  Thus the editing
   591   process becomes dependent on the system guessing correctly what the
   592   user had in mind.  It requires some practice (and study of the
   593   symbol abbreviation tables) to become productive in this advanced
   594   mode.
   595 
   596   In any case, unintended completions can be reverted by the regular
   597   @{verbatim undo} operation of jEdit.  When editing embedded
   598   languages such as ML, it is better to disable either @{system_option
   599   jedit_completion} or @{system_option jedit_completion_immediate}
   600   temporarily.  *}
   601 
   602 
   603 section {* Isabelle symbols \label{sec:symbols} *}
   604 
   605 text {* Isabelle sources consist of \emph{symbols} that extend plain
   606   ASCII to allow infinitely many mathematical symbols within the
   607   formal sources.  This works without depending on particular
   608   encodings and varying Unicode standards
   609   \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within
   610   formal sources would compromise portability and reliability in the
   611   face of changing interpretation of special features of Unicode, such
   612   as Combining Characters or Bi-directional Text.}
   613 
   614   For the prover back-end, formal text consists of ASCII characters
   615   that are grouped according to some simple rules, e.g.\ as plain
   616   ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''.
   617 
   618   For the editor front-end, a certain subset of symbols is rendered
   619   physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}''
   620   as ``@{text "\<alpha>"}'', for example.  This symbol interpretation is
   621   specified by the Isabelle system distribution in @{file
   622   "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
   623   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
   624 
   625   The appendix of \cite{isabelle-isar-ref} gives an overview of the
   626   standard interpretation of finitely many symbols from the infinite
   627   collection.  Uninterpreted symbols are displayed literally, e.g.\
   628   ``@{verbatim "\<foobar>"}''.  Overlap of Unicode characters used in
   629   symbol interpretation with informal ones (which might appear e.g.\
   630   in comments) needs to be avoided!  Raw Unicode characters within
   631   prover source files should be restricted to informal parts, e.g.\ to
   632   write text in non-latin alphabets in comments.
   633 
   634   \medskip \paragraph{Encoding.} Technically, the Unicode view on
   635   Isabelle symbols is an \emph{encoding} in jEdit (not in the
   636   underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}.  It is
   637   provided by the Isabelle/jEdit plugin and enabled by default for all
   638   source files.  Sometimes such defaults are reset accidentally, or
   639   malformed UTF-8 sequences in the text force jEdit to fall back on a
   640   different encoding like @{verbatim "ISO-8859-15"}.  In that case,
   641   verbatim ``@{verbatim "\<alpha>"}'' will be shown in the text buffer
   642   instead of its Unicode rendering ``@{text "\<alpha>"}''.  The jEdit menu
   643   operation \emph{File / Reload with Encoding / UTF-8-Isabelle} helps
   644   to resolve such problems, potentially after repairing malformed
   645   parts of the text.
   646 
   647   \medskip \paragraph{Font.} Correct rendering via Unicode requires a
   648   font that contains glyphs for the corresponding codepoints.  Most
   649   system fonts lack that, so Isabelle/jEdit prefers its own
   650   application font @{verbatim IsabelleText}, which ensures that
   651   standard collection of Isabelle symbols are actually seen on the
   652   screen (or printer).
   653 
   654   Note that a Java/AWT/Swing application can load additional fonts
   655   only if they are not installed on the operating system already!
   656   Some old version of @{verbatim IsabelleText} that happens to be
   657   provided by the operating system would prevents Isabelle/jEdit from
   658   its bundled version.  This could lead to missing glyphs (black
   659   rectangles), when the system version of @{verbatim IsabelleText} is
   660   older than the application version.  This problem can be avoided by
   661   refraining to ``install'' any version of @{verbatim IsabelleText} in
   662   the first place (although it might be occasionally tempting to use
   663   the same font in other applications).
   664 
   665   \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit
   666   could delegate the problem to produce Isabelle symbols in their
   667   Unicode rendering to the underlying operating system and its
   668   \emph{input methods}.  Regular jEdit also provides various ways to
   669   work with \emph{abbreviations} to produce certain non-ASCII
   670   characters.  Since none of these standard input methods work
   671   satisfactorily for the mathematical characters required for
   672   Isabelle, various specific Isabelle/jEdit mechanisms are provided.
   673 
   674   Here is a summary for practically relevant input methods for
   675   Isabelle symbols:
   676 
   677   \begin{enumerate}
   678 
   679   \item The \emph{Symbols} panel with some GUI buttons to insert
   680   certain symbols in the text buffer.  There are also tooltips to
   681   reveal the official Isabelle representation with some additional
   682   information about \emph{symbol abbreviations} (see below).
   683 
   684   \item Copy / paste from decoded source files: text that is rendered
   685   as Unicode already can be re-used to produce further text.  This
   686   also works between different applications, e.g.\ Isabelle/jEdit and
   687   some web browser or mail client, as long as the same Unicode view on
   688   Isabelle symbols is used uniformly.
   689 
   690   \item Copy / paste from prover output within Isabelle/jEdit.  The
   691   same principles as for text buffers apply, but note that \emph{copy}
   692   in secondary Isabelle/jEdit windows works via the keyboard shortcut
   693   @{verbatim "C+c"}, while jEdit menu actions always refer to the
   694   primary text area!
   695 
   696   \item Completion provided by Isabelle plugin (see
   697   \secref{sec:completion}).  Isabelle symbols have a canonical name
   698   and optional abbreviations.  This can be used with the text
   699   completion mechanism of Isabelle/jEdit, to replace a prefix of the
   700   actual symbol like @{verbatim "\<lambda>"}, or its backslashed name
   701   @{verbatim "\\"}@{verbatim "lambda"}, or its ASCII abbreviation
   702   @{verbatim "%"} by the Unicode rendering.
   703 
   704   The following table is an extract of the information provided by the
   705   standard @{file "$ISABELLE_HOME/etc/symbols"} file:
   706 
   707   \medskip
   708   \begin{tabular}{lll}
   709     \textbf{symbol} & \textbf{backslashed name} & \textbf{abbreviation} \\\hline
   710     @{text "\<lambda>"} & @{verbatim "\\lambda"} & @{verbatim "%"} \\
   711     @{text "\<Rightarrow>"} & @{verbatim "\\Rightarrow"} & @{verbatim "=>"} \\
   712     @{text "\<Longrightarrow>"} & @{verbatim "\\Longrightarrow"} & @{verbatim "==>"} \\[0.5ex]
   713     @{text "\<And>"} & @{verbatim "\\And"} & @{verbatim "!!"} \\
   714     @{text "\<equiv>"} & @{verbatim "\\equiv"} & @{verbatim "=="} \\[0.5ex]
   715     @{text "\<forall>"} & @{verbatim "\\forall"} & @{verbatim "!"} \\
   716     @{text "\<exists>"} & @{verbatim "\\exists"} & @{verbatim "?"} \\
   717     @{text "\<longrightarrow>"} & @{verbatim "\\longrightarrow"} & @{verbatim "-->"} \\
   718     @{text "\<and>"} & @{verbatim "\\and"} & @{verbatim "&"} \\
   719     @{text "\<or>"} & @{verbatim "\\or"} & @{verbatim "|"} \\
   720     @{text "\<not>"} & @{verbatim "\\not"} & @{verbatim "~"} \\
   721     @{text "\<noteq>"} & @{verbatim "\\noteq"} & @{verbatim "~="} \\
   722     @{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\
   723     @{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\
   724   \end{tabular}
   725   \medskip
   726 
   727   Note that the above abbreviations refer to the input method. The
   728   logical notation provides ASCII alternatives that often coincide,
   729   but deviate occasionally.  This occasionally causes user confusion
   730   with very old-fashioned Isabelle source that use ASCII replacement
   731   notation like @{verbatim "!"} or @{verbatim "ALL"} directly in the
   732   text.
   733 
   734   On the other hand, coincidence of symbol abbreviations with ASCII
   735   replacement syntax syntax helps to update old theory sources via
   736   explicit completion (see also @{verbatim "C+b"} explained in
   737   \secref{sec:completion}).
   738 
   739   \end{enumerate}
   740 
   741   \paragraph{Control symbols.} There are some special control symbols
   742   to modify the display style of a single symbol (without
   743   nesting). Control symbols may be applied to a region of selected
   744   text, either using the \emph{Symbols} panel or keyboard shortcuts or
   745   jEdit actions.  These editor operations produce a separate control
   746   symbol for each symbol in the text, in order to make the whole text
   747   appear in a certain style.
   748 
   749   \medskip
   750   \begin{tabular}{llll}
   751     \textbf{style} & \textbf{symbol} & \textbf{shortcut} & \textbf{action} \\\hline
   752     superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{verbatim "isabelle.control-sup"} \\
   753     subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{verbatim "isabelle.control-sub"} \\
   754     bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{verbatim "isabelle.control-bold"} \\
   755     reset & & @{verbatim "C+e LEFT"} & @{verbatim "isabelle.control-reset"} \\
   756   \end{tabular}
   757   \medskip
   758 
   759   To produce a single control symbol, it is also possible to complete
   760   on @{verbatim "\\"}@{verbatim sup}, @{verbatim "\\"}@{verbatim sub},
   761   @{verbatim "\\"}@{verbatim bold} as for regular symbols.  *}
   762 
   763 
   764 section {* Automatically tried tools \label{sec:auto-tools} *}
   765 
   766 text {* Continuous document processing works asynchronously in the
   767   background.  Visible document source that has been evaluated already
   768   may get augmented by additional results of \emph{asynchronous print
   769   functions}.  The canonical example is proof state output, which is
   770   always enabled.  More heavy-weight print functions may be applied,
   771   in order to prove or disprove parts of the formal text by other
   772   means.
   773 
   774   Isabelle/HOL provides various automatically tried tools that operate
   775   on outermost goal statements (e.g.\ @{command lemma}, @{command
   776   theorem}), independently of the state of the current proof attempt.
   777   They work implicitly without any arguments.  Results are output as
   778   \emph{information messages}, which are indicated in the text area by
   779   blue squiggles and a blue information sign in the gutter (see
   780   \figref{fig:auto-tools}).  The message content may be shown as for
   781   other output (see also \secref{sec:prover-output}).  Some tools
   782   produce output with \emph{sendback} markup, which means that
   783   clicking on certain parts of the output inserts that text into the
   784   source in the proper place.
   785 
   786   \begin{figure}[htb]
   787   \begin{center}
   788   \includegraphics[scale=0.3]{auto-tools}
   789   \end{center}
   790   \caption{Results of automatically tried tools}
   791   \label{fig:auto-tools}
   792   \end{figure}
   793 
   794   \medskip The following Isabelle system options control the behavior
   795   of automatically tried tools (see also the jEdit dialog window
   796   \emph{Plugin Options / Isabelle / General / Automatically tried
   797   tools}):
   798 
   799   \begin{itemize}
   800 
   801   \item @{system_option auto_methods} controls automatic use of a
   802   combination of standard proof methods (@{method auto}, @{method
   803   simp}, @{method blast}, etc.).  This corresponds to the Isar command
   804   @{command "try0"}.
   805 
   806   The tool is disabled by default, since unparameterized invocation of
   807   standard proof methods often consumes substantial CPU resources
   808   without leading to success.
   809 
   810   \item @{system_option auto_nitpick} controls a slightly reduced
   811   version of @{command nitpick}, which tests for counterexamples using
   812   first-order relational logic. See also the Nitpick manual
   813   \cite{isabelle-nitpick}.
   814 
   815   This tool is disabled by default, due to the extra overhead of
   816   invoking an external Java process for each attempt to disprove a
   817   subgoal.
   818 
   819   \item @{system_option auto_quickcheck} controls automatic use of
   820   @{command quickcheck}, which tests for counterexamples using a
   821   series of assignments for free variables of a subgoal.
   822 
   823   This tool is \emph{enabled} by default.  It requires little
   824   overhead, but is a bit weaker than @{command nitpick}.
   825 
   826   \item @{system_option auto_sledgehammer} controls a significantly
   827   reduced version of @{command sledgehammer}, which attempts to prove
   828   a subgoal using external automatic provers. See also the
   829   Sledgehammer manual \cite{isabelle-sledgehammer}.
   830 
   831   This tool is disabled by default, due to the relatively heavy nature
   832   of Sledgehammer.
   833 
   834   \item @{system_option auto_solve_direct} controls automatic use of
   835   @{command solve_direct}, which checks whether the current subgoals
   836   can be solved directly by an existing theorem.  This also helps to
   837   detect duplicate lemmas.
   838 
   839   This tool is \emph{enabled} by default.
   840 
   841   \end{itemize}
   842 
   843   Invocation of automatically tried tools is subject to some global
   844   policies of parallel execution, which may be configured as follows:
   845 
   846   \begin{itemize}
   847 
   848   \item @{system_option auto_time_limit} (default 2.0) determines the
   849   timeout (in seconds) for each tool execution.
   850 
   851   \item @{system_option auto_time_start} (default 1.0) determines the
   852   start delay (in seconds) for automatically tried tools, after the
   853   main command evaluation is finished.
   854 
   855   \end{itemize}
   856 
   857   Each tool is submitted independently to the pool of parallel
   858   execution tasks in Isabelle/ML, using hardwired priorities according
   859   to its relative ``heaviness''.  The main stages of evaluation and
   860   printing of proof states take precedence, but an already running
   861   tool is not canceled and may thus reduce reactivity of proof
   862   document processing.
   863 
   864   Users should experiment how the available CPU resources (number of
   865   cores) are best invested to get additional feedback from prover in
   866   the background, by using a selection of weaker or stronger tools.
   867 *}
   868 
   869 
   870 section {* Sledgehammer \label{sec:sledgehammer} *}
   871 
   872 text {* The \emph{Sledgehammer} panel (\figref{fig:sledgehammer})
   873   provides a view on some independent execution of the Isar command
   874   @{command sledgehammer}, with process indicator (spinning wheel) and
   875   GUI elements for important Sledgehammer arguments and options.  Any
   876   number of Sledgehammer panels may be active, according to the
   877   standard policies of Dockable Window Management in jEdit.  Closing
   878   such windows also cancels the corresponding prover tasks.
   879 
   880   \begin{figure}[htb]
   881   \begin{center}
   882   \includegraphics[scale=0.3]{sledgehammer}
   883   \end{center}
   884   \caption{An instance of the Sledgehammer panel}
   885   \label{fig:sledgehammer}
   886   \end{figure}
   887 
   888   The \emph{Apply} button attaches a fresh invocation of @{command
   889   sledgehammer} to the command where the cursor is pointing in the
   890   text --- this should be some pending proof problem.  Further buttons
   891   like \emph{Cancel} and \emph{Locate} help to manage the running
   892   process.
   893 
   894   Results appear incrementally in the output window of the panel.
   895   Proposed proof snippets are marked-up as \emph{sendback}, which
   896   means a single mouse click inserts the text into a suitable place of
   897   the original source.  Some manual editing may be required
   898   nonetheless, say to remove earlier proof attempts. *}
   899 
   900 
   901 section {* Find theorems \label{sec:find} *}
   902 
   903 text {* The \emph{Find} panel (\figref{fig:find}) provides an
   904   independent view for the Isar command @{command find_theorems}.  The
   905   main text field accepts search criteria according to the syntax
   906   @{syntax thmcriterium} given in \cite{isabelle-isar-ref}.  Further
   907   options of @{command find_theorems} are available via GUI elements.
   908 
   909   \begin{figure}[htb]
   910   \begin{center}
   911   \includegraphics[scale=0.3]{find}
   912   \end{center}
   913   \caption{An instance of the Find panel}
   914   \label{fig:find}
   915   \end{figure}
   916 
   917   The \emph{Apply} button attaches a fresh invocation of @{command
   918   find_theorems} to the current context of the command where the
   919   cursor is pointing in the text, unless an alternative theory context
   920   (from the underlying logic image) is specified explicitly. *}
   921 
   922 
   923 chapter {* Miscellaneous tools *}
   924 
   925 section {* SideKick *}
   926 
   927 text {* The \emph{SideKick} plugin of jEdit provides some general
   928   services to display buffer structure in a tree view.
   929 
   930   Isabelle/jEdit provides SideKick parsers for its main mode for
   931   theory files, as well as some minor modes for the @{verbatim NEWS}
   932   file, session @{verbatim ROOT} files, and system @{verbatim
   933   options}.
   934 
   935   Moreover, the special SideKick parser @{verbatim "isabelle-markup"}
   936   provides access to the full (uninterpreted) markup tree of the PIDE
   937   document model of the current buffer.  This is occasionally useful
   938   for informative purposes, but the amount of displayed information
   939   might cause problems for large buffers, both for the human and the
   940   machine.
   941 *}
   942 
   943 
   944 section {* Timing *}
   945 
   946 text {* Managed evaluation of commands within PIDE documents includes
   947   timing information, which consists of elapsed (wall-clock) time, CPU
   948   time, and GC (garbage collection) time.  Note that in a
   949   multithreaded system it is difficult to measure execution time
   950   precisely: elapsed time is closer to the real requirements of
   951   runtime resources than CPU or GC time, which are both subject to
   952   influences from the parallel environment that are outside the scope
   953   of the current command transaction.
   954 
   955   The \emph{Timing} panel provides an overview of cumulative command
   956   timings for each document node.  Commands with elapsed time below
   957   the given threshold are ignored in the grand total.  Nodes are
   958   sorted according to their overall timing.  For the document node
   959   that corresponds to the current buffer, individual command timings
   960   are shown as well.  A double-click on a theory node or command moves
   961   the editor focus to that particular source position.
   962 
   963   It is also possible to reveal individual timing information via some
   964   tooltip for the corresponding command keyword, using the technique
   965   of mouse hovering with @{verbatim CONTROL}/@{verbatim COMMAND}
   966   modifier key as explained in \secref{sec:tooltips-hyperlinks}.
   967   Actual display of timing depends on the global option
   968   @{system_option jedit_timing_threshold}, which can be configured in
   969   "Plugin Options / Isabelle / General".
   970 
   971   \medskip The \emph{Monitor} panel provides a general impression of
   972   recent activity of the farm of worker threads in Isabelle/ML.  Its
   973   display is continuously updated according to @{system_option
   974   editor_chart_delay}.  Note that the painting of the chart takes
   975   considerable runtime itself --- on the Java Virtual Machine that
   976   runs Isabelle/Scala, not Isabelle/ML.  Internally, the
   977   Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides
   978   further access to statistics of Isabelle/ML.  *}
   979 
   980 
   981 section {* Isabelle/Scala console *}
   982 
   983 text {* The \emph{Console} plugin of jEdit manages various shells
   984   (command interpreters), e.g.\ \emph{BeanShell}, which is the
   985   official jEdit scripting language, and the cross-platform
   986   \emph{System} shell.  Thus the console provides similar
   987   functionality than the special buffers @{verbatim "*scratch*"} and
   988   @{verbatim "*shell*"} in Emacs.
   989 
   990   Isabelle/jEdit extends the repertoire of the console by
   991   \emph{Scala}, which is the regular Scala toplevel loop running
   992   inside the \emph{same} JVM process as Isabelle/jEdit itself.  This
   993   means the Scala command interpreter has access to the JVM name space
   994   and state of the running Prover IDE application: the main entry
   995   points are @{verbatim view} (the current editor view of jEdit) and
   996   @{verbatim PIDE} (the Isabelle/jEdit plugin object).
   997 
   998   For example, the subsequent Scala snippet gets the PIDE document
   999   model of the current buffer within the current editor view:
  1000 
  1001   \begin{center}
  1002   @{verbatim "PIDE.document_model(view.getBuffer).get"}
  1003   \end{center}
  1004 
  1005   This helps to explore Isabelle/Scala functionality interactively.
  1006   Some care is required to avoid interference with the internals of
  1007   the running application, especially in production use.  *}
  1008 
  1009 
  1010 section {* Low-level output *}
  1011 
  1012 text {* Prover output is normally shown directly in the main text area
  1013   or secondary \emph{Output} panels, as explained in
  1014   \secref{sec:prover-output}.
  1015 
  1016   Beyond this, it is occasionally useful to inspect low-level output
  1017   channels via some of the following additional panels:
  1018 
  1019   \begin{itemize}
  1020 
  1021   \item \emph{Protocol} shows internal messages between the
  1022   Isabelle/Scala and Isabelle/ML side of the PIDE editing protocol.
  1023   Recording of messages starts with the first activation of the
  1024   corresponding dockable window; earlier messages are lost.
  1025 
  1026   Actual display of protocol messages causes considerable slowdown, so
  1027   it is important to undock all \emph{Protocol} panels for production
  1028   work.
  1029 
  1030   \item \emph{Raw Output} shows chunks of text from the @{verbatim
  1031   stdout} and @{verbatim stderr} channels of the prover process.
  1032   Recording of output starts with the first activation of the
  1033   corresponding dockable window; earlier output is lost.
  1034 
  1035   The implicit stateful nature of physical I/O channels makes it
  1036   difficult to relate raw output to the actual command from where it
  1037   was originating.  Parallel execution may add to the confusion.
  1038   Peeking at physical process I/O is only the last resort to diagnose
  1039   problems with tools that are not fully PIDE compliant.
  1040 
  1041   Under normal circumstances, prover output always works via managed
  1042   message channels (corresponding to @{ML writeln}, @{ML warning},
  1043   @{ML error} etc.\ in Isabelle/ML), which are displayed by regular
  1044   means within the document model (\secref{sec:prover-output}).
  1045 
  1046   \item \emph{Syslog} shows system messages that might be relevant to
  1047   diagnose problems with the startup or shutdown phase of the prover
  1048   process; this also includes raw output on @{verbatim stderr}.
  1049 
  1050   A limited amount of syslog messages are buffered, independently of
  1051   the docking state of the \emph{Syslog} panel.  This allows to
  1052   diagnose serious problems with Isabelle/PIDE process management,
  1053   outside of the actual protocol layer.
  1054 
  1055   Under normal situations, such low-level system output can be
  1056   ignored.
  1057 
  1058   \end{itemize}
  1059 *}
  1060 
  1061 
  1062 chapter {* Known problems and workarounds \label{sec:problems} *}
  1063 
  1064 text {*
  1065   \begin{itemize}
  1066 
  1067   \item \textbf{Problem:} Odd behavior of some diagnostic commands with
  1068   global side-effects, like writing a physical file.
  1069 
  1070   \textbf{Workaround:} Copy / paste complete command text from
  1071   elsewhere, or discontinue continuous checking temporarily.
  1072 
  1073   \item \textbf{Problem:} No way to delete document nodes from the overall
  1074   collection of theories.
  1075 
  1076   \textbf{Workaround:} Ignore unused files.  Restart whole
  1077   Isabelle/jEdit session in worst-case situation.
  1078 
  1079   \item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and
  1080   @{verbatim "C+MINUS"} for adjusting the editor font size depend on
  1081   platform details and national keyboards.
  1082 
  1083   \textbf{Workaround:} Rebind keys via \emph{Global Options /
  1084   Shortcuts}.
  1085 
  1086   \item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim
  1087   "COMMAND+COMMA"} for application \emph{Preferences} is in conflict
  1088   with the jEdit default shortcut for \emph{Incremental Search Bar}
  1089   (action @{verbatim "quick-search"}).
  1090 
  1091   \textbf{Workaround:} Rebind key via \emph{Global Options /
  1092   Shortcuts} according to national keyboard, e.g.\ @{verbatim
  1093   "COMMAND+SLASH"} on English ones.
  1094 
  1095   \item \textbf{Problem:} Mac OS X system fonts sometimes lead to
  1096   character drop-outs in the main text area.
  1097 
  1098   \textbf{Workaround:} Use the default @{verbatim IsabelleText} font.
  1099   (Do not install that font on the system.)
  1100 
  1101   \item \textbf{Problem:} Some Linux / X11 input methods such as IBus
  1102   tend to disrupt key event handling of Java/AWT/Swing.
  1103 
  1104   \textbf{Workaround:} Do not use input methods, reset the environment
  1105   variable @{verbatim XMODIFIERS} within Isabelle settings (default in
  1106   Isabelle2013-1).
  1107 
  1108   \item \textbf{Problem:} Some Linux / X11 window managers that are
  1109   not ``re-parenting'' cause problems with additional windows opened
  1110   by Java. This affects either historic or neo-minimalistic window
  1111   managers like @{verbatim awesome} or @{verbatim xmonad}.
  1112 
  1113   \textbf{Workaround:} Use regular re-parenting window manager.
  1114 
  1115   \item \textbf{Problem:} Recent forks of Linux / X11 window managers
  1116   and desktop environments (variants of Gnome) disrupt the handling of
  1117   menu popups and mouse positions of Java/AWT/Swing.
  1118 
  1119   \textbf{Workaround:} Use mainstream versions of Linux desktops.
  1120 
  1121   \item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim
  1122   "toggle-full-screen"} (default shortcut @{verbatim F11}) works on
  1123   Windows, but not on Mac OS X or various Linux / X11 window managers.
  1124 
  1125   \textbf{Workaround:} Use native full-screen control of the window
  1126   manager (notably on Mac OS X).
  1127 
  1128   \item \textbf{Problem:} Full-screen mode and dockable windows in
  1129   \emph{floating} state may lead to confusion about window placement
  1130   (depending on platform characteristics).
  1131 
  1132   \textbf{Workaround:} Avoid this combination.
  1133 
  1134   \end{itemize}
  1135 *}
  1136 
  1137 end