The following finite state machine (FSM):
https://drive.google.com/file/d/1WWQJipBtYXaTGfQAFbyH166I7RX5TSCy/view?usp=sharing
generates the regular language, L = {anbm | a >= 1 and m >= 2}.
Implement the above FSM as a C++ function,
int is_abb(char * str )
{
// C++ code here
}
that returns a 1 if the given string, str, is in L and returns a 0 if str is not in L.
Assume the existence of a C++ function, int str_len(char * str), which returns the length
of the given string, str.
Comments
Leave a comment