1. 01 May, 2018 5 commits
    • Akim Demaille's avatar
      tests: change object pretty-printer · c376ad2c
      Akim Demaille authored
      * tests/bin/ipynbdoctest.py: Let's try to look like the actual output
      from IPython.  It's output is pretty-printed, but it does not look
      like what I get using pprint.  They seem use the json module.
      
      * tests/bin/update-test: Enable patches based on diffs.
      c376ad2c
    • Akim Demaille's avatar
      Tests: fix portability to newest IPython · 491c1944
      Akim Demaille authored
      It now fails when an exception escapes.
      491c1944
    • Akim Demaille's avatar
      Tests: add logs · f73ececa
      Akim Demaille authored
      It took me way too long to understand the new failure...
      f73ececa
    • Akim Demaille's avatar
      python: sort the info dictonary · 45e95439
      Akim Demaille authored
      To match the fact that dictionaries are sorted in Python 3.7, IPython
      no longer sort the dictionaries when displaying
      them (https://github.com/ipython/ipython/issues/10110).
      
      So build them in the sorted order, so that our notebook tests produce
      the expected output.
      45e95439
    • Akim Demaille's avatar
      fst: support fstinfo · f4cbaa83
      Akim Demaille authored
      I wanted to know where OpenFST stands on is-deterministic when there
      are spontaneous transitions.  The answer is: Open FST does not care
      about them wrt determinism: the `one` label is treated like any other
      label.
      
      This is something I was considering for Vcsn too...  But I'm uneasy
      with this, so I think I will rather introduce a new property P, and
      define deterministic as having P and no spontaneous transitions.
      
      See also #196.
      
      * python/vcsn/automaton.py (fstinfo): New.
      * tests/python/efsm.py: Check.
      f4cbaa83
  2. 29 Mar, 2018 1 commit
  3. 28 Mar, 2018 3 commits
  4. 27 Mar, 2018 3 commits
  5. 25 Mar, 2018 6 commits
  6. 23 Mar, 2018 1 commit
  7. 22 Mar, 2018 5 commits
    • Akim Demaille's avatar
      Sms2fr: use xz · c6c0218c
      Akim Demaille authored
      Now that we support compressed efsm, let's compress the efsm
      files of sms2fr.  Not only will this save space, it should also
      help with sites that claim that Vcsn is 98.3% of shell-scripts...
      
      The results with Xz are impressive: graphemic.efsm is reduced to
      5% of its original size, and syntactic.efsm 12%.
      
          -rw-r--r--   1 akim  staff  93099091 21 mar 23:46 graphemic.efsm
          -rw-r--r--   1 akim  staff  11713613 21 mar 19:05 graphemic.efsm.bz2
          -rw-r--r--   1 akim  staff   5502716 21 mar 23:22 graphemic.efsm.xz
          -rw-r--r--   1 akim  staff  62289670 21 mar 23:46 syntactic.efsm
          -rw-r--r--   1 akim  staff  13055960 13 mar 19:44 syntactic.efsm.bz2
          -rw-r--r--   1 akim  staff   7916576 21 mar 23:24 syntactic.efsm.xz
      
      And Vcsn is now 68.8% C++, 20.6% Python and 3.5% shell-script!
      
      While at it:
      - use int not char for options
      - don't use references to keep the automata
      - don't force the format to efsm: let vcsn guess the format
      c6c0218c
    • Akim Demaille's avatar
      efsm: add support for lzma/xz compressed files · a1eb6462
      Akim Demaille authored
      * lib/vcsn/algos/efsm.cc (read_efsm_lzma): New.
      * lib/vcsn/algos/read.cc (guess_automaton_format): Recognize
      efsm,lzma.
      a1eb6462
    • Akim Demaille's avatar
      efsm: add support for bzip2 compressed files · ce9412ef
      Akim Demaille authored
      * configure.ac: Look for Boost.IOStreams.
      * lib/vcsn/algos/efsm.cc (read_efsm_bzip2): New.
      * lib/vcsn/algos/read.cc (guess_automaton_format): Recognize
      efsm,bzip2.
      ce9412ef
    • Akim Demaille's avatar
      efsm: revamp reader to propagate location · 0f0bacfe
      Akim Demaille authored
      However, the location is still empty and not maintained.
      0f0bacfe
    • Akim Demaille's avatar
      git: update ignores · 2355935f
      Akim Demaille authored
      2355935f
  8. 21 Mar, 2018 3 commits
    • Akim Demaille's avatar
      dyn: provide context in errors · 8fd088b6
      Akim Demaille authored
      After a chown preventing me from reading my own dirs:
      
      In [2]: vcsn.B.expression('a@a')
      ---------------------------------------------------------------------------
      RuntimeError                              Traceback (most recent call last)
      <ipython-input-2-2c64004c7018> in <module>()
      ----> 1 vcsn.B.expression('a@a')
      
      RuntimeError: cannot create /Users/akim/src/lrde/2/_build/6s/lib/plugins/algos/compose_expression/expressionset<context<letterset<char_letters>, b>>, expressionset<context<letterset<char_letters>, b>>.71627.cc: Permission denied
        while compiling compose_expression for expressionset<context<letterset<char_letters>, b>>, expressionset<context<letterset<char_letters>, b>>
        while reading expression: "a@a"
      
      * lib/vcsn/dyn/translate.cc: Use auto.
      Prefer operator() for function objects.
      Provide context in exceptions.
      8fd088b6
    • Akim Demaille's avatar
      dyn: check that we can write in the output files · 50a59184
      Akim Demaille authored
      If the user does not have permissions to write in the plugin dir, make
      a clear error message.
      50a59184
    • Akim Demaille's avatar
      style: use auto · d952e81d
      Akim Demaille authored
      d952e81d
  9. 20 Mar, 2018 10 commits
    • Akim Demaille's avatar
      NEWS: add rules and a logo · 5e8c114c
      Akim Demaille authored
      5e8c114c
    • Akim Demaille's avatar
      doc: improve the README · 2f46df4c
      Akim Demaille authored
      - add support for `make doxygen`
      - give more details about the doc, including `vcsn doc`
      2f46df4c
    • Akim Demaille's avatar
      vcsn doc, vcsn config: new commands · 6d8a67f9
      Akim Demaille authored
      * configure.ac (DOCDIR): Export it.
      * bin/vcsn.in (config, vcsn_doc): New.
      Use them.
      6d8a67f9
    • Akim Demaille's avatar
      doc: update NEWS · b12aab87
      Akim Demaille authored
      b12aab87
    • Akim Demaille's avatar
      examples: clean up · 19b51345
      Akim Demaille authored
      * tests/demo/conjunction.cc: Here.
      19b51345
    • Akim Demaille's avatar
      doc: simplify · 7ac53a72
      Akim Demaille authored
      Now that the promotion from single-tape to multitape works, we can use
      single-tape expressions to simplify.
      7ac53a72
    • Akim Demaille's avatar
      ctx: fix instantiations · 133ece89
      Akim Demaille authored
      * vcsn/ctx/instantiate.hh (copy_expression): Second argument is a
      context, not an expressionset.
      133ece89
    • Akim Demaille's avatar
      rat: let copy avoid useless copies · 3ab74ed1
      Akim Demaille authored
      Somewhat related to #205: `copy does not preserve physical sharing`.
      
      Currently the expression parser, when it has finished parsing,
      compares the input context with the context of the produced
      expression, and if they differ, it calls `copy` to convert the
      expression to the input context.
      
      This is because when we parse `a` in `lal<lal>`, we actually get `a`
      as `lal` and then we copy-convert it to `a` in `lat<lal>`.
      
      The comparison between the input context and the context of the result
      is done on their snames (because so far we have nothing else to
      compare two contexts).  This is fragile, and is actually broken by the
      forthcoming change that shows openness of contexts in their snames.
      So if we parse `a` with `[...] -> b`, we actually get `a` with `[a] ->
      b` and so we copy this `a`.  This shows in particular when parsing
      `a{5}` because as of today copy does not preserve physical sharing, so
      the parser breaks the nice sharing of `a` in `a{5}` to end with five
      copies of `a` (this is issue #205).
      
      It turns out that since expressions are immutable, `copy` should just
      as well _not_ copy when it's useless.  This simplifies the parser, is
      faster (no string comparisons of snames), and is actually saving from
      more useless conversions (since we do not need to convert `a{5}` when
      going from `[a] -> b` to `[ab] -> b` or any other sort of useless case
      where the context types are actually the same).
      
      Tests are needed...
      
      * vcsn/core/rat/copy.hh: Avoid useless copies.
      * lib/vcsn/rat/parse.yy: Always copy/convert: let it do its job.
      * vcsn/ctx/instantiate.hh: Be sure to instantiate it by default,
      now that it's used when parsing any expression.
      Adjust dependencies.
      3ab74ed1
    • Akim Demaille's avatar
      rat: let the parser display when it's performing conversion · 90b18b11
      Akim Demaille authored
      We may have to pay for conversion (which can be costly, see
      https://gitlab.lrde.epita.fr/vcsn/vcsn/issues/205) although the
      expression does not need it.  That happens when for instance the
      "input" context is empty and open, and the one we obtained contain
      letters...  That's stupid, we should not pay for copy/conversion in
      that case, but at least we need to be able to see it.
      90b18b11
    • Akim Demaille's avatar
      rat: convert the expression after parsing, if needed · cc0fc3f6
      Akim Demaille authored
      Sometimes we get failures in random_expression for lat.  The reason is
      that we generate a \e, and `exp('\e')` fails in lat.  There is code in
      the parser to convert to multiband if needed, but it was not generic
      enough.  And we actually already have solved this problem with `conv`
      routines which use partial_identity to move from single-tape to
      multitape.
      
      However, `conv` is not accessible in dyn, but `copy` is.  But it is
      very expensive on large expressions such as the ones used in vcsn
      score.  So let's avoid this cost when it is not needed.  Unfortunately
      we have no means to compare two contexts, so... we print their snames
      and compare them.
      
      * lib/vcsn/rat/parse.yy: here.
      cc0fc3f6
  10. 19 Mar, 2018 2 commits
    • Akim Demaille's avatar
      nullableset: check the validity of conversions · e90ab237
      Akim Demaille authored
      Conversion from letterset to letterset is checked:
      
          In [2]: c = vcsn.context('lat<lal(abc), lal(xyz)>, b')
          In [3]: c.expression('a')
          RuntimeError: 1.1: {xyz}: conv: invalid label: a
            while converting expression "a" to RatE[{abc} x {xyz} -> B]
          a
          ^
            while reading expression: "a"
      
      But it was not checked for nullableset, so we build `a|a` although
      `a` is not supported by the second labelset.
      
      There are no tests because the following commit (rat: convert the
      expression after parsing, if needed) exercises this case.
      
      * vcsn/labelset/nullableset.hh (conv): Check conversion.
      e90ab237
    • Akim Demaille's avatar
      tupleset: is_valid · 41f46a65
      Akim Demaille authored
      Will be needed in the next commit.
      41f46a65
  11. 18 Mar, 2018 1 commit
    • Akim Demaille's avatar
      build: don't accept C++17 · 1b5a5961
      Akim Demaille authored
      Vcsn 2 is not meant to require C++17, and some already went into it by
      accident (if constexpr, see previous commit).  Avoid this.
      1b5a5961