greekgift.cql
greekgift.cql demonstrates a simple Greek gift theme. It illustrates how moves are represented in CQL. For more information about Greek gift, see the similar discussion at CQL Home page Greek gift.greekgift.cql line by line
greekgift.cql will match a position that starts a Greek gift sacrifice. It contains a single filter, the ⊢ filter. In a⊢
filter, the ⊢
symbol introduces a sequence of moves and filters. The filters are applied to positions that result from making the given moves.
There are quite a few bells and whistles in ⊢
, but this once just contains three moves (technically called ―― constituents
, and filters. The only filter here is the check
s, which are called filter constituents.
The first constituent of the ⊢
filter is a ――
constituent:
♗×♝h7
This matches a position in which a ♗
captures a ♟
on h7
on the next move, not surprisingly. The notation, which is new in version 6.2, is designed to mimic normal chess figurine algebraic notation.
If the next move from the current position is this move, the ⊢
filter will temporarily execute the move, updating the current position to the position resulting from the move.
The second constituent of the ⊢
filter is check
, which matches a position that is a check.
Thus, the effect of the first two filters is to match a position from which White delivers check with the bishop, capturing a pawn on h7
.
The third of the five constituents, and the second of the ―― constituents
, is
♚×h7
This again looks and means the same thing as standard chess notation: the black king captures a piece on h7
which, of course, must be the ♗
that just moved there.
The next constituent is the third ―― constituent
, ♘――g5
. It represents a move of a white knight to g5
. Finally, there is a check
filter constituent at the end, which is true only if the result of that knight to g5
move is in fact check.