1 / 12

Prolog and Classical Theorem Proving

Prolog and Classical Theorem Proving. Resolution theorem proving viewpoint. Natural deduction theorem proving viewpoint. Conversion to Clausal Form. Step 1: Eliminate  and  operators. Conversion to Clausal Form. Step 2: Move all quantifiers to the left. Conversion to Clausal Form.

Download Presentation

Prolog and Classical Theorem Proving

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Prolog and Classical Theorem Proving • Resolution theorem proving viewpoint. • Natural deduction theorem proving viewpoint.

  2. Conversion to Clausal Form Step 1: Eliminate  and  operators.

  3. Conversion to Clausal Form Step 2: Move all quantifiers to the left.

  4. Conversion to Clausal Form Step 3: Eliminate all existential quantifiers • Those outside the scope of a universal quantifier are replaced with Skolem constants. e.g.X.happy(X) translates to happy(someone) • Those inside the scope of universal quantifiers are replaced with Skolem functions for which the arguments are the universally quantified variables. e.g. X.Y.hates(X,Y) translates to hates(X,enemy(X)) Step 4: Remove universal quantifiers as well since we can now assume all variables are universally quantified.

  5. Conversion to Clausal Form Step 5: Drive negation inwards to predicates.

  6. Conversion to Clausal Form Step 6: Bundle disjunctions together. Step 7: Convert each disjunction bundle to a set. Step 8: Convert top-level conjunction to a set.

  7. Example of Clausal Form Translation X.((lecturer(X)  not(logic_programmer(X))  kindly(X))  lecturer(dave)  not(kindly(dave)) X.(not(lecturer(X)  not(logic_programmer(X))  kindly(X))  lecturer(dave)  not(kindly(dave)) X.(not(lecturer(X))  not(not(logic_programmer(X)))  kindly(X))  lecturer(dave)  not(kindly(dave)) X.(not(lecturer(X))  logic_programmer(X)  kindly(X))  lecturer(dave)  not(kindly(dave)) (not(lecturer(X))  logic_programmer(X)  kindly(X))  lecturer(dave)  not(kindly(dave)) { {not(lecturer(X)), logic_programmer(X),kindly(X)}, {lecturer(dave)}, {not(kindly(dave))} }

  8. A Resolution Proof To prove logic_programmer(dave) from : { {not(lecturer(X)),logic_programmer(X),kindly(X)}, {lecturer(dave)}, {not(kindly(dave))} } {not(lecturer(X)), logic_programmer(X), kindly(X)} {not(logic_programmer(dave))} {not(lecturer(dave)), kindly(dave)} {lecturer(dave)} {not(kindly(dave))} {kindly(dave)} {} Contradiction

  9. Prolog Viewed as Resolution Proof p(X) :- q(X), r(X). q(a). r(a). p(X)  q(X)  r(X). q(a). r(a). { {p(X), not(q(X)), not(r(X))} {q(a)}, {r(a)} } | ?- p(a). {not(p(a))} {p(X), not(q(X)), not(r(X))} {not(q(a)), not(r(a))} {q(a)} {not(r(a))} {r(a)} {} Contradiction yes

  10. Prolog as a Form of Natural Deduction Sub-proofs Proof A F F true 1 F A  B F A F B 2 F A F A  B 3 F A  B F B 4 A  B F F A F B 5 plus negation as failure: F A F not(A)

  11. A Prolog Natural Deduction Proof F= { p(a)  true, p(f(X))  p(X) } F p(f(f(a))) 5 p(f(f(a)))  p(f(a)) F F p(f(a)) 5 p(f(a))  p(a) F F p(a) 5 F true p(a)  trueF 1

  12. Divergences Some proof rules in classical natural deduction aren’t used in Prolog. A or B F [ A|F] C [ B|F] C F C [ A|F] B F A  B but one can get similar effects by different means: g(X1,…,Xm)  p(X1,…,Xn) or q(Xn+1,…,Xm) F then use g(…) instead of (p(…) or q(…)) Use equivalence of A  B to not(A  not(B))

More Related