[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] atari_atari and restricted_defend1
From: |
Inge Wallin |
Subject: |
[gnugo-devel] atari_atari and restricted_defend1 |
Date: |
Fri, 23 Nov 2001 19:53:31 +0100 (MET) |
Consider the following position:
A B C D E F G H J K L M N O P Q R S T
19 . . . . . . . . . . . . . . . . . . . 19
18 . . . . z . z z z . . . . . . . . . . 18
17 . . . . . A z B B z z . z z . . . . . 17
16 . . . z z z B B B B B z z C z z z z . 16
15 . . z . . D z B . B B B z C C C C z z 15
14 . . E z . . z B . . . y C . C C z z F 14
13 . . z . z . z z B . . . . . C x F F F 13
12 . . . z G . z . B . . . . . . . . . . 12
11 . . z . z z B B . . . . . . . . . . . 11
10 . . z + z B . B . + . . . . . + F . . 10
9 . . H z B B . . . . . . . . F . . F . 9
8 . . z z B . . . . . . . . . . . w . . 8
7 . . . . z B . . . B . . . . F . . . . 7
6 . . . z z B B B B v . . . . . . . . . 6
5 . . . z B B z B z I . . . . . J . . . 5
4 . z z z B z z z z I . . . . . + . . . 4
3 z K K K z . . L z I I . . . . . J . . 3
2 . z . K z . z L z z I I . . . . . . . 2
1 z z . K z . . . . z z I . . . . . . . 1
A B C D E F G H J K L M N O P Q R S T
It is the position at move just before 146 taken from the infamous
game against Viking that Gunnar posted some days ago.
There is a combination attack for white starting with Q12 (threatening
T14) and then N13 followed by P12 and black is captured. However, GNU
Go doesn't see this combination because it starts with a move (Q12)
that is not an atari, but a more subtle threat.
I have now extended atari_atari so that it sees this combination by
introducing a new reading depth parameter, aa_threat_depth. Below this
depth, the atari_atari code also considers more general threats. It is
currently set to 1, but I will try 3 (2 is not useful since the second
move is the opponents) and see if it takes too much time.
But I have run into a problem. The new atari_atari version sees bogus
attack sequences. The reason for this is that the old version
contains the following code:
if (aa_val) {
/* The atari at (ai,aj) seems to work but we still
* must check there is not a better defense.
*/
int cpos;
int res = restricted_defend1(pos, &cpos, EMPTY, 0,
1, &bpos);
if (res) {
if (trymove(cpos, other, "do_atari_atari-C",
pos, EMPTY, NO_MOVE)) {
increase_depth_values();
increase_depth_values();
if (!do_atari_atari(color, NULL, defense_point,
apos, save_verbose, minsize))
aa_val = 0;
decrease_depth_values();
decrease_depth_values();
popgo();
}
}
What it does is that it finds additional defense moves when simply
moving out of the atari isn't enough. The function
restricted_defend1() takes as extra parameters a list if moves not to
try (the 1, &bpos pair above). It works together with
restricted_attack2() to form a simple attack/defend pair that can do
little more than read ladders.
But this doesn't work when there is no real atari but instead an
indirect threat. Restricted_defend1 is not callable at all since the
attacked group has more than 1 liberty. So we can't find any more
defense moves in the atari_atari sequence and thus end up with bogus
attacks. In the case above, GNU Go chooses to play F3 because it
"saves the J5 group against a combination attack". The first defense
move it tries against F3 is C2 that defends E3, but of course nto J5.
The obvious reply is of course either F2 or G3 but these are never
tried.
I see two ways of solving this problem:
1) Extend the restricted_ paradigm to include all attack and defense
functions. The change would be very easy to do since it only
involves checking moves against a list before trying it. It would
also make the reading more general, but the question is wether this
would be useful in more places.
2) Extend attack() and find_defense() so that they can give *all*, or
at least a number of, working intersections instead of just one.
Then we can check all the suggested defenses and see if one of them
works. I even think that this would remove the need for
restricted_* altogether, at least in atari_atari.
I am interested in a discussion about this. I will send the current
state of my changes in my next mail if anybody wants to take a look at
it.
-Inge
- [gnugo-devel] atari_atari and restricted_defend1,
Inge Wallin <=