dragonwasrobot / learn-prolog-now-exercises

My solutions to the exercises and practical sessions of the book 'Learn Prolog Now!' by Patrick Blackburn, Johan Bos, and Kristina Striegnitz.
288 stars 81 forks source link

Fix exercise 4.4 - the tails of the two lists should be identical #15

Closed ghost closed 8 years ago

ghost commented 8 years ago

The two bindings of the _ variable are independent, which means that they could be bound to different objects. For example:

swap12([1, 2, 3], [2, 1, 4]).

would evaluate to true with the use of _. The first _ gets bound to 3, while the second _ gets bound to 4.