(base) Desktop$ swipl Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- [g]. true. ?- nn(Parse,[telescope],[]). Parse = nn(telescope). ?- nn(Parse,[Word],[]). Parse = nn(man), Word = man ; Parse = nn(boy), Word = boy ; Parse = nn(telescope), Word = telescope. ?- dt(Parse,[Word],[]). ?- dt(Parse,[Word],[]). Parse = dt(a), Word = a ; Parse = dt(the), Word = the. ?- vbd(Parse,[Word],[]). Parse = vbd(see+ed), Word = saw. ?- in(Parse,[Word],[]). Parse = in(with), Word = with. ?- ?- [g]. true. ?- s(Parse,[a,boy,saw,the,man,with,a,telescope],[]). Parse = s(np(dt(a), nn(boy)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(a), nn(telescope))))) ; false. ?- s(Parse,Sentence,[]). Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, a, man, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, a, man, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, a, man, with, a, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(the), nn(man))))), Sentence = [a, man, saw, a, man, with, the, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(the), nn(boy))))), Sentence = [a, man, saw, a, man, with, the, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(man)), pp(in(with), np(dt(the), nn(telescope))))), Sentence = [a, man, saw, a, man, with, the, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, a, boy, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, a, boy, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, a, boy, with, a, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(the), nn(man))))), Sentence = [a, man, saw, a, boy, with, the, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(the), nn(boy))))), Sentence = [a, man, saw, a, boy, with, the, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(boy)), pp(in(with), np(dt(the), nn(telescope))))), Sentence = [a, man, saw, a, boy, with, the, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, a, telescope, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, a, telescope, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, a, telescope, with, a, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(the), nn(man))))), Sentence = [a, man, saw, a, telescope, with, the, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(the), nn(boy))))), Sentence = [a, man, saw, a, telescope, with, the, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(a), nn(telescope)), pp(in(with), np(dt(the), nn(telescope))))), Sentence = [a, man, saw, a, telescope, with, the, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, the, man, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, the, man, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, the, man, with, a, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(the), nn(man))))), Sentence = [a, man, saw, the, man, with, the, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(the), nn(boy))))), Sentence = [a, man, saw, the, man, with, the, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(man)), pp(in(with), np(dt(the), nn(telescope))))), Sentence = [a, man, saw, the, man, with, the, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, the, boy, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, the, boy, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, the, boy, with, a, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(the), nn(man))))), Sentence = [a, man, saw, the, boy, with, the, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(the), nn(boy))))), Sentence = [a, man, saw, the, boy, with, the, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(boy)), pp(in(with), np(dt(the), nn(telescope))))), Sentence = [a, man, saw, the, boy, with, the, telescope] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(telescope)), pp(in(with), np(dt(a), nn(man))))), Sentence = [a, man, saw, the, telescope, with, a, man] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(telescope)), pp(in(with), np(dt(a), nn(boy))))), Sentence = [a, man, saw, the, telescope, with, a, boy] ; Parse = s(np(dt(a), nn(man)), vp(vbd(see+ed), np(dt(the), nn(telescope)), pp(in(with), np(dt(a), nn(telescope))))), Sentence = [a, man, saw, the, telescope, with, a, telescope] . ?-