]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbprobe.h
Fix compilation after recent merge.
[stockfish] / src / syzygy / tbprobe.h
index 9ed6f0a39330febb489fc1e8ecb0476fb35b27cb..3b7c8aa70fda619b9523f0f2ca5b456d9aac4ec7 100644 (file)
@@ -1,16 +1,59 @@
+/*
+  Stockfish, a UCI chess playing engine derived from Glaurung 2.1
+  Copyright (C) 2004-2023 The Stockfish developers (see AUTHORS file)
+
+  Stockfish is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Stockfish is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 #ifndef TBPROBE_H
 #define TBPROBE_H
 
-namespace Tablebases {
-
-extern int TBLargest;
+#include <string>
 
-void init(const std::string& path);
-int probe_wdl(Position& pos, int *success);
-int probe_dtz(Position& pos, int *success);
-bool root_probe(Position& pos, Value& TBScore);
-bool root_probe_wdl(Position& pos, Value& TBScore);
+#include "../search.h"
 
+namespace Stockfish {
+class Position;
 }
 
+namespace Stockfish::Tablebases {
+
+enum WDLScore {
+    WDLLoss        = -2,  // Loss
+    WDLBlessedLoss = -1,  // Loss, but draw under 50-move rule
+    WDLDraw        = 0,   // Draw
+    WDLCursedWin   = 1,   // Win, but draw under 50-move rule
+    WDLWin         = 2,   // Win
+};
+
+// Possible states after a probing operation
+enum ProbeState {
+    FAIL              = 0,   // Probe failed (missing file table)
+    OK                = 1,   // Probe successful
+    CHANGE_STM        = -1,  // DTZ should check the other side
+    ZEROING_BEST_MOVE = 2    // Best move zeroes DTZ (capture or pawn move)
+};
+
+extern int MaxCardinality;
+
+void     init(const std::string& paths);
+WDLScore probe_wdl(Position& pos, ProbeState* result);
+int      probe_dtz(Position& pos, ProbeState* result);
+bool     root_probe(Position& pos, Search::RootMoves& rootMoves);
+bool     root_probe_wdl(Position& pos, Search::RootMoves& rootMoves);
+void     rank_root_moves(Position& pos, Search::RootMoves& rootMoves);
+
+}  // namespace Stockfish::Tablebases
+
 #endif