Opened 7 years ago

Closed 7 years ago

#18191 closed defect (fixed)

Automaton: representation string wrong for Automata with 1 state

Reported by: Daniel Krenn Owned by:
Priority: trivial Milestone: sage-6.8
Component: finite state machines Keywords: sd64.25, beginner
Cc: Merged in:
Authors: Karen Kohl Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 9bd9f30 (Commits, GitHub, GitLab) Commit: 9bd9f3045d9b7c8529bbb8be71dbf386708f68a6
Dependencies: Stopgaps:

Status badges

Description

sage: A = Automaton()
sage: A.add_state(42)
42
sage: A
Automaton with 1 states

The last line is wrong and should be "...with 1 state".

Change History (11)

comment:1 Changed 7 years ago by Daniel Krenn

Keywords: beginner added

comment:2 Changed 7 years ago by Karen Kohl

Authors: Karen Kohl

comment:3 Changed 7 years ago by Karen Kohl

Branch: u/ktkohl/automaton__representation_string_wrong_for_automata_with_1_state

comment:4 Changed 7 years ago by Karen Kohl

Commit: b0c5a38590417f1bb52b132ccbf73aeb55276b8c
Status: newneeds_review

Also made the same correction for Transducer and FiniteStateMachine? in addition to Automaton.


New commits:

b0c5a38Changed representation string for Automaton, Transducer, and FiniteStateMachine.

comment:5 Changed 7 years ago by Vincent Delecroix

Status: needs_reviewneeds_work

Hello,

While you are at it, this is also wrong

sage: FiniteStateMachine()
Finite state machine with 0 states

It should rather be Empty finite state machine.

Best Vincent

comment:6 Changed 7 years ago by git

Commit: b0c5a38590417f1bb52b132ccbf73aeb55276b8c9bd9f3045d9b7c8529bbb8be71dbf386708f68a6

Branch pushed to git repo; I updated commit sha1. New commits:

9bd9f30Changed representation string to say "empty" instead of "0 states" in all of Automaton, Finite State Machine, and Transducer.

comment:7 Changed 7 years ago by Karen Kohl

Status: needs_workneeds_review

comment:8 Changed 7 years ago by Vincent Delecroix

Reviewers: Vincent Delecroix
Status: needs_reviewpositive_review

Hello,

For the future: the commit message should not be that long. It must start with a one-line description (~70 characters). Possibly you can add some more comments after a line break. Something like

"0 states" -> "empty" for Finite State Machine

We change the method _repr_ for Automaton, Finite State Machine and
Transducer to be more friendly when there is no state.

Vincent

comment:9 Changed 7 years ago by Karen Kohl

Thanks for letting me know and for all your help.

comment:10 Changed 7 years ago by Karen Kohl

Keywords: sd64.25 added; sd67 removed
Milestone: sage-6.6sage-6.8

comment:11 Changed 7 years ago by Volker Braun

Branch: u/ktkohl/automaton__representation_string_wrong_for_automata_with_1_state9bd9f3045d9b7c8529bbb8be71dbf386708f68a6
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.