Skip to content

Instantly share code, notes, and snippets.

@wilyJ80
Created September 3, 2024 13:46
Show Gist options
  • Save wilyJ80/5f11e500c341184ab88c4ccb25e2c09c to your computer and use it in GitHub Desktop.
Save wilyJ80/5f11e500c341184ab88c4ccb25e2c09c to your computer and use it in GitHub Desktop.
Automata: even number of as and bs
/* Automato finito: w possui um numero par de a e b */
digraph {
zero;
one;
two;
node [shape="doublecircle"];
three;
/* estado inicial */
zero -> one [label="a"];
zero -> two [label="b"];
/* em direcao ao estado de aceitacao */
one -> three [label="a"];
two -> three [label="b"];
/* saiu do estado de aceitacao */
three -> one [label="a"];
three -> two [label="b"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment