COMP 523: Language-based Security
Home : Course Information : Schedule : Assignments : Handouts : Resources

Resources -- Winter 2008

Twelf

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. You may also find the Twelf Wiki useful.

To run Twelf in the SOCS-domain, you need to add the following to your .emacs or .xemacs/init.el file:

;; ============================
;; Twelf
;; ============================

(setq load-path (cons "/usr/share/twelf/emacs/" load-path))

(setq twelf-root "/usr/share/twelf/")


;;; own version of twelf-init

(load "/usr/share/twelf/emacs/twelf-init.el")

Twelf Resources

  • Twelf Project
  • Standard ML
  • Standard ML

    Standard ML is a safe, modular, strict, functional, polymorphic programming language with compile-time type checking and type inference, garbage collection, exception handling, immutable data types and updatable references, abstract data types, and parametric modules. It has efficient implementations and a formal definition with a proof of soundness. For more information:

    Recommended gentle introductions:

    Recommended books and other documents:

    Programming Contests

    Once you have mastered SML, you may be intrigued by the ICFP Programming contest held every year. Check it out here! Note that this contest does not require you to program in a functional language, but nevertheless many people choose a functional language.

    Using SML in emacs or xemacs:

    Basics on how to use SML within SOCS McGill

    SML has been installed on the lab machines and you should be able to start the SML compiler by logging into one of these machines and then typing sml in a shell.

    To run the code provided, you should first change to the directory where your sml code resides. Then you can start the sml compiler by typing sml. To compile the code provided, just type CM.make "sources.cm";

    If you have started the sml compiler in a different directory than your code, you must change to correct directory. Within sml you can type the following:

    How to change the printing depth in SML 110.55?

    If you want to print back the results of some evaluation and you only see # where you expect some expression, then you may want to change the print depth of the sml compiler.

    Alternatively, you can set the depth at startup using the -Cxxx=yyy command line switch:

    sml -Cprint.depth=100

    Run

    sml -H

    to see a list of all such options.