This program provides new labeling functions:
L is the list of variables.
Sym is the list of symmetries using predicates sym/2, sym/3 and group/1.
sym/2 and sym/3 are facts describing the symmetries using list(s)
of permutation over variables, values or couples variable/value (called
group/1 is a predicate which generates all symmetry predicates from
a list of symmetry generators. The order of variable in L must be the
same as the order chosen for
specify the symmetries.
Options is the list of labeling methods (like gprolog).
The specification of symmetries is very simple and several
methods exist. For help we will take the example
of n-queens, with n=4. L is a
list of four variables representing each row of the board,
each variable has a domain from 1 to 4, for each line (note that 0 is
added for specify symmetries).
There are eight obvious geometric symmetries (with the identity but
which doesn't be specified).
In the general case each (variable,value) couple is
converted in a point :
where ivar is the position of the variable in L. So
in the list LPoint the ith element takes the value of its symmetric
point. All points must be in the list, even the constant point.
ex: horizontal symmetry (variable 1
permutes with 4, 2 with 3).
Note: the values are between 0 and the maximum of all domains.
In the case of just a permutation in variables or/and values it's not
necessary to specifiy all points. So LVar and
LVal contain the list of (resp) variables and values permutations.
ex: horizontal symmetry:
forms sym(point_red,LPointRed), sym(varval_red, LVarRed, LValRed):
It's possible to specify only the permuted points. The lists
LPointRed, LVarRed and LValRed contain cycles of
permuted points, variables or values.
For the cycles, list [a1,...,an] means "a1 becomes a2 becomes
... an becomes a1".
Local symmetries allows to specify a variable (resp. value) symmetry
just for some values (resp. variables),
LocalVal (resp. LocalVar) contains only concerned values (resp.
is a special case where all values except 0 are considered)
vertical symmetry (line 1 permute with 4 and 2 with
is a special case where all variables are considered)
group of symmetries group(Sym):
group indicates that program must build all symmetries from generators
contained in Sym with any representation
ex: group of horizontal and
vertical symmetries (must generates the 180° rotation)
The symmetrie wich corresponds to 180° rotation, like the two
generators, are stored in the data structure of the program
and add to the other symmetries already specified. But the user have no
access (for the moment) to the generated predicates.
The options of labeling are :
standard : leftmost variable is selected (default mode).
max : from the
greatest variable to
middle: from the middle variableto
bounds: from the bounds variableto
min : from the smallest value to the greatest (default mode).
max : from the greatest valueto
middle: from the middle valueto
bounds: from the bounds valueto
random: enumerates the values randomly, each value is only tried once.