File: conn.db

package info (click to toggle)
gnugo 3.8-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 17,312 kB
  • ctags: 4,228
  • sloc: ansic: 56,439; perl: 3,771; lisp: 2,789; sh: 730; makefile: 700; python: 682; awk: 113; sed: 22
file content (732 lines) | stat: -rw-r--r-- 10,127 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# 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,   #
# 2008 and 2009 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.                                            #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Database of connection patterns.
#
#  ? - don't care
#  . - empty
#  X - opposite color of O
#  O - color of dragon looking for connection
#  x - X or empty
#  o - O or empty
#  * - cutting point in the O formation, an X move here must be
#      tactically safe
#  ! - inhibit connection, eye space points for O are turned marginal
#
###################################
#
# Classification
#
# The connection database contains patterns of three different classes,
# which also are matched separately.
#
#  B - Indicate cutting points and inhibit connections.
#  C - Amalgamate worms into dragons.
#
# Additionally there are a few acceptance modifiers. 
#
#  s - Accept even if the pattern includes tactically unsafe strings
#
###################################
#
# Organisation
#
# The connection database is organized into a number of different
# categories and ordered so that more specific patterns are matched
# before more general ones, since evaluating the constraints of the
# latter usually is expensive.
#
#  EB    - Edge B patterns
#  CB    - Center B patterns
#  EC    - Edge C patterns
#  CC    - Center C patterns
#  Lunch - patterns that invalidate lunches, matched with I patterns
#
###################################


attribute_map none

goal_elements none
# callback_data is dependent on pattern class in this database


########################
#
# B patterns on the edge
#
########################

callback_data X!


##########################
#
# B patterns in the center
#
##########################

callback_data X!


Pattern CB1b

?O.          fragile double connection 
X*O
?O.

:8,B

?b.
X*O
?a.

;!xplay_connect(*,a,b)


Pattern CB2b

?O.
?..          fragile double connection 
X*O
?O.

:8,B

?b.
?..
X*O
?a.

;!xplay_connect(*,a,b)


Pattern CB3b

O!O
.*X
.O?

:8,B

O!a
.*X
.b?

;!xplay_connect(*,a,b)


Pattern CB3c

O!O
.*.
.OX

:8,B

c!a
.*.
.bX

;!oplay_disconnect(a,c)
;&& !oplay_disconnect(c,b)
;&& !xplay_connect(*,a,b)


Pattern CB7
# This pattern is used to find potential cutting stones as defined by
# the field cutstone2 in the worm data. The helper returns 0 so the
# pattern doesn't fire as a B pattern.

XO
O*

:\,B,cutstone2_helper

AO
O*

;attack(A)


Pattern CB11b

?OX?
O!OX
?*!O
??O?

:8,B

?bX?
O!OX
?*!a
??O?

;!xplay_connect(*,a,b)


Pattern CB15b
# tm New Pattern (3.1.23)  (see global:17, )
#   careful not to break trevord:730
# FIXME:  Need to use amalgamate_most_valuable helper.
# xplay_disconnect helper also might be useful here.

?*?   save cutting stone.
OXO
!O!

:8,B

?*?
aXb
!O!

;!xplay_connect(*,a,b)


Pattern CB16
# gf Revised constraint. (3.3.13)

?O
x*          fragile double connection 
XO
O!

:8,B

?a
x*
XO
b!

;xplay_connect(a,b) && !xplay_connect(*,a,b)


Pattern CB17

O!O
!*?        fragile double connection 
O??

:\,B

O!a
!*?
b??

;!xplay_connect(*,a,b)


Pattern CB18

?X?
X.X        workaround for ko contingent connection
OXO
?O*

:8,B

?X?
XbX
OAd
?c*

;xplay_attack(*,A)<WIN && !xplay_connect(*,?,b,c,d)


########################
#
# C patterns on the edge
#
########################

# Static connections need almost everything
callback_data .Oxo,!


Pattern EC1

??oo??
?....?
oO..Oo
o....o
o....o
------

:|,C


Pattern EC1b

??....??
o.O..O.o
o......o
o......o
--------

:|,C


Pattern EC3a

o...o
oO.Oo
o...o
o...o
o...o
-----

:8,C

o...o
oO.Oo
o...o
oa..o
o...o
-----

;omoyo(a)


##########################
#
# C patterns in the center
#
##############################################
#
# CC1xx - patterns without reading constraints
#
##############################################

# Static connections need almost everything
callback_data .Oxo,!


Pattern CC101

.O
O.

:X,C

aO
Ob

;!xcut(a) && !xcut(b)


Pattern CC103

?oooo?
o....o
oO..Oo
o....o
?oooo?

:+,C


Pattern CC104

?ooo??
o...oo
oO...o
o...Oo
oo...o
??ooo?

:8,C


Pattern CC105

?ooo?
.....
.O.O.
.....
?ooo?

:+,C


Pattern CC106

.O.O.
o...o
o...o
o.O.o

:8,C


Pattern CC107

.O.O.
o...o
o...o
.O.O.

:8,C


