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