@@ -88,7 +88,7 @@ We need more tests. In particular something that checks:
8888 * vcsn/algos/synchronize.hh: Here.
8989
9090* Bugs
91- ** subprograms
91+ ** subprograms (AP)
9292We don't kill our children when we are killed. For instance, if the user
9393asked for the graphical rendering of a huge automaton, and decides to kill
9494vcsn realizing her error, the dot process will continue to waste cpu.
@@ -113,7 +113,7 @@ from the caller, which is the one which knows the identities to use!
113113As a matter of fact, we need to revise the propagation of the identities
114114everywhere.
115115
116- ** Incorrect context
116+ ** Incorrect context (SP)
117117When trie(istream) adds words to the trie, the context used to parse the
118118stream is not the one of the automaton we are buildding. As a result, we
119119have a stupid context:
@@ -173,10 +173,6 @@ In the case of RW, check that the expression is valid.
173173** debug compilation mode
174174crange should not feature size and empty if !VCSN_DEBUG.
175175
176- ** check dubious const& members
177- Having a member of type automaton_t (or similarly, a shared_ptr) as a const& is
178- suspicious, and it should be checked in every class.
179-
180176* Improvements
181177** are-equivalent
182178V1 was calling letterize and proper, so it was more general than we are now.
@@ -205,12 +201,45 @@ non-commutativity: as is, (a, b) can work, but not (b, a).
205201But anyway: does it really mean something to compare a B-automaton with a Z
206202one?
207203
208- ** dot
204+ ** dot (SP)
209205Let's try a means to improve our rendering of decorated automaton (typically
210206derived-term) with MathJax rendering. Stackoverflow has hints on how we can
211207do that for SVG, but so far, I failed to adjust the output of dot.
212208
213- ** efsm
209+ ** dot
210+ At least under IPython we would like to have cuter automata. I don't like
211+ the fact that the size of the states depends on the number of digits for
212+ instance. Larger than 999 hardly makes sense, so let's try to fix it for 1
213+ or 2 digits.
214+
215+ Here was an attempt:
216+
217+ diff --git a/python/vcsn/dot.py b/python/vcsn/dot.py
218+ index 72fddc2..055f85b 100644
219+ --- a/python/vcsn/dot.py
220+ +++ b/python/vcsn/dot.py
221+ @@ -11,7 +11,7 @@ from vcsn import _tmp_file, _popen, _check_call
222+ # Default style for real states as issued by vcsn::dot.
223+ state_style = 'node [shape = circle, style = rounded, width = 0.5]'
224+ # IPython style for real states.
225+ -state_colored = 'node [fillcolor = cadetblue1, shape = circle, style = "filled,rounded", width = 0.5]'
226+ +state_colored = 'node [fillcolor = cadetblue1, shape = circle, style = "filled,rounded", height = 0.4]'
227+ # Style for pre and post states, or when rendering transitions only.
228+ state_point = 'node [shape = point, width = 0]'
229+
230+ ** efsm: single-pass reading (SP)
231+ Currently when we load an EFSM file, we use the lazy-automaton-editor, which
232+ stores transitions as a list of strings, checks these strings to see what
233+ kind of labels and weights are used, and then reads the transition list to
234+ really create the automaton.
235+
236+ We should rather improve efstdecompile so that it inserts in the EFSM file a
237+ context string, and we should directly load the automaton in a single pass,
238+ using automaton_editor, not lazy_automaton_editor.
239+
240+ It sounds reasonable to rewrite efstdecompile into Python.
241+
242+ ** efsm (SP)
214243When passing a LAW, maybe we should letterize it transparently? Currently,
215244we treat it as if it were lan<string> instead of law<char>.
216245
@@ -258,8 +287,10 @@ Those two should really be the same algorithm, it's the signatures that
258287change. And rather than having two implementations, we should have a single
259288implementation of the algorithm, but better data structures for signatures.
260289
261- ** multiply
262- The repeated multiplication of automata does not check that min <= max.
290+ ** multiply (SP)
291+ The repeated multiplication of automata does not check that min <= max. See
292+ if there are other such errors. This is probably checked in the case of
293+ expressions.
263294
264295** normalize
265296I'm a bit lost in polynomialset::normalize: how come in
@@ -273,6 +304,43 @@ for i in range(10):
273304it manages to factor out the '<2>x' bits? Reading the code, I fail to see
274305where the common 'xx' are removed.
275306
307+ ** Extending classes in Python (AD, AP, SP)
308+ In Python, we augment the classes built by Boost.Python, but Python is messy
309+ to do that: we have to create a function, and then to bind it as a method.
310+ Yet the function stays there, it's ugly.
311+
312+ See the following commit (currently in their branch `next`) in Spot:
313+
314+ commit e8ce08a98958d30ed15c443d960fa226650ddfb3
315+ Author: Alexandre Duret-Lutz <
[email protected] >
316+ Date: Wed Oct 7 19:42:51 2015 +0200
317+
318+ python: better way to extend existing classes
319+
320+ * wrap/python/spot.py: Use a decorator to extend classes.
321+ * wrap/python/tests/formulas.ipynb: Adjust expected help text.
322+
323+ +def _extend(*classes):
324+ + """
325+ + Decorator that extends all the given classes with the contents
326+ + of the class currently being defined.
327+ + """
328+ + def wrap(this):
329+ + for cls in classes:
330+ + for (name, val) in this.__dict__.items():
331+ + if name not in ('__dict__', '__weakref__') \
332+ + and not (name == '__doc__' and val is None):
333+ + setattr(cls, name, val)
334+ + return classes[0]
335+ + return wrap
336+ +
337+
338+ And use it to extend our classes in Python.
339+
340+ ** Python: __format__ (AD, AP, SP)
341+ I just discovered that Python feature, which is nicely used in Spot, and I
342+ think we should have something like it. See the s
343+
276344** rat: parse
277345
278346v score-compare --only 'b.expression\(e\)' +scores/36s/v2.0-0931-gd70d722 \
@@ -307,10 +375,11 @@ Fix this. Ask other members of the project what they think about that
307375** products: lazyness
308376We need a lazy implementation of product.
309377
310- ** product: is_idempotent
311- We don't need to insplit in the case of idempotent semirings.
378+ ** product: is_idempotent (VT)
379+ We don't need to insplit in the case of idempotent semirings, not just in
380+ the case of B.
312381
313- ** product: lazy insplit
382+ ** product: lazy insplit (VT)
314383Explore the possibility to apply insplitting lazily.
315384
316385** products: a function on top of all the products?
@@ -320,6 +389,15 @@ in our API.
320389Also, it would be nice to have variadic versions of these products for
321390expressions, just as we have it for automata.
322391
392+ ** ps (SP)
393+ vcsn-ps is currently written in sh + perl. Rewrite in Python, using the
394+ psutil to gain portability. Display the duration in a first column, then
395+ use something equivalent to what vcsn-compile does with the sugar function
396+ to improve the display of what is being compiled.
397+
398+ Of course there should be no code duplication: ask Antoine where the common
399+ code should be put.
400+
323401** scc
324402Dijkstra is often more efficient than Tarjan, so we should have an
325403implementation too. See
@@ -391,7 +469,7 @@ Boost.Optional 1.56 moves from opt.get_value_or to opt.value_or. However,
391469moving to C++17 should suffice: use std::optional.
392470
393471** Copy
394- There are numerous opportunities for an improve copy. For instance when
472+ There are numerous opportunities for an improved copy. For instance when
395473computing the square automaton (see has_twins_property), we would like to
396474call copy with a lambda that transforms the weights: \w.w -> (w, 1) and
397475likewise for the other tape. If we can do that on-the-fly, then the
@@ -408,7 +486,7 @@ because sometimes we need to escape the output (e.g., label = "\\langle 1
408486\\rangle" in dot), and sometimes not (e.g., "\langle 1 \rangle" in TikZ).
409487Find something more elegant to address this issue. See what was done in tc?
410488
411- ** Beware of our use of subprocess
489+ ** Beware of our use of subprocess (AP)
412490I think my code is really wrong.
413491http://stackoverflow.com/questions/6341451/piping-together-several-subprocesses
414492
@@ -529,11 +607,11 @@ the accessible parts.
529607
530608** ambiguous_word
531609We are clearly traversing the automaton too many times: once to find a pair
532- of "ambiguous states", then another time to compute am ambiguous word. If
610+ of "ambiguous states", then another time to compute an ambiguous word. If
533611speed were an issue, we should do it another way.
534612
535613In particular, it might be a good idea to use a distance map to ensure that
536- we good (one of the) shortest ambiguous word.
614+ we found (one of) the shortest ambiguous word.
537615
538616** bool is true
539617In automata, false never appears for both b and f2. mutable_automaton takes
@@ -646,11 +724,6 @@ The core issue is really that we build a monster: 6'119'750 transitions for
646724the latter, and 17'480 for the former. The ratio, 355, is still smaller
647725than that of timings: 2750.
648726
649- * to-expression
650- ** Incremental
651- Transform the current implementation of the "naive" heuristics into
652- something incremental. See what TAF-Kit.pdf B.1.4.1 says about it.
653-
654727* dyn::
655728** Implement implicit conversions
656729So that, for instance, we can run is-derministic on a proper lan.
0 commit comments