author | wenzelm |
Wed, 30 Oct 2013 17:05:23 +0100 | |
changeset 54351 | 5cbe32533cdb |
parent 54350 | b0cdb4b10d20 |
child 54352 | 7557f9f1d4aa |
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 |
||
54351 | 248 |
subsection {* File-system access *} |
249 |
||
250 |
text {* File specifications in jEdit follow various formats and |
|
251 |
conventions according to \emph{Virtual File Systems}, which may be |
|
252 |
also provided by additional plugins. This allows to access remote |
|
253 |
files via the @{verbatim "http:"} protocol prefix, for example. |
|
254 |
Isabelle/jEdit attempts to work with the file-system access model of |
|
255 |
jEdit as far as possible. In particular, theory sources are passed |
|
256 |
directly from the editor to the prover, without indirection via |
|
257 |
files. |
|
258 |
||
259 |
Despite the flexibility of URLs in jEdit, local files are |
|
260 |
particularly important and are accessible without protocol prefix. |
|
261 |
Here the path notation is that of the Java Virtual Machine on the |
|
262 |
underlying platform. On Windows the preferred form uses |
|
263 |
backslashes, but happens to accept Unix/POSIX forward slashes, too. |
|
264 |
Further differences arise due to drive letters and network shares. |
|
265 |
||
266 |
The Java notation for files needs to be distinguished from the one |
|
267 |
of Isabelle, which uses POSIX notation with forward slashes on |
|
268 |
\emph{all} platforms.\footnote{Isabelle on Windows uses Cygwin |
|
269 |
file-system access.} Moreover, environment variables from the |
|
270 |
Isabelle process may be used freely, e.g.\ @{file |
|
271 |
"$ISABELLE_HOME/etc/symbols"} or @{file |
|
272 |
"$ISABELLE_JDK_HOME/README.html"}. There are special shortcuts: |
|
273 |
@{verbatim "~"} for @{file "$USER_HOME"}, and @{verbatim "~~"} for |
|
274 |
@{file "$ISABELLE_HOME"}. |
|
275 |
||
276 |
\medskip Since jEdit happens to support environment variables within |
|
277 |
file specifications as well, it is natural to use similar notation |
|
278 |
within the editor, e.g.\ in the file-browser. This does not work in |
|
279 |
full generality, though, due to the bias of jEdit towards |
|
280 |
platform-specific notation and of Isabelle towards POSIX. Moreover, |
|
281 |
the Isabelle settings environment is not yet active when starting |
|
282 |
Isabelle/jEdit via its standard application wrapper (in contrast to |
|
283 |
@{verbatim "isabelle jedit"} run from the command line). |
|
284 |
||
285 |
For convenience, Isabelle/jEdit imitates at least @{verbatim |
|
286 |
"$ISABELLE_HOME"} and @{verbatim "$ISABELLE_HOME_USER"} within the |
|
287 |
Java process environment, in order to allow easy access to these |
|
288 |
important places from the editor. |
|
289 |
||
290 |
Moreover note that path specifications in prover input or output |
|
291 |
usually include formal markup that turns it into a hyperlink (see |
|
292 |
also \secref{sec:theory-source}). This allows to open the |
|
293 |
corresponding file in the text editor, independently of the path |
|
294 |
notation. *} |
|
295 |
||
296 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
297 |
chapter {* Prover IDE functionality *} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
298 |
|
54351 | 299 |
section {* Text buffers and theories \label{sec:theory-source} *} |
54322 | 300 |
|
54350 | 301 |
text {* As regular text editor, jEdit maintains a collection of open |
302 |
\emph{text buffers} to store source files; each buffer may be |
|
303 |
associated with any number of visible \emph{text areas}. Buffers |
|
304 |
are subject to an \emph{edit mode} that is determined from the file |
|
305 |
type. Files with extension \texttt{.thy} are assigned to the mode |
|
306 |
\emph{isabelle} and treated specifically. |
|
54321 | 307 |
|
54329 | 308 |
\medskip Isabelle theory files are automatically added to the formal |
309 |
document model of Isabelle/Scala, which maintains a family of |
|
310 |
versions of all sources for the prover. The \emph{Theories} panel |
|
54322 | 311 |
provides an overview of the status of continuous checking of theory |
54329 | 312 |
sources. Unlike batch sessions \cite{isabelle-sys}, theory nodes |
313 |
are identified by full path names; this allows to work with multiple |
|
314 |
(disjoint) Isabelle sessions simultaneously within the same editor |
|
315 |
session. |
|
54322 | 316 |
|
54329 | 317 |
Certain events to open or update buffers with theory files cause |
318 |
Isabelle/jEdit to resolve dependencies of \emph{theory imports}. |
|
54350 | 319 |
The system requests to load additional files into editor buffers, in |
320 |
order to be included in the theory document model for further |
|
321 |
checking. It is also possible to resolve dependencies |
|
322 |
automatically, depending on \emph{Plugin Options / Isabelle / |
|
323 |
General / Auto load} (Isabelle system option @{system_option |
|
324 |
jedit_auto_load}). |
|
54321 | 325 |
|
54329 | 326 |
\medskip The open text area views on theory buffers define the |
327 |
visible \emph{perspective} of Isabelle/jEdit. This is taken as a |
|
328 |
hint for document processing: the prover ensures that those parts of |
|
329 |
a theory where the user is looking are checked, while other parts |
|
54350 | 330 |
that are presently not required are ignored. The perspective is |
54330 | 331 |
changed by opening or closing text area windows, or scrolling within |
332 |
some window. |
|
54322 | 333 |
|
54330 | 334 |
The \emph{Theories} panel provides some further options to influence |
335 |
the process of continuous checking: it may be switched off globally |
|
54350 | 336 |
to restrict the prover to superficial processing of command syntax. |
337 |
It is also possible to indicate theory nodes as \emph{required} for |
|
54330 | 338 |
continuous checking: this means such nodes and all their imports are |
339 |
always processed independently of the visibility status (if |
|
340 |
continuous checking is enabled). Big theory libraries that are |
|
341 |
marked as required can have significant impact on performance, |
|
342 |
though. |
|
54322 | 343 |
|
344 |
\medskip Formal markup of checked theory content is turned into GUI |
|
345 |
rendering, based on a standard repertoire known from IDEs for |
|
346 |
programming languages: colors, icons, highlighting, squiggly |
|
54329 | 347 |
underline, tooltips, hyperlinks etc. For outer syntax of |
54350 | 348 |
Isabelle/Isar there is some traditional syntax-highlighting via |
349 |
static keyword tables and tokenization within the editor. In |
|
350 |
contrast, the painting of inner syntax (term language etc.)\ uses |
|
351 |
semantic information that is reported dynamically from the logical |
|
352 |
context. Thus the prover can provide additional markup to help the |
|
353 |
user to understand the meaning of formal text, and to produce more |
|
354 |
text with some add-on tools (e.g.\ information messages by automated |
|
355 |
provers or disprovers running in the background). |
|
54322 | 356 |
|
54350 | 357 |
Such annotated text can be explored further by using the @{verbatim |
358 |
CONTROL} modifier key on Linux and Windows, or @{verbatim COMMAND} |
|
359 |
on Mac OS X. Hovering with the mouse while the modifier is pressed |
|
360 |
reveals a \emph{tooltip} (grey box over the text with a yellow |
|
361 |
popup) and/or a \emph{hyperlink} (black rectangle over the text); |
|
362 |
see \figref{fig:tooltip}. |
|
54331 | 363 |
|
364 |
\begin{figure}[htbp] |
|
365 |
\begin{center} |
|
366 |
\includegraphics[scale=0.3]{popup1} |
|
367 |
\end{center} |
|
54350 | 368 |
\caption{Tooltip and hyperlink for some formal entity.} |
369 |
\label{fig:tooltip} |
|
54331 | 370 |
\end{figure} |
371 |
||
54350 | 372 |
Tooltip popups use the same rendering principles as the main text |
373 |
area, and further tooltips and/or hyperlinks may be exposed |
|
374 |
recursively by the same mechanism; see |
|
375 |
\figref{fig:nested-tooltips}. |
|
54323 | 376 |
|
54331 | 377 |
\begin{figure}[htbp] |
378 |
\begin{center} |
|
379 |
\includegraphics[scale=0.3]{popup2} |
|
380 |
\end{center} |
|
381 |
\caption{Nested tooltips over formal entities.} |
|
54350 | 382 |
\label{fig:nested-tooltips} |
54331 | 383 |
\end{figure} |
54350 | 384 |
|
385 |
The tooltip popup window provides some controls to \emph{close} or |
|
386 |
\emph{detach} the window, turning it into a separate \emph{Info} |
|
387 |
dockable window managed by jEdit. The @{verbatim ESCAPE} key closes |
|
388 |
\emph{all} popups, which is particularly relevant for nested |
|
389 |
tooltips stacking up. *} |
|
54321 | 390 |
|
391 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
392 |
section {* Isabelle symbols and fonts *} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
393 |
|
54323 | 394 |
text {* Isabelle sources consist of \emph{symbols} that extend plain |
54330 | 395 |
ASCII to allow infinitely many mathematical symbols within the |
396 |
formal sources. This works without depending on particular |
|
397 |
encodings or varying Unicode standards \cite{Wenzel:2011:CICM}. |
|
54323 | 398 |
|
399 |
For the prover back-end, formal text consists of ASCII characters |
|
400 |
that are grouped according to some simple rules, e.g.\ as plain |
|
401 |
``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''. |
|
402 |
||
54329 | 403 |
For the editor front-end, a certain subset of symbols is rendered as |
54330 | 404 |
Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}'' as ``@{text |
405 |
"\<alpha>"}'', for example. This symbol interpretation is specified by the |
|
406 |
Isabelle system distribution (@{file "$ISABELLE_HOME/etc/symbols"}) |
|
407 |
or by the user (@{verbatim "$ISABELLE_HOME_USER/etc/symbols"}). |
|
54323 | 408 |
|
54329 | 409 |
The appendix of \cite{isabelle-isar-ref} gives an overview of the |
410 |
standard interpretation of finitely many symbols from the infinite |
|
54330 | 411 |
collection. Uninterpreted symbols are shown literally, e.g.\ |
412 |
``@{verbatim "\<foobar>"}''. |
|
54323 | 413 |
|
414 |
\medskip Technically, the Unicode view on Isabelle symbols is an |
|
415 |
\emph{encoding} in Isabelle/jEdit, which is called @{verbatim |
|
416 |
"UTF-8-Isabelle"} and enabled by default. Sometimes such defaults |
|
417 |
are reset accidentally, or malformed UTF-8 sequences in the text |
|
418 |
force jEdit to fall back on a different encoding like @{verbatim |
|
54330 | 419 |
"ISO-8859-15"}. In that case, verbatim ``@{verbatim "\<alpha>"}'' will be |
420 |
shown in the text buffer instead of its Unicode rendering ``@{text |
|
421 |
"\<alpha>"}''. The jEdit menu operation \emph{File / Reload with Encoding |
|
422 |
/ UTF-8-Isabelle} helps to resolve such problems, potentially after |
|
54323 | 423 |
repairing malformed parts of the text. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
424 |
|
54329 | 425 |
\medskip Correct rendering via Unicode requires a font that contains |
426 |
glyphs for the corresponding codepoints. Most system fonts lack |
|
427 |
that, so Isabelle/jEdit prefers its own application font @{verbatim |
|
54330 | 428 |
IsabelleText}, which ensures that standard collection of Isabelle |
429 |
symbols are actually seen on the screen (or printer). |
|
54329 | 430 |
|
54330 | 431 |
Note that a Java/AWT/Swing application can load additional fonts |
432 |
only if they are not installed as system font already! This means |
|
433 |
some old version of @{verbatim IsabelleText} that happens to be |
|
434 |
already present prevents Isabelle/jEdit from using its current |
|
435 |
bundled version. This might result in missing glyphs (black |
|
436 |
rectangles), since obsolete versions of @{verbatim IsabelleText} |
|
437 |
lack recent improvements of Unicode glyph coverage. This problem |
|
438 |
can be avoided by refraining to ``install'' any version of |
|
439 |
@{verbatim IsabelleText} in the first place. |
|
54329 | 440 |
|
54323 | 441 |
\medskip \paragraph{Input methods.} In principle, Isabelle/jEdit |
442 |
could delegate the problem to produce Isabelle symbols in their |
|
443 |
Unicode rendering to the underlying operating system and its |
|
54329 | 444 |
\emph{input methods}. Regular jEdit also provides various ways to |
445 |
work with \emph{abbreviations} to produce certain non-ASCII |
|
446 |
characters. Since none of these standard input methods work |
|
447 |
satisfactorily for the mathematical characters required for |
|
448 |
Isabelle, various specific Isabelle/jEdit mechanisms are provided. |
|
54323 | 449 |
|
54329 | 450 |
Here is a summary for practically relevant input methods for |
54330 | 451 |
Isabelle symbols: |
54323 | 452 |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
453 |
\begin{enumerate} |
54323 | 454 |
|
54330 | 455 |
\item The \emph{Symbols} panel with some GUI buttons to insert |
54323 | 456 |
certain symbols in the text buffer. There are also tooltips to |
457 |
reveal to official Isabelle representation with some additional |
|
458 |
information about \emph{symbol abbreviations} (see below). |
|
459 |
||
460 |
\item Copy / paste from decoded source files: text that is rendered |
|
54330 | 461 |
as Unicode already can be re-used to produce further such text. |
54323 | 462 |
This also works between different applications, e.g.\ Isabelle/jEdit |
54329 | 463 |
and some web browser or mail client, as long as the same Unicode |
464 |
view on Isabelle symbols is used uniformly. |
|
54323 | 465 |
|
54329 | 466 |
\item Copy / paste from prover output within Isabelle/jEdit. The |
467 |
same principles as for text buffers apply, but note that \emph{copy} |
|
468 |
in Isabelle \emph{Output} works via the keyboard shortcut @{verbatim |
|
54330 | 469 |
"C+c"}, not jEdit menu actions. |
54323 | 470 |
|
471 |
\item Completion provided by Isabelle plugin (see |
|
472 |
\secref{sec:completion}). Isabelle symbols have a canonical name |
|
473 |
and optional abbreviations. This can be used with the text |
|
474 |
completion mechanism of Isabelle/jEdit, to replace a prefix of the |
|
54329 | 475 |
actual symbol like @{verbatim "\<lambda>"}, or its backslashed name |
476 |
@{verbatim "\\"}@{verbatim "lambda"}, or its ASCII abbreviation |
|
54330 | 477 |
@{verbatim "%"} by the Unicode rendering. |
54323 | 478 |
|
479 |
The following table is an extract of the information provided by the |
|
54329 | 480 |
standard @{file "$ISABELLE_HOME/etc/symbols"} file: |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
481 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
482 |
\medskip |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
483 |
\begin{tabular}{lll} |
54329 | 484 |
\textbf{symbol} & \textbf{abbreviation} & \textbf{backslashed name} \\\hline |
53771 | 485 |
@{text "\<lambda>"} & @{verbatim "%"} & @{verbatim "\\lambda"} \\ |
486 |
@{text "\<Rightarrow>"} & @{verbatim "=>"} & @{verbatim "\\Rightarrow"} \\ |
|
487 |
@{text "\<Longrightarrow>"} & @{verbatim "==>"} & @{verbatim "\\Longrightarrow"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
488 |
|
53771 | 489 |
@{text "\<And>"} & @{verbatim "!!"} & @{verbatim "\\And"} \\ |
490 |
@{text "\<equiv>"} & @{verbatim "=="} & @{verbatim "\\equiv"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
491 |
|
53771 | 492 |
@{text "\<forall>"} & @{verbatim "!"} & @{verbatim "\\forall"} \\ |
493 |
@{text "\<exists>"} & @{verbatim "?"} & @{verbatim "\\exists"} \\ |
|
494 |
@{text "\<longrightarrow>"} & @{verbatim "-->"} & @{verbatim "\\longrightarrow"} \\ |
|
495 |
@{text "\<and>"} & @{verbatim "&"} & @{verbatim "\\and"} \\ |
|
496 |
@{text "\<or>"} & @{verbatim "|"} & @{verbatim "\\or"} \\ |
|
497 |
@{text "\<not>"} & @{verbatim "~"} & @{verbatim "\\not"} \\ |
|
498 |
@{text "\<noteq>"} & @{verbatim "~="} & @{verbatim "\\noteq"} \\ |
|
499 |
@{text "\<in>"} & @{verbatim ":"} & @{verbatim "\\in"} \\ |
|
500 |
@{text "\<notin>"} & @{verbatim "~:"} & @{verbatim "\\notin"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
501 |
\end{tabular} |
54329 | 502 |
\medskip |
503 |
||
504 |
Note that the above abbreviations refer to the input method. The |
|
505 |
logical notation provides ASCII alternatives that often coincide, |
|
506 |
but deviate occasionally. Writing formal sources directly with |
|
507 |
ASCII replacement notation like @{verbatim "!"} or @{verbatim "ALL"} |
|
54330 | 508 |
is considered old-fashioned in 2013! |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
509 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
510 |
\end{enumerate} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
511 |
|
54329 | 512 |
Raw Unicode characters within prover source files should be |
54323 | 513 |
restricted to informal parts, e.g.\ to write text in non-latin |
514 |
alphabets. Mathematical symbols should be defined via the official |
|
54331 | 515 |
rendering tables, to avoid problems with portability and long-term |
54323 | 516 |
storage of formal text. |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
517 |
|
54323 | 518 |
\paragraph{Control symbols.} There are some special control symbols |
54329 | 519 |
to modify the style of a single symbol (without nesting). Control |
520 |
symbols may be applied to a region of selected text, either using |
|
521 |
the \emph{Symbols} panel or keyboard shortcuts; these editor |
|
522 |
operations produce a separate control symbol for each symbol in the |
|
54330 | 523 |
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
|
524 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
525 |
\medskip |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
526 |
\begin{tabular}{lll} |
54321 | 527 |
\textbf{symbol} & style & keyboard shortcut \\\hline |
54323 | 528 |
@{verbatim "\<^sup>"} & superscript & @{verbatim "C+e UP"} \\ |
529 |
@{verbatim "\<^sub>"} & subscript & @{verbatim "C+e DOWN"} \\ |
|
530 |
@{verbatim "\<^bold>"} & bold face & @{verbatim "C+e RIGHT"} \\ |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
531 |
& reset & @{verbatim "C+e LEFT"} \\ |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
532 |
\end{tabular} |
54323 | 533 |
|
534 |
It is also possible to complete on @{verbatim "\\"}@{verbatim sup}, |
|
535 |
@{verbatim "\\"}@{verbatim sub}, @{verbatim "\\"}@{verbatim bold} as |
|
536 |
for regular symbols. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
537 |
*} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
538 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
539 |
|
54323 | 540 |
section {* Text completion \label{sec:completion} *} |
53769 | 541 |
|
53981 | 542 |
text {* |
543 |
Text completion works via some light-weight GUI popup, which is triggered by |
|
544 |
keyboard events during the normal editing process in the main jEdit text |
|
545 |
area and a few additional text fields. The popup interprets special keys: |
|
546 |
@{verbatim TAB}, @{verbatim ESCAPE}, @{verbatim UP}, @{verbatim DOWN}, |
|
547 |
@{verbatim PAGE_UP}, @{verbatim PAGE_DOWN}. All other key events are passed |
|
548 |
to the jEdit text area --- this allows to ignore unwanted completions most |
|
549 |
of the time and continue typing quickly. |
|
550 |
||
551 |
Various Isabelle plugin options control the popup behavior and immediate |
|
552 |
insertion into buffer. |
|
553 |
||
54320 | 554 |
Isabelle Symbols are completed in backslashed forms, e.g.\ @{verbatim |
53981 | 555 |
"\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the Isabelle |
53982 | 556 |
symbol @{text "\<forall>"} in its Unicode rendering. Alternatively, symbol |
557 |
abbreviations may be used as specified in @{file |
|
558 |
"$ISABELLE_HOME/etc/symbols"}. |
|
53981 | 559 |
|
560 |
\emph{Explicit completion} works via standard jEdit shortcut @{verbatim |
|
561 |
"C+b"}, which is remapped to action @{verbatim "isabelle.complete"}, with a |
|
562 |
fall-back on regular @{verbatim "complete-word"} for non-Isabelle buffers. |
|
563 |
||
564 |
\emph{Implicit completion} works via keyboard input on text area, with popup |
|
565 |
or immediate insertion into buffer. Plain words require at least 3 |
|
566 |
characters to be completed. |
|
567 |
||
568 |
\emph{Immediate completion} means the (unique) replacement text is inserted |
|
569 |
into the buffer without popup. This mode ignores plain words and requires |
|
570 |
more than one characters for symbol abbreviations. Otherwise it falls back |
|
571 |
on completion popup. |
|
572 |
*} |
|
53769 | 573 |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
574 |
|
54329 | 575 |
chapter {* Known problems and workarounds \label{sec:problems} *} |
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
576 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
577 |
text {* |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
578 |
\begin{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
579 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
580 |
\item \textbf{Problem:} Lack of dependency management for auxiliary files |
53771 | 581 |
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
|
582 |
|
54330 | 583 |
\textbf{Workaround:} Re-load files manually within the prover, by |
584 |
editing corresponding command in the text. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
585 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
586 |
\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
|
587 |
global side-effects, like writing a physical file. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
588 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
589 |
\textbf{Workaround:} Avoid such commands. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
590 |
|
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
591 |
\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
|
592 |
collection of theories. |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
593 |
|
54329 | 594 |
\textbf{Workaround:} Ignore unused files. Restart whole |
595 |
Isabelle/jEdit session in worst-case situation. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
596 |
|
54330 | 597 |
\item \textbf{Problem:} Keyboard shortcuts @{verbatim "C+PLUS"} and |
598 |
@{verbatim "C+MINUS"} for adjusting the editor font size depend on |
|
599 |
platform details and national keyboards. |
|
600 |
||
601 |
\textbf{Workaround:} Use numeric keypad or rebind keys in the |
|
602 |
jEdit Shortcuts options dialog. |
|
603 |
||
53886
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
604 |
\item \textbf{Problem:} The Mac OS X keyboard shortcut @{verbatim |
54349 | 605 |
"COMMAND+COMMA"} for application \emph{Preferences} is in conflict |
606 |
with the jEdit default shortcut for \emph{Incremental Search Bar} |
|
607 |
(action @{verbatim "quick-search"}). |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
608 |
|
53886
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
609 |
\textbf{Workaround:} Remap in jEdit manually according to national |
c83727c7a510
updated documentation concerning MacOSX plugin 1.3;
wenzelm
parents:
53773
diff
changeset
|
610 |
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
|
611 |
|
54349 | 612 |
\item \textbf{Problem:} Mac OS X system fonts sometimes lead to |
613 |
character drop-outs in the main text area. |
|
614 |
||
615 |
\textbf{Workaround:} Use the default @{verbatim IsabelleText} font. |
|
616 |
(Do not install that font on the system.) |
|
617 |
||
54329 | 618 |
\item \textbf{Problem:} Some Linux / X11 input methods such as IBus |
54330 | 619 |
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
|
620 |
|
54329 | 621 |
\textbf{Workaround:} Do not use input methods, reset the environment |
622 |
variable @{verbatim XMODIFIERS} within Isabelle settings (default in |
|
623 |
Isabelle2013-1). |
|
624 |
||
625 |
\item \textbf{Problem:} Some Linux / X11 window managers that are |
|
626 |
not ``re-parenting'' cause problems with additional windows opened |
|
54331 | 627 |
by Java. This affects either historic or neo-minimalistic window |
628 |
managers like @{verbatim awesome} or @{verbatim xmonad}. |
|
54329 | 629 |
|
630 |
\textbf{Workaround:} Use regular re-parenting window manager. |
|
631 |
||
632 |
\item \textbf{Problem:} Recent forks of Linux / X11 window managers |
|
633 |
and desktop environments (variants of Gnome) disrupt the handling of |
|
634 |
menu popups and mouse positions of Java/AWT/Swing. |
|
635 |
||
636 |
\textbf{Workaround:} Use mainstream versions of Linux desktops. |
|
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
637 |
|
54349 | 638 |
\item \textbf{Problem:} Full-screen mode via jEdit action @{verbatim |
639 |
"toggle-full-screen"} (default shortcut @{verbatim F11}) works on |
|
640 |
Windows, but not on Mac OS X or various Linux / X11 window managers. |
|
641 |
||
642 |
\textbf{Workaround:} Use native full-screen control of the window |
|
643 |
manager, if available (notably on Mac OS X). |
|
644 |
||
645 |
\item \textbf{Problem:} Full-screen mode and dockable windows in |
|
646 |
\emph{floating} state may lead to confusion about window placement |
|
647 |
(depending on platform characteristics). |
|
648 |
||
649 |
\textbf{Workaround:} Avoid this combination. |
|
650 |
||
53770
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
651 |
\end{itemize} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
652 |
*} |
db362319d766
added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents:
53769
diff
changeset
|
653 |
|
53769 | 654 |
end |