We will be using the Twelf system, which is an implementation of a logical framework (LF), a constraint logic programming language (Elf), and a meta-theorem prover. Below is a quick introduction. For more information see the Twelf home page and the User's Guide for Version 1.3
The executable files you need are installed in the Andrew and CS domains at CMU. You have the choice to run Twelf within Emacs or directly from a shell by typing in the full path name. We recommend running Twelf within Emacs.
/afs/cs.cmu.edu/user/fp/courses/comp-ded/elf/mini-ml/
To run Twelf within emacs, you need to add the following line to
your .emacs
file:
(load "/afs/cs/local/twelf/common/andrew/emacs/twelf-init.el")
You can then continue and run the Twelf Server or the SML interface within Emacs:
M-x twelf-server
M-x twelf-sml
M-x twelf-mode
M-x twelf-info
You can also run Twelf from a shell by providing the full path to the Twelf Server or SML interface.
/afs/cs/local/twelf/common/andrew/bin/twelf-server
/afs/cs/local/twelf/common/andrew/bin/twelf-sml
To run Twelf within Emacs, you need to add the following line to your
.emacs
file:
(load "/usr/local/lib/twelf/emacs/twelf-init.el")
You can then continue and run the Twelf Server or the SML interface within Emacs:
M-x twelf-server
M-x twelf-sml
M-x twelf-mode
M-x twelf-info
You can also run Twelf from a shell by providing the full path to the twelf server and / or SML interface.
twelf-server
twelf-sml
If you would like to install Twelf on your own machine, please follow the instructions on the Twelf home page.
Step 1: First, copy the files from the Mini-ML (directory
/afs/cs.cmu.edu/user/fp/courses/comp-ded/elf/mini-ml/
) to
your directory. We assume your .emacs
file is set up as
described above and your are visiting the file mini-ml.elf
.
The current query or declaration refers to the one under the cursor in
the current buffer.
Step 2: You can type-check and load the current configuration
by typing C-c C-c
. Twelf will then ask what config file to
use. The default config file is sources.cfg
.
Step 3: To execute some example queries, load the file
examples.quy
. You can execute a single query by placing your
cursor in the line of the query and typing C-c C-d
. You can
also execute the whole file by typing C-c C-s
.
C-c C-c ; type-check and load current configuration C-c C-d ; execute current query C-c C-s ; execute current file
If you are using XEmacs, then you do not actually need to remember all these short-cuts. The tool bar at the top of your xemacs has an item for Twelf which contains the most important commands you need to know.
For a more detailed explanation on how to use Twelf, please consult the Twelf User's Guide (PS, PDF). In particular, there is a Emacs command summary which you might find very useful.
[ Home | Schedule | Assignments | Handouts | Software | Overview ]
fp@cs
Frank Pfenning