gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Readconnect


From: Tristan Cazenave
Subject: Re: [gnugo-devel] Readconnect
Date: Sat, 08 Dec 2001 21:13:23 +0100

> > Is it possible to test readconnect on these mistakes ?
> > Where can I find them ?
> 
> Connection mistakes happen frequently. I would say
> in most games. A typical example is trevor test 9:
> 
> http://www.public32.com/regress/?trevor:9
> 

As this is a non transitivity problem, I have added
some functions to handle non transitivity in
readconnect.c

What is really needed now is the function 
prevent_connection_in_three_moves, I can write
it, but maybe you already have written what I need,
that is a function to compute second order liberties
, and a function to check if an intersection is
a second order liberty of a string efficiently
(in Golois I have a bitmap of the board that
can tell the result in one bit lookup).

This will enable to solve trevor test case 9 with the
current definition of non_transitivity.

I suggest that if a is connected to b and b to c, and
a and c are less than three moves away from each other
the engine calls non_transitivity before amalgamating
them in the same dragon.

we should also have a new gtp command which in the case
of trevor test 9 would look like :

non_transitivity D4 D6 F7
#? [1 (D5|E5)]

the front end function in readconnect.c is

int non_transitivity(int str1, int str2, int str3, int *move);

I also modified disconnect() to allow more moves to be found, 
and improved some little things, like a new function chainlinks3
that finds all adjacent strings with less than a given number
of liberties.

The new function to be added to board.c is :

/* chainlinks3 returns (in adj array) the chains surrounding
 * the string at str, which have less or equal lib liberties.
 * The number of such chains is returned.
 */

int
chainlinks3(int str, int adj[MAXCHAIN], int lib)
{
  struct string_data *s, *t;
  int k;
  int neighbors;

  ASSERT1(IS_STONE(board[str]), str);

  if (!strings_initialized)
    init_board();

  /* We already have the list ready, just copy the strings with the
   * right number of liberties.
   */
  neighbors = 0;
  s = &string[string_number[str]];
  for (k = 0; k < s->neighbors; k++) {
    t = &string[s->neighborlist[k]];
    if (t->liberties <= lib)
      adj[neighbors++] = t->origin;
  }
  return neighbors;
}


here is what it gives with the new connect.tst :

Summary: 39/81 passes. 6 unexpected passes, 0 unexpected
failures                                                                        
         

The new files is at :

http://www.ai.univ-paris8.fr/~cazenave/readconnect.c

Tristan.



reply via email to

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