Opened 13 years ago

Closed 13 years ago

#8186 closed defect (fixed)

iterated_right_palindromic_closure of a finite word should return a finite word

Reported by: Sébastien Labbé Owned by: Sage Combinat CC user
Priority: major Milestone: sage-4.3.3
Component: combinatorics Keywords:
Cc: Alexandre Blondin Masse Merged in: sage-4.3.3.alpha0
Authors: Sébastien Labbé Reviewers: Alexandre Blondin Massé
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Le 5 février 2010 00:33, Alexandre Blondin Massé a écrit :
> Salut, Seb !
> C'est bizarre, j'obtiens ceci dans Sage:
>
> sage: w = Word('abaabababababab')
> sage: u = w.iterated_right_palindromic_closure()
> sage: print u.length()
> None
> sage: len(u)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
>
> /Users/alexandre/<ipython console> in <module>()
>
> TypeError: an integer is required
> sage:
>
> J'imagine que c'est dû au fait que c'est un mot implémenté par un itérateur
> avec cache, mais ce n'est pas très pratique, on devrait pouvoir savoir la
> longueur d'un tel mot. Y a-t-il moyen de le faire ? Peut-on forcer
> l'évaluation ? Merci !
> Alex

Attachments (2)

trac_8186_length_handling-sl.patch (8.0 KB) - added by Sébastien Labbé 13 years ago.
trac_8186_minor_doc_changes-abm.patch (2.2 KB) - added by Alexandre Blondin Masse 13 years ago.
Very minor changes in the doc (typos and rephrasing)

Download all attachments as: .zip

Change History (12)

comment:1 Changed 13 years ago by Sébastien Labbé

Status: newneeds_review

I just attached a patch which fixes the problem for the mentioned function, but also for some others having the same problem.

It also adds a function that gives the longest periodic prefixes of a word which should not be harder to review.

Changed 13 years ago by Sébastien Labbé

Changed 13 years ago by Alexandre Blondin Masse

Very minor changes in the doc (typos and rephrasing)

comment:2 Changed 13 years ago by Alexandre Blondin Masse

Status: needs_reviewpositive_review

Tested the patch on sage 4.3.1. Everything builds fine, the doc generated by Sphinx is ok too. I made very minor modifications, only typos and rephrasing. Positive review if Sébastien agrees with my changes.

comment:3 Changed 13 years ago by Alexandre Blondin Masse

Authors: Sébastien Labbé
Reviewers: Alexandre Blondin Massé

Forgot to set the author and reviewer fields. Done.

comment:4 Changed 13 years ago by Alexandre Blondin Masse

I forgot to mention that it solved my initial problem as well.

comment:5 Changed 13 years ago by Sébastien Labbé

Thanks for the doc fixes. I agree with them.

comment:6 Changed 13 years ago by Mitesh Patel

For the record, the "length handling" patch applies to 4.3.2 with

applying trac_8186_length_handling-sl.patch
patching file sage/combinat/words/word.py
Hunk #2 succeeded at 1109 with fuzz 2 (offset 0 lines).

in the queue

trac_8219.patch
trac_3683-upgrade_moinmoin.patch
trac_8183-French_pdf.patch
trac_8190-docbuild.patch
trac_8184-eclib.patch
trac_8184-indentation.patch
trac_8155.patch
trac_8124-selmer-nf.review.patch
trac_7575.patch
trac_7575-followup.patch
trac_8189-hg.patch
trac_7935.patch
trac_7935b.2.patch
trac_6296.patch
trac_6296-part2.patch
trac6942_jordan.patch
trac6942_jordan_tests.patch
trac_6942-reviewer.patch
trac_8128-latex_cell_unicode.patch
trac_7313-multiline.patch
trac_8203-doc.patch
trac_8206_developer-doc.patch
trac_7944-dev-guide.patch
trac-8211.patch
trac_8044-categories_finite_groups-nt.patch
trac_8215_empty_word-sl.patch
trac_8186_length_handling-sl.patch               # You are here!
trac_8186_minor_doc_changes-abm.patch
trac_8140-sturmian-sl.patch
trac_8140-doc_fixes-abm.patch
trac_8140_cf-arg-sl.patch
trac_8093_palindromes_prefixes-abm.patch
trac_8093_doc_fixes-sl.patch
trac_7978_crystal_cleanup-as.2.patch
trac_6775-disjoint_set-sl.patch
7580_fixes_and_extensions_total.patch
trac_8120-uniquerep_hash-fh.patch
trac_8212-minimal_weight_poly_defining_GF2n.patch
6199-fast-int-mul-all.patch
trac_8188.patch
trac_8138-one_column_index-v2.patch
trac_8209-mathtt.3.patch
trac_8199-dev-guide.patch
trac_7947.patch
trac_7793-zorder-disk.patch
trac_4838-vd.patch
trac_8082.patch
trac-8004-region_plot.patch
trac_6878_exclude.patch
8185-numerical-noise.patch
trac_8180-kpsewhich.patch
6515-solve-assume.patch
trac_6515-referee.patch
trac-7334-logcontract-5.patch
trac-7334-logcontract-5-bugfix.patch
trac_7334-logcontract-5-reviewer.patch

comment:7 Changed 13 years ago by Mitesh Patel

Never mind. I switched the order of #8186 and #8093

comment:8 in reply to:  7 Changed 13 years ago by Sébastien Labbé

Replying to mpatel:

Never mind. I switched the order of #8186 and #8093

Here is the ordering of the current positive review patches in the sage-combinat tree, if it may help your job, I just tested them and they all apply without warning fuzz message :

sage-4.3.3.patch
trac_8223-fix_dir-nt.patch
trac_8044-categories_finite_groups-nt.patch
trac_8093_palindromes_prefixes-abm.patch
trac_8093_doc_fixes-sl.patch
trac_8140-sturmian-sl.patch
trac_8140-doc_fixes-abm.patch
trac_8140_cf-arg-sl.patch
trac_6775-disjoint_set-sl.patch
trac_8186_length_handling-sl.patch
trac_8186_minor_doc_changes-abm.patch
trac_8120-uniquerep_hash-fh.patch
trac_7978_crystal_cleanup-as.patch
trac_8215_empty_word-sl.patch
trac_8127-word_str_features-vd.patch
trac_8127-review-sl.patch
trac_8232_word_cmp_bug-sl.patch

comment:9 Changed 13 years ago by Sébastien Labbé

the patch

trac_8127-word_str_features-vd.patch

correspond to trac_8127.patch on the trac server.

comment:10 Changed 13 years ago by Mitesh Patel

Merged in: sage-4.3.3.alpha0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.