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