Prefix, suffix, infix - back to content

			?- prefix(ant,antiquity).
        		true.
        		?- prefix(ant,another).
        		false.
        		?- suffix(rior,superior).
        		true.
        		?- infix(pp,happiness).
        		true.

prefix(P,C):- name(P,Pcod),name(C,Ccod), append(Pcod,_,Ccod). suffix(S,C):- name(S,Scod),name(C,Ccod), append(X,Scod,Ccod),not X=[]. infix(I,C):- name(I,Icod),name(C,Ccod), append(C1,C2,Ccod),append(Icod,_,C2).