资源描述:
《人工智能确定性推理部分参考答案.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、确定性推理部分参考答案1判断下列公式是否为可合一,若可合一,则求出其最一般合一。(1)P(a,b),P(x,y)(2)P(f(x),b),P(y,z)(3)P(f(x),y),P(y,f(b))(4)P(f(y),y,x),P(x,f(a),f(b))(5)P(x,y),P(y,x)解:(1)可合一,其最一般和一为:σ={a/x,b/y}。(2)可合一,其最一般和一为:σ={y/f(x),b/z}。(3)可合一,其最一般和一为:σ={f(b)/y,b/x}。(4)不可合一。(5)可合一,其最一般和一为:σ={y/x}。
2、2把下列谓词公式化成子句集:(1)(x)(y)(P(x,y)∧Q(x,y))(2)(x)(y)(P(x,y)→Q(x,y))(3)(x)(y)(P(x,y)∨(Q(x,y)→R(x,y)))(4)(x)(y)(z)(P(x,y)→Q(x,y)∨R(x,z))解:(1)由于(x)(y)(P(x,y)∧Q(x,y))已经是Skolem标准型,且P(x,y)∧Q(x,y)已经是合取范式,所以可直接消去全称量词、合取词,得{P(x,y),Q(x,y)}再进行变元换名得子句集:S={P(x,y),Q(u,v)}(2)对谓词公式(
3、x)(y)(P(x,y)→Q(x,y)),先消去连接词“→”得:(x)(y)(¬P(x,y)∨Q(x,y))此公式已为Skolem标准型。再消去全称量词得子句集:S={¬P(x,y)∨Q(x,y)}(3)对谓词公式(x)(y)(P(x,y)∨(Q(x,y)→R(x,y))),先消去连接词“→”得:(x)(y)(P(x,y)∨(¬Q(x,y)∨R(x,y)))此公式已为前束范式。再消去存在量词,即用Skolem函数f(x)替换y得:(x)(P(x,f(x))∨¬Q(x,f(x))∨R(x,f(x)))此公式已为Skole
4、m标准型。最后消去全称量词得子句集:S={P(x,f(x))∨¬Q(x,f(x))∨R(x,f(x))}(4)对谓词(x)(y)(z)(P(x,y)→Q(x,y)∨R(x,z)),先消去连接词“→”得:(x)(y)(z)(¬P(x,y)∨Q(x,y)∨R(x,z))再消去存在量词,即用Skolem函数f(x)替换y得:(x)(y)(¬P(x,y)∨Q(x,y)∨R(x,f(x,y)))此公式已为Skolem标准型。最后消去全称量词得子句集:S={¬P(x,y)∨Q(x,y)∨R(x,f(x,y))}3判断下列子句集中哪
5、些是不可满足的:(1){¬P∨Q,¬Q,P,¬P}(2){P∨Q,¬P∨Q,P∨¬Q,¬P∨¬Q}(3){P(y)∨Q(y),¬P(f(x))∨R(a)}(4){¬P(x)∨Q(x),¬P(y)∨R(y),P(a),S(a),¬S(z)∨¬R(z)}(5){¬P(x)∨Q(f(x),a),¬P(h(y))∨Q(f(h(y)),a)∨¬P(z)}(6){P(x)∨Q(x)∨R(x),¬P(y)∨R(y),¬Q(a),¬R(b)}解:(1)不可满足,其归结过程为:¬P∨Q¬Q¬PPNIL(2)不可满足,其归结过程为:P∨Q
6、¬P∨QQP∨¬Q¬P∨¬Q¬QNIL(3)不是不可满足的,原因是不能由它导出空子句。(4)不可满足,其归结过程略(5)不是不可满足的,原因是不能由它导出空子句。(6)不可满足,其归结过程略4对下列各题分别证明G是否为F1,F2,…,Fn的逻辑结论:(1)F:(x)(y)(P(x,y)G:(y)(x)(P(x,y)(2)F:(x)(P(x)∧(Q(a)∨Q(b)))G:(x)(P(x)∧Q(x))(3)F:(x)(y)(P(f(x))∧(Q(f(y)))G:P(f(a))∧P(y)∧Q(y)(4)F1:(x)(P(x)
7、→(y)(Q(y)→L(x.y)))F2:(x)(P(x)∧(y)(R(y)→L(x.y)))G:(x)(R(x)→Q(x))(5)F1:(x)(P(x)→(Q(x)∧R(x)))F2:(x)(P(x)∧S(x))G:(x)(S(x)∧R(x))解:(1)先将F和¬G化成子句集:S={P(a,b),¬P(x,b)}再对S进行归结:¬P(x,b)P(a,b)NIL{a/x}所以,G是F的逻辑结论(2)先将F和¬G化成子句集由F得:S1={P(x),(Q(a)∨Q(b))}由于¬G为:¬(x)(P(x)∧Q(x)),即(x
8、)(¬P(x)∨¬Q(x)),可得:S2={¬P(x)∨¬Q(x)}因此,扩充的子句集为:S={P(x),(Q(a)∨Q(b)),¬P(x)∨¬Q(x)}再对S进行归结:Q(a)∨Q(b)Q(a)¬P(x)∨¬Q(x)¬P(a)P(x)NILQ(a)∨Q(b){a/b}¬P(x)∨¬Q(x)Q(a){a/x}¬P(a)P(x){a