Using Isabelle with Isamode, you interact in a shell-like buffer based
on the Emacs command-interpreter package, comint
. The same
package lies behind the shell mode in Emacs. The comint
package
has many useful features. For example, there is a command history ring,
accessed with the keys M-p (comint-previous-input
) and
M-n (comint-next-input
). Another feature is
context-sensitive completion, used in Isamode for filenames and ML
identifiers.
You can find out more about comint
by reading the documentation
in the file `comint.el' or, as usual, using C-h m
(describe-mode
) to show the keys and commands available. Many of
the commands are also available on pull-down menus.
The main command to start Isabelle is M-x isabelle.
*logic*
.
See below for more details about how to select a logic.
M-x isabelle behaves as other similar Emacs commands: if there is
already a buffer *logic*
, then isabelle logic
will switch to that buffer (and its associated buffers). But it is
perfectly possible to have more than one Isabelle session with the same
logic -- you simply rename the first buffer.
If you type M-x isabelle
you are prompted for a logic name; you
may hit SPC for a list of possibilities. Alternatively,
selecting `Session' from the Isabelle menu will also display a sub-menu
of logic names. The list shown will contain all the object logics found
when Isamode was started. Object logics
are searched for using the Isabelle tool isatool findlogics
.
If you want to use a newly built logic which isn't in the completion
list, typing C-u M-x isabelle will run the command isatool
findlogics
again to update the internal record of object logics
available. (Note: this doesn't rebuild the menu at present).
The command M-x isabelle calls the internal function
isabelle-session
, which may be useful if you wish to write
special start-up scripts for Emacs to fire-up Isabelle, or define keys
to switch to a particular logic session.
*logic*
.
The default value is set via the Isabelle settings environment, to be the value of the environment variable ISAMODE_prelude. An example setting is:
ISAMODE_PRELUDE='use "/home/da/isabelle/startup.ML";'
which attempts to read in a file `startup.ML' from my Isabelle directory. You might set this variable in the private settings file `$ISABELLE_HOME_user/etc/settings'.
note: the string is sent silently; make sure it is properly terminated and doesn't lead to errors - you won't see the results of executing it!
Completion is not implemented for rule names because typically they are short, and may be displayed in a rule table anyway (see section 4. Rule tables).
Isabelle uses ML strings to represent types and terms of the meta-logic. Terms and types can be very long strings which are easier to read, type and edit if they span several lines. ML strings which span lines must contain the escape sequence `\ \' to indicate to the ML parser that the carriage return is not part of the string and that the string will be continued on the next line.
When you are inputting such strings it is annoying to need to remember to include these backslashes. So Isamode makes the job easy for you by doing it automatically, both in interaction buffers, and inside `.thy' files (see section 6.1 Editing theory files).
If you type RET at the end of a line which contains an unclosed string, Isamode will insert a backslash (if you haven't done already) before sending it to the ML process. Another backslash will be inserted on the following line.
If you don't like this behaviour, you can disable it by customizing isa-auto-backslashes.
Isamode provides a main menu, called `Isabelle', which appears by
default in Isabelle interaction buffers and theory file buffers. After loading
Isamode, it will also appear in ML buffers, if you use sml-mode
(see section 6.2 Editing ML files). To add the main menu to the menubar of the current
buffer in other cases, there is a command, M-x isa-menus.
The main menu has options for starting Isabelle sessions, displaying documentation, or engaging various editing functions (see section 6. Theory and ML files). In addition to the `Isabelle' menu, there are four menus provided for interaction mode.
The convention for the Isabelle command key sequences is:
The commands are shown in full in section 2.6 Interaction mode menu operations.
Here's a list of the Isamode interaction buffer commands in the `Goal', `Prover' and `Tactic' menus. We show the text they insert, and the keystrokes bound to the commands by default. In the table, d stands for the designated subgoal (see section 3.1 Proofstate Commands -- don't forget C-up and C-down). rules, thmname, etc, stand for some data that must be typed to complete the command. If there is no data needed, the text may be sent immediately to Isabelle; otherwise you should type something followed by RET.
isa-resolve_tac
by (resolve_tac [rules] d);
isa-resolve_tac-prems
by (resolve_tac prems d);
isa-assume_tac
by (assume_tac d);
isa-eresolve_tac
by (eresolve_tac [rules] d);
isa-dresolve_tac
by (dresolve_tac [rules] d);
isa-forward_tac
by (forward_tac [rules] d);
isa-match_tac
by (match_tac [rules] d);
isa-match_tac-prems
by (match_tac prems d);
isa-eq_assume_tac
by (eq_assume_tac [rules] d);
isa-ematch_tac
by (ematch_tac [rules] d);
isa-dmatch_tac
by (dmatch_tac [rules] d);
isa-rewrite_goals_tac
by (rewrite_goals_tac [rules]);
isa-rewrite_tac
by (rewrite_tac [rules]);
isa-fold_goals_tac
by (fold_goals_tac [rules]);
isa-cut_facts_tac
by (cut_facts_tac [rules] d);
isa-cut_facts_tac-prems
by (cut_facts_tac prems d);
isa-simp_tac
by (simp_tac simpset_ss d);
isa-asm_simp_tac
by (asm_simp_tac simpset_ss d);
isa-asm_full_simp_tac
by (asm_full_simp_tac simpset_ss d);
isa-fast_tac
by (fast_tac claset_cs d);
isa-best_tac
by (best_tac claset_cs d);
isa-step_tac
by (step_tac claset_cs d);
isa-contr_tac
by (contr_tac d);
isa-mp_tac
by (mp_tac d);
isa-eq_mp_tac
by (eq_mp_tac d);
isa-undo
undo();
isa-back
back();
isa-chop
chop();
isa-choplev
choplev lev;
isa-goal-thy
val prems = goal thy "goal";
isa-goalw-thy
val prems = goalw thy rewrites "goal";
isa-result
val thmname = result();
isa-push-proof
push_proof();
isa-pop-proof
val prems = pop_proof();
isa-rotate-proofs
val prems = rotate_proof();
Go to the first, previous, next, last section, table of contents.