An html version of MutualStalemates.cql which is not in the cql.zip file.

CQL 5.1 Created by Lewis Stiller.

CQL 3.2 Created by Peter Boll.

Searching for Mutual or Reciprocal Stalemate studies.

In a position critical for White, the only way for white to reach a draw is to leave Black the choice between two separate continuations, of which one leads to a stalemate position for White, while the other leads to a stalemate position for Black.

The CQL 5.1 is much more compact.

In CQL 3.2  two cql files are used to find these studies with a white and black stalemate in one study. It finds 14664 studies.

The first cql is WhiteStalemates.cql; The second is MutualStalemates.cql

CQL 5.1
; both white and black stalemate occur in a game cql(input heijden.pgn variations result 1/2-1/2) initial next* {wtm stalemate} next* {btm stalemate}

CQL 3.2
; MutualStalemates.cql. Finding a white and a black stalemate position in one study.
; The first part finds all studies with a white stalemates. (match
:pgn Heijden.pgn
:output WhiteStalemates.pgn
(position
:stalemate
:markall
:variations
:terminal
:wtm)
)

The second MutualStalemates.cql searches in this intermediate WhiteStalemates.pgn file for black stalemate positions (also in variations) and finds 276 studies.

(match
:pgn WhiteStalemates.pgn
:output MutualStalemates.pgn
(position
:stalemate
:markall
:variations
:terminal
:btm)
)
After executing this with "> cql MutualStalemates.cql" there are 276 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 10 studies are presented: