1. 22 Oct, 2013 7 commits
    • Akim Demaille's avatar
      WIP: even more visibility. · beb08417
      Akim Demaille authored
      * vcsn/algos/make-context.hh: .
      * vcsn/alphabets/char.hh: .
      * vcsn/alphabets/setalpha.hh: .
      * vcsn/core/rat/info.hh: .
      * vcsn/core/rat/less-than.hh: .
      * vcsn/core/rat/printer.hh: .
      * vcsn/core/rat/ratexp.hh: .
      * vcsn/core/rat/transpose.hh: .
      * vcsn/core/rat/visitor.hh: .
      * vcsn/ctx/context.hh: .
      * vcsn/dyn/polynomial.hh: .
      * vcsn/dyn/polynomialset.hh: .
      * vcsn/dyn/ratexp.hh: .
      * vcsn/dyn/ratexpset.hh: .
      * vcsn/dyn/weight.hh: .
      * vcsn/empty.hh: .
      * vcsn/labelset/genset-labelset.hh: .
      * vcsn/labelset/letterset.hh: .
      * vcsn/labelset/nullableset.hh: .
      * vcsn/labelset/oneset.hh: .
      * vcsn/labelset/wordset.hh: .
      beb08417
    • Akim Demaille's avatar
      build: fix '-fvisibility' use for Clang, part II · 9725ba97
      Akim Demaille authored
      This is more troublesome.  Consider a public (visibility=default)
      class template 'derived<T>', parameterized with private
      (visibility=invisible) type 'payload'.  The resulting type
      'derived<payload>' is uniquely defined for G++, and _not_ for Clang++.
      As a result, dynamic_cast fails with Clang++, not with G++.
      
      We have this problem with concrete_abstract_weight<WeightSet>: Clang
      requires the WeightSet to be public.
      
      See http://stackoverflow.com/questions/19496643.
      
      * vcsn/core/rat/ratexpset.hh, vcsn/dyn/weight.hh,
      * vcsn/dyn/weightset.hh, vcsn/weights/b.hh, vcsn/weights/f2.hh,
      * vcsn/weights/polynomialset.hh, vcsn/weights/q.hh, vcsn/weights/r.hh,
      * vcsn/weights/z.hh, vcsn/weights/zmin.hh:
      Declare these classes/class templates as public.
      9725ba97
    • Akim Demaille's avatar
      build: fix '-fvisibility' use for Clang, part I · 018ae4e8
      Akim Demaille authored
      Clang does not support namespace attributes.  A pity.
      
      * vcsn/misc/attributes.hh (ATTRIBUTE_DLLEXPORT, ATTRIBUTE_DLLIMPORT): New
      for Clang.
      * vcsn/dyn/algos.hh, vcsn/misc/escape.hh, vcsn/misc/stream.hh,
      * lib/vcsn/rat/read.hh: Do not use the namespace attributes.
      018ae4e8
    • Akim Demaille's avatar
      build: apply visibility flags to all the compilations · eaf28913
      Akim Demaille authored
      * Makefile.am: here.
      * lib/local.mk, lib/vcsn/local.mk: Simplify.
      eaf28913
    • Akim Demaille's avatar
      style: formatting changes · fcc66b7c
      Akim Demaille authored
      * vcsn/ctx/lal_char_b.hh: here.
      fcc66b7c
    • Akim Demaille's avatar
      build: useless include · ff0053b9
      Akim Demaille authored
      * vcsn/core/transition.hh: here.
      Touching b.hh should not trigger the recompilation of all the contexts!
      ff0053b9
    • Akim Demaille's avatar
      style: remove useless semicolons · 8a1d818e
      Akim Demaille authored
      * vcsn/dyn/automaton.hh, vcsn/dyn/context.hh,
      * vcsn/dyn/polynomial.hh, vcsn/dyn/ratexp.hh,
      * vcsn/dyn/weight.hh: Here.
      8a1d818e
  2. 18 Oct, 2013 4 commits
    • Akim Demaille's avatar
      build: address compiler warnings · f402b3e2
      Akim Demaille authored
      * vcsn/algos/aut-to-exp.hh, vcsn/algos/product.hh: Beware of signedness.
      f402b3e2
    • Akim Demaille's avatar
      build: enable diagnostics about Doxygen documentation · 92cc22db
      Akim Demaille authored
      * configure.ac: here.
      For Clang.
      92cc22db
    • Akim Demaille's avatar
      todo: remove dead tasks · 92c55fa6
      Akim Demaille authored
      92c55fa6
    • Akim Demaille's avatar
      power: fix the implementation · a1259e7d
      Akim Demaille authored
      The implementation was buggy:
      
        $ for i in 1 2 3 4 5 6 7 8
          do
           printf "$i "
           vcsn-power -f share/vcsn/lal_char_z/c1.gv $i | vcsn-evaluate -f - ba
          done
        1 2
        2 4
        3 8
        4 16
        5 64
        6 64
        7 512
        8 256
      
      Interestingly, it is not always a clear speed-up to use the
      square-based exponentiation, plain iterative products might be faster.
      This would require a more thorough bench evaluation.  Other factors
      (especially the implementation of transitions in mutable_automaton)
      are expected to interfere.
      
      This is "vcsn power -O null -f binary.gv $i":
                8    9    10   11   12   13   14   15     16
      products 0.05 0.06 0.11 0.17 0.45 1.54 6.43 28.65 145.95
      squares  0.06 0.05 0.06 0.08 0.19 0.71 3.51 19.10 207.46
      
      Score:
        7.93s (0.05s+7.88s): ladybird 21 | determinize -O null
        0.10s (0.05s+0.05s): de-bruijn 20 | evaluate -O null -f - aaaaaaaaaaaaaaaaaaaaa
       11.65s (0.85s+10.80s): thompson -C "lan_char(a)_b" -Ee "a?{2000}" | proper -O null
       21.30s (9.52s+11.78s): standard -Ee "(a+b+c+d)?{100}" | aut-to-exp -O null
        0.51s (0.05s+0.46s): standard -C "lal_char(ab)_z" -Ee "(a+b)*b(<2>a+<2>b)*" | power -O null -f- 10
        0.05s (0.05s): standard -E -e "(a?){70}" -o a70.gv
       12.69s (12.69s): product -O null -f a70.gv a70.gv
        0.19s (0.19s): shuffle -O null -f a70.gv a70.gv
       15.87s (15.87s): infiltrate -O null -f a70.gv a70.gv
      
      * vcsn/ctx/context.hh (operator=): New.
      * vcsn/core/mutable_automaton.hh (context_): No longer const, to allow...
      (operator=): the definition of a move-assignment operator.
      * vcsn/algos/product.hh (power): Fix the implementation.
      
      * tests/tafkit/power.dir/binary^0.gv, tests/tafkit/power.dir/binary^1.gv:
      New, extracted from...
      * tests/tafkit/power.chk: Here.
      Adjust.
      Check the previous failures (e.g., 2^5 => 32, not 64).
      a1259e7d
  3. 17 Oct, 2013 5 commits
    • Luca Saiu's avatar
      product: require is_commutative from the weightset · f78e084a
      Luca Saiu authored
      * vcsn/algos/product.hh: Here.
      * vcsn/ctx/instantiate.hh (register_commutative_semiring_kind_functions): Add.
      * vcsn/algos/info.hh (is_ambiguous): Adjust enable_if condition.
      
      * tests/tafkit/infiltrate.chk, tests/tafkit/product.chk,
      * tests/tafkit/shuffle.chk: Verify failure on non-commutative weightsets.
      f78e084a
    • Luca Saiu's avatar
      weightsets: define is_commutative_semiring · 562d2b27
      Luca Saiu authored
      * vcsn/core/rat/ratexpset.hh: Here.
      * vcsn/weights/b.hh: Here.
      * vcsn/weights/f2.hh: Here.
      * vcsn/weights/polynomialset.hh: Here.
      * vcsn/weights/q.hh: Here.
      * vcsn/weights/r.hh: Here.
      * vcsn/weights/z.hh: Here.
      * vcsn/weights/zmin.hh: Here.
      562d2b27
    • Luca Saiu's avatar
      product, shuffle, infiltration: factor the common parts · 66b912fc
      Luca Saiu authored
      The infiltration algorithm is essentially a combination of product and
      shuffle.  Factor the common operations into private methods.
      
      * vcsn/algos/product.hh: Here.
      66b912fc
    • Luca Saiu's avatar
      score: bench shuffle and infiltration · c6812c5b
      Luca Saiu authored
      c6812c5b
    • Luca Saiu's avatar
      infiltrate: new algorithm (static, dyn, TAF-Kit) · 452f6e62
      Luca Saiu authored
      * vcsn/algos/product.hh (infiltrate): Add algorithm.
      * vcsn/ctx/instantiate.hh: Adjust.
      * vcsn/dyn/algos.hh: Adjust.
      * lib/vcsn/algos/product.cc: Adjust.
      * bin/vcsn-infiltrate.cc: New.
      * bin/local.mk: Adjust.
      
      * tests/tafkit/infiltrate.chk: New.
      * tests/tafkit/local.mk: Adjust.
      452f6e62
  4. 15 Oct, 2013 9 commits
    • Akim Demaille's avatar
      todo: more details · 1e40f3d3
      Akim Demaille authored
      1e40f3d3
    • Akim Demaille's avatar
      derived-terms: new algorithm (static, dyn, TAF-Kit) · e581f2c0
      Akim Demaille authored
      * vcsn/algos/derive.hh (derived_terms): New.
      * vcsn/ctx/instantiate.hh: Instantiate.
      * vcsn/dyn/algos.hh (dyn::derived_terms): Declare.
      * lib/vcsn/algos/derive.cc: Implement it.
      
      * bin/vcsn-derived-terms.cc: New.
      * bin/local.mk: Compile it.
      
      * tests/tafkit/derive.dir/e1-dt.gv: New.
      * tests/tafkit/local.mk: Adjust.
      * tests/tafkit/derive.chk: Check derived-terms.
      e581f2c0
    • Akim Demaille's avatar
      style: put derive into its own library file · 2949963f
      Akim Demaille authored
      Currently it share the one of constant-term, but since more algorithms
      will live in derive.hh, split it not.
      
      * lib/vcsn/algos/constant-term.cc (derive): Move to...
      * lib/vcsn/algos/derive.cc: New.
      * lib/vcsn/local.mk: here.
      2949963f
    • Akim Demaille's avatar
      dyn::eliminate_state · c92654db
      Akim Demaille authored
      New algorithm, which provides the user with a means to control the
      order of state elimination.  There are still issues to treat:
      - we need the actual state number, not the one displayed by dot
      - we need better control on the state number
      - we need to provide a dyn:: access to state selection
      
      * vcsn/algos/aut_to_exp.hh (dyn::eliminate_state): New.
      * lib/vcsn/algos/aut-to-exp.cc, vcsn/ctx/instantiate.hh,
      * vcsn/dyn/algos.hh: Adjust.
      * bin/vcsn-eliminate-state.cc: New.
      * bin/local.mk, common.mk: Adjust.
      
      * tests/tafkit/aut-to-exp.dir/lao-elim-0.gv,
      * tests/tafkit/aut-to-exp.dir/lao-elim-1.gv,
      * tests/tafkit/aut-to-exp.dir/lao-elim-2.gv,
      * tests/tafkit/aut-to-exp.dir/lao.gv: New test files.
      * tests/tafkit/aut-to-exp.chk: Use them.
      c92654db
    • Akim Demaille's avatar
      10c0336f
    • Akim Demaille's avatar
      packages: initiate a MacPorts package · 43c65988
      Akim Demaille authored
      * configure.ac: Let's go for "vaucanson 2b.XX" as numbering scheme for betas.
      * ports/Portfile: New.
      43c65988
    • Akim Demaille's avatar
      build: control the size of the library symbol table · ad226c61
      Akim Demaille authored
      Instead of explicitly hiding the symbols that must not be exported, do
      the converse: require that by default symbols are _not_ exported, but
      in turn explicitly flag what symbols must be exported.
      
      The vcsn/misc/export.hh file provide a symbol, LIBVCSN_API, which must
      be explicitly used to flag symbols to export, _and_ used to import
      them in callers.
      
      Of course all the dyn/algos.hh signature must be exported, which is
      easy to write thanks to the namespace attributes syntax from GCC.
      Likewise for algorithms in vcsn/misc that are actually implemented in
      *.cc files.
      
      What was not really expected is that explicit class template
      instantiations must also be flagged with LIBVCSN_API (see for instance
      its uses in vcsn/ctx/instantiate.hh).
      
      On my machine, using 4.8, I get a significant reduction of the library
      sizes (roughly 20%):
      
        920K -> 732K liblal_char_b.0.dylib
        1,1M -> 788K liblal_char_br.0.dylib
        840K -> 660K liblal_char_q.0.dylib
        828K -> 656K liblal_char_r.0.dylib
        840K -> 660K liblal_char_z.0.dylib
        848K -> 664K liblal_char_zmin.0.dylib
        1,1M -> 800K liblal_char_zr.0.dylib
        1,2M -> 912K liblal_char_zrr.0.dylib
        864K -> 680K liblan_char_b.0.dylib
        844K -> 660K liblan_char_r.0.dylib
        832K -> 648K liblan_char_z.0.dylib
        1,1M -> 812K liblan_char_zr.0.dylib
        816K -> 628K liblao_br.0.dylib
        572K -> 464K liblao_z.0.dylib
        768K -> 604K liblaw_char_b.0.dylib
        964K -> 740K liblaw_char_br.0.dylib
        796K -> 628K liblaw_char_q.0.dylib
        780K -> 620K liblaw_char_r.0.dylib
        768K -> 608K liblaw_char_z.0.dylib
        780K -> 616K liblaw_char_zmin.0.dylib
        968K -> 748K liblaw_char_zr.0.dylib
        1,1M -> 848K liblaw_char_zrr.0.dylib
        764K -> 720K libvcsn.0.dylib
      
         20M -> 16M  TOTAL
      
      There is no compilation speed-up (or I failed to measure it).  However
      we _might_ benefit from a small speed-up when launching TAF-Kit (as the
      dynamic loader as a simpler job to do):
      
      Before:
        8.53s (0.08s+8.45s): ladybird 21 | determinize -O null
        0.17s (0.08s+0.09s): de-bruijn 20 | evaluate -O null -f - aaaaaaaaaaaaaaaaaaaaa
       12.84s (1.03s+11.81s): thompson -C "lan_char(a)_b" -Ee "a?{2000}" | proper -O null
       23.30s (10.37s+12.93s): standard -Ee "(a+b+c+d)?{100}" | aut-to-exp -O null
        7.27s (0.07s+7.20s): standard -C "lal_char(ab)_z" -Ee "(a+b)*b(<2>a+<2>b)*" | power -O null -f- 10
        0.07s (0.07s): standard -E -e "(a?){70}" -o a70.gv
       13.63s (13.63s): product -O null -f a70.gv a70.gv
      
      After:
        7.94s (0.05s+7.89s): ladybird 21 | determinize -O null
        0.10s (0.05s+0.05s): de-bruijn 20 | evaluate -O null -f - aaaaaaaaaaaaaaaaaaaaa
       12.04s (0.93s+11.11s): thompson -C "lan_char(a)_b" -Ee "a?{2000}" | proper -O null
       22.69s (10.16s+12.53s): standard -Ee "(a+b+c+d)?{100}" | aut-to-exp -O null
        6.72s (0.05s+6.67s): standard -C "lal_char(ab)_z" -Ee "(a+b)*b(<2>a+<2>b)*" | power -O null -f- 10
        0.05s (0.05s): standard -E -e "(a?){70}" -o a70.gv
       13.01s (13.01s): product -O null -f a70.gv a70.gv
      
      Granted, the differences are small and might be insignificant.
      
      * configure.ac: Check if the compiler supports -fvisibility=hidden.
      * lib/local.mk, lib/vcsn/local.mk: Use it to compile libvcsn and
      the context libraries.
      
      * lib/ctx/libctx.cc: Enable the exportation of the symbols.
      
      * vcsn/misc/export.hh: New.
      * vcsn/local.mk: Adjust.
      
      * lib/vcsn/dot/driver.hh, lib/vcsn/rat/driver.hh,
      * lib/vcsn/rat/read.hh, vcsn/core/mutable_automaton.hh,
      * vcsn/ctx/instantiate.hh, vcsn/dyn/algos.hh, vcsn/dyn/automaton.hh,
      * vcsn/dyn/context.hh, vcsn/dyn/fwd.hh, vcsn/dyn/ratexp.hh,
      * vcsn/dyn/weight.hh, vcsn/misc/escape.hh, vcsn/misc/stream.hh:
      Flag the symbols that need to be exported.
      ad226c61
    • Akim Demaille's avatar
      attributes: visibility · f71c0f3d
      Akim Demaille authored
      * vcsn/misc/attributes.hh: Sort.
      Improve layout.
      (ATTRIBUTE_DLLEXPORT, ATTRIBUTE_DLLIMPORT): New.
      f71c0f3d
    • Akim Demaille's avatar
      style: comment changes · c131b807
      Akim Demaille authored
      c131b807
  5. 14 Oct, 2013 10 commits
    • Akim Demaille's avatar
      determinize, product: factor the printing of origins · 111f40a1
      Akim Demaille authored
      * vcsn/algos/determinize.hh, vcsn/algos/product.hh (origins_t)
      (print): New.
      Use them.
      111f40a1
    • Akim Demaille's avatar
      determinize: no longer force the result to be complete · 8171a3f5
      Akim Demaille authored
      Decided during Vaucanson meeting 2013-06-25.
      
      No visible impact of the additional test in the score.
      
        8.35s (0.08s+8.27s): ladybird 21 | determinize -O null
        0.14s (0.07s+0.07s): de-bruijn 20 | evaluate -O null -f - aaaaaaaaaaaaaaaaaaaaa
       11.66s (0.86s+10.80s): thompson -C "lan_char(a)_b" -Ee "a?{2000}" | proper -O null
       21.32s (9.54s+11.78s): standard -Ee "(a+b+c+d)?{100}" | aut-to-exp -O null
        6.73s (0.07s+6.66s): standard -C "lal_char(ab)_z" -Ee "(a+b)*b(<2>a+<2>b)*" | power -O null -f- 10
        0.07s (0.07s): standard -E -e "(a?){70}" -o a70.gv
       13.33s (13.33s): product -O null -f a70.gv a70.gv
      
      * vcsn/algos/determinize.hh (determinize): Accept a argument specifying
      whether to force the result to be complete.
      By the way, when VCSN_DETERMINIZE is set, output the origins.
      * bin/vcsn-determinize.cc, lib/vcsn/algos/determinize.cc,
      * vcsn/algos/are-equivalent.hh, vcsn/ctx/lal_char_b.hh,
      * vcsn/dyn/algos.hh: Adjust.
      
      Adjust the TAF-Kit test suite to check the origins, now that they are
      generated in the output.
      
      * tests/tafkit/determinize.dir/a-det-0.gv: New.
      * tests/tafkit/determinize.dir/a-det.gv: Rename as...
      * tests/tafkit/determinize.dir/a-det-1.gv: this.
      * tests/tafkit/determinize.dir/empty-det-0.gv: New.
      * tests/tafkit/determinize.dir/empty-det.gv: Rename as...
      * tests/tafkit/determinize.dir/empty-det-1.gv: this.
      * tests/tafkit/determinize.dir/epsilon-det-0.gv: New.
      * tests/tafkit/determinize.dir/epsilon-det.gv: Rename as...
      * tests/tafkit/determinize.dir/epsilon-det-1.gv: this.
      * tests/tafkit/determinize.chk, tests/tafkit/local.mk: Adjust.
      
      * tests/tafkit/transpose.chk: Adjust: require a complete result.
      
      Now that the TAF-Kit test suite checks the origins, and the fact that
      the result is complete or not, the "unit" test for determinize is
      useless.
      
      * tests/unit/determinize.cc: Remove.
      * tests/unit/determinize.chk: Remove.
      * tests/unit/local.mk: Adjust.
      
      * NEWS.txt: Advertise.
      
      fixup! determinize: no longer force the result to be complete
      8171a3f5
    • Akim Demaille's avatar
      style: derive: introduce ratexp_polynomial_t · 2ff474d9
      Akim Demaille authored
      * vcsn/algos/derive.hh: here.
      And use it.
      2ff474d9
    • Akim Demaille's avatar
      build: fix warning-disabling pragmas · d73ad242
      Akim Demaille authored
      * lib/vcsn/dot/scan.ll, lib/vcsn/rat/scan.ll: here.
      d73ad242
    • Akim Demaille's avatar
      dyn: turn make_automaton_editor into a more classic function · a2d289e4
      Akim Demaille authored
      make_automaton_editor is somewhat special: it is parameterized by an
      Automaton type, but takes a context name as argument.
      
      Turn this into something more consistent with the other algorithms.
      
      * vcsn/algos/edit-automaton.hh (make_automaton_editor): Take a context
      as parameter type.
      * vcsn/ctx/instantiate.hh: Simplify accordingly.
      a2d289e4
    • Akim Demaille's avatar
      dyn: simplify the instantiation of the bridges · 2a091fe6
      Akim Demaille authored
      See previous commit for details.
      
      * vcsn/algos/dot.hh, vcsn/algos/is-valid.hh, vcsn/algos/lift.hh:
      Name the bridges after the dyn type.
      * vcsn/ctx/instantiate.hh: Simplify.
      2a091fe6
    • Akim Demaille's avatar
      dyn: simplify the instantiation of the bridges · 54326e1a
      Akim Demaille authored
      There is really no reason to force the bridges to be overloaded (e.g.,
      using "standard" for two routines, one with automaton as input, and
      the other with "ratexp" as input), as these functions are never seen
      by the user.
      
      However, it does make the instantiatiation and use by the system more
      complex (e.g., the REGISTER macros cannot be used).
      
      Relax these constraints, and use the same name for the bridge, and for
      its associated typedef (standard -> standard_t, standard_exp ->
      standard_exp_t).
      
      * vcsn/algos/edit-automaton.hh, vcsn/factory/ladybird.hh: Comment change.
      * vcsn/algos/print.hh, vcsn/algos/standard.hh: Use the same names for
      bridges and types.
      * vcsn/ctx/lan_char_b.hh, vcsn/ctx/instantiate.hh: Simplify.
      54326e1a
    • Akim Demaille's avatar
      style: address minor fixmes · 089711f3
      Akim Demaille authored
      * vcsn/algos/enumerate.hh: Remove a dead FIXME.
      * vcsn/factory/double-ring.hh: Use state_t instead of unsigned.
      089711f3
    • Akim Demaille's avatar
      dyn: factor the generation of type strings for binary dispatch · 723cf724
      Akim Demaille authored
      * lib/vcsn/algos/left-mult.cc (vname): Move to...
      * lib/vcsn/algos/registry.hh (vname): here, and generalize it to any type.
      
      * lib/vcsn/algos/are-equivalent.cc, lib/vcsn/algos/concatenate.cc,
      * lib/vcsn/algos/left-mult.cc, lib/vcsn/algos/product.cc,
      * lib/vcsn/algos/sum.cc, lib/vcsn/algos/union.cc: Use it.
      Interestingly some of these calls were wrong, and using "rhs, rhs" types
      instead of "lhs, rhs".
      723cf724
    • Akim Demaille's avatar
  6. 13 Oct, 2013 1 commit
  7. 12 Oct, 2013 4 commits