Rules are called all the information about the problem domain (in our case the geometry of convex polyhedra) polymake needs to response adequately to user's requests. They include descriptions of properties, algorithms computing new properties, as well as some technical staff.

Rules are kept in special rule files. A rule file has nearly the same format as the data files: it consists of sections separated by empty lines. The first line of a section is called rule header, the rest makes up the rule body. Long header lines can be broken into several lines, placing the continuation character \ at the end of each but the last line. Comments can be scattered everywhere in the rule file; they are recognized by the leading # character.

Polymake parses the rule files (either specified in the argument list or the default file poly.rules) during the startup, before it reads the data file.

There are several kinds of sections that may occur in a rule file. They are recognized by the header syntax. In the simplest case it is a fixed keyword staying alone in the header line.

BEGIN
The body is evaluated as perl code. The compilation environment is
package Rules; use strict;
There may be as many separate BEGIN sections as needed. They are evaluated in the order of their occurence in the rule files. Usually these sections define subroutines and global constants shared by several rules.
INCLUDE
The body lists additional files contributing to the rule base. File names can be separated by white spaces or put each on a new line. Each included file is read in only once, so the same file can be safely repeated in several INCLUDE sections. The inclusion nesting depth is not limited.
polymake seeks for the files being included at various locations, depending on the path spelling: The name of the included file name determines also how polymake will parse it. The rule files are recognized by the suffix .rules. Any other names lead polymake to suppose that the file is a normal perl script, and thus it parses it much the same way as the require directive does.
USE
The body consists of names of additional building blocks contributing clients and/or perl modules to the application. This rule does nothing but expands the list of directories searched for INCLUDE by the perl subdirectories found beneath installation directory/modules.
HELP
The body can contain some descriptive text about the rule file. It will be printed on stderr if polymake is called in --help mode. In the meanwhile, these sections became nearly out of use, as the whole helpful (as we hope) documentation has been migrated to HTML files.
section property_name
The body declares a section.
filter name
The body defines a printing filter.

All other sections are treated as production rules.