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