35 |
35 |
36 \item [Isabelle/Scala] is the system programming language of |
36 \item [Isabelle/Scala] is the system programming language of |
37 Isabelle. It extends the pure logical environment of Isabelle/ML |
37 Isabelle. It extends the pure logical environment of Isabelle/ML |
38 towards the ``real world'' of graphical user interfaces, text |
38 towards the ``real world'' of graphical user interfaces, text |
39 editors, IDE frameworks, web services etc. Special infrastructure |
39 editors, IDE frameworks, web services etc. Special infrastructure |
40 allows to transfer algebraic datatype values and formatted text |
40 allows to transfer algebraic datatypes and formatted text easily |
41 easily between ML and Scala, using asynchronous protocol commands. |
41 between ML and Scala, using asynchronous protocol commands. |
42 |
42 |
43 \item [jEdit] is a sophisticated text editor implemented in |
43 \item [jEdit] is a sophisticated text editor implemented in |
44 Java.\footnote{\url{http://www.jedit.org}} It is easily extensible |
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.\ |
45 by plugins written in languages that work on the JVM, e.g.\ |
46 Scala\footnote{\url{http://www.scala-lang.org/}}. |
46 Scala\footnote{\url{http://www.scala-lang.org/}}. |
47 |
47 |
48 \item [Isabelle/jEdit] is the main example application of the PIDE |
48 \item [Isabelle/jEdit] is the main example application of the PIDE |
49 framework and the default user-interface for Isabelle. It targets |
49 framework and the default user-interface for Isabelle. It targets |
50 both beginners and experts. Technically, Isabelle/jEdit combines a |
50 both beginners and experts. Technically, Isabelle/jEdit combines a |
51 slightly modified version of the official jEdit code base with a |
51 slightly modified version of the jEdit code base with a special |
52 special plugin for Isabelle, integrated as standalone application |
52 plugin for Isabelle, integrated as standalone application for the |
53 for the main operating system platforms: Linux, Windows, Mac OS X. |
53 main operating system platforms: Linux, Windows, Mac OS X. |
54 |
54 |
55 \end{description} |
55 \end{description} |
56 |
56 |
57 The subtle differences of Isabelle/ML versus Standard ML, |
57 The subtle differences of Isabelle/ML versus Standard ML, |
58 Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be |
58 Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit need to be |
160 subsection {* Options *} |
160 subsection {* Options *} |
161 |
161 |
162 text {* Both jEdit and Isabelle have distinctive management of |
162 text {* Both jEdit and Isabelle have distinctive management of |
163 persistent options. |
163 persistent options. |
164 |
164 |
165 Regular jEdit options are accessible via the dialogs for |
165 Regular jEdit options are accessible via the dialog for |
166 \emph{Global Options} and \emph{Plugin Options}. Changed properties |
166 \emph{Plugins / Plugin Options}, which is also accessible via |
167 are stored eventually in @{verbatim |
167 \emph{Utilities / Global Options}. Changed properties are stored in |
168 "$ISABELLE_HOME_USER/jedit/properties"}. In contrast, Isabelle |
168 @{file_unchecked "$ISABELLE_HOME_USER/jedit/properties"}. In |
169 system options are managed by Isabelle/Scala and changes stored in |
169 contrast, Isabelle system options are managed by Isabelle/Scala and |
170 @{verbatim "$ISABELLE_HOME_USER/etc/preferences"}, independently of |
170 changed values stored in @{file_unchecked |
171 the jEdit properties. See also \cite{isabelle-sys}, especially the |
171 "$ISABELLE_HOME_USER/etc/preferences"}, independently of the jEdit |
172 coverage of sessions and command-line tools like @{tool build} or |
172 properties. See also \cite{isabelle-sys}, especially the coverage |
173 @{tool options}. |
173 of sessions and command-line tools like @{tool build} or @{tool |
|
174 options}. |
174 |
175 |
175 Those Isabelle options that are declared as \textbf{public} are |
176 Those Isabelle options that are declared as \textbf{public} are |
176 configurable in jEdit via \emph{Plugin Options / Isabelle / |
177 configurable in jEdit via \emph{Plugin Options / Isabelle / |
177 General}. Moreover, there are various options for rendering of |
178 General}. Moreover, there are various options for rendering of |
178 document content, which are configurable via \emph{Plugin Options / |
179 document content, which are configurable via \emph{Plugin Options / |
179 Isabelle / Rendering}. Thus \emph{Plugin Options / Isabelle} in |
180 Isabelle / Rendering}. Thus \emph{Plugin Options / Isabelle} in |
180 jEdit provides a view on certain Isabelle options. Note that some |
181 jEdit provides a view on a subset of Isabelle system options. Note |
181 of these options affect general parameters that are relevant outside |
182 that some of these options affect general parameters that are |
182 Isabelle/jEdit as well, e.g.\ @{system_option threads} or |
183 relevant outside Isabelle/jEdit as well, e.g.\ @{system_option |
183 @{system_option parallel_proofs} for the Isabelle build tool |
184 threads} or @{system_option parallel_proofs} for the Isabelle build |
184 \cite{isabelle-sys}. |
185 tool \cite{isabelle-sys}. |
185 |
186 |
186 \medskip All options are loaded on startup and saved on shutdown of |
187 \medskip All options are loaded on startup and saved on shutdown of |
187 Isabelle/jEdit. Editing the machine-generated files @{verbatim |
188 Isabelle/jEdit. Editing the machine-generated @{file_unchecked |
188 "$ISABELLE_HOME_USER/jedit/properties"} or @{verbatim |
189 "$ISABELLE_HOME_USER/jedit/properties"} or @{file_unchecked |
189 "$ISABELLE_HOME_USER/etc/preferences"} manually while the |
190 "$ISABELLE_HOME_USER/etc/preferences"} manually while the |
190 application is running is likely to cause surprise due to lost |
191 application is running is likely to cause surprise due to lost |
191 update! *} |
192 update! *} |
192 |
193 |
193 |
194 |
217 follows: |
219 follows: |
218 |
220 |
219 \begin{description} |
221 \begin{description} |
220 |
222 |
221 \item[Linux] The platform-independent \emph{Nimbus} is used by |
223 \item[Linux] The platform-independent \emph{Nimbus} is used by |
222 default, but the classic \emph{Metal} also works. \emph{GTK+} works |
224 default. |
223 under the side-condition that the overall GTK theme is selected in a |
225 |
224 Swing-friendly way.\footnote{GTK support in Java/Swing was once |
226 \emph{GTK+} works under the side-condition that the overall GTK |
225 marketed aggressively by Sun, but never quite finished, and is today |
227 theme is selected in a Swing-friendly way.\footnote{GTK support in |
226 (2013) lagging a bit behind further development of Swing and GTK.} |
228 Java/Swing was once marketed aggressively by Sun, but never quite |
227 |
229 finished, and is today (2013) lagging a bit behind further |
228 \item[Windows] Regular \emph{Windows} is used by default, but |
230 development of Swing and GTK.} |
229 platform-independent \emph{Nimbus} and \emph{Metal} also work. |
231 |
230 |
232 \item[Windows] Regular \emph{Windows} is used by default. |
231 \item[Mac OS X] Regular \emph{Mac OS X} is used by default, but |
233 |
232 platform-independent \emph{Nimbus} and \emph{Metal} also work. |
234 \item[Mac OS X] Regular \emph{Mac OS X} is used by default. |
|
235 |
233 Moreover the bundled \emph{MacOSX} plugin provides various functions |
236 Moreover the bundled \emph{MacOSX} plugin provides various functions |
234 that are expected from applications on that particular platform: |
237 that are expected from applications on that particular platform: |
235 quit from menu or dock, preferences menu, drag-and-drop of text |
238 quit from menu or dock, preferences menu, drag-and-drop of text |
236 files on the application, full-screen mode for main editor windows |
239 files on the application, full-screen mode for main editor windows |
237 etc. |
240 etc. |
238 |
241 |
239 \end{description} |
242 \end{description} |
240 |
243 |
241 Users may experiment with different look-and-feels, but need to keep |
244 Users may experiment with different look-and-feels, but need to keep |
242 in mind that this extra variance of GUI functionality is unlikely to |
245 in mind that this extra variance of GUI functionality is unlikely to |
243 work in arbitrary combinations. The historic \emph{CDE/Motif} is |
246 work in arbitrary combinations. The platform-independent |
244 better avoided. After changing the look-and-feel in \emph{Global |
247 \emph{Nimbus} and \emph{Metal} should always work. The historic |
245 Options / Appearance}, it is advisable to restart Isabelle/jEdit in |
248 \emph{CDE/Motif} is better avoided. |
246 order to take full effect. *} |
249 |
247 |
250 After changing the look-and-feel in \emph{Global Options / |
248 |
251 Appearance}, it is advisable to restart Isabelle/jEdit in order to |
249 subsection {* File-system access *} |
252 take full effect. *} |
|
253 |
|
254 |
|
255 chapter {* Prover IDE functionality *} |
|
256 |
|
257 section {* File-system access *} |
250 |
258 |
251 text {* File specifications in jEdit follow various formats and |
259 text {* File specifications in jEdit follow various formats and |
252 conventions according to \emph{Virtual File Systems}, which may be |
260 conventions according to \emph{Virtual File Systems}, which may be |
253 also provided by additional plugins. This allows to access remote |
261 also provided by additional plugins. This allows to access remote |
254 files via the @{verbatim "http:"} protocol prefix, for example. |
262 files via the @{verbatim "http:"} protocol prefix, for example. |
319 Isabelle/jEdit to resolve dependencies of \emph{theory imports}. |
325 Isabelle/jEdit to resolve dependencies of \emph{theory imports}. |
320 The system requests to load additional files into editor buffers, in |
326 The system requests to load additional files into editor buffers, in |
321 order to be included in the theory document model for further |
327 order to be included in the theory document model for further |
322 checking. It is also possible to resolve dependencies |
328 checking. It is also possible to resolve dependencies |
323 automatically, depending on \emph{Plugin Options / Isabelle / |
329 automatically, depending on \emph{Plugin Options / Isabelle / |
324 General / Auto load} (Isabelle system option @{system_option |
330 General / Auto load}. |
325 jedit_auto_load}). |
|
326 |
331 |
327 \medskip The open text area views on theory buffers define the |
332 \medskip The open text area views on theory buffers define the |
328 visible \emph{perspective} of Isabelle/jEdit. This is taken as a |
333 visible \emph{perspective} of Isabelle/jEdit. This is taken as a |
329 hint for document processing: the prover ensures that those parts of |
334 hint for document processing: the prover ensures that those parts of |
330 a theory where the user is looking are checked, while other parts |
335 a theory where the user is looking are checked, while other parts |
331 that are presently not required are ignored. The perspective is |
336 that are presently not required are ignored. The perspective is |
332 changed by opening or closing text area windows, or scrolling within |
337 changed by opening or closing text area windows, or scrolling within |
333 some window. |
338 an editor window. |
334 |
339 |
335 The \emph{Theories} panel provides some further options to influence |
340 The \emph{Theories} panel provides some further options to influence |
336 the process of continuous checking: it may be switched off globally |
341 the process of continuous checking: it may be switched off globally |
337 to restrict the prover to superficial processing of command syntax. |
342 to restrict the prover to superficial processing of command syntax. |
338 It is also possible to indicate theory nodes as \emph{required} for |
343 It is also possible to indicate theory nodes as \emph{required} for |
364 original source text, and visualized in the text area, e.g.\ as text |
369 original source text, and visualized in the text area, e.g.\ as text |
365 colours for free and bound variables, or as squiggly underline for |
370 colours for free and bound variables, or as squiggly underline for |
366 warnings, errors etc.\ (see also \figref{fig:output}). In the |
371 warnings, errors etc.\ (see also \figref{fig:output}). In the |
367 latter case, the corresponding messages are shown by hovering with |
372 latter case, the corresponding messages are shown by hovering with |
368 the mouse over the highlighted text --- although in many situations |
373 the mouse over the highlighted text --- although in many situations |
369 the user should already get some clue by looking at the text |
374 the user should already get some clue by looking at the position of |
370 highlighting alone. |
375 the text highlighting. |
371 |
376 |
372 \begin{figure}[htb] |
377 \begin{figure}[htb] |
373 \begin{center} |
378 \begin{center} |
374 \includegraphics[scale=0.3]{output} |
379 \includegraphics[scale=0.3]{output} |
375 \end{center} |
380 \end{center} |
376 \caption{Multiple views on prover output: gutter area, text area |
381 \caption{Multiple views on prover output: gutter area with icon, |
377 with popup, overview area, Theories panel, Output panel} |
382 text area with popup, overview area, Theories panel, Output panel} |
378 \label{fig:output} |
383 \label{fig:output} |
379 \end{figure} |
384 \end{figure} |
380 |
385 |
381 The ``gutter area'' on the left-hand-side of the text area uses |
386 The ``gutter area'' on the left-hand-side of the text area uses |
382 icons to provide a summary of the messages within the corresponding |
387 icons to provide a summary of the messages within the adjacent |
383 line of text. Message priorities are used to prefer errors over |
388 line of text. Message priorities are used to prefer errors over |
384 warnings, warnings over information messages etc. Plain output is |
389 warnings, warnings over information messages etc. Plain output is |
385 ignored here. |
390 ignored here. |
386 |
391 |
387 The ``overview area'' on the right-hand-side of the text area uses |
392 The ``overview area'' on the right-hand-side of the text area uses |
388 similar information to paint small rectangles for the overall status |
393 similar information to paint small rectangles for the overall status |
389 of the whole text buffer. The graphics is scaled to fit the logical |
394 of the whole text buffer. The graphics is scaled to fit the logical |
390 buffer length into the given window height. Mouse clicks on the |
395 buffer length into the given window height. Mouse clicks on the |
391 overview area position the cursor approximately to the corresponding |
396 overview area position the cursor approximately to the corresponding |
392 line of text in the buffer. |
397 line of text in the buffer. Repainting the overview in real-time |
|
398 causes problems with big theories, so it is restricted to part of |
|
399 the text according to \emph{Plugin Options / Isabelle / General / |
|
400 Text Overview Limit} (in characters). |
393 |
401 |
394 Another course-grained overview is provided by the \emph{Theories} |
402 Another course-grained overview is provided by the \emph{Theories} |
395 panel (\secref{sec:buffers-theories}), but without direct |
403 panel, but without direct correspondence to text positions. A |
396 correspondence to text positions. A double-click on one of the |
404 double-click on one of the theory entries with their status overview |
397 theory entries with their status overview opens the corresponding |
405 opens the corresponding text buffer, without changing the cursor |
398 text buffer, without changing the cursor position. |
406 position. |
399 |
407 |
400 \medskip In addition, the \emph{Output} panel displays prover |
408 \medskip In addition, the \emph{Output} panel displays prover |
401 messages that correspond to a given command, within a separate |
409 messages that correspond to a given command, within a separate |
402 window. |
410 window. |
403 |
411 |
404 The cursor position in the presently active text area determines the |
412 The cursor position in the presently active text area determines the |
405 prover commands whose cumulative message output is appended an shown |
413 prover commands whose cumulative message output is appended and |
406 in that window (in canonical order according to the processing of |
414 shown in that window (in canonical order according to the processing |
407 the command). There are also control elements to modify the update |
415 of the command). There are also control elements to modify the |
408 policy of the output wrt.\ continued editor movements. This is |
416 update policy of the output wrt.\ continued editor movements. This |
409 particularly useful with several independent instances of the |
417 is particularly useful with several independent instances of the |
410 \emph{Output} panel, which the Dockable Window Manager of jEdit can |
418 \emph{Output} panel, which the Dockable Window Manager of jEdit can |
411 handle conveniently. |
419 handle conveniently. |
412 |
420 |
413 Former users of the old TTY interaction model (e.g.\ Proof~General) |
421 Former users of the old TTY interaction model (e.g.\ Proof~General) |
414 might find a separate window for prover messages familiar, but it is |
422 might find a separate window for prover messages familiar, but it is |
415 important to understand that the main Prover IDE feedback happens |
423 important to understand that the main Prover IDE feedback happens |
416 elsewhere. It is possible to do meaningful proof editing |
424 elsewhere. It is possible to do meaningful proof editing |
417 efficiently while using the secondary window only rarely. |
425 efficiently, using secondary output windows only rarely. |
418 |
426 |
419 The main purpose of the output window is to ``debug'' unclear |
427 The main purpose of the output window is to ``debug'' unclear |
420 situations by inspecting internal state of the prover.\footnote{In |
428 situations by inspecting internal state of the prover.\footnote{In |
421 that sense, unstructured tactic scripts depend on continuous |
429 that sense, unstructured tactic scripts depend on continuous |
422 debugging with internal state inspection.} Consequently, some |
430 debugging with internal state inspection.} Consequently, some |
460 \label{fig:nested-tooltips} |
468 \label{fig:nested-tooltips} |
461 \end{figure} |
469 \end{figure} |
462 |
470 |
463 The tooltip popup window provides some controls to \emph{close} or |
471 The tooltip popup window provides some controls to \emph{close} or |
464 \emph{detach} the window, turning it into a separate \emph{Info} |
472 \emph{detach} the window, turning it into a separate \emph{Info} |
465 dockable window managed by jEdit. The @{verbatim ESCAPE} key closes |
473 window managed by jEdit. The @{verbatim ESCAPE} key closes |
466 \emph{all} popups, which is particularly relevant when nested |
474 \emph{all} popups, which is particularly relevant when nested |
467 tooltips are stacking up. |
475 tooltips are stacking up. |
468 |
476 |
469 \medskip A black rectangle in the text indicates a hyperlink that |
477 \medskip A black rectangle in the text indicates a hyperlink that |
470 may be followed by a mouse click (while the @{verbatim CONTROL} or |
478 may be followed by a mouse click (while the @{verbatim CONTROL} or |
471 @{verbatim COMMAND} modifier key is still pressed). Presently |
479 @{verbatim COMMAND} modifier key is still pressed). Presently |
472 (Isabelle2013-1) there is no systematic way to return to the |
480 (Isabelle2013-1) there is no systematic navigation within the |
473 original location within the editor. |
481 editor to return to the original location. |
474 |
482 |
475 Also note that the link target may be a file that is itself not |
483 Also note that the link target may be a file that is itself not |
476 subject to formal document processing of the editor session and thus |
484 subject to formal document processing of the editor session and thus |
477 prevents further exploration: the chain of hyperlinks may end in |
485 prevents further exploration: the chain of hyperlinks may end in |
478 some source file of the underlying logic image, even within the |
486 some source file of the underlying logic image, or within the |
479 Isabelle/ML bootstrap sources of Isabelle/Pure, where the formal |
487 Isabelle/ML bootstrap sources of Isabelle/Pure. *} |
480 markup is less detailed. *} |
|
481 |
488 |
482 |
489 |
483 section {* Text completion \label{sec:completion} *} |
490 section {* Text completion \label{sec:completion} *} |
484 |
491 |
485 text {* \paragraph{Completion tables} are determined statically from |
492 text {* \paragraph{Completion tables} are determined statically from |
486 the ``outer syntax'' of the underlying edit mode (for theory files |
493 the ``outer syntax'' of the underlying edit mode (for theory files |
487 this is the syntax of Isar commands) and specifications of Isabelle |
494 this is the syntax of Isar commands), and specifications of Isabelle |
488 symbols (see also \secref{sec:symbols}). |
495 symbols (see also \secref{sec:symbols}). |
489 |
496 |
490 Symbols are completed in backslashed forms, e.g.\ @{verbatim |
497 Symbols are completed in backslashed forms, e.g.\ @{verbatim |
491 "\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the |
498 "\\"}@{verbatim "forall"} or @{verbatim "\<forall>"} that both produce the |
492 Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The |
499 Isabelle symbol @{text "\<forall>"} in its Unicode rendering.\footnote{The |
493 extra backslash avoids overlap with keywords of the buffer syntax, |
500 extra backslash avoids overlap with keywords of the buffer syntax, |
494 and facilitates to produce Isabelle symbols in arbitrary syntactic |
501 and allows to produce Isabelle symbols robustly in most syntactic |
495 contexts.} Alternatively, symbol abbreviations may be used as |
502 contexts.} Alternatively, symbol abbreviations may be used as |
496 specified in @{file "$ISABELLE_HOME/etc/symbols"}. |
503 specified in @{file "$ISABELLE_HOME/etc/symbols"}. |
497 |
504 |
498 \paragraph{Completion popups} are required in situations of |
505 \paragraph{Completion popups} are required in situations of |
499 ambiguous completion results or where explicit confirmation is |
506 ambiguous completion results or where explicit confirmation is |
521 |
529 |
522 Movement within the popup is only active for multiple items. |
530 Movement within the popup is only active for multiple items. |
523 Otherwise the corresponding key event retains its standard meaning |
531 Otherwise the corresponding key event retains its standard meaning |
524 within the underlying text area. |
532 within the underlying text area. |
525 |
533 |
526 \paragraph{Explicit completion} is triggered by the keyword shortcut |
534 \paragraph{Explicit completion} is triggered by the keyboard |
527 @{verbatim "C+b"} for action @{verbatim "isabelle.complete"}. This |
535 shortcut @{verbatim "C+b"} (action @{verbatim "isabelle.complete"}). |
528 overrides the original jEdit action @{verbatim "complete-word"} on |
536 This overrides the original jEdit binding for action @{verbatim |
529 that key sequence, but the latter is used as fall-back for |
537 "complete-word"}, but the latter is used as fall-back for |
530 non-Isabelle edit modes. It is also possible to restore the |
538 non-Isabelle edit modes. It is also possible to restore the |
531 original jEdit keyboard mapping of @{verbatim "complete-word"}. |
539 original jEdit keyboard mapping of @{verbatim "complete-word"} via |
|
540 \emph{Global Options / Shortcuts}. |
532 |
541 |
533 Replacement text is inserted immediately into the buffer, unless |
542 Replacement text is inserted immediately into the buffer, unless |
534 ambiguous results demand an explicit popup. |
543 ambiguous results demand an explicit popup. |
535 |
544 |
536 \paragraph{Implicit completion} is triggered by regular keyboard |
545 \paragraph{Implicit completion} is triggered by regular keyboard |
537 input events during of the editing process in the main jEdit text |
546 input events during of the editing process in the main jEdit text |
538 area (and a few additional text fields like the search criterium of |
547 area (and a few additional text fields like the search criteria of |
539 the Find panel, see \secref{sec:find}). Implicit completion depends |
548 the Find panel, see \secref{sec:find}). Implicit completion depends |
540 on on further side-conditions: |
549 on on further side-conditions: |
541 |
550 |
542 \begin{enumerate} |
551 \begin{enumerate} |
543 |
552 |
544 \item The system option @{system_option jedit_completion} needs to |
553 \item The system option @{system_option jedit_completion} needs to |
545 be enabled (default). |
554 be enabled (default). |
546 |
555 |
547 \item Completion of syntax keywords requires at least 3 characters |
556 \item Completion of syntax keywords requires at least 3 relevant |
548 in the text. |
557 characters in the text. |
549 |
558 |
550 \item The system option @{system_option jedit_completion} determines |
559 \item The system option @{system_option jedit_completion_delay} |
551 an additional delay (0.0 by default), before opening a completion |
560 determines an additional delay (0.0 by default), before opening a |
552 popup. |
561 completion popup. |
553 |
562 |
554 \item The system option @{system_option jedit_completion_immediate} |
563 \item The system option @{system_option jedit_completion_immediate} |
555 (disabled by default) controls whether replacement text should be |
564 (disabled by default) controls whether replacement text should be |
556 inserted immediately without popup, if possible. This only works |
565 inserted immediately without popup. This is restricted to Isabelle |
557 for Isabelle symbols (\secref{sec:symbols}). |
566 symbols and their abbreviations (\secref{sec:symbols}) --- plain |
558 |
567 keywords always demand a popup for clarity. |
559 \item Completion of symbol abbreviations with only 1 character in |
568 |
560 the text always enforces and explicit popup, independently of |
569 \item Completion of symbol abbreviations with only one relevant |
561 @{system_option jedit_completion_immediate}. |
570 character in the text always enforces an explicit popup, |
|
571 independently of @{system_option jedit_completion_immediate}. |
562 |
572 |
563 \end{enumerate} |
573 \end{enumerate} |
564 |
574 |
565 These completion options may be configured in \emph{Plugin Options / |
575 These completion options may be configured in \emph{Plugin Options / |
566 Isabelle / General / Completion}. The default is quite moderate in |
576 Isabelle / General / Completion}. The default is quite moderate in |
567 showing occasional popups and refraining from immediate insertion. |
577 showing occasional popups and refraining from immediate insertion. |
568 An additional of e.g.\ 0.3 seconds will make it even less ambitious. |
578 An additional completion delay of 0.3 seconds will make it even less |
569 |
579 ambitious. |
570 A more aggressive configuration is @{system_option |
580 |
|
581 In contrast, more aggressive completion works via @{system_option |
571 jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option |
582 jedit_completion_delay}~@{verbatim "= 0.0"} and @{system_option |
572 jedit_completion_immediate}~@{verbatim "= true"}. Thus the editing |
583 jedit_completion_immediate}~@{verbatim "= true"}. Thus the editing |
573 process becomes more dependent on the system guessing correctly what |
584 process becomes dependent on the system guessing correctly what the |
574 the user had in mind. It requires some practice and study of the |
585 user had in mind. It requires some practice (and study of the |
575 symbol abbreviation tables to be productive in this mode. |
586 symbol abbreviation tables) to become productive in this advanced |
576 |
587 mode. |
577 Unintended completions can be reverted by the regular @{verbatim |
588 |
578 undo} operation of jEdit. When editing embedded languages such as |
589 In any case, unintended completions can be reverted by the regular |
579 ML works, it is better to disable either @{system_option |
590 @{verbatim undo} operation of jEdit. When editing embedded |
|
591 languages such as ML, it is better to disable either @{system_option |
580 jedit_completion} or @{system_option jedit_completion_immediate} |
592 jedit_completion} or @{system_option jedit_completion_immediate} |
581 temporarily. |
593 temporarily. *} |
582 *} |
|
583 |
594 |
584 |
595 |
585 section {* Isabelle symbols \label{sec:symbols} *} |
596 section {* Isabelle symbols \label{sec:symbols} *} |
586 |
597 |
587 text {* Isabelle sources consist of \emph{symbols} that extend plain |
598 text {* Isabelle sources consist of \emph{symbols} that extend plain |
588 ASCII to allow infinitely many mathematical symbols within the |
599 ASCII to allow infinitely many mathematical symbols within the |
589 formal sources. This works without depending on particular |
600 formal sources. This works without depending on particular |
590 encodings or varying Unicode standards |
601 encodings and varying Unicode standards |
591 \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within |
602 \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within |
592 formal sources would compromise portability and reliability in the |
603 formal sources would compromise portability and reliability in the |
593 face of changing interpretation of various unexpected features of |
604 face of changing interpretation of special features of Unicode, such |
594 Unicode.} |
605 as Combining Characters or Bi-directional Text.} |
595 |
606 |
596 For the prover back-end, formal text consists of ASCII characters |
607 For the prover back-end, formal text consists of ASCII characters |
597 that are grouped according to some simple rules, e.g.\ as plain |
608 that are grouped according to some simple rules, e.g.\ as plain |
598 ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''. |
609 ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''. |
599 |
610 |
600 For the editor front-end, a certain subset of symbols is rendered |
611 For the editor front-end, a certain subset of symbols is rendered |
601 physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}'' |
612 physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}'' |
602 as ``@{text "\<alpha>"}'', for example. This symbol interpretation is |
613 as ``@{text "\<alpha>"}'', for example. This symbol interpretation is |
603 specified by the Isabelle system distribution in @{file |
614 specified by the Isabelle system distribution in @{file |
604 "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in |
615 "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in |
605 @{verbatim "$ISABELLE_HOME_USER/etc/symbols"}. |
616 @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}. |
606 |
617 |
607 The appendix of \cite{isabelle-isar-ref} gives an overview of the |
618 The appendix of \cite{isabelle-isar-ref} gives an overview of the |
608 standard interpretation of finitely many symbols from the infinite |
619 standard interpretation of finitely many symbols from the infinite |
609 collection. Uninterpreted symbols are displayed literally, e.g.\ |
620 collection. Uninterpreted symbols are displayed literally, e.g.\ |
610 ``@{verbatim "\<foobar>"}''. Overlap of Unicode characters used in |
621 ``@{verbatim "\<foobar>"}''. Overlap of Unicode characters used in |
611 symbol interpretation with informal ones that might appear e.g.\ in |
622 symbol interpretation with informal ones (which might appear e.g.\ |
612 comments needs to be avoided! |
623 in comments) needs to be avoided! Raw Unicode characters within |
|
624 prover source files should be restricted to informal parts, e.g.\ to |
|
625 write text in non-latin alphabets in comments. |
613 |
626 |
614 \medskip \paragraph{Encoding.} Technically, the Unicode view on |
627 \medskip \paragraph{Encoding.} Technically, the Unicode view on |
615 Isabelle symbols is an \emph{encoding} in jEdit (not in the |
628 Isabelle symbols is an \emph{encoding} in jEdit (not in the |
616 underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}. It is |
629 underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}. It is |
617 provided by the Isabelle/jEdit plugin and enabled by default for all |
630 provided by the Isabelle/jEdit plugin and enabled by default for all |
630 application font @{verbatim IsabelleText}, which ensures that |
643 application font @{verbatim IsabelleText}, which ensures that |
631 standard collection of Isabelle symbols are actually seen on the |
644 standard collection of Isabelle symbols are actually seen on the |
632 screen (or printer). |
645 screen (or printer). |
633 |
646 |
634 Note that a Java/AWT/Swing application can load additional fonts |
647 Note that a Java/AWT/Swing application can load additional fonts |
635 only if they are not installed as system font already! This means |
648 only if they are not installed on the operating system already! |
636 some old version of @{verbatim IsabelleText} that happens to be |
649 Some old version of @{verbatim IsabelleText} that happens to be |
637 already present prevents Isabelle/jEdit from using its current |
650 provided by the operating system would prevents Isabelle/jEdit from |
638 bundled version. This results in missing glyphs (black rectangles), |
651 its bundled version. This could lead to missing glyphs (black |
639 when some obsolete version of @{verbatim IsabelleText} is used by |
652 rectangles), when the system version of @{verbatim IsabelleText} is |
640 accident. This problem can be avoided by refraining to ``install'' |
653 older than the application version. This problem can be avoided by |
641 any version of @{verbatim IsabelleText} in the first place. |
654 refraining to ``install'' any version of @{verbatim IsabelleText} in |
|
655 the first place (although it might be occasionally tempting to use |
|
656 the same font in other applications). |
642 |
657 |
643 \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit |
658 \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit |
644 could delegate the problem to produce Isabelle symbols in their |
659 could delegate the problem to produce Isabelle symbols in their |
645 Unicode rendering to the underlying operating system and its |
660 Unicode rendering to the underlying operating system and its |
646 \emph{input methods}. Regular jEdit also provides various ways to |
661 \emph{input methods}. Regular jEdit also provides various ways to |
682 The following table is an extract of the information provided by the |
697 The following table is an extract of the information provided by the |
683 standard @{file "$ISABELLE_HOME/etc/symbols"} file: |
698 standard @{file "$ISABELLE_HOME/etc/symbols"} file: |
684 |
699 |
685 \medskip |
700 \medskip |
686 \begin{tabular}{lll} |
701 \begin{tabular}{lll} |
687 \textbf{symbol} & \textbf{abbreviation} & \textbf{backslashed name} \\\hline |
702 \textbf{symbol} & \textbf{backslashed name} & \textbf{abbreviation} \\\hline |
688 @{text "\<lambda>"} & @{verbatim "%"} & @{verbatim "\\lambda"} \\ |
703 @{text "\<lambda>"} & @{verbatim "\\lambda"} & @{verbatim "%"} \\ |
689 @{text "\<Rightarrow>"} & @{verbatim "=>"} & @{verbatim "\\Rightarrow"} \\ |
704 @{text "\<Rightarrow>"} & @{verbatim "\\Rightarrow"} & @{verbatim "=>"} \\ |
690 @{text "\<Longrightarrow>"} & @{verbatim "==>"} & @{verbatim "\\Longrightarrow"} \\ |
705 @{text "\<Longrightarrow>"} & @{verbatim "\\Longrightarrow"} & @{verbatim "==>"} \\[0.5ex] |
691 |
706 @{text "\<And>"} & @{verbatim "\\And"} & @{verbatim "!!"} \\ |
692 @{text "\<And>"} & @{verbatim "!!"} & @{verbatim "\\And"} \\ |
707 @{text "\<equiv>"} & @{verbatim "\\equiv"} & @{verbatim "=="} \\[0.5ex] |
693 @{text "\<equiv>"} & @{verbatim "=="} & @{verbatim "\\equiv"} \\ |
708 @{text "\<forall>"} & @{verbatim "\\forall"} & @{verbatim "!"} \\ |
694 |
709 @{text "\<exists>"} & @{verbatim "\\exists"} & @{verbatim "?"} \\ |
695 @{text "\<forall>"} & @{verbatim "!"} & @{verbatim "\\forall"} \\ |
710 @{text "\<longrightarrow>"} & @{verbatim "\\longrightarrow"} & @{verbatim "-->"} \\ |
696 @{text "\<exists>"} & @{verbatim "?"} & @{verbatim "\\exists"} \\ |
711 @{text "\<and>"} & @{verbatim "\\and"} & @{verbatim "&"} \\ |
697 @{text "\<longrightarrow>"} & @{verbatim "-->"} & @{verbatim "\\longrightarrow"} \\ |
712 @{text "\<or>"} & @{verbatim "\\or"} & @{verbatim "|"} \\ |
698 @{text "\<and>"} & @{verbatim "&"} & @{verbatim "\\and"} \\ |
713 @{text "\<not>"} & @{verbatim "\\not"} & @{verbatim "~"} \\ |
699 @{text "\<or>"} & @{verbatim "|"} & @{verbatim "\\or"} \\ |
714 @{text "\<noteq>"} & @{verbatim "\\noteq"} & @{verbatim "~="} \\ |
700 @{text "\<not>"} & @{verbatim "~"} & @{verbatim "\\not"} \\ |
715 @{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\ |
701 @{text "\<noteq>"} & @{verbatim "~="} & @{verbatim "\\noteq"} \\ |
716 @{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\ |
702 @{text "\<in>"} & @{verbatim ":"} & @{verbatim "\\in"} \\ |
|
703 @{text "\<notin>"} & @{verbatim "~:"} & @{verbatim "\\notin"} \\ |
|
704 \end{tabular} |
717 \end{tabular} |
705 \medskip |
718 \medskip |
706 |
719 |
707 Note that the above abbreviations refer to the input method. The |
720 Note that the above abbreviations refer to the input method. The |
708 logical notation provides ASCII alternatives that often coincide, |
721 logical notation provides ASCII alternatives that often coincide, |
709 but deviate occasionally. This occasionally causes user confusion |
722 but deviate occasionally. This occasionally causes user confusion |
710 with very old-fashioned Isabelle source that use ASCII replacement |
723 with very old-fashioned Isabelle source that use ASCII replacement |
711 notation like @{verbatim "!"} or @{verbatim "ALL"} directly. |
724 notation like @{verbatim "!"} or @{verbatim "ALL"} directly in the |
|
725 text. |
|
726 |
|
727 On the other hand, coincidence of symbol abbreviations with ASCII |
|
728 replacement syntax syntax helps to update old theory sources via |
|
729 explicit completion (see also @{verbatim "C+b"} explained in |
|
730 \secref{sec:completion}). |
712 |
731 |
713 \end{enumerate} |
732 \end{enumerate} |
714 |
733 |
715 Raw Unicode characters within prover source files should be |
|
716 restricted to informal parts, e.g.\ to write text in non-latin |
|
717 alphabets. Mathematical symbols should be defined via the official |
|
718 rendering tables, to avoid problems with portability and long-term |
|
719 storage of formal text. |
|
720 |
|
721 \paragraph{Control symbols.} There are some special control symbols |
734 \paragraph{Control symbols.} There are some special control symbols |
722 to modify the style of a single symbol (without nesting). Control |
735 to modify the display style of a single symbol (without |
723 symbols may be applied to a region of selected text, either using |
736 nesting). Control symbols may be applied to a region of selected |
724 the \emph{Symbols} panel or keyboard shortcuts or jEdit actions. |
737 text, either using the \emph{Symbols} panel or keyboard shortcuts or |
725 These editor operations produce a separate control symbol for each |
738 jEdit actions. These editor operations produce a separate control |
726 symbol in the text, in order to make the whole text appear in a |
739 symbol for each symbol in the text, in order to make the whole text |
727 certain style. |
740 appear in a certain style. |
728 |
741 |
729 \medskip |
742 \medskip |
730 \begin{tabular}{llll} |
743 \begin{tabular}{llll} |
731 style & \textbf{symbol} & shortcut & action \\\hline |
744 \textbf{style} & \textbf{symbol} & \textbf{shortcut} & \textbf{action} \\\hline |
732 superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{verbatim "isabelle.control-sup"} \\ |
745 superscript & @{verbatim "\<^sup>"} & @{verbatim "C+e UP"} & @{verbatim "isabelle.control-sup"} \\ |
733 subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{verbatim "isabelle.control-sub"} \\ |
746 subscript & @{verbatim "\<^sub>"} & @{verbatim "C+e DOWN"} & @{verbatim "isabelle.control-sub"} \\ |
734 bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{verbatim "isabelle.control-bold"} \\ |
747 bold face & @{verbatim "\<^bold>"} & @{verbatim "C+e RIGHT"} & @{verbatim "isabelle.control-bold"} \\ |
735 reset & & @{verbatim "C+e LEFT"} & @{verbatim "isabelle.control-reset"} \\ |
748 reset & & @{verbatim "C+e LEFT"} & @{verbatim "isabelle.control-reset"} \\ |
736 \end{tabular} |
749 \end{tabular} |
951 display is continuously updated according to @{system_option |
966 display is continuously updated according to @{system_option |
952 editor_chart_delay}. Note that the painting of the chart takes |
967 editor_chart_delay}. Note that the painting of the chart takes |
953 considerable runtime itself --- on the Java Virtual Machine that |
968 considerable runtime itself --- on the Java Virtual Machine that |
954 runs Isabelle/Scala, not Isabelle/ML. Internally, the |
969 runs Isabelle/Scala, not Isabelle/ML. Internally, the |
955 Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides |
970 Isabelle/Scala module @{verbatim isabelle.ML_Statistics} provides |
956 further access runtime statistics of Isabelle/ML. *} |
971 further access to statistics of Isabelle/ML. *} |
957 |
972 |
958 |
973 |
959 section {* Isabelle/Scala console *} |
974 section {* Isabelle/Scala console *} |
960 |
975 |
961 text {* The \emph{Console} plugin of jEdit manages various shells |
976 text {* The \emph{Console} plugin of jEdit manages various shells |
962 (command interpreters), e.g.\ \emph{BeanShell}, which is the |
977 (command interpreters), e.g.\ \emph{BeanShell}, which is the |
963 official jEdit scripting language, and the somewhat |
978 official jEdit scripting language, and the cross-platform |
964 platform-independent \emph{System} shell. Thus the console provides |
979 \emph{System} shell. Thus the console provides similar |
965 similar functionality than the special buffers @{verbatim |
980 functionality than the special buffers @{verbatim "*scratch*"} and |
966 "*scratch*"} and @{verbatim "*shell*"} in Emacs. |
981 @{verbatim "*shell*"} in Emacs. |
967 |
982 |
968 Isabelle/jEdit extends the repertoire of the console by |
983 Isabelle/jEdit extends the repertoire of the console by |
969 \emph{Scala}, which is the regular Scala toplevel loop running |
984 \emph{Scala}, which is the regular Scala toplevel loop running |
970 inside the \emph{same} JVM process as Isabelle/jEdit itself. This |
985 inside the \emph{same} JVM process as Isabelle/jEdit itself. This |
971 means the Scala command interpreter has access to the JVM name space |
986 means the Scala command interpreter has access to the JVM name space |