author | wenzelm |
Tue, 29 Oct 2013 19:45:55 +0100 | |
changeset 54349 | fd5ddf2bce76 |
parent 54348 | 923690bfb818 |
child 54350 | b0cdb4b10d20 |
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 |
|
54329 | 22 |
\item [PIDE] is a general framework for Prover IDEs based on |
23 |
Isabelle/Scala. It is built around a concept of parallel and |
|
24 |
asynchronous document processing, which is supported natively by the |
|
25 |
parallel proof engine that is implemented in Isabelle/ML. The prover |
|
26 |
discontinues the traditional TTY-based command loop, and supports |
|
27 |
direct editing of formal source text with rich formal markup for GUI |
|
28 |
rendering. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
29 |
|
54321 | 30 |
\item [Isabelle/ML] is the implementation and extension language of |
31 |
Isabelle, see also \cite{isabelle-implementation}. It is integrated |
|
54329 | 32 |
into the logical context of Isabelle/Isar and allows to manipulate |
33 |
logical entities directly. Arbitrary add-on tools may be implemented |
|
34 |
for object-logics such as Isabelle/HOL. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
35 |
|
54321 | 36 |
\item [Isabelle/Scala] is the system programming language of |
37 |
Isabelle. It extends the pure logical environment of Isabelle/ML |
|
38 |
towards the ``real world'' of graphical user interfaces, text |
|
39 |
editors, IDE frameworks, web services etc. Special infrastructure |
|
54348 | 40 |
allows to transfer algebraic datatype values and formatted text |
54329 | 41 |
easily between ML and Scala, using asynchronous protocol commands. |
54321 | 42 |
|
54329 | 43 |
\item [jEdit] is a sophisticated text editor implemented in |
44 |
Java.\footnote{\url{http://www.jedit.org}} It is easily extensible |
|
45 |
by plugins written in languages that work on the JVM, e.g.\ |
|
46 |
Scala\footnote{\url{http://www.scala-lang.org/}}. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
47 |
|
54321 | 48 |
\item [Isabelle/jEdit] is the main example application of the PIDE |
54329 | 49 |
framework and the default user-interface for Isabelle. It targets |
50 |
both beginners and experts. Technically, Isabelle/jEdit combines a |
|
51 |
slightly modified version of the official jEdit code base with a |
|
52 |
special plugin for Isabelle, integrated as standalone application |
|
53 |
for the 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
|
54 |
|
54321 | 55 |
\end{description} |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
56 |
|
54321 | 57 |
The subtle differences of Isabelle/ML versus Standard ML, |
54330 | 58 |
Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be |
59 |
taken into account when discussing any of these PIDE building blocks |
|
60 |
in public forums, mailing lists, or even scientific publications. |
|
61 |
*} |
|
53770
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 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
64 |
section {* The Isabelle/jEdit Prover IDE *} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
65 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
66 |
text {* |
54331 | 67 |
\begin{figure}[htbp] |
68 |
\begin{center} |
|
53773 | 69 |
\includegraphics[width=\textwidth]{isabelle-jedit} |
54331 | 70 |
\end{center} |
71 |
\caption{The Isabelle/jEdit Prover IDE} |
|
72 |
\end{figure} |
|
53773 | 73 |
|
54321 | 74 |
Isabelle/jEdit consists of some plugins for the well-known jEdit |
75 |
text editor \url{http://www.jedit.org}, according to the following |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
76 |
principles. |
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 |
54321 | 90 |
semantic markup produced by Isabelle 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 |
||
122 |
text {* Regular jEdit documentation is accessible via its @{verbatim |
|
123 |
Help} menu or @{verbatim F1} keyboard shortcut. This includes a full |
|
124 |
\emph{User's Guide} and \emph{Frequently Asked Questions} for this |
|
125 |
sophisticated text editor. |
|
126 |
||
54329 | 127 |
Most of this information about jEdit is relevant for Isabelle/jEdit |
128 |
as well, but one needs to keep in mind that defaults sometimes |
|
129 |
differ, and the official jEdit documentation does not know about the |
|
130 |
Isabelle plugin with its special support for theory editing. |
|
54321 | 131 |
*} |
132 |
||
133 |
||
134 |
subsection {* Plugins *} |
|
135 |
||
136 |
text {* The \emph{Plugin Manager} of jEdit allows to augment editor |
|
137 |
functionality by JVM modules (jars) that are provided by the central |
|
54348 | 138 |
plugin repository, which is accessible by various mirror sites. |
54321 | 139 |
|
140 |
Connecting to the plugin server infrastructure of the jEdit project |
|
54348 | 141 |
allows to update bundled plugins or to add further functionality. |
142 |
This needs to be done with the usual care for such an open bazaar of |
|
143 |
contributions. Arbitrary combinations of add-on features are apt to |
|
144 |
cause problems. It is advisable to start with the default |
|
145 |
configuration of Isabelle/jEdit and develop some understanding how |
|
146 |
it is supposed to work, before loading additional plugins at a grand |
|
147 |
scale. |
|
54321 | 148 |
|
54348 | 149 |
\medskip The main \emph{Isabelle} plugin is an integral part of |
150 |
Isabelle/jEdit and needs to remain active at all times! A few |
|
151 |
additional plugins are bundled with Isabelle/jEdit for convenience |
|
152 |
or out of necessity, notably \emph{Console} with its Isabelle/Scala |
|
153 |
sub-plugin and \emph{SideKick} with some Isabelle-specific parsers |
|
154 |
for document tree structure. The \emph{ErrorList} plugin is |
|
155 |
required by \emph{SideKick}, but not used specifically in |
|
156 |
Isabelle/jEdit. *} |
|
54321 | 157 |
|
158 |
||
159 |
subsection {* Options *} |
|
160 |
||
54329 | 161 |
text {* Both jEdit and Isabelle have distinctive management of |
54348 | 162 |
persistent options. |
54321 | 163 |
|
54348 | 164 |
Regular jEdit options are accessible via the dialogs for |
165 |
\emph{Global Options} and \emph{Plugin Options}. Changed properties |
|
166 |
are stored eventually in @{verbatim |
|
167 |
"$ISABELLE_HOME_USER/jedit/properties"}. In contrast, Isabelle |
|
168 |
system options are managed by Isabelle/Scala and changes stored in |
|
169 |
@{verbatim "$ISABELLE_HOME_USER/etc/preferences"}, independently of |
|
170 |
the jEdit properties. See also \cite{isabelle-sys}, especially the |
|
171 |
coverage of sessions and command-line tools like @{tool build} or |
|
172 |
@{tool options}. |
|
54321 | 173 |
|
54348 | 174 |
Those Isabelle options that are declared as \textbf{public} are |
175 |
configurable in jEdit via \emph{Plugin Options / Isabelle / |
|
176 |
General}. Moreover, there are various options for rendering of |
|
177 |
document content, which are configurable via \emph{Plugin Options / |
|
178 |
Isabelle / Rendering}. Thus \emph{Plugin Options / Isabelle} in |
|
179 |
jEdit provides a view on certain Isabelle options. Note that some |
|
180 |
of these options affect general parameters that are relevant outside |
|
181 |
Isabelle/jEdit as well, e.g.\ @{system_option threads} or |
|
54321 | 182 |
@{system_option parallel_proofs} for the Isabelle build tool |
183 |
\cite{isabelle-sys}. |
|
54329 | 184 |
|
54348 | 185 |
\medskip All options are loaded on startup and saved on shutdown of |
54329 | 186 |
Isabelle/jEdit. Editing the machine-generated files @{verbatim |
187 |
"$ISABELLE_HOME_USER/jedit/properties"} or @{verbatim |
|
188 |
"$ISABELLE_HOME_USER/etc/preferences"} manually while the |
|
54348 | 189 |
application is running is likely to cause surprise due to lost |
190 |
update! *} |
|
54321 | 191 |
|
192 |
||
193 |
subsection {* Keymaps *} |
|
194 |
||
195 |
text {* Keyboard shortcuts used to be managed as jEdit properties in |
|
196 |
the past, but recent versions (2013) have a separate concept of |
|
54348 | 197 |
\emph{keymap} that is configurable via \emph{Global Options / |
198 |
Shortcuts}. The @{verbatim imported} keymap is derived from the |
|
54330 | 199 |
initial environment of properties that is available at the first |
54348 | 200 |
start of the editor; afterwards the keymap file takes precedence. |
54321 | 201 |
|
202 |
This is relevant for Isabelle/jEdit due to various fine-tuning of |
|
203 |
default properties, and additional keyboard shortcuts for Isabelle |
|
54348 | 204 |
specific functionality. Users may change their keymap, but need to |
205 |
copy Isabelle-specific key bindings manually. *} |
|
54321 | 206 |
|
207 |
||
54322 | 208 |
subsection {* Look-and-feel *} |
54321 | 209 |
|
54330 | 210 |
text {* jEdit is a Java/AWT/Swing application with some ambition to |
54329 | 211 |
support ``native'' look-and-feel on all platforms, within the limits |
54330 | 212 |
of what Oracle as Java provider and major operating system |
213 |
distributors allow (see also \secref{sec:problems}). |
|
54321 | 214 |
|
54329 | 215 |
Isabelle/jEdit enables platform-specific look-and-feel by default as |
54330 | 216 |
follows: |
54321 | 217 |
|
218 |
\begin{description} |
|
219 |
||
220 |
\item[Linux] The platform-independent \emph{Nimbus} is used by |
|
54322 | 221 |
default, but the classic \emph{Metal} also works. \emph{GTK+} works |
222 |
under the side-condition that the overall GTK theme is selected in a |
|
54348 | 223 |
Swing-friendly way.\footnote{GTK support in Java/Swing was once |
224 |
marketed aggressively by Sun, but never quite finished, and is today |
|
225 |
(2013) lagging a bit behind further development of Swing and GTK.} |
|
54321 | 226 |
|
227 |
\item[Windows] Regular \emph{Windows} is used by default, but |
|
228 |
platform-independent \emph{Nimbus} and \emph{Metal} also work. |
|
229 |
||
54348 | 230 |
\item[Mac OS X] Regular \emph{Mac OS X} is used by default, but |
231 |
platform-independent \emph{Nimbus} and \emph{Metal} also work. |
|
54321 | 232 |
Moreover the bundled \emph{MacOSX} plugin provides various functions |
233 |
that are expected from applications on that particular platform: |
|
234 |
quit from menu or dock, preferences menu, drag-and-drop of text |
|
235 |
files on the application, full-screen mode for main editor windows |
|
236 |
etc. |
|
237 |
||
238 |
\end{description} |
|
239 |
||
240 |
Users may experiment with different look-and-feels, but need to keep |
|
54329 | 241 |
in mind that this extra variance of GUI functionality is unlikely to |
54348 | 242 |
work in arbitrary combinations. The historic \emph{CDE/Motif} is |
243 |
better avoided. After changing the look-and-feel in \emph{Global |
|
244 |
Options / Appearance}, it is advisable to restart Isabelle/jEdit in |
|
245 |
order to take full effect. *} |
|
54321 | 246 |
|
247 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
248 |
chapter {* Prover IDE functionality *} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
249 |
|
54322 | 250 |
section {* Buffers and theories *} |
251 |
||
252 |
text {* jEdit maintains a collection of open \emph{text buffers} to |
|
253 |
store source files. Each buffer may be associated with any number |
|
54330 | 254 |
of visible \emph{text areas}. Buffers are subject to an \emph{edit |
255 |
mode} that is determined from the file type. Files with extension |
|
256 |
\texttt{.thy} are assigned to the mode \emph{isabelle} and treated |
|
257 |
specifically. |
|
54321 | 258 |
|
54329 | 259 |
\medskip Isabelle theory files are automatically added to the formal |
260 |
document model of Isabelle/Scala, which maintains a family of |
|
261 |
versions of all sources for the prover. The \emph{Theories} panel |
|
54322 | 262 |
provides an overview of the status of continuous checking of theory |
54329 | 263 |
sources. Unlike batch sessions \cite{isabelle-sys}, theory nodes |
264 |
are identified by full path names; this allows to work with multiple |
|
265 |
(disjoint) Isabelle sessions simultaneously within the same editor |
|
266 |
session. |
|
54322 | 267 |
|
54329 | 268 |
Certain events to open or update buffers with theory files cause |
269 |
Isabelle/jEdit to resolve dependencies of \emph{theory imports}. |
|
54330 | 270 |
The system requests to load further files into editor buffers, in |
271 |
order to be added to the theory document model for further checking. |
|
272 |
It is also possible to resolve dependencies automatically, depending |
|
273 |
on the option @{system_option jedit_auto_load}. |
|
54321 | 274 |
|
54329 | 275 |
\medskip The open text area views on theory buffers define the |
276 |
visible \emph{perspective} of Isabelle/jEdit. This is taken as a |
|
277 |
hint for document processing: the prover ensures that those parts of |
|
278 |
a theory where the user is looking are checked, while other parts |
|
54330 | 279 |
that are presently not required are ignored. The perspective can be |
280 |
changed by opening or closing text area windows, or scrolling within |
|
281 |
some window. |
|
54322 | 282 |
|
54330 | 283 |
The \emph{Theories} panel provides some further options to influence |
284 |
the process of continuous checking: it may be switched off globally |
|
285 |
to perform superficial processing of command syntax only. It is |
|
286 |
also possible to indicate theory nodes as \emph{required} for |
|
287 |
continuous checking: this means such nodes and all their imports are |
|
288 |
always processed independently of the visibility status (if |
|
289 |
continuous checking is enabled). Big theory libraries that are |
|
290 |
marked as required can have significant impact on performance, |
|
291 |
though. |
|
54322 | 292 |
|
293 |
\medskip Formal markup of checked theory content is turned into GUI |
|
294 |
rendering, based on a standard repertoire known from IDEs for |
|
295 |
programming languages: colors, icons, highlighting, squiggly |
|
54329 | 296 |
underline, tooltips, hyperlinks etc. For outer syntax of |
297 |
Isabelle/Isar there is some traditional syntax-highlighting, based |
|
298 |
on static keyword tables and tokenization within the editor. In |
|
299 |
contrast, the painting of inner syntax (term language etc.) is |
|
300 |
based on semantic information that is reported dynamically from the |
|
301 |
logical context. Thus the prover can provide additional markup to |
|
302 |
help the user understanding the meaning of the text, and to produce |
|
303 |
more text with some add-on tools (e.g.\ information messages by |
|
304 |
automated provers or disprovers running in the background). |
|
54322 | 305 |
|
306 |
Such formally annotated text can be explored further by using the |
|
54329 | 307 |
@{verbatim CONTROL} modifier key on Linux and Windows, or @{verbatim |
54322 | 308 |
COMMAND} on Mac OS X. Hovering with the mouse while the modifier is |
309 |
pressed reveals \emph{tooltips} (grey box within the text with a |
|
310 |
yellow popup) and/or \emph{hyperlinks} (dark grey rectangle within |
|
54331 | 311 |
the text). |
312 |
||
313 |
\begin{figure}[htbp] |
|
314 |
\begin{center} |
|
315 |
\includegraphics[scale=0.3]{popup1} |
|
316 |
\end{center} |
|
317 |
\caption{Hyperlink and tooltip for some formal entity.} |
|
318 |
\end{figure} |
|
319 |
||
320 |
Tooltip popups use the same rendering principles as the |
|
54322 | 321 |
main text area, and further tooltips and/or hyperlinks may be |
322 |
exposed recursively by the same mechanism. |
|
54323 | 323 |
|
54331 | 324 |
\begin{figure}[htbp] |
325 |
\begin{center} |
|
326 |
\includegraphics[scale=0.3]{popup2} |
|
327 |
\end{center} |
|
328 |
\caption{Nested tooltips over formal entities.} |
|
329 |
\end{figure} |
|
54322 | 330 |
*} |
54321 | 331 |
|
332 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
333 |
section {* Isabelle symbols and fonts *} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
334 |
|
54323 | 335 |
text {* Isabelle sources consist of \emph{symbols} that extend plain |
54330 | 336 |
ASCII to allow infinitely many mathematical symbols within the |
337 |
formal sources. This works without depending on particular |
|
338 |
encodings or varying Unicode standards \cite{Wenzel:2011:CICM}. |
|
54323 | 339 |
|
340 |
For the prover back-end, formal text consists of ASCII characters |
|
341 |
that are grouped according to some simple rules, e.g.\ as plain |
|
342 |
``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''. |
|
343 |
||
54329 | 344 |
For the editor front-end, a certain subset of symbols is rendered as |
54330 | 345 |
Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}'' as ``@{text |
346 |
"\<alpha>"}'', for example. This symbol interpretation is specified by the |
|
347 |
Isabelle system distribution (@{file "$ISABELLE_HOME/etc/symbols"}) |
|
348 |
or by the user (@{verbatim "$ISABELLE_HOME_USER/etc/symbols"}). |
|
54323 | 349 |
|
54329 | 350 |
The appendix of \cite{isabelle-isar-ref} gives an overview of the |
351 |
standard interpretation of finitely many symbols from the infinite |
|
54330 | 352 |
collection. Uninterpreted symbols are shown literally, e.g.\ |
353 |
``@{verbatim "\<foobar>"}''. |
|
54323 | 354 |
|
355 |
\medskip Technically, the Unicode view on Isabelle symbols is an |
|
356 |
\emph{encoding} in Isabelle/jEdit, which is called @{verbatim |
|
357 |
"UTF-8-Isabelle"} and enabled by default. Sometimes such defaults |
|
358 |
are reset accidentally, or malformed UTF-8 sequences in the text |
|
359 |
force jEdit to fall back on a different encoding like @{verbatim |
|
54330 | 360 |
"ISO-8859-15"}. In that case, verbatim ``@{verbatim "\<alpha>"}'' will be |
361 |
shown in the text buffer instead of its Unicode rendering ``@{text |
|
362 |
"\<alpha>"}''. The jEdit menu operation \emph{File / Reload with Encoding |
|
363 |
/ UTF-8-Isabelle} helps to resolve such problems, potentially after |
|
54323 | 364 |
repairing malformed parts of the text. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
365 |
|
54329 | 366 |
\medskip Correct rendering via Unicode requires a font that contains |
367 |
glyphs for the corresponding codepoints. Most system fonts lack |
|
368 |
that, so Isabelle/jEdit prefers its own application font @{verbatim |
|
54330 | 369 |
IsabelleText}, which ensures that standard collection of Isabelle |
370 |
symbols are actually seen on the screen (or printer). |
|
54329 | 371 |
|
54330 | 372 |
Note that a Java/AWT/Swing application can load additional fonts |
373 |
only if they are not installed as system font already! This means |
|
374 |
some old version of @{verbatim IsabelleText} that happens to be |
|
375 |
already present prevents Isabelle/jEdit from using its current |
|
376 |
bundled version. This might result in missing glyphs (black |
|
377 |
rectangles), since obsolete versions of @{verbatim IsabelleText} |
|
378 |
lack recent improvements of Unicode glyph coverage. This problem |
|
379 |
can be avoided by refraining to ``install'' any version of |
|
380 |
@{verbatim IsabelleText} in the first place. |
|
54329 | 381 |
|
54323 | 382 |
\medskip \paragraph{Input methods.} In principle, Isabelle/jEdit |
383 |
could delegate the problem to produce Isabelle symbols in their |
|
384 |
Unicode rendering to the underlying operating system and its |
|
54329 | 385 |
\emph{input methods}. Regular jEdit also provides various ways to |
386 |
work with \emph{abbreviations} to produce certain non-ASCII |
|
387 |
characters. Since none of these standard input methods work |
|
388 |
satisfactorily for the mathematical characters required for |
|
389 |
Isabelle, various specific Isabelle/jEdit mechanisms are provided. |
|
54323 | 390 |
|
54329 | 391 |
Here is a summary for practically relevant input methods for |
54330 | 392 |
Isabelle symbols: |
54323 | 393 |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
394 |
\begin{enumerate} |
54323 | 395 |
|
54330 | 396 |
\item The \emph{Symbols} panel with some GUI buttons to insert |
54323 | 397 |
certain symbols in the text buffer. There are also tooltips to |
398 |
reveal to official Isabelle representation with some additional |
|
399 |
information about \emph{symbol abbreviations} (see below). |
|
400 |
||
401 |
\item Copy / paste from decoded source files: text that is rendered |
|
54330 | 402 |
as Unicode already can be re-used to produce further such text. |
54323 | 403 |
This also works between different applications, e.g.\ Isabelle/jEdit |
54329 | 404 |
and some web browser or mail client, as long as the same Unicode |
405 |
view on Isabelle symbols is used uniformly. |
|
54323 | 406 |
|
54329 | 407 |
\item Copy / paste from prover output within Isabelle/jEdit. The |
408 |
same principles as for text buffers apply, but note that \emph{copy} |
|
409 |
in Isabelle \emph{Output} works via the keyboard shortcut @{verbatim |
|
54330 | 410 |
"C+c"}, not jEdit menu actions. |
54323 | 411 |
|
412 |
\item Completion provided by Isabelle plugin (see |
|
413 |
\secref{sec:completion}). Isabelle symbols have a canonical name |
|
414 |
and optional abbreviations. This can be used with the text |
|
415 |
completion mechanism of Isabelle/jEdit, to replace a prefix of the |
|
54329 | 416 |
actual symbol like @{verbatim "\<lambda>"}, or its backslashed name |
417 |
@{verbatim "\\"}@{verbatim "lambda"}, or its ASCII abbreviation |
|
54330 | 418 |
@{verbatim "%"} by the Unicode rendering. |
54323 | 419 |
|
420 |
The following table is an extract of the information provided by the |
|
54329 | 421 |
standard @{file "$ISABELLE_HOME/etc/symbols"} file: |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
422 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
423 |
\medskip |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
424 |
\begin{tabular}{lll} |
54329 | 425 |
\textbf{symbol} & \textbf{abbreviation} & \textbf{backslashed name} \\\hline |
53771 | 426 |
@{text "\<lambda>"} & @{verbatim "%"} & @{verbatim "\\lambda"} \\ |
427 |
@{text "\<Rightarrow>"} & @{verbatim "=>"} & @{verbatim "\\Rightarrow"} \\ |
|
428 |
@{text "\<Longrightarrow>"} & @{verbatim "==>"} & @{verbatim "\\Longrightarrow"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
429 |
|
53771 | 430 |
@{text "\<And>"} & @{verbatim "!!"} & @{verbatim "\\And"} \\ |
431 |
@{text "\<equiv>"} & @{verbatim "=="} & @{verbatim "\\equiv"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
432 |
|
53771 | 433 |
@{text "\<forall>"} & @{verbatim "!"} & @{verbatim "\\forall"} \\ |
434 |
@{text "\<exists>"} & @{verbatim "?"} & @{verbatim "\\exists"} \\ |
|
435 |
@{text "\<longrightarrow>"} & @{verbatim "-->"} & @{verbatim "\\longrightarrow"} \\ |
|
436 |
@{text "\<and>"} & @{verbatim "&"} & @{verbatim "\\and"} \\ |
|
437 |
@{text "\<or>"} & @{verbatim "|"} & @{verbatim "\\or"} \\ |
|
438 |
@{text "\<not>"} & @{verbatim "~"} & @{verbatim "\\not"} \\ |
|
439 |
@{text "\<noteq>"} & @{verbatim "~="} & @{verbatim "\\noteq"} \\ |
|
440 |
@{text "\<in>"} & @{verbatim ":"} & @{verbatim "\\in"} \\ |
|
441 |
@{text "\<notin>"} & @{verbatim "~:"} & @{verbatim "\\notin"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
442 |
\end{tabular} |
54329 | 443 |
\medskip |
444 |
||
445 |
Note that the above abbreviations refer to the input method. The |
|
446 |
logical notation provides ASCII alternatives that often coincide, |
|
447 |
but deviate occasionally. Writing formal sources directly with |
|
448 |
ASCII replacement notation like @{verbatim "!"} or @{verbatim "ALL"} |
|
54330 | 449 |
is considered old-fashioned in 2013! |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
450 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
451 |
\end{enumerate} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
452 |
|
54329 | 453 |
Raw Unicode characters within prover source files should be |
54323 | 454 |
restricted to informal parts, e.g.\ to write text in non-latin |
455 |
alphabets. Mathematical symbols should be defined via the official |
|
54331 | 456 |
rendering tables, to avoid problems with portability and long-term |
54323 | 457 |
storage of formal text. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
458 |
|
54323 | 459 |
\paragraph{Control symbols.} There are some special control symbols |
54329 | 460 |
to modify the style of a single symbol (without nesting). Control |
461 |
symbols may be applied to a region of selected text, either using |
|
462 |
the \emph{Symbols} panel or keyboard shortcuts; these editor |
|
463 |
operations produce a separate control symbol for each symbol in the |
|
54330 | 464 |
text, in order to make the whole text appear in a certain style. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
465 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
466 |
\medskip |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
467 |
\begin{tabular}{lll} |
54321 | 468 |
\textbf{symbol} & style & keyboard shortcut \\\hline |
54323 | 469 |
@{verbatim "\<^sup>"} & superscript & @{verbatim "C+e UP"} \\ |
470 |
@{verbatim "\<^sub>"} & subscript & @{verbatim "C+e DOWN"} \\ |
|
471 |
@{verbatim "\<^bold>"} & bold face & @{verbatim "C+e RIGHT"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
472 |
& reset & @{verbatim "C+e LEFT"} \\ |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
473 |
\end{tabular} |
54323 | 474 |
|
475 |
It is also possible to complete on @{verbatim "\\"}@{verbatim sup}, |
|
476 |
@{verbatim "\\"}@{verbatim sub}, @{verbatim "\\"}@{verbatim bold} as |
|
477 |
for regular symbols. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
478 |
*} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
479 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
480 |
|
54323 | 481 |
section {* Text completion \label{sec:completion} *} |
53769 | 482 |
|
53981 | 483 |
text {* |
484 |
Text completion works via some light-weight GUI popup, which is triggered by |
|
485 |
keyboard events during the normal editing process in the main jEdit text |
|
486 |
area and a few additional text fields. The popup interprets special keys: |
|
487 |
@{verbatim TAB}, @{verbatim ESCAPE}, @{verbatim UP}, @{verbatim DOWN}, |
|
488 |
@{verbatim PAGE_UP}, @{verbatim PAGE_DOWN}. All other key events are passed |
|
489 |
to the jEdit text area --- this allows to ignore unwanted completions most |
|
490 |
of the time and continue typing quickly. |
|
491 |
||
492 |
Various Isabelle plugin options control the popup behavior and immediate |
|
493 |
insertion into buffer. |
|
494 |
||
54320 | 495 |
Isabelle Symbols are completed in backslashed forms, e.g.\ @{verbatim |
53981 | 496 |
"\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the Isabelle |
53982 | 497 |
symbol @{text "\<forall>"} in its Unicode rendering. Alternatively, symbol |
498 |
abbreviations may be used as specified in @{file |
|
499 |
"$ISABELLE_HOME/etc/symbols"}. |
|
53981 | 500 |
|
501 |
\emph{Explicit completion} works via standard jEdit shortcut @{verbatim |
|
502 |
"C+b"}, which is remapped to action @{verbatim "isabelle.complete"}, with a |
|
503 |
fall-back on regular @{verbatim "complete-word"} for non-Isabelle buffers. |
|
504 |
||
505 |
\emph{Implicit completion} works via keyboard input on text area, with popup |
|
506 |
or immediate insertion into buffer. Plain words require at least 3 |
|
507 |
characters to be completed. |
|
508 |
||
509 |
\emph{Immediate completion} means the (unique) replacement text is inserted |
|
510 |
into the buffer without popup. This mode ignores plain words and requires |
|
511 |
more than one characters for symbol abbreviations. Otherwise it falls back |
|
512 |
on completion popup. |
|
513 |
*} |
|
53769 | 514 |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
515 |
|
54329 | 516 |
chapter {* Known problems and workarounds \label{sec:problems} *} |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
517 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
518 |
text {* |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
519 |
\begin{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
520 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
521 |
\item \textbf{Problem:} Lack of dependency management for auxiliary files |
53771 | 522 |
that contribute to a theory (e.g.\ @{command ML_file}). |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
523 |
|
54330 | 524 |
\textbf{Workaround:} Re-load files manually within the prover, by |
525 |
editing corresponding command in the text. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
526 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
527 |
\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
|
528 |
global side-effects, like writing a physical file. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
529 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
530 |
\textbf{Workaround:} Avoid such commands. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
531 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
532 |
\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
|
533 |
collection of theories. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
534 |
|
54329 | 535 |
\textbf{Workaround:} Ignore unused files. Restart whole |
536 |
Isabelle/jEdit session in worst-case situation. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
537 |
|
54330 | 538 |
\item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and |
539 |
@{verbatim "C+MINUS"} for adjusting the editor font size depend on |
|
540 |
platform details and national keyboards. |
|
541 |
||
542 |
\textbf{Workaround:} Use numeric keypad or rebind keys in the |
|
543 |
jEdit Shortcuts options dialog. |
|
544 |
||
53886
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
545 |
\item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim |
54349 | 546 |
"COMMAND+COMMA"} for application \emph{Preferences} is in conflict |
547 |
with the jEdit default shortcut for \emph{Incremental Search Bar} |
|
548 |
(action @{verbatim "quick-search"}). |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
549 |
|
53886
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
550 |
\textbf{Workaround:} Remap in jEdit manually according to national |
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
551 |
keyboard, e.g.\ @{verbatim "COMMAND+SLASH"} on English ones. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
552 |
|
54349 | 553 |
\item \textbf{Problem:} Mac OS X system fonts sometimes lead to |
554 |
character drop-outs in the main text area. |
|
555 |
||
556 |
\textbf{Workaround:} Use the default @{verbatim IsabelleText} font. |
|
557 |
(Do not install that font on the system.) |
|
558 |
||
54329 | 559 |
\item \textbf{Problem:} Some Linux / X11 input methods such as IBus |
54330 | 560 |
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
|
561 |
|
54329 | 562 |
\textbf{Workaround:} Do not use input methods, reset the environment |
563 |
variable @{verbatim XMODIFIERS} within Isabelle settings (default in |
|
564 |
Isabelle2013-1). |
|
565 |
||
566 |
\item \textbf{Problem:} Some Linux / X11 window managers that are |
|
567 |
not ``re-parenting'' cause problems with additional windows opened |
|
54331 | 568 |
by Java. This affects either historic or neo-minimalistic window |
569 |
managers like @{verbatim awesome} or @{verbatim xmonad}. |
|
54329 | 570 |
|
571 |
\textbf{Workaround:} Use regular re-parenting window manager. |
|
572 |
||
573 |
\item \textbf{Problem:} Recent forks of Linux / X11 window managers |
|
574 |
and desktop environments (variants of Gnome) disrupt the handling of |
|
575 |
menu popups and mouse positions of Java/AWT/Swing. |
|
576 |
||
577 |
\textbf{Workaround:} Use mainstream versions of Linux desktops. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
578 |
|
54349 | 579 |
\item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim |
580 |
"toggle-full-screen"} (default shortcut @{verbatim F11}) works on |
|
581 |
Windows, but not on Mac OS X or various Linux / X11 window managers. |
|
582 |
||
583 |
\textbf{Workaround:} Use native full-screen control of the window |
|
584 |
manager, if available (notably on Mac OS X). |
|
585 |
||
586 |
\item \textbf{Problem:} Full-screen mode and dockable windows in |
|
587 |
\emph{floating} state may lead to confusion about window placement |
|
588 |
(depending on platform characteristics). |
|
589 |
||
590 |
\textbf{Workaround:} Avoid this combination. |
|
591 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
592 |
\end{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
593 |
*} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
594 |
|
53769 | 595 |
end |