automaton

Generator.

An automaton is defined which goes through a certain number of states. The states are named by indices. The sequence of permitted states is defined by a grammar that handles strings of states.

Axioms define the string of initial states. In this case 0.

Productions or production rules  allow the rewriting (through substitution) of certain states. Thus 0 may be rewritten 0 1 5 0.

Generator.

To each defined state of the automaton a vector is attached which refers to the action to carry out : rotate ( as mentioned by the orientation of the vector ), and move forward some length ( as expressed by the magnitude of the vector ). The action may be visible ( a segment is drawn ) or not ( the pen simply moves ).

Iterations.
  • Step 0- Start with state  0
  • Step 1- Each state is rewritten to the string of states that the rule defines for the state. In this case 0 1 5 0
  • Step 2- To this result string, the very same productions are applied. We get 0 1 5 0   1 2 0 1   5 0 4 5   0 1 5 0
  • Step 3- and so on ...
  • The automaton reads the result sequence of states and sets its internal state to the read state. It then performs the state-attached action and proceeds reading, thus moving to the next state.