Skip to content

WordMorphism language methods bug for non-extendable systems/languages #40466

@staroste

Description

@staroste

Steps To Reproduce

Running

m = WordMorphism('0->01,1->10')
Word('000') in m.language(3,Word('000'))

return False, but it should return True. The problem is that the system with this morphism and this axiom (Word('000')) is not extendable, and the algorithm does not account for this.

Word('010101') in m.language(6,Word('000'))

should also give True, but returns False.

Expected Behavior

The expected behaviour is the one given by the doc of WordMorphism lanuage method:

Given a non-erasing substitution s and a word u the DOL-language generated by s and u is the union of the factors of s^n(u) where n is a nonnegative integer.

Actual Behavior

The implementation fails when the parameter u is chosen such that the D0L language is not extendable: there are elements that fail to be extendable to right or left. In the example given, the Thue-Morse morphism, the cubes are not extendable, but they are introduced by u=Word('000').

Additional Information

No response

Environment

  • OS: Linux
  • Sage Version: 10.6

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions