Opened 8 years ago
Closed 8 years ago
#16128 closed defect (fixed)
FiniteStateMachine: colors lists, not tuples
Reported by: | cheuberg | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-6.2 |
Component: | combinatorics | Keywords: | finite_state_machine |
Cc: | dkrenn, skropf | Merged in: | |
Authors: | Clemens Heuberger | Reviewers: | Daniel Krenn |
Report Upstream: | N/A | Work issues: | |
Branch: | d51be51 (Commits, GitHub, GitLab) | Commit: | d51be51b8299930abc0e6b72700eca79cd978cfc |
Dependencies: | Stopgaps: |
Description
Between the time when #15963 was merged in develop and #15963 was actually closed, I found and fixed a bug and pushed it to #15963, see http://trac.sagemath.org/ticket/15963#comment:4. However, due to the race condition outlined above, this fix has never been merged.
Thus, this is a new ticket with the same fix.
For convenience, I repeat http://trac.sagemath.org/ticket/15963#comment:4:
The following behaviour is undesired (docstrings says that colors are tuples of the colors of the constituent states, but this is not the case and leads to problems in Automaton.determinisation):
sage: A = Automaton([[0, 0, 0]], initial_states=[0]) sage: B = A.product_FiniteStateMachine(A, ....: lambda t1, t2: (0, None)) sage: B.states()[0].color [None, None] sage: B.determinisation() Traceback (most recent call last): ... TypeError: unhashable type: 'list' sage: A = Automaton([[0, 0, 0]], initial_states=[0]) sage: B = A.composition(A, algorithm='explorative') sage: B.states()[0].color [None, None] sage: B.determinisation() Traceback (most recent call last): ... TypeError: unhashable type: 'list'
I pushed commits correcting this and adding two more docstrings to emphasize that colors have to be hashable in order to be able to use Automaton.determinisation.
Change History (3)
comment:1 Changed 8 years ago by
- Status changed from new to needs_review
comment:2 Changed 8 years ago by
- Reviewers set to Daniel Krenn
- Status changed from needs_review to positive_review
comment:3 Changed 8 years ago by
- Branch changed from u/cheuberg/fsm/state_color to d51be51b8299930abc0e6b72700eca79cd978cfc
- Resolution set to fixed
- Status changed from positive_review to closed
I've checked already the changes between merging and closing of #15963. Everything looks fine.