% Adapted from Covington p.421

s(String) :- concat_atom(Words, ' ', String), sentence(Words).

sentence(Words) :- article(Words, Left1), noun(Left1, Left2), verb(Left2, []).

article([the| Left], Left).
article([a| Left],  Left).

noun([Noun| Left], Left) :- member(Noun, [dog,cat,girl,boy]).

verb([Verb|Left], Left) :- member(Verb, [ran,talked,slept]).
