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