[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] list all owl pattern matches?

From: Gunnar Farneback
Subject: Re: [gnugo-devel] list all owl pattern matches?
Date: Wed, 28 Nov 2001 20:14:13 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Trevor wrote:
>  - list all matching patterns, not just 3 (something like -a)

All matched patterns are listed in the trace output if you use "-t"
together with "--decide-dragon".

>  - list all matching patterns, ignoring constraints
>     (would probably want to limit to patterns of a certain size)

I'm not sure how useful this would really be. In some situations one
can get far with a simple trick. Assume you're debugging a pattern
with a complex constraint, say this one

Pattern A1610
# gf New pattern. (3.1.11)

OXXX?      edge tesuji


bAAA?      edge tesuji

;lib(A)==3 && !attack(b) && !oplay_attack(*,c,d,e,f,f)

In order to see whether the pattern matches except for the constraint
and what's more exactly going on with the constraint, we can replace
it by

;gprintf("A1610: %d %d %d\n", lib(A), attack(b), oplay_attack(*,c,d,e,f,f)),
;lib(A)==3 && !attack(b) && !oplay_attack(*,c,d,e,f,f)

Notice that the comma operator in C discards the result of the first
operand (after evaluating it) and instead returns the second operand.
Hence the constraint will work exactly like before but now we get a
debug output every time the pattern is matched geometrically.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]