; This computes the theme for the 9th World Chess Composing Tournament:
; "In a win study, the white queen moves, without capturing, checking or refuting
; a check, to a square where she is not guarded by Whtie and where she can immediately be
; captured by Black", (http://www.sci.fi/~stniekat/pccc/9_wcct.htm).
; It works by searching for positions where the queen moves to an empty square, and in that
; position there is no attacking piece, called $attacker, which either (a) is not pinned, or
; (b) is the only other piece on a ray with endpoints the black king and the moved white Queen.
; That is, one wants to eliminate positions where the White queen moves to a square where its only
; attackers are pinned to the black king by a piece other than that White queen.
(match
:pgn heijden.pgn
:output wcct9.pgn
:result 1-0
:forany attacker [qrbnp]
:forany Queen Q
(position
:markall
:tagmatch Queen Q
:movefrom $Queen
:moveto .
:nocheck
:sequence
((position)
(position
:attackcount $attacker $Queen 1
:attackcount A $Queen 0
:or
((position :rayattack (A $attacker k) 0)
(position :ray ($Queen $attacker k)))
:nocheck)
)
)
)

After executing this with "> cql Wcct9.cql" there are 431 studies found in the Harold van der Heijden Database 2015.NB. When you see {MATCH} in the text, it means that cql has found the position asked for.

Below only 5 studies are presented:

your web browser and/or your host do not support iframes as required to display the chessboard

your web browser and/or your host do not support iframes as required to display the chessboard

your web browser and/or your host do not support iframes as required to display the chessboard

your web browser and/or your host do not support iframes as required to display the chessboard

your web browser and/or your host do not support iframes as required to display the chessboard

"I just do art because I am ugly and there is nothing else for me to do - Andy Warhol."