# HG changeset patch
# User Daniel Krenn <math+sage@danielkrenn.at>
# Date 1377194778 7200
# Node ID d813d31511ad71bd111e9ff0817ad3b1e72793e3
# Parent 4d575d15945e83cf4c7f976bf99d749c5b7844d4
Trac 15078: fsm, fixing docstrings
diff git a/sage/combinat/finite_state_machine.py b/sage/combinat/finite_state_machine.py
a

b


1423  1423  
1424  1424  
1425  1425  def _latex_(self): 
1426   """ 
 1426  r""" 
1427  1427  Returns a LaTex code for the graph of the finite state machine. 
1428  1428  
1429  1429  EXAMPLES:: 
… 
… 

1564  1564  [1 0 0 0 1] 
1565  1565  [0 1 1 0 0] 
1566  1566  [0 0 0 1 1] 
1567   sage: B.adjacency_matrix(1, entry=(lambda transition: \ 
 1567  sage: B.adjacency_matrix(1, entry=(lambda transition: 
1568  1568  ....: exp(I*transition.word_out[0]*var('t')))) 
1569  1569  [ 0 1 0 0 0] 
1570  1570  [ 0 0 0 1 0] 
… 
… 

3305  3305  ``word_out`` values. 
3306  3306  
3307  3307  EXAMPLES:: 
 3308  
3308  3309  sage: fsm = FiniteStateMachine([("A", "B", 0, 1), ("A", "B", 1, 0), 
3309  3310  ....: ("B", "C", 0, 0), ("B", "C", 1, 1), 
3310  3311  ....: ("C", "D", 0, 1), ("C", "D", 1, 0), 
… 
… 

3562  3563  machine. 
3563  3564  
3564  3565  An instance of this class is generated when 
3565   :meth:`FiniteStateMachine.process` oder 
 3566  :meth:`FiniteStateMachine.process` or 
3566  3567  :meth:`FiniteStateMachine.iter_process` of the finite state 
3567  3568  machine is invoked. It behaves like an iterator which, in each 
3568  3569  step, takes one letter of the input and runs (one step on) the 
… 
… 

3834  3835  to the preamble of Latex so that the finite state machines can be 
3835  3836  drawn nicely. 
3836  3837  
3837   TESTS: 
 3838  TESTS:: 
3838  3839  
3839  3840  sage: from sage.combinat.finite_state_machine import setup_latex_preamble 
3840  3841  sage: setup_latex_preamble() 