EqualityComputational LogicLecture 16Michael GeneserethSpring 20022CoreferentialityDifferent terms can sometimes refer to the same object.2+22*24In many situations, we want to say explicitly that two terms arecoreferential; and, in many situations, we want to sayexplicitly that two terms are not coreferential. For this, we useequality2+2=2*2Coreferentiality3EqualityAn equation is true if and only if the terms in the equation referto the same object in the universe of discourse.(1) Given an interpretation, a constant “refers” to the node inthe interpretation graph on which it occurs as a label.(2) Given an interpretation, a functional term refers to thevalue of the function applied to the arguments as specified inthe interpretationInterpretation/Database:{boss(art)=art,boss(joe)=art}Example:p(x,boss(x)) → p(joe,boss(joe)) → p(joe,art).4HerbrandThe Herbrand Theorem does not hold in the presence ofequality.In a Herbrand interpretation, every constant refers toitself. In other interpretations, different constants mayrefer to the same constant.5IncompletenessTheorem: Resolution (with factoring) is refutationcomplete for Relational Logic*.*without equality.Theorem: There is a set of premises ∆ and a conclusion ϕ(involving equality) such that ∆ logically implies ϕ but ϕcannot be proved from ∆ using Resolution.1. b = aPremise2. b = cPremise3. a = c? Goal6Two ApproachesAxiomatic approach -- add axioms of equalityProof Theoretic approach -- add new rules of inference7Equality AxiomsReflexivity∀x.x=xSymmetry:∀x.∀y.(x=y ⇒ y=x)Transitivity:∀x.∀y.∀z.(x=y ∧ y=z ⇒ x=z)8Equality Axioms in Rule FormReflexivityx=xSymmetry:x=y ⇐ y=xTransitivity:x=z ⇐ x=y ∧ y=z9Equality Proof1. b = aPremise2. b = cPremise3. x = x Equality4. x = y ⇐ y = x Equality5. x = z ⇐ x = y ∧ y = z Equality6. a = c? Goal7. a = y ∧ y = c? 5,68. y = a ∧ y = c? 4,79. b = c? 1,810. ? 2,910Equality Problem1. f(a) = bPremise2. f(b) = aPremise3. x = x Equality4. x = y ⇐ y = x Equality5. x = z ⇐ x = y ∧ y = z Equality6. f( f (a)) = a? Goal7. a = f ( f (a))? 4,68. f( f (a)) = y ∧ y = a? 5,69. f( f (a)) = w ∧ w = y ∧ y = a? 5,810. f( f (a)) = v ∧ v = w∧ w = y ∧ y = a? 5,911FlatteningEquivalence:f(f(a))=a ⇔ ∃x.(f(a)=x ∧ f(x)=a)Rewrite: f(f(a))=aAs: ∃x.(f(a)=x ∧ f(x)=a)As: f(a)=c ∧ f(c)=aAs: f(a)=c f(c)=aRewrite: f(f(a))=a?As: ∃x.(f(a)=x ∧ f(x)=a)?As: f(a)=x ∧ f(x)=a?12Proof With Flattening1. f (a) = bPremise2. f (b) = aPremise3. x = x Equality4. x = y ⇐ y = x Equality5. x = z ⇐ x = y ∧ y = z Equality6. f (a) = x ∧ f (x) = a? f( f (a)) = a?7. f (b) = a? 1,68. ? 2,713Substitution AxiomFlattening Rule:f(f(a))=a ⇔ ∃x.(f(a)=x ∧ f(x)=a)Substitution Axiom:f(x)=z ⇐ x=y ∧ f(y)=z14Proof With Substitution1. f(a) = bPremise2. f(b) = aPremise3. x = x Equality4. x = y ⇐ y = x Equality5. x = z ⇐ x = y ∧ y = z Equality6. f(x) = z ⇐ x = y ∧ f (y) = z?Substitution7. f( f (a)) = a? Goal8. f(a) = y ∧ f (y) = a? 6,79. f(b) = a? 1,810. ? 2,915NotesSubstitution axioms for relation constants too.p(x) ⇐ x=y ∧ p(y)Substitution axioms for multiple argumentsp(x,y)=z ⇐ x=u ∧ y=v ∧ p(u,v)Need one substitution for each function and relation constant.16Motivation for Demodulationp(a, f (b,g(a,h(b)),c),d)b = ep(a, f (b,g(a,h(e)),c),d)17Demodulation{ϕ1,...,ϕn}{τ1= τ2}{ϕ1,...,ϕn}[τ1σ ←τ2σ]where τ occurs in ϕi where τ1σ = τ18Examplesp(a, f (b,g(a,h(b)),c),d)b = ep(a, f (e,g(a,h(e)),c),d)p(a, f (b,g(a,h(b)),c),d)g(x, y) = j(x)p(a, f (b, j(a),c),d)19Non-Examplesp(a,g(a,b),c)g(a,y) = y ⇐ p(y)p(a,g(a,b),c) ⇐ p(b)p(a,g(x,b),c)g(a,y) = j(y)p(a, j(b),c)Unit Equations OnlyVariables Substituted in Equation Only20Parent DeletionIn general, given a literalwith n arguments and k equations:Demodulation at most 1 clauseParamodulation (k+1)n possible clauses1. a = 1 a = 12. p(a,a,a) p(a,a,a)3. p(a,a,1) p(a,a,1)4. p(a,1,1) p(a,1,a)5. p(1,1,1) p(a,1,1)6. p(1,a,a)7. p(1,a,1)8. p(1,1,a)9. p(1,1,1)In Demodulation, parent is usually deleted after substitution.21Proof With Demodulation1. f (a) = bPremise2. f (b) = aPremise3. x = x Equality4. f ( f(a)) = a? Goal5. f (b) = a? 1,46. ? 2,522Proof With Demodulation1. f(1) =1Premise2. f(x) = x* f(x −1)Premise3. x = x Equality4.arithmeticaxiomsPremise5. f(3) = z? Goal6. 3* f (3−1) = z? 2,57. 3* f (2) = z? 4,68. 3*2* f(2 −1) = z? 2,79. 3*2* f(1) = z? 4,810. 3*2*1= z? 1,911. 3*2 = z? 4,1012. 6 = z? 4,1113. ? 3,1223Proof With DemodulationSuppose Bill is Joe's paternal grandfather and suppose that Billis kind. Prove that Joe's paternal grandfather is kind.1. pgf (joe) = billPremise2. f ( f(x)) = pgf (x)Premise3. kind(bill)Premise4. kind( f ( f (joe)))? Goal5. kind(pgf( joe))? 2,46. kind(bill)? 1,57. ? 3,624Problems With DemodulationCannot bind variables in expression:father(pat) =quincyolder( father(x), x)older(quincy,pat)Equation must be a unit clausefather(x) = y ⇐ x = pat ∧ y =quincyolder( father(x), x)older(quincy,pat) ⇐ x = pat ∧ y =quincy25Paramodulation{ϕ1,...,ϕn}{ψ1,...,τ1= τ2,...,ψn}{ϕ1,...,ϕn,ψ1,...,ψn}σ[τ1σ ← τ2σ]where τ occurs in ϕi where τ1σ = τσ26Differences(1) Demodulation requires a unit equation.(2) Demodulation binds variables in equation only.(3) Demodulation deletes parent.27Example{p( f (x,b),x),q(x)}{f (a,y) = y,r(y)}{p(b,a),q(a),r(b)}28Proof With Paramodulation1. {father(pat) =quincy}Premise2. {older( father(x),x)}Premise3. {¬older(quincy,pat)} Goal4. {older(quincy, pat)} 1,25. {} 3,429Proof With Paramodulation1. {p(a)}Premise2. {p(b)}Premise3. {a = c,b = c} a = c∨ b = c4. {¬p(c)} Goal5. {¬p(a),b = c} 3,46. {¬p(a),¬p(b)} 4,57. {¬p(b)} 1,68. {} 2,730PowerTheorem: Resolution and Paramodulation (together with thereflexivity axiom) are refutation complete for all of RelationalLogic*.*including
View Full Document