all files |
finite_automata
docs,
code |
web app
script,
template
Running finite_automata on and.fa .
===== and.fa =====
states : [ one_even, one_odd, two_even, two_odd, zero_even, zero_odd ]
accept : [ one_even ]
alphabet : [ 0, 1 ]
start : zero_even
tests :
no [ ]
yes [ 0 ]
no [ 1, 0 ]
yes [ 0, 1, 0, 1, 0, 1, 0, 1 ]
transitions :
one_even x 1 => one_odd
one_even x 0 => two_even
one_odd x 1 => one_even
one_odd x 0 => two_odd
two_even x 1 => two_odd
two_even x 0 => zero_even
two_odd x 1 => two_even
two_odd x 0 => zero_odd
zero_even x 0 => one_even
zero_even x 1 => zero_odd
zero_odd x 0 => one_odd
zero_odd x 1 => zero_even
analysis :
It's a strict DFA.
Running inputs and tests :
'' => no (ok)
'0' => yes (ok)
'10' => no (ok)
'01010101' => yes (ok)
Passed all 4 tests.
Diagram created in file 'and.png'
Jim Mahoney (mahoney@marlboro.edu) | Feb 2008 |