SLIDE 1
Matching
Once we have objects, it is useful to compare them. The mechanism to do so is called matching in Prolog, and is different from the equalities we find in other programming languages.
- Two numbers match if they represent the same mathematical
number.
- Two atoms match if they are made of the same characters.
- A variable matches any object.
- Two structures match if
- their functors match (as atoms),
- all their corresponding arguments match.
60 / 109