Each property mentioned in the production rules must be previously declared. A declaration section looks as follows:
section property_name
%description=('group' => text, ...);
$type="type";
$weight="x.y";
$temporary=value;
$synchronize{primary_property}=subroutine reference;
optional subroutines
The body of the section is evaluated as one piece of perl code, so all valid perl constructs can be used therein. The only exception is that it may not contain empty lines, since they would break the body into several sections.
pseudo specifies
a pseudo-target.
Properties of a polyhedron are considered mutually consistent as long as they are created new by the rules. As explained in the discussion about production rules, each property is created once, and never changes afterwards, even if several rules were executed later, which also could create it. There is an exception, however, caused by explicit usage of pseudo-targets. If a rule the psedo-target is assigned to is allowed to rewrite a property, which was earlier used to compute other properties, there can arise an inconsistence between them, if there can be more than one valid data representation of the rewritten property.
The most popular examples are VERTICES and FACETS: various convex hull computation algorithms may generate them in different order. But other properties, such as VERTICES_IN_FACETS, GRAPH, and so on, become invalid if the order of vertices or facets changes.
Such properties, being sensitive to a particular representation of another (primary) property, are called dependent. In the previous polymake versions, dependent properties were simply deleted as soon as the primary property was rewritten, and had to be created again when needed. Now this behavior is considered wasteful, so a new synchronization mechanism has been introduced, which comprises a couple of special subroutines defined within the declarations of concerned properties.
To express the dependence of a property on another one, a synchronization subroutine must
be defined and a reference to it stored in %synchronize hash table
under the key equal to the name of the primary property.
The primary property should in turn define a sub diff:
comparison subroutine for two representations of the property.
The calling convention for these subroutines is as follows:
die
with an appropriate message. In this case the synchronization becomes impossible, and
all dependent properties will be deleted.
die, in which case the synchronization will be considered failed and the
dependend property deleted.
die with an appropriate diagnostic message.