abducibles at/2, in/2, see/2, skypes/2. assumption acting/2. at(ruc,X) ==> in(roskilde,X). in(Loc1,X) \ in(Loc2,X) <=> Loc1=Loc2. at(kiis,X) ==> at(ruc,X). at(vacation,X) ==> in(Loc,X), diff(Loc,roskilde). see(X,Y) ==> true | (in(L,X), in(L,Y) ; in(Lx,X), in(Ly,Y), diff(Lx,Ly), skypes(X,Y)). story --> [] ; s, ['.'], story. s --> np(subject,X), [sees], np(object,Y), {see(X,Y)}. s --> np(subject,X), [is,at], np(object,E), {at(E,X)}. s --> np(subject,X), [is,on,vacation], {at(vacation,X)}. np(_,peter) --> [peter], {*acting(masc,peter)}. np(_,mary) --> [mary], {*acting(fem,mary)}. np(_,jane) --> [jane], {*acting(fem,jane)}. np(object,ruc) --> [ruc]. np(object,kiis) --> [the,kiis,course]. np(Case,Id) --> pn(Case,Gender), {-acting(Gender,Id)}. pn(subject,masc) --> [he]. pn(object,masc) --> [him]. pn(subject,fem) --> [she]. pn(object,fem) --> [her]. /**** SAMPLES phrase(story, [peter,is,at,ruc,'.']). phrase(story, [mary,is,at,the,kiis,course,'.']). phrase(story, [peter,sees,mary,'.']). 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,sees,mary,'.', she,sees,jane,'.', he,is,at,ruc,'.', she,is,at,the,kiis,course, '.', jane,is,on,vacation,'.']). phrase(story, [peter,sees,him,'.']). ****/ %% prettier diff in output than if you use prolog's dif/2 :- chr_constraint diff/2. diff(X,X) <=> fail. diff(A,B) \ diff(A,B) <=> true. diff(A,B) \ diff(B,A) <=> true. diff(A,B) <=> ?=(A,B) | true.