02 Juni 2010

A Context Free Poem

the woman shoots the woman
the woman shoots the man
the woman shoots a woman
the woman shoots a man
the woman shoots

the man shoots the woman
the man shoots the man
the man shoots a woman
the man shoots a man
the man shoots

a woman shoots the woman
a woman shoots the man
a woman shoots a woman
a woman shoots a man
a woman shoots

a man shoots the woman
a man shoots the man
a man shoots a woman
a man shoots a man
a man shoots

s(Z) :- np(X), vp(Y), append(X,Y,Z).
np(Z) :- det(X), n(Y), append(X,Y,Z).
vp(Z) :- v(X), np(Y), append(X,Y,Z).
vp(Z) :- v(Z). det([the]). det([a]).
n([woman]). n([man]). v([shoots]).


(Learn Prolog Now!).

revisi 10.06.02-01