author | wenzelm |
Mon, 09 Jun 2014 20:41:00 +0200 | |
changeset 57320 | 00f2c8d1aa0b |
parent 57319 | 3ca8216f4a96 |
child 57321 | f7e75bb411b4 |
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 |
|
57310 | 173 |
Regular jEdit options are accessible via the dialogs \emph{Utilities / |
174 |
Global Options} or \emph{Plugins / Plugin Options}, with a second chance to |
|
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 |
186 |
in Isabelle/jEdit via \emph{Plugin Options / Isabelle / General}. Moreover, |
|
187 |
there are various options for rendering of document content, which are |
|
188 |
configurable via \emph{Plugin Options / Isabelle / Rendering}. Thus |
|
189 |
\emph{Plugin Options / Isabelle} in jEdit provides a view on a subset of |
|
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 |
|
54348 | 208 |
\emph{keymap} that is configurable via \emph{Global Options / |
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 |
|
216 |
key bindings manually (see also @{file_unchecked |
|
217 |
"$ISABELLE_HOME_USER/jedit/keymaps"}). *} |
|
54321 | 218 |
|
219 |
||
57320
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
220 |
section {* Command-line invocation *} |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
221 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
222 |
text {* |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
223 |
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
|
224 |
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
|
225 |
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
|
226 |
command-line, with some extra options and environment settings as explained |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
227 |
below. The command-line usage of @{tool_def jedit} is as follows: |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
228 |
\begin{ttbox} |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
229 |
Usage: isabelle jedit [OPTIONS] [FILES ...] |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
230 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
231 |
Options are: |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
232 |
-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
|
233 |
-b build only |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
234 |
-d DIR include session directory |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
235 |
-f fresh build |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
236 |
-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
|
237 |
-l NAME logic image name (default ISABELLE_LOGIC) |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
238 |
-m MODE add print mode for output |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
239 |
-n no build of session image on startup |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
240 |
-s system build mode for session image |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
241 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
242 |
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
|
243 |
(default "\$USER_HOME/Scratch.thy"). |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
244 |
\end{ttbox} |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
245 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
246 |
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
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
251 |
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
|
252 |
@{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
|
253 |
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
|
254 |
process for the selected session image. |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
255 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
256 |
The @{verbatim "-m"} option specifies additional print modes for the |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
257 |
prover process. Note that the system option @{system_option |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
258 |
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
|
259 |
Plugin Options dialog of Isabelle/jEdit), without requiring |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
260 |
command-line invocation. |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
261 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
262 |
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
|
263 |
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
|
264 |
defaults are provided by the Isabelle settings environment |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
265 |
\cite{isabelle-sys}. |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
266 |
|
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
267 |
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
|
268 |
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
|
269 |
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
|
270 |
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
|
271 |
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
|
272 |
*} |
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 |
|
57318 | 275 |
chapter {* Augmented jEdit functionality *} |
276 |
||
277 |
section {* Look-and-feel *} |
|
54321 | 278 |
|
54330 | 279 |
text {* jEdit is a Java/AWT/Swing application with some ambition to |
54329 | 280 |
support ``native'' look-and-feel on all platforms, within the limits |
54330 | 281 |
of what Oracle as Java provider and major operating system |
282 |
distributors allow (see also \secref{sec:problems}). |
|
54321 | 283 |
|
54329 | 284 |
Isabelle/jEdit enables platform-specific look-and-feel by default as |
54330 | 285 |
follows: |
54321 | 286 |
|
287 |
\begin{description} |
|
288 |
||
289 |
\item[Linux] The platform-independent \emph{Nimbus} is used by |
|
54372 | 290 |
default. |
54321 | 291 |
|
57310 | 292 |
\emph{GTK+} works under the side-condition that the overall GTK theme is |
293 |
selected in a Swing-friendly way.\footnote{GTK support in Java/Swing was |
|
294 |
once marketed aggressively by Sun, but never quite finished. Today (2013) it |
|
295 |
is lagging behind further development of Swing and GTK. The graphics |
|
296 |
rendering performance can be worse than for other Swing look-and-feels.} |
|
54321 | 297 |
|
54381 | 298 |
\item[Windows] Regular \emph{Windows} is used by default, but |
299 |
\emph{Windows Classic} also works. |
|
54372 | 300 |
|
301 |
\item[Mac OS X] Regular \emph{Mac OS X} is used by default. |
|
302 |
||
57310 | 303 |
Moreover the bundled \emph{MacOSX} plugin provides various functions that |
304 |
are expected from applications on that particular platform: quit from menu |
|
305 |
or dock, preferences menu, drag-and-drop of text files on the application, |
|
306 |
full-screen mode for main editor windows. It is advisable to have the |
|
307 |
\emph{MacOSX} enabled all the time on that platform. |
|
54321 | 308 |
|
309 |
\end{description} |
|
310 |
||
311 |
Users may experiment with different look-and-feels, but need to keep |
|
54329 | 312 |
in mind that this extra variance of GUI functionality is unlikely to |
54372 | 313 |
work in arbitrary combinations. The platform-independent |
314 |
\emph{Nimbus} and \emph{Metal} should always work. The historic |
|
315 |
\emph{CDE/Motif} is better avoided. |
|
316 |
||
317 |
After changing the look-and-feel in \emph{Global Options / |
|
318 |
Appearance}, it is advisable to restart Isabelle/jEdit in order to |
|
319 |
take full effect. *} |
|
54321 | 320 |
|
321 |
||
57317 | 322 |
section {* Dockable windows *} |
57316 | 323 |
|
324 |
text {* |
|
325 |
In jEdit terminology, a \emph{view} is an editor window with one or more |
|
326 |
\emph{text areas} that show the content of one or more \emph{buffers}. A |
|
327 |
regular view may be surrounded by \emph{dockable windows} that show |
|
328 |
additional information in arbitrary format, not just text; a \emph{plain |
|
329 |
view} does not allow dockables. The \emph{dockable window manager} of jEdit |
|
330 |
organizes these dockable windows, either as \emph{floating} windows, or |
|
331 |
\emph{docked} panels within one of the four margins of the view. There may |
|
332 |
be any number of floating instances of some dockable window, but at most one |
|
333 |
docked instance; jEdit actions that address \emph{the} dockable window of a |
|
334 |
particular kind refer to the unique docked instance. |
|
335 |
||
336 |
Dockables are used routinely in jEdit for important functionality like |
|
337 |
\emph{HyperSearch Results} or the \emph{File System Browser}. Plugins often |
|
338 |
provide a central dockable to access their key functionality, which may be |
|
339 |
opened by the user on demand. The Isabelle/jEdit plugin takes this approach |
|
340 |
to the extreme: its main plugin menu merely provides entry-points to panels |
|
341 |
that are managed as dockable windows. Some important panels are docked by |
|
342 |
default, e.g.\ \emph{Documentation}, \emph{Output}, \emph{Query}, but the |
|
343 |
user can change this arrangement easily. |
|
344 |
||
345 |
Compared to plain jEdit, dockable window management in Isabelle/jEdit is |
|
346 |
slightly augmented according to the the following principles: |
|
347 |
||
348 |
\begin{itemize} |
|
349 |
||
350 |
\item Floating windows are dependent on the main window as \emph{dialog} in |
|
351 |
the sense of Java/AWT/Swing. Dialog windows always stay on top of the view, |
|
352 |
which is particularly important in full-screen mode. The desktop environment |
|
353 |
of the underlying platform may impose further policies on such dependent |
|
354 |
dialogs, in contrast to fully independent windows, e.g.\ some window |
|
355 |
management functions may be missing. |
|
356 |
||
357 |
\item Keyboard focus of the main view vs.\ a dockable window is carefully |
|
358 |
managed according to the intended semantics, as a panel mainly for output or |
|
359 |
input. For example, activating the \emph{Output} (\secref{sec:output}) panel |
|
360 |
via the dockable window manager returns keyboard focus to the main text |
|
361 |
area, but for \emph{Query} (\secref{sec:query}) the focus is given to the |
|
362 |
main input field of that panel. |
|
363 |
||
364 |
\item Panels that provide their own text area for output have an additional |
|
365 |
dockable menu item \emph{Detach}. This produces an independent copy of the |
|
366 |
current output as a floating \emph{Info} window, which displays that content |
|
367 |
independently of ongoing changes of the PIDE document-model. Note that |
|
368 |
Isabelle/jEdit popup windows (\secref{sec:tooltips-hyperlinks}) provide a |
|
369 |
similar \emph{Detach} operation as an icon. |
|
370 |
||
371 |
\end{itemize} |
|
372 |
*} |
|
373 |
||
374 |
||
57319 | 375 |
section {* Isabelle symbols \label{sec:symbols} *} |
376 |
||
377 |
text {* Isabelle sources consist of \emph{symbols} that extend plain |
|
378 |
ASCII to allow infinitely many mathematical symbols within the |
|
379 |
formal sources. This works without depending on particular |
|
380 |
encodings and varying Unicode standards |
|
381 |
\cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within |
|
382 |
formal sources would compromise portability and reliability in the |
|
383 |
face of changing interpretation of special features of Unicode, such |
|
384 |
as Combining Characters or Bi-directional Text.} |
|
385 |
||
386 |
For the prover back-end, formal text consists of ASCII characters |
|
387 |
that are grouped according to some simple rules, e.g.\ as plain |
|
388 |
``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''. |
|
389 |
||
390 |
For the editor front-end, a certain subset of symbols is rendered |
|
391 |
physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}'' |
|
392 |
as ``@{text "\<alpha>"}'', for example. This symbol interpretation is |
|
393 |
specified by the Isabelle system distribution in @{file |
|
394 |
"$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in |
|
395 |
@{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}. |
|
396 |
||
397 |
The appendix of \cite{isabelle-isar-ref} gives an overview of the |
|
398 |
standard interpretation of finitely many symbols from the infinite |
|
399 |
collection. Uninterpreted symbols are displayed literally, e.g.\ |
|
400 |
``@{verbatim "\<foobar>"}''. Overlap of Unicode characters used in |
|
401 |
symbol interpretation with informal ones (which might appear e.g.\ |
|
402 |
in comments) needs to be avoided! Raw Unicode characters within |
|
403 |
prover source files should be restricted to informal parts, e.g.\ to |
|
404 |
write text in non-latin alphabets in comments. |
|
405 |
||
406 |
\medskip \paragraph{Encoding.} Technically, the Unicode view on |
|
407 |
Isabelle symbols is an \emph{encoding} in jEdit (not in the |
|
408 |
underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}. It is |
|
409 |
provided by the Isabelle/jEdit plugin and enabled by default for all |
|
410 |
source files. Sometimes such defaults are reset accidentally, or |
|
411 |
malformed UTF-8 sequences in the text force jEdit to fall back on a |
|
412 |
different encoding like @{verbatim "ISO-8859-15"}. In that case, |
|
413 |
verbatim ``@{verbatim "\<alpha>"}'' will be shown in the text buffer |
|
414 |
instead of its Unicode rendering ``@{text "\<alpha>"}''. The jEdit menu |
|
415 |
operation \emph{File / Reload with Encoding / UTF-8-Isabelle} helps |
|
416 |
to resolve such problems, potentially after repairing malformed |
|
417 |
parts of the text. |
|
418 |
||
419 |
\medskip \paragraph{Font.} Correct rendering via Unicode requires a |
|
420 |
font that contains glyphs for the corresponding codepoints. Most |
|
421 |
system fonts lack that, so Isabelle/jEdit prefers its own |
|
422 |
application font @{verbatim IsabelleText}, which ensures that |
|
423 |
standard collection of Isabelle symbols are actually seen on the |
|
424 |
screen (or printer). |
|
425 |
||
426 |
Note that a Java/AWT/Swing application can load additional fonts |
|
427 |
only if they are not installed on the operating system already! |
|
428 |
Some old version of @{verbatim IsabelleText} that happens to be |
|
429 |
provided by the operating system would prevent Isabelle/jEdit to use |
|
430 |
its bundled version. This could lead to missing glyphs (black |
|
431 |
rectangles), when the system version of @{verbatim IsabelleText} is |
|
432 |
older than the application version. This problem can be avoided by |
|
433 |
refraining to ``install'' any version of @{verbatim IsabelleText} in |
|
434 |
the first place (although it is occasionally tempting to use |
|
435 |
the same font in other applications). |
|
436 |
||
437 |
\medskip \paragraph{Input methods.} In principle, Isabelle/jEdit |
|
438 |
could delegate the problem to produce Isabelle symbols in their |
|
439 |
Unicode rendering to the underlying operating system and its |
|
440 |
\emph{input methods}. Regular jEdit also provides various ways to |
|
441 |
work with \emph{abbreviations} to produce certain non-ASCII |
|
442 |
characters. Since none of these standard input methods work |
|
443 |
satisfactorily for the mathematical characters required for |
|
444 |
Isabelle, various specific Isabelle/jEdit mechanisms are provided. |
|
445 |
||
446 |
Here is a summary for practically relevant input methods for |
|
447 |
Isabelle symbols: |
|
448 |
||
449 |
\begin{enumerate} |
|
450 |
||
451 |
\item The \emph{Symbols} panel: some GUI buttons allow to insert |
|
452 |
certain symbols in the text buffer. There are also tooltips to |
|
453 |
reveal the official Isabelle representation with some additional |
|
454 |
information about \emph{symbol abbreviations} (see below). |
|
455 |
||
456 |
\item Copy / paste from decoded source files: text that is rendered |
|
457 |
as Unicode already can be re-used to produce further text. This |
|
458 |
also works between different applications, e.g.\ Isabelle/jEdit and |
|
459 |
some web browser or mail client, as long as the same Unicode view on |
|
460 |
Isabelle symbols is used. |
|
461 |
||
462 |
\item Copy / paste from prover output within Isabelle/jEdit. The |
|
463 |
same principles as for text buffers apply, but note that \emph{copy} |
|
464 |
in secondary Isabelle/jEdit windows works via the keyboard shortcut |
|
465 |
@{verbatim "C+c"}, while jEdit menu actions always refer to the |
|
466 |
primary text area! |
|
467 |
||
468 |
\item Completion provided by Isabelle plugin (see |
|
469 |
\secref{sec:completion}). Isabelle symbols have a canonical name |
|
470 |
and optional abbreviations. This can be used with the text |
|
471 |
completion mechanism of Isabelle/jEdit, to replace a prefix of the |
|
472 |
actual symbol like @{verbatim "\<lambda>"}, or its backslashed name |
|
473 |
@{verbatim "\\"}@{verbatim "lambda"}, or its ASCII abbreviation |
|
474 |
@{verbatim "%"} by the Unicode rendering. |
|
475 |
||
476 |
The following table is an extract of the information provided by the |
|
477 |
standard @{file "$ISABELLE_HOME/etc/symbols"} file: |
|
478 |
||
479 |
\medskip |
|
480 |
\begin{tabular}{lll} |
|
481 |
\textbf{symbol} & \textbf{backslashed name} & \textbf{abbreviation} \\\hline |
|
482 |
@{text "\<lambda>"} & @{verbatim "\\lambda"} & @{verbatim "%"} \\ |
|
483 |
@{text "\<Rightarrow>"} & @{verbatim "\\Rightarrow"} & @{verbatim "=>"} \\ |
|
484 |
@{text "\<Longrightarrow>"} & @{verbatim "\\Longrightarrow"} & @{verbatim "==>"} \\[0.5ex] |
|
485 |
@{text "\<And>"} & @{verbatim "\\And"} & @{verbatim "!!"} \\ |
|
486 |
@{text "\<equiv>"} & @{verbatim "\\equiv"} & @{verbatim "=="} \\[0.5ex] |
|
487 |
@{text "\<forall>"} & @{verbatim "\\forall"} & @{verbatim "!"} \\ |
|
488 |
@{text "\<exists>"} & @{verbatim "\\exists"} & @{verbatim "?"} \\ |
|
489 |
@{text "\<longrightarrow>"} & @{verbatim "\\longrightarrow"} & @{verbatim "-->"} \\ |
|
490 |
@{text "\<and>"} & @{verbatim "\\and"} & @{verbatim "&"} \\ |
|
491 |
@{text "\<or>"} & @{verbatim "\\or"} & @{verbatim "|"} \\ |
|
492 |
@{text "\<not>"} & @{verbatim "\\not"} & @{verbatim "~"} \\ |
|
493 |
@{text "\<noteq>"} & @{verbatim "\\noteq"} & @{verbatim "~="} \\ |
|
494 |
@{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\ |
|
495 |
@{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\ |
|
496 |
\end{tabular} |
|
497 |
\medskip |
|
498 |
||
499 |
Note that the above abbreviations refer to the input method. The |
|
500 |
logical notation provides ASCII alternatives that often coincide, |
|
501 |
but deviate occasionally. This occasionally causes user confusion |
|
502 |
with very old-fashioned Isabelle source that use ASCII replacement |
|
503 |
notation like @{verbatim "!"} or @{verbatim "ALL"} directly in the |
|
504 |
text. |
|
505 |
||
506 |
On the other hand, coincidence of symbol abbreviations with ASCII |
|
507 |
replacement syntax syntax helps to update old theory sources via |
|
508 |
explicit completion (see also @{verbatim "C+b"} explained in |
|
509 |
\secref{sec:completion}). |
|
510 |
||
511 |
\end{enumerate} |
|
512 |
||
513 |
\paragraph{Control symbols.} There are some special control symbols |
|
514 |
to modify the display style of a single symbol (without |
|
515 |
nesting). Control symbols may be applied to a region of selected |
|
516 |
text, either using the \emph{Symbols} panel or keyboard shortcuts or |
|
517 |
jEdit actions. These editor operations produce a separate control |
|
518 |
symbol for each symbol in the text, in order to make the whole text |
|
519 |
appear in a certain style. |
|
520 |
||
521 |
\medskip |
|
522 |
\begin{tabular}{llll} |
|
523 |
\textbf{style} & \textbf{symbol} & \textbf{shortcut} & \textbf{action} \\\hline |
|
524 |
superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{action "isabelle.control-sup"} \\ |
|
525 |
subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{action "isabelle.control-sub"} \\ |
|
526 |
bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{action "isabelle.control-bold"} \\ |
|
527 |
reset & & @{verbatim "C+e LEFT"} & @{action "isabelle.control-reset"} \\ |
|
528 |
\end{tabular} |
|
529 |
\medskip |
|
530 |
||
531 |
To produce a single control symbol, it is also possible to complete |
|
532 |
on @{verbatim "\\"}@{verbatim sup}, @{verbatim "\\"}@{verbatim sub}, |
|
533 |
@{verbatim "\\"}@{verbatim bold} as for regular symbols. *} |
|
534 |
||
535 |
||
536 |
section {* SideKick parsers \label{sec:sidekick} *} |
|
537 |
||
538 |
text {* |
|
539 |
The \emph{SideKick} plugin provides some general services to display buffer |
|
540 |
structure in a tree view. |
|
541 |
||
542 |
Isabelle/jEdit provides SideKick parsers for its main mode for |
|
543 |
theory files, as well as some minor modes for the @{verbatim NEWS} |
|
544 |
file, session @{verbatim ROOT} files, and system @{verbatim |
|
545 |
options}. |
|
546 |
||
547 |
Moreover, the special SideKick parser @{verbatim "isabelle-markup"} |
|
548 |
provides access to the full (uninterpreted) markup tree of the PIDE |
|
549 |
document model of the current buffer. This is occasionally useful |
|
550 |
for informative purposes, but the amount of displayed information |
|
551 |
might cause problems for large buffers, both for the human and the |
|
552 |
machine. |
|
553 |
*} |
|
554 |
||
555 |
||
556 |
section {* Scala console \label{sec:scala-console} *} |
|
557 |
||
558 |
text {* |
|
559 |
The \emph{Console} plugin manages various shells (command interpreters), |
|
560 |
e.g.\ \emph{BeanShell}, which is the official jEdit scripting language, and |
|
561 |
the cross-platform \emph{System} shell. Thus the console provides similar |
|
562 |
functionality than the special Emacs buffers @{verbatim "*scratch*"} and |
|
563 |
@{verbatim "*shell*"}. |
|
564 |
||
565 |
Isabelle/jEdit extends the repertoire of the console by \emph{Scala}, which |
|
566 |
is the regular Scala toplevel loop running inside the \emph{same} JVM |
|
567 |
process as Isabelle/jEdit itself. This means the Scala command interpreter |
|
568 |
has access to the JVM name space and state of the running Prover IDE |
|
569 |
application: the main entry points are @{verbatim view} (the current editor |
|
570 |
view of jEdit) and @{verbatim PIDE} (the Isabelle/jEdit plugin object). For |
|
571 |
example, the Scala expression @{verbatim "PIDE.snapshot(view)"} makes a PIDE |
|
572 |
document snapshot of the current buffer within the current editor view. |
|
573 |
||
574 |
This helps to explore Isabelle/Scala functionality interactively. Some care |
|
575 |
is required to avoid interference with the internals of the running |
|
576 |
application, especially in production use. |
|
577 |
*} |
|
578 |
||
579 |
||
57318 | 580 |
section {* File-system access *} |
581 |
||
582 |
text {* File specifications in jEdit follow various formats and |
|
583 |
conventions according to \emph{Virtual File Systems}, which may be |
|
584 |
also provided by additional plugins. This allows to access remote |
|
585 |
files via the @{verbatim "http:"} protocol prefix, for example. |
|
586 |
Isabelle/jEdit attempts to work with the file-system access model of |
|
587 |
jEdit as far as possible. In particular, theory sources are passed |
|
588 |
directly from the editor to the prover, without indirection via |
|
589 |
physical files. |
|
590 |
||
591 |
Despite the flexibility of URLs in jEdit, local files are |
|
592 |
particularly important and are accessible without protocol prefix. |
|
593 |
Here the path notation is that of the Java Virtual Machine on the |
|
594 |
underlying platform. On Windows the preferred form uses |
|
595 |
backslashes, but happens to accept forward slashes of Unix/POSIX, too. |
|
596 |
Further differences arise due to drive letters and network shares. |
|
597 |
||
598 |
The Java notation for files needs to be distinguished from the one |
|
599 |
of Isabelle, which uses POSIX notation with forward slashes on |
|
600 |
\emph{all} platforms.\footnote{Isabelle/ML on Windows uses Cygwin |
|
601 |
file-system access.} Moreover, environment variables from the |
|
602 |
Isabelle process may be used freely, e.g.\ @{file |
|
603 |
"$ISABELLE_HOME/etc/symbols"} or @{file_unchecked "$POLYML_HOME/README"}. |
|
604 |
There are special shortcuts: @{file "~"} for @{file "$USER_HOME"} |
|
605 |
and @{file "~~"} for @{file "$ISABELLE_HOME"}. |
|
606 |
||
607 |
\medskip Since jEdit happens to support environment variables within |
|
608 |
file specifications as well, it is natural to use similar notation |
|
609 |
within the editor, e.g.\ in the file-browser. This does not work in |
|
610 |
full generality, though, due to the bias of jEdit towards |
|
611 |
platform-specific notation and of Isabelle towards POSIX. Moreover, |
|
612 |
the Isabelle settings environment is not yet active when starting |
|
613 |
Isabelle/jEdit via its standard application wrapper (in contrast to |
|
614 |
@{verbatim "isabelle jedit"} run from the command line). |
|
615 |
||
616 |
For convenience, Isabelle/jEdit imitates at least @{verbatim |
|
617 |
"$ISABELLE_HOME"} and @{verbatim "$ISABELLE_HOME_USER"} within the Java |
|
618 |
process environment, in order to allow easy access to these important places |
|
619 |
from the editor. The file browser of jEdit also includes \emph{Favorites} |
|
620 |
for these two important locations. |
|
621 |
||
622 |
\medskip Path specifications in prover input or output usually include |
|
623 |
formal markup that turns it into a hyperlink (see also |
|
624 |
\secref{sec:tooltips-hyperlinks}). This allows to open the corresponding |
|
625 |
file in the text editor, independently of the path notation. |
|
626 |
||
627 |
Formally checked paths in prover input are subject to completion |
|
628 |
(\secref{sec:completion}): partial specifications are resolved via actual |
|
629 |
directory content and possible completions are offered in a popup. |
|
630 |
*} |
|
631 |
||
632 |
||
57315 | 633 |
chapter {* Prover IDE functionality *} |
634 |
||
54353 | 635 |
section {* Text buffers and theories \label{sec:buffers-theories} *} |
54322 | 636 |
|
54350 | 637 |
text {* As regular text editor, jEdit maintains a collection of open |
638 |
\emph{text buffers} to store source files; each buffer may be |
|
639 |
associated with any number of visible \emph{text areas}. Buffers |
|
640 |
are subject to an \emph{edit mode} that is determined from the file |
|
641 |
type. Files with extension \texttt{.thy} are assigned to the mode |
|
642 |
\emph{isabelle} and treated specifically. |
|
54321 | 643 |
|
54329 | 644 |
\medskip Isabelle theory files are automatically added to the formal |
57320
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
645 |
document model of Isabelle/Scala, which maintains a family of versions of |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
646 |
all sources for the prover. The \emph{Theories} panel provides an overview |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
647 |
of the status of continuous checking of theory sources. Unlike batch |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
648 |
sessions of @{tool build} \cite{isabelle-sys}, theory nodes are identified |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
649 |
by full path names; this allows to work with multiple (disjoint) Isabelle |
00f2c8d1aa0b
more on command-line invocation -- moved material from system manual;
wenzelm
parents:
57319
diff
changeset
|
650 |
sessions simultaneously within the same editor session. |
54322 | 651 |
|
54329 | 652 |
Certain events to open or update buffers with theory files cause |
57310 | 653 |
Isabelle/jEdit to resolve dependencies of \emph{theory imports}. The system |
654 |
requests to load additional files into editor buffers, in order to be |
|
655 |
included in the document model for further checking. It is also possible to |
|
656 |
resolve dependencies automatically, according to \emph{Plugin Options / |
|
657 |
Isabelle / General / Auto Load}. |
|
54321 | 658 |
|
54329 | 659 |
\medskip The open text area views on theory buffers define the |
660 |
visible \emph{perspective} of Isabelle/jEdit. This is taken as a |
|
661 |
hint for document processing: the prover ensures that those parts of |
|
662 |
a theory where the user is looking are checked, while other parts |
|
54350 | 663 |
that are presently not required are ignored. The perspective is |
54330 | 664 |
changed by opening or closing text area windows, or scrolling within |
57310 | 665 |
a window. |
54322 | 666 |
|
54330 | 667 |
The \emph{Theories} panel provides some further options to influence |
668 |
the process of continuous checking: it may be switched off globally |
|
54350 | 669 |
to restrict the prover to superficial processing of command syntax. |
670 |
It is also possible to indicate theory nodes as \emph{required} for |
|
54330 | 671 |
continuous checking: this means such nodes and all their imports are |
672 |
always processed independently of the visibility status (if |
|
673 |
continuous checking is enabled). Big theory libraries that are |
|
674 |
marked as required can have significant impact on performance, |
|
675 |
though. |
|
54322 | 676 |
|
677 |
\medskip Formal markup of checked theory content is turned into GUI |
|
57310 | 678 |
rendering, based on a standard repertoire known from IDEs for programming |
679 |
languages: colors, icons, highlighting, squiggly underline, tooltips, |
|
680 |
hyperlinks etc. For outer syntax of Isabelle/Isar there is some traditional |
|
681 |
syntax-highlighting via static keyword tables and tokenization within the |
|
682 |
editor. In contrast, the painting of inner syntax (term language etc.)\ uses |
|
683 |
semantic information that is reported dynamically from the logical context. |
|
684 |
Thus the prover can provide additional markup to help the user to understand |
|
685 |
the meaning of formal text, and to produce more text with some add-on tools |
|
686 |
(e.g.\ information messages with \emph{sendback} markup by automated provers |
|
687 |
or disprovers in the background). *} |
|
54322 | 688 |
|
54352 | 689 |
|
57316 | 690 |
section {* Output \label{sec:output} *} |
54353 | 691 |
|
692 |
text {* Prover output consists of \emph{markup} and \emph{messages}. |
|
693 |
Both are directly attached to the corresponding positions in the |
|
694 |
original source text, and visualized in the text area, e.g.\ as text |
|
695 |
colours for free and bound variables, or as squiggly underline for |
|
54357 | 696 |
warnings, errors etc.\ (see also \figref{fig:output}). In the |
697 |
latter case, the corresponding messages are shown by hovering with |
|
698 |
the mouse over the highlighted text --- although in many situations |
|
54372 | 699 |
the user should already get some clue by looking at the position of |
700 |
the text highlighting. |
|
54357 | 701 |
|
702 |
\begin{figure}[htb] |
|
703 |
\begin{center} |
|
57312 | 704 |
\includegraphics[scale=0.333]{output} |
54357 | 705 |
\end{center} |
54372 | 706 |
\caption{Multiple views on prover output: gutter area with icon, |
707 |
text area with popup, overview area, Theories panel, Output panel} |
|
54357 | 708 |
\label{fig:output} |
709 |
\end{figure} |
|
54353 | 710 |
|
711 |
The ``gutter area'' on the left-hand-side of the text area uses |
|
54372 | 712 |
icons to provide a summary of the messages within the adjacent |
54353 | 713 |
line of text. Message priorities are used to prefer errors over |
57310 | 714 |
warnings, warnings over information messages, but plain output is |
715 |
ignored. |
|
54353 | 716 |
|
57310 | 717 |
The ``overview area'' on the right-hand-side of the text area uses similar |
718 |
information to paint small rectangles for the overall status of the whole |
|
719 |
text buffer. The graphics is scaled to fit the logical buffer length into |
|
720 |
the given window height. Mouse clicks on the overview area position the |
|
721 |
cursor approximately to the corresponding line of text in the buffer. |
|
722 |
Repainting the overview in real-time causes problems with big theories, so |
|
723 |
it is restricted according to \emph{Plugin Options / Isabelle / General / |
|
54372 | 724 |
Text Overview Limit} (in characters). |
54353 | 725 |
|
726 |
Another course-grained overview is provided by the \emph{Theories} |
|
54372 | 727 |
panel, but without direct correspondence to text positions. A |
728 |
double-click on one of the theory entries with their status overview |
|
729 |
opens the corresponding text buffer, without changing the cursor |
|
730 |
position. |
|
54353 | 731 |
|
732 |
\medskip In addition, the \emph{Output} panel displays prover |
|
733 |
messages that correspond to a given command, within a separate |
|
734 |
window. |
|
735 |
||
57310 | 736 |
The cursor position in the presently active text area determines the prover |
737 |
command whose cumulative message output is appended and shown in that window |
|
738 |
(in canonical order according to the internal execution of the command). |
|
739 |
There are also control elements to modify the update policy of the output |
|
740 |
wrt.\ continued editor movements. This is particularly useful with several |
|
741 |
independent instances of the \emph{Output} panel, which the Dockable Window |
|
742 |
Manager of jEdit can handle conveniently. |
|
54353 | 743 |
|
57310 | 744 |
Former users of the old TTY interaction model (e.g.\ Proof~General) might |
745 |
find a separate window for prover messages familiar, but it is important to |
|
746 |
understand that the main Prover IDE feedback happens elsewhere. It is |
|
747 |
possible to do meaningful proof editing, while using secondary output |
|
748 |
windows only rarely. |
|
54353 | 749 |
|
750 |
The main purpose of the output window is to ``debug'' unclear |
|
751 |
situations by inspecting internal state of the prover.\footnote{In |
|
54355 | 752 |
that sense, unstructured tactic scripts depend on continuous |
54353 | 753 |
debugging with internal state inspection.} Consequently, some |
754 |
special messages for \emph{tracing} or \emph{proof state} only |
|
755 |
appear here, and are not attached to the original source. |
|
756 |
||
757 |
\medskip In any case, prover messages also contain markup that may |
|
758 |
be explored recursively via tooltips or hyperlinks (see |
|
759 |
\secref{sec:tooltips-hyperlinks}), or clicked directly to initiate |
|
54355 | 760 |
certain actions (see \secref{sec:auto-tools} and |
761 |
\secref{sec:sledgehammer}). *} |
|
54353 | 762 |
|
763 |
||
57311 | 764 |
section {* Query \label{sec:query} *} |
765 |
||
766 |
text {* |
|
767 |
The \emph{Query} panel provides various GUI forms to request extra |
|
57314 | 768 |
information from the prover In old times the user would have issued some |
769 |
diagnostic command like @{command find_theorems} and inspected its output, |
|
770 |
but this is now integrated into the Prover IDE. |
|
57311 | 771 |
|
772 |
A \emph{Query} window provides some input fields and buttons for a |
|
773 |
particular query command, with output in a dedicated text area. There are |
|
774 |
various query modes: \emph{Find Theorems}, \emph{Find Constants}, |
|
57314 | 775 |
\emph{Print Context}, e.g.\ see \figref{fig:query}. As usual in jEdit, |
776 |
multiple \emph{Query} windows may be active at the same time: any number of |
|
57313 | 777 |
floating instances, but at most one docked instance (which is used by |
778 |
default). |
|
779 |
||
780 |
\begin{figure}[htb] |
|
781 |
\begin{center} |
|
782 |
\includegraphics[scale=0.333]{query} |
|
783 |
\end{center} |
|
784 |
\caption{An instance of the Query panel} |
|
785 |
\label{fig:query} |
|
786 |
\end{figure} |
|
57311 | 787 |
|
57314 | 788 |
\medskip The following GUI elements are common to all query modes: |
57311 | 789 |
\begin{itemize} |
790 |
||
791 |
\item The spinning wheel provides feedback about the status of a pending |
|
792 |
query wrt.\ the evaluation of its context and its own operation. |
|
793 |
||
794 |
\item The \emph{Apply} button attaches a fresh query invocation to the |
|
795 |
current context of the command where the cursor is pointing in the text. |
|
796 |
||
797 |
\item The \emph{Search} field allows to highlight query output according to |
|
57313 | 798 |
some regular expression, in the notation that is commonly used on the Java |
799 |
platform. This may serve as an additional visual filter of the result. |
|
57311 | 800 |
|
801 |
\item The \emph{Zoom} box controls the font size of the output area. |
|
802 |
||
803 |
\end{itemize} |
|
804 |
||
805 |
All query operations are asynchronous: there is no need to wait for the |
|
806 |
evaluation of the document for the query context, nor for the query |
|
807 |
operation itself. Query output may be detached as independent \emph{Info} |
|
808 |
window, using a menu operation of the dockable window manager. The printed |
|
809 |
result usually provides sufficient clues about the original query, with some |
|
810 |
hyperlink to its context (via markup of its head line). |
|
811 |
*} |
|
812 |
||
813 |
||
814 |
subsection {* Find theorems *} |
|
815 |
||
816 |
text {* |
|
57313 | 817 |
The \emph{Query} panel in \emph{Find Theorems} mode retrieves facts from the |
818 |
theory or proof context matching all of given criteria in the \emph{Find} |
|
819 |
text field. A single criterium has the following syntax: |
|
57311 | 820 |
|
57313 | 821 |
@{rail \<open> |
822 |
('-'?) ('name' ':' @{syntax nameref} | 'intro' | 'elim' | 'dest' | |
|
823 |
'solves' | 'simp' ':' @{syntax term} | @{syntax term}) |
|
824 |
\<close>} |
|
825 |
||
826 |
See also the Isar command @{command find_theorems} in |
|
827 |
\cite{isabelle-isar-ref}. |
|
57311 | 828 |
*} |
829 |
||
830 |
||
831 |
subsection {* Find constants *} |
|
832 |
||
833 |
text {* |
|
57313 | 834 |
The \emph{Query} panel in \emph{Find Constants} mode prints all constants |
835 |
whose type meets all of the given criteria in the \emph{Find} text field. |
|
836 |
A single criterium has the following syntax: |
|
837 |
||
838 |
@{rail \<open> |
|
839 |
('-'?) |
|
840 |
('name' ':' @{syntax nameref} | 'strict' ':' @{syntax type} | @{syntax type}) |
|
841 |
\<close>} |
|
842 |
||
843 |
See also the Isar command @{command find_consts} in |
|
844 |
\cite{isabelle-isar-ref}. |
|
57311 | 845 |
*} |
846 |
||
847 |
||
848 |
subsection {* Print context *} |
|
849 |
||
850 |
text {* |
|
57313 | 851 |
The \emph{Query} panel in \emph{Print Context} mode prints information from |
852 |
the theory or proof context, or proof state. See also the Isar commands |
|
853 |
@{command print_context}, @{command print_cases}, @{command print_binds}, |
|
854 |
@{command print_theorems}, @{command print_state} in |
|
855 |
\cite{isabelle-isar-ref}. |
|
57311 | 856 |
*} |
857 |
||
858 |
||
54352 | 859 |
section {* Tooltips and hyperlinks \label{sec:tooltips-hyperlinks} *} |
860 |
||
57310 | 861 |
text {* |
862 |
Formally processed text (prover input or output) contains rich markup |
|
863 |
information that can be explored further by using the @{verbatim CONTROL} |
|
864 |
modifier key on Linux and Windows, or @{verbatim COMMAND} on Mac OS X. |
|
865 |
Hovering with the mouse while the modifier is pressed reveals a |
|
866 |
\emph{tooltip} (grey box over the text with a yellow popup) and/or a |
|
867 |
\emph{hyperlink} (black rectangle over the text with change of mouse |
|
868 |
pointer); see also \figref{fig:tooltip}. |
|
54331 | 869 |
|
54357 | 870 |
\begin{figure}[htb] |
54331 | 871 |
\begin{center} |
57312 | 872 |
\includegraphics[scale=0.5]{popup1} |
54331 | 873 |
\end{center} |
54356 | 874 |
\caption{Tooltip and hyperlink for some formal entity} |
54350 | 875 |
\label{fig:tooltip} |
54331 | 876 |
\end{figure} |
877 |
||
57310 | 878 |
Tooltip popups use the same rendering mechanisms as the main text |
54350 | 879 |
area, and further tooltips and/or hyperlinks may be exposed |
54357 | 880 |
recursively by the same mechanism; see \figref{fig:nested-tooltips}. |
54323 | 881 |
|
54357 | 882 |
\begin{figure}[htb] |
54331 | 883 |
\begin{center} |
57312 | 884 |
\includegraphics[scale=0.5]{popup2} |
54331 | 885 |
\end{center} |
54356 | 886 |
\caption{Nested tooltips over formal entities} |
54350 | 887 |
\label{fig:nested-tooltips} |
54331 | 888 |
\end{figure} |
54350 | 889 |
|
890 |
The tooltip popup window provides some controls to \emph{close} or |
|
891 |
\emph{detach} the window, turning it into a separate \emph{Info} |
|
54372 | 892 |
window managed by jEdit. The @{verbatim ESCAPE} key closes |
54352 | 893 |
\emph{all} popups, which is particularly relevant when nested |
894 |
tooltips are stacking up. |
|
895 |
||
57310 | 896 |
\medskip A black rectangle in the text indicates a hyperlink that may be |
897 |
followed by a mouse click (while the @{verbatim CONTROL} or @{verbatim |
|
898 |
COMMAND} modifier key is still pressed). Such jumps to other text locations |
|
899 |
are recorded by the \emph{Navigator} plugin, which is bundled with |
|
900 |
Isabelle/jEdit and enabled by default, including navigation arrows in the |
|
901 |
main jEdit toolbar. |
|
54352 | 902 |
|
903 |
Also note that the link target may be a file that is itself not |
|
904 |
subject to formal document processing of the editor session and thus |
|
905 |
prevents further exploration: the chain of hyperlinks may end in |
|
54372 | 906 |
some source file of the underlying logic image, or within the |
907 |
Isabelle/ML bootstrap sources of Isabelle/Pure. *} |
|
54321 | 908 |
|
909 |
||
54361 | 910 |
section {* Text completion \label{sec:completion} *} |
911 |
||
54362 | 912 |
text {* \paragraph{Completion tables} are determined statically from |
913 |
the ``outer syntax'' of the underlying edit mode (for theory files |
|
54372 | 914 |
this is the syntax of Isar commands), and specifications of Isabelle |
54362 | 915 |
symbols (see also \secref{sec:symbols}). |
916 |
||
917 |
Symbols are completed in backslashed forms, e.g.\ @{verbatim |
|
918 |
"\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the |
|
919 |
Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The |
|
920 |
extra backslash avoids overlap with keywords of the buffer syntax, |
|
54372 | 921 |
and allows to produce Isabelle symbols robustly in most syntactic |
54362 | 922 |
contexts.} Alternatively, symbol abbreviations may be used as |
923 |
specified in @{file "$ISABELLE_HOME/etc/symbols"}. |
|
924 |
||
925 |
\paragraph{Completion popups} are required in situations of |
|
926 |
ambiguous completion results or where explicit confirmation is |
|
927 |
demanded before inserting completed text into the buffer. |
|
928 |
||
929 |
The popup is some minimally invasive GUI component over the text |
|
930 |
area. It interprets special keys @{verbatim TAB}, @{verbatim |
|
931 |
ESCAPE}, @{verbatim UP}, @{verbatim DOWN}, @{verbatim PAGE_UP}, |
|
932 |
@{verbatim PAGE_DOWN}, but all other key events are passed to the |
|
933 |
underlying text area. This allows to ignore unwanted completions |
|
934 |
most of the time and continue typing quickly. |
|
54361 | 935 |
|
54362 | 936 |
The meaning of special keys is as follows: |
937 |
||
938 |
\medskip |
|
939 |
\begin{tabular}{ll} |
|
54372 | 940 |
\textbf{key} & \textbf{action} \\\hline |
54362 | 941 |
@{verbatim "TAB"} & select completion \\ |
942 |
@{verbatim "ESCAPE"} & dismiss popup \\ |
|
943 |
@{verbatim "UP"} & move up one item \\ |
|
944 |
@{verbatim "DOWN"} & move down one item \\ |
|
945 |
@{verbatim "PAGE_UP"} & move up one page of items \\ |
|
946 |
@{verbatim "PAGE_DOWN"} & move down one page of items \\ |
|
947 |
\end{tabular} |
|
948 |
\medskip |
|
949 |
||
950 |
Movement within the popup is only active for multiple items. |
|
951 |
Otherwise the corresponding key event retains its standard meaning |
|
952 |
within the underlying text area. |
|
953 |
||
54372 | 954 |
\paragraph{Explicit completion} is triggered by the keyboard |
56059
2390391584c2
some document antiquotations for Isabelle/jEdit elements;
wenzelm
parents:
55880
diff
changeset
|
955 |
shortcut @{verbatim "C+b"} (action @{action "isabelle.complete"}). |
54372 | 956 |
This overrides the original jEdit binding for action @{verbatim |
957 |
"complete-word"}, but the latter is used as fall-back for |
|
54362 | 958 |
non-Isabelle edit modes. It is also possible to restore the |
54372 | 959 |
original jEdit keyboard mapping of @{verbatim "complete-word"} via |
960 |
\emph{Global Options / Shortcuts}. |
|
54361 | 961 |
|
54362 | 962 |
Replacement text is inserted immediately into the buffer, unless |
963 |
ambiguous results demand an explicit popup. |
|
964 |
||
57311 | 965 |
\paragraph{Implicit completion} is triggered by regular keyboard input |
966 |
events during of the editing process in the main jEdit text area (and a few |
|
967 |
additional text fields like the ones of the the \emph{Query} panel, see |
|
968 |
\secref{sec:query}). Implicit completion depends on on further |
|
969 |
side-conditions: |
|
54362 | 970 |
|
971 |
\begin{enumerate} |
|
972 |
||
973 |
\item The system option @{system_option jedit_completion} needs to |
|
974 |
be enabled (default). |
|
975 |
||
54372 | 976 |
\item Completion of syntax keywords requires at least 3 relevant |
977 |
characters in the text. |
|
54362 | 978 |
|
54372 | 979 |
\item The system option @{system_option jedit_completion_delay} |
57310 | 980 |
determines an additional delay (0.5 by default), before opening a |
54372 | 981 |
completion popup. |
54361 | 982 |
|
54362 | 983 |
\item The system option @{system_option jedit_completion_immediate} |
984 |
(disabled by default) controls whether replacement text should be |
|
54372 | 985 |
inserted immediately without popup. This is restricted to Isabelle |
986 |
symbols and their abbreviations (\secref{sec:symbols}) --- plain |
|
987 |
keywords always demand a popup for clarity. |
|
54362 | 988 |
|
54372 | 989 |
\item Completion of symbol abbreviations with only one relevant |
990 |
character in the text always enforces an explicit popup, |
|
991 |
independently of @{system_option jedit_completion_immediate}. |
|
54362 | 992 |
|
993 |
\end{enumerate} |
|
54361 | 994 |
|
54362 | 995 |
These completion options may be configured in \emph{Plugin Options / |
996 |
Isabelle / General / Completion}. The default is quite moderate in |
|
997 |
showing occasional popups and refraining from immediate insertion. |
|
54361 | 998 |
|
54372 | 999 |
In contrast, more aggressive completion works via @{system_option |
54362 | 1000 |
jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option |
1001 |
jedit_completion_immediate}~@{verbatim "= true"}. Thus the editing |
|
54372 | 1002 |
process becomes dependent on the system guessing correctly what the |
1003 |
user had in mind. It requires some practice (and study of the |
|
1004 |
symbol abbreviation tables) to become productive in this advanced |
|
1005 |
mode. |
|
54362 | 1006 |
|
54372 | 1007 |
In any case, unintended completions can be reverted by the regular |
57310 | 1008 |
@{verbatim undo} operation of jEdit. *} |
54361 | 1009 |
|
1010 |
||
54355 | 1011 |
section {* Automatically tried tools \label{sec:auto-tools} *} |
54353 | 1012 |
|
54354 | 1013 |
text {* Continuous document processing works asynchronously in the |
1014 |
background. Visible document source that has been evaluated already |
|
1015 |
may get augmented by additional results of \emph{asynchronous print |
|
1016 |
functions}. The canonical example is proof state output, which is |
|
1017 |
always enabled. More heavy-weight print functions may be applied, |
|
1018 |
in order to prove or disprove parts of the formal text by other |
|
1019 |
means. |
|
1020 |
||
1021 |
Isabelle/HOL provides various automatically tried tools that operate |
|
1022 |
on outermost goal statements (e.g.\ @{command lemma}, @{command |
|
1023 |
theorem}), independently of the state of the current proof attempt. |
|
1024 |
They work implicitly without any arguments. Results are output as |
|
1025 |
\emph{information messages}, which are indicated in the text area by |
|
54356 | 1026 |
blue squiggles and a blue information sign in the gutter (see |
1027 |
\figref{fig:auto-tools}). The message content may be shown as for |
|
57316 | 1028 |
other output (see also \secref{sec:output}). Some tools |
54356 | 1029 |
produce output with \emph{sendback} markup, which means that |
1030 |
clicking on certain parts of the output inserts that text into the |
|
1031 |
source in the proper place. |
|
1032 |
||
54357 | 1033 |
\begin{figure}[htb] |
54356 | 1034 |
\begin{center} |
57312 | 1035 |
\includegraphics[scale=0.333]{auto-tools} |
54356 | 1036 |
\end{center} |
57312 | 1037 |
\caption{Result of automatically tried tools} |
54356 | 1038 |
\label{fig:auto-tools} |
1039 |
\end{figure} |
|
54354 | 1040 |
|
54372 | 1041 |
\medskip The following Isabelle system options control the behavior |
54354 | 1042 |
of automatically tried tools (see also the jEdit dialog window |
1043 |
\emph{Plugin Options / Isabelle / General / Automatically tried |
|
1044 |
tools}): |
|
1045 |
||
1046 |
\begin{itemize} |
|
1047 |
||
1048 |
\item @{system_option auto_methods} controls automatic use of a |
|
1049 |
combination of standard proof methods (@{method auto}, @{method |
|
54372 | 1050 |
simp}, @{method blast}, etc.). This corresponds to the Isar command |
54354 | 1051 |
@{command "try0"}. |
1052 |
||
1053 |
The tool is disabled by default, since unparameterized invocation of |
|
1054 |
standard proof methods often consumes substantial CPU resources |
|
1055 |
without leading to success. |
|
1056 |
||
1057 |
\item @{system_option auto_nitpick} controls a slightly reduced |
|
1058 |
version of @{command nitpick}, which tests for counterexamples using |
|
1059 |
first-order relational logic. See also the Nitpick manual |
|
1060 |
\cite{isabelle-nitpick}. |
|
1061 |
||
1062 |
This tool is disabled by default, due to the extra overhead of |
|
1063 |
invoking an external Java process for each attempt to disprove a |
|
1064 |
subgoal. |
|
1065 |
||
1066 |
\item @{system_option auto_quickcheck} controls automatic use of |
|
1067 |
@{command quickcheck}, which tests for counterexamples using a |
|
1068 |
series of assignments for free variables of a subgoal. |
|
1069 |
||
1070 |
This tool is \emph{enabled} by default. It requires little |
|
1071 |
overhead, but is a bit weaker than @{command nitpick}. |
|
1072 |
||
1073 |
\item @{system_option auto_sledgehammer} controls a significantly |
|
1074 |
reduced version of @{command sledgehammer}, which attempts to prove |
|
1075 |
a subgoal using external automatic provers. See also the |
|
1076 |
Sledgehammer manual \cite{isabelle-sledgehammer}. |
|
1077 |
||
1078 |
This tool is disabled by default, due to the relatively heavy nature |
|
1079 |
of Sledgehammer. |
|
1080 |
||
1081 |
\item @{system_option auto_solve_direct} controls automatic use of |
|
1082 |
@{command solve_direct}, which checks whether the current subgoals |
|
1083 |
can be solved directly by an existing theorem. This also helps to |
|
1084 |
detect duplicate lemmas. |
|
1085 |
||
1086 |
This tool is \emph{enabled} by default. |
|
1087 |
||
1088 |
\end{itemize} |
|
1089 |
||
1090 |
Invocation of automatically tried tools is subject to some global |
|
1091 |
policies of parallel execution, which may be configured as follows: |
|
1092 |
||
1093 |
\begin{itemize} |
|
1094 |
||
1095 |
\item @{system_option auto_time_limit} (default 2.0) determines the |
|
54372 | 1096 |
timeout (in seconds) for each tool execution. |
54354 | 1097 |
|
1098 |
\item @{system_option auto_time_start} (default 1.0) determines the |
|
1099 |
start delay (in seconds) for automatically tried tools, after the |
|
1100 |
main command evaluation is finished. |
|
1101 |
||
1102 |
\end{itemize} |
|
1103 |
||
1104 |
Each tool is submitted independently to the pool of parallel |
|
1105 |
execution tasks in Isabelle/ML, using hardwired priorities according |
|
1106 |
to its relative ``heaviness''. The main stages of evaluation and |
|
1107 |
printing of proof states take precedence, but an already running |
|
1108 |
tool is not canceled and may thus reduce reactivity of proof |
|
1109 |
document processing. |
|
1110 |
||
1111 |
Users should experiment how the available CPU resources (number of |
|
1112 |
cores) are best invested to get additional feedback from prover in |
|
54372 | 1113 |
the background, by using a selection of weaker or stronger tools. |
1114 |
*} |
|
54353 | 1115 |
|
1116 |
||
1117 |
section {* Sledgehammer \label{sec:sledgehammer} *} |
|
1118 |
||
54356 | 1119 |
text {* The \emph{Sledgehammer} panel (\figref{fig:sledgehammer}) |
54372 | 1120 |
provides a view on some independent execution of the Isar command |
1121 |
@{command sledgehammer}, with process indicator (spinning wheel) and |
|
1122 |
GUI elements for important Sledgehammer arguments and options. Any |
|
54356 | 1123 |
number of Sledgehammer panels may be active, according to the |
54372 | 1124 |
standard policies of Dockable Window Management in jEdit. Closing |
1125 |
such windows also cancels the corresponding prover tasks. |
|
54356 | 1126 |
|
54357 | 1127 |
\begin{figure}[htb] |
54356 | 1128 |
\begin{center} |
57312 | 1129 |
\includegraphics[scale=0.333]{sledgehammer} |
54356 | 1130 |
\end{center} |
1131 |
\caption{An instance of the Sledgehammer panel} |
|
1132 |
\label{fig:sledgehammer} |
|
1133 |
\end{figure} |
|
54355 | 1134 |
|
1135 |
The \emph{Apply} button attaches a fresh invocation of @{command |
|
1136 |
sledgehammer} to the command where the cursor is pointing in the |
|
1137 |
text --- this should be some pending proof problem. Further buttons |
|
1138 |
like \emph{Cancel} and \emph{Locate} help to manage the running |
|
1139 |
process. |
|
1140 |
||
1141 |
Results appear incrementally in the output window of the panel. |
|
54372 | 1142 |
Proposed proof snippets are marked-up as \emph{sendback}, which |
54355 | 1143 |
means a single mouse click inserts the text into a suitable place of |
1144 |
the original source. Some manual editing may be required |
|
1145 |
nonetheless, say to remove earlier proof attempts. *} |
|
54353 | 1146 |
|
1147 |
||
54358 | 1148 |
chapter {* Miscellaneous tools *} |
1149 |
||
54359 | 1150 |
section {* Timing *} |
1151 |
||
1152 |
text {* Managed evaluation of commands within PIDE documents includes |
|
1153 |
timing information, which consists of elapsed (wall-clock) time, CPU |
|
1154 |
time, and GC (garbage collection) time. Note that in a |
|
1155 |
multithreaded system it is difficult to measure execution time |
|
1156 |
precisely: elapsed time is closer to the real requirements of |
|
1157 |
runtime resources than CPU or GC time, which are both subject to |
|
1158 |
influences from the parallel environment that are outside the scope |
|
1159 |
of the current command transaction. |
|
1160 |
||
1161 |
The \emph{Timing} panel provides an overview of cumulative command |
|
1162 |
timings for each document node. Commands with elapsed time below |
|
1163 |
the given threshold are ignored in the grand total. Nodes are |
|
1164 |
sorted according to their overall timing. For the document node |
|
1165 |
that corresponds to the current buffer, individual command timings |
|
1166 |
are shown as well. A double-click on a theory node or command moves |
|
1167 |
the editor focus to that particular source position. |
|
1168 |
||
1169 |
It is also possible to reveal individual timing information via some |
|
1170 |
tooltip for the corresponding command keyword, using the technique |
|
1171 |
of mouse hovering with @{verbatim CONTROL}/@{verbatim COMMAND} |
|
1172 |
modifier key as explained in \secref{sec:tooltips-hyperlinks}. |
|
1173 |
Actual display of timing depends on the global option |
|
1174 |
@{system_option jedit_timing_threshold}, which can be configured in |
|
54360 | 1175 |
"Plugin Options / Isabelle / General". |
1176 |
||
1177 |
\medskip The \emph{Monitor} panel provides a general impression of |
|
1178 |
recent activity of the farm of worker threads in Isabelle/ML. Its |
|
1179 |
display is continuously updated according to @{system_option |
|
1180 |
editor_chart_delay}. Note that the painting of the chart takes |
|
1181 |
considerable runtime itself --- on the Java Virtual Machine that |
|
1182 |
runs Isabelle/Scala, not Isabelle/ML. Internally, the |
|
1183 |
Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides |
|
54372 | 1184 |
further access to statistics of Isabelle/ML. *} |
54359 | 1185 |
|
1186 |
||
54358 | 1187 |
section {* Low-level output *} |
1188 |
||
1189 |
text {* Prover output is normally shown directly in the main text area |
|
54372 | 1190 |
or secondary \emph{Output} panels, as explained in |
57316 | 1191 |
\secref{sec:output}. |
54358 | 1192 |
|
1193 |
Beyond this, it is occasionally useful to inspect low-level output |
|
1194 |
channels via some of the following additional panels: |
|
1195 |
||
1196 |
\begin{itemize} |
|
1197 |
||
1198 |
\item \emph{Protocol} shows internal messages between the |
|
1199 |
Isabelle/Scala and Isabelle/ML side of the PIDE editing protocol. |
|
1200 |
Recording of messages starts with the first activation of the |
|
1201 |
corresponding dockable window; earlier messages are lost. |
|
1202 |
||
1203 |
Actual display of protocol messages causes considerable slowdown, so |
|
54372 | 1204 |
it is important to undock all \emph{Protocol} panels for production |
1205 |
work. |
|
54358 | 1206 |
|
1207 |
\item \emph{Raw Output} shows chunks of text from the @{verbatim |
|
1208 |
stdout} and @{verbatim stderr} channels of the prover process. |
|
1209 |
Recording of output starts with the first activation of the |
|
1210 |
corresponding dockable window; earlier output is lost. |
|
1211 |
||
1212 |
The implicit stateful nature of physical I/O channels makes it |
|
1213 |
difficult to relate raw output to the actual command from where it |
|
1214 |
was originating. Parallel execution may add to the confusion. |
|
1215 |
Peeking at physical process I/O is only the last resort to diagnose |
|
57310 | 1216 |
problems with tools that are not PIDE compliant. |
54358 | 1217 |
|
57310 | 1218 |
Under normal circumstances, prover output always works via managed message |
1219 |
channels (corresponding to @{ML writeln}, @{ML warning}, @{ML |
|
1220 |
Output.error_message} etc.\ in Isabelle/ML), which are displayed by regular |
|
57316 | 1221 |
means within the document model (\secref{sec:output}). |
54358 | 1222 |
|
1223 |
\item \emph{Syslog} shows system messages that might be relevant to |
|
1224 |
diagnose problems with the startup or shutdown phase of the prover |
|
1225 |
process; this also includes raw output on @{verbatim stderr}. |
|
1226 |
||
1227 |
A limited amount of syslog messages are buffered, independently of |
|
1228 |
the docking state of the \emph{Syslog} panel. This allows to |
|
1229 |
diagnose serious problems with Isabelle/PIDE process management, |
|
1230 |
outside of the actual protocol layer. |
|
1231 |
||
1232 |
Under normal situations, such low-level system output can be |
|
1233 |
ignored. |
|
1234 |
||
1235 |
\end{itemize} |
|
1236 |
*} |
|
1237 |
||
1238 |
||
54329 | 1239 |
chapter {* Known problems and workarounds \label{sec:problems} *} |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1240 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1241 |
text {* |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1242 |
\begin{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1243 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1244 |
\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
|
1245 |
global side-effects, like writing a physical file. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1246 |
|
54372 | 1247 |
\textbf{Workaround:} Copy / paste complete command text from |
57310 | 1248 |
elsewhere, or disable continuous checking temporarily. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1249 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1250 |
\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
|
1251 |
collection of theories. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1252 |
|
54329 | 1253 |
\textbf{Workaround:} Ignore unused files. Restart whole |
1254 |
Isabelle/jEdit session in worst-case situation. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1255 |
|
54330 | 1256 |
\item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and |
1257 |
@{verbatim "C+MINUS"} for adjusting the editor font size depend on |
|
1258 |
platform details and national keyboards. |
|
1259 |
||
54372 | 1260 |
\textbf{Workaround:} Rebind keys via \emph{Global Options / |
1261 |
Shortcuts}. |
|
54330 | 1262 |
|
53886
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
1263 |
\item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim |
54349 | 1264 |
"COMMAND+COMMA"} for application \emph{Preferences} is in conflict |
1265 |
with the jEdit default shortcut for \emph{Incremental Search Bar} |
|
1266 |
(action @{verbatim "quick-search"}). |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1267 |
|
54372 | 1268 |
\textbf{Workaround:} Rebind key via \emph{Global Options / |
1269 |
Shortcuts} according to national keyboard, e.g.\ @{verbatim |
|
1270 |
"COMMAND+SLASH"} on English ones. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1271 |
|
54349 | 1272 |
\item \textbf{Problem:} Mac OS X system fonts sometimes lead to |
1273 |
character drop-outs in the main text area. |
|
1274 |
||
1275 |
\textbf{Workaround:} Use the default @{verbatim IsabelleText} font. |
|
1276 |
(Do not install that font on the system.) |
|
1277 |
||
54329 | 1278 |
\item \textbf{Problem:} Some Linux / X11 input methods such as IBus |
54330 | 1279 |
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
|
1280 |
|
54329 | 1281 |
\textbf{Workaround:} Do not use input methods, reset the environment |
1282 |
variable @{verbatim XMODIFIERS} within Isabelle settings (default in |
|
54639 | 1283 |
Isabelle2013-2). |
54329 | 1284 |
|
1285 |
\item \textbf{Problem:} Some Linux / X11 window managers that are |
|
1286 |
not ``re-parenting'' cause problems with additional windows opened |
|
54331 | 1287 |
by Java. This affects either historic or neo-minimalistic window |
1288 |
managers like @{verbatim awesome} or @{verbatim xmonad}. |
|
54329 | 1289 |
|
57310 | 1290 |
\textbf{Workaround:} Use a regular re-parenting window manager. |
54329 | 1291 |
|
1292 |
\item \textbf{Problem:} Recent forks of Linux / X11 window managers |
|
1293 |
and desktop environments (variants of Gnome) disrupt the handling of |
|
1294 |
menu popups and mouse positions of Java/AWT/Swing. |
|
1295 |
||
1296 |
\textbf{Workaround:} Use mainstream versions of Linux desktops. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1297 |
|
54349 | 1298 |
\item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim |
1299 |
"toggle-full-screen"} (default shortcut @{verbatim F11}) works on |
|
1300 |
Windows, but not on Mac OS X or various Linux / X11 window managers. |
|
1301 |
||
1302 |
\textbf{Workaround:} Use native full-screen control of the window |
|
54372 | 1303 |
manager (notably on Mac OS X). |
54349 | 1304 |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1305 |
\end{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1306 |
*} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
1307 |
|
53769 | 1308 |
end |