The forestalg GAP package

Author: Antoine Delignat-Lavaud
Current version: 1.11 (released April 2011)
License: GNU General Public License version 2 or any later version at your convenience.


1.11 - April, 2011
Added some logical tools
 << total depth-first order on nodes
 - right child relation
 || ancestor relation
Fixed a rare minimization bug
Improved compilation speed of logic

1.1 - March, 2011
Added monadic second order logic sentences
and compilation to forest automata
Slightly improved the determinization function

1.0 - August, 2010
First Version of the package


  1. The first step is to install GAP. Refer to for instructions on how to install GAP on your system.
  2. forestalg needs two third-party packages to work: automata ( and sgpviz ( Follow the specific installation steps for each of these packages in their respective documentation
  3. The two above packages depend on external software to work: graphviz ( and a PostScript viewer must be installed on your system and available in the PATH for your user. Note that neither are strictly required except for all drawing functions.
  4. To install forestalg itself, expand the package archive into the pkg/ directory of your GAP installation (this is platform dependent; refer to the GAP documentation for your system). If you installed GAP using the gap-core Debian or Ubuntu package, this directory is /usr/share/gap/pkg. On UNIX, if you don't have write access to this directory you can expand the archive in a subfolder gap/pkg/ of your home directory, or use the -l option of GAP to load the package from any directory.
  5. Before using the package, you must load it with the command LoadPackage("forestalg");