Since this year, we have to decide between logic and functional programming, because of a shortening of the studies (bachelor/master instead of diploma). Yes, this is stupid, noone likes it. But I'm only taking CS as a subsidiary subject, so that's not affecting me much.
But on loops: we're doing the famous family tree, and so I did this:
twin_of(hans, georg).
...
twin_of(X,Y) :- twin_of(Y,X).
Volia: Loop, the infinite kind... I'm still not sure if it's stupid of Prolog not to remember past requests.
And I managed to produce a predicate which says yes to
vorfahre_von(iris, hans), but fails to list iris and hans with vorfahre_von(X,Y). /me likes challenges :) |