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