Author: Harald Lüßen
Date: 12:52:05 10/27/05
Go up one level in this thread
On October 27, 2005 at 06:35:38, Tord Romstad wrote:
>On October 26, 2005 at 19:13:22, Harald Lüßen wrote:
>
>>I want to understand this. Let me try to explain it in my words
>>and pseudo code. I have left out everything else.
>>
>>search(a,b,d) {
>> try nullmove
>> for moves M
>> r=0 but reduce late moves with r=1 (or fraction?)
>> do move
>>again:
>> search(-b,-a,d-1-r)
>> --> {
>> try nullmove
>> if it fails low because of move N
>> and M was reduced (M.r > 0)
>> and M.piece == N.piece
>> then return cancel_reason_tords_enhancement
>> for moves m
>> ...
>> next move
>> }
>> <--
>> if r>0 and returned cancel_reason_tords_enhancement
>> r = 0
>> goto again
>> undo move
>> next move
>>}
>>
>>In 'and M.piece == N.piece' is it important that it is
>>exactly the same piece or can it be the same piece-type?
>>
>>Can you confirm this or correct me?
>
>If I understand your code correctly, everything between
>"-->" and "<--" isn't really supposed to be located exactly
>where it is printed above, but rather directly below the
>"try nullmove" near the top of the code. In this case, it
Yes. I wrote the recursively called (same) search
function, or the important essentials, inside --> <--.
>looks correct, though the exact implementation is slightly
>different from mine. Here is what I do, in compact pseudo
>code (there could be bugs here):
The only 'implementation' I have is the pseudo code above.
>int search(int alpha, int beta, int depth) {
> int value, moves_searched;
>
> do_nullmove();
> value = -search(-beta, -beta + 1, depth - 4);
> undo_nullmove();
> if(value >= beta) return value;
> else {
> ThreatMove[Ply] = BestMove[Ply+1];
> if(Reduction[Ply-1] &&
> from_square(ThreatMove[Ply]) == to_square(CurrentMove[Ply-1]))
OK, that answers the question of 'same piece'.
> return alpha - 1;
The caller will see this as beta + 1.
Hm? Will there be a cutoff instead of a research? Let's see...
> }
>
> generate_moves();
> moves_searched = 0;
> while((CurrentMove[Ply] = pick_move()) && alpha < beta) {
> do_move(CurrentMove[Ply]);
> if(moves_searched > 3 && ok_to_reduce(move))
{
Reduction[ply] = true; // ?
> value = -search(-beta, -alpha, depth - 2);
Reduction[ply] = false; // ?
This was the reduction.
}
> else value = alpha + 1;
And this is just a trick to slip into the if-clause below?
I expected something like
value = -search(-beta, -alpha, depth - 1);
after the else. Not written because 'compact pseudo code'?
> undo_move(CurrentMove[Ply]);
> if(value > alpha) {
Is this the re-search? Why value > alpha? Perhaps value == beta + 1?
Does the normal not reduced search come into this if?
> value = -search(-beta, -alpha, depth - 1);
> if(value > alpha) alpha = value;
> }
> moves_searched++;
> }
> return alpha;
>}
>
>Tord
Thank you. There are a few open questions.
May be I lost you somewhere.
Harald
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.