Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This DFA recognizes { x in {0,1}* | x does not end in 000 }
- states: lambda, # last bit was a 1 or non-existent
- 0, # last two bits were 10
- 00, # last three bits were 100
- 000 # last three bits were 000
- input alphabet: 0,1
- start state: lambda # no last bit when we start
- accept states: lambda,0,00 # accept as long as the last three bits weren't 000
- delta: # if we see a 1, reset
- lambda,1 -> lambda
- 0,1 -> lambda
- 00,1 -> lambda
- 000,1 -> lambda
- # if we see a 0, count one more 0 than before
- lambda,0 -> 0
- 0,0 -> 00
- 00,0 -> 000
- # until we get to three, and then just remember
- 000,0 -> 000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement