Skip to content
  • Akim Demaille's avatar
    proper: strip the nullable part of the result · 83b309f6
    Akim Demaille authored
    Our (current) implementation of `proper` is in-place, and as a
    consequence, the result features the same context as the input
    automaton: a nullable labelset.
    
    Now it return a labelset un-nullabled _if possible_.
    
    To this end, `proper` now performs two copies: the initial one to be
    able to modify the working copy of the input automaton, and a final
    one to rewrite the automaton in the context with removed support for
    spontaneous transitions.
    
    There is no real noted performance regression:
    
       before  after
        2.39    2.41  a.proper()           # a = thompson(a?{1200})
    
    * vcsn/algos/proper.hh (proper): Do that.
    * vcsn/labelset/nullableset.hh: .
    * python/vcsn/automaton.py (_lan_to_lal, proper): Remove, now useless.
    * python/vcsn_cxx.cc (proper): Bind under its real name.
    * vcsn/labelset/tupleset.hh (conv): Add support to strip an outter
    nullableset.
    
    * tests/bin/test.py (normalize): New.
    (CHECK_EQUIV): Use it.
    * tests/python/compose.py, tests/python/proper.py, bin/vcsn-score: Adjust.
    83b309f6