positionid
Each position in the game tree is assigned a unique integer, its position id. These position ids have the following properties:- If a position X is a mainline position, then its position id is equal to its ply. Hence, the initial position has position id of 0.
- Suppose X and Y are two positions. Then:
- If X and Y are mainline positions and X is an ancestor of Y, then the position id of X is smaller than the position id of X.
- Equivalently, if X and Y are mainline positions and X is a descendant of Y, then the position id of Y is smaller than the position id of X.
- If X and Y are any (not necessarily mainline) positions, and if X is an ancestor of Y, then the position id of X is smaller than the position id of Y .
positionid filter
Thepositionid
filter is a numeric filter whose value is the position id of the currentposition, e.g.:
x=positionid
When two positions X and Y are compared using a relational operator like ==
, <=
, >=
, or >
, the positions are converted into their position ids, and those ids are compared. This feature sometimes used in echo
filters to make sure that the same pair of positions is only examined one time.
X<Ycan be a shorter way to test if Y is a descendant of X then the wordier but equivalent (for mainline positions
X
and Y
)
descendant(X Y)