8、给定下述语句: John likes all kinds of food. Apples are food.
Anything anyone eats and isn't killed by is food. Bill eats peanuts and is still alive. Sue eats everything Bill eats.
(1)用归结法证明"John likes peanuts。" (2)用归结法提取回答"What food does Sue eat?" 答: 该问题用谓词公式描述如下: 已知:
(1)(x){Food(x)→Like(John, x)} (2)Food(Apple) (3)(
x)(
y){[Eat(y, x)∧~Kill(x, y)]→Food(x)}
(4)Eat(Bill, Peanut)∧~Kill(Penut, Bill) (5)(
x){Eat(Bill, x)→Eat(Sue, x)}
目标1:Like(John, Peanut) 目标2:(x)Food(x)∧Eat(Sue, x) 已知条件化子句集: (1)( = (
x){Food(x)→Like(John, x)} x){~Food(x)∨Like(John, x)}
=> {~Food(x)∨Like(John, x)} (2)Food(Apple) (3)( = (
= (
x)(x)(x)(
y){[Eat(y, x)∧~Kill(x, y)]→Food(x)} y){~[Eat(y, x)∧~Kill(x, y)]∨Food(x)} y){~[Eat(y, x)∨Kill(x, y)]∨Food(x)}
=> {~Eat(y, x)∨Kill(x, y)∨Food(x)} (4)Eat(Bill, Peanut)∧~Kill(Penut, Bill) => {Eat(Bill, Peanut), ~Kill(Penut, Bill)} (5)( = (
x){Eat(Bill, x)→Eat(Sue, x)} x){~Eat(Bill, x)∨Eat(Sue, x)}
=> ~Eat(Bill, x)∨Eat(Sue, x) 目标1取反化子句集: ~Like(John, Peanut) 目标2取反化子句集: ~{(x)Food(x)∧Eat(Sue, x)} = (
x)~Food(x)∨~Eat(Sue, x)
=> ~Food(x)∨~Eat(Sue, x)
对于目标1,经变量换名后,得子句集:
{~Food(x1)∨Like(John, x1),Food(Apple),~Eat(y2, x2)∨Kill(x2, y2)∨Food(x2),Eat(Bill, Peanut), ~Kill(Penut, Bill), ~Eat(Bill, x3)∨Eat(Sue, x3), ~Like(John, Peanut)} 归结树如下: