Slide 14.10: Examples of resolution Slide 14.12: An example of unification Home |
legs(x,4) ← mammal(x), arms(x,0), legs(horse,4).
⇓ x = horse
legs(horse,4)←mammal(horse),arms(horse,0),legs(horse,4).
Unification is a binary operation whose purpose is to attempt to make its two operands the same.Other than resolution and unification, the execution orders need to be considered too. For example, given the Horn clauses
ancestor( x, y ) ← parent( x, z ), ancestor( z, y ). ancestor( x, x ). parent( amy, bob ).if we provide the query
← ancestor( x, bob ).
there are two possible answers for this query:
ancestor(x,x)
is used, the solution is x=bob
.
ancestor(x,y)←parent(x,z),ancestor(z,y)
is used, the solution x=amy
will be found.