/* A simple sentence alterer. Helen Pain (from Clocksin and Mellish) 26.2.85 To use the program, first consult this file and then type: ?- alter([i,write,a,sentence],X). Another sentence will be output, with a number of the words in the input sentence changed. */ alter([],[]). alter([H|T],[X|Y]):- change(H,X), alter(T,Y). change(we,you). change(are,[are,not]). change(french,german). change(do,no). change(you,we). change([are,not],are). change(yes,no). change(i,you). change(am,[am,not]). change(X,X).