I'm trying to understand what happens on this particular situation about Prolog DCG rules. The rules are:
fizz_buzz(Msg) --> anything, fizz(Msg), anything, buzz, anything.
anything --> [].
anything --> [_], anything.
fizz(Msg) -->
"fizz",
{
format('At fizz we have Msg=~w~n', [Msg])
}.
buzz -->
"buzz".
run :-
atom_codes("blah blah fizz blah buzz", Codes),
phrase(fiz_buzz(Msg), Codes),
write(Msg).
And got:
ERROR: phrase/3: Undefined procedure: fiz_buzz/3
ERROR: However, there are definitions for:
ERROR: fizz_buzz/3
I just cant find the the correct "phrase" to run this grammar. What mistake am I making?