RosettaCodeData/Task/Generic-swap/Prolog/generic-swap.pro

6 lines
48 B
Prolog

swap(A,B,B,A).
?- swap(1,2,X,Y).
X = 2,
Y = 1.