diff --git a/gnugo/bench.mk b/gnugo/bench.mk
new file mode 100644
index 0000000000000000000000000000000000000000..d9b47703d4de572d594e9dbb8214eb86425c86b1
--- /dev/null
+++ b/gnugo/bench.mk
@@ -0,0 +1,96 @@
+### Description for gnugo benchmark ###
+DIR := $(call my-dir)
+
+##### target = gnugo_bench ######
+include $(BUILD)/clear.mk
+TARGET := gnugo_bench
+
+# Which file we measure the size
+get_which_size=gnugo_bench
+
+# Running commands
+run_cmd=${PERFLAB_PATH}/gnugo_bench --quiet --mode gtp --gtp-input ${PERFLAB_INPUT}/viking.tst
+
+target_srcs= \
+ utils/getopt1.c \
+ utils/getopt.c \
+ utils/gg_utils.c \
+ utils/random.c \
+ utils/winsocket.c \
+ engine/aftermath.c \
+ engine/board.c \
+ engine/boardlib.c \
+ engine/breakin.c \
+ engine/cache.c \
+ engine/clock.c \
+ engine/combination.c \
+ engine/dragon.c \
+ engine/endgame.c \
+ engine/filllib.c \
+ engine/fuseki.c \
+ engine/genmove.c \
+ engine/globals.c \
+ engine/handicap.c \
+ engine/hash.c \
+ engine/influence.c \
+ engine/interface.c \
+ engine/matchpat.c \
+ engine/montecarlo.c \
+ engine/movelist.c \
+ engine/move_reasons.c \
+ engine/optics.c \
+ engine/oracle.c \
+ engine/owl.c \
+ engine/persistent.c \
+ engine/printutils.c \
+ engine/readconnect.c \
+ engine/reading.c \
+ engine/semeai.c \
+ engine/sgfdecide.c \
+ engine/sgffile.c \
+ engine/shapes.c \
+ engine/showbord.c \
+ engine/surround.c \
+ engine/unconditional.c \
+ engine/utils.c \
+ engine/value_moves.c \
+ engine/worm.c \
+ sgf/sgf_utils.c \
+ sgf/sgfnode.c \
+ sgf/sgftree.c \
+ interface/main.c \
+ interface/play_gmp.c \
+ interface/gmp.c \
+ interface/play_solo.c \
+ interface/play_test.c \
+ interface/play_gtp.c \
+ interface/gtp.c \
+ interface/play_ascii.c \
+ patterns/transform.c \
+ patterns/oraclepat.c \
+ patterns/apatterns.c \
+ patterns/connections.c \
+ patterns/dpatterns.c \
+ patterns/influence.c \
+ patterns/handipat.c \
+ patterns/aa_attackpat.c \
+ patterns/helpers.c \
+ patterns/fuseki13.c \
+ patterns/conn.c \
+ patterns/fuseki9.c \
+ patterns/owl_vital_apat.c \
+ patterns/endgame.c \
+ patterns/fusekipat.c \
+ patterns/eyes.c \
+ patterns/barriers.c \
+ patterns/owl_attackpat.c \
+ patterns/josekidb.c \
+ patterns/owl_defendpat.c \
+ patterns/patterns.c \
+ patterns/fuseki19.c \
+ patterns/mcpat.c
+
+target_local_includes := src src/sgf src/utils src/patterns src/engine
+target_local_cflags := -DHAVE_CONFIG_H
+
+include $(BUILD)/build_executable.mk
diff --git a/gnugo/data/viking.tst b/gnugo/data/viking.tst
new file mode 100644
index 0000000000000000000000000000000000000000..42480155d7742563be133edd150b9291e7f547a9
--- /dev/null
+++ b/gnugo/data/viking.tst
@@ -0,0 +1,44 @@
+# This test suite is based on games against the program Viking by
+# Magnus Persson.
+
+loadsgf /sdcard/perflab_input/viking1.sgf 23
+1 reg_genmove white
+#? [E2]
+
+loadsgf /sdcard/perflab_input/viking1.sgf 65
+2 reg_genmove white
+#? [M15|B7]
+
+loadsgf /sdcard/perflab_input/viking1.sgf 187
+3 reg_genmove white
+#? [S5]
+
+loadsgf /sdcard/perflab_input/viking1.sgf 189
+4 reg_genmove white
+#? [B17|B18]
+
+# Locally S5 is the only move.
+loadsgf /sdcard/perflab_input/viking3.sgf 79
+5 restricted_genmove white T8 T7 S7 R7 T6 T5 S5 T4 T3 T2 T1 S1
+#? [S5]
+
+# A1 is of course inferior to B3
+loadsgf /sdcard/perflab_input/viking3.sgf 93
+6 restricted_genmove white B3 A1
+#? [B3]
+
+# The position cries out for a move at J13.
+loadsgf /sdcard/perflab_input/viking3.sgf 103
+7 reg_genmove white
+#? [J13]
+
+# K15 leaves too many cutting points.
+loadsgf /sdcard/perflab_input/viking3.sgf 113
+8 reg_genmove white
+#? [K16]
+
+# G19 is a very odd move.
+loadsgf /sdcard/perflab_input/viking3.sgf 113
+9 restricted_genmove white G19 J17
+#? [J17]
+
diff --git a/gnugo/data/viking1.sgf b/gnugo/data/viking1.sgf
new file mode 100644
index 0000000000000000000000000000000000000000..99050fc14f6506bb5b4213993edd599c3ffa07cb
--- /dev/null
+++ b/gnugo/data/viking1.sgf
@@ -0,0 +1,31 @@
+(;GM[1]FF[4]RU[Japanese]SZ[19]
+PW[GNU Go]PB[GNU Go 2.7.207 ascii]HA[3]KM[0.5]GN[GNU Go 2.7.207 ascii Random Seed 978859946]
+AB[dd]AB[pd]AB[dp]
+LB[cc:9][fc:22][nc:22][qc:9][fd:15][gd:18][md:18][nd:15][cf:22][df:15][pf:16][qf:22][dg:18][pg:19][dm:18][cn:22][dn:15][fp:16][gp:19][pp:75][cq:9][fq:22]
+C[Value of move: 75]
+;W[pp];B[kq];W[fq];B[qn];W[ql];B[dn];W[dq];B[pm];W[nc];B[pl]
+;W[pf];B[nd];W[md];B[oc];W[ci];B[nb];W[mc];B[cq];W[cr];B[eq]
+;W[dr];B[fp];W[fc];B[fd];W[gd];B[fe];W[ec];B[ge];W[cb];B[hd]
+;W[qk];B[pk];W[rm];B[er];W[bq];B[cp];W[ds];B[qj];W[bp];B[gc]
+;W[rn];B[qo];W[rj];B[qe];W[mb];B[ne];W[lf];B[bo];W[bs];B[qp]
+;W[cl];B[di];W[ng];B[dj];W[cj];B[dk];W[pj];B[ch];W[bh];B[cg]
+;W[bg];B[ck];W[bk];B[me];W[aj];B[le];W[ob];B[dl];W[pi];B[oj]
+;W[qf];B[pb];W[na];B[oi];W[jc];B[ib];W[lh];B[mk];W[gq];B[ph]
+;W[qi];B[iq];W[oh];B[jb];W[kc];B[qh];W[pe];B[qd];W[rh];B[mg]
+;W[mh];B[og];W[nh];B[of];W[nf];B[oe];W[pg];B[kb];W[je];B[ke]
+;W[kg];B[rf];W[qg];B[bd];W[ie];B[hf];W[ac];B[bl];W[ad];B[bi]
+;W[bj];B[bf];W[af];B[be];W[ae];B[dc];W[db];B[cc];W[al];B[cm]
+;W[fr];B[es];W[am];B[pq];W[sq];B[rp];W[qr];B[pr];W[sp];B[op]
+;W[rq];B[ao];W[ji];B[po];W[mf];B[hi];W[rg];B[re];W[gb];B[hb]
+;W[fb];B[ij];W[ps];B[os];W[qs];B[jj];W[or];B[nr];W[kj];B[kk]
+;W[ki];B[kf];W[jf];B[if];W[ns];B[ih];W[jg];B[gp];W[nq];B[bm]
+;W[mr];B[ea];W[js];B[np];W[pa];B[qb];W[ai];B[lj];W[hs];B[hq]
+;W[qa];B[rb];W[lb];B[mp];W[jh];B[ig];W[ka];B[ap];W[ar];B[ra]
+;W[oa];B[ic];W[id];B[qq];W[aq];B[so];W[rr];B[ag];W[ro];B[jr]
+;W[ks];B[lr];W[ls];B[hr];W[gs];B[gr];W[is];B[fs];W[kr];B[ir]
+;W[ms];B[oq];W[lq];B[lp];W[mq];B[bb];W[ah];B[bc];W[eb];B[ca]
+;W[fa];B[ba];W[kp];B[jq];W[ko];B[ln];W[io];B[kn];W[jn];B[jm]
+;W[jo];B[im];W[ld];B[kd];W[jd];B[od];W[sf];B[se];W[sg];B[ii]
+;W[ja];B[ia];W[la];B[da];W[ni];B[nj];W[mi];B[an];W[qm];B[mj]
+;W[li];B[he];W[tt];B[hn];W[tt];B[ho];W[tt];B[tt];W[tt]
+)
diff --git a/gnugo/data/viking3.sgf b/gnugo/data/viking3.sgf
new file mode 100644
index 0000000000000000000000000000000000000000..2f94c37d1e77282b2e085a8017087a3be66c81f1
--- /dev/null
+++ b/gnugo/data/viking3.sgf
@@ -0,0 +1,43 @@
+(;GM[1]FF[4]
+SZ[19]HA[4]KM[0.5]
+PW[GnuGo (GNU Go 3.1.16)]WR[14k*]
+PB[viking4]BR[17k*]
+PC[NNGS]DT[2001-12-15]AP[gnugoclient:2.0]
+RE[W+8.5]
+AB[dd][pd][dp][pp]
+;W[qn];B[np];W[lq];B[mo];W[cf];B[fd];W[cn];B[hq];W[qf];B[cj];W[nc]
+;B[oe];W[qc];B[qj];W[qd];B[nm];W[bd];B[cc];W[dh];B[bj];W[hc];B[ge]
+;W[bc];B[ei];W[kc];B[en];W[bp];B[eh];W[cq];B[ko];W[rp];B[qq];W[jp]
+;B[in];W[jr];B[ql];W[rn];B[cb];W[bh];B[nr];W[rq];B[rr];W[rl];B[dq]
+;W[qp];B[qh];W[ho];B[hn];W[qr];B[po];W[hp];B[dl];W[gq];B[dm];W[oc]
+;B[gn];W[bl];B[rk];W[pg];B[nf];W[er];B[dr];W[eq];B[eo];W[cr];B[ds]
+;W[rg];B[ef];W[es];B[gp];W[gr];B[bb];W[ac];B[fp];W[fb];B[pq];W[qs]
+;B[qo];W[sm];B[ro];W[sr];B[cs];W[bs];B[br];W[ar];B[as];W[aq];B[so]
+;W[bs];B[ph];W[rs];B[og];W[as];B[bk];W[le];B[lg];W[kf];B[kg];W[jf]
+;B[bi];W[bf];B[ls];W[he];B[hf];W[ci];B[hd];W[bn];B[dg];W[cg];B[jg]
+;W[id];B[ie];W[je];B[ic];W[ib];B[jd];W[ga];B[hb];W[gc];B[jb];W[kb]
+;B[if];W[ia];B[ja];W[kd];B[ha];W[ka];B[mr];W[ri];B[rh];W[sh];B[di]
+;W[ch];B[ag];W[ah];B[qg];W[sg];B[pf];W[qm];B[qe];W[re];B[rf];W[se]
+C[L:9];B[gd];W[cl]C[L:10];B[dk];W[de];B[ee];W[df];B[eg];W[lf];B[mf]
+;W[jc];B[id];W[fq];B[ep];W[cm];B[od];W[pc];B[md];W[mc];B[qi];W[me]
+;B[nd];W[si];B[sf];W[qf];B[sk];W[rf];B[pe];W[ld];B[sp];W[sq];B[ai]
+;W[kp];B[jn];W[lo];B[lm];W[ln];B[kn];W[mn];B[pr];W[mm];B[ml];W[nn]
+;B[mq];W[pl]C[L:8];B[qk];W[ll]C[L:7];B[lk];W[km]C[L:5];B[jl];W[mk]
+C[L:6];B[nl];W[nk]C[L:7];B[kl];W[lm]C[L:5];B[om];W[on]C[L:6];B[ni]
+;W[lj]C[L:7];B[kk];W[mi]C[L:8];B[mh];W[ji]C[L:9];B[ol];W[pk]C[L:7]
+;B[oj];W[ok]C[L:8];B[sl];W[lp];B[hi];W[ik]C[L:9];B[jj];W[ki]C[L:10]
+;B[jm];W[ih];B[os];W[hh];B[gi];W[gg];B[ks];W[pj];B[oi];W[lh];B[fr]
+;W[iq];B[rm];W[sn];B[rl];W[pn];B[io];W[kr];B[ip];W[hr];B[go];W[hq]
+;B[ii];W[jh];B[ig];W[cd];B[ab];W[dc];B[db];W[ed];B[ec];W[dd];B[eb]
+;W[ak];B[fg];W[gf];B[kj];W[gh];B[pi];W[co];B[mj];W[nj];B[cp];W[bq]
+;B[ne];W[fh];B[ck];W[fi];B[fj];W[oo];B[mp];W[op];B[oq];W[lr];B[jo]
+;W[js];B[ms];W[ff];B[fe];W[li];B[kh];W[pm];B[hg];W[mj];B[aj];W[al]
+;B[dn];W[do];B[no];W[ps];B[rj];W[sj];B[];W[]
+C[final_score: W+8.5
+G19 removed
+F18 removed
+G17 removed
+A13 removed
+J9 removed
+F2 removed]
+)
diff --git a/gnugo/src/AUTHORS b/gnugo/src/AUTHORS
new file mode 100644
index 0000000000000000000000000000000000000000..a6463d2ce390990c31c2f2fa8019606721f0ca13
--- /dev/null
+++ b/gnugo/src/AUTHORS
@@ -0,0 +1,8 @@
+GNU Go authors (in chronological order of contribution) are Man Li, Wayne
+Iba, Daniel Bump, David Denholm, Gunnar Farneback, Nils Lohner, Jerome
+Dumonteil, Tommy Thorn, Nicklas Ekstrand, Inge Wallin, Thomas Traber,
+Douglas Ridgway, Teun Burgers, Tanguy Urvoy, Thien-Thi Nguyen, Heikki
+Levanto, Mark Vytlacil, Adriaan van Kessel, Wolfgang Manner, Jens Yllman,
+Don Dailey, Mans Ullerstam, Arend Bayer, Trevor Morris, Evan Berggren
+Daniel, Fernando Portela, Paul Pogonyshev, S.P. Lee, Stéphane Nicolet,
+Martin Holters, Grzegorz Leszczynski and Lee Fisher.
diff --git a/gnugo/src/CMakeLists.txt b/gnugo/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..47cee596a95b97efff8c9146ab39e02a5d4e18f5
--- /dev/null
+++ b/gnugo/src/CMakeLists.txt
@@ -0,0 +1,51 @@
+PROJECT(GNUGo)
+
+INCLUDE(CheckIncludeFiles)
+CHECK_INCLUDE_FILES(sys/times.h HAVE_SYS_TIMES_H)
+CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
+CHECK_INCLUDE_FILES("sys/time.h;time.h" TIME_WITH_SYS_TIME)
+CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
+CHECK_INCLUDE_FILES(curses.h HAVE_CURSES_H)
+CHECK_INCLUDE_FILES(glib.h HAVE_GLIB_H)
+CHECK_INCLUDE_FILES(ncurses/curses.h HAVE_NCURSES_CURSES_H)
+CHECK_INCLUDE_FILES(ncurses/term.h HAVE_NCURSES_TERM_H)
+CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILES(term.h HAVE_TERM_H)
+CHECK_INCLUDE_FILES(crtdbg.h HAVE_CRTDBG_H)
+CHECK_INCLUDE_FILES("winsock.h;io.h" HAVE_WINSOCK_IO_H)
+
+INCLUDE(CheckTypeSize)
+CHECK_TYPE_SIZE(long SIZEOF_LONG)
+
+INCLUDE(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS(times HAVE_TIMES)
+CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
+CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
+CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
+CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF)
+# FIXME: Probably necessary to add the glib library for this test to pass.
+CHECK_FUNCTION_EXISTS(g_vsnprintf HAVE_G_VSNPRINTF)
+
+SET(PRAGMAS "")
+IF(WIN32)
+ SET(PRAGMAS "#pragma warning(disable: 4244 4305)")
+ENDIF(WIN32)
+
+IF(MSVC80)
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
+ ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
+ENDIF(MSVC80)
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+
+# Make sure all files know about and can find config.h
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+
+# Recurse into subdirectories.
+ADD_SUBDIRECTORY(utils)
+ADD_SUBDIRECTORY(sgf)
+ADD_SUBDIRECTORY(engine)
+ADD_SUBDIRECTORY(patterns)
+ADD_SUBDIRECTORY(interface)
diff --git a/gnugo/src/COPYING b/gnugo/src/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..94a9ed024d3859793618152ea559a168bbcbb5e2
--- /dev/null
+++ b/gnugo/src/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/gnugo/src/ChangeLog b/gnugo/src/ChangeLog
new file mode 100644
index 0000000000000000000000000000000000000000..61f1f17d167629e1aa8e20d94234f39112fda9e1
--- /dev/null
+++ b/gnugo/src/ChangeLog
@@ -0,0 +1,7962 @@
+-------------------------------------------------------------------------
+-- ChangeLog
+-------------------------------------------------------------------------
+
+3.8 released February 17, 2009
+
+- added Wietze Brandsma to THANKS
+- revised config.vc
+- revised NEWS
+- restored missing mkmcpat.dsp, regress.cmd
+
+3.8rc1 released February 6, 2009
+
+- revisions to montecarlo.texi
+- revised .dsp files
+- Lee Fisher added to AUTHORS
+- WINDOWS doc and install.texi revised per Lee Fisher's changes
+- mkmcpat puts 16 items on a line instead of 8
+- (unsigned char) and (unsigned short) explicit typings
+- missing files added to EXTRA_DIST
+- copyrights updated to 2009
+
+3.7.13 released December 23, 2008
+
+- restore cmake files that were missing from the 3.7.12 tarball
+- bring copyright date to 2008
+- doc revision
+- be forgiving with replacement moves conflicting with unconditional analysis
+- accept --enable-socket-support even if configure test fails
+- add globals.c to mkmcpat for OS/X build
+
+3.7.12 released April 7, 2008
+
+- cmake configuration files for generating MSVC project files
+- minor doc revision
+- new options --mc-patterns, --mc-list-patterns, and --mc-load-patterns
+- tunable local patterns for Monte Carlo simulations
+- try harder to find the right move to make seki in find_moves_to_make_seki()
+- better heuristics to avoid calling semeai reading in
+ find_moves_to_make_seki() in hopeless cases
+- never amalgamate dragons over three-liberty strings and sometimes not
+ over two-liberty strings
+- send_two_return_one() moved from utils.c to board.c and reimplemented
+- new file engine/montecarlo.c
+- new options --monte-carlo and --mc-games-per-level to use Monte Carlo UCT
+ search on 9x9 and smaller boards
+- call check_boardsize() from play_gmp.c to avoid crashing on bad board sizes
+- new function check_boardsize()
+- bugfix in handling of foreground color with ncurses
+- orientation invariant board hashes added
+- tuning
+- add STS-RV semeai regression test suite
+- new and revised tests
+
+3.7.11 released November 1, 2007
+
+- gtp-commands.texi is not built automatically
+- updates texinfo.tex
+- minor doc revision
+- revised configure.in, aclocal.m4 and *Makefile.in for recent autotools
+- removed acconfig.h
+- don't play send-two-return-one in tactical reading attack moves
+- bugfix in reevaluate_ko_threats() to avoid a crash
+- more efficient aftermath moves
+- version 3 of GPL and update copyright for 2007
+- new static function remove_eye_filling_moves() in owl.c
+- semeai reading revisions
+- look more ambitiously for back-capturing moves in attack1()
+- generate cut move reasons for cutting moves found during find_connections()
+- fix compilation with MAX_BOARD set to low boardsizes (>= 7 tested)
+- performance tuning in do_owl_analyze_semeai()
+- detect unconditionally meaningless moves
+- get_lively_stones() revised to be valid also for stackp>0
+- bugfix in compute_owl_escape_values()
+- moves can be marked as known_safe_moves by patterns
+- bugfix in compute_surroundings()
+- owl tuning
+- new and revised tests
+
+3.7.10 released May 21, 2006
+
+- gnugo.dsw and uncompress_fuseki.dsp revised
+- configure.in revised to improve socket support detection on windows
+- gameinfo_play_sgftree_rot() revised to fail gracefully
+- new static really_do_trymove() and is_superko_violation() in board.c
+- board hashes stored in the move history
+- is_legal() no longer depends on allow_suicide
+- new is_allowed_move() to determine legality for current suicide and ko rules
+- new global variables suicide_rule and ko_rule
+- illegal moves replaced with passes near the end of do_genmove()
+- reevaluate_ko_threats() revised
+- under superko rules look for ko threats also if best move illegal
+- new options --forbid-suicide (default) and --allow-all-suicide
+- new options --simple-ko (default), --no-ko, --positional-superko,
+ and --situational-superko
+- is_allowed_move() used instead of is_legal() in play_gtp.c, play_ascii.c
+ and play_solo.c
+- identify_thrashing_dragons() called earlier in make_dragons()
+- do not play self-atari while splitting eyespaces in aftermath_genmove()
+- in do_owl_attack(), don't consider send-two-return-one defender moves
+- send-two-return-one moves not tried in find_more_attack_and_defense_moves()
+- send-two-return-one moves not tried in find_worm_attacks_and_defenses()
+- string connection bonus for ko captures reduced in move_connects_strings()
+- maximum bonus from secondary move values limited to 0.4 points
+- more legality checking in fill_liberty()
+- detect_tactical_blunder() revised to avoid finding illegal defense moves
+- semeai.tst reordered
+- new option --limit-commands to regress.pike
+- new testfile 13x13c.tst
+- do not try to add an sgf circle for pass moves in replay_node()
+- new enum same_dragon_value in owl.c
+- new owl_defendpats.db classification "a" for connecting all friendly
+ stones to the goal
+- owl tuning
+- influence tuning
+- tuning
+- new and revised tests
+
+3.7.9 released March 10, 2006
+
+- new GTP command advance_random_seed
+- make update_random_seed() deterministic
+- fix assertion failure in semeai()
+- semeai attack and defense codes added to struct dragon_data2
+- in estimate_territorial_value(), let stones have influence strength also
+ when their safety depends on ko
+- unify internal handling of limit_search and restricted_genmove
+- new function play_lib_n() in utils.c and autohelper functions
+ oplay_lib/xplay_lib
+- new static function modify_eyefilling_move() in owl.c
+- do not reset permeability around dead stones
+- do not consider moves playing into snapback in
+ do_find_more_owl_attack_and_defense_moves()
+- new function playing_into_snapback() in utils.c
+- only call do_find_more_owl_attack_and_defense_moves() when stackp==0
+- use .strategic_size in estimate_strategical_value()
+- new field .strategic_size in dragon_data2, includes bonus for weak neighbors
+- use gg_normalize_float2int() in valuate_combinable_pattern_chain() to
+ address platform dependencies
+- carefully select new owl goal origin
+- allow excess strategical value for some single-worm dragons
+- include played move in atari-atari blunder analysis
+- score.c removed from sources
+- owl tuning
+- tuning
+- new and revised tests
+
+3.7.8 released January 30, 2006
+
+- new global variable handicap
+- chinese scoring adds the number of handicap stones in addition to the
+ komi to white's score
+- include handicap in sgf headers
+- dead code removed from influence_evaluate_position() and the rest moved
+ to game_status()
+- metamachine enabled in ascii mode (as in GNU Go 3.6)
+- configure option oracle renamed metamachine (as in GNU Go 3.6)
+- new testfile gifu05.tst
+- don't try large scale attack if original owl reading was expensive
+- teach influence_score() about chinese rules
+- copyright notices updated for 2006
+- bugfix in unconditional status analysis
+- let --capture-all-dead and --play-out-aftermath be effective also when
+ playing out a game for scoring (e.g. --score finish)
+- semeai analysis turned off when there are a huge number of dragons
+- MAX_STRINGS value corrected
+- new assertions that the next_string pointer hasn't overflowed
+- hash flag bits and -H option removed
+- default size of reading cache set to a fixed number of entries instead
+ of a fixed amount of memory, improving platform independence
+- update information about valid boardsizes in gnugo.pod
+- bugfix for drawing 1x1 board in play_ascii.c
+- regress.pike can run multiple engines in parallel (-j option)
+- correction of color in order_moves() call in reading.c
+- doc revision, updated instruction for setting up HTML regression views
+- find_connection_moves() revised
+- GTP command dragon_data fixed to give well-formed output also on empty
+ board
+- update regress.pl and regress.plx to count connection nodes instead of
+ life nodes and expect reg_genmove instead of gg_genmove
+- remove gnugo_play_sgftree(), gnugo_genmove(), gameinfo_load_sgfheader(),
+ and gameinfo_play_move() from engine/interface.c
+- 1D conversion of gnugo_play_move()
+- new function get_sgfmove()
+- let semeai code pass if no riskless move was found
+- do not hardwire owl node limit for large scale attacks
+- remove many unneeded configure tests
+- READLINE compile (warning) fixes
+- complete rework of clock.c, using level adaption logic from play_gtp.c
+- use more tactical moves in do_owl_analyze_semeai()
+- unused function transform2() removed
+- report_worm() made static in worm.c
+- hashdata_to_string() revised for consistency between 32 and 64 bit platforms
+- bugfixes in do_aftermath_genmove()
+- adjust readconnect node limit when starting search at higher stackp
+- new function get_depth_modification()
+- removed functions set_temporary_depth_values()/restore_depth_values()
+- always set dragon status to ALIVE if owl_status is UNCHECKED
+- correct C-code footer in uncompress_fuseki.c for all values of
+ NUM_HASHVALUES
+- play_replay() and replay_node() partially rewritten
+- tuning
+- new and revised tests
+
+3.7.7 released October 9, 2005
+
+- FSF address corrected in COPYING
+- large scale improvements
+- use signed char instead of char most of the time in the engine
+- string_to_location(), debug_influence_move(), and report_worm()
+ converted to 1D
+- get_level() removed from genmove.c
+- documentation update
+- remove long deprecated command hurry from play_ascii
+- use signed char in connected_components() in owl.c
+- rotation support for --decide_* options removed
+- remove trivial wrapper functions from engine/interface.c
+- patterns/transpat.c, patterns/patlib.c, and patterns/patlib.h removed
+- unused game records in regression/golois removed
+- makevcdist.pl updated and re-run
+- all Makefile.in regenerated
+- debugboard traces from Makefile and configure removed
+- endgame1.tst removed from distribution but not from CVS
+- cutstone.tst, semeai2.tst, and *_rot.tst removed
+- debugboard removed
+- support for pattern based reading (EXPERIMENTAL_READING) removed
+- support for tree based pattern matching removed
+- view.pike: support multiple tests as argument
+- test revisions
+- consistently initialize global variables in globals.c (not main.c)
+- large scale code reorganized
+- fullboard support (-f option) remove from mkpat
+- atari_atari tuning
+- endgame tuning
+
+3.7.6 released September 21, 2005
+
+- a few missing game records restored
+- revised patterns.dsp and new uncompress_fuseki.dsp
+
+3.7.5 released September 20, 2005
+
+- revision to patterns.dsp (but more revision needed before VC will compile)
+- send usage messages caused by bad input to stderr
+- new, larger fuseki database added as compressed files
+- new files patterns/compress_fuseki.c and patterns/uncompress_fuseki.c
+- use a fullboard hash for fuseki database patterns
+- new array comulative_goal in local_owl_data
+- don't count former owl goal dragon stones towards escape measure
+- removed PROFILE_MATCHER
+- handle CRLF newlines correctly in view.pike
+- new static function squeeze_moves() in reading.c
+- fix komaster problem
+- do not trust connection moves to be safe in
+ estimate_territorial_value()
+- add random move value contributions also for pure ko threats
+- new and revised tests
+
+3.7.4 released June 12, 2005
+
+- copyright notices updated for 2005 and new FSF address
+- bugfix in find_backfilling_move in filllib.c
+- make fast_defense() aware of under-the-stones tesuji
+- make superstring_break_chain_moves() attack 3-liberty chains
+- unused code to compute genus removed from make_dragons()
+- owl tuning
+- atari-atari tuning
+- optics tuning
+- tuning
+- new and revised tests
+
+3.7.3 released March 22, 2005
+
+- special_rescue_moves() allows self atari moves which may set up a snapback
+- increase depth after filling liberties in endgame_find_backfilling_dame()
+- try harder to find safe backfilling moves in endgame_find_backfilling_dame()
+- revised heuristics to find a font file in view.pike
+- avoid crashing on bad engine paths when starting a new engine in view.pike
+- move_connects_strings() revised
+- outcommented patterns removed
+- ignore off board vertices in openregion() in fuseki.c
+- Revise diagonal value in topological_eye() to account for damezumari
+- owl tuning
+- new and revised tests
+
+3.7.2 released January 20, 2005
+
+- gnugo.el: Grid display implemented
+- gnugo.el: SGF handling improved
+- gnugo.el: Undo and Redo related enhancements
+- gnugo.el: Primitive edit mode
+- gnugo.el: Regression view mode
+- Doc revision (Emacs mode in using.texi)
+- use print_numeric_influence() for printing escape influence
+- take neighbouring half/false eyes into account when estimating lunch value
+- do not trust strategic attack and defense moves to be safe when scoring
+- thrash_around_helper() returns false if fuseki is disabled
+- value_territory() revised to disable certain reductions of the territory
+ value when scoring
+- regress.pike revised so that previous output can be used as input
+ with -f to rerun tests with unexpected results
+- connection_value() revised
+- use influence-based score estimate instead of Bouzy's algorithm
+- new global variable white_score, black_score
+- should_resign() now depends on optimistic_score instead of average_score
+- added support for GTP over TCP/IP sockets on Windows
+- new static function all_own_neighbors_inessential() in aftermath.c
+- do_aftermath_genmove() revised
+- breakage2tst.py now produces command line for regress.pike
+- further revision of thrashing dragon heuristic
+- try harder to find backfilling moves in fill_liberty()
+- find_backfilling_move() in filllib.c revised
+- test_attack_either() revised
+- fixed anchor building of owl_attackpats.db repaired
+- thrashing dragon heuristics revised
+- readline support in ASCII mode
+- liberties and neighbors list broken out of string_data array in board.c
+ for speedup
+- new functions remove_double_blocks(), check_double_block() to improve
+ territorial evaluation at places where an intrusion is possible
+- stop using worm data at stackp==0 in does_attack() and does_defend()
+- concerns_noncritical_dragon() revised
+- MIN_BOARD reduced to 1
+- free memory allocated in a failed read of an sgf file
+- extract_fuseki revisions: statistics on outcomes,
+ popularity cutoffs based on unique players added to command line
+ parameters, tweaks and bugfixes in game selection
+- atari_atari moves considered blocking in estimate_territorial_value()
+- MAX_LIBERTIES reduced to 8
+- popgo() bugfix to repair sgf traces
+- do_owl_analyze_semeai() revised
+- emacs variant of ascii interface removed
+- give less bonus to connection moves when scoring
+- influence tuning
+- owl tuning
+- tuning
+- new testsuite tiny.tst
+- new and revised tests
+
+3.7.1 released November 23, 2004
+
+- new function send_two_return_one() in utils.c
+- don't consider send-two-return-one moves in
+ do_find_more_owl_attack_and_defense_moves()
+- does_attack() made ko aware
+- new GTP commands does_attack and does_defend
+- sgfnode.c (readsgffile): Do not fclose stdin.
+- gtp.texi (GTP command reference): Add @cindex.
+- gtp-commands.sed: Use @verbatim. Tighten output.
+- gtp-commands.sed: Move `Function' field into @item line, sans field name.
+- doc/ Makefile.am (gtp-commands.texi): Eliminate redundant use of cat(1).
+- revision of gtp-commands.sed
+- bugfix in main.c: remember to sgfFreeNode(gameinfo.game_record.root)
+- allow PASS_MOVE in trymove() and tryko()
+- do_trymove() and popgo() revised
+- 'printfsgf -' supported from GTP
+- copyright notices added to xpm files
+- gnugo.el brought up to Thi's gnugo.el-2.2.8
+- new gtp_move_history() for use with gnugo.el
+- minor doc revision
+- capture_non_invincible_strings() and unconditional_life() moved from
+ utils.c to unconditional.c
+- resignation option reverted from GTP commands genmove_black and
+ genmove_white
+- new heuristic to reduce branching factor in connection reading.
+- resign rather than pass when all own stones seem dead
+- lively_dragon_exists() based on status rather than crude_status
+- potential_moves[] array converted to 1D
+- distance measures converted from floating to fixed point arithmetic
+ in connection reading code.
+- owl threats disabled as a command line option
+- EXIT_SUCCESS and EXIT_FAILURE used in transpat.c and sgfgen.c
+- revised interface to all genmove() type functions
+- new global variable depth_offset
+- only cache safe_move() results when reading depth is unmodified
+- revision of interface/emacs.el
+- new interface/xpms/*xpm, make-gnugo-xpms.el and gnugo-xpms.el
+- break_chain2_moves() revised
+- special_attack4_moves() revised
+- defend_secondary_chain_moves() revised and split into two functions
+- check_self_atari() in readconnect.c revised
+- devalue tactical defenses of owl critical dragons when there are
+ better owl defenses elsewhere
+- find_moves_to_make_seki() extended to examine the case of dead stones
+ inside the eye of single-eyed dragons
+- added support for GTP communication over TCP/IP socket; GNU Go can
+ both connect and listen
+- bugfix in break_in_goal_from_str(): check pos+delta on board
+- bugfix in sgfStartVariant
+- constrain thrashing dragons more often
+- hashing cleanups
+- missing files added to EXTRADIST in Makefile.* in doc/ and regression/
+- new file logo-36.pdf
+- DFA micro optimizations
+- Test results updated: cvs tag rel-3-7-1-pre-1
+- use int arrays instead of char arrays to mark eyes in
+ owl_determine_life() and dependent functions
+- added .eps-version of new logo
+- help string revised
+- warnings fixed
+- doc revisions
+- TODO revised
+- basic strategies to break mirror go implemented
+- matcher_check verbosity refined
+- new function are_neighbors()
+- 9x9 opening moves tuned
+- view.pike enhancement: switch to new test case
+- debugging enhancement: owl goal marked in sgf trees
+- new move reasons POTENTIAL_SEMEAI_ATTACK/DEFENSE to defer analysis of
+ possible semeai winning moves until move valuation
+- infrastructure to cut owl goal dragons
+- new owl pattern class C: threaten to cut owl goal dragon
+- view.pike enhancement: owl_does_defend/attack
+- crash in owl_hotspots() fixed
+- view.pike enhancement: directly start sgf viewer
+- remove special case of CLASS_C in matchpat.c
+- influence tuning
+- owl tuning
+- endgame tuning
+- tuning
+- implement persistent semeai caching
+- don't crash on some .sgf-files from kgs
+- NEWS updated
+- refer to 3.6 instead of 3.4 in docs
+- new and revised tests
+
+3.5.10 released August 7, 2004
+
+- move initalization of ..._vital_points to initialize_dragon_data()
+- persistent caches reorganized to share common code
+
+3.5.9 released July 18, 2004
+
+- bugfix in read_eye()
+- bugfix in fast_defense()
+- improved printing of hashvalues
+- bugfix in atari_atari_blunder_size()
+- new static function dump_board_sgf() in printutils.c
+- abortgo() no longer unwinds the stack but prints an sgf file
+- new and revised tests
+- doc revision
+
+3.5.8 released June 8, 2004
+
+- make `mkpat' detect duplicate pattern names
+- duplicate pattern names renamed
+- reduce DFA_MAX_MATCHED 20 times
+- calculate actual maximum dfa with new dfa_calculate_max_matched_patterns()
+- remove unused configure option --experimental-semeai
+- add missing output to --options
+- new static function special_rescue4() called from defend2() in reading.c
+- fast_defense() now heuristically looks for neighbors to capture
+- don't restore random state in hash_init() and keyhash_init()
+- major `view.pike' revision, added new "single window" mode
+- break_chain2_moves() revised to generate more backfilling moves
+- atari_atari_blunder_size() now returns multiple defenses, better verified
+- remove %r support from gprintf, use result_to_string() instead
+- double_atari_chain2() revised to generate more moves
+- new argument recompute_dragons to owl_analyze_semeai_after_move()
+- owl_mark_dragon() and init_owl() revised
+- detect_tactical_blunder() revised
+- value of tactical blunders doubled to twice the effective size of the string
+- not a blunder if a string alive in seki is saved when outer liberties filled
+- normalize apos, bpos in do_owl_analyze_semeai
+- find_cuts() called from make_dragons() instead of make_domains()
+- new compute_new_dragons() and new static join_new_dragons() in dragon.c
+- new global array cutting_points[]
+- cut field removed from struct eye_data
+- INHIBIT_CONNECTION bit no longer used in the type field of struct eye_data
+- find_cuts() no longer allowed to modify eyespaces
+- bugfix in do_owl_analyze_semeai()
+- tuning
+- new and revised tests
+
+3.5.7 released May 27, 2004
+
+- minor revisions in score.c
+- regress.pike measures uncertainty of moves
+- global variable hashdata renamed to board_hash
+- hashdata_compare() function removed
+- fields in struct stats_data updated for new cache
+- initialization of Zobrist random numbers in hash.c and cache.c unified
+- new function hash_init_zobrist_array() in hash.c
+- hashdata_remainder() never uses more than the 32 lowest bits of hash value
+- hashdata_NULL, hashdata_clear(), and hashdata_init() macros removed
+- any number of MIN_HASHBITS can now be used
+- ROUTINE_COSTS revised
+- find_connection_moves() revised
+- always print copyright string on stdout
+- do not include "Version" in the --version output
+- old cache implementation removed
+- ignore inessential critical dragons in in dilate_erode()
+- TRACE_CACHED_RESULT* macros implemented for new caching scheme
+- old cache implementation commented out
+- new file engine/unconditional.c added
+- break-in reading tuned
+- safety checks improved for owl defense moves
+- bugfix in find_neighbor_dragons()
+- attribute "noreturn" for abortgo()
+- don't add child to root node in sgffile_printboard()
+- remove color parameter from examine_position(), compute_eyes_pessimistic()
+- new arrays white_vital_points and black_vital_points
+- read_eye() stores vital point in new arrays when add_moves == 1
+- new functions find_lunches(), revise_inessentiality(), eye_computations()
+ broken out of make_dragons()
+- VITAL_EYE_MOVE almost retired
+- fix bugs in recursive_break()
+- owl tuning
+- new and revised tests
+
+3.5.6 released April 23, 2004
+
+- new configure and runtime option large-scale
+- new change_owl_nodes()
+- gprintf supports %r
+- cleanup of patterns/*.sgf
+- revision of dragon_invincible()
+- suppress copyright notice in ASCII playing mode or with --version
+- copyright string shortened
+- new GTP commands move_probabilities and move_uncertainty
+- bugfix in unconditional_life()
+- owl_update_goal() overrides same_dragon == 0 in obvious cases
+- new and revised tests
+
+3.5.5 released April 15, 2004
+
+- moved TRACE_READ_RESULTS definition to hash.h
+- initialize lunch data for single owl move
+- bugfix in compute_eyes_pessimistic(): initialize chainlinks[]
+- improved sgf trace in trymove: location of tried move noted
+- complete conversion to new cache
+- add priority to reading results in new cache
+- kill unused hash_ng_init()
+- minor statistics improvements
+- enlarge owl goal when it has had lunch
+- komaster and kom_pos made static variables in board.c
+- edge_block_moves() proposes more moves
+- don't try to undo when stackp is not zero (GTP mode)
+- support for multiple engines in view.pike
+- more info about semeais in dragon_data2
+- double-check owl attack moves against dragons involved in semeai(s)
+- be less optimistic about large, but bulky eyespaces
+- support for 'make gnugo.pdf' and make 'gnugo.html' in doc/
+- slowest move statistics from regress.pike
+- update usages of time_report()
+- `twogtp.pike' can now use third engine (arbiter) to score games
+- breakin and readconnect fixes
+- first implementation of owl threat combinator--intended for improving
+ move ordering
+- pattern attributes (shape, followup etc.) are now stored in lists, not
+ in `pattern' structure
+- there is now a possibility to define virtually unlimited number of new
+ pattern attributes
+- common code of shapes_callback() and joseki_callback() is broken into
+ new static function handle_joseki_patterns()
+- new function do_find_more_owl_attack_and_defense_moves() broken out
+ of find_more_owl_attack_and_defense_moves()
+- induce_secondary_move_reasons() tries to upgrade induced reasons to
+ owl attacks/defenses with do_find_more_owl_attack_and_defense_moves()
+- strategical attack move reason is induced for saving certain worms
+ adjoining weak opponent dragons
+- major improvement of analyze_eyegraph functionality in optics.c
+- adjust min_level and max_level if --level is set outside their range
+- do not malloc() 0 bytes in pattern_list_build_heap()
+- aftermath_final_status() declaration moved from gnugo.h to liberty.h
+- bugfix in find_connection_moves()
+- bugfix in hashdata_init macro
+- caching enabled for unbranched owl nodes
+- comments added explaining heap in readconnect.c
+- provide links to html regression views from regress.sh
+- semeai analysis in make_dragons() postponed until after revision of
+ inessentiality
+- identification of thrashing dragons in make_dragons() postponed
+ until after semeai analysis
+- avoid overflow in reading_cache_init()
+- converted owl to use new cache implementation
+- owl tuning
+- new game records and test cases
+
+3.5.4 released January 23, 2004
+
+- copyright 2004 added to copyright notices
+- new static function capture_non_invincible_strings() broken out of
+ unconditional_life()
+- unconditional_life() revised
+- new semeai_propose_eyespace_filling_move() tries to play inside eyeshapes
+- number_of_dragons initialized in initialize_dragon_data()
+- new option --gtp-dump-commands to dump all incoming GTP commands to file
+- new function and autohelper owl_lunch()
+- lunches_are_current field no longer reset in owl_safe_move()
+- don't claim levels higher than 10 are unsupported
+- new GTP command unconditional_status
+- estimate_lunch_eye_value() revised
+- avoid calling owl_substantial() when not needed in aa_compute_status()
+- value_move_reasons() revised
+- special_rescue6_moves() revised
+- find_connection_moves() revised
+- computation of NUM_HASHVALUES corrected in hash.h
+- hashdata_to_string reimplemented
+- defend4() and special_rescue_moves() revised
+- avoid ko captures when filling outer liberties in semeai reading
+- adjust breakin_depth in modify_depth_values()
+- atari_atari tuning
+- endgame tuning
+- eye tuning
+- fuseki tuning
+- influence tuning
+- owl tuning
+- tuning
+- new test suite unconditional.tst
+- new game records and test cases
+
+3.5.3 released January 7, 2004
+
+- new GTP command kgs-genmove_cleanup
+- compute_crude_status() revised to consider dragons with big
+ territorial moyo value as alive
+- semeai moves considered safe in mark_changed_dragon
+- compare number of eyes when both colors pass in
+ do_owl_analyze_semeai() instead of always consider it a seki
+- do not use the attack point from owl if owl considers a dragon dead
+ but semeai revises it to critical
+- bugfix in break_through_helper() in reading.c
+- new static function close_enough_for_proper_semeai() in semeai.c
+- liberty_of_dragon() transformed into neighbor_of_dragon() in semeai.c
+- in semeai(), be more careful when considering two dragons involved
+ in a semeai
+- new static function max_lunch_eye_value() in value_moves.c
+- when restraining thrashing dragons, do not bother connecting
+ inessential strings which cannot provide an eye (in
+ estimate_strategical_value())
+- new autohelper function adjacent_to_stone_in_atari
+- new static bamboo_rescue_moves() in `reading.c'.
+- computation of safety and status values in make_dragons() revised to
+ more robustly handle invincible dragons
+- dragon_invincible() revised
+- detect_tactical_blunder() revised
+- owl stack management reimplemented
+- consider semeai worms adjacent to the outside as important in
+ owl_analyze_semeai_after_move()
+- additional semeai debug output
+- let stdout be unbuffered instead of line buffered in play_gtp()
+- if one dragon is considerably smaller than the other in a semeai,
+ prefer to get ko over seki in do_owl_analyze_semeai()
+- in a semeai, consider also the eyespaces including opponent semeai
+ worms in order to detect a definite lack of eyespace and to find
+ certain vital moves
+- off-by-one error in loops over semeai_worms[] corrected
+- don't allow "safe" common liberties to depend on ko in
+ do_owl_analyze_semeai()
+- new static function find_moves_to_make_seki() in semeai.c
+- do semeai analysis for all pairs of critical/dead dragons except
+ when one is inessential, other exceptional cases removed from semeai()
+- defend4() generates superstring moves
+- semeai_move_reasons() revised
+- induce_secondary_move_reasons() revised; do not allow owl attack moves
+ to induce strategic defense of neighbors if involved in a semeai
+- connection_value() revised to never give points for connection to
+ inessential strings
+- get_influence() revised
+- list_move_reasons() revised and made global
+- new functions print_all_move_values() and prepare_move_influence_debugging()
+- delta_territory cache can be disabled in estimate_territorial_value()
+- new GTP commands all_move_values, eye_data, half_eye_data, move_reasons
+- GTP command influence replaced by initial_influence, move_influence, and
+ followup_influence
+- GTP command clear_cache now also clears the non-persistent cache
+- bugfix in corner_add_pattern() (mkpat.c): labels must be rotated too
+- spread_connection_distances() now delays expensive constraint evaluation,
+ storing pending evaluation on a heap
+- new function signed_mark_string()
+- computation of active area revised in store_persistent_connection_cache(),
+ store_persistent_breakin_cache(), and store_persistent_owl_cache()
+- move_is_marked_unsafe() in move_reasons.h revised
+- modify_stupid_eye_vital_point() revised
+- influence tuning
+- fuseki tuning
+- eye tuning
+- endgame tuning
+- owl tuning
+- tuning
+- new test suite seki.tst
+- new game records and test cases
+
+3.5.2 released November 5, 2003
+
+- Cosmic GNU Go disabled by default.
+- report_dragon() revised
+- gtp_worm_data() revised
+- pattern tagging
+- regress.sh revised
+- regress.pike revised
+- attack2() revised
+- defend4() revised
+- slow sorting in get_next_move_from_list() is replaced with heap sorting
+- new static functions pattern_list_build_heap() and
+ pattern_list_get_next_pattern() in `engine/owl.c'
+- new command line option --no-cosmic-gnugo
+- remove global variables score, lower_bound, upper_bound
+- remove (level >= 8) condition for estimate_score() call
+- pass our_score instead of score to the move valuation functions
+- tuning
+- influence tuning
+- owl tuning
+- joseki tuning
+- new game records and test cases
+
+3.5.1 released September 4, 2003
+
+- semeai() revised to better handle certain cases of multiple simultaneous
+ semeais
+- find additional semeai moves in semeai_reasons()
+- added more robust handling of .dtr files
+- removed option to build pre-rotated DFAs
+- unconditional_status in struct worm_data changed to enum dragon_status
+- final_status in the aftermath code changed to use enum dragon_status
+- enum dragon_status extended with BLACK_TERRITORY, WHITE_TERRITORY,
+ and DAME
+- new GTP command last_move
+- threaten_to_capture_helper() and pattern `Sente12' retired
+- no buffering on stdout in ascii mode
+- roadmap to engine files in overview.texi updated
+- move DEBUG_func to showbord.c
+- pattern tuning: remove "t" classification from various patterns
+- WHITE_BORDER, BLACK_BORDER, GRAY_BORDER retired
+- colors and komaster state, safety values and dragon status, cache routine
+ ids are now "enum"
+- board library: remove all stuff that is not directly related to board
+ (and move it to the engine)
+- board library: new file board.h as public interface, new file boardlib.c
+ to collect global variable of the board library;
+- board library documentation updated to reflect changes
+- new function: hashdata_to_string()
+- small_semeai() and small_semeai_analyzer() removed
+- support for !experimental_semeai removed
+- old semeai() removed and new_semeai() renamed to semeai()
+- analyze_semeai(), add_appropriate_semeai_moves(), and liberty_of_dragon()
+ removed
+- old amalgamation (!experimental_connections) code and patterns removed
+- dragon_eye() removed
+- basic_cut_helper() and ugly_cutstone_helper() removed
+- komaster schemes 1-4 removed
+- komaster_is_empty() retired
+- komaster_to_string() revised
+- KOMASTER_TRACE functionality removed
+- new GTP command combination_defend
+- revised hash table scheme
+- new COSMIC_GNUGO function choose_best_strategy() sets tuning parameters
+- new global tuning parameters: minimum_value_weight, maximum_value_weight,
+ invasion_malus_weight, strategical_weight, territorial_weight,
+ attack_dragon_weight;
+- remove unneeded configure stuff, add -Wundef to SOME_WARNINGS
+- replace setlinebuf by setvbuf
+- add safety_hash field to delta territory cache, reenable this cache
+- cgi interface in interface/html directory removed
+- owl tuning
+- new game records and test cases
+
+3.4 released July 31, 2003
+
+- breakage2tst.py and gnugo-db.el added to EXTRA_DIST
+- wariuchi fuseki: invade between shimaris
+- new sgmp mode
+- regress.pike added to EXTRA_DIST
+- revision of copyright notices
+- warnings fixed on some platforms
+- doc revision
+
+3.3.23 released July 15, 2003
+
+- bugfix in show_dragons()
+- redistribution consistency checking disabled for stable release
+- gg_genmove replaced by reg_genmove almost everywhere in the regressions
+- twogtp.py and twogtp.pike added to gtp_examples/README
+- twogtp and twogtp-a made GTP version 2 compliant
+- break-in code turned off below level 10; other level cutoffs revised
+- support for ranges in sgf files
+- time summaries reported with --showtime in gmp mode
+- TODO revised.
+- clock_init_autolevel() retired
+- new global variables min_level and max_level
+- new options --min-level and --max-level
+- time handling implemented in play_gtp.c
+- speedup: move some functionality of update_liberties() to do_remove_string()
+- bugfix in do_play_move()
+- doc: delete most lists of functions
+- doc: remove move_generation.texi overview sections
+- doc: reorder
+- doc: Consistently use hierarchical structure instead of next/previous/up
+- tuning
+- owl tuning
+- eye tuning
+- doc: complete rewrite of first sections of overview.texi
+- doc: subsection on 1D board array moved to board.texi
+- doc: references to cavities in dragon amalgamation removed
+- new game records and test cases
+
+3.3.22 released June 28, 2003
+
+- break-in code turned off below level 9
+- VPATH modifications in regression/Makefile*
+- new function thrash_around_helper()
+- thrashing patterns in patterns.db
+- configure --enable-cosmic-gnugo produces a center-oriented engine
+- added cache for results of approxlib() and accuratelib()
+- new static functions do_approxlib() and do_accuratelib() in board.c
+- finish_sgftrace() will not free the trace tree if not written successfully
+- remove tabs from twogtp.py
+- twogtp.py checks that board is not empty before indexing it
+- active area for persistent breakin cache shrinked
+- new HIGH_LIBERTY_BIT2 in persistent caches, used by breakin cache
+- new function break_chain4_moves()
+- owl moves for non-critical dragons discarded
+- do_owl_analyze_semeai() revised
+- detect_owl_blunder() also looks for semeai defenses
+- estimate_strategical_value() revised
+- new function defend_secondary_chain_moves() in reading.c
+- new parameter be_aggressive to break_chain2_moves(),
+ break_chain2_defense_moves() and break_chain3_moves()
+- new depth value: break_chain_depth
+- defend2() no longer plays on self atari liberties
+- superstring_breakchain_moves() renamed superstring_break_chain_moves()
+- fix "no moves found" logic in various readconnect.c functions
+- new debug flag DEBUG_BREAKIN
+- "smaller goal" in breakin.c revised
+- be more careful when erasing territory after successful break-in
+- break-in move generation bug fix
+- endgame_find_backfilling_dame() revised
+- new global array forced_backfilling_moves[]
+- find_backfilling_move in filllib.c revised
+- disable revise_semeai() when doing_scoring
+- no bonus for attack or defense of dead potential cutstones when doing_scoring
+- reevaluate_ko_threats() revised to avoid playing losing ko threats
+- RTRACE and VTRACE retired
+- corrected format of AP property in sgf_write_header()
+- tuning
+- owl_tuning
+- new game records and test cases
+
+3.3.21 released June 3, 2003
+
+- revision of owl_strong_dragon()
+- extra care is now taken not to waste points on tiny ko threats
+- ko threats with large followups always preferred to large reverse followups
+- twogtp.py fixed to handle jigo in endgame contests
+- made --enable-experimental-break-in the default
+- compute_smaller_goal() makes the goal even smaller in the block_off case
+- persistent caching for break_in()/block_off()
+- inessential dragons handled differently in estimate_territorial_value()
+- use smaller goal area when trying to break into territories
+- semeai_trymove_and_recurse() propagetes back changes to &owla, &owlb
+- copy over old eye_data in do_owl_defend() if escape > MAX_ESCAPE
+- new configure option --experimental-break-in
+- load_and_score_sgf_file() revised
+- detect_tactical_blunder() revised
+- ko result codes no longer discarded in owl_analyze_semeai()
+- new_semeai() revised
+- decide_semeai() in sgfdecide.c revised
+- GTP command owl_analyze_semeai renamed to analyze_semeai
+- new function owl_analyze_semeai_after_move() and corresponding GTP
+ command analyze_semeai_after_move
+- gtp_owl_analyze_semeai() revised
+- new static function semeai_trymove_and_recurse() in owl.c
+- all owl_analyze_semeai regression test cases changed to analyze_semeai
+ and revised for new result format
+- bugfixes in breakin.c and block_off()
+- new helper functions goal_to_hashvalue(), xor_hashvalues()
+- new function get_read_result_hash_modified to enable calling functions
+ to use a modified hash value when storing/looking up results in cache
+- results for recursive_break() and recursive_block() now get cached
+- cast to avoid warnings
+- documentation revisions
+
+3.3.20 released June 3, 2003
+
+- hoshi.sgf split into hoshi_keima.sgf and hoshi_other.sgf
+- new functions recursive_break(), recursive_block() in readconnect.c:
+ decide whether a string can be connected to an arbitrary goal area
+- new functions break_in(), block_off(), frontends to the functions above
+- corresponding GTP commands break_in, block_off
+- new file breakin.c evaluates whether territories can be broken in
+- new command line --experimental-break-in to evaluate territory break-ins
+- retire move_safety check in value_moves.c for territorial move valuation
+- read_eye() revised
+- `num_defends' field of half_eye_data strtucture renamed `num_defenses'
+- maximum 15 points of territorial_value will get shape bonus
+- change of semantics for --seed option
+- new GTP command printsgf
+- debugboard repaired
+- TODO revised
+- new function partition_eyespaces()
+- new function owl_find_relevant_eyespaces()
+- cpu time support for regress.pike
+- broke new spread_connection_distances() out of compute_connection_distances()
+- new spread_connection_distances() tuned
+- t moves devalued to value 16
+- new function edge_distance() in board.c
+- CPU time reported by twogtp.py
+- new static function endgame_find_backfilling_dame() in endgame.c
+- new static function endgame_find_liberties() broken out of
+ endgame_analyze_worm_liberties()
+- new owl_mineye() and owl_maxeye() and corresponding autohelper functions
+- move_connects_strings revised not to try connecting invincible strings
+- ALL_MOVE move reasons no longer considered to guarantee a safe move
+- never give cutstone bonus for an inessential string
+- new test suite joseki.tst
+- do_push_owl() doesn't copy unnecessary fields of local_owl_data anymore
+- retire special meaning of owl pattern values 99 and 100
+- bugfix in revise_semeai()
+- find_half_and_false_eyes() bugfixed
+- improve_lunch_attack() revised
+- D219 pattern retired
+- new pattern action good_attack_threat overrides heuristics in value_moves.c
+- new global known_good_attack_threats[][]
+- new functions register_good_attack_threat(), is_known_good_attack_threat()
+- make delta territory cache aware of base influence recomputation
+- owl_find_lunches() revised
+- owl_determine_life() bugfixed
+- owl.c made completely 1D and other revisions
+- new GTP command analyze_eyegraph
+- new functions analyze_eyegraph(), evaluate_eyespace(), tactical_life(),
+ tactical_life_attack(), and tactical_life_defend() in optics.c
+- new functions set_/get_/update_/reuse_random_seed()
+- save and restore random_seed where it is set to zero in deterministic
+ GTP commands
+- adjust conection and semeai depth parameters according to levels
+- don't forget to switch exchange sgf_messages in order_moves()
+- influence tuning
+- tuning
+- joseki tuning
+- owl tuning
+- major eye tuning
+- atari_atari tuning
+- new tests and test revisions
+
+3.3.19 released April 28, 2003
+
+- change USE_BDIST to 1 in owl.c
+- who_wins() invokes silent_examine_position()
+- bugfix in do_owl_analyze_semeai()
+- global variable urgent retired
+- num_stones pointer in do_corner_matchpat() replaced with macro
+- joseki tuning
+- new game records and test cases
+
+3.3.18 released April 22, 2003
+
+- don't even try 'wrong' liberties in simple_ladder_attack()
+- major revision of do_owl_analyze_semeai()
+- do_owl_analyze_semeai tracks ko results and result certainty
+- semeai tactical phase deprecated
+- semeai_trymove() eliminated
+- semeai worms redefined
+- new r format character supported by vgprintf
+- uncertain semeais treated as critical
+- new function sgf_trace_semeai() in cache.c used by SGFTRACE_SEMEAI() macro
+- new dragon2 fields semeai_attack_certain and semeai_defense_certain
+- owl_estimate_life() revised for use in semeai reading
+- don't attack unconditionally dead stones, even if thrashing
+- never play on vertices which are unconditional territory for either player
+- bugfix in attack_either()
+- back-capturing added in attack1() and code restructured
+- new regression script regress.pike
+- hashtable_clear() doesn't clear already clean parts of the table
+- `stackp' pseudofield in Read_result renamed `remaining_depth'
+- endgame1.sgf removed from the distribution
+- play_move_no_history() revised to speed up undo
+- modify_eye_spaces(), remove_lunch(), and not_lunch_helper() removed
+- new function estimate_lunch_eye_value() broken out of sniff_lunch()
+- obvious_false_eye() moved from owl.c to optics.c
+- lunch invalidating patterns removed from conn.db together with
+ corresponding code in connections.c
+- semeai moves stored in dragon2 array
+- new functions collect_move_reasons(), semeai_move_reasons()
+- new prevent_attach_threat_helper() adds reverse followup value
+- DEBUG_TERRITORY made less confusing
+- handle suicides in do_commit_suicide(), not in do_play_move()
+- fix prisoner accounting in do_commit_suicide()
+- DEBUG_INFLUENCE made less noisy
+- bugfix in gnugo_estimate_score()
+- reevaluate_ko_threats() revised
+- new helper backfill_replace
+- revisions of twogtp.py
+- bugfix in play_move()
+- improved output files from scoring mode
+- traces added to find_double_threats()
+- semeai tracing improved
+- fix arraybound violation in corner_matchpat()
+- tuning
+- influence tuning
+- joseki tuning
+- owl tuning
+- atari_atari tuning
+- eye tuning
+- new and revised test cases
+
+3.3.17 released March 2, 2003
+
+- most superstring related move generation broken into new superstring_moves()
+- try (a bit) harder in attack_either()
+- semeai worms do not have to be adjacent but may instead share a liberty
+- only claim win for attacking a semeai worm if the attack is unconditional
+- moves to defend a semeai worm are marked as possibly connected to the dragon
+- liberty_of_goal() shall consider goal vertices where stones were captured
+- allow conditional ko capture in attack4()
+- new function is_corner_vertex() in board.c
+- mark_dragon() changed from static to global
+- global variable time_to_die removed
+- revision of new_semeai()
+- endgame move generator beginnings implemented in endgame.c
+- endgame() in ascii.c renamed ascii_endgame()
+- dragon_weak() moved to dragon.c
+- bugfix in owl_substantial()
+- merge superstring related tactical move generators into superstring_moves()
+- resigning of hopeless games implemented (over GTP and in replay mode)
+- ascii interface revised to support resignation
+- twogtp.py revised to support game resignations and endgame contests
+- ascii_endgame() renamed ascii_count()
+- new ascii_endgame() in play_ascii.c
+- new command-line option --resign-allowed
+- twogtp script updated to understand resignation
+- owl_* fields moved from struct dragon_data to struct dragon_data2
+- more trace output in do_atari_atari()
+- update_aa_goal() revised
+- new dfa builder implemented in dfa.c
+- dfa size reduction algorithm implemented
+- dfa transformation hints (.dtr) files added to repository
+- speed optimizations in cache.c
+- hashtable_unlink_closed_results() renamed hashnode_unlink_closed_results()
+- check for snapback/oiotoshi reactivated in check_self_atari()
+- joseki patterns are matched using corner matcher
+- symmetrical joseki patterns no longer match twice
+- antisuji joseki patterns are handled by callback now
+- goal_elements and callback_data added to all relevant databases to
+ drop unnecessary pattern elements
+- add missing break in main.c
+- do_owl_analyze_semeai doesn't crash on certain inconsistent eye results
+- bugfix in adjacent_to_nondead_stone()
+- unneeded fflush(stdout) flushed from patterns/connections.c
+- new tests
+- atari_atari tuning
+- joseki tuning
+- owl tuning
+- tuning
+- speed up scan_for_patterns()
+- remove DFA_SORT
+
+3.3.16 released January 29, 2003
+
+- redundant patterns removed from hoshi.c
+- killer move heuristic in reading.c
+- bugfix in evaluate_diagonal_intersection
+- do_owl_analyze_semeai doesn't crash on certain inconsistent eye results
+- new static functions mark_dragon() and identify_thrashing_dragons()
+ in dragon.c
+- dead friendly neighbors of a thrashing dragon also considered thrashing
+- new global array thrashing_stone[] to mark all thrashing dragons
+- drop move reasons in add_move_reason() when the lists become full
+- bugfix in value_move_reasons()
+- MAX_REASONS increased to 120
+- persistent connection cache implemented but disabled by default
+- bugfix in estimate_score
+- bugfix for unsigned char's concerning pessimistic_min
+- bugfix: estimate_score was called many places with parameters switched
+- don't crash reading a bogus sgf file
+- more reading functions use candidate move mechanism
+- new fast_defense() looks for fast ways to get liberties
+- switch strings sometimes in defend_both
+- atari_atari tuning
+- influence tuning
+- tuning
+- new tests and regressions
+- doc revision
+
+3.3.15 released January 12, 2003
+
+- evaluate_diagonal_intersection() tries additional moves to defend a diagonal
+- does_secure() made global and moved to reading.c
+- owl_add_move has a new parameter max_moves
+- --allpats works with semeai
+- defend_both() revised to require that both strings can be saved without ko
+- adjacent_to_nondead_stone() in value_moves.c generalized
+- try harder in estimate_territorial_value() to detect when an
+ ATTACK_THREAT should not yield a followup value
+- do not use tactical defense threats as ko threats unless the move
+ itself is strategically safe
+- do not count strategical value for tactically critical dragons
+- small bonus to dame moves which have a cut or connect move reason
+- threaten_to_capture_helper() revised
+- new autohelper adjacent_to_defendable_stone_in_atari
+- new corner_point in owl.c
+- revision of improve_lunch_attack
+- surround code revised
+- surround code moved up in in make_dragons() and used to correct escape route
+- new utility function square_dist() in board.c
+- new alternate gnugo.el in interface/gtp_examples
+- semeai nodes increased to 500
+- owla life accepted on escape in do_owl_analyze_semeai only if stackp>2
+- use status instead of owl_status in find_more_owl_attack_and_defense_moves
+- speed optimizations in board.c, particularly fastlib()
+- now possible to reduce MAX_BOARD and still get working GNU Go
+- mkpat now has amechanism for dropping patterns
+- corner database creation implemented
+- corner database pattern matcher implemented but not activated
+- bugfix in play_ascii.c: allow changing handicap/komi etc. in new games
+- fixed broken indentation in play_ascii.c
+- bugfix in gtp_known_command
+- new visible_along_edge() and autohelpers
+- influence tuning
+- tuning
+- eye tuning
+- new game records and regression tests
+- doc revision
+
+3.3.14 released January 1, 2003
+
+- life.c removed from the distribution
+- semeai module made standard
+- never decrement *eyemin to negative
+- unnecessary patval elements removed from some pattern databases
+- mkpat understands goal_elements and callback_data directives
+- new autohelper : owl_eye_size()
+- tuning
+- owl tuning
+- Copyright notices updated for 2003
+- code maintenance
+
+3.3.13 released December 22, 2002
+
+- new aa_ pattern A16
+- tactical move ordering tuned
+- complete rewrite of interface to influence.c
+- new macros INITIAL_INFLUENCE(color), OPPOSITE_INFLUENCE(color)
+- new functions compute_worm_influence(), get_lively_stones(),
+ compute_dragon_influence(), get_alive_stones(), set_dragon_strengths(),
+ mark_inessential_stones(), set_strength_data(), mark_changed_string()
+ to set up calls to compute_influence()
+- new gtp command clear_cache
+- new functions clear_persistent_owl_cache, clear_persistent_reading_cache
+- joseki preparations: mkpat cleaning
+- joseki preparations: some currently unused mkpat options changed
+- joseki preparations: autohelpers no longer take `patt' argument
+- set_value_helper() retired and replaced with inline code, generated by mkpat
+- structures for the coming joseki pattern matcher defined in patterns.h
+- use "territorial_influence" for pre-owl initial_influence
+- safety values WEAKLY_ALIVE and WEAK removed
+- use dragon2[].weakness or new field .weakness_pre_owl instead in most places
+- use crude_dragon_weakness() to decide whether owl analysis is needed
+- intersections with prisoners only contribute 1.0 to moyo_value
+- arrays worms[], dragons[] removed in worms.c and value_moves.c
+- new discard rule to enforce definiton of attack either/defend both reasons
+- cleanups and improvements in board.c
+- new function set_up_snapback_moves() in reading.c
+- defend1() and restricted_defend1() revised
+- TRACE macros and friends unified
+- matchpat.c converted to 1D
+- strategic bonus for connecting critical dragons out reintroduced
+- strategic effect on critical dragon ignored unless move has owl move reason
+- influence debug output enhanced
+- defense functions in reading.c reorganized
+- eye_vertex and eye_graph structures reorganized
+- mkeyes.c rewritten to conform the changes in eyes.h
+- adjacent() and buggy hadj() macros in optics.c retired
+- recognize_eye(), first_map() and next_map() simplified and sped up
+- new static reset_map() in optics.c
+- new autohelpers omoyo_opposite and xmoyo_opposite
+- CLASS_I added to CLASS_MOVE_REASONS in patterns.h
+- compactify_att() removes duplicates from attribute list in DFA
+- dfa_rt_t.next now stores offset to next state
+- new fucntion dfa_shuffle() to minimize jump sizes between DFA states
+- shorten generated pattern files to avoid too many lines warning
+- new GTP command restricted_genmove
+- new function genmove_restricted() in genmove.c
+- new parameter allowed_moves[] to do_genmove(), review_move_reasons(),
+ and find_best_move()
+- always call init_board() when reaching a new_position()
+- eyes.db revised
+- bugfixes in cut_connect_callback() in connections.c
+- tuning
+- owl tuning
+- influence tuning
+- connection tuning
+- new tests
+
+3.3.12 released November 20, 2002
+
+- optimization in do_play_move: don't check ko unnecessarily
+- revision of critical worms to inessential in make_dragons() revised
+- owl vital attack patterns now also used for owl defense
+- major revision of connection_value(), using new function
+ crude_dragon_weakness()
+- reading.c: new move for defend1(): try to set up snap back
+- reading.c: special_rescue4() generalized to hane_rescue_moves()
+- a connection move where amalgamtion is inhibited by cut_possible() may
+ induce further connection moves
+- new oracle.c and oracle.db
+- oracle is a second gnugo process communicating with the gtp by unix pipes
+- experimental alternative move generation --metamachine using oracle
+- demonstration pattern database using oracle
+- bugfix: gnugo_get_komi() returns float as it should
+- ..goal_list macros converted to functions in owl.c
+- bugfix in owl_determine_life()
+- new functions min_eye_threat() and max_eye_threat() in optics.c
+- somewhere() revised
+- new autohelper functions [ox]_alive_somewhere
+- autohelper functions [ox]_somewhere revised
+- major revision of find_connection_distances()
+- other revisions and tuning in readconnect.c
+- bugfix in find_defense: compare against fourlib_depth when appropriate
+- compiler warnings fixed
+- new struct dfa_rt_t allows different run-time DFA structure from build-time
+- optional #define USE_BDIST in owl.c for better rotational independance
+- new and revised tests
+- new eat_lunch_escape_bonus() called by sniff_lunch()
+- 'make all' does not cause build of extract_fuseki and debugboard
+- owl_determine_life is careful if saving a lunch attacks an eye
+- bugfix: typo in store_persistent_reading_cache()
+- major cleanup in influence.[ch]
+- pre-rotated pattern generation in mkpat. (-p option) implemented.
+- %2m added as valid syntax for gprintf
+- relabel rotation matrices in transform.c
+- bugfix in atari_atari_blunder_size: don't crash on inconsistent defense
+- autoharvesting of documentation from play_gtp.c
+- tuning
+- komoku and hoshi tuning
+- eye tuning
+- owl tuning
+
+3.3.11 released October 29, 2002
+
+- experimental connection code made default
+- configure --help cleanup
+- minor changes to twogtp*
+- revision of CB20 in conn.db
+- calls to accurate_approxlib() replaced by accuratelib()
+- owl_find_lunches() revised
+- owl tuning
+- eye tuning
+- new game records and regression tests
+
+3.3.10 released October 20, 2002
+
+- fastlib revised
+- new accuratelib intended to replace accurate_approxlib
+- incremental_self_atari merged into revised is_self_atari
+- accurate_approxlib moved to board.c
+- old sgftree is now freed on successful sgf loading
+- sgftrees are freed when sgf tracing is finished
+- sgffile_printsgf() revised
+- gtp_fixed_handicap revised
+- comments improved in play_gtp.c.
+- play_ascii() revised
+- combinations() revised
+- atari_atari() generates lots of defense moves and validates them
+- do_atari_atari() generates lots of potential defense moves
+- decide_combination() revised
+- YOUR_ATARI_ATARI_MOVE considered safe in examine_move_safety()
+- atari_atari tuning
+- new GTP commands attack_either and defend_both
+- optimization in compute_connection_distances()
+- owl code reorganization
+- new clear_owl_move_data() set_single_owl_move(),
+- break out reading_limit_reached(), owl_estimate_life()
+ from do_owl_attack/defend
+- mode local_owl_node_counter global variable for owl.c
+- made long "if (pass == ...)" statements "switch (pass)" in owl.c
+- eliminated unnecessary variable "found_read_result" in owl.c
+- new strategic_effective_size()
+- computation of strategic effect is modified
+- new static read_eye() tries to improve recognize_eye() results
+- recognize_eye() sets vp->num_attacks/defenses to 0 when eye is found
+- new file surround.c
+- new is_surrounded(), does_surround() and surround_map()
+- new gtp functions is_surrounded, does_surround and surround_map
+- new autohelper macros is_surrounded, does_surround and surround_map
+- new command line option --decide-surrounded
+- new global variable gtp_version
+- new option --gtp_version
+- new function simple_showboard() in showbord.c
+- new function get_last_player() in board.c
+- gtp code revised for GTP version 2 and uses this by default
+- new function delete_persistent_reading_entry()
+- inconsistent results in attack_and_defend() resolved
+- compilation errors for EXPERIMENTAL_READING fixed
+- new experimental owl code is aware of tails getting captured
+- new move reasons OWL_ATTACK_MOVE_GAIN and OWL_DEFEND_MOVE_LOSS
+ with corresponding supporting code in value_moves.c and move_reasons.c
+- new move reason INVASION_MOVE
+- pattern class I (invasions) can now be used in patterns.db et al
+ and not only in influence patterns
+- remove EXPAND_TERRITORY_MOVE from strategic_penalty()
+- new static function do_find_break_chain2_efficient_moves() split off
+ from break_chain2_efficient_moves() and revised
+- superstring_breakchain() revised
+- speed optimization of compute_primary_domains()
+- countlib() calls eliminated in count_common_libs(), find_common_libs(),
+ and have_common_lib()
+- escape_value arrays changed from int to char
+- bugfix in code awarding strategical value for attacks/defenses of lunches
+- bugfix in ATTACK_THREAT handling in estimate_territorial_value()
+- bugfix in owl_substantial(); depth values modified correctly
+- depth consistency assertion added in do_genmove()
+- bugfix in mkpat.c
+- new static functions analyze_false_eye_territory(),
+ connected_to_eye(), and connected_to_eye_recurse() in dragon.c.
+- new global array false_eye_territory[]
+- critical dragons only consisting of inessential worms are revised
+ to be inessential
+- new function is_false_eye() in optics.c
+- new autohelper functions o_captures_something(),
+ x_captures_something(), false_eye_territory(), and false_eye()
+- owl_tuning
+- eye tuning
+- influence tuning
+- tuning
+- new game records and regression tests
+
+3.3.9 released September 29, 2002
+
+- new configure option experimental-owl-ext
+- code simplification in safe_move (use REVERSE_RESULT)
+- new randomness_scaling field in struct move_data and new scale_randomness()
+- moves matching Fj and Ft patterns get extra randomness
+- fuseki pattern tuning for kakaris in high handicap games
+- persistent cache code moved from reading.c and owl.c to new file persistent.c
+- speed optimization in order_moves() in reading.c
+- speed optimizations in fastlib(), count_common_libs(), find_common_libs()
+- duplicate lines removed from safety_to_string()
+- draw_active_area() functions in reading.c and owl.c unified
+- new ascii command: freehandicap .
+- new function: ascii_free_handicap
+- report_worm(): print all attack, defense, threat points/codes
+- worm_data::defend_codes is now called defense_codes
+- enhanced result_to_string() with new return codes.
+- removed strategically_sound_defense()
+- mingw build searches for mingwex
+- pattern symmetry corrections in owl_defendpats.db and patterns2.db
+- bugfix in topological_eye()
+- don't spread any influence below INFLUENCE_CUTOFF
+- mark_safe_stones() distinguishes between SAFE_STONE and OWL_SAVED_STONE
+- detect_owl_blunder() calls owl_confirm_safety() if move may harm own eyes
+- bugfix and speedups in accumulate_influence()
+- bugfix in value_territory()
+- comment play_connect_n()
+- document play_connect_n() in the texinfo docs
+- bugfix in play_connect_n (trace output)
+- fix comment in find_double_threats()
+- break_chain2_moves() revised
+- do_play_move() revised to improve performance
+- corrects quoting of special characters in regress.plx
+- sgffile_loadandprint() renamed to sgffile_printsgf() and revised
+- use EOF rather than -1 the code to read sgf files in sgfnode.c
+- major revision of code to write an sgf tree to file in sgfnode.c
+- set_depth_values() reorganized
+- new function find_half_and_false_eyes() in optics.c
+- blunder_size() code reorganized
+- new static detect_owl_blunder() and detect_tactical_blunder() in utils.c
+- for walking across dragons new first_worm_in_dragon(), next_worm_in_dragon()
+- new next_wormlist[]
+- mark_changed_dragon() revised using dragon loop
+- bugfix in fill_liberty()
+- filllib_confirm_safety() revised
+- make_dragon(): resolve inconsistent owl result by calling owl_does_defend()
+- add assert on inconsistent do_genmove result() in genmove()
+- life code completely disabled
+- global variables life and life_eyesize removed
+- options --life and --life-eyesize removed
+- new eye value scheme; all code handling eye values revised
+- new functions set_eyevalue(), min_eyes(), max_eyes(),
+ add_eyevalues(), eye_move_urgency(), eyevalue_to_string()
+- eyes.db revised for new eye value scheme and substantially extended
+- configure test for alarm removed
+- sigterm_handler() and volatile variable time_to_die removed
+- functions special_rescue(), special_rescue2() converted to .._moves()
+- break_chain2() removed; use new break_chain2_defense_moves() instead
+- defend2() and defend3() simplified
+- new reading codes GAIN/LOSS for later use in owl
+- more consistent use of WIN and REVERSE_RESULT() macros
+- new function sgffile_load_and_print()
+- new call convention for sgftree* functions
+- sgftreeCreateHeaderNode() revised
+- sgffile_debuginfo() renamed to sgffile_add_debuginfo()
+- new call convention for sgffile_output()
+- --color option effective in scoring mode
+- sgftree struct and functions consistently used in play_gmp(),
+ play_solo(), load_and_analyze_sgf_file(), and load_and_score_sgf_file()
+- new arrays close_worms[][], close_white_worms[][],
+ close_black_worms[][], number_close_worms[],
+ number_close_white_worms[], number_close_black_worms[]
+- compute_surrounding_moyo_sizes() revised
+- compute_surrounding_moyo_sizes() variant for experimental-connections option
+- new function influence_get_moyo_data()
+- tuning
+- owl tuning
+- new game records and regression tests
+
+3.3.8 released September 5, 2002
+
+- remove unneeded inclusion of stdlib.h in helpers.c
+- bugfix in matcher_check
+- URL's updated in documentation
+- tests updated
+
+3.3.7 released September 4, 2002
+
+- better ko tracking searching for additional worm attacks and defenses
+ in find_more_attack_and_defense_moves() and make_worms()
+- new option --output-flags
+- output using sgf trees with -o option
+- cleaning and minor bugfixes in play ascii
+- sgf handling is disconnected from engine again
+- moved sgfAddDebugInfo -> sgffile_debuginfo, outputsgf -> sgffile_output
+- write "forced" as comment when this ascii mode command is used
+- sgftree_readfile does not change root node to NULL
+- new blunder_size(), atari_atari_blunder_size() compute the blunder size
+- remove vital_string logic in atari_atari code
+- remove allowed_blunder_size heuristic in review_move_reasons()
+- instead use blunder size more exactly in new function find_best_move()
+- bugfix in hashtable_partially_clear()
+- bugfix in gameinfo_play_sgftree_rot()
+- bugfix (reading uninitialized memory) in sniff_lunch()
+- bugfix (EXPERIMENTAL_CONNECTIONS) in cut_connect_callback()
+- bugfix (gameinfo_load_sgfheader) in play_ascii()
+- man page revised
+- new options --mirror and --mirror-limit
+- new global variables play_mirror_go and mirror_stones_limit
+- new static find_mirror_move(), test_symmetry_after_move() in genmove.c
+- Apply "B" cutting pattern from shapes.db only if connection code confirms
+- new function test_attack_either_move; gets invoked by patterns
+ instead of directly adding the attack-either move reason
+- new function mark_changed_dragon() in move_reasons.c
+- only mark owl defended stones as safe if also sufficiently tactically safe
+- matcher_check can analyze existing sgf files
+- twogtp-a kills processes
+- break_chain2_moves() revised
+- placehand() renamed to place_fixed_handicap()
+- new function place_free_handicap() in handicap.c with associated
+- static find_free_handicap_pattern(), free_handicap_callback() in handicap.c
+- new GTP command place_free_handicap
+- new pattern database handicap.db
+- new autohelper macros handicap_stones, total_handicap_stones for handicap.db
+- mkpat.c revised to avoid compiler warnings for constraints using no labels
+- new file engine/handicap.c
+- placehand() moved from genmove.c to handicap.c
+- bug fix in adjusted_worm_attack_value()
+- FIXME added regarding several EITHER_MOVE reasons
+- show_dragons() revised
+- tuning
+- influence tuning
+- connection tuning
+- owl tuning
+- revised tests, many new tests, new game files
+- added Evan Berggren Daniel to AUTHORS
+
+3.3.6 released August 13, 2002
+
+- extended_chainlinks() revised
+- MAX_REASONS increased from 80 to 100
+- modify_stupid_eye_vital_point() revised
+- new functions improve_lunch_attack() and improve_lunch_defense()
+- backfilling in do_owl_attack() when trying the defender's best move
+- sniff_lunch() revised
+- new experimental_connections contingent code in shapes_callback()
+- induce_secondary_move_reasons() revised
+- tuning
+- endgame tuning
+- owl tuning
+- request id no longer passed to callbacks in play_gtp.c
+- gtp_printid() renamed to gtp_start_response()
+- new preprocessing of command lines in gtp_main_loop()
+- GTP command dragon_status revised
+- bug fix in estimate_strategical_value: EITHER_MOVE negative values
+- j pattern value increased from 22.0 to 24.0
+- new gtp experimental_score for metamachine
+- new DEBUG_MISCELLANEOUS used only in find_eye_dragons
+- connection tuning
+- B patterns found by find_cuts inhibit C patterns by find_connections
+- new connection tests
+- strategic_penalty() adds negative strategical move value a bit more often
+- revise_thrashing_dragons() revised
+- tuning
+- owl tuning
+- new tests and game records
+
+3.3.5 released July 5, 2002
+
+- bugfix in break_through_helper()
+- bugfix in combinations()
+- reduced_init_owl() allocates bigger owl stack with --experimental-semeai
+- bugfixes in pop_owl(): don't crash if owl stack has moved
+- reduce reading depth by one in influence pattern matching
+- new struct reading_moves in reading.c
+- owl stack can now handle two local_owl_data structs
+- semeai code now uses owl stack
+- don't push owl data in owl_analyze_semeai below branch depth
+- Don't change critical dragons to dead due to semeai results
+- DEBUG_SEMEAI trace enhancements
+- semeai refinements
+- owl_phase now local variable in do_owl_analyze_semeai
+- bugfix in do_owl_defend(): computation of escape parameter
+- bugfix in play_ascii.c: don't crash on unusual boardsizes
+- dead stones with no neighbors are captured territory
+- improved debug traces in score.c
+- decide-dragon clears cache between owl attack and defend
+- influence pattern tuning
+- new tests and regressions
+
+3.3.4 released June 19, 2002
+
+- segment_regions also computes territorial value of regions if available
+- dragon2.moyo_size_pre_owl andmoyo_size_post_owl replace dragon2.moyo
+- new dragon2.moyo_territorial_value, weakness
+- strategic dragon evaluation rewritten, setting dragon2[].weakness
+- moved interpolate to gg_interpolate in gg_utils.c
+- new struct eyevalue
+- moves to connect two dragons which are both adjacent to a thrashing
+ dragon are appreciated by the move valuation
+- experimental connections off by default in VC build
+- tuning
+- influence tuning
+- connection tuning
+- eye tuning
+- joseki tuning
+- owl tuning
+- new tests and game records
+
+3.3.3 released June 4, 2002
+
+- new function owl_strong_dragon() and new autohelper with the same name
+- vital_chain() returns the max number of eyes
+- no amalgamation around eye spaces with experimental_connections enabled
+- eye spaces no longer modified by INHIBIT_CONNECTION with
+ experimental_connections enabled
+- bugfix in find_connection_moves()
+- pattern classes Y and W introduced in conn.db to identify patterns
+ which only applies with or without experimental_connections
+- patterns with class e in conn.db changed to class I to better
+ reflect current usage
+- connection tuning
+- improves DFA compile time by doing fewest possible large syncs
+- experimental_influence command line and configure option removed
+- new flags dragons_known and is_territorial_influence in influence_data
+- struct local_owl_data for speedup only holds eye space of relevant color
+- owl_eyespace() and allies use only one eyespace
+- dfa doesn't report symmetric patterns multiple times
+- escape patterns in owl_defendpats.db given E classification
+- owl_determine_life() not called during escape attempt
+- only print debug output for eyes during owl reading if owl debug is on
+- better traces for unused owl patterns
+- --decide-connection also reports ko results
+- bugfix in load_and_score_sgf_file()
+- new test cases
+- edge_block and double_atari_chain2 renamed to *_moves
+- do_attack uses simple_ladder_attack when stackp > depth+10
+- give up simple_ladder_attack below 20 ply when we are komaster
+- unused caching code removed from attack? and defend?
+- macros used to make reading code readable
+- dragon field in struct eye_data removed
+- new function find_eye_dragons() in optics.c
+- dragon_invincible() and genus computation in make_dragons() revised
+- play_connect_n() uses string_connect() and disconnect()
+ unconditionally, no longer contingent on experimental_connections
+- default value for experimental_connections reset to 0
+- new command line option --decide-dragon-data
+- consistency checking of replacement patterns reenabled for unstable line
+- tuning
+- new tests and sgf files
+
+3.3.2 released May 6, 2002
+
+- Macro PATTERN_CHECK_ON_DEMAND retired
+- allpats options for owl shape moves repaired
+- new function extended_chainlinks() in board.c
+- connection and cut move reasons are relative to worms, not dragons
+- unused find_worm_pair() and related variables removed from move_reasons.c
+- MAX_REASONS increased from 40 to 80
+- induce_secondary_move_reasons() reimplemented
+- tuning
+- new test case
+- fix warnings generated by regress.plx
+- doc revisions
+- add_block_territory_move() removed
+- BLOCK_TERRITORY_MOVE reason removed
+- compute_shape_factor() and move_connects_strings() moved to value_moves.c
+- move_reasons_confirm_safety() moved and renamed value_moves_confirm_safety()
+- b patterns changed to e in endgame.db, fuseki.db, patterns.db, patterns2.db
+- classification letters ordered consistently in pattern databases
+- find_backfilling_move() in filllib.c revised
+- new debug flag DEBUG_TOP_MOVES
+- environment variables GG_OPTIONS and GNUGO when (make)ing tests
+- top moves list maintained when moves are rejected
+- bugfixes in metamachine
+- regression revisions
+
+3.2 released April 25, 2002
+
+- revision of copyright statements and THANKS
+- handtalk games moved to their own directory
+- correct move number reported in influence for illegal move error
+
+3.1.34 released April 20, 2002
+
+- "choose best anchor"-platform dependency patch in mkpat.c
+- bogus (int) conversion removed in get_next_move_from_list
+- 3.0 replaced by 3.2 in WINDOWS
+
+3.1.33 released April 19, 2002
+
+- regression/READING, STRATEGY and NICKLAS removed
+- makevcdist.pl, doc/gnugo-32.[jpg|eps]added to EXTRADIST
+- eval3.sh and semeai2.tst added to automake control
+- TODO list in texinfo updated
+- class field in struct pattern and class_mask in made unsigned int
+- input_FILE and output_FILE in mkpat.c explicitly initialized
+- tree based reading not compiled by default
+- consistency checking of replacement patterns disabled for the stable release
+- more Handtalk games in CVS
+- Jessie Annala THANKed
+- new function gg_normalize_float2int to address optics.c-platform dependency
+- hash_init behaviour made independent of boardsize
+- output cleanup: --statistics, and EITHER_MOVE-trace
+- floats normalized in finish_pattern() in mkpat.c
+- put GNU Go's passes in permanent move history
+- assertion in compute_connection_distances corrected
+
+3.1.32 released April 13, 2002
+
+- new update_random_seed()
+- gtp_set_boardsize updates the random seed
+- reset engine updates the random seed
+- aftermath revisions
+- combination of --score aftermath and -o options more useful
+- dead function opponent_not_passing() removed from genmove.c
+- init_influence() and new_value_territory() revised
+- sgftree_printboard() made global
+- bugfix in owl_hotspots()
+- valuation of attack threats revised to allow more ko threats
+- bugfix in estimate_strategical_value()
+- solid string connection bonus revised to also favor cuts of opponent
+- play_gtp() starts with boardsize of board loaded with -l instead of 19
+- no warning by default for FF[1] sgf game records
+- bugfix in push_owl
+- corrected assertion in examine_cavity()
+- shadowed variables fixed in dragon.c
+- major aftermath code revisions
+- doing_scoring contingent revisions in influence_callback(), shapes(),
+ shapes_callback(), connection_value(), estimate_strategical_value(),
+ high_handicap_helper(), and reinforce_helper()
+- analyze_neighbor() in filllib.c revised
+- size of persistent owl cache increased from 100 to 150 entires
+- bugfix in owl_confirm_safety()
+- territorial value computed for tactical attacks of dead or defenseless stones
+- caching of recent compute_escape_influence() results
+- reading cache stores depth-stackp instead of stackp
+- infl_followup_value renamed influence_followup_value and initialized
+- initialize_dragon_data broken out of make_dragons
+- dragon_data initialized even on empty board
+- owl reasons ignores empty board positions
+- twogtp does not report duplicate scores unless they differ
+- new gtp get_random_seed, set_random_seed
+- tuning
+
+3.1.31 released April 4, 2002
+
+- boardsize field added to persistent caches in reading.c and owl.c
+- break_chain_efficient_moves() revised
+- new function reduced_init_owl() in owl.c
+- mark_dragon_hotspot_values() revised
+- revised handling of inessential stones in init_influence()
+- bugfix in strategic_penalty()
+- owl speedup: owl data immediately stored in owl_stack
+- bugfix in do_owl_defense()
+- attack() now always returns PASS as move if there is no attack
+- some ASSERTs removed in board.c.
+- revision in get_next_move_from_list
+- bugfix in find_connection_moves()
+- begin_sgftreedump() can take a NULL pointer parameter
+- new gtp command ladder_attack
+- unneeded include directories removed from sgf/Makefile.*
+- seed field removed from Gameinfo struct
+- new global variable random_seed
+- joseki tuning
+- Handtalk games in regression/games
+- doc revision
+
+3.1.30 released March 30, 2002
+
+- target sgf_properties.h not built by default
+- bugfixes in defend2(), special_rescue(), and special_rescue2()
+- MAX_INTRUSIONS doubled in size
+- intrusions beyond MAX_INTRUSION silently discarded
+- new connect_and_cut_helper2 autohelper macro
+- platform dependency resolved in store_persistent_reading_cache
+- EXP_J_VALUE increased to 35 in shapes.c
+- graph_ renamed to tree_ in mkpat.c & related files
+- a few FIXMEs addressed
+- tuning
+- influence tuning
+- new logo-32.jpg and logo-32.eps
+- newlogo.eps made smaller using level 2 postscript
+- doc revision
+
+3.1.29 released March 26, 2002
+
+- asymmetry in influence computation reduced
+- case added in strategic_penalty
+- simulation of ko threat + answer in sgf output reinstated in tryko()
+- new function gg_normalize_float() in gg_utils.c
+- platform dependency fixed in readconnect.c by using gg_normalize_float()
+- scoring tweaks and optimizations
+- bugfix in gg_cputime()
+- new function influence_initial_territory to export territory valuation
+- negative strategic value added to invasion type moves
+- keima shape bonus removed in CB204b
+- tuning
+- influence tuning
+- code consistency cleanup
+- new tests in nngs1.tst
+- THANKS updated
+
+3.1.28 released March 24, 2002
+
+- hashing dependent on compiler switches, default 64 bit and no full position
+- default cache size set to 8
+- --stack option and showstack global variable removed
+- cache.o removed from libboard.a
+- unneeded include of dfa.h removed from patterns.h
+- compiler warnings fixed: dragon2_func prototyped, etc.
+- bugfix in confirm_safety() plus 1D conversion
+- komaster scheme 5 implemented and made default
+- update_aa_goal() in combination.c revised
+- heuristics to estimate cost of pattern constraint introduced
+- constraint cost used in owl callback for speedup
+- twogtp and twogtp-a close the sgf file if an engine crashes
+- twogtp-a had coordinates reversed
+- global variable last_moves[] removed
+- move history added to board state
+- static function undo_move() in board.c renamed to undo_trymove()
+- new global functions store_board(), restore_board(), undo_move(),
+ get_last_opponent_move(), and get_last_move() in board.c
+- macros do_add_stone() and do_remove_stone() removed from board.c
+- Position struct removed
+- Gameinfo struct revised
+- new board_state struct
+- API functions gnugo_* work on an internal board state instead of on
+ an externally provided board state
+- board_size workaround in influence.c obsoleted and removed
+- revised order of operations in main.c; in particular playing up the
+ position specified by -l and -L options centralized
+- revised modes for --score option
+- all undo implementations in GTP, GMP, and ASCII interfaces replaced
+ by the new undo_move() function in the board code
+- Added several .h files to appropriate .dsp files
+- corrected gcc warnings & other cleanup in mkpat.c
+- komaster_to_string now takes 2 arguments
+- new KOMASTER_TRACE; set to log all komaster_trymove calls
+- dfa ise announced only as a debug message
+- copyright notices updated
+- DRAGON2 macro array bounds checking is not the default
+- tuning
+- test revision
+- doc revision
+- additional correct answers added to reading.tst
+
+3.1.27 released March 1, 2002
+
+- important bugfix in store_persistent_owl_cache()
+- bugfix in semeai_find_backfilling_move()
+- new command line option --debug-flags
+- new DEBUG_OWL_PERSISTENT_CACHE
+- owl.c:draw_active_area draws the owl point
+- new printutils.c:routine_to_string()
+- KOMASTER_SCHEME 4 introduced
+- Tree-based pattern matching introduced.
+- pattern-base reading code supports defense by pattern.
+- new command-line switches "(attack|defend)-by-pattern"
+- OPT enums re-based to 127, to avoid conflict w/ ASCII values.
+- reformatted transform.c to look like matrices.
+- DRAGON_WEAK implemented in a function and checks array bounds.
+- improved fastlib().
+- DRAGON2 macro checks array bounds.
+- bugfix in readconnect.c:moves_to_connect_in_three_moves()
+- for non-variadic, non-VC compilers, add trace_dummy assignment
+- new function init_owl() in owl.c
+- re-order conditions in revise_semeai to insure valid DRAGON2 data
+- organize include file order to facilitate pre-compiled headers.
+- use location_to_string in replay_node()
+- improve assertion in sgftreeAddComment()
+- removes a bogus "," from Pattern D305
+- read_attack.db tuning
+- new read_defend.db
+- VC builds uses precompiled headers
+- VC Release builds generate debug symbols
+- new '-s' option to regress.pl to control creation of sgf files.
+- instruct robots not to follow regress.plx links.
+- unexpected results page orders results correctly
+- defaults for config.vc(in) made same as 3.1.27 release.
+- new semeai test
+- doc revision
+
+3.1.26 released February 24, 2002
+
+- experimental influence, experimental and alternate connections are default
+- caching code revised to once more work with TRACE_READ_RESULT enabled
+- added EXPERIMENTAL_READING to config.vc(in)
+- updated makevcdist.pl
+- bugfix in owl.c:dump_pattern_list()
+- alternative reorganized owl callback structure for substantial speed-up:
+- owl_shapes revised, new functions get_next_move_from_list() et al.
+- new function dump_pattern_list(...) for debugging
+- pattern cleanup
+- spelling fixes
+- verbosity revisions with alternate connections in readconnect.c
+- bugfix in close_bubbles()
+- bugfix in compute_owl_escape_values()
+- revised "stepped on a bug" message
+- bugfix in update_status in semeai.c
+- bugfix in estimate_time_by_move
+- replay added to debug helpstring
+- revised nonvariadic versions of TRACE and allies
+- increased MAXSTACK to MAX_BOARD*MAX_BOARD again
+- experimental influence taken down for initial influence when dragons unknown
+- doc revision
+
+3.1.25 released February 14, 2002
+
+- updated AUTHORS
+- command line option --options reports configure options
+- verbose reduced in readconnect.
+- do_genmove tries harder to restrain thrashing dragons.
+- DFA_SORT set to 0.
+- new gtp tryko.
+- new function fastlib() helper for approxlib family.
+- a pattern can now force the anchor point.
+- matchpat can be run forcing anchor to be in the goal.
+- simplification of UPDATE_SAVED_KO_RESULT
+- reduce overhead in non-variadic macro TRACE definitions
+- reduce MAXSTACK
+- EXPERIMENTAL_READING code much more interesting.
+- moved most of EXPERIMENTAL_READING code out of do_attack.
+- [ox]lib request only up to MAX_LIBERTIES liberties.
+- bugfix in reevaluate_ko_threats
+- floating point exceptions stopped in readconnect.c
+- experimental influence: yet another new_value_territory revision
+- experimental influence: fixed followup values really taken down (shapes.c)
+- experimental influence: pattern tuning
+- experimental influence: follow-up specific constraints for B patterns
+- experimental influence: new_value_territory revised (center correction)
+- experimental influence: most fixed follow-up values taken down
+- experimental influence: tuning, joseki values increased, some bugs fixed
+- experimental_influence ignored for escape influence
+- influential doc revision
+- edge_double_sente_helper is now autohelper
+- owl threat loop broken out
+- new global thrashing_dragon
+
+3.1.24 released February 3, 2002
+
+- cleanup of clock.c, filllib.c, fuseki.c, genmove.c, globals.c,
+ gnugo.h, hash.h, printutils.c, reading.c, showbord.c, utils.c,
+ worm.c
+- New function gfprintf in printutils.c
+- do_owl_analyze_semeai won't read below MAX_SEMEAI_DEPTH
+- AFFINE_TRANSFORM() macro
+- new (stub) function opponent_not_passing
+- new function sgffile_write_circle_mark
+- gg_cputime used for time statistics consistently.
+- alternate connection reading algorithm appended to readconnect.c
+- new option --alternate-connections toggles the connection reading algorithms
+- Zobrist hashing implemented in owl_analyze_semeai
+- do_owl_analyze_semeai no longer considers unsafe outside liberties
+- small_semeai reimplemented
+- make_worms takes the save_verbose parameter to allow a few traces
+- traces improved in decide_tactical_semeai
+- EXPERIMENTAL_READING code (pattern based) added.
+- added "tried" parameter to special_rescue
+- defend2-[CD] won't re-try moves (avoid cache check).
+- faster implementation of accurate_approxlib.
+- mkpat takes multiple -i parameters, outputs in binary
+- Visual C now uses _vsnprintf
+- revision of patterns/mkpat.dsp
+- sgf output tweeking.
+- bugfix in experimental influence: floating point exception cure
+- bugfix in regress.plx: handling of gtp worm_stones
+- tuning
+- owl tuning
+- connection tuning
+- test revision
+
+3.1.23 released January 28, 2002
+
+- configure option: alternate-connections
+- experimental influence: followup value computed in influence.c
+- experimental influence: new_value_territory revised
+- experimental influence: new handling for intrusion patterns
+- experimental influence: support for standard/experimental specific patterns
+- reevaluate_ko_threats now makes checks
+- new get_biggest_owl_target()
+- DEFEND_BOTH_MOVE reason taken down
+- new gtp functions get_komi and get_handicap
+- bugfix in gtp worm_stones: did not print newline if board empty
+- support for two strings and two results in cache.[ch]
+- simplified code to do cache lookup in reading.c and owl.c
+- bugfix in estimate_territorial_value()
+- bugfix in find_worm_threats()
+- readconnect finds connections through ponnuki
+- readconnect sgf improvements
+- bugfix in estimate_strategical_value(): ALL_MOVE worms were overvalued
+- VC build now DFA compliant
+- semeai module sets matcher status to ALIVE instead of ALIVE_IN_SEKI
+- regression html view enhancements
+- fix arraybound violation in compute_aa_values
+- constraint diagram checking moved to new check_constraint_diagram()
+- Invoke check_constraint_diagram *before* incrementing patno
+- atari_atari_find_defense_moves() revised
+- ATTACK_EITHER_MOVE taken down
+- new ALL_MOVE reason
+- new static find_all_data(), all_move_redundant() in move_reasons.c
+- new function add_all_move()
+- add_defend_both autohelper macro revised
+- tuning
+- influence tuning
+- owl tuning
+- hoshi tuning
+- new and revised tests
+
+3.1.22 released January 20, 2002
+
+- find_backfilling_move() in filllib.c revised
+- dfa made standard
+- owl threat computation made optional (and not default)
+- comments added, cleanup around discard_redundant_move_reasons
+- new (unused) experimental influence configure and run time options
+- unsafe tactical moves now taken care by discard_redundant_move_reasons
+- FIXME added for reevaluate_ko_threats
+- atari_atari_attack_patterns() uses a goal array to limit search area
+- new functions compute_aa_values(), get_aa_value(), and update_aa_goal()
+- ko contingent defenses excluded in get_saved_worms(), get_saved_dragons()
+- valuation of atari_atari move reasons revised
+- recognize_eye() revised
+- spelling corrections
+- fflush() added a few places
+- owl tries tactical defense for small groups
+- owl logs number of variations per sub-tree in SGF file
+- [ox]play_(attack_either|defend_both) handles ko correctly.
+- added [ox]play_connect and dis_connect helpers
+- allow followup value if defense threat is contingent on ko.
+- only allow territory move values if move is deemed safe.
+- reduce cutstone values in case of ko.
+- debug printing in influence.c slightly restructured
+- new function influence_moyo_color_opposite()
+- one trace output reenabled in confirm_safety()
+- bugfix in sgftreeAddStone
+- bugfix in komaster_trymove
+- mascot in dragon.c
+- tuning
+- eye tuning
+- atari_atari tuning
+- connection tuning
+- fuseki tuning
+- owl tuning
+- test revisions
+
+3.1.21 released January 12, 2002
+
+- revision of compute_surrounding_moyo_sizes()
+- bugfix in pattern EE302
+- value_moves.c split from move_reasons.c
+
+3.1.20 released January 11, 2002
+
+- ko return codes from owl_does_attack() and owl_does_defend() handled
+ in analyze_semeai()
+- special_rescue2() generalized and reimplemented
+- bugfix in edge_clamp()
+- mkpat does consistency checking between the diagram and constraint diagram
+- new function connect_and_cut_helper() in helpers.c
+- least significant bit of move reason now denotes a threat
+- bugfix in add_attack_either_move
+- new move reason: EITHER_MOVE
+- disabled add_attack_either_move
+- removed redundant EITHER_MOVEs
+- minor cleanup in move_reasons.c
+- some cleanup in move_reasons.c
+- renamed some move reasons for name consistency
+- new function special_rescue6() in reading.c
+- defend3() revised
+- don't run compute_eyes on eye spaces not attached to a dragon
+- avoid giving followup values to non-sente threats in
+ threaten_to_capture_helper() and in estimate_territorial_value()
+- new test_gray_border() in board.c with assertions in genmove.c
+- xplay_attack_either returns WIN not 1
+- improved debugging and trace output
+- checking of sgf GM and FF properties revised
+- Makefile.in's converted using Automake 1.5
+- html view enhancements
+- tuning
+- influence tuning
+- owl tuning
+- fuseki tuning
+- performance tuning
+- test revisions
+
+3.1.19 released January 2, 2002
+
+- bugfix in aftermath_genmove()
+- bugfixes in the atari_atari code
+- obsolete atari_atari code removed
+- tuning
+- owl tuning
+- sgf2tst repair
+- regress.plx improvements
+
+3.1.18 released December 23, 2001
+
+- 1D conversion of incremental.texi
+- new function dragon_looks_inessential() in dragon.c
+- adjusted_worm_attack_value() revised
+- indented debug output of secondary move values
+- new local struct aa_move in combinations.c
+- new pattern class 'c' for conditional moves in aa_attackspats.db
+- atari_atari() tries to attack smallest targets first
+- combinations() finds multiple defenses when opponent has a combination attack
+- new gtp commands owl_connection_defends and owl_substantial
+- mkpat checks that main diagram and constraint diagram have the same size
+- mkpat stricter in parsing of classification field
+- new function gg_sort() in gg_utils.c
+- all calls to qsort() replaced by calls to gg_sort()
+- linear_eye_space() removed
+- make RTRACE and VTRACE variatic functions same as macros
+- debug output and valuation of attack on defenseless stones corrected
+- TODO revised
+- fixed value of J patterns no longer scaled with board_size
+- bugfix in owl_attackpats.db pattern D1137
+- assertion added in owl_escape_value()
+- bugfix in moves_to_connect_in_three_moves() in readconnect.c
+- support for all tactical worm points in debugboard
+- tuning
+- owl tuning
+- influence tuning
+- atari_atari tuning
+- test revisions
+
+3.1.17 released December 16, 2001
+
+- new configure and runtime options semeai-variations
+- new function semeai_trymove()
+- bugfix in catalog_goal
+- semeai revisions
+- warning avoided in dfa_avoid_string()
+- code cleanup
+- devalued attacking dead group bonus
+- corrected value to final_value in review_move_reasons()
+- value_territory() in influence.c revised
+- common debug code moved from compute_eyes(), compute_eyes_pessimistic()
+ to print_eyes()
+- inactive support to test against linear_eyes() in compute_eyes_pessimistic()
+- MAXPATNO increased to 400 in mkeyes.c
+- naive_ladder() replaced by simple_ladder()
+- bugfixes in attack_threats()
+- new gtp commands reset_connection_node_counter, get_connection_node_counter
+- removed small valued lunch attacks and defenses in owl_determine_life()
+- new gtp commands owl_threaten_attack, owl_threaten_defense
+- better error reporting in mkpat.c
+- improved error reporting in owl.c
+- html regression view tweeks
+- new function second_order_liberty_of_string() in board.c
+- readconnect.c revised
+- take into account followup values if reverse_followup >= 1
+- try a little harder in attack_either
+- break_through_helper improved
+- tuning
+- owl tuning
+- eye tuning, adding many patterns with occupied margins
+- test revisions
+
+3.1.16 released December 9, 2001
+
+- readconnect revised
+- new board.c function breakchain3()
+- dsp and config.vc updates
+- new function influence_get_moyo_segmentation()
+- new function add_influence_source()
+- computations of moyo size surrounding a dragon changed
+- confirm_safety() takes two new parameters to tell which stones were saved
+- atari_atari_confirm_safety() revised
+- compute_aa_status() revised
+- new is_vital_string() in combinations.c tracks stones not to be sacrificed
+- generation of attack moves in do_atari_atari uses patterns
+- new pattern database pattern/aa_attackpats.db
+- atari_atari_find_defense_moves() improved
+- new functions get_saved_worms() and get_saved_dragons() in move_reasons.c
+- new function move_reasons_confirm_safety()
+- examine_move_safety() revised
+- new function decide_combination() in sgfdecide.c
+- new option --decide-combination
+- new experimental-combination configure option, and command line options
+- new gtp command aa_confirm_safety
+- bugfix in trymove()
+- 1D revisions and cleaning up
+- new file: engine/movelist.c
+- generalized handling of move lists and moved from worm.c
+- attack_threats() enhanced
+- AA_THREAT_DEPTH set to 3
+- find_worm_threats() uses attack_threats more
+- pessimistic_compute_eyes() tries harder to find a vital point
+- new atari_atari_find_attack_moves() and atari_atari_find_defense_moves()
+- do_atari_atari() restructured
+- experimental-semeai configure option
+- experimental_semeai command line option
+- new function new_semeai()
+- owl_analyze_semeai improvements
+- split USAGE_DEBUG in half due to VC limitation
+- removed final VC warning in dfa.c
+- revised trace in value_move_reasons()
+- regress.plx improvements
+- speedup in gtp_same_dragon
+- test revisions
+- 13x13 tests
+
+3.1.15 released November 30, 2001
+
+- new field value in struct half_eye_data
+- topological_eye(), evaluate_diagonal_intersection() take ko into account
+- improved debug output in compute_eyes() and compute_eyes_pessimistic()
+- add_half_eye() renamed add_false_eye
+- make_proper_eye_space() and remove_eyepoint() removed
+- owl_topological_eye() reimplemented to look up stored data
+- new function special_rescue5() in reading.c
+- defend2() and defend3() revised
+- new GTP commands list_stones and tactical_analyze_semeai()
+- new command line option --decide-tactical-semeai
+- support for marginal eye points with opponent stones in eyes.db
+- persistent caching added to owl_does_attack()
+- owl_does_defend() and owl_does_attack() now understand ko
+- owl_determine_life() revised
+- owl_analyze_semeai() revised
+- small_semeai() calls owl_analyze_semeai
+- new function silent_examine_position()
+- find_more_owl_attack_and_defense_moves() revised
+- ko valuation revised
+- cutting worms are never inessential
+- 1D revision of print_eye() in optics.c
+- compute_eyes_pessimistic() revised
+- bugfixes in evaluate_diagonal_intersection()
+- new gtp commands owl_analyze_semeai, owl_does_attack, and owl_does_defend
+- revision of owl_analyze_semeai()
+- new static catalog_goal in owl.c
+- sgfdecide functions made 1D
+- empty_corner_value adjusted to board size in fuseki()
+- removed tactical reading move pass from owl.c
+- contribution of (reverse) followup values revised in value_move_reasons
+- comments made 1D in owl.c
+- regress.pl now accepts "problem sets"
+- regress.plx includes "unexpected result" list
+- new gtp_example/sgf2tst.pl
+- changed warning to error in mkpat.c
+- minor change to regress.pl
+- atari_atari now considers general threat the first moves
+- new depth parameter aa_threat_depth
+- new function: atari_atari_succeeded
+- cleanup in atari_atari functions
+- compute_escape_influence now 1D
+- new function in reading.c: attack_threats
+- handling of tactical moves in worm.c no longer static
+- replaced abort() in mkeyes with fatal error messages
+- patterns.dsp and gnugo.dsw revised
+- tuning
+- influence tuning
+- connection_tuning
+- owl tuning
+- test revisions
+- new trevora tests
+- new semeai tests
+- doc revision
+
+3.1.14 released November 17, 2001
+
+- recognize_eye() revised
+- new function test_eyeshape() in optics.c
+- new gtp command test_eyeshape
+- vital and num_vital fields removed from struct eye_graph
+- mkeyes.c revised
+- non-territory patterns introduced in the influence code
+- revised formula for addition of followup_value
+- better trace output for followup_value and reverse_followup_value
+- typo fixed (whose_moyo for whose_area) in value_territory()
+- new debug flag DEBUG_TERRITORY
+- delta computation of territory, moyo, and area in influence.c restructured
+- influence_value part of move valuation removed
+- new function is_edge_vertex() in board.c
+- guess_eye_space() revised
+- compute_eyes_pessimistic revised
+- do_owl_defend() revised
+- move stupid vital marginals from first to second line in owl_determine_life()
+- patterns.dsp doesn't reference invalid file
+- regress.pl deals with threads better on Win32
+- regress.plx supports view by category
+- updated regress.pl
+- add file & line numbers to more warnings in mkpat.c
+- comments in reading.c made 1D
+- DFA_ENABLE ifdefs removed
+- remove *.dfa stuff from makefiles keeping only DFA_FLAGS for mkpat.
+- configure --enable-dfa touches .db files.
+- bugfix in find_double_threats()
+- global_matchpat() renamed matchpat()
+- regression view includes node counts, SGF link, and -t output.
+- GTP echo_err added to allow echoing to STDERR.
+- atari_atari moved to combination.c
+- restricted_defend1 and restricted attack2 now public functions
+- in find_double_threats, make threat reasons into attack_either reasons
+- old disabled function remove_move_reason() now enabled
+- some simple cleaning
+- genmove now 1D
+- out of bounds array violation in showbord.c fixed.
+- regress.pl records sgf trace for owl_attack & owl_defend.
+- regress.plx provides access to sgf trace files if present.
+- tuning
+- connection tuning
+- eye tuning
+- owl tuning
+- influence tuning
+- revision of rot tests
+- ld_owl_life.tst removed
+- new and revised regression tests
+- Some tests in endgame.tst corrected.
+
+3.1.13 released November 6, 2001
+
+- new function are_neighbor_dragons()
+- verbose value reduced while running owl_reasons
+- influence code revised
+- function find_stones_saved_by_move() in move_reasons.c removed
+- find_more_owl_attack_and_defense_moves() revised
+- owl attacks induce strategical defenses of friendly neighbors
+- connection values revised
+- territorial value of attacks, defenses, owl attacks, and owl
+ defenses computed through influence function, not effective_size
+- bugfix in computing effects of min and max territory values
+- played stone not automatically in goal array in owl_does_defend(),
+ owl_confirm_safety(), and owl_connection_defends()
+- gtp commands debug_influence, debug_move_influence, move_influence removed
+- cleanup in mkpat.c
+- malformed line warning turned into error in mkpat
+- 1D documentation revisions.
+- twogtp-a now give a (halfhearted) default to missing goprog.
+- twogtp-a works for VC builds now.
+- mkpat.c generates more useful errors.
+- mkpat.c forces output to have compile error if input also had errors.
+- comments in readconnect.c
+- snapback only looks at one liberty in readconnect.c
+- do_atari_atari confirms the *defense_point is safe before returning
+- atari_atari_confirm_safety initializes defense_point
+- trivial bugfix in move_reasons.c
+- important bugfix in semeai.c, could cause a crash
+- tuning
+- owl tuning
+- influence tuning
+- gtp_set_boardsize resets the engine and stack
+- new and revised regression tests
+- new command-line option --orientation
+- -l and decide-* options can be combined with --orientation
+- tuning and regression revisions
+- regress.plx revisions: total line, time display, command line hint
+
+3.1.12 released October 28, 2001
+
+- break_chain2_efficient_moves() and break_chain2_moves() revised
+- add_array() in readconnect.c simplified
+- bugfix in moves_to_connect_in_two_moves()
+- sgf traces turned off in quiescence_capture()
+- new fields owl_attack_code and owl_defense_code in struct dragon_data
+- revised definition of WEAK and WEAKLY_ALIVE dragons in make_dragons()
+- revised computation of size of surrounding moyo for a dragon
+- 1D revisions
+- add_attack_move() and relatives also take the result code as parameter
+- new move reasons ATTACK_MOVE_GOOD_KO, ATTACK_MOVE_BAD_KO, and so on
+- move valuation distinguishes between attacks, defenses, owl attacks
+ and owl defenses with or without ko
+- connections tested as owl defenses when connecting out a critical dragon
+- revised valuation of threats and strategical attacks
+- compute_eyes_pessimistic() revised
+- owl_determine_life() revised
+- new static compute_aa_status() broken out of three atari_atari functions
+- tuning
+- connection tuning
+- owl tuning
+- joseki tuning
+- new and revised regression tests
+- new reorientation test suites
+- remove rot* subdirs from EXTRA_DIST
+- bugfix in score.c (typo from 1D conversion)
+- revisions to extract_fuseki: make partial board patterns
+- revised fuseki9.db
+- Corrected VC build error converting unsigned 64-bit long to double
+- regress.pl split into regress.pl & regress.plx
+- added -all, to have regress.pl parse Makefile.in for tstfile list.
+- html view has better marking of non gg_genmove positions.
+- New move generator: combinations() in new file combinations.c
+- double attack threats detected
+- better valuation of attacks on worms
+- general cleanups
+
+3.1.11 released October 21, 2001
+
+- tuning
+- owl tuning
+- eye tuning
+- new function owl_proper_eye() and autohelper with the same name
+- valuation of uncertain owl defense moves revised
+- evaluate_diagonal_intersection() revised
+- new pattern class b in owl_defendpats.db
+- handling of same_dragon field in struct owl_data revised
+- do_atari_atari() revised
+- bugfixes in make_worms()
+- 1D revisions all over the engine
+- new debug flag DEBUG_READING_CACHE
+- same_dragon() renamed is_same_dragon()
+- new gtp commands start_sgftrace and finish_sgftrace
+- new and revised regression tests
+- new gtp command top_moves
+- bugfix in draw_back
+- Add ON_BOARD1 assertions in liberty_of_string and neighbour_of_string
+- Use Win32 API to get CPU time usage for all Win32 builds, not just VC
+- Added a few scattered regression comments
+- Updated regress.pl to latest ever evolving version.
+- Adds several test cases and SGF files to trevor.tst & games/trevor/
+- reorientation code moved from gtp.c to play_gtp.c
+- owl_rot.tst uses reorientation code
+- fixed sscanf problem in (worm|dragon)_(stones|data)
+- allow dragon_stones to take color parameter, as well as coord.
+- revisions to capture.tst and vie.tst
+- further 1D revision in dragon.c
+- top_move functionality added to regress.pl
+- filllib.c and semeai.c made 1-dimensional
+- new gg_cputime in gg_utils.c
+- improved configuration for ncurses/{term,curses}.h
+- new and improved tests
+
+3.1.10 released October 14, 2001
+
+- portability fix for MINGW. Don't include crtdbg.h
+- rename connect to string_connect.
+- all move reason handling is 1D
+- owl goal and other date are 1D
+- new and revised test cases
+- bugfix in random.c
+- revision of readconnect.c
+- bugfix for Cygwin: gtp_dragon_data misreports invalid coordinate
+- revision of trevor.tst
+- bugfix in inv_rotate: use bs-1 instead of bs
+- new gtp function orientation
+- new gtp function query_orientation
+- in gtp_mprintf use gtp_print_vertex for the %m format specifier.
+- revision of regress.pl, Stone.pm
+- revision of engine/engine.dsp: remember readconnect.c
+- make gtp_loadsgf reorient gamerecords
+- make gtp_printvertices orient output points back
+- new function count_common_libs() in board.c
+- struct worm_data tracks all attack, defense, attack and defense threat points
+- remove_attack_move() and remove_defense_move() removed
+- attack_move_known(), defense_move_known(), attack_threat_move_known(),
+ and defense_threat_move_known() moved from move_reasons.c to worm.c
+- change_attack() and change_defense() moved from utils.c to worm.c
+- new functions change_attack_threat() and change_defense_threat() in worm.c
+- new function worm_reasons() in worm.c
+- trace messages in worm.c changed to DEBUG_WORMS messages
+- remove_opponent_attack_and_defense_moves() and
+ do_remove_false_attack_and_defense_moves() removed from move_reasons.c
+- NON_ATTACK_MOVE and NON_DEFEND_MOVE move reasons removed
+- try a little harder to find attack threats
+- attack.db and defense.db revised
+- indirect_helper() removed from helpers.c
+- tuning
+- minor owl tuning
+- new function have_common_lib() in board.c
+- new option --decide-connection
+- new function decideconnection() in sgfdecide.c
+- bugfixes in board.c, sgfdecide.c, and main.c
+- new IS_COLOR macro
+- comments moved from regression/STRATEGY to strategy.tst
+- time_report has a mintime parameter
+- many new tests in strategy4.tst
+- new regression/golois/*.sgf
+- new connect.tst global.tst vie.tst wolf.tst
+- new gtp function cputime
+
+3.1.9 released October 7, 2001
+
+- revised examine_move_safety heuristics
+- owl_determine_life() revised
+- new gtp functions connect and disconnect
+- naive_ladder() made global
+- warnings eliminated from readconnect.c
+- most functions in readconnect.c made static
+- add point reorientation functions
+- add some comments to dfa.c
+- bugfix and cleanup in naive_ladder()
+- new interface/GoImage/Stone.pm
+- struct eye_data arrays changed from 2D to 1D
+- 9x9 case revised in fuseki()
+- bugfix in goal detection in matchpat, don't accept empty goal vertices
+- bugfix in gtp_genmove()
+- new test cases in owl.tst
+- further 1D revisions in worm.c
+- find_lunch() moved from utils.c to worm.c
+- is_same_worm() converted to 1D
+- bugfix in list_move_reasons()
+- revised test case in niki.tst
+- tuning
+- owl tuning
+- connection tuning
+- new implementation of compute_primary_domains()
+- new eye pattern
+- bugfix in fuseki.c
+- cleanup and further 1D conversion in optics.c
+- sgf_decideeye doesn't require owl computation
+- 1D revisions in worm.c
+- is_worm_origin(), propagate_worms(), does_attack(), does_defend() are 1D
+- NNGS customization removed from ascii interface
+- gtp_worm_stones can be run with stackp>0 and can take a color argument
+- mkpat can take -i and -o options
+- MIN_BOARD is 5
+
+3.1.8 released October 1, 2001
+
+- defend2() revised
+- attack2() revised
+- break_chain2_moves() revised
+- connection_value() revised
+- most parts of move_reasons.c converted to 1D
+- domain calculation in optics.c now 1D
+- hash.c is more 1D
+- new function is_ko_point() in board.c
+- computation of cavities removed from worm.c
+- computation of caves removed from dragon.c
+- computation of inessential worms moved from make_dragons() to make_worms()
+- computation of ko points removed from make_worms()
+- printing of cutting stones removed from genmove.c
+- examine_cavity() simplified and made static
+- cavity_recurse() simplified
+- ko field removed from worm_data struct
+- border field removed from dragon_data struct
+- several fields moved from struct dragon_data to struct dragon_data2
+- false_margin field eliminated from struct eye_data
+- cleanup of sgf code
+- extended functionality of gtp commands dragon_stones and worm_stones
+- gtp_dragon_data returns a list of strings
+- new gtp functions dragon_stones and worm_stones
+- revision of extract_fuseki
+- revision of fuseki.c
+- bugfix in break_chain3
+- bugfix in special_attack4
+- warning fixed in mkpat
+- formatting errors fixed in decidestring and other places: use %1m
+- bugfix: trace in move_reasons.c
+- gtp_dragon_data() revised
+- new gtp functions dragon_stones and worm_stones
+- twogtp-a writes html
+- tuning
+- owl tuning
+- eye tuning
+- one new test case in reading.tst
+- new regression/games/trevor/* and unsorted tests mv'ed to trevor
+- new tests xxlin.tst
+- strategy4 target in regression/Makefile.am corrected
+- rotated tests revised
+- dsp files revised
+
+3.1.7 released September 24, 2001
+
+- heye[] is now stored as a 1-dimensional array
+- halfeye() is now called is_halfeye()
+- new macro for traversing all points: for_all_board()
+- atari_atari and helper functions now 1D
+- all goal functions in reading.c now 1D
+- calls to the goal functions in reading.c converted to 1D calling standards.
+- bufix in do_find_superstring()
+- bugfix in aftermath_genmove()
+- bugfix in hashdata_recalc()
+- bugfix in store_persistent_owl_cache()
+- assertions added to are_neighbor_strings()
+- analyze_neighbor() in filllib.c revised
+- alternative definition of ASSERT1 macro corrected
+- revised valuation of vital eye moves
+- colored legends with -T output
+- make internals of worm[][] 1-dimensional
+- make eye data 1-dimensional
+- new macros: PASS_MOVE and NO_MOVE
+- change_attack and change_defense are now 1-dimensional
+- worm handling in move_reasons.c is now 1-dimensional
+- dragon.c is now 1-dimensional
+- prefix struct option in getopt.c with gg_
+- prefix all occurences of optarg with gg_
+- improved color support in cygwin and VC++
+- brighter colors under VC++
+- increase BOARDSIZE by one
+- set MAX_BOARD to 19 for development versions
+- new functions readsgffilefuseki, gametreefuseki in sgfnode()
+- tuning
+- owl tuning
+- new strategy4.tst and unsorted.tst
+- new game record and new and revised filllib regression tests
+
+3.1.6 released September 15, 2001
+
+- limited pushing of p[][] allows one level of recursion in global_matchpat
+- bugfix in sgf_utils.c function get_moveX() and get_moveY()
+- new functions find_common_libs() and are_neighbor_strings() in board.c
+
+3.1.5 released September 15, 2001
+
+- board changed from 2D to 1D array representation
+- major revisions of board.c and reading.c
+- smaller revisions more or less anywhere
+
+3.1.4 released September 14, 2001
+
+- do_atari_atari tries harder to find defenses
+- confirm_atari_atari checks to see if tried move really causes the combination
+- changing a group's status from CRITICAL to DEAD does not satisfy atari_atari
+- bugfix in find_more_owl_attack_and_defense_moves()
+- new function start_timer() and time_report() in utils.c
+- showtime code cleaned up in dragon.c, genmove.c, and move_reasons.c
+- move numbers printed correctly in ascii interface
+- minor changes and cleanup in ascii interface
+- prefix getopt_long and the options struct with gg_
+- new functions sgfFreeNode and sgfFreeProperty
+- tuning
+- influence tuning
+
+3.1.3 released September 6, 2001
+
+- bugfix in the atari_atari code
+- obsolete sgf_dump facilities removed
+- remove_string removed from gnugo.h
+- add_replacement_move() in move_reasons.c revised
+- in value_move_reasons() ko threats are affected by shape values
+- tuning
+- don't call new_position for every stone when playing out an SGF tree.
+- new gtp engine metamachine in interface/gtp_examples
+- new gtp command query_boardsize
+
+3.1.2 released September 4, 2001
+
+- realloc space for owl stack if needed
+- new static functions push_owl and pop_owl
+- bugfix in move_reasons.c to avoid overcounting certain attacks
+- move replacement mechanism implemented in move_reasons.c
+- new autohelper action replace()
+- new game record and regression test
+- new tests and regressions
+
+3.1.1 released August 31, 2001
+
+- halfeyes valued slightly more guessing eye value for shapes not in eyes.db
+- all owl data stored in do_owl_attack() and do_owl_defend()
+- revised definition of inessential strings in owl_find_lunches()
+- confirm_safety() revised
+- owl tuning
+- global_matchpat() to perform pattern matching on the whole board.
+- removed scan loops from different files.
+- matchpat() made static
+- size test made one time for all the board.
+- reverse spiral implemented to compute the move's row in the spiral path.
+- bugfixes and improved trace output in atari_atari functions
+- bugfix in dragon.c: broken format crashed printworms option
+- bugfix in play_gtp.c: format needed extra newline
+- configure --enable-profile implemented
+- new game records and regressions
+- new gtp_example vanilla.c
+- missing subheadings added in doc/*texi
+- BREAKAGE reset
+
+3.0.0 released August 24, 2001
+
+- komi can be set from CGoban using the command line
+- play_gmp takes a Gameinfo * parameter
+- corrected bounds in small_semeai
+- simplified bounds check in double_atari
+- explicit cast to avert warning in play_gtp.c
+- doc revision
+
+2.7.256 released August 23, 2001
+
+- unused dragon.old_safety retired
+- bugfix in owl_determine_life: signed char mx
+- no long filenames in games/arb
+- variations eliminated in dublin1.sgf
+- one dublin1 test in connection.tst
+- doc revision
+
+2.7.255 released August 22, 2001
+
+- two declarations moved in liberty.h
+- dilate_erode, sgftree_printboard and resize_dfa are static
+- doc revision
+
+2.7.254 released August 21, 2001
+
+- MAXSTACK expanded
+- struct move_data renamed owl_move_data in owl.c
+- superstring_breakchain made static
+- bugfix in showboard: capture colors switched
+- stray | removed from manyfaces.tst
+- revised newlogo
+- Trevor Morris and Stephan Somogyi THANKed
+- initials cleaned and comments edited in patterns.db
+- doc revision
+
+2.7.253 released August 20, 2001
+
+- gtp_loadsgf modified to work on Mac OS X
+- DEFAULT_LEVEL 10 in config.vc and config.vcin
+- newlogo.jpg restored in doc/
+- gtp2_6 added to interface/gtp_examples/
+- doc revision
+
+2.7.252 released August 19, 2001
+
+- moved interface/gtp/ to interface/gtp_examples/
+- pragma disable 4244 4305 added to config.vc and config.vcin again
+- placehand does not place a stone if handicap == 1
+- gameinfo_play_sgftree default handicap is 0.5 if handicap != 0
+- regress.awk strips carriage returns for DOS compatibility
+- doc revision
+
+2.7.251 released August 18, 2001
+
+- moved the komi field from Gameinfo to Position
+- change usages of komi in various places
+- estimate_score no longer declared in gnugo.h
+- use gnugo_estimate_score in play_gmp, play_solo, play_ascii, debugboard
+- bugfix in gameinfo_load_sgfheader: initialize handicap
+- abortgo.sgf reference taken out of abortgo
+- gameinfo_play_sgftree does not place a stone if handicap 1
+- twogtp default handicap 0, not 1
+- twogtp declares file FF[4] not FF[3]
+- doc revision
+- win/ directory removed
+- WINDOWS revised again
+
+2.7.250 released August 17, 2001
+
+- bugfix in main.c: stray hyphen broke compile
+- bugfix in interface.c: reject weird handicaps
+- bugfix in double_atari: reject off board locations
+- bugfix in aftermath: reject off board locations
+- new WINDOWS
+- new logo
+- do_play_move made static
+- doc revision
+- pragma disable 4244 4305 added to config.vc and config.vcin
+- new command load in ascii mode.
+- reference of --autolevel in help massege.
+- fixed a bug in sgf file saving (to avoid strange handicap)
+
+2.7.249 released August 16, 2001
+
+- print_moyo color parameter eliminated
+- All FIXME's classified post 3.0
+- bugfix in owl_big_eyespace: check ON_BOARD(oi,oj)
+- bugfix in fill_liberty: check ON_BOARD
+- bugfix: initialize path in dfa matcher
+- moved dfa scan function and others from dfa.c to matchpat.c
+- moved dfa_fixup_for_size into dfa_compile_for_match.
+- cleanup of dfa code
+- removed heavy functions dfa_scan() and dfa_restart()
+- new function scan_for_pattern()
+- New warning in mkpat for DFA_MAX_MATCHED update.
+- a warning fixed in dfa.c
+- Any pattern db can use wired dfa's.
+- removed load_dfa() and save_dfa() functions.
+- removed -d option from mkpat.
+- removed unused values from dfa_t struct
+- sync_product uses a hash table instead of an huge array
+- new stucture test_array_t and new static functions in dfa.c
+- DFA_MAX_BOARD set to 21
+- revision of all .dsp files
+- analyze.h removed from engine/Makefile.am
+- unused function dump_data removed from score.c
+- bugfix in aftermath_genmove()
+- code cleanup
+- unchosen fuseki moves from fuseki database awarded a smaller value
+- filllib and aftermath moves also recorded with move_considered()
+- potential_moves array converted from int to float
+- PROFILE_PATTERNS disabled by default
+- computation of inessential strings in owl_find_lunches revised
+- is_worm_origin() moved from utils.c to worm.c
+- test mode option replaced by a replay option
+- code in play_test.c heavily rewritten
+- owl tuning
+- new gtp function top_moves
+- new game record and regression tests
+- doc revision
+- new tests tanguy.tst, dublin1.sgf and dublin2.sgf
+
+2.7.248 released August 7, 2001
+
+- undo implemented in play_gtp
+- estimate_score renamed old_estimate_score
+- new_estimate_score renamed estimate_score
+- gtp commands new_score and prisoners renamed estimate_score and captures
+- default level set to 10
+- config.guess and config.sub removed from the distribution
+- moyo.c and analyze.c removed from the distribution
+- obsolete --moyo options retired
+- count_territory, evaluate_territory and remove_string removed
+- new function gnugo_estimate_score
+- doc revision
+- cleanup
+- minor tuning
+- Jens Yllman added to authors
+- patterns.dsp replaced
+- VC++ warnings addressed
+
+2.7.247 released August 2, 2001
+
+- aftermath_genmove() revised
+- bugfix in do_genmove(), no reinforcing moves while scoring
+- bugfix in estimate_territorial_value(), no reinforcing moves while scoring
+- bugfix in score.c, 19 replaced by board_size
+- bugfix in confirm_safety(), verbose not restored in two cases
+- values used by worm[][].conditional_status made more consistent
+- connection_value returns a higher value if we are ahead
+- status INESSENTIAL distrusted by connection_value if we are ahead
+- xcut autohelper macro rejects B pattern ! as well as *
+- connection tuning
+- score, upper_bound and lower_bound are made global variables
+- estimate_strategical_value takes score parameter
+- revision of score report in play_solo
+- new --showscore option
+- tuning
+- owl tuning
+- spelling mistake in regression/Makefile.am fixed
+- new regression test and game record
+- code cleanup in analyze.c
+- assert() changed to gg_assert() in extract_fuseki.c
+- mkpat and joseki add copyright notice to built files
+- verbose prints the score
+- bugfix in report_dragon: if dragon.id = -1 ignore dragon2
+- VC++ compatibility changes
+- DFAFLAGS is -D instead of -d
+- autolevel target is level 10, not 11
+- play_gmp uses new_score at game end
+- doc revision
+- revision of twogtp
+- new game records and connection tests
+
+2.7.246 released July 15, 2001
+
+- if ahead, owl_prevent_threat move reasons given real value
+- tuning
+- owl tuning
+- Chinese counting implemented
+- ascii mode revised
+- files gtp.c and gtp.h under X11 licensing
+- autolevel option activated
+- bugfix in matchpat.c
+- new #define GNUGO_PATH in config.h.in
+- fixed some problems with inclusion of dfa in pattern c files.
+- mkpat is now called with option -D instead of -d => no more binary dfa files.
+- in matchpat.c dfa_match_init do not try to load dfa's files anymore.
+- load_dfa() adapted to enable wired dfas
+- wired dfas
+- new macro gg_assert
+- change_dragon_status() replaced by change_matcher_status()
+- minor cleanup
+- atari_atari_try_combination turns down verbose
+- hyphenation of some command line options
+- project files *.dsp and *.dsw revised
+- color support revised
+- doc revision
+
+2.7.245 released July 5, 2001
+
+- aftermath code revised
+- new options --allow-suicide, --play-out-aftermath, --capture-all-dead
+- unused constant MAX_TRY removed from genmove.c
+- option --noinhibit removed
+- new function and autohelper max_eye_value()
+- new global doing_scoring affecting valuations while scoring
+- bugfix in valuation of attack_either and defend_both moves
+- neither black nor white used in colored displays
+- new gtp commands final_status, final_status_list, and protocol_version
+- gtp_playblack and gtp_playwhite revised
+- warning eliminated in debugboard/gui.c
+- fuseki9.db regenerated from a bigger set of games
+- new regression tests and game records
+- regressions/niki.tst included (omitted by mistake from 2.7.244)
+- new autohelper macro effective_size
+- copyright notice added to twogtp
+- depth values increased in owl_substantial
+- followup contribution cap lowered to tot_value
+- tuning
+- owl tuning
+- hyphens replace underscores in command line options
+- doc revision
+
+2.7.244 released July 1, 2001
+
+- followup values are calculated more carefully
+- attacks on uncertainly DEAD dragons are now called uncertain defense
+- confirm_safety less verbose
+- demotion of many fuseki patterns
+- tuning
+- owl tuning
+- reduction of j and t classes
+- new function atari_atari_try_combination and autohelper macros
+- TRACE_ATARI_ATARI replaced with DEBUG_ATARI_ATARI
+- Use double instead of timeval structs for clock time values
+- Removed a lot of heavy timeval functions from clock.c
+- new function clock_time_graph() for time/move/level stats
+- added more traces to clock functions
+- pushbutton does not complain when no initialisation is done
+- removed a lot of non used memory check in mkpat:
+- mkpat never rejects a pattern but complains if it makes the dfa big
+- the -d and -D option of mkpat do not require arguments
+- -m option is now alway used in Makefiles to save memory on owl pats
+- -r option eradicated from mkpat.
+- ignore trailing white space in input to mkeyes.c
+- remove @SET_MAKE@ from Makefile.am.
+- remove config.guess en config.sub from distribution
+- revision of coloring part of configure.in
+- play_ascii correctly marks the last stone played while GNU Go thinks
+- doc revision
+- new test nikki.tst
+
+2.7.243 released June 22, 2001
+
+- dragon.owl_status_certain split to owl_attack_certain, owl_defend_certain
+- new_estimate_score is run every move if level >= 8
+- if safely ahead, uncertain defensive moves are added
+- revision of certain connection values
+- WEAK safety value reduced
+- doc/gtp.texi revised
+- aftermath code revised
+- warnings eliminated in clock.c
+- on board assertions in same_dragon()
+- liberty filling code revised
+- value of empty corners reduced in fuseki.c
+- tweek in influence_callback()
+- more careful valuation of ko threats in value_move_reasons()
+- confirm_safety() call in review_move_reasons() avoids bad ko threats
+- more careful detection of disturbing moves in the persistent owl cache
+- new function owl_confirm_safety()
+- new function atari_atari_confirm_safety()
+- confirm_safety() and double_atari() revised
+- gtp_final_score() revised
+- new gtp commands fixed_handicap, level, name, and version
+- code cleanup
+- tuning
+- owl tuning
+- eye tuning
+- new helper backfill_helper() and autohelper function with same name
+- new function interface/twogtp
+
+2.7.242 released June 19, 2001
+
+- bonus for uncertain defense/attacks reduced
+- bugfix: defense threat move reasons not generated for illegal moves
+- tuning
+- owl tuning
+- more careful to get dragon.owl_status_certain right
+- dragon.owl_status_certain can affect dragon.safety
+- corrections to -m option
+- bugfix: OWL_DEFENSE_THREAT was reported incorrectly
+- adjective ``reliable'' disassociated from semeai()
+- bugfix in decidedragon: report uncertainty correctly
+- revision of gtp_report_uncertainty
+- ignore trailing whitespace in patterns
+- add prototype in dfa.h for print_c_dfa
+- some sgf files standardized
+
+2.7.241 released June 12, 2001
+
+- owl_attack and owl_defend return a certainty value
+- new field dragon.owl_status certain
+- new UNCERTAIN_OWL_ATTACK and UNCERTAIN_OWL_DEFEND move reasons
+- revisions and corrections to some gtp functions
+- tuning
+- owl tuning
+- reduced value of j patterns by one point
+- merged new_matchpat.c into matchpat.c
+- when no dfa file is found, use standard do_matchpat()
+- fixed a reference to nonexistent merged_board[][].
+- updated dfa matcher to merged_val optimization.
+- removed check_pattern() function.
+- dfa board preparation moved to dfa_match_init()
+- new constant DFA_MAX_MATCHED
+- assertion to check possible DFA_MAX_MATCHED overflows.
+- added --clock,--byo_time and --byo_period in --help listing.
+- new function print_c_dfa() in dfa.c
+- new option -D in mkpat.c puts the dfa into the binary
+- doc revision
+- new tests and regressions
+- corrections to old tests and regressions
+
+2.7.240 released June 12, 2001
+
+- new autohelper function macro owl_threatens
+- CAN_THREATEN_ATTACK and CAN_THREATEN_DEFENSE renumbered
+- status_to_string revised
+- gtp declarations sorted alphabetically
+- new gtp command "help" lists gtp commands
+- gtp command dragon_data revised
+- show_dragon revised
+- new function safety_to_string
+- tuning
+- owl tuning
+- game regression/games/pending ssstator.sgf added
+- last two moves cached in global last_moves_i, last_moves_j array
+- bugfix: sometimes owl_threat_status was wrongly UNCHECKED
+- when reading a file even passes are given to gnugo_play_move
+- OWL_PREVENT_THREAT reason valued more if opponent adds to a dead dragon
+- new vital owl attack pattern VA17
+- change ko_i and ko_j to board_ko_i and board_ko_j in new_matchpat.c
+- bugfixes in captured_territory() from score.c
+- new game records and regression tests
+- aftermath code revised
+- pure_threat_value increased from 0.0 to 0.4 in genmove()
+- new flag worthwhile_threat in the move[][] array used in move_reasons.c
+- new function add_worthwhile_threat_move() in move_reasons.c
+- new pattern classification W for worthwhile threats
+- bugfix in owl_does_defend()
+- active area computation in store_persistent_owl_cache() revised
+- bugfix in atari_atari code
+- print_regions() in score.c reimplemented
+- new game records and regression tests
+- doc revision
+
+2.7.239 released June 8, 2001
+
+- use gg_gettimeofday routines in stead of gettimeofday
+- make autoconf 2.50 script detect mingw32
+- include config.h in gnugo.h
+- new file score.c
+- new function new_estimate_score()
+- new gtp function gtp_new_score
+- fixed --score last and --score [movenum]
+- aftermath code revisions
+- new function same_string() in board.c
+- global variable threats_enabled renamed disable_threat_computation
+- new global variable disable_endgame_patterns
+- new function owl_hotspots() and reading_hotspots()
+- revision of induce_secondary_move_reasons()
+- connect_strings bonus revised
+- new functions edge_clamp() and edge_block() in reading.c
+- performance improvement in atari_atari() and do_atari_atari()
+- improved traces from the atari_atari functions
+- minor tweaking of move ordering parameters
+- performance improvement in superstring_add_string() in utils.c
+- tuning
+- owl tuning
+- new regression suites blunder.tst and newscore.tst
+- new and revised regression tests
+- new and revised game records
+- missing parameters supplied to is_illegal_ko_capture in value_moves
+- bugfix in fuseki
+- incorrectly dimensioned arrays fixed in gtp_all_legal
+- is_pass() moved to board.c
+- A number of FIXMEs addressed
+- minor cleanup
+
+2.7.238 released May 28, 2001
+
+- aftermath_genmove() revised
+- new global threats_enabled to disable computing worm and dragon threats
+- definition of WIN, KO_A, KO_B, LOSE, and CUT only in gnugo.h
+- minor optimizations in filllib.c and owl.c
+- better debug support for persistent owl cache
+- move order tuning in reading.c
+- neighbors of invincible worms excluded from active area in persistent cache
+- owl tuning
+- new game records and regression tests
+- new option --autolevel (not activated by default).
+- revision of clock.c and clock.h
+- broken return codes corrected
+- new gtp command worm_cutstone
+- doc revision
+
+2.7.237 released May 27, 2001
+
+- revised reading and owl return codes
+- incremental_board.c removed from engine/Makefile.am
+- parameters to chainlinks() and chainlinks2() revised
+- incremental_order_moves() counts stones in atari more accurately
+- superstring functions reimplemented
+- new function find_superstring_stones_and_liberties
+- optimization in owl_does_defend()
+- detection of insubstantial strings in owl_determine_life made more efficient
+- persistent reading cache size doubled from 50 to 100 entries
+- revisions in defend2() and defend3()
+- order_moves() revised
+- bugfix in break_through_helper
+- order_moves doesn't sort singleton lists
+- pure threat value in do_genmove set to zero
+- more stats with -b option
+- globals your_last_move_*, my_last_move_*, no_old_data_exists removed
+- superceded dragon data caching scheme taken down
+- new tests and regressions
+- new gtp command worm_cutstone
+- new testsuite cutstone.tst
+- new game record wormflaw.sgf
+- minor tuning
+- doc revisions
+- some FIXMEs addressed
+- debugboard now shows all worm and most dragon data
+- upgrade configure.in to work with autoconf version >= 2.50
+- new files config.guess and config.sub
+
+2.7.236 released May 17, 2001
+
+- shadowing and persistent caching of reading functions implemented
+- new function get_move_from_stack()
+- new functions draw_reading_shadow() and purge_persistent_reading_cache()
+- new function attack_and_defend()
+- new tests and regressions
+- fill_liberty() looks for ko back captures
+- minor tuning
+- bugfix in double_atari
+- bugfix in komaster_trymove: i - j confusion
+- new functions: gnugo_play_sgfnode and gnugo_play_sgftree
+- new functions: gameinfo_load_sgfheader and gameinfo_play_sgftree
+- renamed load_sgf_header, play_sgf_tree, sgfPlayNode and sgfPlayTree
+- sgfutils.c removed
+- removed incremental_board.c and sgfutils.c from engine/Makefile.am
+- renamed neighbor_of to neighbor_of_string
+- renamed liberty_of to liberty_of_string
+- minor cleanup of gnugo.h
+- doc revision
+- print more debugging info in worm.c
+- rewrite loop in worm.c with deltai and deltaj arrays
+- revision of play_test
+
+2.7.235 released May 5, 2001
+
+- aftermath code revised
+- owl reuse is off by default
+- function komaster_trymove() replaces move_allowed()
+- optimization in is_self_atari()
+- new function owl_big_eyespace() and corresponding autohelper function
+- new field unconditional_status in struct worm_data
+- new static function edge_closing backfill in reading.c
+- move ordering scores available outside order_moves()
+- attack4() rewritten
+- propose_edge_moves() revised
+- relative_break_chain() obsoleted and removed
+- move ordering scores written in sgf output file with variations
+- sgf output file records komaster
+- changed parameters to unconditional_life()
+- unconditional_life() now finds unconditional dead stones and territory
+- reinforce_helper() revised
+- tuning, owl tuning
+- tune_move_ordering() can write c code for inclusion
+- new and revised regression tests and game records
+- new global variable shadow[][]
+
+2.7.234 released May 4, 2001
+
+- komaster implementation corrected in owl.c
+- sgf traces now show komaster in -o output
+- bugfix: --no_owl_reuse was broke
+- bugfix in sgfutils.c which could crash on some files with IL property
+- IL property moved to the end of files reading16.sgf and reading20.sgf
+- variable length value for SGFproperty
+- numeric keypad can be used for cursor movement in debugboard
+- debugboard needs slightly smaller screen
+- debugboard shows data for both black and white eyes
+- new movement buttons for debugboard: ctrl-a and ctrl-e
+
+2.7.233 released April 29, 2001
+
+- revision of the komaster scheme
+- persistent owl caching
+- owl_attack is more cautious if an attack can produce a ko
+- parameters in acconfig.h sorted in order recommended by comments in file
+- config.vcin is once again brought in sync with the current config.h
+- bugfix in eyes.db
+- SGF IL property can set (board_ko_i, board_ko_j)
+- owl test 27 corrected
+- new tests manyfaces.tst
+- new directory regression/games/seki_exotics
+- doc revision
+
+2.7.232 released April 25, 2001
+
+- break_chain2_efficient_moves() revised
+- bugfixes in order_moves()
+- new tuning parameter safe_atari_score in order_moves()
+- bugfix in configure.in
+- spelling correction in gnugo.texi
+- same_dragon(), report_dragon() and ascii_report_dragon() moved to dragon.c
+- speed improvements in filllib.c
+- corrected size of defend_not_adjacent_lib_score[] array in reading.c
+- bugfix and minor reorganization in review_move_reasons()
+- remove incremental_board.[ch] from engine/Makefile.am
+- hashtable_unlink_closed_results() can now remove read results selectively
+- remove incremental_board.[ch] from engine/Makefile.am
+- hashtable_unlink_closed_results() can now remove read results selectively
+- attack tuning
+- new GTP command: echo
+- attack tuning
+- tuning
+- endgame performance tuning
+- minor cleanup
+- commented some tests in NICKLAS test suite
+- bugfix in nicklas2.tst
+- SGF PL property handling in play_ascii.c corrected
+- revised order of inclusion of header files in interface/main.c
+- Chinese and Japanese rules were switched
+- new files "clock.h" and "clock.c"
+- new global struct "clk" handeling the timers.
+- new global variable "clock_enabled" (set to 1 by --clock XXX).
+- new functions clock_isOver(), clock_isByoYomi(), clock_getTimeLeft()
+- new options --clock, --byo_time and --byo_period
+- compute the clock delta error
+- cleanup clock initialisation in main.c
+- new games and regressions in arb.tst
+- new games mfgg*.sgf and nightmare.sgf in regression/games/pending
+- macros abs, max and min renamed gg_abs, gg_max and gg_min
+
+2.7.231 released April 20, 2001
+
+- we do not reuse data unless 2 last moves are on the board
+- last moves are set by play_solo
+- extra level inserted between levels 6 and 7
+- nominal depth variables by mandated depth variables
+- revised handling of depth variables set at command line
+- new function set_depth_values()
+- get_location renamed string_to_location and moved
+- review_move_reasons tries harder not to return illegal moves
+- same_dragon() moved to board.c
+- redundant lunch timing removed from dragon.c
+- average move time computed by --showtime
+- atari_atari uses restricted_defend1 to find second move
+- tuning
+- aftermath code revised
+- new function aftermath_compute_score()
+- new debug flag DEBUG_AFTERMATH
+- new functions store_position(), restore_position() in engine/interface.c
+- who_wins() moved from moyo.c to utils.c and revised
+- superstring_breakchain() now considers ko
+- score computations consistently use positive values for white wins
+- gtp_loadsgf sets no_old_data_exists=1
+- new gtp command final_score()
+- scoring option --score aftermath now works properly
+- new regression file score.tst
+- add configure test for variadic #define
+- fix bug in configure test for __FUNCTION__
+- remove __ prefix from function prototypes in gg-getopt.h
+- new option --chinese_rules
+- new configure option --enable-chinese-rules
+- new functions ascii_report_dragon and report_dragon for use in gdb
+- new game records and test cases
+- minor doc revision
+
+2.7.230 released April 13, 2001
+
+- default default level is 8
+- default level can be set at configure or run time
+- default cache can be set to arbitrary value at configure time
+- revised ko handling
+- kothreat_needed no longer needed
+- aftermath uses genmove_conservative
+- tuning
+- owl tuning
+- influence tuning
+- systematic use of faster ON_BOARD macro
+- new function is_illegal_ko_capture()
+- does_capture_something() made public
+- new function genmove_conservative
+- improved --showtime information
+- minor revision of confirm_safety
+- print_top_moves() split out from review_move_reasons()
+- configure tests for keypad
+- malloc.h inclusions taken down
+- help string revised
+- new tests and regressions
+
+2.7.229 released April 9, 2001
+
+- caching of owl data implemented and reuse on later moves
+- showtime option shows information about owl reading time
+- new global variables my_last_move_i, my_last_move_j, no_old_data_exists
+- last_move_i, last_move_j renamed your_last_move_i, your_last_move_j
+- incremental_order_moves() revised
+- order_moves() revised
+- attack2() revised
+- bugfix in linear_eyes()
+- do_owl_attack() and do_owl_defend() revised and simplified
+- more robust topological eye analysis in owl_determine_life()
+- vital moves for multiple eyespaces recognized in owl_determine_life()
+- sniff_lunch() revised
+- owl_eyespace() ignores eyespaces which do not yield a single eye
+- joseki.c revised
+- tuning, owl tuning, eye tuning
+- new takamoku joseki
+- new game record and test cases
+- test results updated
+
+2.7.228 released March 30, 2001
+
+- parameters kom_i and kom_j complement komaster field in many functions
+- routine_i_j_stackp renamed compressed_data
+- komaster added to cached compressed_data field
+- parameters ko_i and ko_j renamed board_ko_i and board_ko_j
+- GRAY is a synonym for GRAY_BORDER
+- incremental_board.* removed
+- incremental board functionality merged into board.c
+- revised komaster scheme in reading.c and owl.c
+- trick to avoid sorting corners in matchpat.c
+- mkpat -m now works in both dfa and non-dfa mode
+- compile_for_match() no longer calculates merged values
+- revised debug messages in influence.c and sgfnode.c
+- tuning
+- owl tuning
+- influence tuning
+- new game records and regression tests
+- test results updated
+
+2.7.227 released March 23, 2001
+
+- new file engine/aftermath.c
+- temporary option "--score aftermath"
+- "connect strings" bonus in move_reasons.c revised
+- bugfix in value_move_reasons
+- all vital owl attack pattern matches counted
+- bugfix in owl_determine_life(), a no longer valid shortcut disabled
+- dead code removed from owl_reasons()
+- break_chain2() revised
+- various FIXMEs addressed
+- try kos in play_break_through_n(), play_attack_defend_n(),
+ and play_attack_defend2_n()
+- bugfix in atari_atari
+- worm threats on second order liberties.
+- new transform.c
+- endgame tuning
+- tuning
+- eye tuning
+- owl tuning
+- new regression test cases and game records
+- more copyright messages updated
+- minor doc revision
+
+2.7.226 released March 21, 2001
+
+- bugfix in atari_atari
+- minor speedups in matchpat.c
+- looks for tactical ko theats
+- long USAGE string split in interface/main.c
+- removed main.c.zheng and interface.dsp from distribution
+- tuning
+- owl tuning
+- updated copyright messages
+
+2.7.225 released March 15, 2001
+
+- new move reasons: ATTACK_THREAT_MOVE and DEFEND_THREAT_MOVE
+- new functions compute_effective_worm_sizes() and
+ find_worm_attacks_and_defenses() split off from make_worms()
+- new function find_worm_threats(), called from make_worms()
+- redundant NULLs removed from attack.db, barriers.db, conn.db,
+ defense.db, endgame.db, fuseki19.db, fuseki9.db, and patterns2.db
+- extract_fuseki.c revised not to generate unnecessary NULL string
+- owl tuning
+- new and revised regression tests and game records
+
+2.7.224 released March 8, 2001
+
+- komaster status stored in reading cache
+- several functions in cache.c made static
+- new function incremental_order_moves() to support order_moves()
+- cleanup in topological_eye() and evaluate_diagonal_intersection()
+- improved traces in owl.c
+- semeai detecting code in owl_reasons() taken down
+- tuning
+- eye tuning
+- owl tuning
+- endgame tuning
+- new game record
+- new and revised regression test cases
+- endgame fix in move_reason.c
+- cleanup in helpers.c
+- tests for both sides in endgame.tst
+- estimate_score only if DEBUG_SCORING
+- revision of rotated tests and arb.tst
+- vc project files revised
+- Yin Zheng and Don Wagner added to acknowledgements
+
+2.7.223 released February 28, 2001
+
+- bugfix in play_move()
+- make_domains() distinguishes strictly between owl calls and others
+- bugfix in examine_position()
+- inessential worms excluded in one time in estimate_strategical value
+- false_margin() revised
+- inessential strings added in the owl code
+- MAXPATNO incresead in mkeyes.c
+- tuning
+- eye tuning
+- owl tuning
+- name collisions resolved in pattern databases
+- regression/READING revised
+- new and revised regression test cases
+- bugfix in regressions/Makefile*
+- revised nicklas* regressions
+
+2.7.222 released February 26, 2001
+
+- dead code removed from dfa.c, dfa.h, mkpat.c
+- o_somewhere and x_somewhere only check matcher_status if stackp==0
+- bugfix in atari_atari
+- bugfix in analyze_semeai
+- dragon.owl_status, status and matcher status initialized
+- tactically critical nakade stones reclassified as inessential
+- influence code revised
+- no strategical attack value for strongly alive dragons
+- hardwired values for J, j, and t patterns scaled with the board size
+- maximum values for j and t patterns disabled for boards < 17x17
+- tuning
+- influence tuning
+- owl tuning
+- endgame tuning
+- bugfix in mkpat.c, patterns of class c were unintentionally disabled
+- new game records
+- new and revised regression test cases
+- nonstandard SGF records and missing handicap stones fixed
+- Mathias Wagner thanked
+
+2.7.221 released February 19, 2001
+
+- restricted_attack2 and restricted_defend1 remember to set komaster
+- matcher_status only initialized to CRITICAL if owl code says so
+- bugfix in matchpat(), static variable properly reset
+- new debug messages in semeai.c
+- tuning
+- rotated tests updated
+- test results updated
+- new test reading 141
+
+2.7.220 released February 17, 2001
+
+- TODO revised
+- experimental influence based score estimation
+- scoring option in ascii interface uses the influence score estimate
+- test for tactically critical O worms restored from 2.7.218
+- atari_atari tries harder to find refutations
+- influence B patterns do not accept dead stones
+- revised connection values
+- bonus for moves which both owl defend/attack and connect/cut something
+- new autohelper for owl patterns; owl_eyespace()
+- defend_both() tries harder to find attackable splitting strings
+- class_mask[CRITICAL][color]=CLASS_O in new_matchpat
+- open dfa files in binary mode on MS-DOS and Windows
+- fix dfa error messages.
+- sgf code now understands PL[1] and PL[2]
+- new pattern class c, weak connections
+- tuning
+- owl tuning
+- influence tuning
+- eye tuning
+- new game records
+- new and revised regression tests
+- test results updated
+
+2.7.219 released February 13, 2001
+
+- redundant test for tactically critical O worms taken down in shapes_callback
+- fix bug in glib configuring
+- link dfa.c instead of include it.
+- extra parens in influence
+- add extra brackets to code1 macro in accumulate_influence
+- tuning
+- bugfix in mkpat.c: autohelper function halfeye() now works
+- gnits automake option removed
+- new test ego.sgf
+
+2.7.218 released February 7, 2001
+
+- O patterns reject CRITICAL friendly dragons
+- in make_worms() if worm.defend==PASS move not tried
+- in attack_callback() ignore strings with 5 liberties
+- default memory increased to 32Mb
+- configure supports 48MB and 64MB models
+- minor tuning
+- doc revision
+- vsnprintf error gives warning, not fatal error
+- duplicate owl test 186 renumbered
+
+2.7.217 released February 1, 2001
+
+- worm.c: only add defense move if worm.defend != PASS
+- find_defense returns PASS if string is alive as stands
+- defend1 pattern gets constraint
+- caching scheme revised so that the cache can be cleared on the fly
+- new debug flag DEBUG_READING_PERFORMANCE
+- only make requested dfa files (currently owl*dfa)
+- tuning
+- owl tuning
+- new game record dniwog.sgf
+
+2.7.216 released January 29, 2001
+
+- missing files generate_owl_dfa.sh and matchtest.sh in minipat2 restored
+- local_owl_node_counter initialized in owl_substantial
+
+2.7.215 released January 28, 2001
+
+- bugfix in analyze_semeai()
+- bugfix in find_attack_patterns()
+- new gtp command combination_attack
+- defend_against_atari_helper() revised
+- new regression test suite atari_atari.tst
+- STRATEGY revised
+- new regression tests and game records
+- reenable board printing on core dumps
+- bugfix in attack_callback: attack patterns are matched again
+- integrate rolled and unrolled versions of accumulate_influence
+- move invariant code out of loop in accumulate_influence
+- put patterns/minipat2 under automake control
+- include unistd.h in patterns/dfa.c for sleep function prototype
+- add pkgdata_DATA macro to patterns/Makefile.am
+- add macro DFAFLAGS
+- bugfix in dfa generation: borders constraints now always checked.
+- modification in patterns.h to avoid a warning: struct dfa *pdfa
+- add experimental check_pattern_light() function only checking
+- DEBUG_OWL_PERFORMANCE reports CPU times
+- vgprintf uses %.2f for %f
+- tuning
+- influence tuning
+- owl tuning
+- attack tuning
+- minor cleaning
+
+2.7.214 released January 21, 2001
+
+- combo attack and defend_both/attack_either can't both add to move value
+- bugfix in atari_atari()
+- eye tuning
+- owl tuning
+- READING revised
+- new and revised regression tests
+- test results updated (except nicklas*.tst)
+- doc revision
+
+2.7.213 released January 20, 2001
+
+- bigger moyo measure allowed for big dragons before owl code is disabled
+- compute_eyes_pessimistic() no longer consults the life code
+- cleanup of mkeyes.c
+- now possible to specify edge and corner vertices in eyes.db
+- mkeyes.c and recognize_eye()
+- owl_substantial() revised
+- bugfix in special_rescue3()
+- loop unrolled in order_moves
+- revision of is_hoshi_point
+- bugfix in analyze_semeai(): don't try PASS moves
+- shape value in j or t pattern now modifies hard-wired value
+- atari_atari makes atari even if a chain is already in atari
+- environment variable $GNUGO_PATH used to load dfa files
+- fixup a Sun portability bug with enable-dfa
+- fixup for owl_vital_apats.db with enable-dfa
+- tuning
+- connection tuning
+- eye tuning
+- owl tuning
+- READING revised
+- new regression tests and game records
+
+2.7.212 released January 18, 2001
+
+- assertion added in is_ko()
+- revision of compute_eyes_pessimistic()
+- vital_apats consulted also by do_owl_defend
+- vital_apats only consulted if level >= 9
+- followup values reduced in two helpers
+- eye tuning
+- owl tuning
+- two new helpers finish_ko_helper() and squeeze_ko_helper()
+- portability patch for dfa in patterns.h
+- portability patch for cygwin in mkpat.c
+- test revisions
+
+2.7.211 released January 16, 2001
+
+- new file owl_vital_apats.db
+- vital_apats are consulted by do_owl_attack regardless of genus
+- new static variable match_found in owl.c
+- estimate_territorial_value() limits overvaluation of half point kos
+- changed order of min and max constraints in value_move_reasons()
+- analyze_semeai() revised
+- generic_walk made static in utils.c
+- tuning
+- owl tuning
+- eye tuning
+- READING and STRATEGY revised
+- new and revised regression test cases
+- new game records
+- rotated tests corrected
+
+2.7.210 released January 14, 2001
+
+- bugfix in reading.c: superstring liberty arrays needed more space
+- bugfix in owl_reasons which could cause a crash
+- bugfix in owl_threaten_attack(): return value was always 0
+- owl threatened groups are WEAKLY_ALIVE
+- value of connecting WEAK and WEAKLY_ALIVE groups increased
+- owl_threats not evaluated if level <= 7
+- tactical reading move order tuned
+- tuning
+- owl tuning
+- tuning of hoshi.sgf and sansan.sgf
+- new regression suites endgame.tst, viking.tst and strategy28.sgf
+- new tests in owl.tst and strategy2.tst
+- new regression game records
+- revision of rotated test suites
+
+2.7.209 released January 10, 2001
+
+- new parameter superstring_depth (default 7)
+- minor tuning of hoshi.sgf
+- tuning
+- owl tuning
+- connection tuning
+- renumbering of owl patterns
+- AB property added to handicap games in regression/games
+- one new owl test
+- doc revision
+
+2.7.208 released January 7, 2001
+
+- new reading function special_rescue3
+- break_chain2 and break_chain3 calls removed from defend2 and defend3
+- call edge reading function from attack2 and attack3
+- superstring_breakchain depth in defend2 changed to backfill2_depth
+- defend2 and defend3 try playing a liberty of the superstring
+- special_rescue3 called from defend3
+- break_chain2_moves tests for self atari
+- move ordering adds bonus for saved moves
+- doc revision
+- basic worm building extracted from make_worms.
+- new function: build_worms
+- estimate_territorial_value requires owl reasons with VITAL_EYE_MOVE
+- better reading at the edge
+- some fixes in debugboard
+- use same reading depths in debugboard as in gnugo
+- minor tuning
+
+2.7.207 released January 4, 2001
+
+- new function break_chain2_efficient_moves
+- revision of special_rescue()
+- revision of attack2(), attack3(), superstring_breakchain()
+- look harder for neighbors of attack moves in examine_move_safety()
+- compute_eyes_pessimistic tracks margins adjacent to margins
+- owl_find_lunches considers ko captures
+- owl_escape_value checks empty before returning -10
+- decision to handle tactically moved to semeai_analyzer
+- semeai analyzer adds move reasons instead of moving defense
+- tuning
+- owl tuning
+- influence tuning
+- revision of rotated tests
+
+2.7.206 released January 3, 2001
+
+- revision of print_influence and print_numeric_influence
+- value_move_reasons considers moves with min_territory>0
+- reversed level inequality fixed in review_move_reasons
+- is_legal replaced by safe_move call in semeai_analyzer
+- revision of proper_superstring_chainlinks() and superstring_recurse()
+- new patterns in barriers.db
+- general cleanup
+- tuning of seki patterns
+- comments about regression tests
+- doc revision
+- manpage revision
+- new file gnugo.pod
+
+2.7.205 released January 1, 2001
+
+- semeai analyzer looks for owl solution first
+- semeai analyzer not invoked for inessential dragons
+- owl patterns classified
+- bugfix in superstring_breakchain
+- minor tuning
+- new regessions arion.tst
+- revision of rotated tests
+- minor doc revision
+
+2.7.204 released December 26, 2000
+
+- superstring technology used in attack2, defend2
+- new static functions restricted_attack2, in_list in reading.c
+- libi, libj arrays sized 2 (formerly 3) in attack2
+- minimum standard joseki value raised to 27
+- hurry replaced by level
+- print_influence takes dragons_known parameter
+- obsolete code removed from optics.c
+- minor tuning
+- doc revision
+- doc/indigo2.sgf removed from distribution
+
+
+2.7.203 released December 21, 2000
+
+- owl status is checked also for dragons with high escape potential
+- new safety value WEAKLY_ALIVE for dragons which are owl alive by escape
+- fill_liberty() code revised
+- new function filllib_confirm_safety()
+- new debug flag DEBUG_FILLLIB and new debug traces in filllib.c
+- move valuation slightly revised
+- influence code revisions
+- maximum move values for standard joseki removed in shapes_callback()
+- tuning
+- owl tuning
+- influence tuning
+- new regression test suite filllib.tst
+- new tests and game records
+- doc revision
+- new superstring functions in utils.c
+- find_superstring_recurse() renamed superstring_recurse() and generalized
+- new superstring_breakchain() and restricted_defend1()
+- Separated the SGF library totally from the engine
+- integrated sgf_utils.h into sgftree.h
+- The Gameinfo struct expanded
+- movenum moved to the internals (from gnugo.h to liberty.h)
+- Some FIXMEs addressed
+- General minor cleanup
+
+2.7.202 released December 17, 2000
+
+- anisotropic attenuation removed from the influence function
+- attenuation and strength split into black and white in influence.c
+- new semantics for E class patterns in influence_callback()
+- new macro ASSERT_ON_BOARD defined in liberty.h
+- assertions added in optics.c, move_reasons.c, owl.c, and reading.c
+- minor revisions of valuation of defense and connect moves
+- bugfix in linear_eye_space()
+- bugfix in attack1()
+- warnings eliminated in main.c
+- workaround in influence.c for bug in main.c
+- bugfix in patterns/patterns.h
+- bugfix in mkpat for dfa
+- tuning
+- owl tuning
+- default owl_node_limit increased to 600
+- revisions of golife.tst, ld_owl.tst, and ld_owl_rot.tst
+- doc revisions
+
+2.7.201 released December 8, 2000
+
+- interface/interface.c removed from the distribution
+- legal(), suicide() and self_atari() renamed is_legal() etc.
+- New API function: gnugo_is_suicide.
+- interface/interface.c removed
+- playing options quiet is now a global variable
+- A number of FIXMEs addressed
+- bugfix in linear_eye_space
+- minor revision of komoku.sgf and hoshi.sgf
+- minor tuning
+- unnecessary NULLs removed in patterns.db
+- doc revision
+
+2.7.200 released November 30, 2000
+
+- serious bugfix in semeai()
+- bugfix in owl.c
+- bugfix in pattern ED58
+- bugfix in fill_liberty()
+- revision of rotated tests
+- new file regression/games/me.tst and 3 new strategy2 tests
+- test results updated
+
+2.7.199 released November 29, 2000
+
+- color support test restored to 2.7.193 condition in configure.in
+- missing doc/api.texi replaced
+- analyze_semeai is not called if an owl_substantial worm is en prise
+- minor tuning
+
+2.7.198 released November 28, 2000
+
+- bugfixes in owl.c
+- new patterns in eyes.db
+- tuning
+- owl tuning
+- minor revisions in analyze_semeai
+- revised and new regression tests
+- bugfix in dfa.c: gpout was not cleanly reset before synchronization
+- if DFA_SORT is set in new_matchpat then sort patterns before check_pattern
+- new stat functions update_pattern_stats(), display_pattern_stats(),
+ reset_pattern_stat()
+- dfa_add_pattern is now able to add all transformations into the dfa
+- new functions for dfa_add_pattern: permut() and show_pattern_instance()
+- fixed some bugs in matcher.c, and matchtest.sh
+- removed some unused files.
+- option -tm forces the anchor to be in the center and adds all transformations
+- added little_owl.tst
+- test results updated
+
+2.7.197 released November 27, 2000
+
+- old code removed from moyo.c
+- sgffile_decidestring() renamed decidestring() etc.
+- owl data structs in owl_attack, etc. made static
+- assertion changed in join_dragons
+- config.h included in interface.c and main.c
+- revisions to owl_analyze_semeai
+- show_dragons() lists worm lunches
+- assertion corrected in join_dragons()
+- new function find_more_owl_attack_and_defense_moves() in move_reasons.c
+- strategically_sound_defense() reimplemented
+- tuning
+- owl tuning
+- new file regression/READING reviewing failed reading tests
+- new tests in reading.tst and ld_owl.tst
+- new game records
+- test results updated
+
+2.7.196 released November 23, 2000
+
+- old definition of inessential worms restored
+- minor revision of owl_analyze_semeai
+- Small rearrangements in board.c
+- init_board() renamed to clear_board()
+- Some comments and rearrangements in gnugo.h
+- major cleanup in hash.h and hash.c
+- old definition of inessential worms restored
+- #include restored in play_ascii.c, play_gtp.c and hash.c
+- new function owl_update_goal()
+- revisions of owl_does_defend(), owl_does_attack(),
+ owl_connection_defends(), and owl_threaten_defense()
+- bugfix in owl_threaten_attack()
+- doc revision
+
+2.7.195 released November 19, 2000
+
+- owl_analyze_semeai() complete (though still very buggy)
+- struct local_owl_data now has a color field
+- owl_find_lunches no longer has color parameter
+- two missing sgf files restored
+- config.h included again in matchpat.c and analyze.c
+
+2.7.194 released November 18, 2000
+
+- continued localization of owl
+- new struct local_owl_data for passing goal, boundary and lunches
+- new functions owl_update_boundary_marks() and owl_make_domains()
+- new function owl_topological_eye()
+- name restored in autohelper macro owl_topological_eye
+- get_coordinate globalized and moved to printutils.c
+- new --decidesemeai option
+- new function owl_analyze_semeai()
+- Removed all unnecessary inclusion of config.h
+- cleanup of worm.c
+- Error handing in main.c: get_coordinate()
+- shuffling of main.c
+- inclusion of cache.h removed from board.c
+- definition of inessential worms changed
+- dragons classified CRITICAL when owl_attack() and owl_defend() disagree
+- join_dragons() revised to choose origin consistently within dragons
+- dragon_ring() and dragon_eye() cleaned up and revised
+- clear_move_reasons() moved from genmove() to reset_engine()
+- revised and extended debug output from influence.c
+- strategically_sound_defense() revised
+- valuation of inessential dragons corrected
+- the owl code doesn't consider escape on the first move
+- filter out vital defense moves which are self ataris in owl_determine_eye()
+- bugfix in owl_shapes
+- bugfixes in owl_substantial()
+- attack2() revised
+- new function special_attack4() in reading.c
+- move ordering retuned
+- safe_move() again changed to return 3 for illegal ko captures
+- bugfix in shapes_callback()
+- gtp_loadsgf() now also calls reset_engine()
+- cut_connect_callback revised to deal with join_dragons() changes
+- tuning of barriers.db, influence.db, conn.db, and eyes.db
+- tuning
+- owl tuning
+- revision of joseki values
+- new game records and test cases
+- regression/STRATEGY revised
+- mkpat and mkeyes tolerate "\r" for Windows compatibility
+- Mingw32 and VC++ compatibility changes in configure.in and debugboard
+
+2.7.193 released November 14, 2000
+
+- owl_topological_eye autohelper macro replaced by topological_eye
+- owl goals and boundaries systematically localized
+- global owl_goal_color removed
+- now O patterns accept critical friendlies if * rescues tactically
+- matcher_status used in print_ascii_area (moyo.c)
+- new function matcher_status()
+- ascii mode save command fixed
+- fixme's addressed in play_ascii.c
+- tuning
+- two ld*sgf files had gotten overwritten by rotated versions--fixed
+- revision of test results
+
+2.7.192 released November 12, 2000
+
+- new on board assertions in move_reasons.c
+- increased safety value for strongly alive dragons
+- territory changes are counted for owl attacks and defenses
+- influence changes are counted for semeai moves
+- reverse followup values can never more than double the move value
+- bugfix in liberty_of_dragon(), check that vertex is empty
+- somewhere() function and corresponding autohelpers require that
+ found stone does not have status dead
+- play_attack and play_defend autohelpers return ko results
+- tuning of barriers.db, conn.db, endgame.db
+- owl tuning
+- tuning of patterns.db and patterns2.db
+- double_does_break_helper and wide_break_helper replaced by constraints
+- new helpers edge_double_sente_helper and defend_against_atari_helper
+- new autohelper defend_against_atari
+- new target all_batches in regression/Makefile.am
+- revision of rotated testsuite
+- updating of test results
+
+2.7.191 released November 10, 2000
+
+- bug fix in update_liberties: kmouse_branch_depth
+- reading terminates when stackp>mouse_reading_depth
+- doc revision
+- revised dragon_escape() to allow kosumi directly from dragon
+- revised effect of I class influence patterns when computing escape
+ influence
+- find_influence_patterns() add influence barriers "manually" when
+ computing escape influence
+- dragon under consideration is now allowed to contribute influence during
+ computation of escape influence
+- mouse_find_lunches() made static to mouse.c
+- new autohelper function mouse_escape_value
+- 7 new patterns in mouse_defendpats.db, aiming at escape
+- new function mouse_connection_defends() in mouse.c
+- code revised in do_mouse_attack(), do_mouse_defend(), and
+ mouse_mark_dragon()
+- mouse_mark_dragon now can take either one or two dragons
+- bugfix in do_mouse_attack(), two loop end conditions were off by one
+- bugfix in do_mouse_attack() and do_mouse_defend(), the second most
+ important move was removed when pattern of value 99 found, but not third
+ most important one
+- move_safety field of move_data struct initialized correctly in
+ move_reasons.c
+- examine_move_safety() revised
+- order of examine_move_safety() and induce_secondary_move_reasons() calls
+ reversed in review_move_reasons()
+- same_dragon() in utils.c revised to be able to deal with the "no dragon"
+ case, i.e. (-1, -1) coordinates
+- effective_move measure revised to never include intersections further
+ away than distance 4
+
+2.7.130 released July 11, 2000
+
+- escape2 field removed from dragon_data struct together with code to
+ compute it
+- patterns/escape.db removed
+- mouse status and if applicable attack and defense points printed by
+ show_dragons()
+- bugfix in compute_escape_influence() in influence.c
+- revised debug and trace messages in mouse.c
+- new function examine_move_safety() in move_reasons.c
+- strategically_sound_defense() revised
+- more restrictions on which move reasons induce a block/expand move reason
+
+2.7.129 released July 9, 2000
+
+- redundant assignments removed from mouse.c
+- reading cache cleared after examine_position() call in
+ sgffile_decidedragon() and sgffile_decideposition()
+- new file regression/games/incident262.sgf
+
+2.7.128 released July 8, 2000
+
+- obsolete declarations of black_domain and white_domain removed from
+ liberty.h
+- dragon_escape() and compute_alternative_escape() in dragon.c revised
+- new function compute_escape_influence() in influence.c
+- new static functions compute_mouse_escape_values() and
+ mouse_escape_route() in mouse.c
+- if --alternative_escape option enabled, do_mouse_attack() and
+ do_mouse_defend() cut off reading if mouse_escape_route() report a
+ sufficiently high escape potential
+- redundant file interface/debugboard/loadsgffile.c really removed
+- removed remaining occurences of return code 2 in do_mouse_attack() and
+ do_mouse_defend()
+- new lunch pattern in patterns/conn.db
+
+2.7.127 released July 6, 2000
+
+- redundant file interface/debugboard/loadsgffile.c removed
+- parts of interface/play_solo.c moved into new file
+ interface/loadsgffile.c
+- new library interface/libinterface.a for use by interface/debugboard
+- new files sgf/sgfkey.c and sgf/sgfkey.h to handle new abstract type
+ sgfkey
+- find_border() renamed to examine_cavity() in worm.c
+- static functions propagate_worm_recursive() and libertiesrec() removed
+ from worm.c
+- code in worm.c simplified and cleaned up
+- dragon genus initialized in make_dragons() instead of in make_worms()
+- new static functions dragon_escape() and compute_alternative_escape()
+ in dragon.c
+- new option --alternative_escape to enable new escape route measure
+- new file /regression/games/incident261.sgf
+- one new test in regression/mouse.tst
+
+2.7.126 released July 5, 2000
+
+- change in definition to higher order liberties
+
+2.7.125 released July 4, 2000
+
+- statistics functions reset_mouse_node_counter() and
+ get_mouse_node_counter() in mouse.c
+- corresponding new GTP commands reset_mouse_node_counter and
+ get_mouse_node_counter
+- mouse.tst, ld_mouse.tst, and ld_mouse_life.tst reports the total number of
+ nodes visited by the mouse reading
+- bugfix in mouse_determine_life(), attack and defense points for lunches
+ were switched
+- constraints in some mouse patterns reordered for better performance
+- new files incident256.sgf and incident 258.sgf in regression/games
+- four new tests in regression/mouse.tst
+
+2.7.124 released July 1, 2000
+
+- tuning of mouse_defendpats.db
+- new files incident253.sgf and incident254.sgf in regression/games/
+- two new tests in regression/mouse.tst
+- restructured and corrected coordinate conversion code in play_ascii.c
+
+2.7.123 released June 27, 2000
+
+- one new pattern in mouse_attackpats.db
+- new file regression/games/life_and_death/ld18.sgf
+- two new test cases in regression/ld*.tst
+- bugfixes in life.c
+- new GTP commands debug_move_influence, influence, move_influence,
+ worm_data, and dragon_data
+- new function gtp_mprintf() in interface/gtp.c
+- new functions in influence.c to export influence data
+
+2.7.122 released June 22, 2000
+
+- partial implementation of debugboard eyes tab
+- black_domain[][] and white_domain[][] now static in optics.c
+- make_domains() restructured
+- xor() and unique_color() macros removed from showbord.c
+- support for boards smaller than 19x19 in debugboard
+- worm[][].attacki comparisons with -1 replaced everywhere with
+ comparisons of worm[][].attack_code with 0
+- likewise for worm[][].defendi and worm[][].defend_code
+- doc/dragon.texi revised
+- new GTP command debug_influence
+- code for debug printing restructured in influence.c
+
+2.7.121 released June 20, 2000
+
+- mouse option automatically enabled with decidedragon and decideposition
+ options
+- matchpat() uses mouse status if available
+- new file regression/games/incident252.sgf
+- one new reading test
+
+2.7.120 released June 17, 2000
+
+- mouse lunches must have attack code 1
+- bugfix in tryko sgf output
+- many reading functions take komaster argument
+- many reading functions made static
+- new functions do_attack and do_find_defense (with komaster)
+- cleanup in reading.c
+- doc revision
+- pattern Eye1 in conn.db taken out
+
+2.7.119 released June 16, 2000
+
+- new function gg_vsnprintf in gg_utils.c
+- check in configure.in for vwprintf
+- gg_vsnprintf used as workaround if vwprintf unavailable
+- fcntl/read stuff removed from debugboard
+- display_board_cursor() call added at the end of display_refresh()
+- leaveok() call removed from display_init()
+- debugboard cursor can be controlled by arrow keys
+- COLOR_* renamed to GG_COLOR_* to avoid name collision when using
+ pdcurses
+- new file regression/games/life_and_death/ld17.sgf and new ld* test cases
+- non-options treated as filenames
+- new format strings %H and %C to vgprintf() and relatives
+- trymove() and tryko() write hash value together with node number to
+ output sgf file
+- new files incident248.sgf and incident251.sgf in regression/games
+- decideeye() moved from utils.c to sgffile.c and renamed
+ sgffile_decideeye()
+- decideeye option now can write variations to an sgf file
+- life code revisions
+- utils.texi revised
+- bugfix in attack_callback() in worm.c
+
+2.7.118 released June 13, 2000
+
+- minor sniff_lunch revision
+- new mouse_attack pattern
+- new file regression/games/reading03.tst.
+- one new reading test
+- check for curses also in -lpdcurses
+- check for term.h and curses.h in AC_CHECK_HEADERS
+ instead of separate AC_CHECK_HEADER
+- new #define TERMINFO in config.h for the color
+ code in gg_utils.c, debugboard builds with pdcurses
+ on DJGPP despite the absence of term.h
+- workaround for the case when vwprintw is not available (as in pdcurses)
+ in display_message() in interface/debugboard/display.c
+- print the error message about too small screen after the screen has been
+ cleared in display_message()
+- use O_NONBLOCK as mask instead of FNDELAY since O_NONBLOCK
+ is more widely available
+- remove HAVE_STRING_H use
+- include instead of for mingw
+ included with new cygwin-1.1.1 release
+- cleanup of regression/Makefile.am
+- load_and_score_sgf_file() revised
+- life code revisions
+- default life eyesize increased from 8 to 10
+- bugfix in mouse_attack() and mouse_defend()
+- decideeye() in utils.c revised
+- terse option removed
+- function remove_string_and_mark() removed from board.c
+- distance and strategic_distance code removed
+
+2.7.117 released June 11, 2000
+
+- bugfix in regression/Makefile.am
+- countsize() renamed to countstones()
+- new function findstones()
+- life.c completely rewritten
+- regression/games/marginal.sgf extended
+- new life and optics tests
+- depth values no longer reduced while running make_domains()
+- revision of topological_eye()-calling code in dragon.c and mouse.c
+- doc/utils.texi revised
+
+2.7.116 released June 9, 2000
+
+- goal now static to mouse.c
+- mouse_attack() and mouse_defend() usage simplified
+- mouse_effective_defense replaced by mouse_does_defend
+- doc revision
+- debugboard: strings renamed to worms
+- debugboard now gives info about dragons
+- debugboard now has a help screen
+- color_to_string enhanced with eye colors also
+- new function status_to_string in utils.c
+- regression/Makefile.am revised so that make check also works with a
+ VPATH build
+- STACK_SIZE revised and assertion added in incremental_board.c
+- recognize_eyes2() now returns 0 if the eyespace is too large to evaluate
+- assertion added in eyehash_index() in life.c
+- size of hash table in life.c corrected
+- new function location_set_get_size()
+- bugfix in hadj() macro in optics.c
+- gtp.c keeps track of the board size in a static variable
+- one new reading test
+
+2.7.115 released June 7, 2000
+
+- regression/Makefile.am prepared for VPATH build
+- compiling without curses works again, debugboard disabled in that case
+- assert that color is BLACK or WHITE in do_trymove()
+- pass move in minimize_eyes() scored and tested together with the other
+ legal moves
+- bugfix in maximize_eyes()
+- new GTP commands genmove_black and genmove_white
+- eyes1.sgf, eyes2.sgf, and eyes3.sgf in regression/games/ extended
+- new tests in optics.tst and life.tst
+
+2.7.114 released June 6, 2000
+
+- sniff_lunch revised and moved to mouse.c
+- mouse code classifies boundary strings
+- bugfix: mouse code was unsafe when stackp>0
+- new functions do_mouse_attack() and do_mouse_defend
+- more careful includes in interface/debugboard/display.c
+- bugfix in incremental_sloppy_self_atari()
+- regression shell scripts revised
+- global variable color_has_played eliminated
+- new function stones_on_board() in board.c
+- movenum no longer used in fuseki.c
+- examine_position() avoids recomputing data that are up to date
+- caching of mouse reading results is no longer using code 2 to indicate a
+ successful result for pass
+- new workaround for mangling of cached negative move coordinates
+- statistics functions reset_life_node_counter() and
+ get_life_node_counter() in life.c
+- corresponding new GTP commands reset_life_node_counter and
+ get_life_node_counter
+- life.tst, ld_life.tst, and ld_mouse_life.tst reports the total number of
+ nodes visited by the life code
+- make_worms no longer returns anything
+- correct answer for mouse test 37 revised
+- temporary workaround in recognize_eye2(), chimeras are reported as one
+ and a half eye
+- maximize_eyes() and minimize_eyes() score and sort the moves to test
+- performance optimizations in maximize_eyes() and minimize_eyes(),
+ shortcut loops where possible unless all attack or defense moves are
+ asked for
+- bugfix in maximize_eyes(), check for marginality when counting eyes
+
+2.7.113 released June 5, 2000
+
+- mouse lunches are sniffed
+- sniff_lunch revised
+- bugfix in mouse_find_lunches
+- new global mouse_goal_color
+- bugfix in mouse_topological_eye autohelper
+- decidedragon messages corrected when tenuki wins
+- mouse tuning
+- new function location_to_string() in utils.c
+- new function position_examine_position() in engine/interface.c
+- new program debugboard located in interface/debugboard/
+- warning fixed in utils/gg_utils.c
+- comments about mapping of colors for linux console moved from showbord.c
+ to utils/gg_utils.c
+- unused define -DBUILDING_GNUGO_ENGINE removed from engine/Makefile.am
+- config.h no longer included by moyo.c or showbord.c
+- new functions suicide() and self_atari() in board.c
+- a few approxlib() calls in reading.c replaced by suicide() and
+ self_atari()
+- new files incident59.sgf, incident74.sgf, and reading02.sgf in
+ regression/games
+- new mouse and reading test cases
+
+2.7.112 released June 5, 2000
+
+- optimizations of false_margin()
+- safe_move() no longer called from make_domains() if mouse code enabled
+- call to modify_eye_spaces1() from make_domains() disabled if mouse code
+ enabled
+- bugfix in attack2()
+- bugfix in break_chain2()
+- duplicate comment block removed from reading.c
+- new files incident169.sgf, incident246.sgf, incident91.sgf, and
+ reading01.sgf in regression/games
+- regression/games/life_and_death/ld11.sgf slightly revised
+- new mouse and reading test cases
+
+2.7.111 released June 4, 2000
+
+- comment added in attack4
+- mouse_attack and mouse_defend call make_domains when stackp==0
+- new files mouse04.sgf, incident185.sgf, incident186.sgf,
+ incident199.sgf, and incident225.sgf in regression/games/
+- new mouse and reading tests
+
+2.7.110 released June 3, 2000
+
+- init_color() in utils/gg_utils.c renamed to gg_init_color() to avoid
+ name collision with curses library function
+
+2.7.109 released June 3, 2000
+
+- HASH64 removed from configure.in and acconfig.h
+- config.vcin brought in sync with config.h.in
+- macro UCHAR_ALIAS replaced by char
+- curses initialization and drawing code moved from moyo.c and showbord.c
+ to utils/gg_utils.c
+- argument source_root removed from sgf_write_header
+- new files games/mouse02.sgf and games/mouse03.sgf
+- new tests, revised results
+- MAX_MOVES increased to 3 in mouse.c
+- attack4 tries a little harder
+- tuning of mouse patterns
+- life and death test cases 52-64 completed
+
+2.7.108 released June 1, 2000
+
+- mouse functions use a return code of 2 if tenuki works
+- Zobrist hashing extended to mouse_attack and mouse_defend
+- new function new_position() in board.c
+- warning fixed in life.c
+
+2.7.107 released May 31, 2000
+
+- random.c and random.h moved from engine/ to utils/
+- gg_snprintf() and gg_gettimeofday() moved to new file utils/gg_utils.c
+ and corresponding header file utils/gg_utils.h
+- new function gg_version() in utils/gg_utils.c
+- safe move cache implemented for mouse_shapes_callback
+- topological_eye autohelper function (taken down in 2.7.104) is back for mice
+- topological eye takes both eyespaces as parameters
+- 32 new life and death test cases, 1 new mouse test
+
+2.7.106 released May 30, 2000
+
+- tuning of mouse patterns
+- fuseki9.db rebuilt from a larger set of games
+- new game records and test cases
+
+2.7.105 released May 29, 2000
+
+- config.h only included by files which need it
+- one new mouse pattern
+- new test suite ld.tst with variations for --mouse and --life options;
+ added for real this time
+- new dedicated fullboard pattern matcher for use with the fuseki
+ databases
+- first move patterns in fuseki9.db and fuseki19.db no longer commented
+ out
+- missing borders added in fuseki9.db and fuseki19.db
+- number of preambles in mkpat.c reduced from three to one
+- mkpat.c revised to also handle patterns for fullboard matcher
+- bugfix in make_dragons(), lunches weren't propagated to the whole dragon
+- one new pattern in eyes.db
+- pattern Lunch2 in conn.db revised
+- regression/games/marginal.sgf revised
+- new optics and life regression test cases
+
+2.7.104 released May 28, 2000
+
+- topological_eye takes the eye_data as a parameter
+- newgoal removed from mouse_attack
+- mouse_attack wins if ALL strings of original dragon are taken
+- topological_eye autohelper function temporarily taken down
+- mouse apat A39 revised
+- make_dragons does not add_lunch if lunch already eaten
+- doc revision
+- new function false_marginal_eye in life.c
+- new eye pattern for 4 point linear eye with a false margin
+- Tests for life and optics restructured
+- New tests for false margins
+- config.h only included by files which need it, plus still liberty.h
+- new GTP command dragon_status
+- new test suite ld.tst with variations for --mouse and --life options
+- shell scripts in regression/ revised
+- new game records ld1.sgf -- ld8.sgf in regression/games/life_and_death
+
+2.7.103 released May 27, 2000
+
+- new fields height and width added to the pattern struct
+- bugfix in fixup_patterns_for_board_size() in matchpat.c; matching now
+ works correctly also when the board size changes between calls to
+ matchpat
+- bugfixes in does_attack() and does_defend() in utils.c
+- bugfix in false_margin() in optics.c
+
+2.7.102 released May 26, 2000
+
+- better documentation of life code in the source
+- life.c handles false marginals
+- new function: location_set_isempty() in location_set.c
+- regression/games/marginal.sgf revised
+- new optics and life tests
+
+2.7.101 released May 25, 2000
+
+- revised doc/gnugo-logo.jpg and doc/gnugo-logo.jpg
+- new tests in reading.tst and mouse.tst
+- bugfixes in test files
+
+2.7.100 released May 24, 2000
+
+- minimize_eyes and maximize_eyes simplified and bugfixed
+- better documentation of the hash table in life.c
+- some cleanup in life.c, optics.c
+- new format character 'x' in vgprintf (utils.c)
+- improved printing of pass moves when %m is used in vgprintf
+- default life_eyesize increased to 8
+- new eye tests
+
+2.7.99 released May 23, 2000
+
+- suffix rules for .gtp and .res in regression/Makefile
+- new regression files regression/*.tst
+- regression shell scripts revised
+- regression/expected removed
+- several new files in regression/games
+- several new regression tests
+- regression/ directory now under control of automake
+
+2.7.98 released May 22, 2000
+
+- false marginals are renamed false margins
+- eyespace search revised in mouse_determine_life
+- new file regression/expected
+- new targets in regression/Makefile
+- regression/games/false_marginal.sgf renamed regression/games/marginal.sgf
+- mouse tuning
+- several new files in regression/games
+- several new tests in regression/mouse.gtp, regression/eyes.gtp, and
+ regression/reading.gtp
+- new GTP commands trymove, popgo, dump_stack, increase_depths, and
+ decrease_depths
+- new function gtp_decode_move() in interface/gtp.c
+- ko eyes assigned to a dragon so halfeye analysis is performed
+- old regression files in regression/obsolete/ removed
+
+2.7.97 released May 21, 2000
+
+- false marginals are detected during make_domains
+- new function false_marginal
+- new file regression/games/false_marginal.sgf
+- regression tests in regression/eyes reimplemented to use GTP
+- regression shell scripts revised
+- new targets in regression/Makefile to test optics and life code
+- new global variable position_number which is increased any time a real
+ move (not a trymove) is made or the board is permanently changed by some
+ other means
+- safe_move cache modified to use position_number instead of movenum
+- caches in moyo.c modified likewise
+- new function setup_board() in board.c
+- the functions in engine/interface.c no longer modifies the global board
+ on their own
+- new function gtp_finish_response in interface/gtp.c
+- new gtp command eval_eye
+
+2.7.96 released May 20, 2000
+
+- GTP documented
+- new file doc/gtp.texi
+- reading test suite extended
+- regression shell scripts revised
+- bugfix in gtp_loadsgf()
+- output from gtp_attack(), gtp_defend(), gtp_mouse_attack(), and
+ gtp_mouse_defend() revised
+
+2.7.95 released May 19, 2000
+
+- new interface: GTP, Go Text Protocol
+- new files in interface/: gtp.c, gtp.h, and play_gtp.c
+- old contents of regression/ moved to regression/obsolete/
+- new regression scripts and suits in regression/
+- doc/regression.texi revised
+
+2.7.94 released May 18, 2000
+
+- bugfixes in mouse.c
+
+2.7.93 released May 16, 2000
+
+- writesgf() split into sgf_write_header() and writesgf()
+
+2.7.92 released May 14, 2000
+
+- bugfix in utils.c, config.h included before using information from
+ configure tests
+
+2.7.91 released May 14, 2000
+
+- all functions in sgffile.c are now prefixed with sgffile_ instead of
+ sgf_ to separate them from functions which handle SGF trees
+- some minor cleanup in dragon.c
+- globals last_move_i, last_move_j made local to interface/play_ascii.c
+- functions save_state() and restore_state() removed together with
+ variables white_captured_backup and black_captured_backup.
+- move reasons are now sorted
+- inclusion of sys/time.h made contingent on HAVE_SYS_TIME_H in utils.c
+- inclusion of time.h and/or sys/time.h removed from hash.c and
+ interface/play_solo.c
+- one new pattern in eyes.db
+
+2.7.90 released May 12, 2000
+
+- bugfixes in play_gmp.c, play_solo.c, and play_test.c; gameinfo correctly
+ initialized
+- cleanup of play_gmp.c
+
+2.7.89 released May 10, 2000
+
+- bugfixes in main.c; decidestring, decidedragon, and decideeye options
+ work correctly again
+- new function color_to_string() in utils.c
+
+2.7.88 released May 9, 2000
+
+- minor tuning of mouse_attackpats.db
+- extended documentation of influence function
+- new function unconditional_life() in utils.c
+- MAX_STRINGS macro moved from incremental_board.h to liberty.h
+- unused variable removed from do_pass() in play_ascii.c
+
+2.7.87 released May 8, 2000
+
+- guess_mode_from_sgf_comment() removed
+- coordinates (-1, -1) are now always used for pass moves (rather than
+ (board_size, board_size))
+- obsolete and unused debug flags marked in gnugo.h
+- inclusion of sys/types.h removed from gmp.c
+- unused function str2short() removed from sgf_utils.c
+- cleanup of play_solo.c, play_test.c, and sgf_utils.c
+- bugfix: move number again passed from the interfaces to the engine
+
+2.7.86 released May 7, 2000
+
+- doc revision
+- more comments in the code for multiple diagonals of a halfeye
+- extended debug outputs in optics.c
+- bugfix in hash.c
+- new datataype Gameinfo
+- Gameinfo used everywhere in interface/*.c
+- Gameinfo used instead of Position in a few places otherwise
+- new function: position_recordhand()
+- board_size no longer public; moved from gnugo.h to liberty.h
+- several small functions removed from interface/interface.c
+- bugfix in regression/Makefile
+- bugfix in mkpat.c
+
+2.7.85 released May 5, 2000
+
+- bugfix in recognize_eye()
+
+2.7.84 released May 3, 2000
+
+- multiple vital eye moves in conjunction with topological halfeyes
+ supported in both optics and life code
+- compiler warnings fixed in interface/play_ascii.c and engine/interface.c
+- parameter names added to function prototypes in interface/interface.h
+
+2.7.83 released May 1, 2000
+
+- new functions in engine/interface.c
+- p[][], ko_i, ko_j, black_captured, white_captured moved from gnugo.h
+ to liberty.h, i.e. made local to the engine
+- attack() and find_defense() also made local to the engine
+- board handling functions removed from interface/interface.c
+- all interface functions in interface/interface.c now use the Position
+ datatype
+- sgfAddMoveFromTree() and sgfPlayTree() moved from sgfana.c to ttsgf.c
+- minor tuning of mouse_defendpats.db
+
+2.7.82 released April 30, 2000
+
+- new file engine/interface.c included for real this time
+- removed types SGFNodeP and SGFPropertyP
+- play_solo() and play_gmp() now plays on a Position.
+- get_moveXY moved from play_solo.c to sgf_utils.c
+- minor cleanup in a number of places
+- main.h moved from engine/ to interface/
+
+2.7.81 released April 28, 2000
+
+- new function sniff_lunch (unused and untested)
+- new function remove_string_and_mark
+- originate_eye now public
+- add_half_eye now takes half_eye array as an argument
+- doc revision
+- jump_out_helper() rewritten to use influence function rather than
+ strategic distance
+- matchpat_db() renamed to matchpat()
+- redundant autohelper function singleton() removed
+
+2.7.80 released April 27, 2000
+
+- bugfix in hash_rand()
+- obsolete -DBUILDING_GNUGO_ENGINE removed from patterns/Makefile.am
+- countlib2(), findlib2(), and approxlib2() renamed to countlib(),
+ findlib(), and approxlib() respectively
+- minor tuning of influence.db
+
+2.7.79 released April 26, 2000
+
+- count of hash collisions added to the --statistics option
+- new files random.c and random.h with an implementation of a twisted
+ GFSR random number generator
+- all calls to rand() or random() replaced by calls to the local random
+ number generator
+- test for random() removed from configure.in
+
+2.7.78 released April 25, 2000
+
+- sgf/sgf.c moved to the engine and renamed to sgffile.c
+- sgf/sgf.h removed; declarations moved to gnugo.h and liberty.h
+- removed a few declarations for non-existent functions from sgf_utils.h
+- analyzerflag moved to globals.c
+- new file: engine/interface.c
+- some functions for handling positions.
+- ttsgf_read.c and ttsgf_write.c integrated into ttsgf.c
+- bugfix in sgfPlayTree()
+- old approxlib() removed
+- bugfix in life.c
+- local random generator removed from hash.c
+- cleanup of hash.c
+- simplified typedefs in hash.h
+
+2.7.77 released April 24, 2000
+
+- doc of the colored influence displays added
+- new function hashdata_diff_dump() for use in assertions
+- local random generator in hash.c
+- revised types in hashing code
+- bugfix in semeai_analyzer()
+- order of engine/ and pattern/ builds changed back
+- extract_fuseki no longer built by default
+- bugfixes in extract_fuseki.c
+- tuning of influence.db
+- bugfixes in patterns.db
+
+2.7.76 released April 23, 2000
+
+- revised assertions in add_stone() and remove_stone()
+- declaration and initialization of color_has_played moved from interface/
+ to engine/
+- hashtable_clear no longer crashes if passed a NULL pointer
+- warning if hashtable allocation fails
+- new database matching step in the fuseki module
+- new experimental option --fusekidb to enable fuseki database matching
+- new program patterns/extract_fuseki.c which compiles a fuseki database
+ in patterns.db format from a collection of game records
+- new pattern databases fuseki9.db and fuseki19.db containing 9x9 and
+ 19x19 fuseki databases respectively
+- bugfix in influence.c to stop a single stone from claiming the whole board
+- libengine is now built before the patterns/ subdirectory is compiled
+
+2.7.75 released April 20, 2000
+
+- recognize_eye() and recognize_eye2() looks for all vital eye points and
+ passes them to the move generation
+- eyes.db format extended for multiple vital moves and database revised
+- liberty counting functions in incremental_board.c restructured to agree
+ with the new corresponding functions in board.c
+- approxlib() and countlib() calls converted to countlib2(), findlib2(),
+ and approxlib2() calls
+- countlib() macro removed
+- accurate_approxlib() revised and accurate_countlib() macro removed
+- autohelper lib() can now be used for stackp>0
+- TODO revised
+
+2.7.74 released April 19, 2000
+
+- obsolete code removed from genmove()
+- board_t renamed to Intersection
+- new Position struct added in gnugo.h
+- print_influence() now prints everything to stderr
+
+2.7.73 released April 18, 2000
+
+- revised TODO
+- renamed static function compile_for_match_new() back to
+ compile_for_match()
+- removed all external calls to compile_for_match()
+- minor cleanup in globals.c
+- don't regard marginal eye points as real eyes in the life code
+- neighbors to marginal eye points may be captured in the life code
+
+2.7.72 released April 13, 2000
+
+- old board code removed from board.c
+- new functions countlib2(), findlib2(), and approxlib2(), intended to
+ replace approxlib()
+
+2.7.71 released April 12, 2000
+
+- bugfixes in the hashing code, now CHECK_HASHING works again
+- pattern database code restructured, explicit calls to compile_for_match()
+ no longer needed
+- apats.db renamed to mouse_attackpats.db and dpats.db renamed to
+ mouse_defendpats.db
+- minor cleanup of dragon.c, life.c, optics.c, and patterns/patterns.h
+- documentation of hashing added to doc/reading.texi
+- cleanup of filllib.c
+
+2.7.70 released April 10, 2000
+
+- doc revision
+- bug fix in fill_liberty
+- compiler warning fix
+- simplified implementation of double_threat()
+- improved trace messages in confirm_safety()
+- depth values increased during reading in confirm_safety()
+
+2.7.69 released April 9, 2000
+
+- bugfix in regression/eyes/test.sh
+- revision of confirm_safety
+- revision of review_move_reasons
+- new function double_atari
+- new function accurate_approxlib
+- accurate_countlib takes *libi, *libj as parameters
+- fill_liberty tries to avoid setting up double ataris
+- doc revision
+- load_and_analyze_sgf_file assumes color_has_played
+- bugfix in mouse_determine_life
+
+2.7.68 released April 7, 2000
+
+- New switch --terse for test output
+- Various minor cleanups
+- life.c much commented
+- regression tests for life code using --decideeye in regression/eyes
+
+2.7.67 released April 5, 2000
+
+- check for size of int and long in configure
+- configure option --enable-hash64
+- separate options --life and --life_eyesize
+- reformatting of help string to fit 80 columns
+- bugfix in play_ascii.c
+- minor tuning of patterns.db
+
+2.7.66 released April 4, 2000
+
+- point of attack and point of defense considered separately by
+ compute_eyes(), recognize_eye(), topological_eye(), and half_eye_data
+- make_dragons() now take color to play as parameter
+- (defensei, defensej) renamed (defendi, defendj) in a number of places
+- minor tuning of patterns2.db
+
+2.7.65 released April 3, 2000
+
+- removed trailing ',' symbols in enums in main.c and gmp.c
+- extraneous declaration of deltai[] and deltaj[] removed from influence.c
+- bugfixes in the CHECK_HASHING code
+- bugfix in play_ascii.c, repeated save and load now works
+- compile_for_match() added in two places
+- keep track of attack and defense points of mouse_lunches
+- revision of mouse_find_lunches() and mouse_lively()
+- minor doc revision
+- aesthetic reformatting in eyes.db
+- declaration of incremental board functions moved from liberty.h to
+ incremental_board.h
+- new function incremental_mark_string() in incremental_board.c
+- replaced mouse_mark_strings() with a generic mark_string() in board.c
+
+2.7.64 released April 2, 2000
+
+- updated DJGPP info
+- removed leading white space in windows.texi for more nicely formatted
+ info files
+- removed obsolete workaround for a texi2html missing feature.
+- added members defendi and defendj to struct eye_data
+- recognize_eye2 now returns point of defense as well as point
+ of attack for an eye
+- compute_eye now reports defense point as well as attack point
+- recognize_eye2 now considers if the boundary of the eye is
+ captured during eye reading
+- speed optimizations in recognize_eye2
+- 5 new functions in location_set.c
+- small bugfix in showbord.c
+- small bugfix(?) in main.c
+- small cleanup in dragon.c
+- new function mouse_effective_defense()
+- if the mouse code is enabled, strategically_sound_defense() invokes
+ mouse_effective_defense()
+
+2.7.63 released April 2, 2000
+
+- new function attack1() to determine whether a string in atari can be
+ captured
+- snapback() made obsolete and removed
+
+2.7.62 released April 1, 2000
+
+- bugfix in evaluate_diagonal_intersection()
+- evaluate_diagonal_intersection moved to optics.c and made static
+- new function topological_eye
+- new autohelper option topological_eye
+- doc revision
+- mouse tuning
+- hashvalue test whether matchpat is properly prepared for the board
+ position being matched
+- compile_for_match() added in a few places
+- modify_eye_spaces1() and find_cuts() not used when make_domains() is
+ called from the mouse code
+- minor bugfixes in life.c and board.c
+- minor tuning of patterns2.db
+
+2.7.61 released March 31, 2000
+
+- bugfix in recognize_eyes2() so it can be used for stackp>0
+- reloading of files in ascii mode is documented
+- mouse code tries tenuki if no move of value >40 found
+- dpat revision
+- eye pattern 524 removed
+- obsolete fixme removed from patterns2.db
+- new function move_in_stack() in board.c
+- improved debug output in life.c
+- decideeye() disables trace outputs during make_worms() and make_dragons()
+
+2.7.60 released March 30, 2000
+
+- doc revision
+- new option --life to enable the life code
+- new function initialize_engine() in genmove.c
+- bugfixes in sgf_decidedragon(), sgf_decideposition(), and decideeye()
+- modify_eye_spaces1() only called from make_domains() if stackp==0
+- loop unrolling in accumulate_influence enabled
+
+2.7.59 released March 29, 2000
+
+- new file life.c with eye reading code
+- new file location_set.c with a utility class that contains a set of
+ locations on the go board
+- bew file location_set.h with headers for location_set.c
+- bugfix in board.c which makes the allocation of hash nodes correct
+- separation of the examination step of genmove() into it's own
+ function, examine_position(), and calls to this function in a number of
+ places
+- some comments added in mouse.c plus some cleanup
+- new option --decideeye which tells the status of an eye
+- new function get_coordinate() in main.c
+- black_eye and white_eye passed as arguments to make_domains
+- private black_eye and white_eye arrays for mouse.c
+- eye pattern added to eyes.db
+- bugfix in unrolled accumulate_influence()
+- bugfix in move_reasons.c
+
+2.7.58 released March 28, 2000
+
+- loop unrolling in accumulate_influence(), initially disabled by default
+
+2.7.57 released March 27, 2000
+
+- doc revision
+- compile_for_match() called again after running mouse code from genmove()
+- mouse_genmove() removed from utils.c (was unused)
+- doc/MOUSE and doc/INFLUENCE removed from distribution, all material is
+ included in the Texinfo documentation
+- matchpat aborts if color==EMPTY
+- mouse_attack returns true if trymove captures
+- unnecessary test eschewed in mouse_find_lunches
+- corrected: debug flag set wrong in main.c with --mouse
+
+2.7.56 released March 25, 2000
+
+- optics.c: redefinition of lively for mousing
+- new functions mouse_find_lunches and mouse_lively
+- new DEBUG_MOUSE debug option
+- does_attack and does_defend no longer require stackp==0
+- new apats and dpats
+- doc revision
+- sethand.c: bugfix in placehand(), use add_stone() instead of
+ manipulating p[][] directly
+
+2.7.55 released March 25, 2000
+
+- initialize dragon.mouse_attack and dragon.mouse_defend
+- revaluation of joseki database
+- hashing code revised for 64 bit architectures
+- Makefile added to regression subdirectory and regress.sh revised
+- minor tuning of patterns.db
+- AUTHORS and doc/introduction.texi revised
+
+2.7.54 released March 23, 2000
+
+- revised eye patterns, prefer to play on marginal vital points
+- doc revision
+- introduction moved from incremental.c to texinfo
+- special value 99 implemented for apats and dpats
+- new apats and dpats
+- AUTHORS and doc/introduction.texi revised
+- accurate_countlib revised
+- slow_findlib() added in incremental_board.c so that
+ incremental_findlib() and incremental_countlib() can handle all cases
+
+2.7.53 released March 21, 2000
+
+- bugfixes and other revisions of the incremental board code
+- incremental board code enabled by default
+- new function accurate_countlib() in utils.c
+- a few countlib() calls replaced by accurate_countlib()
+- minor bugfix in connection_value2
+
+2.7.52 released March 19, 2000
+
+- bugfix: decidestring and decidedragons were getting depth 0
+- new apats and dpats
+- minor cleanup of join_dragon invocations
+- mouse code reports findings (temporary measure)
+- doc revision
+
+2.7.51 released March 18, 2000
+
+- doc revision
+- hurry >= 3 turns off some features
+- adjust configure.in, config.vc and sgf/ttsgf.c
+ to test for vsnprintf instead of snprintf
+- replace an embedded newline in a #defined
+ string in main.c with an explicit \n
+- remove trailing ',' characters in enum
+ declarations
+- include interface.h in sgf_utils.h so
+ that enum testmode is defined when declaring
+ guess_mode_from_sgf_comment.
+- bugfix in break_through_helper()
+
+2.7.50 released March 17, 2000
+
+- new option --showtime makes genmove report its time
+- new option --hurry decrements depth parameters
+- hurry can be set during ascii play
+- new global variables hurry and showtime
+- gg_gettimeofday made global
+- new global variables nominal_depth, nominal_backfill_depth,
+ nominal_fourlib_depth, and nominal_ko_depth
+
+2.7.49 released March 15, 2000
+
+- bugfix in make_dragons (--mouse could cause crash)
+- bugfix in mouse_determine_life
+- bugfix in vgprintf
+- new function vital_chain
+- new autohelper functions singleton and vital_chain
+- mouse tuning
+- new eye pattern
+- mouse code documented
+- string.h included in incremental_board.c to stop warning
+- sgf functions cleaned up by passing around a file handle instead of
+ sharing a global one
+- minor optimizations in break_chain() and relative_break_chain()
+- minor changes and more comments in incremental_board.c
+- stack implementation revised in incremental_board.h
+
+2.7.48 released March 14, 2000
+
+- new global variable mouse
+- new functions mouse_reasons, add_mouse_attack_move, add_mouse_defend_move
+- new option --mouse
+- support for loading a position from file and continue playing with the
+ ascii interface
+
+2.7.47 released March 13, 2000
+
+- singleton() moved from utils.c to board.c
+- new files incremental_board.c and incremental_board.h, supplying an
+ implementation of incremental board updates
+- support for incremental board updates added to board.c but still disabled
+- updateboard() made static to board.c
+- return type of pushgo() and popgo() changed to void
+- new function play_move() replaces updateboard() for use from interfaces
+
+2.7.46 released March 10, 2000
+
+- chainlinks() and chain() moved from reading.c to board.c
+- find_origin() moved from utils.c to board.c
+- count() made static to board.c
+
+2.7.45 released March 9, 2000
+
+- globals global_size, global_lib, global_libi, and global_libj eliminated
+- new function countsize() in board.c
+- tenuki (?) implemented for autohelpers
+- two autohelpers in patterns.db and one in dpats.db use tenuki
+- type omitted from findex entries
+- decideposition takes a color option
+- if (MOUSE) then showboard prints two diagrams
+- new apats and dpats
+- error messages in mkpat slightly revised
+- Martijn van der Kooij and NNGS are thanked
+- minor spelling corrections in Texinfo documentation
+- windows.texi revised
+
+2.7.44 released March 8, 2000
+
+- globals size, lib, libi, libj renamed global_size, global_lib,
+ global_libi, global_libj
+- new parameters to count(), approxlib(), and countlib() for passing
+ liberty locations
+- bug fixed in mouse_determine_life which could cause crash
+- new option --decideposition
+- showboard can display mouse_status
+- mouse_status computed in dragon.c
+- a few new apats and dpats
+- findex entries omit parameters
+- windows installation instructions added to Texinfo documentation
+
+2.7.43 released March 7, 2000
+
+- connection_value2() revised
+- type of potential_move array changed to int
+- updated VC project files
+
+2.7.42 released March 6, 2000
+
+- mouse goal array changed from int to char
+- C patterns implemented for mouse patterns
+- bugfix in mouse_defense: misplaced popgo() popped
+- new function goaldump for debugging
+- new function mouse_mark (like count but does not mark liberties)
+- new mouse patterns
+- cleanup of interface.c
+- pushgo() made static
+- pattern profiling output now computes the total number of hits and
+ reading nodes
+- O symmetry introduced in barriers.db
+
+2.7.41 released March 5, 2000
+
+- documentation revision
+- new file doc/influence.texi
+- move generation functions are documented in Texinfo
+- influence.c functions are documented in Texinfo
+- short section on Migration removed from move_generation.texi
+- new pattern profiling option --profile_patterns
+- minor tuning
+- new symmetry class 'O'
+- joseki pattern values reduced to a third
+
+2.7.40 released March 4, 2000
+
+- doc revision
+- tryko returns 0 if suicide is attempted
+- now --printsgf works with -L
+- implementation of trymove() and tryko() unified
+- minor optimization in attack_either()
+- cleanup of utils.c
+- experimental pattern CB327 in patterns.db
+
+2.7.39 released March 1, 2000
+
+- revision of patterns/apats.db and patterns.dpats.db
+- default depth values restored to 2.6 level
+- new functions set_temporary_depth_values() and restore_depth_values()
+ in utils.c
+- depth values temporarily decreased while computing influence
+- bugfix in tryko()
+
+2.7.38 released February 29, 2000
+
+- handle handicap stones in sgf files correctly
+- bugfix in mouse.c
+- trymove() replaced by tryko() in compute_move_influence
+
+2.7.37 released February 28, 2000
+
+- point to strings instead of copying them in mouse.c
+- more than two moves per position can now be handled by the mouse code by
+ increasing the value of MAX_MOVES
+- B class patterns in dpats.db inhibit addition of the stone to the dragon
+- AUTHORS, THANKS, and doc/introduction.texi revised
+- two eye patterns revised
+- bugfix in sgfOverwritePropertyInt() in ttsgf.c
+- sethand() split into two halves to make it more flexible
+- play_ascii.c revised to deal correctly with handicap stones
+
+2.7.36 released February 27, 2000
+
+- dragon.c: serious bug fixed in topological eye evaluation
+- substantial revision of mouse.c
+- new patterns in apats.db and dpats.db
+- sgf.c: revision of decidedragon
+- doc expanded of certain autohelper functions
+- Jamal Hannah's typing Gnu acknowledged as logo source
+- documentation of influence function begun in doc/INFLUENCE
+
+2.7.35 released February 26, 2000
+
+- mouse_attack and mouse_defend avoid some duplicate eyespace evaluations
+- missing eye pattern in eyes.db
+- sgf_decidedragon correctly invoked from main.c
+- close sgf file before reopening it
+- do not close stdout in sgf_close_file
+- print_eye revised to give nice output also when stackp>0
+
+2.7.34 released February 25, 2000
+
+- experimental mouse code
+- gnugo.eps and gnugo.jpg renamed gnugo-logo.eps and gnugo-logo.jpg
+
+2.7.33 released February 23, 2000
+
+- VC project files and WINDOWS revised
+
+2.7.32 released February 22, 2000
+
+- reading cache cleared once it becomes full
+- -M option now takes float argument
+- -M 0 no longer causes a floating exception
+
+2.7.31 released February 21, 2000
+
+- VC project files adapted from 2.6
+- win/ directory with makefile brought over from 2.6
+- bugfix in main.c, optind replaced by gg_optind
+- WINDOWS revised
+- minor assorted cleanups
+
+2.7.30 released February 19, 2000
+
+- cleaned up code for debuginfluence option
+- general cleanup of main.c
+- minor tuning of patterns2.db
+- AUTHORS, THANKS, and README brought up to date with 2.6
+- TODO revised
+- Added news for 2.6 in NEWS
+- WINDOWS brought over from 2.6
+- year 2000 added in copyright notices everywhere
+- emacs interface added from 2.6
+- gnugo.jpg added from 2.6
+- gnugo.eps built by encapsulating gnugo.jpg into postscript level 2 using
+ jpeg2ps
+- Texinfo documentation merged with late changes from 2.6
+- various other late changes from 2.6 merged
+
+2.7.29 released February 11, 2000
+
+- tuning of barriers.db, endgame.db, and patterns.db
+- sprintf replaced by vsprintf in gg_snprintf
+- spelling corrections
+- TODO revised
+- unreachable code in hashdata_init() commented out
+- UNUSED and ON_BOARD macros moved to liberty.h
+- special_rescue() made more general
+- calls to special_rescue() also in defend3()
+
+2.7.28 released February 8, 2000
+
+- bugfix in break_through()
+- tuning of conn.db, influence.db, patterns.db, and patterns2.db
+- various minor fixes to eliminate warnings on certain platforms
+- opterr, optind, and optopt prefixed with gg_ to allow building with
+ profiling
+
+2.7.27 released February 6, 2000
+
+- copying.texi added for real this time
+- minor revision of patterns.texi
+- various code revisions in influence.c
+- new functions for segmenting connected regions of territory, moyo, and
+ area added to influence.c
+- -m option can take hexadecimal values
+- tuning of barriers.db, influence.db, conn.db, patterns.db, and
+ patterns2.db
+- conn.db reorganized
+- retuning of joseki patterns
+- corner moves in fuseki.c retuned
+- minor revisions of move_reasons.c
+- workaround to avoid black characters on black background in showbord.c
+- we no longer add half eyes when eye.dragoni == -1
+
+2.7.26 released January 31, 2000
+
+- endgame patterns split off from patterns.db to endgame.db and matched
+ separately
+- influence_delta_territory results cached
+- tuning of barriers.db, conn.db, patterns.db, and patterns2.db
+- new eye pattern from 2.5.63
+- new option --debuginfluence to help tuning influence function
+- listing of worms includes origins of corresponding dragons
+- bugfix in move_reasons.c; don't accept cuts or connections of one dragon
+ and itself
+
+2.7.25 released January 29, 2000
+
+- AUTHORS, INSTALL, and THANKS revised
+- GPL added to texinfo documentation
+- small_semeai() documented in texinfo documentation
+- autohelper call moved from matchpat() to callback
+- possible to pass auxiliary data through matchpat() to callback
+- DEPTH decreased from 14 to 12, BACKFILL_DEPTH from 8 to 6, and KO_DEPTH
+ from 8 to 6
+- new functions for drawing boards for debug output
+- symbolic names for colors
+- influence function implemented in influence.c and influence.h
+- new patterns to assist influence function in patterns/barriers.db and
+ patterns/influence.db
+- terri renamed to territory in a number of places
+- revised heuristics to decide when a tactical defense is strategically
+ sound, using influence values
+- territorial value estimated with influence_delta_territory() instead of
+ delta_terri() from moyo module
+- influence value estimated with influence module functions instead of
+ delta_moyo() from moyo module
+- secondary_value weighted down substantially in computation of total move
+ value
+- symbolic names for printmoyo values
+- local optimizations in shapes_callback() to avoid unnecessary reading
+- increased depth values when evaluating reading constraints disabled to
+ improve speed
+- new patterns in conn.db
+- local optimization in connections.c, don't evaluate autohelper if there
+ is nothing to amalgamate
+- autohelper functions xarea, oarea, xmoyo, omoyo, xterri, and oterri
+ changed to use functions from influence module
+- separate flag to mkpat to decide anchoring policy
+- tuning of patterns.db and patterns2.db
+
+2.7.24 released January 27, 2000
+
+- cleanup of the interface/ files
+- minor revision to doc/using.texi
+- doc/reading.texi updated from 2.5.62
+
+2.7.23 released January 26, 2000
+
+- removed inclusion of unistd.h where unnecessary
+- include io.h on platforms where unistd.h not available
+- remove unused files utils/long-options.[ch] utils/closeout.[ch], and
+ utils/error.h
+- fixed getopt warnings by renaming the getopt in utils/ to gg-getopt
+- TODO revised
+- -M option repaired
+- bugfix in init_gnugo() in board.c; don't do everything twice
+- default size of reading cache increased from 8 MB to 32 MB
+- docs/ directory replaced by doc/ with texinfo documentation from 2.5.60
+- gnugo.6 man page moved from top directory to doc/
+- /docs/WINDOWS updated from 2.5.60 and moved to top directory
+
+2.7.22 released January 20, 2000
+
+- always use strtok in play_ascii.c and skip strsep
+- cleanup in configure.in
+- bugfix in play_solo.c
+- configure test for gettimeofday in interface/
+- HAVE___FUNCTION__ moved to the right position in acconfig.h
+- in configure.in, add -lwsock32 to $LIBS for the mingw32 environment
+ for the select call in gmp.c
+- include windows.h and windows32/sockets.h to get definitions for fd_set,
+ select and FD_* macros in gmp.c
+- incorrect "abort;" changed to "abort();" in several places
+- TODO item about converting documentation into texinfo marked as done
+
+2.7.21 released January 17, 2000
+
+- confirm_safety() called from review_move_reasons() in order to avoid
+ certain blunders
+- the search for lunches moved to the end of make_worms()
+
+2.7.20 released January 16, 2000
+
+- removed unused file utils/getdate.c from distribution
+- pattern Eye2 taken out from conn.db as workaround to a bug
+- only victims with attack code 1 or 2 are considered lunch
+- separation of interface into a public and a private part; liberty.h
+ split into gnugo.h for external interface and liberty.h for internal
+ interface
+- dragon_status() renamed to compute_dragon_status()
+- new function dragon_status() hiding dragon_data struct
+- default cached function is only attack()
+- new function is_worm_origin()
+- new function confirm_safety()
+- update the files getopt.c getopt1.c and getopt.h in utils/ to glibc-2.1.2
+- add a file README in the utils directory explaining where the getopt
+ files come from.
+- make utils the first subdirectory to compile
+- link in utils/libutils.a when linking mkpat.c
+
+2.7.19 released January 13, 2000
+
+- unsigned char changed into signed char in sgfana.c, ttsgf.c, and
+ ttsgf_write.c to eliminate DEC-cc warnings.
+
+2.7.18 released January 12, 2000
+
+- src directory renamed to engine
+
+2.7.17 released January 10, 2000
+
+- cleanup in moyo.c, eliminating DEC-cc compiler warnings
+- main.c moved from src/ to interface/
+- dragon.weak renamed dragon.safety
+
+2.7.16 released January 8, 2000
+
+- cleanup in configure.in
+- cleanup in make_proper_eye_space()
+- autohelper functions for modifying eyespace
+- more debug output for DEBUG_EYES
+- tuning
+- one new pattern in eyes.db
+
+2.7.15 released January 6, 2000
+
+- cleanup in configure.in
+- configure tests for random and alarm
+- embedded newline removed from a string in mkeyes.c
+- extra pair of braces to avoid ambiguous else in optics.c
+- compiler warning about snprintf eliminated from ttsgf.c
+- documentation about dragon.status and dragon.weak revised in docs/DRAGON
+- attack() is more cautious about snapbacks
+- dragon_status() revised to consider a missing case
+- docs/PATTERNS fully revised
+- slight revision of the definition of higher order liberties, in an attempt
+ to fix escape_route problem
+- reading depths increased with the number of explicitly placed stones
+ in autohelpers
+- minor cleanup in utils.c
+- patterns shuffled around in patterns.db and patterns2.db
+- two extra matching pattern steps to modify eyespaces, patterns temporarily
+ hosted in conn.db
+- not_lunch patterns moved to conn.db and matched together with eye space
+ modifying patterns
+- autohelpers can now also be used in conn.db patterns with no '*'
+- minor revision of escape.db
+- dont_attack_helper removed since it was no longer in use
+- remaining references to EXPERIMENTAL_MOVEGEN removed
+- bugfix in add_half_eye()
+- new function make_proper_eye_space() in optics.c for use from autohelpers
+- tuning
+
+2.7.14 released January 4, 2000
+
+- four vgprintf calls in utils.c changed to vprintf calls
+- variable sized arrays changed to fixed size in sgfana.c
+- declaration of board_size in ttsgf.h made consistent with liberty.h
+- removed embedded newlines in strings in mkeyes.c and main.c
+- escape.db patterns revised
+- bugfix in matchpat
+- revised heuristics for non-matched eye shapes
+- tuning
+
+2.7.13 released January 3, 2000
+
+- help debug prints default hash memory
+- decidestring reports even if verbose=0
+- print_eye() documented, prototype moved
+- documentation in docs/PATTERNS partially updated to reflect changes
+ in pattern format
+- bugfix in mkpat.c
+- bugfix in getopt string
+- bugfixes in trace messages in shapes.c
+- new function dragon_status2() using new escape route measure in
+ the escape2 field (not yet in actual use)
+- new patterns in escape.db
+- tuning
+
+2.7.12 released January 2, 2000
+
+- configure option to revert to sprintf if neither snprintf or g_snprintf
+ found
+- command line option -M (--memory) to specify hashtable size
+- bugfixes in board.c
+
+2.7.11 released January 2, 2000
+
+- all remaining patterns in patterns.db adapted to new move generation scheme
+- format of ":" lines in pattern databases changed
+- joseki.c updated to produce new database format
+- patterns in conn.db can have action lines
+- three new autohelpers: dragonsize(), wormsize(), and potential_cutstone()
+- patterns are no longer sorted in mkpat and min weight optimization
+ removed from matchpat
+- updated documentation of autohelpers in docs/PATTERNS
+- value field in worm_data and dragon_data obsoleted and removed
+- obsolete section removed from docs/PATTERNS
+- obsolete pattern classes Q and q removed, remaining ones slightly reordered
+- B, C, a, d patterns work on up to five dragons (previously max two or one)
+- improved tunability of patterns, possible to specify min and max
+ territorial and total values
+- many helpers converted to constraints and removed
+- join_dragons() no longer need to be called with origins of dragons
+- wind assistance and moyo assistance functions obsoleted and removed
+- connection_value() and compute_score() obsoleted and removed
+- attack_either move reason rejected if one of the strings is defenseless
+- old style move values no longer used in move generation
+- shape value effect changed from additive to multiplicative
+- random contribution to move value decreased
+- tuning
+
+2.7.10 released December 28, 1999
+
+- changes from 2.5.47--2.5.52 merged into eyes.db
+- tuning
+- unused helpers and patterns removed
+- many patterns in patterns.db adapted to new move generation scheme
+- linear eyes of size 6 with one marginal eye fixed in eyes.db
+
+2.7.9 released December 27, 1999
+
+- bugfixes and cleanups in configure.in and various Makefile.am
+- bugfix in move valuation
+- bugfix in add_half_eye: remember to adjust marginal_neighbors
+- bugfix in defend1: consider case of 4 liberties after extend
+- breakchain2: try_harder to break chain
+- bugfix in singleton()
+
+2.7.8 released December 23, 1999
+
+- break_chain2 considers a few extra possibilities
+- stricter syntax checking in mkpat.c
+- bugfixes in pattern databases
+- caching of read results indexed also on stackp
+- warning eliminated in dragon.c
+- implementation of tracing of read results revised
+- one new pattern in escape.db
+- new escape route algorithm documented in docs/DRAGON
+
+2.7.7 released December 21, 1999
+
+- More verbose autoconf test for __FUNCTION__
+- bugfix and cleanup in patterns/Makefile.am
+- Split utils.c into board.c and utils.c
+- Cleanup of both files.
+- Fix a warning in fuseki.c
+- minor tuning
+- one new pattern in conn.db
+- improved trace messages for read results, contingent on TRACE_READ_RESULTS
+
+2.7.6 released December 19, 1999
+
+- READ_RETURN0 macro redefined in reading.c
+- makes consistent the inequalities in reading.c
+- misspelling of "propagate" corrected
+- experimental implementation of new escape route algorithm
+- new file: patterns/escape.db
+- DEBUG_HEY (obsolete) replaced by DEBUG_ESCAPE
+- one new pattern in conn.db
+- new autohelpers: same_dragon and same_worm
+- minor tuning
+- bugfix in rr_set_result_ri_rj() macro
+- bugfix in compile_for_match()
+- don't allocate hash table space in find_defense if more than four liberties
+- bugfixes in defend3()
+- two compiler warnings eliminated in semeai.c
+- bugfixes in attack_callback() and defense_callback in worm.c
+
+2.7.5 released December 18, 1999
+
+- elimination of stackp=depth
+- dead code cleaned away from reading.c
+
+2.7.3 released December 16, 1999
+
+- minor tuning
+- cleanup of patterns and helpers
+- cleanup of matchpat()
+- attack and defense patterns moved from patterns.db/patterns2.db to
+ new files attack.db and defense.db
+- attack and defense patterns matched during make_worms()
+- error message instead of segmentation fault when using -L without -l
+- testmode output modified
+- cleanup of ttsgf.c, ttsgf_read.c, and ttsgf_write.c
+- improved configure detection of snprintf
+- cleanup in Makefile.am and patterns/Makefile.am
+- configure tests for gcc specific macro __FUNCTION__
+- bugfix in sgf/Makefile.am
+- in break_chain, removed stackp7 is alive in recognize_eye
+- several eye patterns added
+- dragon_status: escape_route bound for CRITICAL upped to 6
+- -o and --analyzerfile add handicap stones by AB,AW
+- in nonfile modes the handicap stones are added in sethand()
+- sethand() checks for max handicap values and returns actually set stones
+- reduced MAX_HANDICAP to 19
+- main.c checks for MAX_HANDICAP
+- sgf_close_file is called only once, when ending ascii mode with "quit"
+- GM property added in --analyzerfile
+- HA property added in --analyzerfile (in sethand())
+- defined MIN_BOARD 3 in liberty.h
+- help output shows MIN_BOARD, MAX_BOARD and MAX_HANDICAP
+- cleanup of shapes.c, optics.c and moyo.c
+
+2.3.86 released August 21, 1999
+
+- resolved: hashed functions shall be readlad2 and basicnet3
+- connection code patch to reconcile amalgamation and cutstone
+ classification (needs rewriting)
+- tuning
+- amalgamate over _dead_ ko positions
+- bugfix in not_lunch_helper
+- Changed semantics of play_attack_defend_n()
+- unused color parameter removed from get_read_result
+- no compiler warnings under GNU/Linux
+- man page docs/gnugo.6 added
+- convenient tcsh completion described in docs/MISC
+
+2.3.85 released August 20, 1999
+
+- configure option --disable-hashing now functional
+- values are not hashed when stackp>depth
+- cleanup of mkpat.c
+- cleanup of eyes.h
+- tuning
+- now prints number of eyes in analyzerfile with --analyze eyeinfo
+
+2.3.84 released August 18, 1999
+
+- tuning
+- cleanup of dragon.c
+- halfeyes.c removed from the distribution
+- configure option --disable-hashing sets HASHING to 0
+- sgf.c: avoid trying to close output file twice
+- eyes.db: code # has been changed to @ to avoid conflict with comments
+- Revised compute_eyes() and split off linear eyes to an own function.
+- Made return value from recognize_eye() more consistent.
+- New autohelper functions to identify eye space points: eye(),
+ proper_eye(), and marginal_eye()
+- Major revisions of endgame patterns, taking eye space into account
+- obsolete functions play_attack_defend2() to play_attack_defend8() removed
+
+2.3.83 released August 15, 1999
+
+- joseki.c upgraded to generate constraints in .db
+- 3 new autohelpers in mkpat.c: diff_moyo, area_space, area_stone
+- interface/play_test.c: bugfix when --testmode and --analyze are combined
+- CHECK_HASHING turned off
+
+2.3.82 released August 14, 1999
+
+- hash codes are now computed incrementally
+- bugfix in hash.c
+- reading.c: sacrifice only if stackp, replace old --fuseki and --fearless
+
+2.3.79 released August 10, 1999
+
+- hash.h: bugfix which caused reading errors in rr_set_result_ri_rj
+- reading.c: savestone2 looks for double ataris to chain when stackp>depth
+- updated docs/MISC: analyze functions
+- option --analyze works again (was temporarily off by accident)
+- option --analyze works in --testmode game, no variations tested
+- new analyze functions: moyocolor, recommended, eyeinfo, worminfo
+- bug fix in analyze function eyes
+- option --score last --analzyerfile saves the potential territory with TW,TB
+- option --statistics writes also to analyzerfile
+- abortgo() saves analyzerfile
+- ttsgf.c: ttsgf_move_made() removed
+- play_solo.c: timing added to benchmark mode
+
+2.3.78 released August 7, 1999
+
+- hashing in basicnet3 and savestone3
+- bugfix in play_gmp.c: undo now seems to work!
+- sgf/sgf_utils.c: bugfixes in get_moveX and get_moveY
+- interface/play_solo.c: bugfix in get_moveXY
+
+2.3.77 released August 5, 1999
+
+- showbord.c: revised behavior of -E option
+- minor change in moyo.c to have it reinitialized when a game is reloaded
+- change in scoring system for compliancy with chinese & japanese style rules
+- ascii mode: save territory points to analyzerfile
+- gmp mode: log game in sgf tree
+- gmp mode: undo implemented by replaying sgf tree
+- gmp mode: save result and territory points to analyzerfile
+- ttsgf.c: new function sgfOverwritePropertyInt()
+- ttsgf.c: new function sgfAddStone()
+- sethand.c: sets handicap stones to sgf tree
+- hash.diff removed from distribution
+
+2.3.76 released August 4, 1999
+
+- interface/html directory contains cgi interface
+- bugfix in optics.c: initialization of domains
+- bugfix in reading.c: some variations were being overlooked
+- hashing implemented in savestone2
+
+2.3.75 released August 2, 1999
+
+- mark illegal moves in --printsgf with IL property
+- Some new macros in hash.h
+- Use hashing in readlad2
+- Some cleanup of worm.c
+- option -f rewritten : opening tuning, including oba moves
+- non fuseki part of old -f option became --fearless option
+
+2.3.74 released August 1, 1999
+
+- bugfixes in helpers.c. One of these could cause a crash
+- two connection patterns increased substantially
+- moved get_komi() and inc_movenumber() to liberty.h
+- play_ascii(): new commands to navigate the game tree in ascii mode
+- back command (undo) implemented in ascii mode! Newly placed
+ stones appear as variations in the sgf
+- play_ascii(): changed the compare length of some commands. Now q works
+ for quit, b for back and f for forward.
+- removed bug in play_ascii(): user pass after computer pass did not
+ display result.
+- fixed bug in helpanalyzer output
+- utils.c: added function intialize board() and removed remove_stone()
+- fixed the komi bug reported by Douglas in --analzyerfile
+
+2.3.73 This version may be released later
+
+2.3.72 released July 30, 1999
+
+- bugfix in updateboard ko handling
+- Moved obsolete documentation about reading.c to doc about utils.c
+- Expanded documentation about reading with hashing
+- minor tuning
+
+2.3.71 released July 29, 1999
+
+- bugfix in make_worms: moving point of defense
+- fixes to handling of ko after a pass
+- updatepassmove() removed
+- updateboard now handles pass moves.
+- KO handling by trymove is currently broke
+- play_ascii.c, play_gmp.c, play_solo.c updated accordingly.
+- revisions to ascii interface.
+- legal() now reports a pass move to be legal.
+- revision of one eye pattern
+- tuning to increase attention to connections
+- 2 new helpers
+- mkpat: weak autohelper option needed ==CRITICAL
+- modified worm values
+
+2.3.70 released July 28, 1999
+
+- Zobrist hashing implemented
+- new files src/hash.h and src/hash.c
+- readlad1 uses hashing
+- readlad2 does consider 2 stone sacrifices if stackp19
+- depth and backfill_depth are augmented in attacker() and defender()
+- bugfix in printsgf mode
+- sgf_printboard prints current board position to sgf file
+- LOAD_AND_PRINT mode: read file, output final position
+
+2.3.65 released July 21, 1999
+
+- dragon_eye does not amalgamate across an ikken tobi
+- play_ascii.c: change depth on the fly
+- new option --statistics
+- revision of various helpers and 2 new helpers
+- mkpat rewritten so constraints can now be on several lines.
+- New autohelper functions xplay_attack, oplay_attack, xplay_defend,
+ and oplay_defend, which take variable number of arguments.
+- New functions in utils.c to support the above.
+- tuning
+- bugfix in sethand.c
+- increased DEPTH to 14 and BACKFILL_DEPTH to 7
+- change_attack can sometimes reclassify dragons as DEAD
+- command line resetting of depth
+
+2.3.64 released July 20, 1999
+
+- reformatting of reading.c
+- bugfix in break_chain2
+- revised basicnet3: try harder to rescue boundary chains
+- revised basicnet3: remember moves tried to avoid redundant reading
+- bugfix in find_lunch: pick juciest worm
+- sgf property PL implemented in play_solo
+- revisions in play_solo.c and fuseki.c for small boards
+
+2.3.63 released July 19, 1999
+
+- delta_moyo, delta_terri work with either color
+- 2 new functions diff_terri and diff_moyo,
+- cleanup of moyo.c
+- -f option revised
+- docs/BOUZY revised
+- new docs/SCORING
+- New autohelper functions.
+- New connection patterns and revisions of the connections matching code.
+- Bugfix to an eye pattern.
+- Much tuning.
+- Revised criterion for when to defend or attack a worm.
+- Extended the scope of destroyer().
+- Experimental worm and cut revaluation in light of dragon formations
+- Changed heuristics for eye values of non-matched eye shapes.
+- reordered arguments to does_attack() and does_defend()
+- bugfix in readlad2: backfill was turned off
+- default backfill_depth is now 5
+- -l and -o options can be - for stdin and stdout
+
+2.3.62 released July 17, 1999
+
+- New autohelper functions, xlib(), olib(), xcut(), and ocut().
+- Revised documentation for autohelper functions.
+- Connections database introduced. New files: connections.c and conn.db.
+- find_dragon_pairs() disabled, replaced by connection patterns.
+- Cutting patterns from the connection database can modify eye spaces.
+- Amalgamation in dragon_eye() no longer done over marginal eyes.
+- mkpat partially rewritten.
+- Minor correction to eyes.db.
+- Nakade helpers cleaned away.
+- Minor tuning,
+- two more nakade like patterns removed, EC63 again C pattern.
+- Bug fix in attacker(): discount bad captures, not good ones
+- New function destroyer() to capture of strings that can't currently
+ be defended, but which could be after opponent backfilling
+- Some cleaning in genmove.c.
+- Attack points of non-defendable strings not moved in make_worms
+- defense points added for adjacent non-defendable strings so
+ dragon amalgamation won't confuse semeai()
+- new function read_sgf_header used by load_and_analyse_sgf_file
+- new function load_and_score_sgf_file
+- new option --score and new mode LOAD_AND_SCORE
+- new function evaluate_territory
+
+2.3.61 released July 15, 1999
+
+- nakade patterns are gone
+- only linear patterns are currently hand-coded
+- many new eye patterns
+- not_lunch_helper aids in hane/kill combinations
+- undid a change in 2.3.59: amalgamation on first line
+
+2.3.60 released July 15, 1999
+
+- TODO revised
+- copyright revised in interface/ files
+- new pattern in eyes.db
+- halfeyes: require O not dead
+- revision of detect_trap_helper
+- revision of one pattern in hey.db
+- new ko patterns
+- other minor changes
+- new functions does_attack and does_defend in utils.c
+- attacker and defender call these functions
+- copyright notice slightly changed in main.c
+- reformatting of worm.c
+- unwanted handicap printf removed from play_gmp.c
+
+2.3.59 released July 14, 1999
+
+- revision of docs/DRAGON
+- several new eye patterns
+- fair amount of tuning. Particularly, changes to diag_miai patterns
+- dragon.c: we don't amalgamate a dragon if it touches the eyeshape
+ only on the first line
+- COLOR_STACK_SIZE increased to 70
+- DEBUG used in optics.c
+
+2.3.58 released July 13, 1999
+
+- mkpat revised. Autohelper functions now can take multiple parameters.
+ First out is defend_against(a,b) which plays our own stone at a and
+ then checks whether the opponent can safely play at b.
+- some tuning of patterns.
+- new function defend_against() in utils.c
+- bugfix in compute_eyes(): missing returns
+- two new eye patterns
+- bugfix in add_half_eye
+- more refined testing of att_X case in halfeyes.c
+- halfeye: obsolete test that eye and halfeye are in distinct cavities omitted
+- halfeye: we check that * is a safe move for X
+- restored marginal test in throw_in_atari_helper (removed in 2.3.55)
+- superceded docs/GRAPHS removed from distribution
+- filllib.c reformatted
+
+2.3.57 released July 12, 1999
+
+- count and chain rewritten for speed
+- more graceful error message if no in file specified in testmode
+- eye pattern 10 needed a vital point
+- find_lunch and make_worms: a ko is not lunch
+
+2.3.56 released July 11, 1999
+
+- add_half_eye: when a half eye's vital point is in another eyeshape
+ the eyeshapes are amalgamated. This is correct and stops some crashes
+- computer tries to compute the score at end of game
+- new function who_win in moyo.c
+- one chimera pattern included in eyes.db
+- bugfix in attdef.c: color in territory test
+- bugfix in showbord.c: display of capture count
+
+2.3.55 released July 9, 1999
+
+- integration of half eye and eye code
+- separate eye domains for black and white
+- revision of docs/EYES to document the algorithm
+- a couple of changes that will be undone in a later release:
+ temporary oversimplification of treatment of att_X in hey_callback
+ temporary oversimplification of throw_in_atari_helper
+- removal of one half eye pattern
+- experimental penalty for running inside enemy territory
+- bug fix in semeai.c
+- revision in showboard for -E option
+
+2.3.53 released July 8, 1999
+
+- reading.c: new function special_rescue finds certain saving moves
+- revisions to savestone2 including use of special_rescue
+- speedup in find_lunch
+- minor revisions to hey.db and eyes.db
+- bugfix in mkpat (this could cause compilation failure)
+- bug fix in make_dragons (ignore eyes when not relevant)
+
+2.3.52 released July 7, 1999
+
+- bugfix in setup_double_atari_helper (could cause crash)
+- minor tuning
+- revision make_domains: influence can't creep under third line stone
+- revision to find_lunch: if already eaten it's not lunch
+- revision in halfeyes.c vis a vis Pattern 12
+
+2.3.51 released July 6, 1999
+
+- revision of mkeyes
+- new function recognize_eye() for use by the reading code (unfinished)
+- revision of the -f option (move generator based on territory)
+- cleanup in helpers.c and replacement of helpers by constraints
+
+2.3.50 released July 4, 1999
+
+- gnugo -f implements search for big moves with delta_moyo>=12
+- and delta_terri >=14. Such a move gets value 80.
+- tuning
+- some work on false eye code
+- some work on the eye code
+- bugfix in double_atari_helper
+
+2.3.49 released July 2, 1999
+
+- Correction to sgf output from ascii interface.
+- Results of safe_move() are cached if stackp==0.
+- Helpers and some other code rewritten to use safe_move()
+- Bugfixes in block_attack_defend_helper and urgent_connect_helper
+- Reading bug fixed in savestone2().
+- tuning
+- autohelper options safe_xmove,safe_omove,xmoyo,omoyo,xarea,oarea,xterri,oterri
+- new function mkeyes to compile the eye database (unfinished)
+- docs/GRAPHS explains the approach to the eye code
+- revisions to eyes.db and eyes.h
+- in halfeyes.c we make an exception to the rule that X can't be captured
+- revisions to hey.db
+- dragons with one eye and lunch are CRITICAL
+- revisions to eye_finder to find such dragons
+- eyespaces are not connected through adjacent marginal eyes
+- various fields initialized in make_domains()
+- bugfixes in make_domains
+- bugfix in compute_eyes: sometimes found the wrong end of a linear space
+
+2.3.48 released June 29, 1999
+
+- experimental changes to fuseki.c
+- revisions to helpers and patterns
+- eye_finder() now calls sgf_move_considered()
+- revisions to compute_eyes: eye shapes of size 4
+- DEPTH is now 13, BACKFILL_DEPTH is 9
+- gnugo --help now prints defaults of depth and backfill_depth
+- bugfix in worm.c: some non-kos were incorrectly identified as ko
+
+2.3.47 released June 29, 1999
+
+- substantial speedup in chainlinks
+- minor tuning
+
+2.3.46 release June 28, 1999
+
+- tuning, new helpers and patterns
+- some half eye code restored to dragon.c
+- some further linear patterns in compute_eyes()
+- bugfix in savestone3
+- speedup in find_lunch: if stackp==0, we used cached info
+- in break_chain2 don't try certain foolish moves
+- speedup in basicnet3 (avoid unnecessary readlad1)
+
+2.3.45 released June 27, 1999
+
+- 3 new functions delta_terri_color, delta_moyo_color, delta_area_color
+- new board stack in moyo.c
+- BOUZY updated
+- bug fixes regarding half eyes in dragon.c and eyes.c
+- new code for some linear patterns
+- bugfix: dragons around a ko were getting amalgamated
+
+2.3.44 released June 25, 1999
+
+- bugfix in atari_save_helper (could cause crash)
+- revision to CD68 (could cause GNU to play out a ladder)
+- bugfix in dragon.c: incrementing msize wrongly
+- minor revisions to make_domains()
+- new functions int moyo_color(int m,int n) and int terri_color(int m,int n)
+ returning the color of the intersection as seen by terri & moyo modules
+- new function delta_moyo_simple() without meta_connect bonus, delta_moyo()
+ is now a wrapper to this one (should be a transparent modification)
+- diag_miai_helper uses the new moyo_color()
+
+2.3.43 released June 24, 1999
+
+- revisions to ascii interface
+- gnugo can resume adjourned games
+- gnugo plays through endgame phase of the ascii interface
+- much tuning
+- revisions to helpers and new helpers
+- in this version a weak group has between 0 and 20 points space
+- two half eye patterns are back. Half eyes still not working right
+- (incomplete) revision of eye code to deal with half eyes
+- bug fix in eyes.c regarding opponent stones within eyespace
+- tinkering with hoshi.sgf
+
+
+2.3.42 released June 23, 1999
+
+- weak groups now have between 4 and 20 liberties
+- diag_miai_helper won't recommend a move in opponent's territory
+- revisions to patterns/hoshi.sgf
+- mkpat.c: fields in NULL pattern at end of patterns.c corrected
+- mkpat.c: weak option added to pattern compiler
+- some tuning
+- dragon.c: error eye.msize was preventing us from finding false eyes
+- some code moved from eye.c to dragon.c to help finding false eyes
+- compute_eyes and propogate_eyes are now public functions
+- bugfix in shapes.c: obonus and xbonus should now work correctly
+- revisions to documentation
+
+2.3.41 released June 22, 1999
+
+- compute_eyes is partially written (without using matchpat)
+- revisions to computation of genus
+- openeyes is expunged
+- half eye database is invoked earlier
+- half eye database used only to find false eyes
+- bonus field split into obonus and xbonus
+- obonus and xbonus are applied to patterns involving weak groups
+- most EB patterns now have bonuses
+- 5 point bonus for patterns involving weak groups (2.3.38) is gone
+- some tuning
+- some bugfixes in eyes.c, dragons.c and semeai.c
+
+2.3.40 released June 21, 1999
+
+- substantial revisions and new code in dragon.c and eye.c
+- dragons around an eye shape are now amalgamated
+- delta_moyo looks in meta_connect for the tested move
+- Bug fixes for two helpers.
+- Minor tuning.
+- GNU now can read sgf files with missing final ")".
+- defender and the attacker try the move suggested by shapes()
+- The semeai player now prefers to play on mutual liberties if this
+ improves the liberty balance.
+
+2.3.39 released June 18, 1999
+
+- some tuning, new helper block_attack_defend_helper
+- eye code now fills out an array eye[][] with data
+- revision to eye algorithm
+- open eye spaces now have origins
+- bugfix with -E option
+- dead groups are now cyan in showboard (were white)
+
+2.3.38 released June 17, 1999
+
+- experimental bonus of 5 points to patterns involving a weak dragon
+- revision of patterns/hoshi.sgf: attachment variations deprecated
+- open eye shapes are now computed. Display these with gnugo -E
+- some tuning
+
+2.3.37 released June 16, 1999
+
+- weak groups no longer classed dragon.status==CRITICAL. Instead ...
+- new field dragon.weak
+- old worm.weak and dragon.weak renamed worm.lunch and dragon.lunch
+- weak groups (found by moyo) classed dragon.weak==CRITICAL
+- dragon.weak field not used by genmove but displayed by showboard
+- new helper wedge2_helper
+- tuning and other revisions to pattern database
+- src/eye.c code is now linked though not used by genmove
+- revisions to showboard to display eye domains if xo=1
+- int make_worms() (was void) returns 1 if board not empty
+- find_weak() renamed find_lunch()
+
+2.3.36 released June 15, 1999
+
+- weak groups are classed CRITICAL so they scrounge eyes
+- new function test_weak to find weak groups (in moyo.c)
+- revision to print_txt_color
+- bugfix in fill_liberties
+- revised docs/BOUZY
+- bugfix: find_defense no longer checks that strings can be attacked
+ which required some modifications, slowing us down a little
+- DEPTH reduced to 12
+
+2.3.35 released June 15, 1999
+
+- reading code is much faster now and hopefully also more accuracy.
+- new function relative_break_chain() used in revised readlad2()
+- caching of moves eschewed in break_chain(), break_chain2()
+ if return pointer is NULL
+- DEPTH increased from 10 to 13
+- new docs/READING explains using --decidestring -o with gdb
+- connect_under_helper() rewritten to use connection_value()
+- housecleaning in patterns.db
+
+2.3.34 released June 14, 1999
+
+- test for pass in play_solo.c corrected
+- tuning
+- new pattern classification: Edge Expansion
+- GNU tries in two ways to fill liberties (points in Chinese count)
+- before passing, DEAD opponent stones in semeai are reclassed
+ unknown, then shapes is rerun
+- if that doesn't work, new function fill_liberty() tries again
+- new field dragon.semeai, new function revise_semeai()
+- static_eval() is gone (superceded by moyo())
+- reading.c: new function savestone3()
+- reading.c: savestone2 no longer tries to find the best move since
+ we have ways to improve points of attack and defense
+- some code taken out of find_defense()
+- dump_stack() uses gprintf instead of TRACE and counts variation
+
+2.3.33 released June 12, 1999
+
+- new function meta_connect to test a move against area ownership
+ (returns true when the move connects/disconnects meta groups)
+- area ownership now sees kosumi connections
+- minor changes in moyo.c data structures
+- in shape.c, added some bonus for meta_connect moves
+- in mkpat.c, some bonus added to maxwt for meta_connect moves
+- minor tuning
+- in readlad2() we consider throwins
+- Copyright updated (no longer says 2.0) in src/ and patterns/
+
+2.3.32 released June 11, 1999
+
+- substantial speedup of reading code
+- in savestone2, we try to find an easy saving move before reading
+- in savestone2, we don't try second move if first works
+- in readlad2, we postpone break_chain2 but not break_chain
+- option --decidestring -o now outputs variation numbers
+- bugfix in extend_to_kill_helper
+- embryonic src/eyes.c included in tar file
+
+2.3.31 released June 10, 1999
+
+- new globals last_move_i and last_move_j give the last move made.
+ This is used to improve(?) ascii output.
+- fixed bug ascii play where the captured stones where added wrong
+- play_ascii and play_test start with move 0 like play_gmp
+- in ascii play the last move is now marked
+- bug fixed in ascii play when a pass is made
+
+2.3.30 released June 9, 1999
+
+- reimplementation of of handicap in ascii without writing p[][]
+- new functions for saving/restoring game state without using stack
+- use inc_movenum instead of movenum++ in play_gmp and play_solo
+- revision to ko_important_helper: ko values cut in half
+- move_attack() and move_defense() renamed change_attack() and change_defense()
+- new komoku pattern
+- 2 new patterns
+
+2.3.29 released June 7, 1999
+
+- connection_value moved to src/util.c
+- alive11_helper modified
+- eschewing of kos by attacker() and defender(), dropped in 2.3.28 is back
+- edge_ko_important helper added
+- new sente_extend_helper, straight_connect_helper, block_to_kill_helper
+ extend_to_kill_helper, revise_value_helper
+- new half eye pattern
+- several new patterns and changes to patterns.db
+- moved some CC patterns from wrong section
+- now --color should work with ascii interface
+
+2.3.28 released June 6, 1999
+
+- bugfix (worm.c, shapes.c, helpers.c): propogate_worm not used with stackp>0
+- attacker() and defender() no longer eschew kos
+- unused sgfAddPlay is commented out (fixing a warning)
+- fixes to trace (indent is back, caves which are kos are reported correctly)
+- default backfill_depth is 7 (arrived at by trial and error)
+- option --decidestring no longer requires -o (useful with or without it)
+- in make_worms() code to improve worm.attack, worm.defend we now read
+ one step deeper in the stack to avoid horizon effect
+- initialization in propogate_worm() uses memset
+
+2.3.27 released June 5, 1999
+
+- new option -B [depth] should now work
+- default values of depth and backfill_depth are 10 and 5
+- new function mprintf which is similar to gprintf but writes to stdout
+- changed vgprintf to work with different outputs (i.e. stderr, stdout)
+- the testmode now write its output to stdout only (never stderr)
+- bugfix in backfire_helper
+
+2.3.26 released June 4, 1999
+
+- Backfill depth can now be set with -B [depth]
+- very minor revisions to patterns.db
+- reading.c: bc was not being initialized when stackp>0 (twice)
+
+2.3.25 released June 1, 1999
+
+- bug fix in new make_worm() code
+- connection_value gives a bonus if the connecting move makes 2 eyes
+- mystery pattern CB102 removed
+
+2.3.24 released May 30, 1999
+
+- tuning of joseki and patterns
+- revised definition of inessential worms --- require worm.weak==-1
+- new code in make_worms() to revise points of attack/defense
+- BACKFILL_DEPTH reduced to 4 due to increased slowness
+- basicnet4 included but turned off
+
+2.3.23 released May 29, 1999
+
+- asymmetry bug in moyo.c fixed: when init_moyo() is launched,
+ boardsize is not known
+- area computation and dilat algorithm bug
+- distribution includes reading.c.alt for the experimentally inclined
+- tuning and new helpers
+- dragon.c split into dragon.c and worm.c
+
+2.3.22 released May 27, 1999
+
+- disabled long jumps into enemy area without a secure connection
+- no center pattern can jump down to or along the second line
+- revision to the endgame patterns according to docs/ENDGAME
+- detect_trap_helper looks for moves attacking two groups at once
+- some other tuning
+- evaluate_game removed from the distribution
+- semeai will not recommend a move which leads to an immediate loss
+- bugfix in semeai: bestlib was not getting updated
+
+2.3.21 released May 27, 1999
+
+- Empty corner play moved to src/fuseki.c (new) and reimplemented
+- Embryos for 3-4, 3-3, 5-3, and 5-4 joseki databases in patterns/*.sgf
+- option -m [level] for debugging moyos
+- docs/EYES revised
+- bugfix in urgent_connect_helper
+- pattern revisions
+
+2.3.20 released May 26, 1999
+
+- readlad2 now tries backfilling. readlad2 and attack return 2 if
+ a backfill is found but no direct attacking move
+- new patterns
+- use of macros to simplify helpers
+- trymove: sgf --decidestring now gives more information
+- solves errors when MAX_DILAT != MOY_DILAT
+- now the area ownership uses 4 dilation, which seems better.
+- docs/ENDGAME added from Gunnar's email of May 18, 1999
+
+2.3.19 released May 24, 1999
+
+- edge block/expand patterns reordered
+- tuning
+- a new joseki
+- a new helper
+- Move evaluate_game functionality into play_test.c
+- It is now main.c that loads the sgf file into a tree.
+- If no playmode / testmode is supplied, look for a comment
+ of the form C[testmode=...] in the root node. If found,
+ this sets the playmode / testmode.
+- Other interface fns take the tree, rather than filename, as param.
+- testmode is now a local variable, passed as param into play_test,
+ rather than setting into global state via set_testmode / get_testmode
+- Move the tests for acceptable sgf file (GM[1]FF[3/4]) into the
+ sgf reader, rather than in the user of the tree.
+- bugfix in hane_backfill_helper
+- semeai now attacks dragons of low vitality
+- semeai tries a little harder to choose a smart liberty
+
+2.3.18 released May 23, 1999
+
+- break_chain() and break_chain2() return 2 if saving move can be taken
+- savestone2() and find_defense() try harder not to make self-atari
+- find_defense() now considers tenuki
+- forgot to initialize adjsize and adjlib in chainlinks()
+
+2.3.17 released May 23, 1999
+
+- Complete reordering and some tuning of the fuseki patterns.
+- A little tuning elsewhere.
+- Documentation of the new features in the patterns.db format.
+- The -m option enhanced with another board with delta_moyo values.
+- chainlinks test now in basicnet3
+- delta_terri(int ti, int tj,int color) : the same as delta_moyo(),
+ but against the 5/21 evaluation
+- area ownership evaluation (using 5/0 algo), with wrapper functions :
+ area_stone(int m,int n), area_space(int m,int n)
+ area_color(int m,int n), area_tag(int m,int n)
+ set_area_tag(int m,int n,int tag)
+- the values are computed during make_moyo evaluation, use
+ "gnugo -m" to see how area are evaluated.
+- bugfix in play_test.c
+
+2.3.16 released May 22, 1999
+
+- Wind assistance complemented by moyo assistance.
+- Move dependent randomness replaced by pattern dependent randomness.
+- Format of patterns.db changed to accomodate new features mentioned above.
+- One new joseki line.
+- Jump out patterns retuned. They may still be somewhat out of tune
+ but in a new and different way. Or maybe they even work quite well.
+- Some tuning of fuseki patterns.
+- Caching of upower and mypower values from testwind.
+- Some functions moved from matchpat.c to shapes.c.
+
+2.3.15 released May 22, 1999
+
+- board-setup nodes were being ignored in test-mode
+- fixes a bug where moves annotated as bad (MA[]) were reported as good.
+- took ascii_showboard out of play_test.c.
+- end_sgfdump() tries to pop the stack before closing the file
+- DEPTH ramped all the way up to 10, the new reading code is so fast
+- evaluation of moves is moved to break_chain and break_chain2
+- simplification of readlad1, readlad2, savestone2, find_defense and basicnet3
+- a few annotated games against David Fotland's XGO added to regression/
+
+2.3.14 released May 21, 1999
+
+- documentational changes to helpers.c
+- minor changes in patterns.db
+- all jump_out_helper patterns changed to weight 60 for moyo heuristics
+- jump_out_helper() modified to use moyo heuristics
+- new function delta_moyo() run quite fastly, using the cache as proposed.
+ the result of this function go in global variables :
+ moyo_test[WHITE],moyo_test[BLACK] and the difference from precedent
+ moyo evaluation is in moyo_test[0]
+ delta_moyo returns what is expected : the difference from point of view
+ of "color" player, aka moyo_test[0]
+ the same for moyo_eval[3] and terri_eval[3]
+ so all the results are availables for later use.
+ (see sources for details)
+- used #defines for the variables 5/21 and 5/10 (can be 4/10 too), see liberty.h
+
+
+2.3.13 released May 20, 1999
+
+- further revisions to ttsgf_read.c regarding file buffering
+- tuning, new patterns, helpers, half eye patterns
+
+2.3.12 released May 20, 1999
+
+- tuning
+- ttsgf_read.c: changed
+
+2.3.11 released May 19, 1999
+
+- reading.c from 2.3.8 is restored
+- MAX_FILE_BUFFER increased to 150000 in ttsgf_read.c
+- tuning and a new joseki
+- hide most of liberty.h from non-src/ code.
+- src/ and patterns/ define BUILDING_GNUGO_ENGINE,
+ and are therefore allowed to see all the internal
+ symbols. Otherwise, code just sees a few functions,
+ and sees 'const' versions of the variables.
+- (liberty.h defines a macro PUBLIC_VARIABLE which expands
+ to extern for engine source files, and extern const
+ for others)
+- *NOTE* : we get many warnings about const violations,
+ where other modules write to these variables. In particular,
+ ascii_showboard makes temporary changes to p[][].
+ But it still compiles (with gcc at least). These interface
+ violations were always there. Now they are visible.
+- Moved remove_string() and count_territory() from play_ascii
+ into src/utils : these need to be part of the engine
+ since they have intimate access to the state.
+- Did a bit of gratuitous changes with play_test.c
+ No functionality changes.
+- lost get_*_a and put_*_a interface functions.
+- make_dragons() is no longer predicated on movenum, but
+ on existence of worms.
+- potential_moves[][] is now taken seriously : genmove()
+ clears it at the start of the move cycle, rather than
+ having sgf_move_made() clear it at some random time
+ after genmove has returned.
+- semeai criterion slightly changed: my dragon.vitality<0
+ and your dragon.status==DEAD.
+
+2.3.10 released May 18, 1999
+
+- hane_backfill_helper deprecated
+- semeai module now consults vitality field to initiate fighting
+- test mode did not pass movenum to engine code: fixed.
+ did away with the game_info entries for boardsize and move_number,
+ made the interface use the engine's global variables instead.
+ Better solution is needed (see TODO)
+
+2.3.9 released May 17, 1999
+
+- play_solo.c: in load_sgf_file() we now use global movenum instead of mv
+- play_solo.c: white stones were loading as black (fixed)
+- new helpers, tuning, revisions to pattern database
+- mkpat.c: maxwt now takes bonus into account
+- reading.c: break_chain2 simplified
+
+2.3.8 released May 17, 1999
+
+- backfill.sgf added to regression/
+- color added to moyo.c
+- bugfix in moyo.c: captures were counted backwards
+- BOUZY added to docs/
+- bugfix in sente_hane_helper
+- joseki patterns are now type 's'
+- fix the board_size bug in test mode
+- reimplement load_sgf_file() in terms of the sgf parser : gives us
+ ability to read multiple AB[][]... for free
+- move load_sgf_file and load_and_analyse_sgf_file from sgf/ into
+ interface. (Currently play_solo.c but that's temporary.)
+ Justification is that these fns have more to do with the engine
+ than with sgf files.
+- put in the emacs variable blocks into some of the files
+- remove some extern refs from .c files - according to David
+ this is a bad practise
+- Remove a few remaining // comments, and disable // comments in
+ GNUGO_SOME_WARNINGS
+- Reorganise the --help page, and add long options for most of the
+ short ones. The --help is modelled after gnu tar.
+- Some files had #define _NO_PROTO to hide getopt() prototype, but
+ these files were not doing option parsing, so assume this is redundant.
+- interface game_info structure was used only in interface.c, so
+ moved the structure defn out of a public header file
+- The ttsgf_read.c code only offered to parse an sgf file which had
+ already been read into a buffer. Moved a code fragment which appeared
+ in two places to load the file then parse it into a readsgffile()
+ function.
+- Prefixed all the symbols for long option names with OPT_, and mode
+ names with MODE_to avoid namespace clashes. (DECIDE_STRING was being
+ used as a mode and an option.)
+
+2.3.7 released May 15, 1999
+
+- Jerome's moyo mode (-m option)
+- new patterns and helpers, including backfill patterns CD47 and CD48
+- reading.c: trysafe in readlad2 has been removed
+- reading.c: in savestone2 if stackp==0 we first try to capture
+- a surrounding string. This would lead to thrashing if we tried
+- it at deeper levels
+- reading.c: bug fix in find_defense (Gunnar)
+- reading.c: in break_chain2 we omit harder attacks if string has
+- 3 liberties since this causes too many errors.
+- reading.c: in basicnet3 we test a little more the attack really works
+
+2.3.6 released May 15, 1999
+
+- bug fixes in patterns/
+
+2.3.5 released May 14, 1999
+
+- tuning, new helper
+- initialization in src/evaluate_game.c and interface/play_test.c
+
+2.3.4 released May 13, 1999
+
+- Nils' changes to main.c and src/Makefile.am
+- tuning, joseki revisions, new helper wedge_helper
+
+2.3.3 released May 12, 1999
+
+- find_weak eschewed in find_defense
+- change to allow build in a directory other than source
+- braces to joseki.c to avoid a warning about dangling else
+- added --testmode game to analyze games and see if it considered the moves
+- added docs/structure.doc describing program structure and APIs
+
+2.3.2 released May 12, 1999
+
+- missing library files restored in utils/Makefile.am
+- tuning, invasion under hoshi joseki
+- and a cosmetic bug fix in shapes.c.
+- patterns for endgame ko
+- bugfix in double_attack patterns
+
+2.3.1 released May 11, 1999
+
+- Joseki compiler and beginnings of a Joseki database
+- some tuning
+- Tweak sgf/Makefile.am to write generated sgf_properties to $(srcdir)/
+ note : this generates a warning at automake, but I think it is benign.
+- remove the GCC_OPTS from the Makefile.am's, and replace with either
+ @GNUGO_SOME_WARNINGS@ or @GNUGO_ALL_WARNINGS@.
+ This means we can centralise the choice of which warnings we enable,
+ rather than having to duplicate the list of warnings in each component.
+- Add code to configure.in to generate the above. ALL_WARNINGS switches off use
+ of // comments (via -Wp,-lang-c89 which runs preprocesser in ansi mode).
+ SOME_WARNINGS will do the same once all components have been cleaned up.
+ SOME_WARNINGS is intended for code over which we don't have full control (eg gmp.c)
+ and so we have to be more liberal in the diagnostics.
+- Removed from the build some of the stuff in utils/ which we do not (currently) use.
+- fixed clear_board() bug that caused segfaults
+- fixed game parameter handling in main() to use interface API
+- updated other interfaces to partially use interface API (no more
+ passing from main!)
+- removed // comments where they were not needed
+ They stil are in the tt* code, that needs to be revisited!!
+- patched sgfgen to use stdin and stdout- makes things easier
+
+2.1.25 released May 10, 1999
+
+- added --decidestring option for sgf debugging reading code
+- added regression directory: contains a few example test files
+- added --quiet option
+- added --testmode option: move, annotation, or both
+ This allows some flexibility in handling differently annotated files
+- added --infile and --outfile options
+- wrote play_test to handle regression testing
+- wrote sgfgen, a program to translate SGF definitions into a header file
+- added Tommy Thorn's code for SGF parsing and implemented tree parsing
+- updated ASCII interface to rely on interface routines- it works!
+- updated interfaces to handle new 'pass' based on int returned from genmove
+- made genmove return boardsize, boardsize coordinates for pass
+- added interface specification and code-- we now have engine independence!
+- moved all SGF code into sgf directory
+
+2.1.23 released May 7, 1999
+
+- sgf debugging of reading code (from gdb only in this release)
+
+2.1.22 released May 6, 1999
+
+- renum target removed from pattern Makefile.am and Makefile.in
+- strategic_distance was being calculated incorrectly
+- revisions to pattern database
+- chainlinks now tabulates the size of adjacent worms in preparation
+ to trying to sorting them when stackp19, else [] (by SGF standard)
+- changed 'pass' moves to send board_size, board_size to sgf routines
+
+2.1.18 released May 3, 1999
+
+- play_ascii: playblack and playwhite are recognized as valid commands.
+- play_ascii: Correct use of strtok on Solaris (missing strsep)
+- ascii display and showboard now work as stated in the help command
+- ascii display doesn't draw the board twice if showboard is enabled.
+- ascii force was broken, is no longer.
+- added check for getopt.h to configure.in
+- fixed PLAY in play_ascii: need to check for two passes!
+- prettyfication in main.c: changed strcmp() usage
+- fixed seed printing in sgf.c
+- play_gmp: handicap was not being passed to sgf_write_game_info
+
+2.1.17 released May 2, 1999
+
+- added counting to ascii interface
+- Gunnar's reshuffled patterns
+- LDFLAGS = $(COLORLIB) in src/Makefile.am and src/Makefile.in
+
+2.1.16 released May 1, 1999
+
+- further revisions to ascii interface
+
+2.1.15 released May 1, 1999
+
+- further revisions to play_ascii and sgf.c
+- Gunnar's pattern classification in patterns.db
+- static evaluation of the board position
+
+2.1.13 released April 30, 1999
+
+- moved all sgf routines into sgf.c
+- changed pass value: from 19, 19 --> board_size, board_size
+- added sgf_open_file() sgf_close_file() and sgf_flush_file() to sgf.c
+- also added sgf_write_line() and sgf_write_game_info()
+- rewrote play_solo to use new sgf routines
+- absolutely no more build errors! (at least on Linux...)
+- renamed ascii.* play_ascii.*
+- moved play_gmp into play_gmp.c and added header file
+- added komi option (doesn't do anything yet, just parses it)
+
+2.1.12 released April 29, 1999
+
+- finished adding long options
+- color also works now (--handicap and --boardsize have been working)
+- needs a little cleanup with short options- some should become long
+- finished ASCII interface
+- can display any board size up to 25x25
+- has command line options and help
+- enhanced error messages
+- added 'switch' command to switch colors in the middle of play
+
+2.1.11 realeased April 29, 1999
+
+- Minor changes to the syntax of patterns.db and hey.db as a preparation
+ for restructuring of patterns.db. Documentation in PATTERNS updated.
+- moved ascii play code into ascii.c
+- copied showboard code for ascii play into ascii.c (ascii_showboard)
+- updated Makefile.am's to reflect changes
+- removed posix and error.c files from lib dir- not needed
+- added long option parsing; still need to add this to help menu
+- moved PATTERNS, DRAGON and OVERVIEW to /docs
+
+2.1.10 released April 28, 1999
+
+- incorporated more reorganizational patches
+
+2.1.9 released April 28, 1999
+
+- Automake-ized (NL)
+- Made code which moves dragon[m][n].borders contingent on !worm[m][n].ko
+- Set TRUST_GRID back to 1.
+
+--------------------------------------------------------------
+
+This is GNU Go, a Go program. Contact gnugo@gnu.org, or see
+http://www.gnu.org/software/gnugo/ for more information.
+
+Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+and 2008 by the Free Software Foundation.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation - version 3 or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License in file COPYING for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02111, USA.
diff --git a/gnugo/src/INSTALL b/gnugo/src/INSTALL
new file mode 100644
index 0000000000000000000000000000000000000000..d5f4c36eb31f4bbb7d4b7d6152cb0252a1e217d2
--- /dev/null
+++ b/gnugo/src/INSTALL
@@ -0,0 +1,146 @@
+ GNU GO INSTALLATION INSTRUCTIONS
+
+Get the most recent tar file from ftp.gnu.org or a mirror (see
+http://www.gnu.org/order/ftp.html for a list).
+
+Untar the sources, change to the directory gnugo-3.6. Now do:
+
+ ./configure [OPTIONS]
+ make
+
+Several configure options will be explained below. You do not need to set
+these unless you are dissatisfied with GNU Go's performance or wish to vary
+the experimental options.
+
+ As an example,
+
+ ./configure --enable-level=9 --enable-cosmic-gnugo
+
+will make a binary in which the default level is 9, and the experimental
+"cosmic"' option is enabled. A list of all configure options can be obtained
+by running `./configure --help'. Further information about the experimental
+options can be found in the next section.
+
+ After running configure and make, you have now made a binary called
+`interface/gnugo'. Now (running as root) type
+
+ make install
+
+to install gnugo in `/usr/local/bin'.
+
+ There are different methods of using GNU Go. You may run it from the
+command line by just typing:
+
+ gnugo
+
+but it is nicer to run it using CGoban 1 (under X Window System) or Jago (on
+any platform with a Java Runtime Environment).
+
+ You can get the most recent version of CGoban 1 from
+http://sourceforge.net/projects/cgoban1/. The earlier version
+1.12 is available from http://www.igoweb.org/~wms/comp/cgoban/index.html.
+The CGoban version number MUST be 1.9.1 at least or it won't work. CGoban 2
+will not work.
+
+ See the file README for instructions on how to run GNU Go from Cgoban, or
+for Jago.
+
+
+ RAM CACHE
+
+By default, GNU Go makes a cache of 8 Megabytes in RAM for its
+internal use. The cache is used to store intermediate results during
+its analysis of the position.
+
+Increasing the cache size will often give a modest speed improvement.
+If your system has lots of RAM, consider increasing the cache
+size. But if the cache is too large, swapping will occur,
+causing hard drive accesses and degrading performance. If
+your hard drive seems to be running excessively your cache
+may be too large. On GNU/Linux systems, you may detect swapping
+using the program 'top'. Use the 'f' command to toggle SWAP
+display.
+
+You may override the size of the default cache at compile time
+by running one of:
+
+ ./configure --enable-cache-size=n
+
+To set the cache size to n. For example
+
+ ./configure --enable-cache-size=48
+
+creates a cache of size 48. If you omit this, your default
+cache size will be 8. You must recompile and reinstall GNU Go
+after reconfiguring it by running make and make install.
+
+You may override the compile-time defaults by running gnugo with
+the option `--cache-size n', where n is the size (in megabytes) of
+the cache you want, and `--level n' where n is the level desired.
+We will discuss setting these parameters next in detail.
+
+ DEFAULT LEVEL
+
+GNU Go can play at different levels. Up to level 10 is
+supported. At level 10 GNU Go is much more accurate but takes
+an average of about 1.6 times longer to play than at level 8.
+
+The level can be set at run time using the --level option.
+If you don't set this, the default level will be used. You
+can set the default level with the configure option
+--enable-level=n. For example
+
+./configure --enable-level=9
+
+sets the default level to 9. If you omit this parameter,
+the compiler sets the default level to 10. We recommend
+using level 10 unless you find it too slow. If you decide
+you want to change the default you may rerun configure
+and recompile the program.
+
+ DFA
+
+GNU Go has two versions of the pattern matcher. The default
+version uses a Discrete Finite Automaton (DFA). It can be
+disabled, giving the old matcher (which was the default in
+GNU Go 3.0) with './configure --disable-dfa'.
+
+ EXPERIMENTAL OPTIONS
+
+--enable-experimental-semeai enables an experimental semeai
+module. This will result in an engine that is probably stronger
+but slightly slower and less debugged. It is not guaranteed
+that the semeai code could not cause crashes in some situations.
+
+--enable-owl-threats will result in an engine that does more
+life and death analysis. It will be stronger but slower.
+
+There are other experimental options but we only mention these.
+
+ WINDOWS
+
+Windows installation is described in a separate file, called WINDOWS.
+
+ MACINTOSH
+
+If you have Mac OS X you can build GNU Go using Apple's compiler,
+which is derived from GCC. We recommend adding the flag -no-cpp-precomp
+to CFLAGS.
+
+ THE MANUAL
+
+You can obtain a printed copy of the manual by running 'make
+gnugo.ps' in the doc/ directory, then printing the resulting
+postscript file @file{gnugo.ps}. The manual contains a great
+deal of information about the algorithms of GNU Go. The first
+few sections serve as a user's manual.
+
+On platforms supporting info documentation, you can usually
+install the manual by executing `make install' (running as
+root) from the doc/ directory. The info documentation can
+be read conveniently from within Emacs by executing the
+command `Control-h i'.
+
+
+
+
diff --git a/gnugo/src/Makefile.am b/gnugo/src/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..bf1641e49539da3e7cd364300b842b443041d2e2
--- /dev/null
+++ b/gnugo/src/Makefile.am
@@ -0,0 +1,64 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = utils sgf engine patterns interface doc regression
+
+DISTCLEANFILES = *~
+
+EXTRA_DIST = gnugo.dsw config.vc makevcdist.pl WINDOWS OSX CMakeLists.txt config.h.cmake stamp-h.in
+
+maintainer-check:
+
+# Tag before making distribution. Also, don't make a distribution if
+# checks fail. Also, make sure the NEWS file is up-to-date.
+cvs-dist: maintainer-check
+ pkg=`echo "@PACKAGE@" | tr a-z A-Z`; \
+ ver=`echo "@VERSION@" | sed 's/\./_/g'`; \
+ tag="$$pkg-$$ver"; \
+ echo tag=$$tag; \
+ if cvs -n log -h README| grep -e $$tag > /dev/null; then \
+ echo "VERSION not new; not releasing" 1>&2; \
+ exit 1; \
+ else :; \
+ fi; \
+ cvs tag -c $$tag
+ $(MAKE) dist
+
+dist-hook:
+ cd $(distdir) \
+ && find . '(' -name '*.rej' -o -name '*.orig' ')' -exec rm '{}' ';'
+
+vpathcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck
+ -rm -rf $(distdir)
+ @banner="Successful VPATH build for $(distdir).tar.gz"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+
+acdir = m4
+@MAINT@aclocal-files: configure.in
+@MAINT@ echo 'acfiles = \' > $@-tmp
+@MAINT@ find $(acdir) -type f -name '*.m4' -print \
+@MAINT@ | sed 's!^!$(top_srcdir)/!' \
+@MAINT@ | tr '\012' ' ' \
+@MAINT@ >> $@-tmp
+@MAINT@ echo >> $@-tmp
+@MAINT@ mv $@-tmp $@
+
+@MAINT@include aclocal-files
+
+@MAINT@# Override default rule to use --acdir option
+@MAINT@$(srcdir)/aclocal.m4: configure.in $(acfiles)
+@MAINT@ cd $(srcdir) && aclocal --acdir=$(acdir)
diff --git a/gnugo/src/Makefile.in b/gnugo/src/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..01561b61acc367a5855200ef5babd47648556cae
--- /dev/null
+++ b/gnugo/src/Makefile.in
@@ -0,0 +1,655 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/config.vcin $(top_srcdir)/configure AUTHORS COPYING \
+ ChangeLog INSTALL NEWS THANKS TODO depcomp install-sh missing \
+ mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = config.vc
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DFA_ENABLED_FALSE = @DFA_ENABLED_FALSE@
+DFA_ENABLED_TRUE = @DFA_ENABLED_TRUE@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_ONLY_FALSE = @GCC_ONLY_FALSE@
+GCC_ONLY_TRUE = @GCC_ONLY_TRUE@
+GNU_GO_WARNINGS = @GNU_GO_WARNINGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+glibconfig = @glibconfig@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = utils sgf engine patterns interface doc regression
+DISTCLEANFILES = *~
+EXTRA_DIST = gnugo.dsw config.vc makevcdist.pl WINDOWS OSX CMakeLists.txt config.h.cmake stamp-h.in
+acdir = m4
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+config.vc: $(top_builddir)/config.status $(srcdir)/config.vcin
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/.
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-generic clean-recursive ctags \
+ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-hdr distclean-recursive \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
+
+
+maintainer-check:
+
+# Tag before making distribution. Also, don't make a distribution if
+# checks fail. Also, make sure the NEWS file is up-to-date.
+cvs-dist: maintainer-check
+ pkg=`echo "@PACKAGE@" | tr a-z A-Z`; \
+ ver=`echo "@VERSION@" | sed 's/\./_/g'`; \
+ tag="$$pkg-$$ver"; \
+ echo tag=$$tag; \
+ if cvs -n log -h README| grep -e $$tag > /dev/null; then \
+ echo "VERSION not new; not releasing" 1>&2; \
+ exit 1; \
+ else :; \
+ fi; \
+ cvs tag -c $$tag
+ $(MAKE) dist
+
+dist-hook:
+ cd $(distdir) \
+ && find . '(' -name '*.rej' -o -name '*.orig' ')' -exec rm '{}' ';'
+
+vpathcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck
+ -rm -rf $(distdir)
+ @banner="Successful VPATH build for $(distdir).tar.gz"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+@MAINT@aclocal-files: configure.in
+@MAINT@ echo 'acfiles = \' > $@-tmp
+@MAINT@ find $(acdir) -type f -name '*.m4' -print \
+@MAINT@ | sed 's!^!$(top_srcdir)/!' \
+@MAINT@ | tr '\012' ' ' \
+@MAINT@ >> $@-tmp
+@MAINT@ echo >> $@-tmp
+@MAINT@ mv $@-tmp $@
+
+@MAINT@include aclocal-files
+
+@MAINT@# Override default rule to use --acdir option
+@MAINT@$(srcdir)/aclocal.m4: configure.in $(acfiles)
+@MAINT@ cd $(srcdir) && aclocal --acdir=$(acdir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnugo/src/NEWS b/gnugo/src/NEWS
new file mode 100644
index 0000000000000000000000000000000000000000..b6cbf3c69f1109478cc8cfb9fa4bcd82f4e984eb
--- /dev/null
+++ b/gnugo/src/NEWS
@@ -0,0 +1,92 @@
+New in 3.8 (since 3.6)
+
+- many small improvements and tuning since 3.6
+- experimental Monte Carlo mode (9x9 only)
+- support for tiny boards
+- GPL v3
+
+New in 3.6 (since 3.4)
+
+- stronger than 3.4
+- many small improvements
+- GNU Go can now resign games
+- emacs mode can display the board graphically using xpms
+- basic knowledge of how to break out of mirror go
+
+New in 3.4 (since 3.2)
+
+- stronger than 3.2
+- new connection and semeai modules use lookahead
+- new break-in code
+- improvements to many parts of the program
+
+New in 3.2 (since 3.0)
+
+- stronger than 3.0
+- uses less RAM than 3.0
+- 1-dimensional board
+- experimental dynamic connection analysis
+- experimental reading semeai module
+- new influence function
+- stronger and more agressive
+- reads to find combinations
+- revised Zobrist hashing
+- new html views of the regressions, and many more tests
+
+New in 3.0 (since 2.6)
+
+- stronger than 2.6
+- new move generation scheme
+- new influence function
+- more accurate reading
+- board information maintained incrementally during reading
+- new "owl" and "life" modules for accurate life and death analysis
+- persistent caching of reading and owl results for speed
+- revised semeai module
+- experimental Deterministic Finite State Automaton (DFA) pattern matcher
+- new debugging tools
+- level option
+
+New in 2.6 (since 2.4)
+
+- stronger than 2.4
+- more portable code
+- Texinfo documentation
+- Emacs mode
+
+New in 2.4 (since 2.0)
+
+Enhancements for the user:
+
+- stronger: able to give GNU Go 2.0 a 5 stone handicap
+ - life and death evaluation drastically improved
+ - more efficient and accurate reading
+ - (small) joseki database
+ - takes influence and territory into account
+- Ascii interface as an alternative to CGoban
+- uses GNU configure
+- undo supported
+- man page
+
+Enhancements for the developer:
+
+- expanded pattern database
+- autohelpers for patterns
+- joseki library in Smart Go Format
+- fuseki module
+- backfilling and numerous other improvements to reading code
+- algorithms for estimating territory and influence
+- eye_finder module uses a static algorithm for life and death
+- eyeshape database
+- connection database
+- reading code uses Zobrist hashing and other speedups
+- greater modularity
+- documentation of key algorithms
+- expanded support for Smart Go Format
+- various debugging tools
+
+
+
+
+
+
diff --git a/gnugo/src/OSX b/gnugo/src/OSX
new file mode 100644
index 0000000000000000000000000000000000000000..60d0251e3080bf10fbef8e35c5f4f0662bb99e63
--- /dev/null
+++ b/gnugo/src/OSX
@@ -0,0 +1,9 @@
+If you have Mac OS X you can build GNU Go using Apple's compiler, which
+is derived from GCC. You will need Xcode.
+
+ One issue is that the configure test for socket support is too
+conservative. On OS/X, the configure test fails, but actually socket
+support exists. So if you want to be able to connect to the engine
+through tcp/ip (using gtp) you may `configure --enable-socket-support'.
+There will be an error message but you may build the engine and socket
+support should work.
diff --git a/gnugo/src/README b/gnugo/src/README
new file mode 100644
index 0000000000000000000000000000000000000000..46cad14e052f365e0e9ae79c4c5dfcee84a361ce
--- /dev/null
+++ b/gnugo/src/README
@@ -0,0 +1,244 @@
+ GNU Go
+
+This is GNU Go, a Go program. Development versions of GNU Go may be
+found at http://www.gnu.org/software/gnugo/devel.html. Consult TODO if
+you are interested in helping.
+
+
+ Installation
+
+In short, './configure; make' will build GNU Go; optionally (running
+as root) 'make install' will put it into /usr/local/bin and also
+install the man page. You also will probably want to install CGoban.
+See INSTALL for details.
+
+
+ Documentation
+
+User documentation can be obtained by running 'gnugo --help' or 'man
+gnugo' from any terminal.
+
+Texinfo documentation includes instructions for users as well as
+documentation of GNU Go's algorithms and functions for programmers and
+developers. Use an info reader or emacs to read the info files, or run
+`make gnugo.dvi' or `make gnugo.ps' in the doc/ directory to get
+printed documentation. You can also make html documentation from the
+Texinfo files. One method of making html documentation is to run the
+command 'makeinfo --html gnugo.texi' in the doc/ directory.
+
+
+
+Contact us at gnugo@gnu.org if you are interested in helping to
+develop this program.
+
+
+ Running GNU Go via CGoban
+
+This is an extremely nice way to run GNU Go. CGoban provides a
+beautiful graphic user interface under X Window System.
+
+Start CGoban. When the CGoban Control panel comes up, select ``Go
+Modem''. You will get the Go Modem Protocol Setup. Choose one (or
+both) of the players to be ``Program,'' and fill out the box with the
+path to gnugo. After clicking OK, you get the Game Setup window.
+Choose ``Rules Set'' to be Japanese (otherwise handicaps won't work).
+Set the board size and handicap if you want. Click OK and you are
+ready to go.
+
+In the Go Modem Protocol Setup window, when you specify the path to
+GNU Go, you can give it command line options, such as --quiet to
+suppress most messages. Since the Go Modem Protocol preempts standard
+I/O other messages are sent to stderr, even if they are not error
+messages. These will appear in the terminal from which you started
+CGoban.
+
+If you want to play with a komi, you should bear in mind that
+the GMP does not have any provision for communicating the komi.
+Because of this misfeature, unless you set the komi at the command
+line GNU Go will have to guess it. It assumes the komi is 5.5 for
+even games, 0.5 for handicap games. If this is not what you want,
+you can specify the komi at the command line with the --komi
+option, in the Go Modem Protocol Setup window. You have to set
+the komi again in the Game Setup window, which comes up next.
+
+Click OK and you are ready to go.
+
+Other command line options can be listed by typing 'gnugo --help'
+-or- 'man gnugo' from any terminal, or by consulting the Texinfo
+documentation.
+
+
+ Ascii Interface
+
+Even if you do not have CGoban installed you can play with GNU Go
+using its default Ascii interface. Simply type `gnugo' at the command
+line, and GNU Go will draw a board. Typing `help' will give a list of
+options. At the end of the game, pass twice, and GNU Go will prompt you
+through the counting. You and GNU Go must agree on the dead groups--you
+can toggle the status of groups to be removed, and when you are done,
+GNU Go will report the score.
+
+
+ GNU Go mode in Emacs
+
+ You can run GNU Go from Emacs. This has the advantage that you place
+the stones using the cursor arrow keys. This requires Emacs 20.4 or
+later. (Tested with Emacs 20.4. Does not work with 20.2.)
+
+ Load `interface/gnugo.el', either by `M-x load-file', or by adding a
+line
+
+ (autoload 'gnugo "gnugo" "GNU Go" t)
+
+in your `.emacs' file. Now you may start GNU Go by `M-x gnugo'. You
+will be prompted for command line options *note Invoking GNU Go::.
+Using these, you may set the handicap, board size, color and komi.
+
+ You can enter commands from the GNU Go ASCII interface after
+typing `:'. For example, to take a move back, type `:back', or
+to list all commands, type `:help'.
+
+ Here are the default keybindings:
+
+ * `Return' or `Space'
+ Select point as the next move. An error is signalled for
+ invalid locations. Illegal locations, on the other hand,
+ show up in the GNU Go Console buffer.
+
+ * `q' or `Q'
+ Quit. Both Board and Console buffers are deleted.
+
+ * `R'
+ Resign.
+
+ * `C-l'
+ Refresh. Includes restoring default window configuration.
+
+ * `M-_'
+ Bury both Board and Console buffers (when the boss is near).
+
+ * `p'
+ Pass; i.e., select no location for your move.
+
+ * `:'
+ Extended command. Type in a string to be passed directly to
+ the inferior GNU Go process."
+
+
+
+ Running GNU Go via Jago
+
+Jago, like CGoban is a client capable of providing GNU Go with a
+graphical user interface. Unlike CGoban, it does not require
+X Window System, so it is an attractive alternative under Windows.
+You will need a Java Runtime Environment. Obtain Jago at
+http://www.rene-grothmann.de/jago and follow the links there for the
+Java Runtime Environment.
+
+
+ Go Modem Protocol
+
+The Go Modem Protocol was developed by Bruce Wilcox with input from
+David Fotland, Anders Kierulf and others, according to the history in
+ftp://www.joy.ne.jp/welcome/igs/Go/programs/protocol.Z . Any Go
+program *should* use this protocol since it is standard. Since CGoban
+supports this protocol, the user interface for any Go program can be
+done entirely through CGoban. The programmer can concentrate on the
+real issues without worrying about drawing stones, resizing the board
+and other distracting issues.
+
+
+ Options
+
+A few options are described here. A more complete list
+may be found in the Texinfo documentation, or by running
+gnugo --help.
+
+* `--help', `-h'.
+ Print a help message describing the options. This will also
+ tell you the defaults of various parameters, most importantly
+ the level and cache size. The default values of these
+ parameters can be set before compiling by `configure'. If
+ you forget the defaults you can find out using `--help'.
+
+* `--level LEVEL'
+ GNU Go can play with different strengths and speeds. Level 10
+ is the default. Decreasing the level will make GNU Go faster
+ but less accurate in its reading.
+
+* `--quiet', `--silent'
+ Don't print copyright and other messages. Messages
+ specifically requested by other command line options, such as
+ `--trace', are not supressed.
+
+* `-l', `--infile FILENAME'
+ Load the named SGF file
+
+* `-L', `--until MOVE'
+ Stop loading just before the indicated move is played. MOVE
+ can be either the move number or location.
+
+* `-o', `--outfile FILENAME'
+ Write sgf output to file
+
+* `--mode MODE'
+ Force the playing mode ('ascii', 'gmp' or 'gtp'). The
+ default is ASCII, but if no terminal is detected GMP (Go
+ Modem Protocol) will be assumed. In practice this is usually
+ what you want, so you may never need this option.
+
+
+* `-M', `--cache-size MEGS'
+ Memory in megabytes used for hashing. The default size is 8
+ unless you configure gnugo with the command `configure
+ --enable-cache-size=SIZE' before compiling to make SIZE
+ the default.
+
+
+* `--chinese-rules'
+ Use Chinese counting.
+
+
+* `--japanese-rules'
+ Use Japanese Rules. This is the default unless you specify
+ `--enable-chinese-rules' as a configure option.
+
+* `--copyright': Display the copyright notice
+
+* `--version' or `-v': Print the version number
+
+* `--printsgf FILENAME': Create an SGF file containing a diagram of
+ the board. Useful with `-L' to create diagrams from games.
+
+
+
+
+ Copyrights and License
+
+All files Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+2007, 2008 and 2009 by the Free Software Foundation except as noted below.
+
+All files are under the GNU General Public License, which may be
+found in the file COPYING, with the following exceptions.
+
+* The files interface/gtp.c and gtp.h are copyright 2001 by
+ the Free Software Foundation. In the interests of promoting
+ the Go Text Protocol these two files are licensed under a less
+ restrictive license than the GPL and are free for unrestricted use.
+ The GTP license appears in each file.
+
+* The files gmp.c and gmp.h are copyright Bill Shubert. These
+ are free for unrestricted use.
+
+* The files regression/golois/* and the tests vie.tst, connect.tst,
+ capture.tst and global.tst are copyright Tristan Cazenave and are
+ used with his permission
+
+* The SGF files in regression/games/handtalk are copyright Jessie Annala
+ and are used with permission.
+
+* The SGF files in regression/games/mertin13x13 are copyright Stefan
+ Mertin and are used with permission.
+
+* The remaining SGF files are either copyright by the FSF or are in
+ the public domain.
diff --git a/gnugo/src/THANKS b/gnugo/src/THANKS
new file mode 100644
index 0000000000000000000000000000000000000000..cabb4897eb0f59d3202a61fcacb604e80bd24770
--- /dev/null
+++ b/gnugo/src/THANKS
@@ -0,0 +1,33 @@
+ Acknowledgements
+
+We would like to thank Arthur Britto, David Doshay, Tim Hunt, Matthias Krings,
+Piotr Lakomy, Paul Leonard, Jean-Louis Martineau, Andreas Roever, Pierce
+Wetter, Joseph Piche, and Emanuele Cisbani for helpful correspondence.
+
+Thanks to everyone who stepped on a bug (and sent us a report)!
+
+Thanks to Gary Boos, Wietze Brandsma, Peter Gucwa, Martijn van der Kooij, Michael
+Margolis, Trevor Morris, Mans Ullerstam, Don Wagner, Yin Zheng for help
+with Visual C++.
+
+Thanks to Allan Crossman, Pierce Wetter, Stephan Somogyi and Mathias Wagner
+for help with Macintosh. And thanks to Marco Scheurer and Shigeru Mabuchi for
+helping us find various problems.
+
+Thanks to Jessie Annala for the Handtalk games, and to Stefan
+Mertin for the games from his 13x13 tournament.
+
+Thanks to Ricard Vilà for creating the STS-RV semeai regression test
+suite and to Emanuele Cisbani for helping to port it to GNU Go.
+
+Special thanks to Ebba Berggren for creating our logos, logo-34 and
+logo-36. Logo-34 is based on a design by Tanguy Urvoy and comments
+by Alan Crossman. The old GNU Go logo32 was adapted from Jamal
+Hannah's typing GNU: http://www.gnu.org/graphics/atypinggnu.html.
+
+We would like to thank Stuart Cracraft, Richard Stallman and Man Lung Li for
+their interest in making this program a part of GNU, William Shubert for
+writing CGoban and gmp.c, Rene Grothmann for Jago and Erik van Riper and his
+collaborators for NNGS.
+
+
diff --git a/gnugo/src/TODO b/gnugo/src/TODO
new file mode 100644
index 0000000000000000000000000000000000000000..99cdbbd812ac95a35b1eef270fe8dc930afabbfd
--- /dev/null
+++ b/gnugo/src/TODO
@@ -0,0 +1,207 @@
+ GNU Go Task List
+
+You can help make GNU Go the best Go program.
+
+This is a task-list for anyone who is interested in helping with GNU
+Go. If you want to work on such a project you should correspond with
+us until we reach a common vision of how the feature will work!
+
+A note about copyright. Before any code can be accepted as a part of
+the official release of GNU Go, the Free Software Foundation will want
+you to sign a copyright disclaimer. Of course you can work on a forked
+version without signing such a disclaimer. If you want your changes to
+the program to be incorporated into the version we distribute we need
+such a disclaimer. Please contact the GNU Go maintainers, Daniel Bump
+(bump@sporadic.stanford.edu) and Gunnar Farneback
+(gunnar@lysator.liu.se), to get more information and the papers to
+sign.
+
+Below is a list of things YOU could work on. We are already working on
+some of these tasks, but don't let that stop you. Please contact us or
+the person assigned to task for further discussion.
+
+//--------------------------------------------------------------
+// General
+//--------------------------------------------------------------
+
+ * If you can, send us bug FIXES as well as bug reports. If you see
+ some bad behavior, figure out what causes it, and what to do about
+ fixing it. And send us a patch! If you find an interesting bug and
+ cannot tell us how to fix it, we would be happy to have you tell us
+ about it anyway. Send us the sgf file (if possible) and attach
+ other relevant information, such as the GNU Go version number. In
+ cases of assertion failures and segmentation faults we probably
+ want to know what operating system and compiler you were using, in
+ order to determine if the problem is platform dependent.
+
+//--------------------------------------------------------------
+// smaller projects
+//--------------------------------------------------------------
+
+These issues are of tactical nature, i.e. they concern some specific
+feature or the infrastructure of the engine. Some of these are quiet
+small, maybe doable in a day for an experienced GNU Go programmer.
+They might also be useful project to start with for a new project
+member. Some of them are bigger and demand a deeper knowledge of the
+engine internals. The issues are presented here in an approximate
+order of perceived difficulty.
+
+ * Add more checks in patterns/mkpat.c testing whether the main diagram and
+ the constraint diagram are consistent.
+
+ * Break out handling of movelists into its own file and generalize it.
+ This is started in 3.1.16. Move lists are used, among other places,
+ in worms.c where it is used to store moves that capture, save,
+ threaten to capture and threaten to save the worm.
+
+ * Implement move lists storing important moves for dragons and eyes
+ in the same way as it is used for worms. Half eyes are already
+ halfway done. The moves are stored, but not the attack and defend
+ codes (LOSE, KO_A, KO_B and WIN).
+
+ * Make the cache not waste storage on 64 bit systems.
+
+ * The dragon data is split into two arrays, dragon[] and dragon2[].
+ The dragon2 array only have one entry per dragon, in contrast to
+ the dragon array where all the data is stored once for every
+ intersection of the board. Complete the conversion of eye_data,
+ half_eye_data, worm and dragon to use the same structure as the
+ dragon2 array.
+
+ * Support for ko in eyes.db and optics.c.
+
+ * Integrate the time handling code in play_gtp.c with the autolevel
+ code in clock.c. Alternatively, replace them both with something
+ better. Basing it on some solid system identification theory and/or
+ control theory wouldn't hurt.
+
+ * Write a script which plays through the joseki databases and checks
+ that the engine really generates a joseki move for all positions in
+ the databases. This would also be interesting to run with the
+ --nojosekidb option.
+
+
+//--------------------------------------------------------------
+// long term issues
+//--------------------------------------------------------------
+
+
+These issues are strategic in nature. They will help us to improve the
+playing strength of the program and/or enhance certain aspects of it.
+
+ * Extend the regression test suites.
+ See the texinfo manual in the doc directory for a description of
+ how to do this. In particular it would be useful with test suites
+ for common life and death problems. Currently second line groups, L
+ groups and the tripod shape are reasonably well covered, but there
+ is for example almost nothing on comb formations, carpenter's
+ square, and so on. Other areas where test suites would be most
+ welcome are fuseki, tesuji, and endgame.
+
+ * Tuning the pattern databases. These are under constant revision. Tuning
+ them is a sort of art. It is not necessary to do any programming to do
+ this since most of the patterns do not require helpers. We would like it if
+ a few more Dan level players would learn this skill.
+
+ * Extend and tune the Joseki database. It might be very useful to implement
+ a semi-automatic way of doing this. The current method based on sgf files
+ becomes difficult with existing tools.
+
+ * The semeai module is still in need of improvement. (This is underway.)
+
+ * GNU Go does not have a move generator that tries explicitly to build
+ moyos, or reduce/invade opponent's moyos. Such a move generator could
+ be built using the same type of code that is used in the owl life and
+ death reader, or the connection reader mentioned in point 5 above.
+
+ * A much improved combination module. The combination module of
+ today only finds combinations of threats to capture enemy groups.
+ A more useful combination module would e.g. find combinations of
+ threats to capture a group or enter opponent territory. It would
+ also be strong enough to find combinations of strategic moves and
+ more indirect threats (a threat to a threat). Possibly it could
+ combine threats in AND-OR trees (DAGs?) that could be searched
+ using ordinary tree search algorithms. (Revision of combination.c
+ is underway.)
+
+ * Speed up the tactical reading. GNU Go is reasonably accurate when
+ it comes to tactical reading, but not always very fast. The main
+ problem is that too many ineffective moves are tested, leading to
+ strange variations that shouldn't need consideration. To improve
+ one could refine the move generation heuristics in the reading.
+ Also, one should implement some more of the standard tree search
+ optimizations used in alpha-beta readers.
+
+ * Improve the heuristics for assessment of the safety of a
+ group. This might take into account number of eyes / half eyes,
+ moyo in corners, moyo along the edge, moyo in the center, proximity
+ to living friendly groups, weak opponent groups etc. It is of
+ particular interest to be able to accurately determine how a move
+ affects the safety of all groups on the board.
+
+
+//--------------------------------------------------------------
+// Ideas
+//--------------------------------------------------------------
+
+
+These are some ideas that have been floated on the mailing list. Some
+of them are down-to-earth, and some are just blue sky ramblings. They
+are presented here for inspiration.
+
+ * A good GUI.
+ A start is being made with GoThic, a goban widget based on the Qt
+ toolkit. This is linked from the GNU Go development web page on
+ gnu.org. Other starts have been made based on GTK+, but so far
+ nothing more than a start has been attempted.
+
+ * A graphical pattern editor.
+ This would make it much easier for non-programmers to improve the
+ strength of GNU Go. It could also be used as a debugging tool for
+ the programmers. This project has the GUI as a prerequisite.
+ The challenge here is not to make a tool which makes it easier to
+ create patterns but to make it easier to overview and maintain the
+ database.
+
+ * Make the engine thread safe and use multiple CPUs on an SMP
+ machine.
+
+ * Making the engine use many machines loosely connected on the
+ internet or in a cluster.
+
+ * Think on the opponent's time.
+
+ * A global alpha-beta reader. This would probably be very slow and
+ could only read 2 or 3 moves ahead. Still it could find fatal
+ errors and improve the moves that GNU Go makes.
+
+ * A strategic module that identifies high-level goals and then gives
+ these goals to the rest of the engine. It should be able to
+ identify if we are ahead in territory or thickness, if we should
+ play safe or if we should play daringly (e.g. if behind). It
+ should also identify weak areas where we can attack or where we
+ should defend. Maybe this module doesn't have to be written in C.
+ Maybe PROLOG, LISP or some other AI language would be better.
+
+ * A parameter that makes GNU Go play different styles. Such styles
+ could be 'play for territory', 'play aggressively', 'play tricky
+ moves (hamete)', and so on. It could be used to present human
+ users with different kinds of opponents or to tell GNU Go how to
+ play certain computer opponents in tournaments.
+
+ * Generalize representation and handling of threats so that we have a
+ graph representation of threats that can be searched to see how
+ different threats interact.
+
+ * An endgame module based on ideas from combinatorial game theory.
+ To be really useful this would have to deal with early endgame
+ positions.
+
+ * Fuseki tuning by hand is difficult. People who are interested
+ in doing machine learning experiments with GNU Go could try
+ working with fuseki. This may be one of the areas with most
+ potential for substantial and reasonably quick improvements.
+
+ * Create a paradigm for handling other types of ko (approach move ko,
+ multi-step ko, etc) and then write code that handles them.
+
diff --git a/gnugo/src/WINDOWS b/gnugo/src/WINDOWS
new file mode 100644
index 0000000000000000000000000000000000000000..0432d59ab9497f003abfeb3fde6dc112c3a5e865
--- /dev/null
+++ b/gnugo/src/WINDOWS
@@ -0,0 +1,183 @@
+ Building GNU Go on Windows Platforms
+
+==========================
+
+
+ BUILDING WITH OLDER VISUAL STUDIO
+
+The distribution directories contain some .dsp and .dsw files with
+GNU Go. These have been brought up to date in the sense that they
+should work if you have the older VC++ with Visual Studio 6
+but the distributed .dsp and .dsw files will only be of use with
+older version of Visual Studio.
+
+In most cases (unless you are building in Cygwin) the preferred way
+to build GNU Go on Windows platforms is to use CMake. CMake
+understands about many versions of Visual C/Visual Studio, and will
+generate project/solution files for the tools installed on your
+system. So even if you have Visual Studio 6 you may use CMake
+and dispense with the distributed .dsp and .dsw files.
+
+==========================
+
+ BUILDING WITH VISUAL STUDIO PROJECT FILES
+
+Before you compile the GNU Go source, you need to run CMake first, to
+generate the build files you'll give to Visual Studio.
+
+From the cmd.exe command prompt, CD into the GNU Go source directory.
+To confirm you're in the right place, you should see the file
+'CMakeLists.txt' in the top-level directory of the GNU Go code (as well
+as others in lower subdirectories).
+
+Direct CMake to generate the new Visual Studio build files by typing:
+
+ cmake CMakeLists.txt
+
+Compile the code by invoking the newly-created Solution file:
+
+ vcbuild GNUGo.sln
+
+This will take a few moments, as CMake generates 4 debug/retail targets:
+
+ debug
+ release
+ minsizerel
+ relwithdebinfo
+
+For each of these targets, Visual Studio is generating a version of
+gnugo.exe:
+
+ interface\debug\gnugo.exe
+ interface\release\gnugo.exe
+ interface\minsizerel\gnugo.exe
+ interface\relwithdebinfo\gnugo.exe
+
+Additionally, there is an 'Install' target available, that will copy the
+the gnugo.exe into the %ProgramFiles% directory. To do this, type:
+
+ vcbuild INSTALL.vcproj
+
+This should result in copying GNU/Go into:
+
+ "%ProgramFiles%\GNUGo\bin\gnugo.exe" --options
+
+In addition to command line use, CMake also has a GUI version. Users of
+the Visual Studio GUI might prefer to use that.
+
+==========================
+
+ BUILDING WITH NMAKE MAKEFILES
+
+GNU Go will also build using NMake makefiles. Optionally, instead of
+Visual Studio project/solution files, you may direct CMake to generate
+NMake makefiles. To generate the makefiles:
+
+ cmake -G "NMake Makefiles" CMakeLists.txt
+
+The default rule for the makefile is 'all'. Use the 'help' rule to show
+a list of available targets.
+
+ nmake -f Makefile help
+
+To compile GNU Go:
+
+ nmake -f Makefile all
+
+On some systems, GNU GO may fail to build when using NMake makefiles. It
+only fails the first time run, run NMake again with the 'clean all'
+targets, and it will compile the second and subsequent times.
+
+ nmake -f Makefile clean all
+
+Which will successfully generate a gnugo.exe.
+
+ interface\gnugo.exe --options
+
+==========================
+
+ BUILDING WITH MINGW MAKEFILES:
+
+GNU Go can be built on Windows systems using MinGW.
+
+This development environment uses: the GCC compiler (gcc.exe, not
+cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
+Make build tool (mingw32-make.exe, not NMake), all from the Windows
+shell (cmd.exe, not sh/bash).
+
+For CMake to work, in addition to the base MinGW installation, the C++
+compiler (g++.exe) and GNU Make (mingw32-make.exe) need to be installed.
+This was tested using GCC v3, not the experimental v4. To debug, use
+GDB, as the GCC-generated symbols won't work with NTSD/Windbg/Visual Studio.
+
+To create the makfiles, run CMake with the MinGW generator option:
+
+ cmake -G "MinGW Makefiles" CMakeLists.txt
+
+To build GNU Go, from a cmd.exe shell, run GNU Make (against the
+newly-created 'Makefile' and it's default 'all' target):
+
+ mingw32-make
+ ..\interface\gnugo.exe --options
+
+==========================
+
+ BUILDING WITH MSYS MAKEFILES (MinGW)
+
+GNU Go can be built on Windows systems using MSYS.
+
+This development environment uses: the GCC compiler (gcc.exe, not
+cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
+Make build tool (make, not NMake), all from the GNU Bash (sh.exe, not
+cmd.exe).
+
+To create the makfiles, run CMake with the MSYS generator option:
+
+ cmake -G "MSYS Makefiles" CMakeLists.txt
+
+Start MSYS's Bash shell, either clicking on a shortcut on from the
+command line:
+
+ cd /d c:\msys\1.0
+ msys.bat
+
+To build GNU Go, from a Bash shell, run GNU Make (against the
+newly-created 'Makefile' and it's default 'all' target):
+
+ make
+ ../interface/gnugo.exe --options
+
+To debug, use GDB, as the GCC-generated symbols won't work with
+NTSD/Windbg/Visual Studio.
+
+==========================
+
+ BUILDING ON CYGWIN
+
+With Cygwin, you should be able to
+
+ tar zxvf gnugo-3.8.tar.gz
+ cd gnugo-3.8
+ env CC='gcc -mno-cygwin' ./configure
+ make
+
+==========================
+
+Testing on Windows:
+
+Regress.cmd is a simplified cmd.exe-centric port of the main gnugo Unix
+shell script regress.sh. It can be used to help verify that the
+generated binary might be operational. Read the script's comment header
+for more information. For access to the full GNU Go tests, use Unix, not
+Windows.
+
+To test:
+
+ cd regression
+ regress.cmd ..\interface\gnugo.exe
+
+==========================
+
+
+
+
diff --git a/gnugo/src/aclocal.m4 b/gnugo/src/aclocal.m4
new file mode 100644
index 0000000000000000000000000000000000000000..b7a0e851eea4a35d07fcda51decd9b2b963da70f
--- /dev/null
+++ b/gnugo/src/aclocal.m4
@@ -0,0 +1,891 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/gnugo/src/config.h b/gnugo/src/config.h
new file mode 100644
index 0000000000000000000000000000000000000000..17de8ac50d117723ce9a663a514d569176ca7961
--- /dev/null
+++ b/gnugo/src/config.h
@@ -0,0 +1,168 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Connection module. Default standard. */
+#define ALTERNATE_CONNECTIONS 1
+
+/* Define to use ansi escape sequences for color debugging */
+/* #undef ANSI_COLOR */
+
+/* Ruleset. Default Japanese */
+#define CHINESE_RULES 0
+
+/* Center oriented influence. Disabled by default. */
+#define COSMIC_GNUGO 0
+
+/* Default level (strength). Up to 10 supported */
+#define DEFAULT_LEVEL 10
+
+/* Default hash table size in megabytes */
+#define DEFAULT_MEMORY -1
+
+/* Compile support for GTP communication over TCP/IP channel. */
+#define ENABLE_SOCKET_SUPPORT 0
+
+/* Connection module. Default experimental. */
+#define EXPERIMENTAL_CONNECTIONS 1
+
+/* GAIN/LOSS codes. Disabled by default. */
+#define EXPERIMENTAL_OWL_EXT 0
+
+/* The concatenation of the strings "GNU ", and PACKAGE. */
+#define GNU_PACKAGE "GNU gnugo"
+
+/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode
+ */
+#define GRID_OPT 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_CURSES_H 0
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_GLIB_H */
+
+/* Define to 1 if you have the `g_vsnprintf' function. */
+/* #undef HAVE_G_VSNPRINTF */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_NCURSES_CURSES_H */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_NCURSES_TERM_H */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TIMES_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_TERM_H 0
+
+/* Define to 1 if you have the `times' function. */
+#define HAVE_TIMES 1
+
+/* Define if your compiler supports transparent unions */
+/* #undef HAVE_TRANSPARENT_UNIONS */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `usleep' function. */
+#define HAVE_USLEEP 1
+
+/* Define if #define can take a variable number of arguments */
+#define HAVE_VARIADIC_DEFINE 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Large Scale Captures. Disabled by default. */
+#define LARGE_SCALE 0
+
+/* Oracle. Default not enabled. */
+#define ORACLE 0
+
+/* Owl Node Limit */
+#define OWL_NODE_LIMIT 1000
+
+/* Owl Threats. 0 standard. */
+#define OWL_THREATS 0
+
+/* Name of package */
+#define PACKAGE "gnugo"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "gnugo"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "gnugo 3.8"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gnugo"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "3.8"
+
+/* Enable GNU Readline support */
+#define READLINE 0
+
+/* Allow resignation. Default enabled */
+#define RESIGNATION_ALLOWED 1
+
+/* Semeai Variations. 500 default */
+#define SEMEAI_NODE_LIMIT 500
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if termcap/terminfo is available. */
+/* #define TERMINFO 0 */
+
+/* Define to 1 if you can safely include both and . */
+#define TIME_WITH_SYS_TIME 1
+
+/* Break-in module. Enabled by default. */
+#define USE_BREAK_IN 1
+
+/* Define special valgrind macros. */
+#define USE_VALGRIND 0
+
+/* Version number of package */
+#define VERSION "3.8"
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
diff --git a/gnugo/src/config.h.cmake b/gnugo/src/config.h.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..c6a4e06f059ad66294e14a07ef5bf2bf3bfddeb4
--- /dev/null
+++ b/gnugo/src/config.h.cmake
@@ -0,0 +1,131 @@
+/* Ruleset. Default Japanese */
+#define CHINESE_RULES 0
+
+/* Allow resignation. Default enabled */
+#define RESIGNATION_ALLOWED 1
+
+/* Default level (strength). Up to 10 supported */
+#define DEFAULT_LEVEL 10
+
+/* Center oriented influence. Disabled by default. */
+#define COSMIC_GNUGO 0
+
+/* Owl Node Limit. 1000 default. */
+#define OWL_NODE_LIMIT 1000
+
+/* Semeai Variations. 500 default */
+#define SEMEAI_NODE_LIMIT 500
+
+/* Default hash table size in megabytes */
+#define DEFAULT_MEMORY -1
+
+/* Compile support for GTP communication over TCP/IP channel. */
+#undef ENABLE_SOCKET_SUPPORT
+
+/* GAIN/LOSS codes. Disabled by default. */
+#define EXPERIMENTAL_OWL_EXT 0
+
+/* Large Scale Captures. Disabled by default. */
+#define LARGE_SCALE 0
+
+/* Oracle. Default not enabled. */
+#define ORACLE 0
+
+/* Owl Threats. 0 standard. */
+#define OWL_THREATS 0
+
+/* Break-in module. Enabled by default. */
+#define USE_BREAK_IN 1
+
+/* Connection module. Default experimental. */
+#define EXPERIMENTAL_CONNECTIONS 1
+
+/* Connection module. Default standard. */
+#define ALTERNATE_CONNECTIONS 1
+
+/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode
+ */
+#define GRID_OPT 1
+
+/* Define to use ansi escape sequences for color debugging */
+#undef ANSI_COLOR
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_CURSES_H 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_GLIB_H 1
+
+/* Define to 1 if you have the `g_vsnprintf' function. */
+#cmakedefine HAVE_G_VSNPRINTF 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_NCURSES_CURSES_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_NCURSES_TERM_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_SYS_TIMES_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_TERM_H 1
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_CRTDBG_H 1
+
+/* Define to 1 if you have the and header files. */
+#cmakedefine HAVE_WINSOCK_IO_H 1
+
+/* Define to 1 if you have the `times' function. */
+#cmakedefine HAVE_TIMES 1
+
+/* Define if your compiler supports transparent unions */
+#undef HAVE_TRANSPARENT_UNIONS
+
+/* Define to 1 if you have the header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `usleep' function. */
+#cmakedefine HAVE_USLEEP 1
+
+/* Define if #define can take a variable number of arguments */
+#undef HAVE_VARIADIC_DEFINE
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#cmakedefine HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `_vsnprintf' function. */
+#cmakedefine HAVE__VSNPRINTF 1
+
+/* Enable GNU Readline support */
+#undef READLINE
+
+/* The size of a `long', as computed by sizeof. */
+#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
+
+/* Define to 1 if termcap/terminfo is available. */
+#undef TERMINFO
+
+/* Define to 1 if you can safely include both and . */
+#cmakedefine TIME_WITH_SYS_TIME 1
+
+/* Define special valgrind macros. */
+#undef USE_VALGRIND
+
+/* Version number of package */
+#define VERSION "3.8"
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+${PRAGMAS}
diff --git a/gnugo/src/config.h.in b/gnugo/src/config.h.in
new file mode 100644
index 0000000000000000000000000000000000000000..caca852fc40aed8ffce76d3b96c094b7ffcbd03f
--- /dev/null
+++ b/gnugo/src/config.h.in
@@ -0,0 +1,167 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Connection module. Default standard. */
+#undef ALTERNATE_CONNECTIONS
+
+/* Define to use ansi escape sequences for color debugging */
+#undef ANSI_COLOR
+
+/* Ruleset. Default Japanese */
+#undef CHINESE_RULES
+
+/* Center oriented influence. Disabled by default. */
+#undef COSMIC_GNUGO
+
+/* Default level (strength). Up to 10 supported */
+#undef DEFAULT_LEVEL
+
+/* Default hash table size in megabytes */
+#undef DEFAULT_MEMORY
+
+/* Compile support for GTP communication over TCP/IP channel. */
+#undef ENABLE_SOCKET_SUPPORT
+
+/* Connection module. Default experimental. */
+#undef EXPERIMENTAL_CONNECTIONS
+
+/* GAIN/LOSS codes. Disabled by default. */
+#undef EXPERIMENTAL_OWL_EXT
+
+/* The concatenation of the strings "GNU ", and PACKAGE. */
+#undef GNU_PACKAGE
+
+/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode
+ */
+#undef GRID_OPT
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_CURSES_H
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_GLIB_H
+
+/* Define to 1 if you have the `g_vsnprintf' function. */
+#undef HAVE_G_VSNPRINTF
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_NCURSES_CURSES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_NCURSES_TERM_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_TERM_H
+
+/* Define to 1 if you have the `times' function. */
+#undef HAVE_TIMES
+
+/* Define if your compiler supports transparent unions */
+#undef HAVE_TRANSPARENT_UNIONS
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define if #define can take a variable number of arguments */
+#undef HAVE_VARIADIC_DEFINE
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Large Scale Captures. Disabled by default. */
+#undef LARGE_SCALE
+
+/* Oracle. Default not enabled. */
+#undef ORACLE
+
+/* Owl Node Limit */
+#undef OWL_NODE_LIMIT
+
+/* Owl Threats. 0 standard. */
+#undef OWL_THREATS
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Enable GNU Readline support */
+#undef READLINE
+
+/* Allow resignation. Default enabled */
+#undef RESIGNATION_ALLOWED
+
+/* Semeai Variations. 500 default */
+#undef SEMEAI_NODE_LIMIT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if termcap/terminfo is available. */
+#undef TERMINFO
+
+/* Define to 1 if you can safely include both and . */
+#undef TIME_WITH_SYS_TIME
+
+/* Break-in module. Enabled by default. */
+#undef USE_BREAK_IN
+
+/* Define special valgrind macros. */
+#undef USE_VALGRIND
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
diff --git a/gnugo/src/config.vc b/gnugo/src/config.vc
new file mode 100644
index 0000000000000000000000000000000000000000..8458ede392067efe354907e3fb1acf58739250fc
--- /dev/null
+++ b/gnugo/src/config.vc
@@ -0,0 +1,82 @@
+/* This is the Microsoft Visual C++ version of config.h *
+ * Replace the distributed config.h with this file *
+ * See config.h.in for comments on the meanings of most of the *
+ * defines. This file is autogenerated. Do not modify it. *
+ * See instead, the perl script makevcdist.pl */
+
+#define HAVE_CRTDBG_H 1
+#define HAVE_WINSOCK_IO_H 1
+#define HAVE__VSNPRINTF 1
+
+/* Connection module. Default standard. */
+#define ALTERNATE_CONNECTIONS 1
+
+/* Ruleset. Default Japanese */
+#define CHINESE_RULES 0
+
+/* Center oriented influence. Disabled by default. */
+#define COSMIC_GNUGO 0
+
+/* Default level (strength). Up to 10 supported */
+#define DEFAULT_LEVEL 10
+
+/* Default hash table size in megabytes */
+#define DEFAULT_MEMORY 8
+
+/* Compile support for GTP communication over TCP/IP channel. */
+#define ENABLE_SOCKET_SUPPORT 1
+
+/* Connection module. Default experimental. */
+#define EXPERIMENTAL_CONNECTIONS 1
+
+/* GAIN/LOSS codes. Disabled by default. */
+#define EXPERIMENTAL_OWL_EXT 0
+
+/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode
+ */
+#define GRID_OPT 1
+
+/* Large Scale Captures. Disabled by default. */
+#define LARGE_SCALE 0
+
+/* Oracle. Default not enabled. */
+#define ORACLE 0
+
+/* Owl Node Limit */
+#define OWL_NODE_LIMIT 1000
+
+/* Owl Threats. 0 standard. */
+#define OWL_THREATS 0
+
+/* Enable GNU Readline support */
+#define READLINE 0
+
+/* Allow resignation. Default enabled */
+#define RESIGNATION_ALLOWED 1
+
+/* Semeai Variations. 500 default */
+#define SEMEAI_NODE_LIMIT 500
+
+/* Break-in module. Enabled by default. */
+#define USE_BREAK_IN 1
+
+/* Define special valgrind macros. */
+#define USE_VALGRIND 0
+
+
+/* Version number of package */
+#define PACKAGE "gnugo"
+
+/* The concatenation of the strings "GNU ", and PACKAGE. */
+#define GNU_PACKAGE "GNU " PACKAGE
+
+/* The number of bytes in a int. */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long. */
+#define SIZEOF_LONG 4
+
+/* Version number of package */
+#define VERSION "3.8"
+
+#pragma warning(disable: 4244 4305)
diff --git a/gnugo/src/config.vcin b/gnugo/src/config.vcin
new file mode 100644
index 0000000000000000000000000000000000000000..6abb75b72a30f23fc17b5c83ea4595cca72908eb
--- /dev/null
+++ b/gnugo/src/config.vcin
@@ -0,0 +1,82 @@
+/* This is the Microsoft Visual C++ version of config.h *
+ * Replace the distributed config.h with this file *
+ * See config.h.in for comments on the meanings of most of the *
+ * defines. This file is autogenerated. Do not modify it. *
+ * See instead, the perl script makevcdist.pl */
+
+#define HAVE_CRTDBG_H 1
+#define HAVE_WINSOCK_IO_H 1
+#define HAVE__VSNPRINTF 1
+
+/* Connection module. Default standard. */
+#define ALTERNATE_CONNECTIONS 1
+
+/* Ruleset. Default Japanese */
+#define CHINESE_RULES 0
+
+/* Center oriented influence. Disabled by default. */
+#define COSMIC_GNUGO 0
+
+/* Default level (strength). Up to 10 supported */
+#define DEFAULT_LEVEL 10
+
+/* Default hash table size in megabytes */
+#define DEFAULT_MEMORY 8
+
+/* Compile support for GTP communication over TCP/IP channel. */
+#define ENABLE_SOCKET_SUPPORT 1
+
+/* Connection module. Default experimental. */
+#define EXPERIMENTAL_CONNECTIONS 1
+
+/* GAIN/LOSS codes. Disabled by default. */
+#define EXPERIMENTAL_OWL_EXT 0
+
+/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode
+ */
+#define GRID_OPT 1
+
+/* Large Scale Captures. Disabled by default. */
+#define LARGE_SCALE 0
+
+/* Oracle. Default not enabled. */
+#define ORACLE 0
+
+/* Owl Node Limit */
+#define OWL_NODE_LIMIT 1000
+
+/* Owl Threats. 0 standard. */
+#define OWL_THREATS 0
+
+/* Enable GNU Readline support */
+#define READLINE 0
+
+/* Allow resignation. Default enabled */
+#define RESIGNATION_ALLOWED 1
+
+/* Semeai Variations. 500 default */
+#define SEMEAI_NODE_LIMIT 500
+
+/* Break-in module. Enabled by default. */
+#define USE_BREAK_IN 1
+
+/* Define special valgrind macros. */
+#define USE_VALGRIND 0
+
+
+/* Version number of package */
+#define PACKAGE "gnugo"
+
+/* The concatenation of the strings "GNU ", and PACKAGE. */
+#define GNU_PACKAGE "GNU " PACKAGE
+
+/* The number of bytes in a int. */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long. */
+#define SIZEOF_LONG 4
+
+/* Version number of package */
+#define VERSION "@VERSION@"
+
+#pragma warning(disable: 4244 4305)
diff --git a/gnugo/src/configure b/gnugo/src/configure
new file mode 100755
index 0000000000000000000000000000000000000000..9ef956a9ff8fbf80a93311db7b7315606affbb51
--- /dev/null
+++ b/gnugo/src/configure
@@ -0,0 +1,7916 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for gnugo 3.8.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 &1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='gnugo'
+PACKAGE_TARNAME='gnugo'
+PACKAGE_VERSION='3.8'
+PACKAGE_STRING='gnugo 3.8'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="engine/dragon.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include
+#ifdef HAVE_SYS_TYPES_H
+# include
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include
+#endif
+#ifdef STDC_HEADERS
+# include
+# include
+#else
+# ifdef HAVE_STDLIB_H
+# include
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include
+# endif
+# include
+#endif
+#ifdef HAVE_STRINGS_H
+# include
+#endif
+#ifdef HAVE_INTTYPES_H
+# include
+#endif
+#ifdef HAVE_STDINT_H
+# include
+#endif
+#ifdef HAVE_UNISTD_H
+# include
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CPP
+RANLIB
+GREP
+EGREP
+glibconfig
+DFA_ENABLED_TRUE
+DFA_ENABLED_FALSE
+GCC_ONLY_TRUE
+GCC_ONLY_FALSE
+GCC_MAJOR_VERSION
+GCC_MINOR_VERSION
+GNU_GO_WARNINGS
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures gnugo 3.8 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/gnugo]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of gnugo 3.8:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-color use curses or ansi escape sequences for colored
+ debug output
+ --disable-color do not try to generated colored debug output
+ --enable-grid-opt enable the grid optimisation within the pattern
+ matcher (default)
+ --enable-grid-opt=distrust enable the grid optimisation in non-trusting mode
+ --disable-grid-opt disable the grid optimisation
+ --enable-cache-size=n reserve n MB RAM for caching (special value -1
+ default, corresponding to 8-11 MB depending on
+ platform)
+ --enable-level=n n = default level (10 standard)
+ --enable-semeai-node-limit=n n = semeai variations (500 standard)
+ --enable-owl-node-limit=n n = owl node limit (1000 standard)
+ --disable-dfa use old non-dfa pattern matcher
+ --enable-chinese-rules use Chinese (area) counting
+ --disable-chinese-rules use Japanese counting (default)
+ --enable-resignation-allowed resign lost games (default)
+ --disable-resignation-allowed never resign
+ --enable-metamachine enable metamachine
+ --disable-metamachine don't enable metamachine (default)
+ --enable-experimental-break-in use the breakin module (default)
+ --disable-experimental-break-in don't use the breakin module
+ --enable-experimental-owl-ext use the experimental GAIN/LOSS codes
+ --disable-experimental-owl-ext use standard owl module (default)
+ --enable-cosmic-gnugo use center-oriented influence code
+ --disable-cosmic-gnugo use standard influence code (default)
+ --enable-large-scale look for large scale captures
+ --disable-large-scale don't seek large scale captures (default)
+ --enable-experimental-connections use experimental connection analysis
+ (default)
+ --disable-experimental-connections use standard connection analysis
+ --enable-alternate-connections use alternate experimental connection
+ analysis
+ --disable-alternate-connections use primary experimental connection
+ analysis (default)
+ --disable-socket-support don't compile GTP over TCP/IP support
+ --enable-socket-support compile TCP/IP support (default)
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-readline try to use GNU Readline for command reading
+ --without-readline do not use GNU Readline (default)
+ --with-curses try to use curses for colored debugging output (default)
+ --without-curses do not use curses for colored debugging output
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L if you have libraries in a
+ nonstandard directory
+ LIBS libraries to pass to the linker, e.g. -l
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if
+ you have headers in a nonstandard directory
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" || continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+gnugo configure 3.8
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by gnugo $as_me 3.8, which was
+generated by GNU Autoconf 2.61. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ SET_MAKE=
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='gnugo'
+ VERSION='3.8'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+GNU_PACKAGE="GNU $PACKAGE"
+cat >>confdefs.h <<_ACEOF
+#define GNU_PACKAGE "$GNU_PACKAGE"
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+
+
+# Check whether --with-readline was given.
+if test "${with_readline+set}" = set; then
+ withval=$with_readline;
+fi
+
+
+
+# Check whether --with-curses was given.
+if test "${with_curses+set}" = set; then
+ withval=$with_curses;
+fi
+
+
+# Check whether --enable-color was given.
+if test "${enable_color+set}" = set; then
+ enableval=$enable_color;
+fi
+
+
+
+# Check whether --enable-grid-opt was given.
+if test "${enable_grid_opt+set}" = set; then
+ enableval=$enable_grid_opt;
+fi
+
+
+default_cache_size=-1
+default_level=10
+default_semeai_node_limit=500
+default_owl_node_limit=1000
+
+# Check whether --enable-cache-size was given.
+if test "${enable_cache_size+set}" = set; then
+ enableval=$enable_cache_size;
+fi
+
+
+# Check whether --enable-level was given.
+if test "${enable_level+set}" = set; then
+ enableval=$enable_level;
+fi
+
+
+# Check whether --enable-semeai-node-limit was given.
+if test "${enable_semeai_node_limit+set}" = set; then
+ enableval=$enable_semeai_node_limit;
+fi
+
+
+# Check whether --enable-level was given.
+if test "${enable_level+set}" = set; then
+ enableval=$enable_level;
+fi
+
+
+# Check whether --enable-dfa was given.
+if test "${enable_dfa+set}" = set; then
+ enableval=$enable_dfa; if test ${enableval} = no; then
+ dfa_c=
+ else
+ dfa_c=dfa
+ fi
+else
+ dfa_c=dfa
+fi
+
+
+# Check whether --enable-chinese-rules was given.
+if test "${enable_chinese_rules+set}" = set; then
+ enableval=$enable_chinese_rules;
+fi
+
+
+# Check whether --enable-resignation-allowed was given.
+if test "${enable_resignation_allowed+set}" = set; then
+ enableval=$enable_resignation_allowed;
+fi
+
+
+# Check whether --enable-metamachine was given.
+if test "${enable_metamachine+set}" = set; then
+ enableval=$enable_metamachine;
+fi
+
+
+# Check whether --enable-experimental-break-in was given.
+if test "${enable_experimental_break_in+set}" = set; then
+ enableval=$enable_experimental_break_in;
+fi
+
+
+# Check whether --enable-experimental-owl-ext was given.
+if test "${enable_experimental_owl_ext+set}" = set; then
+ enableval=$enable_experimental_owl_ext;
+fi
+
+
+# Check whether --enable-cosmic-gnugo was given.
+if test "${enable_cosmic_gnugo+set}" = set; then
+ enableval=$enable_cosmic_gnugo;
+fi
+
+
+# Check whether --enable-large-scale was given.
+if test "${enable_large_scale+set}" = set; then
+ enableval=$enable_large_scale;
+fi
+
+
+# Check whether --enable-experimental-connections was given.
+if test "${enable_experimental_connections+set}" = set; then
+ enableval=$enable_experimental_connections;
+fi
+
+
+# Check whether --enable-alternate-connections was given.
+if test "${enable_alternate_connections+set}" = set; then
+ enableval=$enable_alternate_connections;
+fi
+
+
+# Check whether --enable-socket-support was given.
+if test "${enable_socket_support+set}" = set; then
+ enableval=$enable_socket_support;
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+#include
+#include
+#include
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for library containing pow" >&5
+echo $ECHO_N "checking for library containing pow... $ECHO_C" >&6; }
+if test "${ac_cv_search_pow+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_pow=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_pow+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_pow+set}" = set; then
+ :
+else
+ ac_cv_search_pow=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5
+echo "${ECHO_T}$ac_cv_search_pow" >&6; }
+ac_res=$ac_cv_search_pow
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for mingw32" >&5
+echo $ECHO_N "checking for mingw32... $ECHO_C" >&6; }
+if test "${ac_cv_mingw32+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+return __MINGW32__
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_mingw32="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_mingw32="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_mingw32" >&5
+echo "${ECHO_T}$ac_cv_mingw32" >&6; }
+
+if test $ac_cv_mingw32 = yes;then
+ LIBS="$LIBS -lwsock32"
+ { echo "$as_me:$LINENO: checking for library containing vsnprintf" >&5
+echo $ECHO_N "checking for library containing vsnprintf... $ECHO_C" >&6; }
+if test "${ac_cv_search_vsnprintf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char vsnprintf ();
+int
+main ()
+{
+return vsnprintf ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' mingwex; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_vsnprintf=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_vsnprintf+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_vsnprintf+set}" = set; then
+ :
+else
+ ac_cv_search_vsnprintf=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_search_vsnprintf" >&6; }
+ac_res=$ac_cv_search_vsnprintf
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer to if __STDC__ is defined, since
+ # exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer to if __STDC__ is defined, since
+ # exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ SET_MAKE=
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+#include
+#include
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ # Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_GREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ # Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_EGREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+#include
+#include
+#include
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+#include
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_header in unistd.h sys/time.h sys/times.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_header in curses.h term.h ncurses/curses.h ncurses/term.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "$ac_cv_header_curses_h" = "yes";then
+ curses_header="curses.h"
+elif test "$ac_cv_header_ncurses_curses_h" = "yes";then
+ curses_header="ncurses/curses.h"
+else
+ curses_header="no"
+fi
+
+if test "$ac_cv_header_term_h" = "yes";then
+ term_header="term.h"
+elif test "$ac_cv_header_ncurses_term_h" = "yes";then
+ term_header="ncurses/term.h"
+else
+ term_header="no"
+fi
+
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+typedef long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+
+ typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include
+#include
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+
+
+
+
+for ac_func in vsnprintf gettimeofday usleep times
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case declares $ac_func.
+ For example, HP-UX 11i declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer to if __STDC__ is defined, since
+ exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+if test $ac_cv_func_vsnprintf = no; then
+ # Extract the first word of "glib-config", so it can be a program name with args.
+set dummy glib-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_glibconfig+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$glibconfig"; then
+ ac_cv_prog_glibconfig="$glibconfig" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_glibconfig="yes"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_glibconfig" && ac_cv_prog_glibconfig="no"
+fi
+fi
+glibconfig=$ac_cv_prog_glibconfig
+if test -n "$glibconfig"; then
+ { echo "$as_me:$LINENO: result: $glibconfig" >&5
+echo "${ECHO_T}$glibconfig" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ if test $ac_cv_prog_glibconfig = yes;then
+ glib_cflags=`glib-config --cflags`
+ glib_libs=`glib-config --libs`
+ CPPFLAGS="$CPPFLAGS $glib_cflags"
+ LIBS="$LIBS $glib_libs"
+
+for ac_func in g_vsnprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case declares $ac_func.
+ For example, HP-UX 11i declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer to if __STDC__ is defined, since
+ exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_header in glib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_func_g_vsnprintf = no; then
+ { echo "$as_me:$LINENO: WARNING: GLib installation problem.
+ Continuing without GLib " >&5
+echo "$as_me: WARNING: GLib installation problem.
+ Continuing without GLib " >&2;}
+ fi
+ else
+ { echo "$as_me:$LINENO: WARNING: Neither vsnprintf nor GLib found. GNU Go is
+ compiled but it is safer to get GLib at
+ http://www.gtk.org/" >&5
+echo "$as_me: WARNING: Neither vsnprintf nor GLib found. GNU Go is
+ compiled but it is safer to get GLib at
+ http://www.gtk.org/" >&2;}
+ fi
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for variadic cpp define" >&5
+echo $ECHO_N "checking for variadic cpp define... $ECHO_C" >&6; }
+if test "${gnugo_cv_cpp_variadic_define+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include
+#define zz(fmt,arg...) printf(fmt,##arg)
+int
+main ()
+{
+zz("Hello");zz("%s","Hello");zz("%s%s","Hello","World")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ gnugo_cv_cpp_variadic_define="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ gnugo_cv_cpp_variadic_define="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $gnugo_cv_cpp_variadic_define" >&5
+echo "${ECHO_T}$gnugo_cv_cpp_variadic_define" >&6; }
+if test "$gnugo_cv_cpp_variadic_define" = "yes";then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_VARIADIC_DEFINE 1
+_ACEOF
+
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether $CC supports transparent unions" >&5
+echo $ECHO_N "checking whether $CC supports transparent unions... $ECHO_C" >&6; }
+if test "${gnugo_cv_transparent_unions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+ struct {
+ union {
+ int x;
+ float y;
+ }
+ } A = { { .y = 0.0 } };
+ A.y = 1.0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ gnugo_cv_transparent_unions="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ gnugo_cv_transparent_unions="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $gnugo_cv_transparent_unions" >&5
+echo "${ECHO_T}$gnugo_cv_transparent_unions" >&6; }
+
+if test "$gnugo_cv_transparent_unions" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TRANSPARENT_UNIONS 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+tmp_color_result="none"
+
+if test "$with_curses" != no -a "$enable_color" != no ; then
+ tmp_color_result="none (curses failed)"
+
+
+ if test "$term_header" != "no" -a "$curses_header" != "no" ; then
+
+ { echo "$as_me:$LINENO: checking for library containing tparm" >&5
+echo $ECHO_N "checking for library containing tparm... $ECHO_C" >&6; }
+if test "${ac_cv_search_tparm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tparm ();
+int
+main ()
+{
+return tparm ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ncurses curses pdcurses termcap terminfo termlib; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_tparm=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_tparm+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_tparm+set}" = set; then
+ :
+else
+ ac_cv_search_tparm=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_tparm" >&5
+echo "${ECHO_T}$ac_cv_search_tparm" >&6; }
+ac_res=$ac_cv_search_tparm
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+ if test "$ac_cv_search_tparm" != "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define TERMINFO 1
+_ACEOF
+
+ tmp_color_result="curses"
+ fi
+ fi
+fi
+
+if test "$with_curses" = no -a "$enable_color" != no ; then
+ cat >>confdefs.h <<\_ACEOF
+#define ANSI_COLOR 1
+_ACEOF
+
+ tmp_color_result="ANSI color"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for color support" >&5
+echo $ECHO_N "checking for color support... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $tmp_color_result" >&5
+echo "${ECHO_T}$tmp_color_result" >&6; }
+
+
+
+
+
+if test "$with_readline" = yes ; then
+
+ { echo "$as_me:$LINENO: checking for library containing readline" >&5
+echo $ECHO_N "checking for library containing readline... $ECHO_C" >&6; }
+if test "${ac_cv_search_readline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' termcap readline; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_readline=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_readline+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_readline+set}" = set; then
+ :
+else
+ ac_cv_search_readline=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_readline" >&5
+echo "${ECHO_T}$ac_cv_search_readline" >&6; }
+ac_res=$ac_cv_search_readline
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+ if test "$ac_cv_search_readline" != "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define READLINE 1
+_ACEOF
+
+ else
+ cat >>confdefs.h <<\_ACEOF
+#define READLINE 0
+_ACEOF
+
+ fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define READLINE 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_grid_opt" = "distrust" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define GRID_OPT 2
+_ACEOF
+
+else
+ if test "$enable_grid_opt" = "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define GRID_OPT 0
+_ACEOF
+
+ else
+ cat >>confdefs.h <<\_ACEOF
+#define GRID_OPT 1
+_ACEOF
+
+ fi
+fi
+
+
+
+
+
+
+if test "$enable_cache_size" ; then
+ cat >>confdefs.h <<_ACEOF
+#define DEFAULT_MEMORY $enable_cache_size
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define DEFAULT_MEMORY $default_cache_size
+_ACEOF
+
+fi
+
+
+
+
+
+
+if test "$enable_level" ; then
+ cat >>confdefs.h <<_ACEOF
+#define DEFAULT_LEVEL $enable_level
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define DEFAULT_LEVEL $default_level
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_owl_node_limit" ; then
+ cat >>confdefs.h <<_ACEOF
+#define OWL_NODE_LIMIT $enable_owl_node_limit
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define OWL_NODE_LIMIT $default_owl_node_limit
+_ACEOF
+
+fi
+
+
+
+
+
+
+if test "$enable_semeai_node_limit" ; then
+ cat >>confdefs.h <<_ACEOF
+#define SEMEAI_NODE_LIMIT $enable_semeai_node_limit
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define SEMEAI_NODE_LIMIT $default_semeai_node_limit
+_ACEOF
+
+fi
+
+
+
+
+if test "$enable_dfa" != "no"; then
+ DFA_ENABLED_TRUE=
+ DFA_ENABLED_FALSE='#'
+else
+ DFA_ENABLED_TRUE='#'
+ DFA_ENABLED_FALSE=
+fi
+
+
+rm -f \
+ patterns/owl_attackpat.c \
+ patterns/owl_defendpat.c \
+ patterns/owl_vital_apat.c
+
+
+
+
+
+
+if test "$enable_chinese_rules" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define CHINESE_RULES 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define CHINESE_RULES 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$disable_resignation_allowed" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define RESIGNATION_ALLOWED 0
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define RESIGNATION_ALLOWED 1
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_metamachine" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define ORACLE 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define ORACLE 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_experimental_break_in" = "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_BREAK_IN 0
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define USE_BREAK_IN 1
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_experimental_owl_ext" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define EXPERIMENTAL_OWL_EXT 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define EXPERIMENTAL_OWL_EXT 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_cosmic_gnugo" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define COSMIC_GNUGO 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define COSMIC_GNUGO 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_large_scale" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define LARGE_SCALE 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define LARGE_SCALE 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_experimental_connections" = "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define EXPERIMENTAL_CONNECTIONS 0
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define EXPERIMENTAL_CONNECTIONS 1
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_alternate_connections" = "no" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define ALTERNATE_CONNECTIONS 0
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define ALTERNATE_CONNECTIONS 1
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_owl_threats" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define OWL_THREATS 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define OWL_THREATS 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$enable_valgrind" = "yes" ; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_VALGRIND 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define USE_VALGRIND 0
+_ACEOF
+
+fi
+
+
+
+
+
+if test "$ac_compiler_gnu" = "yes"; then
+ GCC_ONLY_TRUE=
+ GCC_ONLY_FALSE='#'
+else
+ GCC_ONLY_TRUE='#'
+ GCC_ONLY_FALSE=
+fi
+
+
+
+
+
+
+
+if test "$ac_compiler_gnu" = "yes"; then
+
+ GCC_MAJOR_VERSION=`echo __GNUC__ | $CC -E -xc - | tail -n 1`
+ GCC_MINOR_VERSION=`echo __GNUC_MINOR__ | $CC -E -xc - | tail -n 1`
+
+ GNU_GO_WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wundef'
+
+ if (test $GCC_MAJOR_VERSION -eq 3 && test $GCC_MINOR_VERSION -ge 4) || test $GCC_MAJOR_VERSION -gt 3; then
+ GNU_GO_WARNINGS="$GNU_GO_WARNINGS -Wdeclaration-after-statement"
+ fi
+
+else
+ GCC_MAJOR_VERSION=0
+ GCC_MINOR_VERSION=0
+ GNU_GO_WARNINGS=''
+fi
+
+
+
+
+
+
+if test "$enable_socket_support" != "no"; then
+ # Check for all required headers, macros, structures and functions
+ # at once.
+ { echo "$as_me:$LINENO: checking whether socket support can be compiled" >&5
+echo $ECHO_N "checking whether socket support can be compiled... $ECHO_C" >&6; }
+if test "${gnugo_cv_sockets_supported+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if !defined(_WIN32) && !defined(_WIN32_WCE)
+#include
+#include
+#include
+#include
+#else /* on Windows */
+#include
+#endif /* on Windows */
+int
+main ()
+{
+ struct sockaddr_in A;
+ struct hostent *H;
+ A.sin_family = AF_INET;
+ A.sin_addr.s_addr = htonl(INADDR_ANY);
+ A.sin_port = htons(0);
+ gethostbyname(0);
+ socket(PF_INET, SOCK_STREAM, 0);
+ connect(0, 0, 0);
+ bind(0, 0, 0);
+ listen(0, 0);
+ accept(0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ gnugo_cv_sockets_supported="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ gnugo_cv_sockets_supported="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gnugo_cv_sockets_supported" >&5
+echo "${ECHO_T}$gnugo_cv_sockets_supported" >&6; }
+
+ if test "$gnugo_cv_sockets_supported" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define ENABLE_SOCKET_SUPPORT 1
+_ACEOF
+
+ else
+ if test "$enable_socket_support" = "yes"; then
+ { echo "$as_me:$LINENO: WARNING:
+*** Socket support was requested but does not pass configure test. ***
+*** Proceed only if you know what you are doing. ***" >&5
+echo "$as_me: WARNING:
+*** Socket support was requested but does not pass configure test. ***
+*** Proceed only if you know what you are doing. ***" >&2;}
+ cat >>confdefs.h <<\_ACEOF
+#define ENABLE_SOCKET_SUPPORT 1
+_ACEOF
+
+ fi
+ fi
+fi
+
+#AM_GNU_GETTEXT
+#AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+
+ac_config_files="$ac_config_files Makefile interface/Makefile patterns/Makefile sgf/Makefile utils/Makefile engine/Makefile doc/Makefile regression/Makefile config.vc:config.vcin"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${DFA_ENABLED_TRUE}" && test -z "${DFA_ENABLED_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"DFA_ENABLED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"DFA_ENABLED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GCC_ONLY_TRUE}" && test -z "${GCC_ONLY_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GCC_ONLY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GCC_ONLY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by gnugo $as_me 3.8, which was
+generated by GNU Autoconf 2.61. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to ."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+gnugo config.status 3.8
+configured by $0, generated by GNU Autoconf 2.61,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "interface/Makefile") CONFIG_FILES="$CONFIG_FILES interface/Makefile" ;;
+ "patterns/Makefile") CONFIG_FILES="$CONFIG_FILES patterns/Makefile" ;;
+ "sgf/Makefile") CONFIG_FILES="$CONFIG_FILES sgf/Makefile" ;;
+ "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
+ "engine/Makefile") CONFIG_FILES="$CONFIG_FILES engine/Makefile" ;;
+ "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "regression/Makefile") CONFIG_FILES="$CONFIG_FILES regression/Makefile" ;;
+ "config.vc") CONFIG_FILES="$CONFIG_FILES config.vc:config.vcin" ;;
+
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CPP!$CPP$ac_delim
+RANLIB!$RANLIB$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+glibconfig!$glibconfig$ac_delim
+DFA_ENABLED_TRUE!$DFA_ENABLED_TRUE$ac_delim
+DFA_ENABLED_FALSE!$DFA_ENABLED_FALSE$ac_delim
+GCC_ONLY_TRUE!$GCC_ONLY_TRUE$ac_delim
+GCC_ONLY_FALSE!$GCC_ONLY_FALSE$ac_delim
+GCC_MAJOR_VERSION!$GCC_MAJOR_VERSION$ac_delim
+GCC_MINOR_VERSION!$GCC_MINOR_VERSION$ac_delim
+GNU_GO_WARNINGS!$GNU_GO_WARNINGS$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input="Generated from "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ esac
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status. If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless. But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
+ac_dB='\\)[ (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+ sed -n '
+ t rset
+ :rset
+ s/^[ ]*#[ ]*define[ ][ ]*//
+ t ok
+ d
+ :ok
+ s/[\\&,]/\\&/g
+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+ ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[ #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+ # Write a here document:
+ cat >>$CONFIG_STATUS <<_ACEOF
+ # First, check the format of the line:
+ cat >"\$tmp/defines.sed" <<\\CEOF
+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
+b
+:def
+_ACEOF
+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+ grep . conftest.tail >/dev/null || break
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+ if test x"$ac_file" != x-; then
+ echo "/* $configure_input */" >"$tmp/config.h"
+ cat "$ac_result" >>"$tmp/config.h"
+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f $ac_file
+ mv "$tmp/config.h" $ac_file
+ fi
+ else
+ echo "/* $configure_input */"
+ cat "$ac_result"
+ fi
+ rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/gnugo/src/configure.in b/gnugo/src/configure.in
new file mode 100644
index 0000000000000000000000000000000000000000..66ea5cd4bb6cce04f4d2fb9c659016f5ecaa55d1
--- /dev/null
+++ b/gnugo/src/configure.in
@@ -0,0 +1,590 @@
+dnl Process this file with autoconf to produce a configure script.
+
+dnl *****************************************************************
+dnl IMPORTANT: Don't forget to add corresponding output for --options
+dnl if you add a non-trivial configure option here.
+dnl *****************************************************************
+
+dnl this is to determine if the config script is running in the proper place
+dnl just give it one file relative to where it should be
+AC_INIT([gnugo], [3.8])
+AC_CONFIG_SRCDIR([engine/dragon.c])
+
+AM_CONFIG_HEADER(config.h)
+AC_PREREQ(2.52)dnl dnl Minimum Autoconf version required.
+
+AH_TEMPLATE([PACKAGE],
+[Define to the name of the distribution.])
+
+AH_TEMPLATE([GNU_PACKAGE],
+[The concatenation of the strings "GNU ", and PACKAGE.])
+
+AH_TEMPLATE([VERSION],
+[Define to the version of the distribution.])
+
+dnl this defines VERSION and PACKAGE
+AM_INIT_AUTOMAKE
+GNU_PACKAGE="GNU $PACKAGE"
+AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE")
+
+AM_MAINTAINER_MODE
+
+dnl See if user has expressed a preference for use of curses and/or color
+dnl These set variables $enable_color and $with_curses to "no" if disabled
+dnl "yes" if enabled, or undefined if not specified
+
+AC_ARG_WITH(readline,
+ [ --with-readline try to use GNU Readline for command reading
+ --without-readline do not use GNU Readline (default)])
+
+AC_ARG_WITH(curses,
+ [ --with-curses try to use curses for colored debugging output (default)
+ --without-curses do not use curses for colored debugging output])
+
+AC_ARG_ENABLE(color,
+ [ --enable-color use curses or ansi escape sequences for colored
+ debug output
+ --disable-color do not try to generated colored debug output])
+
+dnl and look to see if they want to disable the grid optimisation
+
+AC_ARG_ENABLE(grid-opt,
+ [ --enable-grid-opt enable the grid optimisation within the pattern
+ matcher (default)
+ --enable-grid-opt=distrust enable the grid optimisation in non-trusting mode
+ --disable-grid-opt disable the grid optimisation])
+
+default_cache_size=-1
+default_level=10
+default_semeai_node_limit=500
+default_owl_node_limit=1000
+
+AC_ARG_ENABLE(cache-size,
+ [ --enable-cache-size=n reserve n MB RAM for caching (special value -1
+ default, corresponding to 8-11 MB depending on
+ platform)])
+
+AC_ARG_ENABLE(level,
+ [ --enable-level=n n = default level (10 standard)])
+
+AC_ARG_ENABLE(semeai-node-limit,
+ [ --enable-semeai-node-limit=n n = semeai variations (500 standard)])
+
+AC_ARG_ENABLE(level,
+ [ --enable-owl-node-limit=n n = owl node limit (1000 standard)])
+
+AC_ARG_ENABLE(dfa,
+ [ --disable-dfa use old non-dfa pattern matcher],
+ [ if test ${enableval} = no; then
+ dfa_c=
+ else
+ dfa_c=dfa
+ fi] ,
+ [ dfa_c=dfa ])
+
+AC_ARG_ENABLE(chinese-rules,
+ [ --enable-chinese-rules use Chinese (area) counting
+ --disable-chinese-rules use Japanese counting (default)])
+
+AC_ARG_ENABLE(resignation-allowed,
+ [ --enable-resignation-allowed resign lost games (default)
+ --disable-resignation-allowed never resign])
+
+AC_ARG_ENABLE(metamachine,
+ [ --enable-metamachine enable metamachine
+ --disable-metamachine don't enable metamachine (default)])
+
+AC_ARG_ENABLE(experimental-break-in,
+ [ --enable-experimental-break-in use the breakin module (default)
+ --disable-experimental-break-in don't use the breakin module])
+
+AC_ARG_ENABLE(experimental-owl-ext,
+ [ --enable-experimental-owl-ext use the experimental GAIN/LOSS codes
+ --disable-experimental-owl-ext use standard owl module (default)])
+
+AC_ARG_ENABLE(cosmic-gnugo,
+ [ --enable-cosmic-gnugo use center-oriented influence code
+ --disable-cosmic-gnugo use standard influence code (default)])
+
+AC_ARG_ENABLE(large-scale,
+ [ --enable-large-scale look for large scale captures
+ --disable-large-scale don't seek large scale captures (default)])
+
+AC_ARG_ENABLE(experimental-connections,
+ [ --enable-experimental-connections use experimental connection analysis
+ (default)
+ --disable-experimental-connections use standard connection analysis])
+
+AC_ARG_ENABLE(alternate-connections,
+ [ --enable-alternate-connections use alternate experimental connection
+ analysis
+ --disable-alternate-connections use primary experimental connection
+ analysis (default)])
+
+AC_ARG_ENABLE(socket-support,
+ [ --disable-socket-support don't compile GTP over TCP/IP support
+ --enable-socket-support compile TCP/IP support (default)])
+
+AC_PROG_CC
+
+dnl for automake 1.4.x
+AC_EXEEXT
+
+dnl add -lm to library list since we use some
+dnl math functions such as pow and fabs
+
+AC_SEARCH_LIBS(pow,m)
+
+AC_CACHE_CHECK(
+ [for mingw32],
+ ac_cv_mingw32,
+ AC_TRY_COMPILE(,
+ [return __MINGW32__],
+ ac_cv_mingw32="yes",
+ ac_cv_mingw32="no")
+)
+
+if test $ac_cv_mingw32 = yes;then
+ LIBS="$LIBS -lwsock32"
+ AC_SEARCH_LIBS(vsnprintf, mingwex)
+fi
+
+AC_PROG_CPP
+AC_PROG_RANLIB
+
+dnl required since we use SUBDIRS in Makefile.am
+AC_PROG_MAKE_SET
+
+AC_HEADER_TIME
+
+AC_C_CONST
+
+AC_CHECK_HEADERS(unistd.h sys/time.h sys/times.h)
+AC_CHECK_HEADERS(curses.h term.h ncurses/curses.h ncurses/term.h)
+
+if test "$ac_cv_header_curses_h" = "yes";then
+ curses_header="curses.h"
+elif test "$ac_cv_header_ncurses_curses_h" = "yes";then
+ curses_header="ncurses/curses.h"
+else
+ curses_header="no"
+fi
+
+if test "$ac_cv_header_term_h" = "yes";then
+ term_header="term.h"
+elif test "$ac_cv_header_ncurses_term_h" = "yes";then
+ term_header="ncurses/term.h"
+else
+ term_header="no"
+fi
+
+AC_CHECK_SIZEOF(long,,[#include ])
+
+dnl vsnprintf not universally available
+dnl usleep not available in Unicos and mingw32
+AC_CHECK_FUNCS(vsnprintf gettimeofday usleep times)
+
+dnl if snprintf not available try to use g_snprintf from GLib
+if test $ac_cv_func_vsnprintf = no; then
+ AC_CHECK_PROG(glibconfig,glib-config,yes,no)
+ if test $ac_cv_prog_glibconfig = yes;then
+ glib_cflags=`glib-config --cflags`
+ glib_libs=`glib-config --libs`
+ CPPFLAGS="$CPPFLAGS $glib_cflags"
+ LIBS="$LIBS $glib_libs"
+ AC_CHECK_FUNCS(g_vsnprintf)
+ AC_CHECK_HEADERS(glib.h)
+ if test $ac_cv_func_g_vsnprintf = no; then
+ AC_MSG_WARN([GLib installation problem.
+ Continuing without GLib ])
+ fi
+ else
+ AC_MSG_WARN([Neither vsnprintf nor GLib found. GNU Go is
+ compiled but it is safer to get GLib at
+ http://www.gtk.org/])
+ fi
+fi
+
+dnl ------ variadic #define -----------------------
+
+AH_TEMPLATE([HAVE_VARIADIC_DEFINE],
+[Define if #define can take a variable number of arguments])
+
+AC_CACHE_CHECK(
+ [for variadic cpp define],
+ gnugo_cv_cpp_variadic_define,
+ AC_TRY_COMPILE(
+[#include
+#define zz(fmt,arg...) printf(fmt,##arg)],
+ [zz("Hello");zz("%s","Hello");zz("%s%s","Hello","World")],
+ gnugo_cv_cpp_variadic_define="yes",
+ gnugo_cv_cpp_variadic_define="no")
+)
+if test "$gnugo_cv_cpp_variadic_define" = "yes";then
+ AC_DEFINE(HAVE_VARIADIC_DEFINE)
+fi
+
+dnl ------ transparent unions ---------------------
+
+AH_TEMPLATE([HAVE_TRANSPARENT_UNIONS],
+[Define if your compiler supports transparent unions])
+
+AC_CACHE_CHECK(
+ [whether $CC supports transparent unions],
+ gnugo_cv_transparent_unions,
+ AC_TRY_COMPILE([],
+[[ struct {
+ union {
+ int x;
+ float y;
+ }
+ } A = { { .y = 0.0 } };
+ A.y = 1.0;]],
+ gnugo_cv_transparent_unions="yes",
+ gnugo_cv_transparent_unions="no")
+)
+
+if test "$gnugo_cv_transparent_unions" = "yes"; then
+ AC_DEFINE(HAVE_TRANSPARENT_UNIONS)
+fi
+
+dnl -------- color debugging support -----------
+
+AH_TEMPLATE([TERMINFO],
+[Define to 1 if termcap/terminfo is available.])
+
+AH_TEMPLATE([ANSI_COLOR],
+[Define to use ansi escape sequences for color debugging])
+
+tmp_color_result="none"
+
+if test "$with_curses" != no -a "$enable_color" != no ; then
+ tmp_color_result="none (curses failed)"
+
+ dnl Do a separate test for curses and termcap
+ dnl DJGPP does have pdcurses, but not termcap
+
+ dnl make sure that both curses.h and term.h are available
+ dnl FIXME: better to actually figure out here what headers
+ dnl are really required
+ if test "$term_header" != "no" -a "$curses_header" != "no" ; then
+
+ dnl check for a working termcap library
+ AC_SEARCH_LIBS(tparm,ncurses curses pdcurses termcap terminfo termlib)
+
+ if test "$ac_cv_search_tparm" != "no" ; then
+ AC_DEFINE(TERMINFO)
+ tmp_color_result="curses"
+ fi
+ fi
+fi
+
+if test "$with_curses" = no -a "$enable_color" != no ; then
+ dnl we asked for color, but there is no termcap
+ AC_DEFINE(ANSI_COLOR)
+ tmp_color_result="ANSI color"
+
+fi
+
+AC_MSG_CHECKING(for color support)
+AC_MSG_RESULT($tmp_color_result)
+
+dnl -------- readline support -------------------
+
+AH_TEMPLATE([READLINE], [Enable GNU Readline support])
+
+if test "$with_readline" = yes ; then
+
+ dnl check for a working termcap and readline library
+ AC_SEARCH_LIBS(readline,termcap readline)
+
+ if test "$ac_cv_search_readline" != "no" ; then
+ AC_DEFINE(READLINE,1)
+ else
+ AC_DEFINE(READLINE,0)
+ fi
+else
+ AC_DEFINE(READLINE,0)
+fi
+
+dnl ---------- grid optimisation ------------
+
+AH_TEMPLATE([GRID_OPT],
+[Define as 1 to use the grid optimisation, or 2 to run it in self-test mode])
+
+if test "$enable_grid_opt" = "distrust" ; then
+ AC_DEFINE(GRID_OPT, 2)
+else
+ if test "$enable_grid_opt" = "no" ; then
+ AC_DEFINE(GRID_OPT, 0)
+ else
+ AC_DEFINE(GRID_OPT, 1)
+ fi
+fi
+
+
+dnl ------------ set cache size ----------
+
+AH_TEMPLATE([DEFAULT_MEMORY],
+[Default hash table size in megabytes])
+
+if test "$enable_cache_size" ; then
+ AC_DEFINE_UNQUOTED(DEFAULT_MEMORY, $enable_cache_size)
+else
+ AC_DEFINE_UNQUOTED(DEFAULT_MEMORY, $default_cache_size)
+fi
+
+
+dnl ------------ set default level ----------
+
+AH_TEMPLATE([DEFAULT_LEVEL],
+[Default level (strength). Up to 10 supported])
+
+if test "$enable_level" ; then
+ AC_DEFINE_UNQUOTED(DEFAULT_LEVEL, $enable_level)
+else
+ AC_DEFINE_UNQUOTED(DEFAULT_LEVEL, $default_level)
+fi
+
+dnl ------------ set cache size ----------
+
+AH_TEMPLATE([OWL_NODE_LIMIT],
+[Owl Node Limit])
+
+if test "$enable_owl_node_limit" ; then
+ AC_DEFINE_UNQUOTED(OWL_NODE_LIMIT, $enable_owl_node_limit)
+else
+ AC_DEFINE_UNQUOTED(OWL_NODE_LIMIT, $default_owl_node_limit)
+fi
+
+
+dnl ------------ set semeai variations ----------
+
+AH_TEMPLATE([SEMEAI_NODE_LIMIT],
+[Semeai Variations. 500 default])
+
+if test "$enable_semeai_node_limit" ; then
+ AC_DEFINE_UNQUOTED(SEMEAI_NODE_LIMIT, $enable_semeai_node_limit)
+else
+ AC_DEFINE_UNQUOTED(SEMEAI_NODE_LIMIT, $default_semeai_node_limit)
+fi
+
+dnl ------------ dfa -------------------
+
+AM_CONDITIONAL(DFA_ENABLED, test "$enable_dfa" != "no")
+
+dnl FIXME: Is there a more elegant approach for this?
+dnl force owl c files rebuild
+rm -f \
+ patterns/owl_attackpat.c \
+ patterns/owl_defendpat.c \
+ patterns/owl_vital_apat.c
+
+
+dnl ------------ Chinese Rules -------------------
+
+AH_TEMPLATE([CHINESE_RULES],
+[Ruleset. Default Japanese])
+
+if test "$enable_chinese_rules" = "yes" ; then
+ AC_DEFINE(CHINESE_RULES, 1)
+else
+ AC_DEFINE(CHINESE_RULES, 0)
+fi
+
+dnl ------------ Resignation allowed-------------------
+
+AH_TEMPLATE([RESIGNATION_ALLOWED],
+[Allow resignation. Default enabled])
+
+if test "$disable_resignation_allowed" = "yes" ; then
+ AC_DEFINE(RESIGNATION_ALLOWED, 0)
+else
+ AC_DEFINE(RESIGNATION_ALLOWED, 1)
+fi
+
+dnl ------------ Oracle enabled-------------------
+
+AH_TEMPLATE([ORACLE],
+[Oracle. Default not enabled.])
+
+if test "$enable_metamachine" = "yes" ; then
+ AC_DEFINE(ORACLE, 1)
+else
+ AC_DEFINE(ORACLE, 0)
+fi
+
+dnl ------------ Experimental Breakin enabled-------------------
+
+AH_TEMPLATE([USE_BREAK_IN],
+[Break-in module. Enabled by default.])
+
+if test "$enable_experimental_break_in" = "no" ; then
+ AC_DEFINE(USE_BREAK_IN, 0)
+else
+ AC_DEFINE(USE_BREAK_IN, 1)
+fi
+
+dnl ------------ Owl extensions ------------
+
+AH_TEMPLATE([EXPERIMENTAL_OWL_EXT],
+[GAIN/LOSS codes. Disabled by default.])
+
+if test "$enable_experimental_owl_ext" = "yes" ; then
+ AC_DEFINE(EXPERIMENTAL_OWL_EXT, 1)
+else
+ AC_DEFINE(EXPERIMENTAL_OWL_EXT, 0)
+fi
+
+dnl ------------ Cosmic Consciousness -------------------
+
+AH_TEMPLATE([COSMIC_GNUGO],
+[Center oriented influence. Disabled by default.])
+
+if test "$enable_cosmic_gnugo" = "yes" ; then
+ AC_DEFINE(COSMIC_GNUGO, 1)
+else
+ AC_DEFINE(COSMIC_GNUGO, 0)
+fi
+
+dnl ------------ Large Scale -------------------
+
+AH_TEMPLATE([LARGE_SCALE],
+[Large Scale Captures. Disabled by default.])
+
+if test "$enable_large_scale" = "yes" ; then
+ AC_DEFINE(LARGE_SCALE, 1)
+else
+ AC_DEFINE(LARGE_SCALE, 0)
+fi
+
+dnl ------------ Connections -------------------
+
+AH_TEMPLATE([EXPERIMENTAL_CONNECTIONS],
+[Connection module. Default experimental.])
+
+if test "$enable_experimental_connections" = "no" ; then
+ AC_DEFINE(EXPERIMENTAL_CONNECTIONS, 0)
+else
+ AC_DEFINE(EXPERIMENTAL_CONNECTIONS, 1)
+fi
+
+dnl ------------ Connections -------------------
+
+AH_TEMPLATE([ALTERNATE_CONNECTIONS],
+[Connection module. Default standard.])
+
+if test "$enable_alternate_connections" = "no" ; then
+ AC_DEFINE(ALTERNATE_CONNECTIONS, 0)
+else
+ AC_DEFINE(ALTERNATE_CONNECTIONS, 1)
+fi
+
+dnl ------------ Owl Threats -------------------
+
+AH_TEMPLATE([OWL_THREATS],
+[Owl Threats. 0 standard.])
+
+if test "$enable_owl_threats" = "yes" ; then
+ AC_DEFINE(OWL_THREATS, 1)
+else
+ AC_DEFINE(OWL_THREATS, 0)
+fi
+
+dnl ------------ additional valgrind macros ------
+
+AH_TEMPLATE([USE_VALGRIND],
+[Define special valgrind macros.])
+
+if test "$enable_valgrind" = "yes" ; then
+ AC_DEFINE(USE_VALGRIND, 1)
+else
+ AC_DEFINE(USE_VALGRIND, 0)
+fi
+
+dnl ----------- special-case use of gcc ---------
+
+dnl Not sure if we are supposed to be accessing this variable, but...
+
+AM_CONDITIONAL(GCC_ONLY, test "$ac_compiler_gnu" = "yes")
+
+dnl Now lines in Makefile.am can be prefixed @GCC_ONLY@.
+
+AC_SUBST(GCC_MAJOR_VERSION)
+AC_SUBST(GCC_MINOR_VERSION)
+AC_SUBST(GNU_GO_WARNINGS)
+
+if test "$ac_compiler_gnu" = "yes"; then
+
+ dnl M4 escaping of brackets
+ GCC_MAJOR_VERSION=`echo __GNUC__ | $CC -E -xc - | tail -n 1`
+ GCC_MINOR_VERSION=`echo __GNUC_MINOR__ | $CC -E -xc - | tail -n 1`
+
+ GNU_GO_WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wundef'
+
+ if (test $GCC_MAJOR_VERSION -eq 3 && test $GCC_MINOR_VERSION -ge 4) || test $GCC_MAJOR_VERSION -gt 3; then
+ GNU_GO_WARNINGS="$GNU_GO_WARNINGS -Wdeclaration-after-statement"
+ fi
+
+else
+ GCC_MAJOR_VERSION=0
+ GCC_MINOR_VERSION=0
+ GNU_GO_WARNINGS=''
+fi
+
+dnl FIXME: please add warnings for other compilers!
+
+
+AH_TEMPLATE([ENABLE_SOCKET_SUPPORT],
+[Compile support for GTP communication over TCP/IP channel.])
+
+if test "$enable_socket_support" != "no"; then
+ # Check for all required headers, macros, structures and functions
+ # at once.
+ AC_CACHE_CHECK(
+ [whether socket support can be compiled],
+ gnugo_cv_sockets_supported,
+ AC_TRY_LINK([#if !defined(_WIN32) && !defined(_WIN32_WCE)
+#include
+#include
+#include
+#include
+#else /* on Windows */
+#include
+#endif /* on Windows */],
+[[ struct sockaddr_in A;
+ struct hostent *H;
+ A.sin_family = AF_INET;
+ A.sin_addr.s_addr = htonl(INADDR_ANY);
+ A.sin_port = htons(0);
+ gethostbyname(0);
+ socket(PF_INET, SOCK_STREAM, 0);
+ connect(0, 0, 0);
+ bind(0, 0, 0);
+ listen(0, 0);
+ accept(0, 0, 0);]],
+ gnugo_cv_sockets_supported="yes",
+ gnugo_cv_sockets_supported="no"))
+
+ if test "$gnugo_cv_sockets_supported" = "yes"; then
+ AC_DEFINE(ENABLE_SOCKET_SUPPORT)
+ else
+ if test "$enable_socket_support" = "yes"; then
+ AC_MSG_WARN(
+[[
+*** Socket support was requested but does not pass configure test. ***
+*** Proceed only if you know what you are doing. ***]])
+ AC_DEFINE(ENABLE_SOCKET_SUPPORT)
+ fi
+ fi
+fi
+
+#AM_GNU_GETTEXT
+#AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+dnl FIXME:
+dnl autoconf 2.50 recommends AC_CONFIG_FILES and AC_OUPUT
+dnl This however requires automake 1.4p2 or better
+
+AC_OUTPUT([Makefile interface/Makefile patterns/Makefile sgf/Makefile
+utils/Makefile engine/Makefile doc/Makefile regression/Makefile config.vc:config.vcin])
diff --git a/gnugo/src/depcomp b/gnugo/src/depcomp
new file mode 100755
index 0000000000000000000000000000000000000000..3d9838bcf6d4be19225a6c92ab85d5ed2440cb62
--- /dev/null
+++ b/gnugo/src/depcomp
@@ -0,0 +1,411 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva .
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 AIX compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+
+ tmpdepfile1="$object.d"
+ tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
+ if test "$libtool" = yes; then
+ "$@" -Wc,-MD
+ else
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ test -z "$dashmflag" && dashmflag=-M
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*) # this is libtool, let us make it quiet
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ # X makedepend
+ (
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in no)
+ set ""; shift
+ cleared=yes
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/gnugo/src/doc/Makefile.am b/gnugo/src/doc/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..b333e6b56594440f2363a677507b7f6156ee80a0
--- /dev/null
+++ b/gnugo/src/doc/Makefile.am
@@ -0,0 +1,64 @@
+## Process this file with automake to create Makefile.in
+AUTOMAKE_OPTIONS=no-dependencies
+
+info_TEXINFOS = gnugo.texi
+
+gnugo_TEXINFOS = analyze.texi api.texi board.texi copying.texi dfa.texi \
+ dragon.texi eyes.texi gnugo.texi gtp.texi gtp-commands.texi \
+ influence.texi introduction.texi move_generation.texi \
+ moyo.texi overview.texi owl.texi patterns.texi \
+ reading.texi regression.texi sgf.texi using.texi \
+ utils.texi install.texi montecarlo.texi
+
+man_MANS = gnugo.6
+
+EPS = cdfa.eps dfa.eps dfa2.eps oldlogo.eps newlogo.eps \
+ path.eps sync-prod1.eps sync-prod2.eps logo-34.eps \
+ logo-32.eps logo-36.eps
+
+FIG = cdfa.fig dfa.fig dfa2.fig path.fig sync-prod1.fig sync-prod2.fig
+
+PNG = cdfa.png dfa.png dfa2.png path.png sync-prod1.png sync-prod2.png
+
+JPG = cdfa.jpg dfa.jpg dfa2.jpg oldlogo.jpg path.jpg sync-prod1.jpg \
+ sync-prod2.jpg newlogo.jpg logo-32.jpg logo-34.jpg logo-36.jpg
+
+PDF = cdfa.pdf dfa2.pdf dfa.pdf logo-34.pdf path.pdf sync-prod1.pdf \
+ sync-prod2.pdf logo-36.pdf
+
+EXTRA_DIST = automake-1.4.patch gnugo.6 gnugo.pod gtp-commands.sed \
+ $(EPS) $(FIG) $(PNG) $(JPG) $(PDF)
+
+CLEANFILES = *.log *.dvi *.aux *.vr *.tp *.ky *.pg *.cps *.fns *.toc \
+ *.fn *.cp *~
+
+TEXI2PDF = texi2pdf
+TEXI2HTML = texi2html
+
+gnugo.6: $(srcdir)/gnugo.pod
+ pod2man $(srcdir)/gnugo.pod --section 6 --release @VERSION@ > gnugo.6
+
+BUILT_SOURCES = gtp-commands.texi
+
+cmdsrc = $(srcdir)/../interface/play_gtp.c
+
+gnugo.pdf: gnugo.texi $(gnugo_TEXINFOS)
+ $(TEXI2PDF) $<
+
+gnugo.html: gnugo.texi $(gnugo_TEXINFOS)
+ $(TEXI2HTML) -split=chapter -nosec_nav -expand=tex $<
+
+## Rebuild gtp-commands.texi from play_gtp.c:
+
+gtp-commands:
+ sed -e '1r '$(srcdir)/gtp-commands.sed \
+ -e '/static struct gtp_command commands/,/^}/!d' \
+ -e '/^ /!d' -e '/NULL/d' \
+ -e 's/ *{"\(.*\)"[^a-z]*\(gtp_[a-z_]*\)}.*/s,\2,\1,g/' \
+ $(cmdsrc) > TMP.sed
+ sed -f TMP.sed $(cmdsrc) > $(srcdir)/gtp-commands.texi
+ rm -f TMP.sed
+
+
+
+
diff --git a/gnugo/src/doc/Makefile.in b/gnugo/src/doc/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..7de38817b95225fea103068d14f397b0e8adbcd3
--- /dev/null
+++ b/gnugo/src/doc/Makefile.in
@@ -0,0 +1,555 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = doc
+DIST_COMMON = $(gnugo_TEXINFOS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in texinfo.tex
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+INFO_DEPS = $(srcdir)/gnugo.info
+am__TEXINFO_TEX_DIR = $(srcdir)
+DVIS = gnugo.dvi
+PDFS = gnugo.pdf
+PSS = gnugo.ps
+HTMLS = gnugo.html
+TEXINFOS = gnugo.texi
+TEXI2DVI = texi2dvi
+MAKEINFOHTML = $(MAKEINFO) --html
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
+DVIPS = dvips
+am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man6dir)"
+man6dir = $(mandir)/man6
+NROFF = nroff
+MANS = $(man_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DFA_ENABLED_FALSE = @DFA_ENABLED_FALSE@
+DFA_ENABLED_TRUE = @DFA_ENABLED_TRUE@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_ONLY_FALSE = @GCC_ONLY_FALSE@
+GCC_ONLY_TRUE = @GCC_ONLY_TRUE@
+GNU_GO_WARNINGS = @GNU_GO_WARNINGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+glibconfig = @glibconfig@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = no-dependencies
+info_TEXINFOS = gnugo.texi
+gnugo_TEXINFOS = analyze.texi api.texi board.texi copying.texi dfa.texi \
+ dragon.texi eyes.texi gnugo.texi gtp.texi gtp-commands.texi \
+ influence.texi introduction.texi move_generation.texi \
+ moyo.texi overview.texi owl.texi patterns.texi \
+ reading.texi regression.texi sgf.texi using.texi \
+ utils.texi install.texi montecarlo.texi
+
+man_MANS = gnugo.6
+EPS = cdfa.eps dfa.eps dfa2.eps oldlogo.eps newlogo.eps \
+ path.eps sync-prod1.eps sync-prod2.eps logo-34.eps \
+ logo-32.eps logo-36.eps
+
+FIG = cdfa.fig dfa.fig dfa2.fig path.fig sync-prod1.fig sync-prod2.fig
+PNG = cdfa.png dfa.png dfa2.png path.png sync-prod1.png sync-prod2.png
+JPG = cdfa.jpg dfa.jpg dfa2.jpg oldlogo.jpg path.jpg sync-prod1.jpg \
+ sync-prod2.jpg newlogo.jpg logo-32.jpg logo-34.jpg logo-36.jpg
+
+PDF = cdfa.pdf dfa2.pdf dfa.pdf logo-34.pdf path.pdf sync-prod1.pdf \
+ sync-prod2.pdf logo-36.pdf
+
+EXTRA_DIST = automake-1.4.patch gnugo.6 gnugo.pod gtp-commands.sed \
+ $(EPS) $(FIG) $(PNG) $(JPG) $(PDF)
+
+CLEANFILES = *.log *.dvi *.aux *.vr *.tp *.ky *.pg *.cps *.fns *.toc \
+ *.fn *.cp *~
+
+TEXI2PDF = texi2pdf
+TEXI2HTML = texi2html
+BUILT_SOURCES = gtp-commands.texi
+cmdsrc = $(srcdir)/../interface/play_gtp.c
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .dvi .html .info .pdf .ps .texi
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+.texi.info:
+ restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+ am__cwd=`pwd` && cd $(srcdir) && \
+ rm -rf $$backupdir && mkdir $$backupdir && \
+ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+ done; \
+ else :; fi && \
+ cd "$$am__cwd"; \
+ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $@ $<; \
+ then \
+ rc=0; \
+ cd $(srcdir); \
+ else \
+ rc=$$?; \
+ cd $(srcdir) && \
+ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+ fi; \
+ rm -rf $$backupdir; exit $$rc
+
+.texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) $<
+
+.texi.pdf:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) $<
+
+.texi.html:
+ rm -rf $(@:.html=.htp)
+ if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $(@:.html=.htp) $<; \
+ then \
+ rm -rf $@; \
+ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ else \
+ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+ exit 1; \
+ fi
+$(srcdir)/gnugo.info: gnugo.texi $(gnugo_TEXINFOS)
+gnugo.dvi: gnugo.texi $(gnugo_TEXINFOS)
+.dvi.ps:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) -o $@ $<
+
+uninstall-info-am:
+ @$(PRE_UNINSTALL)
+ @if (install-info --version && \
+ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
+ install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+ done; \
+ else :; fi
+ @$(NORMAL_UNINSTALL)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
+ (if cd "$(DESTDIR)$(infodir)"; then \
+ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
+ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
+ else :; fi); \
+ done
+
+dist-info: $(INFO_DEPS)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(INFO_DEPS)'; \
+ for base in $$list; do \
+ case $$base in \
+ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
+ if test -f $$file; then \
+ relfile=`expr "$$file" : "$$d/\(.*\)"`; \
+ test -f $(distdir)/$$relfile || \
+ cp -p $$file $(distdir)/$$relfile; \
+ else :; fi; \
+ done; \
+ done
+
+mostlyclean-aminfo:
+ -rm -rf gnugo.aux gnugo.cp gnugo.cps gnugo.fn gnugo.fns gnugo.ky gnugo.kys \
+ gnugo.log gnugo.pg gnugo.pgs gnugo.tmp gnugo.toc gnugo.tp \
+ gnugo.tps gnugo.vr gnugo.vrs gnugo.dvi gnugo.pdf gnugo.ps \
+ gnugo.html
+
+maintainer-clean-aminfo:
+ @list='$(INFO_DEPS)'; for i in $$list; do \
+ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
+ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
+ done
+install-man6: $(man6_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man6dir)" || $(mkdir_p) "$(DESTDIR)$(man6dir)"
+ @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.6*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 6*) ;; \
+ *) ext='6' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst"; \
+ done
+uninstall-man6:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.6*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 6*) ;; \
+ *) ext='6' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man6dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man6dir)/$$inst"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-info
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(INFO_DEPS) $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man6dir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am: $(DVIS)
+
+html: html-am
+
+html-am: $(HTMLS)
+
+info: info-am
+
+info-am: $(INFO_DEPS)
+
+install-data-am: install-info-am install-man
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+ if test -f $$ifile; then \
+ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
+ echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
+ $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if (install-info --version && \
+ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
+ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
+ done; \
+ else : ; fi
+install-man: install-man6
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+ maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am: $(PDFS)
+
+ps: ps-am
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man6
+
+.PHONY: all all-am check check-am clean clean-generic dist-info \
+ distclean distclean-generic distdir dvi dvi-am html html-am \
+ info info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-man6 install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
+ mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-info-am uninstall-man \
+ uninstall-man6
+
+
+gnugo.6: $(srcdir)/gnugo.pod
+ pod2man $(srcdir)/gnugo.pod --section 6 --release @VERSION@ > gnugo.6
+
+gnugo.pdf: gnugo.texi $(gnugo_TEXINFOS)
+ $(TEXI2PDF) $<
+
+gnugo.html: gnugo.texi $(gnugo_TEXINFOS)
+ $(TEXI2HTML) -split=chapter -nosec_nav -expand=tex $<
+
+gtp-commands:
+ sed -e '1r '$(srcdir)/gtp-commands.sed \
+ -e '/static struct gtp_command commands/,/^}/!d' \
+ -e '/^ /!d' -e '/NULL/d' \
+ -e 's/ *{"\(.*\)"[^a-z]*\(gtp_[a-z_]*\)}.*/s,\2,\1,g/' \
+ $(cmdsrc) > TMP.sed
+ sed -f TMP.sed $(cmdsrc) > $(srcdir)/gtp-commands.texi
+ rm -f TMP.sed
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnugo/src/doc/analyze.texi b/gnugo/src/doc/analyze.texi
new file mode 100644
index 0000000000000000000000000000000000000000..533cbd12a537ec5eb44fc5f7ae58e41757dd8ece
--- /dev/null
+++ b/gnugo/src/doc/analyze.texi
@@ -0,0 +1,265 @@
+In this chapter we will discuss methods of finding
+out how GNU Go understands a given position. These
+methods will be of interest to anyone working on the
+program, or simply curious about its workings.
+
+In practice, most tuning of GNU Go is done in conjunction
+with maintaining the @file{regression/} directory
+(@pxref{Regression}).
+
+We assume that you have a game GNU Go played saved
+as an sgf file, and you want to know why it made a
+certain move.
+
+@menu
+* Traces:: Analyzing traces in GNU Go 3.6
+* Output File:: The Output File
+* Decide string:: Checking the reading code
+* Decide dragon:: Checking the owl code
+* GTP and GDB techniques:: GTP and GDB techniques
+* view.pike:: Debugging on a Graphic Board
+* Scoring:: Finding out the winner of the game
+* Colored Display:: Colored Display
+@end menu
+
+@node Traces
+@section Interpreting Traces
+@cindex traces
+@cindex tuning GNU Go
+
+A quick way to find out roughly the reason for a move is to run
+
+@example
+gnugo -l @var{filename} -t -L @var{move number}
+@end example
+
+(You may also want to add @option{--quiet} to suppress the copyright
+message.) In GNU Go 3.6, the moves together with their reasons are
+listed, followed by a numerical analysis of the values given to each
+move.
+
+If you are tuning (@pxref{Tuning}) you may want to add the @option{-a}
+option. This causes GNU Go to report all patterns matched, even ones
+that cannot affect the outcome of the move. The reasons for doing
+this is that you may want to modify a pattern already matched
+instead of introducing a new one.
+
+If you use the @option{-w} option, GNU Go will report the statuses of
+worms and dragons around the board. This type of information is
+available by different methods, however (@pxref{view.pike},
+@pxref{Colored Display}).
+
+@node Output File
+@section The Output File
+@cindex output file
+
+If GNU Go is invoked with the option @option{-o filename} it will
+produce an output file. This option can be added at the command line
+in the Go Modem Protocol Setup Window of CGoban. The output file will
+show the locations of the moves considered and their weights. It is
+worth noting that by enlarging the CGoban window to its fullest size
+it can display 3 digit numbers. Dragons with status @code{DEAD} are
+labelled with an @samp{X}, and dragons with status @code{CRITICAL} are
+labelled with a @samp{!}.
+
+If you have a game file which is not commented this way, or
+which was produced by a non-current version of GNU Go you may
+ask GNU Go to produce a commented version by running:
+
+@example
+gnugo --quiet -l --replay -o
+@end example
+
+@noindent
+Here can be 'black,' 'white' or 'both'. The replay
+option will also help you to find out if your current version
+of GNU Go would play differently than the program that created
+the file.
+
+@node Decide string
+@section Checking the reading code
+@cindex decide-string
+
+The @option{--decide-string} option is used to check the tactical reading code
+(@pxref{Tactical Reading}). This option takes an argument, which is a location
+on the board in the usual algebraic notation (e.g.
+@option{--decide-string C17}). This will tell you whether the reading code (in
+@file{engine/reading.c}) believes the string can be captured, and if so,
+whether it believes it can be defended, which moves it finds to attack or
+defend the move, how many nodes it searched in coming to these
+conclusions. Note that when GNU Go runs normally (not with
+@option{--decide-string}) the points of attack and defense are
+computed when @code{make_worms()} runs and cached in
+@code{worm.attack} and @code{worm.defend}.
+
+If used with an output file (@option{-o @var{filename}})
+@option{--decide-string} will produce a variation tree showing
+all the variations which are considered. This is a useful way
+of debugging the reading code, and also of educating yourself
+with the way it works. The variation tree can be displayed
+graphically using CGoban.
+
+At each node, the comment contains some information. For example you
+may find a comment:
+
+@example
+
+attack4-B at D12 (variation 6, hash 51180fdf)
+break_chain D12: 0
+defend3 D12: 1 G12 (trivial extension)
+
+@end example
+
+This is to be interpreted as follows. The node in question
+was generated by the function @code{attack3()} in @file{engine/reading.c},
+which was called on the string at @code{D12}. The data in
+parentheses tell you the values of @code{count_variations} and
+@code{hashdata.hashval}.
+
+The second value (``hash'') you probably will not need to know
+unless you are debugging the hash code, and we will not discuss it.
+But the first value (``variation'') is useful when using the debugger
+@command{gdb}. You can first make an output file using
+the @option{-o} option, then walk through the reading with
+@command{gdb}, and to coordinate the SGF file with the debugger,
+display the value of @code{count_variations}. Specifically,
+from the debugger you can find out where you are as follows:
+
+@example
+(gdb) set dump_stack()
+B:D13 W:E12 B:E13 W:F12 B:F11 (variation 6)
+@end example
+
+If you place yourself right after the call to @code{trymove()}
+which generated the move in question, then the variation number
+in the SGF file should match the variation number displayed by
+@code{dump_stack()}, and the move in question will be the
+last move played (F11 in this example).
+
+This displays the sequence of moves leading up to the variation
+in question, and it also prints @code{count_variations-1}.
+
+The second two lines tell you that from this node, the function
+@code{break_chain()} was called at D12 and returned 0 meaning
+that no way was found of rescuing the string by attacking
+an element of the surrounding chain, and the function
+@code{defend3()} was called also at D12 and returned 1,
+meaning that the string can be defended, and that
+G12 is the move that defends it. If you have trouble
+finding the function calls which generate these comments,
+try setting @code{sgf_dumptree=1} and setting a breakpoint in
+@code{sgf_trace}.
+
+@node Decide dragon
+@section Checking the Owl Code
+@cindex decide-dragon
+
+You can similarly debug the Owl code using the option
+@option{--decide-dragon}. Usage is entirely similar to
+@option{--decide-string}, and it can be used similarly
+to produce variation trees. These should be typically
+much smaller than the variation trees produced by
+@option{--decide-string}.
+
+@node GTP and GDB techniques
+@section GTP and GDB techniques
+@cindex GDB
+@cindex GTP
+
+You can use the Go Text Protocol (@pxref{GTP}) to determine
+the statuses of dragons and other information needed for
+debugging. The GTP command @command{dragon_data P12} will list
+the dragon data of the dragon at @code{P12} and
+@command{worm_data} will list the worm data; other GTP
+commands may be useful as well.
+
+You can also conveniently get such information from GDB.
+A suggested @file{.gdbinit} file may be found in
+@xref{Debugging}. Assuming this file is loaded, you can
+list the dragon data with the command:
+
+@example
+(gdb) dragon P12
+@end example
+
+Similarly you can get the worm data with @command{worm P12}.
+
+@node view.pike
+@section Debugging on a Graphical Board
+@cindex debugging on a graphical board
+
+The quickest way to analyze most positions is to use the tool
+@file{view.pike} in the @file{regression} directory. It can be started
+with a testcase specified, e.g. @command{pike view.pike strategy:40} or
+at a move in an sgf file, e.g. @command{pike view.pike mistake.sgf:125}.
+When started it shows the position on a grapical board on which it also
+marks information like move values, dragon status, and so on. By
+clicking on the board further information about the valuation of moves,
+contents of various data structures, and other data can be made
+available.
+
+Specific information on how to use @file{view.pike} for influence tuning
+can be found in @xref{Influence Tuning}.
+
+@node Scoring
+@section Scoring the game
+@cindex scoring
+
+GNU Go can score the game. Normally GNU Go will report its opinion about
+the score at the end of the game, but if you want this information about
+a game stored in a file, use the @option{--score} option (@pxref{Invoking
+GNU Go}).
+
+@node Colored Display
+@section Colored Display
+@cindex colored display
+
+Various colored displays of the board may be obtained in a color
+@command{xterm} or @command{rxvt} window. Xterm will only work if xterm is
+compiled with color support. If the colors are not displayed on your xterm,
+try @command{rxvt}. You may also use the Linux console. The colored display
+will work best if the background color is black; if this is not the case you
+may want to edit your @file{.Xdefaults} file or add the options
+@option{-bg black -fg white} to @command{xterm} or @command{rxvt}.
+On Mac OS X put @command{setenv TERM xterm-color} in your @file{.tcshrc}
+file to enable color in the terminal.
+
+@subsection Dragon Display
+
+You can get a colored ASCII display of the board in which each dragon
+is assigned a different letter; and the different @code{matcher_status} values
+(@code{ALIVE}, @code{DEAD}, @code{UNKNOWN}, @code{CRITICAL}) have different
+colors. This is very handy for debugging. Actually two diagrams are generated.
+The reason for this is concerns the way the matcher status is computed.
+The dragon_status (@pxref{Dragons}) is computed first, then for some, but not
+all dragons, a more accurate owl status is computed. The matcher status is
+the owl status if available; otherwise it is the dragon_status. Both the
+dragon_status and the owl_status are displayed. The color scheme is as
+follows:
+
+@example
+green = alive
+cyan = dead
+red = critical
+yellow = unknown
+magenta = unchecked
+@end example
+
+To get the colored display, save a game in sgf format using CGoban, or using
+the @option{-o} option with GNU Go itself.
+
+Open an @command{xterm} or @command{rxvt} window.
+
+Execute @command{gnugo -l [filename] -L [movenum] -T} to get the colored
+display.
+
+Other useful colored displays may be obtained by using instead:
+
+@subsection Eye Space Display
+@cindex eye space display
+
+Instead of @option{-T}, try this with @option{-E}. This gives a colored
+display of the eyespaces, with marginal eye spaces marked @samp{!}
+(@pxref{Eyes}).
+
+
diff --git a/gnugo/src/doc/api.texi b/gnugo/src/doc/api.texi
new file mode 100644
index 0000000000000000000000000000000000000000..8d980256ba054f166c04c1b3981132f3a7dc03e3
--- /dev/null
+++ b/gnugo/src/doc/api.texi
@@ -0,0 +1,426 @@
+If you want to write your own interface to GNU Go, or if you want to
+create a go application using the GNU Go engine, this chapter is of
+interest to you.
+
+First an overview: GNU Go consists of two parts: the GNU Go @i{engine}
+and a program (user interface) which uses this engine. These are linked
+together into one binary. The current program implements the following
+user modes:
+
+@itemize @bullet
+@item An interactive board playable on ASCII terminals
+@item solo play - GNU Go plays against itself
+@item replay - a mode which lets the user investigate moves in an existing
+SGF file.
+@item GMP - Go Modem Protocol, a protocol for automatic play between two
+computers.
+@item GTP - Go Text Protocol, a more general go protocol, @pxref{GTP}.
+@end itemize
+@cindex API
+
+The GNU Go engine can be used in other applications. For example, supplied
+with GNU Go is another program using the engine, called @file{debugboard},
+in the directory @file{interface/debugboard/}. The program debugboard lets the
+user load SGF files and can then interactively look at different properties of
+the position such as group status and eye status.
+
+The purpose of this Chapter is to show how to interface your own
+program such as @code{debugboard} with the GNU Go engine.
+
+Figure 1 describes the structure of a program using the GNU Go
+engine.
+
+@example
+@group
+ +-----------------------------------+
+ | |
+ | Go application |
+ | |
+ +-----+----------+------+ |
+ | | | | |
+ | | Game | | |
+ | | handling | | |
+ | | | | |
+ | +----+-----+ | |
+ | SGF | Move | |
+ | handling | generation | |
+ | | | |
+ +----------+------------+-----------+
+ | |
+ | Board handling |
+ | |
+ +-----------------------------------+
+
+ Figure 1: The structure of a program using the GNU Go engine
+
+@end group
+@end example
+
+The foundation is a library called @code{libboard.a} which provides
+efficient handling of a go board with rule checks for moves, with
+incremental handling of connected strings of stones and with methods to
+efficiently hash go positions.
+
+On top of this, there is a library which helps the application use
+Smart Game Format (SGF) files, with complete handling of game trees in
+memory and in files. This library is called @code{libsgf.a}
+
+The main part of the code within GNU Go is the move generation
+library which given a position generates a move. This part of the
+engine can also be used to manipulate a go position, add or remove
+stones, do tactical and strategic reading and to query the engine for
+legal moves. These functions are collected into @code{libengine.a}.
+
+The game handling code helps the application programmer keep tracks
+of the moves in a game. Games can be saved to
+SGF files and then later be read back again. These are also within
+@code{libengine.a}.
+
+The responsibility of the application is to provide the user with a
+user interface, graphical or not, and let the user interact with the
+engine.
+
+@menu
+* Getting Started:: How to use the engine in your program
+* Basic Data Structures:: Basic Data Structures in the Engine
+* The Board State:: The board_state `struct'
+* Positional Functions:: Functions which manipulate a Position
+@end menu
+
+@node Getting Started
+
+@section How to use the engine in your own program: getting started
+
+To use the GNU Go engine in your own program you must include
+the file @file{gnugo.h}. This file describes the whole public API. There is
+another file, @file{liberty.h}, which describes the internal interface within
+the engine. If you want to make a new module within the engine, e.g. for
+suggesting moves you will have to include this file also. In this section we
+will only describe the public interface.
+
+@findex init_gnugo
+ Before you do anything else, you have to call the function
+@code{init_gnugo()}. This function initializes everything within the engine.
+It takes one parameter: the number of megabytes the engine can use for
+the internal hash table. In addition to this the engine will use a few
+megabytes for other purposes such as data describing groups (liberties,
+life status, etc), eyes and so on.
+
+@node Basic Data Structures
+@section Basic Data Structures in the Engine
+@cindex data structures
+@cindex position struct
+
+
+ There are some basic definitions in gnugo.h which are used
+everywhere. The most important of these are the numeric declarations of
+colors. Each intersection on the board is represented by one of these:
+
+@example
+@group
+
+ color value
+ EMPTY 0
+ WHITE 1
+ BLACK 2
+
+@end group
+@end example
+
+There is a macro, @code{OTHER_COLOR(color)} which can be used to get the
+other color than the parameter. This macro can only be used on @code{WHITE}
+or @code{BLACK}, but not on @code{EMPTY}.
+@findex OTHER_COLOR
+
+GNU Go uses two different representations of the board, for
+most purposes a one-dimensional one, but for a few purposes a
+two dimensional one (@pxref{Libboard}). The one-dimensional
+board was introduced before GNU Go 3.2, while the two-dimensional
+board dates back to the ancestral program written by Man Lung Li
+before 1995. The API still uses the two-dimensional board, so
+the API functions have not changed much since GNU Go 3.0.
+
+@node The Board State
+
+@section The board_state struct
+@cindex board_state
+
+A basic data structure in the engine is the @code{board_state} struct.
+This structure is internal to the engine and is defined in @file{liberty.h}.
+
+@example
+@group
+
+ typedef unsigned char Intersection;
+
+ struct board_state @{
+ int board_size;
+
+ Intersection board[BOARDSIZE];
+ int board_ko_pos;
+ int black_captured;
+ int white_captured;
+
+ Intersection initial_board[BOARDSIZE];
+ int initial_board_ko_pos;
+ int initial_white_captured;
+ int initial_black_captured;
+ int move_history_color[MAX_MOVE_HISTORY];
+ int move_history_pos[MAX_MOVE_HISTORY];
+ int move_history_pointer;
+
+ float komi;
+ int move_number;
+ @};
+
+@end group
+@end example
+
+Here @code{Intersection} stores @code{EMPTY}, @code{WHITE} or
+@code{BLACK}. It is currently defined as an @code{unsigned char} to make
+it reasonably efficient in both storage and access time. The board state
+contains an array of @code{Intersection}'s representing the board.
+The move history is contained in the struct. Also contained in
+the struct is the location of a ko (@code{EMPTY}) if the last
+move was not a ko capture, the komi, the number of captures, and
+corresponding data for the initial position at the beginning
+of the move history.
+
+@node Positional Functions
+
+@section Functions which manipulate a Position
+
+All the functions in the engine that manipulate Positions have names
+prefixed by @code{gnugo_}. These functions still use the two-dimensional
+representation of the board (@pxref{The Board Array}). Here is a complete
+list, as prototyped in @file{gnugo.h}:
+
+@itemize
+@item @code{void init_gnugo(float memory)}
+@findex init_gnugo
+@quotation
+Initialize the gnugo engine. This needs to be called
+once only.
+@end quotation
+@item @code{void gnugo_clear_board(int boardsize)}
+@findex gnugo_clear_board
+@quotation
+Clear the board.
+@end quotation
+@item @code{void gnugo_set_komi(float new_komi)}
+@findex gnugo_set_komi
+@quotation
+Set the komi.
+@end quotation
+@item @code{void gnugo_add_stone(int i, int j, int color)}
+@findex gnugo_add_stone
+@quotation
+Place a stone on the board
+@end quotation
+@item @code{void gnugo_remove_stone(int i, int j)}
+@findex gnugo_remove_stone
+@quotation
+Remove a stone from the board
+@end quotation
+@item @code{int gnugo_is_pass(int i, int j)}
+@findex gnugo_is_pass
+@quotation
+Return true if (i,j) is PASS_MOVE
+@end quotation
+@item @code{void gnugo_play_move(int i, int j, int color)}
+@findex gnugo_play_move
+@quotation
+Play a move and start the clock
+@end quotation
+@item @code{int gnugo_undo_move(int n)}
+@findex gnugo_undo_move
+@quotation
+Undo n permanent moves. Returns 1 if successful and 0 if it fails.
+If n moves cannot be undone, no move is undone.
+@end quotation
+@item @code{int gnugo_play_sgfnode(SGFNode *node, int to_move)}
+@findex gnugo_play_sgfnode
+@quotation
+Perform the moves and place the stones from the SGF node on the
+board. Return the color of the player whose turn it is to move.
+@end quotation
+@item @code{int gnugo_play_sgftree(SGFNode *root, int *until, SGFNode **curnode)}
+@findex gnugo_play_sgftree
+@quotation
+Play the moves in ROOT UNTIL movenumber is reached. Return the color of the
+player whose turn it is to move.
+@end quotation
+@item @code{int gnugo_is_legal(int i, int j, int color)}
+@findex gnugo_is_legal
+@quotation
+Interface to @code{is_legal()}.
+@end quotation
+@item @code{int gnugo_is_suicide(int i, int j, int color)}
+@findex gnugo_is_suicide
+@quotation
+Interface to @code{is_suicide()}.
+@end quotation
+@item @code{int gnugo_placehand(int handicap)}
+@findex gnugo_placehand
+@quotation
+Interface to placehand. Sets up handicap pieces and
+returns the number of placed handicap stones.
+@end quotation
+@item @code{void gnugo_recordboard(SGFNode *root)}
+@findex gnugo_recordboard
+@quotation
+Interface to @code{sgffile_recordboard()}
+@end quotation
+@item @code{int gnugo_sethand(int handicap, SGFNode *node)}
+@findex gnugo_sethand
+@quotation
+Interface to placehand. Sets up handicap stones and
+returns the number of placed handicap stones, updating the sgf file
+@end quotation
+@item @code{float gnugo_genmove(int *i, int *j, int color, int *resign)}
+@findex gnugo_genmove
+@quotation
+Interface to @code{genmove()}.
+@end quotation
+@item @code{int gnugo_attack(int m, int n, int *i, int *j)}
+@findex gnugo_attack
+@quotation
+Interface to @code{attack()}.
+@end quotation
+@item @code{int gnugo_find_defense(int m, int n, int *i, int *j)}
+@findex gnugo_find_defense
+@quotation
+Interface to @code{find_defense()}.
+@end quotation
+@item @code{void gnugo_who_wins(int color, FILE *outfile)}
+@findex gnugo_who_wins
+@quotation
+Interface to @code{who_wins()}.
+@end quotation
+@item @code{float gnugo_estimate_score(float *upper, float *lower)}
+@findex gnugo_estimate_score
+@quotation
+Put upper and lower score estimates into @code{*upper}, @code{*lower} and
+return the average. A positive score favors white. In computing
+the upper bound, @code{CRITICAL} dragons are awarded to white; in
+computing the lower bound, they are awarded to black.
+@end quotation
+@item @code{void gnugo_examine_position(int color, int how_much)}
+@findex gnugo_examine_position
+@quotation
+Interface to @code{examine_position}.
+@end quotation
+@item @code{int gnugo_get_komi()}
+@findex gnugo_get_komi
+@quotation
+Report the komi.
+@end quotation
+@item @code{void gnugo_get_board(int b[MAX_BOARD][MAX_BOARD])}
+@findex gnugo_get_board
+@quotation
+Place the board into the @samp{b} array.
+@end quotation
+@item @code{int gnugo_get_boardsize()}
+@findex gnugo_get_boardsize
+@quotation
+Report the board size.
+@end quotation
+@item @code{int gnugo_get_move_number()}
+@findex gnugo_get_move_number
+@quotation
+Report the move number.
+@end quotation
+@end itemize
+
+@section Game handling
+
+The functions (in @pxref{Positional Functions}) are all that are needed to
+create a fully functional go program. But to make the life easier for the
+programmer, there is a small set of functions specially designed for handling
+ongoing games.
+
+The data structure describing an ongoing game is the @code{Gameinfo}. It
+is defined as follows:
+
+@example
+@group
+
+typedef struct @{
+ int handicap;
+
+ int to_move; /* whose move it currently is */
+ SGFTree game_record; /* Game record in sgf format. */
+
+ int computer_player; /* BLACK, WHITE, or EMPTY (used as BOTH) */
+
+ char outfilename[128]; /* Trickle file */
+ FILE *outfile;
+@} Gameinfo;
+
+@end group
+@end example
+
+The meaning of @code{handicap} should be obvious. @code{to_move} is the
+color of the side whose turn it is to move.
+
+The SGF tree @code{game_record} is used to store all the moves in the entire
+game, including a header node which contains, among other things, komi
+and handicap.
+
+If one or both of the opponents is the computer, the field
+@code{computer_player} is used. Otherwise it can be ignored.
+
+GNU Go can use a trickle file to continuously save all the moves of an
+ongoing game. This file can also contain information about internal
+state of the engine such as move reasons for various locations or move
+valuations. The name of this file should
+be stored in @code{outfilename} and the file pointer to the open file is
+stored in @code{outfile}. If no trickle file is used,
+@code{outfilename[0]} will contain a null character and @code{outfile}
+will be set to @code{NULL}.
+
+@subsection Functions which manipulate a Gameinfo
+
+All the functions in the engine that manipulate Gameinfos have names
+prefixed by @code{gameinfo_}. Here is a complete list, as prototyped in
+@file{gnugo.h}:
+
+@itemize
+@item @code{void gameinfo_clear(Gameinfo *ginfo, int boardsize, float komi)}
+@findex gameinfo_clear
+@quotation
+Initialize the @code{Gameinfo} structure.
+@end quotation
+@item @code{void gameinfo_print(Gameinfo *ginfo)}
+@findex gameinfo_print
+@quotation
+Print a gameinfo.
+@end quotation
+@item @code{void gameinfo_load_sgfheader(Gameinfo *gameinfo, SGFNode *head)}
+@findex gameinfo_load_sgfheader
+@quotation
+Reads header info from sgf structure and sets the appropriate variables.
+@end quotation
+@item @code{void gameinfo_play_move(Gameinfo *ginfo, int i, int j, int color)}
+@findex gameinfo_play_move
+@quotation
+Make a move in the game. Return 1 if the move was legal. In that
+case the move is actually done. Otherwise return 0.
+@end quotation
+@item @code{int gameinfo_play_sgftree_rot(Gameinfo *gameinfo, SGFNode *head, const char *untilstr, int orientation)}
+@findex gameinfo_play_sgftree_rot
+@quotation
+Play the moves in an SGF tree. Walk the main variation, actioning the
+properties into the playing board. Returns the color of the next move to be
+made. Head is an sgf tree. Untilstr is an optional string of the form either
+'L12' or '120' which tells it to stop playing at that move or move
+number. When debugging, this is the location of the move being examined.
+@end quotation
+@item @code{int gameinfo_play_sgftree(Gameinfo *gameinfo, SGFNode *head, const char *untilstr)}
+@findex gameinfo_play_sgftree
+@quotation
+Same as previous function, using standard orientation.
+@end quotation
+@end itemize
+
+
diff --git a/gnugo/src/doc/automake-1.4.patch b/gnugo/src/doc/automake-1.4.patch
new file mode 100644
index 0000000000000000000000000000000000000000..607c07723fbef746ae3eb461ebeaa2c4041c90fd
--- /dev/null
+++ b/gnugo/src/doc/automake-1.4.patch
@@ -0,0 +1,11 @@
+--- automake.orig Sat Jan 16 19:37:42 1999
++++ automake Sat Oct 30 15:55:04 1999
+@@ -2367,7 +2367,7 @@
+ $output_rules .= "\t d=\$(srcdir); \\\n";
+ }
+ $output_rules .= ("\t if test -d \$\$d/\$\$file; then \\\n"
+- . "\t cp -pr \$\$/\$\$file \$(distdir)/\$\$file; \\\n"
++ . "\t cp -pr \$\$d/\$\$file \$(distdir)/\$\$file; \\\n"
+ . "\t else \\\n"
+ . "\t test -f \$(distdir)/\$\$file \\\n"
+ . "\t || ln \$\$d/\$\$file \$(distdir)/\$\$file 2> /dev/null \\\n"
diff --git a/gnugo/src/doc/board.texi b/gnugo/src/doc/board.texi
new file mode 100644
index 0000000000000000000000000000000000000000..64595cd6d73bc307e17c0c3a50972d44c48b2b02
--- /dev/null
+++ b/gnugo/src/doc/board.texi
@@ -0,0 +1,573 @@
+@menu
+* Board Data Structures:: Board Data Structures
+* The Board Array:: One-dimensional board array
+* Incremental Board:: Incremental board data structures
+* Some Board Functions:: Explanation of some board functions
+@end menu
+
+The foundation of the GNU Go engine is a library of very efficient
+routines for handling go boards. This board library, called
+@file{libboard}, can be used for those programs that only need a
+basic go board but no AI capability. One such program is
+@file{patterns/joseki.c}, which compiles joseki pattern
+databases from SGF files.
+
+If you want to use the board library in your own program, you need all
+the .c-files listed under libboard_SOURCES in engine/Makefile.am, and
+the files in the directories sgf/ and utils/. Then you should include
+engine/board.h in your code.
+
+The library consists of the following files:
+
+@itemize
+@item @file{board.h}
+@quotation
+The public interface to the board library.
+@end quotation
+
+@item @file{board.c}
+@quotation
+The basic board code. It uses incremental algorithms for keeping track
+of strings and liberties on the go board.
+@end quotation
+
+@item @file{boardlib.c}
+@quotation
+This contains all global variable of the board library.
+@end quotation
+
+@item @file{hash.c}
+@quotation
+Code for hashing go positions.
+@end quotation
+
+@item @file{sgffile.c}
+@quotation
+Implementation of output file in SGF format.
+@end quotation
+
+@item @file{printutils.c}
+@quotation
+Utilities for printing go boards and other things.
+@end quotation
+
+@end itemize
+
+To use the board library, you must include @file{liberty.h} just like
+when you use the whole engine, but of course you cannot use all the
+functions declared in it, i.e. the functions that are part of the
+engine, but not part of the board library. You must link your
+application with @code{libboard.a}.
+
+@node Board Data Structures
+@section Board Data structures
+
+The basic data structures of the board correspond tightly to the
+@code{board_state} struct described in @xref{The Board State}. They are all
+stored in global variables for efficiency reasons, the most important of which
+are:
+
+@example
+@group
+
+int board_size;
+Intersection board[MAXSIZE];
+int board_ko_pos;
+
+float komi;
+int white_captured;
+int black_captured;
+
+Hash_data hashdata;
+@end group
+@end example
+
+The description of the @code{Position} struct is applicable to these
+variables also, so we won't duplicate it here. All these variables are
+globals for performance reasons. Behind these variables, there are a
+number of other private data structures. These implement incremental
+handling of strings, liberties and other properties
+(@pxref{Incremental Board}). The variable @code{hashdata} contains information
+about the hash value for the current position (@pxref{Hashing}).
+
+These variables should never be manipulated directly, since they are
+only the front end for the incremental machinery. They can be read, but
+should only be written by using the functions described in the next
+section. If you write directly to them, the incremental data structures
+will become out of sync with each other, and a crash is the likely
+result.
+
+@node The Board Array
+@section The Board Array
+
+GNU Go represents the board in a one-dimensional array called
+@code{board}. For some purposes a two dimensional indexing of the
+board by parameters @code{(i,j)} might be used.
+
+The @code{board} array includes out-of-board markers around the
+board. To make the relation to the old two-dimensional board
+representation clear, this figure shows how the 1D indices correspond
+to the 2D indices when MAX_BOARD is 7.
+
+@example
+@group
+ j -1 0 1 2 3 4 5 6
+i +----------------------------------
+-1| 0 1 2 3 4 5 6 7
+ 0| 8 9 10 11 12 13 14 15
+ 1| 16 17 18 19 20 21 22 23
+ 2| 24 25 26 27 28 29 30 31
+ 3| 32 33 34 35 36 37 38 39
+ 4| 40 41 42 43 44 45 46 47
+ 5| 48 49 50 51 52 53 54 55
+ 6| 56 57 58 59 60 61 62 63
+ 7| 64 65 66 67 68 69 70 71 72
+@end group
+@end example
+
+To convert between a 1D index @code{pos} and a 2D index @code{(i,j)},
+the macros @code{POS}, @code{I}, and @code{J} are provided, defined as
+below:
+
+@example
+#define POS(i, j) ((MAX_BOARD + 2) + (i) * (MAX_BOARD + 1) + (j))
+#define I(pos) ((pos) / (MAX_BOARD + 1) - 1)
+#define J(pos) ((pos) % (MAX_BOARD + 1) - 1)
+@end example
+
+All 1D indices not corresponding to points on the board have the out
+of board marker value @code{GRAY}. Thus if @code{board_size} and
+@code{MAX_BOARD} both are 7, this looks like
+
+@example
+@group
+ j -1 0 1 2 3 4 5 6
+i +----------------------------------
+-1| # # # # # # # #
+ 0| # . . . . . . .
+ 1| # . . . . . . .
+ 2| # . . . . . . .
+ 3| # . . . . . . .
+ 4| # . . . . . . .
+ 5| # . . . . . . .
+ 6| # . . . . . . .
+ 7| # # # # # # # # #
+@end group
+@end example
+
+The indices marked @samp{#} have value @code{GRAY}.
+If @code{MAX_BOARD} is 7 and @code{board_size} is only 5:
+
+@example
+@group
+ j -1 0 1 2 3 4 5 6
+i +----------------------------------
+-1| # # # # # # # #
+ 0| # . . . . . # #
+ 1| # . . . . . # #
+ 2| # . . . . . # #
+ 3| # . . . . . # #
+ 4| # . . . . . # #
+ 5| # # # # # # # #
+ 6| # # # # # # # #
+ 7| # # # # # # # # #
+@end group
+@end example
+
+Navigation on the board is done by the @code{SOUTH}, @code{WEST},
+@code{NORTH}, and @code{EAST} macros,
+
+@example
+#define NS (MAX_BOARD + 1)
+#define WE 1
+#define SOUTH(pos) ((pos) + NS)
+#define WEST(pos) ((pos) - 1)
+#define NORTH(pos) ((pos) - NS)
+#define EAST(pos) ((pos) + 1)
+@end example
+
+There are also shorthand macros @code{SW}, @code{NW}, @code{NE},
+@code{SE}, @code{SS}, @code{WW}, @code{NN}, @code{EE} for two step
+movements.
+
+Any movement from a point on the board to an adjacent or diagonal
+vertex is guaranteed to produce a valid index into the board array, and
+the color found is GRAY if it is not on the board. To do explicit tests
+for out of board there are two macros
+
+@example
+#define ON_BOARD(pos) (board[pos] != GRAY)
+#define ON_BOARD1(pos) (((unsigned) (pos) < BOARDSIZE) && board[pos] != GRAY)
+@end example
+
+where the first one should be used in the algorithms and the second
+one is useful for assertion tests.
+
+The advantage of a one-dimensional board array is that it gives a
+significant performance advantage. We need only one variable to determine
+a board position, which means that many functions need less arguments. Also,
+often one computation is sufficient for 1D-coordinate where we would need
+two with two 2D-coordinates: If we, for example, want to have the
+coordinate of the upper right of @code{pos}, we can do this with
+@code{NORTH(EAST(pos))} instead of @code{(i+1, j-1)}.
+
+@strong{Important}: The 2D coordinate @code{(-1,-1)}, which is used for
+pass and sometimes to indicate no point, maps to the 1D coordinate
+@code{0}, not to @code{-1}. Instead of a plain @code{0}, use one of the
+macros @code{NO_MOVE} or @code{PASS_MOVE}.
+
+A loop over multiple directions is straightforwardly written:
+
+@example
+ for (k = 0; k < 4; k++) @{
+ int d = delta[k];
+ do_something(pos + d);
+ @}
+@end example
+
+The following constants are useful for loops over the entire board and
+allocation of arrays with a 1-1 mapping to the board.
+
+@example
+#define BOARDSIZE ((MAX_BOARD + 2) * (MAX_BOARD + 1) + 1)
+#define BOARDMIN (MAX_BOARD + 2)
+#define BOARDMAX (MAX_BOARD + 1) * (MAX_BOARD + 1)
+@end example
+
+@code{BOARDSIZE} is the actual size of the 1D board array,
+@code{BOARDMIN} is the first index corresponding to a point on the
+board, and @code{BOARDMAX} is one larger than the last index corresponding to
+a point on the board.
+
+Often one wants to traverse the board, carrying out some function
+at every vertex. Here are two possible ways of doing this:
+
+@example
+ int m, n;
+ for (m = 0; m < board_size; m++)
+ for (n = 0; n < board_size; n++) @{
+ do_something(POS(m, n));
+ @}
+@end example
+
+Or:
+
+@example
+ int pos;
+ for (pos = BOARDMIN; pos < BOARDMAX; pos++) @{
+ if (ON_BOARD(pos))
+ do_something(pos);
+ @}
+@end example
+
+
+@node Incremental Board
+@section Incremental Board data structures
+
+In addition to the global board state, the algorithms in @file{board.c}
+implement a method of incremental updates that keeps track of the
+following information for each string:
+
+@itemize @bullet
+@item The color of the string.
+@item Number of stones in the string.
+@item Origin of the string, i.e. a canonical reference point, defined
+to be the stone with smallest 1D board coordinate.
+@item A list of the stones in the string.
+@item Number of liberties.
+@item A list of the liberties. If there are too many liberties the list is
+truncated.
+@item The number of neighbor strings.
+@item A list of the neighbor strings.
+@end itemize
+
+The basic data structure is
+
+@example
+struct string_data @{
+ int color; /* Color of string, BLACK or WHITE */
+ int size; /* Number of stones in string. */
+ int origin; /* Coordinates of "origin", i.e. */
+ /* "upper left" stone. */
+ int liberties; /* Number of liberties. */
+ int libs[MAX_LIBERTIES]; /* Coordinates of liberties. */
+ int neighbors; /* Number of neighbor strings */
+ int neighborlist[MAXCHAIN]; /* List of neighbor string numbers. */
+ int mark; /* General purpose mark. */
+@};
+
+struct string_data string[MAX_STRINGS];
+@end example
+
+It should be clear that almost all information is stored in the
+@code{string} array. To get a mapping from the board coordinates to the
+@code{string} array we have
+
+@example
+static int string_number[BOARDMAX];
+@end example
+
+@noindent
+which contains indices into the @code{string} array. This information is only
+valid at nonempty vertices, however, so it is necessary to first
+verify that @code{board[pos] != EMPTY}.
+
+The @code{string_data} structure does not include an array of the stone
+coordinates. This information is stored in a separate array:
+
+@example
+static int next_stone[BOARDMAX];
+@end example
+
+This array implements cyclic linked lists of stones. Each vertex
+contains a pointer to another (possibly the same) vertex. Starting at
+an arbitrary stone on the board, following these pointers should
+traverse the entire string in an arbitrary order before coming back to
+the starting point. As for the 'string_number' array, this information
+is invalid at empty points on the board. This data structure has the
+good properties of requiring fixed space (regardless of the number of
+strings) and making it easy to add a new stone or join two strings.
+
+Additionally the code makes use of some work variables:
+
+@example
+static int ml[BOARDMAX];
+static int liberty_mark;
+static int string_mark;
+static int next_string;
+static int strings_initialized = 0;
+@end example
+
+The @code{ml} array and @code{liberty_mark} are used to "mark" liberties on
+the board, e.g. to avoid counting the same liberty twice. The convention is
+that if @code{ml[pos]} has the same value as @code{liberty_mark}, then
+@code{pos} is marked. To clear all marks it suffices to increase the value
+of @code{liberty_mark}, since it is never allowed to decrease.
+
+The same relation holds between the @code{mark} field of the @code{string_data}
+structure and @code{string_mark}. Of course these are used for marking
+individual strings.
+
+@code{next_string} gives the number of the next available entry in the
+@code{string} array. Then @code{strings_initialized} is set to one when
+all data structures are known to be up to date. Given an arbitrary board
+position in the @samp{board} array, this is done by calling
+@code{incremental_board_init()}. It is not necessary to call this
+function explicitly since any other function that needs the information
+does this if it has not been done.
+
+The interesting part of the code is the incremental update of the data
+structures when a stone is played and subsequently removed. To
+understand the strategies involved in adding a stone it is necessary
+to first know how undoing a move works. The idea is that as soon as
+some piece of information is about to be changed, the old value is
+pushed onto a stack which stores the value and its address. The stack
+is built from the following structures:
+
+@example
+struct change_stack_entry @{
+ int *address;
+ int value;
+@};
+
+struct change_stack_entry change_stack[STACK_SIZE];
+int change_stack_index;
+@end example
+
+@noindent
+and manipulated with the macros
+
+@example
+BEGIN_CHANGE_RECORD()
+PUSH_VALUE(v)
+POP_MOVE()
+@end example
+
+Calling @code{BEGIN_CHANGE_RECORD()} stores a null pointer in the address
+field to indicate the start of changes for a new move. As mentioned
+earlier @code{PUSH_VALUE()} stores a value and its corresponding address.
+Assuming that all changed information has been duly pushed onto the
+stack, undoing the move is only a matter of calling @code{POP_MOVE()},
+which simply assigns the values to the addresses in the reverse order
+until the null pointer is reached. This description is slightly
+simplified because this stack can only store 'int' values and we need
+to also store changes to the board. Thus we have two parallel stacks
+where one stores @code{int} values and the other one stores
+@code{Intersection} values.
+
+When a new stone is played on the board, first captured opponent
+strings, if any, are removed. In this step we have to push the board
+values and the @code{next_stone} pointers for the removed stones, and
+update the liberties and neighbor lists for the neighbors of the
+removed strings. We do not have to push all information in the
+'string' entries of the removed strings however. As we do not reuse
+the entries they will remain intact until the move is pushed and they
+are back in use.
+
+After this we put down the new stone and get three distinct cases:
+
+@enumerate
+@item The new stone is isolated, i.e. it has no friendly neighbor.
+@item The new stone has exactly one friendly neighbor.
+@item The new stone has at least two friendly neighbors.
+@end enumerate
+
+The first case is easiest. Then we create a new string by using the
+number given by @code{next_string} and increasing this variable. The string
+will have size one, @code{next_stone} points directly back on itself, the
+liberties can be found by looking for empty points in the four
+directions, possible neighbor strings are found in the same way, and
+those need also to remove one liberty and add one neighbor.
+
+In the second case we do not create a new string but extend the
+neighbor with the new stone. This involves linking the new stone into
+the cyclic chain, if needed moving the origin, and updating liberties
+and neighbors. Liberty and neighbor information also needs updating
+for the neighbors of the new stone.
+
+In the third case finally, we need to join already existing strings.
+In order not to have to store excessive amounts of information, we
+create a new string for the new stone and let it assimilate the
+neighbor strings. Thus all information about those can simply be left
+around in the 'string' array, exactly as for removed strings. Here it
+becomes a little more complex to keep track of liberties and neighbors
+since those may have been shared by more than one of the joined
+strings. Making good use of marks it all becomes rather
+straightforward anyway.
+
+The often used construction
+
+@example
+ pos = FIRST_STONE(s);
+ do @{
+ ...
+ pos = NEXT_STONE(pos);
+ @} while (!BACK_TO_FIRST_STONE(s, pos));
+@end example
+
+@noindent
+traverses the stones of the string with number @samp{s} exactly once,
+with @code{pos} holding the coordinates. In general @code{pos} is
+used as board coordinate and @samp{s} as an index into the
+@code{string} array or sometimes a pointer to an entry in the
+@code{string} array.
+
+@node Some Board Functions
+@section Some Board Functions
+
+@strong{Reading}, often called @strong{search} in computer game
+theory, is a fundamental process in GNU Go. This is the process
+of generating hypothetical future boards in order to determine
+the answer to some question, for example "can these stones live."
+Since these are hypothetical future positions, it is important
+to be able to undo them, ultimately returning to the present
+board. Thus a move stack is maintained during reading. When
+a move is tried, by the function @code{trymove}, or its
+variant @code{tryko}. This function pushes the current board
+on the stack and plays a move. The stack pointer @code{stackp},
+which keeps track of the position, is incremented. The function
+@code{popgo()} pops the move stack, decrementing @code{stackp} and
+undoing the last move made.
+
+Every successful @code{trymove()} must be matched with a @code{popgo()}.
+Thus the correct way of using this function is:
+
+@example
+@group
+
+ if (trymove(pos, color, ... )) @{
+ ... [potentially lots of code here]
+ popgo();
+ @}
+
+@end group
+@end example
+
+@noindent
+
+In case the move is a ko capture, the legality of the capture is subject to
+the komaster scheme (@pxref{Ko}).
+
+@itemize @bullet
+@item @code{int trymove(int pos, int color, const char *message)}
+@findex trymove
+@quotation
+Returns true if @code{(pos)} is a legal move for @code{color}. In that
+case, it pushes the board on the stack and makes the move, incrementing
+@code{stackp}. If the reading code is recording reading variations (as
+with @option{--decide-string} or with @option{-o}), the string
+@code{*message} will be inserted in the SGF file as a comment. The
+comment will also refer to the string at @code{str} if this is not
+@code{0}. The value of @code{str} can be NO_MOVE if it is not needed but
+otherwise the location of @code{str} is included in the comment.
+@end quotation
+@item @code{int tryko(int pos, int color, const char *message)}
+@findex tryko
+@quotation
+@code{tryko()} pushes the position onto the stack, and makes a move
+@code{pos} of @code{color}. The move is allowed even if it is an
+illegal ko capture. It is to be imagined that @code{color} has made an
+intervening ko threat which was answered and now the continuation is to
+be explored. Return 1 if the move is legal with the above
+caveat. Returns zero if it is not legal because of suicide.
+@end quotation
+
+@item @code{void popgo()}
+@findex popgo
+@quotation
+Pops the move stack. This function must (eventually) be called after a
+succesful @code{trymove} or @code{tryko} to restore the board
+position. It undoes all the changes done by the call to
+@code{trymove/tryko} and leaves the board in the same state as it was
+before the call.
+
+@strong{NOTE}: If @code{trymove/tryko} returns @code{0}, i.e. the tried
+move was not legal, you must @strong{not} call @code{popgo}.
+@end quotation
+
+@item @code{int komaster_trymove(int pos, int color, const char *message, int str, int *is_conditional_ko, int consider_conditional_ko)}
+@findex komaster_trymove
+@quotation
+Variation of @code{trymove}/@code{tryko} where ko captures (both
+conditional and unconditional) must follow a komaster scheme
+(@pxref{Ko}).
+@end quotation
+
+@end itemize
+
+As you see, @code{trymove()} plays a move which can be easily
+retracted (with @code{popgo()}) and it is call thousands of
+times per actual game move as GNU Go analyzes the board position.
+By contrast the function @code{play_move()} plays a move which
+is intended to be permanent, though it is still possible to
+undo it if, for example, the opponent retracts a move.
+
+@itemize @bullet
+@item @code{void play_move(int pos, int color)}
+@findex play_move
+@quotation
+Play a move. If you want to test for legality you should first call
+@code{is_legal()}. This function strictly follows the algorithm:
+@enumerate
+@item Place a stone of given color on the board.
+@item If there are any adjacent opponent strings without liberties,
+remove them and increase the prisoner count.
+@item If the newly placed stone is part of a string without liberties,
+remove it and increase the prisoner count.
+@end enumerate
+In spite of the name ``permanent move'', this move can (usually) be
+unplayed by @code{undo_move()}, but it is significantly more costly than
+unplaying a temporary move. There are limitations on the available
+move history, so under certain circumstances the move may not be
+possible to unplay at a later time.
+@end quotation
+@item @code{int undo_move(int n)}
+@findex undo_move
+@quotation
+Undo @samp{n} permanent moves. Returns 1 if successful and 0 if it fails.
+If @samp{n} moves cannot be undone, no move is undone.
+@end quotation
+@end itemize
+
+Other board functions are documented in @xref{Board Utilities}.
+
diff --git a/gnugo/src/doc/cdfa.eps b/gnugo/src/doc/cdfa.eps
new file mode 100644
index 0000000000000000000000000000000000000000..4efdbf2761b2bd7386531a960bd3403315285e10
--- /dev/null
+++ b/gnugo/src/doc/cdfa.eps
@@ -0,0 +1,930 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: cdfa.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 1
+%%CreationDate: Fri Jun 22 18:54:03 2001
+%%For: turvoy@semeai.irisa.fr (Tanguy Urvoy, DEA, Paragraphe)
+%%Orientation: Portrait
+%%BoundingBox: 0 0 411 113
+%%Pages: 0
+%%BeginSetup
+%%EndSetup
+%%Magnification: 0.5000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+-6.0 113.0 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+%%EndProlog
+
+$F2psBegin
+10 setmiterlimit
+n -1000 4750 m -1000 -1000 l 14886 -1000 l 14886 4750 l cp clip
+ 0.03000 0.03000 sc
+7.500 slw
+% Ellipse
+n 900 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 6300 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4500 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2700 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 11100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 12600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2700 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4500 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 6300 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9600 2700 300 300 0 360 DrawEllipse gs col21 s gr
+
+% Polyline
+gs clippath
+5835 870 m 6000 900 l 5835 930 l 6015 930 l 6015 870 l cp
+clip
+n 4800 900 m 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5835 870 m 6000 900 l 5835 930 l 5835 900 l 5835 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5859 990 m 6000 900 l 5900 1034 l 6031 912 l 5991 868 l cp
+clip
+n 4800 900 m 4802 902 l 4807 906 l 4815 914 l 4828 926 l 4846 942 l
+ 4869 963 l 4896 986 l 4926 1013 l 4958 1041 l 4992 1070 l
+ 5027 1099 l 5061 1127 l 5095 1154 l 5128 1178 l 5159 1201 l
+ 5188 1221 l 5216 1238 l 5242 1254 l 5267 1267 l 5291 1277 l
+ 5314 1286 l 5336 1292 l 5358 1297 l 5379 1299 l 5400 1300 l
+ 5421 1299 l 5442 1297 l 5464 1292 l 5486 1286 l 5509 1277 l
+ 5533 1267 l 5558 1254 l 5584 1238 l 5612 1221 l 5641 1201 l
+ 5672 1178 l 5705 1154 l 5739 1127 l 5773 1099 l 5808 1070 l
+ 5842 1041 l 5874 1013 l 5904 986 l 5931 963 l 5954 942 l
+ 5972 926 l 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5859 990 m 6000 900 l 5900 1034 l 5879 1012 l 5859 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5900 758 m 6000 892 l 5859 802 l 5991 924 l 6031 880 l cp
+clip
+n 4800 892 m 4802 890 l 4807 886 l 4815 878 l 4828 866 l 4846 850 l
+ 4869 829 l 4896 806 l 4926 779 l 4958 751 l 4992 722 l
+ 5027 693 l 5061 665 l 5095 638 l 5128 614 l 5159 591 l
+ 5188 571 l 5216 554 l 5242 538 l 5267 525 l 5291 515 l
+ 5314 506 l 5336 500 l 5358 495 l 5379 493 l 5400 492 l
+ 5421 493 l 5442 495 l 5464 500 l 5486 506 l 5509 515 l
+ 5533 525 l 5558 538 l 5584 554 l 5612 571 l 5641 591 l
+ 5672 614 l 5705 638 l 5739 665 l 5773 693 l 5808 722 l
+ 5842 751 l 5874 779 l 5904 806 l 5931 829 l 5954 850 l
+ 5972 866 l 6000 892 l gs col0 s gr gr
+
+% arrowhead
+n 5900 758 m 6000 892 l 5859 802 l 5879 780 l 5900 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4035 870 m 4200 900 l 4035 930 l 4215 930 l 4215 870 l cp
+clip
+n 3000 900 m 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4035 870 m 4200 900 l 4035 930 l 4035 900 l 4035 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4059 990 m 4200 900 l 4100 1034 l 4231 912 l 4191 868 l cp
+clip
+n 3000 900 m 3002 902 l 3007 906 l 3015 914 l 3028 926 l 3046 942 l
+ 3069 963 l 3096 986 l 3126 1013 l 3158 1041 l 3192 1070 l
+ 3227 1099 l 3261 1127 l 3295 1154 l 3328 1178 l 3359 1201 l
+ 3388 1221 l 3416 1238 l 3442 1254 l 3467 1267 l 3491 1277 l
+ 3514 1286 l 3536 1292 l 3558 1297 l 3579 1299 l 3600 1300 l
+ 3621 1299 l 3642 1297 l 3664 1292 l 3686 1286 l 3709 1277 l
+ 3733 1267 l 3758 1254 l 3784 1238 l 3812 1221 l 3841 1201 l
+ 3872 1178 l 3905 1154 l 3939 1127 l 3973 1099 l 4008 1070 l
+ 4042 1041 l 4074 1013 l 4104 986 l 4131 963 l 4154 942 l
+ 4172 926 l 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4059 990 m 4200 900 l 4100 1034 l 4079 1012 l 4059 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4100 758 m 4200 892 l 4059 802 l 4191 924 l 4231 880 l cp
+clip
+n 3000 892 m 3002 890 l 3007 886 l 3015 878 l 3028 866 l 3046 850 l
+ 3069 829 l 3096 806 l 3126 779 l 3158 751 l 3192 722 l
+ 3227 693 l 3261 665 l 3295 638 l 3328 614 l 3359 591 l
+ 3388 571 l 3416 554 l 3442 538 l 3467 525 l 3491 515 l
+ 3514 506 l 3536 500 l 3558 495 l 3579 493 l 3600 492 l
+ 3621 493 l 3642 495 l 3664 500 l 3686 506 l 3709 515 l
+ 3733 525 l 3758 538 l 3784 554 l 3812 571 l 3841 591 l
+ 3872 614 l 3905 638 l 3939 665 l 3973 693 l 4008 722 l
+ 4042 751 l 4074 779 l 4104 806 l 4131 829 l 4154 850 l
+ 4172 866 l 4200 892 l gs col0 s gr gr
+
+% arrowhead
+n 4100 758 m 4200 892 l 4059 802 l 4079 780 l 4100 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2247 969 m 2400 900 l 2281 1018 l 2429 916 l 2395 867 l cp
+clip
+n 1200 900 m 1203 902 l 1209 906 l 1219 913 l 1235 924 l 1257 939 l
+ 1284 957 l 1315 978 l 1350 1000 l 1387 1024 l 1424 1047 l
+ 1461 1070 l 1498 1092 l 1533 1112 l 1566 1129 l 1598 1145 l
+ 1627 1159 l 1655 1170 l 1681 1180 l 1706 1187 l 1730 1193 l
+ 1754 1197 l 1777 1199 l 1800 1200 l 1823 1199 l 1846 1197 l
+ 1870 1193 l 1894 1187 l 1919 1180 l 1945 1170 l 1973 1159 l
+ 2002 1145 l 2034 1129 l 2067 1112 l 2102 1092 l 2139 1070 l
+ 2176 1047 l 2213 1024 l 2250 1000 l 2285 978 l 2316 957 l
+ 2343 939 l 2365 924 l 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2247 969 m 2400 900 l 2281 1018 l 2264 993 l 2247 969 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+435 870 m 600 900 l 435 930 l 615 930 l 615 870 l cp
+clip
+n 225 900 m 600 900 l gs col0 s gr gr
+
+% arrowhead
+n 435 870 m 600 900 l 435 930 l 435 900 l 435 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7635 870 m 7800 900 l 7635 930 l 7815 930 l 7815 870 l cp
+clip
+n 6600 900 m 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7635 870 m 7800 900 l 7635 930 l 7635 900 l 7635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7659 990 m 7800 900 l 7700 1034 l 7831 912 l 7791 868 l cp
+clip
+n 6600 900 m 6602 902 l 6607 906 l 6615 914 l 6628 926 l 6646 942 l
+ 6669 963 l 6696 986 l 6726 1013 l 6758 1041 l 6792 1070 l
+ 6827 1099 l 6861 1127 l 6895 1154 l 6928 1178 l 6959 1201 l
+ 6988 1221 l 7016 1238 l 7042 1254 l 7067 1267 l 7091 1277 l
+ 7114 1286 l 7136 1292 l 7158 1297 l 7179 1299 l 7200 1300 l
+ 7221 1299 l 7242 1297 l 7264 1292 l 7286 1286 l 7309 1277 l
+ 7333 1267 l 7358 1254 l 7384 1238 l 7412 1221 l 7441 1201 l
+ 7472 1178 l 7505 1154 l 7539 1127 l 7573 1099 l 7608 1070 l
+ 7642 1041 l 7674 1013 l 7704 986 l 7731 963 l 7754 942 l
+ 7772 926 l 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7659 990 m 7800 900 l 7700 1034 l 7679 1012 l 7659 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7700 758 m 7800 892 l 7659 802 l 7791 924 l 7831 880 l cp
+clip
+n 6600 892 m 6602 890 l 6607 886 l 6615 878 l 6628 866 l 6646 850 l
+ 6669 829 l 6696 806 l 6726 779 l 6758 751 l 6792 722 l
+ 6827 693 l 6861 665 l 6895 638 l 6928 614 l 6959 591 l
+ 6988 571 l 7016 554 l 7042 538 l 7067 525 l 7091 515 l
+ 7114 506 l 7136 500 l 7158 495 l 7179 493 l 7200 492 l
+ 7221 493 l 7242 495 l 7264 500 l 7286 506 l 7309 515 l
+ 7333 525 l 7358 538 l 7384 554 l 7412 571 l 7441 591 l
+ 7472 614 l 7505 638 l 7539 665 l 7573 693 l 7608 722 l
+ 7642 751 l 7674 779 l 7704 806 l 7731 829 l 7754 850 l
+ 7772 866 l 7800 892 l gs col0 s gr gr
+
+% arrowhead
+n 7700 758 m 7800 892 l 7659 802 l 7679 780 l 7700 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+9135 870 m 9300 900 l 9135 930 l 9315 930 l 9315 870 l cp
+clip
+n 8400 900 m 9300 900 l gs col0 s gr gr
+
+% arrowhead
+n 9135 870 m 9300 900 l 9135 930 l 9135 900 l 9135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+10635 870 m 10800 900 l 10635 930 l 10815 930 l 10815 870 l cp
+clip
+n 9900 900 m 10800 900 l gs col0 s gr gr
+
+% arrowhead
+n 10635 870 m 10800 900 l 10635 930 l 10635 900 l 10635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+12135 870 m 12300 900 l 12135 930 l 12315 930 l 12315 870 l cp
+clip
+n 11400 900 m 12300 900 l gs col0 s gr gr
+
+% arrowhead
+n 12135 870 m 12300 900 l 12135 930 l 12135 900 l 12135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2281 782 m 2400 900 l 2247 831 l 2395 933 l 2429 884 l cp
+clip
+n 1200 900 m 1203 898 l 1209 894 l 1219 887 l 1235 876 l 1257 861 l
+ 1284 843 l 1315 822 l 1350 800 l 1387 776 l 1424 753 l
+ 1461 730 l 1498 708 l 1533 688 l 1566 671 l 1598 655 l
+ 1627 641 l 1655 630 l 1681 620 l 1706 613 l 1730 607 l
+ 1754 603 l 1777 601 l 1800 600 l 1823 601 l 1846 603 l
+ 1870 607 l 1894 613 l 1919 620 l 1945 630 l 1973 641 l
+ 2002 655 l 2034 671 l 2067 688 l 2102 708 l 2139 730 l
+ 2176 753 l 2213 776 l 2250 800 l 2285 822 l 2316 843 l
+ 2343 861 l 2365 876 l 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2281 782 m 2400 900 l 2247 831 l 2264 807 l 2281 782 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2210 2613 m 2359 2688 l 2193 2671 l 2406 2733 l 2423 2675 l cp
+clip
+n 900 1200 m 901 1202 l 902 1207 l 905 1217 l 909 1231 l 915 1252 l
+ 923 1278 l 932 1310 l 944 1348 l 957 1391 l 971 1438 l
+ 987 1488 l 1004 1540 l 1021 1592 l 1039 1645 l 1057 1697 l
+ 1075 1748 l 1093 1796 l 1111 1843 l 1128 1887 l 1146 1929 l
+ 1163 1968 l 1181 2005 l 1198 2039 l 1216 2071 l 1233 2101 l
+ 1251 2130 l 1270 2156 l 1289 2181 l 1309 2205 l 1329 2228 l
+ 1350 2250 l 1372 2271 l 1395 2291 l 1419 2311 l 1444 2330 l
+ 1470 2349 l 1499 2367 l 1529 2384 l 1561 2402 l 1595 2419 l
+ 1632 2437 l 1671 2454 l 1713 2472 l 1757 2489 l 1804 2507 l
+ 1852 2525 l 1903 2543 l 1955 2561 l 2008 2579 l 2060 2596 l
+ 2112 2613 l 2162 2629 l 2209 2643 l 2252 2656 l 2290 2668 l
+ 2322 2677 l 2348 2685 l 2369 2691 l 2400 2700 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 2210 2613 m 2359 2688 l 2193 2671 l 2201 2642 l 2210 2613 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+4035 2670 m 4200 2700 l 4035 2730 l 4215 2730 l 4215 2670 l cp
+clip
+n 3000 2700 m 4200 2700 l gs col0 s gr gr
+
+% arrowhead
+n 4035 2670 m 4200 2700 l 4035 2730 l 4035 2700 l 4035 2670 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4176 1309 m 4260 1164 l 4232 1330 l 4308 1121 l 4252 1101 l cp
+clip
+n 2925 2475 m 2927 2474 l 2931 2473 l 2940 2469 l 2952 2464 l 2970 2457 l
+ 2993 2448 l 3022 2437 l 3055 2424 l 3093 2408 l 3134 2391 l
+ 3177 2373 l 3223 2354 l 3269 2335 l 3315 2314 l 3361 2294 l
+ 3406 2274 l 3448 2255 l 3489 2235 l 3528 2216 l 3565 2197 l
+ 3599 2179 l 3632 2161 l 3662 2144 l 3690 2126 l 3717 2109 l
+ 3742 2091 l 3766 2074 l 3788 2056 l 3810 2038 l 3830 2019 l
+ 3850 2000 l 3870 1979 l 3890 1957 l 3909 1935 l 3927 1911 l
+ 3945 1886 l 3963 1860 l 3980 1832 l 3997 1802 l 4015 1770 l
+ 4032 1736 l 4050 1699 l 4068 1661 l 4086 1620 l 4104 1577 l
+ 4123 1533 l 4141 1487 l 4159 1441 l 4177 1395 l 4194 1350 l
+ 4210 1307 l 4225 1267 l 4238 1231 l 4249 1200 l 4258 1175 l
+ 4264 1155 l 4275 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 4176 1309 m 4260 1164 l 4232 1330 l 4204 1319 l 4176 1309 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+4099 1238 m 4243 1152 l 4138 1283 l 4306 1138 l 4267 1092 l cp
+clip
+n 2925 2475 m 2927 2473 l 2930 2469 l 2937 2462 l 2947 2451 l 2961 2436 l
+ 2979 2416 l 3001 2392 l 3026 2364 l 3055 2332 l 3086 2298 l
+ 3118 2263 l 3152 2226 l 3186 2189 l 3219 2152 l 3252 2117 l
+ 3284 2082 l 3315 2049 l 3344 2017 l 3372 1987 l 3399 1958 l
+ 3424 1931 l 3449 1906 l 3472 1881 l 3495 1858 l 3516 1835 l
+ 3538 1813 l 3559 1792 l 3579 1771 l 3600 1750 l 3621 1729 l
+ 3641 1709 l 3662 1688 l 3684 1668 l 3705 1647 l 3728 1625 l
+ 3751 1603 l 3776 1580 l 3801 1556 l 3828 1531 l 3856 1505 l
+ 3885 1478 l 3916 1450 l 3948 1421 l 3981 1391 l 4014 1360 l
+ 4048 1330 l 4082 1299 l 4114 1270 l 4145 1242 l 4174 1216 l
+ 4199 1193 l 4221 1173 l 4239 1157 l 4253 1144 l 4275 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 4099 1238 m 4243 1152 l 4138 1283 l 4118 1260 l 4099 1238 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+5907 1250 m 6045 1154 l 5950 1293 l 6107 1136 l 6064 1093 l cp
+clip
+n 4725 2475 m 6075 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 5907 1250 m 6045 1154 l 5950 1293 l 5929 1271 l 5907 1250 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+5862 2604 m 6000 2700 l 5837 2659 l 6001 2734 l 6026 2679 l cp
+clip
+n 4800 2700 m 4803 2699 l 4809 2696 l 4819 2691 l 4835 2684 l 4857 2674 l
+ 4884 2662 l 4915 2648 l 4950 2633 l 4987 2617 l 5024 2602 l
+ 5061 2586 l 5098 2572 l 5133 2559 l 5166 2547 l 5198 2537 l
+ 5227 2527 l 5255 2520 l 5281 2513 l 5306 2508 l 5330 2505 l
+ 5354 2502 l 5377 2500 l 5400 2500 l 5423 2500 l 5446 2502 l
+ 5470 2505 l 5494 2508 l 5519 2513 l 5545 2520 l 5573 2527 l
+ 5602 2537 l 5634 2547 l 5667 2559 l 5702 2572 l 5739 2586 l
+ 5776 2602 l 5813 2617 l 5850 2633 l 5885 2648 l 5916 2662 l
+ 5943 2674 l 5965 2684 l 6000 2700 l gs col0 s gr gr
+
+% arrowhead
+n 5862 2604 m 6000 2700 l 5837 2659 l 5850 2631 l 5862 2604 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5837 2741 m 6000 2700 l 5862 2796 l 6026 2721 l 6001 2666 l cp
+clip
+n 4800 2700 m 4803 2701 l 4809 2704 l 4819 2709 l 4835 2716 l 4857 2726 l
+ 4884 2738 l 4915 2752 l 4950 2767 l 4987 2783 l 5024 2798 l
+ 5061 2814 l 5098 2828 l 5133 2841 l 5166 2853 l 5198 2863 l
+ 5227 2873 l 5255 2880 l 5281 2887 l 5306 2892 l 5330 2895 l
+ 5354 2898 l 5377 2900 l 5400 2900 l 5423 2900 l 5446 2898 l
+ 5470 2895 l 5494 2892 l 5519 2887 l 5545 2880 l 5573 2873 l
+ 5602 2863 l 5634 2853 l 5667 2841 l 5702 2828 l 5739 2814 l
+ 5776 2798 l 5813 2783 l 5850 2767 l 5885 2752 l 5916 2738 l
+ 5943 2726 l 5965 2716 l 6000 2700 l gs col0 s gr gr
+
+% arrowhead
+n 5837 2741 m 6000 2700 l 5862 2796 l 5850 2769 l 5837 2741 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+6330 3135 m 6300 3300 l 6270 3135 l 6270 3315 l 6330 3315 l cp
+clip
+n 6300 3000 m 6300 3300 l gs col0 s gr gr
+
+% arrowhead
+n 6330 3135 m 6300 3300 l 6270 3135 l 6300 3135 l 6330 3135 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7674 1182 m 7836 1142 l 7698 1236 l 7901 1146 l 7877 1091 l cp
+clip
+n 6525 2475 m 6526 2473 l 6527 2468 l 6531 2460 l 6536 2447 l 6542 2428 l
+ 6551 2405 l 6562 2376 l 6575 2343 l 6590 2306 l 6606 2266 l
+ 6623 2225 l 6641 2182 l 6659 2138 l 6677 2096 l 6696 2054 l
+ 6714 2014 l 6732 1976 l 6750 1939 l 6768 1905 l 6785 1873 l
+ 6803 1843 l 6820 1814 l 6837 1787 l 6855 1762 l 6873 1738 l
+ 6891 1714 l 6910 1692 l 6930 1671 l 6950 1650 l 6970 1631 l
+ 6990 1612 l 7012 1594 l 7034 1575 l 7058 1557 l 7083 1539 l
+ 7110 1520 l 7138 1502 l 7168 1482 l 7201 1463 l 7235 1443 l
+ 7272 1422 l 7311 1401 l 7352 1379 l 7394 1357 l 7439 1334 l
+ 7485 1311 l 7531 1288 l 7577 1265 l 7623 1243 l 7666 1222 l
+ 7707 1203 l 7745 1185 l 7778 1170 l 7807 1156 l 7830 1146 l
+ 7848 1137 l 7875 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7674 1182 m 7836 1142 l 7698 1236 l 7686 1209 l 7674 1182 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+7840 1378 m 7933 1238 l 7895 1402 l 7983 1198 l 7928 1174 l cp
+clip
+n 6525 2475 m 6527 2474 l 6531 2473 l 6540 2470 l 6552 2466 l 6570 2461 l
+ 6594 2453 l 6622 2444 l 6655 2433 l 6693 2420 l 6734 2406 l
+ 6778 2391 l 6824 2375 l 6871 2359 l 6917 2342 l 6963 2325 l
+ 7008 2308 l 7051 2291 l 7093 2274 l 7132 2258 l 7169 2242 l
+ 7204 2226 l 7237 2210 l 7268 2195 l 7297 2179 l 7324 2163 l
+ 7350 2147 l 7375 2131 l 7398 2115 l 7420 2098 l 7442 2080 l
+ 7463 2063 l 7484 2043 l 7505 2022 l 7525 2000 l 7545 1978 l
+ 7564 1953 l 7584 1928 l 7603 1900 l 7622 1871 l 7642 1840 l
+ 7662 1806 l 7682 1770 l 7703 1732 l 7724 1692 l 7745 1650 l
+ 7767 1606 l 7789 1560 l 7811 1514 l 7832 1468 l 7852 1424 l
+ 7871 1381 l 7889 1341 l 7905 1306 l 7918 1275 l 7929 1250 l
+ 7937 1230 l 7950 1200 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7840 1378 m 7933 1238 l 7895 1402 l 7868 1390 l 7840 1378 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+7704 1320 m 7844 1228 l 7745 1364 l 7907 1212 l 7865 1168 l cp
+clip
+n 6525 2475 m 7875 1200 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7704 1320 m 7844 1228 l 7745 1364 l 7725 1342 l 7704 1320 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+12570 465 m 12600 300 l 12630 465 l 12630 285 l 12570 285 l cp
+clip
+n 12600 600 m 12600 300 l gs col0 s gr gr
+
+% arrowhead
+n 12570 465 m 12600 300 l 12630 465 l 12600 465 l 12570 465 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+9179 2380 m 9271 2519 l 9135 2421 l 9289 2582 l 9332 2540 l cp
+clip
+n 8250 1200 m 8251 1202 l 8254 1206 l 8258 1214 l 8265 1226 l 8275 1243 l
+ 8287 1264 l 8302 1290 l 8319 1319 l 8338 1352 l 8358 1386 l
+ 8379 1422 l 8401 1458 l 8422 1494 l 8443 1529 l 8464 1563 l
+ 8484 1596 l 8504 1627 l 8522 1657 l 8540 1685 l 8558 1712 l
+ 8575 1737 l 8592 1762 l 8608 1785 l 8625 1808 l 8641 1831 l
+ 8658 1853 l 8675 1875 l 8691 1896 l 8708 1916 l 8725 1937 l
+ 8743 1959 l 8761 1980 l 8781 2003 l 8801 2026 l 8823 2051 l
+ 8846 2076 l 8870 2103 l 8896 2131 l 8924 2160 l 8953 2191 l
+ 8983 2223 l 9014 2256 l 9047 2289 l 9079 2323 l 9112 2357 l
+ 9143 2389 l 9173 2420 l 9201 2449 l 9226 2474 l 9247 2496 l
+ 9265 2514 l 9279 2528 l 9300 2550 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9179 2380 m 9271 2519 l 9135 2421 l 9157 2400 l 9179 2380 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9267 2344 m 9287 2509 l 9210 2361 l 9276 2573 l 9333 2555 l cp
+clip
+n 8325 1125 m 8327 1126 l 8331 1130 l 8338 1135 l 8348 1144 l 8363 1157 l
+ 8383 1173 l 8406 1193 l 8434 1216 l 8464 1242 l 8497 1271 l
+ 8531 1300 l 8567 1331 l 8602 1362 l 8637 1393 l 8671 1423 l
+ 8703 1453 l 8734 1482 l 8764 1509 l 8791 1536 l 8817 1561 l
+ 8841 1586 l 8863 1609 l 8884 1632 l 8904 1654 l 8923 1676 l
+ 8940 1698 l 8957 1719 l 8972 1741 l 8988 1763 l 9003 1786 l
+ 9018 1810 l 9033 1834 l 9047 1860 l 9061 1886 l 9075 1913 l
+ 9088 1942 l 9102 1973 l 9115 2005 l 9129 2040 l 9143 2076 l
+ 9158 2115 l 9172 2155 l 9187 2197 l 9202 2240 l 9216 2283 l
+ 9230 2326 l 9243 2367 l 9256 2406 l 9267 2442 l 9276 2473 l
+ 9284 2498 l 9290 2518 l 9300 2550 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9267 2344 m 9287 2509 l 9210 2361 l 9238 2352 l 9267 2344 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9583 2192 m 9590 2359 l 9525 2205 l 9574 2421 l 9633 2408 l cp
+clip
+n 9600 1200 m 9599 1203 l 9598 1209 l 9596 1219 l 9592 1235 l 9587 1257 l
+ 9581 1284 l 9574 1315 l 9567 1350 l 9559 1387 l 9551 1424 l
+ 9543 1461 l 9536 1498 l 9529 1533 l 9524 1566 l 9518 1598 l
+ 9514 1627 l 9510 1655 l 9507 1681 l 9504 1706 l 9502 1730 l
+ 9501 1754 l 9500 1777 l 9500 1800 l 9500 1823 l 9501 1846 l
+ 9502 1870 l 9504 1894 l 9507 1919 l 9510 1945 l 9514 1973 l
+ 9518 2002 l 9524 2034 l 9529 2067 l 9536 2102 l 9543 2139 l
+ 9551 2176 l 9559 2213 l 9567 2250 l 9574 2285 l 9581 2316 l
+ 9587 2343 l 9592 2365 l 9600 2400 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9583 2192 m 9590 2359 l 9525 2205 l 9554 2198 l 9583 2192 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9695 2214 m 9613 2360 l 9639 2195 l 9567 2404 l 9624 2424 l cp
+clip
+n 9600 1200 m 9601 1203 l 9603 1209 l 9607 1219 l 9612 1235 l 9620 1257 l
+ 9629 1284 l 9639 1315 l 9650 1350 l 9662 1387 l 9674 1424 l
+ 9685 1461 l 9696 1498 l 9706 1533 l 9715 1566 l 9723 1598 l
+ 9729 1627 l 9735 1655 l 9740 1681 l 9744 1706 l 9747 1730 l
+ 9749 1754 l 9750 1777 l 9750 1800 l 9750 1823 l 9749 1846 l
+ 9747 1870 l 9744 1894 l 9740 1919 l 9735 1945 l 9729 1973 l
+ 9723 2002 l 9715 2034 l 9706 2067 l 9696 2102 l 9685 2139 l
+ 9674 2176 l 9662 2213 l 9650 2250 l 9639 2285 l 9629 2316 l
+ 9620 2343 l 9612 2365 l 9600 2400 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9695 2214 m 9613 2360 l 9639 2195 l 9667 2204 l 9695 2214 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+10094 2397 m 9936 2453 l 10064 2345 l 9872 2457 l 9902 2508 l cp
+clip
+n 10950 1200 m 10949 1202 l 10948 1207 l 10945 1217 l 10940 1231 l 10934 1251 l
+ 10926 1277 l 10916 1307 l 10905 1342 l 10892 1381 l 10879 1422 l
+ 10865 1464 l 10850 1507 l 10835 1549 l 10820 1590 l 10805 1629 l
+ 10790 1667 l 10775 1702 l 10761 1735 l 10747 1767 l 10732 1796 l
+ 10718 1823 l 10703 1849 l 10689 1874 l 10674 1897 l 10658 1920 l
+ 10642 1941 l 10625 1962 l 10625 1963 l 10607 1983 l 10589 2003 l
+ 10570 2024 l 10549 2043 l 10527 2064 l 10504 2084 l 10478 2104 l
+ 10451 2126 l 10422 2147 l 10390 2170 l 10356 2193 l 10320 2218 l
+ 10282 2243 l 10242 2268 l 10201 2294 l 10160 2320 l 10118 2345 l
+ 10078 2370 l 10041 2392 l 10006 2413 l 9976 2431 l 9951 2445 l
+ 9931 2457 l 9900 2475 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 10094 2397 m 9936 2453 l 10064 2345 l 10079 2371 l 10094 2397 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9984 2340 m 9852 2443 l 9939 2300 l 9793 2466 l 9838 2506 l cp
+clip
+n 10950 1200 m 9825 2475 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9984 2340 m 9852 2443 l 9939 2300 l 9962 2320 l 9984 2340 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9100 2760 m 9261 2717 l 9125 2814 l 9326 2721 l 9301 2666 l cp
+clip
+n 9300 2700 m 9297 2699 l 9289 2696 l 9277 2692 l 9257 2686 l 9232 2677 l
+ 9202 2667 l 9167 2657 l 9130 2645 l 9093 2634 l 9056 2623 l
+ 9020 2614 l 8987 2606 l 8957 2599 l 8929 2593 l 8904 2590 l
+ 8881 2588 l 8861 2587 l 8844 2588 l 8828 2590 l 8813 2594 l
+ 8800 2600 l 8789 2606 l 8779 2614 l 8770 2622 l 8761 2632 l
+ 8754 2642 l 8747 2654 l 8741 2666 l 8736 2679 l 8733 2693 l
+ 8730 2707 l 8728 2721 l 8728 2736 l 8728 2750 l 8730 2764 l
+ 8733 2778 l 8736 2791 l 8741 2804 l 8747 2815 l 8754 2826 l
+ 8761 2836 l 8770 2844 l 8779 2851 l 8789 2858 l 8800 2863 l
+ 8813 2866 l 8828 2869 l 8844 2869 l 8861 2868 l 8881 2865 l
+ 8904 2860 l 8929 2853 l 8957 2844 l 8987 2833 l 9020 2821 l
+ 9056 2807 l 9093 2792 l 9130 2776 l 9167 2760 l 9202 2745 l
+ 9232 2731 l 9257 2720 l 9300 2700 l cp gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9100 2760 m 9261 2717 l 9125 2814 l 9112 2787 l 9100 2760 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9295 3118 m 9364 2965 l 9353 3133 l 9408 2918 l 9350 2903 l cp
+clip
+n 9375 2925 m 9372 2926 l 9365 2929 l 9352 2935 l 9334 2942 l 9309 2953 l
+ 9280 2966 l 9248 2980 l 9213 2996 l 9178 3013 l 9144 3030 l
+ 9111 3046 l 9082 3062 l 9055 3077 l 9032 3092 l 9012 3106 l
+ 8995 3120 l 8980 3133 l 8969 3147 l 8960 3160 l 8954 3174 l
+ 8950 3188 l 8948 3202 l 8948 3216 l 8949 3232 l 8952 3247 l
+ 8957 3263 l 8964 3279 l 8972 3295 l 8981 3310 l 8992 3326 l
+ 9004 3340 l 9017 3354 l 9031 3367 l 9046 3379 l 9061 3389 l
+ 9076 3398 l 9091 3406 l 9106 3412 l 9121 3416 l 9135 3418 l
+ 9149 3418 l 9162 3416 l 9175 3413 l 9187 3407 l 9199 3399 l
+ 9210 3388 l 9221 3374 l 9232 3358 l 9243 3338 l 9254 3315 l
+ 9266 3288 l 9277 3257 l 9289 3224 l 9301 3187 l 9313 3148 l
+ 9325 3108 l 9336 3069 l 9347 3032 l 9356 2999 l 9363 2972 l
+ 9375 2925 l cp gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9295 3118 m 9364 2965 l 9353 3133 l 9324 3125 l 9295 3118 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+9660 3200 m 9617 3038 l 9714 3175 l 9621 2974 l 9566 2999 l cp
+clip
+n 9600 3000 m 9599 3003 l 9596 3011 l 9592 3023 l 9586 3043 l 9577 3068 l
+ 9567 3098 l 9557 3133 l 9545 3170 l 9534 3207 l 9523 3244 l
+ 9514 3280 l 9506 3313 l 9499 3343 l 9493 3371 l 9490 3396 l
+ 9488 3419 l 9487 3439 l 9488 3456 l 9490 3472 l 9494 3487 l
+ 9500 3500 l 9506 3511 l 9514 3521 l 9522 3530 l 9532 3539 l
+ 9542 3546 l 9554 3553 l 9566 3559 l 9579 3564 l 9593 3567 l
+ 9607 3570 l 9621 3572 l 9636 3572 l 9650 3572 l 9664 3570 l
+ 9678 3567 l 9691 3564 l 9704 3559 l 9715 3553 l 9726 3546 l
+ 9736 3539 l 9744 3530 l 9751 3521 l 9758 3511 l 9763 3500 l
+ 9766 3487 l 9769 3472 l 9769 3456 l 9768 3439 l 9765 3419 l
+ 9760 3396 l 9753 3371 l 9744 3343 l 9733 3313 l 9721 3280 l
+ 9707 3244 l 9692 3207 l 9676 3170 l 9660 3133 l 9645 3098 l
+ 9631 3068 l 9620 3043 l 9600 3000 l cp gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 9660 3200 m 9617 3038 l 9714 3175 l 9687 3188 l 9660 3200 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+10102 2905 m 9941 2855 l 10109 2846 l 9889 2818 l 9881 2878 l cp
+clip
+n 12600 1200 m 12599 1202 l 12598 1206 l 12595 1214 l 12590 1226 l 12583 1244 l
+ 12574 1267 l 12563 1296 l 12549 1331 l 12534 1372 l 12516 1417 l
+ 12496 1467 l 12475 1521 l 12452 1578 l 12428 1637 l 12404 1696 l
+ 12379 1757 l 12355 1817 l 12330 1876 l 12306 1934 l 12282 1990 l
+ 12258 2043 l 12235 2095 l 12213 2144 l 12192 2190 l 12171 2234 l
+ 12151 2275 l 12131 2314 l 12112 2351 l 12093 2385 l 12075 2418 l
+ 12057 2448 l 12039 2477 l 12021 2504 l 12004 2530 l 11986 2555 l
+ 11968 2578 l 11950 2600 l 11928 2625 l 11906 2649 l 11884 2672 l
+ 11861 2694 l 11837 2715 l 11813 2735 l 11788 2754 l 11763 2772 l
+ 11737 2789 l 11710 2805 l 11682 2821 l 11654 2835 l 11625 2849 l
+ 11596 2861 l 11566 2873 l 11536 2883 l 11506 2893 l 11475 2902 l
+ 11444 2910 l 11413 2917 l 11383 2923 l 11352 2929 l 11321 2934 l
+ 11290 2938 l 11260 2941 l 11230 2944 l 11199 2946 l 11169 2947 l
+ 11140 2949 l 11110 2949 l 11080 2950 l 11050 2950 l 11020 2950 l
+ 10989 2949 l 10958 2949 l 10926 2948 l 10893 2946 l 10859 2945 l
+ 10823 2943 l 10786 2940 l 10747 2937 l 10706 2934 l 10663 2930 l
+ 10617 2926 l 10570 2922 l 10520 2917 l 10468 2912 l 10414 2907 l
+ 10360 2901 l 10305 2895 l 10250 2889 l 10196 2883 l 10144 2878 l
+ 10096 2872 l 10052 2867 l 10013 2863 l 9980 2859 l 9953 2856 l
+ 9932 2854 l 9900 2850 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 10102 2905 m 9941 2855 l 10109 2846 l 10105 2876 l 10102 2905 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+10107 2805 m 9941 2775 l 10107 2745 l 9885 2745 l 9885 2805 l cp
+clip
+n 12600 1200 m 12599 1202 l 12597 1206 l 12593 1214 l 12586 1226 l 12577 1244 l
+ 12564 1267 l 12549 1295 l 12531 1328 l 12510 1366 l 12487 1408 l
+ 12462 1453 l 12435 1501 l 12407 1550 l 12379 1600 l 12350 1650 l
+ 12321 1699 l 12293 1747 l 12265 1794 l 12237 1838 l 12210 1881 l
+ 12184 1921 l 12159 1959 l 12134 1995 l 12110 2029 l 12086 2061 l
+ 12063 2091 l 12040 2119 l 12017 2146 l 11994 2171 l 11971 2195 l
+ 11948 2219 l 11924 2241 l 11900 2263 l 11874 2285 l 11847 2306 l
+ 11820 2327 l 11792 2348 l 11763 2368 l 11733 2388 l 11702 2407 l
+ 11671 2426 l 11638 2444 l 11605 2462 l 11571 2480 l 11536 2497 l
+ 11501 2513 l 11466 2529 l 11429 2545 l 11393 2560 l 11357 2574 l
+ 11320 2588 l 11284 2601 l 11247 2613 l 11211 2624 l 11176 2635 l
+ 11141 2646 l 11106 2655 l 11072 2664 l 11038 2673 l 11006 2681 l
+ 10974 2688 l 10942 2695 l 10911 2701 l 10880 2707 l 10850 2713 l
+ 10818 2718 l 10786 2723 l 10755 2728 l 10723 2732 l 10690 2737 l
+ 10657 2740 l 10623 2744 l 10588 2747 l 10552 2750 l 10514 2753 l
+ 10474 2756 l 10433 2758 l 10391 2760 l 10346 2762 l 10301 2764 l
+ 10255 2766 l 10208 2768 l 10162 2769 l 10118 2770 l 10076 2771 l
+ 10037 2772 l 10002 2773 l 9973 2774 l 9948 2774 l 9929 2775 l
+ 9900 2775 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 10107 2805 m 9941 2775 l 10107 2745 l 10107 2775 l 10107 2805 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+10109 2689 m 9941 2691 l 10097 2630 l 9879 2674 l 9891 2732 l cp
+clip
+n 12600 1200 m 12599 1201 l 12596 1204 l 12591 1209 l 12583 1217 l 12571 1228 l
+ 12556 1243 l 12536 1261 l 12512 1284 l 12485 1310 l 12453 1340 l
+ 12418 1373 l 12380 1409 l 12339 1448 l 12296 1488 l 12252 1529 l
+ 12206 1571 l 12160 1614 l 12114 1656 l 12068 1697 l 12023 1738 l
+ 11979 1777 l 11936 1815 l 11893 1852 l 11853 1887 l 11813 1921 l
+ 11775 1953 l 11738 1983 l 11702 2012 l 11667 2039 l 11633 2065 l
+ 11600 2089 l 11567 2113 l 11536 2135 l 11504 2156 l 11473 2176 l
+ 11442 2196 l 11412 2215 l 11381 2233 l 11350 2250 l 11317 2268 l
+ 11284 2285 l 11251 2302 l 11217 2318 l 11182 2334 l 11147 2349 l
+ 11110 2365 l 11073 2380 l 11034 2394 l 10993 2409 l 10951 2424 l
+ 10907 2438 l 10861 2453 l 10813 2468 l 10763 2483 l 10711 2498 l
+ 10657 2513 l 10602 2528 l 10545 2543 l 10487 2559 l 10429 2574 l
+ 10371 2588 l 10313 2603 l 10257 2616 l 10203 2630 l 10152 2642 l
+ 10104 2653 l 10061 2663 l 10023 2672 l 9990 2680 l 9963 2686 l
+ 9941 2691 l 9925 2695 l 9900 2700 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 10109 2689 m 9941 2691 l 10097 2630 l 10103 2659 l 10109 2689 l cp gs col21 1.00 shd ef gr col21 s
+% Polyline
+7.500 slw
+gs clippath
+10000 3057 m 10095 3195 l 9957 3100 l 10114 3257 l 10157 3214 l cp
+clip
+n 9825 2925 m 10125 3225 l gs col21 s gr gr
+
+% arrowhead
+15.000 slw
+n 10000 3057 m 10095 3195 l 9957 3100 l 9979 3079 l 10000 3057 l cp gs col21 1.00 shd ef gr col21 s
+/Times-Bold ff 285.00 scf sf
+817 960 m
+gs 1 -1 sc (1) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5400 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3600 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+2625 945 m
+gs 1 -1 sc (2) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+4425 945 m
+gs 1 -1 sc (3) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6225 945 m
+gs 1 -1 sc (4) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7200 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8025 945 m
+gs 1 -1 sc (5) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8775 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+9525 975 m
+gs 1 -1 sc (6) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+10275 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11025 975 m
+gs 1 -1 sc (7) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11700 825 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+12525 975 m
+gs 1 -1 sc (8) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1725 1125 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1800 525 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1425 2175 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+2625 2775 m
+gs 1 -1 sc (9) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+4425 2775 m
+gs 1 -1 sc (A) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 2625 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6225 2775 m
+gs 1 -1 sc (B) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 2400 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5400 2775 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 3600 m
+gs 1 -1 sc (Pattern "XXo") col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3675 1950 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5100 1800 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3300 1800 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6525 1800 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7275 2025 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7050 1800 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11625 225 m
+gs 1 -1 sc (Pattern "????..X") col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8325 1950 m
+gs 1 -1 sc (O) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+8925 1575 m
+gs 1 -1 sc (X) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+9225 1875 m
+gs 1 -1 sc (O) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+9825 1875 m
+gs 1 -1 sc (X) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+10200 1800 m
+gs 1 -1 sc (O) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+10725 2100 m
+gs 1 -1 sc (.) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+9525 2775 m
+gs 1 -1 sc (0) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+8475 2775 m
+gs 1 -1 sc (O) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+8775 3600 m
+gs 1 -1 sc (X) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+9600 3750 m
+gs 1 -1 sc (.) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+11325 2100 m
+gs 1 -1 sc (O) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+11625 2325 m
+gs 1 -1 sc (.) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+12000 2850 m
+gs 1 -1 sc (X) col21 sh gr
+/Times-Bold ff 285.00 scf sf
+10200 3450 m
+gs 1 -1 sc (Error) col21 sh gr
+$F2psEnd
+rs
diff --git a/gnugo/src/doc/cdfa.fig b/gnugo/src/doc/cdfa.fig
new file mode 100644
index 0000000000000000000000000000000000000000..58a0db0ec671f30a889b99fccb6a3884b203f735
--- /dev/null
+++ b/gnugo/src/doc/cdfa.fig
@@ -0,0 +1,232 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+50.00
+Single
+-2
+1200 2
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 900 900 300 300 900 900 1200 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 6300 900 300 300 6300 900 6600 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 4500 900 300 300 4500 900 4800 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 2700 900 300 300 2700 900 3000 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 8100 900 300 300 8100 900 8400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 9600 900 300 300 9600 900 9900 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 11100 900 300 300 11100 900 11400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 12600 900 300 300 12600 900 12900 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 2700 2700 300 300 2700 2700 3000 2700
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 4500 2700 300 300 4500 2700 4800 2700
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 6300 2700 300 300 6300 2700 6600 2700
+1 3 0 1 21 7 100 0 -1 0.000 1 0.0000 9600 2700 300 300 9600 2700 9900 2700
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 4800 900 6000 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 900 5400 1500 6000 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 892 5400 292 6000 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 3000 900 4200 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 900 3600 1500 4200 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 892 3600 292 4200 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 900 1800 1350 2400 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 225 900 600 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 6600 900 7800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 900 7200 1500 7800 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 892 7200 292 7800 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 8400 900 9300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 9900 900 10800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 11400 900 12300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 900 1800 450 2400 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 900 1200 1200 2400 2400 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 3000 2700 4200 2700
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 2925 2475 3975 2100 4275 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 2925 2475 3600 1725 4275 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 4725 2475 6075 1125
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 2700 5400 2400 6000 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 2700 5400 3000 6000 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 6300 3000 6300 3300
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 6525 2475 6825 1575 7875 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 6525 2475 7575 2175 7950 1200
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 6525 2475 7875 1200
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 12600 600 12600 300
+ 0.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 8250 1200 8625 1875 9300 2550
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 8325 1125 9075 1725 9300 2550
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 9600 1200 9450 1800 9600 2400
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 9600 1200 9825 1800 9600 2400
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 10950 1200 10725 2025 9900 2475
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 10950 1200 9825 2475
+ 0.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 4
+ 1 1 2.00 60.00 165.00
+ 9300 2700 8700 2475 8700 3000 9300 2700
+ 0.000 1.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 4
+ 1 1 2.00 60.00 165.00
+ 9375 2925 8775 3150 9225 3600 9375 2925
+ 0.000 1.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 4
+ 1 1 2.00 60.00 165.00
+ 9600 3000 9375 3600 9900 3600 9600 3000
+ 0.000 1.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 4
+ 1 1 2.00 60.00 165.00
+ 12600 1200 12000 2850 11100 3000 9900 2850
+ 0.000 1.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 4
+ 1 1 2.00 60.00 165.00
+ 12600 1200 12000 2400 10800 2775 9900 2775
+ 0.000 1.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 12600 1200 11400 2400 9900 2700
+ 0.000 1.000 0.000
+3 0 0 1 21 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 9825 2925 10125 3225
+ 0.000 0.000
+4 0 0 100 0 2 19 0.0000 4 195 135 817 960 1\001
+4 0 0 100 0 2 19 0.0000 4 45 75 5400 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 5325 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 5325 442 X\001
+4 0 0 100 0 2 19 0.0000 4 45 75 3600 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 3525 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 3525 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 2625 945 2\001
+4 0 0 100 0 2 19 0.0000 4 195 135 4425 945 3\001
+4 0 0 100 0 2 19 0.0000 4 195 135 6225 945 4\001
+4 0 0 100 0 2 19 0.0000 4 45 75 7200 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 7125 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 7125 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 8025 945 5\001
+4 0 0 100 0 2 19 0.0000 4 45 75 8775 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 9525 975 6\001
+4 0 0 100 0 2 19 0.0000 4 45 75 10275 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 11025 975 7\001
+4 0 0 100 0 2 19 0.0000 4 195 210 11700 825 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 12525 975 8\001
+4 0 0 100 0 2 19 0.0000 4 195 225 1725 1125 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 1800 525 .\001
+4 0 0 100 0 2 19 0.0000 4 195 210 1425 2175 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 2625 2775 9\001
+4 0 0 100 0 2 19 0.0000 4 195 210 4425 2775 A\001
+4 0 0 100 0 2 19 0.0000 4 195 210 3525 2625 X\001
+4 0 0 100 0 2 19 0.0000 4 195 195 6225 2775 B\001
+4 0 0 100 0 2 19 0.0000 4 195 225 5325 2400 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 5400 2775 .\001
+4 0 0 100 0 2 19 0.0000 4 195 1860 5325 3600 Pattern "XXo"\001
+4 0 0 100 0 2 19 0.0000 4 45 75 3675 1950 .\001
+4 0 0 100 0 2 19 0.0000 4 195 210 5100 1800 X\001
+4 0 0 100 0 2 19 0.0000 4 195 225 3300 1800 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 6525 1800 X\001
+4 0 0 100 0 2 19 0.0000 4 195 225 7275 2025 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 7050 1800 .\001
+4 0 0 100 0 2 19 0.0000 4 195 2205 11625 225 Pattern "????..X"\001
+4 0 21 100 0 2 19 0.0000 4 195 225 8325 1950 O\001
+4 0 21 100 0 2 19 0.0000 4 195 210 8925 1575 X\001
+4 0 21 100 0 2 19 0.0000 4 195 225 9225 1875 O\001
+4 0 21 100 0 2 19 0.0000 4 195 210 9825 1875 X\001
+4 0 21 100 0 2 19 0.0000 4 195 225 10200 1800 O\001
+4 0 21 100 0 2 19 0.0000 4 45 75 10725 2100 .\001
+4 0 21 100 0 2 19 0.0000 4 195 135 9525 2775 0\001
+4 0 21 100 0 2 19 0.0000 4 195 225 8475 2775 O\001
+4 0 21 100 0 2 19 0.0000 4 195 210 8775 3600 X\001
+4 0 21 100 0 2 19 0.0000 4 45 75 9600 3750 .\001
+4 0 21 100 0 2 19 0.0000 4 195 225 11325 2100 O\001
+4 0 21 100 0 2 19 0.0000 4 45 75 11625 2325 .\001
+4 0 21 100 0 2 19 0.0000 4 195 210 12000 2850 X\001
+4 0 21 100 0 2 19 0.0000 4 195 690 10200 3450 Error\001
diff --git a/gnugo/src/doc/cdfa.jpg b/gnugo/src/doc/cdfa.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a9c629f6521df9d7bc2a0fa5630bf2baa4bddb8c
Binary files /dev/null and b/gnugo/src/doc/cdfa.jpg differ
diff --git a/gnugo/src/doc/cdfa.pdf b/gnugo/src/doc/cdfa.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0d2d6ebbc817a4aee52cac3bd6ddafff8fb97061
Binary files /dev/null and b/gnugo/src/doc/cdfa.pdf differ
diff --git a/gnugo/src/doc/cdfa.png b/gnugo/src/doc/cdfa.png
new file mode 100644
index 0000000000000000000000000000000000000000..18cf23d29ebbece9436365717230c6641354ac44
Binary files /dev/null and b/gnugo/src/doc/cdfa.png differ
diff --git a/gnugo/src/doc/copying.texi b/gnugo/src/doc/copying.texi
new file mode 100644
index 0000000000000000000000000000000000000000..fa485f314e06a2d63c83ede07bfeabb1ef973300
--- /dev/null
+++ b/gnugo/src/doc/copying.texi
@@ -0,0 +1,1272 @@
+The program GNU Go is distributed under the terms of the
+GNU General Public License (GPL). Its documentation is
+distributed under the terms of the GNU Free Documentation
+License (GFDL).
+
+@menu
+* GPL:: The GNU General Public License
+* GFDL:: The GNU Free Documentation License
+* GTP License:: The Go Text Protocol License
+@end menu
+
+@node GPL, GFDL, Copying, Copying
+@cindex licence, program (GPL)
+
+@section GNU GENERAL PUBLIC LICENSE
+@center Version 3, 29 June 2007
+
+@display
+Copyright @copyright{} 2007 Free Software Foundation, Inc.
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@unnumberedsec Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+@iftex
+@unnumberedsec TERMS AND CONDITIONS
+@end iftex
+@ifinfo
+@center TERMS AND CONDITIONS
+@end ifinfo
+
+@enumerate 0
+@item
+DEFINITIONS
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+@sp 1
+@item
+SOURCE CODE
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+@sp 1
+@item
+BASIC PERMISSIONS
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+@sp 1
+@item
+PROTECTING USERS' LEGAL RIGHTS FROM ANTI-CIRCUMVENTION LAW
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+@sp 1
+@item
+CONVEYING VERBATIM COPIES
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+@sp 1
+@item
+CONVEYING MODIFIED SOURCE VERSIONS
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+@sp 1
+@item
+CONVEYING NON-SOURCE FORMS
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+@sp 1
+@item
+ADDITIONAL TERMS
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+@sp 1
+@item
+TERMINATION
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+@sp 1
+@item
+ACCEPTANCE NOT REQUIRED FOR HAVING COPIES
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+@sp 1
+@item
+AUTOMATIC LICENSING OF DOWNSTREAM RECIPIENTS
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+@sp 1
+@item
+PATENTS
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+@sp 1
+@item
+NO SURRENDER OF OTHERS' FREEDOM
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+@sp 1
+@item
+USE WITH THE GNU AFFERO GENERAL PUBLIC LICENSE
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+@sp 1
+@item
+REVISED VERSIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+@sp 1
+@item
+DISCLAIMER OF WARRANTY
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+@sp 1
+@item
+LIMITATION OF LIABILITY.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+@sp 1
+@item
+INTERPRETATION OF SECTIONS 15 AND 16
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+@end enumerate
+
+@unnumberedsec How to Apply These Terms to your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
+
+@node GFDL, GTP License, GPL, Copying
+@cindex licence, documentation (GFDL)
+
+@section GNU FREE DOCUMENTATION LICENSE
+
+@c The GNU Free Documentation License.
+@center Version 1.3, 3 November 2008
+
+@c This file is intended to be included within another document,
+@c hence no sectioning command or @node.
+
+@display
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+@uref{http://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section Entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section Entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
+@end enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+@uref{http://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+@item
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+@end enumerate
+
+@page
+@heading ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+@end group
+@end smallexample
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with@dots{}Texts.'' line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+@node GTP License, , GFDL, Copying
+
+@section The Go Text Protocol License
+
+In order to facilitate the use of the Go Text Protocol, the two files
+@file{gtp.c} and @file{gtp.h} are licensed under the following terms.
+
+Copyright 2001 by the Free Software Foundation.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this file @file{gtp.x}, to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, provided that the above copyright
+notice(s) and this permission notice appear in all copies of the Software and
+that both the above copyright notice(s) and this permission notice appear in
+supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
diff --git a/gnugo/src/doc/dfa.eps b/gnugo/src/doc/dfa.eps
new file mode 100644
index 0000000000000000000000000000000000000000..3b38a2aa14d37f4577b70410a84f86444127708d
--- /dev/null
+++ b/gnugo/src/doc/dfa.eps
@@ -0,0 +1,413 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: dfa.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 1
+%%CreationDate: Fri Jun 22 17:21:06 2001
+%%For: turvoy@semeai.irisa.fr (Tanguy Urvoy, DEA, Paragraphe)
+%%Orientation: Portrait
+%%BoundingBox: 0 0 411 47
+%%Pages: 0
+%%BeginSetup
+%%EndSetup
+%%Magnification: 0.5000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+-6.0 54.0 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+%%EndProlog
+
+$F2psBegin
+10 setmiterlimit
+n -1000 2800 m -1000 -1000 l 14886 -1000 l 14886 2800 l cp clip
+ 0.03000 0.03000 sc
+7.500 slw
+% Ellipse
+n 900 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 6300 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4500 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2700 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 11100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 12600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+gs clippath
+5835 870 m 6000 900 l 5835 930 l 6015 930 l 6015 870 l cp
+clip
+n 4800 900 m 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5835 870 m 6000 900 l 5835 930 l 5835 900 l 5835 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5859 990 m 6000 900 l 5900 1034 l 6031 912 l 5991 868 l cp
+clip
+n 4800 900 m 4802 902 l 4807 906 l 4815 914 l 4828 926 l 4846 942 l
+ 4869 963 l 4896 986 l 4926 1013 l 4958 1041 l 4992 1070 l
+ 5027 1099 l 5061 1127 l 5095 1154 l 5128 1178 l 5159 1201 l
+ 5188 1221 l 5216 1238 l 5242 1254 l 5267 1267 l 5291 1277 l
+ 5314 1286 l 5336 1292 l 5358 1297 l 5379 1299 l 5400 1300 l
+ 5421 1299 l 5442 1297 l 5464 1292 l 5486 1286 l 5509 1277 l
+ 5533 1267 l 5558 1254 l 5584 1238 l 5612 1221 l 5641 1201 l
+ 5672 1178 l 5705 1154 l 5739 1127 l 5773 1099 l 5808 1070 l
+ 5842 1041 l 5874 1013 l 5904 986 l 5931 963 l 5954 942 l
+ 5972 926 l 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5859 990 m 6000 900 l 5900 1034 l 5879 1012 l 5859 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5900 758 m 6000 892 l 5859 802 l 5991 924 l 6031 880 l cp
+clip
+n 4800 892 m 4802 890 l 4807 886 l 4815 878 l 4828 866 l 4846 850 l
+ 4869 829 l 4896 806 l 4926 779 l 4958 751 l 4992 722 l
+ 5027 693 l 5061 665 l 5095 638 l 5128 614 l 5159 591 l
+ 5188 571 l 5216 554 l 5242 538 l 5267 525 l 5291 515 l
+ 5314 506 l 5336 500 l 5358 495 l 5379 493 l 5400 492 l
+ 5421 493 l 5442 495 l 5464 500 l 5486 506 l 5509 515 l
+ 5533 525 l 5558 538 l 5584 554 l 5612 571 l 5641 591 l
+ 5672 614 l 5705 638 l 5739 665 l 5773 693 l 5808 722 l
+ 5842 751 l 5874 779 l 5904 806 l 5931 829 l 5954 850 l
+ 5972 866 l 6000 892 l gs col0 s gr gr
+
+% arrowhead
+n 5900 758 m 6000 892 l 5859 802 l 5879 780 l 5900 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4035 870 m 4200 900 l 4035 930 l 4215 930 l 4215 870 l cp
+clip
+n 3000 900 m 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4035 870 m 4200 900 l 4035 930 l 4035 900 l 4035 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4059 990 m 4200 900 l 4100 1034 l 4231 912 l 4191 868 l cp
+clip
+n 3000 900 m 3002 902 l 3007 906 l 3015 914 l 3028 926 l 3046 942 l
+ 3069 963 l 3096 986 l 3126 1013 l 3158 1041 l 3192 1070 l
+ 3227 1099 l 3261 1127 l 3295 1154 l 3328 1178 l 3359 1201 l
+ 3388 1221 l 3416 1238 l 3442 1254 l 3467 1267 l 3491 1277 l
+ 3514 1286 l 3536 1292 l 3558 1297 l 3579 1299 l 3600 1300 l
+ 3621 1299 l 3642 1297 l 3664 1292 l 3686 1286 l 3709 1277 l
+ 3733 1267 l 3758 1254 l 3784 1238 l 3812 1221 l 3841 1201 l
+ 3872 1178 l 3905 1154 l 3939 1127 l 3973 1099 l 4008 1070 l
+ 4042 1041 l 4074 1013 l 4104 986 l 4131 963 l 4154 942 l
+ 4172 926 l 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4059 990 m 4200 900 l 4100 1034 l 4079 1012 l 4059 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4100 758 m 4200 892 l 4059 802 l 4191 924 l 4231 880 l cp
+clip
+n 3000 892 m 3002 890 l 3007 886 l 3015 878 l 3028 866 l 3046 850 l
+ 3069 829 l 3096 806 l 3126 779 l 3158 751 l 3192 722 l
+ 3227 693 l 3261 665 l 3295 638 l 3328 614 l 3359 591 l
+ 3388 571 l 3416 554 l 3442 538 l 3467 525 l 3491 515 l
+ 3514 506 l 3536 500 l 3558 495 l 3579 493 l 3600 492 l
+ 3621 493 l 3642 495 l 3664 500 l 3686 506 l 3709 515 l
+ 3733 525 l 3758 538 l 3784 554 l 3812 571 l 3841 591 l
+ 3872 614 l 3905 638 l 3939 665 l 3973 693 l 4008 722 l
+ 4042 751 l 4074 779 l 4104 806 l 4131 829 l 4154 850 l
+ 4172 866 l 4200 892 l gs col0 s gr gr
+
+% arrowhead
+n 4100 758 m 4200 892 l 4059 802 l 4079 780 l 4100 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2235 870 m 2400 900 l 2235 930 l 2415 930 l 2415 870 l cp
+clip
+n 1200 900 m 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2235 870 m 2400 900 l 2235 930 l 2235 900 l 2235 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2259 990 m 2400 900 l 2300 1034 l 2431 912 l 2391 868 l cp
+clip
+n 1200 900 m 1202 902 l 1207 906 l 1215 914 l 1228 926 l 1246 942 l
+ 1269 963 l 1296 986 l 1326 1013 l 1358 1041 l 1392 1070 l
+ 1427 1099 l 1461 1127 l 1495 1154 l 1528 1178 l 1559 1201 l
+ 1588 1221 l 1616 1238 l 1642 1254 l 1667 1267 l 1691 1277 l
+ 1714 1286 l 1736 1292 l 1758 1297 l 1779 1299 l 1800 1300 l
+ 1821 1299 l 1842 1297 l 1864 1292 l 1886 1286 l 1909 1277 l
+ 1933 1267 l 1958 1254 l 1984 1238 l 2012 1221 l 2041 1201 l
+ 2072 1178 l 2105 1154 l 2139 1127 l 2173 1099 l 2208 1070 l
+ 2242 1041 l 2274 1013 l 2304 986 l 2331 963 l 2354 942 l
+ 2372 926 l 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2259 990 m 2400 900 l 2300 1034 l 2279 1012 l 2259 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2300 758 m 2400 892 l 2259 802 l 2391 924 l 2431 880 l cp
+clip
+n 1200 892 m 1202 890 l 1207 886 l 1215 878 l 1228 866 l 1246 850 l
+ 1269 829 l 1296 806 l 1326 779 l 1358 751 l 1392 722 l
+ 1427 693 l 1461 665 l 1495 638 l 1528 614 l 1559 591 l
+ 1588 571 l 1616 554 l 1642 538 l 1667 525 l 1691 515 l
+ 1714 506 l 1736 500 l 1758 495 l 1779 493 l 1800 492 l
+ 1821 493 l 1842 495 l 1864 500 l 1886 506 l 1909 515 l
+ 1933 525 l 1958 538 l 1984 554 l 2012 571 l 2041 591 l
+ 2072 614 l 2105 638 l 2139 665 l 2173 693 l 2208 722 l
+ 2242 751 l 2274 779 l 2304 806 l 2331 829 l 2354 850 l
+ 2372 866 l 2400 892 l gs col0 s gr gr
+
+% arrowhead
+n 2300 758 m 2400 892 l 2259 802 l 2279 780 l 2300 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+435 870 m 600 900 l 435 930 l 615 930 l 615 870 l cp
+clip
+n 225 900 m 600 900 l gs col0 s gr gr
+
+% arrowhead
+n 435 870 m 600 900 l 435 930 l 435 900 l 435 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7635 870 m 7800 900 l 7635 930 l 7815 930 l 7815 870 l cp
+clip
+n 6600 900 m 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7635 870 m 7800 900 l 7635 930 l 7635 900 l 7635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7659 990 m 7800 900 l 7700 1034 l 7831 912 l 7791 868 l cp
+clip
+n 6600 900 m 6602 902 l 6607 906 l 6615 914 l 6628 926 l 6646 942 l
+ 6669 963 l 6696 986 l 6726 1013 l 6758 1041 l 6792 1070 l
+ 6827 1099 l 6861 1127 l 6895 1154 l 6928 1178 l 6959 1201 l
+ 6988 1221 l 7016 1238 l 7042 1254 l 7067 1267 l 7091 1277 l
+ 7114 1286 l 7136 1292 l 7158 1297 l 7179 1299 l 7200 1300 l
+ 7221 1299 l 7242 1297 l 7264 1292 l 7286 1286 l 7309 1277 l
+ 7333 1267 l 7358 1254 l 7384 1238 l 7412 1221 l 7441 1201 l
+ 7472 1178 l 7505 1154 l 7539 1127 l 7573 1099 l 7608 1070 l
+ 7642 1041 l 7674 1013 l 7704 986 l 7731 963 l 7754 942 l
+ 7772 926 l 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7659 990 m 7800 900 l 7700 1034 l 7679 1012 l 7659 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7700 758 m 7800 892 l 7659 802 l 7791 924 l 7831 880 l cp
+clip
+n 6600 892 m 6602 890 l 6607 886 l 6615 878 l 6628 866 l 6646 850 l
+ 6669 829 l 6696 806 l 6726 779 l 6758 751 l 6792 722 l
+ 6827 693 l 6861 665 l 6895 638 l 6928 614 l 6959 591 l
+ 6988 571 l 7016 554 l 7042 538 l 7067 525 l 7091 515 l
+ 7114 506 l 7136 500 l 7158 495 l 7179 493 l 7200 492 l
+ 7221 493 l 7242 495 l 7264 500 l 7286 506 l 7309 515 l
+ 7333 525 l 7358 538 l 7384 554 l 7412 571 l 7441 591 l
+ 7472 614 l 7505 638 l 7539 665 l 7573 693 l 7608 722 l
+ 7642 751 l 7674 779 l 7704 806 l 7731 829 l 7754 850 l
+ 7772 866 l 7800 892 l gs col0 s gr gr
+
+% arrowhead
+n 7700 758 m 7800 892 l 7659 802 l 7679 780 l 7700 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+9135 870 m 9300 900 l 9135 930 l 9315 930 l 9315 870 l cp
+clip
+n 8400 900 m 9300 900 l gs col0 s gr gr
+
+% arrowhead
+n 9135 870 m 9300 900 l 9135 930 l 9135 900 l 9135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+10635 870 m 10800 900 l 10635 930 l 10815 930 l 10815 870 l cp
+clip
+n 9900 900 m 10800 900 l gs col0 s gr gr
+
+% arrowhead
+n 10635 870 m 10800 900 l 10635 930 l 10635 900 l 10635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+12135 870 m 12300 900 l 12135 930 l 12315 930 l 12315 870 l cp
+clip
+n 11400 900 m 12300 900 l gs col0 s gr gr
+
+% arrowhead
+n 12135 870 m 12300 900 l 12135 930 l 12135 900 l 12135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+12630 1335 m 12600 1500 l 12570 1335 l 12570 1515 l 12630 1515 l cp
+clip
+n 12600 1200 m 12600 1500 l gs col0 s gr gr
+
+% arrowhead
+n 12630 1335 m 12600 1500 l 12570 1335 l 12600 1335 l 12630 1335 l cp gs 0.00 setgray ef gr col0 s
+/Times-Bold ff 285.00 scf sf
+817 960 m
+gs 1 -1 sc (1) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5400 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3600 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+2625 945 m
+gs 1 -1 sc (2) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1800 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1725 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1725 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+4425 945 m
+gs 1 -1 sc (3) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6225 945 m
+gs 1 -1 sc (4) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7200 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8025 945 m
+gs 1 -1 sc (5) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8775 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+9525 975 m
+gs 1 -1 sc (6) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+10275 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11025 975 m
+gs 1 -1 sc (7) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11700 825 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+12525 975 m
+gs 1 -1 sc (8) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11625 1800 m
+gs 1 -1 sc (Pattern "????..X") col0 sh gr
+$F2psEnd
+rs
diff --git a/gnugo/src/doc/dfa.fig b/gnugo/src/doc/dfa.fig
new file mode 100644
index 0000000000000000000000000000000000000000..fdae49f6a67ebaf9c20fd2ae4dbab57e5613122b
--- /dev/null
+++ b/gnugo/src/doc/dfa.fig
@@ -0,0 +1,111 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+50.00
+Single
+-2
+1200 2
+6 225 225 13875 1800
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 900 900 300 300 900 900 1200 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 6300 900 300 300 6300 900 6600 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 4500 900 300 300 4500 900 4800 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 2700 900 300 300 2700 900 3000 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 8100 900 300 300 8100 900 8400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 9600 900 300 300 9600 900 9900 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 11100 900 300 300 11100 900 11400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 12600 900 300 300 12600 900 12900 900
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 4800 900 6000 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 900 5400 1500 6000 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 892 5400 292 6000 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 3000 900 4200 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 900 3600 1500 4200 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 892 3600 292 4200 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 1200 900 2400 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 900 1800 1500 2400 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 892 1800 292 2400 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 225 900 600 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 6600 900 7800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 900 7200 1500 7800 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 892 7200 292 7800 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 8400 900 9300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 9900 900 10800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 11400 900 12300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 12600 1200 12600 1500
+ 0.000 0.000
+4 0 0 100 0 2 19 0.0000 4 195 135 817 960 1\001
+4 0 0 100 0 2 19 0.0000 4 45 75 5400 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 5325 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 5325 442 X\001
+4 0 0 100 0 2 19 0.0000 4 45 75 3600 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 3525 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 3525 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 2625 945 2\001
+4 0 0 100 0 2 19 0.0000 4 45 75 1800 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 1725 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 1725 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 4425 945 3\001
+4 0 0 100 0 2 19 0.0000 4 195 135 6225 945 4\001
+4 0 0 100 0 2 19 0.0000 4 45 75 7200 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 7125 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 7125 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 8025 945 5\001
+4 0 0 100 0 2 19 0.0000 4 45 75 8775 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 9525 975 6\001
+4 0 0 100 0 2 19 0.0000 4 45 75 10275 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 11025 975 7\001
+4 0 0 100 0 2 19 0.0000 4 195 210 11700 825 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 12525 975 8\001
+4 0 0 100 0 2 19 0.0000 4 195 2205 11625 1800 Pattern "????..X"\001
+-6
diff --git a/gnugo/src/doc/dfa.jpg b/gnugo/src/doc/dfa.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..3e596643c72a1a01c91011358248d5edf32da40a
Binary files /dev/null and b/gnugo/src/doc/dfa.jpg differ
diff --git a/gnugo/src/doc/dfa.pdf b/gnugo/src/doc/dfa.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..41010970e968abc807e479a38b87680d21a3b42b
Binary files /dev/null and b/gnugo/src/doc/dfa.pdf differ
diff --git a/gnugo/src/doc/dfa.png b/gnugo/src/doc/dfa.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c99ebcbcb817407d6277b28b6cc22ca1b27587d
Binary files /dev/null and b/gnugo/src/doc/dfa.png differ
diff --git a/gnugo/src/doc/dfa.texi b/gnugo/src/doc/dfa.texi
new file mode 100644
index 0000000000000000000000000000000000000000..6ffe358b6a6da22bcd84b368071f76c658fdc617
--- /dev/null
+++ b/gnugo/src/doc/dfa.texi
@@ -0,0 +1,441 @@
+In this chapter, we describe the principles of the GNU Go DFA
+pattern matcher. The aim of this system is to permit a fast
+pattern matching when it becomes time critical like in owl
+module (@ref{The Owl Code}). Since GNU Go 3.2, this is enabled
+by default. You can still get back the traditional pattern matcher
+by running @command{configure --disable-dfa} and then recompiling
+GNU Go.
+
+Otherwise, a finite state machine called a Deterministic Finite
+State Automaton (@ref{What is a DFA}) will be built off line from the
+pattern database. This is used at runtime to speedup pattern matching
+(@ref{Pattern matching with DFA} and @ref{Incremental Algorithm}). The
+runtime speedup is at the cost of an increase in memory use and
+compile time.
+
+
+@menu
+* Introduction to the DFA:: Scanning the board along a path
+* What is a DFA:: A recall of language theory.
+* Pattern matching with DFA:: How to retrieve go patterns with a DFA?
+* Building the DFA:: Playing with explosives.
+* Incremental Algorithm:: The joy of determinism.
+* DFA Optimizations:: Some possible optimizations.
+@end menu
+
+
+@cindex pattern matching
+@cindex fast pattern matching
+@cindex pattern database
+@cindex finite state automaton
+@cindex automaton
+@cindex dfa
+@cindex dfa.h
+@cindex dfa.c
+@cindex matchpat.c
+@cindex product
+
+
+@node Introduction to the DFA
+@section Introduction to the DFA
+
+The general idea is as follows:
+
+For each intersection of the board, its neighbourhood is scanned following
+a predefined path. The actual path used does not matter very much; GNU Go
+uses a spiral as shown below.
+
+@ifinfo
+@example
+ +---B--------------+
+ | C 4 A . . . . . .|
+ D 5 1 3 9 . . . . .|
+ E 6 2 8 . . X . . .|
+ | F 7 . . . . . . .|
+ | . +-> . . . . . .|
+ | . . . . . . . . .|
+ | . O . . . X . . .|
+ | . . . . . . . . .|
+ | . . . . . . . . .|
+ +------------------+
+@end example
+@end ifinfo
+@ifnotinfo
+@image{path}
+@end ifnotinfo
+
+In each step of the path, the pattern matcher jumps into a state
+determined by what it has found on the board so far. If we have
+successfully matched one or several patterns in this step, this state
+immediately tells us so (in its @dfn{attribute}).
+But the state also implicitly encodes which further patterns can still
+get matched: The information stored in the state contains in which state
+to jump next, depending on whether we find a black, white or empty
+intersection (or an intersection out of board) in the next step of the
+path. The state will also immediately tell us if we cannot find any
+further pattern (by telling us to jump into the @dfn{error} state).
+
+These sloppy explanations may become clearer with the definitions in
+the next section (@ref{What is a DFA}).
+
+Reading the board following a predefined path reduces
+the two dimentional pattern matching to a linear text searching problem.
+For example, this pattern
+
+@example
+?X?
+.O?
+?OO
+@end example
+
+@noindent
+scanned following the path
+
+@example
+ B
+C4A
+5139
+628
+ 7
+@end example
+
+@noindent
+gives the string @b{"OO?X.?*O*?*?"}
+where @b{"?"} means @b{'don't care'} and @b{"*"} means @b{'don't care, can
+even be out of board'}.
+
+So we can forget that we are dealing with two dimensional patterns and
+consider linear patterns.
+
+
+@node What is a DFA
+@section What is a DFA
+
+The acronym DFA means Deterministic Finite state Automaton
+(See @uref{http://www.eti.pg.gda.pl/~jandac/thesis/node12.html}
+or @cite{Hopcroft & Ullman "Introduction to Language Theory"}
+for more details).
+DFA are common tools in compilers design
+(Read @cite{Aho, Ravi Sethi, Ullman "COMPILERS: Principles, Techniques and Tools"}
+for a complete introduction), a lot of
+powerfull text searching algorithm like @cite{Knuth-Morris-Pratt}
+or @cite{Boyer-Moore} algorithms are based on DFA's
+(See @uref{http://www-igm.univ-mlv.fr/~lecroq/string/} for a bibliography
+of pattern matching algorithms).
+
+Basically,
+a DFA is a set of @dfn{states} connected by labeled @dfn{transitions}.
+The labels are the values read on the board,
+in GNU Go these values are EMPTY, WHITE, BLACK or OUT_BOARD, denoted
+respectively by '.','O','X' and '#'.
+
+
+The best way to represent a DFA is to draw its transition graph:
+the pattern @b{"????..X"} is recognized by the following DFA:
+
+@ifinfo
+@example
+@group
+ .,X,O .,X,O .,X,O .,X,O . . X
+[1]------>[2]----->[3]----->[4]----->[5]--->[6]--->[7]--->[8 OK!]
+Start
+@end group
+@end example
+@end ifinfo
+
+@ifnotinfo
+@image{dfa}
+@end ifnotinfo
+
+
+This means that
+starting from state [1], if you read '.','X' or 'O' on the board,
+go to state [2] and so on until you reach state [5].
+From state [5], if you read '.', go to state [6]
+otherwise go to error state [0].
+And so on until you reach state [8].
+As soon as you reach state [8],
+you recognize Pattern @b{"????..X"}
+
+Adding a pattern like @b{"XXo"} ('o' is a wildcard for not 'X')
+will transform directly the automaton
+by synchronization product (@ref{Building the DFA}).
+Consider the following DFA:
+
+@ifinfo
+@example
+@group
+Start .,O .,X,O .,O,X .,X,O . . X
+[1]---->[2]----->[3]----->[4]------>[5]--->[6]---->[7]--->[8 OK!]
+ | ^ ^ ^
+ | .,O | | |
+ | ---- | |
+ | | X | |
+ | | --- .,X,O |
+ | | | |
+ | X | X | O,. |
+ --------->[9]------>[A]--->[B OK!]-
+@end group
+@end example
+@end ifinfo
+
+@ifnotinfo
+@image{dfa2}
+@end ifnotinfo
+
+By adding a special @dfn{error} state and completing each state
+by a transition to error state when there is none, we transform
+easily a DFA in a @dfn{Complete Deterministic Finite state
+Automaton} (CDFA). The synchronization product
+(@ref{Building the DFA}) is only possible on CDFA's.
+
+
+@ifinfo
+@example
+@group
+Start .,O .,X,O .,O,X .,X,O . . X
+[1]---->[2]----->[3]----->[4]------>[5]--->[6]---->[7]--->[8 OK!]
+ | ^ ^ ^ | | |
+ | .,O | | | | | |
+ | ---- | | | | |
+ | | X | | |X,O | .,O |X,.,O
+ | | --- .,X,O | | | |
+ | | | | | | |
+ | X | X | O,. | \ / \ / \ /
+ --------->[9]------>[A]--->[B OK!]- [0 Error state !]
+@end group
+@end example
+@end ifinfo
+@ifnotinfo
+@image{cdfa}
+@end ifnotinfo
+
+The graph of a CDFA is coded by an array of states:
+The 0 state is the "error" state and
+the start state is 1.
+
+@example
+@group
+----------------------------------------------------
+ state | . | O | X | # | att
+----------------------------------------------------
+ 1 | 2 | 2 | 9 | 0 |
+ 2 | 3 | 3 | 3 | 0 |
+ 3 | 4 | 4 | 4 | 0 |
+ 5 | 6 | 0 | 0 | 0 |
+ 6 | 7 | 0 | 0 | 0 |
+ 7 | 0 | 0 | 8 | 0 |
+ 8 | 0 | 0 | 0 | 0 | Found pattern "????..X"
+ 9 | 3 | 3 | A | 0 |
+ A | B | B | 4 | 0 |
+ B | 5 | 5 | 5 | 0 | Found pattern "XXo"
+----------------------------------------------------
+@end group
+@end example
+
+To each state we associate an often empty
+list of attributes which is the
+list of pattern indexes recognized when this state is reached.
+In '@file{dfa.h}' this is basically represented by two stuctures:
+
+@example
+@group
+@code{
+/* dfa state */
+typedef struct state
+@{
+ int next[4]; /* transitions for EMPTY, BLACK, WHITE and OUT_BOARD */
+ attrib_t *att;
+@}
+state_t;
+
+/* dfa */
+typedef struct dfa
+@{
+ attrib_t *indexes; /* Array of pattern indexes */
+ int maxIndexes;
+
+ state_t *states; /* Array of states */
+ int maxStates;
+@}
+dfa_t;}
+@end group
+@end example
+
+@node Pattern matching with DFA
+@section Pattern matching with DFA
+
+Recognizing with a DFA is very simple
+and thus very fast
+(See '@code{scan_for_pattern()}' in the '@file{engine/matchpat.c}' file).
+
+
+Starting from the start state, we only need to read the board
+following the spiral path, jump from states to states following
+the transitions labelled by the values read on the board and
+collect the patterns indexes on the way. If we reach the error
+state (zero), it means that no more patterns will be matched.
+The worst case complexity of this algorithm is o(m) where m is
+the size of the biggest pattern.
+
+Here is an example of scan:
+
+First we build a minimal DFA recognizing these patterns:
+@b{"X..X"}, @b{"X???"}, @b{"X.OX"} and @b{"X?oX"}.
+Note that wildcards like '?','o', or 'x' give multiple out-transitions.
+
+@example
+@group
+----------------------------------------------------
+ state | . | O | X | # | att
+----------------------------------------------------
+ 1 | 0 | 0 | 2 | 0 |
+ 2 | 3 | 10 | 10 | 0 |
+ 3 | 4 | 7 | 9 | 0 |
+ 4 | 5 | 5 | 6 | 0 |
+ 5 | 0 | 0 | 0 | 0 | 2
+ 6 | 0 | 0 | 0 | 0 | 4 2 1
+ 7 | 5 | 5 | 8 | 0 |
+ 8 | 0 | 0 | 0 | 0 | 4 2 3
+ 9 | 5 | 5 | 5 | 0 |
+ 10 | 11 | 11 | 9 | 0 |
+ 11 | 5 | 5 | 12 | 0 |
+ 12 | 0 | 0 | 0 | 0 | 4 2
+----------------------------------------------------
+@end group
+@end example
+
+We perform the scan of the string
+@b{"X..XXO...."} starting from state 1:
+
+Current state: 1, substring to scan :@b{ X..XXO....}
+
+We read an 'X' value, so from state 1 we must go to
+state 2.
+
+Current state: 2, substring to scan : @b{..XXO....}
+
+We read a '.' value, so from state 2 we must go to
+state 3 and so on ...
+
+@example
+Current state: 3, substring to scan : .XXO....
+Current state: 4, substring to scan : XXO....
+Current state: 6, substring to scan : XO....
+Found pattern 4
+Found pattern 2
+Found pattern 1
+@end example
+
+After reaching state 6 where we match patterns
+1,2 and 4, there is no out-transitions so we stop the matching.
+To keep the same match order as in the standard algorithm,
+the patterns indexes are collected in an array and sorted by indexes.
+
+@node Building the DFA
+@section Building the DFA
+
+The most flavouring point is the building of the minimal DFA
+recognizing a given set of patterns.
+To perform the insertion of a new
+pattern into an already existing DFA one must completly rebuild
+the DFA: the principle is to build the minimal CDFA recognizing
+the new pattern to replace the original CDFA with its
+@dfn{synchronised product} by the new one.
+
+We first give a formal definition:
+Let @b{L} be the left CDFA and @b{R} be the right one.
+Let @b{B} be the @dfn{synchronised product} of @b{L} by @b{R}.
+Its states are the couples @b{(l,r)} where @b{l} is a state of @b{L} and
+@b{r} is a state of @b{R}.
+The state @b{(0,0)} is the error state of @b{B} and the state
+@b{(1,1)} is its initial state.
+To each couple @b{(l,r)} we associate the union of patterns
+recognized in both @b{l} and @b{r}.
+The transitions set of @b{B} is the set of transitions
+@b{(l1,r1)---a--->(l2,r2)} for
+each symbol @b{'a'} such that both @b{l1---a--->l2} in @b{L}
+and @b{r1---a--->r2} in @b{R}.
+
+The maximal number of states of @b{B} is the product of the
+number of states of @b{L} and @b{R} but almost all this states
+are non reachable from the initial state @b{(1,1)}.
+
+The algorithm used in function '@code{sync_product()}' builds
+the minimal product DFA only by keeping the reachable states.
+It recursively scans the product CDFA by following simultaneously
+the transitions of @b{L} and @b{R}. A hast table
+(@code{gtest}) is used to check if a state @b{(l,r)} has
+already been reached, the reachable states are remapped on
+a new DFA. The CDFA thus obtained is minimal and recognizes the
+union of the two patterns sets.
+
+@ifnotinfo
+For example these two CDFA's:
+
+
+@image{sync-prod1}
+
+Give by synchronization product the following one:
+
+
+@image{sync-prod2}
+@end ifnotinfo
+
+It is possible to construct a special pattern database that
+generates an "explosive" automaton: the size of the DFA is in
+the worst case exponential in the number of patterns it
+recognizes. But it doesn't occur in pratical situations:
+the DFA size tends to be @dfn{stable}. By @dfn{stable} we mean that if we
+add a pattern which greatly increases the size of the DFA it
+also increases the chance that the next added pattern does not
+increase its size at all. Nevertheless there are many ways to
+reduce the size of the DFA. Good compression methods are
+explained in @cite{Aho, Ravi Sethi, Ullman "COMPILERS:
+Principles, Techniques and Tools" chapter Optimization of
+DFA-based pattern matchers}.
+
+@node Incremental Algorithm
+@section Incremental Algorithm
+
+The incremental version of the DFA pattern matcher is not yet implemented
+in GNU Go but we explain here how it will work.
+By definition of a deterministic automaton, scanning the same
+string will reach the same states every time.
+
+Each reached state during pattern matching is stored in a stack
+@code{top_stack[i][j]} and @code{state_stack[i][j][stack_idx]}
+We use one stack by intersection @code{(i,j)}. A precomputed reverse
+path list allows to know for each couple of board intersections
+@code{(x,y)} its position @code{reverse(x,y)} in the spiral scan path
+starting from @code{(0,0)}.
+
+When a new stone is put on the board at @code{(lx,ly)}, the only work
+of the pattern matcher is:
+
+@example
+@group
+@code{
+ for(each stone on the board at (i,j))
+ if(reverse(lx-i,ly-j) < top_stack[i][j])
+ @{
+ begin the dfa scan from the state
+ state_stack[i][j][reverse(lx-i,ly-j)];
+ @}
+}
+@end group
+@end example
+
+In most situations reverse(lx-i,ly-j) will be inferior to
+top_stack[i][j]. This should speedup a lot pattern matching.
+
+@node DFA Optimizations
+@section Some DFA Optimizations
+
+The DFA is constructed to minimize jumps in memory making some
+assumptions about the frequencies of the values: the EMPTY
+value is supposed to appear often on the board, so the the '.'
+transition are almost always successors in memory. The
+OUT_BOARD are supposed to be rare, so '#' transitions will
+almost always imply a big jump.
+
diff --git a/gnugo/src/doc/dfa2.eps b/gnugo/src/doc/dfa2.eps
new file mode 100644
index 0000000000000000000000000000000000000000..e008c0e37e13bf839905678dc8f4f87c4531d63c
--- /dev/null
+++ b/gnugo/src/doc/dfa2.eps
@@ -0,0 +1,622 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: dfa2.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 1
+%%CreationDate: Fri Jun 22 17:40:37 2001
+%%For: turvoy@semeai.irisa.fr (Tanguy Urvoy, DEA, Paragraphe)
+%%Orientation: Portrait
+%%BoundingBox: 0 0 411 101
+%%Pages: 0
+%%BeginSetup
+%%EndSetup
+%%Magnification: 0.5000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+-6.0 108.0 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+%%EndProlog
+
+$F2psBegin
+10 setmiterlimit
+n -1000 4600 m -1000 -1000 l 14886 -1000 l 14886 4600 l cp clip
+ 0.03000 0.03000 sc
+7.500 slw
+% Ellipse
+n 900 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 6300 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4500 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2700 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 11100 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 12600 900 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2700 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4500 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 6300 2700 300 300 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+gs clippath
+5835 870 m 6000 900 l 5835 930 l 6015 930 l 6015 870 l cp
+clip
+n 4800 900 m 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5835 870 m 6000 900 l 5835 930 l 5835 900 l 5835 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5859 990 m 6000 900 l 5900 1034 l 6031 912 l 5991 868 l cp
+clip
+n 4800 900 m 4802 902 l 4807 906 l 4815 914 l 4828 926 l 4846 942 l
+ 4869 963 l 4896 986 l 4926 1013 l 4958 1041 l 4992 1070 l
+ 5027 1099 l 5061 1127 l 5095 1154 l 5128 1178 l 5159 1201 l
+ 5188 1221 l 5216 1238 l 5242 1254 l 5267 1267 l 5291 1277 l
+ 5314 1286 l 5336 1292 l 5358 1297 l 5379 1299 l 5400 1300 l
+ 5421 1299 l 5442 1297 l 5464 1292 l 5486 1286 l 5509 1277 l
+ 5533 1267 l 5558 1254 l 5584 1238 l 5612 1221 l 5641 1201 l
+ 5672 1178 l 5705 1154 l 5739 1127 l 5773 1099 l 5808 1070 l
+ 5842 1041 l 5874 1013 l 5904 986 l 5931 963 l 5954 942 l
+ 5972 926 l 6000 900 l gs col0 s gr gr
+
+% arrowhead
+n 5859 990 m 6000 900 l 5900 1034 l 5879 1012 l 5859 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5900 758 m 6000 892 l 5859 802 l 5991 924 l 6031 880 l cp
+clip
+n 4800 892 m 4802 890 l 4807 886 l 4815 878 l 4828 866 l 4846 850 l
+ 4869 829 l 4896 806 l 4926 779 l 4958 751 l 4992 722 l
+ 5027 693 l 5061 665 l 5095 638 l 5128 614 l 5159 591 l
+ 5188 571 l 5216 554 l 5242 538 l 5267 525 l 5291 515 l
+ 5314 506 l 5336 500 l 5358 495 l 5379 493 l 5400 492 l
+ 5421 493 l 5442 495 l 5464 500 l 5486 506 l 5509 515 l
+ 5533 525 l 5558 538 l 5584 554 l 5612 571 l 5641 591 l
+ 5672 614 l 5705 638 l 5739 665 l 5773 693 l 5808 722 l
+ 5842 751 l 5874 779 l 5904 806 l 5931 829 l 5954 850 l
+ 5972 866 l 6000 892 l gs col0 s gr gr
+
+% arrowhead
+n 5900 758 m 6000 892 l 5859 802 l 5879 780 l 5900 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4035 870 m 4200 900 l 4035 930 l 4215 930 l 4215 870 l cp
+clip
+n 3000 900 m 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4035 870 m 4200 900 l 4035 930 l 4035 900 l 4035 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4059 990 m 4200 900 l 4100 1034 l 4231 912 l 4191 868 l cp
+clip
+n 3000 900 m 3002 902 l 3007 906 l 3015 914 l 3028 926 l 3046 942 l
+ 3069 963 l 3096 986 l 3126 1013 l 3158 1041 l 3192 1070 l
+ 3227 1099 l 3261 1127 l 3295 1154 l 3328 1178 l 3359 1201 l
+ 3388 1221 l 3416 1238 l 3442 1254 l 3467 1267 l 3491 1277 l
+ 3514 1286 l 3536 1292 l 3558 1297 l 3579 1299 l 3600 1300 l
+ 3621 1299 l 3642 1297 l 3664 1292 l 3686 1286 l 3709 1277 l
+ 3733 1267 l 3758 1254 l 3784 1238 l 3812 1221 l 3841 1201 l
+ 3872 1178 l 3905 1154 l 3939 1127 l 3973 1099 l 4008 1070 l
+ 4042 1041 l 4074 1013 l 4104 986 l 4131 963 l 4154 942 l
+ 4172 926 l 4200 900 l gs col0 s gr gr
+
+% arrowhead
+n 4059 990 m 4200 900 l 4100 1034 l 4079 1012 l 4059 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4100 758 m 4200 892 l 4059 802 l 4191 924 l 4231 880 l cp
+clip
+n 3000 892 m 3002 890 l 3007 886 l 3015 878 l 3028 866 l 3046 850 l
+ 3069 829 l 3096 806 l 3126 779 l 3158 751 l 3192 722 l
+ 3227 693 l 3261 665 l 3295 638 l 3328 614 l 3359 591 l
+ 3388 571 l 3416 554 l 3442 538 l 3467 525 l 3491 515 l
+ 3514 506 l 3536 500 l 3558 495 l 3579 493 l 3600 492 l
+ 3621 493 l 3642 495 l 3664 500 l 3686 506 l 3709 515 l
+ 3733 525 l 3758 538 l 3784 554 l 3812 571 l 3841 591 l
+ 3872 614 l 3905 638 l 3939 665 l 3973 693 l 4008 722 l
+ 4042 751 l 4074 779 l 4104 806 l 4131 829 l 4154 850 l
+ 4172 866 l 4200 892 l gs col0 s gr gr
+
+% arrowhead
+n 4100 758 m 4200 892 l 4059 802 l 4079 780 l 4100 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2247 969 m 2400 900 l 2281 1018 l 2429 916 l 2395 867 l cp
+clip
+n 1200 900 m 1203 902 l 1209 906 l 1219 913 l 1235 924 l 1257 939 l
+ 1284 957 l 1315 978 l 1350 1000 l 1387 1024 l 1424 1047 l
+ 1461 1070 l 1498 1092 l 1533 1112 l 1566 1129 l 1598 1145 l
+ 1627 1159 l 1655 1170 l 1681 1180 l 1706 1187 l 1730 1193 l
+ 1754 1197 l 1777 1199 l 1800 1200 l 1823 1199 l 1846 1197 l
+ 1870 1193 l 1894 1187 l 1919 1180 l 1945 1170 l 1973 1159 l
+ 2002 1145 l 2034 1129 l 2067 1112 l 2102 1092 l 2139 1070 l
+ 2176 1047 l 2213 1024 l 2250 1000 l 2285 978 l 2316 957 l
+ 2343 939 l 2365 924 l 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2247 969 m 2400 900 l 2281 1018 l 2264 993 l 2247 969 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+435 870 m 600 900 l 435 930 l 615 930 l 615 870 l cp
+clip
+n 225 900 m 600 900 l gs col0 s gr gr
+
+% arrowhead
+n 435 870 m 600 900 l 435 930 l 435 900 l 435 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7635 870 m 7800 900 l 7635 930 l 7815 930 l 7815 870 l cp
+clip
+n 6600 900 m 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7635 870 m 7800 900 l 7635 930 l 7635 900 l 7635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7659 990 m 7800 900 l 7700 1034 l 7831 912 l 7791 868 l cp
+clip
+n 6600 900 m 6602 902 l 6607 906 l 6615 914 l 6628 926 l 6646 942 l
+ 6669 963 l 6696 986 l 6726 1013 l 6758 1041 l 6792 1070 l
+ 6827 1099 l 6861 1127 l 6895 1154 l 6928 1178 l 6959 1201 l
+ 6988 1221 l 7016 1238 l 7042 1254 l 7067 1267 l 7091 1277 l
+ 7114 1286 l 7136 1292 l 7158 1297 l 7179 1299 l 7200 1300 l
+ 7221 1299 l 7242 1297 l 7264 1292 l 7286 1286 l 7309 1277 l
+ 7333 1267 l 7358 1254 l 7384 1238 l 7412 1221 l 7441 1201 l
+ 7472 1178 l 7505 1154 l 7539 1127 l 7573 1099 l 7608 1070 l
+ 7642 1041 l 7674 1013 l 7704 986 l 7731 963 l 7754 942 l
+ 7772 926 l 7800 900 l gs col0 s gr gr
+
+% arrowhead
+n 7659 990 m 7800 900 l 7700 1034 l 7679 1012 l 7659 990 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7700 758 m 7800 892 l 7659 802 l 7791 924 l 7831 880 l cp
+clip
+n 6600 892 m 6602 890 l 6607 886 l 6615 878 l 6628 866 l 6646 850 l
+ 6669 829 l 6696 806 l 6726 779 l 6758 751 l 6792 722 l
+ 6827 693 l 6861 665 l 6895 638 l 6928 614 l 6959 591 l
+ 6988 571 l 7016 554 l 7042 538 l 7067 525 l 7091 515 l
+ 7114 506 l 7136 500 l 7158 495 l 7179 493 l 7200 492 l
+ 7221 493 l 7242 495 l 7264 500 l 7286 506 l 7309 515 l
+ 7333 525 l 7358 538 l 7384 554 l 7412 571 l 7441 591 l
+ 7472 614 l 7505 638 l 7539 665 l 7573 693 l 7608 722 l
+ 7642 751 l 7674 779 l 7704 806 l 7731 829 l 7754 850 l
+ 7772 866 l 7800 892 l gs col0 s gr gr
+
+% arrowhead
+n 7700 758 m 7800 892 l 7659 802 l 7679 780 l 7700 758 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+9135 870 m 9300 900 l 9135 930 l 9315 930 l 9315 870 l cp
+clip
+n 8400 900 m 9300 900 l gs col0 s gr gr
+
+% arrowhead
+n 9135 870 m 9300 900 l 9135 930 l 9135 900 l 9135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+10635 870 m 10800 900 l 10635 930 l 10815 930 l 10815 870 l cp
+clip
+n 9900 900 m 10800 900 l gs col0 s gr gr
+
+% arrowhead
+n 10635 870 m 10800 900 l 10635 930 l 10635 900 l 10635 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+12135 870 m 12300 900 l 12135 930 l 12315 930 l 12315 870 l cp
+clip
+n 11400 900 m 12300 900 l gs col0 s gr gr
+
+% arrowhead
+n 12135 870 m 12300 900 l 12135 930 l 12135 900 l 12135 870 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+12630 1335 m 12600 1500 l 12570 1335 l 12570 1515 l 12630 1515 l cp
+clip
+n 12600 1200 m 12600 1500 l gs col0 s gr gr
+
+% arrowhead
+n 12630 1335 m 12600 1500 l 12570 1335 l 12600 1335 l 12630 1335 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2281 782 m 2400 900 l 2247 831 l 2395 933 l 2429 884 l cp
+clip
+n 1200 900 m 1203 898 l 1209 894 l 1219 887 l 1235 876 l 1257 861 l
+ 1284 843 l 1315 822 l 1350 800 l 1387 776 l 1424 753 l
+ 1461 730 l 1498 708 l 1533 688 l 1566 671 l 1598 655 l
+ 1627 641 l 1655 630 l 1681 620 l 1706 613 l 1730 607 l
+ 1754 603 l 1777 601 l 1800 600 l 1823 601 l 1846 603 l
+ 1870 607 l 1894 613 l 1919 620 l 1945 630 l 1973 641 l
+ 2002 655 l 2034 671 l 2067 688 l 2102 708 l 2139 730 l
+ 2176 753 l 2213 776 l 2250 800 l 2285 822 l 2316 843 l
+ 2343 861 l 2365 876 l 2400 900 l gs col0 s gr gr
+
+% arrowhead
+n 2281 782 m 2400 900 l 2247 831 l 2264 807 l 2281 782 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+2210 2613 m 2359 2688 l 2193 2671 l 2406 2733 l 2423 2675 l cp
+clip
+n 900 1200 m 901 1202 l 902 1207 l 905 1217 l 909 1231 l 915 1252 l
+ 923 1278 l 932 1310 l 944 1348 l 957 1391 l 971 1438 l
+ 987 1488 l 1004 1540 l 1021 1592 l 1039 1645 l 1057 1697 l
+ 1075 1748 l 1093 1796 l 1111 1843 l 1128 1887 l 1146 1929 l
+ 1163 1968 l 1181 2005 l 1198 2039 l 1216 2071 l 1233 2101 l
+ 1251 2130 l 1270 2156 l 1289 2181 l 1309 2205 l 1329 2228 l
+ 1350 2250 l 1372 2271 l 1395 2291 l 1419 2311 l 1444 2330 l
+ 1470 2349 l 1499 2367 l 1529 2384 l 1561 2402 l 1595 2419 l
+ 1632 2437 l 1671 2454 l 1713 2472 l 1757 2489 l 1804 2507 l
+ 1852 2525 l 1903 2543 l 1955 2561 l 2008 2579 l 2060 2596 l
+ 2112 2613 l 2162 2629 l 2209 2643 l 2252 2656 l 2290 2668 l
+ 2322 2677 l 2348 2685 l 2369 2691 l 2400 2700 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 2210 2613 m 2359 2688 l 2193 2671 l 2201 2642 l 2210 2613 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+4035 2670 m 4200 2700 l 4035 2730 l 4215 2730 l 4215 2670 l cp
+clip
+n 3000 2700 m 4200 2700 l gs col0 s gr gr
+
+% arrowhead
+n 4035 2670 m 4200 2700 l 4035 2730 l 4035 2700 l 4035 2670 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+4176 1309 m 4260 1164 l 4232 1330 l 4308 1121 l 4252 1101 l cp
+clip
+n 2925 2475 m 2927 2474 l 2931 2473 l 2940 2469 l 2952 2464 l 2970 2457 l
+ 2993 2448 l 3022 2437 l 3055 2424 l 3093 2408 l 3134 2391 l
+ 3177 2373 l 3223 2354 l 3269 2335 l 3315 2314 l 3361 2294 l
+ 3406 2274 l 3448 2255 l 3489 2235 l 3528 2216 l 3565 2197 l
+ 3599 2179 l 3632 2161 l 3662 2144 l 3690 2126 l 3717 2109 l
+ 3742 2091 l 3766 2074 l 3788 2056 l 3810 2038 l 3830 2019 l
+ 3850 2000 l 3870 1979 l 3890 1957 l 3909 1935 l 3927 1911 l
+ 3945 1886 l 3963 1860 l 3980 1832 l 3997 1802 l 4015 1770 l
+ 4032 1736 l 4050 1699 l 4068 1661 l 4086 1620 l 4104 1577 l
+ 4123 1533 l 4141 1487 l 4159 1441 l 4177 1395 l 4194 1350 l
+ 4210 1307 l 4225 1267 l 4238 1231 l 4249 1200 l 4258 1175 l
+ 4264 1155 l 4275 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 4176 1309 m 4260 1164 l 4232 1330 l 4204 1319 l 4176 1309 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+4099 1238 m 4243 1152 l 4138 1283 l 4306 1138 l 4267 1092 l cp
+clip
+n 2925 2475 m 2927 2473 l 2930 2469 l 2937 2462 l 2947 2451 l 2961 2436 l
+ 2979 2416 l 3001 2392 l 3026 2364 l 3055 2332 l 3086 2298 l
+ 3118 2263 l 3152 2226 l 3186 2189 l 3219 2152 l 3252 2117 l
+ 3284 2082 l 3315 2049 l 3344 2017 l 3372 1987 l 3399 1958 l
+ 3424 1931 l 3449 1906 l 3472 1881 l 3495 1858 l 3516 1835 l
+ 3538 1813 l 3559 1792 l 3579 1771 l 3600 1750 l 3621 1729 l
+ 3641 1709 l 3662 1688 l 3684 1668 l 3705 1647 l 3728 1625 l
+ 3751 1603 l 3776 1580 l 3801 1556 l 3828 1531 l 3856 1505 l
+ 3885 1478 l 3916 1450 l 3948 1421 l 3981 1391 l 4014 1360 l
+ 4048 1330 l 4082 1299 l 4114 1270 l 4145 1242 l 4174 1216 l
+ 4199 1193 l 4221 1173 l 4239 1157 l 4253 1144 l 4275 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 4099 1238 m 4243 1152 l 4138 1283 l 4118 1260 l 4099 1238 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+5907 1250 m 6045 1154 l 5950 1293 l 6107 1136 l 6064 1093 l cp
+clip
+n 4725 2475 m 6075 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 5907 1250 m 6045 1154 l 5950 1293 l 5929 1271 l 5907 1250 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+5862 2604 m 6000 2700 l 5837 2659 l 6001 2734 l 6026 2679 l cp
+clip
+n 4800 2700 m 4803 2699 l 4809 2696 l 4819 2691 l 4835 2684 l 4857 2674 l
+ 4884 2662 l 4915 2648 l 4950 2633 l 4987 2617 l 5024 2602 l
+ 5061 2586 l 5098 2572 l 5133 2559 l 5166 2547 l 5198 2537 l
+ 5227 2527 l 5255 2520 l 5281 2513 l 5306 2508 l 5330 2505 l
+ 5354 2502 l 5377 2500 l 5400 2500 l 5423 2500 l 5446 2502 l
+ 5470 2505 l 5494 2508 l 5519 2513 l 5545 2520 l 5573 2527 l
+ 5602 2537 l 5634 2547 l 5667 2559 l 5702 2572 l 5739 2586 l
+ 5776 2602 l 5813 2617 l 5850 2633 l 5885 2648 l 5916 2662 l
+ 5943 2674 l 5965 2684 l 6000 2700 l gs col0 s gr gr
+
+% arrowhead
+n 5862 2604 m 6000 2700 l 5837 2659 l 5850 2631 l 5862 2604 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+5837 2741 m 6000 2700 l 5862 2796 l 6026 2721 l 6001 2666 l cp
+clip
+n 4800 2700 m 4803 2701 l 4809 2704 l 4819 2709 l 4835 2716 l 4857 2726 l
+ 4884 2738 l 4915 2752 l 4950 2767 l 4987 2783 l 5024 2798 l
+ 5061 2814 l 5098 2828 l 5133 2841 l 5166 2853 l 5198 2863 l
+ 5227 2873 l 5255 2880 l 5281 2887 l 5306 2892 l 5330 2895 l
+ 5354 2898 l 5377 2900 l 5400 2900 l 5423 2900 l 5446 2898 l
+ 5470 2895 l 5494 2892 l 5519 2887 l 5545 2880 l 5573 2873 l
+ 5602 2863 l 5634 2853 l 5667 2841 l 5702 2828 l 5739 2814 l
+ 5776 2798 l 5813 2783 l 5850 2767 l 5885 2752 l 5916 2738 l
+ 5943 2726 l 5965 2716 l 6000 2700 l gs col0 s gr gr
+
+% arrowhead
+n 5837 2741 m 6000 2700 l 5862 2796 l 5850 2769 l 5837 2741 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+6330 3135 m 6300 3300 l 6270 3135 l 6270 3315 l 6330 3315 l cp
+clip
+n 6300 3000 m 6300 3300 l gs col0 s gr gr
+
+% arrowhead
+n 6330 3135 m 6300 3300 l 6270 3135 l 6300 3135 l 6330 3135 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+gs clippath
+7674 1182 m 7836 1142 l 7698 1236 l 7901 1146 l 7877 1091 l cp
+clip
+n 6525 2475 m 6526 2473 l 6527 2468 l 6531 2460 l 6536 2447 l 6542 2428 l
+ 6551 2405 l 6562 2376 l 6575 2343 l 6590 2306 l 6606 2266 l
+ 6623 2225 l 6641 2182 l 6659 2138 l 6677 2096 l 6696 2054 l
+ 6714 2014 l 6732 1976 l 6750 1939 l 6768 1905 l 6785 1873 l
+ 6803 1843 l 6820 1814 l 6837 1787 l 6855 1762 l 6873 1738 l
+ 6891 1714 l 6910 1692 l 6930 1671 l 6950 1650 l 6970 1631 l
+ 6990 1612 l 7012 1594 l 7034 1575 l 7058 1557 l 7083 1539 l
+ 7110 1520 l 7138 1502 l 7168 1482 l 7201 1463 l 7235 1443 l
+ 7272 1422 l 7311 1401 l 7352 1379 l 7394 1357 l 7439 1334 l
+ 7485 1311 l 7531 1288 l 7577 1265 l 7623 1243 l 7666 1222 l
+ 7707 1203 l 7745 1185 l 7778 1170 l 7807 1156 l 7830 1146 l
+ 7848 1137 l 7875 1125 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7674 1182 m 7836 1142 l 7698 1236 l 7686 1209 l 7674 1182 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+7840 1378 m 7933 1238 l 7895 1402 l 7983 1198 l 7928 1174 l cp
+clip
+n 6525 2475 m 6527 2474 l 6531 2473 l 6540 2470 l 6552 2466 l 6570 2461 l
+ 6594 2453 l 6622 2444 l 6655 2433 l 6693 2420 l 6734 2406 l
+ 6778 2391 l 6824 2375 l 6871 2359 l 6917 2342 l 6963 2325 l
+ 7008 2308 l 7051 2291 l 7093 2274 l 7132 2258 l 7169 2242 l
+ 7204 2226 l 7237 2210 l 7268 2195 l 7297 2179 l 7324 2163 l
+ 7350 2147 l 7375 2131 l 7398 2115 l 7420 2098 l 7442 2080 l
+ 7463 2063 l 7484 2043 l 7505 2022 l 7525 2000 l 7545 1978 l
+ 7564 1953 l 7584 1928 l 7603 1900 l 7622 1871 l 7642 1840 l
+ 7662 1806 l 7682 1770 l 7703 1732 l 7724 1692 l 7745 1650 l
+ 7767 1606 l 7789 1560 l 7811 1514 l 7832 1468 l 7852 1424 l
+ 7871 1381 l 7889 1341 l 7905 1306 l 7918 1275 l 7929 1250 l
+ 7937 1230 l 7950 1200 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7840 1378 m 7933 1238 l 7895 1402 l 7868 1390 l 7840 1378 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+7.500 slw
+gs clippath
+7704 1320 m 7844 1228 l 7745 1364 l 7907 1212 l 7865 1168 l cp
+clip
+n 6525 2475 m 7875 1200 l gs col0 s gr gr
+
+% arrowhead
+15.000 slw
+n 7704 1320 m 7844 1228 l 7745 1364 l 7725 1342 l 7704 1320 l cp gs 0.00 setgray ef gr col0 s
+/Times-Bold ff 285.00 scf sf
+817 960 m
+gs 1 -1 sc (1) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5400 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3600 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+2625 945 m
+gs 1 -1 sc (2) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+4425 945 m
+gs 1 -1 sc (3) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6225 945 m
+gs 1 -1 sc (4) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7200 825 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 1200 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7125 442 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8025 945 m
+gs 1 -1 sc (5) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+8775 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+9525 975 m
+gs 1 -1 sc (6) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+10275 750 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11025 975 m
+gs 1 -1 sc (7) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11700 825 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+12525 975 m
+gs 1 -1 sc (8) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+11625 1800 m
+gs 1 -1 sc (Pattern "????..X") col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1725 1125 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1800 525 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+1425 2175 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+2625 2775 m
+gs 1 -1 sc (9) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+4425 2775 m
+gs 1 -1 sc (A) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3525 2625 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6225 2775 m
+gs 1 -1 sc (B) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 2400 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5400 2775 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5325 3600 m
+gs 1 -1 sc (Pattern "XXo") col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3675 1950 m
+gs 1 -1 sc (.) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+5100 1800 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+3300 1800 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+6525 1800 m
+gs 1 -1 sc (X) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7275 2025 m
+gs 1 -1 sc (O) col0 sh gr
+/Times-Bold ff 285.00 scf sf
+7050 1800 m
+gs 1 -1 sc (.) col0 sh gr
+$F2psEnd
+rs
diff --git a/gnugo/src/doc/dfa2.fig b/gnugo/src/doc/dfa2.fig
new file mode 100644
index 0000000000000000000000000000000000000000..fa9a4b6dc1b988654f75d513099fd3ca75058eb9
--- /dev/null
+++ b/gnugo/src/doc/dfa2.fig
@@ -0,0 +1,165 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+50.00
+Single
+-2
+1200 2
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 900 900 300 300 900 900 1200 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 6300 900 300 300 6300 900 6600 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 4500 900 300 300 4500 900 4800 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 2700 900 300 300 2700 900 3000 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 8100 900 300 300 8100 900 8400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 9600 900 300 300 9600 900 9900 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 11100 900 300 300 11100 900 11400 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 12600 900 300 300 12600 900 12900 900
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 2700 2700 300 300 2700 2700 3000 2700
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 4500 2700 300 300 4500 2700 4800 2700
+1 3 0 1 0 7 100 0 -1 0.000 1 0.0000 6300 2700 300 300 6300 2700 6600 2700
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 4800 900 6000 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 900 5400 1500 6000 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 892 5400 292 6000 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 3000 900 4200 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 900 3600 1500 4200 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 3000 892 3600 292 4200 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 900 1800 1350 2400 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 225 900 600 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 6600 900 7800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 900 7200 1500 7800 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 6600 892 7200 292 7800 892
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 8400 900 9300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 9900 900 10800 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 11400 900 12300 900
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 12600 1200 12600 1500
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 1200 900 1800 450 2400 900
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 900 1200 1200 2400 2400 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 3000 2700 4200 2700
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 2925 2475 3975 2100 4275 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 2925 2475 3600 1725 4275 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 4725 2475 6075 1125
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 2700 5400 2400 6000 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 1.00 60.00 165.00
+ 4800 2700 5400 3000 6000 2700
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 1.00 60.00 165.00
+ 6300 3000 6300 3300
+ 0.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 6525 2475 6825 1575 7875 1125
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 3
+ 1 1 2.00 60.00 165.00
+ 6525 2475 7575 2175 7950 1200
+ 0.000 1.000 0.000
+3 0 0 1 0 7 100 0 -1 0.000 0 1 0 2
+ 1 1 2.00 60.00 165.00
+ 6525 2475 7875 1200
+ 0.000 0.000
+4 0 0 100 0 2 19 0.0000 4 195 135 817 960 1\001
+4 0 0 100 0 2 19 0.0000 4 45 75 5400 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 5325 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 5325 442 X\001
+4 0 0 100 0 2 19 0.0000 4 45 75 3600 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 3525 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 3525 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 2625 945 2\001
+4 0 0 100 0 2 19 0.0000 4 195 135 4425 945 3\001
+4 0 0 100 0 2 19 0.0000 4 195 135 6225 945 4\001
+4 0 0 100 0 2 19 0.0000 4 45 75 7200 825 .\001
+4 0 0 100 0 2 19 0.0000 4 195 225 7125 1200 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 7125 442 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 8025 945 5\001
+4 0 0 100 0 2 19 0.0000 4 45 75 8775 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 9525 975 6\001
+4 0 0 100 0 2 19 0.0000 4 45 75 10275 750 .\001
+4 0 0 100 0 2 19 0.0000 4 195 135 11025 975 7\001
+4 0 0 100 0 2 19 0.0000 4 195 210 11700 825 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 12525 975 8\001
+4 0 0 100 0 2 19 0.0000 4 195 2205 11625 1800 Pattern "????..X"\001
+4 0 0 100 0 2 19 0.0000 4 195 225 1725 1125 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 1800 525 .\001
+4 0 0 100 0 2 19 0.0000 4 195 210 1425 2175 X\001
+4 0 0 100 0 2 19 0.0000 4 195 135 2625 2775 9\001
+4 0 0 100 0 2 19 0.0000 4 195 210 4425 2775 A\001
+4 0 0 100 0 2 19 0.0000 4 195 210 3525 2625 X\001
+4 0 0 100 0 2 19 0.0000 4 195 195 6225 2775 B\001
+4 0 0 100 0 2 19 0.0000 4 195 225 5325 2400 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 5400 2775 .\001
+4 0 0 100 0 2 19 0.0000 4 195 1860 5325 3600 Pattern "XXo"\001
+4 0 0 100 0 2 19 0.0000 4 45 75 3675 1950 .\001
+4 0 0 100 0 2 19 0.0000 4 195 210 5100 1800 X\001
+4 0 0 100 0 2 19 0.0000 4 195 225 3300 1800 O\001
+4 0 0 100 0 2 19 0.0000 4 195 210 6525 1800 X\001
+4 0 0 100 0 2 19 0.0000 4 195 225 7275 2025 O\001
+4 0 0 100 0 2 19 0.0000 4 45 75 7050 1800 .\001
diff --git a/gnugo/src/doc/dfa2.jpg b/gnugo/src/doc/dfa2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1daed090e93c4275d5a1198c0d449ddecd7c144c
Binary files /dev/null and b/gnugo/src/doc/dfa2.jpg differ
diff --git a/gnugo/src/doc/dfa2.pdf b/gnugo/src/doc/dfa2.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..92e703d87ec15c9a1d4068f70d68f536332dbaee
Binary files /dev/null and b/gnugo/src/doc/dfa2.pdf differ
diff --git a/gnugo/src/doc/dfa2.png b/gnugo/src/doc/dfa2.png
new file mode 100644
index 0000000000000000000000000000000000000000..728dc0843fb68a867acb3ab40d691bf195d6a2ff
Binary files /dev/null and b/gnugo/src/doc/dfa2.png differ
diff --git a/gnugo/src/doc/dragon.texi b/gnugo/src/doc/dragon.texi
new file mode 100644
index 0000000000000000000000000000000000000000..943d37a27dfd572ecb3c1d8c792dff67fdd6acfe
--- /dev/null
+++ b/gnugo/src/doc/dragon.texi
@@ -0,0 +1,894 @@
+@menu
+* Worms:: Worms
+* Amalgamation:: How two Worms are amalgamated.
+* Connection:: Connections.
+* Half Eyes:: Half Eyes and False Eyes.
+* Dragons:: Union of WORMS.
+* Dragons in Color:: Colored display of DRAGONS.
+@end menu
+
+Before considering its move, GNU Go collects some data in several
+arrays. Two of these arrays, called @code{worm} and @code{dragon}, are
+discussed in this document. Others are discussed in @xref{Eyes}.
+
+This information is intended to help evaluate the connectedness, eye
+shape, escape potential and life status of each group.
+
+Later routines called by @code{genmove()} will then have access to this
+information. This document attempts to explain the philosophy and
+algorithms of this preliminary analysis, which is carried out by the
+two routines @code{make_worm()} and @code{make_dragon()} in
+@file{dragon.c}.
+
+@cindex dragon
+@cindex worm
+@cindex string
+A @dfn{worm} is a maximal set of stones on the board which are connected
+along the horizontal and vertical lines, and are of the same color.
+We often say @dfn{string} instead of worm.
+
+A @dfn{dragon} is a union of strings of the same color which will be
+treated as a unit. The dragons are generated anew at each move. If two strings
+are in the dragon, it is the computer's working hypothesis that they will live
+or die together and are effectively connected.
+
+The purpose of the dragon code is to allow the computer to formulate
+meaningful statements about life and death. To give one example,
+consider the following situation:
+@example
+
+ OOOOO
+ OOXXXOO
+ OX...XO
+ OXXXXXO
+ OOOOO
+
+@end example
+
+The X's here should be considered a single group with one three-space
+eye, but they consist of two separate strings. Thus we must
+amalgamate these two strings into a single dragon. Then the assertion
+makes sense, that playing at the center will kill or save the dragon,
+and is a vital point for both players. It would be difficult to
+formulate this statement if the X's are not perceived as a unit.
+
+The present implementation of the dragon code involves simplifying
+assumptions which can be refined in later implementations.
+
+@node Worms
+@section Worms
+@cindex worm
+
+The array @code{struct worm_data worm[MAX_BOARD]} collects information about
+the worms. We will give definitions of the various fields. Each field has
+constant value at each vertex of the worm. We will define each field.
+
+@example
+
+struct worm_data @{
+ int color;
+ int size;
+ float effective_size;
+ int origin;
+ int liberties;
+ int liberties2;
+ int liberties3;
+ int liberties4;
+ int lunch;
+ int cutstone;
+ int cutstone2;
+ int genus;
+ int inessential;
+ int invincible;
+ int unconditional_status;
+ int attack_points[MAX_TACTICAL_POINTS];
+ int attack_codes[MAX_TACTICAL_POINTS];
+ int defense_points[MAX_TACTICAL_POINTS];
+ int defend_codes[MAX_TACTICAL_POINTS];
+ int attack_threat_points[MAX_TACTICAL_POINTS];
+ int attack_threat_codes[MAX_TACTICAL_POINTS];
+ int defense_threat_points[MAX_TACTICAL_POINTS];
+ int defense_threat_codes[MAX_TACTICAL_POINTS];
+@};
+@end example
+
+@itemize @bullet
+@item @code{color}
+@quotation
+The color of the worm.
+@end quotation
+@item @code{size}
+@quotation
+This field contains the cardinality of the worm.
+@end quotation
+@item @code{effective_size}
+@quotation
+@cindex effective size (worm)
+This is the number of stones in a worm plus the number
+of empty intersections that are at least as close to this worm as to any
+other worm. Intersections that are shared are counted with equal
+fractional values for each worm. This measures the direct territorial
+value of capturing a worm. @dfn{effective_size} is a floating point number.
+Only intersections at a distance of 4 or less are counted.
+@end quotation
+@item @code{origin}
+@quotation
+@cindex origin (worm)
+Each worm has a distinguished member, called its @dfn{origin}.
+The purpose of this field is to make it easy to determine when two vertices
+lie in the same worm: we compare their origin. Also if we wish to perform some
+test once for each worm, we simply perform it at the origin and ignore the
+other vertices. The origin is characterized by the test:
+@example
+worm[pos].origin == pos.
+@end example
+@end quotation
+@item @code{liberties}
+@item @code{liberties2}
+@item @code{liberties3}
+@item @code{liberties4}
+@quotation
+@cindex liberties (worm)
+@cindex liberties, higher order (worm)
+For a nonempty worm the field liberties is the number of liberties of the
+string. This is supplemented by @code{LIBERTIES2}, @code{LIBERTIES3} and
+@code{LIBERTIES4}, which are the number of second order, third order, and
+fourth order liberties, respectively.
+The definition of liberties of order >1 is adapted to the
+problem of detecting the shape of the surrounding
+empty space. In particular we want to be able to see if a group
+is loosely surrounded. A @dfn{liberty of order n} is an empty
+vertex which may be connected to the string by placing n
+stones of the same color on the board, but no fewer. The
+path of connection may pass through an intervening group
+of the same color. The stones placed at distance >1 may
+not touch a group of the opposite color. Connections through
+ko are not permitted. Thus in the following configuration:
+@example
+
+ .XX... We label the .XX.4.
+ XO.... liberties of XO1234
+ XO.... order < 5 of XO1234
+ ...... the O group: .12.4.
+ .X.X.. .X.X..
+
+@end example
+
+The convention that liberties of order >1 may not touch a
+group of the opposite color means that knight's moves and
+one space jumps are perceived as impenetrable barriers.
+This is useful in determining when the string is becoming
+surrounded.
+
+The path may also not pass through a liberty at distance
+1 if that liberty is flanked by two stones of the opposing color. This
+reflects the fact that the O stone is blocked from expansion to the
+left by the two X stones in the following situation:
+@example
+
+ X.
+ .O
+ X.
+
+@end example
+@cindex distance from liberty to dragon
+We say that n is the @dfn{distance} of the liberty of order n from the dragon.
+@end quotation
+@item @code{lunch}
+@quotation
+@cindex lunch (worm)
+If nonzero, @code{lunch} points to a boundary worm which can be easily
+captured. (It does not matter whether or not the string can be
+defended.)
+@end quotation
+@end itemize
+
+We have two distinct notions of cutting stone, which we keep track
+of in the separate fields @code{worm.cutstone} and @code{worm.cutstone2}.
+We use currently use both concepts in parallel.
+
+@itemize
+@item @code{cutstone}
+@quotation
+@cindex cutting stone
+This field is equal to 2 for cutting stones, 1 for potential cutting
+stones. Otherwise it is zero. Definitions for this field: a @dfn{cutting
+stone} is one adjacent to two enemy strings, which do not have a liberty in
+common. The most common type of cutting string is in this situation:
+
+@example
+
+ XO
+ OX
+
+@end example
+@cindex cutting stone, potential
+@cindex potential cutting stone
+
+A @dfn{potential cutting stone} is adjacent to two enemy strings which do
+share a liberty. For example, X in:
+
+@example
+
+ XO
+ O.
+
+@end example
+
+For cutting strings we set @code{worm[].cutstone=2}. For
+potential cutting strings we set @code{worm[].cutstone=1}.
+@end quotation
+@item @code{cutstone2}
+@quotation
+Cutting points are identified by the patterns in the connections
+database. Proper cuts are handled by the fact that attacking and
+defending moves also count as moves cutting or connecting the
+surrounding dragons. The @code{cutstone2} field is set during
+@code{find_cuts()}, called from @code{make_domains()}.
+@end quotation
+@findex find_cuts
+@findex make_domains
+@item @code{genus}
+@quotation
+@cindex genus (worm)
+There are two separate notions of @dfn{genus} for worms and
+dragons. The dragon notion is more important, so
+@code{dragon[pos].genus} is a far more useful field than
+@code{worm[pos].genus}. Both fields are intended as approximations
+to the number of eyes. The @dfn{genus} of a string is the number
+of connected components of its complement, minus one. It is
+an approximation to the number of eyes of the string.
+@end quotation
+@item @code{inessential}
+@quotation
+@cindex inessential string
+An @dfn{inessential} string is one which meets a
+criterion designed to guarantee that it has no life
+potential unless a particular surrounding string of the
+opposite color can be killed. More precisely an
+@dfn{inessential string} is a string S of genus zero,
+not adjacent to any opponent string which can be easily
+captured, and which has no edge liberties or second
+order liberties, and which satisfies the following
+further property: If the string is removed from the
+board, then the remaining cavity only borders worms of the
+opposite color.
+
+@end quotation
+@findex unconditional_life
+@item @code{invincible}
+@quotation
+@cindex invincible worm
+An @dfn{invincible} worm is one which GNU Go thinks
+cannot be captured. Invincible worms are computed by the
+function @code{unconditional_life()} which tries to
+find those worms of the given color that can never be captured,
+even if the opponent is allowed an arbitrary number of consecutive
+moves.
+@end quotation
+@item unconditional_status
+@quotation
+Unconditional status is also set by the function
+@code{unconditional_life}. This is set @code{ALIVE} for stones which are
+invincible. Stones which can not be turned invincible even if the
+defender is allowed an arbitrary number of consecutive moves are given
+an unconditional status of @code{DEAD}. Empty points where the opponent
+cannot form an invincible worm are called unconditional territory. The
+unconditional status is set to @code{WHITE_TERRITORY} or
+@code{BLACK_TERRITORY} depending on who owns the territory. Finally, if
+a stone can be captured but is adjacent to unconditional territory of
+its own color, it is also given the unconditional status @code{ALIVE}.
+In all other cases the unconditional status is @code{UNKNOWN}.
+
+To make sense of these definitions it is important to notice that any
+stone which is alive in the ordinary sense (even if only in seki) can be
+transformed into an invincible group by some number of consecutive
+moves. Well, this is not entirely true because there is a rare class of
+seki groups not satisfying this condition. Exactly which these are is
+left as an exercise for the reader. Currently @code{unconditional_life},
+which strictly follows the definitions above, calls such seki groups
+unconditionally dead, which of course is a misfeature. It is possible to
+avoid this problem by making the algorithm slightly more complex, but
+this is left for a later revision.
+@end quotation
+@item @code{int attack_points[MAX_TACTICAL_POINTS]}
+@item @code{attack_codes[MAX_TACTICAL_POINTS]}
+@item @code{int defense_points[MAX_TACTICAL_POINTS];}
+@item @code{int defend_codes[MAX_TACTICAL_POINTS];}
+@quotation
+If the tactical reading code (@pxref{Tactical Reading}) finds that the
+worm can be attacked, @code{attack_points[0]} is a point of attack, and
+@code{attack_codes[0]} is the attack code, @code{WIN}, @code{KO_A} or
+@code{KO_B}. If multiple attacks are known, @code{attack_points[k]} and
+@code{attack_codes[k]} are used. Similarly with the defense
+codes and defense points.
+@end quotation
+@item @code{int attack_threat_points[MAX_TACTICAL_POINTS];}
+@item @code{int attack_threat_codes[MAX_TACTICAL_POINTS];}
+@item @code{int defense_threat_points[MAX_TACTICAL_POINTS];}
+@item @code{int defense_threat_codes[MAX_TACTICAL_POINTS];}
+@quotation
+These are points that threaten to attack or defend a worm.
+@end quotation
+@end itemize
+
+The function @code{makeworms()} will generate data for all worms.
+
+@node Amalgamation
+@section Amalgamation
+@cindex amalgamation of worms into dragons
+
+A dragon, we have said, is a group of stones which are treated as a
+unit. It is a working hypothesis that these stones will live or die
+together. Thus the program will not expect to disconnect an opponent's
+strings if they have been amalgamated into a single dragon.
+
+The function @code{make_dragons()} will amalgamate worms into dragons by
+maintaining separate arrays @code{worm[]} and @code{dragon[]} containing
+similar data. Each dragon is a union of worms. Just as the data maintained in
+@code{worm[]} is constant on each worm, the data in
+@code{dragon[]} is constant on each dragon.
+
+Amalgamation of worms in GNU Go proceeds as follows.
+First we amalgamate all boundary components of an eyeshape. Thus in
+the following example:
+
+@example
+
+.OOOO. The four X strings are amalgamated into a
+OOXXO. single dragon because they are the boundary
+OX..XO components of a blackbordered cave. The
+OX..XO cave could contain an inessential string
+OOXXO. with no effect on this amalgamation.
+XXX...
+
+@end example
+@findex dragon_eye
+
+The code for this type of amalgamation is in the routine
+@code{dragon_eye()}, discussed further in EYES.
+
+Next, we amalgamate strings which seem uncuttable. We amalgamate dragons
+which either share two or more common liberties, or share one liberty
+into the which the opponent cannot play without being
+captured. (ignores ko rule).
+
+@example
+
+ X. X.X XXXX.XXX X.O
+ .X X.X X......X X.X
+ XXXXXX.X OXX
+
+@end example
+
+A database of connection patterns may be found in @file{patterns/conn.db}.
+
+@node Connection
+@section Connection
+@cindex connections
+
+The fields @code{black_eye.cut} and @code{white_eye.cut} are set where the
+opponent can cut, and this is done by the B (break) class patterns in
+@file{conn.db}. There are two important uses for this field, which can be
+accessed by the autohelper functions @code{xcut()} and @code{ocut()}. The
+first use is to stop amalgamation in positions like
+
+@example
+
+..X..
+OO*OO
+X.O.X
+..O..
+
+@end example
+
+@noindent
+where X can play at * to cut off either branch. What happens
+here is that first connection pattern CB1 finds the double cut
+and marks * as a cutting point. Later the C (connection) class
+patterns in conn.db are searched to find secure connections
+over which to amalgamate dragons. Normally a diagonal
+connection would be deemed secure and amalgamated by connection
+pattern CC101, but there is a constraint requiring that neither of
+the empty intersections is a cutting point.
+@findex amalgamate_most_valuable_helper
+
+A weakness with this scheme is that X can only cut one connection, not
+both, so we should be allowed to amalgamate over one of the connections.
+This is performed by connection pattern CC401, which with the help of
+@code{amalgamate_most_valuable_helper()} decides which connection to
+prefer.
+
+The other use is to simplify making alternative connection patterns to
+the solid connection. Positions where the diag_miai helper thinks a
+connection is necessary are marked as cutting points by connection
+pattern 12. Thus we can write a connection pattern like @code{CC6}:
+
+@example
+
+?xxx? straight extension to connect
+XOO*?
+O...?
+
+:8,C,NULL
+
+?xxx?
+XOOb?
+Oa..?
+
+;xcut(a) && odefend_against(b,a)
+
+@end example
+
+@noindent
+where we verify that a move at @code{*} would stop the enemy from safely
+playing at the cutting point, thus defending against the cut.
+
+@node Half Eyes
+@section Half Eyes and False Eyes
+@cindex half eye
+@cindex false eye
+
+A @dfn{half eye} is a place where, if the defender plays first, an eye
+will materialize, but where if the attacker plays first, no eye will
+materialize. A @dfn{false eye} is a vertex which is surrounded by a
+dragon yet is not an eye. Here is a half eye:
+
+@example
+@group
+
+XXXXX
+OO..X
+O.O.X
+OOXXX
+
+@end group
+@end example
+
+Here is a false eye:
+
+@example
+@group
+
+XXXXX
+XOO.X
+O.O.X
+OOXXX
+
+@end group
+@end example
+
+The "topological" algorithm for determining half and false eyes
+is described elsewhere (@pxref{Eye Topology}).
+
+The half eye data is collected in the dragon array. Before this is done,
+however, an auxiliary array called half_eye_data is filled with
+information. The field @code{type} is 0, or else @code{HALF_EYE} or
+@code{FALSE_EYE} depending on which type is found; the fields
+@code{attack_point[]} point to up to 4 points to attack
+the half eye, and similarly @code{defense_point[]} gives points
+to defend the half eye.
+
+@example
+@group
+
+struct half_eye_data half_eye[MAX_BOARD];
+
+struct half_eye_data @{
+ float value; /* Topological eye value */
+ int type; /* HALF_EYE or FALSE_EYE */
+ int num_attacks; /* Number of attacking points */
+ int attack_point[4]; /* The moves to attack a topological halfeye */
+ int num_defends; /* Number of defending points */
+ int defense_point[4]; /* The moves to defend a topological halfeye */
+@};
+
+@end group
+@end example
+
+The array @code{struct half_eye_data half_eye[MAX_BOARD]}
+contains information about half and false eyes. If the type is
+@code{HALF_EYE} then up to four moves are recorded which can
+either attack or defend the eye. In rare cases the attack points
+could be different from the defense points.
+
+@node Dragons
+@section Dragons
+@cindex dragons
+
+The array @code{struct dragon_data dragon[MAX_BOARD]}
+collects information about the dragons. We will give definitions of the
+various fields. Each field has constant value at each vertex of the
+dragon. (Fields will be discussed below.)
+
+@example
+
+struct dragon_data @{
+ int color; /* its color */
+ int id; /* the index into the dragon2 array */
+ int origin; /* the origin of the dragon. Two vertices */
+ /* are in the same dragon iff they have */
+ /* same origin. */
+ int size; /* size of the dragon */
+ float effective_size; /* stones and surrounding spaces */
+ int crude_status; /* (ALIVE, DEAD, UNKNOWN, CRITICAL)*/
+ int status; /* best trusted status */
+@};
+
+extern struct dragon_data dragon[BOARDMAX];
+
+@end example
+
+Other fields attached to the dragon are contained in the @code{dragon_data2}
+struct array. (Fields will be discussed below.)
+
+@example
+
+struct dragon_data2 @{
+ int origin;
+ int adjacent[MAX_NEIGHBOR_DRAGONS];
+ int neighbors;
+ int hostile_neighbors;
+ int moyo_size;
+ float moyo_territorial_value;
+ int safety;
+ float weakness;
+ float weakness_pre_owl;
+ int escape_route;
+ struct eyevalue genus;
+ int heye;
+ int lunch;
+ int surround_status;
+ int surround_size;
+ int semeais;
+ int semeai_margin_of_safety;
+ int semeai_defense_point;
+ int semeai_defense_certain;
+ int semeai_attack_point;
+ int semeai_attack_certain;
+ int owl_threat_status;
+ int owl_status;
+ int owl_attack_point;
+ int owl_attack_code;
+ int owl_attack_certain;
+ int owl_second_attack_point;
+ int owl_defense_point;
+ int owl_defense_code;
+ int owl_defense_certain;
+ int owl_second_defense_point;
+ int owl_attack_kworm;
+ int owl_defense_kworm;
+@};
+
+extern struct dragon_data2 *dragon2;
+
+@end example
+
+The difference between the two arrays is that the @code{dragon} array
+is indexed by the board, and there is a copy of the dragon data
+at every stone in the dragon, while there is only one copy of
+the dragon2 data. The dragons are numbered, and the @code{id} field
+of the dragon is a key into the dragon2 array. Two macros DRAGON
+and DRAGON2 are provided for gaining access to the two arrays.
+
+@example
+#define DRAGON2(pos) dragon2[dragon[pos].id]
+#define DRAGON(d) dragon[dragon2[d].origin]
+@end example
+
+Thus if you know the position @code{pos} of a stone in the dragon
+you can access the dragon array directly, for example accessing the
+origin with @code{dragon[pos].origin}. However if you need a field
+from the dragon2 array, you can access it using the DRAGON2 macro,
+for example you can access its neighor dragons by
+
+@example
+for (k = 0; k < DRAGON2(pos).neighbors; k++) @{
+ int d = DRAGON2(pos).adjacent[k];
+ int apos = dragon2[d].origin;
+ do_something(apos);
+@}
+@end example
+
+Similarly if you know the dragon number (which is @code{dragon[pos].id})
+then you can access the @code{dragon2} array directly, or you can
+access the @code{dragon} array using the DRAGON macro.
+
+Here are the definitions of each field in the @code{dragon} arrray.
+
+@itemize @bullet
+@item @code{color}
+@quotation
+@cindex color (dragon)
+The color of the dragon.
+@end quotation
+@item @code{id}
+@cindex dragon number
+@quotation
+The dragon number, used as a key into the @code{dragon2} array.
+@end quotation
+@item origin
+@cindex dragon origin
+@quotation
+The origin of the dragon is a unique particular vertex
+of the dragon, useful for determining when two vertices belong
+to the same dragon. Before amalgamation the worm origins are
+copied to the dragon origins. Amalgamation of two dragons
+amounts to changing the origin of one.
+@end quotation
+@item size
+@cindex dragon size
+@quotation
+The number of stones in the dragon.
+@end quotation
+@item effective size
+@cindex effective size
+@quotation
+The sum of the effective sizes of the constituent worms.
+Remembering that vertices equidistant between two or more worms are
+counted fractionally in @code{worm.effective_size}, this equals the
+cardinality of the dragon plus the number of empty vertices which are
+nearer this dragon than any other.
+@end quotation
+@item crude_status
+@quotation
+(ALIVE, DEAD, UNKNOWN, CRITICAL). An early measure of the life
+potential of the dragon. It is computed before the owl code is
+run and is superceded by the status as soon as that becomes
+available.
+@end quotation
+@item status
+@cindex dragon status
+@quotation
+The dragon status is the best measure of the dragon's health.
+It is computed after the owl code is run, then revised again
+when the semeai code is run.
+@end quotation
+@end itemize
+
+Here are definitions of the fields in the @code{dragon2} array.
+
+@itemize @bullet
+@item origin
+@quotation
+The origin field is duplicated here.
+@end quotation
+@item adjacent
+@item @code{adjacent[MAX_NEIGHBOR_DRAGONS]}
+@cindex neighbor dragons
+@cindex adjacent dragons
+@findex find_neighbor_dragons
+@quotation
+Dragons of either color near the given one are called @dfn{neighbors}.
+They are computed by the function @code{find_neighbor_dragons()}.
+The @code{dragon2.adjacent} array gives the dragon numbers of
+these dragons.
+@end quotation
+@item @code{neighbors}
+@cindex neighbor dragons
+@cindex adjacent dragons
+@findex find_neighbor_dragons
+@quotation
+Dragons of either color near the given one are called @dfn{neighbors}.
+They are computed by the function @code{find_neighbor_dragons()}.
+The @code{dragon2.adjacent} array gives the dragon numbers of
+these dragons.
+@end quotation
+@item neighbors
+@quotation
+The number of neighbor dragons.
+@end quotation
+@item hostile_neighbors
+@quotation
+The number of neighbor dragons of the opposite color.
+@end quotation
+@item moyo_size
+@item float moyo_territorial_value
+@findex compute_surrounding_moyo_sizes
+@quotation
+The function @code{compute_surrounding_moyo_sizes()} assigns
+a size and a territorial value to the moyo around
+each dragon (@pxref{Territory and Moyo}). This is the
+moyo size. They are recorded in these fields.
+@end quotation
+@item safety
+@cindex dragon safety
+@quotation
+The dragon safety can take on one of the values
+@itemize @minus
+@item TACTICALLY_DEAD - a dragon consisting of a single worm found dead by the
+reading code (very reliable)
+@item ALIVE - found alive by the owl or semeai code
+@item STRONGLY_ALIVE - alive without much question
+@item INVINCIBLE - definitively alive even after many tenukis
+@item ALIVE_IN_SEKI - determined to be seki by the semeai code
+@item CRITICAL - lives or dies depending on who moves first
+@item DEAD - found to be dead by the owl code
+@item INESSENTIAL - the dragon is unimportant (e.g. nakade stones) and dead
+@end itemize
+@end quotation
+@item weakness
+@item weakness_pre_owl
+@cindex dragon weakness
+@cindex weakness
+@quotation
+A floating point measure of the safety of a dragon. The dragon
+weakness is a number between 0. and 1., higher numbers for
+dragons in greater need of safety. The field @code{weakness_pre_owl}
+is a preliminary computation before the owl code is run.
+@end quotation
+@item escape_route
+@cindex dragon escape_route
+@cindex escape_route
+@findex compute_escape
+@quotation
+A measure of the dragon's potential to escape towards safety,
+in case it cannot make two eyes locally. Documentation
+may be found in @ref{Escape}.
+@end quotation
+@item struct eyevalue genus
+@cindex dragon genus
+@cindex genus
+@quotation
+The approximate number of eyes the dragon can be expected to
+get. Not guaranteed to be accurate. The eyevalue struct, which
+is used throughout the engine, is declared thus:
+@example
+
+struct eyevalue @{
+ unsigned char a; /* # of eyes if attacker plays twice */
+ unsigned char b; /* # of eyes if attacker plays first */
+ unsigned char c; /* # of eyes if defender plays first */
+ unsigned char d; /* # of eyes if defender plays twice */
+@};
+
+@end example
+@end quotation
+@item heye
+@quotation
+Location of a half eye attached to the dragon.
+@end quotation
+@item lunch
+@cindex dragon lunch
+@cindex lunch
+@quotation
+If nonzero, this is the location of a boundary string which
+can be captured. In contrast with worm lunches, a dragon
+lunch must be able to defend itself.
+@end quotation
+@item surround_status
+@item surround_size
+@cindex surround_status
+@cindex surround_size
+@cindex surround
+@quotation
+In estimating the safety of a dragon it is useful to know if
+it is @dfn{surrounded}. See @ref{Surrounded Dragons} and
+the comments in @file{surround.c} for more information about the
+algorithm. Used in computing the escape_route, and also callable
+from patterns (currently used by CB258).
+@end quotation
+@item semeais
+@item semeai_defense_point
+@item semeai_defense_certain
+@item semeai_attack_point
+@item semeai_attack_certain
+@cindex semeai
+@cindex semeai_defense_point
+@cindex semeai_defense_certain
+@cindex semeai_attack_point
+@cindex semeai_attack_certain
+@quotation
+If two dragons of opposite color both have the status CRITICAL
+or DEAD they are in a @dfn{semeai} (capturing race), and their
+status must be adjudicated by the function
+@code{owl_analyze_semeai()} in @file{owl.c}, which attempts to
+determine which is alive, which dead, or if the result is
+seki, and whether it is important who moves first. The
+function @file{new_semeai()} in @file{semeai.c} attempts
+to revise the statuses and to generate move reasons based
+on these results. The field @code{dragon2.semeais} is nonzero
+if the dragon is an element of a semeai, and equals the
+number of semeais (seldom more than one). The semeai defense
+and attack points are locations the defender or attacker
+must move to win the semeai. The field @code{semeai_margin_of_safety}
+is intended to indicate whether the semeai is close or not
+but currently this field is not maintained. The fields
+@code{semeai_defense_certain} and @code{semeai_attack_certain}
+indicate that the semeai code was able to finish analysis
+without running out of nodes.
+@end quotation
+@item owl_status
+@quotation
+This is a classification similar to @code{dragon.crude_status}, but
+based on the life and death reading in @file{owl.c}.
+The owl code (@pxref{The Owl Code}) is skipped for dragons
+which appear safe by certain heuristics. If the owl code
+is not run, the owl status is @code{UNCHECKED}.
+If @code{owl_attack()} determines that the dragon cannot be
+attacked, it is classified as @code{ALIVE}. Otherwise,
+@code{owl_defend()} is run, and if it can be defended it
+is classified as @code{CRITICAL}, and if not, as @code{DEAD}.
+@end quotation
+@item owl_attack_point
+@cindex owl_attack_point
+@quotation
+If the dragon can be attacked this is the point to attack the dragon.
+@end quotation
+@item owl_attack_code
+@cindex owl_attack_code
+@quotation
+The owl attack code, It can be WIN, KO_A, KO_B or 0 (@pxref{Return Codes}).
+@end quotation
+@item owl_attack_certain
+@cindex owl_attack_certain
+@quotation
+The owl reading is able to finish analyzing the attack
+without running out of nodes.
+@end quotation
+@item owl_second_attack_point
+@cindex owl_second_attack_point
+@quotation
+A second attack point.
+@end quotation
+@item owl_defense_point
+@cindex owl_defense_point
+@quotation
+If the dragon can be defended, this is the place to play.
+@end quotation
+@item owl_defense_code
+@cindex owl_defense_code
+@quotation
+The owl defense code, It can be WIN, KO_A, KO_B or 0 (@pxref{Return Codes}).
+@end quotation
+@item owl_defense_certain
+@cindex owl_defense_certain
+@quotation
+The owl code is able to finish analyzing the defense without
+running out of nodes.
+@end quotation
+@item owl_second_defense_point
+@cindex owl_second_defense_point
+@quotation
+A second owl defense point.
+@end quotation
+@end itemize
+
+@node Dragons in Color
+@section Colored Dragon Display
+@cindex colored display
+
+You can get a colored ASCII display of the board in which each dragon
+is assigned a different letter; and the different values of
+@code{dragon.status} values (@code{ALIVE}, @code{DEAD}, @code{UNKNOWN},
+@code{CRITICAL}) have different colors. This is very handy for debugging.
+A second diagram shows the values of @code{owl.status}. If this
+is @code{UNCHECKED} the dragon is displayed in White.
+
+Save a game in sgf format using CGoban, or using the @option{-o} option with
+GNU Go itself.
+
+Open an @command{xterm} or @command{rxvt} window. You may also use the Linux
+console. Using the console, you may need to use ``SHIFT-PAGE UP'' to see the
+first diagram. Xterm will only work if it is compiled with color support---if
+you do not see the colors try @command{rxvt}. Make the background color black
+and the foreground color white.
+
+Execute:
+
+@command{gnugo -l [filename] -L [movenum] -T} to get the colored display.
+
+The color scheme: Green = @code{ALIVE}; Yellow = @code{UNKNOWN};
+Cyan = @code{DEAD} and Red = @code{CRITICAL}. Worms which have been
+amalgamated into the same dragon are labelled with the same letter.
+
+Other useful colored displays may be obtained by using instead:
+
+@itemize @bullet
+@item the option -E to display eye spaces (@pxref{Eyes}).
+@item the option -m 0x0180 to display territory, moyo and area
+(@pxref{Territory and Moyo}).
+@end itemize
+
+The colored displays are documented elsewhere (@pxref{Colored Display}).
+
diff --git a/gnugo/src/doc/eyes.texi b/gnugo/src/doc/eyes.texi
new file mode 100644
index 0000000000000000000000000000000000000000..6b6a9ee46cd049607915777fa16908092fa5dcf2
--- /dev/null
+++ b/gnugo/src/doc/eyes.texi
@@ -0,0 +1,1140 @@
+The purpose of this Chapter is to describe the algorithm used in
+GNU Go to determine eyes.
+
+@menu
+* Local Games:: Local games
+* Eye Space:: Eye space
+* Eye Space as Local Game:: Eye space as local game
+* Eye Example:: An example
+* Graphs:: Underlying graphs
+* Eye Shape:: Pattern matching
+* Eye Local Game Values:: Pattern matching
+* Eye Topology:: False eyes and half eyes
+* Eye Topology with Ko:: False eyes and half eyes with ko
+* False Margins:: False margins
+* Eye Functions:: Functions in @file{optics.c}
+@end menu
+
+@node Local Games
+@section Local games
+
+The fundamental paradigm of combinatorial game theory is that games
+can be added and in fact form a group. If @samp{G} and @samp{H} are
+games, then @samp{G+H} is a game in which each player on his turn
+has the option of playing in either move. We say that the game
+@samp{G+H} is the sum of the local games @samp{G} and @samp{H}.
+
+Each connected eyespace of a dragon affords a local game which yields
+a local game tree. The score of this local game is the number of eyes
+it yields. Usually if the players take turns and make optimal moves,
+the end scores will differ by 0 or 1. In this case, the local game may
+be represented by a single number, which is an integer or half
+integer. Thus if @samp{n(O)} is the score if @samp{O} moves first,
+both players alternate (no passes) and make alternate moves, and
+similarly @samp{n(X)}, the game can be represented by
+@samp{@{n(O)|n(X)@}}. Thus @{1|1@} is an eye, @{2|1@} is an eye plus a
+half eye, etc.
+
+The exceptional game @{2|0@} can occur, though rarely. We call
+an eyespace yielding this local game a CHIMERA. The dragon
+is alive if any of the local games ends up with a score of 2
+or more, so @{2|1@} is not different from @{3|1@}. Thus @{3|1@} is
+NOT a chimera.
+
+Here is an example of a chimera:
+
+@example
+@group
+XXXXX
+XOOOX
+XO.OOX
+XX..OX
+XXOOXX
+XXXXX
+@end group
+@end example
+
+@node Eye Space
+@section Eye spaces
+
+In order that each eyespace be assignable to a dragon,
+it is necessary that all the dragons surrounding it
+be amalgamated (@pxref{Amalgamation}). This is the
+function of @code{dragon_eye()}.
+
+An EYE SPACE for a black dragon is a collection of vertices
+adjacent to a dragon which may not yet be completely closed off,
+but which can potentially become eyespace. If an open eye space is
+sufficiently large, it will yield two eyes. Vertices at the edge
+of the eye space (adjacent to empty vertices outside the eye space)
+are called MARGINAL.
+
+Here is an example from a game:
+
+@example
+@group
+
+ |. X . X X . . X O X O
+ |X . . . . . X X O O O
+ |O X X X X . . X O O O
+ |O O O O X . O X O O O
+ |. . . . O O O O X X O
+ |X O . X X X . . X O O
+ |X O O O O O O O X X O
+ |. X X O . O X O . . X
+ |X . . X . X X X X X X
+ |O X X O X . X O O X O
+
+@end group
+@end example
+
+Here the @samp{O} dragon which is surrounded in the center has open
+eye space. In the middle of this open eye space are three
+dead @samp{X} stones. This space is large enough that O cannot be
+killed. We can abstract the properties of this eye shape as follows.
+Marking certain vertices as follows:
+
+@example
+@group
+
+ |- X - X X - - X O X O
+ |X - - - - - X X O O O
+ |O X X X X - - X O O O
+ |O O O O X - O X O O O
+ |! . . . O O O O X X O
+ |X O . X X X . ! X O O
+ |X O O O O O O O X X O
+ |- X X O - O X O - - X
+ |X - - X - X X X X X X
+ |O X X O X - X O O X O
+
+@end group
+@end example
+
+@noindent
+the shape in question has the form:
+
+@example
+@group
+
+!...
+ .XXX.!
+
+@end group
+@end example
+
+The marginal vertices are marked with an exclamation point (@samp{!}).
+The captured @samp{X} stones inside the eyespace are naturally marked @samp{X}.
+
+The precise algorithm by which the eye spaces are determined is
+somewhat complex. Documentation of this algorithm is in the
+comments in the source to the function @code{make_domains()} in
+@file{optics.c}.
+
+The eyespaces can be conveniently displayed using a colored
+ascii diagram by running @command{gnugo -E}.
+
+@node Eye Space as Local Game
+@section The eyespace as local game
+
+In the abstraction, an eyespace consists of a set of vertices
+labelled:
+
+@example
+
+! . X
+
+@end example
+
+Tables of many eyespaces are found in the database
+@file{patterns/eyes.db}. Each of these may be thought of as a local
+game. The result of this game is listed after the eyespace in the form
+@code{:max,min}, where @code{max} is the number of eyes the pattern
+yields if @samp{O} moves first, while @code{min} is the number of eyes
+the pattern yields if @samp{X} moves first. The player who owns the eye
+space is denoted @samp{O} throughout this discussion. Since three eyes
+are no better than two, there is no attempt to decide whether the space
+yields two eyes or three, so max never exceeds 2. Patterns with min>1
+are omitted from the table.
+
+For example, we have:
+
+@example
+@group
+Pattern 548
+
+ x
+xX.!
+
+:0111
+
+@end group
+@end example
+
+Here notation is as above, except that @samp{x} means @samp{X} or
+@code{EMPTY}. The result of the pattern is not different if @samp{X} has
+stones at these vertices or not.
+
+We may abstract the local game as follows. The two players @samp{O}
+and @samp{X} take turns moving, or either may pass.
+
+RULE 1: @samp{O} for his move may remove any vertex marked @samp{!}
+or marked @samp{.}.
+
+RULE 2: @samp{X} for his move may replace a @samp{.} by an @samp{X}.
+
+RULE 3: @samp{X} may remove a @samp{!}. In this case, each @samp{.}
+adjacent to the @samp{!} which is removed becomes a @samp{!} . If an
+@samp{X} adjoins the @samp{!} which is removed, then that @samp{X}
+and any which are connected to it are also removed. Any @samp{.} which
+are adjacent to the removed @samp{X}'s then become @samp{.}.
+
+Thus if @samp{O} moves first he can transform the eyeshape in
+the above example to:
+
+@example
+@group
+ ... or !...
+ .XXX.! .XXX.
+@end group
+@end example
+
+However if @samp{X} moves he may remove the @samp{!} and the @samp{.}s
+adjacent to the @samp{!} become @samp{!} themselves. Thus if @samp{X}
+moves first he may transform the eyeshape to:
+
+@example
+@group
+ !.. or !..
+ .XXX.! .XXX!
+@end group
+@end example
+
+NOTE: A nuance which is that after the @samp{X:1}, @samp{O:2}
+exchange below, @samp{O} is threatening to capture three X stones,
+hence has a half eye to the left of 2. This is subtle, and there are
+other such subtleties which our abstraction will not capture. Some of
+these at least can be dealt with by a refinements of the scheme, but
+we will content ourselves for the time being with a simplified model.
+
+@example
+@group
+
+ |- X - X X - - X O X O
+ |X - - - - - X X O O O
+ |O X X X X - - X O O O
+ |O O O O X - O X O O O
+ |1 2 . . O O O O X X O
+ |X O . X X X . 3 X O O
+ |X O O O O O O O X X O
+ |- X X O - O X O - - X
+ |X - - X - X X X X X X
+ |O X X O X - X O O X O
+
+@end group
+@end example
+
+We will not attempt to characterize the terminal states
+of the local game (some of which could be seki) or
+the scoring.
+
+@node Eye Example
+@section An example
+
+Here is a local game which yields exactly one
+eye, no matter who moves first:
+
+@example
+@group
+
+!
+...
+...!
+
+@end group
+@end example
+
+Here are some variations, assuming @samp{O} moves first.
+
+@example
+@group
+! (start position)
+...
+...!
+@end group
+
+
+@group
+... (after @samp{O}'s move)
+...!
+@end group
+
+
+@group
+...
+..!
+@end group
+
+
+@group
+...
+..
+@end group
+
+
+@group
+.X. (nakade)
+..
+@end group
+@end example
+
+Here is another variation:
+
+@example
+
+@group
+! (start)
+...
+...!
+@end group
+
+
+@group
+! (after @samp{O}'s move)
+. .
+...!
+@end group
+
+
+@group
+! (after @samp{X}'s move)
+. .
+..X!
+@end group
+
+
+@group
+. .
+..X!
+@end group
+
+
+@group
+. !
+.!
+@end group
+@end example
+
+
+@node Graphs
+@section Graphs
+
+It is a useful observation that the local game associated
+with an eyespace depends only on the underlying graph, which
+as a set consists of the set of vertices, in which two elements
+are connected by an edge if and only if they are adjacent on
+the Go board. For example the two eye shapes:
+
+@example
+
+..
+ ..
+
+and
+
+....
+
+@end example
+
+@noindent
+though distinct in shape have isomorphic graphs, and consequently
+they are isomorphic as local games. This reduces the number of
+eyeshapes in the database @file{patterns/eyes.db}.
+
+A further simplification is obtained through our treatment of
+half eyes and false eyes. Such patterns are identified by the
+topological analysis (@pxref{Eye Topology}).
+
+A half eye is isomorphic to the pattern @code{(!.)} . To see this,
+consider the following two eye shapes:
+
+@example
+@group
+XOOOOOO
+X.....O
+XOOOOOO
+
+@end group
+and:
+@group
+
+XXOOOOO
+XOa...O
+XbOOOOO
+XXXXXXX
+
+@end group
+@end example
+
+These are equivalent eyeshapes, with isomorphic local games @{2|1@}.
+The first has shape:
+
+@example
+
+!....
+
+@end example
+
+The second eyeshape has a half eye at @samp{a} which is taken when @samp{O}
+or @samp{X} plays at @samp{b}. This is found by the topological
+criterion (@pxref{Eye Topology}).
+
+The graph of the eye_shape, ostensibly @samp{....} is modified by replacing
+the left @samp{.} by @samp{!.} during graph matching.
+
+
+A false eye is isomorphic to the pattern @code{(!)} . To see this,
+consider the following eye shape:
+
+@example
+
+XXXOOOOOO
+X.Oa....O
+XXXOOOOOO
+
+@end example
+
+This is equivalent to the two previous eyeshapes, with an isomorphic
+local game @{2|1@}.
+
+This eyeshape has a false eye at @samp{a}. This is also found by the
+topological criterion.
+
+The graph of the eye_shape, ostensibly @samp{.....} is modified by replacing
+the left @samp{.} by @samp{!}. This is made directly in the eye data,
+not only during graph matching.
+
+@node Eye Shape
+@section Eye shape analysis
+
+The patterns in @file{patterns/eyes.db} are compiled into graphs
+represented essentially by arrays in @file{patterns/eyes.c}.
+
+Each actual eye space as it occurs on the board is also
+compiled into a graph. Half eyes are handled as follows.
+Referring to the example
+
+@example
+@group
+XXOOOOO
+XOa...O
+XbOOOOO
+XXXXXX
+@end group
+@end example
+
+@noindent
+repeated from the preceding discussion, the vertex at @samp{b} is
+added to the eyespace as a marginal vertex. The adjacency
+condition in the graph is a macro (in @file{optics.c}): two
+vertices are adjacent if they are physically adjacent,
+or if one is a half eye and the other is its key point.
+
+In @code{recognize_eyes()}, each such graph arising from an actual eyespace is
+matched against the graphs in @file{eyes.c}. If a match is found, the
+result of the local game is known. If a graph cannot be matched, its
+local game is assumed to be @{2|2@}.
+
+@node Eye Local Game Values
+@section Eye Local Game Values
+
+The game values in @file{eyes.db} are given in a simplified scheme which is
+flexible enough to represent most possibilities in a useful way.
+
+The colon line below the pattern gives the eye value of the matched
+eye shape. This consists of four digits, each of which is the number
+of eyes obtained during the following conditions:
+
+@enumerate
+@item The attacker moves first and is allowed yet another move because
+the defender plays tenuki.
+@item The attacker moves first and the defender responds locally.
+@item The defender moves first and the attacker responds locally.
+@item The defender moves first and is allowed yet another move because
+the attacker plays tenuki.
+@end enumerate
+
+The first case does @strong{not} necessarily mean that the attacker is
+allowed two consecutive moves. This is explained with an example
+later.
+
+Also, since two eyes suffice to live, all higher numbers also count
+as two.
+
+The following 15 cases are of interest:
+
+@itemize @bullet
+@item 0000 0 eyes.
+@item 0001 0 eyes, but the defender can threaten to make one eye.
+@item 0002 0 eyes, but the defender can threaten to make two eyes.
+@item 0011 1/2 eye, 1 eye if defender moves first, 0 eyes if attacker does.
+@item 0012 3/4 eyes, 3/2 eyes if defender moves first, 0 eyes if attacker does.
+@item 0022 1* eye, 2 eyes if defender moves first, 0 eyes if attacker does.
+@item 0111 1 eye, attacker can threaten to destroy the eye.
+@item 0112 1 eye, attacker can threaten to destroy the eye, defender can threaten to make another eye.
+@item 0122 5/4 eyes, 2 eyes if defender moves first, 1/2 eye if attacker does.
+@item 0222 2 eyes, attacker can threaten to destroy both.
+@item 1111 1 eye.
+@item 1112 1 eye, defender can threaten to make another eye.
+@item 1122 3/2 eyes, 2 eyes if defender moves first, 1 eye if attacker does.
+@item 1222 2 eyes, attacker can threaten to destroy one eye.
+@item 2222 2 eyes.
+@end itemize
+
+The 3/4, 5/4, and 1* eye values are the same as in Howard Landman's paper
+Eyespace Values in Go. Attack and defense points are only marked in
+the patterns when they have definite effects on the eye value,
+i.e. pure threats are not marked.
+
+Examples of all different cases can be found among the patterns in
+this file. Some of them might be slightly counterintuitive, so we
+explain one important case here. Consider
+
+@example
+@group
+Pattern 6141
+
+ X
+XX.@@x
+
+:1122
+@end group
+@end example
+
+which e.g. matches in this position:
+
+@example
+@group
+.OOOXXX
+OOXOXOO
+OXXba.O
+OOOOOOO
+@end group
+@end example
+
+Now it may look like @samp{X} could take away both eyes by playing @samp{a}
+followed by @samp{b}, giving 0122 as eye value. This is where the subtlety
+of the definition of the first digit in the eye value comes into
+play. It does not say that the attacker is allowed two consecutive
+moves but only that he is allowed to play "another move". The
+crucial property of this shape is that when @samp{X} plays at a to destroy
+(at least) one eye, @samp{O} can answer at @samp{b}, giving:
+
+@example
+@group
+
+.OOOXXX
+OO.OXOO
+O.cOX.O
+OOOOOOO
+
+@end group
+@end example
+
+Now @samp{X} has to continue at @samp{c} in order to keep @samp{O}
+at one eye. After this @samp{O} plays tenuki and @samp{X} cannot
+destroy the remaining eye by another move. Thus the eye value is
+indeed 1122.
+
+As a final note, some of the eye values indicating a threat depend
+on suicide to be allowed, e.g.
+
+@example
+@group
+
+Pattern 301
+
+X.X
+
+:1222
+
+@end group
+@end example
+
+We always assume suicide to be allowed in this database. It is easy
+enough to sort out such moves at a higher level when suicide is
+disallowed.
+
+@node Eye Topology
+@section Topology of Half Eyes and False Eyes
+
+A HALF EYE is a pattern where an eye may or may not materialize,
+depending on who moves first. Here is a half eye for @code{O}:
+
+@example
+@group
+
+ OOXX
+ O.O.
+ OO.X
+
+@end group
+@end example
+
+A FALSE EYE is an eye vertex which cannot become a proper eye. Here are
+two examples of false eyes for @code{O}:
+
+@example
+@group
+
+ OOX OOX
+ O.O O.OO
+ XOO OOX
+
+@end group
+@end example
+
+We describe now the topological algorithm used to find half eyes
+and false eyes. In this section we ignore the possibility of ko.
+
+False eyes and half eyes can locally be characterized by the status of
+the diagonal intersections from an eye space. For each diagonal
+intersection, which is not within the eye space, there are three
+distinct possibilities:
+
+@itemize @bullet
+@item occupied by an enemy (@code{X}) stone, which cannot be captured.
+@item either empty and @code{X} can safely play there, or occupied
+ by an @code{X} stone that can both be attacked and defended.
+@item occupied by an @code{O} stone, an @code{X} stone that can be attacked
+ but not defended, or it's empty and @code{X} cannot safely play there.
+@end itemize
+
+We give the first possibility a value of two, the second a value of
+one, and the last a value of zero. Summing the values for the diagonal
+intersections, we have the following criteria:
+
+@itemize @bullet
+@item sum >= 4: false eye
+@item sum == 3: half eye
+@item sum <= 2: proper eye
+@end itemize
+
+If the eye space is on the edge, the numbers above should be decreased
+by 2. An alternative approach is to award diagonal points which are
+outside the board a value of 1. To obtain an exact equivalence we must
+however give value 0 to the points diagonally off the corners, i.e.
+the points with both coordinates out of bounds.
+
+The algorithm to find all topologically false eyes and half eyes is:
+
+For all eye space points with at most one neighbor in the eye space,
+evaluate the status of the diagonal intersections according to the
+criteria above and classify the point from the sum of the values.
+
+@node Eye Topology with Ko
+@section Eye Topology with Ko
+
+
+This section extends the topological eye analysis to handle ko. We
+distinguish between a ko in favor of @samp{O} and one in favor of @samp{X}:
+
+@example
+@group
+.?O? good for O
+OO.O
+O.O?
+XOX.
+.X..
+
+@end group
+@group
+.?O? good for X
+OO.O
+OXO?
+X.X.
+.X..
+@end group
+@end example
+
+Preliminarily we give the former the symbolic diagonal value @code{a}
+and the latter the diagonal value @code{b}. We should clearly have
+@code{0 < a < 1 < b < 2}. Letting @code{e} be the topological eye value
+(still the sum of the four diagonal values), we want to have the
+following properties:
+
+@example
+e <= 2 - proper eye
+2 < e < 3 - worse than proper eye, better than half eye
+e = 3 - half eye
+3 < e < 4 - worse than half eye, better than false eye
+e >= 4 - false eye
+@end example
+
+In order to determine the appropriate values of @code{a} and @code{b} we
+analyze the typical cases of ko contingent topological eyes:
+
+@example
+@group
+ .X.. (slightly) better than proper eye
+(a) ..OO e < 2
+ OO.O
+ O.OO e = 1 + a
+ XOX.
+ .X..
+
+@end group
+
+@group
+ .X.. better than half eye, worse than proper eye
+(a') ..OO 2 < e < 3
+ OO.O
+ OXOO e = 1 + b
+ X.X.
+ .X..
+
+@end group
+
+@group
+ .X.. better than half eye, worse than proper eye
+(b) .XOO 2 < e < 3
+ OO.O
+ O.OO e = 2 + a
+ XOX.
+ .X..
+
+@end group
+
+@group
+ .X.. better than false eye, worse than half eye
+(b') .XOO 3 < e < 4
+ OO.O
+ OXOO e = 2 + b
+ X.X.
+ .X..
+
+@end group
+
+@group
+ .X..
+ XOX. (slightly) better than proper eye
+(c) O.OO e < 2
+ OO.O
+ O.OO e = 2a
+ XOX.
+ .X..
+
+@end group
+
+@group
+ .X..
+ XOX. proper eye, some aji
+(c') O.OO e ~ 2
+ OO.O
+ OXOO e = a + b
+ X.X.
+ .X..
+
+@end group
+
+@group
+ .X..
+ X.X. better than half eye, worse than proper eye
+(c'') OXOO 2 < e < 3
+ OO.O
+ OXOO e = 2b
+ X.X.
+ .X..
+
+@end group
+
+@group
+ .X...
+ XOX.. better than half eye, worse than proper eye
+(d) O.O.X 2 < e < 3
+ OO.O.
+ O.OO. e = 1 + 2a
+ XOX..
+ .X...
+
+@end group
+
+@group
+ .X...
+ XOX.. half eye, some aji
+(d') O.O.X e ~ 3
+ OO.O.
+ OXOO. e = 1 + a + b
+ X.X..
+ .X...
+
+@end group
+
+@group
+ .X...
+ X.X.. better than false eye, worse than half eye
+(d'') OXO.X 3 < e < 4
+ OO.O.
+ OXOO. e = 1 + 2b
+ X.X..
+ .X...
+
+@end group
+
+@group
+ .X...
+ XOX.. better than false eye, worse than half eye
+(e) O.OXX 3 < e < 4
+ OO.O.
+ O.OO. e = 2 + 2a
+ XOX..
+ .X...
+
+@end group
+
+@group
+ .X...
+ XOX.. false eye, some aji
+(e') O.OXX e ~ 4
+ OO.O.
+ OXOO. e = 2 + a + b
+ X.X..
+ .X...
+
+@end group
+
+@group
+ .X...
+ X.X.. (slightly) worse than false eye
+(e'') OXOXX 4 < e
+ OO.O.
+ OXOO. e = 2 + 2b
+ X.X..
+ .X...
+
+@end group
+@end example
+
+It may seem obvious that we should use
+@example
+(i) a=1/2, b=3/2
+@end example
+but this turns out to have some drawbacks. These can be solved by
+using either of
+@example
+(ii) a=2/3, b=4/3
+(iii) a=3/4, b=5/4
+(iv) a=4/5, b=6/5
+
+@end example
+
+Summarizing the analysis above we have the following table for the
+four different choices of @code{a} and @code{b}.
+
+@example
+case symbolic a=1/2 a=2/3 a=3/4 a=4/5 desired
+ value b=3/2 b=4/3 b=5/4 b=6/5 interval
+(a) 1+a 1.5 1.67 1.75 1.8 e < 2
+(a') 1+b 2.5 2.33 2.25 2.2 2 < e < 3
+(b) 2+a 2.5 2.67 2.75 2.8 2 < e < 3
+(b') 2+b 3.5 3.33 3.25 3.2 3 < e < 4
+(c) 2a 1 1.33 1.5 1.6 e < 2
+(c') a+b 2 2 2 2 e ~ 2
+(c'') 2b 3 2.67 2.5 2.4 2 < e < 3
+(d) 1+2a 2 2.33 2.5 2.6 2 < e < 3
+(d') 1+a+b 3 3 3 3 e ~ 3
+(d'') 1+2b 4 3.67 3.5 3.4 3 < e < 4
+(e) 2+2a 3 3.33 3.5 3.6 3 < e < 4
+(e') 2+a+b 4 4 4 4 e ~ 4
+(e'') 2+2b 5 4.67 4.5 4.4 4 < e
+
+@end example
+
+We can notice that (i) fails for the cases (c''), (d), (d''), and (e).
+The other three choices get all values in the correct intervals. The
+main distinction between them is the relative ordering of (c'') and (d)
+(or analogously (d'') and (e)). If we do a more detailed analysis of
+these we can see that in both cases @samp{O} can secure the eye
+unconditionally if he moves first while @samp{X} can falsify it with ko
+if he moves first. The difference is that in (c''), @samp{X} has to make
+the first ko threat, while in (d), O has to make the first ko threat.
+Thus (c'') is better for O and ought to have a smaller topological eye
+value than (d). This gives an indication that (iv) is the better choice.
+
+We can notice that any value of @code{a}, @code{b} satisfying
+@code{a+b=2} and @code{3/4=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
+.\" to do unbreakable dashes and therefore won't be available. \*(C` and
+.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr
+.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
+.\" index entries marked with X<> in POD. Of course, you'll have to process
+.\" the output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it
+.\" makes way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+.bd B 3
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ======================================================================
+.\"
+.IX Title ".::gnugo 6"
+.TH .::gnugo 6 "3.7.7" "2006-01-10" "User Contributed Perl Documentation"
+.UC
+.SH "NAME"
+gnugo \- The \s-1GNU\s0 program to play the game of Go
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+\&\fBgnugo\fR
+[\fB\*(--boardsize ]
+[\fB\*(--color ]
+[\fB\*(--handicap ]
+[\fB\*(--komi ]
+[\fB\*(--quiet\fR]
+[\fB\-v, \-\-version\fR]
+[\fB\-h, \-\-help\fR]
+[\fB\*(--help debug\fR]
+[\fB\*(--copyright\fR]
+[\fB\*(--mode ]
+[\fB\*(--replay ]
+[\fB\-l, \-\-infile ]
+[\fB\-L, \-\-until ]
+[\fB\-o, \-\-outfile ]
+[\fB\*(--printsgf ]
+[\fB\-D, \-\-depth ]
+[\fB\-B, \-\-backfill_depth ]
+[\fB\*(--score [estimate|finish|aftermath]\fR ]
+[\fB\-a, \-\-allpats\fR]
+[\fB\-T, \-\-printboard\fR]
+[\fB\-d, \-\-debug ]
+[\fB\-w, \-\-worms\fR]
+[\fB\-m, \-\-moyo ]
+[\fB\-b, \-\-benchmark num\fR]
+[\fB\-t, \-\-trace\fR]
+[\fB\-r, \-\-seed num\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\s-1GNU\s0 Go plays a game of Go against the user. It has many other features: it
+can play against itself or another program, analyse and score a recorded
+game. \s-1GNU\s0 Go is compliant with Go modem protocol, load and save game in
+the Smart Game format.
+.PP
+\&\s-1GNU\s0 Go default is a simple alpha-numeric board display, but you can use
+a client such as \fBCGoban\fR.
+.Sh "The game of Go"
+.IX Subsection "The game of Go"
+Go is a game of strategy between two players usually played on a
+19x19 grid called \fBgoban\fR. The two players put black and white \fBstones\fR on
+the goban to enclose \fBterritory\fR. Go was invented about 4000 years ago in
+ancient China. Other names for this game are (Chinese) \fBWei Chi\fR, (Korean)
+\&\fBBaduk\fR and (Ing) \fBGoe\fR.
+.Sh "Playing a game in \s-1ASCII\s0 mode"
+.IX Subsection "Playing a game in ASCII mode"
+To start a game with default options, just invoke \*(L"gnugo\*(R". The board will be
+drawn at your terminal using \s-1ASCII\s0 letters. In this mode, you can get help on
+available commands by the \fBh\fR key. To play as Black with 4 stones handicap,
+with a 0.5 komi, recording the game in the file record.sgf:
+.PP
+.Vb 1
+\& gnugo --color black --handicap 4 --komi 0.5 -o record.sgf
+.Ve
+.Sh "Playing a game with CGoban"
+.IX Subsection "Playing a game with CGoban"
+CGoban is a general purpose client program by Bill Shubert for
+playing Go. It runs under X Window System with a beautiful resizeable
+graphic display. To use \s-1GNU\s0 Go under X Window System, obtain the
+most recent version of CGoban from Bill Shubert's web site
+.PP
+http://www.igoweb.org/~wms/comp/cgoban/index.html
+.PP
+Start CGoban. When the CGoban Control panel comes up, select `Go Modem.'
+You will get the Go Modem Protocol Setup. Choose one (or both) of the
+players to be ``Program,'' and fill out the box to the path to
+gnugo. After clicking \s-1OK\s0, you get the Game Setup window. Choose
+``Rules Set'' to be Japanese (otherwise handicaps won't work). Set the
+board size and handicap if you want. Click \s-1OK\s0 and you are ready to go.
+.PP
+In the Go Modem Protocol Setup window, when you specify the path
+to \s-1GNU\s0 Go, you can give it command line options, such as \-\-quiet
+to suppress most messages. Since the Go Modem Protocol preempts
+standard I/O, other messages are sent to stderr, even if they are
+not error messages. These will appear in the terminal from which
+you started CGoban.
+.Sh "Scoring system"
+.IX Subsection "Scoring system"
+The game stops when both players pass. \s-1GNU\s0 Go will attempt to
+compute and report the score to you. It may occasionally make
+mistakes due to wrong evaluation of the status of a group. You
+can check the score as follows. In \s-1ASCII\s0 mode, at the end of
+the game, stones believed dead are marked in lower case letters,
+and you have the option of toggling their status before counting.
+Using CGoban, you may use CGoban's counting facility to count
+the game using either Japanese or Chinese rules.
+.Sh "Viewing a stored game"
+.IX Subsection "Viewing a stored game"
+gnugo \fB\-l\fR filename.sgf \-\-mode ascii
+.PP
+loads filename.sgf and lets you navigate through the game by using the
+commands \fIforward\fR, \fIback\fR, \fIgoto\fR and \fIlast\fR.
+It is not possible to navigate through variations in ascii mode.
+You may also use CGoban to view stored games. CGoban can navigate
+variations.
+.Sh "Documentation"
+.IX Subsection "Documentation"
+The files in the \fIdoc\fR directory contain detailed documentation about
+debugging options and internal program structure. Other documentation may
+be found in comments throughout the source code.
+.Sh "Go Modem Protocol"
+.IX Subsection "Go Modem Protocol"
+The Go Modem Protocol is a standard interface between Go programs and
+graphical display.
+.PP
+The Go Modem Protocol was developed by Bruce Wilcox with input from
+David Fotland, Anders Kierulf and others. Any Go program *should*
+use this protocol since it is standard. Since CGoban supports this
+protocol, the user interface for any Go program can be done
+entirely through CGoban. Using the Go Modem Protocol, you can play
+with another computer running a different program (even on a
+different operating system) using a modem, a serial cable or over
+the internet if the other program also supports the protocol. You
+can also communicate with the Go servers using CGoban.
+.Sh "Smart Game Format"
+.IX Subsection "Smart Game Format"
+Games (with comments, variations and other features) can be
+stored in the Smart Game Format (\s-1SGF\s0). This format originated in
+Anders Kierulf's program Smart Go. Martin Muller and Arno
+Hollosi developed the current standard, which may be found
+at
+.PP
+http://www.red-bean.com/sgf/
+.PP
+\&\s-1GNU\s0 Go supports the Smart Game Format.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.Sh "Main options"
+.IX Subsection "Main options"
+\&\fB\*(--mode \f(BImode\fB\fR
+.PP
+force the playing mode (\fIascii'\fR, \fIgtp\fR or \fIgmp\fR). Default is
+\&\s-1ASCII\s0. If no terminal is detected \s-1GMP\s0 (Go Modem Protocol) will be assumed.
+.PP
+\&\fB\*(--replay \f(BIcolor\fB\fR
+.PP
+replay the game generating moves for color, where color is \fIwhite\fR,
+\&\fIblack\fR, or \fIboth\fR. (requires \fB\-l\fR)
+.PP
+\&\fB\*(--quiet\fR
+.PP
+Don't print copyright and other informational messages.
+.PP
+\&\fB\-l, \-\-infile \f(BIfile\fB\fR
+.PP
+Load the \s-1SGF\s0 file (to score or analyze a recorded game).
+.PP
+\&\fB\-L, \-\-until \f(BImove\fB\fR
+.PP
+Stop loading just before \fImove\fR is played (e.g. 154 or L10).
+.PP
+\&\fB\-o, \-\-outfile \f(BIfile\fB\fR
+.PP
+Save the played game to \fIfile\fR in \s-1SGF\s0 format.
+.Sh "Game Options:"
+.IX Subsection "Game Options:"
+\&\fB\*(--boardsize \f(BInum\fB\fR
+.PP
+Set the board size to use (1\-19). Default is 19, other common formats are
+13 and 9.
+.PP
+\&\fB\*(--color \f(BIcolor\fB\fR
+.PP
+Choose your color (\fIblack\fR or \fIwhite\fR). Black plays first, White gets
+the komi compensation.
+.PP
+\&\fB\*(--handicap \f(BInum\fB\fR
+.PP
+Set the number of handicap stones.
+.PP
+\&\fB\*(--komi \f(BInum\fB\fR
+.PP
+Set the komi (points given to white player to compensate advantage of the
+first move, usually 5.5 or 0.5). Default is 5.5.
+.Sh "Informative Output:"
+.IX Subsection "Informative Output:"
+\&\fB\-v, \-\-version\fR
+.PP
+Display the version of \s-1GNU\s0 Go.
+.PP
+\&\fB\-h, \-\-help\fR
+.PP
+Display help message.
+.PP
+\&\fB\*(--help debug\fR
+.PP
+Display help about debugging options.
+.PP
+\&\fB\*(--copyright\fR
+.PP
+Display copyright notice.
+.Sh "Debugging and advanced options:"
+.IX Subsection "Debugging and advanced options:"
+\&\fB\-T, \-\-printboard\fR
+.PP
+Show board each move.
+.PP
+\&\fB\*(--level \f(BInum\fB\fR
+.PP
+Level of play. (default 10; smaller=faster, weaker).
+.PP
+\&\fB\-b, \-\-benchmark \f(BInum\fB\fR
+.PP
+Benchmarking mode \- can be used with \fB\-l\fR.
+.PP
+\&\fB\-t, \-\-trace\fR
+.PP
+Verbose tracing (use twice or more to trace reading).
+.PP
+\&\fB\-r, \-\-seed \f(BInum\fB\fR
+.PP
+Set random number seed.
+.PP
+\&\fB\*(--score [\f(BIestimate|finish|aftermath\fB]\fR
+.PP
+Count or estimate territory of the input file. Usage:
+.PP
+\&\fBgnugo \-\-score estimate \-l filename\fR
+.PP
+Loads the \s-1SGF\s0 file and estimates the score by measuring the
+influence. Use with \fB\-L\fR if you want the estimate somewhere else than
+at the end of the file.
+.PP
+\&\fBgnugo \-\-score finish \-l filename\fR
+.PP
+Loads the \s-1SGF\s0 file and gnugo continues to play by itself up to the
+very end. Then the winner is determined by counting the territory.
+.PP
+\&\fBgnugo \-\-score aftermath \-l filename\fR
+.PP
+Similar to \fB\*(--score finish\fR except that a more accurate but slower
+algorithm is used to determine the final status of the groups.
+.PP
+If the option \fB\-o outputfilename\fR is provided,
+the results will also be written as comment at the end of the output file.
+.PP
+\&\fB\*(--printsgf \f(BIoutfile\fB\fR
+.PP
+Load \s-1SGF\s0 file, output final position (requires \fB\-l\fR).
+.SH "BUGS"
+.IX Header "BUGS"
+If you find a bug, please send the \s-1SGF\s0 output file to gnugo@gnu.org
+together with a description of the bug.
diff --git a/gnugo/src/doc/gnugo.info b/gnugo/src/doc/gnugo.info
new file mode 100644
index 0000000000000000000000000000000000000000..d3ef10f9afffaaeef64c88e203bbd8804de3a9d1
--- /dev/null
+++ b/gnugo/src/doc/gnugo.info
@@ -0,0 +1,199 @@
+This is gnugo.info, produced by makeinfo version 4.11 from gnugo.texi.
+
+INFO-DIR-SECTION GNU games
+START-INFO-DIR-ENTRY
+* GNU Go: (gnugo). The GNU Go program
+END-INFO-DIR-ENTRY
+
+
+Indirect:
+gnugo.info-1: 187
+gnugo.info-2: 298286
+gnugo.info-3: 585384
+
+Tag Table:
+(Indirect)
+Node: Top187
+Node: Introduction2429
+Node: About2985
+Node: Copyright4991
+Node: Authors6383
+Node: Thanks7125
+Node: Development8457
+Node: Installation10524
+Node: GNU/Linux and Unix11105
+Node: Configure Options12860
+Node: Ram Cache13290
+Node: Default Level14936
+Node: Other Options15761
+Node: Windows and MS-DOS19044
+Node: Macintosh24802
+Node: User Guide25397
+Node: Documentation25997
+Node: CGoban27978
+Node: Other Clients29758
+Node: Ascii32146
+Node: Emacs33457
+Node: GMP and GTP34790
+Node: Tournaments35815
+Node: SGF Support36427
+Node: Invoking GNU Go36769
+Node: Overview59822
+Node: Examining the Position61077
+Node: Move Generators64103
+Node: Move Valuation68408
+Node: Detailed Sequence of Events69330
+Node: Roadmap72939
+Node: Coding Styles84582
+Node: Navigating the Source87635
+Node: Analyzing88428
+Node: Traces89429
+Node: Output File90380
+Node: Decide string91435
+Node: Decide dragon94534
+Node: GTP and GDB techniques94972
+Node: view.pike95711
+Node: Scoring96535
+Node: Colored Display96896
+Node: Move Generation98854
+Node: Move generation Intro99224
+Node: Move Reasons100943
+Node: Move Reason Details103642
+Node: Attack and Defense104454
+Node: Threats to Attack or Defend105909
+Node: Multi Attack or Defense106611
+Node: Cutting and Connecting106992
+Node: Semeai107977
+Node: Making eyes108766
+Node: Antisuji moves109392
+Node: Territorial moves109796
+Node: Owl attack and defense110330
+Node: Combination Attacks111914
+Node: Valuation112330
+Node: Territorial value115377
+Node: Strategical value116241
+Node: Shape factor116829
+Node: Minimum Value117790
+Node: Secondary Value118459
+Node: Threats and Followup Value118735
+Node: End Game119649
+Node: Worms and Dragons120030
+Node: Worms122366
+Node: Amalgamation132161
+Node: Connection133860
+Node: Half Eyes135693
+Node: Dragons137482
+Node: Dragons in Color148555
+Node: Eyes150034
+Node: Local Games150822
+Node: Eye Space152186
+Node: Eye Space as Local Game154271
+Node: Eye Example157092
+Node: Graphs157778
+Node: Eye Shape159652
+Node: Eye Local Game Values160639
+Node: Eye Topology164228
+Node: Eye Topology with Ko166346
+Node: False Margins172276
+Node: Eye Functions172884
+Node: Patterns182133
+Node: Patterns Overview183433
+Node: Pattern Classification187147
+Node: Pattern Values192559
+Node: Helper Functions193544
+Node: Autohelpers and Constraints196448
+Node: Autohelper Actions198892
+Node: Autohelper Functions201307
+Node: Attack and Defense DB212631
+Node: Connections Database213950
+Node: Connection Functions216196
+Node: Tuning218226
+Node: PM Implementation226271
+Node: Symmetry & transformations227654
+Node: Details229542
+Node: Grid optimization231775
+Node: Joseki Compiler233290
+Node: Ladders in Joseki236881
+Node: Corner Matcher238821
+Node: Editing Patterns243820
+Node: DFA245121
+Node: Introduction to the DFA246335
+Node: What is a DFA248260
+Node: Pattern matching with DFA252932
+Node: Building the DFA255534
+Node: Incremental Algorithm257866
+Node: DFA Optimizations259052
+Node: Tactical Reading259529
+Node: Reading Basics260661
+Ref: Return Codes262979
+Ref: Experimental Owl Extension263604
+Ref: depthparams264135
+Node: Hashing267700
+Node: Hash Calculation269226
+Node: Hash Organization270756
+Node: Hash Structures273370
+Node: Persistent Cache276616
+Node: Ko280124
+Node: A Ko Example284328
+Node: Another Ko Example286396
+Node: Alternate Komaster Schemes288006
+Node: Superstrings289761
+Node: Debugging291105
+Node: Connection Reading295598
+Node: Pattern Based Reading296835
+Node: The Owl Code298286
+Node: Combinations303285
+Node: Influence306331
+Node: Influential Concepts307296
+Node: Territory and Moyo309481
+Node: Influence Usage310817
+Node: Influence and Territory313698
+Node: Territorial Details319583
+Node: The Influence Core321572
+Node: The Influence Algorithm324776
+Node: Permeability327952
+Node: Escape329501
+Node: Break Ins332964
+Node: Surrounded Dragons337404
+Node: Influential Patterns340830
+Node: Influential Display345235
+Node: Influence Tuning348788
+Node: Monte Carlo Go351497
+Node: Libboard359172
+Node: Board Data Structures360978
+Node: The Board Array362402
+Node: Incremental Board367612
+Node: Some Board Functions375267
+Node: SGF379917
+Node: API383219
+Node: Getting Started387212
+Node: Basic Data Structures388208
+Node: The Board State389352
+Node: Positional Functions390806
+Node: Utility Functions397396
+Node: General Utilities397895
+Node: Print Utilities413839
+Node: Board Utilities417413
+Node: Influence Utilities428544
+Node: GTP431012
+Node: The Go Text Protocol431482
+Node: Running in GTP mode432643
+Node: GTP applications434508
+Node: The Metamachine436839
+Node: Adding new GTP commands440640
+Node: GTP command reference444573
+Node: Regression475144
+Node: Regression Testing476680
+Node: Test Suites477489
+Node: Running the Regressions479616
+Node: Running regress.pike482404
+Node: Viewing with Emacs484408
+Node: HTML Views485164
+Node: Copying488598
+Node: GPL489073
+Node: GFDL526318
+Node: GTP License551444
+Node: Concept Index553151
+Node: Functions Index585384
+
+End Tag Table
diff --git a/gnugo/src/doc/gnugo.info-1 b/gnugo/src/doc/gnugo.info-1
new file mode 100644
index 0000000000000000000000000000000000000000..0184447914006e018622bc4a785735c021841c8b
--- /dev/null
+++ b/gnugo/src/doc/gnugo.info-1
@@ -0,0 +1,8030 @@
+This is gnugo.info, produced by makeinfo version 4.11 from gnugo.texi.
+
+INFO-DIR-SECTION GNU games
+START-INFO-DIR-ENTRY
+* GNU Go: (gnugo). The GNU Go program
+END-INFO-DIR-ENTRY
+
+
+File: gnugo.info, Node: Top, Next: Introduction, Up: (dir)
+
+GNU Go Documentation
+********************
+
+GNU Go
+******
+
+This manual documents `GNU Go', a Go program and its sources. This is
+Edition 3.8 of the `GNU Go Program Documentation'
+
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 and 2009 Free Software Foundation (http://www.fsf.org), Inc.
+
+ Permission is granted to make and distribute verbatim or modified
+copies of this manual is given provided that the terms of the GNU Free
+Documentation License (*note GFDL::, version 1.3 or any later version)
+are respected.
+
+ Permission is granted to make and distribute verbatim or modified
+copies of the program GNU Go is given provided the terms of the GNU
+General Public License (*note GPL::, version 3 or any later version)
+are respected.
+
+* Menu:
+
+User's manual
+* Introduction:: What is GNU Go ?
+* Installation:: Installing GNU Go
+* User Guide:: Using GNU Go
+
+An introduction to the GNU Go engine
+* Overview:: Overview of the GNU Go engine
+* Analyzing:: Analyzing GNU Go's moves
+* Move Generation:: How GNU Go generates moves
+* Worms and Dragons:: Dragons and Worms
+* Eyes:: Eyes and half eyes
+* Patterns:: Pattern database
+* Tactical Reading:: Tactical and Connection Reading
+* Pattern Based Reading:: Pattern Based Reading: Owl and Combinations
+* Influence:: Influence Function
+* Monte Carlo Go:: Monte Carlo GNU Go
+
+Infrastructure and Interfaces
+* Libboard:: The basic go board library.
+* SGF:: Handling SGF trees in memory
+* DFA:: The DFA Pattern Matcher
+* Utility Functions:: `utils.c' and `printutils.c'
+* API:: API to the GNU Go engine
+* GTP:: The Go Text Protocol
+* Regression:: Regression testing
+
+Appendices
+* Copying:: Software and Documentation Licenses
+
+Indices
+* Concept Index:: Concept Index
+* Functions Index:: Functions Index
+
+
+File: gnugo.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+This is GNU Go 3.8, a Go program. Development versions of GNU Go may be
+found at `http://www.gnu.org/software/gnugo/devel.html'. Contact us at
+ if you are interested in helping.
+
+* Menu:
+
+* About:: About GNU Go and this Manual
+* Copyright:: Copyright
+* Authors:: The Authors of GNU Go
+* Thanks:: Acknowledgements
+* Development:: Developing GNU Go
+
+
+File: gnugo.info, Node: About, Next: Copyright, Up: Introduction
+
+1.1 About GNU Go and this Manual
+================================
+
+The challenge of Computer Go is not to *beat* the computer, but to
+*program* the computer.
+
+ In Computer Chess, strong programs are capable of playing at the
+highest level, even challenging such a player as Garry Kasparov. No Go
+program exists that plays at the same level as the strongest human
+players.
+
+ To be sure, existing Go programs are strong enough to be interesting
+as opponents, and the hope exists that some day soon a truly strong
+program can be written. This is especially true in view of the
+successes of Monte Carlo methods, and a general recent improvement of
+computer Go.
+
+ Before GNU Go, Go programs have always been distributed as binaries
+only. The algorithms in these proprietary programs are secret. No-one
+but the programmer can examine them to admire or criticise. As a
+consequence, anyone who wished to work on a Go program usually had to
+start from scratch. This may be one reason that Go programs have not
+reached a higher level of play.
+
+ Unlike most Go programs, GNU Go is Free Software. Its algorithms and
+source code are open and documented. They are free for any one to
+inspect or enhance. We hope this freedom will give GNU Go's descendents
+a certain competetive advantage.
+
+ Here is GNU Go's Manual. There are doubtless inaccuracies. The
+ultimate documentation is in the commented source code itself.
+
+ The first three chapters of this manual are for the general user.
+Chapter 3 is the User's Guide. The rest of the book is for programmers,
+or persons curious about how GNU Go works. Chapter 4 is a general
+overview of the engine. Chapter 5 introduces various tools for looking
+into the GNU Go engine and finding out why it makes a certain move, and
+Chapters 6-7 form a general programmer's reference to the GNU Go API.
+The remaining chapters are more detailed explorations of different
+aspects of GNU Go's internals.
+
+
+File: gnugo.info, Node: Copyright, Next: Authors, Prev: About, Up: Introduction
+
+1.2 Copyrights
+==============
+
+Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 and 2008
+by the Free Software Foundation except as noted below.
+
+ All source files are distributed under the GNU General Public License
+(*note GPL::, version 3 or any later version), except `gmp.c', `gmp.h',
+`gtp.c', and `gtp.h'.
+
+ The files `gtp.c' and `gtp.h' are copyright the Free Software
+Foundation. In the interests of promoting the Go Text Protocol these
+two files are licensed under a less restrictive license than the GPL
+and are free for unrestricted use (*note GTP License::).
+
+ The two files `gmp.c' and `gmp.h' were placed in the public domain
+by William Shubert, their author, and are free for unrestricted use.
+
+ Documentation files (including this manual) are distributed under
+the GNU Free Documentation License (*note GFDL::, version 1.3 or any
+later version).
+
+ The files `regression/games/golois/*sgf' are copyright Tristan
+Cazenave and are included with his permission.
+
+ The SGF files in `regression/games/handtalk/' are copyright Jessie
+Annala and are used with permission.
+
+ The SGF files in `regression/games/mertin13x13/' are copyright Stefan
+Mertin and are used with permission.
+
+ The remaining SGF files are either copyright by the FSF or are in
+the public domain.
+
+
+File: gnugo.info, Node: Authors, Next: Thanks, Prev: Copyright, Up: Introduction
+
+1.3 Authors
+===========
+
+GNU Go maintainers are Daniel Bump, Gunnar Farneback and Arend Bayer.
+GNU Go authors (in chronological order of contribution) are Man Li,
+Wayne Iba, Daniel Bump, David Denholm, Gunnar Farneba"ck, Nils Lohner,
+Jerome Dumonteil, Tommy Thorn, Nicklas Ekstrand, Inge Wallin, Thomas
+Traber, Douglas Ridgway, Teun Burgers, Tanguy Urvoy, Thien-Thi Nguyen,
+Heikki Levanto, Mark Vytlacil, Adriaan van Kessel, Wolfgang Manner, Jens
+Yllman, Don Dailey, Maans Ullerstam, Arend Bayer, Trevor Morris, Evan
+Berggren Daniel, Fernando Portela, Paul Pogonyshev, S.P. Lee and
+Stephane Nicolet, Martin Holters, Grzegorz Leszczynski and Lee Fisher.
+
+
+File: gnugo.info, Node: Thanks, Next: Development, Prev: Authors, Up: Introduction
+
+1.4 Thanks
+==========
+
+We would like to thank Arthur Britto, David Doshay, Tim Hunt, Matthias
+Krings, Piotr Lakomy, Paul Leonard, Jean-Louis Martineau, Andreas
+Roever and Pierce Wetter for helpful correspondence.
+
+ Thanks to everyone who stepped on a bug (and sent us a report)!
+
+ Thanks to Gary Boos, Peter Gucwa, Martijn van der Kooij, Michael
+Margolis, Trevor Morris, Maans Ullerstam, Don Wagner and Yin Zheng for
+help with Visual C++.
+
+ Thanks to Alan Crossman, Stephan Somogyi, Pierce Wetter and Mathias
+Wagner for help with Macintosh. And thanks to Marco Scheurer and
+Shigeru Mabuchi for helping us find various problems.
+
+ Thanks to Jessie Annala for the Handtalk games.
+
+ Special thanks to Ebba Berggren for creating our logo, based on a
+design by Tanguy Urvoy and comments by Alan Crossman. The old GNU Go
+logo was adapted from Jamal Hannah's typing GNU:
+`http://www.gnu.org/graphics/atypinggnu.html'. Both logos can be found
+in `doc/newlogo.*' and `doc/oldlogo.*'.
+
+ We would like to thank Stuart Cracraft, Richard Stallman and Man
+Lung Li for their interest in making this program a part of GNU,
+William Shubert for writing CGoban and gmp.c, Rene Grothmann for Jago
+and Erik van Riper and his collaborators for NNGS.
+
+
+File: gnugo.info, Node: Development, Prev: Thanks, Up: Introduction
+
+1.5 Development
+===============
+
+You can help make GNU Go the best Go program.
+
+ This is a task-list for anyone who is interested in helping with GNU
+Go. If you want to work on such a project you should correspond with us
+until we reach a common vision of how the feature will work!
+
+ A note about copyright. The Free Software Foundation has the
+copyright to GNU Go. For this reason, before any code can be accepted
+as a part of the official release of GNU Go, the Free Software
+Foundation will want you to sign a copyright assignment.
+
+ Of course you could work on a forked version without signing such a
+disclaimer. You can also distribute such a forked version of the
+program so long as you also distribute the source code to your
+modifications under the GPL (*note GPL::). But if you want your changes
+to the program to be incorporated into the version we distribute we
+need you to assign the copyright.
+
+ Please contact the GNU Go maintainers, Daniel Bump
+() and Gunnar Farneba"ck
+(), to get more information and the papers to
+sign.
+
+ Bug reports are very welcome, but if you can, send us bug FIXES as
+well as bug reports. If you see some bad behavior, figure out what
+causes it, and what to do about fixing it. And send us a patch! If you
+find an interesting bug and cannot tell us how to fix it, we would be
+happy to have you tell us about it anyway. Send us the sgf file (if
+possible) and attach other relevant information, such as the GNU Go
+version number. In cases of assertion failures and segmentation faults
+we probably want to know what operating system and compiler you were
+using, in order to determine if the problem is platform dependent.
+
+ If you want to work on GNU Go you should subscribe to the GNU Go
+development list. (http://lists.gnu.org/mailman/listinfo/gnugo-devel)
+Discussion of bugs and feedback from established developers about new
+projects or tuning the existing engine can be done on the list.
+
+
+File: gnugo.info, Node: Installation, Next: User Guide, Prev: Introduction, Up: Top
+
+2 Installation
+**************
+
+You can get the most recent version of GNU Go ftp.gnu.org or a mirror
+(see `http://www.gnu.org/order/ftp.html' for a list). You can read
+about newer versions and get other information at
+`http://www.gnu.org/software/gnugo/'.
+
+* Menu:
+
+* GNU/Linux and Unix:: GNU Linux and Unix Installation
+* Configure Options:: Configure Options
+* Windows and MS-DOS:: Windows Installation
+* Macintosh:: Macintosh Installation
+
+
+File: gnugo.info, Node: GNU/Linux and Unix, Next: Configure Options, Up: Installation
+
+2.1 GNU/Linux and Unix
+======================
+
+Untar the sources, change to the directory gnugo-3.8. Now do:
+
+ ./configure [OPTIONS]
+ make
+
+ Several configure options will be explained in the next section. You
+do not need to set these unless you are dissatisfied with GNU Go's
+performance or wish to vary the experimental options.
+
+ As an example,
+
+ ./configure --enable-level=9 --enable-cosmic-gnugo
+
+will make a binary in which the default level is 9, and the experimental
+"cosmic"' option is enabled. A list of all configure options can be
+obtained by running `./configure --help'. Further information about the
+experimental options can be found in the next section (*note Configure
+Options::).
+
+ After running configure and make, you have now made a binary called
+`interface/gnugo'. Now (running as root) type
+
+ make install
+
+to install `gnugo' in `/usr/local/bin'.
+
+ There are different methods of using GNU Go. You may run it from the
+command line by just typing:
+
+ gnugo
+
+but it is nicer to run it using CGoban 1 (under X Window System),
+Quarry, Jago (on any platform with a Java Runtime Environment) or other
+client programs offering a GUI.
+
+ You can get the most recent version of CGoban 1 from
+`http://sourceforge.net/projects/cgoban1/'. The earlier version 1.12 is
+available from `http://www.igoweb.org/~wms/comp/cgoban/index.html'.
+The CGoban version number MUST be 1.9.1 at least or it won't work.
+CGoban 2 will not work.
+
+ *Note CGoban::, for instructions on how to run GNU Go from Cgoban, or
+*Note Other Clients::, for Jago or other clients.
+
+ Quarry is available at `http://home.gna.org/quarry/'.
+
+
+File: gnugo.info, Node: Configure Options, Next: Windows and MS-DOS, Prev: GNU/Linux and Unix, Up: Installation
+
+2.2 Configure Options
+=====================
+
+There are three options which you should consider configuring,
+particularly if you are dissatisfied with GNU Go's performance.
+
+* Menu:
+
+* Ram Cache:: Ram Cache
+* Default Level:: Default Level
+* Other Options:: Other Options
+
+
+File: gnugo.info, Node: Ram Cache, Next: Default Level, Up: Configure Options
+
+2.2.1 Ram Cache
+---------------
+
+By default, GNU Go makes a cache of about 8 Megabytes in RAM for its
+internal use. The cache is used to store intermediate results during
+its analysis of the position. More precisely the default cache size is
+350000 entries, which translates to 8.01 MB on typical 32 bit platforms
+and 10.68 MB on typical 64 bit platforms.
+
+ Increasing the cache size will often give a modest speed improvement.
+If your system has lots of RAM, consider increasing the cache size. But
+if the cache is too large, swapping will occur, causing hard drive
+accesses and degrading performance. If your hard drive seems to be
+running excessively your cache may be too large. On GNU/Linux systems,
+you may detect swapping using the program 'top'. Use the 'f' command to
+toggle SWAP display.
+
+ You may override the size of the default cache at compile time by
+running one of:
+
+ ./configure --enable-cache-size=n
+
+to set the cache size to `n' megabytes. For example
+
+ ./configure --enable-cache-size=32
+
+creates a cache of size 32 megabytes. If you omit this, your default
+cache size will be 8-11 MB as discussed above. Setting cache size
+negative also gives the default size. You must recompile and reinstall
+GNU Go after reconfiguring it by running `make' and `make install'.
+
+ You may override the compile-time defaults by running `gnugo' with
+the option `--cache-size n', where `n' is the size in megabytes of the
+cache you want, and `--level' where n is the level desired. We will
+discuss setting these parameters next in detail.
+
+
+File: gnugo.info, Node: Default Level, Next: Other Options, Prev: Ram Cache, Up: Configure Options
+
+2.2.2 Default Level
+-------------------
+
+GNU Go can play at different levels. Up to level 10 is supported. At
+level 10 GNU Go is much more accurate but takes an average of about 1.6
+times longer to play than at level 8.
+
+ The level can be set at run time using the `--level' option. If you
+don't set this, the default level will be used. You can set the default
+level with the configure option `--enable-level=n'. For example
+
+ ./configure --enable-level=9
+
+sets the default level to 9. If you omit this parameter, the compiler
+sets the default level to 10. We recommend using level 10 unless you
+find it too slow. If you decide you want to change the default you may
+rerun configure and recompile the program.
+
+
+File: gnugo.info, Node: Other Options, Prev: Default Level, Up: Configure Options
+
+2.2.3 Other Options
+-------------------
+
+Anything new in the engine is generally tested as an experimental option
+which can be turned on or off at compile time or run time. Some
+"experimental" options such as the break-in code are no longer
+experimental but are enabled by default.
+
+ This section can be skipped unless you are interested in the
+experimental options.
+
+ Moreover, some configure options were removed from the stable
+release. For example it is known that the owl extension code can cause
+crashes, so the configure option -enable-experimental-owl-ext was
+disabled for 3.8.
+
+ The term "default" must be clarified, since there are really two
+sets of defaults at hand, runtime defaults specified in `config.h' and
+compile time default values for the runtime defaults, contained in
+`configure' (which is created by editing `configure.in' then running
+`autoconf'. For example we find in `config.h'
+
+ /* Center oriented influence. Disabled by default. */
+ #define COSMIC_GNUGO 0
+
+ /* Break-in module. Enabled by default. */
+ #define USE_BREAK_IN 1
+
+ This means that the experimental cosmic option, which causes GNU Go
+to play a center-oriented game (and makes the engine weaker) is
+disabled by default, but that the break-in module is used. These are
+defaults which are used when GNU Go is run without command line
+options. They can be overridden with the run time options:
+
+ gnugo --cosmic-gnugo --without-break-in
+
+ Alternatively you can configure GNU Go as follows:
+
+ ./configure --enable-cosmic-gnugo --disable-experimental-break-in
+
+ then recompile GNU Go. This changes the defaults in `config.h', so
+that you do not have to pass any command line options to GNU Go at run
+time to get the experimental owl extension turned on and the
+experimental break-in code turned off.
+
+ If you want to find out what experimental options were compiled into
+your GNU Go binary you can run `gnugo --options' to find out. Here is a
+list of experimental options in GNU Go.
+
+ * `experimental-break-in'. Experimental break-in code (*note Break
+ Ins::). You should not need to configure this because the break in
+ code is enabled by default in level 10, and is turned off at level
+ 9. If you don't want the breakin code just play at level 9.
+
+ * `cosmic-gnugo'. An experimental style which plays a center
+ oriented game and has a good winning rate against standard GNU Go,
+ though it makes GNU Go weaker against other opponents.
+
+ * `large-scale'. Attempt to make large-scale captures. See:
+
+ `http://lists.gnu.org/archive/html/gnugo-devel/2003-07/msg00209.html'
+
+ for the philosophy of this option. This option makes the engine
+ slower.
+
+ * `metamachine'. Enables the metamachine, which allows you to run
+ the engine in an experimental mode whereby it forks a new `gnugo'
+ process which acts as an "oracle." Has no effect unless combined
+ with the `--metamachine' run-time option.
+
+ Other options are not experimental, and can be changed as configure
+or runtime options.
+
+ * `chinese-rules' Use Chinese (area) counting.
+
+ * `resignation-allowed' Allow GNU Go to resign games. This is on by
+ default.
+
+
+File: gnugo.info, Node: Windows and MS-DOS, Next: Macintosh, Prev: Configure Options, Up: Installation
+
+2.3 Compiling GNU Go on Microsoft platforms
+===========================================
+
+2.3.1 Building with older visual studio
+---------------------------------------
+
+The distribution directories contain some .dsp and .dsw files with GNU
+Go. These have been brought up to date in the sense that they should
+work if you have the older VC++ with Visual Studio 6 but the
+distributed .dsp and .dsw files will only be of use with older version
+of Visual Studio.
+
+ In most cases (unless you are building in Cygwin) the preferred way
+to build GNU Go on Windows platforms is to use CMake. CMake understands
+about many versions of Visual C/Visual Studio, and will generate
+project/solution files for the tools installed on your system. So even
+if you have Visual Studio 6 you may use CMake and dispense with the
+distributed .dsp and .dsw files.
+
+2.3.2 Building with Visual Studio project files
+-----------------------------------------------
+
+Before you compile the GNU Go source, you need to run CMake first, to
+generate the build files you'll give to Visual Studio.
+
+ From the cmd.exe command prompt, CD into the GNU Go source directory.
+To confirm you're in the right place, you should see the file
+'CMakeLists.txt' in the top-level directory of the GNU Go code (as well
+as others in lower subdirectories).
+
+ Direct CMake to generate the new Visual Studio build files by typing:
+
+ cmake CMakeLists.txt
+
+ Compile the code by invoking the newly-created Solution file:
+
+ vcbuild GNUGo.sln
+
+ This will take a few moments, as CMake generates 4 debug/retail
+targets:
+
+ debug
+ release
+ minsizerel
+ relwithdebinfo
+
+ For each of these targets, Visual Studio is generating a version of
+gnugo.exe:
+
+ interface\debug\gnugo.exe
+ interface\release\gnugo.exe
+ interface\minsizerel\gnugo.exe
+ interface\relwithdebinfo\gnugo.exe
+
+ Additionally, there is an 'Install' target available, that will copy
+the the gnugo.exe into the %ProgramFiles% directory. To do this, type:
+
+ vcbuild INSTALL.vcproj
+
+ This should result in copying GNU/Go into:
+
+ "%ProgramFiles%\GNUGo\bin\gnugo.exe" --options
+
+ In addition to command line use, CMake also has a GUI version. Users
+of the Visual Studio GUI might prefer to use that.
+
+2.3.3 Building with Nmake makefiles
+-----------------------------------
+
+GNU Go will also build using NMake makefiles. Optionally, instead of
+Visual Studio project/solution files, you may direct CMake to generate
+NMake makefiles. To generate the makefiles:
+
+ cmake -G "NMake Makefiles" CMakeLists.txt
+
+ The default rule for the makefile is 'all'. Use the 'help' rule to
+show a list of available targets.
+
+ nmake -f Makefile help
+
+ To compile GNU Go:
+
+ nmake -f Makefil, all
+
+ One sysand 2009 tems, GNU GO may fail to build when using NMake
+makefiles. only fails the first time run, run NMake again with the
+'clean all' targets, and it will compile the second and subsequent
+times.
+
+ nmake -f Makefile clean all
+
+ Which will successfully generate a gnugo.exe.
+
+ interface\gnugo.exe --options
+
+2.3.4 Building with MinGW Makefiles
+-----------------------------------
+
+GNU Go can be built on Windows systems using MinGW.
+
+ This development environment uses: the GCC compiler (gcc.exe, not
+cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
+Make build tool (`mingw32-make.exe', not NMake), all from the Windows
+shell (`cmd.exe', not sh/bash).
+
+ For CMake to work, in addition to the base MinGW installation, the
+C++ compiler (g++.exe) and GNU Make (mingw32-make.exe) need to be
+installed. This was tested using GCC v3, not the experimental v4. To
+debug, use GDB, as the GCC-generated symbols won't work with
+NTSD/Windbg/Visual Studio.
+
+ To create the makfiles, run CMake with the MinGW generator option:
+
+ cmake -G "MinGW Makefiles" CMakeLists.txt
+
+ To build GNU Go, from a cmd.exe shell, run GNU Make (against the
+newly-created 'Makefile' and it's default 'all' target):
+
+ mingw32-make
+ ..\interface\gnugo.exe --options
+
+2.3.5 Building with MSYS makefiles (MinGW)
+------------------------------------------
+
+GNU Go can be built on Windows systems using MSYS.
+
+ This development environment uses: the GCC compiler (gcc.exe, not
+cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
+Make build tool (make, not NMake), all from the GNU Bash (sh.exe, not
+cmd.exe).
+
+ To create the makfiles, run CMake with the MSYS generator option:
+
+ cmake -G "MSYS Makefiles" CMakeLists.txt
+
+ Start MSYS's Bash shell, either clicking on a shortcut on from the
+command line:
+
+ cd /d c:\msys\1.0
+ msys.bat
+
+ To build GNU Go, from a Bash shell, run GNU Make (against the
+newly-created 'Makefile' and it's default 'all' target):
+
+ make
+ ../interface/gnugo.exe --options
+
+ To debug, use GDB, as the GCC-generated symbols won't work with
+NTSD/Windbg/Visual Studio.
+
+2.3.6 Building on cygwin
+------------------------
+
+With Cygwin, you should be able to
+
+ tar zxvf gnugo-3.8.tar.gz
+ cd gnugo-3.8
+ env CC='gcc -mno-cygwin' ./configure
+ make
+
+2.3.7 Testing on Windows:
+-------------------------
+
+`regression/regress.cmd' is a simplified cmd.exe-centric port of the
+main gnugo Unix shell script regress.sh. It can be used to help verify
+that the generated binary might be operational. Read the script's
+comment header for more information. For access to the full GNU Go
+tests, use Unix, not Windows.
+
+ To test:
+
+ cd regression
+ regress.cmd ..\interface\gnugo.exe
+
+
+File: gnugo.info, Node: Macintosh, Prev: Windows and MS-DOS, Up: Installation
+
+2.4 Macintosh
+=============
+
+If you have Mac OS X you can build GNU Go using Apple's compiler, which
+is derived from GCC. You will need Xcode.
+
+ One issue is that the configure test for socket support is too
+conservative. On OS/X, the configure test fails, but actually socket
+support exists. So if you want to be able to connect to the engine
+through tcp/ip (using gtp) you may `configure --enable-socket-support'.
+There will be an error message but you may build the engine and socket
+support should work.
+
+
+File: gnugo.info, Node: User Guide, Next: Overview, Prev: Installation, Up: Top
+
+3 Using GNU Go
+**************
+
+* Menu:
+
+* Documentation:: Getting Documentation
+* CGoban:: Running GNU Go with CGoban
+* Other Clients:: Other Clients
+* Ascii:: The Ascii Interface
+* Emacs:: GNU Go mode in Emacs
+* GMP and GTP:: The Go Modem Protocol and Go Text Protocol
+* Tournaments:: Computer Tournaments
+* SGF Support:: The Smart Game Format
+* Invoking GNU Go:: Command line options
+
+
+File: gnugo.info, Node: Documentation, Next: CGoban, Up: User Guide
+
+3.1 Getting Documentation
+=========================
+
+You can obtain a printed copy of the manual by running `make gnugo.pdf'
+in the `doc/'directory, then printing the resulting file. The manual
+contains a great deal of information about the algorithms of GNU Go.
+
+ On platforms supporting info documentation, you can usually install
+the manual by executing `make install' (running as root) from the
+`doc/' directory. This will create a file called `gnugo.info' (and a
+few others) and copy them into a system directory such as
+`/usr/local/share/info'. You may then add them to your info directory
+tree with the command `install-info --info-file=[path to gnugo.info]
+--info-dir=[path to dir]'. The info documentation can be read
+conveniently from within Emacs by executing the command `Control-h i'.
+
+ Documentation in `doc/' consists of a man page `gnugo.6', the info
+files `gnugo.info', `gnugo.info-1', ... and the Texinfo files from
+which the info files are built. The Texinfo documentation contains this
+User's Guide and extensive information about the algorithms of GNU Go,
+for developers.
+
+ If you want a typeset copy of the Texinfo documentation, you can
+`make gnugo.dvi', `make gnugo.ps', or `make gnugo.pdf' in the `doc/'
+directory. (`make gnugo.pdf' only works after you have converted all
+.eps-files in the doc/ directory to .pdf files, e.g. with the utility
+epstopdf.)
+
+ You can make an HTML version with the command `makeinfo --html
+gnugo.texi'. If you have `texi2html', better HTML documentation may be
+obtained by `make gnugo.html' in the `doc/' directory.
+
+ User documentation can be obtained by running `gnugo --help' or `man
+gnugo' from any terminal, or from the Texinfo documentation.
+
+ Documentation for developers is in the Texinfo documentation, and in
+comments throughout the source. Contact us at if you are
+interested in helping to develop this program.
+
+
+File: gnugo.info, Node: CGoban, Next: Other Clients, Prev: Documentation, Up: User Guide
+
+3.2 Running GNU Go via CGoban
+=============================
+
+There are two different programs called CGoban, both written by William
+Shubert. In this documentation, CGoban means CGoban 1.x, the older
+program. You should get a copy with version number 1.12 or higher.
+
+ CGoban is an extremely nice way to run GNU Go. CGoban provides a
+beautiful graphic user interface under X Window System.
+
+ Start CGoban. When the CGoban Control panel comes up, select "Go
+Modem". You will get the Go Modem Protocol Setup. Choose one (or both)
+of the players to be "Program," and fill out the box with the path to
+`gnugo'. After clicking OK, you get the Game Setup window. Choose
+"Rules Set" to be Japanese (otherwise handicaps won't work). Set the
+board size and handicap if you want.
+
+ If you want to play with a komi, you should bear in mind that the
+GMP does not have any provision for communicating the komi. Because of
+this misfeature, unless you set the komi at the command line GNU Go
+will have to guess it. It assumes the komi is 5.5 for even games, 0.5
+for handicap games. If this is not what you want, you can specify the
+komi at the command line with the `--komi' option, in the Go Modem
+Protocol Setup window. You have to set the komi again in the Game
+Setup window, which comes up next.
+
+ Click OK and you are ready to go.
+
+ In the Go Modem Protocol Setup window, when you specify the path to
+GNU Go, you can give it command line options, such as `--quiet' to
+suppress most messages. Since the Go Modem Protocol preempts standard
+I/O other messages are sent to stderr, even if they are not error
+messages. These will appear in the terminal from which you started
+CGoban.
+
+
+File: gnugo.info, Node: Other Clients, Next: Ascii, Prev: CGoban, Up: User Guide
+
+3.3 Other Clients
+=================
+
+In addition to CGoban (*note CGoban::) there are a number of other good
+clients that are capable of running GNU Go. Here are the ones that we
+are aware of that are Free Software. This list is part of a larger list
+of free Go programs that is maintained at
+`http://www.gnu.org/software/gnugo/free_go_software.html'.
+
+ * Quarry (`http://home.gna.org/quarry/') is a GPL'd client that
+ supports GTP. Works under GNU/Linux and requires GTK+ 2.x and
+ librsvg 2.5. Supports GNU Go as well as other engines. Can play
+ not only Go, but also a few other board games.
+
+ * qGo (`http://sourceforge.net/projects/qgo/') is a full featured
+ Client for playing on the servers, SGF viewing/editing, and GNU Go
+ client written in C++ for GNU/Linux, Windows and Mac OS X. Can
+ play One Color Go. Licensed GPL and QPL.
+
+ * ccGo (`http://ccdw.org/~cjj/prog/ccgo/') is a GPL'd client written
+ in C++ capable of playing with GNU Go, or on IGS.
+
+ * RubyGo (`http://rubygo.rubyforge.org/') is a GPL'd client by J.-F.
+ Menon for IGS written in the scripting language Ruby. RubyGo is
+ capable of playing with GNU Go using the GTP.
+
+ * Dingoui (`http://dingoui.sourceforge.net/') is a free GMP client
+ written in GTK+ which can run GNU Go.
+
+ * Jago (`http://www.rene-grothmann.de/jago/') is a GPL'd Java client
+ which works for both Microsoft Windows and X Window System.
+
+ * Sente Software's FreeGoban
+ (`http://www.sente.ch/software/goban/freegoban.html') is a
+ well-liked user interface for GNU Go (and potentially other
+ programs) distributed under the GPL.
+
+ * Mac GNU Go
+ (`http://www1.u-netsurf.ne.jp/~future/HTML/macgnugo.html') is a
+ front end for GNU Go 3.2 with both English and Japanese versions.
+ License is GPL.
+
+ * Quickiego (`http://www.geocities.com/secretmojo/QuickieGo/') is a
+ Mac interface to GNU Go 2.6.
+
+ * Gogui (`http://sourceforge.net/projects/gogui/') from Markus
+ Enzenberger is a Java workbench that allows you to play with a gtp
+ (`http://www.lysator.liu.se/~gunnar/gtp') engine such as GNU Go.
+ Licence is GPL. Gogui does not support gmp or play on servers but
+ is potentially very useful for programmers working on GNU Go or
+ other engines.
+
+
+File: gnugo.info, Node: Ascii, Next: Emacs, Prev: Other Clients, Up: User Guide
+
+3.4 Ascii Interface
+===================
+
+Even if you do not have any client program, you can play with GNU Go
+using its default Ascii interface. Simply type `gnugo' at the command
+line, and GNU Go will draw a board. Typing `help' will give a list of
+options. At the end of the game, pass twice, and GNU Go will prompt you
+through the counting. You and GNU Go must agree on the dead groups--you
+can toggle the status of groups to be removed, and when you are done,
+GNU Go will report the score.
+
+ You can save the game at any point using the `save FILENAME'
+command. You can reload the game from the resulting SGF file with the
+command `gnugo -l FILENAME --mode ascii'. Reloading games is not
+supported when playing with CGoban. However you can use CGoban to save
+a file, then reload it in ascii mode.
+
+ You may play games with a time limit against GNU Go in ascii mode.
+For this, the Canadian time control system is used. (See
+`http://en.wikipedia.org/wiki/Byoyomi' and
+`http://senseis.xmp.net/?CanadianByoyomi'.) That is, you have a main
+time to be followed by byo-yomi periods. After the main time is
+exhausted you have a certain number of moves to be made in a certain
+number of seconds. (*note Invoking GNU Go::)
+
+
+File: gnugo.info, Node: Emacs, Next: GMP and GTP, Prev: Ascii, Up: User Guide
+
+3.5 GNU Go mode in Emacs
+========================
+
+You can run GNU Go from Emacs. This has the advantage that you place
+the stones using the cursor arrow keys or with the mouse, and you can
+have a nice graphical display of the board within emacs.
+
+ You will need the file `interface/gnugo.el'. There is a version of
+this distributed with GNU Go but it only works with Emacs 21. Most
+Emacsen are Emacs 22 however. Therefore you should get the latest
+version of gnugo.el by Thien-Thi Nguyen, which you can find at
+`http://www.gnuvola.org/software/j/gnugo/' or
+`http://www.emacswiki.org/emacs/gnugo.el'.
+
+ You will also need some xpm files for the graphical display. You can
+either use those distributed by Thien-Thi Nguyen (at the first URL
+above) or those distributed with GNU Go, either the file
+`interface/gnugo-xpms.el' or (for high resolution displays)
+`interface/gnugo-big-xpms.el'.
+
+ Load the file `interface/gnugo.el' and `interface/gnugo-xpms.el'.
+You may do this using the Emacs `M-x load-file' command.
+
+ When you start a game with `M-x gnugo', you will first see an ascii
+board. However typing `i' toggles a graphical board display which is
+very nice. This is a pleasant way to play GNU Go. You may get help by
+typing `C-x m'.
+
+
+File: gnugo.info, Node: GMP and GTP, Next: Tournaments, Prev: Emacs, Up: User Guide
+
+3.6 The Go Modem Protocol and Go Text Protocol
+==============================================
+
+The Go Modem Protocol (GMP) was developed by Bruce Wilcox with input
+from David Fotland, Anders Kierulf and others, according to the history
+in `http://www.britgo.org/tech/gmp.html'.
+
+ Any Go program _should_ support this protocol since it is a
+standard. Since CGoban supports this protocol, the user interface for
+any Go program can be done entirely through CGoban. The programmer can
+concentrate on the real issues without worrying about drawing stones,
+resizing the board and other distracting issues.
+
+ GNU Go 3.0 introduced a new protocol, the Go Text Protocol (*note
+GTP::) which we hope can serve the functions currently used by the GMP.
+The GTP is becoming increasingly adopted by other programs as a method
+of interprocess communication, both by computer programs and by
+clients. Still the GMP is widely used in tournaments.
+
+
+File: gnugo.info, Node: Tournaments, Next: SGF Support, Prev: GMP and GTP, Up: User Guide
+
+3.7 Computer Go Tournaments
+===========================
+
+Computer Tournaments currently use the Go Modem Protocol. The current
+method followed in such tournaments is to connect the serial ports of
+the two computers by a "null modem" cable. If you are running
+GNU/Linux it is convenient to use CGoban. If your program is black,
+set it up in the Go Modem Protocol Setup window as usual. For White,
+select "Device" and set the device to `/dev/cua0' if your serial port
+is COM1 and `/dev/cua1' if the port is COM2.
+
+
+File: gnugo.info, Node: SGF Support, Next: Invoking GNU Go, Prev: Tournaments, Up: User Guide
+
+3.8 Smart Game Format
+=====================
+
+The Smart Game Format (SGF), is the standard format for storing Go
+games. GNU Go supports both reading and writing SGF files. The SGF
+specification (FF[4]) is at: `http://www.red-bean.com/sgf/'
+
+
+File: gnugo.info, Node: Invoking GNU Go, Prev: SGF Support, Up: User Guide
+
+3.9 Invoking GNU Go: Command line options
+=========================================
+
+3.9.1 Some basic options
+------------------------
+
+ * `--help', `-h'
+
+ Print a help message describing the options. This will also
+ tell you the defaults of various parameters, most importantly
+ the level and cache size. The default values of these
+ parameters can be set before compiling by `configure'. If
+ you forget the defaults you can find out using `--help'.
+
+ * `--boardsize SIZE'
+
+ Set the board size
+
+ * `--komi NUM'
+
+ Set the komi
+
+ * `--level LEVEL'
+
+ GNU Go can play with different strengths and speeds. Level 10
+ is the default. Decreasing the level will make GNU Go faster
+ but less accurate in its reading.
+
+ * `--quiet', `--silent'
+
+ Don't print copyright and other messages. Messages
+ specifically requested by other command line options, such as
+ `--trace', are not supressed.
+
+ * `-l', `--infile FILENAME'
+
+ Load the named SGF file. GNU Go will generate a move for the
+ player who is about to move. If you want to override this and
+ generate a move for the other player you may add the option
+ `--color ' where is `black' or `white'.
+
+ * `-L', `--until MOVE'
+
+ Stop loading just before the indicated move is played. MOVE
+ can be either the move number or location.
+
+ * `-o', `--outfile FILENAME'
+
+ Write sgf output to file
+
+ * `-O', `--output-flags FLAGS'
+
+ Add useful information to the sgf file. Flags can be 'd', 'v'
+ or both (i.e. 'dv'). If 'd' is specified, dead and critical
+ dragons are marked in the sgf file. If 'v' is specified, move
+ valuations around the board are indicated.
+
+ * `--mode MODE'
+
+ Force the playing mode ('ascii', 'emacs,' 'gmp' or 'gtp').
+ The default is ASCII, but if no terminal is detected GMP (Go
+ Modem Protocol) will be assumed. In practice this is usually
+ what you want, so you may never need this option.
+
+ * `--resign-allowed'
+
+ GNU Go will resign games if this option is enabled. This is
+ the default unless you build the engine with the configure
+ option `--disable-resignation-allowed'. Unfortunately the Go
+ Modem Protocol has no provision for passing a resignation, so
+ this option has no effect in GMP mode.
+
+ * `--never-resign'
+
+ GNU Go will not resign games.
+
+ * `--resign-allowed'
+
+ GNU Go will resign lost games. This is the default.
+
+3.9.2 Monte Carlo Options
+-------------------------
+
+GNU Go can play Monte Carlo Go on a 9x9 board. (Not available for
+larger boards.) It makes quite a strong engine. Here are the command
+line options.
+
+ * `--monte-carlo'
+
+ Use Monte Carlo move generation (9x9 or smaller).
+
+ * `--mc-games-per-level '
+
+ Number of Monte Carlo simulations per level. Default 8000.
+ Thus at level 10, GNU Go simulates 80,000 games in order to
+ generate a move.
+
+ * `--mc-list-patterns'
+
+ list names of builtin Monte Carlo patterns
+
+ * `--mc-patterns '
+
+ Choose a built in Monte Carlo pattern database. The argument
+ can be `mc_mogo_classic', `mc_montegnu_classic' or
+ `mc_uniform'.
+
+ * `--mc-load-patterns '
+
+ read Monte Carlo patterns from file
+
+3.9.3 Other general options
+---------------------------
+
+ * `-M', `--cache-size MEGS'
+
+ Memory in megabytes used for caching of read results. The
+ default size is 8 unless you configure gnugo with the command
+ `configure --enable-cache-size=SIZE' before compiling to make
+ SIZE the default (*note Installation::). GNU Go stores
+ results of its reading calculations in a hash table (*note
+ Hashing::). If the hash table is filled, it is emptied and
+ the reading continues, but some reading may have to be
+ repeated that was done earlier, so a larger cache size will
+ make GNU Go run faster, provided the cache is not so large
+ that swapping occurs. Swapping may be detected on GNU/Linux
+ machines using the program `top'. However, if you have ample
+ memory or if performance seems to be a problem you may want
+ to increase the size of the cache using this option.
+
+ * `--chinese-rules'
+
+ Use Chinese rules. This means that the Chinese or Area
+ Counting is followed. It may affect the score of the game by
+ one point in even games, more if there is a handicap (since
+ in Chinese Counting the handicap stones count for Black) or
+ if either player passes during the game.
+
+ * `--japanese-rules'
+
+ Use Japanese Rules. This is the default unless you specify
+ `--enable-chinese-rules' as a configure option.
+
+ * `--play-out-aftermath'
+
+ * `--capture-all-dead'
+
+ These options cause GNU Go to play out moves that are usually
+ left unplayed after the end of the game. Such moves lose
+ points under Japanese rules but not Chinese rules. With
+ `--play-out-aftermath', GNU Go may play inside its territory
+ in order to reach a position where it considers every group
+ demonstrably alive or dead. The option `--capture-all-dead'
+ causes GNU Go to play inside its own territory to remove dead
+ stones.
+
+ * `--forbid-suicide'
+
+ Do not allow suicide moves (playing a stone so that it ends
+ up without liberties and is therefore immediately removed).
+ This is the default.
+
+ * `--allow-suicide'
+
+ Allow suicide moves, except single-stone suicide. The latter
+ would not change the board at all and pass should be used
+ instead.
+
+ * `--allow-all-suicide'
+
+ Allow suicide moves, including single-stone suicide. This is
+ only interesting in exceptional cases. Normally the
+ `--allow-suicide' option should be used instead.
+
+ * `--simple-ko'
+
+ Do not allow an immediate recapture of a ko so that the
+ previous position is recreated. Repetition of earlier
+ positions than that are allowed. This is default.
+
+ * `--no-ko'
+
+ Allow all kinds of board repetition.
+
+ * `--positional-superko'
+
+ Forbid repetition of any earlier board position. This only
+ applies to moves on the board; passing is always allowed.
+
+ * `--situational-superko'
+
+ Forbid repetition of any earlier board position with the same
+ player to move. This only applies to moves on the board;
+ passing is always allowed.
+
+ * `--copyright': Display the copyright notice
+
+ * `--version' or `-v': Print the version number
+
+ * `--printsgf FILENAME':
+
+ Create an SGF file containing a diagram of the board. Useful
+ with `-l' and `-L' to create a diagram of the board from
+ another sgf file. Illegal moves are indicated with the private
+ `IL' property. This property is not used in the FF4 SGF
+ specification, so we are free to preempt it.
+
+ * `--options'
+
+ Print which experimental configure options were compiled into
+ the program (*note Other Options::).
+
+ * `--orientation N'
+
+ Combine with `-l'. The Go board can be oriented in 8 different
+ ways, counting reflections and rotations of the position;
+ this option selects an orientation (default 0). The parameter
+ `n' is an integer between 0 and 7.
+
+3.9.4 Other options affecting strength and speed
+------------------------------------------------
+
+ * `--level AMOUNT'
+
+ The higher the level, the deeper GNU Go reads. Level 10 is
+ the default. If GNU Go plays too slowly on your machine, you
+ may want to decrease it.
+
+This single parameter `--level' is the best way of choosing whether to
+play stronger or faster. It controls a host of other parameters which
+may themselves be set individually at the command line. The default
+values of these parameters may be found by running `gnugo --help'.
+
+ Unless you are working on the program you probably don't need the
+remaining options in this category. Instead, just adjust the single
+variable `--level'. The following options are of use to developers
+tuning the program for performance and accuracy. For completeness, here
+they are.
+
+ * `-D', `--depth DEPTH'
+
+ Deep reading cutoff. When reading beyond this depth (default
+ 16) GNU Go assumes that any string which can obtain 3
+ liberties is alive. Thus GNU Go can read ladders to an
+ arbitrary depth, but will miss other types of capturing moves.
+
+ * `-B', `--backfill-depth DEPTH'
+
+ Deep reading cutoff. Beyond this depth (default 12) GNU Go
+ will no longer try backfilling moves in its reading.
+
+ * `--backfill2-depth DEPTH'
+
+ Another depth controlling how deeply GNU Go looks for
+ backfilling moves. The moves tried below `backfill2_depth'
+ are generally more obscure and time intensive than those
+ controlled by `backfill_depth', so this parameter has a lower
+ default.
+
+ * `-F', `--fourlib-depth DEPTH'
+
+ Deep reading cutoff. When reading beyond this depth (default
+ 7) GNU Go assumes that any string which can obtain 4
+ liberties is alive.
+
+ * `-K', `--ko-depth DEPTH'
+
+ Deep reading cutoff. Beyond this depth (default 8) GNU Go no
+ longer tries very hard to analyze kos.
+
+ * `--branch-depth DEPTH'
+
+ This sets the `branch_depth', typically a little below the
+ `depth'. Between `branch_depth' and `depth', attacks on
+ strings with 3 liberties are considered but branching is
+ inhibited, so fewer variations are considered. Below this
+ depth (default 13), GNU Go still tries to attack strings with
+ only 3 liberties, but only tries one move at each node.
+
+ * `--break-chain-depth DEPTH'
+
+ Set the `break_chain_depth'. Beyond this depth, GNU Go
+ abandons some attempts to defend groups by trying to capture
+ part of the surrounding chain.
+
+ * `--aa-depth DEPTH'
+
+ The reading function `atari_atari' looks for combinations
+ beginning with a series of ataris, and culminating with some
+ string having an unexpected change in status (e.g. alive to
+ dead or critical). This command line optio sets the parameter
+ `aa_depth' which determines how deeply this function looks
+ for combinations.
+
+ * `--superstring-depth'
+
+ A superstring (*note Superstrings::) is an amalgamation of
+ tightly strings. Sometimes the best way to attack or defend a
+ string is by attacking or defending an element of the
+ superstring. Such tactics are tried below
+ `superstring_depth' and this command line option allows this
+ parameter to be set.
+
+ The preceeding options are documented with the reading code (*note
+Reading Basics::).
+
+ * `--owl-branch' Below this depth Owl only considers one move.
+ Default 8.
+
+ * `--owl-reading' Below this depth Owl assumes the dragon has
+ escaped. Default 20.
+
+ * `--owl-node-limit'
+
+ If the number of variations exceeds this limit, Owl assumes
+ the dragon can make life. Default 1000. We caution the user
+ that increasing `owl_node_limit' does not necessarily
+ increase the strength of the program.
+
+ * `--owl-node-limit N'
+
+ If the number of variations exceeds this limit, Owl assumes
+ the dragon can make life. Default 1000. We caution the user
+ that increasing `owl_node_limit' does not necessarily
+ increase the strength of the program.
+
+ * `--owl-distrust N'
+
+ Below this limit some owl reading is truncated.
+
+3.9.5 Ascii mode options
+------------------------
+
+ * `--color COLOR'
+
+ Choose your color ('black' or 'white').
+
+ * `--handicap NUMBER'
+
+ Choose the number of handicap stones (0-9)
+
+For more information about the following clock options see *Note
+Ascii::.
+
+ * `--clock SECONDS'
+
+ Initialize the timer.
+
+ * `--byo-time SECONDS'
+
+ Number of seconds per (Canadian) byo-yomi period
+
+ * `--byo-period STONES'
+
+ Number of stones per (Canadian) byo-yomi period
+
+3.9.6 Development options
+-------------------------
+
+ * `--replay COLOR'
+
+ Replay all moves in a game for either or both colors. If used
+ with the `-o' option the game record is annotated with move
+ values. This option requires `-l FILENAME'. The color can be:
+ * white: replay white moves only
+
+ * black: replay black moves only
+
+ * both: replay all moves
+ When the move found by genmove differs from the move in the
+ sgf file the values of both moves are reported thus:
+
+ Move 13 (white): GNU Go plays C6 (20.60) - Game move F4 (20.60)
+
+ This option is useful if one wants to confirm that a change
+ such as a speedup or other optimization has not affected the
+ behavior of the engine. Note that when several moves have the
+ same top value (or nearly equal) the move generated is not
+ deterministic (though it can be made deterministic by
+ starting with the same random seed). Thus a few deviations
+ from the move in the sgf file are to be expected. Only if the
+ two reported values differ should we conclude that the engine
+ plays differently from the engine which generated the sgf
+ file. *Note Regression::.
+
+ * `-a', `--allpats'
+
+ Test all patterns, even those smaller in value than the
+ largest move found so far. This should never affect GNU Go's
+ final move, and it will make it run slower. However this can
+ be very useful when "tuning" GNU Go. It causes both the
+ traces and the output file (`-o') to be more informative.
+
+ * `-T', `--printboard': colored display of dragons.
+
+ Use rxvt, xterm or Linux Console. (*note Colored Display::)
+
+ * `--showtime'
+
+ Print timing information to stderr.
+
+ * `-E', `--printeyes': colored display of eye spaces
+
+ Use rxvt, xterm or Linux Console. (*note Colored Display::)
+
+ * `-d', `--debug LEVEL'
+
+ Produce debugging output. The debug level is given in
+ hexadecimal, using the bits defined in the following table
+ from `engine/gnugo.h'. A list of these may be produced using
+ `--debug-flags'. Here they are in hexadecimal:
+
+ DEBUG_INFLUENCE 0x0001
+ DEBUG_EYES 0x0002
+ DEBUG_OWL 0x0004
+ DEBUG_ESCAPE 0x0008
+ DEBUG_MATCHER 0x0010
+ DEBUG_DRAGONS 0x0020
+ DEBUG_SEMEAI 0x0040
+ DEBUG_LOADSGF 0x0080
+ DEBUG_HELPER 0x0100
+ DEBUG_READING 0x0200
+ DEBUG_WORMS 0x0400
+ DEBUG_MOVE_REASONS 0x0800
+ DEBUG_OWL_PERFORMANCE 0x1000
+ DEBUG_LIFE 0x2000
+ DEBUG_FILLLIB 0x4000
+ DEBUG_READING_PERFORMANCE 0x8000
+ DEBUG_SCORING 0x010000
+ DEBUG_AFTERMATH 0x020000
+ DEBUG_ATARI_ATARI 0x040000
+ DEBUG_READING_CACHE 0x080000
+ DEBUG_TERRITORY 0x100000
+ DEBUG_OWL_PERSISTENT_CACHE 0X200000
+ DEBUG_TOP_MOVES 0x400000
+ DEBUG_MISCELLANEOUS 0x800000
+ DEBUG_ORACLE_STREAM 0x1000000
+
+ These debug flags are additive. If you want to turn on both
+ dragon and worm debugging you can use `-d0x420'.
+
+ * `--debug-flags'
+
+ Print the list of debug flags
+
+ * `-w', `--worms'
+
+ Print more information about worm data.
+
+ * `-m', `--moyo LEVEL'
+
+ moyo debugging, show moyo board. The LEVEL is fully
+ documented elsewhere (*note Influential Display::).
+
+ * `-b', `--benchmark NUMBER'
+
+ benchmarking mode - can be used with `-l'. Causes GNU Go to
+ play itself repeatedly, seeding the start of the game with a
+ few random moves. This method of testing the program is
+ largely superceded by use of the `twogtp' program.
+
+ * `-S', `--statistics'
+
+ Print statistics (for debugging purposes).
+
+ * `-t', `--trace'
+
+ Print debugging information. Use twice for more detail.
+
+ * `-r', `--seed SEED'
+
+ Set random number seed. This can be used to guarantee that
+ GNU Go will make the same decisions on multiple runs through
+ the same game. If `seed' is zero, GNU Go will play a
+ different game each time.
+
+ * `--decide-string LOCATION'
+
+ Invoke the tactical reading code (*note Tactical Reading:: to
+ decide whether the string at LOCATION can be captured, and if
+ so, whether it can be defended. If used with `-o', this will
+ produce a variation tree in SGF.
+
+ * `--decide-owl LOCATION'
+
+ Invoke the owl code (*note The Owl Code::) to decide whether
+ the dragon at LOCATION can be captured, and whether it can be
+ defended. If used with `-o', this will produce a variation
+ tree in SGF.
+
+ * `--decide-connection LOCATION1/LOCATION2'
+
+ Decide whether dragons at LOCATION1 and LOCATION2 can be
+ connected. Useful in connection with `-o' to write the
+ variations to an SGF file.
+
+ * `--decide-dragon-data LOCATION'
+
+ Print complete information about the status of the dragon at
+ LOCATION.
+
+ * `--decide-semeai LOCATION1/LOCATION2'
+
+ At LOCATION1 and LOCATION2 are adjacent dragons of the
+ opposite color. Neither is aliveby itself, and their fate
+ (alive, dead or seki) depends on the outcome of a semeai
+ (capturing race). Decide what happens. Useful in connection
+ with `-o' to write the variations to an SGF file.
+
+ * `--decide-tactical-semeai LOCATION1/LOCATION2'
+
+ Similar to `--decide-semeai', except that moves proposed by
+ the owl code are not considered.
+
+ * `--decide-position'
+
+ Try to attack and defend every dragon with dragon.escape<6. If
+ used with `-o', writes the variations to an sgf file.
+
+ * `--decide-eye LOCATION'
+
+ Evaluates the eyespace at LOCATION and prints a report. You
+ can get more information by adding `-d0x02' to the command
+ line. (*note Eye Local Game Values::.)
+
+ * `--decide-surrounded LOCATION'
+
+ A dragon is _surrounded_ if it is contained in the convex
+ hull of its unfriendly neighbor dragons. This does not mean
+ that it cannot escape, but it is often a good indicator that
+ the dragon is under attack. This option draws the convex hull
+ of the neighbor dragons and decides whether the dragon at
+ LOCATION is surrounded.
+
+ * `--decide-combination'
+
+ Calls the function `atari_atari' to decide whether there
+ exist combinations on the board.
+
+ * `--score METHOD'
+
+ Requires `-l' to specify which game to score and `-L' if you
+ want to score anywhere else than at the end of the game
+ record. METHOD can be "estimate", "finish", or "aftermath".
+ "finish" and "aftermath" are appropriate when the game is
+ complete, or nearly so, and both try to supply an accurate
+ final score. Notice that if the game is not already finished
+ it will be played out, which may take quite a long time if
+ the game is far from complete. The "estimate" method may be
+ used to get a quick estimate during the middle of the game.
+ Any of these options may be combined with `--chinese-rules'
+ if you want to use Chinese (Area) counting.
+
+ If the option `-o OUTPUTFILENAME' is provided, the result
+ will also be written as a comment in the output file. For the
+ "finish" and "aftermath" scoring algorithms, the selfplayed
+ moves completing the game are also stored.
+
+ * finish
+
+ Finish the game by selfplaying until two passes,
+ then determine the status of all stones and compute
+ territory.
+
+ * aftermath
+
+ Finish the game by selfplaying until two passes,
+ then accurately determine status of all stones by
+ playing out the "aftermath", i.e. playing on until
+ all stones except ones involved in seki have become
+ either unconditionally (in the strongest sense)
+ alive or unconditionally dead (or captured). Slower
+ than `--score finish', and while these algorithms
+ usually agree, if they differ, `--score aftermath'
+ is most likely to be correct.
+
+ * `--score aftermath --capture-all-dead --chinese-rules'
+
+ This combination mandates *Tromp-Taylor* scoring. The
+ Tromp-Taylor ruleset requires the game to be played out until
+ all dead stones are removed, then uses area (Chinese) scoring.
+ The option `--capture-all-dead' requires the aftermath code
+ to finish capturing all dead stones.
+
+3.9.7 Experimental options
+--------------------------
+
+Most of these are available as configure options and are described in
+*note Other Options::.
+
+ * `--options'
+
+ Print which experimental configure options were compiled into
+ the program.
+
+ * `--with-break-in'
+
+ * `--without-break-in'
+
+ Use or do not use the experimental break-in code. This option
+ has no effect at level 9 or below. The break in code is
+ enabled by default at level 10, and the only difference
+ between levels 9 and level 10 is that the break in code is
+ disabled at level 9.
+
+ * `--cosmic-gnugo'
+
+ Use center oriented influence.
+
+ * `--nofusekidb'
+
+ Turn off the fuseki database.
+
+ * `--nofuseki'
+
+ Turn off fuseki moves entirely
+
+ * `--nojosekidb'
+
+ Turn off the joseki database.
+
+ * `--mirror'
+
+ Try to play mirror go.
+
+ * `--mirror-limit N'
+
+ Stop mirroring when N stones are on the board.
+
+
+File: gnugo.info, Node: Overview, Next: Analyzing, Prev: User Guide, Up: Top
+
+4 GNU Go engine overview
+************************
+
+This chapter is an overview of the GNU Go internals. Further
+documentation of how any one module or routine works may be found in
+later chapters or comments in the source files.
+
+ GNU Go starts by trying to understand the current board position as
+good as possible. Using the information found in this first phase, and
+using additional move generators, a list of candidate moves is
+generated. Finally, each of the candidate moves is valued according to
+its territorial value (including captures or life-and-death effects),
+and possible strategical effects (such as strengthening a weak group).
+
+ Note that while GNU Go does, of course, do a lot of reading to
+analyze possible captures, life and death of groups etc., it does not
+(yet) have a fullboard lookahead.
+
+* Menu:
+
+* Examining the Position:: Gathering Information
+* Move Generators:: Selecting Candidate Moves
+* Move Valuation:: Selecting the best Move
+* Detailed Sequence of Events:: Outline of `genmove()'.
+* Roadmap:: Description of the different files.
+* Coding Styles:: Coding conventions.
+* Navigating the Source:: Navigating the Source.
+
+
+File: gnugo.info, Node: Examining the Position, Next: Move Generators, Up: Overview
+
+4.1 Gathering Information
+=========================
+
+This is by far the most important phase in the move generation.
+Misunderstanding life-and-death situations can cause gross mistakes.
+Wrong territory estimates will lead to inaccurate move valuations. Bad
+judgement of weaknesses of groups make strategic mistakes likely.
+
+ This information gathering is done by the function
+`examine_position()'. It first calls `make_worms()'.
+
+ Its first steps are very simple: it identifies sets of directly
+connected stones, called "worms", and notes their sizes and their
+number of liberties.
+
+ Soon after comes the most important step of the worm analysis: the
+tactical reading code (*note Tactical Reading::) is called for every
+worm. It tries to read out which worms can be captured directly, giving
+up as soon as a worm can reach 5 liberties. If a worm can be captured,
+the engine of course looks for moves defending against this capture.
+Also, a lot of effort is made to find virtually all moves that achieve
+the capture or defense of a worm.
+
+ After knowing which worms are tactically stable, we can make a first
+picture of the balance of power across the board: the *note Influence::
+code is called for the first time.
+
+ This is to aid the next step, the analysis of dragons. By a "dragon"
+we mean a group of stones that cannot be disconnected.
+
+ Naturally the first step in the responsible function `make_dragons()'
+is to identify these dragons, i.e. determine which worms cannot be
+disconnected from each other. This is partly done by patterns, but in
+most cases the specialized readconnect code is called. This module does
+a minimax search to determine whether two given worms can be connected
+with, resp. disconnected from each other.
+
+ Then we compute various measures to determine how strong or weak any
+given dragon is:
+ * A crude estimate of the number of eyes is made.
+
+ * The results of the influence computations is used to see which
+ dragons are adjacent to own territory or a moyo.
+
+ * A guess is made for the potential to escape if the dragon got
+ under attack.
+
+ For those dragons that are considered weak, a life and death analysis
+is made (*note The Owl Code::). If two dragons next to each other are
+found that are both not alive, we try to resolve this situation with
+the semeai module.
+
+ For a more detailed reference of the worm and dragon analysis (and
+explanations of the data structures used to store the information), see
+*Note Worms and Dragons::.
+
+ The influence code is then called second time to make a detailed
+analysis of likely territory. Of course, the life-and-death status of
+dragons are now taken into account.
+
+ The territorial results of the influence module get corrected by the
+break-in module. This specifically tries to analyze where an opponent
+could break into an alleged territory, with sequences that would be too
+difficult to see for the influence code.
+
+
+File: gnugo.info, Node: Move Generators, Next: Move Valuation, Prev: Examining the Position, Up: Overview
+
+4.2 Move Generators
+===================
+
+Once we have found out all about the position it is time to generate
+the best move. Moves are proposed by a number of different modules
+called "move generators". The move generators themselves do not set the
+values of the moves, but enumerate justifications for them, called
+"move reasons". The valuation of the moves comes last, after all moves
+and their reasons have been generated.
+
+ For a list and explanation of move reasons used in GNU Go, and how
+they are evaluated, see *Note Move Generation::.
+
+ There are a couple of move generators that only extract data found in
+the previous phase, examining the position:
+
+ * `worm_reasons()'
+
+ Moves that have been found to capture or defend a worm are
+ proposed as candidates.
+
+ * `owl_reasons()'
+
+ The status of every dragon, as it has been determined by the
+ owl code (*note The Owl Code::) in the previous phase, is
+ reviewed. If the status is critical, the killing or defending
+ move gets a corresponding move reason.
+
+ * `semeai_move_reasons()'
+
+ Similarly as `owl_reasons', this function proposes moves
+ relevant for semeais.
+
+ * `break_in_move_reasons()'
+
+ This suggests moves that have been found to break into
+ opponent's territory by the break-in module.
+
+ The following move generators do additional work:
+
+ * `fuseki()'
+
+ Generate a move in the early fuseki, either in an empty
+ corner of from the fuseki database.
+
+ * `shapes()'
+
+ This is probably the most important move generator. It finds
+ patterns from `patterns/patterns.db',
+ `patterns/patterns2.db', `patterns/fuseki.db', and the joseki
+ files in the current position. Each pattern is matched in
+ each of the 8 possible orientations obtainable by rotation and
+ reflection. If the pattern matches, a so called "constraint"
+ may be tested which makes use of reading to determine if the
+ pattern should be used in the current situation. Such
+ constraints can make demands on number of liberties of
+ strings, life and death status, and reading out ladders, etc.
+ The patterns may call helper functions, which may be hand
+ coded (in `patterns/helpers.c') or autogenerated.
+
+ The patterns can be of a number of different classes with
+ different goals. There are e.g. patterns which try to attack
+ or defend groups, patterns which try to connect or cut
+ groups, and patterns which simply try to make good shape. (In
+ addition to the large pattern database called by `shapes()',
+ pattern matching is used by other modules for different tasks
+ throughout the program. *Note Patterns::, for a complete
+ documentation of patterns.)
+
+ * `combinations()'
+
+ See if there are any combination threats or atari sequences
+ and either propose them or defend against them.
+
+ * `revise_thrashing_dragon()'
+
+ This module does not directly propose move: If we are clearly
+ ahead, and the last move played by the opponent is part of a
+ dead dragon, we want to attack that dragon again to be on the
+ safe side. This is done be setting the status of this
+ "thrashing dragon" to unkown and repeating the shape move
+ generation and move valution.
+
+ * `endgame_shapes()'
+
+ If no move is found with a value greater than 6.0, this
+ module matches a set of extra patterns which are designed for
+ the endgame. The endgame patterns can be found in
+ `patterns/endgame.db'.
+
+ * `revise_semeai()'
+
+ If no move is found, this module changes the status of
+ opponent groups involved in a semeai from `DEAD' to
+ `UNKNOWN'. After this, genmove runs `shapes' and
+ `endgame_shapes' again to see if a new move turns up.
+
+ * `fill_liberty()'
+
+ Fill a common liberty. This is only used at the end of the
+ game. If necessary a backfilling or backcapturing move is
+ generated.
+
+
+File: gnugo.info, Node: Move Valuation, Next: Detailed Sequence of Events, Prev: Move Generators, Up: Overview
+
+4.3 Move Valuation
+==================
+
+After the move generation modules have run, each proposed candidate
+move goes through a detailed valuation by the function
+`review_move_reasons'. This invokes some analysis to try to turn up
+other move reasons that may have been missed.
+
+ The most important value of a move is its territorial effect. *note
+Influence and Territory:: explains in detail how this is determined.
+
+ This value is modified for all move reasons that cannot be expressed
+directly in terms of territory, such as combination attacks (where it
+is not clear which of several strings will get captured), strategical
+effects, connection moves, etc. A large set heuristics is necessary
+here, e.g. to avoid duplication of such values. This is explained in
+more detail in *note Valuation::.
+
+
+File: gnugo.info, Node: Detailed Sequence of Events, Next: Roadmap, Prev: Move Valuation, Up: Overview
+
+4.4 Detailed Sequence of Events
+===============================
+
+First comes the sequence of events when `examine_position()' is run
+from `genmove()'. This is for reference only.
+
+`purge_persistent_caches()'
+`make_worms()':
+ `compute_effective_sizes()'
+ `compute_unconditional_status()'
+ `find_worm_attacks_and_defenses()':
+ for each attackable worm:
+ set `worm.attack'
+ `change_attack()' to add the attack point
+ `find_attack_patterns()' to find a few more attacks
+ for each defensible worm:
+ set `worm.attack'
+ `change_defense()' to add the defense point
+ `find_defense_patterns()' to find a few more defense moves
+ find additional attacks and defenses by testing all
+ immediate liberties
+ find higher order liberties (for each worm)
+ find cutting stones (for each worm)
+ improve attacks and defenses: if capturing a string defends
+ another friendly string, or kills an unfriendly one, we
+ add points of defense or attack. Make repairs if adjacent
+ strings can both be attacked but not defended.
+ find worm lunches
+ find worm threats
+ identify inessential worms (such as nakade stones)
+`compute_worm_influence()':
+ `find_influence_patterns()'
+ `value_influence()'
+ `segment_influence()'
+`make_dragons()':
+ `find_cuts()'
+ `find_connections()'
+ `make_domains()' (determine eyeshapes)
+ `find_lunches()' (adjacent strings that can be captured)
+ `find_half_and_false_eyes()'
+ `eye_computations()': Compute the value of each eye space.
+ Store its attack and defense point.
+ `analyze_false_eye_territory()'
+ for each dragon `compute_dragon_genus()'
+ for each dragon `compute_escape()' and set escape route data
+ `resegment_initial_influence()'
+ `compute_refined_dragon_weaknesses()' (called again after owl)
+ for each dragon `compute_crude_status()'
+ `find_neighbor_dragons()'
+ for each dragon compute surround status
+ for each weak dragon run `owl_attack()' and `owl_defend()'
+ to determine points of attack and defense
+ for each dragon compute dragon.status
+ for each thrashing dragon compute owl threats
+ for each dragon compute dragon.safety
+ `revise_inessentiality()'
+ `semeai()':
+ for every semeai, run `owl_analyze_semeai()'
+ `find_moves_to_make_seki()'
+ `identify_thrashing_dragons()'
+ `compute_dragon_influence()':
+ `compute_influence()'
+ `break_territories()' (*note Break Ins::)
+ `compute_refined_dragon_weaknesses()'
+
+ Now a summary of the sequence of events during the move generation
+and selection phases of `genmove()', which take place after the
+information gathering phase has been completed:
+
+`estimate_score()'
+`choose_strategy()'
+`collect_move_reasons()':
+ `worm_reasons()': for each attack and defense point add a move reason
+ `semeai_reasons()': for each dragon2.semeai point add a move reason
+ `owl_reasons()': for each owl attack and defense point add a move reason
+ `break_in_reasons()': for each breakin found add a move reason
+`fuseki()'
+`break_mirror_go()'
+`shapes()': match patterns around the board (*note Patterns Overview::)
+`combinations()': look for moves with a double meaning and other tricks
+ `find_double_threats()'
+ `atari_atari()'
+`review_move_reasons()'
+if ahead and there is a thrashing dragon, consider it
+ alive and reconsider the position
+`endgame_shapes()'
+`endgame()'
+if no move found yet, revisit any semeai, change status of dead opponent
+ to alive, then run `shapes()' and `endgame_shapes()' again
+if no move found yet, run `fill_liberty()'
+
+
+File: gnugo.info, Node: Roadmap, Next: Coding Styles, Prev: Detailed Sequence of Events, Up: Overview
+
+4.5 Roadmap
+===========
+
+The GNU Go engine is contained in two directories, `engine/' and
+`patterns/'. Code related to the user interface, reading and writing of
+Smart Game Format files, and testing are found in the directories
+`interface/', `sgf/', and `regression/'. Code borrowed from other GNU
+programs is contained in `utils/'. That directory also includes some
+code developed within GNU Go which is not go specific. Documentation is
+in `doc/'.
+
+ In this document we will describe some of the individual files
+comprising the engine code in `engine/' and `patterns/'. In `interface/'
+we mention two files:
+
+ * `gmp.c'
+
+ This is the Go Modem Protocol interface (courtesy of William
+ Shubert and others). This takes care of all the details of
+ exchanging setup and moves with Cgoban, or any other driving
+ program recognizing the Go Modem Protocol.
+
+ * `main.c'
+
+ This contains `main()'. The `gnugo' target is thus built in
+ the `interface/' directory.
+
+4.5.1 Files in `engine/'
+------------------------
+
+In `engine/' there are the following files:
+
+ * `aftermath.c'
+
+ Contains algorithms which may be called at the end of the
+ game to generate moves that will generate moves to settle the
+ position, if necessary playing out a position to determine
+ exactly the status of every group on the board, which GNU Go
+ can get wrong, particularly if there is a seki. This module is
+ the basis for the most accurate scoring algorithm available
+ in GNU Go.
+
+ * `board.c'
+
+ This file contains code for the maintenance of the board.
+ For example it contains the important function `trymove()'
+ which tries a move on the board, and `popgo()' which removes
+ it by popping the move stack. At the same time vital
+ information such as the number of liberties for each string
+ and their location is updated incrementally.
+
+ * `breakin.c'
+
+ Code to detect moves which can break into supposed territory
+ and moves to prevent this.
+
+ * `cache.c' and `cache.h'
+
+ As a means of speeding up reading, computed results are
+ cached so that they can be quickly reused if the same
+ position is encountered through e.g. another move ordering.
+ This is implemented using a hash table.
+
+ * `clock.c' and `clock.h'
+
+ Clock code, including code allowing GNU Go to automatically
+ adjust its level in order to avoid losing on time in
+ tournaments.
+
+ * `combination.c'
+
+ When something can (only) be captured through a series of
+ ataris or other threats we call this a combination attack.
+ This file contains code to find such attacks and moves to
+ prevent them.
+
+ * `dragon.c'
+
+ This contains `make_dragons()'. This function is executed
+ before the move-generating modules `shapes()' `semeai()' and
+ the other move generators but after `make_worms()'. It tries
+ to connect worms into dragons and collect important
+ information about them, such as how many liberties each has,
+ whether (in GNU Go's opinion) the dragon can be captured, if
+ it lives, etc.
+
+ * `endgame.c'
+
+ Code to find certain types of endgame moves.
+
+ * `filllib.c'
+
+ Code to force filling of dame (backfilling if necessary) at
+ the end of the game.
+
+ * `fuseki.c'
+
+ Generates fuseki (opening) moves from a database. Also
+ generates moves in empty corners.
+
+ * `genmove.c'
+
+ This file contains `genmove()' and its supporting routines,
+ particularly `examine_position()'.
+
+ * `globals.c'
+
+ This contains the principal global variables used by GNU Go.
+
+ * `gnugo.h'
+
+ This file contains declarations forming the public interface
+ to the engine.
+
+ * `hash.c' and `hash.h'
+
+ Hashing code implementing Zobrist hashing. (*note Hashing::)
+ The code in `hash.c' provides a way to hash board positions
+ into compact descriptions which can be efficiently compared.
+ The caching code in `cache.c' makes use of the board hashes
+ when storing and retrieving read results.
+
+ * `influence.c' and `influence.h'.
+
+ This code determines which regions of the board are under the
+ influence of either player. (*note Influence::)
+
+ * `liberty.h'
+
+ Header file for the engine. The name "liberty" connotes
+ freedom (*note Copying::).
+
+ * `matchpat.c'
+
+ This file contains the pattern matcher `matchpat()', which
+ looks for patterns at a particular board location. The actual
+ patterns are in the `patterns/' directory. The function
+ `matchpat()' is called by every module which does pattern
+ matching, notably `shapes'.
+
+ * `move_reasons.c' and `move_reasons.h'
+
+ Code for keeping track of move reasons.
+
+ * `movelist.c'
+
+ Supporting code for lists of moves.
+
+ * `optics.c'
+
+ This file contains the code to recognize eye shapes,
+ documented in *Note Eyes::.
+
+ * `oracle.c'
+
+ Code to fork off a second GNU Go process which can be used to
+ simulate reading with top level information (e.g. dragon
+ partitioning) available.
+
+ * `owl.c'
+
+ This file does life and death reading. Move generation is
+ pattern based and the code in `optics.c' is used to evaluate
+ the eyespaces for vital moves and independent life. A dragon
+ can also live by successfully escaping. Semeai reading along
+ the same principles is also implemented in this file.
+
+ * `persistent.c'
+
+ Persistent cache which allows reuse of read results at a
+ later move or with additional stones outside an active area,
+ which are those intersections thought to affect the read
+ result.
+
+ * `printutils.c'
+
+ Print utilities.
+
+ * `readconnect.c' and `readconnect.h'
+
+ This file contains code to determine whether two strings can
+ be connected or disconnected.
+
+ * `reading.c'
+
+ This file contains code to determine whether any given string
+ can be attacked or defended. *Note Tactical Reading::, for
+ details.
+
+ * `semeai.c'
+
+ This file contains `semeai()', the module which detects
+ dragons in semeai. To determine the semeai results the semeai
+ reading in `owl.c' is used.
+
+ * `sgfdecide.c'
+
+ Code to generate sgf traces for various types of reading.
+
+ * `shapes.c'
+
+ This file contains `shapes()', the module called by
+ `genmove()' which tries to find moves which match a pattern
+ (*note Patterns::).
+
+ * `showbord.c'
+
+ This file contains `showboard()', which draws an ASCII
+ representation of the board, depicting dragons (stones with
+ same letter) and status (color). This was the primary
+ interface in GNU Go 1.2, but is now a debugging aid.
+
+ * `surround.c'
+
+ Code to determine whether a dragon is surrounded and to find
+ moves to surround with or break out with.
+
+ * `utils.c'
+
+ An assortment of utilities, described in greater detail below.
+
+ * `value_moves.c'
+
+ This file contains the code which assigns values to every move
+ after all the move reasons are generated. It also tries to
+ generate certain kinds of additional move reasons.
+
+ * `worm.c'
+
+ This file contains `make_worms()', code which is run at the
+ beginning of each move cycle, before the code in `dragon.c',
+ to determine the attributes of every string. These attributes
+ are things like liberties, wether the string can be captured
+ (and how), etc
+
+4.5.2 Files in `patterns/'
+--------------------------
+
+The directory `patterns/' contains files related to pattern matching.
+Currently there are several types of patterns. A partial list:
+
+ * move generation patterns in `patterns.db' and `patterns2.db'
+
+ * move generation patterns in files `hoshi.db' etc. which are
+ automatically build from the files `hoshi.sgf' etc. These comprise
+ our small Joseki library.
+
+ * patterns in `owl_attackpats.db', `owl_defendpats.db' and
+ `owl_vital_apats.db'. These generate moves for the owl code (*note
+ The Owl Code::).
+
+ * Connection patterns in `conn.db' (*note Connections Database::)
+
+ * Influence patterns in `influence.db' and `barriers.db' (*note
+ Influence::)
+
+ * eye patterns in `eyes.db' (*note Eyes::).
+
+ The following list contains, in addition to distributed source files
+some intermediate automatically generated files such as `patterns.c'.
+These are C source files produced by "compiling" various pattern
+databases, or in some cases (such as `hoshi.db') themselves
+automatically generated pattern databases produced by "compiling"
+joseki files in Smart Game Format.
+
+ * `conn.db'
+
+ Database of connection patterns.
+
+ * `conn.c'
+
+ Automatically generated file, containing connection patterns
+ in form of struct arrays, compiled by `mkpat' from `conn.db'.
+
+ * `eyes.c'
+
+ Automatically generated file, containing eyeshape patterns in
+ form of struct arrays, compiled by `mkpat' from `eyes.db'.
+
+ * `eyes.h'
+
+ Header file for `eyes.c'.
+
+ * `eyes.db'
+
+ Database of eyeshape patterns. *Note Eyes::, for details.
+
+ * `helpers.c'
+
+ These are helper functions to assist in evaluating moves by
+ matchpat.
+
+ * `hoshi.sgf'
+
+ Smart Game Format file containing 4-4 point openings
+
+ * `hoshi.db'
+
+ Automatically generated database of 4-4 point opening
+ patterns, make by compiling `hoshi.sgf'
+
+ * `joseki.c'
+
+ Joseki compiler, which takes a joseki file in Smart Game
+ Format, and produces a pattern database.
+
+ * `komoku.sgf'
+
+ Smart Game Format file containing 3-4 point openings
+
+ * `komoku.db'
+
+ Automatically generated database of 3-4 point opening
+ patterns, make by compiling `komoku.sgf'
+
+ * `mkeyes.c'
+
+ Pattern compiler for the eyeshape databases. This program
+ takes `eyes.db' as input and produces `eyes.c' as output.
+
+ * `mkpat.c'
+
+ Pattern compiler for the move generation and connection
+ databases. Takes the file `patterns.db' together with the
+ autogenerated Joseki pattern files `hoshi.db', `komoku.db',
+ `sansan.db', `mokuhadzushi.db', `takamoku.db' and produces
+ `patterns.c', or takes `conn.db' and produces `conn.c'.
+
+ * `mokuhazushi.sgf'
+
+ Smart Game Format file containing 5-3 point openings
+
+ * `mokuhazushi.db'
+
+ Pattern database compiled from mokuhadzushi.sgf
+
+ * `sansan.sgf'
+
+ Smart Game Format file containing 3-3 point openings
+
+ * `sansan.db'
+
+ Pattern database compiled from `sansan.sgf'
+
+ * `takamoku.sgf'
+
+ Smart Game Format file containing 5-4 point openings
+
+ * `takamoku.db'
+
+ Pattern database compiled from takamoku.sgf.
+
+ * `patterns.c'
+
+ Pattern data, compiled from patterns.db by mkpat.
+
+ * `patterns.h'
+
+ Header file relating to the pattern databases.
+
+ * `patterns.db' and `patterns2.db'
+
+ These contain pattern databases in human readable form.
+
+
+
+File: gnugo.info, Node: Coding Styles, Next: Navigating the Source, Prev: Roadmap, Up: Overview
+
+4.6 Coding styles and conventions
+=================================
+
+4.6.1 Coding Conventions
+------------------------
+
+Please follow the coding conventions at:
+`http://www.gnu.org/prep/standards_toc.html'
+
+ Please preface every function with a brief description of its usage.
+
+ Please help to keep this Texinfo documentation up-to-date.
+
+4.6.2 Tracing
+-------------
+
+A function `gprintf()' is provided. It is a cut-down `printf',
+supporting only `%c', `%d', `%s', and without field widths, etc. It
+does, however, add some useful facilities:
+
+ * `%m'
+
+ Takes two parameters, and displays a formatted board
+ co-ordinate.
+
+ * indentation
+
+ Trace messages are automatically indented to reflect the
+ current stack depth, so it is clear during read-ahead when it
+ puts a move down or takes one back.
+
+ * "outdent"
+
+ As a workaround, `%o' at the beginning of the: format string
+ suppresses the indentation.
+
+ Normally `gprintf()' is wrapped in one of the following:
+
+ `TRACE(fmt, ...)':
+
+ Print the message if the 'verbose' variable > 0. (verbose is set
+ by `-t' on the command line)
+
+ `DEBUG(flags, fmt, ...)':
+
+ While `TRACE' is intended to afford an overview of what GNU Go is
+ considering, `DEBUG' allows occasional in depth study of a module,
+ usually needed when something goes wrong. `flags' is one of the
+ `DEBUG_*' symbols in `engine/gnugo.h'. The `DEBUG' macro tests to
+ see if that bit is set in the `debug' variable, and prints the
+ message if it is. The debug variable is set using the `-d'
+ command-line option.
+
+ The variable `verbose' controls the tracing. It can equal 0 (no
+trace), 1, 2, 3 or 4 for increasing levels of tracing. You can set the
+trace level at the command line by `-t' for `verbose=1', `-t -t' for
+`verbose=2', etc. But in practice if you want more verbose tracing than
+level 1 it is better to use GDB to reach the point where you want the
+tracing; you will often find that the variable `verbose' has been
+temporarily set to zero and you can use the GDB command `set var
+verbose=1' to turn the tracing back on.
+
+4.6.3 Assertions
+----------------
+
+Related to tracing are assertions. Developers are strongly encouraged
+to pepper their code with assertions to ensure that data structures are
+as they expect. For example, the helper functions make assertions about
+the contents of the board in the vicinity of the move they are
+evaluating.
+
+ `ASSERT()' is a wrapper around the standard C `assert()' function.
+In addition to the test, it takes an extra pair of parameters which are
+the co-ordinates of a "relevant" board position. If an assertion fails,
+the board position is included in the trace output, and `showboard()'
+and `popgo()' are called to unwind and display the stack.
+
+4.6.4 FIXME
+-----------
+
+We have adopted the convention of putting the word FIXME in comments to
+denote known bugs, etc.
+
+
+File: gnugo.info, Node: Navigating the Source, Prev: Coding Styles, Up: Overview
+
+4.7 Navigating the Source
+=========================
+
+If you are using Emacs, you may find it fast and convenient to use
+Emacs' built-in facility for navigating the source. Switch to the root
+directory `gnugo-3.6/' and execute the command:
+
+ find . -print|grep "\.[ch]$" | xargs etags
+
+ This will build a file called `gnugo-3.6/TAGS'. Now to find any GNU
+Go function, type `M-.' and enter the command which you wish to find,
+or just `RET' if the cursor is at the name of the function sought.
+
+ The first time you do this you will be prompted for the location of
+the TAGS table. Enter the path to `gnugo-3.6/TAGS', and henceforth you
+will be able to find any function with a minimum of keystrokes.
+
+
+File: gnugo.info, Node: Analyzing, Next: Move Generation, Prev: Overview, Up: Top
+
+5 Analyzing GNU Go's moves
+**************************
+
+In this chapter we will discuss methods of finding out how GNU Go
+understands a given position. These methods will be of interest to
+anyone working on the program, or simply curious about its workings.
+
+ In practice, most tuning of GNU Go is done in conjunction with
+maintaining the `regression/' directory (*note Regression::).
+
+ We assume that you have a game GNU Go played saved as an sgf file,
+and you want to know why it made a certain move.
+
+* Menu:
+
+* Traces:: Analyzing traces in GNU Go 3.6
+* Output File:: The Output File
+* Decide string:: Checking the reading code
+* Decide dragon:: Checking the owl code
+* GTP and GDB techniques:: GTP and GDB techniques
+* view.pike:: Debugging on a Graphic Board
+* Scoring:: Finding out the winner of the game
+* Colored Display:: Colored Display
+
+
+File: gnugo.info, Node: Traces, Next: Output File, Up: Analyzing
+
+5.1 Interpreting Traces
+=======================
+
+A quick way to find out roughly the reason for a move is to run
+
+ gnugo -l FILENAME -t -L MOVE NUMBER
+
+ (You may also want to add `--quiet' to suppress the copyright
+message.) In GNU Go 3.6, the moves together with their reasons are
+listed, followed by a numerical analysis of the values given to each
+move.
+
+ If you are tuning (*note Tuning::) you may want to add the `-a'
+option. This causes GNU Go to report all patterns matched, even ones
+that cannot affect the outcome of the move. The reasons for doing this
+is that you may want to modify a pattern already matched instead of
+introducing a new one.
+
+ If you use the `-w' option, GNU Go will report the statuses of worms
+and dragons around the board. This type of information is available by
+different methods, however (*note view.pike::, *note Colored Display::).
+
+
+File: gnugo.info, Node: Output File, Next: Decide string, Prev: Traces, Up: Analyzing
+
+5.2 The Output File
+===================
+
+If GNU Go is invoked with the option `-o filename' it will produce an
+output file. This option can be added at the command line in the Go
+Modem Protocol Setup Window of CGoban. The output file will show the
+locations of the moves considered and their weights. It is worth noting
+that by enlarging the CGoban window to its fullest size it can display
+3 digit numbers. Dragons with status `DEAD' are labelled with an `X',
+and dragons with status `CRITICAL' are labelled with a `!'.
+
+ If you have a game file which is not commented this way, or which
+was produced by a non-current version of GNU Go you may ask GNU Go to
+produce a commented version by running:
+
+ gnugo --quiet -l --replay -o
+
+Here can be 'black,' 'white' or 'both'. The replay option will
+also help you to find out if your current version of GNU Go would play
+differently than the program that created the file.
+
+
+File: gnugo.info, Node: Decide string, Next: Decide dragon, Prev: Output File, Up: Analyzing
+
+5.3 Checking the reading code
+=============================
+
+The `--decide-string' option is used to check the tactical reading code
+(*note Tactical Reading::). This option takes an argument, which is a
+location on the board in the usual algebraic notation (e.g.
+`--decide-string C17'). This will tell you whether the reading code (in
+`engine/reading.c') believes the string can be captured, and if so,
+whether it believes it can be defended, which moves it finds to attack
+or defend the move, how many nodes it searched in coming to these
+conclusions. Note that when GNU Go runs normally (not with
+`--decide-string') the points of attack and defense are computed when
+`make_worms()' runs and cached in `worm.attack' and `worm.defend'.
+
+ If used with an output file (`-o FILENAME') `--decide-string' will
+produce a variation tree showing all the variations which are
+considered. This is a useful way of debugging the reading code, and
+also of educating yourself with the way it works. The variation tree
+can be displayed graphically using CGoban.
+
+ At each node, the comment contains some information. For example you
+may find a comment:
+
+
+ attack4-B at D12 (variation 6, hash 51180fdf)
+ break_chain D12: 0
+ defend3 D12: 1 G12 (trivial extension)
+
+ This is to be interpreted as follows. The node in question was
+generated by the function `attack3()' in `engine/reading.c', which was
+called on the string at `D12'. The data in parentheses tell you the
+values of `count_variations' and `hashdata.hashval'.
+
+ The second value ("hash") you probably will not need to know unless
+you are debugging the hash code, and we will not discuss it. But the
+first value ("variation") is useful when using the debugger `gdb'. You
+can first make an output file using the `-o' option, then walk through
+the reading with `gdb', and to coordinate the SGF file with the
+debugger, display the value of `count_variations'. Specifically, from
+the debugger you can find out where you are as follows:
+
+ (gdb) set dump_stack()
+ B:D13 W:E12 B:E13 W:F12 B:F11 (variation 6)
+
+ If you place yourself right after the call to `trymove()' which
+generated the move in question, then the variation number in the SGF
+file should match the variation number displayed by `dump_stack()', and
+the move in question will be the last move played (F11 in this example).
+
+ This displays the sequence of moves leading up to the variation in
+question, and it also prints `count_variations-1'.
+
+ The second two lines tell you that from this node, the function
+`break_chain()' was called at D12 and returned 0 meaning that no way
+was found of rescuing the string by attacking an element of the
+surrounding chain, and the function `defend3()' was called also at D12
+and returned 1, meaning that the string can be defended, and that G12
+is the move that defends it. If you have trouble finding the function
+calls which generate these comments, try setting `sgf_dumptree=1' and
+setting a breakpoint in `sgf_trace'.
+
+
+File: gnugo.info, Node: Decide dragon, Next: GTP and GDB techniques, Prev: Decide string, Up: Analyzing
+
+5.4 Checking the Owl Code
+=========================
+
+You can similarly debug the Owl code using the option
+`--decide-dragon'. Usage is entirely similar to `--decide-string', and
+it can be used similarly to produce variation trees. These should be
+typically much smaller than the variation trees produced by
+`--decide-string'.
+
+
+File: gnugo.info, Node: GTP and GDB techniques, Next: view.pike, Prev: Decide dragon, Up: Analyzing
+
+5.5 GTP and GDB techniques
+==========================
+
+You can use the Go Text Protocol (*note GTP::) to determine the
+statuses of dragons and other information needed for debugging. The GTP
+command `dragon_data P12' will list the dragon data of the dragon at
+`P12' and `worm_data' will list the worm data; other GTP commands may
+be useful as well.
+
+ You can also conveniently get such information from GDB. A
+suggested `.gdbinit' file may be found in *Note Debugging::. Assuming
+this file is loaded, you can list the dragon data with the command:
+
+ (gdb) dragon P12
+
+ Similarly you can get the worm data with `worm P12'.
+
+
+File: gnugo.info, Node: view.pike, Next: Scoring, Prev: GTP and GDB techniques, Up: Analyzing
+
+5.6 Debugging on a Graphical Board
+==================================
+
+The quickest way to analyze most positions is to use the tool
+`view.pike' in the `regression' directory. It can be started with a
+testcase specified, e.g. `pike view.pike strategy:40' or at a move in
+an sgf file, e.g. `pike view.pike mistake.sgf:125'. When started it
+shows the position on a grapical board on which it also marks
+information like move values, dragon status, and so on. By clicking on
+the board further information about the valuation of moves, contents of
+various data structures, and other data can be made available.
+
+ Specific information on how to use `view.pike' for influence tuning
+can be found in *Note Influence Tuning::.
+
+
+File: gnugo.info, Node: Scoring, Next: Colored Display, Prev: view.pike, Up: Analyzing
+
+5.7 Scoring the game
+====================
+
+GNU Go can score the game. Normally GNU Go will report its opinion about
+the score at the end of the game, but if you want this information about
+a game stored in a file, use the `--score' option (*note Invoking GNU
+Go::).
+
+
+File: gnugo.info, Node: Colored Display, Prev: Scoring, Up: Analyzing
+
+5.8 Colored Display
+===================
+
+Various colored displays of the board may be obtained in a color
+`xterm' or `rxvt' window. Xterm will only work if xterm is compiled
+with color support. If the colors are not displayed on your xterm, try
+`rxvt'. You may also use the Linux console. The colored display will
+work best if the background color is black; if this is not the case you
+may want to edit your `.Xdefaults' file or add the options `-bg black
+-fg white' to `xterm' or `rxvt'. On Mac OS X put `setenv TERM
+xterm-color' in your `.tcshrc' file to enable color in the terminal.
+
+5.8.1 Dragon Display
+--------------------
+
+You can get a colored ASCII display of the board in which each dragon
+is assigned a different letter; and the different `matcher_status'
+values (`ALIVE', `DEAD', `UNKNOWN', `CRITICAL') have different colors.
+This is very handy for debugging. Actually two diagrams are generated.
+The reason for this is concerns the way the matcher status is computed.
+The dragon_status (*note Dragons::) is computed first, then for some,
+but not all dragons, a more accurate owl status is computed. The
+matcher status is the owl status if available; otherwise it is the
+dragon_status. Both the dragon_status and the owl_status are displayed.
+The color scheme is as follows:
+
+ green = alive
+ cyan = dead
+ red = critical
+ yellow = unknown
+ magenta = unchecked
+
+ To get the colored display, save a game in sgf format using CGoban,
+or using the `-o' option with GNU Go itself.
+
+ Open an `xterm' or `rxvt' window.
+
+ Execute `gnugo -l [filename] -L [movenum] -T' to get the colored
+display.
+
+ Other useful colored displays may be obtained by using instead:
+
+5.8.2 Eye Space Display
+-----------------------
+
+Instead of `-T', try this with `-E'. This gives a colored display of
+the eyespaces, with marginal eye spaces marked `!' (*note Eyes::).
+
+
+File: gnugo.info, Node: Move Generation, Next: Worms and Dragons, Prev: Analyzing, Up: Top
+
+6 Move generation
+*****************
+
+* Menu:
+
+* Move generation Intro:: Introduction.
+* Move Reasons:: Generation of move reasons.
+* Move Reason Details:: Detailed Descriptions of Move Reasons
+* Valuation:: Valuating the moves
+* End Game:: Endgame move generation
+
+
+File: gnugo.info, Node: Move generation Intro, Next: Move Reasons, Up: Move Generation
+
+6.1 Introduction
+================
+
+GNU Go 3.0 introduced a move generation scheme substantially different
+from earlier versions. In particular, it was different from the method
+of move generation in GNU Go 2.6.
+
+ In the old scheme, various move generators suggested different moves
+with attached values. The highest such value then decided the move.
+There were two important drawbacks with this scheme:
+
+ * Efficient multipurpose moves could only be found by patterns which
+ explicitly looked for certain combinations, such as a simultaneous
+ connection and cut. There was also no good way to e.g. choose among
+ several attacking moves.
+
+ * The absolute move values were increasingly becoming harder to tune
+ with the increasing number of patterns. They were also fairly
+ subjective and the tuning could easily break in unexpected ways
+ when something changed, e.g. the worm valuation.
+
+ The basic idea of the new move generation scheme is that the various
+move generators suggest reasons for moves, e.g. that a move captures
+something or connects two strings, and so on. When all reasons for the
+different moves have been found, the valuation starts. The primary
+advantages are
+
+ * The move reasons are objective, in contrast to the move values in
+ the old scheme. Anyone can verify whether a suggested move reason
+ is correct.
+
+ * The centralized move valuation makes tuning easier. It also allows
+ for style dependent tuning, e.g. how much to value influence
+ compared to territory. Another possibility is to increase the value
+ of safe moves in a winning position.
+
+
+File: gnugo.info, Node: Move Reasons, Next: Move Reason Details, Prev: Move generation Intro, Up: Move Generation
+
+6.2 Generation of move reasons
+==============================
+
+Each move generator suggests a number of moves. It justifies each move
+suggestion with one or move "move reasons". These move reasons are
+collected at each intersection where the moves are suggested for later
+valuation. Here is a partial list of of move reasons considered by GNU
+Go. (The complete list may be found in `move_reasons.h'.)
+
+`ATTACK_MOVE'
+`DEFEND_MOVE'
+ Attack or defend a worm.
+
+`ATTACK_THREAT_MOVE'
+`DEFEND_THREAT_MOVE'
+ Threaten to attack or defend a worm.
+
+`EITHER_MOVE'
+ A move that either achieves one goal or another (at the moment
+ this only used for attacks on worms).
+
+`ALL_MOVE'
+ At the moment this is used for a move that defends two worms
+ threatened by a double attack.
+
+`CONNECT_MOVE'
+`CUT_MOVE'
+ Connect or cut two worms.
+
+`ANTISUJI_MOVE'
+ Declare an antisuji or forbidden move.
+
+`SEMEAI_MOVE'
+`SEMEAI_THREAT'
+ Win or threaten to win a semeai.
+
+`EXPAND_TERRITORY_MOVE'
+
+`EXPAND_MOYO_MOVE'
+ Move expanding our territory/moyo. These reasons are at the moment
+ treated identically.
+
+`VITAL_EYE_MOVE'
+ A vital point for life and death.
+
+`STRATEGIC_ATTACK_MOVE'
+`STRATEGIC_DEFEND_MOVE'
+ Moves added by 'a' and 'd' class patterns (*note Pattern
+ Classification::) which (perhaps intangibly) attack or defend a
+ dragon.
+
+`OWL_ATTACK_MOVE'
+`OWL_DEFEND_MOVE'
+ An owl attack or defense move.
+
+`OWL_ATTACK_THREAT'
+`OWL_DEFEND_THREAT'
+ A threat to owl attack or defend a group.
+
+`OWL_PREVENT_THREAT'
+ A move to remove an owl threat.
+
+`UNCERTAIN_OWL_ATTACK'
+`UNCERTAIN_OWL_DEFENSE'
+ An uncertain owl attack or defense. This means that the owl code
+ could not decide the outcome, because the owl node limit was
+ reached.
+
+`MY_ATARI_ATARI_MOVE'
+ A move that starts a chain of ataris, eventually leading to a
+ capture.
+
+`YOUR_ATARI_ATARI_MOVE'
+ A move that if played by the opponent starts a chain of ataris for
+ the opponent, leading to capture, which is also a safe move for
+ us. Preemptively playing such a move almost always defends the
+ threat.
+
+ The attack and defend move types can have a suffix to denote moves
+whose result depends on a ko, e.g. `OWL_ATTACK_MOVE_GOOD_KO'. Here
+`..._GOOD_KO' and `..._BAD_KO' correspond to `KO_A' and `KO_B' as
+explained in *note Ko::. See `engine/move_reasons.h' for the full of
+move reasons.
+
+ *NOTICE:* Some of these are reasons for *not* playing a move.
+
+ More detailed discussion of these move reasons will be found in the
+next section.
+
+
+File: gnugo.info, Node: Move Reason Details, Next: Valuation, Prev: Move Reasons, Up: Move Generation
+
+6.3 Detailed Descriptions of various Move Reasons
+=================================================
+
+* Menu:
+
+* Attack and Defense:: Worm Attack and Defense
+* Threats to Attack or Defend:: Worm Threats
+* Multi Attack or Defense:: Combined Attacks and Defenses
+* Cutting and Connecting:: Cutting and Connecting moves
+* Semeai:: Semeai winning moves
+* Making eyes:: Vital eye moves
+* Antisuji moves:: Never play these!
+* Territorial moves:: Block or expand territory
+* Owl attack and defense:: Owl Attack and Defense
+* Combination Attacks:: Coordinated threats such as double ataris
+
+
+File: gnugo.info, Node: Attack and Defense, Next: Threats to Attack or Defend, Up: Move Reason Details
+
+6.3.1 Attacking and defending moves
+-----------------------------------
+
+A move which tactically captures a worm is called an "attack move" and a
+move which saves a worm from being tactically captured is called a
+"defense move". It is understood that a defense move can only exist if
+the worm can be captured, and that a worm without defense only is
+attacked by moves that decrease the liberty count or perform necessary
+backfilling.
+
+ It is important that all moves which attack or defend a certain
+string are found, so that the move generation can make an informed
+choice about how to perform a capture, or find moves which capture
+and/or defend several worms.
+
+ Attacking and defending moves are first found in `make_worms' while
+it evaluates the tactical status of all worms, although this step only
+gives one attack and defense (if any) move per worm. Immediately after,
+still in `make_worms', all liberties of the attacked worms are tested
+for additional attack and defense moves. More indirect moves are found
+by `find_attack_patterns' and `find_defense_patterns', which match the
+A (attack) and D (defense) class patterns in `patterns/attack.db' and
+`patterns/defense.db' As a final step, all moves which fill some
+purpose at all are tested whether they additionally attacks or defends
+some worm. (Only unstable worms are analyzed.)
+
+
+File: gnugo.info, Node: Threats to Attack or Defend, Next: Multi Attack or Defense, Prev: Attack and Defense, Up: Move Reason Details
+
+6.3.2 Threats to Attack or Defend
+---------------------------------
+
+A threat to attack a worm, but where the worm can be defended is used as
+a secondary move reason. This move reason can enhance the value of a
+move so that it becomes sente. A threatening move without any other
+justification can also be used as a ko threat. The same is true for a
+move that threatens defense of a worm, but where the worm can still be
+captured if the attacker doesn't tenuki.
+
+ Threats found by the owl code are called *owl threats* and they have
+their own owl reasons.
+
+
+File: gnugo.info, Node: Multi Attack or Defense, Next: Cutting and Connecting, Prev: Threats to Attack or Defend, Up: Move Reason Details
+
+6.3.3 Multiple attack or defense moves
+--------------------------------------
+
+Sometimes a move attacks at least one of a number of worms or
+simultaneously defends all of several worms. These moves are noted by
+their own move reasons.
+
+
+File: gnugo.info, Node: Cutting and Connecting, Next: Semeai, Prev: Multi Attack or Defense, Up: Move Reason Details
+
+6.3.4 Cutting and connecting moves
+----------------------------------
+
+Moves which connect two distinct dragons are called `connecting moves'.
+Moves which prevent such connections are called "cutting moves". Cutting
+and connecting moves are primarily found by pattern matching, the `C'
+and `B' class patterns.
+
+ A second source of cutting and connecting moves comes from the attack
+and defense of cutting stones. A move which attacks a worm
+automatically counts as a connecting move if there are multiple dragons
+adjacent to the attacked worm. Similarly a defending move counts as a
+cutting move. The action taken when a pattern of this type is found is
+to induce a connect or cut move reason.
+
+ When a cut or connect move reason is registered, the involved dragons
+are of course stored. Thus the same move may cut and/or connect several
+pairs of dragons.
+
+
+File: gnugo.info, Node: Semeai, Next: Making eyes, Prev: Cutting and Connecting, Up: Move Reason Details
+
+6.3.5 Semeai winning moves
+--------------------------
+
+A move which is necessary to win a capturing race is called a "semeai
+move". These are similar to attacking moves, except that they involve
+the simultaneous attack of one worm and the defense of another. As for
+attack and defense moves, it's important that all moves which win a
+semeai are found, so an informed choice can be made between them.
+
+ Semeai move reasons should be set by the semeai module. However this
+has not been implemented yet. One might also wish to list moves which
+increase the lead in a semeai race (removes ko threats) for use as
+secondary move reasons. Analogously if we are behind in the race.
+
+
+File: gnugo.info, Node: Making eyes, Next: Antisuji moves, Prev: Semeai, Up: Move Reason Details
+
+6.3.6 Making or destroying eyes
+-------------------------------
+
+A move which makes a difference in the number of eyes produced from an
+eye space is called an "eye move". It's not necessary that the eye is
+critical for the life and death of the dragon in question, although it
+will be valued substantially higher if this is the case. As usual it's
+important to find all moves that change the eye count.
+
+ (This is part of what eye_finder was doing. Currently it only finds
+one vital point for each unstable eye space.)
+
+
+File: gnugo.info, Node: Antisuji moves, Next: Territorial moves, Prev: Making eyes, Up: Move Reason Details
+
+6.3.7 Antisuji moves
+--------------------
+
+Moves which are locally inferior or for some other reason must not be
+played are called "antisuji moves". These moves are generated by pattern
+matching. Care must be taken with this move reason as the move under no
+circumstances will be played.
+
+
+File: gnugo.info, Node: Territorial moves, Next: Owl attack and defense, Prev: Antisuji moves, Up: Move Reason Details
+
+6.3.8 Territorial moves
+-----------------------
+
+Any move that increases territory gets a move reason. This is the expand
+territory move reason. That move reason is added by the `e' patterns in
+`patterns/patterns.db'. Similarly the `E' patterns attempt to generate
+or mitigate a moyo, which is a region of influence not yet secure
+territory, yet valuable. Such a pattern sets the "expand moyo" move
+reason.
+
+
+File: gnugo.info, Node: Owl attack and defense, Next: Combination Attacks, Prev: Territorial moves, Up: Move Reason Details
+
+6.3.9 Attacking and Defending Dragons
+-------------------------------------
+
+Just as the tactical reading code tries to determine when a worm can be
+attacked or defended, the owl code tries to determine when a dragon can
+get two eyes and live. The function `owl_reasons()' generates the
+corresponding move reasons.
+
+ The owl attack and owl defense move reasons are self explanatory.
+
+ The owl attack threat reason is generated if owl attack on an
+opponent's dragon fails but the owl code determines that the dragon can
+be killed with two consecutive moves. The killing moves are stored in
+`dragon[pos].owl_attack_point' and
+`dragon[pos].owl_second_attack_point'.
+
+ Similarly if a friendly dragon is dead but two moves can revive it,
+an owl defense threat move reason is generated.
+
+ The prevent threat reasons are similar but with the colors reversed:
+if the opponent has an attack threat move then a move which removes the
+threat gets a prevent threat move reason.
+
+ The owl uncertain move reasons are generated when the owl code runs
+out of nodes. In order to prevent the owl code from running too long, a
+cap is put on the number of nodes one owl read can generate. If this is
+exceeded, the reading is cut short and the result is cached as usual,
+but marked uncertain. In this case an owl uncertain move reason may be
+generated. For example, if the owl code finds the dragon alive but is
+unsure, a move to defend may still be generated.
+
+
+File: gnugo.info, Node: Combination Attacks, Prev: Owl attack and defense, Up: Move Reason Details
+
+6.3.10 Combination Attacks
+--------------------------
+
+The function `atari_atari' tries to find a sequence of ataris
+culminating in an unexpected change of status of any opponent string,
+from `ALIVE' to `CRITICAL'. Once such a sequence of ataris is found, it
+tries to shorten it by rejecting irrelevant moves.
+
+
+File: gnugo.info, Node: Valuation, Next: End Game, Prev: Move Reason Details, Up: Move Generation
+
+6.4 Valuation of suggested moves
+================================
+
+At the end of the move generation process, the function
+`value_move_reasons()' tries to assign values to the moves for the
+purpose of selecting the best move. The single purpose of the move
+valuation is to try to rank the moves so that the best move gets the
+highest score. In principle these values could be arbitrary, but in
+order to make it easier to evaluate how well the valuation performs,
+not to mention simplify the tuning, we try to assign values which are
+consistent with the usual methods of counting used by human Go players,
+as explained for example in _The Endgame_ by Ogawa and Davies.
+
+ Moves are valued with respect to four different criteria. These are
+
+ * territorial value
+
+ * strategical value
+
+ * shape value,
+
+ * secondary value.
+
+ All of these are floats and should be measured in terms of actual
+points.
+
+ The territorial value is the total change of expected territory
+caused by this move. This includes changes in the status of groups if
+the move is an attack or a defense move.
+
+ Beginning with GNU Go 3.0, the influence function plays an important
+role in estimating territory (*note Influence and Territory::). It is
+used to make a guess at each intersection how likely it is that it will
+become black or white territory. The territorial value sums up the
+changes in these valuations.
+
+ Strategical value is a measure of the effect the move has on the
+safety of all groups on the board. Typically cutting and connecting
+moves have their main value here. Also edge extensions, enclosing moves
+and moves towards the center have high strategical value. The
+strategical value should be the sum of a fraction of the territorial
+value of the involved dragons. The fraction is determined by the change
+in safety of the dragon.
+
+ Shape value is a purely local shape analysis. An important role of
+this measure is to offset mistakes made by the estimation of
+territorial values. In open positions it's often worth sacrificing a
+few points of (apparent) immediate profit to make good shape. Shape
+value is implemented by pattern matching, the Shape patterns.
+
+ Secondary value is given for move reasons which by themselves are not
+sufficient to play the move. One example is to reduce the number of
+eyes for a dragon that has several or to attack a defenseless worm.
+
+ When all these values have been computed, they are summed, possibly
+weighted (secondary value should definitely have a small weight), into
+a final move value. This value is used to decide the move.
+
+* Menu:
+
+* Territorial value:: How much territory does a move gain
+* Strategical value:: Strategical gains from a move
+* Shape factor:: Local shape
+* Minimum Value:: Minimum value
+* Secondary Value:: Other, more indirect, gains from a move
+* Threats and Followup Value:: Valuation of attack and defense threats
+
+
+File: gnugo.info, Node: Territorial value, Next: Strategical value, Up: Valuation
+
+6.4.1 Territorial Value
+-----------------------
+
+The algorithm for computing territorial value is in the function
+`estimate_territorial_value'. As the name suggests, it seeks to
+estimate the change in territory.
+
+ It considers all groups that are changed from alive to death or
+vice-versa due to this move. Also, it makes an assumption whether the
+move should be considered safe. If so, the influence module is called:
+The function `influence_delta_territory' estimates the territorial
+effect of both the stone played and of the changes of group status'.
+
+ The result returned by the influence module is subject to a number of
+corrections. This is because some move reasons cannot be evaluated by a
+single call to the influence function, such as moves depending on a ko.
+
+
+File: gnugo.info, Node: Strategical value, Next: Shape factor, Prev: Territorial value, Up: Valuation
+
+6.4.2 Strategical Value
+-----------------------
+
+Strategical defense or attack reasons are assigned to any move which
+matches a pattern of type `a' or `d'. These are moves which in some
+(often intangible) way tend to help strengthen or weaken a dragon. Of
+course strengthening a dragon which is already alive should not be
+given much value, but when the move reason is generated it is not
+necessary to check its status or safety. This is done later, during the
+valuation phase.
+
+
+File: gnugo.info, Node: Shape factor, Next: Minimum Value, Prev: Strategical value, Up: Valuation
+
+6.4.3 Shape Factor
+------------------
+
+In the value field of a pattern (*note Pattern Values::) one may
+specify a shape value.
+
+ This is used to compute the shape factor, which multiplies the score
+of a move. We take the largest positive contribution to shape and add 1
+for each additional positive contribution found. Then we take the
+largest negative contribution to shape, and add 1 for each additional
+negative contribution. The resulting number is raised to the power 1.05
+to obtain the shape factor.
+
+ The rationale behind this complicated scheme is that every shape
+point is very significant. If two shape contributions with values (say)
+5 and 3 are found, the second contribution should be devalued to 1.
+Otherwise the engine is too difficult to tune since finding multiple
+contributions to shape can cause significant overvaluing of a move.
+
+
+File: gnugo.info, Node: Minimum Value, Next: Secondary Value, Prev: Shape factor, Up: Valuation
+
+6.4.4 Minimum Value
+-------------------
+
+A pattern may assign a minimum (and sometimes also a maximum) value.
+For example the Joseki patterns have values which are prescribed in
+this way, or ones with a `value' field. One prefers not to use this
+approach but in practice it is sometimes needed.
+
+ In the fuseki, there are often several moves with identical minimum
+value. GNU Go chooses randomly between such moves, which ensures some
+indeterminacy of GNU Go's play. Later in the game, GNU Go's genuine
+valuation of such a move is used as a secondary criterion.
+
+
+File: gnugo.info, Node: Secondary Value, Next: Threats and Followup Value, Prev: Minimum Value, Up: Valuation
+
+6.4.5 Secondary Value
+---------------------
+
+Secondary move reasons are weighed very slightly. Such a move can tip
+the scales if all other factors are equal.
+
+
+File: gnugo.info, Node: Threats and Followup Value, Prev: Secondary Value, Up: Valuation
+
+6.4.6 Threats and Followup Value
+--------------------------------
+
+Followup value refers to value which may acrue if we get two moves in a
+row in a local area. It is assigned for moves that threaten to attack
+or defend a worm or dragon. Also, since GNU Go 3.2 the influence module
+makes an assessment of the possible purely territorial followup moves.
+In cases where these two heuristics are not sufficient we add patterns
+with a `followup_value' autohelper macro.
+
+ Usually, the followup value gives only a small contribution; e.g. if
+it the followup value is very large, then GNU Go treats the move as
+sente by doubling its value. However, if the largest move on the board
+is a ko which we cannot legally take, then such a move becomes
+attractive as a ko threat and the full followup value is taken into
+account.
+
+
+File: gnugo.info, Node: End Game, Prev: Valuation, Up: Move Generation
+
+6.5 End Game
+============
+
+Endgame moves are generated just like any other move by GNU Go. In fact,
+the concept of endgame does not exist explicitly, but if the largest
+move initially found is worth 6 points or less, an extra set of patterns
+in `endgame.db' is matched and the move valuation is redone.
+
+
+File: gnugo.info, Node: Worms and Dragons, Next: Eyes, Prev: Move Generation, Up: Top
+
+7 Worms and Dragons
+*******************
+
+* Menu:
+
+* Worms:: Worms
+* Amalgamation:: How two Worms are amalgamated.
+* Connection:: Connections.
+* Half Eyes:: Half Eyes and False Eyes.
+* Dragons:: Union of WORMS.
+* Dragons in Color:: Colored display of DRAGONS.
+
+ Before considering its move, GNU Go collects some data in several
+arrays. Two of these arrays, called `worm' and `dragon', are discussed
+in this document. Others are discussed in *Note Eyes::.
+
+ This information is intended to help evaluate the connectedness, eye
+shape, escape potential and life status of each group.
+
+ Later routines called by `genmove()' will then have access to this
+information. This document attempts to explain the philosophy and
+algorithms of this preliminary analysis, which is carried out by the
+two routines `make_worm()' and `make_dragon()' in `dragon.c'.
+
+ A "worm" is a maximal set of stones on the board which are connected
+along the horizontal and vertical lines, and are of the same color. We
+often say "string" instead of worm.
+
+ A "dragon" is a union of strings of the same color which will be
+treated as a unit. The dragons are generated anew at each move. If two
+strings are in the dragon, it is the computer's working hypothesis that
+they will live or die together and are effectively connected.
+
+ The purpose of the dragon code is to allow the computer to formulate
+meaningful statements about life and death. To give one example,
+consider the following situation:
+
+ OOOOO
+ OOXXXOO
+ OX...XO
+ OXXXXXO
+ OOOOO
+
+ The X's here should be considered a single group with one three-space
+eye, but they consist of two separate strings. Thus we must amalgamate
+these two strings into a single dragon. Then the assertion makes sense,
+that playing at the center will kill or save the dragon, and is a vital
+point for both players. It would be difficult to formulate this
+statement if the X's are not perceived as a unit.
+
+ The present implementation of the dragon code involves simplifying
+assumptions which can be refined in later implementations.
+
+
+File: gnugo.info, Node: Worms, Next: Amalgamation, Up: Worms and Dragons
+
+7.1 Worms
+=========
+
+The array `struct worm_data worm[MAX_BOARD]' collects information about
+the worms. We will give definitions of the various fields. Each field
+has constant value at each vertex of the worm. We will define each
+field.
+
+
+ struct worm_data {
+ int color;
+ int size;
+ float effective_size;
+ int origin;
+ int liberties;
+ int liberties2;
+ int liberties3;
+ int liberties4;
+ int lunch;
+ int cutstone;
+ int cutstone2;
+ int genus;
+ int inessential;
+ int invincible;
+ int unconditional_status;
+ int attack_points[MAX_TACTICAL_POINTS];
+ int attack_codes[MAX_TACTICAL_POINTS];
+ int defense_points[MAX_TACTICAL_POINTS];
+ int defend_codes[MAX_TACTICAL_POINTS];
+ int attack_threat_points[MAX_TACTICAL_POINTS];
+ int attack_threat_codes[MAX_TACTICAL_POINTS];
+ int defense_threat_points[MAX_TACTICAL_POINTS];
+ int defense_threat_codes[MAX_TACTICAL_POINTS];
+ };
+
+ * `color'
+
+ The color of the worm.
+
+ * `size'
+
+ This field contains the cardinality of the worm.
+
+ * `effective_size'
+
+ This is the number of stones in a worm plus the number of
+ empty intersections that are at least as close to this worm
+ as to any other worm. Intersections that are shared are
+ counted with equal fractional values for each worm. This
+ measures the direct territorial value of capturing a worm.
+ "effective_size" is a floating point number. Only
+ intersections at a distance of 4 or less are counted.
+
+ * `origin'
+
+ Each worm has a distinguished member, called its "origin".
+ The purpose of this field is to make it easy to determine
+ when two vertices lie in the same worm: we compare their
+ origin. Also if we wish to perform some test once for each
+ worm, we simply perform it at the origin and ignore the other
+ vertices. The origin is characterized by the test:
+ worm[pos].origin == pos.
+
+ * `liberties'
+
+ * `liberties2'
+
+ * `liberties3'
+
+ * `liberties4'
+
+ For a nonempty worm the field liberties is the number of
+ liberties of the string. This is supplemented by
+ `LIBERTIES2', `LIBERTIES3' and `LIBERTIES4', which are the
+ number of second order, third order, and fourth order
+ liberties, respectively. The definition of liberties of
+ order >1 is adapted to the problem of detecting the shape of
+ the surrounding empty space. In particular we want to be able
+ to see if a group is loosely surrounded. A "liberty of order
+ n" is an empty vertex which may be connected to the string by
+ placing n stones of the same color on the board, but no
+ fewer. The path of connection may pass through an intervening
+ group of the same color. The stones placed at distance >1 may
+ not touch a group of the opposite color. Connections through
+ ko are not permitted. Thus in the following configuration:
+
+ .XX... We label the .XX.4.
+ XO.... liberties of XO1234
+ XO.... order < 5 of XO1234
+ ...... the O group: .12.4.
+ .X.X.. .X.X..
+
+ The convention that liberties of order >1 may not touch a
+ group of the opposite color means that knight's moves and one
+ space jumps are perceived as impenetrable barriers. This is
+ useful in determining when the string is becoming surrounded.
+
+ The path may also not pass through a liberty at distance 1 if
+ that liberty is flanked by two stones of the opposing color.
+ This reflects the fact that the O stone is blocked from
+ expansion to the left by the two X stones in the following
+ situation:
+
+ X.
+ .O
+ X.
+ We say that n is the "distance" of the liberty of order n
+ from the dragon.
+
+ * `lunch'
+
+ If nonzero, `lunch' points to a boundary worm which can be
+ easily captured. (It does not matter whether or not the
+ string can be defended.)
+
+ We have two distinct notions of cutting stone, which we keep track
+of in the separate fields `worm.cutstone' and `worm.cutstone2'. We use
+currently use both concepts in parallel.
+
+ * `cutstone'
+
+ This field is equal to 2 for cutting stones, 1 for potential
+ cutting stones. Otherwise it is zero. Definitions for this
+ field: a "cutting stone" is one adjacent to two enemy
+ strings, which do not have a liberty in common. The most
+ common type of cutting string is in this situation:
+
+
+ XO
+ OX
+
+ A "potential cutting stone" is adjacent to two enemy strings
+ which do share a liberty. For example, X in:
+
+
+ XO
+ O.
+
+ For cutting strings we set `worm[].cutstone=2'. For potential
+ cutting strings we set `worm[].cutstone=1'.
+
+ * `cutstone2'
+
+ Cutting points are identified by the patterns in the
+ connections database. Proper cuts are handled by the fact
+ that attacking and defending moves also count as moves
+ cutting or connecting the surrounding dragons. The
+ `cutstone2' field is set during `find_cuts()', called from
+ `make_domains()'.
+
+ * `genus'
+
+ There are two separate notions of "genus" for worms and
+ dragons. The dragon notion is more important, so
+ `dragon[pos].genus' is a far more useful field than
+ `worm[pos].genus'. Both fields are intended as approximations
+ to the number of eyes. The "genus" of a string is the number
+ of connected components of its complement, minus one. It is
+ an approximation to the number of eyes of the string.
+
+ * `inessential'
+
+ An "inessential" string is one which meets a criterion
+ designed to guarantee that it has no life potential unless a
+ particular surrounding string of the opposite color can be
+ killed. More precisely an "inessential string" is a string S
+ of genus zero, not adjacent to any opponent string which can
+ be easily captured, and which has no edge liberties or second
+ order liberties, and which satisfies the following further
+ property: If the string is removed from the board, then the
+ remaining cavity only borders worms of the opposite color.
+
+
+ * `invincible'
+
+ An "invincible" worm is one which GNU Go thinks cannot be
+ captured. Invincible worms are computed by the function
+ `unconditional_life()' which tries to find those worms of the
+ given color that can never be captured, even if the opponent
+ is allowed an arbitrary number of consecutive moves.
+
+ * unconditional_status
+
+ Unconditional status is also set by the function
+ `unconditional_life'. This is set `ALIVE' for stones which are
+ invincible. Stones which can not be turned invincible even if
+ the defender is allowed an arbitrary number of consecutive
+ moves are given an unconditional status of `DEAD'. Empty
+ points where the opponent cannot form an invincible worm are
+ called unconditional territory. The unconditional status is
+ set to `WHITE_TERRITORY' or `BLACK_TERRITORY' depending on
+ who owns the territory. Finally, if a stone can be captured
+ but is adjacent to unconditional territory of its own color,
+ it is also given the unconditional status `ALIVE'. In all
+ other cases the unconditional status is `UNKNOWN'.
+
+ To make sense of these definitions it is important to notice
+ that any stone which is alive in the ordinary sense (even if
+ only in seki) can be transformed into an invincible group by
+ some number of consecutive moves. Well, this is not entirely
+ true because there is a rare class of seki groups not
+ satisfying this condition. Exactly which these are is left as
+ an exercise for the reader. Currently `unconditional_life',
+ which strictly follows the definitions above, calls such seki
+ groups unconditionally dead, which of course is a misfeature.
+ It is possible to avoid this problem by making the algorithm
+ slightly more complex, but this is left for a later revision.
+
+ * `int attack_points[MAX_TACTICAL_POINTS]'
+
+ * `attack_codes[MAX_TACTICAL_POINTS]'
+
+ * `int defense_points[MAX_TACTICAL_POINTS];'
+
+ * `int defend_codes[MAX_TACTICAL_POINTS];'
+
+ If the tactical reading code (*note Tactical Reading::) finds
+ that the worm can be attacked, `attack_points[0]' is a point
+ of attack, and `attack_codes[0]' is the attack code, `WIN',
+ `KO_A' or `KO_B'. If multiple attacks are known,
+ `attack_points[k]' and `attack_codes[k]' are used. Similarly
+ with the defense codes and defense points.
+
+ * `int attack_threat_points[MAX_TACTICAL_POINTS];'
+
+ * `int attack_threat_codes[MAX_TACTICAL_POINTS];'
+
+ * `int defense_threat_points[MAX_TACTICAL_POINTS];'
+
+ * `int defense_threat_codes[MAX_TACTICAL_POINTS];'
+
+ These are points that threaten to attack or defend a worm.
+
+ The function `makeworms()' will generate data for all worms.
+
+
+File: gnugo.info, Node: Amalgamation, Next: Connection, Prev: Worms, Up: Worms and Dragons
+
+7.2 Amalgamation
+================
+
+A dragon, we have said, is a group of stones which are treated as a
+unit. It is a working hypothesis that these stones will live or die
+together. Thus the program will not expect to disconnect an opponent's
+strings if they have been amalgamated into a single dragon.
+
+ The function `make_dragons()' will amalgamate worms into dragons by
+maintaining separate arrays `worm[]' and `dragon[]' containing similar
+data. Each dragon is a union of worms. Just as the data maintained in
+`worm[]' is constant on each worm, the data in `dragon[]' is constant
+on each dragon.
+
+ Amalgamation of worms in GNU Go proceeds as follows. First we
+amalgamate all boundary components of an eyeshape. Thus in the
+following example:
+
+
+ .OOOO. The four X strings are amalgamated into a
+ OOXXO. single dragon because they are the boundary
+ OX..XO components of a blackbordered cave. The
+ OX..XO cave could contain an inessential string
+ OOXXO. with no effect on this amalgamation.
+ XXX...
+
+ The code for this type of amalgamation is in the routine
+`dragon_eye()', discussed further in EYES.
+
+ Next, we amalgamate strings which seem uncuttable. We amalgamate
+dragons which either share two or more common liberties, or share one
+liberty into the which the opponent cannot play without being captured.
+(ignores ko rule).
+
+
+ X. X.X XXXX.XXX X.O
+ .X X.X X......X X.X
+ XXXXXX.X OXX
+
+ A database of connection patterns may be found in `patterns/conn.db'.
+
+
+File: gnugo.info, Node: Connection, Next: Half Eyes, Prev: Amalgamation, Up: Worms and Dragons
+
+7.3 Connection
+==============
+
+The fields `black_eye.cut' and `white_eye.cut' are set where the
+opponent can cut, and this is done by the B (break) class patterns in
+`conn.db'. There are two important uses for this field, which can be
+accessed by the autohelper functions `xcut()' and `ocut()'. The first
+use is to stop amalgamation in positions like
+
+
+ ..X..
+ OO*OO
+ X.O.X
+ ..O..
+
+where X can play at * to cut off either branch. What happens here is
+that first connection pattern CB1 finds the double cut and marks * as a
+cutting point. Later the C (connection) class patterns in conn.db are
+searched to find secure connections over which to amalgamate dragons.
+Normally a diagonal connection would be deemed secure and amalgamated
+by connection pattern CC101, but there is a constraint requiring that
+neither of the empty intersections is a cutting point.
+
+ A weakness with this scheme is that X can only cut one connection,
+not both, so we should be allowed to amalgamate over one of the
+connections. This is performed by connection pattern CC401, which with
+the help of `amalgamate_most_valuable_helper()' decides which
+connection to prefer.
+
+ The other use is to simplify making alternative connection patterns
+to the solid connection. Positions where the diag_miai helper thinks a
+connection is necessary are marked as cutting points by connection
+pattern 12. Thus we can write a connection pattern like `CC6':
+
+
+ ?xxx? straight extension to connect
+ XOO*?
+ O...?
+
+ :8,C,NULL
+
+ ?xxx?
+ XOOb?
+ Oa..?
+
+ ;xcut(a) && odefend_against(b,a)
+
+where we verify that a move at `*' would stop the enemy from safely
+playing at the cutting point, thus defending against the cut.
+
+
+File: gnugo.info, Node: Half Eyes, Next: Dragons, Prev: Connection, Up: Worms and Dragons
+
+7.4 Half Eyes and False Eyes
+============================
+
+A "half eye" is a place where, if the defender plays first, an eye will
+materialize, but where if the attacker plays first, no eye will
+materialize. A "false eye" is a vertex which is surrounded by a dragon
+yet is not an eye. Here is a half eye:
+
+
+ XXXXX
+ OO..X
+ O.O.X
+ OOXXX
+
+ Here is a false eye:
+
+
+ XXXXX
+ XOO.X
+ O.O.X
+ OOXXX
+
+ The "topological" algorithm for determining half and false eyes is
+described elsewhere (*note Eye Topology::).
+
+ The half eye data is collected in the dragon array. Before this is
+done, however, an auxiliary array called half_eye_data is filled with
+information. The field `type' is 0, or else `HALF_EYE' or `FALSE_EYE'
+depending on which type is found; the fields `attack_point[]' point to
+up to 4 points to attack the half eye, and similarly `defense_point[]'
+gives points to defend the half eye.
+
+
+ struct half_eye_data half_eye[MAX_BOARD];
+
+ struct half_eye_data {
+ float value; /* Topological eye value */
+ int type; /* HALF_EYE or FALSE_EYE */
+ int num_attacks; /* Number of attacking points */
+ int attack_point[4]; /* The moves to attack a topological halfeye */
+ int num_defends; /* Number of defending points */
+ int defense_point[4]; /* The moves to defend a topological halfeye */
+ };
+
+ The array `struct half_eye_data half_eye[MAX_BOARD]' contains
+information about half and false eyes. If the type is `HALF_EYE' then
+up to four moves are recorded which can either attack or defend the
+eye. In rare cases the attack points could be different from the
+defense points.
+
+
+File: gnugo.info, Node: Dragons, Next: Dragons in Color, Prev: Half Eyes, Up: Worms and Dragons
+
+7.5 Dragons
+===========
+
+The array `struct dragon_data dragon[MAX_BOARD]' collects information
+about the dragons. We will give definitions of the various fields. Each
+field has constant value at each vertex of the dragon. (Fields will be
+discussed below.)
+
+
+ struct dragon_data {
+ int color; /* its color */
+ int id; /* the index into the dragon2 array */
+ int origin; /* the origin of the dragon. Two vertices */
+ /* are in the same dragon iff they have */
+ /* same origin. */
+ int size; /* size of the dragon */
+ float effective_size; /* stones and surrounding spaces */
+ int crude_status; /* (ALIVE, DEAD, UNKNOWN, CRITICAL)*/
+ int status; /* best trusted status */
+ };
+
+ extern struct dragon_data dragon[BOARDMAX];
+
+ Other fields attached to the dragon are contained in the
+`dragon_data2' struct array. (Fields will be discussed below.)
+
+
+ struct dragon_data2 {
+ int origin;
+ int adjacent[MAX_NEIGHBOR_DRAGONS];
+ int neighbors;
+ int hostile_neighbors;
+ int moyo_size;
+ float moyo_territorial_value;
+ int safety;
+ float weakness;
+ float weakness_pre_owl;
+ int escape_route;
+ struct eyevalue genus;
+ int heye;
+ int lunch;
+ int surround_status;
+ int surround_size;
+ int semeais;
+ int semeai_margin_of_safety;
+ int semeai_defense_point;
+ int semeai_defense_certain;
+ int semeai_attack_point;
+ int semeai_attack_certain;
+ int owl_threat_status;
+ int owl_status;
+ int owl_attack_point;
+ int owl_attack_code;
+ int owl_attack_certain;
+ int owl_second_attack_point;
+ int owl_defense_point;
+ int owl_defense_code;
+ int owl_defense_certain;
+ int owl_second_defense_point;
+ int owl_attack_kworm;
+ int owl_defense_kworm;
+ };
+
+ extern struct dragon_data2 *dragon2;
+
+ The difference between the two arrays is that the `dragon' array is
+indexed by the board, and there is a copy of the dragon data at every
+stone in the dragon, while there is only one copy of the dragon2 data.
+The dragons are numbered, and the `id' field of the dragon is a key
+into the dragon2 array. Two macros DRAGON and DRAGON2 are provided for
+gaining access to the two arrays.
+
+ #define DRAGON2(pos) dragon2[dragon[pos].id]
+ #define DRAGON(d) dragon[dragon2[d].origin]
+
+ Thus if you know the position `pos' of a stone in the dragon you can
+access the dragon array directly, for example accessing the origin with
+`dragon[pos].origin'. However if you need a field from the dragon2
+array, you can access it using the DRAGON2 macro, for example you can
+access its neighor dragons by
+
+ for (k = 0; k < DRAGON2(pos).neighbors; k++) {
+ int d = DRAGON2(pos).adjacent[k];
+ int apos = dragon2[d].origin;
+ do_something(apos);
+ }
+
+ Similarly if you know the dragon number (which is `dragon[pos].id')
+then you can access the `dragon2' array directly, or you can access the
+`dragon' array using the DRAGON macro.
+
+ Here are the definitions of each field in the `dragon' arrray.
+
+ * `color'
+
+ The color of the dragon.
+
+ * `id'
+
+ The dragon number, used as a key into the `dragon2' array.
+
+ * origin
+
+ The origin of the dragon is a unique particular vertex of the
+ dragon, useful for determining when two vertices belong to
+ the same dragon. Before amalgamation the worm origins are
+ copied to the dragon origins. Amalgamation of two dragons
+ amounts to changing the origin of one.
+
+ * size
+
+ The number of stones in the dragon.
+
+ * effective size
+
+ The sum of the effective sizes of the constituent worms.
+ Remembering that vertices equidistant between two or more
+ worms are counted fractionally in `worm.effective_size', this
+ equals the cardinality of the dragon plus the number of empty
+ vertices which are nearer this dragon than any other.
+
+ * crude_status
+
+ (ALIVE, DEAD, UNKNOWN, CRITICAL). An early measure of the life
+ potential of the dragon. It is computed before the owl code is
+ run and is superceded by the status as soon as that becomes
+ available.
+
+ * status
+
+ The dragon status is the best measure of the dragon's health.
+ It is computed after the owl code is run, then revised again
+ when the semeai code is run.
+
+ Here are definitions of the fields in the `dragon2' array.
+
+ * origin
+
+ The origin field is duplicated here.
+
+ * adjacent
+
+ * `adjacent[MAX_NEIGHBOR_DRAGONS]'
+
+ Dragons of either color near the given one are called
+ "neighbors". They are computed by the function
+ `find_neighbor_dragons()'. The `dragon2.adjacent' array
+ gives the dragon numbers of these dragons.
+
+ * `neighbors'
+
+ Dragons of either color near the given one are called
+ "neighbors". They are computed by the function
+ `find_neighbor_dragons()'. The `dragon2.adjacent' array
+ gives the dragon numbers of these dragons.
+
+ * neighbors
+
+ The number of neighbor dragons.
+
+ * hostile_neighbors
+
+ The number of neighbor dragons of the opposite color.
+
+ * moyo_size
+
+ * float moyo_territorial_value
+
+ The function `compute_surrounding_moyo_sizes()' assigns a
+ size and a territorial value to the moyo around each dragon
+ (*note Territory and Moyo::). This is the moyo size. They are
+ recorded in these fields.
+
+ * safety
+
+ The dragon safety can take on one of the values
+ - TACTICALLY_DEAD - a dragon consisting of a single worm
+ found dead by the reading code (very reliable)
+
+ - ALIVE - found alive by the owl or semeai code
+
+ - STRONGLY_ALIVE - alive without much question
+
+ - INVINCIBLE - definitively alive even after many tenukis
+
+ - ALIVE_IN_SEKI - determined to be seki by the semeai code
+
+ - CRITICAL - lives or dies depending on who moves first
+
+ - DEAD - found to be dead by the owl code
+
+ - INESSENTIAL - the dragon is unimportant (e.g. nakade
+ stones) and dead
+
+ * weakness
+
+ * weakness_pre_owl
+
+ A floating point measure of the safety of a dragon. The dragon
+ weakness is a number between 0. and 1., higher numbers for
+ dragons in greater need of safety. The field
+ `weakness_pre_owl' is a preliminary computation before the
+ owl code is run.
+
+ * escape_route
+
+ A measure of the dragon's potential to escape towards safety,
+ in case it cannot make two eyes locally. Documentation may be
+ found in *note Escape::.
+
+ * struct eyevalue genus
+
+ The approximate number of eyes the dragon can be expected to
+ get. Not guaranteed to be accurate. The eyevalue struct, which
+ is used throughout the engine, is declared thus:
+
+ struct eyevalue {
+ unsigned char a; /* # of eyes if attacker plays twice */
+ unsigned char b; /* # of eyes if attacker plays first */
+ unsigned char c; /* # of eyes if defender plays first */
+ unsigned char d; /* # of eyes if defender plays twice */
+ };
+
+ * heye
+
+ Location of a half eye attached to the dragon.
+
+ * lunch
+
+ If nonzero, this is the location of a boundary string which
+ can be captured. In contrast with worm lunches, a dragon
+ lunch must be able to defend itself.
+
+ * surround_status
+
+ * surround_size
+
+ In estimating the safety of a dragon it is useful to know if
+ it is "surrounded". See *note Surrounded Dragons:: and the
+ comments in `surround.c' for more information about the
+ algorithm. Used in computing the escape_route, and also
+ callable from patterns (currently used by CB258).
+
+ * semeais
+
+ * semeai_defense_point
+
+ * semeai_defense_certain
+
+ * semeai_attack_point
+
+ * semeai_attack_certain
+
+ If two dragons of opposite color both have the status CRITICAL
+ or DEAD they are in a "semeai" (capturing race), and their
+ status must be adjudicated by the function
+ `owl_analyze_semeai()' in `owl.c', which attempts to
+ determine which is alive, which dead, or if the result is
+ seki, and whether it is important who moves first. The
+ function `new_semeai()' in `semeai.c' attempts to revise the
+ statuses and to generate move reasons based on these results.
+ The field `dragon2.semeais' is nonzero if the dragon is an
+ element of a semeai, and equals the number of semeais (seldom
+ more than one). The semeai defense and attack points are
+ locations the defender or attacker must move to win the
+ semeai. The field `semeai_margin_of_safety' is intended to
+ indicate whether the semeai is close or not but currently
+ this field is not maintained. The fields
+ `semeai_defense_certain' and `semeai_attack_certain' indicate
+ that the semeai code was able to finish analysis without
+ running out of nodes.
+
+ * owl_status
+
+ This is a classification similar to `dragon.crude_status', but
+ based on the life and death reading in `owl.c'. The owl code
+ (*note The Owl Code::) is skipped for dragons which appear
+ safe by certain heuristics. If the owl code is not run, the
+ owl status is `UNCHECKED'. If `owl_attack()' determines that
+ the dragon cannot be attacked, it is classified as `ALIVE'.
+ Otherwise, `owl_defend()' is run, and if it can be defended it
+ is classified as `CRITICAL', and if not, as `DEAD'.
+
+ * owl_attack_point
+
+ If the dragon can be attacked this is the point to attack the
+ dragon.
+
+ * owl_attack_code
+
+ The owl attack code, It can be WIN, KO_A, KO_B or 0 (*note
+ Return Codes::).
+
+ * owl_attack_certain
+
+ The owl reading is able to finish analyzing the attack
+ without running out of nodes.
+
+ * owl_second_attack_point
+
+ A second attack point.
+
+ * owl_defense_point
+
+ If the dragon can be defended, this is the place to play.
+
+ * owl_defense_code
+
+ The owl defense code, It can be WIN, KO_A, KO_B or 0 (*note
+ Return Codes::).
+
+ * owl_defense_certain
+
+ The owl code is able to finish analyzing the defense without
+ running out of nodes.
+
+ * owl_second_defense_point
+
+ A second owl defense point.
+
+
+File: gnugo.info, Node: Dragons in Color, Prev: Dragons, Up: Worms and Dragons
+
+7.6 Colored Dragon Display
+==========================
+
+You can get a colored ASCII display of the board in which each dragon
+is assigned a different letter; and the different values of
+`dragon.status' values (`ALIVE', `DEAD', `UNKNOWN', `CRITICAL') have
+different colors. This is very handy for debugging. A second diagram
+shows the values of `owl.status'. If this is `UNCHECKED' the dragon is
+displayed in White.
+
+ Save a game in sgf format using CGoban, or using the `-o' option with
+GNU Go itself.
+
+ Open an `xterm' or `rxvt' window. You may also use the Linux
+console. Using the console, you may need to use "SHIFT-PAGE UP" to see
+the first diagram. Xterm will only work if it is compiled with color
+support--if you do not see the colors try `rxvt'. Make the background
+color black and the foreground color white.
+
+ Execute:
+
+ `gnugo -l [filename] -L [movenum] -T' to get the colored display.
+
+ The color scheme: Green = `ALIVE'; Yellow = `UNKNOWN'; Cyan = `DEAD'
+and Red = `CRITICAL'. Worms which have been amalgamated into the same
+dragon are labelled with the same letter.
+
+ Other useful colored displays may be obtained by using instead:
+
+ * the option -E to display eye spaces (*note Eyes::).
+
+ * the option -m 0x0180 to display territory, moyo and area (*note
+ Territory and Moyo::).
+
+ The colored displays are documented elsewhere (*note Colored
+Display::).
+
+
+File: gnugo.info, Node: Eyes, Next: Patterns, Prev: Worms and Dragons, Up: Top
+
+8 Eyes and Half Eyes
+********************
+
+The purpose of this Chapter is to describe the algorithm used in GNU Go
+to determine eyes.
+
+* Menu:
+
+* Local Games:: Local games
+* Eye Space:: Eye space
+* Eye Space as Local Game:: Eye space as local game
+* Eye Example:: An example
+* Graphs:: Underlying graphs
+* Eye Shape:: Pattern matching
+* Eye Local Game Values:: Pattern matching
+* Eye Topology:: False eyes and half eyes
+* Eye Topology with Ko:: False eyes and half eyes with ko
+* False Margins:: False margins
+* Eye Functions:: Functions in `optics.c'
+
+
+File: gnugo.info, Node: Local Games, Next: Eye Space, Up: Eyes
+
+8.1 Local games
+===============
+
+The fundamental paradigm of combinatorial game theory is that games can
+be added and in fact form a group. If `G' and `H' are games, then `G+H'
+is a game in which each player on his turn has the option of playing in
+either move. We say that the game `G+H' is the sum of the local games
+`G' and `H'.
+
+ Each connected eyespace of a dragon affords a local game which yields
+a local game tree. The score of this local game is the number of eyes
+it yields. Usually if the players take turns and make optimal moves,
+the end scores will differ by 0 or 1. In this case, the local game may
+be represented by a single number, which is an integer or half integer.
+Thus if `n(O)' is the score if `O' moves first, both players alternate
+(no passes) and make alternate moves, and similarly `n(X)', the game
+can be represented by `{n(O)|n(X)}'. Thus {1|1} is an eye, {2|1} is an
+eye plus a half eye, etc.
+
+ The exceptional game {2|0} can occur, though rarely. We call an
+eyespace yielding this local game a CHIMERA. The dragon is alive if
+any of the local games ends up with a score of 2 or more, so {2|1} is
+not different from {3|1}. Thus {3|1} is NOT a chimera.
+
+ Here is an example of a chimera:
+
+ XXXXX
+ XOOOX
+ XO.OOX
+ XX..OX
+ XXOOXX
+ XXXXX
+
+
+File: gnugo.info, Node: Eye Space, Next: Eye Space as Local Game, Prev: Local Games, Up: Eyes
+
+8.2 Eye spaces
+==============
+
+In order that each eyespace be assignable to a dragon, it is necessary
+that all the dragons surrounding it be amalgamated (*note
+Amalgamation::). This is the function of `dragon_eye()'.
+
+ An EYE SPACE for a black dragon is a collection of vertices adjacent
+to a dragon which may not yet be completely closed off, but which can
+potentially become eyespace. If an open eye space is sufficiently
+large, it will yield two eyes. Vertices at the edge of the eye space
+(adjacent to empty vertices outside the eye space) are called MARGINAL.
+
+ Here is an example from a game:
+
+
+ |. X . X X . . X O X O
+ |X . . . . . X X O O O
+ |O X X X X . . X O O O
+ |O O O O X . O X O O O
+ |. . . . O O O O X X O
+ |X O . X X X . . X O O
+ |X O O O O O O O X X O
+ |. X X O . O X O . . X
+ |X . . X . X X X X X X
+ |O X X O X . X O O X O
+
+ Here the `O' dragon which is surrounded in the center has open eye
+space. In the middle of this open eye space are three dead `X' stones.
+This space is large enough that O cannot be killed. We can abstract the
+properties of this eye shape as follows. Marking certain vertices as
+follows:
+
+
+ |- X - X X - - X O X O
+ |X - - - - - X X O O O
+ |O X X X X - - X O O O
+ |O O O O X - O X O O O
+ |! . . . O O O O X X O
+ |X O . X X X . ! X O O
+ |X O O O O O O O X X O
+ |- X X O - O X O - - X
+ |X - - X - X X X X X X
+ |O X X O X - X O O X O
+
+the shape in question has the form:
+
+
+ !...
+ .XXX.!
+
+ The marginal vertices are marked with an exclamation point (`!').
+The captured `X' stones inside the eyespace are naturally marked `X'.
+
+ The precise algorithm by which the eye spaces are determined is
+somewhat complex. Documentation of this algorithm is in the comments in
+the source to the function `make_domains()' in `optics.c'.
+
+ The eyespaces can be conveniently displayed using a colored ascii
+diagram by running `gnugo -E'.
+
+
+File: gnugo.info, Node: Eye Space as Local Game, Next: Eye Example, Prev: Eye Space, Up: Eyes
+
+8.3 The eyespace as local game
+==============================
+
+In the abstraction, an eyespace consists of a set of vertices labelled:
+
+
+ ! . X
+
+ Tables of many eyespaces are found in the database
+`patterns/eyes.db'. Each of these may be thought of as a local game.
+The result of this game is listed after the eyespace in the form
+`:max,min', where `max' is the number of eyes the pattern yields if `O'
+moves first, while `min' is the number of eyes the pattern yields if
+`X' moves first. The player who owns the eye space is denoted `O'
+throughout this discussion. Since three eyes are no better than two,
+there is no attempt to decide whether the space yields two eyes or
+three, so max never exceeds 2. Patterns with min>1 are omitted from the
+table.
+
+ For example, we have:
+
+ Pattern 548
+
+ x
+ xX.!
+
+ :0111
+
+ Here notation is as above, except that `x' means `X' or `EMPTY'.
+The result of the pattern is not different if `X' has stones at these
+vertices or not.
+
+ We may abstract the local game as follows. The two players `O' and
+`X' take turns moving, or either may pass.
+
+ RULE 1: `O' for his move may remove any vertex marked `!' or marked
+`.'.
+
+ RULE 2: `X' for his move may replace a `.' by an `X'.
+
+ RULE 3: `X' may remove a `!'. In this case, each `.' adjacent to the
+`!' which is removed becomes a `!' . If an `X' adjoins the `!' which is
+removed, then that `X' and any which are connected to it are also
+removed. Any `.' which are adjacent to the removed `X''s then become
+`.'.
+
+ Thus if `O' moves first he can transform the eyeshape in the above
+example to:
+
+ ... or !...
+ .XXX.! .XXX.
+
+ However if `X' moves he may remove the `!' and the `.'s adjacent to
+the `!' become `!' themselves. Thus if `X' moves first he may transform
+the eyeshape to:
+
+ !.. or !..
+ .XXX.! .XXX!
+
+ NOTE: A nuance which is that after the `X:1', `O:2' exchange below,
+`O' is threatening to capture three X stones, hence has a half eye to
+the left of 2. This is subtle, and there are other such subtleties
+which our abstraction will not capture. Some of these at least can be
+dealt with by a refinements of the scheme, but we will content
+ourselves for the time being with a simplified model.
+
+
+ |- X - X X - - X O X O
+ |X - - - - - X X O O O
+ |O X X X X - - X O O O
+ |O O O O X - O X O O O
+ |1 2 . . O O O O X X O
+ |X O . X X X . 3 X O O
+ |X O O O O O O O X X O
+ |- X X O - O X O - - X
+ |X - - X - X X X X X X
+ |O X X O X - X O O X O
+
+ We will not attempt to characterize the terminal states of the local
+game (some of which could be seki) or the scoring.
+
+
+File: gnugo.info, Node: Eye Example, Next: Graphs, Prev: Eye Space as Local Game, Up: Eyes
+
+8.4 An example
+==============
+
+Here is a local game which yields exactly one eye, no matter who moves
+first:
+
+
+ !
+ ...
+ ...!
+
+ Here are some variations, assuming `O' moves first.
+
+ ! (start position)
+ ...
+ ...!
+
+
+ ... (after `O''s move)
+ ...!
+
+
+ ...
+ ..!
+
+
+ ...
+ ..
+
+
+ .X. (nakade)
+ ..
+
+ Here is another variation:
+
+
+ ! (start)
+ ...
+ ...!
+
+
+ ! (after `O''s move)
+ . .
+ ...!
+
+
+ ! (after `X''s move)
+ . .
+ ..X!
+
+
+ . .
+ ..X!
+
+
+ . !
+ .!
+
+
+File: gnugo.info, Node: Graphs, Next: Eye Shape, Prev: Eye Example, Up: Eyes
+
+8.5 Graphs
+==========
+
+It is a useful observation that the local game associated with an
+eyespace depends only on the underlying graph, which as a set consists
+of the set of vertices, in which two elements are connected by an edge
+if and only if they are adjacent on the Go board. For example the two
+eye shapes:
+
+
+ ..
+ ..
+
+ and
+
+ ....
+
+though distinct in shape have isomorphic graphs, and consequently they
+are isomorphic as local games. This reduces the number of eyeshapes in
+the database `patterns/eyes.db'.
+
+ A further simplification is obtained through our treatment of half
+eyes and false eyes. Such patterns are identified by the topological
+analysis (*note Eye Topology::).
+
+ A half eye is isomorphic to the pattern `(!.)' . To see this,
+consider the following two eye shapes:
+
+ XOOOOOO
+ X.....O
+ XOOOOOO
+ and:
+
+ XXOOOOO
+ XOa...O
+ XbOOOOO
+ XXXXXXX
+
+ These are equivalent eyeshapes, with isomorphic local games {2|1}.
+The first has shape:
+
+
+ !....
+
+ The second eyeshape has a half eye at `a' which is taken when `O' or
+`X' plays at `b'. This is found by the topological criterion (*note Eye
+Topology::).
+
+ The graph of the eye_shape, ostensibly `....' is modified by
+replacing the left `.' by `!.' during graph matching.
+
+ A false eye is isomorphic to the pattern `(!)' . To see this,
+consider the following eye shape:
+
+
+ XXXOOOOOO
+ X.Oa....O
+ XXXOOOOOO
+
+ This is equivalent to the two previous eyeshapes, with an isomorphic
+local game {2|1}.
+
+ This eyeshape has a false eye at `a'. This is also found by the
+topological criterion.
+
+ The graph of the eye_shape, ostensibly `.....' is modified by
+replacing the left `.' by `!'. This is made directly in the eye data,
+not only during graph matching.
+
+
+File: gnugo.info, Node: Eye Shape, Next: Eye Local Game Values, Prev: Graphs, Up: Eyes
+
+8.6 Eye shape analysis
+======================
+
+The patterns in `patterns/eyes.db' are compiled into graphs represented
+essentially by arrays in `patterns/eyes.c'.
+
+ Each actual eye space as it occurs on the board is also compiled
+into a graph. Half eyes are handled as follows. Referring to the
+example
+
+ XXOOOOO
+ XOa...O
+ XbOOOOO
+ XXXXXX
+
+repeated from the preceding discussion, the vertex at `b' is added to
+the eyespace as a marginal vertex. The adjacency condition in the graph
+is a macro (in `optics.c'): two vertices are adjacent if they are
+physically adjacent, or if one is a half eye and the other is its key
+point.
+
+ In `recognize_eyes()', each such graph arising from an actual
+eyespace is matched against the graphs in `eyes.c'. If a match is
+found, the result of the local game is known. If a graph cannot be
+matched, its local game is assumed to be {2|2}.
+
+
+File: gnugo.info, Node: Eye Local Game Values, Next: Eye Topology, Prev: Eye Shape, Up: Eyes
+
+8.7 Eye Local Game Values
+=========================
+
+The game values in `eyes.db' are given in a simplified scheme which is
+flexible enough to represent most possibilities in a useful way.
+
+ The colon line below the pattern gives the eye value of the matched
+eye shape. This consists of four digits, each of which is the number of
+eyes obtained during the following conditions:
+
+ 1. The attacker moves first and is allowed yet another move because
+ the defender plays tenuki.
+
+ 2. The attacker moves first and the defender responds locally.
+
+ 3. The defender moves first and the attacker responds locally.
+
+ 4. The defender moves first and is allowed yet another move because
+ the attacker plays tenuki.
+
+ The first case does *not* necessarily mean that the attacker is
+allowed two consecutive moves. This is explained with an example later.
+
+ Also, since two eyes suffice to live, all higher numbers also count
+as two.
+
+ The following 15 cases are of interest:
+
+ * 0000 0 eyes.
+
+ * 0001 0 eyes, but the defender can threaten to make one eye.
+
+ * 0002 0 eyes, but the defender can threaten to make two eyes.
+
+ * 0011 1/2 eye, 1 eye if defender moves first, 0 eyes if attacker
+ does.
+
+ * 0012 3/4 eyes, 3/2 eyes if defender moves first, 0 eyes if
+ attacker does.
+
+ * 0022 1* eye, 2 eyes if defender moves first, 0 eyes if attacker
+ does.
+
+ * 0111 1 eye, attacker can threaten to destroy the eye.
+
+ * 0112 1 eye, attacker can threaten to destroy the eye, defender can
+ threaten to make another eye.
+
+ * 0122 5/4 eyes, 2 eyes if defender moves first, 1/2 eye if attacker
+ does.
+
+ * 0222 2 eyes, attacker can threaten to destroy both.
+
+ * 1111 1 eye.
+
+ * 1112 1 eye, defender can threaten to make another eye.
+
+ * 1122 3/2 eyes, 2 eyes if defender moves first, 1 eye if attacker
+ does.
+
+ * 1222 2 eyes, attacker can threaten to destroy one eye.
+
+ * 2222 2 eyes.
+
+ The 3/4, 5/4, and 1* eye values are the same as in Howard Landman's
+paper Eyespace Values in Go. Attack and defense points are only marked
+in the patterns when they have definite effects on the eye value, i.e.
+pure threats are not marked.
+
+ Examples of all different cases can be found among the patterns in
+this file. Some of them might be slightly counterintuitive, so we
+explain one important case here. Consider
+
+ Pattern 6141
+
+ X
+ XX.@x
+
+ :1122
+
+ which e.g. matches in this position:
+
+ .OOOXXX
+ OOXOXOO
+ OXXba.O
+ OOOOOOO
+
+ Now it may look like `X' could take away both eyes by playing `a'
+followed by `b', giving 0122 as eye value. This is where the subtlety
+of the definition of the first digit in the eye value comes into play.
+It does not say that the attacker is allowed two consecutive moves but
+only that he is allowed to play "another move". The crucial property of
+this shape is that when `X' plays at a to destroy (at least) one eye,
+`O' can answer at `b', giving:
+
+
+ .OOOXXX
+ OO.OXOO
+ O.cOX.O
+ OOOOOOO
+
+ Now `X' has to continue at `c' in order to keep `O' at one eye.
+After this `O' plays tenuki and `X' cannot destroy the remaining eye by
+another move. Thus the eye value is indeed 1122.
+
+ As a final note, some of the eye values indicating a threat depend
+on suicide to be allowed, e.g.
+
+
+ Pattern 301
+
+ X.X
+
+ :1222
+
+ We always assume suicide to be allowed in this database. It is easy
+enough to sort out such moves at a higher level when suicide is
+disallowed.
+
+
+File: gnugo.info, Node: Eye Topology, Next: Eye Topology with Ko, Prev: Eye Local Game Values, Up: Eyes
+
+8.8 Topology of Half Eyes and False Eyes
+========================================
+
+A HALF EYE is a pattern where an eye may or may not materialize,
+depending on who moves first. Here is a half eye for `O':
+
+
+ OOXX
+ O.O.
+ OO.X
+
+ A FALSE EYE is an eye vertex which cannot become a proper eye. Here
+are two examples of false eyes for `O':
+
+
+ OOX OOX
+ O.O O.OO
+ XOO OOX
+
+ We describe now the topological algorithm used to find half eyes and
+false eyes. In this section we ignore the possibility of ko.
+
+ False eyes and half eyes can locally be characterized by the status
+of the diagonal intersections from an eye space. For each diagonal
+intersection, which is not within the eye space, there are three
+distinct possibilities:
+
+ * occupied by an enemy (`X') stone, which cannot be captured.
+
+ * either empty and `X' can safely play there, or occupied by an
+ `X' stone that can both be attacked and defended.
+
+ * occupied by an `O' stone, an `X' stone that can be attacked but
+ not defended, or it's empty and `X' cannot safely play there.
+
+ We give the first possibility a value of two, the second a value of
+one, and the last a value of zero. Summing the values for the diagonal
+intersections, we have the following criteria:
+
+ * sum >= 4: false eye
+
+ * sum == 3: half eye
+
+ * sum <= 2: proper eye
+
+ If the eye space is on the edge, the numbers above should be
+decreased by 2. An alternative approach is to award diagonal points
+which are outside the board a value of 1. To obtain an exact
+equivalence we must however give value 0 to the points diagonally off
+the corners, i.e. the points with both coordinates out of bounds.
+
+ The algorithm to find all topologically false eyes and half eyes is:
+
+ For all eye space points with at most one neighbor in the eye space,
+evaluate the status of the diagonal intersections according to the
+criteria above and classify the point from the sum of the values.
+
+
+File: gnugo.info, Node: Eye Topology with Ko, Next: False Margins, Prev: Eye Topology, Up: Eyes
+
+8.9 Eye Topology with Ko
+========================
+
+This section extends the topological eye analysis to handle ko. We
+distinguish between a ko in favor of `O' and one in favor of `X':
+
+ .?O? good for O
+ OO.O
+ O.O?
+ XOX.
+ .X..
+ .?O? good for X
+ OO.O
+ OXO?
+ X.X.
+ .X..
+
+ Preliminarily we give the former the symbolic diagonal value `a' and
+the latter the diagonal value `b'. We should clearly have `0 < a < 1 <
+b < 2'. Letting `e' be the topological eye value (still the sum of the
+four diagonal values), we want to have the following properties:
+
+ e <= 2 - proper eye
+ 2 < e < 3 - worse than proper eye, better than half eye
+ e = 3 - half eye
+ 3 < e < 4 - worse than half eye, better than false eye
+ e >= 4 - false eye
+
+ In order to determine the appropriate values of `a' and `b' we
+analyze the typical cases of ko contingent topological eyes:
+
+ .X.. (slightly) better than proper eye
+ (a) ..OO e < 2
+ OO.O
+ O.OO e = 1 + a
+ XOX.
+ .X..
+
+ .X.. better than half eye, worse than proper eye
+ (a') ..OO 2 < e < 3
+ OO.O
+ OXOO e = 1 + b
+ X.X.
+ .X..
+
+ .X.. better than half eye, worse than proper eye
+ (b) .XOO 2 < e < 3
+ OO.O
+ O.OO e = 2 + a
+ XOX.
+ .X..
+
+ .X.. better than false eye, worse than half eye
+ (b') .XOO 3 < e < 4
+ OO.O
+ OXOO e = 2 + b
+ X.X.
+ .X..
+
+ .X..
+ XOX. (slightly) better than proper eye
+ (c) O.OO e < 2
+ OO.O
+ O.OO e = 2a
+ XOX.
+ .X..
+
+ .X..
+ XOX. proper eye, some aji
+ (c') O.OO e ~ 2
+ OO.O
+ OXOO e = a + b
+ X.X.
+ .X..
+
+ .X..
+ X.X. better than half eye, worse than proper eye
+ (c'') OXOO 2 < e < 3
+ OO.O
+ OXOO e = 2b
+ X.X.
+ .X..
+
+ .X...
+ XOX.. better than half eye, worse than proper eye
+ (d) O.O.X 2 < e < 3
+ OO.O.
+ O.OO. e = 1 + 2a
+ XOX..
+ .X...
+
+ .X...
+ XOX.. half eye, some aji
+ (d') O.O.X e ~ 3
+ OO.O.
+ OXOO. e = 1 + a + b
+ X.X..
+ .X...
+
+ .X...
+ X.X.. better than false eye, worse than half eye
+ (d'') OXO.X 3 < e < 4
+ OO.O.
+ OXOO. e = 1 + 2b
+ X.X..
+ .X...
+
+ .X...
+ XOX.. better than false eye, worse than half eye
+ (e) O.OXX 3 < e < 4
+ OO.O.
+ O.OO. e = 2 + 2a
+ XOX..
+ .X...
+
+ .X...
+ XOX.. false eye, some aji
+ (e') O.OXX e ~ 4
+ OO.O.
+ OXOO. e = 2 + a + b
+ X.X..
+ .X...
+
+ .X...
+ X.X.. (slightly) worse than false eye
+ (e'') OXOXX 4 < e
+ OO.O.
+ OXOO. e = 2 + 2b
+ X.X..
+ .X...
+
+ It may seem obvious that we should use
+ (i) a=1/2, b=3/2
+ but this turns out to have some drawbacks. These can be solved by
+using either of
+ (ii) a=2/3, b=4/3
+ (iii) a=3/4, b=5/4
+ (iv) a=4/5, b=6/5
+
+ Summarizing the analysis above we have the following table for the
+four different choices of `a' and `b'.
+
+ case symbolic a=1/2 a=2/3 a=3/4 a=4/5 desired
+ value b=3/2 b=4/3 b=5/4 b=6/5 interval
+ (a) 1+a 1.5 1.67 1.75 1.8 e < 2
+ (a') 1+b 2.5 2.33 2.25 2.2 2 < e < 3
+ (b) 2+a 2.5 2.67 2.75 2.8 2 < e < 3
+ (b') 2+b 3.5 3.33 3.25 3.2 3 < e < 4
+ (c) 2a 1 1.33 1.5 1.6 e < 2
+ (c') a+b 2 2 2 2 e ~ 2
+ (c'') 2b 3 2.67 2.5 2.4 2 < e < 3
+ (d) 1+2a 2 2.33 2.5 2.6 2 < e < 3
+ (d') 1+a+b 3 3 3 3 e ~ 3
+ (d'') 1+2b 4 3.67 3.5 3.4 3 < e < 4
+ (e) 2+2a 3 3.33 3.5 3.6 3 < e < 4
+ (e') 2+a+b 4 4 4 4 e ~ 4
+ (e'') 2+2b 5 4.67 4.5 4.4 4 < e
+
+ We can notice that (i) fails for the cases (c"), (d), (d"), and (e).
+The other three choices get all values in the correct intervals. The
+main distinction between them is the relative ordering of (c") and (d)
+(or analogously (d") and (e)). If we do a more detailed analysis of
+these we can see that in both cases `O' can secure the eye
+unconditionally if he moves first while `X' can falsify it with ko if
+he moves first. The difference is that in (c"), `X' has to make the
+first ko threat, while in (d), O has to make the first ko threat. Thus
+(c") is better for O and ought to have a smaller topological eye value
+than (d). This gives an indication that (iv) is the better choice.
+
+ We can notice that any value of `a', `b' satisfying `a+b=2' and
+`3/4antisuji(a)
+
+ The line starting with `>' is the action line. In this case it tells
+the move generation that the move at a should not be considered,
+whatever move reasons are found by other patterns. The action line uses
+the labels from the constraint diagram. Both constraint and action can
+be used in the same pattern. If the action only needs to refer to `*',
+no constraint diagram is required. Like constraints, actions can span
+multiple lines.
+
+ Here is a partial list of the autohelper macros which are typically
+called from action lines. This list is not complete. If you cannot find
+an autohelper macro in an action line in this list, consult `mkpat.c' to
+find out what function in the engine is actually called. If no macro
+exists which does what you want, you can add macros by editing the list
+in `mkpat.c'.
+
+ * `antisuji(a);'
+
+ Mark `a' as an antisuji, that is, a move that must never be
+ played.
+
+ * `replace(a,*)'
+
+ This is appropriate if the move at `*' is definitely better
+ than the move at `a'. The macro adds a point redistribution
+ rule. Any points which are assigned to `a' during the move
+ generation by any move reason are redistributed to `*'.
+
+ * `prevent_attack_threat(a)'
+
+ Add a reverse followup value because the opponent's move here
+ would threaten to capture `a'.
+
+ * `threaten_to_save(a)'
+
+ Add a followup value because the move at `*' threatens to
+ rescue the dead string at `a'.
+
+ * `defend_against_atari(a)'
+
+ Estimate the value of defending the string `a' which can be
+ put into atari and add this as a reverse followup value.
+
+ * `add_defend_both_move(a,b);'
+
+
+ * `add_cut_move(c,d);'
+
+ Add to the move reasons that the move at `*' threatens to cut
+ `c' and `d'.
+
+
+File: gnugo.info, Node: Autohelper Functions, Next: Attack and Defense DB, Prev: Autohelper Actions, Up: Patterns
+
+9.7 Autohelper Functions
+========================
+
+The autohelper functions are translated into C code by the program in
+`mkpat.c'. To see exactly how the functions are implemented, consult
+the autohelper function definitions in that file. Autohelper functions
+can be used in both constraint and action lines.
+
+
+ `lib(x)'
+ `lib2(x)'
+ `lib3(x)'
+ `lib4(x)'
+
+ Number of first, second, third, and fourth order liberties of a worm
+respectively. *Note Worms and Dragons::, the documentation on worms for
+definitions.
+
+
+ `xlib(x)'
+ `olib(x)'
+
+ The number of liberties that an enemy or own stone, respectively,
+would obtain if played at the empty intersection `x'.
+
+ `xcut(x)'
+ `ocut(x)'
+
+ Calls `cut_possible' (*note General Utilities::) to determine
+whether `X' or `O' can cut at the empty intersection `x'.
+
+ `ko(x)'
+
+ True if `x' is either a stone or an empty point involved in a ko
+position.
+
+ `status(x)'
+
+ The matcher status of a dragon. status(x) returns an integer that
+can have the values `ALIVE', `UNKNOWN', `CRITICAL', or `DEAD' (*note
+Worms and Dragons::).
+
+ `alive(x)'
+ `unknown(x)'
+ `critical(x)'
+ `dead(x)'
+
+ Each function true if the dragon has the corresponding matcher
+status and false otherwise (*note Worms and Dragons::).
+
+ `status(x)'
+
+ Returns the status of the dragon at `x' (*note Worms and Dragons::).
+
+ `genus(x)'
+
+ The number of eyes of a dragon. It is only meaningful to compare this
+value against 0, 1, or 2.
+
+
+ `xarea(x)'
+ `oarea(x)'
+ `xmoyo(x)'
+ `omoyo(x)'
+ `xterri(x)'
+ `oterri(x)'
+
+ These functions call `whose_territory()', `whose_moyo()' and
+`whose_area()' (*note Territory and Moyo::). For example `xarea(x)'
+evaluates to true if `x' is either a living enemy stone or an empty
+point within the opponent's "area". The function `oarea(x)' is
+analogous but with respect to our stones and area. The main difference
+between area, moyo, and terri is that area is a very far reaching kind
+of influence, moyo gives a more realistic estimate of what may turn in
+to territory, and terri gives the points that already are believed to
+be secure territory.
+
+ `weak(x)'
+
+ True for a dragon that is perceived as weak.
+
+
+ `attack(x)'
+ `defend(x)'
+
+ Results of tactical reading. `attack(x)' is true if the worm can be
+captured, `defend(x)' is true if there also is a defending move. Please
+notice that `defend(x)' will return false if there is no attack on the
+worm.
+
+
+ `safe_xmove(x)'
+ `safe_omove(x)'
+
+ True if an enemy or friendly stone, respectively, can safely be
+played at `x'. By safe it is understood that the move is legal and that
+it cannot be captured right away.
+
+
+ `legal_xmove(x)'
+ `legal_omove(x)'
+
+ True if an enemy or friendly stone, respectively, can legally be
+played at x.
+
+
+ o_somewhere(x,y,z, ...)
+ x_somewhere(x,y,z, ...)
+
+ True if O (respectively X) has a stone at one of the labelled
+vertices. In the diagram, these vertices should be marked with a `?'.
+
+
+ odefend_against(x,y)
+ xdefend_against(x,y)
+
+ True if an own stone at `x' would stop the enemy from safely playing
+at `y', and conversely for the second function.
+
+
+ `does_defend(x,y)'
+ `does_attack(x,y)'
+
+ True if a move at `x' defends/attacks the worm at `y'. For defense a
+move of the same color as `y' is tried and for attack a move of the
+opposite color.
+
+
+ `xplay_defend(a,b,c,...,z)'
+ `oplay_defend(a,b,c,...,z)'
+ `xplay_attack(a,b,c,...,z)'
+ `oplay_attack(a,b,c,...,z)'
+
+ These functions make it possible to do more complex reading
+experiments in the constraints. All of them work so that first the
+sequence of moves `a',`b',`c',... is played through with alternating
+colors, starting with `X' or `O' as indicated by the name. Then it is
+tested whether the worm at `z' can be attacked or defended,
+respectively. It doesn't matter who would be in turn to move, a worm of
+either color may be attacked or defended. For attacks the opposite
+color of the string being attacked starts moving and for defense the
+same color starts. The defend functions return true if the worm cannot
+be attacked in the position or if it can be attacked but also defended.
+The attack functions return true if there is a way to capture the worm,
+whether or not it can also be defended. If there is no stone present at
+`z' after the moves have been played, it is assumed that an attack has
+already been successful or a defense has already failed. If some of
+the moves should happen to be illegal, typically because it would have
+been suicide, the following moves are played as if nothing has happened
+and the attack or defense is tested as usual. It is assumed that this
+convention will give the relevant result without requiring a lot of
+special cases.
+
+ The special label `?' can be used to represent a tenuki. Thus
+`oplay_defend(a,?,b,c)' tries moves by `O' at `a' and `b', as if `X'
+plays the second move in another part of the board, then asks if `c'
+can be defended. The tenuki cannot be the first move of the sequence,
+nor does it need to be: instead of `oplay_defend(?,a,b,c)' you can use
+`xplay_defend(a,b,c)'.
+
+ `xplay_defend_both(a,b,c,...,y,z)'
+ `oplay_defend_both(a,b,c,...,y,z)'
+ `xplay_attack_either(a,b,c,...,y,z)'
+ `oplay_attack_either(a,b,c,...,y,z)'
+
+ These functions are similar to the previous ones. The difference is
+that the last *two* arguments denote worms to be attacked or defended
+simultaneously. Obviously `y' and `z' must have the same color. If
+either location is empty, it is assumed that an attack has been
+successful or a defense has failed. The typical use for these functions
+is in cutting patterns, where it usually suffices to capture either
+cutstone.
+
+ The function `xplay_defend_both' plays alternate moves beginning
+with an `X' at `a'. Then it passes the last two arguments to
+`defend_both' in `engine/utils.c'. This function checks to determine
+whether the two strings can be simultaneously defended.
+
+ The function `xplay_attack_either' plays alternate moves beginning
+with an `X' move at `a'. Then it passes the last two arguments to
+`attack_either' in `engine/utils.c'. This function looks for a move
+which captures at least one of the two strings. In its current
+implementation `attack_either' only looks for uncoordinated attacks and
+would thus miss a double atari.
+
+ `xplay_connect(a,b,c,...,y,z)'
+ `oplay_connect(a,b,c,...,y,z)'
+ `xplay_disconnect(a,b,c,...,y,z)'
+ `oplay_disconnect(a,b,c,...,y,z)'
+
+ The function `xplay_connect(a,b,c,...,y,z)' begins with an `X' move
+at `a', then an `O' move at `b', and so forth, then finally calls
+`string_connect()' to determine whether `x' and `y' can be connected.
+The other functions are similar (*note Connection Reading::).
+
+
+ `xplay_break_through(a,b,c,...,x,y,z)'
+ `oplay_break_through(a,b,c,...,x,y,z)'
+
+ These functions are used to set up a position like
+
+
+ .O. .y.
+ OXO xXz
+
+and `X' aims at capturing at least one of `x', `y', and `z'. If this
+succeeds `1' is returned. If it doesn't, `X' tries instead to cut
+through on either side and if this succeeds, `2' is returned. Of course
+the same shape with opposite colors can also be used.
+
+ Important notice: `x', `y', and `z' must be given in the order they
+have in the diagram above, or any reflection and/or rotation of it.
+
+ seki_helper(x)
+
+ Checks whether the string at `x' can attack any surrounding string.
+If so, return false as the move to create a seki (probably) wouldn't
+work.
+
+ threaten_to_save(x)
+
+ Calls `add_followup_value' to add as a move reason a conservative
+estimate of the value of saving the string `x' by capturing one opponent
+stone.
+
+ area_stone(x)
+
+ Returns the number of stones in the area around `x'.
+
+ area_space(x)
+
+ Returns the amount of space in the area around `x'.
+
+ `eye(x)'
+ `proper_eye(x)'
+ `marginal_eye(x)'
+
+ True if `x' is an eye space for either color, a non-marginal eye
+space for either color, or a marginal eye space for either color,
+respectively.
+
+ `antisuji(x)'
+
+ Tell the move generation that `x' is a substandard move that never
+should be played.
+
+ same_dragon(x,y)
+ same_worm(x,y)
+
+ Return true if `x' and `y' are the same dragon or worm respectively.
+
+ `dragonsize(x)'
+ `wormsize(x)'
+
+ Number of stones in the indicated dragon or worm.
+
+ `add_connect_move(x,y)'
+ `add_cut_move(x,y)'
+ `add_attack_either_move(x,y)'
+ `add_defend_both_move(x,y)'
+
+ Explicitly notify the move generation about move reasons for the move
+in the pattern.
+
+ `halfeye(x)'
+
+ Returns true if the empty intersection at `x' is a half eye.
+
+ `remove_attack(x)'
+
+ Inform the tactical reading that a supposed attack does in fact not
+work.
+
+ `potential_cutstone(x)'
+
+ True if `cutstone2' field from worm data is larger than one. This
+indicates that saving the worm would introduce at least two new cutting
+points.
+
+ `not_lunch(x,y)'
+
+ Prevents the misreporting of `x' as lunch for `y'. For example, the
+following pattern tells GNU Go that even though the stone at `a' can be
+captured, it should not be considered "lunch" for the dragon at `b',
+because capturing it does not produce an eye:
+
+ XO| ba|
+ O*| O*|
+ oo| oo|
+ ?o| ?o|
+
+ > not_lunch(a,b)
+
+ `vital_chain(x)'
+
+ Calls `vital_chain' to determine whether capturing the stone at `x'
+will result in one eye for an adjacent dragon. The current
+implementation just checks that the stone is not a singleton on the
+first line.
+
+ `amalgamate(x,y)'
+
+ Amalgamate (join) the dragons at `x' and `y' (*note Worms and
+Dragons::).
+
+ `amalgamate_most_valuable(x,y,z)'
+
+ Called when `x', `y', `z' point to three (preferably distinct)
+dragons, in situations such as this:
+
+
+ .O.X
+ X*OX
+ .O.X
+
+ In this situation, the opponent can play at `*', preventing the
+three dragons from becoming connected. However `O' can decide which cut
+to allow. The helper amalgamates the dragon at `y' with either `x' or
+`z', whichever is largest.
+
+ make_proper_eye(x)
+
+ This autohelper should be called when `x' is an eyespace which is
+misidentified as marginal. It is reclassified as a proper eyespace
+(*note Eye Space::).
+
+ remove_halfeye(x)
+
+ Remove a half eye from the eyespace. This helper should not be run
+after `make_dragons' is finished, since by that time the eyespaces have
+already been analyzed.
+
+ remove_eyepoint(x)
+
+ Remove an eye point. This function can only be used before the
+segmentation into eyespaces.
+
+ `owl_topological_eye(x,y)'
+
+ Here `x' is an empty intersection which may be an eye or half eye
+for some dragon, and `y' is a stone of the dragon, used only to
+determine the color of the eyespace in question. Returns the sum of the
+values of the diagonal intersections, relative to `x', as explained in
+*Note Eye Topology::, equal to 4 or more if the eye at `x' is false, 3
+if it is a half eye, and 2 if it is a true eye.
+
+ `owl_escape_value(x)'
+
+ Returns the escape value at `x'. This is only useful in owl attack
+and defense patterns.
+
+
+File: gnugo.info, Node: Attack and Defense DB, Next: Connections Database, Prev: Autohelper Functions, Up: Patterns
+
+9.8 Attack and Defense Database
+===============================
+
+The patterns in `attack.db' and `defense.db' are used to assist the
+tactical reading in finding moves that attacks or defends worms. The
+matching is performed during `make_worms()', at the time when the
+tactical status of all worms is decided. None of the classes described
+above are useful in these databases, instead we have two other classes.
+
+`D'
+ For each `O' worm in the pattern that can be tactically captured
+ (`worm[m][n].attack_code != 0'), the move at `*' is tried. If it
+ is found to defend the stone, this is registered as a reason for
+ the move `*' and the defense point of the worm is set to `*'.
+
+`A'
+ For each `X' worm in the pattern, it's tested whether the move at
+ `*' captures the worm. If that is the case, this is registered as
+ a reason for the move at `*'. The attack point of the worm is set
+ to `*' and if it wasn't attacked before, a defense is searched for.
+
+ Furthermore, `A' patterns can only be used in `attack.db' and `D'
+patterns only in `defense.db'. Unclassified patterns may appear in
+these databases, but then they must work through actions to be
+effective.
+
+
+File: gnugo.info, Node: Connections Database, Next: Connection Functions, Prev: Attack and Defense DB, Up: Patterns
+
+9.9 The Connections Database
+============================
+
+The patterns in `conn.db' are used for helping `make_dragons()'
+amalgamate worms into dragons and to some extent for modifying eye
+spaces. The patterns in this database use the classifications `B',
+`C', and `e'. `B' patterns are used for finding cutting points, where
+amalgamation should not be performed, `C' patterns are used for finding
+existing connections, over which amalgamation is to be done, and `e'
+patterns are used for modifying eye spaces and reevaluating lunches.
+There are also some patterns without classification, which use action
+lines to have an impact. These are matched together with the `C'
+patterns. Further details and examples can be found in *Note Worms and
+Dragons::.
+
+ We will illustrate these databases by example. In this situation:
+
+ XOO
+ O.O
+ ...
+ `X' cannot play safely at the cutting point, so the `O' dragons are
+to be amalgamated. Two patterns are matched here:
+
+ Pattern CC204
+
+ O
+ .
+ O
+
+ :+,C
+
+ O
+ A
+ O
+
+ ;!safe_xmove(A) && !ko(A) && !xcut(A)
+
+ Pattern CC205
+
+ XO
+ O.
+
+ :\,C
+
+ AO
+ OB
+
+ ;attack(A) || (!safe_xmove(B) && !ko(B) && !xcut(B))
+
+ The constraints are mostly clear. For example the second pattern
+should not be matched if the `X' stone cannot be attacked and `X' can
+play safely at `B', or if `B' is a ko. The constraint `!xcut(B)' means
+that connection has not previously been inhibited by `find_cuts'. For
+example consider this situation:
+
+
+ OOXX
+ O.OX
+ X..O
+ X.OO
+ The previous pattern is matched here twice, yet `X' can push in and
+break one of the connections. To fix this, we include a pattern:
+
+ Pattern CB11
+
+ ?OX?
+ O!OX
+ ?*!O
+ ??O?
+
+ :8,B
+
+ ?OA?
+ OaOB
+ ?*bO
+ ??O?
+
+ ; !attack(A) && !attack(B) && !xplay_attack(*,a,b,*) && !xplay_attack(*,b,a,*)
+
+ After this pattern is found, the `xcut' autohelper macro will return
+true at any of the points `*', `a' and `b'. Thus the patterns `CB204'
+and `CB205' will not be matched, and the dragons will not be
+amalgamated.
+
+
+File: gnugo.info, Node: Connection Functions, Next: Tuning, Prev: Connections Database, Up: Patterns
+
+9.10 Connections Functions
+==========================
+
+Here are the public functions in `connections.c'.
+
+ * `static void cut_connect_callback(int m, int n, int color,
+ struct pattern *pattern, int ll, void *data)'
+
+ Try to match all (permutations of) connection patterns at
+ `(m,n)'. For each match, if it is a B pattern, set cutting
+ point in worm data structure and make eye space marginal for
+ the connection inhibiting entries of the pattern. If it is a
+ `C' pattern, amalgamate the dragons in the pattern.
+
+ * `void find_cuts(void)'
+
+ Find cutting points which should inhibit amalgamations and
+ sever the adjacent eye space. This goes through the
+ connection database consulting only patterns of type B. When
+ such a function is found, the function `cut_connect_callback'
+ is invoked.
+
+ * `void find_connections(void)'
+
+ Find explicit connection patterns and amalgamate the involved
+ dragons. This goes through the connection database
+ consulting patterns except those of type B, E or e. When such
+ a function is found, the function `cut_connect_callback' is
+ invoked.
+
+ * void modify_eye_spaces1(void)
+
+ Find explicit connection patterns and amalgamate the involved
+ dragons. This goes through the connection database
+ consulting only patterns of type E (*note Connections
+ Database::). When such a function is found, the function
+ `cut_connect_callback' is invoked.
+
+ * void modify_eye_spaces1(void)
+
+ Find explicit connection patterns and amalgamate the involved
+ dragons. This goes through the connection database
+ consulting only patterns of type e (*note Connections
+ Database::). When such a function is found, the function
+ `cut_connect_callback' is invoked.
+
+
+File: gnugo.info, Node: Tuning, Next: PM Implementation, Prev: Connection Functions, Up: Patterns
+
+9.11 Tuning the Pattern databases
+=================================
+
+Since the pattern databases, together with the valuation of move
+reasons, decide GNU Go's personality, much time can be devoted to
+"tuning" them. Here are some suggestions.
+
+ If you want to experiment with modifying the pattern database, invoke
+with the `-a' option. This will cause every pattern to be evaluated,
+even when some of them may be skipped due to various optimizations.
+
+ You can obtain a Smart Game Format (SGF) record of your game in at
+least two different ways. One is to use CGoban to record the game. You
+can also have GNU Go record the game in Smart Game Format, using the
+`-o' option. It is best to combine this with `-a'. Do not try to read
+the SGF file until the game is finished and you have closed the game
+window. This does not mean that you have to play the game out to its
+conclusion. You may close the CGoban window on the game and GNU Go will
+close the SGF file so that you can read it.
+
+ If you record a game in SGF form using the `-o' option, GNU Go will
+add labels to the board to show all the moves it considered, with their
+values. This is an extremely useful feature, since one can see at a
+glance whether the right moves with appropriate weights are being
+proposed by the move generation.
+
+ First, due to a bug of unknown nature, it occasionally happens that
+GNU Go will not receive the `SIGTERM' signal from CGoban that it needs
+to know that the game is over. When this happens, the SGF file ends
+without a closing parenthesis, and CGoban will not open the file. You
+can fix the file by typing:
+
+
+ echo ")" >>[filename]
+
+at the command line to add this closing parenthesis. Or you could add
+the ) using an editor.
+
+ Move values exceeding 99 (these should be rare) can be displayed by
+CGoban but you may have to resize the window in order to see all three
+digits. Grab the lower right margin of the CGoban window and pull it
+until the window is large. All three digits should be visible.
+
+ If you are playing a game without the `-o' option and you wish to
+analyze a move, you may still use CGoban's "Save Game" button to get an
+SGF file. It will not have the values of the moves labelled, of course.
+
+ Once you have a game saved in SGF format, you can analyze any
+particular move by running:
+
+
+ gnugo -l [filename] -L [move number] -t -a -w
+
+to see why GNU Go made that move, and if you make changes to the
+pattern database and recompile the program, you may ask GNU Go to
+repeat the move to see how the behavior changes. If you're using emacs,
+it's a good idea to run GNU Go in a shell in a buffer (M-x shell) since
+this gives good navigation and search facilities.
+
+ Instead of a move number, you can also give a board coordinate to
+`-L' in order to stop at the first move played at this location. If you
+omit the `-L' option, the move after those in the file will be
+considered.
+
+ If a bad move is proposed, this can have several reasons. To begin
+with, each move should be valued in terms of actual points on the
+board, as accurately as can be expected by the program. If it's not,
+something is wrong. This may have two reasons. One possibility is that
+there are reasons missing for the move or that bogus reasons have been
+found. The other possibility is that the move reasons have been
+misevaluated by the move valuation functions. Tuning of patterns is
+with a few exceptions a question of fixing the first kind of problems.
+
+ If there are bogus move reasons found, search through the trace
+output for the pattern that is responsible. (Some move reasons, e.g.
+most tactical attack and defense, do not originate from patterns. If no
+pattern produced the bogus move reason, it is not a tuning problem.)
+Probably this pattern was too general or had a faulty constraint. Try
+to make it more specific or correct bugs if there were any. If the
+pattern and the constraint looks right, verify that the tactical
+reading evaluates the constraint correctly. If not, this is either a
+reading bug or a case where the reading is too complicated for GNU Go.
+
+ If a connecting move reason is found, but the strings are already
+effectively connected, there may be missing patterns in `conn.db'.
+Similarly, worms may be incorrectly amalgamated due to some too general
+or faulty pattern in `conn.db'. To get trace output from the matching
+of patterns in `conn.db' you need to add a second `-t' option.
+
+ If a move reason is missing, there may be a hole in the database. It
+could also be caused by some existing pattern being needlessly
+specific, having a faulty constraint, or being rejected due to a
+reading mistake. Unless you are familiar with the pattern databases, it
+may be hard to verify that there really is a pattern missing. Look
+around the databases to try to get a feeling for how they are
+organized. (This is admittedly a weak point of the pattern databases,
+but the goal is to make them more organized with time.) If you decide
+that a new pattern is needed, try to make it as general as possible,
+without allowing incorrect matches, by using proper classification from
+among snOoXx and constraints. The reading functions can be put to good
+use. The reason for making the patterns as general as they can be is
+that we need a smaller number of them then, which makes the database
+much easier to maintain. Of course, if you need too complicated
+constraints, it's usually better to split the pattern.
+
+ If a move has the correct set of reasons but still is misevaluated,
+this is usually not a tuning problem. There are, however, some
+possibilities to work around these mistakes with the use of patterns.
+In particular, if the territorial value is off because `delta_terri()'
+give strange results, the (min)terri and maxterri values can be set by
+patterns as a workaround. This is typically done by the endgame
+patterns, where we can know the (minimum) value fairly well from the
+pattern. If it should be needed, (min)value and maxvalue can be used
+similarly. These possibilities should be used conservatively though,
+since such patterns are likely to become obsolete when better (or at
+least different) functions for e.g. territory estimation are being
+developed.
+
+ In order to choose between moves with the same move reasons, e.g.
+moves that connect two dragons in different ways, patterns with a
+nonzero shape value should be used. These should give positive shape
+values for moves that give good shape or good aji and negative values
+for bad shape and bad aji. Notice that these values are additive, so
+it's important that the matches are unique.
+
+ Sente moves are indicated by the use of the pattern followup value.
+This can usually not be estimated very accurately, but a good rule is
+to be rather conservative. As usual it should be measured in terms of
+actual points on the board. These values are also additive so the same
+care must be taken to avoid unintended multiple matches.
+
+ You can also get a visual display of the dragons using the `-T'
+option. The default GNU Go configuration tries to build a version with
+color support using either curses or the ansi escape sequences. You are
+more likely to find color support in rxvt than xterm, at least on many
+systems, so we recommend running:
+
+ gnugo -l [filename] -L [move number] -T
+
+in an rxvt window. If you do not see a color display, and if your host
+is a GNU/Linux machine, try this again in the Linux console.
+
+ Worms belonging to the same dragon are labelled with the same
+letters. The colors indicate the value of the field `dragon.safety',
+which is set in `moyo.c'.
+
+Green: GNU Go thinks the dragon is alive
+Yellow: Status unknown
+Blue: GNU Go thinks the dragon is dead
+Red: Status critical (1.5 eyes) or weak by the algorithm
+ in `moyo.c'
+
+ If you want to get the same game over and over again, you can
+eliminate the randomness in GNU Go's play by providing a fixed random
+seed with the `-r' option.
+
+
+File: gnugo.info, Node: PM Implementation, Next: Symmetry & transformations, Prev: Tuning, Up: Patterns
+
+9.12 Implementation
+===================
+
+The pattern code in GNU Go is fairly straightforward conceptually, but
+because the matcher consumes a significant part of the time in choosing
+a move, the code is optimized for speed. Because of this there are
+implementation details which obscure things slightly.
+
+ In GNU Go, the ascii `.db' files are precompiled into tables (see
+`patterns.h') by a standalone program `mkpat.c', and the resulting `.c'
+files are compiled and linked into the main GNU Go executable.
+
+ Each pattern is compiled to a header, and a sequence of elements,
+which are (notionally) checked sequentially at every position and
+orientation of the board. These elements are relative to the pattern
+'anchor' (or origin). One `X' or `O' stone is (arbitrarily) chosen to
+represent the origin of the pattern. (We cannot dictate one or the
+other since some patterns contain only one colour or the other.) All
+the elements are in co-ordinates relative to this position. So a
+pattern matches "at" board position `(m,n,o)' if the the pattern anchor
+stone is on `(m,n)', and the other elements match the board when the
+pattern is transformed by transformation number `o'. (See below for the
+details of the transformations, though these should not be necessary)
+
+
+File: gnugo.info, Node: Symmetry & transformations, Next: Details, Prev: PM Implementation, Up: Patterns
+
+9.13 Symmetry and transformations
+=================================
+
+In general, each pattern must be tried in each of 8 different
+permutations, to reflect the symmetry of the board. But some patterns
+have symmetries which mean that it is unnecessary (and therefore
+inefficient) to try all eight. The first character after the `:' can be
+one of `8',`|',`\',`/', `X', `-', `+', representing the axes of
+symmetry. It can also be `O', representing symmetry under 180 degrees
+rotation.
+
+transformation I - | . \ l r /
+ ABC GHI CBA IHG ADG CFI GDA IFC
+ DEF DEF FED FED BEH BEH HEB HEB
+ GHI ABC IHG CBA CFI ADG IFC GDA
+
+ a b c d e f g h
+
+ Then if the pattern has the following symmetries, the following are
+true:
+
+
+ | c=a, d=b, g=e, h=f
+ - b=a, c=d, e=f, g=h
+ \ e=a, g=b, f=c, h=d
+ / h=a, f=b, g=c, e=d
+ O a=d, b=c, e=h, f=g
+ X a=d=e=h, b=c=f=g
+ + a=b=c=d, e=f=g=h
+
+ We can choose to use transformations a,d,f,g as the unique
+transformations for patterns with either `|', `-', `\', or `/' symmetry.
+
+ Thus we choose to order the transformations a,g,d,f,h,b,e,c and
+choose first 2 for `X' and `+', the first 4 for `|', `-', `/', and `\',
+the middle 4 for `O', and all 8 for non-symmetrical patterns.
+
+ Each of the reflection operations (e-h) is equivalent to reflection
+about one arbitrary axis followed by one of the rotations (a-d). We
+can choose to reflect about the axis of symmetry (which causes no net
+change) and can therefore conclude that each of e-h is equivalent to
+the reflection (no-op) followed by a-d. This argument therefore
+extends to include `-' and `/' as well as `|' and `\'.
+
+
+File: gnugo.info, Node: Details, Next: Grid optimization, Prev: Symmetry & transformations, Up: Patterns
+
+9.14 Implementation Details
+===========================
+
+ 1. An entry in the pattern header states whether the anchor is an `X'
+ or an `O'. This helps performance, since all transformations can be
+ rejected at once if the anchor stone does not match. (Ideally, we
+ could just define that the anchor is always `O' or always `X', but
+ some patterns contain no `O' and some contain no `X'.)
+
+ 2. The pattern header contains the size of the pattern (ie the
+ co-ordinates of the top left and bottom right elements) relative to
+ the anchor. This allows the pattern can be rejected quickly if
+ there is not room for the pattern to fit around the anchor stone
+ in a given orientation (ie it is too near the edge of the board).
+ The bounding box information must first be transformed like the
+ elements before it can be tested, and after transforming, we need
+ to work out where the top-left and bottom-right corners are.
+
+ 3. The edge constraints are implemented by notionally padding the
+ pattern with rows or columns of `?' until it is exactly 19 (or
+ whatever the current board size is) elements wide or high. Then the
+ pattern is quickly rejected by (ii) above if it is not at the
+ edge. So the example pattern above is compiled as if it was written
+
+
+ "example"
+ .OO????????????????
+ *XX????????????????
+ o??????????????????
+ :8,80
+
+ 4. The elements in a pattern are sorted so that non-space elements
+ are checked before space elements. It is hoped that, for most of
+ the game, more squares are empty, and so the pattern can be more
+ quickly rejected doing it this way.
+
+ 5. The actual tests are performed using an 'and-compare' sequence.
+ Each board position is a 2-bit quantity. %00 for empty, %01 for
+ `O', %10 for `X'. We can test for an exact match by and-ing with
+ %11 (no-op), then comparing with 0, 1 or 2. The test for `o' is the
+ same as a test for 'not-X', ie not %10. So and with %01 should
+ give 0 if it matches. Similarly `x' is a test that bit 0 is not
+ set.
+
+
+
+File: gnugo.info, Node: Grid optimization, Next: Joseki Compiler, Prev: Details, Up: Patterns
+
+9.15 The "Grid" Optimization
+============================
+
+The comparisons between pattern and board are performed as 2-bit
+bitwise operations. Therefore they can be performed in parallel,
+16-at-a-time on a 32-bit machine.
+
+ Suppose the board is layed out as follows :
+
+
+ .X.O....OO
+ XXXXO.....
+ .X..OOOOOO
+ X.X.......
+ ....X...O.
+
+which is internally stored internally in a 2d array (binary)
+
+
+ 00 10 00 01 00 00 00 00 01 01
+ 10 10 10 10 01 00 00 00 00 00
+ 00 10 00 00 01 01 01 01 01 01
+ 10 00 10 00 00 00 00 00 00 00
+ 00 00 00 00 10 00 00 00 01 00
+
+we can compile this to a composite array in which each element stores
+the state of a 4x4 grid of squares :
+
+
+ ???????? ???????? ???????? ...
+ ??001000 00100001 10000100
+ ??101010 10101010 10101001
+ ??001000 00100000 10000001
+
+ ??001000 00100001 ...
+ ??101010 10101010
+ ??001000 00100000
+ ??001000 10001000
+
+ ...
+
+ ??100010 ...
+ ??000000
+ ????????
+ ????????
+
+ Where '??' is off the board.
+
+ We can store these 32-bit composites in a 2d merged-board array,
+substituting the illegal value %11 for '??'.
+
+ Similarly, for each pattern, mkpat produces appropriate 32-bit
+and-value masks for the pattern elements near the anchor. It is a
+simple matter to test the pattern with a similar test to (5) above, but
+for 32-bits at a time.
+
+
+File: gnugo.info, Node: Joseki Compiler, Next: Ladders in Joseki, Prev: Grid optimization, Up: Patterns
+
+9.16 The Joseki Compiler
+========================
+
+GNU Go includes a joseki compiler in `patterns/joseki.c'. This processes
+an SGF file (with variations) and produces a sequence of patterns which
+can then be fed back into mkpat. The joseki database is currently in
+files in `patterns/' called `hoshi.sgf', `komoku.sgf', `sansan.sgf',
+`mokuhazushi.sgf' and `takamoku.sgf'. This division can be revised
+whenever need arises.
+
+ The SGF files are transformed into the pattern database `.db' format
+by the program in `joseki.c'. These files are in turn transformed into C
+code by the program in `mkpat.c' and the C files are compiled and linked
+into the GNU Go binary.
+
+ Not every node in the SGF file contributes a pattern. The nodes which
+contribute patterns have the joseki in the upper right corner, with the
+boundary marked with a square mark and other information to determine
+the resulting pattern marked in the comments.
+
+ The intention is that the move valuation should be able to choose
+between the available variations by normal valuation. When this fails
+the primary workaround is to use shape values to increase or decrease
+the value. It is also possible to add antisuji variations to forbid
+popular suboptimal moves. As usual constraints can be used, e.g. to
+condition a variation on a working ladder.
+
+ The joseki format has the following components for each SGF node:
+
+ * A square mark (`SQ' or `MA' property) to decide how large part of
+ the board should be included in the pattern.
+
+ * A move (`W' or `B' property) with the natural interpretation. If
+ the square mark is missing or the move is a pass, no pattern is
+ produced for the node.
+
+ * Optional labels (`LB' property), which must be a single letter
+ each. If there is at least one label, a constraint diagram will be
+ produced with these labels.
+
+ * A comment (`C' property). As the first character it should have
+ one of the following characters to decide its classification:
+ - `U' - urgent move
+
+ - `S' or `J' - standard move
+
+ - `s' or `j' - lesser joseki
+
+ - `T' - trick move
+
+ - `t' - minor joseki move (tenuki OK)
+
+ - `0' - antisuji (`A' can also be used)
+ The rest of the line is ignored, as is the case of the letter. If
+ neither of these is found, it's assumed to be a standard joseki
+ move.
+
+ In addition to this, rows starting with the following characters
+ are recognized:
+ - `#' - Comments. These are copied into the patterns file,
+ above the diagram.
+
+ - `;' - Constraints. These are copied into the patterns file,
+ below the constraint diagram.
+
+ - `>' - Actions. These are copied into the patterns file, below
+ the constraint diagram.
+
+ - `:' - Colon line. This is a little more complicated, but the
+ colon line of the produced patterns always start out with
+ ":8,s" for transformation number and sacrifice pattern class
+ (it usually isn't a sacrifice, but it's pointless spending
+ time checking for tactical safety). Then a joseki pattern
+ class character is appended and finally what is included on
+ the colon line in the comment for the SGF node.
+
+ Example: If the comment in the SGF file looks like
+
+ F
+ :C,shape(3)
+ ;xplay_attack(A,B,C,D,*)
+
+the generated pattern will have a colon line
+
+ :8,sjC,shape(3)
+
+and a constraint
+
+ ;xplay_attack(A,B,C,D,*)
+
+
+File: gnugo.info, Node: Ladders in Joseki, Next: Corner Matcher, Prev: Joseki Compiler, Up: Patterns
+
+9.17 Ladders in Joseki
+======================
+
+As an example of how to use autohelpers with the Joseki compiler, we
+consider an example where a Joseki is bad if a ladder fails. Assume we
+have the taisha and are considering connecting on the outside with the
+pattern
+
+ --------+
+ ........|
+ ........|
+ ...XX...|
+ ...OXO..|
+ ...*O...|
+ ....X...|
+ ........|
+ ........|
+
+ But this is bad unless we have a ladder in our favor. To check this
+we add a constraint which may look like
+
+ --------+
+ ........|
+ ........|
+ ...XX...|
+ ...OXO..|
+ ...*OAC.|
+ ....DB..|
+ ........|
+ ........|
+
+ ;oplay_attack(*,A,B,C,D)
+
+ In order to accept the pattern we require that the constraint on the
+semicolon line evaluates to true. This particular constraint has the
+interpretation "Play with alternating colors, starting with `O', on the
+intersections `*', `A', `B', and `C'. Then check whether the stone at
+`D' can be captured." I.e. play to this position
+
+ --------+
+ ........|
+ ........|
+ ...XX...|
+ ...OXO..|
+ ...OOXX.|
+ ....XO..|
+ ........|
+ ........|
+
+and call `attack()' to see whether the lower `X' stone can be captured.
+This is not limited to ladders, but in this particular case the reading
+will of course involve a ladder.
+
+ The constraint diagram above with letters is how it looks in the
+`.db' file. The joseki compiler knows how to create these from labels in
+the SGF node. `Cgoban' has an option to create one letter labels, but
+this ought to be a common feature for SGF editors.
+
+ Thus in order to implement this example in SGF, one would add labels
+to the four intersections and a comment:
+
+ ;oplay_attack(*,A,B,C,D)
+
+ The appropriate constraint (autohelper macro) will then be added to
+the Joseki `.db' file.
+
+
+File: gnugo.info, Node: Corner Matcher, Next: Editing Patterns, Prev: Ladders in Joseki, Up: Patterns
+
+9.18 Corner Matcher
+===================
+
+GNU Go uses a special matcher for joseki patterns. It has certain
+constraints on the patterns it can match, but is much faster and takes
+far less space to store patterns than the standard matcher.
+
+ Patterns used with corner matcher have to qualify the following
+conditions:
+
+ * They must be matchable only at a corner of the board (hence the
+ name of the matcher).
+
+ * They can consist only of `O', `X' and `.' elements.
+
+ * Of all pattern values (*note Pattern Values::), corner matcher only
+ support `shape(x)'. This is not because the matcher cannot handle
+ other values in principle, just they are currently not used in
+ joseki databases.
+
+ Corner matcher was specifically designed for joseki patterns and
+they of course satisfy all the conditions above. With some
+modifications corner matcher could be used for fuseki patterns as well,
+but fullboard matcher does its work just fine.
+
+ The main idea of the matcher is very same to the one of DFA matcher
+(*note Pattern matching with DFA::): check all available patterns at
+once, not a single pattern at a time. A modified version of DFA
+matcher could be used for joseki pattern matching, but its database
+would be very large. Corner matcher capitalizes on the fact that there
+are relatively few stones in each such pattern.
+
+ Corner pattern database is organized into a tree. Nodes of the tree
+are called "variations". Variations represent certain sets of stones
+in a corner of the board. Root variation corresponds to an empty
+corner and a step down the tree is equivalent to adding a stone to the
+corner. Each variation has several properties:
+
+ - stone position relative to the corner,
+
+ - a flag determining whether the stone color must be equal to the
+ first matched stone color,
+
+ - number of stones in the corner area (see below) of the variation
+ stone.
+
+ By corner area we define a rectangle which corners are the current
+corner of the board and the position of the stone (inclusive). For
+instance, if the current board corner is A19 then corner area of a
+stone at C18 consists of A18, A19, B18, B19, C18 and C19.
+
+ Variation which is a direct child of the root variation matches if
+there is any stone at the variation position and the stone is alone in
+its corner area.
+
+ Variation at a deeper level of the tree matches if there is a stone
+of specified color in variation position and the number of stones in its
+corner area is equal to the number specified in variation structure.
+
+ When a certain variation matches, all its children has to be checked
+recursively for a match.
+
+ All leaf variations and some inner ones have patterns attached to
+them. For a pattern to match, it is required that its _parent_
+variation matches. In addition, it is checked that pattern is being
+matched for the appropriate color (using its variation "stone color"
+field) and that the number of stones in the area where the pattern is
+being matched is indeed equal to the number of stones in the pattern.
+The "stone position" property of the pattern variation determines the
+move suggested by the pattern.
+
+ Consider this joseki pattern which has four stones:
+
+ ------+
+ ......|
+ ......|
+ .O*...|
+ .XXO..|
+ ......|
+ ......|
+
+ To encode it for the corner matcher, we have to use five variations,
+each next being a child of previous:
+
+Tree level Position Color Number of stones
+1 R16 "same" 1
+2 P17 "same" 1
+3 Q16 "other" 2
+4 P16 "other" 4
+5 Q17 "same" 1
+
+ The fifth variation should have an attached pattern. Note that the
+stone color for the fifth variation is "same" because the first matched
+stone for this pattern is `O' which stands for the stones of the player
+to whom moves are being suggested with `*'.
+
+ The tree consists of all variations for all patterns combined
+together. Variations for each patterns are sorted to allow very quick
+tree branch rejection and at the same time keep the database small
+enough. More details can be found in comments in file `mkpat.c'
+
+ Corner matcher resides in `matchpat.c' in two functions:
+`corner_matchpat()' and `do_corner_matchpat()'. The former computes
+`num_stones[]' array which holds number of stones in corner areas of
+different intersections of the board for all possible transformations.
+`corner_matchpat()' also matches top-level variations.
+`do_corner_matchpat()' is responsible for recursive matching on the
+variation tree and calling callback function upon pattern match.
+
+ Tree-like database for corner matcher is generated by `mkpat'
+program. Database generator consists of several functions, most
+important are: `corner_best_element()', `corner_variation_new()',
+`corner_follow_variation()' and `corner_add_pattern()'.
+
+
+File: gnugo.info, Node: Editing Patterns, Prev: Corner Matcher, Up: Patterns
+
+9.19 Emacs Mode for Editing Patterns
+====================================
+
+If you use GNU Emacs (XEmacs might work too), you can try a special
+mode for editing GNU Go pattern databases. The mode resides in
+`patterns/gnugo-db.el'.
+
+ Copy the file to `emacs/site-lisp' directory. You can then load the
+mode with `(require 'gnugo-db)'. It makes sense to put this line into
+your configuration file (`~/.emacs'). You can either use
+`gnugo-db-mode' command to switch to pattern editing mode, or use the
+following code snippet to make Emacs do this automatically upon opening
+a file with `.db' suffix:
+
+ (setq auto-mode-alist
+ (append
+ auto-mode-alist
+ '(("\\.db\\'" . gnugo-db-mode))))
+
+ Pattern editing mode provides the following features:
+
+ - highlighting of keywords (`Pattern', `goal_elements' and
+ `callback_data') and comments,
+
+ - making paragraphs equal to patterns (`M-h', `M-{', `M-}' and
+ others operate on patterns),
+
+ - commands for pattern creation with automatic name selection (`C-c
+ C-p') and copying main diagram to constraint diagram (`C-c C-c'),
+
+ - automated indentation of constraints and side comments (pattern
+ descriptions).
+
+
+File: gnugo.info, Node: DFA, Next: Utility Functions, Prev: SGF, Up: Top
+
+10 The DFA pattern matcher
+**************************
+
+In this chapter, we describe the principles of the GNU Go DFA pattern
+matcher. The aim of this system is to permit a fast pattern matching
+when it becomes time critical like in owl module (*note The Owl
+Code::). Since GNU Go 3.2, this is enabled by default. You can still
+get back the traditional pattern matcher by running `configure
+--disable-dfa' and then recompiling GNU Go.
+
+ Otherwise, a finite state machine called a Deterministic Finite
+State Automaton (*note What is a DFA::) will be built off line from the
+pattern database. This is used at runtime to speedup pattern matching
+(*note Pattern matching with DFA:: and *note Incremental Algorithm::).
+The runtime speedup is at the cost of an increase in memory use and
+compile time.
+
+* Menu:
+
+* Introduction to the DFA:: Scanning the board along a path
+* What is a DFA:: A recall of language theory.
+* Pattern matching with DFA:: How to retrieve go patterns with a DFA?
+* Building the DFA:: Playing with explosives.
+* Incremental Algorithm:: The joy of determinism.
+* DFA Optimizations:: Some possible optimizations.
+
+
+File: gnugo.info, Node: Introduction to the DFA, Next: What is a DFA, Up: DFA
+
+10.1 Introduction to the DFA
+============================
+
+The general idea is as follows:
+
+ For each intersection of the board, its neighbourhood is scanned
+following a predefined path. The actual path used does not matter very
+much; GNU Go uses a spiral as shown below.
+
+ +---B--------------+
+ | C 4 A . . . . . .|
+ D 5 1 3 9 . . . . .|
+ E 6 2 8 . . X . . .|
+ | F 7 . . . . . . .|
+ | . +-> . . . . . .|
+ | . . . . . . . . .|
+ | . O . . . X . . .|
+ | . . . . . . . . .|
+ | . . . . . . . . .|
+ +------------------+
+
+ In each step of the path, the pattern matcher jumps into a state
+determined by what it has found on the board so far. If we have
+successfully matched one or several patterns in this step, this state
+immediately tells us so (in its "attribute"). But the state also
+implicitly encodes which further patterns can still get matched: The
+information stored in the state contains in which state to jump next,
+depending on whether we find a black, white or empty intersection (or
+an intersection out of board) in the next step of the path. The state
+will also immediately tell us if we cannot find any further pattern (by
+telling us to jump into the "error" state).
+
+ These sloppy explanations may become clearer with the definitions in
+the next section (*note What is a DFA::).
+
+ Reading the board following a predefined path reduces the two
+dimentional pattern matching to a linear text searching problem. For
+example, this pattern
+
+ ?X?
+ .O?
+ ?OO
+
+scanned following the path
+
+ B
+ C4A
+ 5139
+ 628
+ 7
+
+gives the string "OO?X.?*O*?*?" where "?" means 'don't care' and "*"
+means 'don't care, can even be out of board'.
+
+ So we can forget that we are dealing with two dimensional patterns
+and consider linear patterns.
+
+
+File: gnugo.info, Node: What is a DFA, Next: Pattern matching with DFA, Prev: Introduction to the DFA, Up: DFA
+
+10.2 What is a DFA
+==================
+
+The acronym DFA means Deterministic Finite state Automaton (See
+`http://www.eti.pg.gda.pl/~jandac/thesis/node12.html' or `Hopcroft &
+Ullman "Introduction to Language Theory"' for more details). DFA are
+common tools in compilers design (Read `Aho, Ravi Sethi, Ullman
+"COMPILERS: Principles, Techniques and Tools"' for a complete
+introduction), a lot of powerfull text searching algorithm like
+`Knuth-Morris-Pratt' or `Boyer-Moore' algorithms are based on DFA's
+(See `http://www-igm.univ-mlv.fr/~lecroq/string/' for a bibliography of
+pattern matching algorithms).
+
+ Basically, a DFA is a set of "states" connected by labeled
+"transitions". The labels are the values read on the board, in GNU Go
+these values are EMPTY, WHITE, BLACK or OUT_BOARD, denoted respectively
+by '.','O','X' and '#'.
+
+ The best way to represent a DFA is to draw its transition graph: the
+pattern "????..X" is recognized by the following DFA:
+
+ .,X,O .,X,O .,X,O .,X,O . . X
+ [1]------>[2]----->[3]----->[4]----->[5]--->[6]--->[7]--->[8 OK!]
+ Start
+
+ This means that starting from state [1], if you read '.','X' or 'O'
+on the board, go to state [2] and so on until you reach state [5].
+From state [5], if you read '.', go to state [6] otherwise go to error
+state [0]. And so on until you reach state [8]. As soon as you reach
+state [8], you recognize Pattern "????..X"
+
+ Adding a pattern like "XXo" ('o' is a wildcard for not 'X') will
+transform directly the automaton by synchronization product (*note
+Building the DFA::). Consider the following DFA:
+
+ Start .,O .,X,O .,O,X .,X,O . . X
+ [1]---->[2]----->[3]----->[4]------>[5]--->[6]---->[7]--->[8 OK!]
+ | ^ ^ ^
+ | .,O | | |
+ | ---- | |
+ | | X | |
+ | | --- .,X,O |
+ | | | |
+ | X | X | O,. |
+ --------->[9]------>[A]--->[B OK!]-
+
+ By adding a special "error" state and completing each state by a
+transition to error state when there is none, we transform easily a DFA
+in a "Complete Deterministic Finite state Automaton" (CDFA). The
+synchronization product (*note Building the DFA::) is only possible on
+CDFA's.
+
+ Start .,O .,X,O .,O,X .,X,O . . X
+ [1]---->[2]----->[3]----->[4]------>[5]--->[6]---->[7]--->[8 OK!]
+ | ^ ^ ^ | | |
+ | .,O | | | | | |
+ | ---- | | | | |
+ | | X | | |X,O | .,O |X,.,O
+ | | --- .,X,O | | | |
+ | | | | | | |
+ | X | X | O,. | \ / \ / \ /
+ --------->[9]------>[A]--->[B OK!]- [0 Error state !]
+
+ The graph of a CDFA is coded by an array of states: The 0 state is
+the "error" state and the start state is 1.
+
+ ----------------------------------------------------
+ state | . | O | X | # | att
+ ----------------------------------------------------
+ 1 | 2 | 2 | 9 | 0 |
+ 2 | 3 | 3 | 3 | 0 |
+ 3 | 4 | 4 | 4 | 0 |
+ 5 | 6 | 0 | 0 | 0 |
+ 6 | 7 | 0 | 0 | 0 |
+ 7 | 0 | 0 | 8 | 0 |
+ 8 | 0 | 0 | 0 | 0 | Found pattern "????..X"
+ 9 | 3 | 3 | A | 0 |
+ A | B | B | 4 | 0 |
+ B | 5 | 5 | 5 | 0 | Found pattern "XXo"
+ ----------------------------------------------------
+
+ To each state we associate an often empty list of attributes which
+is the list of pattern indexes recognized when this state is reached.
+In '`dfa.h'' this is basically represented by two stuctures:
+
+ `
+ /* dfa state */
+ typedef struct state
+ {
+ int next[4]; /* transitions for EMPTY, BLACK, WHITE and OUT_BOARD */
+ attrib_t *att;
+ }
+ state_t;
+
+ /* dfa */
+ typedef struct dfa
+ {
+ attrib_t *indexes; /* Array of pattern indexes */
+ int maxIndexes;
+
+ state_t *states; /* Array of states */
+ int maxStates;
+ }
+ dfa_t;'
+
+
+File: gnugo.info, Node: Pattern matching with DFA, Next: Building the DFA, Prev: What is a DFA, Up: DFA
+
+10.3 Pattern matching with DFA
+==============================
+
+Recognizing with a DFA is very simple and thus very fast (See
+'`scan_for_pattern()'' in the '`engine/matchpat.c'' file).
+
+ Starting from the start state, we only need to read the board
+following the spiral path, jump from states to states following the
+transitions labelled by the values read on the board and collect the
+patterns indexes on the way. If we reach the error state (zero), it
+means that no more patterns will be matched. The worst case complexity
+of this algorithm is o(m) where m is the size of the biggest pattern.
+
+ Here is an example of scan:
+
+ First we build a minimal DFA recognizing these patterns: "X..X",
+"X???", "X.OX" and "X?oX". Note that wildcards like '?','o', or 'x'
+give multiple out-transitions.
+
+ ----------------------------------------------------
+ state | . | O | X | # | att
+ ----------------------------------------------------
+ 1 | 0 | 0 | 2 | 0 |
+ 2 | 3 | 10 | 10 | 0 |
+ 3 | 4 | 7 | 9 | 0 |
+ 4 | 5 | 5 | 6 | 0 |
+ 5 | 0 | 0 | 0 | 0 | 2
+ 6 | 0 | 0 | 0 | 0 | 4 2 1
+ 7 | 5 | 5 | 8 | 0 |
+ 8 | 0 | 0 | 0 | 0 | 4 2 3
+ 9 | 5 | 5 | 5 | 0 |
+ 10 | 11 | 11 | 9 | 0 |
+ 11 | 5 | 5 | 12 | 0 |
+ 12 | 0 | 0 | 0 | 0 | 4 2
+ ----------------------------------------------------
+
+ We perform the scan of the string "X..XXO...." starting from state 1:
+
+ Current state: 1, substring to scan : X..XXO....
+
+ We read an 'X' value, so from state 1 we must go to state 2.
+
+ Current state: 2, substring to scan : ..XXO....
+
+ We read a '.' value, so from state 2 we must go to state 3 and so on
+...
+
+ Current state: 3, substring to scan : .XXO....
+ Current state: 4, substring to scan : XXO....
+ Current state: 6, substring to scan : XO....
+ Found pattern 4
+ Found pattern 2
+ Found pattern 1
+
+ After reaching state 6 where we match patterns 1,2 and 4, there is
+no out-transitions so we stop the matching. To keep the same match
+order as in the standard algorithm, the patterns indexes are collected
+in an array and sorted by indexes.
+
+
+File: gnugo.info, Node: Building the DFA, Next: Incremental Algorithm, Prev: Pattern matching with DFA, Up: DFA
+
+10.4 Building the DFA
+=====================
+
+The most flavouring point is the building of the minimal DFA
+recognizing a given set of patterns. To perform the insertion of a new
+pattern into an already existing DFA one must completly rebuild the
+DFA: the principle is to build the minimal CDFA recognizing the new
+pattern to replace the original CDFA with its "synchronised product" by
+the new one.
+
+ We first give a formal definition: Let L be the left CDFA and R be
+the right one. Let B be the "synchronised product" of L by R. Its
+states are the couples (l,r) where l is a state of L and r is a state
+of R. The state (0,0) is the error state of B and the state (1,1) is
+its initial state. To each couple (l,r) we associate the union of
+patterns recognized in both l and r. The transitions set of B is the
+set of transitions (l1,r1)--a-->(l2,r2) for each symbol 'a' such that
+both l1--a-->l2 in L and r1--a-->r2 in R.
+
+ The maximal number of states of B is the product of the number of
+states of L and R but almost all this states are non reachable from the
+initial state (1,1).
+
+ The algorithm used in function '`sync_product()'' builds the minimal
+product DFA only by keeping the reachable states. It recursively scans
+the product CDFA by following simultaneously the transitions of L and
+R. A hast table (`gtest') is used to check if a state (l,r) has already
+been reached, the reachable states are remapped on a new DFA. The CDFA
+thus obtained is minimal and recognizes the union of the two patterns
+sets.
+
+ It is possible to construct a special pattern database that
+generates an "explosive" automaton: the size of the DFA is in the worst
+case exponential in the number of patterns it recognizes. But it
+doesn't occur in pratical situations: the DFA size tends to be
+"stable". By "stable" we mean that if we add a pattern which greatly
+increases the size of the DFA it also increases the chance that the
+next added pattern does not increase its size at all. Nevertheless
+there are many ways to reduce the size of the DFA. Good compression
+methods are explained in `Aho, Ravi Sethi, Ullman "COMPILERS:
+Principles, Techniques and Tools" chapter Optimization of DFA-based
+pattern matchers'.
+
+
+File: gnugo.info, Node: Incremental Algorithm, Next: DFA Optimizations, Prev: Building the DFA, Up: DFA
+
+10.5 Incremental Algorithm
+==========================
+
+The incremental version of the DFA pattern matcher is not yet
+implemented in GNU Go but we explain here how it will work. By
+definition of a deterministic automaton, scanning the same string will
+reach the same states every time.
+
+ Each reached state during pattern matching is stored in a stack
+`top_stack[i][j]' and `state_stack[i][j][stack_idx]' We use one stack
+by intersection `(i,j)'. A precomputed reverse path list allows to
+know for each couple of board intersections `(x,y)' its position
+`reverse(x,y)' in the spiral scan path starting from `(0,0)'.
+
+ When a new stone is put on the board at `(lx,ly)', the only work of
+the pattern matcher is:
+
+ `
+ for(each stone on the board at (i,j))
+ if(reverse(lx-i,ly-j) < top_stack[i][j])
+ {
+ begin the dfa scan from the state
+ state_stack[i][j][reverse(lx-i,ly-j)];
+ }
+ '
+
+ In most situations reverse(lx-i,ly-j) will be inferior to
+top_stack[i][j]. This should speedup a lot pattern matching.
+
+
+File: gnugo.info, Node: DFA Optimizations, Prev: Incremental Algorithm, Up: DFA
+
+10.6 Some DFA Optimizations
+===========================
+
+The DFA is constructed to minimize jumps in memory making some
+assumptions about the frequencies of the values: the EMPTY value is
+supposed to appear often on the board, so the the '.' transition are
+almost always successors in memory. The OUT_BOARD are supposed to be
+rare, so '#' transitions will almost always imply a big jump.
+
+
+File: gnugo.info, Node: Tactical Reading, Next: Pattern Based Reading, Prev: Patterns, Up: Top
+
+11 Tactical reading
+*******************
+
+The process of visualizing potential moves done by you and your
+opponent to learn the result of different moves is called "reading".
+GNU Go does three distinct types of reading: "tactical reading" which
+typically is concerned with the life and death of individual strings,
+"Owl reading" which is concerned with the life and death of dragons,
+and "connection reading". In this Chapter, we document the tactical
+reading code, which is in `engine/reading.c'.
+
+* Menu:
+
+* Reading Basics:: Reading Basics
+* Hashing:: Hashing of positions
+* Persistent Cache:: Persistent Reading Cache
+* Ko:: Ko handling
+* A Ko Example:: A Ko Example
+* Another Ko Example:: Another Ko Example
+* Alternate Komaster Schemes:: Alternate Komaster Schemes
+* Superstrings:: Superstrings
+* Debugging:: Debugging the reading code
+* Connection Reading:: Connection Reading
+
+
+File: gnugo.info, Node: Reading Basics, Next: Hashing, Up: Tactical Reading
+
+11.1 Reading Basics
+===================
+
+What we call _Tactical Reading_ is the analysis whether there is a
+direct capture of a single string, or whether there is a move to prevent
+such a direct capture.
+
+ If the reading module finds out that the string can get captured,
+this answer should (usually) be trusted. However, if it says it can be
+defended, this does not say as much. It is often the case that such a
+string has no chance to make a life, but that it cannot be captured
+within the horizon (and the cutoff heuristics) of the tactical reading.
+
+ The tactical reading is done by the functions in `engine/reading.c'.
+It is a minimax search that declares win for the attacker once he can
+physically take the string off board, whereas the defense is considered
+successful when the string has sufficiently many liberties. A string
+with five liberties is always considered alive. At higher depth within
+the search tree even fewer liberties cause GNU Go to give up the attack,
+*Note depthparams::.
+
+ The reading code makes use of a stack onto which board positions can
+be pushed. The parameter `stackp' is zero if GNU Go is examining the
+true board position; if it is higher than zero, then GNU Go is
+examining a hypothetical position obtained by playing several moves.
+
+ The most important public reading functions are `attack' and
+`find_defense'. These are wrappers for functions `do_attack' and
+`do_find_defense' which are declared statically in `reading.c'. The
+functions `do_attack' and `do_find_defense' call each other recursively.
+
+11.1.1 Organization of the reading code
+---------------------------------------
+
+The function `do_attack' and `do_find_defense' are wrappers themselves
+and call `attack1', `attack2', `attack3' or `attack4' resp. `defend1',
+`defend1', `defend1' or `defend1' depending on the number of liberties.
+
+ These are fine-tuned to generate and try out the moves in an
+efficient order. They generate a few moves themselves (mostly direct
+liberties of the string), and then call helper functions called
+`..._moves' which suggest less obvious moves. Which of these functions
+get called depends on the number of liberties and of the current search
+depth.
+
+11.1.2 Return Codes
+-------------------
+
+The return codes of the reading (and owl) functions and owl can be `0',
+`KO_B', `KO_A' or `WIN'. Each reading function determines whether a
+particular player (assumed to have the move) can solve a specific
+problem, typically attacking or defending a string.
+
+ A return code of `WIN' means success, 0 failure, while `KO_A' and
+`KO_B' are success conditioned on ko. A function returns `KO_A' if the
+position results in ko and that the player to move will get the first
+ko capture (so the opponent has to make the first ko threat). A return
+code of `KO_B' means that the player to move will have to make the
+first ko threat.
+
+ If GNU Go is compiled with the configure option
+`--enable-experimental-owl-ext' then the owl functions also have
+possible return codes of `GAIN' and `LOSS'. A code of `GAIN' means that
+the attack (or defense) does not succeed, but that in the process of
+trying to attack or defend, an opponent's worm is captured. A code of
+`LOSS' means that the attack or defense succeeds, but that another
+friendly worm dies during the attack or defense.
+
+11.1.3 Reading cutoff and depth parameters
+------------------------------------------
+
+Depth of reading is controlled by the parameters `depth' and
+`branch_depth'. The `depth' has a default value `DEPTH' (in
+`liberty.h'), which is set to 16 in the distribution, but it may also
+be set at the command line using the `-D' or `--depth' option. If
+`depth' is increased, GNU Go will be stronger and slower. GNU Go will
+read moves past depth, but in doing so it makes simplifying assumptions
+that can cause it to miss moves.
+
+ Specifically, when `stackp > depth', GNU Go assumes that as soon as
+the string can get 3 liberties it is alive. This assumption is
+sufficient for reading ladders.
+
+ The `branch_depth' is typically set a little below `depth'. Between
+`branch_depth' and `depth', attacks on strings with 3 liberties are
+considered, but branching is inhibited, so fewer variations are
+considered.
+
+ %%Currently the reading code does not try to defend a string by
+%attacking a boundary string with more than two liberties. Because %of
+this restriction, it can make oversights. A symptom of this is %two
+adjacent strings, each having three or four liberties, each %classified
+as `DEAD'. To resolve such situations, a function %`small_semeai()' (in
+`engine/semeai.c') looks for such %pairs of strings and corrects their
+classification.
+
+ The `backfill_depth' is a similar variable with a default 12. Below
+this depth, GNU Go will try "backfilling" to capture stones. For
+example in this situation:
+
+
+ .OOOOOO. on the edge of the board, O can capture X but
+ OOXXXXXO in order to do so he has to first play at a in
+ .aObX.XO preparation for making the atari at b. This is
+ -------- called backfilling.
+
+ Backfilling is only tried with `stackp <= backfill_depth'. The
+parameter `backfill_depth' may be set using the `-B' option.
+
+ The `fourlib_depth' is a parameter with a default of only 7. Below
+this depth, GNU Go will try to attack strings with four liberties. The
+`fourlib_depth' may be set using the `-F' option.
+
+ The parameter `ko_depth' is a similar cutoff. If `stackp0 we add the moves already played from the
+ moves stack with mark 4.
+
+
+File: gnugo.info, Node: Ko, Next: A Ko Example, Prev: Persistent Cache, Up: Tactical Reading
+
+11.4 Ko Handling
+================
+
+The principles of ko handling are the same for tactical reading and owl
+reading.
+
+ We have already mentioned (*note Reading Basics::) that GNU Go uses
+a return code of `KO_A' or `KO_B' if the result depends on ko. The
+return code of `KO_B' means that the position can be won provided the
+player whose move calls the function can come up with a sufficiently
+large ko threat. In order to verify this, the function must simulate
+making a ko threat and having it answered by taking the ko even if it
+is illegal. We call such an experimental taking of the ko a
+"conditional" ko capture.
+
+ Conditional ko captures are accomplished by the function `tryko()'.
+This function is like `trymove()' except that it does not require
+legality of the move in question.
+
+ The static reading functions, and the global functions `do_attack'
+and `do_find_defense' consult parameters `komaster', `kom_pos', which
+are declared static in `board.c'. These mediate ko captures to prevent
+the occurrence of infinite loops. During reading, the komaster values
+are pushed and popped from a stack.
+
+ Normally `komaster' is `EMPTY' but it can also be `BLACK', `WHITE',
+`GRAY_BLACK', `GRAY_WHITE' or `WEAK_KO'. The komaster is set to `color'
+when `color' makes a conditional ko capture. In this case `kom_pos' is
+set to the location of the captured ko stone.
+
+ If the opponent is komaster, the reading functions will not try to
+take the ko at `kom_pos'. Also, the komaster is normally not allowed to
+take another ko. The exception is a nested ko, characterized by the
+condition that the captured ko stone is at distance 1 both vertically
+and horizontally from `kom_pos', which is the location of the last
+stone taken by the komaster. Thus in this situation:
+
+
+ .OX
+ OX*X
+ OmOX
+ OO
+
+ Here if `m' is the location of `kom_pos', then the move at `*' is
+allowed.
+
+ The rationale behind this rule is that in the case where there are
+two kos on the board, the komaster cannot win both, and by becoming
+komaster he has already chosen which ko he wants to win. But in the
+case of a nested ko, taking one ko is a precondition to taking the
+other one, so we allow this.
+
+ If the komaster's opponent takes a ko, then both players have taken
+one ko. In this case `komaster' is set to `GRAY_BLACK' or `GRAY_WHITE'
+and after this further ko captures are even further restricted.
+
+ If the ko at `kom_pos' is filled, then the komaster reverts to
+`EMPTY'.
+
+ In detail, the komaster scheme is as follows. Color `O' is to move.
+This scheme is known as scheme 5 since in versions of GNU Go through
+3.4, several different schemes were included.
+
+ * 1. Komaster is EMPTY.
+ - 1a. Unconditional ko capture is allowed.
+
+ Komaster remains EMPTY if previous move was not a ko
+ capture. Komaster is set to WEAK_KO if previous move
+ was a ko capture and kom_pos is set to the old value of
+ board_ko_pos.
+
+ - 1b) Conditional ko capture is allowed.
+
+ Komaster is set to O and kom_pos to the location of the
+ ko, where a stone was just removed.
+
+ * 2. Komaster is O:
+ - 2a) Only nested ko captures are allowed. Kom_pos is moved to
+ the new removed stone.
+
+ - 2b) If komaster fills the ko at kom_pos then komaster reverts
+ to EMPTY.
+
+ * 3. Komaster is X:
+
+ Play at kom_pos is not allowed. Any other ko capture is
+ allowed. If O takes another ko, komaster becomes GRAY_X.
+
+ * 4. Komaster is GRAY_O or GRAY_X:
+
+ Ko captures are not allowed. If the ko at kom_pos is filled
+ then the komaster reverts to EMPTY.
+
+ * 5. Komaster is WEAK_KO:
+ - 5a) After a non-ko move komaster reverts to EMPTY.
+
+ - 5b) Unconditional ko capture is only allowed if it is nested
+ ko capture.
+
+ Komaster is changed to WEAK_X and kom_pos to the old
+ value of board_ko_pos.
+
+ - 5c) Conditional ko capture is allowed according to the rules
+ of 1b.
+
+
+File: gnugo.info, Node: A Ko Example, Next: Another Ko Example, Prev: Ko, Up: Tactical Reading
+
+11.5 A Ko Example
+=================
+
+To see the komaster scheme in action, consider this position from the
+file `regressions/games/life_and_death/tripod9.sgf'. We recommend
+studying this example by examining the variation file produced by the
+command:
+
+ gnugo -l tripod9.sgf --decide-dragon C3 -o vars.sgf
+
+ In the lower left hand corner, there are kos at A2 and B4. Black is
+unconditionally dead because if W wins either ko there is nothing B can
+do.
+
+
+ 8 . . . . . . . .
+ 7 . . O . . . . .
+ 6 . . O . . . . .
+ 5 O O O . . . . .
+ 4 O . O O . . . .
+ 3 X O X O O O O .
+ 2 . X X X O . . .
+ 1 X O . . . . . .
+ A B C D E F G H
+
+ This is how the komaster scheme sees this. B (i.e. X) starts by
+taking the ko at B4. W replies by taking the ko at A1. The board looks
+like this:
+
+
+ 8 . . . . . . . .
+ 7 . . O . . . . .
+ 6 . . O . . . . .
+ 5 O O O . . . . .
+ 4 O X O O . . . .
+ 3 X . X O O O O .
+ 2 O X X X O . . .
+ 1 . O . . . . . .
+ A B C D E F G H
+
+ Now any move except the ko recapture (currently illegal) at A1 loses
+for B, so B retakes the ko and becomes komaster. The board looks like
+this:
+
+
+ 8 . . . . . . . . komaster: BLACK
+ 7 . . O . . . . . kom_pos: A2
+ 6 . . O . . . . .
+ 5 O O O . . . . .
+ 4 O X O O . . . .
+ 3 X . X O O O O .
+ 2 . X X X O . . .
+ 1 X O . . . . . .
+ A B C D E F G H
+
+ W takes the ko at B3 after which the komaster is `GRAY' and ko
+recaptures are not allowed.
+
+
+ 8 . . . . . . . . komaster: GRAY
+ 7 . . O . . . . . kom_pos: B4
+ 6 . . O . . . . .
+ 5 O O O . . . . .
+ 4 O . O O . . . .
+ 3 X O X O O O O .
+ 2 . X X X O . . .
+ 1 X O . . . . . .
+ A B C D E F G H
+
+ Since B is not allowed any ko recaptures, there is nothing he can do
+and he is found dead. Thus the komaster scheme produces the correct
+result.
+
+
+File: gnugo.info, Node: Another Ko Example, Next: Alternate Komaster Schemes, Prev: A Ko Example, Up: Tactical Reading
+
+11.6 Another Ko Example
+=======================
+
+We now consider an example to show why the komaster is reset to `EMPTY'
+if the ko is resolved in the komaster's favor. This means that the ko
+is filled, or else that is becomes no longer a ko and it is illegal for
+the komaster's opponent to play there.
+
+ The position resulting under consideration is in the file
+`regressions/games/ko5.sgf'. This is the position:
+
+ . . . . . . O O 8
+ X X X . . . O . 7
+ X . X X . . O . 6
+ . X . X X X O O 5
+ X X . X . X O X 4
+ . O X O O O X . 3
+ O O X O . O X X 2
+ . O . X O X X . 1
+ F G H J K L M N
+
+ We recommend studying this example by examining the variation file
+produced by the command:
+
+ gnugo -l ko5.sgf --quiet --decide-string L1 -o vars.sgf
+
+ The correct resolution is that H1 attacks L1 unconditionally while K2
+defends it with ko (code `KO_A').
+
+ After Black (X) takes the ko at K3, white can do nothing but retake
+the ko conditionally, becoming komaster. B cannot do much, but in one
+variation he plays at K4 and W takes at H1. The following position
+results:
+
+ . . . . . . O O 8
+ X X X . . . O . 7
+ X . X X . . O . 6
+ . X . X X X O O 5
+ X X . X X X O X 4
+ . O X O O O X . 3
+ O O X O . O X X 2
+ . O O . O X X . 1
+ F G H J K L M N
+
+ Now it is important the `O' is no longer komaster. Were `O' still
+komaster, he could capture the ko at N3 and there would be no way to
+finish off B.
+
+
+File: gnugo.info, Node: Alternate Komaster Schemes, Next: Superstrings, Prev: Another Ko Example, Up: Tactical Reading
+
+11.7 Alternate Komaster Schemes
+===============================
+
+The following alternate schemes have been proposed. It is assumed that
+`O' is the player about to move.
+
+11.7.1 Essentially the 2.7.232 scheme.
+--------------------------------------
+
+ * Komaster is EMPTY.
+ - Unconditional ko capture is allowed. Komaster remains EMPTY.
+
+ - Conditional ko capture is allowed. Komaster is set to O and
+ `kom_pos' to the location of the ko, where a stone was just
+ removed.
+
+ * Komaster is O:
+ - Conditional ko capture is not allowed.
+
+ - Unconditional ko capture is allowed. Komaster parameters
+ unchanged.
+
+ * Komaster is X:
+ - Conditional ko capture is not allowed.
+
+ - Unconditional ko capture is allowed except for a move at
+ `kom_pos'. Komaster parameters unchanged.
+
+11.7.2 Revised 2.7.232 version
+------------------------------
+
+ * Komaster is EMPTY.
+ - Unconditional ko capture is allowed. Komaster remains EMPTY.
+
+ - Conditional ko capture is allowed. Komaster is set to `O' and
+ `kom_pos' to the location of the ko, where a stone was just
+ removed.
+
+ * Komaster is `O':
+ - Ko capture (both kinds) is allowed only if after playing the
+ move, `is_ko(kom_pos, X)' returns false. In that case,
+ `kom_pos' is updated to the new ko position, i.e. the stone
+ captured by this move.
+
+ * Komaster is `X':
+ - Conditional ko capture is not allowed.
+
+ - Unconditional ko capture is allowed except for a move at
+ `kom_pos'. Komaster parameters unchanged.
+
+
+File: gnugo.info, Node: Superstrings, Next: Debugging, Prev: Alternate Komaster Schemes, Up: Tactical Reading
+
+11.8 Superstrings
+=================
+
+A _superstring_ is an extended string, where the extensions are through
+the following kinds of connections:
+
+ 1. Solid connections (just like ordinary string).
+ OO
+
+ 2. Diagonal connection or one space jump through an intersection
+ where an opponent move would be suicide or self-atari.
+ ...
+ O.O
+ XOX
+ X.X
+
+ 3. Bamboo joint.
+ OO
+ ..
+ OO
+
+ 4. Diagonal connection where both adjacent intersections are empty.
+ .O
+ O.
+
+ 5. Connection through adjacent or diagonal tactically captured stones.
+ Connections of this type are omitted when the superstring code is
+ called from `reading.c', but included when the superstring code is
+ called from `owl.c'.
+
+ Like a dragon, a superstring is an amalgamation of strings, but it is
+a much tighter organization of stones than a dragon, and its purpose is
+different. Superstrings are encountered already in the tactical reading
+because sometimes attacking or defending an element of the superstring
+is the best way to attack or defend a string. This is in contrast with
+dragons, which are ignored during tactical reading.
+
+
+File: gnugo.info, Node: Debugging, Next: Connection Reading, Prev: Superstrings, Up: Tactical Reading
+
+11.9 Debugging the reading code
+===============================
+
+The reading code searches for a path through the move tree to determine
+whether a string can be captured. We have a tool for investigating this
+with the `--decidestring' option. This may be run with or without an
+output file.
+
+ Simply running
+
+
+ `gnugo -t -l [input file name] -L [movenumber] --decidestring [location]'
+
+will run `attack()' to determine whether the string can be captured.
+If it can, it will also run `find_defense()' to determine whether or
+not it can be defended. It will give a count of the number of
+variations read. The `-t' is necessary, or else GNU Go will not report
+its findings.
+
+ If we add `-o OUTPUT FILE' GNU Go will produce an output file with
+all variations considered. The variations are numbered in comments.
+
+ This file of variations is not very useful without a way of
+navigating the source code. This is provided with the GDB source file,
+listed at the end. You can source this from GDB, or just make it your
+GDB init file.
+
+ If you are using GDB to debug GNU Go you may find it less confusing
+to compile without optimization. The optimization sometimes changes the
+order in which program steps are executed. For example, to compile
+`reading.c' without optimization, edit `engine/Makefile' to remove the
+string `-O2' from the file, touch `engine/reading.c' and make. Note
+that the Makefile is automatically generated and may get overwritten
+later.
+
+ If in the course of reading you need to analyze a result where a
+function gets its value by returning a cached position from the hashing
+code, rerun the example with the hashing turned off by the command line
+option `--hash 0'. You should get the same result. (If you do not,
+please send us a bug report.) Don't run `--hash 0' unless you have a
+good reason to, since it increases the number of variations.
+
+ With the source file given at the end of this document loaded, we
+can now navigate the variations. It is a good idea to use cgoban with a
+small `-fontHeight', so that the variation window takes in a big
+picture. (You can resize the board.)
+
+ Suppose after perusing this file, we find that variation 17 is
+interesting and we would like to find out exactly what is going on here.
+
+ The macro 'jt n' will jump to the n-th variation.
+
+
+ (gdb) set args -l [filename] -L [move number] --decidestring [location]
+ (gdb) tbreak main
+ (gdb) run
+ (gdb) jt 17
+
+will then jump to the location in question.
+
+ Actually the attack variations and defense variations are numbered
+separately. (But `find_defense()' is only run if `attack()' succeeds,
+so the defense variations may or may not exist.) It is redundant to
+have to tbreak main each time. So there are two macros avar and dvar.
+
+
+ (gdb) avar 17
+
+restarts the program, and jumps to the 17-th attack variation.
+
+
+ (gdb) dvar 17
+
+jumps to the 17-th defense variation. Both variation sets are found in
+the same sgf file, though they are numbered separately.
+
+ Other commands defined in this file:
+
+
+
+ `dump' will print the move stack.
+ `nv' moves to the next variation
+ `ascii i j' converts (i,j) to ascii
+
+ #######################################################
+ ############### .gdbinit file ###############
+ #######################################################
+
+ # this command displays the stack
+
+ define dump
+ set dump_stack()
+ end
+
+ # display the name of the move in ascii
+
+ define ascii
+ set gprintf("%o%m\n",$arg0,$arg1)
+ end
+
+ # display the all information about a dragon
+
+ define dragon
+ set ascii_report_dragon("$arg0")
+ end
+
+ define worm
+ set ascii_report_worm("$arg0")
+ end
+
+ # move to the next variation
+
+ define nv
+ tbreak trymove
+ continue
+ finish
+ next
+ end
+
+ # move forward to a particular variation
+
+ define jt
+ while (count_variations < $arg0)
+ nv
+ end
+ nv
+ dump
+ end
+
+ # restart, jump to a particular attack variation
+
+ define avar
+ delete
+ tbreak sgffile_decidestring
+ run
+ tbreak attack
+ continue
+ jt $arg0
+ end
+
+ # restart, jump to a particular defense variation
+
+ define dvar
+ delete
+ tbreak sgffile_decidestring
+ run
+ tbreak attack
+ continue
+ finish
+ next 3
+ jt $arg0
+ end
+
+
+File: gnugo.info, Node: Connection Reading, Prev: Debugging, Up: Tactical Reading
+
+11.10 Connection Reading
+========================
+
+GNU Go does reading to determine if strings can be connected. The
+algorithms for this are in `readconnect.c'. As with the reading code,
+the connection code is not pattern based.
+
+ The connection code is invoked by the engine through the functions:
+
+ * `int string_connect(int str1, int str2, int *move)'
+
+ Returns `WIN' if `str1' and `str2' can be connected.
+
+ * `int disconnect(int str1, int str2, int *move)'
+
+ Returns `WIN' if `str1' and `str2' can be disconnected.
+
+ To see the connection code in action, you may try the following
+example.
+
+ gnugo --quiet -l connection3.sgf --decide-connection M3/N7 -o vars.sgf
+
+ (The file `connection3.sgf' is in `regression/games'.) Examine the
+sgf file produced by this to see what kind of reading is done by the
+functions `string_connect()' and `string_disconnect()', which are
+called by the function `decide_connection'.
+
+ One use of the connection code is used is through the autohelper
+macros `oplay_connect', `xplay_connect', `oplay_disconnect' and
+`xplay_disconnect' which are used in the connection databases.
+
+
+File: gnugo.info, Node: Pattern Based Reading, Next: Influence, Prev: Tactical Reading, Up: Top
+
+12 Pattern Based Reading
+************************
+
+In the tactical reading code in `reading.c', the code generating the
+moves which are tried are all hand coded in C, for efficiency. There is
+much to be said for another type of reading, in which the moves to be
+tried are generated from a pattern database.
+
+ GNU Go does three main types of pattern based reading. First, there
+is the OWL code (Optics with Limit Negotiation) which attempts to read
+out to a point where the code in `engine/optics.c' (*note Eyes::) can
+be used to evaluate it. Like the tactical reading code, a persistent
+cache is employed to maintain some of the owl data from move to move.
+This is an essential speedup without which GNU Go would play too slowly.
+
+ Secondly, there is the `engine/combination.c' which attempts to find
+combinations--situations where a series of threats eventually
+culminates in one that cannot be parried.
+
+ Finally there is the semeai module. A *semeai* is a capturing race
+between two adjacent DEAD or CRITICAL dragons of opposite colors. The
+principal function, `owl_analyze_semeai()' is contained in `owl.c'.
+Due to the complex nature of semeais, the results of this function are
+more frequently wrong than the usual owl code.
+
+* Menu:
+
+* The Owl Code:: Life and death reading
+* Combinations:: Combinations
+
diff --git a/gnugo/src/doc/gnugo.info-2 b/gnugo/src/doc/gnugo.info-2
new file mode 100644
index 0000000000000000000000000000000000000000..6435f26e54b9877bf0c39b55f0b27317faf74ce2
--- /dev/null
+++ b/gnugo/src/doc/gnugo.info-2
@@ -0,0 +1,6826 @@
+This is gnugo.info, produced by makeinfo version 4.11 from gnugo.texi.
+
+INFO-DIR-SECTION GNU games
+START-INFO-DIR-ENTRY
+* GNU Go: (gnugo). The GNU Go program
+END-INFO-DIR-ENTRY
+
+
+File: gnugo.info, Node: The Owl Code, Next: Combinations, Up: Pattern Based Reading
+
+12.1 The Owl Code
+=================
+
+The life and death code in `optics.c', described elsewhere (*note
+Eyes::), works reasonably well as long as the position is in a
+"terminal position", which we define to be one where there are no moves
+left which can expand the eye space, or limit it. In situations where
+the dragon is surrounded, yet has room to thrash around a bit making
+eyes, a simple application of the graph-based analysis will not work.
+Instead, a bit of reading is needed to reach a terminal position.
+
+ The defender tries to expand his eyespace, the attacker to limit it,
+and when neither finds an effective move, the position is evaluated. We
+call this type of life and death reading "Optics With
+Limit-negotiation" (OWL). The module which implements it is in
+`engine/owl.c'.
+
+ There are two reasonably small databases
+`patterns/owl_defendpats.db' and `patterns/owl_attackpats.db' of
+expanding and limiting moves. The code in `owl.c' generates a small
+move tree, allowing the attacker only moves from `owl_attackpats.db',
+and the defender only moves from `owl_defendpats.db'. In addition to
+the moves suggested by patterns, vital moves from the eye space
+analysis are also tested.
+
+ A third database, `owl_vital_apats.db' includes patterns which
+override the eyespace analysis done by the optics code. Since the
+eyeshape graphs ignore the complications of shortage of liberties and
+cutting points in the surrounding chains, the static analysis of
+eyespace is sometimes wrong. The problem is when the optics code says
+that a dragon definitely has 2 eyes, but it isn't true due to shortage
+of liberties, so the ordinary owl patterns never get into play. In
+such situations `owl_vital_apats.db' is the only available measure to
+correct mistakes by the optics. Currently the patterns in
+`owl_vital_apats.db' are only matched when the level is 9 or greater.
+
+ The owl code is tuned by editing these three pattern databases,
+principally the first two.
+
+ A node of the move tree is considered `terminal' if no further moves
+are found from `owl_attackpats.db' or `owl_defendpats.db', or if the
+function `compute_eyes_pessimistic()' reports that the group is
+definitely alive. At this point, the status of the group is evaluated.
+The functions `owl_attack()' and `owl_defend()', with usage similar to
+`attack()' and `find_defense()', make use of the owl pattern databases
+to generate the move tree and decide the status of the group.
+
+ The function `compute_eyes_pessimistic()' used by the owl code is
+very conservative and only feels certain about eyes if the eyespace is
+completely closed (i.e. no marginal vertices).
+
+ The maximum number of moves tried at each node is limited by the
+parameter `MAX_MOVES' defined at the beginning of `engine/owl.c'. The
+most most valuable moves are tried first, with the following
+restrictions:
+
+ * If `stackp > owl_branch_depth' then only one move is tried per
+ variation.
+
+ * If `stackp > owl_reading_depth' then the reading terminates, and
+ the situation is declared a win for the defender (since deep
+ reading may be a sign of escape).
+
+ * If the node count exceeds `owl_node_limit', the reading also
+ terminates with a win for the defender.
+
+ * Any pattern with value 99 is considered a forced move: no other
+ move is tried, and if two such moves are found, the function
+ returns false. This is only relevant for the attacker.
+
+ * Any pattern in `patterns/owl_attackpats.db' and
+ `patterns/owl_defendpats.db' with value 100 is considered a win: if
+ such a pattern is found by `owl_attack' or `owl_defend', the
+ function returns true. This feature must be used most carefully.
+
+ The functions `owl_attack()' and `owl_defend()' may, like `attack()'
+and `find_defense()', return an attacking or defending move through
+their pointer arguments. If the position is already won, `owl_attack()'
+may or may not return an attacking move. If it finds no move of
+interest, it will return `PASS', that is, `0'. The same goes for
+`owl_defend()'.
+
+ When `owl_attack()' or `owl_defend()' is called, the dragon under
+attack is marked in the array `goal'. The stones of the dragon
+originally on the board are marked with goal=1; those added by
+`owl_defend()' are marked with goal=2. If all the original strings of
+the original dragon are captured, `owl_attack()' considers the dragon
+to be defeated, even if some stones added later can make a live group.
+
+ Only dragons with small escape route are studied when the functions
+are called from `make_dragons()'.
+
+ The owl code can be conveniently tested using the `--decide-owl
+LOCATION' option. This should be used with `-t' to produce a useful
+trace, `-o' to produce an SGF file of variations produced when the life
+and death of the dragon at LOCATION is checked, or both.
+`--decide-position' performs the same analysis for all dragons with
+small escape route.
+
+
+File: gnugo.info, Node: Combinations, Prev: The Owl Code, Up: Pattern Based Reading
+
+12.2 Combination reading
+========================
+
+It may happen that no single one of a set of worms can be killed, yet
+there is a move that guarantees that at least one can be captured. The
+simplest example is a double atari. The purpose of the code in
+`combination.c' is to find such moves.
+
+ For example, consider the following situation:
+
+
+ +---------
+ |....OOOOX
+ |....OOXXX
+ |..O.OXX..
+ |.OXO.OX..
+ |.OX..OO..
+ |.XXOOOXO.
+ |..*XXOX..
+ |....XOX..
+ |.XX..X...
+ |X........
+
+ Every `X' stone in this position is alive. However the move at `*'
+produces a position in which at least one of four strings will get
+captured. This is a _combination_.
+
+ The driving function is called `atari_atari' because typically a
+combination involves a sequence of ataris culminating in a capture,
+though sometimes the moves involved are not ataris. For example in the
+above example, the first move at `*' is _not_ an atari, though after
+`O' defends the four stones above, a sequence of ataris ensues
+resulting in the capture of some string.
+
+ Like the owl functions `atari_atari' does pattern-based reading. The
+database generating the attacking moves is `aa_attackpats.db'. One
+danger with this function is that the first atari tried might be
+irrelevant to the actual combination. To detect this possibility, once
+we've found a combination, we mark that first move as forbidden, then
+try again. If no combination of the same size or larger turns up, then
+the first move was indeed essential.
+
+ * `void combinations(int color)'
+
+ Generate move reasons for combination attacks and defenses
+ against them. This is one of the move generators called from
+ genmove().
+
+ * `int atari_atari(int color, int *attack_move, char
+ defense_moves[BOARDMAX], int save_verbose)'
+
+ Look for a combination for `color'. For the purpose of the
+ move generation, returns the size of the smallest of the
+ worms under attack.
+
+ * `int atari_atari_confirm_safety(int color, int move, int *defense,
+ int minsize, const char saved_dragons[BOARDMAX], const char
+ saved_worms[BOARDMAX])'
+
+ Tries to determine whether a move is a blunder. Wrapper
+ around atari_atari_blunder_size. Check whether a combination
+ attack of size at least `minsize' appears after move at
+ `move' has been made. The arrays `saved_dragons[]' and
+ `saved_worms[]' should be one for stones belonging to dragons
+ or worms respectively, which are supposedly saved by `move'.
+
+ * `int atari_atari_blunder_size(int color, int move, int *defense,
+ const char safe_stones[BOARDMAX])'
+
+ This function checks whether any new combination attack
+ appears after move at (move) has been made, and returns its
+ size (in points). `safe_stones' marks which of our stones
+ are supposedly safe after this move.
+
+
+File: gnugo.info, Node: Influence, Next: Monte Carlo Go, Prev: Pattern Based Reading, Up: Top
+
+13 Influence Function
+*********************
+
+* Menu:
+
+* Influential Concepts:: Conceptual Outline of Influence
+* Territory and Moyo:: Territory, Moyo and Area
+* Influence Usage:: Where influence gets used in the engine
+* Influence and Territory:: Influence and Territory
+* Territorial Details:: Details of the Territory Valuation
+* The Influence Core:: The Core of the Influence Function
+* The Influence Algorithm:: The algorithm of `accumlate_influence()'
+* Permeability:: Permeability
+* Escape:: Escape
+* Break Ins:: Break Ins
+* Surrounded Dragons:: Surrounded Dragons
+* Influential Patterns:: Patterns used by the Influence module
+* Influential Display:: Colored display and debugging of influence
+* Influence Tuning:: Influence tuning with view.pike
+
+
+File: gnugo.info, Node: Influential Concepts, Next: Territory and Moyo, Up: Influence
+
+13.1 Conceptual Outline of Influence
+====================================
+
+We define call stones "lively" if they cannot be tactically attacked,
+or if they have a tactical defense and belong to the player whose turn
+it is. Similarly, stones that cannot be strategically attacked (in the
+sense of the life-and-death analysis), or that have a strategical
+defense and belong to the player to move, are called "alive". If we
+want to use the influence function before deciding the strategical
+status, all lively stones count as alive.
+
+ Every alive stone on the board works as an influence source, with
+influence of its color radiating outwards in all directions. The
+strength of the influence declines exponentially with the distance from
+the source.
+
+ Influence can only flow unhindered if the board is empty, however.
+All lively stones (regardless of color) act as influence barriers, as do
+connections between enemy stones that can't be broken through. For
+example the one space jump counts as a barrier unless either of the
+stones can be captured. Notice that it doesn't matter much if the
+connection between the two stones can be broken, since in that case
+there would come influence from both directions anyway.
+
+ From the influence of both colors we compute a territorial value
+between -1.0 and +1.0 for each intersection, which can be seen as the
+likely hood of it becoming territory for either color.
+
+ In order to avoid finding bogus territory, we add extra influence
+sources at places where an invasion can be launched, e.g. at 3-3 under
+a handicap stone, in the middle of wide edge extensions and in the
+center of large open spaces anywhere. Similarly we add extra influence
+sources where intrusions can be made into what otherwise looks as solid
+territory, e.g. monkey jumps. These intrusions depend on whose turn we
+assume it to be.
+
+ All these extra influence sources, as well as connections, are
+controlled by a pattern database, which consists of the two files
+patterns/influence.db and patterns/barriers.db. The details are
+explained in *note Influential Patterns::.
+
+
+File: gnugo.info, Node: Territory and Moyo, Next: Influence Usage, Prev: Influential Concepts, Up: Influence
+
+13.2 Territory, Moyo and Area
+=============================
+
+Using the influence code, empty regions of the board are partitioned in
+three ways. A vertex may be described as White or Black's "territory",
+"moyo" or "area". The functions `whose_territory()', `whose_moyo()' and
+`whose_area()' will return a color, or EMPTY if it belongs to one
+player or the other in one of these classifications.
+
+ * Territory
+
+ Those parts of the board which are expected to materialize as
+ actual points for one player or the other at the end of the
+ game are considered "territory".
+
+ * Moyo
+
+ Those parts of the board which are either already territory
+ or more generally places where a territory can easily
+ materialize if the opponent neglects to reduce are considered
+ "moyo". "moyo".
+
+ * Area
+
+ Those parts of the board where one player or the other has a
+ stronger influence than his opponent are considered "area".
+
+ Generally territory is moyo and moyo is area. To get a feeling for
+these concepts, load an sgf file in a middle game position with the
+option `-m 0x0180' and examine the resulting diagrams (*note
+Influential Display::).
+
+
+File: gnugo.info, Node: Influence Usage, Next: Influence and Territory, Prev: Territory and Moyo, Up: Influence
+
+13.3 Where influence gets used in the engine
+============================================
+
+The information obtained from the influence computation is used in a
+variety of places in the engine, and the influence module is called
+several times in the process of the move generation. The details of the
+influence computation vary according to the needs of the calling
+function.
+
+ After GNU Go has decided about the tactical stability of strings, the
+influence module gets called the first time. Here all lively stones act
+as an influence source of default strength 100. The result is stored in
+the variables `initial_influence' and `initial_opposite_influence', and
+it is used as an important information for guessing the strength of
+dragons. For example, a dragon that is part of a moyo of size 25 is
+immediately considered alive. For dragons with a smaller moyo size, a
+life-and-death analysis will be done by the owl code (see *note Pattern
+Based Reading::). A dragon with a moyo size of only 5 will be
+considered weak, even if the owl code has decided that it cannot be
+killed.
+
+ As a tool for both the owl code and the strength estimate of dragons,
+an "escape" influence gets computed for each dragon (*note Escape::).
+
+ Once all dragons have been evaluated, the influence module is called
+again and the variables `initial_influence' and
+`initial_opposite_influence' get overwritten. Of course, the dragon
+status', which are available now, are taken into account. Stones
+belonging to a dead dragon will not serve as an influence source, and
+the strengths of other stones get adjusted according to the strength of
+their respective dragon.
+
+ The result of this run is the most important tool for move
+evaluation. All helper functions of patterns as explained in *note
+Patterns:: that refer to influence results (e. g. `olib(*)' etc.)
+actually use these results. Further, `initial_influence' serves as the
+reference for computing the territorial value of a move. That is, from
+the influence strengths stored in `initial_influence', a territory
+value is assigned to each intersection. This value is supposed to
+estimate the likelyhood that this intersection will become white or
+black territory.
+
+ Then, for each move that gets considered in the function
+`value_moves', the influence module is called again via the function
+`compute_move_influence' to assess the likely territorial balance after
+this move, and the result is compared with the state before that move.
+
+ An additional influence computation is done in order to compute the
+followup value of a move. Some explainations are in *note Territorial
+Details::.
+
+ Some of the public functions from `influence.c' which are used
+throughout the engine are listed in *note Influence Utilities::.
+
+
+File: gnugo.info, Node: Influence and Territory, Next: Territorial Details, Prev: Influence Usage, Up: Influence
+
+13.4 Influence and Territory
+============================
+
+In this section we consider how the influence function is used to
+estimate territory in the function `estimate_territorial_value()'.
+
+ A move like `*' by `O' below is worth one point:
+
+ OXXX.
+ OX.XX
+ O*a.X
+ OX.XX
+ OXXX.
+
+ This is evaluated by the influence function in the following way: We
+first assign territory under the assumption that X moves first in all
+local positions in the original position; then we reassing territory,
+again under the assumption that `X' moves first in all local positions,
+but after we let `O' make the move at `*'. These two territory
+assignments are compared and the difference gives the territorial value
+of the move.
+
+ Technically, the assumption that `X' plays first everywhere is
+implemented via an asymmetric pattern database in `barriers.db'. What
+exactly is a safe connection that stops hostile influence from passing
+through is different for `O' and `X'; of course such a connection has
+to be tighter for stones with color `O'. Also, additional intrusion
+influence sources are added for `X' in places where `X' stones have
+natural followup moves.
+
+ In this specific example above, the asymmetry (before any move has
+been made) would turn out as follows: If `X' is in turn to move, the
+white influence would get stopped by a barrier at `*', leaving 4 points
+of territory for `X'. However, if `O' was next to move, then a
+followup move for the white stones at the left would be assumed in the
+form of an extra ("intrusion") influence source at `*'. This would get
+stopped at `a', leaving three points of territory.
+
+ Returning to the valuation of a move by `O' at `*', we get a value
+of 1 for the move at `*'. However, of course this move is sente once
+it is worth playing, and should therefore (in miai counting) be awarded
+an effective value of 2. Hence we need to recognize the followup value
+of a move. GNU Go 3.0 took care of this by using patterns in
+`patterns.db' that enforced an explicit followup value. Versions from
+3.2 on instead compute a seperate followup influence to each move
+considered. In the above example, an intrusion source will be added at
+`a' as a followup move to `*'. This destroys all of Black's territory
+and hence gives a followup value of 3.
+
+ The pattern based followup value are still needed at some places,
+however.
+
+ To give another example, consider this position where we want to
+estimate the value of an `O' move at `*':
+
+ OOOXXX
+ ..OX..
+ ..OX..
+ ...*..
+ ------
+
+ Before the move we assume `X' moves first in the local position (and
+that `O' has to connect), which gives territory like this (lower case
+letter identify territory for each player):
+
+ OOOXXX
+ ooOXxx
+ o.OXxx
+ o...xx
+ ------
+
+ Then we let `O' make the move at `*' and assume `X' moves first
+again next. The territory then becomes (`X' is also assumed to have to
+connect):
+
+ OOOXXX
+ ooOXxx
+ ooOX.x
+ oo.O.x
+ ------
+
+ We see that this makes a difference in territory of 4, which is what
+influence_delta_territory() should report. Then again, we have followup
+value, and here also a reverse followup value. The reverse followup
+value, which in this case will be so high that the move is treated as
+reverse sente, is added by an explicit pattern. Other sources for
+followup or reverse followup values are threats to capture a rescue a
+string of stones. See the code and comments in the function
+`value_move_reaons' for how followup and reverse followup values are
+used to adjust the effective move value.
+
+ To give an example of territorial value where something is captured,
+consider the `O' move at `*' here,
+
+ XXXXXXXO
+ X.OOOOXO
+ X.O..O*O
+ --------
+
+ As before we first let the influence function determine territory
+assuming X moves first, i.e. with a captured group:
+
+ XXXXXXXO
+ XxyyyyXO
+ Xxyxxy.O
+ --------
+
+ Here `y' indicates `X' territory + captured stone, i.e. these count
+for two points. After the `O' move at `*' we instead get
+
+ XXXXXXXO
+ X.OOOOXO
+ X.OooOOO
+ --------
+
+ and we see that `X' has 16 territory fewer and `O' has two territory
+more, for a total difference of 18 points.
+
+ That the influence function counts the value of captured stones was
+introduced in GNU Go 3.2. Previously this was instead done using the
+effective_size heuristic. The effective size is the number of stones
+plus the surrounding empty spaces which are closer to this string or
+dragon than to any other stones. Here the `O' string would thus have
+effective size 6 (number of stones) + 2 (interior eye) + 2*0.5 (the two
+empty vertices to the left of the string, split half each with the
+surrounding X string) + 1*0.33 (the connection point, split between
+three strings) = 9.33. As noted this value was doubled, giving 18.67
+which is reasonably close to the correct value of 18. The effective size
+heuristic is still used in certain parts of the move valuation where we
+can't easily get a more accurate value from the influence function (e.
+g. attacks depending on a ko, attack threats).
+
+ Note that this section only describes the territorial valuation of a
+move. Apart from that, GNU Go uses various heuristics in assigning a
+strategical value (weakening and strengthening of other stones on the
+board) to a move. Also, the influence function isn't quite as well
+tuned as the examples above may seem to claim. But it should give a
+fairly good idea of how the design is intended.
+
+ Another matter is that so far we have only considered the change in
+secure territory. GNU Go 3.2 and later versions use a revised
+heuristic, which is explained in the next section, to assign probable
+territory to each player.
+
+
+File: gnugo.info, Node: Territorial Details, Next: The Influence Core, Prev: Influence and Territory, Up: Influence
+
+13.5 Details of the Territory Valuation
+=======================================
+
+This section explains how GNU Go assigns a territorial value to an
+intersection once the white and black influence have been computed.
+The intention is that an intersection that has a chance of xx% of
+becoming white territory is counted as 0.xx points of territory for
+white, and similar for black.
+
+ The algorithm in the function `new_value_territory' goes roughly as
+follows:
+
+ If `wi' is the white influence at a point, and `bi' the black
+influence, then ` value = ( (wi-bi)/ (wi+bi) )^3' (positive values
+indicates likley white territory, negative stand for black territory)
+turns out to be very simple first guess that is still far off, but
+reasonable enough to be useful.
+
+ This value is then suspect a number of corrections. Assume that this
+first guess resulted in a positive value.
+
+ If both `bi' and `wi' are small, it gets reduced. What exactly is
+"small" depends on whether the intersection is close to a corner or an
+edge of the board, since it is easier to claim territory in the corner
+than in the center.
+
+ Then the value at each intersection is degraded to the minimum value
+of its neighbors. This can be seen as a second implementation of the
+proverb saying that there is no territory in the center of the board.
+This step substantially reduces the size of spheres of territory that
+are open at several sides.
+
+ Finally, there are a number of patterns that explicitly forbid GNU
+Go to count territory at some intersections. This is used e. g. for
+false eyes that will eventually have to be filled in. Also, points for
+prisoners are added.
+
+ To fine tune this scheme, some revisions have been made to the
+influence computations that are relevant for territorial evaluation.
+This includes a reduced default attenuation and some revised pattern
+handling.
+
+
+File: gnugo.info, Node: The Influence Core, Next: The Influence Algorithm, Prev: Territorial Details, Up: Influence
+
+13.6 The Core of the Influence Function
+=======================================
+
+The basic influence radiation process can efficiently be implemented as
+a breadth first search for adjacent and more distant points, using a
+queue structure.
+
+ Influence barriers can be found by pattern matching, assisted by
+reading through constraints and/or helpers. Wall structures, invasion
+points and intrusion points can be found by pattern matching as well.
+
+ When influence is computed, the basic idea is that there are a number
+of influence sources on the board, whose contributions are summed to
+produce the influence values. For the time being we can assume that the
+living stones on the board are the influence sources, although this is
+not the whole story.
+
+ The function `compute_influence()' contains a loop over the board,
+and for each influence source on the board, the function
+`accumulate_influence()' is called. This is the core of the influence
+function. Before we get into the details, this is how the influence
+field from a single isolated influence source of strength 100 turns out
+(with an attenuation of 3.0):
+
+ 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 1 1 1 0 0 0 0
+ 0 0 0 1 2 3 2 1 0 0 0
+ 0 0 1 3 5 11 5 3 1 0 0
+ 0 1 2 5 16 33 16 5 2 1 0
+ 0 1 3 11 33 X 33 11 3 1 0
+ 0 1 2 5 16 33 16 5 2 1 0
+ 0 0 1 3 5 11 5 3 1 0 0
+ 0 0 0 1 2 3 2 1 0 0 0
+ 0 0 0 0 1 1 1 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0
+
+ These values are in reality floating point numbers but have been
+rounded down to the nearest integer for presentation. This means that
+the influence field does not stop when the numbers become zeroes.
+
+ Internally `accumulate_influence()' starts at the influence source
+and spreads influence outwards by means of a breadth first propagation,
+implemented in the form of a queue. The order of propagation and the
+condition that influence only is spread outwards guarantee that no
+intersection is visited more than once and that the process terminates.
+In the example above, the intersections are visited in the following
+order:
+
+ + + + + + + + + + + +
+ + 78 68 66 64 63 65 67 69 79 +
+ + 62 46 38 36 35 37 39 47 75 +
+ + 60 34 22 16 15 17 23 43 73 +
+ + 58 32 14 6 3 7 19 41 71 +
+ + 56 30 12 2 0 4 18 40 70 +
+ + 57 31 13 5 1 8 20 42 72 +
+ + 59 33 21 10 9 11 24 44 74 +
+ + 61 45 28 26 25 27 29 48 76 +
+ + 77 54 52 50 49 51 53 55 80 +
+ + + + + + + + + + + +
+
+ The visitation of intersections continues in the same way on the
+intersections marked '`+' and further outwards. In a real position
+there will be stones and tight connections stopping the influence from
+spreading to certain intersections. This will disrupt the diagram
+above, but the main property of the propagation still remains, i.e. no
+intersection is visited more than once and after being visited no more
+influence will be propagated to the intersection.
+
+
+File: gnugo.info, Node: The Influence Algorithm, Next: Permeability, Prev: The Influence Core, Up: Influence
+
+13.7 The Influence Algorithm
+============================
+
+Let `(m, n)' be the coordinates of the influence source and `(i, j)'
+the coordinates of a an intersection being visited during propagation,
+using the same notation as in the `accumulate_influence()' function.
+Influence is now propagated to its eight closest neighbors, including
+the diagonal ones, according to the follow scheme:
+
+ For each of the eight directions `(di, dj)', do:
+
+ 1. Compute the scalar product `di*(i-m) + dj*(j-n)' between the
+ vectors `(di,dj)' and `(i,j) - (m,n)'
+
+ 2. If this is negative or zero, the direction is not outwards and we
+ continue with the next direction. The exception is when we are
+ visiting the influence source, i.e. the first intersection, when
+ we spread influence in all directions anyway.
+
+ 3. If `(i+di, j+dj)' is outside the board or occupied we also
+ continue with the next direction.
+
+ 4. Let S be the strength of the influence at `(i, j)'. The influence
+ propagated to `(i+di, j+dj)' from this intersection is given by
+ `P*(1/A)*D*S', where the three different kinds of damping are:
+
+ * The permeability `P', which is a property of the board
+ intersections. Normally this is one, i.e. unrestricted
+ propagation, but to stop propagation through e.g. one step
+ jumps, the permeability is set to zero at such intersections
+ through pattern matching. This is further discussed below.
+
+ * The attenuation `A', which is a property of the influence
+ source and different in different directions. By default this
+ has the value 3 except diagonally where the number is twice
+ as much. By modifying the attenuation value it is possible to
+ obtain influence sources with a larger or a smaller effective
+ range.
+
+ * The directional damping `D', which is the squared cosine of
+ the angle between `(di,dj)' and `(i,j) - (m,n)'. The idea is
+ to stop influence from "bending" around an interfering stone
+ and get a continuous behavior at the right angle cutoff. The
+ choice of the squared cosine for this purpose is rather
+ arbitrary, but has the advantage that it can be expressed as a
+ rational function of `m', `n', `i', `j', `di', and `dj',
+ without involving any trigonometric or square root
+ computations. When we are visiting the influence source we
+ let by convention this factor be one.
+
+ Influence is typically contributed from up to three neighbors
+"between" this intersection and the influence source. These values are
+simply added together. As pointed out before, all contributions will
+automatically have been made before the intersection itself is visited.
+
+ When the total influence for the whole board is computed by
+`compute_influence()', `accumulate_influence()' is called once for each
+influence source. These invocations are totally independent and the
+influence contributions from the different sources are added together.
+
+
+File: gnugo.info, Node: Permeability, Next: Escape, Prev: The Influence Algorithm, Up: Influence
+
+13.8 Permeability
+=================
+
+The permeability at the different points is initially one at all empty
+intersections and zero at occupied intersections. To get a useful
+influence function we need to modify this, however. Consider the
+following position:
+
+ |......
+ |OOOO..
+ |...O..
+ |...a.X ('a' empty intersection)
+ |...O..
+ |...OOO
+ |.....O
+ +------
+
+ The corner is of course secure territory for `O' and clearly the `X'
+stone has negligible effect inside this position. To stop `X' influence
+from leaking into the corner we use pattern matching (pattern
+Barrier1/Barrier2 in `barriers.db') to modify the permeability for `X'
+at this intersection to zero. `O' can still spread influence through
+this connection.
+
+ Another case that needs to be mentioned is how the permeability
+damping is computed for diagonal influence radiation. For horizontal
+and vertical radiation we just use the permeability (for the relevant
+color) at the intersection we are radiating from. In the diagonal case
+we additionally multiply with the maximum permeability at the two
+intersections we are trying to squeeze between. The reason for this can
+be found in the diagram below:
+
+ |...X |...X
+ |OO.. |Oda.
+ |..O. |.bc.
+ |..O. |..O.
+ +---- +----
+
+ We don't want `X' influence to be spread from `a' to `b', and since
+the permeability at both c and d is zero, the rule above stops this.
+
+
+File: gnugo.info, Node: Escape, Next: Break Ins, Prev: Permeability, Up: Influence
+
+13.9 Escape
+===========
+
+One application of the influence code is in computing the
+`dragon.escape_route' field. This is computed by the function
+`compute_escape()' as follows. First, every intersection is assigned
+an escape value, ranging between 0 and 4, depending on the influence
+value of the opposite color.
+
+ The `escape_route' field is modified by the code in `surround.c'
+(*note Surrounded Dragons::). It is divided by two for weakly surrounded
+dragons, and set to zero for surrounded ones.
+
+ In addition to assiging an escape value to empty vertices, we also
+assign an escape value to friendly dragons. This value can range from 0
+to 6 depending on the status of the dragon, with live dragons having
+value 6.
+
+ Then we sum the values of the resulting influence escape values over
+the intersections (including friendly dragons) at distance 4, that is,
+over those intersections which can be joined to the dragon by a path of
+length 4 (and no shorter path) not passing adjacent to any unfriendly
+dragon. In the following example, we sum the influence escape value
+over the four vertices labelled '4'.
+
+
+ . . . . . . . . . . . . . . . . . .
+ . . . . . X . . O . . . . . X . . O
+ . . X . . . . . O . . X . 2 . 4 . O
+ X . . . . . . . . X . . 1 1 2 3 4 .
+ X O . O . . . . O X O 1 O 1 2 3 4 O
+ X O . O . . . . . X O 1 O 1 . 4 . .
+ X O . . . X . O O X O 1 . . X . . O
+ . . . X . . . . . . 1 . X . . . . .
+ X . . . . X . . . X . . . . X . . .
+ . . . . . . . . . . . . . . . . . .
+
+ Since the dragon is trying to reach safety, the reader might wonder
+why `compute_influence()' is called with the opposite color of the
+dragon contemplating escape. To explain this point, we first remind
+the reader why there is a color parameter to `compute_influence()'.
+Consider the following example position:
+
+ ...XX...
+ OOO..OOO
+ O......O
+ O......O
+ --------
+
+ Whether the bottom will become O territory depends on who is in turn
+to play. This is implemented with the help of patterns in barriers.db,
+so that X influence is allowed to leak into the bottom if X is in turn
+to move but not if O is. There are also "invade" patterns which add
+influence sources in sufficiently open parts of the board which are
+handled differently depending on who is in turn to move.
+
+ In order to decide the territorial value of an O move in the third
+line gap above, influence is first computed in the original position
+with the opponent (i.e. X) in turn to move. Then the O stone is played
+to give:
+
+
+ ...XX...
+ OOO.OOOO
+ O......O
+ O......O
+ --------
+
+ Now influence is computed once more, also this time with X in turn to
+move. The difference in territory (as computed from the influence
+values) gives the territorial value of the move.
+
+ Exactly how influence is computed for use in the escape route
+estimation is all ad hoc. But it makes sense to assume the opponent
+color in turn to move so that the escape possibilities aren't
+overestimated. After we have made a move in the escape direction it is
+after all the opponent's turn.
+
+ The current escape route mechanism seems good enough to be useful
+but is not completely reliable. Mostly it seems to err on the side of
+being too optimistic.
+
+
+File: gnugo.info, Node: Break Ins, Next: Surrounded Dragons, Prev: Escape, Up: Influence
+
+13.10 Break Ins
+===============
+
+The code in `breakin.c' break-ins into territories that require deeper
+tactical reading and are thus impossible to detect for the influence
+module. It gets run after the influence module and revises its
+territory valuations.
+
+ The break-in code makes use of two public functions in
+`readconnect.c',
+
+ * int break_in(int str, const char goal[BOARDMAX], int *move)
+
+ Returns WIN if `str' can connect to the area `goal[]' (which
+ may or may not contain stones), if the string's owner gets
+ the first move.
+
+ * int block_off(int str, const char goal[BOARDMAX], int *move)
+
+ Returns WIN if `str' cannot connect to the area `goal[]'
+ (which may or may not contain stones), if the other color
+ moves first.
+
+ These functions are public front ends to their counterparts
+`recursive_break_in' and `recursive_block_off', which call each other
+recursively.
+
+ The procedure is as follows: We look at all big (>= 10) territory
+regions as detected by the influence code. Using the computation of
+connection distances from readconnect.c, we compute all nearby vertices
+of this territory. We look for the closest safe stones belonging to the
+opponent.
+
+ For each such string `str' we call
+
+ * `break_in(str, territory)' if the opponent is assumed to be next
+ to move,
+
+ * `block_off(str, territory)' if the territory owner is next.
+
+ If the break in is successful resp. the blocking unsuccessful, we
+shrink the territory, and see whether the opponent can still break in.
+We repeat this until the territory is shrunk so much that the opponent
+can no longer reach it.
+
+ To see the break in code in action run GNU Go on the file
+`regression/games/break_in.sgf' with the option `-d0x102000'. Among the
+traces you will find:
+
+ Trying to break in from D7 to:
+ E9 (1) F9 (1) G9 (1) E8 (1) F8 (1) G8 (1)
+ H8 (1) G7 (1) H7 (1) J7 (1) H6 (1) J6 (1)
+ H5 (1) J5 (1) H4 (1) J4 (1) H3 (1) J3 (1)
+ H2 (1) J2 (1)
+ block_off D7, result 0 PASS (355, 41952 nodes, 0.73 seconds)
+ E9 (1) F9 (1) G9 (1) E8 (1) F8 (1) G8 (1)
+ H8 (1) G7 (1) H7 (1) J7 (1) H6 (1) J6 (1)
+ H5 (1) J5 (1) H4 (1) J4 (1) H3 (1) J3 (1)
+ H2 (1) J2 (1)
+ B:F4
+ Erasing territory at E8 -b.
+ Erasing territory at G3 -b.
+ Now trying to break to smaller goal:
+ F9 (1) G9 (1) F8 (1) G8 (1) H8 (1) G7 (1)
+ H7 (1) J7 (1) H6 (1) J6 (1) H5 (1) J5 (1)
+ H4 (1) J4 (1) H3 (1) J3 (1) H2 (1) J2 (1)
+
+ This means that the function `break_in' is called with the goal
+marked 'a' in the following diagram. The code attempts to find out
+whether it is possible to connect into this area from the string at
+`D7'.
+
+ A B C D E F G H J
+ 9 . . . . a a a . . 9
+ 8 . . . . a a a a . 8
+ 7 . . . X O O a a a 7
+ 6 . . . X X X O a a 6
+ 5 . . . . + . . a a 5
+ 4 . . . X . . O a a 4
+ 3 . . . . X . . a a 3
+ 2 . . . . . . O a a 2
+ 1 . . . . . . . . . 1
+ A B C D E F G H J
+
+ A breakin is found, so the goal is shrunk by removing `E9' and `J2',
+then break_in is called again.
+
+ In order to see what reading is actually done in order to do this
+break in, you may load GNU Go in gtp mode, then issue the commands:
+
+ loadsgf break_in.sgf
+ = black
+
+ start_sgftrace
+ =
+
+ break_in D7 E9 F9 G9 E8 F8 G8 H8 G7 H7 J7 H6 J6 H5 J5 H4 J4 H3 J3 H2 J2
+ = 1 E8
+
+ finish_sgftrace vars.sgf
+ =
+
+ start_sgftrace
+ =
+
+ break_in D7 F9 G9 F8 G8 H8 G7 H7 J7 H6 J6 H5 J5 H4 J4 H3 J3 H2 J2
+ = 1 G7
+
+ finish_sgftrace vars1.sgf
+
+ This will produce two sgf files containing the variations caused by
+these calls to the breakin code. The second file, `vars1.sgf' will
+contain quite a few variations.
+
+ The break in code makes a list of break ins which are found. When
+it is finished, the function `add_expand_territory_move' is called for
+each break in, adding a move reason.
+
+ The break in code is slow, and only changes a few moves by the engine
+per game. Nevertheless we believe that it contributes substantially to
+the strength of the program. The break in code is enabled by default in
+GNU Go 3.6 at level 10, and disabled at level 9. In fact, this is the
+*only* difference between levels 9 and 10 in GNU Go 3.6.
+
+
+File: gnugo.info, Node: Surrounded Dragons, Next: Influential Patterns, Prev: Break Ins, Up: Influence
+
+13.11 Surrounded Dragons
+========================
+
+When is a dragon surrounded?
+
+ As has been pointed out by Bruce Wilcox, the geometric lines
+connecting groups of the opposite color are often important. It is very
+hard to prevent the escape of this `O' dragon:
+
+ ..........
+ .....O....
+ .X.......X
+ .X...O...X
+ ..........
+ ..........
+ ----------
+
+ On the other hand, this dragon is in grave danger:
+
+ ..........
+ ..........
+ .X.......X
+ .....O....
+ .X.......X
+ .X...O...X
+ ..........
+ ..........
+ ----------
+
+ The difference between these two positions is that in the first, the
+`O' dragon crosses the line connecting the top two `X' stones.
+
+ Code in `surround.c' implements a test for when a dragon is
+surrounded. The idea is to compute the convex hull of the _surround
+set_, that is, the set stones belonging to unfriendly neighbor dragons.
+If the dragon is contained within that hull. If it is, it is said to be
+_surrounded_.
+
+ In practice this scheme is modified slightly. The implementation
+uses various algorithms to compute distances and hostile stones are
+discarded from the surround set when a pair other hostile ones can be
+found which makes the considered one useless. For example, in the
+following position the bottom `O' stone would get discarded.
+
+ O.X.O
+ .....
+ .O.O.
+ .....
+ ..O..
+
+ Also, points are added to the surround set below stones on the
+second and third lines. This should account for the edge being a
+natural barrier.
+
+ In order to compute distances between corners of the convex hull a
+sorting by angle algorithm has been implemented. If the distance
+between a pair enclosing stones is large, the surround status gets
+decreased to `WEAKLY_SURROUNDED', or even 0 for very large ones.
+
+ The sorting by angle must be explained. A small diagram will
+probably help :
+
+ .O.O.
+ O...O
+ ..X..
+ O...O
+ .O.O.
+
+ The sorting algorithm will generate this:
+
+ .4.5.
+ 3...6
+ ..X..
+ 2...7
+ .1.8.
+
+ That is, the points are sorted by ascending order of the measure of
+the angle S-G-O, where S is SOUTH, G the (approximated) gravity center
+of the goal, and O the position of the considered hostile stones.
+
+ The necessity of such sorting appears when one tries to measure
+distances between enclosing stones without sorting them, just by using
+directly the existing left and right corners arrays. In some positions,
+the results will be inconsistent. Imagine, for example a position where
+for instance the points 1,2,3,4,6 and 7 were in the left arrary,
+leaving only 5 and 8 in the right array. Because of the large distance
+between 5 and 8, the dragon would have declared weak surrounded or not
+surrounded at all. Such cases are rare but frequent enough to require
+the angle sorting.
+
+ The following position:
+
+ O.X.O
+ .....
+ .O.O.
+
+ This is "more" surrounded than the following position:
+
+ O.XXXXXX.O
+ ..........
+ .O......O.
+
+ In the second case, the surround status would be lowered to
+`WEAKLY_SURROUNDED'.
+
+ The surround code is used to modify the escape_route field in the
+dragon2 data array. When a dragon is WEAKLY_SURROUNDED, the
+escape_route is divided by 2. If the dragon is SURROUNDED, escape_route
+is simply set to 0.
+
+
+File: gnugo.info, Node: Influential Patterns, Next: Influential Display, Prev: Surrounded Dragons, Up: Influence
+
+13.12 Patterns used by the Influence module
+===========================================
+
+This section explains the details of the pattern databases used for the
+influence computation.
+
+ First, we have the patterns in `influence.db', which get matched
+symmetrically for both colors.
+
+ * `E'
+
+ These patterns add extra influence sources close to some
+ shapes like walls. This tries to reflect their extra
+ strength. These patterns are not used in the influence
+ computations relevant for territory valuations, but they are
+ useful for getting a better estimate of strengths of groups.
+
+ * `I'
+
+ These patterns add extra influence sources at typical
+ invasion points. Usually they are of small strength. If they
+ additionally have the class `s', the extra influence source
+ is added for both colors. Otherwise, only the player assumed
+ to be next to move gets the benefit.
+
+ The patterns in `barriers.db' get matched only for `O' being the
+player next to move.
+
+ * `A'
+
+ Connections between `X' stones that stop influence of `O'.
+ They have to be tight enough that `O' cannot break through,
+ even though he is allowed to move first.
+
+ * `D'
+
+ Connections between `O' stones that stop influence of `X'. The
+ stones involved can be more loosely connected than those in
+ `A' patterns.
+
+ * `B'
+
+ These indicate positions of followup moves for the `O' stone
+ marked with `Q' in the pattern. They are used to reduce the
+ territory e. g. where a monkey jump is possible. Also, they
+ are used in the computation of the followup influence, if the
+ `Q' stone was the move played (or a stone saved by the move
+ played).
+
+ * `t'
+
+ These patterns indicate intersections where one color will
+ not be able to get territory, for example in a false eye. The
+ points are set with a call to the helper non_oterritory or
+ non_xterritory in the action of the pattern.
+
+ The intrusion patterns (`B') are more powerful than the description
+above might suggest. They can be very helpful in identifying weak shapes
+(by adding an intrusion source for the opponent where he can break
+through). A negative inference for this is that a single bad `B'
+pattern, e. g. one that has a wrong constraint, typically causes 5 to
+10 `FAIL's in the regression test suite.
+
+ Influence Patterns can have autohelper constraints as usual. As for
+the constraint attributes, there are (additionally to the usual ones
+`O', `o', `X' and `x'), attributes `Y' and `FY'. A pattern marked with
+`Y' will only be used in the influence computations relevant for the
+territory valuation, while `FY' patterns only get used in the other
+influence computations.
+
+ The action of an influence pattern is at the moment only used for
+non-territory patterns as mentioned above, and as a workaround for a
+problem with `B' patterns in the followup influence.
+
+ To see why this workaround is necessary, consider the follwoing
+situation:
+
+
+ ..XXX
+ .a*.O
+ .X.O.
+ ..XXO
+
+ (Imagine that there is `X' territory on the left.)
+
+ The move by `O' at `*' has a natural followup move at `a'. So, in
+the computation of the followup influence for `*', there would be an
+extra influence source for `O' at `a' which would destroy a lot of
+black territory on the left. This would give a big followup value, and
+in effect the move `*' would be treated as sente.
+
+ But of course it is gote, since `X' will answer at `a', which both
+stops the possible intrusion and threatens to capture `*'. This
+situation is in fact quite common.
+
+ Hence we need an additional constraint that can tell when an
+intrusion pattern can be used in followup influence. This is done by
+misusing the action line: An additional line
+
+ >return ;
+
+ gets added to the pattern. The `condition' should be true if the
+intrusion cannot be stopped in sente. In the above example, the relevant
+intrusion pattern will have an action line of the form
+
+ >return (!xplay_attack(a,b));
+
+ where `b' refers to the stone at `*'. In fact, almost all
+followup-specific constraints look similar to this.
+
+
+File: gnugo.info, Node: Influential Display, Next: Influence Tuning, Prev: Influential Patterns, Up: Influence
+
+13.13 Colored display and debugging of influence
+================================================
+
+There are various ways to obtain detailed information about the
+influence computations. Colored diagrams showing influence are possible
+from a colored xterm or rxvt window.
+
+ There are two options controlling when to generate diagrams:
+
+ * `-m 0x08' or `-m 8'
+
+ Show diagrams for the initial influence computation. This is
+ done twice, the first time before `make_dragons()' is run and
+ the second time after. The difference is that dead dragons
+ are taken into account the second time. Tactically captured
+ worms are taken into account both times.
+
+ * `--debug-influence LOCATION'
+
+ Show influence diagrams after the move at the given location.
+ An important limitation of this option is that it's only
+ effective for moves that the move generation is considering.
+
+ The other options control which diagrams should be generated in these
+situations. You have to specify at least one of the options above and
+at least one of the options below to generate any output.
+
+ * The options below must be combined with one of the two previous
+ones, or the diagram will not be printed. For example to print the
+influence diagram, you may combine 0x08 and 0x010, and use the option
+`-m 0x018'.*
+
+ * `-m 0x010' or `-m 16'
+
+ Show colored display of territory/moyo/area regions.
+ - territory: cyan
+
+ - moyo: yellow
+
+ - area: red
+ This feature is very useful to get an immediate impression of
+ the influence regions as GNU Go sees them.
+
+ * `-m 0x20' or `-m 32'
+
+ Show numerical influence values for white and black. These
+ come in two separate diagrams, the first one for white, the
+ second one for black. Notice that the influence values are
+ represented by floats and thus have been rounded in these
+ diagrams.
+
+ * `-m 0x40' or `-m 64'
+
+ This generates two diagrams showing the permeability for
+ black and white influence on the board.
+
+ * `-m 0x80' or `-m 128'
+
+ This shows the strength of the influence sources for black
+ and white across the board. You will see sources at each
+ lively stone (with strength depending on the strength of this
+ stone), and sources contributed by patterns.
+
+ * `-m 0x100' or `-m 256'
+
+ This shows the attenuation with which the influence sources
+ spread influence across the board. Low attenuation indicates
+ far-reaching influence sources.
+
+ * `-m 0x200' or `-m 512'
+
+ This shows the territory valuation of GNU Go. Each
+ intersection is shown with a value between -1.0 and +1.0 (or
+ -2 resp. +2 if there is a dead stone on this intersection).
+ Positive values indicate territory for white. A value of -0.5
+ thus indicates a point where black has a 50% chance of
+ getting territory.
+
+ Finally, there is the debug option `-d 0x1' which turns on on
+`DEBUG_INFLUENCE'. This gives a message for each influence pattern that
+gets matched. Unfortunately, these are way too many messages making it
+tedious to navigate the output. However, if you discover an influence
+source with `-m 0x80' that looks wrong, the debug output can help you
+to quickly find out the responsible pattern.
+
+
+File: gnugo.info, Node: Influence Tuning, Prev: Influential Display, Up: Influence
+
+13.14 Influence Tuning with `view.pike'
+=======================================
+
+A useful program in the regression directory is `view.pike'. To run
+it, you need Pike, which you may download from
+`http://pike.ida.liu.se/'.
+
+ The test case `endgame:920' fails in GNU Go 3.6. We will explain how
+to fix it.
+
+ Start by firing up view.pike on testcase endgame:920, e.g. by running
+`pike view.pike endgame:920' in the regression directory.
+
+ We see from the first view of move values that filling dame at P15 is
+valued highest with 0.17 points while the correct move at C4 is valued
+slightly lower with 0.16. The real problem is of course that C4 is
+worth a full point and thus should be valued about 1.0.
+
+ Now click on C4 to get a list of move reasons and move valuation
+information. Everything looks okay except that change in territory is
+0.00 rather than 1.00 as it ought to be.
+
+ We can confirm this by choosing the "delta territory for..." button
+and again clicking C4. Now B5 should have been marked as one point of
+change in territory, but it's not.
+
+ Next step is to enter the influence debug tool. Press the "influence"
+button, followed by "black influence, dragons known," and "territory
+value." This shows the expected territory if black locally moves first
+everywhere (thus "black influence"). Here we can see that B5 is
+incorrectly considered as 1.0 points of white territory.
+
+ We can compare this with the territory after a white move at C4
+(still assuming that black locally moves first everywhere after that) by
+pressing "after move influence for..." and clicking C4. This looks
+identical, as expected since delta territory was 0, but here it is
+correct that B5 is 1.0 points of territory for white.
+
+ The most straightforward solution to this problem is to add a
+non-territory pattern, saying that white can't get territory on B5 if
+black moves first. The nonterritory patterns are in `barriers.db'.
+
+ Pattern Nonterritory56
+
+ ...
+ X.O
+ ?O.
+
+ :8,t
+
+ eac
+ XbO
+ ?Od
+
+ ;oplay_attack(a,b,c,d,d)
+
+ >non_xterritory(e);
+
+ In these patterns it's always assumed that `O' moves first and thus
+it says that `X' can't get territory at `B5' (`e' in the pattern). Now
+we need to be a bit careful however since after `O' plays at `a' and
+`X' cuts in at `b', it may well happen that `O' needs to defend around
+`d', allowing `X' to cut at `c', possibly making the nonterritory
+assumption invalid. It's difficult to do this entirely accurate, but
+the constraint above is fairly conservative and should guarantee that
+`a' is safe in most, although not all, cases.
+
+
+File: gnugo.info, Node: Monte Carlo Go, Next: Libboard, Prev: Influence, Up: Top
+
+14 Monte Carlo Go
+*****************
+
+In Monte Carlo Go the engine plays random games to the end, generating
+moves from a pattern database within the context of the algorithm UCT
+(upper confidence bounds applied to trees). This algorithm allowed the
+program MoGo (`http://www.lri.fr/~gelly/MoGo.htm', to become the first
+computer program to defeat a professional while taking a 9 stone
+handicap (`http://senseis.xmp.net/?MoGo').
+
+ GNU Go 3.8 can play 9x9 Go with the option `--monte-carlo' using the
+UCT algorithm. For command line options, see *Note Invoking GNU Go::.
+
+ During reading, the engine makes incremental updates of local 3x3
+neighborhood, suicide status, self-atari status, and number of stones
+captured, for each move.
+
+ GNU Go's simulations (Monte Carlo games) are pattern generated. The
+random playout move generation is distributed strictly proportional to
+move values computed by table lookup from a local context consisting of
+3x3 neighborhood, opponent suicide status, own and opponent self-atari
+status, number of stones captured by own and opponent move, and
+closeness to the previous move. Let's call this local context simply "a
+pattern" and the table "pattern values" or simply "patterns".
+
+ There are three built-in databases that you can select using the
+option `--mc-patterns ', where `' is one of
+
+ * `mc_montegnu_classic'
+
+ * `mc_mogo_classic'
+
+ * `mc_uniform'
+
+ The first of these is an approximation of the previous random move
+generation algorithm. The `mogo_classic' pattern values is an
+approximation of the simulation policy used by early versions of MoGo,
+as published in the report odification of UCT with Patterns in
+Monte-Carlo Go (http://hal.inria.fr/inria-00117266) RR-6062, by Sylvain
+Gelly, Yizao Wang, Rémi Munos, and Olivier Teytaud. The uniform pattern
+values is the so called "light" playout which chooses uniformly between
+all legal moves except single point proper eyes.
+
+ If you're not satisfied with these you can also tune your own
+pattern values with a pattern database file and load it at runtime with
+`--mc-load-patterns ' adding your own pattern database.
+
+ Let's start with the uniform pattern values. Those are defined by the
+file `patterns/mc_uniform.db', which looks like this:
+
+
+ oOo
+ O*O
+ oO?
+
+ :0
+
+ oOo
+ O*O
+ ---
+
+ :0
+
+ |Oo
+ |*O
+ +--
+
+ :0
+
+ Patterns are always exactly 3x3 in size with the move at the center
+point. The symbols are the usual for GNU Go pattern databases:
+
+ * move
+ O own stone (i.e. the same color as the color to move)
+ o own stone or empty
+ X opponent stone
+ x opponent stone or empty
+ ? own stone, opponent stone, or empty
+ | vertical edge
+ - horizontal edge
+ + corner
+
+ There's also a new symbol:
+
+ % own stone, opponent stone, empty, or edge
+
+ After the pattern comes a line starting with a colon. In all these
+patterns it says that the pattern has a move value of 0, i.e. must not
+be played. Unmatched patterns have a default value of 1. When all move
+values are zero for both players, the playout will stop. Including the
+three patterns above is important because otherwise the playouts would
+be likely to go on indefinitely, or as it actually happens be
+terminated at a hard-coded limit of 600 moves. Also place these
+patterns at the top of the database because when multiple patterns
+match, the first one is used, regardless of the values.
+
+ When using only these patterns you will probably notice that it plays
+rather heavy, trying hard to be solidly connected. This is because
+uniform playouts are badly biased with a high probability of non-solid
+connections being cut apart. To counter this you could try a pattern
+like
+
+ ?X?
+ O*O
+ x.?
+
+ :20,near
+
+ to increase the probability that the one-point jump is reinforced
+when threatened. Here we added the property "near", which means that the
+pattern only applies if the previous move was played "near" this move.
+Primarily "near" means within the surrounding 3x3 neighborhood but it
+also includes certain cases of liberties of low-liberty strings
+adjacent to the previous move, e.g. the move to extend out of an atari
+created by the previous move. You have to read the source to find out
+the exact rules for nearness.
+
+ We could also be even more specific and say
+
+ ?X?
+ O*O
+ x.?
+
+ :20,near,osafe,xsafe
+
+ to exclude the cases where this move is a self atari (osafe) or would
+be a self-atari for the opponent (xsafe).
+
+ It may also be interesting to see the effect of capturing stones. A
+catch-all pattern for captures would be
+
+ ?X%
+ ?*%
+ %%%
+
+ :10,ocap1,osafe
+ :20,ocap2
+ :30,ocap3
+
+ where we have used multiple colon lines to specify different move
+values depending on the number of captured stones; value 10 for a
+single captured stone, value 20 for two captured stones, and value 30
+for three or more captured stones. Here we also excluded self-atari
+moves in the case of 1 captured stone in order to avoid getting stuck
+in triple-ko in the playouts (there's no superko detection in the
+playouts).
+
+ The full set of pattern properties is as follows:
+
+`near'
+ The move is "near" the previous move.
+
+`far'
+ The move is not "near" the previous move.
+
+`osafe'
+ The move is not a self-atari.
+
+`ounsafe'
+ The move is a self-atari.
+
+`xsafe'
+ The move would not be a self-atari for the opponent.
+
+`xunsafe'
+ The move would be a self-atari for the opponent.
+
+`xsuicide'
+ The move would be suicide for the opponent
+
+`xnosuicide'
+ The move would not be suicide for the opponent.
+
+`ocap0'
+ The move captures zero stones.
+
+`ocap1'
+ The move captures one stone.
+
+`ocap2'
+ The move captures two stones.
+
+`ocap3'
+ The move captures three or more stones.
+
+`ocap1+'
+ The move captures one or more stones.
+
+`ocap1-'
+ The move captures at most one stone.
+
+`ocap2+'
+ The move captures two or more stones.
+
+`ocap2-'
+ The move captures at most two stones.
+
+`xcap0'
+ An opponent move would capture zero stones.
+
+`xcap1'
+ An opponent move would capture one stone.
+
+`xcap2'
+ An opponent move would capture two stones.
+
+`xcap3'
+ An opponent move would capture three or more stones.
+
+`xcap1+'
+ An opponent move would capture one or more stones.
+
+`xcap1-'
+ An opponent move would capture at most one stone.
+
+`xcap2+'
+ An opponent move would capture two or more stones.
+
+`xcap2-'
+ An opponent move would capture at most two stones.
+
+ These can be combined arbitrarily but all must be satisfied for the
+pattern to take effect. If contradictory properties are combined, the
+pattern will never match.
+
+14.0.1 Final Remarks
+--------------------
+
+ * Move values are unsigned 32-bit integers. To avoid overflow in
+ computations it is highly recommended to keep the values below
+ 10000000 or so.
+
+ * There is no speed penalty for having lots of patterns in the
+ database. The average time per move is approximately constant
+ (slightly dependent on how often stones are captured or become low
+ on liberties) and the time per game mostly depends on the average
+ game length.
+
+ * For more complex pattern databases, see
+ `patterns/mc_montegnu_classic.db' and
+ `patterns/mc_mogo_classic.db'.
+
+ Nobody really knows how to tune the random playouts to get as strong
+engine as possible. Please play with this and report any interesting
+findings, especially if you're able to make it substantially stronger
+than the `montegnu_classic' patterns.
+
+
+File: gnugo.info, Node: Libboard, Next: SGF, Prev: Monte Carlo Go, Up: Top
+
+15 The Board Library
+********************
+
+* Menu:
+
+* Board Data Structures:: Board Data Structures
+* The Board Array:: One-dimensional board array
+* Incremental Board:: Incremental board data structures
+* Some Board Functions:: Explanation of some board functions
+
+ The foundation of the GNU Go engine is a library of very efficient
+routines for handling go boards. This board library, called
+`libboard', can be used for those programs that only need a basic go
+board but no AI capability. One such program is `patterns/joseki.c',
+which compiles joseki pattern databases from SGF files.
+
+ If you want to use the board library in your own program, you need
+all the .c-files listed under libboard_SOURCES in engine/Makefile.am,
+and the files in the directories sgf/ and utils/. Then you should
+include engine/board.h in your code.
+
+ The library consists of the following files:
+
+ * `board.h'
+
+ The public interface to the board library.
+
+ * `board.c'
+
+ The basic board code. It uses incremental algorithms for
+ keeping track of strings and liberties on the go board.
+
+ * `boardlib.c'
+
+ This contains all global variable of the board library.
+
+ * `hash.c'
+
+ Code for hashing go positions.
+
+ * `sgffile.c'
+
+ Implementation of output file in SGF format.
+
+ * `printutils.c'
+
+ Utilities for printing go boards and other things.
+
+
+ To use the board library, you must include `liberty.h' just like
+when you use the whole engine, but of course you cannot use all the
+functions declared in it, i.e. the functions that are part of the
+engine, but not part of the board library. You must link your
+application with `libboard.a'.
+
+
+File: gnugo.info, Node: Board Data Structures, Next: The Board Array, Up: Libboard
+
+15.1 Board Data structures
+==========================
+
+The basic data structures of the board correspond tightly to the
+`board_state' struct described in *Note The Board State::. They are all
+stored in global variables for efficiency reasons, the most important
+of which are:
+
+
+ int board_size;
+ Intersection board[MAXSIZE];
+ int board_ko_pos;
+
+ float komi;
+ int white_captured;
+ int black_captured;
+
+ Hash_data hashdata;
+
+ The description of the `Position' struct is applicable to these
+variables also, so we won't duplicate it here. All these variables are
+globals for performance reasons. Behind these variables, there are a
+number of other private data structures. These implement incremental
+handling of strings, liberties and other properties (*note Incremental
+Board::). The variable `hashdata' contains information about the hash
+value for the current position (*note Hashing::).
+
+ These variables should never be manipulated directly, since they are
+only the front end for the incremental machinery. They can be read, but
+should only be written by using the functions described in the next
+section. If you write directly to them, the incremental data structures
+will become out of sync with each other, and a crash is the likely
+result.
+
+
+File: gnugo.info, Node: The Board Array, Next: Incremental Board, Prev: Board Data Structures, Up: Libboard
+
+15.2 The Board Array
+====================
+
+GNU Go represents the board in a one-dimensional array called `board'.
+For some purposes a two dimensional indexing of the board by parameters
+`(i,j)' might be used.
+
+ The `board' array includes out-of-board markers around the board. To
+make the relation to the old two-dimensional board representation
+clear, this figure shows how the 1D indices correspond to the 2D
+indices when MAX_BOARD is 7.
+
+ j -1 0 1 2 3 4 5 6
+ i +----------------------------------
+ -1| 0 1 2 3 4 5 6 7
+ 0| 8 9 10 11 12 13 14 15
+ 1| 16 17 18 19 20 21 22 23
+ 2| 24 25 26 27 28 29 30 31
+ 3| 32 33 34 35 36 37 38 39
+ 4| 40 41 42 43 44 45 46 47
+ 5| 48 49 50 51 52 53 54 55
+ 6| 56 57 58 59 60 61 62 63
+ 7| 64 65 66 67 68 69 70 71 72
+
+ To convert between a 1D index `pos' and a 2D index `(i,j)', the
+macros `POS', `I', and `J' are provided, defined as below:
+
+ #define POS(i, j) ((MAX_BOARD + 2) + (i) * (MAX_BOARD + 1) + (j))
+ #define I(pos) ((pos) / (MAX_BOARD + 1) - 1)
+ #define J(pos) ((pos) % (MAX_BOARD + 1) - 1)
+
+ All 1D indices not corresponding to points on the board have the out
+of board marker value `GRAY'. Thus if `board_size' and `MAX_BOARD' both
+are 7, this looks like
+
+ j -1 0 1 2 3 4 5 6
+ i +----------------------------------
+ -1| # # # # # # # #
+ 0| # . . . . . . .
+ 1| # . . . . . . .
+ 2| # . . . . . . .
+ 3| # . . . . . . .
+ 4| # . . . . . . .
+ 5| # . . . . . . .
+ 6| # . . . . . . .
+ 7| # # # # # # # # #
+
+ The indices marked `#' have value `GRAY'. If `MAX_BOARD' is 7 and
+`board_size' is only 5:
+
+ j -1 0 1 2 3 4 5 6
+ i +----------------------------------
+ -1| # # # # # # # #
+ 0| # . . . . . # #
+ 1| # . . . . . # #
+ 2| # . . . . . # #
+ 3| # . . . . . # #
+ 4| # . . . . . # #
+ 5| # # # # # # # #
+ 6| # # # # # # # #
+ 7| # # # # # # # # #
+
+ Navigation on the board is done by the `SOUTH', `WEST', `NORTH', and
+`EAST' macros,
+
+ #define NS (MAX_BOARD + 1)
+ #define WE 1
+ #define SOUTH(pos) ((pos) + NS)
+ #define WEST(pos) ((pos) - 1)
+ #define NORTH(pos) ((pos) - NS)
+ #define EAST(pos) ((pos) + 1)
+
+ There are also shorthand macros `SW', `NW', `NE', `SE', `SS', `WW',
+`NN', `EE' for two step movements.
+
+ Any movement from a point on the board to an adjacent or diagonal
+vertex is guaranteed to produce a valid index into the board array, and
+the color found is GRAY if it is not on the board. To do explicit tests
+for out of board there are two macros
+
+ #define ON_BOARD(pos) (board[pos] != GRAY)
+ #define ON_BOARD1(pos) (((unsigned) (pos) < BOARDSIZE) && board[pos] != GRAY)
+
+ where the first one should be used in the algorithms and the second
+one is useful for assertion tests.
+
+ The advantage of a one-dimensional board array is that it gives a
+significant performance advantage. We need only one variable to
+determine a board position, which means that many functions need less
+arguments. Also, often one computation is sufficient for 1D-coordinate
+where we would need two with two 2D-coordinates: If we, for example,
+want to have the coordinate of the upper right of `pos', we can do this
+with `NORTH(EAST(pos))' instead of `(i+1, j-1)'.
+
+ *Important*: The 2D coordinate `(-1,-1)', which is used for pass and
+sometimes to indicate no point, maps to the 1D coordinate `0', not to
+`-1'. Instead of a plain `0', use one of the macros `NO_MOVE' or
+`PASS_MOVE'.
+
+ A loop over multiple directions is straightforwardly written:
+
+ for (k = 0; k < 4; k++) {
+ int d = delta[k];
+ do_something(pos + d);
+ }
+
+ The following constants are useful for loops over the entire board
+and allocation of arrays with a 1-1 mapping to the board.
+
+ #define BOARDSIZE ((MAX_BOARD + 2) * (MAX_BOARD + 1) + 1)
+ #define BOARDMIN (MAX_BOARD + 2)
+ #define BOARDMAX (MAX_BOARD + 1) * (MAX_BOARD + 1)
+
+ `BOARDSIZE' is the actual size of the 1D board array, `BOARDMIN' is
+the first index corresponding to a point on the board, and `BOARDMAX'
+is one larger than the last index corresponding to a point on the board.
+
+ Often one wants to traverse the board, carrying out some function at
+every vertex. Here are two possible ways of doing this:
+
+ int m, n;
+ for (m = 0; m < board_size; m++)
+ for (n = 0; n < board_size; n++) {
+ do_something(POS(m, n));
+ }
+
+ Or:
+
+ int pos;
+ for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
+ if (ON_BOARD(pos))
+ do_something(pos);
+ }
+
+
+File: gnugo.info, Node: Incremental Board, Next: Some Board Functions, Prev: The Board Array, Up: Libboard
+
+15.3 Incremental Board data structures
+======================================
+
+In addition to the global board state, the algorithms in `board.c'
+implement a method of incremental updates that keeps track of the
+following information for each string:
+
+ * The color of the string.
+
+ * Number of stones in the string.
+
+ * Origin of the string, i.e. a canonical reference point, defined to
+ be the stone with smallest 1D board coordinate.
+
+ * A list of the stones in the string.
+
+ * Number of liberties.
+
+ * A list of the liberties. If there are too many liberties the list
+ is truncated.
+
+ * The number of neighbor strings.
+
+ * A list of the neighbor strings.
+
+ The basic data structure is
+
+ struct string_data {
+ int color; /* Color of string, BLACK or WHITE */
+ int size; /* Number of stones in string. */
+ int origin; /* Coordinates of "origin", i.e. */
+ /* "upper left" stone. */
+ int liberties; /* Number of liberties. */
+ int libs[MAX_LIBERTIES]; /* Coordinates of liberties. */
+ int neighbors; /* Number of neighbor strings */
+ int neighborlist[MAXCHAIN]; /* List of neighbor string numbers. */
+ int mark; /* General purpose mark. */
+ };
+
+ struct string_data string[MAX_STRINGS];
+
+ It should be clear that almost all information is stored in the
+`string' array. To get a mapping from the board coordinates to the
+`string' array we have
+
+ static int string_number[BOARDMAX];
+
+which contains indices into the `string' array. This information is only
+valid at nonempty vertices, however, so it is necessary to first verify
+that `board[pos] != EMPTY'.
+
+ The `string_data' structure does not include an array of the stone
+coordinates. This information is stored in a separate array:
+
+ static int next_stone[BOARDMAX];
+
+ This array implements cyclic linked lists of stones. Each vertex
+contains a pointer to another (possibly the same) vertex. Starting at
+an arbitrary stone on the board, following these pointers should
+traverse the entire string in an arbitrary order before coming back to
+the starting point. As for the 'string_number' array, this information
+is invalid at empty points on the board. This data structure has the
+good properties of requiring fixed space (regardless of the number of
+strings) and making it easy to add a new stone or join two strings.
+
+ Additionally the code makes use of some work variables:
+
+ static int ml[BOARDMAX];
+ static int liberty_mark;
+ static int string_mark;
+ static int next_string;
+ static int strings_initialized = 0;
+
+ The `ml' array and `liberty_mark' are used to "mark" liberties on
+the board, e.g. to avoid counting the same liberty twice. The
+convention is that if `ml[pos]' has the same value as `liberty_mark',
+then `pos' is marked. To clear all marks it suffices to increase the
+value of `liberty_mark', since it is never allowed to decrease.
+
+ The same relation holds between the `mark' field of the `string_data'
+structure and `string_mark'. Of course these are used for marking
+individual strings.
+
+ `next_string' gives the number of the next available entry in the
+`string' array. Then `strings_initialized' is set to one when all data
+structures are known to be up to date. Given an arbitrary board
+position in the `board' array, this is done by calling
+`incremental_board_init()'. It is not necessary to call this function
+explicitly since any other function that needs the information does
+this if it has not been done.
+
+ The interesting part of the code is the incremental update of the
+data structures when a stone is played and subsequently removed. To
+understand the strategies involved in adding a stone it is necessary to
+first know how undoing a move works. The idea is that as soon as some
+piece of information is about to be changed, the old value is pushed
+onto a stack which stores the value and its address. The stack is built
+from the following structures:
+
+ struct change_stack_entry {
+ int *address;
+ int value;
+ };
+
+ struct change_stack_entry change_stack[STACK_SIZE];
+ int change_stack_index;
+
+and manipulated with the macros
+
+ BEGIN_CHANGE_RECORD()
+ PUSH_VALUE(v)
+ POP_MOVE()
+
+ Calling `BEGIN_CHANGE_RECORD()' stores a null pointer in the address
+field to indicate the start of changes for a new move. As mentioned
+earlier `PUSH_VALUE()' stores a value and its corresponding address.
+Assuming that all changed information has been duly pushed onto the
+stack, undoing the move is only a matter of calling `POP_MOVE()', which
+simply assigns the values to the addresses in the reverse order until
+the null pointer is reached. This description is slightly simplified
+because this stack can only store 'int' values and we need to also
+store changes to the board. Thus we have two parallel stacks where one
+stores `int' values and the other one stores `Intersection' values.
+
+ When a new stone is played on the board, first captured opponent
+strings, if any, are removed. In this step we have to push the board
+values and the `next_stone' pointers for the removed stones, and update
+the liberties and neighbor lists for the neighbors of the removed
+strings. We do not have to push all information in the 'string' entries
+of the removed strings however. As we do not reuse the entries they
+will remain intact until the move is pushed and they are back in use.
+
+ After this we put down the new stone and get three distinct cases:
+
+ 1. The new stone is isolated, i.e. it has no friendly neighbor.
+
+ 2. The new stone has exactly one friendly neighbor.
+
+ 3. The new stone has at least two friendly neighbors.
+
+ The first case is easiest. Then we create a new string by using the
+number given by `next_string' and increasing this variable. The string
+will have size one, `next_stone' points directly back on itself, the
+liberties can be found by looking for empty points in the four
+directions, possible neighbor strings are found in the same way, and
+those need also to remove one liberty and add one neighbor.
+
+ In the second case we do not create a new string but extend the
+neighbor with the new stone. This involves linking the new stone into
+the cyclic chain, if needed moving the origin, and updating liberties
+and neighbors. Liberty and neighbor information also needs updating for
+the neighbors of the new stone.
+
+ In the third case finally, we need to join already existing strings.
+In order not to have to store excessive amounts of information, we
+create a new string for the new stone and let it assimilate the
+neighbor strings. Thus all information about those can simply be left
+around in the 'string' array, exactly as for removed strings. Here it
+becomes a little more complex to keep track of liberties and neighbors
+since those may have been shared by more than one of the joined
+strings. Making good use of marks it all becomes rather straightforward
+anyway.
+
+ The often used construction
+
+ pos = FIRST_STONE(s);
+ do {
+ ...
+ pos = NEXT_STONE(pos);
+ } while (!BACK_TO_FIRST_STONE(s, pos));
+
+traverses the stones of the string with number `s' exactly once, with
+`pos' holding the coordinates. In general `pos' is used as board
+coordinate and `s' as an index into the `string' array or sometimes a
+pointer to an entry in the `string' array.
+
+
+File: gnugo.info, Node: Some Board Functions, Prev: Incremental Board, Up: Libboard
+
+15.4 Some Board Functions
+=========================
+
+*Reading*, often called *search* in computer game theory, is a
+fundamental process in GNU Go. This is the process of generating
+hypothetical future boards in order to determine the answer to some
+question, for example "can these stones live." Since these are
+hypothetical future positions, it is important to be able to undo them,
+ultimately returning to the present board. Thus a move stack is
+maintained during reading. When a move is tried, by the function
+`trymove', or its variant `tryko'. This function pushes the current
+board on the stack and plays a move. The stack pointer `stackp', which
+keeps track of the position, is incremented. The function `popgo()'
+pops the move stack, decrementing `stackp' and undoing the last move
+made.
+
+ Every successful `trymove()' must be matched with a `popgo()'. Thus
+the correct way of using this function is:
+
+
+ if (trymove(pos, color, ... )) {
+ ... [potentially lots of code here]
+ popgo();
+ }
+
+In case the move is a ko capture, the legality of the capture is
+subject to the komaster scheme (*note Ko::).
+
+ * `int trymove(int pos, int color, const char *message)'
+
+ Returns true if `(pos)' is a legal move for `color'. In that
+ case, it pushes the board on the stack and makes the move,
+ incrementing `stackp'. If the reading code is recording
+ reading variations (as with `--decide-string' or with `-o'),
+ the string `*message' will be inserted in the SGF file as a
+ comment. The comment will also refer to the string at `str'
+ if this is not `0'. The value of `str' can be NO_MOVE if it
+ is not needed but otherwise the location of `str' is included
+ in the comment.
+
+ * `int tryko(int pos, int color, const char *message)'
+
+ `tryko()' pushes the position onto the stack, and makes a move
+ `pos' of `color'. The move is allowed even if it is an
+ illegal ko capture. It is to be imagined that `color' has
+ made an intervening ko threat which was answered and now the
+ continuation is to be explored. Return 1 if the move is legal
+ with the above caveat. Returns zero if it is not legal
+ because of suicide.
+
+ * `void popgo()'
+
+ Pops the move stack. This function must (eventually) be
+ called after a succesful `trymove' or `tryko' to restore the
+ board position. It undoes all the changes done by the call to
+ `trymove/tryko' and leaves the board in the same state as it
+ was before the call.
+
+ *NOTE*: If `trymove/tryko' returns `0', i.e. the tried move
+ was not legal, you must *not* call `popgo'.
+
+ * `int komaster_trymove(int pos, int color, const char *message, int
+ str, int *is_conditional_ko, int consider_conditional_ko)'
+
+ Variation of `trymove'/`tryko' where ko captures (both
+ conditional and unconditional) must follow a komaster scheme
+ (*note Ko::).
+
+
+ As you see, `trymove()' plays a move which can be easily retracted
+(with `popgo()') and it is call thousands of times per actual game move
+as GNU Go analyzes the board position. By contrast the function
+`play_move()' plays a move which is intended to be permanent, though it
+is still possible to undo it if, for example, the opponent retracts a
+move.
+
+ * `void play_move(int pos, int color)'
+
+ Play a move. If you want to test for legality you should
+ first call `is_legal()'. This function strictly follows the
+ algorithm:
+ 1. Place a stone of given color on the board.
+
+ 2. If there are any adjacent opponent strings without
+ liberties, remove them and increase the prisoner count.
+
+ 3. If the newly placed stone is part of a string without
+ liberties, remove it and increase the prisoner count.
+ In spite of the name "permanent move", this move can
+ (usually) be unplayed by `undo_move()', but it is
+ significantly more costly than unplaying a temporary move.
+ There are limitations on the available move history, so under
+ certain circumstances the move may not be possible to unplay
+ at a later time.
+
+ * `int undo_move(int n)'
+
+ Undo `n' permanent moves. Returns 1 if successful and 0 if it
+ fails. If `n' moves cannot be undone, no move is undone.
+
+ Other board functions are documented in *Note Board Utilities::.
+
+
+File: gnugo.info, Node: SGF, Next: DFA, Prev: Libboard, Up: Top
+
+16 Handling SGF trees in memory
+*******************************
+
+"SGF" - Smart Game Format - is a file format which is used for storing
+game records for a number of different games, among them chess and go.
+The format is a framework with special adaptions to each game. This is
+not a description of the file format standard. Too see the exact
+definition of the file format, see `http://www.red-bean.com/sgf/'.
+
+ GNU Go contains a library to handle go game records in the SGF
+format in memory and to read and write SGF files. This library -
+`libsgf.a' - is in the `sgf' subdirectory. To use the SGF routines,
+include the file `sgftree.h'.
+
+ Each game record is stored as a tree of "nodes", where each node
+represents a state of the game, often after some move is made. Each node
+contains zero or more "properties", which gives meaning to the node.
+There can also be a number of "child nodes" which are different
+variations of the game tree. The first child node is the main variation.
+
+ Here is the definition of `SGFNode', and `SGFProperty', the data
+structures which are used to encode the game tree.
+
+
+ typedef struct SGFProperty_t {
+ struct SGFProperty_t *next;
+ short name;
+ char value[1];
+ } SGFProperty;
+
+ typedef struct SGFNode_t {
+ SGFProperty *props;
+ struct SGFNode_t *parent;
+ struct SGFNode_t *child;
+ struct SGFNode_t *next;
+ } SGFNode;
+
+ Each node of the SGF tree is stored in an `SGFNode' struct. It has a
+pointer to a linked list of properties (see below) called `props'. It
+also has a pointer to a linked list of children, where each child is a
+variation which starts at this node. The variations are linked through
+the `next' pointer and each variation continues through the `child'
+pointer. Each and every node also has a pointer to its parent node (the
+`parent' field), except the top node whose parent pointer is `NULL'.
+
+ An SGF property is encoded in the `SGFPoperty' struct. It is linked
+in a list through the `next' field. A property has a `name' which is
+encoded in a short int. Symbolic names of properties can be found in
+`sgf_properties.h'.
+
+ Some properties also have a value, which could be an integer, a
+floating point value, a character or a string. These values can be
+accessed or set through special functions.
+
+16.1 The SGFTree datatype
+=========================
+
+Sometimes we just want to record an ongoing game or something similarly
+simple and not do any sofisticated tree manipulation. In that case we
+can use the simplified interface provided by `SGFTree' below.
+
+
+ typedef struct SGFTree_t {
+ SGFNode *root;
+ SGFNode *lastnode;
+ } SGFTree;
+
+ An `SGFTree' contains a pointer to the root node of an SGF tree and
+a pointer to the node that we last accessed. Most of the time this will
+be the last move of an ongoing game.
+
+ Most of the functions which manipulate an `SGFTree' work exactly
+like their `SGFNode' counterparts, except that they work on the current
+node of the tree.
+
+ All the functions below that take arguments `tree' and `node' will
+work on:
+
+ 1. `node' if non-`NULL'
+
+ 2. `tree->lastnode' if non-`NULL'
+
+ 3. The current end of the game tree.
+ in that order.
+
+
+File: gnugo.info, Node: API, Next: GTP, Prev: Utility Functions, Up: Top
+
+17 Application Programmers Interface to GNU Go
+**********************************************
+
+If you want to write your own interface to GNU Go, or if you want to
+create a go application using the GNU Go engine, this chapter is of
+interest to you.
+
+ First an overview: GNU Go consists of two parts: the GNU Go engine
+and a program (user interface) which uses this engine. These are linked
+together into one binary. The current program implements the following
+user modes:
+
+ * An interactive board playable on ASCII terminals
+
+ * solo play - GNU Go plays against itself
+
+ * replay - a mode which lets the user investigate moves in an
+ existing SGF file.
+
+ * GMP - Go Modem Protocol, a protocol for automatic play between two
+ computers.
+
+ * GTP - Go Text Protocol, a more general go protocol, *note GTP::.
+
+ The GNU Go engine can be used in other applications. For example,
+supplied with GNU Go is another program using the engine, called
+`debugboard', in the directory `interface/debugboard/'. The program
+debugboard lets the user load SGF files and can then interactively look
+at different properties of the position such as group status and eye
+status.
+
+ The purpose of this Chapter is to show how to interface your own
+program such as `debugboard' with the GNU Go engine.
+
+ Figure 1 describes the structure of a program using the GNU Go
+engine.
+
+ +-----------------------------------+
+ | |
+ | Go application |
+ | |
+ +-----+----------+------+ |
+ | | | | |
+ | | Game | | |
+ | | handling | | |
+ | | | | |
+ | +----+-----+ | |
+ | SGF | Move | |
+ | handling | generation | |
+ | | | |
+ +----------+------------+-----------+
+ | |
+ | Board handling |
+ | |
+ +-----------------------------------+
+
+ Figure 1: The structure of a program using the GNU Go engine
+
+ The foundation is a library called `libboard.a' which provides
+efficient handling of a go board with rule checks for moves, with
+incremental handling of connected strings of stones and with methods to
+efficiently hash go positions.
+
+ On top of this, there is a library which helps the application use
+Smart Game Format (SGF) files, with complete handling of game trees in
+memory and in files. This library is called `libsgf.a'
+
+ The main part of the code within GNU Go is the move generation
+library which given a position generates a move. This part of the
+engine can also be used to manipulate a go position, add or remove
+stones, do tactical and strategic reading and to query the engine for
+legal moves. These functions are collected into `libengine.a'.
+
+ The game handling code helps the application programmer keep tracks
+of the moves in a game. Games can be saved to SGF files and then later
+be read back again. These are also within `libengine.a'.
+
+ The responsibility of the application is to provide the user with a
+user interface, graphical or not, and let the user interact with the
+engine.
+
+* Menu:
+
+* Getting Started:: How to use the engine in your program
+* Basic Data Structures:: Basic Data Structures in the Engine
+* The Board State:: The board_state `struct'
+* Positional Functions:: Functions which manipulate a Position
+
+
+File: gnugo.info, Node: Getting Started, Next: Basic Data Structures, Up: API
+
+17.1 How to use the engine in your own program: getting started
+===============================================================
+
+To use the GNU Go engine in your own program you must include the file
+`gnugo.h'. This file describes the whole public API. There is another
+file, `liberty.h', which describes the internal interface within the
+engine. If you want to make a new module within the engine, e.g. for
+suggesting moves you will have to include this file also. In this
+section we will only describe the public interface.
+
+ Before you do anything else, you have to call the function
+`init_gnugo()'. This function initializes everything within the engine.
+It takes one parameter: the number of megabytes the engine can use for
+the internal hash table. In addition to this the engine will use a few
+megabytes for other purposes such as data describing groups (liberties,
+life status, etc), eyes and so on.
+
+
+File: gnugo.info, Node: Basic Data Structures, Next: The Board State, Prev: Getting Started, Up: API
+
+17.2 Basic Data Structures in the Engine
+========================================
+
+There are some basic definitions in gnugo.h which are used everywhere.
+The most important of these are the numeric declarations of colors.
+Each intersection on the board is represented by one of these:
+
+
+ color value
+ EMPTY 0
+ WHITE 1
+ BLACK 2
+
+ There is a macro, `OTHER_COLOR(color)' which can be used to get the
+other color than the parameter. This macro can only be used on `WHITE'
+or `BLACK', but not on `EMPTY'.
+
+ GNU Go uses two different representations of the board, for most
+purposes a one-dimensional one, but for a few purposes a two
+dimensional one (*note Libboard::). The one-dimensional board was
+introduced before GNU Go 3.2, while the two-dimensional board dates
+back to the ancestral program written by Man Lung Li before 1995. The
+API still uses the two-dimensional board, so the API functions have not
+changed much since GNU Go 3.0.
+
+
+File: gnugo.info, Node: The Board State, Next: Positional Functions, Prev: Basic Data Structures, Up: API
+
+17.3 The board_state struct
+===========================
+
+A basic data structure in the engine is the `board_state' struct. This
+structure is internal to the engine and is defined in `liberty.h'.
+
+
+ typedef unsigned char Intersection;
+
+ struct board_state {
+ int board_size;
+
+ Intersection board[BOARDSIZE];
+ int board_ko_pos;
+ int black_captured;
+ int white_captured;
+
+ Intersection initial_board[BOARDSIZE];
+ int initial_board_ko_pos;
+ int initial_white_captured;
+ int initial_black_captured;
+ int move_history_color[MAX_MOVE_HISTORY];
+ int move_history_pos[MAX_MOVE_HISTORY];
+ int move_history_pointer;
+
+ float komi;
+ int move_number;
+ };
+
+ Here `Intersection' stores `EMPTY', `WHITE' or `BLACK'. It is
+currently defined as an `unsigned char' to make it reasonably efficient
+in both storage and access time. The board state contains an array of
+`Intersection''s representing the board. The move history is contained
+in the struct. Also contained in the struct is the location of a ko
+(`EMPTY') if the last move was not a ko capture, the komi, the number
+of captures, and corresponding data for the initial position at the
+beginning of the move history.
+
+
+File: gnugo.info, Node: Positional Functions, Prev: The Board State, Up: API
+
+17.4 Functions which manipulate a Position
+==========================================
+
+All the functions in the engine that manipulate Positions have names
+prefixed by `gnugo_'. These functions still use the two-dimensional
+representation of the board (*note The Board Array::). Here is a
+complete list, as prototyped in `gnugo.h':
+
+ * `void init_gnugo(float memory)'
+
+ Initialize the gnugo engine. This needs to be called once
+ only.
+
+ * `void gnugo_clear_board(int boardsize)'
+
+ Clear the board.
+
+ * `void gnugo_set_komi(float new_komi)'
+
+ Set the komi.
+
+ * `void gnugo_add_stone(int i, int j, int color)'
+
+ Place a stone on the board
+
+ * `void gnugo_remove_stone(int i, int j)'
+
+ Remove a stone from the board
+
+ * `int gnugo_is_pass(int i, int j)'
+
+ Return true if (i,j) is PASS_MOVE
+
+ * `void gnugo_play_move(int i, int j, int color)'
+
+ Play a move and start the clock
+
+ * `int gnugo_undo_move(int n)'
+
+ Undo n permanent moves. Returns 1 if successful and 0 if it
+ fails. If n moves cannot be undone, no move is undone.
+
+ * `int gnugo_play_sgfnode(SGFNode *node, int to_move)'
+
+ Perform the moves and place the stones from the SGF node on
+ the board. Return the color of the player whose turn it is to
+ move.
+
+ * `int gnugo_play_sgftree(SGFNode *root, int *until, SGFNode
+ **curnode)'
+
+ Play the moves in ROOT UNTIL movenumber is reached. Return
+ the color of the player whose turn it is to move.
+
+ * `int gnugo_is_legal(int i, int j, int color)'
+
+ Interface to `is_legal()'.
+
+ * `int gnugo_is_suicide(int i, int j, int color)'
+
+ Interface to `is_suicide()'.
+
+ * `int gnugo_placehand(int handicap)'
+
+ Interface to placehand. Sets up handicap pieces and returns
+ the number of placed handicap stones.
+
+ * `void gnugo_recordboard(SGFNode *root)'
+
+ Interface to `sgffile_recordboard()'
+
+ * `int gnugo_sethand(int handicap, SGFNode *node)'
+
+ Interface to placehand. Sets up handicap stones and returns
+ the number of placed handicap stones, updating the sgf file
+
+ * `float gnugo_genmove(int *i, int *j, int color, int *resign)'
+
+ Interface to `genmove()'.
+
+ * `int gnugo_attack(int m, int n, int *i, int *j)'
+
+ Interface to `attack()'.
+
+ * `int gnugo_find_defense(int m, int n, int *i, int *j)'
+
+ Interface to `find_defense()'.
+
+ * `void gnugo_who_wins(int color, FILE *outfile)'
+
+ Interface to `who_wins()'.
+
+ * `float gnugo_estimate_score(float *upper, float *lower)'
+
+ Put upper and lower score estimates into `*upper', `*lower'
+ and return the average. A positive score favors white. In
+ computing the upper bound, `CRITICAL' dragons are awarded to
+ white; in computing the lower bound, they are awarded to
+ black.
+
+ * `void gnugo_examine_position(int color, int how_much)'
+
+ Interface to `examine_position'.
+
+ * `int gnugo_get_komi()'
+
+ Report the komi.
+
+ * `void gnugo_get_board(int b[MAX_BOARD][MAX_BOARD])'
+
+ Place the board into the `b' array.
+
+ * `int gnugo_get_boardsize()'
+
+ Report the board size.
+
+ * `int gnugo_get_move_number()'
+
+ Report the move number.
+
+17.5 Game handling
+==================
+
+The functions (in *note Positional Functions::) are all that are needed
+to create a fully functional go program. But to make the life easier
+for the programmer, there is a small set of functions specially
+designed for handling ongoing games.
+
+ The data structure describing an ongoing game is the `Gameinfo'. It
+is defined as follows:
+
+
+ typedef struct {
+ int handicap;
+
+ int to_move; /* whose move it currently is */
+ SGFTree game_record; /* Game record in sgf format. */
+
+ int computer_player; /* BLACK, WHITE, or EMPTY (used as BOTH) */
+
+ char outfilename[128]; /* Trickle file */
+ FILE *outfile;
+ } Gameinfo;
+
+ The meaning of `handicap' should be obvious. `to_move' is the color
+of the side whose turn it is to move.
+
+ The SGF tree `game_record' is used to store all the moves in the
+entire game, including a header node which contains, among other
+things, komi and handicap.
+
+ If one or both of the opponents is the computer, the field
+`computer_player' is used. Otherwise it can be ignored.
+
+ GNU Go can use a trickle file to continuously save all the moves of
+an ongoing game. This file can also contain information about internal
+state of the engine such as move reasons for various locations or move
+valuations. The name of this file should be stored in `outfilename' and
+the file pointer to the open file is stored in `outfile'. If no trickle
+file is used, `outfilename[0]' will contain a null character and
+`outfile' will be set to `NULL'.
+
+17.5.1 Functions which manipulate a Gameinfo
+--------------------------------------------
+
+All the functions in the engine that manipulate Gameinfos have names
+prefixed by `gameinfo_'. Here is a complete list, as prototyped in
+`gnugo.h':
+
+ * `void gameinfo_clear(Gameinfo *ginfo, int boardsize, float komi)'
+
+ Initialize the `Gameinfo' structure.
+
+ * `void gameinfo_print(Gameinfo *ginfo)'
+
+ Print a gameinfo.
+
+ * `void gameinfo_load_sgfheader(Gameinfo *gameinfo, SGFNode *head)'
+
+ Reads header info from sgf structure and sets the appropriate
+ variables.
+
+ * `void gameinfo_play_move(Gameinfo *ginfo, int i, int j, int color)'
+
+ Make a move in the game. Return 1 if the move was legal. In
+ that case the move is actually done. Otherwise return 0.
+
+ * `int gameinfo_play_sgftree_rot(Gameinfo *gameinfo, SGFNode *head,
+ const char *untilstr, int orientation)'
+
+ Play the moves in an SGF tree. Walk the main variation,
+ actioning the properties into the playing board. Returns the
+ color of the next move to be made. Head is an sgf tree.
+ Untilstr is an optional string of the form either 'L12' or
+ '120' which tells it to stop playing at that move or move
+ number. When debugging, this is the location of the move
+ being examined.
+
+ * `int gameinfo_play_sgftree(Gameinfo *gameinfo, SGFNode *head,
+ const char *untilstr)'
+
+ Same as previous function, using standard orientation.
+
+
+File: gnugo.info, Node: Utility Functions, Next: API, Prev: DFA, Up: Top
+
+18 Utility Functions
+********************
+
+In this Chapter, we document some of the utilities which may be called
+from the GNU Go engine.
+
+* Menu:
+
+* General Utilities:: Utilities from `engine/utils.c'
+* Print Utilities:: Utilities from `engine/printutils.c'
+* Board Utilities:: Utilities from `engine/board.c'
+* Influence Utilities:: Utilities from `engine/influence.c'
+
+
+File: gnugo.info, Node: General Utilities, Next: Print Utilities, Up: Utility Functions
+
+18.1 General Utilities
+======================
+
+Utility functions from `engine/utils.c'. Many of these functions
+underlie autohelper functions (*note Autohelper Functions::).
+
+ * `void change_dragon_status(int dr, int status)'
+
+ Change the status of all the stones in the dragon at `dr'.
+
+ * `int defend_against(int move, int color, int apos)'
+
+ Check whether a move at `move' stops the enemy from playing
+ at (apos).
+
+ * `int cut_possible(int pos, int color)'
+
+ Returns true if `color' can cut at `pos', or if connection
+ through `pos' is inhibited. This information is collected by
+ `find_cuts()', using the B patterns in the connections
+ database.
+
+ * `int does_attack(int move, int str)'
+
+ returns true if the move at `move' attacks `str'. This means
+ that it captures the string, and that `str' is not already
+ dead.
+
+ * `int does_defend(int move, int str)'
+
+ `does_defend(move, str)' returns true if the move at `move'
+ defends `str'. This means that it defends the string, and that
+ `str' can be captured if no defense is made.
+
+ * `int somewhere(int color, int last_move, ...)'
+
+ Example: `somewhere(WHITE, 2, apos, bpos, cpos)'. Returns
+ true if one of the vertices listed satisfies
+ `board[pos]==color'. Here num_moves is the number of moves
+ minus one. If the check is true the dragon is not allowed to
+ be dead. This check is only valid if `stackp==0'.
+
+ * `int visible_along_edge(int color, int apos, int bpos)'
+
+ Search along the edge for the first visible stone. Start at
+ apos and move in the direction of bpos. Return 1 if the first
+ visible stone is of the given color. It is required that apos
+ and bpos are at the same distance from the edge.
+
+ * `int test_symmetry_after_move(int move, int color, int strict)'
+
+ Is the board symmetric (or rather antisymmetric) with respect
+ to mirroring in tengen after a specific move has been played?
+ If the move is PASS_MOVE, check the current board. If strict
+ is set we require that each stone is matched by a stone of
+ the opposite color at the mirrored vertex. Otherwise we only
+ require that each stone is matched by a stone of either color.
+
+ * `int play_break_through_n(int color, int num_moves, ...)'
+
+ The function `play_break_through_n()' plays a sequence of
+ moves, alternating between the players and starting with
+ color. After having played through the sequence, the three
+ last coordinate pairs gives a position to be analyzed by
+ `break_through()', to see whether either color has managed to
+ enclose some stones and/or connected his own stones. If any
+ of the three last positions is empty, it's assumed that the
+ enclosure has failed, as well as the attempt to connect. If
+ one or more of the moves to play turns out to be illegal for
+ some reason, the rest of the sequence is played anyway, and
+ `break_through()' is called as if nothing special happened.
+ Like `break_through()', this function returns 1 if the
+ attempt to break through was succesful and 2 if it only
+ managed to cut through.
+
+ * `int play_attack_defend_n(int color, int do_attack, int num_moves,
+ ...)'
+
+ * `int play_attack_defend2_n(int color, int do_attack, int
+ num_moves, ...)'
+
+ The function `play_attack_defend_n()' plays a sequence of
+ moves, alternating between the players and starting with
+ `color'. After having played through the sequence, the last
+ coordinate pair gives a target to attack or defend, depending
+ on the value of do_attack. If there is no stone present to
+ attack or defend, it is assumed that it has already been
+ captured. If one or more of the moves to play turns out to be
+ illegal for some reason, the rest of the sequence is played
+ anyway, and attack/defense is tested as if nothing special
+ happened. Conversely, `play_attack_defend2_n()' plays a
+ sequence of moves, alternating between the players and
+ starting with `color'. After having played through the
+ sequence, the two last coordinate pairs give two targets to
+ simultaneously attack or defend, depending on the value of
+ do_attack. If there is no stone present to attack or defend,
+ it is assumed that it has already been captured. If one or
+ more of the moves to play turns out to be illegal for some
+ reason, the rest of the sequence is played anyway, and
+ attack/defense is tested as if nothing special happened. A
+ typical use of these functions is to set up a ladder in an
+ autohelper and see whether it works or not.
+
+ * `int play_connect_n(int color, int do_connect, int num_moves, ...)'
+
+ Plays a sequence of moves, alternating between the players
+ and starting with `color'. After having played through the
+ sequence, the two last coordinates give two targets that
+ should be connected or disconnected, depending on the value
+ of do_connect. If there is no stone present to connect or
+ disconnect, it is assumed that the connection has failed. If
+ one or more of the moves to play turns out to be illegal for
+ some reason, the rest of the sequence is played anyway, and
+ connection/disconnection is tested as if nothing special
+ happened. Ultimately the connection is decided by the
+ functions `string_connect' and `disconnect' (*note Connection
+ Reading::).
+
+ * `void set_depth_values(int level)'
+
+ It is assumed in reading a ladder if `stackp >= depth' that
+ as soon as a bounding stone is in atari, the string is safe.
+ Similar uses are made of the other depth parameters such as
+ `backfill_depth' and so forth. In short, simplifying
+ assumptions are made when `stackp' is large. Unfortunately
+ any such scheme invites the "horizon effect," in which a
+ stalling move is perceived as a win, by pushing the
+ refutation past the "horizon"--the value of `stackp' in which
+ the reading assumptions are relaxed. To avoid the depth it is
+ sometimes necessary to increase the depth parameters. This
+ function can be used to set the various reading depth
+ parameters. If `mandated_depth_value' is not -1 that value is
+ used; otherwise the depth values are set as a function of
+ level. The parameter `mandated_depth_value' can be set at the
+ command line to force a particular value of depth; normally
+ it is -1.
+
+ * `void modify_depth_values(int n)'
+
+ Modify the various tactical reading depth parameters. This is
+ typically used to avoid horizon effects. By temporarily
+ increasing the depth values when trying some move, one can
+ avoid that an irrelevant move seems effective just because
+ the reading hits a depth limit earlier than it did when
+ reading only on relevant moves.
+
+ * `void increase_depth_values(void)'
+
+ `modify_depth_values(1)'.
+
+ * `void decrease_depth_values(void)'
+
+ `modify_depth_values(-1)'.
+
+ * `void restore_depth_values()'
+
+ Sets `depth' and so forth to their saved values.
+
+ * `void set_temporary_depth_values(int d, int b, int b2, int bc, int
+ ss, int br, int f, int k)'
+
+ Explicitly set the depth values. This function is currently
+ never called.
+
+ * `int confirm_safety(int move, int color, int *defense_point, char
+ safe_stones[BOARDMAX])'
+
+ Check that the move at color doesn't involve any kind of
+ blunder, regardless of size.
+
+ * `float blunder_size(int move, int color, int *defense_point, char
+ safe_stones[BOARDMAX])'
+
+ This function will detect some blunders. If the move reduces
+ the number of liberties of an adjacent friendly string, there
+ is a danger that the move could backfire, so the function
+ checks that no friendly worm which was formerly not
+ attackable becomes attackable, and it checks that no opposing
+ worm which was not defendable becomes defendable. It returns
+ the estimated size of the blunder, or 0.0 if nothing bad has
+ happened. The array `safe_stones[]' contains the stones that
+ are supposedly safe after `move'. It may be `NULL'. For use
+ when called from `fill_liberty()', this function may
+ optionally return a point of defense, which, if taken, will
+ presumably make the move at `move' safe on a subsequent turn.
+
+ * `int double_atari(int move, int color, float *value, char
+ safe_stones[BOARDMAX])'
+
+ Returns true if a move by (color) fits the following shape:
+ X* (O=color)
+ OX
+ capturing one of the two `X' strings. The name is a slight
+ misnomer since this includes attacks which are not
+ necessarily double ataris, though the common double atari is
+ the most important special case. If `safe_stones != NULL',
+ then only attacks on stones marked as safe are tried. The
+ value of the double atari attack is returned in value (unless
+ value is `NULL'), and the attacked stones are marked unsafe.
+
+ * `void unconditional_life(int unconditional_territory[BOARDMAX],
+ int color)'
+
+ Find those worms of the given color that can never be
+ captured, even if the opponent is allowed an arbitrary number
+ of consecutive moves. The coordinates of the origins of these
+ worms are written to the worm arrays and the number of
+ non-capturable worms is returned. The algorithm is to cycle
+ through the worms until none remains or no more can be
+ captured. A worm is removed when it is found to be
+ capturable, by letting the opponent try to play on all its
+ liberties. If the attack fails, the moves are undone. When no
+ more worm can be removed in this way, the remaining ones are
+ unconditionally alive. After this, unconditionally dead
+ opponent worms and unconditional territory are identified. To
+ find these, we continue from the position obtained at the end
+ of the previous operation (only unconditionally alive strings
+ remain for color) with the following steps:
+
+ 1. Play opponent stones on all liberties of the
+ unconditionally alive strings except where illegal.
+ (That the move order may determine exactly which
+ liberties can be played legally is not important. Just
+ pick an arbitrary order).
+
+ 2. Recursively extend opponent strings in atari, except
+ where this would be suicide.
+
+ 3. Play an opponent stone anywhere it can get two empty
+ neighbors. (I.e. split big eyes into small ones).
+
+ 4. an opponent stone anywhere it can get one empty
+ neighbor. (I.e. reduce two space eyes to one space eyes.)
+ Remaining opponent strings in atari and remaining
+ liberties of the unconditionally alive strings
+ constitute the unconditional territory. Opponent
+ strings from the initial position placed on
+ unconditional territory are unconditionally dead. On
+ return, `unconditional_territory[][]' is 1 where color
+ has unconditionally alive stones, 2 where it has
+ unconditional territory, and 0 otherwise.
+
+ * `void who_wins(int color, FILE *outfile)'
+
+ Score the game and determine the winner
+
+ * `void find_superstring(int str, int *num_stones, int *stones)'
+
+ Find the stones of an extended string, where the extensions
+ are through the following kinds of connections:
+ 1. Solid connections (just like ordinary string).
+ OO
+
+ 2. Diagonal connection or one space jump through an
+ intersection where an opponent move would be suicide or
+ self-atari.
+ ...
+ O.O
+ XOX
+ X.X
+
+ 3. Bamboo joint.
+ OO
+ ..
+ OO
+
+ 4. Diagonal connection where both adjacent intersections
+ are empty.
+ .O
+ O.
+
+ 5. Connection through adjacent or diagonal tactically
+ captured stones. Connections of this type are omitted
+ when the superstring code is called from reading.c, but
+ included when the superstring code is called from owl.c
+
+ * `void find_superstring_liberties(int str, int *num_libs, int
+ *libs, int liberty_cap)'
+
+ This function computes the superstring at `str' as described
+ above, but omitting connections of type 5. Then it constructs
+ a list of liberties of the superstring which are not already
+ liberties of `str'. If `liberty_cap' is nonzero, only
+ liberties of substrings of the superstring which have fewer
+ than `liberty_cap' liberties are generated.
+
+ * `void find_proper_superstring_liberties(int str, int *num_libs,
+ int *libs, int liberty_cap)'
+
+ This function is the same as find_superstring_liberties, but
+ it omits those liberties of the string `str', presumably
+ since those have already been treated elsewhere. If
+ `liberty_cap' is nonzero, only liberties of substrings of the
+ superstring which have at most `liberty_cap' liberties are
+ generated.
+
+ * `void find_superstring_stones_and_liberties(int str, int
+ *num_stones, int *stones, int *num_libs, int *libs, int
+ liberty_cap)'
+
+ This function computes the superstring at `str' as described
+ above, but omitting connections of type 5. Then it constructs
+ a list of liberties of the superstring which are not already
+ liberties of `str'. If liberty_cap is nonzero, only liberties
+ of substrings of the superstring which have fewer than
+ liberty_cap liberties are generated.
+
+ * `void superstring_chainlinks(int str, int *num_adj, int
+ adjs[MAXCHAIN], int liberty_cap)'
+
+ analogous to chainlinks, this function finds boundary chains
+ of the superstring at `str', including those which are
+ boundary chains of `str' itself. If `liberty_cap != 0', only
+ those boundary chains with `<= liberty_cap' liberties are
+ reported.
+
+ * `void proper_superstring_chainlinks(int str, int *num_adj, int
+ adjs[MAXCHAIN], int liberty_cap)'
+
+ analogous to chainlinks, this function finds boundary chains
+ of the superstring at `str', omitting those which are
+ boundary chains of `str' itself. If `liberty_cap != 0', only
+ those boundary chains with `<= liberty_cap' liberties are
+ reported.
+
+ * `void start_timer(int n)'
+
+ Start a timer. GNU Go has four internal timers available for
+ assessing the time spent on various tasks.
+
+ * `double time_report(int n, const char *occupation, int move,
+ double mintime)'
+
+ Report time spent and restart the timer. Make no report if
+ elapsed time is less than mintime.
+
+
+File: gnugo.info, Node: Print Utilities, Next: Board Utilities, Prev: General Utilities, Up: Utility Functions
+
+18.2 Print Utilities
+====================
+
+Functions in `engine/printutils.c' do formatted printing similar to
+`printf' and its allies. The following formats are recognized:
+
+ * `%c', `%d', `%f', `%s', `%x'
+
+ These have their usual meaning in formatted output, printing
+ a character, integer, float, string or hexadecimal,
+ respectively.
+
+ * `%o'
+
+ `Outdent.' Normally output is indented by `2*stackp' spaces,
+ so that the depth can be seen at a glance in traces. At the
+ beginning of a format, this `%o' inhibits the indentation.
+
+ * `%H'
+
+ Print a hashvalue.
+
+ * `%C'
+
+ Print a color as a string.
+
+ * `%m', `%2m' (synonyms)
+
+ Takes 2 integers and writes a move, using the two dimensional
+ board representation (*note The Board Array::)
+
+ * `%1m'
+
+ Takes 1 integers and writes a move, using the one dimensional
+ board representation (*note The Board Array::)
+
+ We list the non statically declared functions in `printutils.c'.
+
+ * `void gfprintf(FILE *outfile, const char *fmt, ...)'
+
+ Formatted output to `outfile'.
+
+ * `int gprintf(const char *fmt, ...)'
+
+ Formatted output to stderr. Always returns 1 to allow use in
+ short-circuit logical expressions.
+
+ * `int mprintf(const char *fmt, ...)'
+
+ Formatted output to stdout.
+
+ * `DEBUG(level, fmt, args...)'
+
+ If `level & debug', do formatted output to stderr. Otherwise,
+ ignore.
+
+ * `void abortgo(const char *file, int line, const char *msg, int
+ pos)'
+
+ Print debugging output in an error situation, then exit.
+
+ * `const char * color_to_string(int color)'
+
+ Convert a color value to a string
+
+ * `const char * location_to_string(int pos)'
+
+ Convert a location to a string
+
+ * `void location_to_buffer(int pos, char *buf)'
+
+ Convert a location to a string, writing to a buffer.
+
+ * `int string_to_location(int boardsize, char *str, int *m, int *n)'
+
+ Get the `(m, n)' coordinates in the standard GNU Go
+ coordinate system from the string `str'. This means that `m'
+ is the nth row from the top and `n' is the column. Both
+ coordinates are between 0 and `boardsize-1', inclusive.
+ Return 1 if ok, otherwise return 0;
+
+ * `int is_hoshi_point(int m, int n)' True if the coordinate is a
+ hoshi point.
+
+ * `void draw_letter_coordinates(FILE *outfile)' Print a line with
+ coordinate letters above the board.
+
+ * `void simple_showboard(FILE *outfile)'
+
+ Bare bones version of `showboard(0)'. No fancy options, no
+ hint of color, and you can choose where to write it.
+
+ The following functions are in `showbord.c'. Not all public
+functions in that file are listed here.
+
+ * `void showboard(int xo)'
+
+ Show go board.
+ xo=0: black and white XO board for ascii game
+ xo=1: colored dragon display
+ xo=2: colored eye display
+ xo=3: colored owl display
+ xo=4: colored matcher status display
+
+ * `const char * status_to_string(int status)'
+
+ Convert a status value to a string.
+
+ * `const char * safety_to_string(int status)'
+
+ Convert a safety value to a string.
+
+ * `const char * result_to_string(int result)'
+
+ Convert a read result to a string
+
+
+File: gnugo.info, Node: Board Utilities, Next: Influence Utilities, Prev: Print Utilities, Up: Utility Functions
+
+18.3 Board Utilities
+====================
+
+The functions documented in this section are from `board.c'. Other
+functions in `board.c' are described in *Note Some Board Functions::.
+
+ * `void store_board(struct board_state *state)'
+
+ Save board state.
+
+ * `void restore_board(struct board_state *state)'
+
+ Restore a saved board state.
+
+ * `void clear_board(void)'
+
+ Clear the internal board.
+
+ * `void dump_stack(void)'
+
+ for use under GDB prints the move stack.
+
+ * `void add_stone(int pos, int color)'
+
+ Place a stone on the board and update the board_hash. This
+ operation destroys all move history.
+
+ * `void remove_stone(int pos)'
+
+ Remove a stone from the board and update the board_hash. This
+ operation destroys the move history.
+
+ * `int is_pass(int pos)'
+
+ Test if the move is a pass or not. Return 1 if it is.
+
+ * `int is_legal(int pos, int color)'
+
+ Determines whether the move `color' at `pos' is legal.
+
+ * `int is_suicide(int pos, int color)'
+
+ Determines whether the move `color' at `pos' would be a
+ suicide. This is the case if
+ 1. There is no neighboring empty intersection.
+
+ 2. There is no neighboring opponent string with exactly one
+ liberty.
+
+ 3. There is no neighboring friendly string with more than
+ one liberty.
+
+ * `int is_illegal_ko_capture(int pos, int color)'
+
+ Determines whether the move `color' at `pos' would be an
+ illegal ko capture.
+
+ * `int is_edge_vertex(int pos)'
+
+ Determine whether vertex is on the edge.
+
+ * `int edge_distance(int pos)'
+
+ Distance to the edge.
+
+ * `int is_corner_vertex(int pos)'
+
+ Determine whether vertex is a corner.
+
+ * `int get_komaster()'
+
+ * `int get_kom_pos()'
+
+ Public functions to access the variable `komaster' and
+ `kom_pos', which are static in `board.c'.
+
+ Next we come to `countlib()' and its allies, which address the
+problem of determining how many liberties a string has. Although
+`countlib()' addresses this basic question, other functions can often
+get the needed information more quickly, so there are a number of
+different functions in this family.
+
+ * `int countlib(int str)'
+
+ Count the number of liberties of the string at `pos'. There
+ must be a stone at this location.
+
+ * `int findlib(int str, int maxlib, int *libs)'
+
+ Find the liberties of the string at `str'. This location must
+ not be empty. The locations of up to maxlib liberties are
+ written into `libs[]'. The full number of liberties is
+ returned. If you want the locations of all liberties,
+ whatever their number, you should pass `MAXLIBS' as the value
+ for `maxlib' and allocate space for `libs[]' accordingly.
+
+ * `int fastlib(int pos, int color, int ignore_captures)'
+
+ Count the liberties a stone of the given color would get if
+ played at `pos'. The intent of this function is to be as fast
+ as possible, not necessarily complete. But if it returns a
+ positive value (meaning it has succeeded), the value is
+ guaranteed to be correct. Captures are ignored based if the
+ `ignore_captures' field is nonzero. The location `pos' must
+ be empty. The function fails if there are more than two
+ neighbor strings of the same color. In this case, the return
+ value is -1. Captures are handled in a very limited way, so
+ if ignore_capture is 0, and a capture is required, it will
+ often return -1.
+
+ * `int approxlib(int pos, int color, int maxlib, int *libs)'
+
+ Find the liberties a stone of the given color would get if
+ played at `pos', ignoring possible captures of opponent
+ stones. The location `pos' must be empty. If `libs != NULL',
+ the locations of up to `maxlib' liberties are written into
+ `libs[]'. The counting of liberties may or may not be halted
+ when `maxlib' is reached. The number of liberties found is
+ returned, which may be less than the total number of
+ liberties if `maxlib' is small. If you want the number or the
+ locations of all liberties, however many they are, you should
+ pass `MAXLIBS' as the value for maxlib and allocate space for
+ `libs[]' accordingly.
+
+ * `int accuratelib(int pos, int color, int maxlib, int *libs)'
+
+ Find the liberties a stone of the given color would get if
+ played at `pos'. This function takes into consideration all
+ captures. Its return value is exact in that sense it counts
+ all the liberties, unless `maxlib' allows it to stop earlier.
+ The location `pos' must be empty. If `libs != NULL', the
+ locations of up to `maxlib' liberties are written into
+ `libs[]'. The counting of liberties may or may not be halted
+ when `maxlib' is reached. The number of found liberties is
+ returned. This function guarantees that liberties which are
+ not results of captures come first in `libs[]' array. To find
+ whether all the liberties starting from a given one are
+ results of captures, one may use `if (board[libs[k]] !=
+ EMPTY)' construction. If you want the number or the
+ locations of all liberties, however many they are, you should
+ pass `MAXLIBS' as the value for `maxlib' and allocate space
+ for `libs[]' accordingly.
+
+ Next we have some general utility functions.
+
+ * `int count_common_libs(int str1, int str2)'
+
+ Find the number of common liberties of the two strings.
+
+ * `int find_common_libs(int str1, int str2, int maxlib, int *libs)'
+
+ Find the common liberties of the two strings. The locations
+ of up to `maxlib' common liberties are written into `libs[]'.
+ The full number of common liberties is returned. If you want
+ the locations of all common liberties, whatever their number,
+ you should pass `MAXLIBS' as the value for `maxlib' and
+ allocate space for `libs[]' accordingly.
+
+ * `int have_common_lib(int str1, int str2, int *lib)'
+
+ Determine whether two strings have at least one common
+ liberty. If they do and `lib != NULL', one common liberty is
+ returned in `*lib'.
+
+ * `int countstones(int str)'
+
+ Report the number of stones in a string.
+
+ * `int findstones(int str, int maxstones, int *stones)'
+
+ Find the stones of the string at `str'. The location must not
+ be empty. The locations of up to maxstones stones are written
+ into `stones[]'. The full number of stones is returned.
+
+ * `int chainlinks(int str, int adj[MAXCHAIN])'
+
+ This very useful function returns (in the `adj' array) the
+ chains surrounding the string at `str'. The number of chains
+ is returned.
+
+ * `int chainlinks2(int str, int adj[MAXCHAIN], int lib)'
+
+ Returns (in `adj' array) those chains surrounding the string
+ at `str', which has exactly `lib' liberties. The number of
+ such chains is returned.
+
+ * `int chainlinks3(int str, int adj[MAXCHAIN], int lib)'
+
+ 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 extended_chainlinks(int str, int adj[MAXCHAIN], int
+ both_colors)'
+
+ Returns (in the `adj' array) the opponent strings being
+ directly adjacent to `str' or having a common liberty with
+ `str'. The number of such strings is returned. If the
+ both_colors parameter is true, also own strings sharing a
+ liberty are returned.
+
+ * `int find_origin(int str)'
+
+ Find the origin of a string, i.e. the point with the smallest
+ 1D board coordinate. The idea is to have a canonical
+ reference point for a string.
+
+ * `int is_self_atari(int pos, int color)'
+
+ Determine whether a move by color at `pos' would be a self
+ atari, i.e. whether it would get more than one liberty. This
+ function returns true also for the case of a suicide move.
+
+ * `int liberty_of_string(int pos, int str)'
+
+ Returns true if `pos' is a liberty of the string at `str'.
+
+ * `int second_order_liberty_of_string(int pos, int str)'
+
+ Returns true if `pos' is a second order liberty of the string
+ at str.
+
+ * `int neighbor_of_string(int pos, int str)'
+
+ Returns true if `pos' is adjacent to the string at `str'.
+
+ * `int has_neighbor(int pos, int color)'
+
+ Returns true if `pos' has a neighbor of `color'.
+
+ * `int same_string(int str1, int str2)'
+
+ Returns true if `str1' and `str2' belong to the same string.
+
+ * `int adjacent_strings(int str1, int str2)'
+
+ Returns true if the strings at `str1' and `str2' are adjacent.
+
+ * `int is_ko(int pos, int color, int *ko_pos)'
+
+ Return true if the move `pos' by `color' is a ko capture
+ (whether capture is legal on this move or not). If so, and if
+ `ko_pos' is not a `NULL' pointer, then `*ko_pos' returns the
+ location of the captured ko stone. If the move is not a ko
+ capture, `*ko_pos' is set to 0. A move is a ko capture if
+ and only if
+ 1. All neighbors are opponent stones.
+
+ 2. The number of captured stones is exactly one.
+
+ * `int is_ko_point(int pos)'
+
+ Return true if `pos' is either a stone, which if captured
+ would give ko, or if `pos' is an empty intersection adjacent
+ to a ko stone.
+
+ * `int does_capture_something(int pos, int color)'
+
+ Returns 1 if at least one string is captured when color plays
+ at `pos'.
+
+ * `void mark_string(int str, char mx[BOARDMAX], char mark)'
+
+ For each stone in the string at pos, set `mx' to value mark.
+ If some of the stones in the string are marked prior to
+ calling this function, only the connected unmarked stones
+ starting from pos are guaranteed to become marked. The rest
+ of the string may or may not become marked. (In the current
+ implementation, it will.)
+
+ * `int move_in_stack(int pos, int cutoff)'
+
+ Returns true if at least one move has been played at pos at
+ deeper than level `cutoff' in the reading tree.
+
+ * `int stones_on_board(int color)'
+
+ Return the number of stones of the indicated color(s) on the
+ board. This only counts stones in the permanent position,
+ not stones placed by `trymove()' or `tryko()'. Use
+ `stones_on_board(BLACK | WHITE)' to get the total number of
+ stones on the board.
+
+
+File: gnugo.info, Node: Influence Utilities, Prev: Board Utilities, Up: Utility Functions
+
+18.4 Utilities from `engine/influence.c'
+========================================
+
+We will only list here a portion of the public functions in
+`influence.c'. The influence code is invoked through the function
+`compute_influence' (*note Influence Usage::). It is invoked as follows.
+
+ * `void compute_influence(int color, const char
+ safe_stones[BOARDMAX], const float strength[BOARDMAX], struct
+ influence_data *q, int move, const char *trace_message)'
+
+ Compute the influence values for both colors. The caller must
+ - set up the `board[]' state
+
+ - mark safe stones with `INFLUENCE_SAFE_STONE', dead
+ stones with 0
+
+ - mark stones newly saved by a move with
+ `INFLUENCE_SAVED_STONE' (this is relevant if the
+ influence_data *q is reused to compute a followup value
+ for this move).
+ Results will be stored in q. `move' has no effects except
+ toggling debugging. Set it to -1 for no debug output at all
+ (otherwise it will be controlled by the `-m' command line
+ option). It is assumed that `color' is in turn to move. (This
+ affects the barrier patterns (class A, D) and intrusions
+ (class B)). Color
+
+ Other functions in `influence.c' are of the nature of utilities
+which may be useful throughout the engine. We list the most useful ones
+here.
+
+ * `void influence_mark_non_territory(int pos, int color)'
+
+ Called from actions for `t' patterns in `barriers.db'. Marks
+ `pos' as not being territory for `color'.
+
+ * `int whose_territory(const struct influence_data *q, int pos)'
+
+ Return the color of the territory at `pos'. If it's territory
+ for neither color, `EMPTY' is returned.
+
+ * `int whose_moyo(const struct influence_data *q, int pos)'
+
+ Return the color who has a moyo at `pos'. If neither color
+ has a moyo there, `EMPTY' is returned. The definition of moyo
+ in terms of the influences is totally ad hoc.
+
+ * `int whose_area(const struct influence_data *q, int pos)'
+
+ Return the color who has dominating influence ("area") at
+ `pos'. If neither color dominates the influence there, EMPTY
+ is returned. The definition of area in terms of the
+ influences is totally ad hoc.
+
+
+File: gnugo.info, Node: GTP, Next: Regression, Prev: API, Up: Top
+
+19 The Go Text Protocol
+***********************
+
+* Menu:
+
+* The Go Text Protocol:: The Go Text Protocol
+* Running in GTP mode:: Running GNU Go in GTP mode
+* GTP applications:: GTP applications
+* The Metamachine:: The Metamachine
+* Adding new GTP commands:: Adding new GTP commands
+* GTP command reference:: Details on every GTP command
+
+
+File: gnugo.info, Node: The Go Text Protocol, Next: Running in GTP mode, Up: GTP
+
+19.1 The Go Text Protocol
+=========================
+
+GNU Go 3.0 introduced a new interface, the Go Text Protocol, abbreviated
+GTP. The intention was to make an interface that is better suited for
+machine-machine communication than the ascii interface and simpler, more
+powerful, and more flexible than the Go Modem Protocol.
+
+ There are two versions of the protocol. Version 1 was used with GNU
+Go 3.0 and 3.2. GNU Go 3.4 and later versions use protocol version 2.
+The specification of GTP version 2 is available at
+`http://www.lysator.liu.se/~gunnar/gtp/'. GNU Go 3.4 is the reference
+implementation for GTP version 2, but all but the most common commands
+are to be regarded as private extensions of the protocol.
+
+ The GTP has a variety of applications. For GNU Go the first use was
+in regression testing (*note Regression::), followed by communication
+with the NNGS go server and for automated test games against itself and
+other programs. Now there are also many graphical user interfaces
+available supporting GTP, as well as bridges to other Go servers than
+NNGS.
+
+
+File: gnugo.info, Node: Running in GTP mode, Next: GTP applications, Prev: The Go Text Protocol, Up: GTP
+
+19.2 Running GNU Go in GTP mode
+===============================
+
+To start GNU Go in GTP mode, simply invoke it with the option `--mode
+gtp'. You will not get a prompt or any other output to start with but
+GNU Go is silently waiting for GTP commands.
+
+ A sample GTP session may look as follows:
+
+ virihaure 462% ./gnugo --mode gtp
+ 1 boardsize 7
+ =1
+
+ 2 clear_board
+ =2
+
+ 3 play black D5
+ =3
+
+ 4 genmove white
+ =4 C3
+
+ 5 play black C3
+ ?5 illegal move
+
+ 6 play black E3
+ =6
+
+ 7 showboard
+ =7
+ A B C D E F G
+ 7 . . . . . . . 7
+ 6 . . . . . . . 6
+ 5 . . + X + . . 5
+ 4 . . . + . . . 4
+ 3 . . O . X . . 3
+ 2 . . . . . . . 2 WHITE (O) has captured 0 stones
+ 1 . . . . . . . 1 BLACK (X) has captured 0 stones
+ A B C D E F G
+
+ 8 quit
+ =8
+
+ Commands are given on a single line, starting by an optional identity
+number, followed by the command name and its arguments.
+
+ If the command is successful, the response starts by an equals sign
+(`='), followed by the identity number of the command (if any) and then
+the result. In this example all results were empty strings except for
+command 4 where the answer was the white move at C3, and command 7
+where the result was a diagram of the current board position. The
+response ends by two consecutive newlines.
+
+ Failing commands are signified by a question mark (`?') instead of
+an equals sign, as in the response to command 5.
+
+ The detailed specification of the protocol can be found at
+`http://www.lysator.liu.se/~gunnar/gtp/'. The available commands in GNU
+Go may always be listed using the command `list_commands'. They are
+also documented in *Note GTP command reference::.
+
+
+File: gnugo.info, Node: GTP applications, Next: The Metamachine, Prev: Running in GTP mode, Up: GTP
+
+19.3 GTP applications
+=====================
+
+GTP is an asymmetric protocol involving two parties which we call
+controller and engine. The controller sends all commands and the engine
+only responds to these commands. GNU Go implements the engine end of the
+protocol.
+
+ With the source code of GNU Go is also distributed a number of
+applications implementing the controller end. Among the most
+interesting of these are:
+
+ * `regression/regress.awk'
+
+ Script to run regressions. The script sends GTP commands to
+ set up and evaluate positions to the engine and then analyzes
+ the responses from the engine. More information about GTP
+ based regression testing can be found in the regression
+ chapter (*note Regression::).
+
+ * `regression/regress.pl'
+
+ Perl script to run regressions, giving output which together
+ with the CGI script `regression/regress.plx' generates HTML
+ views of the regressions.
+
+ * `regression/regress.pike'
+
+ Pike script to run regressions. More feature-rich and
+ powerful than `regress.awk'.
+
+ * `regression/view.pike'
+
+ Pike script to examine a single regression testcase through a
+ graphical board. This gives an easy way to inspect many of
+ the GNU Go internals.
+
+ * `interface/gtp_examples/twogtp'
+
+ Perl script to play two engines against each other. The script
+ essentially sets up both engines with desired boardsize,
+ handicap, and komi, then relays moves back and forth between
+ the engines.
+
+ * `interface/gtp_examples/twogtp-a'
+
+ An alternative Perl implementation of twogtp.
+
+ * `interface/gtp_examples/twogtp.py'
+
+ Implementation of twogtp in Python. Has more features than
+ the Perl variants.
+
+ * `interface/gtp_examples/twogtp.pike'
+
+ Implementation of twogtp in Pike. Has even more features than
+ the Python variant.
+
+ * `interface/gtp_examples/2ptkgo.pl'
+
+ Variation of twogtp which includes a graphical board.
+
+ More GTP applications, including bridges to go servers and graphical
+user interfaces, are listed at `http://www.lysator.liu.se/~gunnar/gtp/'.
+
+
+File: gnugo.info, Node: The Metamachine, Next: Adding new GTP commands, Prev: GTP applications, Up: GTP
+
+19.4 The Metamachine
+====================
+
+An interesting application of the GTP is the concept of using GNU Go as
+an "Oracle" that can be consulted by another process. This could be
+another computer program that asks GNU Go to generate future board
+positions, then evaluate them.
+
+ David Doshay at the University of California at Santa Cruz has done
+interesting experiments with a parallel engine, known as SlugGo, that
+is based on GNU Go. These are described in
+`http://lists.gnu.org/archive/html/gnugo-devel/2004-08/msg00060.html'.
+
+ The "Metamachine" experiment is a more modest approach using the GTP
+to communicate with a GNU Go process that is used as an oracle. The
+following scheme is used.
+
+ * The GNU Go "oracle" is asked to generate its top moves using the
+ GTP `top_moves' commands.
+
+ * Both moves are tried and `estimate_score' is called from the
+ resulting board position.
+
+ * The higher scoring position is selected as the engine's move.
+
+ This scheme does not produce a stronger engine, but it is
+suggestive, and the SlugGo experiment seems to show that a more
+elaborate scheme along the same lines could produce a stronger engine.
+
+ Two implementations are distributed with GNU Go. Both make use of
+`fork' and `pipe' system calls, so they require a Unix-like
+environment. The Metamachine has been tested under GNU/Linux.
+
+ *Important:* If the Metamachine terminates normally, the GNU Go
+process will be killed. However there is a danger that something will
+go wrong. When you are finished running the Metamachine, it is a good
+idea to run `ps -A|grep gnugo' or `ps -aux|grep gnugo' to make sure
+there are no unterminated processes. (If there are, just kill them.)
+
+19.4.1 The Standalone Metamachine
+---------------------------------
+
+In `interface/gtp_examples/metamachine.c' is a standalone
+implementation of the Metamachine. Compile it with `cc -o metamachine
+metamachine.c' and run it. It forks a `gnugo' process with which it
+communicates through the GTP, to use as an oracle.
+
+ The following scheme is followed:
+
+ stdin pipe a
+ GTP client ----> Metamachine -----> GNU Go
+ <---- <-----
+ stdout pipe b
+
+ Most commands issued by the client are passed along verbatim to GNU
+Go by the Metamachine. The exception is gg_genmove, which is
+intercepted then processed differently, as described above. The client
+is unaware of this, and only knows that it issued a gg_genmove command
+and received a reply. Thus to the the Metamachine appears as an
+ordinary GTP engine.
+
+ Usage: no arguments gives normal GTP behavior. `metamachine
+--debug' sends diagnostics to stderr.
+
+19.4.2 GNU Go as a Metamachine
+------------------------------
+
+Alternatively, you may compile GNU Go with the configure option
+`--enable-metamachine'. This causes the file `oracle.c' to be compiled,
+which contains the Metamachine code. This has no effect on the engine
+unless you run GNU Go with the runtime option `--metamachine'. Thus you
+must use both the configure and the runtime option to get the
+Metamachine.
+
+ This method is better than the standalone program since you have
+access to GNU Go's facilities. For example, you can run the Metamachine
+with CGoban or in Ascii mode this way.
+
+ You can get traces by adding the command line `-d0x1000000'. In
+debugging the Metamachine, a danger is that any small oversight in
+designing the program can cause the forked process and the controller
+to hang, each one waiting for a response from the other. If this seems
+to happen it is useful to know that you can attach `gdb' to a running
+process and find out what it is doing.
+
+
+File: gnugo.info, Node: Adding new GTP commands, Next: GTP command reference, Prev: The Metamachine, Up: GTP
+
+19.5 Adding new GTP commands
+============================
+
+The implementation of GTP in GNU Go is distributed over three files,
+`interface/gtp.h', `interface/gtp.c', and `interface/play_gtp.c'. The
+first two implement a small library of helper functions which can be
+used also by other programs. In the interest of promoting the GTP they
+are licensed with minimal restrictions (*note GTP License::). The
+actual GTP commands are implemented in `play_gtp.c', which has
+knowledge about the engine internals.
+
+ To see how a simple but fairly typical command is implemented we
+look at `gtp_countlib()' (a GNU Go private extension command):
+
+ static int
+ gtp_countlib(char *s)
+ {
+ int i, j;
+ if (!gtp_decode_coord(s, &i, &j))
+ return gtp_failure("invalid coordinate");
+
+ if (BOARD(i, j) == EMPTY)
+ return gtp_failure("vertex must not be empty");
+
+ return gtp_success("%d", countlib(POS(i, j)));
+ }
+
+ The arguments to the command are passed in the string `s'. In this
+case we expect a vertex as argument and thus try to read it with
+`gtp_decode_coord()' from `gtp.c'.
+
+ A correctly formatted response should start with either `=' or `?',
+followed by the identity number (if one was sent), the actual result,
+and finally two consecutive newlines. It is important to get this
+formatting correct since the controller in the other end relies on it.
+Naturally the result itself cannot contain two consecutive newlines but
+it may be split over several lines by single newlines.
+
+ The easiest way to generate a correctly formatted response is with
+one of the functions `gtp_failure()' and `gtp_success()', assuming that
+their formatted output does not end with a newline.
+
+ Sometimes the output is too complex for use with gtp_success, e.g. if
+we want to print vertices, which gtp_success() does not support. Then
+we have to fall back to the construction in e.g. `gtp_genmove()':
+
+ static int
+ gtp_genmove(char *s)
+ {
+ [...]
+ gtp_start_response(GTP_SUCCESS);
+ gtp_print_vertex(i, j);
+ return gtp_finish_response();
+ }
+
+ Here `gtp_start_response()' writes the equal sign and the identity
+number while `gtp_finish_response()' adds the final two newlines. The
+next example is from `gtp_list_commands()':
+
+ static int
+ gtp_list_commands(char *s)
+ {
+ int k;
+ UNUSED(s);
+
+ gtp_start_response(GTP_SUCCESS);
+
+ for (k = 0; commands[k].name != NULL; k++)
+ gtp_printf("%s\n", commands[k].name);
+
+ gtp_printf("\n");
+ return GTP_OK;
+ }
+
+ As we have said, the response should be finished with two newlines.
+Here we have to finish up the response ourselves since we already have
+one newline in place from the last command printed in the loop.
+
+ In order to add a new GTP command to GNU Go, the following pieces of
+code need to be inserted in `play_gtp.c':
+ 1. A function declaration using the `DECLARE' macro in the list
+ starting at line 68.
+
+ 2. An entry in the `commands[]' array starting at line 200.
+
+ 3. An implementation of the function handling the command.
+
+ Useful helper functions in `gtp.c'/`gtp.h' are:
+ * `gtp_printf()' for basic formatted printing.
+
+ * `gtp_mprintf()' for printing with special format codes for
+ vertices and colors.
+
+ * `gtp_success()' and `gtp_failure()' for simple responses.
+
+ * `gtp_start_response()' and `gtp_end_response()' for more complex
+ responses.
+
+ * `gtp_print_vertex()' and `gtp_print_vertices()' for printing one
+ or multiple vertices.
+
+ * `gtp_decode_color()' to read in a color from the command arguments.
+
+ * `gtp_decode_coord()' to read in a vertex from the command
+ arguments.
+
+ * `gtp_decode_move()' to read in a move, i.e. color plus vertex,
+ from the command arguments.
+
+
+File: gnugo.info, Node: GTP command reference, Prev: Adding new GTP commands, Up: GTP
+
+19.6 GTP command reference
+==========================
+
+This section lists the GTP commands implemented in GNU Go along with
+some information about each command. Each entry in the list has the
+following fields:
+
+ * Function: What this command does.
+
+ * Arguments: What other information, if any, this command requires.
+ Typical values include "none" or "vertex" or "integer" (there are
+ others).
+
+ * Fails: Circumstances which cause this command to fail.
+
+ * Returns: What is displayed after the "=" and before the two
+ newlines. Typical values include "nothing" or "a move coordinate"
+ or some status string (there are others).
+
+ * Status: How this command relates to the standard GTP version 2
+ commands. If nothing else is specified it is a GNU Go private
+ extension.
+
+ Without further ado, here is the big list (in no particular order).
+
+ Note: if new commands are added by editing `interface/play_gtp.c'
+this list could become incomplete. You may rebuild this list in
+`doc/gtp-commands.texi' with the command `make gtp-commands' in the
+`doc/' directory. This may require GNU sed.
+
+ * quit: Quit
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * protocol_version: Report protocol version.
+ Arguments: none
+ Fails: never
+ Returns: protocol version number
+
+ Status: GTP version 2 standard command.
+
+
+ * name: Report the name of the program.
+ Arguments: none
+ Fails: never
+ Returns: program name
+
+ Status: GTP version 2 standard command.
+
+
+ * version: Report the version number of the program.
+ Arguments: none
+ Fails: never
+ Returns: version number
+
+ Status: GTP version 2 standard command.
+
+
+ * boardsize: Set the board size to NxN and clear the board.
+ Arguments: integer
+ Fails: board size outside engine's limits
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * query_boardsize: Find the current boardsize
+ Arguments: none
+ Fails: never
+ Returns: board_size
+
+
+ * clear_board: Clear the board.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * orientation: Set the orienation to N and clear the board
+ Arguments: integer
+ Fails: illegal orientation
+ Returns: nothing
+
+
+ * query_orientation: Find the current orientation
+ Arguments: none
+ Fails: never
+ Returns: orientation
+
+
+ * komi: Set the komi.
+ Arguments: float
+ Fails: incorrect argument
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * get_komi: Get the komi
+ Arguments: none
+ Fails: never
+ Returns: Komi
+
+
+ * black: Play a black stone at the given vertex.
+ Arguments: vertex
+ Fails: invalid vertex, illegal move
+ Returns: nothing
+
+ Status: Obsolete GTP version 1 command.
+
+
+ * playwhite: Play a white stone at the given vertex.
+ Arguments: vertex
+ Fails: invalid vertex, illegal move
+ Returns: nothing
+
+ Status: Obsolete GTP version 1 command.
+
+
+ * play: Play a stone of the given color at the given vertex.
+ Arguments: color, vertex
+ Fails: invalid vertex, illegal move
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * fixed_handicap: Set up fixed placement handicap stones.
+ Arguments: number of handicap stones
+ Fails: invalid number of stones for the current boardsize
+ Returns: list of vertices with handicap stones
+
+ Status: GTP version 2 standard command.
+
+
+ * place_free_handicap: Choose free placement handicap stones and put
+ them on the board.
+ Arguments: number of handicap stones
+ Fails: invalid number of stones
+ Returns: list of vertices with handicap stones
+
+ Status: GTP version 2 standard command.
+
+
+ * set_free_handicap: Put free placement handicap stones on the board.
+ Arguments: list of vertices with handicap stones
+ Fails: board not empty, bad list of vertices
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * get_handicap: Get the handicap
+ Arguments: none
+ Fails: never
+ Returns: handicap
+
+
+ * loadsgf: Load an sgf file, possibly up to a move number or the
+ first occurence of a move.
+ Arguments: filename + move number, vertex, or nothing
+ Fails: missing filename or failure to open or parse file
+ Returns: color to play
+
+ Status: GTP version 2 standard command.
+
+
+ * color: Return the color at a vertex.
+ Arguments: vertex
+ Fails: invalid vertex
+ Returns: "black", "white", or "empty"
+
+
+ * list_stones: List vertices with either black or white stones.
+ Arguments: color
+ Fails: invalid color
+ Returns: list of vertices
+
+
+ * countlib: Count number of liberties for the string at a vertex.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: Number of liberties.
+
+
+ * findlib: Return the positions of the liberties for the string at a
+ vertex.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: Sorted space separated list of vertices.
+
+
+ * accuratelib: Determine which liberties a stone of given color will
+ get if played at given vertex.
+ Arguments: move (color + vertex)
+ Fails: invalid color, invalid vertex, occupied vertex
+ Returns: Sorted space separated list of liberties
+
+
+ * accurate_approxlib: Determine which liberties a stone of given
+ color will get if played at given vertex.
+ Arguments: move (color + vertex)
+ Fails: invalid color, invalid vertex, occupied vertex
+ Returns: Sorted space separated list of liberties
+
+ Supposedly identical in behavior to the above function and
+ can be retired when this is confirmed.
+
+
+ * is_legal: Tell whether a move is legal.
+ Arguments: move
+ Fails: invalid move
+ Returns: 1 if the move is legal, 0 if it is not.
+
+
+ * all_legal: List all legal moves for either color.
+ Arguments: color
+ Fails: invalid color
+ Returns: Sorted space separated list of vertices.
+
+
+ * captures: List the number of captures taken by either color.
+ Arguments: color
+ Fails: invalid color
+ Returns: Number of captures.
+
+
+ * last_move: Return the last move.
+ Arguments: none
+ Fails: no previous move known
+ Returns: Color and vertex of last move.
+
+
+ * move_history: Print the move history in reverse order
+ Arguments: none
+ Fails: never
+ Returns: List of moves played in reverse order in format:
+ color move (one move per line)
+
+
+ * invariant_hash: Return the rotation/reflection invariant board
+ hash.
+ Arguments: none
+ Fails: never
+ Returns: Invariant hash for the board as a hexadecimal number.
+
+
+ * invariant_hash_for_moves: Return the rotation/reflection invariant
+ board hash obtained by playing all the possible moves for the
+ given color.
+ Arguments: color
+ Fails: invalid color
+ Returns: List of moves + invariant hash as a hexadecimal number,
+ one pair of move + hash per line.
+
+
+ * trymove: Play a stone of the given color at the given vertex.
+ Arguments: move (color + vertex)
+ Fails: invalid color, invalid vertex, illegal move
+ Returns: nothing
+
+
+ * tryko: Play a stone of the given color at the given vertex,
+ allowing illegal ko capture.
+ Arguments: move (color + vertex)
+ Fails: invalid color, invalid vertex, illegal move
+ Returns: nothing
+
+
+ * popgo: Undo a trymove or tryko.
+ Arguments: none
+ Fails: stack empty
+ Returns: nothing
+
+ * clear_cache: clear the caches.
+ Arguments: none.
+ Fails: never.
+ Returns: nothing.
+
+
+ * attack: Try to attack a string.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: attack code followed by attack point if attack code nonzero.
+
+
+ * attack_either: Try to attack either of two strings
+ Arguments: two vertices
+ Fails: invalid vertex, empty vertex
+ Returns: attack code against the strings. Guarantees there
+ exists a move which will attack one of the two
+ with attack_code, but does not return the move.
+
+
+ * defend: Try to defend a string.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: defense code followed by defense point if defense code nonzero.
+
+
+ * does_attack: Examine whether a specific move attacks a string
+ tactically.
+ Arguments: vertex (move), vertex (dragon)
+ Fails: invalid vertex, empty vertex
+ Returns: attack code
+
+
+ * does_defend: Examine whether a specific move defends a string
+ tactically.
+ Arguments: vertex (move), vertex (dragon)
+ Fails: invalid vertex, empty vertex
+ Returns: attack code
+
+
+ * ladder_attack: Try to attack a string strictly in a ladder.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: attack code followed by attack point if attack code nonzero.
+
+
+ * increase_depths: Increase depth values by one.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * decrease_depths: Decrease depth values by one.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * owl_attack: Try to attack a dragon.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: attack code followed by attack point if attack code nonzero.
+
+
+ * owl_defend: Try to defend a dragon.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: defense code followed by defense point if defense code nonzero.
+
+
+ * owl_threaten_attack: Try to attack a dragon in 2 moves.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: attack code followed by the two attack points if
+ attack code nonzero.
+
+
+ * owl_threaten_defense: Try to defend a dragon with 2 moves.
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: defense code followed by the 2 defense points if
+ defense code nonzero.
+
+
+ * owl_does_attack: Examine whether a specific move attacks a dragon.
+ Arguments: vertex (move), vertex (dragon)
+ Fails: invalid vertex, empty vertex
+ Returns: attack code
+
+
+ * owl_does_defend: Examine whether a specific move defends a dragon.
+ Arguments: vertex (move), vertex (dragon)
+ Fails: invalid vertex, empty vertex
+ Returns: defense code
+
+
+ * owl_connection_defends: Examine whether a connection defends
+ involved dragons.
+ Arguments: vertex (move), vertex (dragon1), vertex (dragon2)
+ Fails: invalid vertex, empty vertex
+ Returns: defense code
+
+
+ * defend_both: Try to defend both of two strings
+ Arguments: two vertices
+ Fails: invalid vertex, empty vertex
+ Returns: defend code for the strings. Guarantees there
+ exists a move which will defend both of the two
+ with defend_code, but does not return the move.
+
+
+ * owl_substantial: Determine whether capturing a string gives a
+ living dragon
+ Arguments: vertex
+ Fails: invalid vertex, empty vertex
+ Returns: 1 if dragon can live, 0 otherwise
+
+
+ * analyze_semeai: Analyze a semeai
+ Arguments: dragona, dragonb
+ Fails: invalid vertices, empty vertices
+ Returns: semeai defense result, semeai attack result, semeai move
+
+
+ * analyze_semeai_after_move: Analyze a semeai after a move have been
+ made.
+ Arguments: color, vertex, dragona, dragonb
+ Fails: invalid vertices
+ Returns: semeai defense result, semeai attack result, semeai move
+
+
+ * tactical_analyze_semeai: Analyze a semeai, not using owl
+ Arguments: dragona, dragonb
+ Fails: invalid vertices, empty vertices
+ Returns: status of dragona, dragonb assuming dragona moves first
+
+
+ * connect: Try to connect two strings.
+ Arguments: vertex, vertex
+ Fails: invalid vertex, empty vertex, vertices of different colors
+ Returns: connect result followed by connect point if successful.
+
+
+ * disconnect: Try to disconnect two strings.
+ Arguments: vertex, vertex
+ Fails: invalid vertex, empty vertex, vertices of different colors
+ Returns: disconnect result followed by disconnect point if successful.
+
+
+ * break_in: Try to break from string into area.
+ Arguments: vertex, vertices
+ Fails: invalid vertex, empty vertex.
+ Returns: result followed by break in point if successful.
+
+
+ * block_off: Try to block string from area.
+ Arguments: vertex, vertices
+ Fails: invalid vertex, empty vertex.
+ Returns: result followed by block point if successful.
+
+ * eval_eye: Evaluate an eye space
+ Arguments: vertex
+ Fails: invalid vertex
+ Returns: Minimum and maximum number of eyes. If these differ an
+ attack and a defense point are additionally returned.
+ If the vertex is not an eye space or not of unique color,
+ a single -1 is returned.
+
+ * dragon_status: Determine status of a dragon.
+ Arguments: optional vertex
+ Fails: invalid vertex, empty vertex
+ Returns: status ("alive", "critical", "dead", or "unknown"),
+ attack point, defense point. Points of attack and
+ defense are only given if the status is critical.
+ If no vertex is given, the status is listed for all
+ dragons, one per row in the format "A4: alive".
+
+ FIXME: Should be able to distinguish between life in seki
+ and independent life. Should also be able to identify ko.
+
+ * same_dragon: Determine whether two stones belong to the same
+ dragon.
+ Arguments: vertex, vertex
+ Fails: invalid vertex, empty vertex
+ Returns: 1 if the vertices belong to the same dragon, 0 otherwise
+
+ * unconditional_status: Determine the unconditional status of a
+ vertex.
+ Arguments: vertex
+ Fails: invalid vertex
+ Returns: unconditional status ("undecided", "alive", "dead",
+ "white_territory", "black_territory"). Occupied vertices can
+ be undecided, alive, or dead. Empty vertices can be
+ undecided, white territory, or black territory.
+
+ * combination_attack: Find a move by color capturing something
+ through a combination attack.
+ Arguments: color
+ Fails: invalid color
+ Returns: Recommended move, PASS if no move found
+
+ * combination_defend: If color can capture something through a
+ combination attack, list moves by the opponent of color
+ to defend against this attack.
+ Arguments: color
+ Fails: invalid color
+ Returns: Recommended moves, PASS if no combination attack found.
+
+ * aa_confirm_safety: Run atari_atari_confirm_safety().
+ Arguments: move, optional int
+ Fails: invalid move
+ Returns: success code, if failure also defending move
+
+
+ * genmove_black: Generate and play the supposedly best black move.
+ Arguments: none
+ Fails: never
+ Returns: a move coordinate or "PASS"
+
+ Status: Obsolete GTP version 1 command.
+
+
+ * genmove_white: Generate and play the supposedly best white move.
+ Arguments: none
+ Fails: never
+ Returns: a move coordinate or "PASS"
+
+ Status: Obsolete GTP version 1 command.
+
+
+ * genmove: Generate and play the supposedly best move for either
+ color.
+ Arguments: color to move
+ Fails: invalid color
+ Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed)
+
+ Status: GTP version 2 standard command.
+
+
+ * reg_genmove: Generate the supposedly best move for either color.
+ Arguments: color to move
+ Fails: invalid color
+ Returns: a move coordinate (or "PASS")
+
+ Status: GTP version 2 standard command.
+
+
+ * gg_genmove: Generate the supposedly best move for either color.
+ Arguments: color to move, optionally a random seed
+ Fails: invalid color
+ Returns: a move coordinate (or "PASS")
+
+ This differs from reg_genmove in the optional random seed.
+
+
+ * restricted_genmove: Generate the supposedly best move for either
+ color from a choice of allowed vertices.
+ Arguments: color to move, allowed vertices
+ Fails: invalid color, invalid vertex, no vertex listed
+ Returns: a move coordinate (or "PASS")
+
+
+ * kgs-genmove_cleanup: Generate and play the supposedly best move
+ for either color, not passing until all dead opponent stones have
+ been removed.
+ Arguments: color to move
+ Fails: invalid color
+ Returns: a move coordinate (or "PASS")
+
+ Status: KGS specific command.
+
+ A similar command, but possibly somewhat different, will likely be added
+ to GTP version 3 at a later time.
+
+
+ * level: Set the playing level.
+ Arguments: int
+ Fails: incorrect argument
+ Returns: nothing
+
+ * undo: Undo one move
+ Arguments: none
+ Fails: If move history is too short.
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+ * gg-undo: Undo a number of moves
+ Arguments: optional int
+ Fails: If move history is too short.
+ Returns: nothing
+
+ * time_settings: Set time allowance
+ Arguments: int main_time, int byo_yomi_time, int byo_yomi_stones
+ Fails: syntax error
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+ * time_left: Report remaining time
+ Arguments: color color, int time, int stones
+ Fails: syntax error
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * final_score: Compute the score of a finished game.
+ Arguments: Optional random seed
+ Fails: never
+ Returns: Score in SGF format (RE property).
+
+ Status: GTP version 2 standard command.
+
+
+ * final_status: Report the final status of a vertex in a finished
+ game.
+ Arguments: Vertex, optional random seed
+ Fails: invalid vertex
+ Returns: Status in the form of one of the strings "alive", "dead",
+ "seki", "white_territory", "black_territory", or "dame".
+
+
+ * final_status_list: Report vertices with a specific final status in
+ a finished game.
+ Arguments: Status in the form of one of the strings "alive", "dead",
+ "seki", "white_territory", "black_territory", or "dame".
+ An optional random seed can be added.
+ Fails: missing or invalid status string
+ Returns: Vertices having the specified status. These are split with
+ one string on each line if the vertices are nonempty (i.e.
+ for "alive", "dead", and "seki").
+
+ Status: GTP version 2 standard command.
+ However, "dame", "white_territory", and "black_territory"
+ are private extensions.
+
+ * estimate_score: Estimate the score
+ Arguments: None
+ Fails: never
+ Returns: upper and lower bounds for the score
+
+ * experimental_score: Estimate the score, taking into account which
+ player moves next
+ Arguments: Color to play
+ Fails: Invalid color
+ Returns: Score.
+
+ This function generates a move for color, then adds the
+ value of the move generated to the value of the position.
+ Critical dragons are awarded to the opponent since the
+ value of rescuing a critical dragon is taken into account
+ in the value of the move generated.
+
+
+ * reset_life_node_counter: Reset the count of life nodes.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+ Note: This function is obsolete and only remains for backwards
+ compatibility.
+
+
+ * get_life_node_counter: Retrieve the count of life nodes.
+ Arguments: none
+ Fails: never
+ Returns: number of life nodes
+
+ Note: This function is obsolete and only remains for backwards
+ compatibility.
+
+
+ * reset_owl_node_counter: Reset the count of owl nodes.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * get_owl_node_counter: Retrieve the count of owl nodes.
+ Arguments: none
+ Fails: never
+ Returns: number of owl nodes
+
+
+ * reset_reading_node_counter: Reset the count of reading nodes.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * get_reading_node_counter: Retrieve the count of reading nodes.
+ Arguments: none
+ Fails: never
+ Returns: number of reading nodes
+
+
+ * reset_trymove_counter: Reset the count of trymoves/trykos.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * get_trymove_counter: Retrieve the count of trymoves/trykos.
+ Arguments: none
+ Fails: never
+ Returns: number of trymoves/trykos
+
+
+ * reset_connection_node_counter: Reset the count of connection nodes.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * get_connection_node_counter: Retrieve the count of connection
+ nodes.
+ Arguments: none
+ Fails: never
+ Returns: number of connection nodes
+
+
+ * test_eyeshape: Test an eyeshape for inconsistent evaluations
+ Arguments: Eyeshape vertices
+ Fails: Bad vertices
+ Returns: Failure reports on stderr.
+
+
+ * analyze_eyegraph: Compute an eyevalue and vital points for an eye
+ graph
+ Arguments: Eyeshape encoded in string
+ Fails: Bad eyeshape, analysis failed
+ Returns: Eyevalue, vital points
+
+
+ * cputime: Returns elapsed CPU time in seconds.
+ Arguments: none
+ Fails: never
+ Returns: Total elapsed (user + system) CPU time in seconds.
+
+
+ * showboard: Write the position to stdout.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+ Status: GTP version 2 standard command.
+
+
+ * dump_stack: Dump stack to stderr.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * initial_influence: Return information about the initial influence
+ function.
+ Arguments: color to move, what information
+ Fails: never
+ Returns: Influence data formatted like:
+
+ 0.51 1.34 3.20 6.60 9.09 8.06 1.96 0.00 0.00
+ 0.45 1.65 4.92 12.19 17.47 15.92 4.03 0.00 0.00
+ .
+ .
+ .
+ 0.00 0.00 0.00 0.00 0.00 100.00 75.53 41.47 23.41
+
+ The available choices of information are:
+
+ white_influence (float)
+ black_influence (float)
+ white_strength (float)
+ black_strength (float)
+ white_attenuation (float)
+ black_attenuation (float)
+ white_permeability (float)
+ black_permeability (float)
+ territory_value (float)
+ influence_regions (int)
+ non_territory (int)
+
+ The encoding of influence_regions is as follows:
+ 4 white stone
+ 3 white territory
+ 2 white moyo
+ 1 white area
+ 0 neutral
+ -1 black area
+ -2 black moyo
+ -3 black territory
+ -4 black stone
+
+
+ * move_influence: Return information about the influence function
+ after a move.
+ Arguments: move, what information
+ Fails: never
+ Returns: Influence data formatted like for initial_influence.
+
+
+ * move_probabilities: List probabilities of each move being played
+ (when non-zero). If no previous genmove command has been issued,
+ the result of this command will be meaningless.
+ Arguments: none
+ Fails: never
+ Returns: Move, probabilty pairs, one per row.
+
+
+ * move_uncertainty: Return the number of bits of uncertainty in the
+ move. If no previous genmove command has been issued, the result
+ of this command will be meaningless.
+ Arguments: none
+ Fails: never
+ Returns: bits of uncertainty
+
+
+ * followup_influence: Return information about the followup
+ influence after a move.
+ Arguments: move, what information
+ Fails: never
+ Returns: Influence data formatted like for initial_influence.
+
+
+ * worm_data: Return the information in the worm data structure.
+ Arguments: optional vertex
+ Fails: never
+ Returns: Worm data formatted like:
+
+ A19:
+ color black
+ size 10
+ effective_size 17.83
+ origin A19
+ liberties 8
+ liberties2 15
+ liberties3 10
+ liberties4 8
+ attack PASS
+ attack_code 0
+ lunch B19
+ defend PASS
+ defend_code 0
+ cutstone 2
+ cutstone2 0
+ genus 0
+ inessential 0
+ B19:
+ color white
+ .
+ .
+ .
+ inessential 0
+ C19:
+ ...
+
+ If an intersection is specified, only data for this one will be returned.
+
+
+ * worm_stones: List the stones of a worm
+ Arguments: the location, "BLACK" or "WHITE"
+ Fails: if called on an empty or off-board location
+ Returns: list of stones
+
+
+ * worm_cutstone: Return the cutstone field in the worm data
+ structure.
+ Arguments: non-empty vertex
+ Fails: never
+ Returns: cutstone
+
+
+ * dragon_data: Return the information in the dragon data structure.
+ Arguments: optional intersection
+ Fails: never
+ Returns: Dragon data formatted in the corresponding way to worm_data.
+
+
+ * dragon_stones: List the stones of a dragon
+ Arguments: the location
+ Fails: if called on an empty or off-board location
+ Returns: list of stones
+
+
+ * eye_data: Return the information in the eye data structure.
+ Arguments: color, vertex
+ Fails: never
+ Returns: eye data fields and values, one pair per row
+
+
+ * half_eye_data: Return the information in the half eye data
+ structure.
+ Arguments: vertex
+ Fails: never
+ Returns: half eye data fields and values, one pair per row
+
+
+ * start_sgftrace: Start storing moves executed during reading in an
+ sgf tree in memory.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+ Warning: You had better know what you're doing if you try to use this
+ command.
+
+
+ * finish_sgftrace: Finish storing moves in an sgf tree and write it
+ to file.
+ Arguments: filename
+ Fails: never
+ Returns: nothing
+
+ Warning: You had better know what you're doing if you try to use this
+ command.
+
+
+ * printsgf: Dump the current position as a static sgf file to
+ filename, or as output if filename is missing or "-"
+ Arguments: optional filename
+ Fails: never
+ Returns: nothing if filename, otherwise the sgf
+
+
+ * tune_move_ordering: Tune the parameters for the move ordering in
+ the tactical reading.
+ Arguments: MOVE_ORDERING_PARAMETERS integers
+ Fails: incorrect arguments
+ Returns: nothing
+
+
+ * echo: Echo the parameter
+ Arguments: string
+ Fails: never
+ Returns: nothing
+
+
+ * echo_err: Echo the parameter to stdout AND stderr
+ Arguments: string
+ Fails: never
+ Returns: nothing
+
+
+ * help: List all known commands
+ Arguments: none
+ Fails: never
+ Returns: list of known commands, one per line
+
+ Status: GTP version 2 standard command.
+
+
+ * known_command: Tell whether a command is known.
+ Arguments: command name
+ Fails: never
+ Returns: "true" if command exists, "false" if not
+
+ Status: GTP version 2 standard command.
+
+
+ * report_uncertainty: Turn uncertainty reports from owl_attack and
+ owl_defend on or off.
+ Arguments: "on" or "off"
+ Fails: invalid argument
+ Returns: nothing
+
+
+ * get_random_seed: Get the random seed
+ Arguments: none
+ Fails: never
+ Returns: random seed
+
+
+ * set_random_seed: Set the random seed
+ Arguments: integer
+ Fails: invalid data
+ Returns: nothing
+
+
+ * advance_random_seed: Advance the random seed by a number of games.
+ Arguments: integer
+ Fails: invalid data
+ Returns: New random seed.
+
+
+ * is_surrounded: Determine if a dragon is surrounded
+ Arguments: vertex (dragon)
+ Fails: invalid vertex, empty vertex
+ Returns: 1 if surrounded, 2 if weakly surrounded, 0 if not
+
+
+ * does_surround: Determine if a move surrounds a dragon
+ Arguments: vertex (move), vertex (dragon)
+ Fails: invalid vertex, empty (dragon, nonempty (move)
+ Returns: 1 if (move) surrounds (dragon)
+
+ * surround_map: Report the surround map for dragon at a vertex
+ Arguments: vertex (dragon), vertex (mapped location)
+ Fails: invalid vertex, empty dragon
+ Returns: value of surround map at (mapped location), or -1 if
+ dragon not surrounded.
+
+
+ * set_search_diamond: limit search, and establish a search diamond
+ Arguments: pos
+ Fails: invalid value
+ Returns: nothing
+
+
+ * reset_search_mask: unmark the entire board for limited search
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+ * limit_search: sets the global variable limit_search
+ Arguments: value
+ Fails: invalid arguments
+ Returns: nothing
+
+
+ * set_search_limit: mark a vertex for limited search
+ Arguments: position
+ Fails: invalid arguments
+ Returns: nothing
+
+
+ * draw_search_area: Draw search area. Writes to stderr.
+ Arguments: none
+ Fails: never
+ Returns: nothing
+
+
+File: gnugo.info, Node: Regression, Next: Copying, Prev: GTP, Up: Top
+
+20 Regression testing
+*********************
+
+The standard purpose of regression testing is to avoid getting the same
+bug twice. When a bug is found, the programmer fixes the bug and adds a
+test to the test suite. The test should fail before the fix and pass
+after the fix. When a new version is about to be released, all the tests
+in the regression test suite are run and if an old bug reappears, this
+will be seen quickly since the appropriate test will fail.
+
+ The regression testing in GNU Go is slightly different. A typical
+test case involves specifying a position and asking the engine what
+move it would make. This is compared to one or more correct moves to
+decide whether the test case passes or fails. It is also stored whether
+a test case is expected to pass or fail, and deviations in this status
+signify whether a change has solved some problem and/or broken something
+else. Thus the regression tests both include positions highlighting some
+mistake being done by the engine, which are waiting to be fixed, and
+positions where the engine does the right thing, where we want to detect
+if a change breaks something.
+
+* Menu:
+
+* Regression Testing:: Regression Testing in GNU Go
+* Test Suites:: Test Suites
+* Running the Regressions:: Running the Regression Tests
+* Running regress.pike:: Running regress.pike
+* Viewing with Emacs:: Viewing tests with Emacs
+* HTML Views:: HTML Views
+
+
+File: gnugo.info, Node: Regression Testing, Next: Test Suites, Up: Regression
+
+20.1 Regression testing in GNU Go
+=================================
+
+Regression testing is performed by the files in the `regression/'
+directory. The tests are specified as GTP commands in files with the
+suffix `.tst', with corresponding correct results and expected
+pass/fail status encoded in GTP comments following the test. To run a
+test suite the shell scripts `test.sh', `eval.sh', and `regress.sh' can
+be used. There are also Makefile targets to do this. If you `make
+all_batches' most of the tests are run. The Pike script `regress.pike'
+can also be used to run all tests or a subset of the tests.
+
+ Game records used by the regression tests are stored in the
+directory `regression/games/' and its subdirectories.
+
+
+File: gnugo.info, Node: Test Suites, Next: Running the Regressions, Prev: Regression Testing, Up: Regression
+
+20.2 Test suites
+================
+
+The regression tests are grouped into suites and stored in files as GTP
+commands. A part of a test suite can look as follows:
+ # Connecting with ko at B14 looks best. Cutting at D17 might be
+ # considered. B17 (game move) is inferior.
+ loadsgf games/strategy25.sgf 61
+ 90 gg_genmove black
+ #? [B14|D17]
+
+ # The game move at P13 is a suicidal blunder.
+ loadsgf games/strategy25.sgf 249
+ 95 gg_genmove black
+ #? [!P13]
+
+ loadsgf games/strategy26.sgf 257
+ 100 gg_genmove black
+ #? [M16]*
+
+ Lines starting with a hash sign, or in general anything following a
+hash sign, are interpreted as comments by the GTP mode and thus ignored
+by the engine. GTP commands are executed in the order they appear, but
+only those on numbered lines are used for testing. The comment lines
+starting with `#?' are magical to the regression testing scripts and
+indicate correct results and expected pass/fail status. The string
+within brackets is matched as a regular expression against the response
+from the previous numbered GTP command. A particular useful feature of
+regular expressions is that by using `|' it is possible to specify
+alternatives. Thus `B14|D17' above means that if either `B14' or `D17'
+is the move generated in test case 90, it passes. There is one
+important special case to be aware of. If the correct result string
+starts with an exclamation mark, this is excluded from the regular
+expression but afterwards the result of the matching is negated. Thus
+`!P13' in test case 95 means that any move except `P13' is accepted as
+a correct result.
+
+ In test case 100, the brackets on the `#?' line is followed by an
+asterisk. This means that the test is expected to fail. If there is no
+asterisk, the test is expected to pass. The brackets may also be
+followed by a `&', meaning that the result is ignored. This is
+primarily used to report statistics, e.g. how many tactical reading
+nodes were spent while running the test suite.
+
+
+File: gnugo.info, Node: Running the Regressions, Next: Running regress.pike, Prev: Test Suites, Up: Regression
+
+20.3 Running the Regression Tests
+=================================
+
+`./test.sh blunder.tst' runs the tests in `blunder.tst' and prints the
+results of the commands on numbered lines, which may look like:
+
+ 1 E5
+ 2 F9
+ 3 O18
+ 4 B7
+ 5 A4
+ 6 E4
+ 7 E3
+ 8 A3
+ 9 D9
+ 10 J9
+ 11 B3
+ 12 C6
+ 13 C6
+
+ This is usually not very informative, however. More interesting is
+`./eval.sh blunder.tst' which also compares the results above against
+the correct ones in the test file and prints a report for each test on
+the form:
+
+ 1 failed: Correct '!E5', got 'E5'
+ 2 failed: Correct 'C9|H9', got 'F9'
+ 3 PASSED
+ 4 failed: Correct 'B5|C5|C4|D4|E4|E3|F3', got 'B7'
+ 5 PASSED
+ 6 failed: Correct 'D4', got 'E4'
+ 7 PASSED
+ 8 failed: Correct 'B4', got 'A3'
+ 9 failed: Correct 'G8|G9|H8', got 'D9'
+ 10 failed: Correct 'G9|F9|C7', got 'J9'
+ 11 failed: Correct 'D4|E4|E5|F4|C6', got 'B3'
+ 12 failed: Correct 'D4', got 'C6'
+ 13 failed: Correct 'D4|E4|E5|F4', got 'C6'
+
+ The result of a test can be one of four different cases:
+
+ * `passed': An expected pass
+
+ This is the ideal result.
+
+ * `PASSED': An unexpected pass
+
+ This is a result that we are hoping for when we fix a bug. An old
+ test case that used to fail is now passing.
+
+ * `failed': An expected failure
+
+ The test failed but this was also what we expected, unless we were
+ trying to fix the particular mistake highlighted by the test case.
+ These tests show weaknesses of the GNU Go engine and are good
+ places to search if you want to detect an area which needs
+ improvement.
+
+ * `FAILED': An unexpected failure
+
+ This should nominally only happen if something is broken by a
+ change. However, sometimes GNU Go passes a test, but for the wrong
+ reason or for a combination of wrong reasons. When one of these
+ reasons is fixed, the other one may shine through so that the test
+ suddenly fails. When a test case unexpectedly fails, it is
+ necessary to make a closer examination in order to determine
+ whether a change has broken something.
+
+
+ If you want a less verbose report, `./regress.sh . blunder.tst' does
+the same thing as the previous command, but only reports unexpected
+results. The example above is compressed to
+
+ 3 unexpected PASS!
+ 5 unexpected PASS!
+ 7 unexpected PASS!
+
+ For convenience the tests are also available as makefile targets. For
+example, `make blunder' runs the tests in the blunder test suite by
+executing `eval.sh blunder.tst'. `make all_batches' runs all test
+suites in a sequence using the `regress.sh' script.
+
+
+File: gnugo.info, Node: Running regress.pike, Next: Viewing with Emacs, Prev: Running the Regressions, Up: Regression
+
+20.4 Running regress.pike
+=========================
+
+A more powerful way to run regressions is with the script
+`regress.pike'. This requires that you have Pike
+(`http://pike.ida.liu.se') installed.
+
+ Executing `./regress.pike' without arguments will run all testsuites
+that `make all_batches' would run. The difference is that unexpected
+results are reported immediately when they have been found (instead of
+after the whole file has been run) and that statistics of time
+consumption and node usage is presented for each test file and in total.
+
+ To run a single test suite do e.g. `./regress.pike nicklas3.tst' or
+`./regress.pike nicklas3'. The result may look like:
+ nicklas3 2.96 614772 3322 469
+ Total nodes: 614772 3322 469
+ Total time: 2.96 (3.22)
+ Total uncertainty: 0.00
+ The numbers here mean that the test suite took 2.96 seconds of
+processor time and 3.22 seconds of real time. The consumption of
+reading nodes was 614772 for tactical reading, 3322 for owl reading,
+and 469 for connection reading. The last line relates to the
+variability of the generated moves in the test suite, and 0 means that
+none was decided by the randomness contribution to the move valuation.
+Multiple testsuites can be run by e.g. `./regress.pike owl ld_owl owl1'.
+
+ It is also possible to run a single testcase, e.g. `./regress.pike
+strategy:6', a number of testcases, e.g. `./regress.pike
+strategy:6,23,45', a range of testcases, e.g. `./regress.pike
+strategy:13-15' or more complex combinations e.g. `./regress.pike
+strategy:6,13-15,23,45 nicklas3:602,1403'.
+
+ There are also command line options to choose what engine to run,
+what options to send to the engine, to turn on verbose output, and to
+use a file to specify which testcases to run. Run `./regress.pike
+--help' for a complete and up to date list of options.
+
+
+File: gnugo.info, Node: Viewing with Emacs, Next: HTML Views, Prev: Running regress.pike, Up: Regression
+
+20.5 Viewing tests with Emacs
+=============================
+
+To get a quick regression view, you may use the graphical display mode
+available with Emacs (*note Emacs::). You will want the cursor in the
+regression buffer when you enter `M-x gnugo', so that GNU Go opens in
+the correct directory. A good way to be in the right directory is to
+open the window of the test you want to investigate. Then you can cut
+and past GTP commands directly from the test to the minibuffer, using
+the `:' command from Emacs. Although Emacs mode does not have a
+coordinate grid, you may get an ascii board with the coordinate grid
+using `: showboard' command.
+
+
+File: gnugo.info, Node: HTML Views, Prev: Viewing with Emacs, Up: Regression
+
+20.6 HTML Regression Views
+==========================
+
+Extremely useful HTML Views of the regression tests may be produced
+using two perl scripts `regression/regress.pl' and
+`regression/regress.plx'.
+
+ 1. The driver program (regress.pl) which:
+ * Runs the regression tests, invoking GNU Go.
+
+ * Captures the trace output, board position, and pass/fail
+ status, sgf output, and dragon status information.
+
+ 2. The interface to view the captured output (regress.plx) which:
+ * Never invokes GNU Go.
+
+ * Displays the captured output in helpful formats (i.e. HTML).
+
+20.6.1 Setting up the HTML regression Views
+-------------------------------------------
+
+There are many ways configuring Apache to permit CGI scripts, all of
+them are featured in Apache documentation, which can be found at
+`http://httpd.apache.org/docs/2.0/howto/cgi.html'
+
+ Below you will find one example.
+
+ This documentation assumes an Apache 2.0 included in Fedora Core
+distribution, but it should be fairly close to the config for other
+distributions.
+
+ First, you will need to configure Apache to run CGI scripts in the
+directory you wish to serve the html views from. In
+`/etc/httpd/conf/httpd.conf' there should be a line:
+
+ `DocumentRoot "/var/www/html"'
+
+ Search for a line `', where
+`/path/to/directory' is the same as provided in `DocumentRoot', then
+add `ExecCGI' to list of `Options'. The whole section should look like:
+
+
+ ...
+ Options ... ExecCGI
+ ...
+
+
+ This allows CGI scripts to be executed in the directory used by
+regress.plx. Next, you need to tell Apache that `.plx' is a CGI script
+ending. Your `httpd.conf' file should contain a line:
+
+ `AddHandler cgi-script ...'
+
+ If there isn't already, add it; add `.plx' to the list of extensions,
+so line should look like:
+
+ `AddHandler cgi-script ... .plx'
+
+ You will also need to make sure you have the necessary modules
+loaded to run CGI scripts; mod_cgi and mod_mime should be sufficient.
+Your `httpd.conf' should have the relevant `LoadModule cgi_module
+modules/mod_cgi.so' and `LoadModule mime_module modules/mod_mime.so'
+lines; uncomment them if necessary.
+
+ Next, you need to put a copy of `regress.plx' in the `DocumentRoot'
+directory `/var/www/html' or it subdirectories where you plan to serve
+the html views from.
+
+ You will also need to install the Perl module GD
+(`http://search.cpan.org/dist/GD/'), available from CPAN.
+
+ Finally, run `regression/regress.pl' to create the xml data used to
+generate the html views (to do all regression tests run
+`regression/regress.pl -a 1'); then, copy the `html/' directory to the
+same directory as `regress.plx' resides in.
+
+ At this point, you should have a working copy of the html regression
+views.
+
+ Additional notes for Debian users: The Perl GD module can be
+installed by `apt-get install libgd-perl'. It may suffice to add this to
+the apache2 configuration:
+
+
+ Options +ExecCGI
+ AddHandler cgi-script .plx
+ RedirectMatch ^/regression$ /regression/regress.plx
+
+
+ and then make a link from `/var/www/regression' to the GNU Go
+regression directory. The `RedirectMatch' statement is only needed to
+set up a shorter entry URL.
+
+
+File: gnugo.info, Node: Copying, Next: Concept Index, Prev: Regression, Up: Top
+
+Appendix A Copying
+******************
+
+The program GNU Go is distributed under the terms of the GNU General
+Public License (GPL). Its documentation is distributed under the terms
+of the GNU Free Documentation License (GFDL).
+
+* Menu:
+
+* GPL:: The GNU General Public License
+* GFDL:: The GNU Free Documentation License
+* GTP License:: The Go Text Protocol License
+
+
+File: gnugo.info, Node: GPL, Next: GFDL, Prev: Copying, Up: Copying
+
+A.1 GNU GENERAL PUBLIC LICENSE
+==============================
+
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+========
+
+The GNU General Public License is a free, copyleft license for software
+and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program-to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+ 0. DEFINITIONS
+
+ "This License" refers to version 3 of the GNU General Public
+ License.
+
+ "Copyright" also means copyright-like laws that apply to other
+ kinds of works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+ License. Each licensee is addressed as "you". "Licensees" and
+ "recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the
+ work in a fashion requiring copyright permission, other than the
+ making of an exact copy. The resulting work is called a "modified
+ version" of the earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work
+ based on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+ permission, would make you directly or secondarily liable for
+ infringement under applicable copyright law, except executing it
+ on a computer or modifying a private copy. Propagation includes
+ copying, distribution (with or without modification), making
+ available to the public, and in some countries other activities as
+ well.
+
+ To "convey" a work means any kind of propagation that enables other
+ parties to make or receive copies. Mere interaction with a user
+ through a computer network, with no transfer of a copy, is not
+ conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+ to the extent that it includes a convenient and prominently visible
+ feature that (1) displays an appropriate copyright notice, and (2)
+ tells the user that there is no warranty for the work (except to
+ the extent that warranties are provided), that licensees may
+ convey the work under this License, and how to view a copy of this
+ License. If the interface presents a list of user commands or
+ options, such as a menu, a prominent item in the list meets this
+ criterion.
+
+
+ 1. SOURCE CODE
+
+ The "source code" for a work means the preferred form of the work
+ for making modifications to it. "Object code" means any non-source
+ form of a work.
+
+ A "Standard Interface" means an interface that either is an
+ official standard defined by a recognized standards body, or, in
+ the case of interfaces specified for a particular programming
+ language, one that is widely used among developers working in that
+ language.
+
+ The "System Libraries" of an executable work include anything,
+ other than the work as a whole, that (a) is included in the normal
+ form of packaging a Major Component, but which is not part of that
+ Major Component, and (b) serves only to enable use of the work
+ with that Major Component, or to implement a Standard Interface
+ for which an implementation is available to the public in source
+ code form. A "Major Component", in this context, means a major
+ essential component (kernel, window system, and so on) of the
+ specific operating system (if any) on which the executable work
+ runs, or a compiler used to produce the work, or an object code
+ interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+ the source code needed to generate, install, and (for an executable
+ work) run the object code and to modify the work, including
+ scripts to control those activities. However, it does not include
+ the work's System Libraries, or general-purpose tools or generally
+ available free programs which are used unmodified in performing
+ those activities but which are not part of the work. For example,
+ Corresponding Source includes interface definition files
+ associated with source files for the work, and the source code for
+ shared libraries and dynamically linked subprograms that the work
+ is specifically designed to require, such as by intimate data
+ communication or control flow between those subprograms and other
+ parts of the work.
+
+ The Corresponding Source need not include anything that users can
+ regenerate automatically from other parts of the Corresponding
+ Source.
+
+ The Corresponding Source for a work in source code form is that
+ same work.
+
+
+ 2. BASIC PERMISSIONS
+
+ All rights granted under this License are granted for the term of
+ copyright on the Program, and are irrevocable provided the stated
+ conditions are met. This License explicitly affirms your unlimited
+ permission to run the unmodified Program. The output from running
+ a covered work is covered by this License only if the output,
+ given its content, constitutes a covered work. This License
+ acknowledges your rights of fair use or other equivalent, as
+ provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+ convey, without conditions so long as your license otherwise
+ remains in force. You may convey covered works to others for the
+ sole purpose of having them make modifications exclusively for
+ you, or provide you with facilities for running those works,
+ provided that you comply with the terms of this License in
+ conveying all material for which you do not control copyright.
+ Those thus making or running the covered works for you must do so
+ exclusively on your behalf, under your direction and control, on
+ terms that prohibit them from making any copies of your
+ copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+ the conditions stated below. Sublicensing is not allowed; section
+ 10 makes it unnecessary.
+
+
+ 3. PROTECTING USERS' LEGAL RIGHTS FROM ANTI-CIRCUMVENTION LAW
+
+ No covered work shall be deemed part of an effective technological
+ measure under any applicable law fulfilling obligations under
+ article 11 of the WIPO copyright treaty adopted on 20 December
+ 1996, or similar laws prohibiting or restricting circumvention of
+ such measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+ circumvention of technological measures to the extent such
+ circumvention is effected by exercising rights under this License
+ with respect to the covered work, and you disclaim any intention
+ to limit operation or modification of the work as a means of
+ enforcing, against the work's users, your or third parties' legal
+ rights to forbid circumvention of technological measures.
+
+
+ 4. CONVEYING VERBATIM COPIES
+
+ You may convey verbatim copies of the Program's source code as you
+ receive it, in any medium, provided that you conspicuously and
+ appropriately publish on each copy an appropriate copyright notice;
+ keep intact all notices stating that this License and any
+ non-permissive terms added in accord with section 7 apply to the
+ code; keep intact all notices of the absence of any warranty; and
+ give all recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+ and you may offer support or warranty protection for a fee.
+
+
+ 5. CONVEYING MODIFIED SOURCE VERSIONS
+
+ You may convey a work based on the Program, or the modifications to
+ produce it from the Program, in the form of source code under the
+ terms of section 4, provided that you also meet all of these
+ conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has
+ interactive interfaces that do not display Appropriate Legal
+ Notices, your work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+ works, which are not by their nature extensions of the covered
+ work, and which are not combined with it such as to form a larger
+ program, in or on a volume of a storage or distribution medium, is
+ called an "aggregate" if the compilation and its resulting
+ copyright are not used to limit the access or legal rights of the
+ compilation's users beyond what the individual works permit.
+ Inclusion of a covered work in an aggregate does not cause this
+ License to apply to the other parts of the aggregate.
+
+
+ 6. CONVEYING NON-SOURCE FORMS
+
+ You may convey a covered work in object code form under the terms
+ of sections 4 and 5, provided that you also convey the
+ machine-readable Corresponding Source under the terms of this
+ License, in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the Corresponding
+ Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in
+ accord with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at
+ no further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place
+ to copy the object code is a network server, the Corresponding
+ Source may be on a different server (operated by you or a
+ third party) that supports equivalent copying facilities,
+ provided you maintain clear directions next to the object code
+ saying where to find the Corresponding Source. Regardless of
+ what server hosts the Corresponding Source, you remain
+ obligated to ensure that it is available for as long as needed
+ to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is
+ excluded from the Corresponding Source as a System Library, need
+ not be included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means
+ any tangible personal property which is normally used for
+ personal, family, or household purposes, or (2) anything designed
+ or sold for incorporation into a dwelling. In determining whether
+ a product is a consumer product, doubtful cases shall be resolved
+ in favor of coverage. For a particular product received by a
+ particular user, "normally used" refers to a typical or common use
+ of that class of product, regardless of the status of the
+ particular user or of the way in which the particular user
+ actually uses, or expects or is expected to use, the product. A
+ product is a consumer product regardless of whether the product
+ has substantial commercial, industrial or non-consumer uses,
+ unless such uses represent the only significant mode of use of the
+ product.
+
+ "Installation Information" for a User Product means any methods,
+ procedures, authorization keys, or other information required to
+ install and execute modified versions of a covered work in that
+ User Product from a modified version of its Corresponding Source.
+ The information must suffice to ensure that the continued
+ functioning of the modified object code is in no case prevented or
+ interfered with solely because modification has been made.
+
+ If you convey an object code work under this section in, or with,
+ or specifically for use in, a User Product, and the conveying
+ occurs as part of a transaction in which the right of possession
+ and use of the User Product is transferred to the recipient in
+ perpetuity or for a fixed term (regardless of how the transaction
+ is characterized), the Corresponding Source conveyed under this
+ section must be accompanied by the Installation Information. But
+ this requirement does not apply if neither you nor any third party
+ retains the ability to install modified object code on the User
+ Product (for example, the work has been installed in ROM).
+
+ The requirement to provide Installation Information does not
+ include a requirement to continue to provide support service,
+ warranty, or updates for a work that has been modified or
+ installed by the recipient, or for the User Product in which it
+ has been modified or installed. Access to a network may be denied
+ when the modification itself materially and adversely affects the
+ operation of the network or violates the rules and protocols for
+ communication across the network.
+
+ Corresponding Source conveyed, and Installation Information
+ provided, in accord with this section must be in a format that is
+ publicly documented (and with an implementation available to the
+ public in source code form), and must require no special password
+ or key for unpacking, reading or copying.
+
+
+ 7. ADDITIONAL TERMS
+
+ "Additional permissions" are terms that supplement the terms of
+ this License by making exceptions from one or more of its
+ conditions. Additional permissions that are applicable to the
+ entire Program shall be treated as though they were included in
+ this License, to the extent that they are valid under applicable
+ law. If additional permissions apply only to part of the Program,
+ that part may be used separately under those permissions, but the
+ entire Program remains governed by this License without regard to
+ the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+ remove any additional permissions from that copy, or from any part
+ of it. (Additional permissions may be written to require their own
+ removal in certain cases when you modify the work.) You may place
+ additional permissions on material, added by you to a covered work,
+ for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material
+ you add to a covered work, you may (if authorized by the copyright
+ holders of that material) supplement the terms of this License
+ with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions
+ of it) with contractual assumptions of liability to the
+ recipient, for any liability that these contractual
+ assumptions directly impose on those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+ restrictions" within the meaning of section 10. If the Program as
+ you received it, or any part of it, contains a notice stating that
+ it is governed by this License along with a term that is a further
+ restriction, you may remove that term. If a license document
+ contains a further restriction but permits relicensing or
+ conveying under this License, you may add to a covered work
+ material governed by the terms of that license document, provided
+ that the further restriction does not survive such relicensing or
+ conveying.
+
+ If you add terms to a covered work in accord with this section, you
+ must place, in the relevant source files, a statement of the
+ additional terms that apply to those files, or a notice indicating
+ where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in
+ the form of a separately written license, or stated as exceptions;
+ the above requirements apply either way.
+
+
+ 8. TERMINATION
+
+ You may not propagate or modify a covered work except as expressly
+ provided under this License. Any attempt otherwise to propagate or
+ modify it is void, and will automatically terminate your rights
+ under this License (including any patent licenses granted under
+ the third paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly and
+ finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, you do not qualify to receive new
+ licenses for the same material under section 10.
+
+
+ 9. ACCEPTANCE NOT REQUIRED FOR HAVING COPIES
+
+ You are not required to accept this License in order to receive or
+ run a copy of the Program. Ancillary propagation of a covered work
+ occurring solely as a consequence of using peer-to-peer
+ transmission to receive a copy likewise does not require
+ acceptance. However, nothing other than this License grants you
+ permission to propagate or modify any covered work. These actions
+ infringe copyright if you do not accept this License. Therefore,
+ by modifying or propagating a covered work, you indicate your
+ acceptance of this License to do so.
+
+
+ 10. AUTOMATIC LICENSING OF DOWNSTREAM RECIPIENTS
+
+ Each time you convey a covered work, the recipient automatically
+ receives a license from the original licensors, to run, modify and
+ propagate that work, subject to this License. You are not
+ responsible for enforcing compliance by third parties with this
+ License.
+
+ An "entity transaction" is a transaction transferring control of an
+ organization, or substantially all assets of one, or subdividing an
+ organization, or merging organizations. If propagation of a
+ covered work results from an entity transaction, each party to that
+ transaction who receives a copy of the work also receives whatever
+ licenses to the work the party's predecessor in interest had or
+ could give under the previous paragraph, plus a right to
+ possession of the Corresponding Source of the work from the
+ predecessor in interest, if the predecessor has it or can get it
+ with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+ rights granted or affirmed under this License. For example, you
+ may not impose a license fee, royalty, or other charge for
+ exercise of rights granted under this License, and you may not
+ initiate litigation (including a cross-claim or counterclaim in a
+ lawsuit) alleging that any patent claim is infringed by making,
+ using, selling, offering for sale, or importing the Program or any
+ portion of it.
+
+
+ 11. PATENTS
+
+ A "contributor" is a copyright holder who authorizes use under this
+ License of the Program or a work on which the Program is based.
+ The work thus licensed is called the contributor's "contributor
+ version".
+
+ A contributor's "essential patent claims" are all patent claims
+ owned or controlled by the contributor, whether already acquired or
+ hereafter acquired, that would be infringed by some manner,
+ permitted by this License, of making, using, or selling its
+ contributor version, but do not include claims that would be
+ infringed only as a consequence of further modification of the
+ contributor version. For purposes of this definition, "control"
+ includes the right to grant patent sublicenses in a manner
+ consistent with the requirements of this License.
+
+ Each contributor grants you a non-exclusive, worldwide,
+ royalty-free patent license under the contributor's essential
+ patent claims, to make, use, sell, offer for sale, import and
+ otherwise run, modify and propagate the contents of its
+ contributor version.
+
+ In the following three paragraphs, a "patent license" is any
+ express agreement or commitment, however denominated, not to
+ enforce a patent (such as an express permission to practice a
+ patent or covenant not to sue for patent infringement). To
+ "grant" such a patent license to a party means to make such an
+ agreement or commitment not to enforce a patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent
+ license, and the Corresponding Source of the work is not available
+ for anyone to copy, free of charge and under the terms of this
+ License, through a publicly available network server or other
+ readily accessible means, then you must either (1) cause the
+ Corresponding Source to be so available, or (2) arrange to deprive
+ yourself of the benefit of the patent license for this particular
+ work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream
+ recipients. "Knowingly relying" means you have actual knowledge
+ that, but for the patent license, your conveying the covered work
+ in a country, or your recipient's use of the covered work in a
+ country, would infringe one or more identifiable patents in that
+ country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+ arrangement, you convey, or propagate by procuring conveyance of, a
+ covered work, and grant a patent license to some of the parties
+ receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the
+ patent license you grant is automatically extended to all
+ recipients of the covered work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+ the scope of its coverage, prohibits the exercise of, or is
+ conditioned on the non-exercise of one or more of the rights that
+ are specifically granted under this License. You may not convey a
+ covered work if you are a party to an arrangement with a third
+ party that is in the business of distributing software, under
+ which you make payment to the third party based on the extent of
+ your activity of conveying the work, and under which the third
+ party grants, to any of the parties who would receive the covered
+ work from you, a discriminatory patent license (a) in connection
+ with copies of the covered work conveyed by you (or copies made
+ from those copies), or (b) primarily for and in connection with
+ specific products or compilations that contain the covered work,
+ unless you entered into that arrangement, or that patent license
+ was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+ any implied license or other defenses to infringement that may
+ otherwise be available to you under applicable patent law.
+
+
+ 12. NO SURRENDER OF OTHERS' FREEDOM
+
+ If conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this
+ License, they do not excuse you from the conditions of this
+ License. If you cannot convey a covered work so as to satisfy
+ simultaneously your obligations under this License and any other
+ pertinent obligations, then as a consequence you may not convey it
+ at all. For example, if you agree to terms that obligate you to
+ collect a royalty for further conveying from those to whom you
+ convey the Program, the only way you could satisfy both those
+ terms and this License would be to refrain entirely from conveying
+ the Program.
+
+
+ 13. USE WITH THE GNU AFFERO GENERAL PUBLIC LICENSE
+
+ Notwithstanding any other provision of this License, you have
+ permission to link or combine any covered work with a work licensed
+ under version 3 of the GNU Affero General Public License into a
+ single combined work, and to convey the resulting work. The terms
+ of this License will continue to apply to the part which is the
+ covered work, but the special requirements of the GNU Affero
+ General Public License, section 13, concerning interaction through
+ a network will apply to the combination as such.
+
+
+ 14. REVISED VERSIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish revised and/or new
+ versions of the GNU General Public License from time to time.
+ Such new versions will be similar in spirit to the present
+ version, but may differ in detail to address new problems or
+ concerns.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies that a certain numbered version of the GNU
+ General Public License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that numbered version or of any later version published by the
+ Free Software Foundation. If the Program does not specify a
+ version number of the GNU General Public License, you may choose
+ any version ever published by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+ versions of the GNU General Public License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Program.
+
+ Later license versions may give you additional or different
+ permissions. However, no additional obligations are imposed on any
+ author or copyright holder as a result of your choosing to follow a
+ later version.
+
+
+ 15. DISCLAIMER OF WARRANTY
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+ COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
+ RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
+ SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+
+ 16. LIMITATION OF LIABILITY.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
+ AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+ THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+ BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGES.
+
+
+ 17. INTERPRETATION OF SECTIONS 15 AND 16
+
+ If the disclaimer of warranty and limitation of liability provided
+ above cannot be given local legal effect according to their terms,
+ reviewing courts shall apply local law that most closely
+ approximates an absolute waiver of all civil liability in
+ connection with the Program, unless a warranty or assumption of
+ liability accompanies a copy of the Program in return for a fee.
+
+
+How to Apply These Terms to your New Programs
+=============================================
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C) This program
+comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This
+is free software, and you are welcome to redistribute it under
+certain conditions; type `show c' for details.
+
+ The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a GUI interface, you would
+use an "about box".
+
+ You should also get your employer (if you work as a programmer) or
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. For more information on this, and how to apply and follow
+the GNU GPL, see .
+
+ The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Lesser General Public License instead of this License. But first,
+please read .
+
+
+File: gnugo.info, Node: GFDL, Next: GTP License, Prev: GPL, Up: Copying
+
+A.2 GNU FREE DOCUMENTATION LICENSE
+==================================
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, receipt of a copy of some or all of
+ the same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation. If the Document specifies that a proxy
+ can decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: gnugo.info, Node: GTP License, Prev: GFDL, Up: Copying
+
+A.3 The Go Text Protocol License
+================================
+
+In order to facilitate the use of the Go Text Protocol, the two files
+`gtp.c' and `gtp.h' are licensed under the following terms.
+
+ Copyright 2001 by the Free Software Foundation.
+
+ Permission is hereby granted, free of charge, to any person
+obtaining a copy of this file `gtp.x', to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+provided that the above copyright notice(s) and this permission notice
+appear in all copies of the Software and that both the above copyright
+notice(s) and this permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+
+File: gnugo.info, Node: Concept Index, Next: Functions Index, Prev: Copying, Up: Top
+
+Concept Index
+*************
+
+ [index ]
+* Menu:
+
+* aa_confirm_safety: GTP command reference.
+ (line 492)
+* accurate_approxlib: GTP command reference.
+ (line 207)
+* accuratelib: GTP command reference.
+ (line 200)
+* adjacent dragons: Dragons. (line 145)
+* advance_random_seed: GTP command reference.
+ (line 960)
+* all_legal: GTP command reference.
+ (line 223)
+* amalgamation of worms into dragons: Amalgamation. (line 6)
+* analyze_eyegraph: GTP command reference.
+ (line 710)
+* analyze_semeai: GTP command reference.
+ (line 400)
+* analyze_semeai_after_move: GTP command reference.
+ (line 406)
+* API: API. (line 26)
+* area: Territory and Moyo. (line 6)
+* ascii description of shapes: Patterns Overview. (line 27)
+* ascii interface: Ascii. (line 6)
+* ascii mode: Invoking GNU Go. (line 336)
+* attack: GTP command reference.
+ (line 288)
+* attack shapes database: Patterns Overview. (line 6)
+* attack_either: GTP command reference.
+ (line 294)
+* autohelper actions: Autohelper Actions. (line 6)
+* Autohelpers: Autohelpers and Constraints.
+ (line 6)
+* automaton: DFA. (line 29)
+* black: GTP command reference.
+ (line 111)
+* block_off: GTP command reference.
+ (line 437)
+* board_state: The Board State. (line 6)
+* boardsize: GTP command reference.
+ (line 63)
+* break_in: GTP command reference.
+ (line 431)
+* cache: Invoking GNU Go. (line 119)
+* cache-size: Invoking GNU Go. (line 119)
+* captures: GTP command reference.
+ (line 229)
+* CGoban: CGoban. (line 6)
+* clear_board: GTP command reference.
+ (line 77)
+* clear_cache: GTP command reference.
+ (line 284)
+* color: GTP command reference.
+ (line 175)
+* color (dragon): Dragons. (line 98)
+* colored display <1>: Dragons in Color. (line 6)
+* colored display: Colored Display. (line 6)
+* combination_attack: GTP command reference.
+ (line 479)
+* combination_defend: GTP command reference.
+ (line 485)
+* command line options: Invoking GNU Go. (line 6)
+* connect: GTP command reference.
+ (line 419)
+* connection shapes database <1>: Connections Database.
+ (line 6)
+* connection shapes database: Patterns Overview. (line 6)
+* connections: Connection. (line 6)
+* connections database: Connections Database.
+ (line 6)
+* corner matcher: Corner Matcher. (line 6)
+* countlib: GTP command reference.
+ (line 187)
+* cputime: GTP command reference.
+ (line 717)
+* cutting stone: Worms. (line 124)
+* cutting stone, potential: Worms. (line 133)
+* data structures: Basic Data Structures.
+ (line 6)
+* debugging on a graphical board: view.pike. (line 6)
+* debugging options: Invoking GNU Go. (line 415)
+* Debugging the reading code: Debugging. (line 6)
+* decide-dragon: Decide dragon. (line 6)
+* decide-string: Decide string. (line 6)
+* decrease_depths: GTP command reference.
+ (line 334)
+* defence shapes database: Patterns Overview. (line 6)
+* defend: GTP command reference.
+ (line 302)
+* defend_both: GTP command reference.
+ (line 385)
+* depth: Invoking GNU Go. (line 242)
+* Depth of reading: Tactical Reading. (line 6)
+* description of shapes: Patterns Overview. (line 27)
+* dfa: DFA. (line 29)
+* dfa.c: DFA. (line 29)
+* dfa.h: DFA. (line 29)
+* disconnect: GTP command reference.
+ (line 425)
+* distance from liberty to dragon: Worms. (line 109)
+* does_attack: GTP command reference.
+ (line 308)
+* does_defend: GTP command reference.
+ (line 315)
+* does_surround: GTP command reference.
+ (line 972)
+* dragon: Worms and Dragons. (line 27)
+* dragon escape_route: Dragons. (line 207)
+* dragon genus: Dragons. (line 213)
+* dragon lunch: Dragons. (line 230)
+* dragon number: Dragons. (line 100)
+* dragon origin: Dragons. (line 104)
+* dragon safety: Dragons. (line 176)
+* dragon size: Dragons. (line 112)
+* dragon status: Dragons. (line 131)
+* dragon weakness: Dragons. (line 199)
+* dragon_data: GTP command reference.
+ (line 854)
+* dragon_status: GTP command reference.
+ (line 452)
+* dragon_stones: GTP command reference.
+ (line 860)
+* dragons: Dragons. (line 6)
+* draw_search_area: GTP command reference.
+ (line 1008)
+* dump_stack: GTP command reference.
+ (line 731)
+* echo: GTP command reference.
+ (line 913)
+* echo_err: GTP command reference.
+ (line 919)
+* editing pattern database: Editing Patterns. (line 6)
+* editing patterns: Editing Patterns. (line 6)
+* effective size: Dragons. (line 116)
+* effective size (worm): Worms. (line 48)
+* eliminate the randomness: Tuning. (line 155)
+* emacs mode: Emacs. (line 6)
+* escape_route: Dragons. (line 207)
+* estimate_score: GTP command reference.
+ (line 621)
+* eval_eye: GTP command reference.
+ (line 444)
+* experimental_score: GTP command reference.
+ (line 626)
+* eye shapes database: Patterns Overview. (line 6)
+* eye space display: Colored Display. (line 48)
+* eye_data: GTP command reference.
+ (line 866)
+* false eye: Half Eyes. (line 6)
+* fast pattern matching: DFA. (line 29)
+* final_score: GTP command reference.
+ (line 589)
+* final_status: GTP command reference.
+ (line 597)
+* final_status_list: GTP command reference.
+ (line 605)
+* findlib: GTP command reference.
+ (line 193)
+* finish_sgftrace: GTP command reference.
+ (line 889)
+* finite state automaton: DFA. (line 29)
+* fixed_handicap: GTP command reference.
+ (line 135)
+* FIXME: Coding Styles. (line 83)
+* followup_influence: GTP command reference.
+ (line 799)
+* format of the pattern database: Patterns Overview. (line 27)
+* formatted printing: Print Utilities. (line 6)
+* GDB <1>: Debugging. (line 30)
+* GDB: GTP and GDB techniques.
+ (line 6)
+* generation of helper functions: Autohelpers and Constraints.
+ (line 6)
+* genmove: GTP command reference.
+ (line 512)
+* genmove_black: GTP command reference.
+ (line 496)
+* genmove_white: GTP command reference.
+ (line 504)
+* genus: Dragons. (line 213)
+* genus (worm): Worms. (line 155)
+* get_connection_node_counter: GTP command reference.
+ (line 697)
+* get_handicap: GTP command reference.
+ (line 160)
+* get_komi: GTP command reference.
+ (line 105)
+* get_life_node_counter: GTP command reference.
+ (line 646)
+* get_owl_node_counter: GTP command reference.
+ (line 661)
+* get_random_seed: GTP command reference.
+ (line 948)
+* get_reading_node_counter: GTP command reference.
+ (line 673)
+* get_trymove_counter: GTP command reference.
+ (line 685)
+* gg-undo: GTP command reference.
+ (line 571)
+* gg_genmove: GTP command reference.
+ (line 529)
+* GMP: GMP and GTP. (line 6)
+* GNU Go's GDB commands: Debugging. (line 82)
+* go position: Hash Calculation. (line 10)
+* grid optimization: Details. (line 6)
+* GTP <1>: GTP and GDB techniques.
+ (line 6)
+* GTP: GMP and GTP. (line 6)
+* GTP command reference: GTP command reference.
+ (line 6)
+* half eye: Half Eyes. (line 6)
+* half_eye_data: GTP command reference.
+ (line 872)
+* Hash node: Hash Organization. (line 8)
+* Hashing of positions: Hashing. (line 6)
+* help: GTP command reference.
+ (line 925)
+* helper functions in pattern matching: Helper Functions. (line 6)
+* how GNU Go learns new joseki: Joseki Compiler. (line 6)
+* How to debug the reading code: Debugging. (line 6)
+* implementation of pattern matching <1>: Corner Matcher. (line 6)
+* implementation of pattern matching: PM Implementation. (line 6)
+* increase_depths: GTP command reference.
+ (line 328)
+* inessential string: Worms. (line 165)
+* initial_influence: GTP command reference.
+ (line 737)
+* installation: GNU/Linux and Unix. (line 6)
+* invariant_hash: GTP command reference.
+ (line 248)
+* invariant_hash_for_moves: GTP command reference.
+ (line 255)
+* invincible worm: Worms. (line 178)
+* invoking GNU Go: Invoking GNU Go. (line 6)
+* is_legal: GTP command reference.
+ (line 217)
+* is_surrounded: GTP command reference.
+ (line 966)
+* jago: Other Clients. (line 6)
+* joseki <1>: Corner Matcher. (line 6)
+* joseki: Joseki Compiler. (line 6)
+* kgs-genmove_cleanup: GTP command reference.
+ (line 544)
+* known_command: GTP command reference.
+ (line 933)
+* komi: GTP command reference.
+ (line 97)
+* ladder_attack: GTP command reference.
+ (line 322)
+* last_move: GTP command reference.
+ (line 235)
+* level <1>: GTP command reference.
+ (line 557)
+* level: Invoking GNU Go. (line 225)
+* level of play: Invoking GNU Go. (line 25)
+* liberties (worm): Worms. (line 74)
+* liberties, higher order (worm): Worms. (line 74)
+* licence, documentation (GFDL): GFDL. (line 3)
+* licence, program (GPL): GPL. (line 3)
+* limit_search: GTP command reference.
+ (line 996)
+* list_stones: GTP command reference.
+ (line 181)
+* loadsgf: GTP command reference.
+ (line 166)
+* lunch: Dragons. (line 230)
+* lunch (worm): Worms. (line 114)
+* matchpat.c: DFA. (line 29)
+* Monte Carlo Go: Monte Carlo Go. (line 6)
+* move generation: Move Generators. (line 6)
+* move generators: Move Generators. (line 6)
+* move reasons <1>: Move Reasons. (line 6)
+* move reasons: Move Generators. (line 6)
+* move_history: GTP command reference.
+ (line 241)
+* move_influence: GTP command reference.
+ (line 776)
+* move_probabilities: GTP command reference.
+ (line 783)
+* move_uncertainty: GTP command reference.
+ (line 791)
+* moyo: Territory and Moyo. (line 6)
+* name: GTP command reference.
+ (line 47)
+* neighbor dragons: Dragons. (line 145)
+* orientation: GTP command reference.
+ (line 85)
+* origin (worm): Worms. (line 58)
+* output file: Output File. (line 6)
+* owl_attack: GTP command reference.
+ (line 340)
+* owl_attack_certain: Dragons. (line 296)
+* owl_attack_code: Dragons. (line 291)
+* owl_attack_point: Dragons. (line 286)
+* owl_connection_defends: GTP command reference.
+ (line 378)
+* owl_defend: GTP command reference.
+ (line 346)
+* owl_defense_certain: Dragons. (line 314)
+* owl_defense_code: Dragons. (line 309)
+* owl_defense_point: Dragons. (line 305)
+* owl_does_attack: GTP command reference.
+ (line 366)
+* owl_does_defend: GTP command reference.
+ (line 372)
+* owl_second_attack_point: Dragons. (line 301)
+* owl_second_defense_point: Dragons. (line 319)
+* owl_substantial: GTP command reference.
+ (line 393)
+* owl_threaten_attack: GTP command reference.
+ (line 352)
+* owl_threaten_defense: GTP command reference.
+ (line 359)
+* pattern attributes: Pattern Classification.
+ (line 6)
+* pattern database <1>: DFA. (line 29)
+* pattern database: Patterns Overview. (line 6)
+* pattern matching <1>: DFA. (line 29)
+* pattern matching: Patterns Overview. (line 6)
+* pattern matching optimization: Details. (line 6)
+* pattern overview: Patterns Overview. (line 6)
+* pattern.c: Patterns Overview. (line 6)
+* pattern.h: Patterns Overview. (line 6)
+* persistent cache: Persistent Cache. (line 6)
+* place_free_handicap: GTP command reference.
+ (line 143)
+* play: GTP command reference.
+ (line 127)
+* playwhite: GTP command reference.
+ (line 119)
+* popgo: GTP command reference.
+ (line 277)
+* position: Hash Calculation. (line 10)
+* position struct: Basic Data Structures.
+ (line 6)
+* potential cutting stone: Worms. (line 133)
+* printsgf: GTP command reference.
+ (line 899)
+* product: DFA. (line 29)
+* protocol_version: GTP command reference.
+ (line 39)
+* qGo: Other Clients. (line 6)
+* quarry: Other Clients. (line 6)
+* query_boardsize: GTP command reference.
+ (line 71)
+* query_orientation: GTP command reference.
+ (line 91)
+* quit: GTP command reference.
+ (line 33)
+* Read result: Hash Organization. (line 8)
+* Reading code: Tactical Reading. (line 6)
+* Reading code debugging tools: Debugging. (line 6)
+* reading DEPTH: Tactical Reading. (line 6)
+* Reading optimisation: Hashing. (line 6)
+* Reading process: Tactical Reading. (line 6)
+* reading return codes: Reading Basics. (line 51)
+* reading shadow: Persistent Cache. (line 50)
+* reading.c <1>: Reading Basics. (line 122)
+* reading.c: Tactical Reading. (line 6)
+* reading.h: Tactical Reading. (line 6)
+* reg_genmove: GTP command reference.
+ (line 521)
+* report_uncertainty: GTP command reference.
+ (line 941)
+* reset_connection_node_counter: GTP command reference.
+ (line 691)
+* reset_life_node_counter: GTP command reference.
+ (line 637)
+* reset_owl_node_counter: GTP command reference.
+ (line 655)
+* reset_reading_node_counter: GTP command reference.
+ (line 667)
+* reset_search_mask: GTP command reference.
+ (line 990)
+* reset_trymove_counter: GTP command reference.
+ (line 679)
+* restricted_genmove: GTP command reference.
+ (line 537)
+* return codes: Reading Basics. (line 51)
+* same_dragon: GTP command reference.
+ (line 464)
+* scoring: Scoring. (line 6)
+* semeai: Dragons. (line 254)
+* semeai_attack_certain: Dragons. (line 254)
+* semeai_attack_point: Dragons. (line 254)
+* semeai_defense_certain: Dragons. (line 254)
+* semeai_defense_point: Dragons. (line 254)
+* set_free_handicap: GTP command reference.
+ (line 152)
+* set_random_seed: GTP command reference.
+ (line 954)
+* set_search_diamond: GTP command reference.
+ (line 984)
+* set_search_limit: GTP command reference.
+ (line 1002)
+* SGF (Smart Game Format): SGF Support. (line 6)
+* SGF files in memory: SGF. (line 6)
+* shape attributes: Pattern Classification.
+ (line 6)
+* showboard: GTP command reference.
+ (line 723)
+* Smart Game Format: SGF Support. (line 6)
+* Speedup of reading process: Hashing. (line 6)
+* start_sgftrace: GTP command reference.
+ (line 879)
+* string: Worms and Dragons. (line 27)
+* superstring: General Utilities. (line 249)
+* surround: Dragons. (line 238)
+* surround_map: GTP command reference.
+ (line 979)
+* surround_size: Dragons. (line 238)
+* surround_status: Dragons. (line 238)
+* symmetry and transformations: Symmetry & transformations.
+ (line 6)
+* symmetry and transformations of shapes: Symmetry & transformations.
+ (line 6)
+* tactical_analyze_semeai: GTP command reference.
+ (line 413)
+* teaching josekis to GNU Go: Joseki Compiler. (line 6)
+* territory: Territory and Moyo. (line 6)
+* test_eyeshape: GTP command reference.
+ (line 704)
+* The Go Modem Protocol and Go Text Protocol: GMP and GTP. (line 6)
+* the joseki compiler: Joseki Compiler. (line 6)
+* time_left: GTP command reference.
+ (line 583)
+* time_settings: GTP command reference.
+ (line 576)
+* timers: General Utilities. (line 328)
+* traces: Traces. (line 6)
+* Transposition table: Hashing. (line 6)
+* Trying hypothetical moves: Tactical Reading. (line 6)
+* tryko: GTP command reference.
+ (line 270)
+* trymove: GTP command reference.
+ (line 264)
+* tune_move_ordering: GTP command reference.
+ (line 906)
+* tuning GNU Go: Traces. (line 6)
+* tuning the pattern database: Tuning. (line 6)
+* tuning the shapes database: Tuning. (line 6)
+* UCT algorithm: Monte Carlo Go. (line 6)
+* unconditional_status: GTP command reference.
+ (line 470)
+* undo: GTP command reference.
+ (line 564)
+* Usage of the stack in reading: Tactical Reading. (line 6)
+* version: GTP command reference.
+ (line 55)
+* weakness: Dragons. (line 199)
+* worm <1>: Worms. (line 6)
+* worm: Worms and Dragons. (line 27)
+* worm_cutstone: GTP command reference.
+ (line 847)
+* worm_data: GTP command reference.
+ (line 806)
+* worm_stones: GTP command reference.
+ (line 841)
+* Zobrist hashing algorithm: Hashing. (line 6)
+
diff --git a/gnugo/src/doc/gnugo.info-3 b/gnugo/src/doc/gnugo.info-3
new file mode 100644
index 0000000000000000000000000000000000000000..d48989866463898aedd0d5e13df4b9319747e119
Binary files /dev/null and b/gnugo/src/doc/gnugo.info-3 differ
diff --git a/gnugo/src/doc/gnugo.pod b/gnugo/src/doc/gnugo.pod
new file mode 100644
index 0000000000000000000000000000000000000000..76e219fed55f93ae7a156fd11c0b729b06ea7ede
--- /dev/null
+++ b/gnugo/src/doc/gnugo.pod
@@ -0,0 +1,263 @@
+
+=head1 NAME
+
+gnugo - The GNU program to play the game of Go
+
+=head1 SYNOPSIS
+
+B
+[B<--boardsize >]
+[B<--color >]
+[B<--handicap >]
+[B<--komi >]
+[B<--quiet>]
+[B<-v, --version>]
+[B<-h, --help>]
+[B<--help debug>]
+[B<--copyright>]
+[B<--mode >]
+[B<--replay >]
+[B<-l, --infile >]
+[B<-L, --until >]
+[B<-o, --outfile >]
+[B<--printsgf >]
+[B<-D, --depth >]
+[B<-B, --backfill_depth >]
+[B<--score [estimate|finish|aftermath]> ]
+[B<-a, --allpats>]
+[B<-T, --printboard>]
+[B<-d, --debug >]
+[B<-w, --worms>]
+[B<-m, --moyo >]
+[B<-b, --benchmark num>]
+[B<-t, --trace>]
+[B<-r, --seed num>]
+
+=head1 DESCRIPTION
+
+GNU Go plays a game of Go against the user. It has many other features: it
+can play against itself or another program, analyse and score a recorded
+game. GNU Go is compliant with Go modem protocol, load and save game in
+the Smart Game format.
+
+GNU Go default is a simple alpha-numeric board display, but you can use
+a client such as B.
+
+=head2 The game of Go
+
+Go is a game of strategy between two players usually played on a
+19x19 grid called B. The two players put black and white B on
+the goban to enclose B. Go was invented about 4000 years ago in
+ancient China. Other names for this game are (Chinese) B, (Korean)
+B and (Ing) B.
+
+=head2 Playing a game in ASCII mode
+
+To start a game with default options, just invoke "gnugo". The board will be
+drawn at your terminal using ASCII letters. In this mode, you can get help on
+available commands by the B key. To play as Black with 4 stones handicap,
+with a 0.5 komi, recording the game in the file record.sgf:
+
+ gnugo --color black --handicap 4 --komi 0.5 -o record.sgf
+
+=head2 Playing a game with CGoban
+
+CGoban is a general purpose client program by Bill Shubert for
+playing Go. It runs under X Window System with a beautiful resizeable
+graphic display. To use GNU Go under X Window System, obtain the
+most recent version of CGoban from Bill Shubert's web site
+
+http://www.igoweb.org/~wms/comp/cgoban/index.html
+
+Start CGoban. When the CGoban Control panel comes up, select `Go Modem.'
+You will get the Go Modem Protocol Setup. Choose one (or both) of the
+players to be ``Program,'' and fill out the box to the path to
+gnugo. After clicking OK, you get the Game Setup window. Choose
+``Rules Set'' to be Japanese (otherwise handicaps won't work). Set the
+board size and handicap if you want. Click OK and you are ready to go.
+
+In the Go Modem Protocol Setup window, when you specify the path
+to GNU Go, you can give it command line options, such as --quiet
+to suppress most messages. Since the Go Modem Protocol preempts
+standard I/O, other messages are sent to stderr, even if they are
+not error messages. These will appear in the terminal from which
+you started CGoban.
+
+=head2 Scoring system
+
+The game stops when both players pass. GNU Go will attempt to
+compute and report the score to you. It may occasionally make
+mistakes due to wrong evaluation of the status of a group. You
+can check the score as follows. In ASCII mode, at the end of
+the game, stones believed dead are marked in lower case letters,
+and you have the option of toggling their status before counting.
+Using CGoban, you may use CGoban's counting facility to count
+the game using either Japanese or Chinese rules.
+
+=head2 Viewing a stored game
+
+gnugo B<-l> filename.sgf --mode ascii
+
+loads filename.sgf and lets you navigate through the game by using the
+commands I, I, I and I.
+It is not possible to navigate through variations in ascii mode.
+You may also use CGoban to view stored games. CGoban can navigate
+variations.
+
+=head2 Documentation
+
+The files in the F directory contain detailed documentation about
+debugging options and internal program structure. Other documentation may
+be found in comments throughout the source code.
+
+=head2 Go Modem Protocol
+
+The Go Modem Protocol is a standard interface between Go programs and
+graphical display.
+
+The Go Modem Protocol was developed by Bruce Wilcox with input from
+David Fotland, Anders Kierulf and others. Any Go program *should*
+use this protocol since it is standard. Since CGoban supports this
+protocol, the user interface for any Go program can be done
+entirely through CGoban. Using the Go Modem Protocol, you can play
+with another computer running a different program (even on a
+different operating system) using a modem, a serial cable or over
+the internet if the other program also supports the protocol. You
+can also communicate with the Go servers using CGoban.
+
+=head2 Smart Game Format
+
+Games (with comments, variations and other features) can be
+stored in the Smart Game Format (SGF). This format originated in
+Anders Kierulf's program Smart Go. Martin Muller and Arno
+Hollosi developed the current standard, which may be found
+at
+
+http://www.red-bean.com/sgf/
+
+GNU Go supports the Smart Game Format.
+
+=head1 OPTIONS
+
+=head2 Main options
+
+B<--mode I>
+
+force the playing mode (I, I or I). Default is
+ASCII. If no terminal is detected GMP (Go Modem Protocol) will be assumed.
+
+B<--replay I>
+
+replay the game generating moves for color, where color is I,
+I, or I. (requires B<-l>)
+
+B<--quiet>
+
+Don't print copyright and other informational messages.
+
+B<-l, --infile I>
+
+Load the SGF file (to score or analyze a recorded game).
+
+B<-L, --until I>
+
+Stop loading just before I is played (e.g. 154 or L10).
+
+B<-o, --outfile I>
+
+Save the played game to I in SGF format.
+
+=head2 Game Options:
+
+B<--boardsize I>
+
+Set the board size to use (1-19). Default is 19, other common formats are
+13 and 9.
+
+B<--color I>
+
+Choose your color (I or I). Black plays first, White gets
+the komi compensation.
+
+B<--handicap I