function negamax(node, depth, α, β, color)
if node is a terminal node or depth = 0
return color * the heuristic value of node
else
foreach child of node
val := -negamax(child, depth-1, -β, -α, -color)
{the following if statement constitutes alpha-beta pruning}
if val≥β
return val
if val≥α
α:=val
return α
したがって、上記が私のnegamaxコード(ウィキペディアからコピー)であり、次のように呼び出される場合:
negamax(origin, depth, -inf, +inf, 1)
次に、関数を呼び出す深さに関係なく、この関数は常に正の値を返しますか。これは、ヒューリスティック値自体が常に正であると想定しています。