By Arend Bayer, Daniel Bump, Evan Berggren Daniel, David Denholm
Total Page:16
File Type:pdf, Size:1020Kb
Documentation for the GNU Go Project Edition 3.8 July, 2003 By Arend Bayer, Daniel Bump, Evan Berggren Daniel, David Denholm, Jerome Dumonteil, Gunnar Farneb¨ack, Paul Pogonyshev, Thomas Traber, Tanguy Urvoy, Inge Wallin GNU Go 3.8 Copyright c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 and 2008 Free Software Foundation, Inc. This is Edition 3.8 of The GNU Go Project documentation, for the 3.8 version of the GNU Go program. Published by the Free Software Foundation Inc 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA Tel: 617-542-5942 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 (see Section A.5 [GFDL], page 218, 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 (see Section A.1 [GPL], page 207, version 3 or any later version) are respected. i Table of Contents ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1 Introduction::::::::::::::::::::::::::::::::::::: 2 1.1 About GNU Go and this Manual ::::::::::::::::::::::::::::::: 2 1.2 Copyrights ::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 1.3 Authors :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 1.4 Thanks :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 1.5 Development ::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2 Installation :::::::::::::::::::::::::::::::::::::: 5 2.1 GNU/Linux and Unix :::::::::::::::::::::::::::::::::::::::::: 5 2.2 Configure Options:::::::::::::::::::::::::::::::::::::::::::::: 5 2.2.1 Ram Cache ::::::::::::::::::::::::::::::::::::::::::::::: 6 2.2.2 Default Level:::::::::::::::::::::::::::::::::::::::::::::: 6 2.2.3 Other Options::::::::::::::::::::::::::::::::::::::::::::: 6 2.3 Compiling GNU Go on Microsoft platforms ::::::::::::::::::::: 7 2.3.1 Windows 95/98, MS-DOS and Windows 3.x using DJGPP :: 8 2.3.2 Windows NT, 2000, XP, 95/98/ME using Cygwin:::::::::: 8 2.3.3 Windows NT, 2000, XP, 95/98/ME using MinGW32 ::::::: 9 2.3.4 Windows NT, Windows 95/98 using Visual C and project files ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.3.5 Running GNU Go on Windows NT and Windows 95/98 :: 10 2.4 Macintosh :::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3 Using GNU Go :::::::::::::::::::::::::::::::: 11 3.1 Getting Documentation ::::::::::::::::::::::::::::::::::::::: 11 3.2 Running GNU Go via CGoban :::::::::::::::::::::::::::::::: 11 3.3 Other Clients ::::::::::::::::::::::::::::::::::::::::::::::::: 12 3.4 Ascii Interface :::::::::::::::::::::::::::::::::::::::::::::::: 13 3.5 GNU Go mode in Emacs :::::::::::::::::::::::::::::::::::::: 13 3.6 The Go Modem Protocol and Go Text Protocol ::::::::::::::: 13 3.7 Computer Go Tournaments ::::::::::::::::::::::::::::::::::: 14 3.8 Smart Game Format :::::::::::::::::::::::::::::::::::::::::: 14 3.9 Invoking GNU Go: Command line options::::::::::::::::::::: 14 3.9.1 Some basic options ::::::::::::::::::::::::::::::::::::::: 14 3.9.2 Monte Carlo Options ::::::::::::::::::::::::::::::::::::: 15 3.9.3 Other general options :::::::::::::::::::::::::::::::::::: 16 3.9.4 Other options affecting strength and speed:::::::::::::::: 17 3.9.5 Ascii mode options ::::::::::::::::::::::::::::::::::::::: 19 3.9.6 Development options ::::::::::::::::::::::::::::::::::::: 19 3.9.7 Experimental options::::::::::::::::::::::::::::::::::::: 23 ii 4 GNU Go engine overview::::::::::::::::::::: 24 4.1 Gathering Information :::::::::::::::::::::::::::::::::::::::: 24 4.2 Move Generators :::::::::::::::::::::::::::::::::::::::::::::: 25 4.3 Move Valuation ::::::::::::::::::::::::::::::::::::::::::::::: 26 4.4 Detailed Sequence of Events ::::::::::::::::::::::::::::::::::: 27 4.5 Roadmap ::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 4.5.1 Files in `engine/' :::::::::::::::::::::::::::::::::::::::: 29 4.5.2 Files in `patterns/' :::::::::::::::::::::::::::::::::::::: 32 4.6 Coding styles and conventions ::::::::::::::::::::::::::::::::: 34 4.6.1 Coding Conventions :::::::::::::::::::::::::::::::::::::: 34 4.6.2 Tracing :::::::::::::::::::::::::::::::::::::::::::::::::: 34 4.6.3 Assertions:::::::::::::::::::::::::::::::::::::::::::::::: 35 4.6.4 FIXME :::::::::::::::::::::::::::::::::::::::::::::::::: 35 4.7 Navigating the Source ::::::::::::::::::::::::::::::::::::::::: 35 5 Analyzing GNU Go's moves :::::::::::::::::: 36 5.1 Interpreting Traces:::::::::::::::::::::::::::::::::::::::::::: 36 5.2 The Output File :::::::::::::::::::::::::::::::::::::::::::::: 36 5.3 Checking the reading code :::::::::::::::::::::::::::::::::::: 36 5.4 Checking the Owl Code ::::::::::::::::::::::::::::::::::::::: 37 5.5 GTP and GDB techniques :::::::::::::::::::::::::::::::::::: 38 5.6 Debugging on a Graphical Board :::::::::::::::::::::::::::::: 38 5.7 Scoring the game:::::::::::::::::::::::::::::::::::::::::::::: 38 5.8 Colored Display ::::::::::::::::::::::::::::::::::::::::::::::: 38 5.8.1 Dragon Display :::::::::::::::::::::::::::::::::::::::::: 38 5.8.2 Eye Space Display:::::::::::::::::::::::::::::::::::::::: 39 6 Move generation ::::::::::::::::::::::::::::::: 40 6.1 Introduction :::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.2 Generation of move reasons ::::::::::::::::::::::::::::::::::: 40 6.3 Detailed Descriptions of various Move Reasons :::::::::::::::: 42 6.3.1 Attacking and defending moves ::::::::::::::::::::::::::: 42 6.3.2 Threats to Attack or Defend:::::::::::::::::::::::::::::: 42 6.3.3 Multiple attack or defense moves ::::::::::::::::::::::::: 42 6.3.4 Cutting and connecting moves :::::::::::::::::::::::::::: 42 6.3.5 Semeai winning moves:::::::::::::::::::::::::::::::::::: 43 6.3.6 Making or destroying eyes :::::::::::::::::::::::::::::::: 43 6.3.7 Antisuji moves ::::::::::::::::::::::::::::::::::::::::::: 43 6.3.8 Territorial moves ::::::::::::::::::::::::::::::::::::::::: 43 6.3.9 Attacking and Defending Dragons :::::::::::::::::::::::: 43 6.3.10 Combination Attacks:::::::::::::::::::::::::::::::::::: 44 6.4 Valuation of suggested moves:::::::::::::::::::::::::::::::::: 44 6.4.1 Territorial Value ::::::::::::::::::::::::::::::::::::::::: 45 6.4.2 Strategical Value ::::::::::::::::::::::::::::::::::::::::: 45 6.4.3 Shape Factor ::::::::::::::::::::::::::::::::::::::::::::: 45 6.4.4 Minimum Value :::::::::::::::::::::::::::::::::::::::::: 45 6.4.5 Secondary Value ::::::::::::::::::::::::::::::::::::::::: 46 iii 6.4.6 Threats and Followup Value :::::::::::::::::::::::::::::: 46 6.5 End Game :::::::::::::::::::::::::::::::::::::::::::::::::::: 46 7 Worms and Dragons :::::::::::::::::::::::::: 47 7.1 Worms:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 7.2 Amalgamation :::::::::::::::::::::::::::::::::::::::::::::::: 51 7.3 Connection ::::::::::::::::::::::::::::::::::::::::::::::::::: 52 7.4 Half Eyes and False Eyes :::::::::::::::::::::::::::::::::::::: 53 7.5 Dragons :::::::::::::::::::::::::::::::::::::::::::::::::::::: 54 7.6 Colored Dragon Display ::::::::::::::::::::::::::::::::::::::: 59 8 Eyes and Half Eyes :::::::::::::::::::::::::::: 60 8.1 Local games :::::::::::::::::::::::::::::::::::::::::::::::::: 60 8.2 Eye spaces :::::::::::::::::::::::::::::::::::::::::::::::::::: 60 8.3 The eyespace as local game:::::::::::::::::::::::::::::::::::: 61 8.4 An example ::::::::::::::::::::::::::::::::::::::::::::::::::: 63 8.5 Graphs ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 64 8.6 Eye shape analysis :::::::::::::::::::::::::::::::::::::::::::: 65 8.7 Eye Local Game Values ::::::::::::::::::::::::::::::::::::::: 66 8.8 Topology of Half Eyes and False Eyes ::::::::::::::::::::::::: 67 8.9 Eye Topology with Ko :::::::::::::::::::::::::::::::::::::::: 68 8.10 False Margins :::::::::::::::::::::::::::::::::::::::::::::::: 72 8.11 Functions in `optics.c' :::::::::::::::::::::::::::::::::::::: 72 9 The Pattern Code ::::::::::::::::::::::::::::: 77 9.1 Overview ::::::::::::::::::::::::::::::::::::::::::::::::::::: 77 9.2 Pattern Attributes :::::::::::::::::::::::::::::::::::::::::::: 78 9.2.1 Constraint Pattern Attributes :::::::::::::::::::::::::::: 78 9.2.2 Action Attributes :::::::::::::::::::::::::::::::::::::::: 79 9.3 Pattern Attributes :::::::::::::::::::::::::::::::::::::::::::: 80 9.4 Helper Functions :::::::::::::::::::::::::::::::::::::::::::::: 81 9.5 Autohelpers and Constraints :::::::::::::::::::::::::::::::::: 82 9.6 Autohelper Actions ::::::::::::::::::::::::::::::::::::::::::: 83 9.7 Autohelper Functions ::::::::::::::::::::::::::::::::::::::::: 84 9.8 Attack and Defense Database ::::::::::::::::::::::::::::::::: 90 9.9 The Connections Database :::::::::::::::::::::::::::::::::::: 90 9.10 Connections Functions ::::::::::::::::::::::::::::::::::::::: 92 9.11 Tuning the Pattern databases :::::::::::::::::::::::::::::::: 92 9.12 Implementation :::::::::::::::::::::::::::::::::::::::::::::: 95 9.13 Symmetry and transformations::::::::::::::::::::::::::::::: 95 9.14 Implementation Details :::::::::::::::::::::::::::::::::::::: 96 9.15 The \Grid" Optimization :::::::::::::::::::::::::::::::::::: 97 9.16 The Joseki Compiler ::::::::::::::::::::::::::::::::::::::::: 98 9.17 Ladders in Joseki :::::::::::::::::::::::::::::::::::::::::::: 99 9.18 Corner Matcher::::::::::::::::::::::::::::::::::::::::::::: 100 9.19 Emacs Mode for Editing Patterns ::::::::::::::::::::::::::: 102 iv 10 The DFA pattern matcher ::::::::::::::::: 103 10.1