2 Stockfish, a UCI chess playing engine derived from Glaurung 2.1
3 Copyright (C) 2004-2023 The Stockfish developers (see AUTHORS file)
5 Stockfish is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 Stockfish is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "../search.h"
30 namespace Stockfish::Tablebases {
34 WDLBlessedLoss = -1, // Loss, but draw under 50-move rule
36 WDLCursedWin = 1, // Win, but draw under 50-move rule
40 // Possible states after a probing operation
42 FAIL = 0, // Probe failed (missing file table)
43 OK = 1, // Probe successful
44 CHANGE_STM = -1, // DTZ should check the other side
45 ZEROING_BEST_MOVE = 2 // Best move zeroes DTZ (capture or pawn move)
48 extern int MaxCardinality;
50 void init(const std::string& paths);
51 WDLScore probe_wdl(Position& pos, ProbeState* result);
52 int probe_dtz(Position& pos, ProbeState* result);
53 bool root_probe(Position& pos, Search::RootMoves& rootMoves);
54 bool root_probe_wdl(Position& pos, Search::RootMoves& rootMoves);
55 void rank_root_moves(Position& pos, Search::RootMoves& rootMoves);
57 } // namespace Stockfish::Tablebases