:- dynamic verb/1,noun/1,keyword/1. verb --> [has]. verb --> [go]. verb --> [expires]. name --> [eu-rent]. name --> [poland]. %brak mozliwosci uzywania malych liter dla nazw noun -->[car]. noun -->[period]. noun --> [rental]. noun --> [rental,period]. keyword --> [and]. keyword --> [or]. keyword --> [a]. keyword --> [the]. keyword -->[it,is,obligatory,that]. keyword -->[it,is,necessary,that]. keyword --> [it,is,prohibited,that]. %i tak dalej mozna zdefiniowac slownictwo writeList([]):-true,!. writeList([H|T]) :- write(H),write(' '),writeList(T). col(X) :- reverse(X,C),append(A,B,C),reverse(B,Z), ( verb(Z,[]),write(''),writeList(Z),write(' '); noun(Z,[]),write(''),writeList(Z),write(' '); keyword(Z,[]),write(''),writeList(Z),write(' '); name(Z,[]),write(''),writeList(Z),write('') ),reverse(A,Y),!, col(Y). np go(A):- tell('output.html'),write(' Colored prolog output

'),col(A);nl,write('

'),told.