FiniteStateMachine: implement final_word_out
Implement FSMState.final_word_out
in order to accomodate subsequential transducers in this package. A transducer is said to be subsequential if it is deterministic, every state
is final and it has a final output word for each final state, i.e., when reading an input and reaching some final state along some path, then the final output word of this state is appended to the output labels collected along the path.
This will facilitate various transducers, e.g., when we currently have to read a sufficiently large number of zeros in order to flush some more output.
final_word_out is introduced in #16253. Now final_word_out is implemented everywhere (or there is a NotImplementedError
, see #16548).
Change History (10)
Dependencies: |
#16206 →
#16206, #16207
|
Dependencies: |
#16206, #16207 →
#16206, #16207, #16253, #16254
|
Description: |
modified (diff)
|
Dependencies: |
#16206, #16207, #16253, #16254 →
#16206, #16207, #16253, #16145#16254
|
Milestone: |
sage-6.2 →
sage-6.3
|
Component: |
combinatorics →
finite state machines
|
Branch: |
→ u/skropf/fsm/final-word-out-problems
|
Commit: |
→ c3f2b335d22977e7ba2460cd9721553ca5274fbc
|
Description: |
modified (diff)
|
Status: |
new →
needs_review
|
Authors: |
→ Sara Kropf
|
Branch: |
u/skropf/fsm/final-word-out-problems →
u/cheuberg/fsm/final-word-out-problems
|
Commit: |
c3f2b335d22977e7ba2460cd9721553ca5274fbc →
d1f3e216a8e8e1913c803ec27baadc789f7b2300
|
Reviewers: |
→ Clemens Heuberger
|
Reviewers: |
Clemens Heuberger →
Clemens Heuberger, Daniel Krenn
|
Status: |
needs_review →
positive_review
|
Branch: |
u/cheuberg/fsm/final-word-out-problems →
d1f3e216a8e8e1913c803ec27baadc789f7b2300
|
Resolution: |
→ fixed
|
Status: |
positive_review →
closed
|
I reviewed the patch. Builds, doctests pass. I added one commit with rather minor changes (punctuation, indentation,
.. TODO::
tag) and moved the new example from the private method_composition_explorative_
to the public methodcomposition
.Please cross-review these changes and feel free to set the status to positive_review.
Last 10 new commits:
FSMState.copy also copies final_word_out
Transducer.asymptotic_moments only accepts transducers with all states final and transducers.GrayCode is now such a transducer.
Correct TeX errors (raw string vs. string) in docstring (Gray Code)
Modified a few docstrings to reflect use of final output word
removed determine_alphabets=True from docstrings because it is the default anyway
Use iterators instead of lists
Added examples for FiniteStateMachine.equivalence_classes
NotImplementedError in _composition_explorative_ if there are final word outs
corrected spacing
trac #16191: Reviewer Patch: Move one example; spacing; typo; punctuation