在合一的过程中,x置换为f(A),而f(A)与A不能合一。
5、已知两个子句为 Loves(father(a),a) ~Loves(y,x)∨Loves(x,y)
试用合一算法求第一个子句和第二个子句的第一个文字合一时的结果。 答: 略
6、用归结反演法证明下列公式的永真性:
(1)(x){[P(x)→P(A)]∧[P(x)→P(B)]} (2)(
z)[Q(z)→P(z)]→{(x)[Q(x)→P(A)]∧[Q(x)→P(B)]}
(3)(x)(y){[P(f(x))∧Q(f(B))]→[P(f(A))∧P(y)∧Q(y)]} (4)(x)((5)(
y)P(x,y)→(
y)(x)P(x,y)
x){P(x)∧[Q(A)∨Q(B)]}→(x)[P(x)∧Q(x)]
答: (1)(x){[P(x)→P(A)]∧[P(x)→P(B)]} 目标取反化子句集:
~(x){[P(x)→P(A)]∧[P(x)→P(B)]} ~(x){[~P(x)∨P(A)]∧[~P(x)∨P(B)]} ( ( (
x){[P(x)∧~P(A)]∨[P(x)∧~P(B)]}
x){[P(x)∧~P(A)]∨P(x)}∧{[P(x)∧~P(A)]∨~P(B)}} x){P(x)∧[~P(A)∨P(x)]∧[P(x)∨~P(B)]∧[~P(A)∨~P(B)]}
P(x)∧[~P(A)∨P(x)]∧[P(x)∨~P(B)]∧[~P(A)∨~P(B)] 得子句集: 1, P(x1)
2, ~P(A)∨P{x2} 3, P(x3)∨~P(B) 4, ~P(A)∨
~P(B)
(2)(
z)[Q(z)→P(z)]→{(x)[Q(x)→P(A)]∧[Q(x)→P(B)]}
目标取反化子句集: ~{( ~{(
z)[Q(z)→P(z)]→{(x)[Q(x)→P(A)]∧[Q(x)→P(B)]}} z)[~Q(z)∨P(z)]→{(x)[~Q(x)∨P(A)]∧[~Q(x)∨P(B)]}}
~{~{(z)[~Q(z)∨P(z)]}∨{(x)[~Q(x)∨P(A)]∧[~Q(x)∨P(B)]}}