mhulden / foma

Automatically exported from code.google.com/p/foma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single-insertion rule does not work in some cases

coltekin opened this issue · comments

The single-insertion rule seems to fail in some cases. With multiple parallel rules, the insertion conditioned on a LHS symbol is ignored if another rule rewrites it as multiple symbols. A quick git bisect points to commit ffbbc06, but I could not figure out the cause, it may also be affecting other operations/cases.

Here is the behavior before (expected):

foma[0]: regex a -> b c ,, [..] -> x || a _;
490 bytes. 3 states, 7 arcs, Cyclic.
foma[1]: down a
bcx

Current:

foma[0]: regex a -> b c ,, [..] -> x || a _;
432 bytes. 2 states, 5 arcs, Cyclic.
foma[1]: down a
bc

If the first rewrite rule has a single-symbol RHS, it seems to work:

foma[1]: regex a -> b ,, [..] -> x || a _;
432 bytes. 2 states, 5 arcs, Cyclic.
foma[2]: down a
bx