Here is a tiny lexicon and a minigrammar consisting of one syntactic rule, I have to list all the sentences that this grammar can generate in the order that Prolog will generate them in, I know that the first sentence would be: a criminal eats a criminal, but then I don't know how to find the other sentences, how does the Prolog interpreter works on these cases? I don't want you to give me all the answers, I just need a little clue.
word(determiner,a).
word(determiner,every).
word(noun,criminal).
word(noun,'big kahuna burger').
word(verb,eats).
word(verb,likes).
sentence(Word1,Word2,Word3,Word4,Word5):-
word(determiner,Word1),
word(noun,Word2),
word(verb,Word3),
word(determiner,Word4),
word(noun,Word5).
sentence
that match the database. – lurker