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

5.1 Created by Lewis Stiller.

Lewis Stiller comments with this improvement:

"The existing CQL 3.02 example gives all false positives from the sample output. 
 
The new 5.1 indian.cql is one of  the most interesting CQL files I have seen, in my opinion.
I think it's worth running to illustrate the use of comments, which can elucidate the structure of complex themes.
I do not know of any false negatives or false positives in the output; let me know if you find some."

3.02 Created by Gady Costeff.

CQL 5.1
; Indian theme ; ; In a win study, ; (1) White crosses a critical square with a piece p1 ; (2) White moves to the critical square with a piece p2, interfering ; with the piece on p1 ; (3) this results in a position in which Black would be in stalemate, except ; for the fact that p2 is interfering with p1 ; (4) the interference is removed by p2 moving from the critical square ; The results are sorted by the length of the critical move cql(input heijden.pgn result 1-0) piece $p1 in [RBQ] piece $p2 in [RBNP] square $p1dest in move from $p1 square $criticalsquare in between ($p1 $p1dest) silent next( move from $p1 to $p1dest not move from $p1* {move from $p2 to $criticalsquare comment "interference to critical square" comment $criticalsquare } not move from $p1 or $p2 * {; Black would be in stalemate, but for the interference btm not check {square all $kdest in anydirection 1 k attack (A $kdest) or {a on $kdest} or ray attack ($p1 $p2 $kdest) } {square all $b in [rnbq] ray attack ($p1 $p2 $b k) or square all $bdest in attack($b [A.]) square $pinner in [RBQ] ray attack ($pinner $b k) not ray attack ($pinner $b $bdest k) not ray attack ($pinner $bdest $b k) not $bdest on $pinner } {square all $bp in p {square $pinner in [RBQ] ray attack ($pinner $bp k)} or {[Aa] on down 1 $bp attack 0 ($bp A) } or ray attack ($p1 $p2 $bp k) } comment "black would be stalemated if not for interference on" comment $criticalsquare } not move from $p1 or $p2 * {move from $p2 comment "move away from critical square" comment $criticalsquare} ) comment "Indian theme: critical move from" comment $p1 comment "to" comment $p1dest comment "crossing critical square" comment $criticalsquare sort "critical move length" countsquares 1 8 between ($p1 $p1dest)
CQL 3.02
;; Indian manoeuvre. A stale-mating position is culminated which White has provided by preparing an ambush so as to allow the defense a move that may expose him to a discovered mate.
(match
:pgn heijden.pgn
:output Indian.pgn (position :flipcolor :or (
(position :gappedsequence (
(position :rayorthogonal ([QR] a k) :movefrom [QR])
(position :rayorthogonal ([QR] a k))
(position :rayorthogonal ([QR] [BNP] a k))
(position :rayorthogonal ([QR] [BNP] k))
))
(position :gappedsequence (
(position :raydiagonal ([QB] a k) :movefrom [QR])
(position :raydiagonal ([QB] a k))
(position :raydiagonal ([QB] [RNP] a k))
(position :raydiagonal ([QB] [RNP] k))
))
)
)
)
After executing this with "> cql Indian.cql" there are 107 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 4 studies are presented and out if 73 studies found by the CQL 5.1 version: