% file: appendgr
% sample query: s([the,painter,painted,the,sculpture]).

s(S) :-  np(NP), vp(VP), append(NP,VP,S).
np(NP) :-  det(Det), noun(Noun), append(Det,Noun,NP).
vp(VP) :-  v(V), np(NP), append(V,NP,VP).
vp(V) :- v(V).
det([the]).
noun([sculptor]).	noun([painter]).	
noun([sculpture]).	noun([painting]).
v([painted]).		v([sculpted]).

append([],L,L).
append([X|L1],L2,[X|L3]) :- append(L1,L2,L3).

