- // can_return_tt() returns true if a transposition table score can be used to
- // cut-off at a given point in search.
-
- bool can_return_tt(const TTEntry* tte, Depth depth, Value v, Value beta) {
-
- return ( tte->depth() >= depth
- || v >= std::max(VALUE_MATE_IN_MAX_PLY, beta)
- || v < std::min(VALUE_MATED_IN_MAX_PLY, beta))
-
- && ( ((tte->type() & BOUND_LOWER) && v >= beta)
- || ((tte->type() & BOUND_UPPER) && v < beta));
- }
-
-
- // refine_eval() returns the transposition table score if possible, otherwise
- // falls back on static position evaluation.
-
- Value refine_eval(const TTEntry* tte, Value v, Value defaultEval) {
-
- assert(tte);
-
- if ( ((tte->type() & BOUND_LOWER) && v >= defaultEval)
- || ((tte->type() & BOUND_UPPER) && v < defaultEval))
- return v;
-
- return defaultEval;
- }
-
-