A Quick Introduction to TREEBAG

Frank Drewes


Below, you will find some brief instructions on how to install, run, and use TREEBAG. To learn more about TREEBAG, see the TREEBAG home page.

  1. Installation
    To install TREEBAG, simply download the system from the home page and store the file (which is a jar archive, called the TREEBAG archive below) on your computer.
  2. Running TREEBAG
    In order to execute TREEBAG, the Java runtime environment (version 1.4 or later) must be installed on your system. If this is the case, it should be sufficient to double-click the TREEBAG archive if you just want to start TREEBAG without an argument. However, you gain flexibility by executing TREEBAG from the command line. For this, let us assume that you have copied the TREEBAG archive to <my directory>/treebag.jar. Then you can start TREEBAG using the command
    java -jar <my directory>/treebag.jar [<worksheet>]

    where the last argument is optional and should, if present, be the file name of the TREEBAG worksheet to be opened (see below). Under Windows, you may prefer to substitute javaw for java in order to suppress the console window which the former opens (and you should probably use Windows' path separator character '\' instead of '/').

    To avoid running out of stack or memory space, it is advisable to start the Java interpreter using the options -Xss and -Xmx, e.g., -Xss8m (8MB stack space) and -Xmx800m (800MB memory limit). This would turn the basic command displayed above into

    java -Xss8m -Xmx800m -jar <my directory>/treebag.jar [<worksheet>].

    For convenience, one may define a small command called treebag or the like, which takes one optional argument and acts as an abbreviation for java -Xss8m -Xmx800m -jar <my directory>/treebag.jar. The way in which such a command can be defined (e.g., as a shell script under Unix, Linux, or Mac OS X) depends on the operation system used.
  3. Examples
    A wealth of examples related to picture generation can be found on the CD enclosed with the book Grammatical Picture Generation. The examples can also be downloaded from the web site related to the book.
  4. The TREEBAG worksheet
    The worksheet is the main window of TREEBAG. It allows the user to create and modify a graph consisting of TREEBAG components: tree generators (i.e., tree grammars and tree transducers), algebras, and so-called displays. The output of a tree generator can be fed into tree transducers and algebras; that of an algebra can be fed into displays. New input relations can be established by clicking first on the source and then on the target node. A double click on a node opens a control pane that allows you to interact with the respective component (in the case of displays, the first double click opens the associated window whereas the second opens its control pane). A double click on an unoccupied area of the worksheet opens a file selector that allows you to load another component. See the TREEBAG manual on how to define such components.
  5. Classes of tree grammars
    Below follows a brief description of the classes of tree grammars used in the examples on the CD mentioned above.

Back to main page