/* File: chom0.pl Author: Mihaela Malita Title: A grammar to build sentences in English Our vocabulary consists of: 3 nouns: boy, girl, dog 2 verbs: likes, loves ?- phrase(sentence,[the,boy,likes,dog]). No What does the boy like? ?- phrase(sentence,[the,boy,likes,_,X]). X = boy ; X = dog ; X = girl ; ?- phrase(sentence,X). .. X = [the, boy, likes, the, dog] ; X = [the, boy, likes, the, girl] ; .. ?- forall(phrase(sentence,X),(write(X),nl)). [the, boy, likes, the, boy] [the, boy, likes, the, dog] [the, boy, likes, the, girl].. */ sentence --> noun_ph,verb_ph. noun_ph --> det,noun. verb_ph --> verb,noun_ph. det --> [the]. % determiner noun --> [boy]; [dog]; [girl]. verb --> [likes] ; [hates].