[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] Inessential worms

From: Daniel Bump
Subject: [gnugo-devel] Inessential worms
Date: Sat, 24 Nov 2001 21:34:12 -0800

I've put up a patch at:

This is not ready to be used but the changes in worm.c are
ready for discussion.

This is a proposed redefinition of inessential worms. The
changes to owl_analyze_semeai should not be taken too seriously
because this is very much in flux but the idea is that when
the new parameter "owl" in owl_analyze_semeai is 0, the
function can be called before examine_positions is finished
and still call a race between a pair of worms.

The definition of an inessential worm is changed to the

static int
inessential_worm(int pos)
  int color = board[pos];
  int other = OTHER_COLOR(color);

  if (worm[pos].genus == 0
      && worm[pos].liberties2 == 0
      && worm[pos].lunch == NO_MOVE) {
    int edge;
    int border_color = examine_cavity(pos, &edge);

    if (border_color != GRAY_BORDER && edge < 3) {
      int m, n;

      if (!worm[pos].cutstone)
         return 1;
      for (m = 0; m < board_size; m++)
      for (n = 0; n < board_size; n++) {
        int apos = POS(m, n);
          int safetya, safetyb;

          if (board[apos] != other
              || worm[apos].origin != apos
              || !adjacent_strings(pos, apos))
          owl_analyze_semeai(pos, apos, &safetya,
                             &safetyb, NULL, 0);
          if (safetya != DEAD)
              return 0;
      return 1;
  return 0;

If the worm is a cutting stone (adjacent to more than one
other worm) and "looks" inessential, we try a semeai race
with every adjacent worm. If it wins any of these it is
not inessential. Otherwise, it is.

The reason this change is needed is to prevent spurious
amalgamations of dragons, a known problem. For an example
of this look at the A12/A14 dragons in semeai6.sgf. The
B dragon is wrongly considered inessential. (Run gnugo -T
and see that the two dragons it adjoins are considered

I've run somewhat less than half the regressions (strategy2 
not done yet) and so far this patch doesn't break anything.

I don't propose to put this patch in the CVS until 
owl_analyze_semeai is a lot more debugged. However I want
Gunnar and anyone else with an opinion to see the proposed
change so I can have some feedback if this looks OK.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]