FOIL Example
- Say we are tying to predict the Target-predicate
GrandDaughter(x,y).
- FOIL begins with
NewRule = GrandDaughter(x,y) ←
- To specialize it, generate these candidate additions to the
preconditions:
Equal(x,y), Female(x), Female(y),
Father(x,y), Father(y.x), Father(x,z), Father(z,x),
Father(y,z), Father(z,y)
and their negations.
- FOIL might greedily select Father(x,y) as most promising,
then
NewRule = GrandDaughter(x,y) ←
Father(y,z).
- Foil now considers all the literals from the previous step
as well as:
Female(z), Equal(z,x), Equal(z,y),
Father(z,w), Father(w,z)
and their negations.
- Foil might select Father(z,x), and on the next step
Female(y) leading to
NewRule = GrandDaughter (x,y)
← Father(y,z) ∧ Father(z,x) ∧ Female(y)
- If this covers only positive examples it terminates the
search for further specialization.
- FOIL now removes all positive examples covered by this new
rule. If more are left then the outer loop continues.
José M. Vidal
.
29 of 47