[Top][All Lists]

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

[gnugo-devel] preparation for a new pattern matcher patch

From: Paul Pogonyshev
Subject: [gnugo-devel] preparation for a new pattern matcher patch
Date: Tue, 17 Dec 2002 23:29:07 +0200

this patch is mostly a preparation for hacking in the new
(joseki) pattern matcher. i post it now, since it touches a
lot of files and will probably conflict with many other
patches if i wait till it is completed.

currently, it conflicts with Arrend's influence cleanup
patch, at least on mkpat.c. but it must be trivial to

full list of changes (most likely not for the change log):
- mkpat cleaned a bit
- some options (not those currently in use) in mkpat changed
- autohelpers take `patt' argument no more (this caused
  modifications to many files)
- set_value_helper() retired and replaced with inline code,
  generated by mkpat
- structures for the coming pattern matcher defined in

i removed the `struct pattern *patt' argument from autohelpers
for several reasons. first of all, i wanted autohelpers to be
uniform for all pattern matchers and corner pattern matcher
(it will be anchored in corners and work for joseki and fuseki
databases only) won't use the `pattern' structure.

further, autohelpers are meant to work for a single pattern
only, so there's no need to pass the address, it can be
evaluated at build time.

and finally, that argument was never used in active code. it
was only used by set_value_helper() from experimental reading
databases. i added infrastructure to mkpat.c to replace
`set_value(n)' with `value = n'. now it works inline (not
as a call to set_value_helper()) and looks even better (at
least i think so :).

if a need to access the pattern structure by other means
than `value' ever arises, it can be satisfied in much the
same way as you add new pseudo-functions (`xlib', `attack'
etc.) to mkpat (see implementation of `value' in mkpat.c).

it is now possible to omit parenthesis if a pseudo-function
takes no parameters (that's why i could write `value = n',
not `value() = n'). currently, it can be applied to `goallib',
`remaining_handicap_stones', `total_handicap_stones' and
`value' itself. since it is not very important (and not
everyone might like it) i didn't remove parenthesis from
those pseudo-functions. this can be done later, or the things
may be left as they are.

the patch is rather large, so i send it gzipped.


Attachment: matchpat.patch.gz
Description: GNU Zip compressed data

reply via email to

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