Search code examples
outputfinite-automatacomputationboyer-mooretransducer-machines

Constructing a Moore Machine


I have a homework question:

Construct a Moore machine that takes a string consisting of a's b's and c's as input and outputs a string containing 1 at the end of each substring abc and a 0 in all other positions. e.g. input, aabcb produces output, 000010

I tried constructing, but I have come to a dead end. Here is my attempt: enter image description here

As you can see, I can't create a string cccb and an 'abc' can output a 0. I feel like I overcomplicated this simple problem.

EDIT: Took a break and redid it. I think this is right, unless someone can tell me otherwise:

enter image description here


Solution

  • The solution. Just needed to think clearly.

    The solution