Static Exchange Evaluation(SEE)は、ある升で駒の取り合いが続いたとき、最終的な損得がどうなりそうかを静的に見積もる手法である。 静止探索や手の並べ替えでよく使われる。
駒取りの手があるとき、
を判断したい場面が多い。
SEE では、ある升に対して
ことで、その取りの損得を近似的に求める。
単純化した擬似コードは次のようになる。
int see(Position pos, Square sq) {
int gain[MAX_SWAP];
int depth = 0;
gain[depth] = pieceValue(pos.pieceOn(sq));
while (hasAttacker(pos, sq, pos.sideToMove())) {
Move capture = leastValuableAttacker(pos, sq, pos.sideToMove());
doMove(pos, capture);
++depth;
gain[depth] = pieceValue(capturedPiece(capture)) - gain[depth - 1];
}
while (--depth > 0) {
gain[depth - 1] = -std::max(-gain[depth - 1], gain[depth]);
}
return gain[0];
}
実際には pin や成り、将棋特有の利きの更新も考える必要がある。
将棋では、
が多く、単純な 駒を取る手だから良い という判断では不十分である。
そのため SEE は、特に捕獲手の品質管理に役立つ。