Pattern CC108

O.O
...
...
.O.

:|,C

OaO
bcd
efg
.O.

;omoyo(a) && oarea(c) && oarea(f)
;&& ((omoyo(b) + omoyo(c) + omoyo(d) + omoyo(e) + omoyo(f) +omoyo(g)) >= 3)


Pattern CC109
# gf Revised constraint. (3.3.3)

O.oo
..oo
..oo
.Ooo

:8,C

c.oo
.aoo
.boo
.doo

;omoyo(a) && omoyo(b) && lib(c)>=4 && lib(d)>=4


##########################################################
#
# CC2xx - patterns with reasonably inexpensive constraints
#
##########################################################

#############################################
#
# CC3xx - patterns with expensive constraints
#
#############################################
#
# CC30x - one space jump connections
#
####################################

###########################
#
# CC31x - keima connections
#
###########################

####################################
#
# CC32x - two space jump connections
#
####################################

############################
#
# CC33x - ogeima connections
#
############################

####################################################################
#
# CC4xx -  fragile double connections
#
# FIXME: These shouldn't be matched until all other amalgamation has
# been completed.
#
####################################################################

Pattern CC401
# Do amalgamate one of the two possible connections. We guess that
# the larger of the two dragons is the one we most want to keep in
# case of a cut.

?O.          fragile double connection 
X.O
?O.

:8,-

?d.
Xac
?b.

;xcut(a)

>amalgamate_most_valuable_helper(b,c,d);


Pattern CC402
# Do amalgamate one of the two possible connections. We guess that
# the larger of the two dragons is the one we most want to keep in
# case of a cut.

?O.
?..          fragile double connection 
X.O
?O.

:8,-

?gd
?bc
Xaf
?e.

;xcut(a)

>if (!xplay_attack_either(b,c,d,b,d) || !xplay_attack_either(c,b,a,c,a))
>  amalgamate(e,f);
>else
>  amalgamate_most_valuable_helper(e,f,g);


####################################################################
#
# CC5xx - experimental connection patterns
#
####################################################################
#
# Note about patterns CC501, CC502, CC502b, CC511
#
# In theory, these patterns go against the connection policy that the
# involved strings must be tactically stable (not capturable) and
# consequently, they should not be needed at all. In practice though,
# problems arise with the optics/owl analysis when such strings aren't
# amalgamated. An example (see owl:50)
#
# +------
# |...X.O
# |XXX.XO
# |.OOXXO
# |O.OOOO
#
# In the absence of the mentioned patterns, the topmost X stone would
# NOT be amalgamated with the others, because all attempts at
# defending these kosumi connections result in a tactical capture of
# the whole string, thus a successful cut.
#
# As a consequence, the owl code would be run against separate targets,
# and in the above case, it would even fail to find a way to kill the
# topmost X stone (the lack of context is then responsible for the 
# optics/owl code not being able to return vital points)
#
####################################################################


Pattern CC501
# Connect even if stones not tactically safe.

xO
O.

:\,sC

xO
Oc

;x_suicide(c)


Pattern CC502
# Connect even if stones not tactically safe.

XO
O.

:\,sC

Xb
ac

;lib(a)>1 && lib(b)>1 && !xcut(c) && xlib(c)==1 && xplay_attack(c,c)==WIN


Pattern CC502b
# Connect even if stones not tactically safe.

.O
O.

:\,sC

db
ac

;lib(a)>1 && lib(b)>1 && !xcut(c) && !xcut(d)
;&& xlib(c)==1 && xplay_attack(c,c)


Pattern CC503

O
.
O

:+,C

c
a
b

;!xcut(a) && !disconnect_helper(b,c)


Pattern CC504

XO
O.

:\,C

Xb
ca

;!xcut(a) && !disconnect_helper(b,c)


Pattern CC505

XO
OX

:X,C

Bc
dA

;((attack(A) && !distrust_tactics_helper(A))
; || (attack(B) && !distrust_tactics_helper(B)))
;&& !disconnect_helper(c,d)


Pattern CC506

O
.
.
O

:+,C

c
a
b
d

;!xcut(a) && !xcut(b) && !disconnect_helper(c,d)


Pattern CC506b

O.
Xo
..
O.

:8,C

c.
Eo
ab
d.

;!xcut(a) && !xcut(b) && lib(E)<=2 && !disconnect_helper(c,d)


Pattern CC507

Ox
..
xO

:O,C

cx
ab
xd

;!xcut(a) && !xcut(b) && !disconnect_helper(c,d)


Pattern CC508

O?
.X
xO

:8,C

b?
aX
xc

;!xcut(a) && !disconnect_helper(b,c)


Pattern CC509

Ox
..
..
xO

:O,C

ex
ab
cd
xf

;!xcut(a) && !xcut(b) && !xcut(c) && !xcut(d) && !disconnect_helper(e,f)


Pattern CC511
# Connect even if stones not tactically safe.

.O
O.

:\,sC

db
ac

;attack(a) && attack(b) && !xcut(c) && !xcut(d)


# END OF FILE