src/Doc/JEdit/JEdit.thy
author wenzelm
Tue, 20 Oct 2015 23:53:40 +0200
changeset 61493 0debd22f0c0e
parent 61483 07c8d5d8acab
child 61503 28e788ca2c5d
permissions -rw-r--r--
isabelle update_cartouches -t;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53981
1f4d6870b7b2 more on text completion;
wenzelm
parents: 53886
diff changeset
     1
(*:wrap=hard:maxLineLen=78:*)
1f4d6870b7b2 more on text completion;
wenzelm
parents: 53886
diff changeset
     2
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     3
theory JEdit
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     4
imports Base
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     5
begin
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     6
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
     7
chapter \<open>Introduction\<close>
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     8
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
     9
section \<open>Concepts and terminology\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    10
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    11
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    12
  Isabelle/jEdit is a Prover IDE that integrates \<^emph>\<open>parallel proof
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    13
  checking\<close> @{cite "Wenzel:2009" and "Wenzel:2013:ITP"} with
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    14
  \<^emph>\<open>asynchronous user interaction\<close> @{cite "Wenzel:2010" and
58556
71a63f8a5b84 more refs;
wenzelm
parents: 58554
diff changeset
    15
  "Wenzel:2012:UITP-EPTCS" and "Wenzel:2014:ITP-PIDE" and "Wenzel:2014:UITP"},
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    16
  based on a document-oriented approach to \<^emph>\<open>continuous proof processing\<close>
58556
71a63f8a5b84 more refs;
wenzelm
parents: 58554
diff changeset
    17
  @{cite "Wenzel:2011:CICM" and "Wenzel:2012"}. Many concepts and system
71a63f8a5b84 more refs;
wenzelm
parents: 58554
diff changeset
    18
  components are fit together in order to make this work. The main building
71a63f8a5b84 more refs;
wenzelm
parents: 58554
diff changeset
    19
  blocks are as follows.
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
    20
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
    21
  \<^descr>[PIDE] is a general framework for Prover IDEs based on Isabelle/Scala.
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
    22
  It is built around a concept of parallel and asynchronous document
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
    23
  processing, which is supported natively by the parallel proof engine that is
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
    24
  implemented in Isabelle/ML. The traditional prover command loop is given up;
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
    25
  instead there is direct support for editing of source text, with rich formal
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
    26
  markup for GUI rendering.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    27
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
    28
  \<^descr>[Isabelle/ML] is the implementation and extension language of
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
    29
  Isabelle, see also @{cite "isabelle-implementation"}. It is integrated
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    30
  into the logical context of Isabelle/Isar and allows to manipulate
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    31
  logical entities directly. Arbitrary add-on tools may be implemented
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    32
  for object-logics such as Isabelle/HOL.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    33
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
    34
  \<^descr>[Isabelle/Scala] is the system programming language of
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    35
  Isabelle. It extends the pure logical environment of Isabelle/ML
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    36
  towards the ``real world'' of graphical user interfaces, text
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    37
  editors, IDE frameworks, web services etc.  Special infrastructure
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
    38
  allows to transfer algebraic datatypes and formatted text easily
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
    39
  between ML and Scala, using asynchronous protocol commands.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    40
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
    41
  \<^descr>[jEdit] is a sophisticated text editor implemented in
54703
499f92dc6e45 more antiquotations;
wenzelm
parents: 54671
diff changeset
    42
  Java.\footnote{@{url "http://www.jedit.org"}} It is easily extensible
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    43
  by plugins written in languages that work on the JVM, e.g.\
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    44
  Scala\footnote{@{url "http://www.scala-lang.org"}}.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    45
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
    46
  \<^descr>[Isabelle/jEdit] is the main example application of the PIDE
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    47
  framework and the default user-interface for Isabelle. It targets
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
    48
  both beginners and experts. Technically, Isabelle/jEdit combines a
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
    49
  slightly modified version of the jEdit code base with a special
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
    50
  plugin for Isabelle, integrated as standalone application for the
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
    51
  main operating system platforms: Linux, Windows, Mac OS X.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    52
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    53
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    54
  The subtle differences of Isabelle/ML versus Standard ML,
54330
wenzelm
parents: 54329
diff changeset
    55
  Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be
wenzelm
parents: 54329
diff changeset
    56
  taken into account when discussing any of these PIDE building blocks
wenzelm
parents: 54329
diff changeset
    57
  in public forums, mailing lists, or even scientific publications.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    58
