Opened 8 years ago

Closed 8 years ago

#16253 closed enhancement (fixed)

FiniteStateMachine: Introduce final_word_out

Reported by: skropf Owned by:
Priority: major Milestone: sage-6.3
Component: combinatorics Keywords: finite_state_machine
Cc: dkrenn, cheuberg Merged in:
Authors: Sara Kropf Reviewers: Clemens Heuberger, Daniel Krenn
Report Upstream: N/A Work issues:
Branch: ecbc950 (Commits, GitHub, GitLab) Commit: ecbc950408e769e3ab0deaffdd6e2d9e78d3bae2
Dependencies: #16206, #16207, #16145 Stopgaps:

Status badges


See also #16191.

Introduce 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.

Only final states can have a final output word.

Change History (8)

comment:1 Changed 8 years ago by cheuberg

  • Summary changed from Introduce final_word_out to FiniteStateMachine: Introduce final_word_out

comment:2 Changed 8 years ago by skropf

  • Branch set to u/skropf/fsm/final_output_construction
  • Commit set to 21392c5654e857c534bd812219665953841ad073
  • Dependencies changed from 16206, 16207 to #16206, #16207, #16145
  • Status changed from new to needs_review

comment:3 Changed 8 years ago by cheuberg

  • Reviewers set to Clemens Heuberger

I reviewed this earlier and added a couple of rather minor changes at that time:

  • 77a9bbe is_final/final_output_word: minor changes during review
  • 35518c1 FSM._final_word_out: move initialization of private attribute to __init__
  • 0469d11 reworded ValueError (joined sentences)
  • df6f9fb reviewer patch: line breaks in documentation
  • bbe0866 reworded two docstrings
  • 21392c5 added doctests to FSMState.deepcopy to check that deepcopy of a property works

Please confirm cross-review.

comment:4 Changed 8 years ago by dkrenn

  • Branch changed from u/skropf/fsm/final_output_construction to u/dkrenn/fsm/final_output_construction

comment:5 Changed 8 years ago by dkrenn

  • Commit changed from 21392c5654e857c534bd812219665953841ad073 to ecbc950408e769e3ab0deaffdd6e2d9e78d3bae2
  • Reviewers changed from Clemens Heuberger to Clemens Heuberger, Daniel Krenn

Made a couple of minor changes and rewritings. The remaining part is a positive_review for me. Please cross-review and feel free to give it a positive review.

New commits:

7998980rewrote two if statements to make the code more readable
1b17549minor changes in some docstrings
0302fbb"== None" to "is None" in docstrings (finial_word_out)
ecbc950"== None" to "is None" in code (in composition)

comment:6 Changed 8 years ago by skropf

  • Status changed from needs_review to positive_review

For me everything is fine. As suggested, I give it a positive review.

comment:7 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:8 Changed 8 years ago by vbraun

  • Branch changed from u/dkrenn/fsm/final_output_construction to ecbc950408e769e3ab0deaffdd6e2d9e78d3bae2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.