Global Variables
Getting information about polymake output
If set to at least 2, the output of polymake is shown. At level 1, warnings are shown. This is the default. And at level 0, the polymake package remains silent.
Contains a string that explains the last occurence of fail as a return value of .
Variables for system interaction

The variables for interaction with the system are contained in the file environment.gi. Each of these variables has a function to set it, see . If POLYMAKE&uscore;COMMAND or POLYMAKE&uscore;DATA&uscore;DIR are set at startup, they are not overwritten. So if you don't want (or don't have the rights) to modify environment.gi, you can set the variables in your .gaprc file.

This variable should contain the name of the polymake program in the form as returned by Filename So a probable value is Filename(Directory("/usr/local/bin"),"polymake").
In this directory the files for polymake will be created. By default, this generates a temporary directory using DirectoryTemporary
Converting Polymake Output
The General Method

When polymake is called, its output is read as a string and then processed as follows:

the lines containing upper case letters are found. These are treated as lines containing the keywords. Each of those lines marks the beginning of a block of data.
The string is then cut into a list of blocks (also strings). Each block starts with a line containing the keyword and continues with some lines of data.
for each of the blocks, the appropriate function of ObjectConverters is called. Here "appropriate" just means, that the keyword of the block coincides with the name of the function.
The output of the conversion function is then added to the known properties of the PolymakeObject for which Polymake was called.
Converter- Philosopy

The converter functions should take meaningful polymake data into meaningful &GAP; data. This sometimes means that the (mathematical) representation is changed. Here is an example: polymake writes vectors as augmented affine vectors of the form `1 a1 a2 a3...` which does not go very well with the usual &GAP; conventions of column vectors and multiplying matrices from the right. So `polymaking` converts such a vector to `[a1,a2,a3,...]` and the user is left with the problem of augmentation and left or right multiplication.

Another area where the &GAP; object isn't a literal translation from the polymake world is combinatorics. In Polymake, list elements are enumerated starting from 0. &GAP; enumerates lists starting at 1. So the conversion process adds 1 to the numbers corresponding to vertices in facet lists, for example.

The conversion process is done by the following methods:

Record having polymake keywords as entry names and the respective converted polymake output as entries.

Given a the output of the polymake program as a string string, this method first calls . For each of the returned blocks, the name (=first line) of the block is read and the record is looked up for an entry with that name. If such an entry exists, it (being a function!) is called and passed the block. The returned value is then given the name of the block and added to the record returned by ConvertPolymakeOutputToGapNotation.

List of strings -- "blocks"--
The string string is cut at the lines starting with an upper case character and consisting only of upper case letters, numbers and underscore (&uscore;) characters. The parts are returned as a list of strings. The initial string string remains unchanged.
The entries of this record are labeled by polymake keywords. Each of the entries is a function which converts a string returned by polymake to &GAP; format. So far, only a few converters are implemented. To see which, try RecNames(ObjectConverters); You can define new converters using the basic functions described in section .
Conversion Functions

The following functions are used for the functions in .

The string string is converted to a rational number. Unlike Rat, it tests, if the number represented by string is a floating point number an converts it correctly. If this is the case, a waring is issued.
If list contains a single string, this string is converted into a number using .
Tries to decide if the list list of strings represents a matrix or a list of sets by testing if they start with "{". It then calls either or . The "PlusOne" version calls if list represents a list of sets.
The list list of strings is interpreted as a list of row vectors and converted into a matrix.

The "KillOnes" version removes the leading ones.
As the corresponding "Matrix" version. Just for vectors. ConvertPolymakeIntVectorToGAPPlusOne requires the vector to contain integers. It also adds 1 to every entry.
If list contains a single string, which is either 0,false,1, or true this function returns false or true, respectively.

Let list be a list containing a single string, which is a list of numbers separated by whitespaces and enclosed by &obrace; and &cbrace; . The returned value is then a set of rational numbers (in the GAP sense).

Let list be a list containing several strings representing sets. Then each of these strings is converted to a set of rational numbers and the returned value is the list of all those sets. The "PlusOne" version adds 1 to every entry.

Let list be a list of strings representing sets (that is, a list of integers enclosed by &obrace; and &cbrace;). Then a record is returned containing two sets named .vertices and .edges.