Ticket #148: cleanup2.patch

File cleanup2.patch, 63.4 kB (added by draqo, 17 months ago)

big cleanup

  • config.vcin

    diff -N -r -u -X .ignore gnugo-copy/config.vcin gnugo/config.vcin
    old new  
    3030/* GAIN/LOSS codes. Disabled by default. */ 
    3131#define EXPERIMENTAL_OWL_EXT 0 
    3232 
     33/* Disable unneeded things. 0 standard. */ 
     34#define FINAL_RELEASE 0 
     35 
    3336/* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode 
    3437   */ 
    3538#define GRID_OPT 1 
  • doc/dfa.texi

    diff -N -r -u -X .ignore gnugo-copy/doc/dfa.texi gnugo/doc/dfa.texi
    old new  
    11In this chapter, we describe the principles of the GNU Go DFA 
    22pattern matcher.  The aim of this system is to permit a fast 
    3 pattern matching when it becomes time critical like in owl 
    4 module (@ref{The Owl Code}). Since GNU Go 3.2, this is enabled 
     3pattern matching. Since GNU Go 3.2, this is enabled 
    54by default. You can still get back the traditional pattern matcher 
    65by running @command{configure --disable-dfa} and then recompiling 
    76GNU Go.  
  • doc/dragon.texi

    diff -N -r -u -X .ignore gnugo-copy/doc/dragon.texi gnugo/doc/dragon.texi
    old new  
    1717Later routines called by @code{genmove()} will then have access to this 
    1818information. This document attempts to explain the philosophy and 
    1919algorithms of this preliminary analysis, which is carried out by the 
    20 two routines @code{make_worm()} and @code{make_dragon()} in  
    21 @file{dragon.c}. 
     20two routines @code{make_worms()} (in @file{worm.c}) and 
     21@code{make_dragons()} (in @file{dragon.c}). 
    2222 
    2323@cindex dragon 
    2424@cindex worm 
     
    8383  int unconditional_status; 
    8484  int attack_points[MAX_TACTICAL_POINTS]; 
    8585  int attack_codes[MAX_TACTICAL_POINTS]; 
     86  int discarded_attacks[MAX_TACTICAL_POINTS]; 
    8687  int defense_points[MAX_TACTICAL_POINTS]; 
    8788  int defend_codes[MAX_TACTICAL_POINTS]; 
     89  int discarded_defenses[MAX_TACTICAL_POINTS]; 
    8890  int attack_threat_points[MAX_TACTICAL_POINTS]; 
    89   int attack_threat_codes[MAX_TACTICAL_POINTS];  
     91  int attack_threat_codes[MAX_TACTICAL_POINTS]; 
     92  int discarded_att_threats[MAX_TACTICAL_POINTS]; 
    9093  int defense_threat_points[MAX_TACTICAL_POINTS]; 
    9194  int defense_threat_codes[MAX_TACTICAL_POINTS]; 
     95  int discarded_def_threats[MAX_TACTICAL_POINTS]; 
    9296@}; 
    9397@end example 
    9498 
     
    109113other worm. Intersections that are shared are counted with equal 
    110114fractional values for each worm. This measures the direct territorial 
    111115value of capturing a worm. @dfn{effective_size} is a floating point number. 
    112 Only intersections at a distance of 4 or less are counted. 
     116Only intersections at a distance (empty vertices between a worm and an 
     117intersection) of 5 or less are counted. 
    113118@end quotation 
    114119@item @code{origin} 
    115120@quotation 
     
    220225@end quotation 
    221226@item @code{cutstone2}  
    222227@quotation 
    223 Cutting points are identified by the patterns in the connections 
    224 database. Proper cuts are handled by the fact that attacking and 
     228Number of potential cuts involving the worm. Cutting points are 
     229identified by the patterns in the connections database. Proper 
     230cuts are handled by the fact that attacking and 
    225231defending moves also count as moves cutting or connecting the 
    226232surrounding dragons.  The @code{cutstone2} field is set during  
    227233@code{find_cuts()}, called from @code{make_domains()}. 
     
    248254opposite color can be killed. More precisely an 
    249255@dfn{inessential string} is a string S of genus zero, 
    250256not adjacent to any opponent string which can be easily 
    251 captured, and which has no edge liberties or second 
     257captured, which is not cutstone, and which has up to 
     2582 edge liberties and no second 
    252259order liberties, and which satisfies the following 
    253260further property: If the string is removed from the 
    254261board, then the remaining cavity only borders worms of the 
     
    266273even if the opponent is allowed an arbitrary number of consecutive 
    267274moves. 
    268275@end quotation 
    269 @item unconditional_status 
     276@item @code{unconditional_status} 
    270277@quotation 
    271278Unconditional status is also set by the function 
    272279@code{unconditional_life}. This is set @code{ALIVE} for stones which are 
     
    285292transformed into an invincible group by some number of consecutive 
    286293moves. Well, this is not entirely true because there is a rare class of 
    287294seki groups not satisfying this condition. Exactly which these are is 
    288 left as an exercise for the reader. Currently @code{unconditional_life}, 
    289 which strictly follows the definitions above, calls such seki groups 
    290 unconditionally dead, which of course is a misfeature. It is possible to 
    291 avoid this problem by making the algorithm slightly more complex, but 
    292 this is left for a later revision. 
     295shown in a comment in @file{unconditional.c}. 
    293296@end quotation 
    294 @item @code{int attack_points[MAX_TACTICAL_POINTS]} 
    295 @item @code{attack_codes[MAX_TACTICAL_POINTS]} 
     297@item @code{int attack_points[MAX_TACTICAL_POINTS];} 
     298@item @code{int attack_codes[MAX_TACTICAL_POINTS];} 
    296299@item @code{int defense_points[MAX_TACTICAL_POINTS];} 
    297300@item @code{int defend_codes[MAX_TACTICAL_POINTS];} 
    298301@quotation 
     
    310313@quotation 
    311314These are points that threaten to attack or defend a worm. 
    312315@end quotation 
     316@item @code{int discarded_attacks[MAX_TACTICAL_POINTS];} 
     317@item @code{int discarded_defenses[MAX_TACTICAL_POINTS];} 
     318@item @code{int discarded_att_threats[MAX_TACTICAL_POINTS];} 
     319@item @code{int discarded_def_threats[MAX_TACTICAL_POINTS];} 
     320@quotation 
     321These are checked points that haven't led to any positive result. 
     322Used to not check the same point more than once. 
     323@end quotation 
    313324@end itemize 
    314325 
    315326The function @code{makeworms()} will generate data for all worms. 
     
    343354XXX...        
    344355 
    345356@end example 
    346 @findex dragon_eye 
    347  
    348 The code for this type of amalgamation is in the routine 
    349 @code{dragon_eye()}, discussed further in EYES. 
    350357 
    351358Next, we amalgamate strings which seem uncuttable. We amalgamate dragons 
    352359which either share two or more common liberties, or share one liberty 
     
    367374@section Connection 
    368375@cindex connections 
    369376 
    370 The fields @code{black_eye.cut} and @code{white_eye.cut} are set where the 
     377The fields in @code{cutting_points} are set where the 
    371378opponent can cut, and this is done by the B (break) class patterns in 
    372 @file{conn.db}.  There are two important uses for this field, which can be 
     379@file{conn.db}.  There are two important uses for this table, which can be 
    373380accessed by the autohelper functions @code{xcut()} and @code{ocut()}. The 
    374381first use is to stop amalgamation in positions like 
    375382 
     
    534541  int safety; 
    535542  float weakness; 
    536543  float weakness_pre_owl; 
     544  float strategic_size; 
    537545  int escape_route; 
    538546  struct eyevalue genus; 
    539547  int heye; 
     
    541549  int surround_status; 
    542550  int surround_size; 
    543551  int semeais; 
    544   int semeai_margin_of_safety; 
     552  int semeai_defense_code; 
    545553  int semeai_defense_point; 
    546   int semeai_defense_certain;   
     554  int semeai_defense_certain; 
     555  int semeai_defense_target; 
     556  int semeai_attack_code; 
    547557  int semeai_attack_point; 
    548558  int semeai_attack_certain; 
     559  int semeai_attack_target; 
    549560  int owl_threat_status; 
    550561  int owl_status; 
    551562  int owl_attack_point; 
    552563  int owl_attack_code; 
    553564  int owl_attack_certain; 
     565  int owl_attack_node_count; 
    554566  int owl_second_attack_point; 
    555567  int owl_defense_point; 
    556568  int owl_defense_code; 
     
    607619@quotation 
    608620The dragon number, used as a key into the @code{dragon2} array. 
    609621@end quotation 
    610 @item origin 
     622@item @code{origin} 
    611623@cindex dragon origin 
    612624@quotation 
    613625The origin of the dragon is a unique particular vertex 
     
    616628copied to the dragon origins. Amalgamation of two dragons 
    617629amounts to changing the origin of one. 
    618630@end quotation 
    619 @item size 
     631@item @code{size} 
    620632@cindex dragon size 
    621633@quotation 
    622634The number of stones in the dragon. 
    623635@end quotation 
    624 @item effective size 
     636@item @code{effective size} 
    625637@cindex effective size 
    626638@quotation 
    627639The sum of the effective sizes of the constituent worms. 
     
    630642cardinality of the dragon plus the number of empty vertices which are 
    631643nearer this dragon than any other. 
    632644@end quotation 
    633 @item crude_status 
     645@item @code{crude_status} 
    634646@quotation 
    635647(ALIVE, DEAD, UNKNOWN, CRITICAL). An early measure of the life 
    636648potential of the dragon. It is computed before the owl code is 
    637649run and is superceded by the status as soon as that becomes 
    638650available. 
    639651@end quotation 
    640 @item status 
     652@item @code{status} 
    641653@cindex dragon status 
    642654@quotation 
    643655The dragon status is the best measure of the dragon's health. 
     
    649661Here are definitions of the fields in the @code{dragon2} array. 
    650662 
    651663@itemize @bullet 
    652 @item origin 
     664@item @code{origin} 
    653665@quotation 
    654666The origin field is duplicated here. 
    655667@end quotation 
    656 @item adjacent 
    657668@item @code{adjacent[MAX_NEIGHBOR_DRAGONS]} 
    658 @cindex neighbor dragons 
    659 @cindex adjacent dragons 
    660 @findex find_neighbor_dragons 
    661 @quotation 
    662 Dragons of either color near the given one are called @dfn{neighbors}. 
    663 They are computed by the function @code{find_neighbor_dragons()}. 
    664 The @code{dragon2.adjacent} array gives the dragon numbers of 
    665 these dragons. 
    666 @end quotation 
    667669@item @code{neighbors} 
    668670@cindex neighbor dragons 
    669671@cindex adjacent dragons 
     
    671673@quotation 
    672674Dragons of either color near the given one are called @dfn{neighbors}. 
    673675They are computed by the function @code{find_neighbor_dragons()}. 
    674 The @code{dragon2.adjacent} array gives the dragon numbers of 
    675 these dragons. 
     676The @code{adjacent} array gives the dragon numbers of 
     677these dragons and @code{neighbors} gives the number of them. 
    676678@end quotation 
    677 @item neighbors 
    678 @quotation 
    679 The number of neighbor dragons. 
    680 @end quotation 
    681 @item hostile_neighbors 
     679@item @code{hostile_neighbors} 
    682680@quotation 
    683681The number of neighbor dragons of the opposite color. 
    684682@end quotation 
    685 @item moyo_size 
    686 @item float moyo_territorial_value 
     683@item @code{moyo_size} 
     684@item @code{moyo_territorial_value} 
    687685@findex compute_surrounding_moyo_sizes 
    688686@quotation 
    689687The function @code{compute_surrounding_moyo_sizes()} assigns 
     
    691689each dragon (@pxref{Territory and Moyo}). This is the  
    692690moyo size. They are recorded in these fields. 
    693691@end quotation 
    694 @item safety 
     692@item @code{safety} 
    695693@cindex dragon safety 
    696694@quotation 
    697695The dragon safety can take on one of the values 
     
    707705@item INESSENTIAL - the dragon is unimportant (e.g. nakade stones) and dead 
    708706@end itemize 
    709707@end quotation 
    710 @item weakness 
    711 @item weakness_pre_owl 
     708@item @code{weakness} 
     709@item @code{weakness_pre_owl} 
    712710@cindex dragon weakness 
    713711@cindex weakness 
    714712@quotation 
     
    717715dragons in greater need of safety. The field @code{weakness_pre_owl} 
    718716is a preliminary computation before the owl code is run. 
    719717@end quotation 
    720 @item escape_route 
     718@item @code{strategic_size} 
     719@cindex strategic_size 
     720@quotation 
     721An effective size including weakness of neighbors. 
     722@end quotation 
     723@item @code{escape_route} 
    721724@cindex dragon escape_route 
    722725@cindex escape_route 
    723726@findex compute_escape 
     
    726729in case it cannot make two eyes locally. Documentation 
    727730may be found in @ref{Escape}. 
    728731@end quotation 
    729 @item struct eyevalue genus 
     732@item @code{genus} 
    730733@cindex dragon genus 
    731734@cindex genus 
    732735@quotation 
     
    744747 
    745748@end example 
    746749@end quotation 
    747 @item heye 
     750@item @code{heye} 
    748751@quotation 
    749752Location of a half eye attached to the dragon. 
    750753@end quotation 
    751 @item lunch 
     754@item @code{lunch} 
    752755@cindex dragon lunch 
    753756@cindex lunch 
    754757@quotation 
     
    756759can be captured. In contrast with worm lunches, a dragon 
    757760lunch must be able to defend itself. 
    758761@end quotation 
    759 @item surround_status 
    760 @item surround_size 
     762@item @code{surround_status} 
     763@item @code{surround_size} 
    761764@cindex surround_status 
    762765@cindex surround_size 
    763766@cindex surround 
     
    766769it is @dfn{surrounded}. See @ref{Surrounded Dragons} and 
    767770the comments in @file{surround.c} for more information about the 
    768771algorithm.  Used in computing the escape_route, and also callable 
    769 from patterns (currently used by CB258) 
     772from patterns 
    770773@end quotation 
    771 @item semeais 
    772 @item semeai_defense_point 
    773 @item semeai_defense_certain 
    774 @item semeai_attack_point 
    775 @item semeai_attack_certain 
    776 @cindex semeai 
     774@item @code{semeais} 
     775@item @code{semeai_defense_code} 
     776@item @code{semeai_defense_point} 
     777@item @code{semeai_defense_certain} 
     778@item @code{semeai_defense_target} 
     779@item @code{semeai_attack_code} 
     780@item @code{semeai_attack_point} 
     781@item @code{semeai_attack_certain} 
     782@item @code{semeai_attack_target} 
     783@cindex semeais 
     784@cindex semeai_defense_code 
    777785@cindex semeai_defense_point 
    778786@cindex semeai_defense_certain 
     787@cindex semeai_defense_target 
     788@cindex semeai_attack_code 
    779789@cindex semeai_attack_point 
    780790@cindex semeai_attack_certain 
     791@cindex semeai_attack_target 
    781792@quotation 
    782793If two dragons of opposite color both have the status CRITICAL 
    783794or DEAD they are in a @dfn{semeai} (capturing race), and their 
     
    785796@code{owl_analyze_semeai()} in @file{owl.c}, which attempts to 
    786797determine which is alive, which dead, or if the result is 
    787798seki, and whether it is important who moves first. The 
    788 function @file{new_semeai()} in @file{semeai.c} attempts 
     799function @code{semeai()} in @file{semeai.c} attempts 
    789800to revise the statuses and to generate move reasons based 
    790801on these results. The field @code{dragon2.semeais} is nonzero 
    791802if the dragon is an element of a semeai, and equals the 
    792803number of semeais (seldom more than one). The semeai defense 
    793804and attack points are locations the defender or attacker 
    794 must move to win the semeai. The field @code{semeai_margin_of_safety} 
    795 is intended to indicate whether the semeai is close or not 
    796 but currently this field is not maintained. The fields 
     805must move to win the semeai and the result code of these moves is 
     806also stored. In @code{semeai_defense_target} and 
     807@code{semeai_attack_target} an origin of an opponent dragon in 
     808semeai, on which the move has impact, is stored. The fields 
    797809@code{semeai_defense_certain} and @code{semeai_attack_certain} 
    798810indicate that the semeai code was able to finish analysis 
    799811without running out of nodes. 
    800812@end quotation 
    801 @item owl_status 
     813@item @code{owl_threat_status} 
     814@quotation 
     815Informs, whether the dragon has any defense or attack threats 
     816(@code{CAN_THREATEN_ATTACK} or @code{CAN_THREATEN_DEFENSE}). 
     817@end quotation 
     818@item @code{owl_status} 
    802819@quotation 
    803820This is a classification similar to @code{dragon.crude_status}, but 
    804821based on the life and death reading in @file{owl.c}. 
     
    810827@code{owl_defend()} is run, and if it can be defended it 
    811828is classified as @code{CRITICAL}, and if not, as @code{DEAD}. 
    812829@end quotation 
    813 @item owl_attack_point 
     830@item @code{owl_attack_point} 
    814831@cindex owl_attack_point 
    815832@quotation 
    816833If the dragon can be attacked this is the point to attack the dragon. 
    817834@end quotation 
    818 @item owl_attack_code 
     835@item @code{owl_attack_code} 
    819836@cindex owl_attack_code 
    820837@quotation 
    821 The owl attack code, It can be WIN, KO_A, KO_B or 0 (@pxref{Return Codes}). 
     838The owl attack code, It can be WIN, KO_A, GAIN, LOSS, 
     839KO_B or 0 (@pxref{Return Codes}). 
    822840@end quotation 
    823 @item owl_attack_certain 
     841@item @code{owl_attack_certain} 
    824842@cindex owl_attack_certain 
    825843@quotation 
    826844The owl reading is able to finish analyzing the attack 
    827845without running out of nodes. 
    828846@end quotation 
    829 @item owl_second_attack_point 
     847@item @code{owl_attack_node_count} 
     848@cindex owl_attack_node_count 
     849@quotation 
     850Number of nodes used during analyze of attack move. 
     851@end quotation 
     852@item @code{owl_second_attack_point} 
    830853@cindex owl_second_attack_point 
    831854@quotation 
    832855A second attack point. 
    833856@end quotation 
    834 @item owl_defense_point 
     857@item @code{owl_defense_point} 
    835858@cindex owl_defense_point 
    836859@quotation 
    837860If the dragon can be defended, this is the place to play. 
    838861@end quotation 
    839 @item owl_defense_code 
     862@item @code{owl_defense_code} 
    840863@cindex owl_defense_code 
    841864@quotation 
    842 The owl defense code, It can be WIN, KO_A, KO_B or 0 (@pxref{Return Codes}). 
     865The owl defense code, It can be WIN, KO_A, GAIN, LOSS, 
     866KO_B or 0 (@pxref{Return Codes}). 
    843867@end quotation 
    844 @item owl_defense_certain 
     868@item @code{owl_defense_certain} 
    845869@cindex owl_defense_certain 
    846870@quotation 
    847871The owl code is able to finish analyzing the defense without 
    848872running out of nodes. 
    849873@end quotation 
    850 @item owl_second_defense_point 
     874@item @code{owl_second_defense_point} 
    851875@cindex owl_second_defense_point 
    852876@quotation 
    853877A second owl defense point. 
    854878@end quotation 
     879@item @code{owl_attack_kworm} 
     880@cindex owl_attack_kworm 
     881@quotation 
     882Position of a worm, which can be killed during attack on the dragon 
     883(@code{owl_attack_code} has to be @code{GAIN}). 
     884@end quotation 
     885@item @code{owl_defense_kworm} 
     886@cindex owl_defense_kworm 
     887@quotation 
     888Position of our worm (part of the dragon) abandoned during defense of 
     889the dragon (@code{owl_defend_code} has to be @code{LOSS}). 
     890@end quotation 
    855891@end itemize 
    856892 
    857893@node Dragons in Color 
  • doc/move_generation.texi

    diff -N -r -u -X .ignore gnugo-copy/doc/move_generation.texi gnugo/doc/move_generation.texi
    old new  
    214214the simultaneous attack of one worm and the defense of another. As for 
    215215attack and defense moves, it's important that all moves which win a 
    216216semeai are found, so an informed choice can be made between them. 
     217Semeai move reasons are set by the semeai module. 
     218 
     219One might also wish to list moves which increase the lead in a semeai 
     220race (removes ko threats) for use as secondary move reasons. Analogously, 
     221if we are behind in the race. However this has not been implemented yet. 
    217222 
    218 Semeai move reasons should be set by the semeai module. However this 
    219 has not been implemented yet. One might also wish to list moves 
    220 which increase the lead in a semeai race (removes ko threats) for use 
    221 as secondary move reasons. Analogously if we are behind in the race. 
    222223 
    223224@node  Making eyes 
    224225@subsection Making or destroying eyes 
     
    229230will be valued substantially higher if this is the case. As usual it's 
    230231important to find all moves that change the eye count. 
    231232 
    232 (This is part of what eye_finder was doing. Currently it only finds 
    233 one vital point for each unstable eye space.) 
     233The eye module (@file{optics.c}) is handling this. It uses eyes patterns 
     234database @file{patterns/eyes.db}. 
    234235 
    235236@node  Antisuji moves 
    236237@subsection Antisuji moves 
     
    247248territory move reason. That move reason is added by the @samp{e} 
    248249patterns in @file{patterns/patterns.db}. Similarly the @samp{E} patterns 
    249250attempt to generate or mitigate a moyo, which is a region of influence 
    250 not yet secure territory, yet valuable. Such a pattern sets the ``expand 
    251 moyo'' move reason. 
     251not yet secure territory, yet valuable. There are also other patterns for 
     252reducing territory, invasions and making bariers (to defend before 
     253invasions) - they are in @file{patterns/influence.db} and 
     254@file{patterns/barriers.db}. These patterns set the ``expand moyo'', 
     255``expand territory'' and ``invasion'' move reasons. They also have 
     256influence on a move territorial valuation. 
    252257 
    253258@node Owl attack and defense 
    254259@subsection Attacking and Defending Dragons 
     
    310315as explained for example in @emph{The Endgame} by Ogawa 
    311316and Davies. 
    312317 
    313 Moves are valued with respect to four different criteria. These are 
     318Moves are valued with respect to four different main criteria. These 
     319are 
    314320 
    315321@itemize @bullet 
    316322@item territorial value 
     
    362368* Minimum Value::                 Minimum value 
    363369* Secondary Value::               Other, more indirect, gains from a move 
    364370* Threats and Followup Value::    Valuation of attack and defense threats 
     371* Additional ko value::    Additional threat value for a ko fight 
    365372@end menu 
    366373 
    367374@node Territorial value 
     
    384391 
    385392@node Strategical value 
    386393@subsection Strategical Value 
     394@findex estimate_strategical_value 
    387395 
    388396Strategical defense or attack reasons are assigned to any move 
    389397which matches a pattern of type @samp{a} or @samp{d}. These are 
     
    394402to check its status or safety. This is done later, during 
    395403the valuation phase. 
    396404 
     405The whole algorithm is placed in @code{estimate_strategical_value}. 
     406 
    397407@node Shape factor 
    398408@subsection Shape Factor 
    399409 
     
    451461which we cannot legally take, then such a move becomes attractive as a ko 
    452462threat and the full followup value is taken into account. 
    453463 
     464@node Additional ko value 
     465@subsection Additional ko value 
     466 
     467Some moves give us additional threats and some give them to an opponent. 
     468In such situations we should give some bonus or penalty for creating ko 
     469threats. As for now only positive contribution is counted. 
     470 
    454471@node End Game 
    455472@section End Game 
    456473 
  • doc/patterns.texi

    diff -N -r -u -X .ignore gnugo-copy/doc/patterns.texi gnugo/doc/patterns.texi
    old new  
    8585Elements are not generated for @samp{?} markers, but they are not 
    8686completely ignored - see below. 
    8787         
    88 The line beginning @samp{:} describes various attributes of the pattern, such 
    89 as its symmetry and its class. Optionally, a function called a 
    90 ``helper'' can be provided to assist the matcher in deciding whether 
    91 to accept move. Most patterns do not require a helper, and this field 
    92 is filled with NULL. 
    93  
    9488@findex shapes_callback 
    9589The matcher in @file{matchpat.c} searches the board for places where this 
    9690layout appears on the board, and the callback function 
     
    10094After the pattern, there is some supplementary information in the format: 
    10195@example 
    10296 
    103   :trfno, classification, [values], helper_function 
     97  :trfno, attributes, [values], helper_function 
    10498 
    10599@end example 
    106100 
     
    110104represents the axis of symmetry. (E.g. @samp{|} means symmetrical about a 
    111105vertical axis.) 
    112106 
     107@code{helper_function} is a function that can be provided to assist the matcher 
     108in deciding whether to accept move. Most patterns do not require a helper, 
     109and this field is filled with NULL. 
     110 
    113111The above pattern could equally well be written on the left edge: 
    114112 
    115113@example 
     
    127125way, or for that matter, on the top or right edges, or in any 
    128126of the four corners. As a matter of convention all the edge patterns  
    129127in @file{patterns.db} are written on the bottom edge or in the lower left 
    130 corners. In the @file{patterns/} directory there is a program called 
    131 @code{transpat} which can rotate or otherwise transpose patterns. 
    132 This program is not built by default---if you think you need it, 
    133 @code{make transpat} in the @file{patterns/} directory and 
    134 consult the usage remarks at the beginning of @file{patterns/transpat.c}. 
     128corners. 
    135129 
    136130@node  Pattern Classification 
    137131@section Pattern Attributes 
     
    415409need to remove the stones we placed from the reading stack. This is done 
    416410with the function @code{popgo()}. 
    417411 
     412IMPORTANT: The macro @code{OFFSET} is not used anymore, because it has 
     413fixed coordinates and patterns can be now rotated randomly by DFA 
     414optimizer. All helpers that require usage of this macro have to be moved 
     415to autohelpers. 
     416 
    418417@node  Autohelpers and Constraints 
    419418@section Autohelpers and Constraints 
    420419 
     
    566565The autohelper functions are translated into C code by the program in 
    567566@file{mkpat.c}. To see exactly how the functions are implemented, 
    568567consult the autohelper function definitions in that file. Autohelper 
    569 functions can be used in both constraint and action lines. 
     568functions can be used in both constraint and action lines. Here is 
     569a partial list of them: 
    570570 
    571571@example 
    572572 
     
    10631063 
    10641064The patterns in @file{conn.db} are used for helping @code{make_dragons()} 
    10651065amalgamate worms into dragons and to some extent for modifying eye spaces. 
    1066 The patterns in this database use the classifications @samp{B},  
    1067 @samp{C}, and @samp{e}. @samp{B} patterns are used for finding cutting points, 
     1066The patterns in this database use the classifications @samp{B} and  
     1067@samp{C}. @samp{B} patterns are used for finding cutting points, 
    10681068where amalgamation should not be performed, @samp{C} patterns are used for 
    1069 finding existing connections, over which amalgamation is to be done, and  
    1070 @samp{e} patterns are used for modifying eye spaces and reevaluating lunches. 
     1069finding existing connections, over which amalgamation is to be done. 
    10711070There are also some patterns without classification, which use action lines to 
    10721071have an impact. These are matched together with the @samp{C} patterns. Further 
    10731072details and examples can be found in @xref{Worms and Dragons}. 
     
    11811180@findex find_connections 
    11821181@quotation  
    11831182Find explicit connection patterns and amalgamate the involved dragons. 
    1184 This goes through the connection database consulting patterns except those of 
    1185 type B, E or e. When such a function is found, the function 
     1183This goes through the connection database consulting only patterns of type C. 
     1184When such a function is found, the function 
    11861185@code{cut_connect_callback} is invoked. 
    11871186@end quotation 
    1188 @item void modify_eye_spaces1(void) 
    1189 @findex modify_eye_spaces1 
    1190 @quotation  
    1191 Find explicit connection patterns and amalgamate the involved dragons. 
    1192 This goes through the connection database consulting only patterns 
    1193 of type E (@pxref{Connections Database}). When such a function is found, the 
    1194 function @code{cut_connect_callback} is invoked.   
    1195 @end quotation 
    1196 @item void modify_eye_spaces1(void) 
    1197 @findex modify_eye_spaces1 
    1198 @quotation  
    1199 Find explicit connection patterns and amalgamate the involved dragons. 
    1200 This goes through the connection database consulting only patterns 
    1201 of type e (@pxref{Connections Database}). When such a function is found, the 
    1202 function @code{cut_connect_callback} is invoked.   
    1203 @end quotation 
    12041187@end itemize 
    12051188 
    12061189@node  Tuning 
  • doc/reading.texi

    diff -N -r -u -X .ignore gnugo-copy/doc/reading.texi gnugo/doc/reading.texi
    old new  
    6666 
    6767The function @code{do_attack} and @code{do_find_defense} are wrappers 
    6868themselves and call @code{attack1}, @code{attack2}, @code{attack3} or 
    69 @code{attack4} resp.  @code{defend1}, @code{defend1}, @code{defend1}