:- use_module(library(chr)). :- chr_constraint at/2, see/2. story --> [] ; s, ['.'], story. %s --> np(X), v(V), np(Y). s --> np(X), [sees], np(Y), {see(X,Y)}. s --> np(X), [is,at], np(E), {at(E,X)}. s --> np(X), [is,on,vacation], {at(vacation,X)}. np(peter) --> [peter]. np(mary) --> [mary]. np(jane) --> [jane]. np(ruc) --> [ruc]. np(kiis) --> [the,kiis,course]. /**** SAMPLES phrase(story, [peter,sees,mary,'.', peter,sees,jane,'.', peter,is,at,ruc,'.', mary,is,at,the,kiis,course, '.', jane,is,on,vacation,'.']). phrase(story, [peter,is,at,ruc,'.']). phrase(story, [mary,is,at,the,kiis,course,'.']). phrase(story, [peter,sees,mary,'.']). ****/