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