52 349 Logic Programming

Simple N.L.P - Prolog Listing



maxwell-10% prolog
C-Prolog version 1.5

| ?- [nlp].
nlp consulted 440 bytes 0.0166667 sec.

yes

| ?- listing.

sentence(_0,_1) :-
   noun_phrase(_0,_10),
   verb_phrase(_10,_1).

verb_phrase(_0,_1) :-
   c(_0,sing,_1).

phrase(_0,_1) :-
   _10=..[_0,_1,'[]'],
   call(_10).

noun_phrase(_0,_1) :-
   c(_0,boys,_1).

yes

| ?- halt.

[ Prolog execution halted ]

maxwell-10% 


Prolog File

N.L.P Run 1

N.L.P Run 2


© Paul Goldfinch 1996 Return to N.L.P Text