# HG changeset patch # User IBBoard # Date 1506453978 -3600 # Node ID 91d02b3d74f815970fd8291596e9da350685f651 # Parent 005ae3fad18f58c212c04a446015da6e66c45b4b Write up "unification" code diff -r 005ae3fad18f -r 91d02b3d74f8 3-Prolog/day1-unification.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3-Prolog/day1-unification.pl Tue Sep 26 20:26:18 2017 +0100 @@ -0,0 +1,10 @@ +% "=" isn't assignment in Prolog, it is "unification" - finding something where +% both structures are identical +cat(lion). +cat(tiger). + +% This rule makes sure that X, Y and Z match a lion, a tiger and a bear (oh my!) +dorothy(X, Y, Z) :- X = lion, Y = tiger, Z = bear. + +% This rule checks whether both things are cats, if so then they are "twin_cats" +twin_cats(X, Y) :- cat(X), cat(Y). \ No newline at end of file