[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you are working with large proof developments, you may want to know about the advanced script management features of Proof General covered in this chapter.
Large developments may contain files with many long proofs. Proof General provides functions that let you hide completed proofs from view, temporarily.
Large proof developments are typically spread across various files which depend on each other in some way. Proof General knows enough about the dependencies to allow script management across multiple files. With large developments particularly, users may occasionally need to escape from script management, in case Proof General loses synchronization with the proof assistant. Proof General provides you with several escape mechanisms if you want to do this.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Large developments may consist of large files with many proofs. To help see what has been proved without the detail of the proof itself, Proof General can hide portions of the proof script. Two different kinds of thing can be hidden: comments and (what Proof General designates as) the body of proofs.
You can toggle the visibility of a proof script portion by using the
context sensitive menu triggered by clicking the right mouse button
on a completed proof, or the key C-c v, which runs
pg-toggle-visibility
.
You can also select the "disappearing proofs" mode from the menu,
Proof-General -> Options -> Disappearing Proofs |
This automatically hides each the body of each proof portion as it is completed by the proof assistant. Two further menu commands in the main Proof-General menu, Show all and Hide all apply to all the completed portions in the buffer.
Notice that by design, this feature only applies to completed proofs, after they have been processed by the proof assistant. When files are first visited in Proof General, no information is stored about proof boundaries.
The relevant elisp functions and settings are mentioned below.
Toggle visibility of region under point.
Display all completed proofs in the buffer.
Hide all completed proofs in the buffer.
Non-nil causes Proof General to hide proofs as they are completed.
The default value is nil
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Basic modularity in large proof developments can be achieved by splitting proof scripts across various files. Let's assume that you are in the middle of a proof development. You are working on a soundness proof of Hoare Logic in a file called(5) `HSound.l'. It depends on a number of other files which develop underlying concepts e.g. syntax and semantics of expressions, assertions, imperative programs. You notice that the current lemma is too difficult to prove because you have forgotten to prove some more basic properties about determinism of the programming language. Or perhaps a previous definition is too cumbersome or even wrong.
At this stage, you would like to visit the appropriate file, say `sos.l' and retract to where changes are required. Then, using script management, you want to develop some more basic theory in `sos.l'. Once this task has been completed (possibly involving retraction across even earlier files) and the new development has been asserted, you want to switch back to `HSound.l' and replay to the point you got stuck previously.
Some hours (or days) later you have completed the soundness proof and are ready to tackle new challenges. Perhaps, you want to prove a property that builds on soundness or you want to prove an orthogonal property such as completeness.
Proof General lets you do all of this while maintaining the consistency between proof script buffers and the state of the proof assistant. However, you cannot have more than one buffer where only a fraction of the proof script contains a locked region. Before you can employ script management in another proof script buffer, you must either fully assert or retract the current script buffer.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Proof General tries to be aware of all files that the proof assistant has processed or is currently processing. In the best case, it relies on the proof assistant explicitly telling it whenever it processes a new file which corresponds(6) to a file containing a proof script.
If the current proof script buffer depends on background material from other files, proof assistants typically process these files automatically. If you visit such a file, the whole file is locked as having been processed in a single step. From the user's point of view, you can only retract but not assert in this buffer. Furthermore, retraction is only possible to the beginning of the buffer.
Unlike a script buffer that has been processed step-by-step via Proof General, automatically loaded script buffers do not pass through a "red" phase to indicate that they are currently being processed. This is a limitation of the present implementation. Proof General locks a buffer as soon as it sees the appropriate message from the proof assistant. Different proof assistants may use different messages: either early locking when processing a file begins (e.g. LEGO) or late locking when processing a file ends (e.g. Isabelle).
With early locking, you may find that a script which has only been partly processed (due to an error or interrupt, for example), is wrongly completely locked by Proof General. Visit the file and retract back to the start to fix this.
With late locking, there is the chance that you can break synchronization by editing a file as it is being read by the proof assistant, and saving it before processing finishes.
In fact, there is a general problem of editing files which may be processed by the proof assistant automatically. Synchronization can be broken whenever you have unsaved changes in a proof script buffer and the proof assistant processes the corresponding file. (Of course, this problem is familiar from program development using separate editors and compilers). The good news is that Proof General can detect the problem and flashes up a warning in the response buffer. You can then visit the modified buffer, save it and retract to the beginning. Then you are back on track.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Make sure that the current script buffer has either been completely asserted or retracted (Proof General enforces this). Then you can retract proof scripts in a different file. Simply visit a file that has been processed earlier and retract in it, using the retraction commands from see section Script processing commands. Apart from removing parts of the locked region in this buffer, all files which depend on it will be retracted (and thus unlocked) automatically. Proof General reminds you that now is a good time to save any unmodified buffers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Make sure that the current script buffer has either been completely asserted or retracted. Then you can assert proof scripts in a different file. Simply visit a file that contains no locked region and assert some command with the usual assertion commands, see section Script processing commands. Proof General reminds you that now is a good time to save any unmodified buffers. This is particularly useful as assertion may cause the proof assistant to automatically process other files.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To make it easier to adapt Proof General for a proof assistant, there is another possibility for multiple file support -- that it is provided automatically by Proof General and not integrated with the file-management system of the proof assistant.
In this case, Proof General assumes that the only files processed are the ones it has sent to the proof assistant itself. Moreover, it (conservatively) assumes that there is a linear dependency between files in the order they were processed.
If you only have automatic multiple file handling, you'll find that any files loaded directly by the proof assistant are not locked when you visit them in Proof General. Moreover, if you retract a file it may retract more than is strictly necessary (because it assumes a linear dependency).
For further technical details of the ways multiple file scripting is configured, see Handling multiple files in the Adapting Proof General manual.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Occasionally you may want to review the dialogue of the entire session with the proof assistant, or check that it hasn't done something unexpected. Experienced users may also want to directly communicate with the proof assistant rather than sending commands via the minibuffer, see section Proof assistant commands.
Although the proof shell is usually hidden from view, it is run in a buffer which provides the usual full editing and history facilities of Emacs shells (see the package `comint.el' distributed with your version of Emacs). You can switch to it using the menu:
Proof-General -> Buffers -> Shell |
Warning: you can probably cause confusion by typing in the shell buffer! Proof General may lose track of the state of the proof assistant. Output from the assistant is only fully monitored when Proof General is in control of the shell. When in control, Proof General watches the output from the proof assistant to guess when a file is loaded or when a proof step is taken or undone. What happens when you type in the shell buffer directly depends on how complete the communication is between Proof General and the prover (which depends on the particular instantiation of Proof General).
If synchronization is lost, you have two options to resynchronize. If you are lucky, it might suffice to use the key:
proof-frob-locked-end
This command is disabled by default, to protect novices using it accidently.
If proof-frob-locked-end
does not work, you will need to restart
script management altogether (see section Proof assistant commands).
Move the end of the locked region backwards to regain synchronization.
Only for use by consenting adults.
This command can be used to repair synchronization in case something goes wrong and you want to tell Proof General that the proof assistant has processed less of your script than Proof General thinks.
You should only use it to move the locked region to the end of a proof command.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
During the development of Proof General, we experiment with new features in the interface. The particular features available the version of Proof General you have are described in the file `README.exper' which is included in the distribution.
The experimental features are automatically enabled in development releases of Proof General, but disabled in the stable releases. To adjust the setting, customize the variable below. After changing the setting you should restart Proof General to see (or remove) the new features.
Whether to enable certain features regarded as experimental.
Proof General includes a few features designated as "experimental".
Enabling these will usually have no detrimental effects on using PG,
but the features themselves may be buggy.
We encourage users to set this flag and test the features, but being aware that the features may be buggy (problem reports and suggestions for improvements are welcomed).
The default value is t
.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by David Aspinall on November, 7 2006 using texi2html 1.76.