[Top][All Lists]

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

[gnugo-devel] possible bug in dfa matching of GnuGo

From: mike polyakov
Subject: [gnugo-devel] possible bug in dfa matching of GnuGo
Date: Wed, 24 Apr 2002 01:56:13 -0400

I'm using GnuGo's dfa code as part of my own evolutionary-oriented Go program (a student project). Basically i copied dfa.c, dfa.h and patterns.h to my directory without modifying them. I put the match_pattern function into my own code and modified it to be compatible. For the most part it works fine but occasionally an assertion in do_sync_product (int l, int r) fails:

      nextr = gpright->states[r].next[c];
      gg_assert (nextr < gpright->lastState + 1);

because r is being passed in as -1 (by another instance of do_sync_product).
The strings that I pass to the dfa's are 25 characters or less, and there's only a few of them. The strings that cause the assertion to fail (the root caller of do_sync_product is dfa_add_string()) are no different than other strings that work harmlessly. When it does happen, it's always when maxStates (of some dfa used in construction) goes from 256 to 131328 - though at other times this causes no problems. I am compiling in cygwin(a recent version) with g++ 2.95.3-5. It could be a bug on my part though I don't see how. If you have any ideas, or have come across similar problems in dfa constructions please let me know

reply via email to

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