Computer Chess Club Archives


Search

Terms

Messages

Subject: correction and implementation hints

Author: Gerd Isenberg

Date: 05:19:04 09/09/02

Go up one level in this thread


On September 08, 2002 at 13:30:41, Gerd Isenberg wrote:

>To evaluate this position as "won" for white a few pattern matcher are necessary
>(bitboards required):
>
>1. Endgame with opposite colored bishops ("weaker" side may have an additional
>knight, "stronger" side has passers).
>
>2. "Stronger" King with only one friendly bishop and (passed) pawns stands patt
>("Stronger" side is noted as black now).
>
>3. Black has no capture.
>
>4. WB controlles adjacent king square exclusively, there is no other defender
>rather than the BK (b7).
>
>5. All black pawn move targtes to WB-colored squares are controlled by WB on one
>diagonal but not defended at all (no former duo).
>
>6. All other pawn moves to BB-colored squares (here c5 only) are blocked (but
>not by king) or match condition 5 afterwards (the target-targets are controlled
>by WB but one the same diagonal and not defended att all).
>
>7. No pawn move leaves an escape square for the patt standing BK.
>
>8. WK is not (exclusively) involved to trap opposites king and free to walk
>around.
>
>9. All adjacent BK-squares are either occupied by black pawns or controlled by
>white pieces, so the King is stalemated forever.
>
>If all these conditions match, it's time to give a bonus at least results in a
>draw score:
>
>   max(-materialbalance(white), 0)
>
>... and to disable nullmove for black to move, if not already done in these kind
>of positions.
>
>Now we are looking for a target square for the WK, so that the WB may mate
>protected by his king. With the help of pattern 3 we find the b8,c8 target set
>here.
>
>If the square set is reachable by WK detouring adjacent to most advanced black
>passer which stop is controlled by WB, it's a won position.
>
>As long as the shortest king way to the target square(s) interrups the bishop
>ray to black pawn targtes, we force the king toward most advanced black passer
>(h2). Otherwise we gave a larger bonus the shorter the distance to c8/b8 is.
>
>OK, not yet implemented. Worth to try?
>
>Gerd

[D]B7/p1p5/kb1p4/p3p3/P1N2p2/6p1/7p/K7 w - - 0 1

oups, Statement 5 was not exact enough:

The potential mate square must also be member of the common diagonal that covers
all WB-colored black pawn move targets, otherwise black king may escape, if WB
captures a pushed black pawn.

I hope this should work better:

4. WB controlles adjacent king square exclusively, there is no other defender
rather than the BK (b7). This square determine a diagonal D (a8h1) for the WB.

5. All black pawn move targtes to WB-colored squares are controlled by WB on the
same diagonal D, but not defended at all (no former duo).


How to implement "If the square set is reachable by WK detouring adjacent to
most advanced black passer which stop is controlled by WB, it's a won position":

A set of squares is generated, not attacked by black and not occupied by white
pieces:

0 1 1 1 1 1 1 1
0 0 0 1 1 1 1 1
0 0 1 0 1 1 1 1
0 0 0 1 0 1 1 1
0 0 0 0 1 0 1 1
1 1 1 1 0 1 0 1
1 1 1 1 1 0 1 0
1 1 1 1 1 1 0 1

Next we exclude all the squares belonging to the diagonal D,
but not the squares adjacent to most advanced black passer:

0 1 1 1 1 1 1 1
0 0 0 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 0 1 1 1
0 0 0 0 0 0 1 1
1 1 1 1 0 0 0 1
1 1 1 1 1 0 1 0
1 1 1 1 1 1 0 1

Now we look whether there is a '1'-connection between WK and one Target square!
This may done by a recursive backtracking algorithm. A similar algorithm is
needed in (blocked) pawn-endings, to look whether a king may break through
enemies area via a bottleneck square.

To decide whether WK has already passed the bottleneck and may use the
"shortest" way to his target, we simply split the above bitboard into two sets
by the Diagonal D (and with pecomputed "above/below" diagonal bitboard[30] for
each possible diagonal).

Only one testbit-call is necessary to determine whther the king is in the set
including the Target square.

cheers,
Gerd




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.