diff -N -r -u -X .ignore gnugo-copy/engine/combination.c gnugo/engine/combination.c
--- gnugo-copy/engine/combination.c	2007-01-22 23:43:35.468750000 +0100
+++ gnugo/engine/combination.c	2007-01-19 11:06:00.744875000 +0100
@@ -2,7 +2,7 @@
  * 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 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -144,8 +144,8 @@
 		remove_attack_threat_move(ii, a_threatened_groups[l]);
 	      }
 	    }
-	    else if (!defend_both(a_threatened_groups[k],
-				  a_threatened_groups[l])) {
+	    else if (defend_both(a_threatened_groups[k],
+				 a_threatened_groups[l]) != WIN) {
 	      TRACE("Double threat at %1m, either %1m or %1m attacked.\n",
 		    ii, a_threatened_groups[k], a_threatened_groups[l]);
 	      add_either_move(ii, ATTACK_STRING, a_threatened_groups[k],
diff -N -r -u -X .ignore gnugo-copy/engine/reading.c gnugo/engine/reading.c
--- gnugo-copy/engine/reading.c	2007-01-22 17:14:36.234375000 +0100
+++ gnugo/engine/reading.c	2007-01-22 17:12:18.640625000 +0100
@@ -638,7 +638,8 @@
   int a_savepos;
   int b_savepos;
   int acode = 0;
-  int dcode = 0;
+  int dcode_a;
+  int dcode_b;
   
   int color = board[astr];
   ASSERT1(IS_STONE(color) , astr);
@@ -653,25 +654,29 @@
     bstr = t;
   }
 
-  attack_and_defend(astr, &acode, NULL, &dcode, &a_savepos);
-  if (acode != 0) {
+  attack_and_defend(astr, &acode, NULL, &dcode_a, &a_savepos);
+  if (acode != LOSE) {
     a_threatened = 1;
-    if (dcode != WIN)
-      return 0; /* (astr) already lost */
+    if (dcode_a == LOSE)
+      return LOSE; /* (astr) already lost */
   }
+  else
+    dcode_a = WIN;
   
-  attack_and_defend(bstr, &acode, NULL, &dcode, &b_savepos);
-  if (acode != 0) {
+  attack_and_defend(bstr, &acode, NULL, &dcode_b, &b_savepos);
+  if (acode != LOSE) {
     b_threatened = 1;
-    if (dcode != WIN)
-      return 0; /* (bstr) already lost */
+    if (dcode_b == LOSE)
+      return LOSE; /* (bstr) already lost */
   }
+  else
+    dcode_b = WIN;
 
   /* Neither string can be attacked or only one of them, in which case
    * we have time to save it.
    */
   if (!a_threatened || !b_threatened)
-    return WIN;
+    return gg_min(dcode_a, dcode_b);
   
   /* If both strings are threatened we assume that one will become lost,
    * unless find_defense() happened to return the same defense point for
@@ -682,8 +687,8 @@
    */
 
   if (a_savepos == b_savepos)
-    return WIN; /* Both strings can be attacked but also defended 
-                 * by one move. */
+    return gg_min(dcode_a, dcode_b); /* Both strings can be attacked but
+					also defended by one move. */
 
   /* We also try each of the returned defense points and see whether
    * the other string can still be attacked. This still gives a
diff -N -r -u -X .ignore gnugo-copy/engine/utils.c gnugo/engine/utils.c
--- gnugo-copy/engine/utils.c	2007-01-22 23:49:31.468750000 +0100
+++ gnugo/engine/utils.c	2007-01-19 11:10:09.651125000 +0100
@@ -1384,7 +1384,7 @@
 	&& trymove(move, color, "double_atari", NO_MOVE)) {
       if (countlib(move) > 1
 	  && (BOARD(m, n+dn) == EMPTY || BOARD(m+dm, n) == EMPTY 
-	      || !defend_both(POS(m, n+dn), POS(m+dm, n)))) {
+	      || defend_both(POS(m, n+dn), POS(m+dm, n)) != WIN)) {
 	popgo();
 	if (value) {
 	  if (worm[POS(m, n+dn)].effective_size
diff -N -r -u -X .ignore gnugo-copy/patterns/aa_attackpats.db gnugo/patterns/aa_attackpats.db
--- gnugo-copy/patterns/aa_attackpats.db	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/patterns/aa_attackpats.db	2007-01-17 19:42:44.125000000 +0100
@@ -434,7 +434,7 @@
 ?*?
 BAC
 
-; lib(A) == 1 && lib(B) + lib(C) <= 6 && !oplay_defend_both(*,B,C)
+; lib(A) == 1 && lib(B) + lib(C) <= 6 && oplay_defend_both(*,B,C)!=WIN
 
 
 Pattern A25
diff -N -r -u -X .ignore gnugo-copy/patterns/barriers.db gnugo/patterns/barriers.db
--- gnugo-copy/patterns/barriers.db	2006-03-27 23:18:40.000000000 +0200
+++ gnugo/patterns/barriers.db	2007-01-20 13:31:12.171875000 +0100
@@ -215,7 +215,7 @@
 Oc
 ba
 
-;!safe_omove(a) || oplay_defend_both(a,b,c)
+;!safe_omove(a) || oplay_defend_both(a,b,c)==WIN
 
 
 Pattern Barrier12
@@ -406,7 +406,7 @@
 Oab.
 .dcO
 
-;oplay_attack_either(a,b,c,d,b,d) || oplay_defend_both(a,b,c,d,a,c)
+;oplay_attack_either(a,b,c,d,b,d) || oplay_defend_both(a,b,c,d,a,c)==WIN
 
 
 Pattern Barrier24
@@ -656,7 +656,7 @@
 OcXe
 .bad
 
-;oplay_defend_both(a,b,c,d,a,e)
+;oplay_defend_both(a,b,c,d,a,e)==WIN
 
 
 Pattern Barrier42
@@ -669,7 +669,7 @@
 cD?
 baO
 
-;oplay_attack_either(a,b,b,D) || oplay_defend_both(a,b,a,c)
+;oplay_attack_either(a,b,b,D) || oplay_defend_both(a,b,a,c)==WIN
 
 
 Pattern Barrier43
@@ -696,7 +696,7 @@
 ..,o
 ----
 
-;oplay_attack_either(a,b,c,d,d,b) && !oplay_defend_both(a,c,b,c,E)
+;oplay_attack_either(a,b,c,d,d,b) && oplay_defend_both(a,c,b,c,E)!=WIN
 
 
 Pattern Barrier45
@@ -1198,7 +1198,7 @@
 bfE
 aDc
 
-;!oplay_defend_both(a,b,c,D,E)
+;oplay_defend_both(a,b,c,D,E)!=WIN
 >return (!xplay_attack(b,f));
 
 
@@ -1486,7 +1486,7 @@
 fAb
 
 ;lib(A)==2 && !oplay_attack(b,b)
->return (!xplay_attack(c,d) && xplay_defend_both(e,d,f));
+>return (!xplay_attack(c,d) && xplay_defend_both(e,d,f)==WIN);
 
 
 Pattern Intrusion21
@@ -1894,7 +1894,7 @@
 
 ;safe_omove(a)
 ;&& (o_somewhere(e) || oplay_attack(a,e,e))
-;&& !oplay_defend_both(a,b,c,b,D)
+;&& oplay_defend_both(a,b,c,b,D)!=WIN
 >return (!xplay_attack(a,f) && (o_somewhere(e) || (!xplay_attack(e,f))));
 
 
@@ -1913,7 +1913,7 @@
 
 ;safe_omove(a)
 ;&& (o_somewhere(b) || oplay_attack(a,b,b))
-;&& !oplay_defend_both(a,c,d,e,F,G)
+;&& oplay_defend_both(a,c,d,e,F,G)!=WIN
 >return (!xplay_attack(a,h));
 
 
@@ -2263,7 +2263,7 @@
 cDO
 
 ;oplay_attack(c,b,D)
->return !safe_xmove(a) && !oplay_defend_both(c,b,a,b,D);
+>return !safe_xmove(a) && oplay_defend_both(c,b,a,b,D)!=WIN;
 
 
 Pattern Intrusion63
@@ -2468,7 +2468,7 @@
 ebaO
 ----
 
-;!oplay_defend_both(a,b,c,b,D)
+;oplay_defend_both(a,b,c,b,D)!=WIN
 
 >non_xterritory(b);
 >non_xterritory(c);
@@ -2506,7 +2506,7 @@
 bac
 ---
 
-;safe_omove(a) && !oplay_defend_both(a,b,c,?,d,b,E)
+;safe_omove(a) && oplay_defend_both(a,b,c,?,d,b,E)!=WIN
 
 >non_xterritory(d);
 
@@ -2675,7 +2675,7 @@
 |Xd
 |bX
 
-;!oplay_defend_both(a,b,?,c,a,d)
+;oplay_defend_both(a,b,?,c,a,d)!=WIN
 
 >non_oterritory(a);
 >non_oterritory(c);
@@ -2692,7 +2692,7 @@
 |ba
 |Xc
 
-;!xplay_defend_both(a,b,c)
+;xplay_defend_both(a,b,c)!=WIN
 
 >non_oterritory(a);
 
@@ -2709,7 +2709,7 @@
 bacO
 ----
 
-;!oplay_defend_both(a,b,c,?,d,b,E)
+;oplay_defend_both(a,b,c,?,d,b,E)!=WIN
 
 >non_xterritory(a);
 >non_xterritory(b);
@@ -2728,7 +2728,7 @@
 dcaeO
 -----
 
-;!oplay_defend_both(a,b,c,d,e,?,f,d,b)
+;oplay_defend_both(a,b,c,d,e,?,f,d,b)!=WIN
 
 >non_xterritory(a);
 >non_xterritory(b);
@@ -3096,7 +3096,7 @@
 .cX
 .ab
 
-;!xplay_defend_both(a,b,c)
+;xplay_defend_both(a,b,c)!=WIN
 
 >non_oterritory(a);
 
@@ -3115,7 +3115,7 @@
 .DO
 .bC
 
-;!oplay_defend_both(a,?,b,C,D)
+;oplay_defend_both(a,?,b,C,D)!=WIN
 
 >non_xterritory(b);
 
@@ -3172,7 +3172,7 @@
 bX
 ac
 
-;!xplay_defend_both(a,b,c) && !adjacent_to_defendable_stone_in_atari(b)
+;xplay_defend_both(a,b,c)!=WIN && !adjacent_to_defendable_stone_in_atari(b)
 ;&& !adjacent_to_defendable_stone_in_atari(c)
 
 >non_oterritory(a);
@@ -3286,7 +3286,7 @@
 Oab
 ?Xc
 
-;!oplay_defend_both(a,b,a,c)
+;oplay_defend_both(a,b,a,c)!=WIN
 
 >non_oterritory(b);
 >non_oterritory(d);
@@ -3344,7 +3344,7 @@
 bXa
 cdX
 
-;!safe_omove(a) && !oplay_defend_both(b,a,?,c,b,d)
+;!safe_omove(a) && oplay_defend_both(b,a,?,c,b,d)!=WIN
 
 >non_oterritory(c);
 
@@ -3403,7 +3403,7 @@
 ...
 ---
 
-;oplay_defend_both(a,b,c,D,b) && oplay_attack(a,b,a)
+;oplay_defend_both(a,b,c,D,b)==WIN && oplay_attack(a,b,a)
 
 >non_oterritory(e);
 
diff -N -r -u -X .ignore gnugo-copy/patterns/endgame.db gnugo/patterns/endgame.db
--- gnugo-copy/patterns/endgame.db	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/patterns/endgame.db	2007-01-17 19:42:44.187500000 +0100
@@ -547,7 +547,7 @@
 X*
 --
 
-;eye(*) && proper_eye(a) && oplay_defend_both(*,a,*,b)
+;eye(*) && proper_eye(a) && oplay_defend_both(*,a,*,b)==WIN
 
 
 Pattern EE303
diff -N -r -u -X .ignore gnugo-copy/patterns/helpers.c gnugo/patterns/helpers.c
--- gnugo-copy/patterns/helpers.c	2007-01-22 23:51:32.343750000 +0100
+++ gnugo/patterns/helpers.c	2007-01-19 11:06:14.791750000 +0100
@@ -579,7 +579,7 @@
       if (TRYMOVE(cpos, other)) {
 	if (board[bpos] == EMPTY
 	    || board[epos] == EMPTY
-	    || !defend_both(bpos, epos))
+	    || defend_both(bpos, epos) != WIN)
 	  result = 1;
 	popgo();
       }
@@ -639,7 +639,7 @@
 	if (TRYMOVE(cpos, color)) {
 	  if (board[bpos] == EMPTY
 	      || board[epos] == EMPTY
-	      || !defend_both(bpos, epos))
+	      || defend_both(bpos, epos) != WIN)
 	    result = 1;
 	  popgo();
 	}
@@ -663,7 +663,7 @@
   ASSERT1(board[worma] == OTHER_COLOR(color)
           && board[wormb] == OTHER_COLOR(color), move);
 
-  if (!defend_both(worma, wormb)) {
+  if (defend_both(worma, wormb) != WIN) {
     if (0)
       gprintf("%1m: Reject attack_either_move for %1m, %1m (can't defend both)\n",
 	      move, worma, wormb);
@@ -677,7 +677,7 @@
 	  gprintf("%1m: Rej. attack_either_move for %1m & %1m (regular attack)\n",
 		  move, worma, wormb);
       }
-      else if (!defend_both(worma, wormb))
+      else if (defend_both(worma, wormb) != WIN)
         add_either_move(move, ATTACK_STRING, find_origin(worma),
 			ATTACK_STRING, find_origin(wormb));
       else {
diff -N -r -u -X .ignore gnugo-copy/patterns/owl_attackpats.db gnugo/patterns/owl_attackpats.db
--- gnugo-copy/patterns/owl_attackpats.db	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/patterns/owl_attackpats.db	2007-01-17 19:42:43.906250000 +0100
@@ -733,7 +733,7 @@
 ....
 ----
 
-;!xplay_defend_both(*,b,c,a,b)
+;xplay_defend_both(*,b,c,a,b)!=WIN
 
 
 Pattern A218
@@ -881,7 +881,7 @@
 ...x
 ----
 
-;xplay_attack(*,a,C) || !xplay_defend_both(*,a,b,a,C)
+;xplay_attack(*,a,C) || xplay_defend_both(*,a,b,a,C)!=WIN
 
 
 Pattern A227
@@ -1280,7 +1280,7 @@
 Y*..
 ?..?
 
-; oplay_defend_both(*,a,*,b) && !oplay_attack(*,a,b)
+; oplay_defend_both(*,a,*,b)==WIN && !oplay_attack(*,a,b)
 
 
 Pattern A401a
@@ -1298,7 +1298,7 @@
 Y*..
 ?..?
 
-; oplay_defend_both(*,a,*,b)
+; oplay_defend_both(*,a,*,b)==WIN
 
 
 Pattern A402
@@ -1332,7 +1332,7 @@
 Aad
 OYX
 
-; oplay_defend_both(*,a,b,c,A,b) && oplay_defend_both(*,b,a,d,*,A)
+; oplay_defend_both(*,a,b,c,A,b)==WIN && oplay_defend_both(*,b,a,d,*,A)==WIN
 
 
 Pattern A403b
@@ -1351,7 +1351,7 @@
 OYX
 
 ; owl_escape_value(e)>0
-; && oplay_defend_both(*,a,b,c,A,b) && oplay_defend_both(*,b,a,d,*,A)
+; && oplay_defend_both(*,a,b,c,A,b)==WIN && oplay_defend_both(*,b,a,d,*,A)==WIN
 
 
 Pattern A404
@@ -1646,7 +1646,7 @@
 .*Y
 Abc
 
-;owl_escape_value(A)>0 && oplay_defend_both(*,b,*,c)
+;owl_escape_value(A)>0 && oplay_defend_both(*,b,*,c)==WIN
 
 
 Pattern A416
@@ -1705,7 +1705,7 @@
 .*A
 
 ;(owl_escape_value(A)>0)
-; && oplay_defend_both(*,c,*,d)
+; && oplay_defend_both(*,c,*,d)==WIN
 
 
 Pattern A419b
@@ -1720,7 +1720,7 @@
 .*Y
 
 ;(owl_escape_value(A)>0)
-; && oplay_defend_both(*,c,*,d)
+; && oplay_defend_both(*,c,*,d)==WIN
 
 
 Pattern A420
@@ -1738,7 +1738,7 @@
 bd*.
 xexx
 
-;owl_escape_value(e)>0 && !xplay_defend_both(*,a,b,c,d)
+;owl_escape_value(e)>0 && xplay_defend_both(*,a,b,c,d)!=WIN
 
 
 Pattern A421
@@ -2476,7 +2476,7 @@
 XA*
 ---
 
-; oplay_defend_both(*,A,b,*)
+; oplay_defend_both(*,A,b,*)==WIN
 
 
 Pattern A619
@@ -2906,7 +2906,7 @@
 
 ;lib(A) == 3 && !obvious_false_xeye(d)
 ;&& oplay_defend(*,b,c,*) && oplay_defend(*,e,c,*)
-;&& oplay_defend_both(*,c,b,d,e,b,e)
+;&& oplay_defend_both(*,c,b,d,e,b,e)==WIN
 
 
 #########################################################
@@ -3696,8 +3696,8 @@
 X*?
 
 ; owl_escape_value(b)>0
-; && oplay_defend_both(*,A,b,c,b)
-; && oplay_defend_both(*,A,b,b,*)
+; && oplay_defend_both(*,A,b,c,b)==WIN
+; && oplay_defend_both(*,A,b,b,*)==WIN
 
 
 Pattern A1014
@@ -3727,7 +3727,7 @@
 AfgB
 
 ; (owl_escape_value(A) > 0 || owl_escape_value(B) > 0)
-; && oplay_defend_both(*,g,f,e,f,*)
+; && oplay_defend_both(*,g,f,e,f,*)==WIN
 
 
 Pattern A1015a
@@ -3741,7 +3741,7 @@
 AfgB
 
 ; (owl_escape_value(A) > 0 || owl_escape_value(B) > 0)
-; && oplay_defend_both(*,g,f,e,f,*)
+; && oplay_defend_both(*,g,f,e,f,*)==WIN
 
 
 Pattern A1016
@@ -3760,7 +3760,7 @@
 
 ; (owl_escape_value(A) > 0 || owl_escape_value(B) > 0)
 ; && ((x_somewhere(d) && xplay_attack_either(*,c,c,e))
-;     || (!x_somewhere(d) && !xplay_defend_both(*,c,d,c,e)))
+;     || (!x_somewhere(d) && xplay_defend_both(*,c,d,c,e)!=WIN))
 
 
 Pattern A1016a
@@ -3779,7 +3779,7 @@
 
 ; (owl_escape_value(A) > 0 || owl_escape_value(B) > 0)
 ; && ((x_somewhere(d) && xplay_attack_either(*,c,c,e))
-;     || (!x_somewhere(d) && !xplay_defend_both(*,c,d,c,e)))
+;     || (!x_somewhere(d) && xplay_defend_both(*,c,d,c,e)!=WIN))
 
 
 Pattern A1017
@@ -4012,7 +4012,7 @@
 ?Y?
 
 ; vital_chain(A) && vital_chain(B)
-; && !xplay_defend_both(*,A,B)
+; && xplay_defend_both(*,A,B)!=WIN
 
 
 Pattern A1102
@@ -4027,7 +4027,7 @@
 c*O
 ?Y?
 
-;!xplay_defend_both(*,a,b,a,c)
+;xplay_defend_both(*,a,b,a,c)!=WIN
 
 
 Pattern A1104
@@ -4102,7 +4102,7 @@
 Yb?
 
 ; vital_chain(a) && vital_chain(b)
-; && !xplay_defend_both(*,a,b)
+; && xplay_defend_both(*,a,b)!=WIN
 
 
 Pattern A1107b
@@ -4122,7 +4122,7 @@
 Yc
 
 ;lib(c)>2 && vital_chain(b) && vital_chain(c)
-;&& oplay_attack(*,a,a) && !xplay_defend_both(a,b,c)
+;&& oplay_attack(*,a,a) && xplay_defend_both(a,b,c)!=WIN
 
 # nn Removal candidate (3.3.13)
 #   Success rate in regressions : 0.9 % (23/2562)
@@ -4142,7 +4142,7 @@
 Yc
 
 ;lib(c)>2 && vital_chain(b) && vital_chain(c)
-;&& oplay_attack(*,a,a) && !xplay_defend_both(a,b,c)
+;&& oplay_attack(*,a,a) && xplay_defend_both(a,b,c)!=WIN
 
 
 Pattern A1108
@@ -4282,7 +4282,7 @@
 *bX
 xCx
 
-;owl_escape_value(C)>0 && owl_goal_dragon(D) && !xplay_defend_both(*,a,b)
+;owl_escape_value(C)>0 && owl_goal_dragon(D) && xplay_defend_both(*,a,b)!=WIN
 
 
 Pattern A1117
@@ -4296,7 +4296,7 @@
 X*b
 ?aY
 
-;!xplay_defend_both(*,a,b)
+;xplay_defend_both(*,a,b)!=WIN
 
 
 Pattern A1117a
@@ -4310,7 +4310,7 @@
 Y*b
 ?aX
 
-;!xplay_defend_both(*,a,b)
+;xplay_defend_both(*,a,b)!=WIN
 
 
 Pattern A1118
@@ -4454,7 +4454,7 @@
 
 ;(owl_escape_value(c) > 0
 ; || owl_escape_value(b) > 0)
-;&& oplay_defend_both(*,d,A,*)
+;&& oplay_defend_both(*,d,A,*)==WIN
 
 
 Pattern A1124a
@@ -4476,7 +4476,7 @@
 ;(owl_escape_value(d) > 0
 ; || owl_escape_value(b) > 0
 ; || owl_escape_value(c) > 0)
-;&& !oplay_defend_both(e,*,A,e)
+;&& oplay_defend_both(e,*,A,e)!=WIN
 
 
 Pattern A1124b
@@ -4987,7 +4987,7 @@
 ?a?
 B*C
 
-;attack(a) && !oplay_attack(*,a) && !oplay_defend_both(*,B,C)
+;attack(a) && !oplay_attack(*,a) && oplay_defend_both(*,B,C)!=WIN
 
 
 #########################################################
diff -N -r -u -X .ignore gnugo-copy/patterns/owl_defendpats.db gnugo/patterns/owl_defendpats.db
--- gnugo-copy/patterns/owl_defendpats.db	2006-03-27 23:12:12.000000000 +0200
+++ gnugo/patterns/owl_defendpats.db	2007-01-17 19:42:44.250000000 +0100
@@ -4252,7 +4252,7 @@
 A*
 OB
 
-;vital_chain(A) && vital_chain(B) && !ko(*) && !oplay_defend_both(*,A,B)
+;vital_chain(A) && vital_chain(B) && !ko(*) && oplay_defend_both(*,A,B)!=WIN
 
 
 Pattern D1100b
@@ -4266,7 +4266,7 @@
 A*
 OB
 
-;vital_chain(A)>1 && vital_chain(B)>1 && !oplay_defend_both(*,A,B)
+;vital_chain(A)>1 && vital_chain(B)>1 && oplay_defend_both(*,A,B)!=WIN
 
 
 Pattern D1101
@@ -4402,7 +4402,7 @@
 eOODf
 .....
 
-; !oplay_defend_both(*,f,a,B,C) && oplay_attack(*,D) && !safe_xmove(e)
+; oplay_defend_both(*,f,a,B,C)!=WIN && oplay_attack(*,D) && !safe_xmove(e)
 
 
 Pattern D1108b
@@ -4419,7 +4419,7 @@
 .aaXX
 .....
 
-;owl_goal_dragon(a) && !oplay_defend_both(*,B,C)
+;owl_goal_dragon(a) && oplay_defend_both(*,B,C)!=WIN
 
 
 Pattern D1109
@@ -4732,7 +4732,7 @@
 OAc
 B*?
 
-;lib(A)==2 && owl_escape_value(c)>0 && !oplay_defend_both(*,A,B)
+;lib(A)==2 && owl_escape_value(c)>0 && oplay_defend_both(*,A,B)!=WIN
 
 
 Pattern D1125
@@ -4957,7 +4957,7 @@
 aO
 Ob
 
-; (owl_escape_value(*) > 0) && !oplay_defend_both(*,a,b)
+; (owl_escape_value(*) > 0) && oplay_defend_both(*,a,b)!=WIN
 
 
 Pattern D1140
@@ -5121,7 +5121,7 @@
 *.O
 Boo
 
-; lib(A)==2 && !oplay_defend_both(*,A,B)
+; lib(A)==2 && oplay_defend_both(*,A,B)!=WIN
 
 
 Pattern D1202
@@ -5835,7 +5835,7 @@
 dab.
 ofoo
 
-;owl_escape_value(f)>0 && !oplay_defend_both(*,a,b,c,d,a,E)
+;owl_escape_value(f)>0 && oplay_defend_both(*,a,b,c,d,a,E)!=WIN
 
 
 Pattern D1331
@@ -5852,7 +5852,7 @@
 bD*.
 oeoo
 
-;owl_escape_value(e)>0 && !oplay_defend_both(*,a,b,C,D)
+;owl_escape_value(e)>0 && oplay_defend_both(*,a,b,C,D)!=WIN
 
 
 Pattern D1332
@@ -5887,7 +5887,7 @@
 *BO
 oco
 
-;owl_escape_value(c)>0 && owl_goal_dragon(d) && !oplay_defend_both(*,A,B)
+;owl_escape_value(c)>0 && owl_goal_dragon(d) && oplay_defend_both(*,A,B)!=WIN
 
 
 Pattern D1333b
@@ -5969,7 +5969,7 @@
 dc*.
 ofoo
 
-;owl_escape_value(f)>0 && !oplay_defend_both(*,a,b,c,d,c,E)
+;owl_escape_value(f)>0 && oplay_defend_both(*,a,b,c,d,c,E)!=WIN
 
 
 Pattern D1338
@@ -5986,7 +5986,7 @@
 baO.
 odoo
 
-;owl_escape_value(d)>0 && !oplay_defend_both(*,a,b,a,C)
+;owl_escape_value(d)>0 && oplay_defend_both(*,a,b,a,C)!=WIN
 
 
 Pattern D1339
@@ -6707,7 +6707,7 @@
 
 ; (owl_escape_value(a) > 0 || owl_escape_value(b) > 0)
 ; && ((o_somewhere(d) && oplay_attack_either(*,c,c,E))
-;     || (!o_somewhere(d) && !oplay_defend_both(*,c,d,c,E)))
+;     || (!o_somewhere(d) && oplay_defend_both(*,c,d,c,E)!=WIN))
 
 
 Pattern D1377
diff -N -r -u -X .ignore gnugo-copy/patterns/owl_vital_apats.db gnugo/patterns/owl_vital_apats.db
--- gnugo-copy/patterns/owl_vital_apats.db	2006-02-20 23:42:14.000000000 +0100
+++ gnugo/patterns/owl_vital_apats.db	2007-01-20 18:44:39.875000000 +0100
@@ -615,7 +615,7 @@
 .OX
 *XA
 
-; oplay_defend_both(*,A,*)
+; oplay_defend_both(*,A,*)==WIN
 
 
 Pattern VA35
@@ -841,7 +841,7 @@
 a*
 Xb
 
-;vital_chain(a) && vital_chain(b) && !ko(*) && !xplay_defend_both(*,a,b)
+;vital_chain(a) && vital_chain(b) && !ko(*) && xplay_defend_both(*,a,b)==LOSE
 
 
 Pattern VA47b
@@ -857,7 +857,7 @@
 a*
 Xb
 
-;vital_chain(a) && vital_chain(b) && ko(*) && !xplay_defend_both(*,a,b)
+;vital_chain(a) && vital_chain(b) && ko(*) && xplay_defend_both(*,a,b)!=WIN
 
 
 Pattern VA48
diff -N -r -u -X .ignore gnugo-copy/patterns/patterns.db gnugo/patterns/patterns.db
--- gnugo-copy/patterns/patterns.db	2006-03-27 23:18:40.000000000 +0200
+++ gnugo/patterns/patterns.db	2007-01-17 19:42:44.062500000 +0100
@@ -553,7 +553,7 @@
 O*d
 ?eb
 
-;oplay_defend_both(*,a,b,*,b) && oplay_defend_both(*,b,a,*,a)
+;oplay_defend_both(*,a,b,*,b)==WIN && oplay_defend_both(*,b,a,*,a)==WIN
 
 >add_cut_move(c,d);
 >add_cut_move(c,e);
@@ -716,7 +716,7 @@
 *a
 .X
 
-;oplay_defend_both(*,a,*,b)
+;oplay_defend_both(*,a,*,b)==WIN
 
 
 Pattern CC44
@@ -889,7 +889,7 @@
 c*a
 ??X
 
-;alive(c) && oplay_defend_both(*,a,*,b)
+;alive(c) && oplay_defend_both(*,a,*,b)==WIN
 
 
 Pattern CC54
@@ -1056,7 +1056,7 @@
 Xab
 Xcd
 
-;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)
+;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)==WIN
 
 
 Pattern CC68
@@ -1073,7 +1073,7 @@
 .Xab
 ..cd
 
-;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)
+;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)==WIN
 
 
 Pattern CC69
@@ -1098,7 +1098,7 @@
 aX*E
 ?gcd
 
-;(alive(f) || alive(g)) && !oplay_defend_both(*,a,b,c,d,c,E)
+;(alive(f) || alive(g)) && oplay_defend_both(*,a,b,c,d,c,E)!=WIN
 
 
 Pattern CC71
@@ -1116,7 +1116,7 @@
 aX*E
 ?fcd
 
-;!oplay_defend_both(*,a,b,c,d,c,E) && (dragonsize(f) <= wormsize(E))
+;oplay_defend_both(*,a,b,c,d,c,E)!=WIN && (dragonsize(f) <= wormsize(E))
 
 
 Pattern CC72
@@ -1387,7 +1387,7 @@
 -----
 
 ;odefend_against(*,d)
-;&& !oplay_defend_both(*,a,b,a,E)
+;&& oplay_defend_both(*,a,b,a,E)!=WIN
 ;&& oplay_attack_either(*,b,a,c,b,c)
 
 
@@ -1475,7 +1475,7 @@
 ....
 ----
 
-;!xplay_defend_both(*,a,b,a,D) && xplay_attack_either(*,b,a,c,b,c)
+;xplay_defend_both(*,a,b,a,D)!=WIN && xplay_attack_either(*,b,a,c,b,c)
 
 
 Pattern EC8
@@ -1770,7 +1770,7 @@
 cad
 ---
 
-;!xplay_defend_both(*,a,b,a,e)
+;xplay_defend_both(*,a,b,a,e)!=WIN
 ;&& xplay_attack_either(*,b,a,d,d,b)
 ;&& oplay_attack_either(*,b,b,c)
 ;&& oplay_attack_either(*,a,d,b,b,c)
@@ -2150,8 +2150,8 @@
 -----
 
 ;oplay_attack_either(*,a,b,c,a,c) && oplay_attack_either(*,d,e,f,d,f)
-;&& !oplay_defend_both(*,b,a,d,e,b,d)
-;&& !oplay_defend_both(*,e,d,a,b,e,a)
+;&& oplay_defend_both(*,b,a,d,e,b,d)!=WIN
+;&& oplay_defend_both(*,e,d,a,b,e,a)!=WIN
 
 
 Pattern EC58
@@ -2170,9 +2170,9 @@
 .....
 -----
 
-;!oplay_defend_both(*,b,a,b,I) && oplay_attack_either(*,a,b,c,a,c)
+;oplay_defend_both(*,b,a,b,I)!=WIN && oplay_attack_either(*,a,b,c,a,c)
 ;&& oplay_attack_either(*,b,a,d,e,f,g,h,f,h)
-;&& !oplay_defend_both(*,b,a,d,e,g,f,g,I)
+;&& oplay_defend_both(*,b,a,d,e,g,f,g,I)!=WIN
 
 
 Pattern EC59
@@ -2229,7 +2229,7 @@
 ....
 ----
 
-; oplay_defend_both(*,a,*,b)
+; oplay_defend_both(*,a,*,b)==WIN
 
 
 Pattern EC61
@@ -2632,7 +2632,7 @@
 a*X
 ---
 
-;(safe_xmove(*) && xplay_defend_both(*,a,*,B)) || xdefend_against(a,*)
+;(safe_xmove(*) && xplay_defend_both(*,a,*,B)==WIN) || xdefend_against(a,*)
 
 
 Pattern EC106
@@ -2704,7 +2704,7 @@
 a*.X
 ----
 
-;safe_xmove(*) && xplay_defend_both(*,a,*,B)
+;safe_xmove(*) && xplay_defend_both(*,a,*,B)==WIN
 
 
 Pattern EC202
@@ -2719,7 +2719,7 @@
 ac.X
 ----
 
-;xplay_defend_both(c,a,c,B)
+;xplay_defend_both(c,a,c,B)==WIN
 
 
 Pattern EC203
@@ -5302,7 +5302,7 @@
 Xbd
 ---
 
-;!oplay_defend_both(b,c,a,b) && !oplay_defend_both(c,b,d,*,c,d)
+;oplay_defend_both(b,c,a,b)!=WIN && oplay_defend_both(c,b,d,*,c,d)!=WIN
 
 
 Pattern EB716
@@ -5318,7 +5318,7 @@
 Xbd
 ---
 
-;!oplay_defend_both(b,*,a,b) && oplay_defend_both(*,b,d,c,a,d)
+;oplay_defend_both(b,*,a,b)!=WIN && oplay_defend_both(*,b,d,c,a,d)==WIN
 
 
 Pattern EB717
@@ -5353,7 +5353,7 @@
 Xb.
 ---
 
-;!oplay_defend_both(b,c,a,b) && oplay_defend_both(*,c,a,*)
+;oplay_defend_both(b,c,a,b)!=WIN && oplay_defend_both(*,c,a,*)==WIN
 
 
 Pattern EB719
@@ -5370,7 +5370,7 @@
 Cee*
 ----
 
-;alive(d) && critical(e) && !oplay_defend_both(*,?,a,B,C)
+;alive(d) && critical(e) && oplay_defend_both(*,?,a,B,C)!=WIN
 
 
 ############################################################
@@ -6337,7 +6337,7 @@
 ?a*bo
 -----
 
-;xmoyo(e) && !oplay_defend_both(*,a,b,?,c,a,D) && !oplay_attack(*,a,b,c,*)
+;xmoyo(e) && oplay_defend_both(*,a,b,?,c,a,D)!=WIN && !oplay_attack(*,a,b,c,*)
 
 
 #############
@@ -7706,7 +7706,7 @@
 
 ; lib(c)>1
 ; && !oplay_attack(*,b)
-; && oplay_defend_both(*,A,*,b)
+; && oplay_defend_both(*,A,*,b)==WIN
 ; && (oplay_attack(*,A,e) || !x_alive_somewhere(D,F))
 
 
@@ -9665,7 +9665,7 @@
 ..A?
 ----
 
-;oplay_attack(*,A) && oplay_defend_both(*,c,*,b)
+;oplay_attack(*,A) && oplay_defend_both(*,c,*,b)==WIN
 
 
 Pattern ED23
@@ -10449,7 +10449,7 @@
 OBa
 
 ;xterri(a) && !attack(B) && !attack(C) && !oplay_attack(*,?,a,a)
-;&& !oplay_defend_both(*,?,a,B,C)
+;&& oplay_defend_both(*,?,a,B,C)!=WIN
 
 
 Pattern ED71
@@ -11185,7 +11185,7 @@
 cEa.
 ?EO.
 
-;lib(E)==2 && !oplay_attack(*,c) && !oplay_defend_both(*,a,b,E,D)
+;lib(E)==2 && !oplay_attack(*,c) && oplay_defend_both(*,a,b,E,D)!=WIN
 
 >test_attack_either_move(D,E);
 
@@ -11207,7 +11207,7 @@
 # dX*
 # ?a?
 # 
-# ;!oplay_defend_both(*,a,b,c,d,e)
+# ;oplay_defend_both(*,a,b,c,d,e)!=WIN
 # 
 # >antisuji(*);
 
diff -N -r -u -X .ignore gnugo-copy/patterns/patterns2.db gnugo/patterns/patterns2.db
--- gnugo-copy/patterns/patterns2.db	2006-03-27 23:18:40.000000000 +0200
+++ gnugo/patterns/patterns2.db	2007-01-17 19:43:22.000000000 +0100
@@ -99,7 +99,7 @@
 .OaO
 *dbc
 
-;oplay_attack_either(*,a,b,c,a,c) && !oplay_defend_both(*,a,b,d,c,a,d)
+;oplay_attack_either(*,a,b,c,a,c) && oplay_defend_both(*,a,b,d,c,a,d)!=WIN
 
 
 Pattern Conn105
@@ -280,7 +280,7 @@
 eaf?
 
 ;oplay_attack_either(*,a,b,c,a,c) && oplay_attack_either(*,b,a,e,b,e)
-;&& oplay_defend_both(*,c,*,f)
+;&& oplay_defend_both(*,c,*,f)==WIN
 
 
 Pattern Conn304
@@ -294,8 +294,8 @@
 Obc*
 Eaf?
 
-;oplay_attack_either(*,a,b,c,a,c) && !oplay_defend_both(*,b,a,b,E)
-;&& oplay_defend_both(*,c,*,f)
+;oplay_attack_either(*,a,b,c,a,c) && oplay_defend_both(*,b,a,b,E)!=WIN
+;&& oplay_defend_both(*,c,*,f)==WIN
 
 
 Pattern Conn305
@@ -321,7 +321,7 @@
 Obc?
 EaO*
 
-;oplay_attack_either(*,a,b,c,a,c) && !oplay_defend_both(*,b,a,b,E)
+;oplay_attack_either(*,a,b,c,a,c) && oplay_defend_both(*,b,a,b,E)!=WIN
 
 
 Pattern Conn307
@@ -334,7 +334,7 @@
 ObD?
 caO*
 
-;!oplay_defend_both(*,a,b,a,D) && oplay_attack_either(*,b,a,c,b,c)
+;oplay_defend_both(*,a,b,a,D)!=WIN && oplay_attack_either(*,b,a,c,b,c)
 
 
 Pattern Conn308
@@ -360,7 +360,7 @@
 Oa*
 EbO
 
-;!oplay_defend_both(*,a,b,a,E)
+;oplay_defend_both(*,a,b,a,E)!=WIN
 
 
 Pattern Conn310
@@ -444,7 +444,7 @@
 O*B
 .AO
 
-;!oplay_defend_both(*,A,B)
+;oplay_defend_both(*,A,B)!=WIN
 
 
 ##############################################
@@ -539,7 +539,7 @@
 OacO
 *bde
 
-;oplay_attack_either(*,a,b,c,d,e,c,e) && !oplay_defend_both(*,a,b,d,c,a,d)
+;oplay_attack_either(*,a,b,c,d,e,c,e) && oplay_defend_both(*,a,b,d,c,a,d)!=WIN
 ;&& oplay_attack(*,b,a,c,c)
 
 
@@ -583,7 +583,7 @@
 ODbO
 *Oac
 
-;!oplay_defend_both(*,a,b,a,D) && !oplay_defend_both(*,b,a,c,b,c)
+;oplay_defend_both(*,a,b,a,D)!=WIN && oplay_defend_both(*,b,a,c,b,c)!=WIN
 
 
 Pattern Conn507
@@ -687,7 +687,7 @@
 O*ac
 ?DbO
 
-;!oplay_defend_both(*,a,b,a,D) && oplay_attack_either(*,b,a,c,b,c)
+;oplay_defend_both(*,a,b,a,D)!=WIN && oplay_attack_either(*,b,a,c,b,c)
 
 
 Pattern Conn602
@@ -700,7 +700,7 @@
 Obde
 *acO
 
-;oplay_attack_either(*,a,b,c,d,e,c,e) && !oplay_defend_both(*,a,b,d,c,a,d)
+;oplay_attack_either(*,a,b,c,d,e,c,e) && oplay_defend_both(*,a,b,d,c,a,d)!=WIN
 ;&& oplay_attack(*,b,a,c,c)
 
 
@@ -745,7 +745,7 @@
 Ocb.
 d*ae
 
-;!oplay_break_through(*,a,b,*,b,e) && !oplay_defend_both(*,c,d,a,b,c,a)
+;!oplay_break_through(*,a,b,*,b,e) && oplay_defend_both(*,c,d,a,b,c,a)!=WIN
 
 
 Pattern Conn605
@@ -885,7 +885,7 @@
 ObC?
 Oa*O
 
-;!oplay_defend_both(*,a,b,a,C)
+;oplay_defend_both(*,a,b,a,C)!=WIN
 
 
 Pattern Conn703
@@ -915,8 +915,8 @@
 OcaO
 
 # This condition is not necessary but should be sufficient.
-;oplay_attack(*,e,b,e)  && !oplay_defend_both(*,b,a,c,d,b,c)
-;&& !oplay_defend_both(*,d,c,a,b,d,a)
+;oplay_attack(*,e,b,e)  && oplay_defend_both(*,b,a,c,d,b,c)!=WIN
+;&& oplay_defend_both(*,d,c,a,b,d,a)!=WIN
 
 
 Pattern Conn705
@@ -930,8 +930,8 @@
 OcaO
 
 # This condition is not necessary but should be sufficient.
-;!oplay_defend_both(*,b,a,c,d,b,c)
-;&& !oplay_defend_both(*,d,c,a,b,d,a)
+;oplay_defend_both(*,b,a,c,d,b,c)!=WIN
+;&& oplay_defend_both(*,d,c,a,b,d,a)!=WIN
 
 
 Pattern Conn706
@@ -979,7 +979,7 @@
 O*ac
 ODbO
 
-;!oplay_defend_both(*,a,b,a,D) && oplay_attack_either(*,b,a,c,b,c)
+;oplay_defend_both(*,a,b,a,D)!=WIN && oplay_attack_either(*,b,a,c,b,c)
 
 
 ###########################
@@ -1099,7 +1099,7 @@
 Dab
 ?*C
 
-;!oplay_defend_both(*,a,b,C,D) && !oplay_connect(*,C,D)
+;oplay_defend_both(*,a,b,C,D)!=WIN && !oplay_connect(*,C,D)
 
 
 #######################################
@@ -1903,7 +1903,7 @@
 ba*
 ?X?
 
-;(!attack(b) || defend(b)) && !oplay_defend_both(*,a,*,b)
+;(!attack(b) || defend(b)) && oplay_defend_both(*,a,*,b)!=WIN
 
 
 Pattern Shape30
@@ -2490,7 +2490,7 @@
 *...
 ----
 
-;!oplay_defend_both(*,a,b,c)
+;oplay_defend_both(*,a,b,c)!=WIN
 
 
 Pattern Shape73
@@ -2673,7 +2673,7 @@
 daX
 .cb
 
-;!oplay_defend_both(*,c,a,b) && oplay_attack(d,c,c)
+;oplay_defend_both(*,c,a,b)!=WIN && oplay_attack(d,c,c)
 
 
 Pattern Shape84
@@ -3110,7 +3110,7 @@
 fg*
 
 ;lib(a)>1 && o_alive_somewhere(e,f,g) && !attack(B) && !attack(C)
-;&& !oplay_defend_both(*,?,d,B,C)
+;&& oplay_defend_both(*,?,d,B,C)!=WIN
 
 
 Pattern Sente16
@@ -3128,7 +3128,7 @@
 a*X
 ---
 
-;xplay_attack(*,a,b,*) && xplay_defend_both(*,a,b,*,b)
+;xplay_attack(*,a,b,*) && xplay_defend_both(*,a,b,*,b)==WIN
 
 
 Pattern Sente17
@@ -3144,7 +3144,7 @@
 a*bX
 ----
 
-;alive(d) && !xplay_defend_both(*,a,b,?,c,a,d)
+;alive(d) && xplay_defend_both(*,a,b,?,c,a,d)!=WIN
 
 
 Pattern Sente18
@@ -3307,7 +3307,7 @@
 *a
 bX
 
-;!xplay_defend_both(*,a,b)
+;xplay_defend_both(*,a,b)!=WIN
 
 >add_defend_both_move(a,b);
 
@@ -3322,8 +3322,8 @@
 *ca
 ?bX
 
-;!xplay_defend_both(c,a,b)
-;&& (oplay_attack(*,c,c) || oplay_defend_both(*,c,a,b))
+;xplay_defend_both(c,a,b)!=WIN
+;&& (oplay_attack(*,c,c) || oplay_defend_both(*,c,a,b)==WIN)
 
 >add_defend_both_move(a,b);
 
@@ -3341,7 +3341,7 @@
 Dba
 
 ;oplay_attack(*,D) && oplay_attack_either(*,a,D,E)
-;&& !oplay_defend_both(*,b,c,D,E)
+;&& oplay_defend_both(*,b,c,D,E)!=WIN
 
 >test_attack_either_move(D,E)
 
@@ -3360,7 +3360,7 @@
 db*
 
 ;xplay_attack(a,d) && xplay_attack_either(a,*,d,e)
-;&& !xplay_defend_both(a,b,c,d,e) && !xplay_defend_both(a,c,b,d,e)
+;&& xplay_defend_both(a,b,c,d,e)!=WIN && xplay_defend_both(a,c,b,d,e)!=WIN
 ;&& !xplay_connect(a,d,e) && oplay_connect(*,a,d,e)
 
 >add_defend_both_move(d,e);
@@ -3430,7 +3430,7 @@
 ca.
 Xb*
 
-;safe_xmove(a) && !xplay_defend_both(a,b,c) && oplay_defend_both(*,a,b,c)
+;safe_xmove(a) && xplay_defend_both(a,b,c)!=WIN && oplay_defend_both(*,a,b,c)==WIN
 
 >add_defend_both_move(b,c);
 
@@ -3462,7 +3462,7 @@
 ca*
 Xb.
 
-;safe_xmove(a) && !xplay_defend_both(a,b,c) && oplay_defend_both(*,a,b,c)
+;safe_xmove(a) && xplay_defend_both(a,b,c)!=WIN && oplay_defend_both(*,a,b,c)==WIN
 
 >add_defend_both_move(b,c);
 
@@ -3478,7 +3478,7 @@
 ?Xc
 
 ;(alive(b) || alive(c))
-;&& safe_xmove(a)==WIN && !xplay_defend_both(a,b,c) && oplay_attack(*,a,a)==WIN
+;&& safe_xmove(a)==WIN && xplay_defend_both(a,b,c)!=WIN && oplay_attack(*,a,a)==WIN
 
 >add_defend_both_move(b,c);
 
@@ -3518,7 +3518,7 @@
 ---
 
 ;lib(A)==3 && !oplay_attack(*,E) && oplay_attack(*,d,A)
-;&& !oplay_defend_both(*,c,d,A,B)
+;&& oplay_defend_both(*,c,d,A,B)!=WIN
 
 >test_attack_either_move(A,B)
 
@@ -3541,7 +3541,7 @@
 ---
 
 ;lib(a)==3 && !attack(e) && xplay_attack(*,d,a)
-;&& !xplay_defend_both(*,c,d,a,b)
+;&& xplay_defend_both(*,c,d,a,b)!=WIN
 
 >add_defend_both_move(a,b)
 
