Cocalc has moved from Discord for questions, but someone has a lot of 
automata questions.  I'm copying one here and will let them know it is here.
+++

When using sagemaths automaton module, I'm encountering some weird behavior:
stateTransitions = [
    ('q0', 'q1', '0'),
    ('q1', 'q1', '1'),
   
]
DFA = Automaton(stateTransitions, initial_states=['q0'], 
final_states=['q1'])
list(DFA.language(5,initial_states=['q1']))

yields the output:
[['0'],
 ['0', '1'],
 ['0', '1', '1'],
 ['0', '1', '1', '1'],
 ['0', '1', '1', '1', '1']]


But shouldn't each word start with '1', if the initial state is 'q1'?
The kwargs passed from Automaton.language() seem to be not passed properly.
According to the sagemaths docs, anything after the max_length arg should 
be passed as kwargs to subsequent methods on the automaton:
https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/finite_state_machine.html#sage.combinat.finite_state_machine.FiniteStateMachine.language

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/322a8529-0547-4ce0-b59d-ffebcb9ff255n%40googlegroups.com.

Reply via email to