## Lesson goal: More introduction to Prolog

Previous: Introduction to Prolog: Facts and goals | Home | Next: Adding two fractions

In the last lesson, you got a taste of Prolog facts and goals. Let's continue this now, with an example that might make you think "Hmmm...how did the computer do that?"

We'll use the likes fact again, but with a twist.
likes(ellen,tennis).
likes(bill,X):-likes(tom,X).

Reading likes(bill,X) :- likes(tom,X). means: bill will like item X if tom likes item X. So when Prolog tries to see if bill likes item X, it first has to determine if tom also likes item X (which is can determine from the raw facts).