The :relation keyword occurs in a position list. It takes one parameter, a relation specifier. A relation specifier is a list denoting parameters to the relation keyword.
Example:
(position :relation (:missingpiececount ○ 1 unlimited))
This position list searches for games in which two positions are the same except that the later one is missing one or more white pieces.
The operation of the :relation tag is as follows. A position list with a relation tag matches a position P1 if and only if at some later point in the current game there is a position P2 such that the relationship between P1 and P2 matches the parameters defined in the relation specifier.
• | :changesidetomove |
• | :flip |
• | :ignoresidetomove |
• | :missingpiececount |
• | :newpiececount |
• | :originaldifferentcount |
• | :originalsamecount |
• | :pattern |
• | :samesidetomove |
• | :shift |
• | :variations |
• | :variationsonly |
P2 must have a different side to move as does P1.
Example:
To search games in which the same position occurs with white and black to move - for example, this is useful in looking for mutual zugzwangs - use:
position :relation (:changesidetomove))
Allow P2 to be flipped before the comparison. However, in no case is P2 allowed to have a different piece on a square than P1 after the transform is applied.
Side to move information is ignored.
This keyword takes the same parameters as does the :piececount : position keyword in a position list: a pieced designator followed by a range. A missing piece is a piece that occurs in P1 on a square that is empty on P2. P2 matches if the number of these missing pieces lies within the range specifier. Unlike the case of the :piececount : position keyowrd, at most one :missingpiececount specifier can occur inside the relation list. No shift or flip transformation specifiers in the containing position list affect the piece designator in this keyword.
The default piece designator for :missingpiececount is
◑
and the default range is zero. That is, by default there can
be no missing pieces.
This keyword takes the same parameters as does the :piececount : position keyword in a position list: a pieced designator followed by a range. A new piece is a piece that occurs in P2 on a square that is empty on P1. P2 matches if the number of these new pieces lies within the range specifier. Unlike the case of the :pieccount : position keyowrd, at most one :newpiececount specifier can occur. No shift or flip transformation specifiers in the containing position list affect the piece designator in this keyword.
The default piece designator for :newiececount is ◑
and
the default range is zero. That is, by default there can be no new pieces.
This parameter takes a range specifier. It matches if the number of allowable squares that are different between P1 and P2 lies within the range specifier.
This parameter takes a range specifier. It matches if the number of nonempty allowable squares that are the same between P1 and P2 lies within the range specifier.
The :pattern keyword signifies that all piece designators that occur at the top level of the position list that encloses the current relation list define the allowable squares. Only allowable squares are considered in the comparisons. By default all squares are allowable.
P2 must have the same side to move as P1. This is the default.
Allow P2 to be shifted before the comparison. However, in no case is P2 allowed to have a different piece on a square than P1 after the transform is applied.
Search for P2 within variations and in the main line. By default, P2 must be in the main line.
Search for P2 only within variations.