1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
permute ([], []). permute ([E|X], Z):- permute (X, Y), insert (E, Y, Z). insert (E, X, [E|X]). insert (E, [F|X], [F|Y]):- insert (E, X, Y). marquise(RESULT):- permute (["beautiful marquise", "your beautiful eyes", "make me", "die", "of love" ], RESULT).