all files |
finite_automata
docs,
code |
web app
script,
template
Running finite_automata on zeros_1mod3.fa .
===== zeros_1mod3.fa =====
states : [ evenand0, evenand1, evenand2, oddand0, oddand1, oddand2 ]
accept : [ evenand0. evenand1, evenand2, oddand1 ]
alphabet : [ 0, 1 ]
start : evenand0
tests :
no [ ]
yes [ 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 ]
no [ 0, 0, 1, 1 ]
yes [ 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0 ]
transitions :
evenand0 x 1 => evenand1
evenand0 x 0 => oddand0
evenand1 x 1 => evenand2
evenand1 x 0 => oddand1
evenand2 x 1 => evenand0
evenand2 x 0 => oddand2
oddand0 x 0 => evenand0
oddand0 x 1 => oddand1
oddand1 x 0 => evenand1
oddand1 x 1 => oddand2
oddand2 x 0 => evenand2
oddand2 x 1 => oddand0
analysis :
It's a strict DFA.
Running inputs and tests :
'' => no (ok)
'10010010010' => yes (ok)
'0011' => yes (NOT ok)
'11100010100110000' => no (NOT ok)
Failed 2 out of 4.
Diagram created in file 'zeros_1mod3.png'
Jim Mahoney (mahoney@marlboro.edu) | Feb 2008 |