I'm trying to construct a regular expression from a Finite Automaton but found my self completely stuck with this one. The regex to use is like this:
? = 0 or 1
* = 0 or more
+= 1 or more
| = or
_ = empty string
@ = empty set
() = parentheses
As I understand the strings must either be "b*" end with "a*" or end with "a+bb+"
What i have now is ((b*(a+(bb))*)*)
but that doesn't take into account a string ending with 'a'.
As said, I'm 100% stuck with this and just can't get my head around how I am supposed to work with this.
image: http://img593.imageshack.us/img593/2563/28438387.jpg
CODE:
Type of the automaton
FA
States
q1
q2
q3
q4
Alphabet
a
b
Initial state
q3
Final states
q3
q4
Transitions
q1 a q2
q1 b q3
q2 a q2
q2 b q2
q3 a q4
q3 b q3
q4 a q4
q4 b q1
Any solutions or tips appreciated!