• Akim Demaille's avatar
    split: fix the handling of extended expressions · febae8b1
    Akim Demaille authored
    Our handling of `&`, modeled after `.`, was dead wrong.  The point is
    to capture all the sums that appear at the top-level, so `(a?)[bc]` is
    split in `b⊕c⊕a(b+c)`.  This did require to splut `[bc]` because `a?`
    is nullable.
    However, doing the same with `&` splits `(a?)&[bc]` into
    `b⊕c⊕a&(b+c)`, which is obviously wrong (e.g., the latter accepts `b`
    but not the former).
    Don't try to split extended operators.  Eventually, we might decide to
    distribute from the left to the right, in which case `(a?)&[bc]`
    should be split in `\e&[bc] ⊕ a&[bc]`, but not what we had currently.
    See issue #149 about that.
    * vcsn/algos/split.hh: Avoid recreating equivalent expressions:
    just reuse the expression itself when there is nothing to do.
    * tests/bin/test.py (shortest): New.
    * tests/python/split.py (check): Check that the split expression is
    equivalent to the expression itself.
    Check extended operators.