#12150: upgrade defect() of a finite word
---------------------------------+------------------------------------------
Reporter: sstarosta | Owner: sstarosta
Type: enhancement | Status: needs_info
Priority: trivial | Milestone: sage-4.8
Component: combinatorics | Keywords: finite word, defect,
palindrome, pseudopalindrome
Work_issues: | Upstream: N/A
Reviewer: Vincent Delecroix | Author: Stepan Starosta
Merged: | Dependencies:
---------------------------------+------------------------------------------
Old description:
> Update defect() method of a finite word to calculate the defect for
> generalized palindromes.
>
> Details: the defect is the difference between the maximum number of
> palindromic factors in a word and their actual count. If we count
> generalized palindromes (or f-palindromes, theta-palindromes,
> pseudopalindromes...), the upper bound needs to be corrected according to
> (Š. Starosta, On Theta-palindromic Richness, Theoret. Comp. Sci. 412
> (2011) 1111-1121, DOI: 10.1016/j.tcs.2010.12.011).
>
> Original behavior:
> {{{
> sage: f = WordMorphism('a->b,b->a')
> sage: Word('abbabaabbaababba').defect(f)
> 4
> }}}
>
> Expected:
> {{{
> sage: f = WordMorphism('a->b,b->a')
> sage: Word('abbabaabbaababba').defect(f)
> 3
> }}}
>
> The method is_full() also needs to be updated to be compliant with the
> generalized definition of defect:
>
> now
> {{{
> sage: f = WordMorphism('a->b,b->a')
> sage: w = Word('ab')
> sage: w.is_full(f)
> False
> }}}
>
> expected
> {{{
> sage: f = WordMorphism('a->b,b->a')
> sage: w = Word('ab')
> sage: w.is_full(f)
> True
> }}}
New description:
Update defect() method of a finite word to calculate the defect for
generalized palindromes. Apply the four patches.
Details: the defect is the difference between the maximum number of
palindromic factors in a word and their actual count. If we count
generalized palindromes (or f-palindromes, theta-palindromes,
pseudopalindromes...), the upper bound needs to be corrected according to
(Š. Starosta, On Theta-palindromic Richness, Theoret. Comp. Sci. 412
(2011) 1111-1121, DOI: 10.1016/j.tcs.2010.12.011).
Original behavior:
{{{
sage: f = WordMorphism('a->b,b->a')
sage: Word('abbabaabbaababba').defect(f)
4
}}}
Expected:
{{{
sage: f = WordMorphism('a->b,b->a')
sage: Word('abbabaabbaababba').defect(f)
3
}}}
The method is_full() also needs to be updated to be compliant with the
generalized definition of defect:
now
{{{
sage: f = WordMorphism('a->b,b->a')
sage: w = Word('ab')
sage: w.is_full(f)
False
}}}
expected
{{{
sage: f = WordMorphism('a->b,b->a')
sage: w = Word('ab')
sage: w.is_full(f)
True
}}}
--
Comment(by vdelecroix):
Sorry for that... the four patches need to be applied in the order they
appear.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12150#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.