Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FiniteStateMachine: colors lists, not tuples #16128

Closed
cheuberg opened this issue Apr 11, 2014 · 3 comments
Closed

FiniteStateMachine: colors lists, not tuples #16128

cheuberg opened this issue Apr 11, 2014 · 3 comments

Comments

@cheuberg
Copy link
Contributor

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

CC: @dkrenn @sagetrac-skropf

Component: combinatorics

Author: Clemens Heuberger

Branch/Commit: d51be51

Reviewer: Daniel Krenn

Issue created by migration from https://trac.sagemath.org/ticket/16128

@cheuberg cheuberg added this to the sage-6.2 milestone Apr 11, 2014
@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Reviewer: Daniel Krenn

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

comment:2

I've checked already the changes between merging and closing of #15963. Everything looks fine.

@vbraun
Copy link
Member

vbraun commented Apr 16, 2014

Changed branch from u/cheuberg/fsm/state_color to d51be51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants