Here's the code for
recognize1 given in the lecture:
recognize(A,Node,[]) :-
final(A,Node).
recognize(A,Node_1,String) :-
trans(A,Node_1,Node_2,Label),
traverse(Label,String,NewString),
recognize(A,Node_2,NewString).
Suppose we changed it to this:
recognize(A,Node,[]) :-
final(A,Node),!.
recognize(A,Node_1,String) :-
trans(A,Node_1,Node_2,Label),
traverse(Label,String,NewString),!,
recognize(A,Node_2,NewString).
What effect would this change have? What sort of
FSAs would not be affected by the change?