\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    59
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    60
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    61
section \<open>The Isabelle/jEdit Prover IDE\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    62
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    63
text \<open>
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
    64
  \begin{figure}[htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    65
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
    66
  \includegraphics[scale=0.333]{isabelle-jedit}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    67
  \end{center}
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    68
  \caption{The Isabelle/jEdit Prover IDE}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
    69
  \label{fig:isabelle-jedit}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    70
  \end{figure}
53773
36703fcea740 added canonical screenshot;
wenzelm
parents: 53771
diff changeset
    71
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    72
  Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    73
  the jEdit text editor, while preserving its general look-and-feel as far as
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    74
  possible. The main plugin is called ``Isabelle'' and has its own menu
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    75
  \<^emph>\<open>Plugins~/ Isabelle\<close> with access to several panels (see also
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    76
  \secref{sec:dockables}), as well as \<^emph>\<open>Plugins~/ Plugin Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    77
  Isabelle\<close> (see also \secref{sec:options}).
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    78
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    79
  The options allow to specify a logic session name --- the same selector is
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    80
  accessible in the \<^emph>\<open>Theories\<close> panel (\secref{sec:theories}). On
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    81
  application startup, the selected logic session image is provided
60270
wenzelm
parents: 60264
diff changeset
    82
  automatically by the Isabelle build tool @{cite "isabelle-system"}: if it is
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    83
  absent or outdated wrt.\ its sources, the build process updates it before
60257
wenzelm
parents: 60256
diff changeset
    84
  entering the Prover IDE.  Change of the logic session within Isabelle/jEdit
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
    85
  requires a restart of the whole application.
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
    86
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
    87
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
    88
  The main job of the Prover IDE is to manage sources and their
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    89
  changes, taking the logical structure as a formal document into account (see
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    90
  also \secref{sec:document-model}). The editor and the prover are connected
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    91
  asynchronously in a lock-free manner. The prover is free to organize the
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    92
  checking of the formal text in parallel on multiple cores, and provides
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    93
  feedback via markup, which is rendered in the editor via colors, boxes,
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
    94
  squiggly underlines, hyperlinks, popup windows, icons, clickable output etc.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    95
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    96
  Using the mouse together with the modifier key @{verbatim CONTROL} (Linux,
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    97
  Windows) or @{verbatim COMMAND} (Mac OS X) exposes additional formal content
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    98
  via tooltips and/or hyperlinks (see also \secref{sec:tooltips-hyperlinks}).
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
    99
  Output (in popups etc.) may be explored recursively, using the same
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
   100
  techniques as in the editor source buffer.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
   101
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
   102
  Thus the Prover IDE gives an impression of direct access to formal content
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
   103
  of the prover within the editor, but in reality only certain aspects are
60257
wenzelm
parents: 60256
diff changeset
   104
  exposed, according to the possibilities of the prover and its many add-on
wenzelm
parents: 60256
diff changeset
   105
  tools.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   106
\<close>
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
   107
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
   108
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   109
subsection \<open>Documentation\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   110
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   111
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   112
  The \<^emph>\<open>Documentation\<close> panel of Isabelle/jEdit provides access to the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   113
  standard Isabelle documentation: PDF files are opened by regular desktop
57338
wenzelm
parents: 57337
diff changeset
   114
  operations of the underlying platform. The section ``Original jEdit
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   115
  Documentation'' contains the original \<^emph>\<open>User's Guide\<close> of this
57338
wenzelm
parents: 57337
diff changeset
   116
  sophisticated text editor. The same is accessible via the @{verbatim Help}
wenzelm
parents: 57337
diff changeset
   117
  menu or @{verbatim F1} keyboard shortcut, using the built-in HTML viewer of
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   118
  Java/Swing. The latter also includes \<^emph>\<open>Frequently Asked Questions\<close> and
57338
wenzelm
parents: 57337
diff changeset
   119
  documentation of individual plugins.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   120
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   121
  Most of the information about generic jEdit is relevant for Isabelle/jEdit
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   122
  as well, but one needs to keep in mind that defaults sometimes differ, and
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   123
  the official jEdit documentation does not know about the Isabelle plugin
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   124
  with its support for continuous checking of formal source text: jEdit is a
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   125
  plain text editor, but Isabelle/jEdit is a Prover IDE.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   126
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   127
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   128
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   129
subsection \<open>Plugins\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   130
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   131
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   132
  The \<^emph>\<open>Plugin Manager\<close> of jEdit allows to augment editor functionality by
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   133
  JVM modules (jars) that are provided by the central plugin repository, which
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   134
  is accessible via various mirror sites.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   135
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   136
  Connecting to the plugin server-infrastructure of the jEdit project allows
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   137
  to update bundled plugins or to add further functionality. This needs to be
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   138
  done with the usual care for such an open bazaar of contributions. Arbitrary
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   139
  combinations of add-on features are apt to cause problems. It is advisable
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   140
  to start with the default configuration of Isabelle/jEdit and develop some
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   141
  understanding how it is supposed to work, before loading additional plugins
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   142
  at a grand scale.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   143
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   144
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   145
  The main \<^emph>\<open>Isabelle\<close> plugin is an integral part of
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   146
  Isabelle/jEdit and needs to remain active at all times! A few additional
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   147
  plugins are bundled with Isabelle/jEdit for convenience or out of necessity,
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   148
  notably \<^emph>\<open>Console\<close> with its Isabelle/Scala sub-plugin
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   149
  (\secref{sec:scala-console}) and \<^emph>\<open>SideKick\<close> with some Isabelle-specific
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   150
  parsers for document tree structure (\secref{sec:sidekick}). The
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   151
  \<^emph>\<open>Navigator\<close> plugin is particularly important for hyperlinks within the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   152
  formal document-model (\secref{sec:tooltips-hyperlinks}). Further plugins
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   153
  (e.g.\ \<^emph>\<open>ErrorList\<close>, \<^emph>\<open>Code2HTML\<close>) are included to saturate the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   154
  dependencies of bundled plugins, but have no particular use in
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   155
  Isabelle/jEdit.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   156
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   157
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   158
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   159
subsection \<open>Options \label{sec:options}\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   160
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   161
text \<open>Both jEdit and Isabelle have distinctive management of
54348
wenzelm
parents: 54331
diff changeset
   162
  persistent options.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   163
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   164
  Regular jEdit options are accessible via the dialogs \<^emph>\<open>Utilities~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   165
  Global Options\<close> or \<^emph>\<open>Plugins~/ Plugin Options\<close>, with a second chance to
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   166
  flip the two within the central options dialog. Changes are stored in
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   167
  @{file_unchecked "$ISABELLE_HOME_USER/jedit/properties"} and
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   168
  @{file_unchecked "$ISABELLE_HOME_USER/jedit/keymaps"}.
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   169
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   170
  Isabelle system options are managed by Isabelle/Scala and changes are stored
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   171
  in @{file_unchecked "$ISABELLE_HOME_USER/etc/preferences"}, independently of
60270
wenzelm
parents: 60264
diff changeset
   172
  other jEdit properties. See also @{cite "isabelle-system"}, especially the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   173
  coverage of sessions and command-line tools like @{tool build} or @{tool
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   174
  options}.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   175
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   176
  Those Isabelle options that are declared as \<^bold>\<open>public\<close> are configurable
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   177
  in Isabelle/jEdit via \<^emph>\<open>Plugin Options~/ Isabelle~/ General\<close>. Moreover,
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   178
  there are various options for rendering of document content, which are
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   179
  configurable via \<^emph>\<open>Plugin Options~/ Isabelle~/ Rendering\<close>. Thus
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   180
  \<^emph>\<open>Plugin Options~/ Isabelle\<close> in jEdit provides a view on a subset of
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   181
  Isabelle system options. Note that some of these options affect general
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   182
  parameters that are relevant outside Isabelle/jEdit as well, e.g.\
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   183
  @{system_option threads} or @{system_option parallel_proofs} for the
60270
wenzelm
parents: 60264
diff changeset
   184
  Isabelle build tool @{cite "isabelle-system"}, but it is possible to use the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   185
  settings variable @{setting ISABELLE_BUILD_OPTIONS} to change defaults for
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   186
  batch builds without affecting Isabelle/jEdit.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
   187
57627
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   188
  The jEdit action @{action_def isabelle.options} opens the options dialog for
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   189
  the Isabelle plugin; it can be mapped to editor GUI elements as usual.
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   190
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   191
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   192
  Options are usually loaded on startup and saved on shutdown of
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   193
  Isabelle/jEdit. Editing the machine-generated @{file_unchecked
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   194
  "$ISABELLE_HOME_USER/jedit/properties"} or @{file_unchecked
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   195
  "$ISABELLE_HOME_USER/etc/preferences"} manually while the application is
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   196
  running is likely to cause surprise due to lost update!\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   197
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   198
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   199
subsection \<open>Keymaps\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   200
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   201
text \<open>Keyboard shortcuts used to be managed as jEdit properties in
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   202
  the past, but recent versions (2013) have a separate concept of
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   203
  \<^emph>\<open>keymap\<close> that is configurable via \<^emph>\<open>Global Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   204
  Shortcuts\<close>.  The @{verbatim imported} keymap is derived from the
54330
wenzelm
parents: 54329
diff changeset
   205
  initial environment of properties that is available at the first
54348
wenzelm
parents: 54331
diff changeset
   206
  start of the editor; afterwards the keymap file takes precedence.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   207
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   208
  This is relevant for Isabelle/jEdit due to various fine-tuning of default
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   209
  properties, and additional keyboard shortcuts for Isabelle-specific
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   210
  functionality. Users may change their keymap later, but need to copy some
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
   211
  keyboard shortcuts manually (see also @{file_unchecked
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   212
  "$ISABELLE_HOME_USER/jedit/keymaps"} versus @{verbatim shortcut} properties
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   213
  in @{file "$ISABELLE_HOME/src/Tools/jEdit/src/jEdit.props"}).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   214
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   215
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   216
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   217
section \<open>Command-line invocation \label{sec:command-line}\<close>
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   218
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   219
text \<open>
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   220
  Isabelle/jEdit is normally invoked as standalone application, with
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   221
  platform-specific executable wrappers for Linux, Windows, Mac OS X.
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   222
  Nonetheless it is occasionally useful to invoke the Prover IDE on the
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   223
  command-line, with some extra options and environment settings as explained
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   224
  below. The command-line usage of @{tool_def jedit} is as follows:
61408
9020a3ba6c9a @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61199
diff changeset
   225
  @{verbatim [display]
9020a3ba6c9a @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61199
diff changeset
   226
\<open>Usage: isabelle jedit [OPTIONS] [FILES ...]
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   227
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   228
  Options are:
61132
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   229
    -J OPTION    add JVM runtime option
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   230
    -b           build only
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   231
    -d DIR       include session directory
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   232
    -f           fresh build
61132
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   233
    -j OPTION    add jEdit runtime option
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   234
    -l NAME      logic image name
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   235
    -m MODE      add print mode for output
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   236
    -n           no build of session image on startup
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   237
    -s           system build mode for session image
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   238
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   239
  Start jEdit with Isabelle plugin setup and open theory FILES
61408
9020a3ba6c9a @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61199
diff changeset
   240
  (default "$USER_HOME/Scratch.thy").\<close>}
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   241
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   242
  The @{verbatim "-l"} option specifies the session name of the logic
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   243
  image to be used for proof processing.  Additional session root
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   244
  directories may be included via option @{verbatim "-d"} to augment
60270
wenzelm
parents: 60264
diff changeset
   245
  that name space of @{tool build} @{cite "isabelle-system"}.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   246
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   247
  By default, the specified image is checked and built on demand. The
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   248
  @{verbatim "-s"} option determines where to store the result session image
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   249
  of @{tool build}. The @{verbatim "-n"} option bypasses the implicit build
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   250
  process for the selected session image.
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   251
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   252
  The @{verbatim "-m"} option specifies additional print modes for the prover
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   253
  process. Note that the system option @{system_option_ref jedit_print_mode}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   254
  allows to do the same persistently (e.g.\ via the \<^emph>\<open>Plugin Options\<close>
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   255
  dialog of Isabelle/jEdit), without requiring command-line invocation.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   256
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   257
  The @{verbatim "-J"} and @{verbatim "-j"} options allow to pass additional
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   258
  low-level options to the JVM or jEdit, respectively. The defaults are
60270
wenzelm
parents: 60264
diff changeset
   259
  provided by the Isabelle settings environment @{cite "isabelle-system"}, but
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   260
  note that these only work for the command-line tool described here, and not
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   261
  the regular application.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   262
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   263
  The @{verbatim "-b"} and @{verbatim "-f"} options control the self-build
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   264
  mechanism of Isabelle/jEdit. This is only relevant for building from
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   265
  sources, which also requires an auxiliary @{verbatim jedit_build} component
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   266
  from @{url "http://isabelle.in.tum.de/components"}. The official
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   267
  Isabelle release already includes a pre-built version of Isabelle/jEdit.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   268
\<close>
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   269
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   270
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   271
chapter \<open>Augmented jEdit functionality\<close>
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   272
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   273
section \<open>GUI rendering\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   274
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   275
subsection \<open>Look-and-feel \label{sec:look-and-feel}\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   276
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   277
text \<open>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   278
  jEdit is a Java/AWT/Swing application with some ambition to support
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   279
  ``native'' look-and-feel on all platforms, within the limits of what Oracle
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   280
  as Java provider and major operating system distributors allow (see also
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   281
  \secref{sec:problems}).
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   282
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
   283
  Isabelle/jEdit enables platform-specific look-and-feel by default as
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   284
  follows.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   285
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   286
  \<^descr>[Linux:] The platform-independent \<^emph>\<open>Nimbus\<close> is used by
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   287
  default.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   288
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   289
  \<^emph>\<open>GTK+\<close> also works under the side-condition that the overall GTK theme
60256
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   290
  is selected in a Swing-friendly way.\footnote{GTK support in Java/Swing was
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   291
  once marketed aggressively by Sun, but never quite finished. Today (2015) it
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   292
  is lagging behind further development of Swing and GTK. The graphics
60256
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   293
  rendering performance can be worse than for other Swing look-and-feels.
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   294
  Nonetheless it has its uses for displays with very high resolution (such as
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   295
  ``4K'' or ``UHD'' models), because the rendering by the external library is
2925c5552e25 more on GTK;
wenzelm
parents: 60255
diff changeset
   296
  subject to global system settings for font scaling.}
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   297
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   298
  \<^descr>[Windows:] Regular \<^emph>\<open>Windows\<close> is used by default, but
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   299
  \<^emph>\<open>Windows Classic\<close> also works.
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   300
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   301
  \<^descr>[Mac OS X:] Regular \<^emph>\<open>Mac OS X\<close> is used by default.
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   302
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   303
  The bundled \<^emph>\<open>MacOSX\<close> plugin provides various functions that are
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   304
  expected from applications on that particular platform: quit from menu or
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   305
  dock, preferences menu, drag-and-drop of text files on the application,
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   306
  full-screen mode for main editor windows. It is advisable to have the
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   307
  \<^emph>\<open>MacOSX\<close> plugin enabled all the time on that platform.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   308
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   309
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   310
  Users may experiment with different look-and-feels, but need to keep
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
   311
  in mind that this extra variance of GUI functionality is unlikely to
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   312
  work in arbitrary combinations.  The platform-independent
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   313
  \<^emph>\<open>Nimbus\<close> and \<^emph>\<open>Metal\<close> should always work.  The historic
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   314
  \<^emph>\<open>CDE/Motif\<close> should be ignored.
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   315
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   316
  After changing the look-and-feel in \<^emph>\<open>Global Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   317
  Appearance\<close>, it is advisable to restart Isabelle/jEdit in order to
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   318
  take full effect.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   319
\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   320
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   321
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   322
subsection \<open>Displays with very high resolution \label{sec:hdpi}\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   323
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   324
text \<open>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   325
  Many years ago, displays with $1024 \times 768$ or $1280 \times 1024$ pixels
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   326
  were considered ``high resolution'' and bitmap fonts with 12 or 14 pixels as
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   327
  adequate for text rendering. Today (2015), we routinely see ``Full HD''
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   328
  monitors at $1920 \times 1080$ pixels, and occasionally ``Ultra HD'' at
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   329
  $3840 \times 2160$ or more, but GUI rendering did not really progress
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   330
  beyond the old standards.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   331
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   332
  Isabelle/jEdit defaults are a compromise for reasonable out-of-the box
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   333
  results on common platforms and medium resolution displays (e.g.\ the ``Full
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   334
  HD'' category). Subsequently there are further hints to improve on that.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   335
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   336
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   337
  The \<^bold>\<open>operating-system platform\<close> usually provides some
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   338
  configuration for global scaling of text fonts, e.g.\ $120\%$--$250\%$ on
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   339
  Windows. Changing that only has a partial effect on GUI rendering;
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   340
  satisfactory display quality requires further adjustments.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   341
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   342
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   343
  The Isabelle/jEdit \<^bold>\<open>application\<close> and its plugins provide
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   344
  various font properties that are summarized below.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   345
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   346
  \<^item> \<^emph>\<open>Global Options / Text Area / Text font\<close>: the main text area
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   347
  font, which is also used as reference point for various derived font sizes,
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   348
  e.g.\ the Output panel (\secref{sec:output}).
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   349
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   350
  \<^item> \<^emph>\<open>Global Options / Gutter / Gutter font\<close>: the font for the gutter
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   351
  area left of the main text area, e.g.\ relevant for display of line numbers
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   352
  (disabled by default).
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   353
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   354
  \<^item> \<^emph>\<open>Global Options / Appearance / Button, menu and label font\<close> as
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   355
  well as \<^emph>\<open>List and text field font\<close>: this specifies the primary and
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   356
  secondary font for the old \<^emph>\<open>Metal\<close> look-and-feel
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   357
  (\secref{sec:look-and-feel}), which happens to scale better than newer ones
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   358
  like \<^emph>\<open>Nimbus\<close>.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   359
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   360
  \<^item> \<^emph>\<open>Plugin Options / Isabelle / General / Reset Font Size\<close>: the main
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   361
  text area font size for action @{action_ref "isabelle.reset-font-size"},
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   362
  e.g.\ relevant for quick scaling like in major web browsers.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   363
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   364
  \<^item> \<^emph>\<open>Plugin Options / Console / General / Font\<close>: the console window
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   365
  font, e.g.\ relevant for Isabelle/Scala command-line.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   366
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   367
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   368
  In \figref{fig:isabelle-jedit-hdpi} the \<^emph>\<open>Metal\<close> look-and-feel is
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   369
  configured with custom fonts at 30 pixels, and the main text area and
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   370
  console at 36 pixels. Despite the old-fashioned appearance of \<^emph>\<open>Metal\<close>,
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   371
  this leads to decent rendering quality on all platforms.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   372
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   373
  \begin{figure}[htb]
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   374
  \begin{center}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   375
  \includegraphics[width=\textwidth]{isabelle-jedit-hdpi}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   376
  \end{center}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   377
  \caption{Metal look-and-feel with custom fonts for very high resolution}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   378
  \label{fig:isabelle-jedit-hdpi}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   379
  \end{figure}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   380
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   381
  On Linux, it is also possible to use \<^emph>\<open>GTK+\<close> with a suitable theme and
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   382
  global font scaling. On Mac OS X, the default setup for ``Retina'' displays
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   383
  should work adequately with the native look-and-feel.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   384
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   385
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   386
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   387
section \<open>Dockable windows \label{sec:dockables}\<close>
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   388
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   389
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   390
  In jEdit terminology, a \<^emph>\<open>view\<close> is an editor window with one or more
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   391
  \<^emph>\<open>text areas\<close> that show the content of one or more \<^emph>\<open>buffers\<close>. A
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   392
  regular view may be surrounded by \<^emph>\<open>dockable windows\<close> that show
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   393
  additional information in arbitrary format, not just text; a \<^emph>\<open>plain
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   394
  view\<close> does not allow dockables. The \<^emph>\<open>dockable window manager\<close> of jEdit
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   395
  organizes these dockable windows, either as \<^emph>\<open>floating\<close> windows, or
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   396
  \<^emph>\<open>docked\<close> panels within one of the four margins of the view. There may
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   397
  be any number of floating instances of some dockable window, but at most one
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   398
  docked instance; jEdit actions that address \<^emph>\<open>the\<close> dockable window of a
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   399
  particular kind refer to the unique docked instance.
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   400
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   401
  Dockables are used routinely in jEdit for important functionality like
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   402
  \<^emph>\<open>HyperSearch Results\<close> or the \<^emph>\<open>File System Browser\<close>. Plugins often
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   403
  provide a central dockable to access their key functionality, which may be
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   404
  opened by the user on demand. The Isabelle/jEdit plugin takes this approach
60257
wenzelm
parents: 60256
diff changeset
   405
  to the extreme: its plugin menu provides the entry-points to many panels
wenzelm
parents: 60256
diff changeset
   406
  that are managed as dockable windows. Some important panels are docked by
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   407
  default, e.g.\ \<^emph>\<open>Documentation\<close>, \<^emph>\<open>Output\<close>, \<^emph>\<open>Query\<close>, but the
60257
wenzelm
parents: 60256
diff changeset
   408
  user can change this arrangement easily and persistently.
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   409
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   410
  Compared to plain jEdit, dockable window management in Isabelle/jEdit is
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   411
  slightly augmented according to the the following principles:
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   412
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   413
  \<^item> Floating windows are dependent on the main window as \<^emph>\<open>dialog\<close> in
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   414
  the sense of Java/AWT/Swing. Dialog windows always stay on top of the view,
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   415
  which is particularly important in full-screen mode. The desktop environment
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   416
  of the underlying platform may impose further policies on such dependent
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   417
  dialogs, in contrast to fully independent windows, e.g.\ some window
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   418
  management functions may be missing.
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   419
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   420
  \<^item> Keyboard focus of the main view vs.\ a dockable window is carefully
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   421
  managed according to the intended semantics, as a panel mainly for output or
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   422
  input. For example, activating the \<^emph>\<open>Output\<close> (\secref{sec:output}) panel
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   423
  via the dockable window manager returns keyboard focus to the main text
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   424
  area, but for \<^emph>\<open>Query\<close> (\secref{sec:query}) the focus is given to the
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   425
  main input field of that panel.
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   426
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   427
  \<^item> Panels that provide their own text area for output have an additional
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   428
  dockable menu item \<^emph>\<open>Detach\<close>. This produces an independent copy of the
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   429
  current output as a floating \<^emph>\<open>Info\<close> window, which displays that content
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   430
  independently of ongoing changes of the PIDE document-model. Note that
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   431
  Isabelle/jEdit popup windows (\secref{sec:tooltips-hyperlinks}) provide a
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   432
  similar \<^emph>\<open>Detach\<close> operation as an icon.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   433
\<close>
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   434
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   435
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   436
section \<open>Isabelle symbols \label{sec:symbols}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   437
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   438
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   439
  Isabelle sources consist of \<^emph>\<open>symbols\<close> that extend plain ASCII to allow
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   440
  infinitely many mathematical symbols within the formal sources. This works
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   441
  without depending on particular encodings and varying Unicode
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   442
  standards.\footnote{Raw Unicode characters within formal sources would
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   443
  compromise portability and reliability in the face of changing
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   444
  interpretation of special features of Unicode, such as Combining Characters
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   445
  or Bi-directional Text.} See also @{cite "Wenzel:2011:CICM"}.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   446
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   447
  For the prover back-end, formal text consists of ASCII characters that are
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   448
  grouped according to some simple rules, e.g.\ as plain ``@{verbatim a}'' or
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   449
  symbolic ``@{verbatim "\<alpha>"}''. For the editor front-end, a certain subset of
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   450
  symbols is rendered physically via Unicode glyphs, in order to show
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   451
  ``@{verbatim "\<alpha>"}'' as ``\<open>\<alpha>\<close>'', for example. This symbol
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   452
  interpretation is specified by the Isabelle system distribution in @{file
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   453
  "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   454
  @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   455
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   456
  The appendix of @{cite "isabelle-isar-ref"} gives an overview of the
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   457
  standard interpretation of finitely many symbols from the infinite
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   458
  collection. Uninterpreted symbols are displayed literally, e.g.\
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   459
  ``@{verbatim "\<foobar>"}''. Overlap of Unicode characters used in symbol
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   460
  interpretation with informal ones (which might appear e.g.\ in comments)
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   461
  needs to be avoided. Raw Unicode characters within prover source files
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   462
  should be restricted to informal parts, e.g.\ to write text in non-latin
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   463
  alphabets in comments.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   464
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   465
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   466
  \paragraph{Encoding.} Technically, the Unicode view on Isabelle
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   467
  symbols is an \<^emph>\<open>encoding\<close> called @{verbatim "UTF-8-Isabelle"} in jEdit
60257
wenzelm
parents: 60256
diff changeset
   468
  (not in the underlying JVM). It is provided by the Isabelle/jEdit plugin and
wenzelm
parents: 60256
diff changeset
   469
  enabled by default for all source files. Sometimes such defaults are reset
wenzelm
parents: 60256
diff changeset
   470
  accidentally, or malformed UTF-8 sequences in the text force jEdit to fall
wenzelm
parents: 60256
diff changeset
   471
  back on a different encoding like @{verbatim "ISO-8859-15"}. In that case,
wenzelm
parents: 60256
diff changeset
   472
  verbatim ``@{verbatim "\<alpha>"}'' will be shown in the text buffer instead of its
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   473
  Unicode rendering ``\<open>\<alpha>\<close>''. The jEdit menu operation \<^emph>\<open>File~/
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   474
  Reload with Encoding~/ UTF-8-Isabelle\<close> helps to resolve such problems (after
60257
wenzelm
parents: 60256
diff changeset
   475
  repairing malformed parts of the text).
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   476
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   477
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   478
  \paragraph{Font.} Correct rendering via Unicode requires a
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   479
  font that contains glyphs for the corresponding codepoints.  Most
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   480
  system fonts lack that, so Isabelle/jEdit prefers its own
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   481
  application font @{verbatim IsabelleText}, which ensures that
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   482
  standard collection of Isabelle symbols are actually seen on the
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   483
  screen (or printer).
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   484
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   485
  Note that a Java/AWT/Swing application can load additional fonts only if
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   486
  they are not installed on the operating system already! Some outdated
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   487
  version of @{verbatim IsabelleText} that happens to be provided by the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   488
  operating system would prevent Isabelle/jEdit to use its bundled version.
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   489
  This could lead to missing glyphs (black rectangles), when the system
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   490
  version of @{verbatim IsabelleText} is older than the application version.
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   491
  This problem can be avoided by refraining to ``install'' any version of
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   492
  @{verbatim IsabelleText} in the first place, although it is occasionally
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   493
  tempting to use the same font in other applications.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   494
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   495
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   496
  \paragraph{Input methods.} In principle, Isabelle/jEdit
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   497
  could delegate the problem to produce Isabelle symbols in their
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   498
  Unicode rendering to the underlying operating system and its
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   499
  \<^emph>\<open>input methods\<close>.  Regular jEdit also provides various ways to
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   500
  work with \<^emph>\<open>abbreviations\<close> to produce certain non-ASCII
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   501
  characters.  Since none of these standard input methods work
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   502
  satisfactorily for the mathematical characters required for
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   503
  Isabelle, various specific Isabelle/jEdit mechanisms are provided.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   504
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   505
  This is a summary for practically relevant input methods for Isabelle
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   506
  symbols.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   507
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   508
  \<^enum> The \<^emph>\<open>Symbols\<close> panel: some GUI buttons allow to insert
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   509
  certain symbols in the text buffer.  There are also tooltips to
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   510
  reveal the official Isabelle representation with some additional
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   511
  information about \<^emph>\<open>symbol abbreviations\<close> (see below).
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   512
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   513
  \<^enum> Copy/paste from decoded source files: text that is rendered
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   514
  as Unicode already can be re-used to produce further text.  This
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   515
  also works between different applications, e.g.\ Isabelle/jEdit and
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   516
  some web browser or mail client, as long as the same Unicode view on
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   517
  Isabelle symbols is used.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   518
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   519
  \<^enum> Copy/paste from prover output within Isabelle/jEdit. The same
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   520
  principles as for text buffers apply, but note that \<^emph>\<open>copy\<close> in secondary
60257
wenzelm
parents: 60256
diff changeset
   521
  Isabelle/jEdit windows works via the keyboard shortcuts @{verbatim "C+c"} or
wenzelm
parents: 60256
diff changeset
   522
  @{verbatim "C+INSERT"}, while jEdit menu actions always refer to the primary
wenzelm
parents: 60256
diff changeset
   523
  text area!
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   524
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   525
  \<^enum> Completion provided by Isabelle plugin (see
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   526
  \secref{sec:completion}).  Isabelle symbols have a canonical name
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   527
  and optional abbreviations.  This can be used with the text
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   528
  completion mechanism of Isabelle/jEdit, to replace a prefix of the
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
   529
  actual symbol like @{verbatim "\<lambda>"}, or its name preceded by backslash
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   530
  @{verbatim "\\"}@{verbatim "lambda"}, or its ASCII abbreviation
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   531
  @{verbatim "%"} by the Unicode rendering.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   532
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   533
  The following table is an extract of the information provided by the
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   534
  standard @{file "$ISABELLE_HOME/etc/symbols"} file:
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   535
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   536
  \<^medskip>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   537
  \begin{tabular}{lll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   538
    \<^bold>\<open>symbol\<close> & \<^bold>\<open>name with backslash\<close> & \<^bold>\<open>abbreviation\<close> \\\hline
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   539
    \<open>\<lambda>\<close> & @{verbatim "\\lambda"} & @{verbatim "%"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   540
    \<open>\<Rightarrow>\<close> & @{verbatim "\\Rightarrow"} & @{verbatim "=>"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   541
    \<open>\<Longrightarrow>\<close> & @{verbatim "\\Longrightarrow"} & @{verbatim "==>"} \\[0.5ex]
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   542
    \<open>\<And>\<close> & @{verbatim "\\And"} & @{verbatim "!!"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   543
    \<open>\<equiv>\<close> & @{verbatim "\\equiv"} & @{verbatim "=="} \\[0.5ex]
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   544
    \<open>\<forall>\<close> & @{verbatim "\\forall"} & @{verbatim "!"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   545
    \<open>\<exists>\<close> & @{verbatim "\\exists"} & @{verbatim "?"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   546
    \<open>\<longrightarrow>\<close> & @{verbatim "\\longrightarrow"} & @{verbatim "-->"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   547
    \<open>\<and>\<close> & @{verbatim "\\and"} & @{verbatim "&"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   548
    \<open>\<or>\<close> & @{verbatim "\\or"} & @{verbatim "|"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   549
    \<open>\<not>\<close> & @{verbatim "\\not"} & @{verbatim "~"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   550
    \<open>\<noteq>\<close> & @{verbatim "\\noteq"} & @{verbatim "~="} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   551
    \<open>\<in>\<close> & @{verbatim "\\in"} & @{verbatim ":"} \\
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
   552
    \<open>\<notin>\<close> & @{verbatim "\\notin"} & @{verbatim "~:"} \\
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   553
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   554
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   555
 
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   556
  Note that the above abbreviations refer to the input method. The logical
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   557
  notation provides ASCII alternatives that often coincide, but sometimes
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   558
  deviate. This occasionally causes user confusion with very old-fashioned
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   559
  Isabelle source that use ASCII replacement notation like @{verbatim "!"} or
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   560
  @{verbatim "ALL"} directly in the text.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   561
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   562
  On the other hand, coincidence of symbol abbreviations with ASCII
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   563
  replacement syntax syntax helps to update old theory sources via
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   564
  explicit completion (see also @{verbatim "C+b"} explained in
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   565
  \secref{sec:completion}).
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   566
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   567
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   568
  \paragraph{Control symbols.} There are some special control symbols
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   569
  to modify the display style of a single symbol (without
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   570
  nesting). Control symbols may be applied to a region of selected
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   571
  text, either using the \<^emph>\<open>Symbols\<close> panel or keyboard shortcuts or
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   572
  jEdit actions.  These editor operations produce a separate control
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   573
  symbol for each symbol in the text, in order to make the whole text
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   574
  appear in a certain style.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   575
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   576
  \<^medskip>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   577
  \begin{tabular}{llll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   578
    \<^bold>\<open>style\<close> & \<^bold>\<open>symbol\<close> & \<^bold>\<open>shortcut\<close> & \<^bold>\<open>action\<close> \\\hline
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   579
    superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{action_ref "isabelle.control-sup"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   580
    subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{action_ref "isabelle.control-sub"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   581
    bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{action_ref "isabelle.control-bold"} \\
61483
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   582
    emphasized & @{verbatim "\<^emph>"} & @{verbatim "C+e LEF"} & @{action_ref "isabelle.control-emph"} \\
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   583
    reset & & @{verbatim "C+e BACK_SPACE"} & @{action_ref "isabelle.control-reset"} \\
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   584
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   585
  \<^medskip>
61483
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   586
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   587
  To produce a single control symbol, it is also possible to complete on
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   588
  @{verbatim "\\"}@{verbatim sup}, @{verbatim "\\"}@{verbatim sub}, @{verbatim
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   589
  "\\"}@{verbatim bold}, @{verbatim "\\"}@{verbatim emph} as for regular
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   590
  symbols.
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   591
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   592
  The emphasized style only takes effect in document output, not in the
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   593
  editor.
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   594
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   595
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   596
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   597
section \<open>SideKick parsers \label{sec:sidekick}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   598
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   599
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   600
  The \<^emph>\<open>SideKick\<close> plugin provides some general services to display buffer
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   601
  structure in a tree view.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   602
57336
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   603
  Isabelle/jEdit provides SideKick parsers for its main mode for theory files,
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   604
  as well as some minor modes for the @{verbatim NEWS} file (see
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   605
  \figref{fig:sidekick}), session @{verbatim ROOT} files, and system
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   606
  @{verbatim options}.
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   607
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   608
  \begin{figure}[htb]
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   609
  \begin{center}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   610
  \includegraphics[scale=0.333]{sidekick}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   611
  \end{center}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   612
  \caption{The Isabelle NEWS file with SideKick tree view}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   613
  \label{fig:sidekick}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   614
  \end{figure}
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   615
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   616
  Moreover, the special SideKick parser @{verbatim "isabelle-markup"}
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   617
  provides access to the full (uninterpreted) markup tree of the PIDE
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   618
  document model of the current buffer.  This is occasionally useful
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   619
  for informative purposes, but the amount of displayed information
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   620
  might cause problems for large buffers, both for the human and the
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   621
  machine.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   622
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   623
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   624
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   625
section \<open>Scala console \label{sec:scala-console}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   626
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   627
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   628
  The \<^emph>\<open>Console\<close> plugin manages various shells (command interpreters),
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   629
  e.g.\ \<^emph>\<open>BeanShell\<close>, which is the official jEdit scripting language, and
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   630
  the cross-platform \<^emph>\<open>System\<close> shell. Thus the console provides similar
57603
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   631
  functionality than the Emacs buffers @{verbatim "*scratch*"} and
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   632
  @{verbatim "*shell*"}.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   633
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   634
  Isabelle/jEdit extends the repertoire of the console by \<^emph>\<open>Scala\<close>, which
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   635
  is the regular Scala toplevel loop running inside the same JVM process as
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   636
  Isabelle/jEdit itself. This means the Scala command interpreter has access
57603
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   637
  to the JVM name space and state of the running Prover IDE application. The
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   638
  default environment imports the full content of packages @{verbatim
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   639
  "isabelle"} and @{verbatim "isabelle.jedit"}.
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   640
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   641
  For example, @{verbatim PIDE} refers to the Isabelle/jEdit plugin object,
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   642
  and @{verbatim view} to the current editor view of jEdit. The Scala
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   643
  expression @{verbatim "PIDE.snapshot(view)"} makes a PIDE document snapshot
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   644
  of the current buffer within the current editor view.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   645
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   646
  This helps to explore Isabelle/Scala functionality interactively. Some care
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   647
  is required to avoid interference with the internals of the running
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   648
  application, especially in production use.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   649
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   650
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   651
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   652
section \<open>File-system access\<close>
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   653
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   654
text \<open>
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   655
  File specifications in jEdit follow various formats and conventions
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   656
  according to \<^emph>\<open>Virtual File Systems\<close>, which may be also provided by
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   657
  additional plugins. This allows to access remote files via the @{verbatim
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   658
  "http:"} protocol prefix, for example. Isabelle/jEdit attempts to work with
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   659
  the file-system model of jEdit as far as possible. In particular, theory
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   660
  sources are passed directly from the editor to the prover, without
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   661
  indirection via physical files.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   662
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   663
  Despite the flexibility of URLs in jEdit, local files are particularly
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   664
  important and are accessible without protocol prefix. Here the path notation
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   665
  is that of the Java Virtual Machine on the underlying platform. On Windows
60257
wenzelm
parents: 60256
diff changeset
   666
  the preferred form uses backslashes, but happens to accept also forward
wenzelm
parents: 60256
diff changeset
   667
  slashes like Unix/POSIX. Further differences arise due to Windows drive
wenzelm
parents: 60256
diff changeset
   668
  letters and network shares.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   669
57331
wenzelm
parents: 57329
diff changeset
   670
  The Java notation for files needs to be distinguished from the one of
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   671
  Isabelle, which uses POSIX notation with forward slashes on \<^emph>\<open>all\<close>
57331
wenzelm
parents: 57329
diff changeset
   672
  platforms.\footnote{Isabelle/ML on Windows uses Cygwin file-system access
wenzelm
parents: 57329
diff changeset
   673
  and Unix-style path notation.} Moreover, environment variables from the
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   674
  Isabelle process may be used freely, e.g.\ @{file
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   675
  "$ISABELLE_HOME/etc/symbols"} or @{file_unchecked "$POLYML_HOME/README"}.
57331
wenzelm
parents: 57329
diff changeset
   676
  There are special shortcuts: @{file "~"} for @{file "$USER_HOME"} and @{file
wenzelm
parents: 57329
diff changeset
   677
  "~~"} for @{file "$ISABELLE_HOME"}.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   678
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   679
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   680
  Since jEdit happens to support environment variables within file
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   681
  specifications as well, it is natural to use similar notation within the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   682
  editor, e.g.\ in the file-browser. This does not work in full generality,
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   683
  though, due to the bias of jEdit towards platform-specific notation and of
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   684
  Isabelle towards POSIX. Moreover, the Isabelle settings environment is not
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   685
  yet active when starting Isabelle/jEdit via its standard application
60257
wenzelm
parents: 60256
diff changeset
   686
  wrapper, in contrast to @{tool jedit} run from the command line
wenzelm
parents: 60256
diff changeset
   687
  (\secref{sec:command-line}).
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   688
57331
wenzelm
parents: 57329
diff changeset
   689
  Isabelle/jEdit imitates @{verbatim "$ISABELLE_HOME"} and @{verbatim
wenzelm
parents: 57329
diff changeset
   690
  "$ISABELLE_HOME_USER"} within the Java process environment, in order to
wenzelm
parents: 57329
diff changeset
   691
  allow easy access to these important places from the editor. The file
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   692
  browser of jEdit also includes \<^emph>\<open>Favorites\<close> for these two important
57326
wenzelm
parents: 57325
diff changeset
   693
  locations.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   694
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   695
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   696
  Path specifications in prover input or output usually include
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   697
  formal markup that turns it into a hyperlink (see also
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   698
  \secref{sec:tooltips-hyperlinks}). This allows to open the corresponding
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   699
  file in the text editor, independently of the path notation.
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   700
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   701
  Formally checked paths in prover input are subject to completion
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   702
  (\secref{sec:completion}): partial specifications are resolved via
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   703
  directory content and possible completions are offered in a popup.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   704
\<close>
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   705
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   706
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   707
chapter \<open>Prover IDE functionality \label{sec:document-model}\<close>
57315
d0f34f328ffa clarified section structure;
wenzelm
parents: 57314
diff changeset
   708
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   709
section \<open>Document model \label{sec:document-model}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   710
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   711
text \<open>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   712
  The document model is central to the PIDE architecture: the editor and the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   713
  prover have a common notion of structured source text with markup, which is
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   714
  produced by formal processing. The editor is responsible for edits of
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   715
  document source, as produced by the user. The prover is responsible for
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   716
  reports of document markup, as produced by its processing in the background.
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   717
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   718
  Isabelle/jEdit handles classic editor events of jEdit, in order to connect
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   719
  the physical world of the GUI (with its singleton state) to the mathematical
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   720
  world of multiple document versions (with timeless and stateless updates).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   721
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   722
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   723
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   724
subsection \<open>Editor buffers and document nodes \label{sec:buffer-node}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   725
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   726
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   727
  As a regular text editor, jEdit maintains a collection of \<^emph>\<open>buffers\<close> to
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   728
  store text files; each buffer may be associated with any number of visible
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   729
  \<^emph>\<open>text areas\<close>. Buffers are subject to an \<^emph>\<open>edit mode\<close> that is
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   730
  determined from the file name extension. The following modes are treated
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   731
  specifically in Isabelle/jEdit:
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   732
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   733
  \<^medskip>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   734
  \begin{tabular}{lll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   735
  \<^bold>\<open>mode\<close> & \<^bold>\<open>file extension\<close> & \<^bold>\<open>content\<close> \\\hline
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   736
  @{verbatim "isabelle"} & @{verbatim ".thy"} & theory source \\
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   737
  @{verbatim "isabelle-ml"} & @{verbatim ".ML"} & Isabelle/ML source \\
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   738
  @{verbatim "sml"} & @{verbatim ".sml"} or @{verbatim ".sig"} & Standard ML source \\
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   739
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   740
  \<^medskip>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   741
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   742
  All jEdit buffers are automatically added to the PIDE document-model as
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   743
  \<^emph>\<open>document nodes\<close>. The overall document structure is defined by the
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   744
  theory nodes in two dimensions:
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   745
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   746
  \<^enum> via \<^bold>\<open>theory imports\<close> that are specified in the \<^emph>\<open>theory
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   747
  header\<close> using concrete syntax of the @{command_ref theory} command
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   748
  @{cite "isabelle-isar-ref"};
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   749
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   750
  \<^enum> via \<^bold>\<open>auxiliary files\<close> that are loaded into a theory by special
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   751
  \<^emph>\<open>load commands\<close>, notably @{command_ref ML_file} and @{command_ref
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   752
  SML_file} @{cite "isabelle-isar-ref"}.
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   753
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   754
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   755
  In any case, source files are managed by the PIDE infrastructure: the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   756
  physical file-system only plays a subordinate role. The relevant version of
60257
wenzelm
parents: 60256
diff changeset
   757
  source text is passed directly from the editor to the prover, using internal
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   758
  communication channels.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   759
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   760
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   761
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   762
subsection \<open>Theories \label{sec:theories}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   763
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   764
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   765
  The \<^emph>\<open>Theories\<close> panel (see also \figref{fig:theories}) provides an
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   766
  overview of the status of continuous checking of theory nodes within the
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   767
  document model. Unlike batch sessions of @{tool build} @{cite
60270
wenzelm
parents: 60264
diff changeset
   768
  "isabelle-system"}, theory nodes are identified by full path names; this allows
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   769
  to work with multiple (disjoint) Isabelle sessions simultaneously within the
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   770
  same editor session.
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   771
57339
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   772
  \begin{figure}[htb]
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   773
  \begin{center}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   774
  \includegraphics[scale=0.333]{theories}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   775
  \end{center}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   776
  \caption{Theories panel with an overview of the document-model, and some
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   777
  jEdit text areas as editable view on some of the document nodes}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   778
  \label{fig:theories}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   779
  \end{figure}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   780
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   781
  Certain events to open or update editor buffers cause Isabelle/jEdit to
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   782
  resolve dependencies of theory imports. The system requests to load
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   783
  additional files into editor buffers, in order to be included in the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   784
  document model for further checking. It is also possible to let the system
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   785
  resolve dependencies automatically, according to the system option
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   786
  @{system_option jedit_auto_load}.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   787
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   788
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   789
  The visible \<^emph>\<open>perspective\<close> of Isabelle/jEdit is defined by the
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   790
  collective view on theory buffers via open text areas. The perspective is
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   791
  taken as a hint for document processing: the prover ensures that those parts
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   792
  of a theory where the user is looking are checked, while other parts that
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   793
  are presently not required are ignored. The perspective is changed by
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   794
  opening or closing text area windows, or scrolling within a window.
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   795
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   796
  The \<^emph>\<open>Theories\<close> panel provides some further options to influence
54330
wenzelm
parents: 54329
diff changeset
   797
  the process of continuous checking: it may be switched off globally
54350
wenzelm
parents: 54349
diff changeset
   798
  to restrict the prover to superficial processing of command syntax.
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   799
  It is also possible to indicate theory nodes as \<^emph>\<open>required\<close> for
54330
wenzelm
parents: 54329
diff changeset
   800
  continuous checking: this means such nodes and all their imports are
wenzelm
parents: 54329
diff changeset
   801
  always processed independently of the visibility status (if
wenzelm
parents: 54329
diff changeset
   802
  continuous checking is enabled).  Big theory libraries that are
wenzelm
parents: 54329
diff changeset
   803
  marked as required can have significant impact on performance,
wenzelm
parents: 54329
diff changeset
   804
  though.
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   805
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   806
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   807
  Formal markup of checked theory content is turned into GUI
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   808
  rendering, based on a standard repertoire known from IDEs for programming
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   809
  languages: colors, icons, highlighting, squiggly underlines, tooltips,
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   810
  hyperlinks etc. For outer syntax of Isabelle/Isar there is some traditional
60257
wenzelm
parents: 60256
diff changeset
   811
  syntax-highlighting via static keywords and tokenization within the editor;
wenzelm
parents: 60256
diff changeset
   812
  this buffer syntax is determined from theory imports. In contrast, the
wenzelm
parents: 60256
diff changeset
   813
  painting of inner syntax (term language etc.)\ uses semantic information
wenzelm
parents: 60256
diff changeset
   814
  that is reported dynamically from the logical context. Thus the prover can
wenzelm
parents: 60256
diff changeset
   815
  provide additional markup to help the user to understand the meaning of
wenzelm
parents: 60256
diff changeset
   816
  formal text, and to produce more text with some add-on tools (e.g.\
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   817
  information messages with \<^emph>\<open>sendback\<close> markup by automated provers or
60257
wenzelm
parents: 60256
diff changeset
   818
  disprovers in the background).
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   819
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   820
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   821
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   822
subsection \<open>Auxiliary files \label{sec:aux-files}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   823
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   824
text \<open>
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   825
  Special load commands like @{command_ref ML_file} and @{command_ref
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   826
  SML_file} @{cite "isabelle-isar-ref"} refer to auxiliary files within some
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   827
  theory. Conceptually, the file argument of the command extends the theory
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   828
  source by the content of the file, but its editor buffer may be loaded~/
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   829
  changed~/ saved separately. The PIDE document model propagates changes of
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   830
  auxiliary file content to the corresponding load command in the theory, to
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   831
  update and process it accordingly: changes of auxiliary file content are
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   832
  treated as changes of the corresponding load command.
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   833
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   834
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   835
  As a concession to the massive amount of ML files in Isabelle/HOL
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   836
  itself, the content of auxiliary files is only added to the PIDE
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   837
  document-model on demand, the first time when opened explicitly in the
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   838
  editor. There are further tricks to manage markup of ML files, such that
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   839
  Isabelle/HOL may be edited conveniently in the Prover IDE on small machines
60257
wenzelm
parents: 60256
diff changeset
   840
  with only 8\,GB of main memory. Using @{verbatim Pure} as logic session
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   841
  image, the exploration may start at the top @{file
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   842
  "$ISABELLE_HOME/src/HOL/Main.thy"} or the bottom @{file
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   843
  "$ISABELLE_HOME/src/HOL/HOL.thy"}, for example.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   844
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   845
  Initially, before an auxiliary file is opened in the editor, the prover
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   846
  reads its content from the physical file-system. After the file is opened
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   847
  for the first time in the editor, e.g.\ by following the hyperlink
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   848
  (\secref{sec:tooltips-hyperlinks}) for the argument of its @{command
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   849
  ML_file} command, the content is taken from the jEdit buffer.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   850
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   851
  The change of responsibility from prover to editor counts as an update of
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   852
  the document content, so subsequent theory sources need to be re-checked.
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   853
  When the buffer is closed, the responsibility remains to the editor: the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   854
  file may be opened again without causing another document update.
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   855
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   856
  A file that is opened in the editor, but its theory with the load command is
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   857
  not, is presently inactive in the document model. A file that is loaded via
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   858
  multiple load commands is associated to an arbitrary one: this situation is
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   859
  morally unsupported and might lead to confusion.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   860
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   861
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   862
  Output that refers to an auxiliary file is combined with that of
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   863
  the corresponding load command, and shown whenever the file or the command
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   864
  are active (see also \secref{sec:output}).
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   865
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   866
  Warnings, errors, and other useful markup is attached directly to the
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   867
  positions in the auxiliary file buffer, in the manner of other well-known
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   868
  IDEs. By using the load command @{command SML_file} as explained in @{file
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   869
  "$ISABELLE_HOME/src/Tools/SML/Examples.thy"}, Isabelle/jEdit may be used as
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   870
  fully-featured IDE for Standard ML, independently of theory or proof
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   871
  development: the required theory merely serves as some kind of project
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   872
  file for a collection of SML source modules.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   873
\<close>
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   874
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
   875
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   876
section \<open>Output \label{sec:output}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   877
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   878
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   879
  Prover output consists of \<^emph>\<open>markup\<close> and \<^emph>\<open>messages\<close>. Both are
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   880
  directly attached to the corresponding positions in the original source
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   881
  text, and visualized in the text area, e.g.\ as text colours for free and
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   882
  bound variables, or as squiggly underlines for warnings, errors etc.\ (see
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   883
  also \figref{fig:output}). In the latter case, the corresponding messages
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   884
  are shown by hovering with the mouse over the highlighted text --- although
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   885
  in many situations the user should already get some clue by looking at the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   886
  position of the text highlighting, without the text itself.
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   887
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   888
  \begin{figure}[htb]
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   889
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
   890
  \includegraphics[scale=0.333]{output}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   891
  \end{center}
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   892
  \caption{Multiple views on prover output: gutter area with icon,
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   893
    text area with popup, overview area, Theories panel, Output panel}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   894
  \label{fig:output}
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   895
  \end{figure}
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   896
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   897
  The ``gutter area'' on the left-hand-side of the text area uses
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   898
  icons to provide a summary of the messages within the adjacent
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   899
  line of text.  Message priorities are used to prefer errors over
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   900
  warnings, warnings over information messages, but plain output is
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   901
  ignored.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   902
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   903
  The ``overview area'' on the right-hand-side of the text area uses similar
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   904
  information to paint small rectangles for the overall status of the whole
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   905
  text buffer. The graphics is scaled to fit the logical buffer length into
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   906
  the given window height. Mouse clicks on the overview area position the
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   907
  cursor approximately to the corresponding line of text in the buffer.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   908
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   909
  Another course-grained overview is provided by the \<^emph>\<open>Theories\<close>
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   910
  panel, but without direct correspondence to text positions.  A
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   911
  double-click on one of the theory entries with their status overview
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   912
  opens the corresponding text buffer, without changing the cursor
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   913
  position.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   914
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   915
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   916
  In addition, the \<^emph>\<open>Output\<close> panel displays prover
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   917
  messages that correspond to a given command, within a separate
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   918
  window.
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   919
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   920
  The cursor position in the presently active text area determines the prover
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   921
  command whose cumulative message output is appended and shown in that window
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   922
  (in canonical order according to the internal execution of the command).
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   923
  There are also control elements to modify the update policy of the output
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   924
  wrt.\ continued editor movements. This is particularly useful with several
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   925
  independent instances of the \<^emph>\<open>Output\<close> panel, which the Dockable Window
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   926
  Manager of jEdit can handle conveniently.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   927
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   928
  Former users of the old TTY interaction model (e.g.\ Proof~General) might
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   929
  find a separate window for prover messages familiar, but it is important to
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   930
  understand that the main Prover IDE feedback happens elsewhere. It is
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   931
  possible to do meaningful proof editing within the primary text area and its
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   932
  markup, while using secondary output windows only rarely.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   933
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   934
  The main purpose of the output window is to ``debug'' unclear
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   935
  situations by inspecting internal state of the prover.\footnote{In
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
   936
  that sense, unstructured tactic scripts depend on continuous
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   937
  debugging with internal state inspection.} Consequently, some
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   938
  special messages for \<^emph>\<open>tracing\<close> or \<^emph>\<open>proof state\<close> only
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   939
  appear here, and are not attached to the original source.
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   940
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   941
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   942
  In any case, prover messages also contain markup that may
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   943
  be explored recursively via tooltips or hyperlinks (see
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   944
  \secref{sec:tooltips-hyperlinks}), or clicked directly to initiate
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
   945
  certain actions (see \secref{sec:auto-tools} and
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   946
  \secref{sec:sledgehammer}).\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   947
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   948
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   949
section \<open>Query \label{sec:query}\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   950
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   951
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   952
  The \<^emph>\<open>Query\<close> panel provides various GUI forms to request extra
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   953
  information from the prover. In old times the user would have issued some
57314
wenzelm
parents: 57313
diff changeset
   954
  diagnostic command like @{command find_theorems} and inspected its output,
wenzelm
parents: 57313
diff changeset
   955
  but this is now integrated into the Prover IDE.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   956
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   957
  A \<^emph>\<open>Query\<close> window provides some input fields and buttons for a
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   958
  particular query command, with output in a dedicated text area. There are
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   959
  various query modes: \<^emph>\<open>Find Theorems\<close>, \<^emph>\<open>Find Constants\<close>,
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   960
  \<^emph>\<open>Print Context\<close>, e.g.\ see \figref{fig:query}. As usual in jEdit,
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   961
  multiple \<^emph>\<open>Query\<close> windows may be active at the same time: any number of
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   962
  floating instances, but at most one docked instance (which is used by
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   963
  default).
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   964
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   965
  \begin{figure}[htb]
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   966
  \begin{center}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   967
  \includegraphics[scale=0.333]{query}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   968
  \end{center}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   969
  \caption{An instance of the Query panel}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   970
  \label{fig:query}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   971
  \end{figure}
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   972
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   973
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   974
  The following GUI elements are common to all query modes:
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   975
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   976
  \<^item> The spinning wheel provides feedback about the status of a pending
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   977
  query wrt.\ the evaluation of its context and its own operation.
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   978
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   979
  \<^item> The \<^emph>\<open>Apply\<close> button attaches a fresh query invocation to the
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   980
  current context of the command where the cursor is pointing in the text.
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   981
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   982
  \<^item> The \<^emph>\<open>Search\<close> field allows to highlight query output according to
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   983
  some regular expression, in the notation that is commonly used on the Java
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   984
  platform.\footnote{@{url
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   985
  "http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html"}}
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   986
  This may serve as an additional visual filter of the result.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   987
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   988
  \<^item> The \<^emph>\<open>Zoom\<close> box controls the font size of the output area.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   989
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   990
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   991
  All query operations are asynchronous: there is no need to wait for the
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   992
  evaluation of the document for the query context, nor for the query
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   993
  operation itself. Query output may be detached as independent \<^emph>\<open>Info\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   994
  window, using a menu operation of the dockable window manager. The printed
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   995
  result usually provides sufficient clues about the original query, with some
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   996
  hyperlink to its context (via markup of its head line).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   997
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   998
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   999
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1000
subsection \<open>Find theorems\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1001
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1002
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1003
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Find Theorems\<close> mode retrieves facts from the
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1004
  theory or proof context matching all of given criteria in the \<^emph>\<open>Find\<close>
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1005
  text field. A single criterium has the following syntax:
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1006
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1007
  @{rail \<open>
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1008
    ('-'?) ('name' ':' @{syntax nameref} | 'intro' | 'elim' | 'dest' |
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1009
      'solves' | 'simp' ':' @{syntax term} | @{syntax term})
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1010
  \<close>}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1011
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1012
  See also the Isar command @{command_ref find_theorems} in
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1013
  @{cite "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1014
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1015
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1016
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1017
subsection \<open>Find constants\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1018
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1019
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1020
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Find Constants\<close> mode prints all constants
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1021
  whose type meets all of the given criteria in the \<^emph>\<open>Find\<close> text field.
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1022
  A single criterium has the following syntax:
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1023
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1024
  @{rail \<open>
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1025
    ('-'?)
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1026
      ('name' ':' @{syntax nameref} | 'strict' ':' @{syntax type} | @{syntax type})
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1027
  \<close>}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1028
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1029
  See also the Isar command @{command_ref find_consts} in @{cite
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1030
  "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1031
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1032
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1033
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1034
subsection \<open>Print context\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1035
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1036
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1037
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Print Context\<close> mode prints information from
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1038
  the theory or proof context, or proof state. See also the Isar commands
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1039
  @{command_ref print_context}, @{command_ref print_cases}, @{command_ref
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1040
  print_term_bindings}, @{command_ref print_theorems}, @{command_ref
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1041
  print_state} described in @{cite "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1042
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1043
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1044
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1045
section \<open>Tooltips and hyperlinks \label{sec:tooltips-hyperlinks}\<close>
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1046
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1047
text \<open>
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1048
  Formally processed text (prover input or output) contains rich markup
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1049
  information that can be explored further by using the @{verbatim CONTROL}
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1050
  modifier key on Linux and Windows, or @{verbatim COMMAND} on Mac OS X.
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1051
  Hovering with the mouse while the modifier is pressed reveals a
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1052
  \<^emph>\<open>tooltip\<close> (grey box over the text with a yellow popup) and/or a
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1053
  \<^emph>\<open>hyperlink\<close> (black rectangle over the text with change of mouse
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1054
  pointer); see also \figref{fig:tooltip}.
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1055
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
  1056
  \begin{figure}[htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1057
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1058
  \includegraphics[scale=0.5]{popup1}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1059
  \end{center}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1060
  \caption{Tooltip and hyperlink for some formal entity}
54350
wenzelm
parents: 54349
diff changeset
  1061
  \label{fig:tooltip}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1062
  \end{figure}
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1063
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1064
  Tooltip popups use the same rendering mechanisms as the main text
54350
wenzelm
parents: 54349
diff changeset
  1065
  area, and further tooltips and/or hyperlinks may be exposed
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
  1066
  recursively by the same mechanism; see \figref{fig:nested-tooltips}.
54323
d521407f8d0f more documentation;
wenzelm
parents: 54322
diff changeset
  1067
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
  1068
  \begin{figure}[htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1069
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1070
  \includegraphics[scale=0.5]{popup2}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1071
  \end{center}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1072
  \caption{Nested tooltips over formal entities}
54350
wenzelm
parents: 54349
diff changeset
  1073
  \label{fig:nested-tooltips}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1074
  \end{figure}
54350
wenzelm
parents: 54349
diff changeset
  1075
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1076
  The tooltip popup window provides some controls to \<^emph>\<open>close\<close> or
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1077
  \<^emph>\<open>detach\<close> the window, turning it into a separate \<^emph>\<open>Info\<close>
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1078
  window managed by jEdit.  The @{verbatim ESCAPE} key closes
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1079
  \<^emph>\<open>all\<close> popups, which is particularly relevant when nested
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1080
  tooltips are stacking up.
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1081
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1082
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1083
  A black rectangle in the text indicates a hyperlink that may be
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1084
  followed by a mouse click (while the @{verbatim CONTROL} or @{verbatim
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1085
  COMMAND} modifier key is still pressed). Such jumps to other text locations
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1086
  are recorded by the \<^emph>\<open>Navigator\<close> plugin, which is bundled with
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1087
  Isabelle/jEdit and enabled by default, including navigation arrows in the
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1088
  main jEdit toolbar.
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1089
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1090
  Also note that the link target may be a file that is itself not
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1091
  subject to formal document processing of the editor session and thus
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1092
  prevents further exploration: the chain of hyperlinks may end in
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1093
  some source file of the underlying logic image, or within the
60257
wenzelm
parents: 60256
diff changeset
  1094
  ML bootstrap sources of Isabelle/Pure.\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
  1095
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
  1096
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1097
section \<open>Completion \label{sec:completion}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1098
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1099
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1100
  Smart completion of partial input is the IDE functionality \<^emph>\<open>par
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1101
  excellance\<close>. Isabelle/jEdit combines several sources of information to
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1102
  achieve that. Despite its complexity, it should be possible to get some idea
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1103
  how completion works by experimentation, based on the overview of completion
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1104
  varieties in \secref{sec:completion-varieties}. The remaining subsections
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1105
  explain concepts around completion more systematically.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1106
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1107
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1108
  \<^emph>\<open>Explicit completion\<close> is triggered by the action @{action_ref
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1109
  "isabelle.complete"}, which is bound to the keyboard shortcut @{verbatim
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1110
  "C+b"}, and thus overrides the jEdit default for @{action_ref
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1111
  "complete-word"}.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1112
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1113
  \<^emph>\<open>Implicit completion\<close> hooks into the regular keyboard input stream of
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1114
  the editor, with some event filtering and optional delays.
54361
wenzelm
parents: 54360
diff changeset
  1115
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1116
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1117
  Completion options may be configured in \<^emph>\<open>Plugin Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1118
  Isabelle~/ General~/ Completion\<close>. These are explained in further detail
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1119
  below, whenever relevant. There is also a summary of options in
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1120
  \secref{sec:completion-options}.
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1121
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1122
  The asynchronous nature of PIDE interaction means that information from the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1123
  prover is delayed --- at least by a full round-trip of the document update
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1124
  protocol. The default options already take this into account, with a
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1125
  sufficiently long completion delay to speculate on the availability of all
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1126
  relevant information from the editor and the prover, before completing text
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1127
  immediately or producing a popup. Although there is an inherent danger of
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1128
  non-deterministic behaviour due to such real-time parameters, the general
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1129
  completion policy aims at determined results as far as possible.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1130
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1131
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1132
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1133
subsection \<open>Varieties of completion \label{sec:completion-varieties}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1134
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1135
subsubsection \<open>Built-in templates\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1136
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1137
text \<open>
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1138
  Isabelle is ultimately a framework of nested sub-languages of different
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1139
  kinds and purposes. The completion mechanism supports this by the following
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1140
  built-in templates:
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1141
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1142
  \<^descr> @{verbatim "`"} (single ASCII back-quote) supports \<^emph>\<open>quotations\<close>
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1143
  via text cartouches. There are three selections, which are always presented
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1144
  in the same order and do not depend on any context information. The default
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1145
  choice produces a template ``\<open>\<open>\<box>\<close>\<close>'', where the box indicates the
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1146
  cursor position after insertion; the other choices help to repair the block
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1147
  structure of unbalanced text cartouches.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1148
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1149
  \<^descr> @{verbatim "@{"} is completed to the template ``\<open>@{\<box>}\<close>'',
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1150
  where the box indicates the cursor position after insertion. Here it is
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1151
  convenient to use the wildcard ``@{verbatim __}'' or a more specific name
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1152
  prefix to let semantic completion of name-space entries propose
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1153
  antiquotation names.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1154
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1155
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1156
  With some practice, input of quoted sub-languages and antiquotations of
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1157
  embedded languages should work fluently. Note that national keyboard layouts
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1158
  might cause problems with back-quote as dead key: if possible, dead keys
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1159
  should be disabled.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1160
\<close>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1161
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1162
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1163
subsubsection \<open>Syntax keywords\<close>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1164
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1165
text \<open>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1166
  Syntax completion tables are determined statically from the keywords of the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1167
  ``outer syntax'' of the underlying edit mode: for theory files this is the
60257
wenzelm
parents: 60256
diff changeset
  1168
  syntax of Isar commands according to the cumulative theory imports.
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1169
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1170
  Keywords are usually plain words, which means the completion mechanism only
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1171
  inserts them directly into the text for explicit completion
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1172
  (\secref{sec:completion-input}), but produces a popup
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1173
  (\secref{sec:completion-popup}) otherwise.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1174
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1175
  At the point where outer syntax keywords are defined, it is possible to
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1176
  specify an alternative replacement string to be inserted instead of the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1177
  keyword itself. An empty string means to suppress the keyword altogether,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1178
  which is occasionally useful to avoid confusion, e.g.\ the rare keyword
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1179
  @{command simproc_setup} vs.\ the frequent name-space entry \<open>simp\<close>.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1180
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1181
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1182
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1183
subsubsection \<open>Isabelle symbols\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1184
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1185
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1186
  The completion tables for Isabelle symbols (\secref{sec:symbols}) are
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1187
  determined statically from @{file "$ISABELLE_HOME/etc/symbols"} and
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1188
  @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"} for each symbol
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1189
  specification as follows:
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1190
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1191
  \<^medskip>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1192
  \begin{tabular}{ll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1193
  \<^bold>\<open>completion entry\<close> & \<^bold>\<open>example\<close> \\\hline
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1194
  literal symbol & @{verbatim "\<forall>"} \\
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1195
  symbol name with backslash & @{verbatim "\\"}@{verbatim forall} \\
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1196
  symbol abbreviation & @{verbatim "ALL"} or @{verbatim "!"} \\
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1197
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1198
  \<^medskip>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1199
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1200
  When inserted into the text, the above examples all produce the same Unicode
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1201
  rendering \<open>\<forall>\<close> of the underlying symbol @{verbatim "\<forall>"}.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1202
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1203
  A symbol abbreviation that is a plain word, like @{verbatim "ALL"}, is
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1204
  treated like a syntax keyword. Non-word abbreviations like @{verbatim "-->"}
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1205
  are inserted more aggressively, except for single-character abbreviations
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1206
  like @{verbatim "!"} above.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1207
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1208
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1209
  Symbol completion depends on the semantic language context
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1210
  (\secref{sec:completion-context}), to enable or disable that aspect for a
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1211
  particular sub-language of Isabelle. For example, symbol completion is
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1212
  suppressed within document source to avoid confusion with {\LaTeX} macros
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1213
  that use similar notation.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1214
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1215
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1216
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1217
subsubsection \<open>Name-space entries\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1218
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1219
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1220
  This is genuine semantic completion, using information from the prover, so
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1221
  it requires some delay. A \<^emph>\<open>failed name-space lookup\<close> produces an error
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1222
  message that is annotated with a list of alternative names that are legal.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1223
  The list of results is truncated according to the system option
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1224
  @{system_option_ref completion_limit}. The completion mechanism takes this
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1225
  into account when collecting information on the prover side.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1226
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1227
  Already recognized names are \<^emph>\<open>not\<close> completed further, but completion
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1228
  may be extended by appending a suffix of underscores. This provokes a failed
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1229
  lookup, and another completion attempt while ignoring the underscores. For
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1230
  example, in a name space where @{verbatim "foo"} and @{verbatim "foobar"}
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1231
  are known, the input @{verbatim "foo"} remains unchanged, but @{verbatim
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1232
  "foo_"} may be completed to @{verbatim "foo"} or @{verbatim "foobar"}.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1233
57326
wenzelm
parents: 57325
diff changeset
  1234
  The special identifier ``@{verbatim "__"}'' serves as a wild-card for
wenzelm
parents: 57325
diff changeset
  1235
  arbitrary completion: it exposes the name-space content to the completion
wenzelm
parents: 57325
diff changeset
  1236
  mechanism (truncated according to @{system_option completion_limit}). This
wenzelm
parents: 57325
diff changeset
  1237
  is occasionally useful to explore an unknown name-space, e.g.\ in some
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1238
  template.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1239
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1240
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1241
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1242
subsubsection \<open>File-system paths\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1243
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1244
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1245
  Depending on prover markup about file-system path specifications in the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1246
  source text, e.g.\ for the argument of a load command
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1247
  (\secref{sec:aux-files}), the completion mechanism explores the directory
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1248
  content and offers the result as completion popup. Relative path
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1249
  specifications are understood wrt.\ the \<^emph>\<open>master directory\<close> of the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1250
  document node (\secref{sec:buffer-node}) of the enclosing editor buffer;
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1251
  this requires a proper theory, not an auxiliary file.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1252
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1253
  A suffix of slashes may be used to continue the exploration of an already
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1254
  recognized directory name.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1255
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1256
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1257
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1258
subsubsection \<open>Spell-checking\<close>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1259
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1260
text \<open>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1261
  The spell-checker combines semantic markup from the prover (regions of plain
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1262
  words) with static dictionaries (word lists) that are known to the editor.
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1263
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1264
  Unknown words are underlined in the text, using @{system_option_ref
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1265
  spell_checker_color} (blue by default). This is not an error, but a hint to
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1266
  the user that some action may be taken. The jEdit context menu provides
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1267
  various actions, as far as applicable:
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1268
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1269
  \<^medskip>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1270
  \begin{tabular}{l}
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1271
  @{action_ref "isabelle.complete-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1272
  @{action_ref "isabelle.exclude-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1273
  @{action_ref "isabelle.exclude-word-permanently"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1274
  @{action_ref "isabelle.include-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1275
  @{action_ref "isabelle.include-word-permanently"} \\
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1276
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1277
  \<^medskip>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1278
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1279
  Instead of the specific @{action_ref "isabelle.complete-word"}, it is also
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1280
  possible to use the generic @{action_ref "isabelle.complete"} with its
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1281
  default keyboard shortcut @{verbatim "C+b"}.
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1282
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1283
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1284
  Dictionary lookup uses some educated guesses about lower-case,
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1285
  upper-case, and capitalized words. This is oriented on common use in
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1286
  English, where this aspect is not decisive for proper spelling, in contrast
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1287
  to German, for example.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1288
\<close>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1289
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1290
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1291
subsection \<open>Semantic completion context \label{sec:completion-context}\<close>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1292
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1293
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1294
  Completion depends on a semantic context that is provided by the prover,
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1295
  although with some delay, because at least a full PIDE protocol round-trip
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1296
  is required. Until that information becomes available in the PIDE
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1297
  document-model, the default context is given by the outer syntax of the
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1298
  editor mode (see also \secref{sec:buffer-node}).
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1299
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1300
  The semantic \<^emph>\<open>language context\<close> provides information about nested
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1301
  sub-languages of Isabelle: keywords are only completed for outer syntax,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1302
  symbols or antiquotations for languages that support them. E.g.\ there is no
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1303
  symbol completion for ML source, but within ML strings, comments,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1304
  antiquotations.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1305
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1306
  The prover may produce \<^emph>\<open>no completion\<close> markup in exceptional
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1307
  situations, to tell that some language keywords should be excluded from
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1308
  further completion attempts. For example, @{verbatim ":"} within accepted
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1309
  Isar syntax looses its meaning as abbreviation for symbol \<open>\<in>\<close>.
57589
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1310
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1311
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1312
  The completion context is \<^emph>\<open>ignored\<close> for built-in templates and
57589
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1313
  symbols in their explicit form ``@{verbatim "\<foobar>"}''; see also
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1314
  \secref{sec:completion-varieties}. This allows to complete within broken
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1315
  input that escapes its normal semantic context, e.g.\ antiquotations or
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1316
  string literals in ML, which do not allow arbitrary backslash sequences.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1317
\<close>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1318
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1319
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1320
subsection \<open>Input events \label{sec:completion-input}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1321
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1322
text \<open>
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1323
  Completion is triggered by certain events produced by the user, with
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1324
  optional delay after keyboard input according to @{system_option
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1325
  jedit_completion_delay}.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1326
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1327
  \<^descr>[Explicit completion] works via action @{action_ref
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1328
  "isabelle.complete"} with keyboard shortcut @{verbatim "C+b"}. This
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1329
  overrides the shortcut for @{action_ref "complete-word"} in jEdit, but it is
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1330
  possible to restore the original jEdit keyboard mapping of @{action
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1331
  "complete-word"} via \<^emph>\<open>Global Options~/ Shortcuts\<close> and invent a
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1332
  different one for @{action "isabelle.complete"}.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1333
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1334
  \<^descr>[Explicit spell-checker completion] works via @{action_ref
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1335
  "isabelle.complete-word"}, which is exposed in the jEdit context menu, if
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1336
  the mouse points to a word that the spell-checker can complete.
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1337
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1338
  \<^descr>[Implicit completion] works via regular keyboard input of the editor.
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1339
  It depends on further side-conditions:
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1340
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1341
    \<^enum> The system option @{system_option_ref jedit_completion} needs to
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1342
    be enabled (default).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1343
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1344
    \<^enum> Completion of syntax keywords requires at least 3 relevant
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1345
    characters in the text.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1346
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1347
    \<^enum> The system option @{system_option_ref jedit_completion_delay}
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1348
    determines an additional delay (0.5 by default), before opening a completion
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1349
    popup.  The delay gives the prover a chance to provide semantic completion
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1350
    information, notably the context (\secref{sec:completion-context}).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1351
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1352
    \<^enum> The system option @{system_option_ref jedit_completion_immediate}
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1353
    (enabled by default) controls whether replacement text should be inserted
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1354
    immediately without popup, regardless of @{system_option
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1355
    jedit_completion_delay}. This aggressive mode of completion is restricted to
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1356
    Isabelle symbols and their abbreviations (\secref{sec:symbols}).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1357
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1358
    \<^enum> Completion of symbol abbreviations with only one relevant
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1359
    character in the text always enforces an explicit popup,
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1360
    regardless of @{system_option_ref jedit_completion_immediate}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1361
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1362
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1363
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1364
subsection \<open>Completion popup \label{sec:completion-popup}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1365
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1366
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1367
  A \<^emph>\<open>completion popup\<close> is a minimally invasive GUI component over the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1368
  text area that offers a selection of completion items to be inserted into
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1369
  the text, e.g.\ by mouse clicks. Items are sorted dynamically, according to
57833
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1370
  the frequency of selection, with persistent history. The popup may interpret
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1371
  special keys @{verbatim ENTER}, @{verbatim TAB}, @{verbatim ESCAPE},
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1372
  @{verbatim UP}, @{verbatim DOWN}, @{verbatim PAGE_UP}, @{verbatim
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1373
  PAGE_DOWN}, but all other key events are passed to the underlying text area.
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1374
  This allows to ignore unwanted completions most of the time and continue
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1375
  typing quickly. Thus the popup serves as a mechanism of confirmation of
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1376
  proposed items, but the default is to continue without completion.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1377
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1378
  The meaning of special keys is as follows:
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1379
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1380
  \<^medskip>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1381
  \begin{tabular}{ll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1382
  \<^bold>\<open>key\<close> & \<^bold>\<open>action\<close> \\\hline
57833
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1383
  @{verbatim "ENTER"} & select completion (if @{system_option jedit_completion_select_enter}) \\
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1384
  @{verbatim "TAB"} & select completion (if @{system_option jedit_completion_select_tab}) \\
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1385
  @{verbatim "ESCAPE"} & dismiss popup \\
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1386
  @{verbatim "UP"} & move up one item \\
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1387
  @{verbatim "DOWN"} & move down one item \\
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1388
  @{verbatim "PAGE_UP"} & move up one page of items \\
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1389
  @{verbatim "PAGE_DOWN"} & move down one page of items \\
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1390
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1391
  \<^medskip>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1392
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1393
  Movement within the popup is only active for multiple items.
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1394
  Otherwise the corresponding key event retains its standard meaning
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1395
  within the underlying text area.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1396
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1397
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1398
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1399
subsection \<open>Insertion \label{sec:completion-insert}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1400
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1401
text \<open>
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1402
  Completion may first propose replacements to be selected (via a popup), or
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1403
  replace text immediately in certain situations and depending on certain
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1404
  options like @{system_option jedit_completion_immediate}. In any case,
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1405
  insertion works uniformly, by imitating normal jEdit text insertion,
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1406
  depending on the state of the \<^emph>\<open>text selection\<close>. Isabelle/jEdit tries to
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1407
  accommodate the most common forms of advanced selections in jEdit, but not
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1408
  all combinations make sense. At least the following important cases are
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1409
  well-defined:
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1410
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1411
  \<^descr>[No selection.] The original is removed and the replacement inserted,
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1412
  depending on the caret position.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1413
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1414
  \<^descr>[Rectangular selection of zero width.] This special case is treated by
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1415
  jEdit as ``tall caret'' and insertion of completion imitates its normal
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1416
  behaviour: separate copies of the replacement are inserted for each line of
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1417
  the selection.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1418
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1419
  \<^descr>[Other rectangular selection or multiple selections.] Here the original
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1420
  is removed and the replacement is inserted for each line (or segment) of the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1421
  selection.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1422
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1423
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1424
  Support for multiple selections is particularly useful for
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1425
  \<^emph>\<open>HyperSearch\<close>: clicking on one of the items in the \<^emph>\<open>HyperSearch
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1426
  Results\<close> window makes jEdit select all its occurrences in the corresponding
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1427
  line of text. Then explicit completion can be invoked via @{verbatim "C+b"},
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1428
  e.g.\ to replace occurrences of @{verbatim "-->"} by \<open>\<longrightarrow>\<close>.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1429
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1430
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1431
  Insertion works by removing and inserting pieces of text from the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1432
  buffer. This counts as one atomic operation on the jEdit history. Thus
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1433
  unintended completions may be reverted by the regular @{action undo} action
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1434
  of jEdit. According to normal jEdit policies, the recovered text after
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1435
  @{action undo} is selected: @{verbatim ESCAPE} is required to reset the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1436
  selection and to continue typing more text.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1437
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1438
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1439
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1440
subsection \<open>Options \label{sec:completion-options}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1441
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1442
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1443
  This is a summary of Isabelle/Scala system options that are relevant for
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1444
  completion. They may be configured in \<^emph>\<open>Plugin Options~/ Isabelle~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1445
  General\<close> as usual.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1446
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1447
  \<^item> @{system_option_def completion_limit} specifies the maximum number of
60257
wenzelm
parents: 60256
diff changeset
  1448
  items for various semantic completion operations (name-space entries etc.)
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1449
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1450
  \<^item> @{system_option_def jedit_completion} guards implicit completion via
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1451
  regular jEdit key events (\secref{sec:completion-input}): it allows to
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1452
  disable implicit completion altogether.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1453
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1454
  \<^item> @{system_option_def jedit_completion_select_enter} and
57833
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1455
  @{system_option_def jedit_completion_select_tab} enable keys to select a
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1456
  completion item from the popup (\secref{sec:completion-popup}). Note that a
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1457
  regular mouse click on the list of items is always possible.
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1458
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1459
  \<^item> @{system_option_def jedit_completion_context} specifies whether the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1460
  language context provided by the prover should be used at all. Disabling
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1461
  that option makes completion less ``semantic''. Note that incomplete or
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1462
  severely broken input may cause some disagreement of the prover and the user
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1463
  about the intended language context.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1464
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1465
  \<^item> @{system_option_def jedit_completion_delay} and @{system_option_def
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1466
  jedit_completion_immediate} determine the handling of keyboard events for
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1467
  implicit completion (\secref{sec:completion-input}).
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1468
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1469
  A @{system_option jedit_completion_delay}~@{verbatim "> 0"} postpones the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1470
  processing of key events, until after the user has stopped typing for the
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1471
  given time span, but @{system_option jedit_completion_immediate}~@{verbatim
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1472
  "= true"} means that abbreviations of Isabelle symbols are handled
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1473
  nonetheless.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1474
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1475
  \<^item> @{system_option_def jedit_completion_path_ignore} specifies ``glob''
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1476
  patterns to ignore in file-system path completion (separated by colons),
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1477
  e.g.\ backup files ending with tilde.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1478
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1479
  \<^item> @{system_option_def spell_checker} is a global guard for all
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1480
  spell-checker operations: it allows to disable that mechanism altogether.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1481
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1482
  \<^item> @{system_option_def spell_checker_dictionary} determines the current
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1483
  dictionary, taken from the colon-separated list in the settings variable
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1484
  @{setting_def JORTHO_DICTIONARIES}. There are jEdit actions to specify local
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1485
  updates to a dictionary, by including or excluding words. The result of
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1486
  permanent dictionary updates is stored in the directory @{file_unchecked
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1487
  "$ISABELLE_HOME_USER/dictionaries"}, in a separate file for each dictionary.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1488
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1489
  \<^item> @{system_option_def spell_checker_elements} specifies a
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1490
  comma-separated list of markup elements that delimit words in the source
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1491
  that is subject to spell-checking, including various forms of comments.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1492
\<close>
54361
wenzelm
parents: 54360
diff changeset
  1493
wenzelm
parents: 54360
diff changeset
  1494
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1495
section \<open>Automatically tried tools \label{sec:auto-tools}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1496
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1497
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1498
  Continuous document processing works asynchronously in the background.
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1499
  Visible document source that has been evaluated may get augmented by
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1500
  additional results of \<^emph>\<open>asynchronous print functions\<close>. The canonical
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1501
  example is proof state output, which is always enabled. More heavy-weight
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1502
  print functions may be applied, in order to prove or disprove parts of the
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1503
  formal text by other means.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1504
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1505
  Isabelle/HOL provides various automatically tried tools that operate
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1506
  on outermost goal statements (e.g.\ @{command lemma}, @{command
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1507
  theorem}), independently of the state of the current proof attempt.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1508
  They work implicitly without any arguments.  Results are output as
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1509
  \<^emph>\<open>information messages\<close>, which are indicated in the text area by
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1510
  blue squiggles and a blue information sign in the gutter (see
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1511
  \figref{fig:auto-tools}).  The message content may be shown as for
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
  1512
  other output (see also \secref{sec:output}).  Some tools
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1513
  produce output with \<^emph>\<open>sendback\<close> markup, which means that
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1514
  clicking on certain parts of the output inserts that text into the
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1515
  source in the proper place.
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1516
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
  1517
  \begin{figure}[htb]
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1518
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1519
  \includegraphics[scale=0.333]{auto-tools}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1520
  \end{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1521
  \caption{Result of automatically tried tools}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1522
  \label{fig:auto-tools}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1523
  \end{figure}
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1524
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1525
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1526
  The following Isabelle system options control the behavior
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1527
  of automatically tried tools (see also the jEdit dialog window
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1528
  \<^emph>\<open>Plugin Options~/ Isabelle~/ General~/ Automatically tried
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1529
  tools\<close>):
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1530
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1531
  \<^item> @{system_option_ref auto_methods} controls automatic use of a
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1532
  combination of standard proof methods (@{method auto}, @{method
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1533
  simp}, @{method blast}, etc.).  This corresponds to the Isar command
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1534
  @{command_ref "try0"} @{cite "isabelle-isar-ref"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1535
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1536
  The tool is disabled by default, since unparameterized invocation of
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1537
  standard proof methods often consumes substantial CPU resources
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1538
  without leading to success.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1539
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1540
  \<^item> @{system_option_ref auto_nitpick} controls a slightly reduced
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1541
  version of @{command_ref nitpick}, which tests for counterexamples using
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1542
  first-order relational logic. See also the Nitpick manual
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1543
  @{cite "isabelle-nitpick"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1544
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1545
  This tool is disabled by default, due to the extra overhead of
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1546
  invoking an external Java process for each attempt to disprove a
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1547
  subgoal.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1548
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1549
  \<^item> @{system_option_ref auto_quickcheck} controls automatic use of
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1550
  @{command_ref quickcheck}, which tests for counterexamples using a
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1551
  series of assignments for free variables of a subgoal.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1552
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1553
  This tool is \<^emph>\<open>enabled\<close> by default.  It requires little
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1554
  overhead, but is a bit weaker than @{command nitpick}.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1555
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1556
  \<^item> @{system_option_ref auto_sledgehammer} controls a significantly
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1557
  reduced version of @{command_ref sledgehammer}, which attempts to prove
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1558
  a subgoal using external automatic provers. See also the
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1559
  Sledgehammer manual @{cite "isabelle-sledgehammer"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1560
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1561
  This tool is disabled by default, due to the relatively heavy nature
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1562
  of Sledgehammer.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1563
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1564
  \<^item> @{system_option_ref auto_solve_direct} controls automatic use of
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1565
  @{command_ref solve_direct}, which checks whether the current subgoals
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1566
  can be solved directly by an existing theorem.  This also helps to
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1567
  detect duplicate lemmas.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1568
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1569
  This tool is \<^emph>\<open>enabled\<close> by default.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1570
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1571
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1572
  Invocation of automatically tried tools is subject to some global
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1573
  policies of parallel execution, which may be configured as follows:
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1574
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1575
  \<^item> @{system_option_ref auto_time_limit} (default 2.0) determines the
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1576
  timeout (in seconds) for each tool execution.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1577
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1578
  \<^item> @{system_option_ref auto_time_start} (default 1.0) determines the
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1579
  start delay (in seconds) for automatically tried tools, after the
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1580
  main command evaluation is finished.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1581
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1582
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1583
  Each tool is submitted independently to the pool of parallel
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1584
  execution tasks in Isabelle/ML, using hardwired priorities according
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1585
  to its relative ``heaviness''.  The main stages of evaluation and
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1586
  printing of proof states take precedence, but an already running
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1587
  tool is not canceled and may thus reduce reactivity of proof
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1588
  document processing.
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1589
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1590
  Users should experiment how the available CPU resources (number of
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1591
  cores) are best invested to get additional feedback from prover in
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1592
  the background, by using a selection of weaker or stronger tools.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1593
\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1594
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1595
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1596
section \<open>Sledgehammer \label{sec:sledgehammer}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1597
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1598
text \<open>The \<^emph>\<open>Sledgehammer\<close> panel (\figref{fig:sledgehammer})
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1599
  provides a view on some independent execution of the Isar command
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1600
  @{command_ref sledgehammer}, with process indicator (spinning wheel) and
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1601
  GUI elements for important Sledgehammer arguments and options.  Any
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1602
  number of Sledgehammer panels may be active, according to the
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1603
  standard policies of Dockable Window Management in jEdit.  Closing
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1604
  such windows also cancels the corresponding prover tasks.
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1605
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
  1606
  \begin{figure}[htb]
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1607
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1608
  \includegraphics[scale=0.333]{sledgehammer}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1609
  \end{center}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1610
  \caption{An instance of the Sledgehammer panel}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1611
  \label{fig:sledgehammer}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1612
  \end{figure}
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1613
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1614
  The \<^emph>\<open>Apply\<close> button attaches a fresh invocation of @{command
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1615
  sledgehammer} to the command where the cursor is pointing in the
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1616
  text --- this should be some pending proof problem.  Further buttons
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1617
  like \<^emph>\<open>Cancel\<close> and \<^emph>\<open>Locate\<close> help to manage the running
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1618
  process.
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1619
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1620
  Results appear incrementally in the output window of the panel.
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1621
  Proposed proof snippets are marked-up as \<^emph>\<open>sendback\<close>, which
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1622
  means a single mouse click inserts the text into a suitable place of
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1623
  the original source.  Some manual editing may be required
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1624
  nonetheless, say to remove earlier proof attempts.\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1625
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1626
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1627
chapter \<open>Isabelle document preparation\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1628
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1629
text \<open>The ultimate purpose of Isabelle is to produce nicely rendered documents
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1630
  with the Isabelle document preparation system, which is based on {\LaTeX};
60270
wenzelm
parents: 60264
diff changeset
  1631
  see also @{cite "isabelle-system" and "isabelle-isar-ref"}. Isabelle/jEdit
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1632
  provides some additional support for document editing.\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1633
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1634
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1635
section \<open>Document outline\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1636
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1637
text \<open>Theory sources may contain document markup commands, such as
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1638
  @{command_ref chapter}, @{command_ref section}, @{command subsection}. The
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1639
  Isabelle SideKick parser (\secref{sec:sidekick}) represents this document
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1640
  outline as structured tree view, with formal statements and proofs nested
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1641
  inside; see \figref{fig:sidekick-document}.
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1642
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1643
  \begin{figure}[htb]
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1644
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1645
  \includegraphics[scale=0.333]{sidekick-document}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1646
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1647
  \caption{Isabelle document outline via SideKick tree view}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1648
  \label{fig:sidekick-document}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1649
  \end{figure}
60264
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1650
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1651
  It is also possible to use text folding according to this structure, by
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1652
  adjusting \<^emph>\<open>Utilities / Buffer Options / Folding mode\<close> of jEdit. The
60264
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1653
  default mode @{verbatim isabelle} uses the structure of formal definitions,
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1654
  statements, and proofs. The alternative mode @{verbatim sidekick} uses the
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1655
  document structure of the SideKick parser, as explained above.\<close>
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1656
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1657
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1658
section \<open>Citations and Bib{\TeX} entries\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1659
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1660
text \<open>Citations are managed by {\LaTeX} and Bib{\TeX} in @{verbatim ".bib"}
60257
wenzelm
parents: 60256
diff changeset
  1661
  files. The Isabelle session build process and the @{tool latex} tool @{cite
60270
wenzelm
parents: 60264
diff changeset
  1662
  "isabelle-system"} are smart enough to assemble the result, based on the
60257
wenzelm
parents: 60256
diff changeset
  1663
  session directory layout.
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1664
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1665
  The document antiquotation \<open>@{cite}\<close> is described in @{cite
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1666
  "isabelle-isar-ref"}. Within the Prover IDE it provides semantic markup for
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1667
  tooltips, hyperlinks, and completion for Bib{\TeX} database entries.
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1668
  Isabelle/jEdit does \<^emph>\<open>not\<close> know about the actual Bib{\TeX} environment
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1669
  used in {\LaTeX} batch-mode, but it can take citations from those @{verbatim
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1670
  ".bib"} files that happen to be open in the editor; see
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1671
  \figref{fig:cite-completion}.
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1672
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1673
  \begin{figure}[htb]
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1674
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1675
  \includegraphics[scale=0.333]{cite-completion}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1676
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1677
  \caption{Semantic completion of citations from open Bib{\TeX} files}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1678
  \label{fig:cite-completion}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1679
  \end{figure}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1680
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1681
  Isabelle/jEdit also provides some support for editing @{verbatim ".bib"}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1682
  files themselves. There is syntax highlighting based on entry types
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1683
  (according to standard Bib{\TeX} styles), a context-menu to compose entries
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1684
  systematically, and a SideKick tree view of the overall content; see
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1685
  \figref{fig:bibtex-mode}.
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1686
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1687
  \begin{figure}[htb]
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1688
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1689
  \includegraphics[scale=0.333]{bibtex-mode}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1690
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1691
  \caption{Bib{\TeX} mode with context menu and SideKick tree view}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1692
  \label{fig:bibtex-mode}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1693
  \end{figure}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1694
\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1695
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1696
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1697
chapter \<open>Miscellaneous tools\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1698
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1699
section \<open>Timing\<close>
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1700
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1701
text \<open>Managed evaluation of commands within PIDE documents includes
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1702
  timing information, which consists of elapsed (wall-clock) time, CPU
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1703
  time, and GC (garbage collection) time.  Note that in a
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1704
  multithreaded system it is difficult to measure execution time
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1705
  precisely: elapsed time is closer to the real requirements of
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1706
  runtime resources than CPU or GC time, which are both subject to
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1707
  influences from the parallel environment that are outside the scope
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1708
  of the current command transaction.
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1709
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1710
  The \<^emph>\<open>Timing\<close> panel provides an overview of cumulative command
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1711
  timings for each document node.  Commands with elapsed time below
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1712
  the given threshold are ignored in the grand total.  Nodes are
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1713
  sorted according to their overall timing.  For the document node
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1714
  that corresponds to the current buffer, individual command timings
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1715
  are shown as well.  A double-click on a theory node or command moves
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1716
  the editor focus to that particular source position.
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1717
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1718
  It is also possible to reveal individual timing information via some
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1719
  tooltip for the corresponding command keyword, using the technique
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1720
  of mouse hovering with @{verbatim CONTROL}/@{verbatim COMMAND}
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1721
  modifier key as explained in \secref{sec:tooltips-hyperlinks}.
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1722
  Actual display of timing depends on the global option
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1723
  @{system_option_ref jedit_timing_threshold}, which can be configured in
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1724
  \<^emph>\<open>Plugin Options~/ Isabelle~/ General\<close>.
54360
9d19298d3650 more on Monitor panel;
wenzelm
parents: 54359
diff changeset
  1725
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1726
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1727
  The \<^emph>\<open>Monitor\<close> panel visualizes various data collections about
57869
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1728
  recent activity of the Isabelle/ML task farm and the underlying ML runtime
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1729
  system. The display is continuously updated according to @{system_option_ref
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1730
  editor_chart_delay}. Note that the painting of the chart takes considerable
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1731
  runtime itself --- on the Java Virtual Machine that runs Isabelle/Scala, not
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1732
  Isabelle/ML. Internally, the Isabelle/Scala module @{verbatim
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1733
  isabelle.ML_Statistics} provides further access to statistics of
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1734
  Isabelle/ML.\<close>
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1735
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1736
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1737
section \<open>Low-level output\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1738
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1739
text \<open>Prover output is normally shown directly in the main text area
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1740
  or secondary \<^emph>\<open>Output\<close> panels, as explained in
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
  1741
  \secref{sec:output}.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1742
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1743
  Beyond this, it is occasionally useful to inspect low-level output
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1744
  channels via some of the following additional panels:
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1745
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1746
  \<^item> \<^emph>\<open>Protocol\<close> shows internal messages between the
60257
wenzelm
parents: 60256
diff changeset
  1747
  Isabelle/Scala and Isabelle/ML side of the PIDE document editing protocol.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1748
  Recording of messages starts with the first activation of the
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1749
  corresponding dockable window; earlier messages are lost.
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1750
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1751
  Actual display of protocol messages causes considerable slowdown, so
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1752
  it is important to undock all \<^emph>\<open>Protocol\<close> panels for production
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1753
  work.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1754
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1755
  \<^item> \<^emph>\<open>Raw Output\<close> shows chunks of text from the @{verbatim
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1756
  stdout} and @{verbatim stderr} channels of the prover process.
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1757
  Recording of output starts with the first activation of the
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1758
  corresponding dockable window; earlier output is lost.
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1759
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1760
  The implicit stateful nature of physical I/O channels makes it
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1761
  difficult to relate raw output to the actual command from where it
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1762
  was originating.  Parallel execution may add to the confusion.
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1763
  Peeking at physical process I/O is only the last resort to diagnose
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1764
  problems with tools that are not PIDE compliant.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1765
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1766
  Under normal circumstances, prover output always works via managed message
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1767
  channels (corresponding to @{ML writeln}, @{ML warning}, @{ML
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1768
  Output.error_message} in Isabelle/ML), which are displayed by regular means
60257
wenzelm
parents: 60256
diff changeset
  1769
  within the document model (\secref{sec:output}). Unhandled Isabelle/ML
wenzelm
parents: 60256
diff changeset
  1770
  exceptions are printed by the system via @{ML Output.error_message}.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1771
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1772
  \<^item> \<^emph>\<open>Syslog\<close> shows system messages that might be relevant to diagnose
60257
wenzelm
parents: 60256
diff changeset
  1773
  problems with the startup or shutdown phase of the prover process; this also
wenzelm
parents: 60256
diff changeset
  1774
  includes raw output on @{verbatim stderr}. Isabelle/ML also provides an
wenzelm
parents: 60256
diff changeset
  1775
  explicit @{ML Output.system_message} operation, which is occasionally useful
wenzelm
parents: 60256
diff changeset
  1776
  for diagnostic purposes within the system infrastructure itself.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1777
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1778
  A limited amount of syslog messages are buffered, independently of
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1779
  the docking state of the \<^emph>\<open>Syslog\<close> panel.  This allows to
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1780
  diagnose serious problems with Isabelle/PIDE process management,
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1781
  outside of the actual protocol layer.
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1782
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1783
  Under normal situations, such low-level system output can be
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1784
  ignored.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1785
\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1786
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1787
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1788
chapter \<open>Known problems and workarounds \label{sec:problems}\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1789
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1790
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1791
  \<^item> \<^bold>\<open>Problem:\<close> Odd behavior of some diagnostic commands with
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1792
  global side-effects, like writing a physical file.
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1793
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1794
  \<^bold>\<open>Workaround:\<close> Copy/paste complete command text from
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1795
  elsewhere, or disable continuous checking temporarily.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1796
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1797
  \<^item> \<^bold>\<open>Problem:\<close> No direct support to remove document nodes from the
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1798
  collection of theories.
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1799
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1800
  \<^bold>\<open>Workaround:\<close> Clear the buffer content of unused files and close
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1801
  \<^emph>\<open>without\<close> saving changes.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1802
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1803
  \<^item> \<^bold>\<open>Problem:\<close> Keyboard shortcuts @{verbatim "C+PLUS"} and
54330
wenzelm
parents: 54329
diff changeset
  1804
  @{verbatim "C+MINUS"} for adjusting the editor font size depend on
wenzelm
parents: 54329
diff changeset
  1805
  platform details and national keyboards.
wenzelm
parents: 54329
diff changeset
  1806
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1807
  \<^bold>\<open>Workaround:\<close> Rebind keys via \<^emph>\<open>Global Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1808
  Shortcuts\<close>.
54330
wenzelm
parents: 54329
diff changeset
  1809
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1810
  \<^item> \<^bold>\<open>Problem:\<close> The Mac OS X key sequence @{verbatim
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1811
  "COMMAND+COMMA"} for application \<^emph>\<open>Preferences\<close> is in conflict with the
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1812
  jEdit default keyboard shortcut for \<^emph>\<open>Incremental Search Bar\<close> (action
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1813
  @{action_ref "quick-search"}).
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1814
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1815
  \<^bold>\<open>Workaround:\<close> Rebind key via \<^emph>\<open>Global Options~/
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1816
  Shortcuts\<close> according to national keyboard, e.g.\ @{verbatim
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1817
  "COMMAND+SLASH"} on English ones.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1818
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1819
  \<^item> \<^bold>\<open>Problem:\<close> Mac OS X system fonts sometimes lead to
54349
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1820
  character drop-outs in the main text area.
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1821
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1822
  \<^bold>\<open>Workaround:\<close> Use the default @{verbatim IsabelleText} font.
54349
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1823
  (Do not install that font on the system.)
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1824
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1825
  \<^item> \<^bold>\<open>Problem:\<close> Some Linux/X11 input methods such as IBus
54330
wenzelm
parents: 54329
diff changeset
  1826
  tend to disrupt key event handling of Java/AWT/Swing.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1827
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1828
  \<^bold>\<open>Workaround:\<close> Do not use X11 input methods. Note that environment
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1829
  variable @{verbatim XMODIFIERS} is reset by default within Isabelle
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1830
  settings.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1831
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1832
  \<^item> \<^bold>\<open>Problem:\<close> Some Linux/X11 window managers that are
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1833
  not ``re-parenting'' cause problems with additional windows opened
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1834
  by Java. This affects either historic or neo-minimalistic window
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1835
  managers like @{verbatim awesome} or @{verbatim xmonad}.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1836
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1837
  \<^bold>\<open>Workaround:\<close> Use a regular re-parenting X11 window manager.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1838
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1839
  \<^item> \<^bold>\<open>Problem:\<close> Various forks of Linux/X11 window managers and
60257
wenzelm
parents: 60256
diff changeset
  1840
  desktop environments (like Gnome) disrupt the handling of menu popups and
wenzelm
parents: 60256
diff changeset
  1841
  mouse positions of Java/AWT/Swing.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1842
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1843
  \<^bold>\<open>Workaround:\<close> Use mainstream versions of Linux desktops.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1844
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1845
  \<^item> \<^bold>\<open>Problem:\<close> Native Windows look-and-feel with global font
60293
wenzelm
parents: 60291
diff changeset
  1846
  scaling leads to bad GUI rendering of various tree views.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
  1847
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1848
  \<^bold>\<open>Workaround:\<close> Use \<^emph>\<open>Metal\<close> look-and-feel and re-adjust its
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
  1849
  primary and secondary font as explained in \secref{sec:hdpi}.
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
  1850
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1851
  \<^item> \<^bold>\<open>Problem:\<close> Full-screen mode via jEdit action @{action_ref
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1852
  "toggle-full-screen"} (default keyboard shortcut @{verbatim F11}) works on
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1853
  Windows, but not on Mac OS X or various Linux/X11 window managers.
54349
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1854
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1855
  \<^bold>\<open>Workaround:\<close> Use native full-screen control of the window
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
  1856
  manager (notably on Mac OS X).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1857
\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1858
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
  1859
end