- // yields_to_threat() tests whether the move at previous ply yields to the so
- // called threat move (the best move returned from a null search that fails
- // low). Here 'yields to' means that the move somehow made the threat possible
- // for instance if the moving piece is the same in both moves.
-
- bool yields_to_threat(const Position& pos, Move move, Move threat) {
-
- assert(is_ok(move));
- assert(is_ok(threat));
- assert(color_of(pos.piece_on(from_sq(threat))) == ~pos.side_to_move());
-
- Square mfrom = from_sq(move);
- Square mto = to_sq(move);
- Square tfrom = from_sq(threat);
- Square tto = to_sq(threat);
-
- // The piece is the same or threat's destination was vacated by the move
- if (mto == tfrom || tto == mfrom)
- return true;
-
- // Threat moves through the vacated square
- if (between_bb(tfrom, tto) & mfrom)
- return true;
+ // refutes() tests whether a 'first' move is able to defend against a 'second'
+ // opponent's move. In this case will not be pruned. Normally the second move
+ // is the threat (the best move returned from a null search that fails low).