:- use_module(library(chr)).

:- chr_constraint at/2, sees/2.

story --> [] ; s, ['.'], story.

%s --> np(X), v(V), np(Y).

s --> np(X), [sees], np(Y), {sees(X,Y)}.
s --> np(X), [is,at], np(E), {at(E,X)}.
s --> np(X), [is,on,vacation], {at(vacation,X)}.

np(pedro)    --> [pedro].
np(maria)     --> [maria].
np(loli)     --> [loli].
np(grlmc)  --> [grlmc].
np(hennings_talk) --> [hennings,talk].
np(vacation) --> [vacation].

/**** SAMPLES
phrase(story, [pedro,is,at,grlmc,'.']).

phrase(story, [maria,is,at,hennings,talk,'.']).

phrase(story, [pedro,sees,maria,'.']).

phrase(story, [pedro,sees,maria,'.', pedro,sees,loli,'.',
               pedro,is,at,grlmc,'.', maria,is,at,hennings,talk, '.',
               loli,is,on,vacation,'.']).

****/