System Overview

The LMNtal compiler (lmnc) first compiles LMNtal source files into
intermediate code. It then translates the intermediate code
into Java programs,
which is in turn compiled into Java bytecode and packaged into a
.jar (Java archive) file.

You can also execute the intermediate code
interpretively (rather than translating them into Java)
by using the lmntal command or lmnc with the --interpret option.

When invoked without a source filename, the LMNtal system
enters the read-eval-print loop (REPL) mode in which expressions
are executed interpretively.

The system comes with a library API.
In addition, you can define your own libraries to be
used with your programs.
See How to create libraries (below) for details about libraries.

LMNtal programs transtaled into Java bytecode run an order of
magnitude faster than the interpreted intermediate code.

How to Use

(Note to Cygwin users: When you run LMNtal (version 0.80 or earlier) on Cygwin, please use lmnc_cyg, lmnr_cyg, and lmntal_cyg
instead of lmnc, lmnr, and lmntal. The _cyg suffix is not necessary for version 0.81 and up.)

Execution

Interactive execution (Read-Eval-Print loop)

$ lmntal

The system enters the interactive when a filename is not specified
in the command line.
Enter an LMNtal expression (that can spread over multiple lines)
and hit the return key twice to execute it.
you can also tell the system to start execution with one newline by
giving the --immediate option.

0: (default) use an atom stack for each membrane
(atoms are selected in a LIFO manner)
1: atoms are selected in a system-defined order
(which is not random or LIFO)
2: select atoms and membranes randomly from a membrane
3: select atoms, membranes and rules randomly from a membrane

The graphical Mode (experimental) visualizes program execution.
A graphical window will be displayed that visualizes the
evolution of hierarchical graph structure.
Computation proceeds step by step by pressing the space bar or
clicking on the 'Go ahead' button.
Atoms can be dragged to arbitrary positions so that the graph
may look better.
To terminate the execution, close the window manually.

System rulesets

A system ruleset is a set of global rules, namely
rules applicable to every place in the membrane structure.
For instance, built-in arithmetics (that evaluates
x=1+2*3 to x=7, for example) is implemented as
system rulesets.

A programmer can define his/her own system ruleset by
defining the system_ruleset module.