The Forlan Project (Version 3.1)


Introduction

The Forlan Project consists of a toolset (called Forlan) for experimenting with formal languages, a draft textbook entitled Formal Language Theory: Integrating Experimentation and Proof, and associated lecture slides. The toolset and lecture slides are released under free software/documentation licenses. The final version of the book will be published by Cambridge University Press.

The Forlan toolset is implemented as a set of Standard ML (a functional programming language) modules. It's used interactively. In fact, a Forlan session is nothing more than a Standard ML session in which the Forlan modules are available.

Resources

Standard ML

Very little knowledge of Standard ML is required in order to use Forlan in simple ways. But users who are more familiar with ML will be able to use Forlan in more sophisticated ways.

The book assumes no previous knowledge of Standard ML. In order to understand and extend the implementation of Forlan, though, one must have a good working knowledge of Standard ML.

More information about SML can be obtained from Robert Harper's draft book Programming in Standard ML. Alternatively, one can read one of the following books:

People who are already familiar with Objective Caml (OCaml), can consult a comparison of Objective Caml and Standard ML.

Forlan is used in conjunction with the Standard ML of New Jersey (SML/NJ) compiler, which can be obtained from the following site: www.smlnj.org. Click on "Downloading SML/NJ Software for Unix or Windows", and then on "Working Versions". Install Version 110.65 or greater of the compiler. (The current "release" (110.0.7) is seriously out-of-date, and Forlan won't compile under it.)

The Standard ML Basis Library is included as part of the SML/NJ distribution and contains many useful functions.

The best way to run ML is as a sub-process of the Emacs text editor, using the SML mode for Emacs. If you install Forlan on your machine (see below), you can make Emacs run forlan instead of sml by adding

  (setq sml-program-name "forlan")

to your .emacs file.

Forlan Manual

A manual for Version 3.1 of Forlan is available. The manual is also available as a compressed tarball, and as a zip archive. The root HTML file is index.html

JFA - a Java Graphical Editor for Finite Automata

JFA is a Java program for creating and editing Forlan finite automata. It can be invoked by Forlan or run as a standalone application. It was designed and implemented by Leonard Lee, as his honors research project during his studies at K-State.

JTR - a Java Graphical Editor for Regular Expression and Parse Trees

JTR is a Java program for creating and editing Forlan regular expression and parse trees. It can be invoked by Forlan or run as a standalone application. It was designed and implemented by Jessica Sherrill, as her honors research project during her studies at K-State.

Installing Forlan on Linux, Mac OS X and Windows

Here are instructions for downloading and installing Forlan Version 3.1 on a machine running Linux, Mac OS X or Windows.

The instructions that follow assume that SML/NJ (version 110.65 or greater) has been installed in the directory/folder:

Linux/Mac OS X /usr/local/smlnj
Windows c:\sml

If you install SML/NJ somewhere else, you'll have to modify the instructions accordingly. But you'll also have to make appropriate edits to the script forlan (under Linux/Mac OS X) or forlan.bat (under Windows).

Installing Forlan under Linux and Mac OS X

Transfer the compressed tarball forlan-min-src-3.1.tgz to a temporary directory. (This tarball contains the minimum source needed to compile Forlan. If you plan to make changes to Forlan, you should get the full source. See below.) Then, run the following commands, after changing directory to the temporary directory:

  gunzip forlan-min-src-3.1.tgz
  tar xf forlan-min-src-3.1.tar
  cd forlan-min-src-3.1
  ./build-heap-image

This will cause an SML/NJ heap image for Forlan to be written to the file forlan.x86-linux (Linux), forlan.ppc-darwin (Mac OS X PowerPC) or forlan.x86-darwin (Mac OS X Intel).

Then move the bash shell script forlan to /usr/local/bin, and move the heap image to /usr/local/smlnj/bin/.heap.

Installing Forlan under Windows

Transfer the zip archive forlan-min-src-3.1.zip to a temporary directory (folder). (This zip archive contains the minimum source needed to compile Forlan. If you plan to make changes to Forlan, you should get the full source. See below.) Extract the directory forlan-min-src-3.1 from this archive.

Then, run the following commands, after changing directory to the temporary directory:

  cd forlan-min-src-3.1
  sml
  Control.trackExn := false;
  CM.make "forlan.cm";
  open TopLevel;
  Export.export();

This will cause an SML/NJ heap image for Forlan to be written to the file forlan.x86-win32.

Then move the shell script forlan.bat to the directory c:\sml\bin, and move the heap image to the directory c:\sml\bin\.heap.

Create a desktop and/or startup menu shortcut to the command

  c:\sml\bin\forlan.bat

Set the working directory for the shortcut to the one where your personal SML and Forlan files will reside.

Forlan Project Distribution

Version 3.1 of the Forlan Project distribution is available as a compressed tarball. The distribution contains:

The toolset and lecture slides are released under the GNU General Public License and the GNU Free Documentation License, respectively. The final version of the book will be published by Cambridge University Press.


Alley Stoughton (stough@cis.ksu.edu)
Valid XHTML 1.0!   Valid CSS!