Docsity

First-Order Logic: Horn Clauses and Deduction, Study notes of Computer Science

Toggle sidebar
bg1
First-Order Logic
•Returns the result of a relation between “n” terms (Symbolic
Expressions) as some symbol
•Allows quantification over individuals but not over predicates
and functions
X = Y iff ∀ P. P(X) = P(Y) and ∀ F. F(X) = F(Y)
Function
Modus Ponens
Modus Tolens
And Elimination
And Introduction
Universal Instantiation
Any clause or statement in the form of a proper implication
or its equivalent is a horn clause
By proper implication we mean:
Convert the following to Horn Clauses:
robin(rob-rob) => bird(rob-rob)
~ human(jon) v mortal(jon)
cat(tom) v dog(tom)
Horn Clauses
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download First-Order Logic: Horn Clauses and Deduction and more Study notes Computer Science in PDF only on Docsity!

First-Order Logic

  • Returns the result of a relation between “n”terms (Symbolic Expressions) as some symbol
  • Allows quantification over individuals but not over predicates and functions X = Y iff ∀ P. P(X) = P(Y) and ∀ F. F(X) = F(Y)

Function

Modus Ponens Modus Tolens And Elimination And Introduction Universal Instantiation

Any clause or statement in the form of a proper implication or its equivalent is a horn clause By proper implication we mean:

Convert the following to Horn Clauses: robin(rob-rob) => bird(rob-rob) ~ human(jon) v mortal(jon)

cat(tom) v dog(tom)

Horn Clauses

Horn Database consists only of Horn Clauses These databases are important because:

if is in the database

and if

and if is in the database

then we can add:

Example

We want to go to Atlanta for the weekend. There are two ways for us to get there: A flight by Delta at 3 p.m. or driving our car. We have meetings at 2 and 3 p.m. and our car is broken. Can we go?

flight(delta, 3, atlanta) => trip(delta, atlanta) drive(car) => broken(car) v trip(car, atlanta) trip(delta, atlanta) v trip(car, atlanta) => go(atlanta) meeting(2) meeting(3) broken(car) flight(delta, 3, atlanta) meeting(X) => busy(X) flight(X, Y, Z) ^ busy(Y) => notrip(X, Z) drive(X) ^ broken(X) => notrip(X, atlanta) notrip(X, Y) => nogo(Y)

flight(delta, 3, atlanta) => trip(delta, atlanta) drive(car) => broken(car) v trip(car, atlanta) trip(delta, atlanta) => go(atlanta) trip(car, atlanta) => go(atlanta) meeting(2) meeting(3) broken(car) flight(delta, 3, atlanta) meeting(X) => busy(X) flight(X, Y, Z) ^ busy(Y) => notrip(X, Z) drive(X) ^ broken(X) => notrip(X, atlanta) notrip(X, Y) => nogo(Y)

flight(delta, 3, atlanta) => trip(delta, atlanta) drive(car) => broken(car) v trip(car, atlanta) trip(delta, atlanta) => go(atlanta) trip(car, atlanta) => go(atlanta) T => meeting(2) meeting(3) broken(car) flight(delta, 3, atlanta) meeting(X) => busy(X) flight(X, Y, Z) ^ busy(Y) => notrip(X, Z) drive(X) ^ broken(X) => notrip(X, atlanta) notrip(X, Y) => nogo(Y)

flight(delta, 3, atlanta) => trip(delta, atlanta) drive(car) => broken(car) v trip(car, atlanta) trip(delta, atlanta) => go(atlanta) trip(car, atlanta) => go(atlanta) T => meeting(2) T => meeting(3) T => broken(car) T => flight(delta, 3, atlanta) meeting(X) => busy(X) flight(X, Y, Z) ^ busy(Y) => notrip(X, Z) drive(X) ^ broken(X) => notrip(X, atlanta) notrip(X, Y) => nogo(Y)

Suppose that we have the relationship: ∀ X, Y, Z. brother(X,Y) ^ son(Z,Y) => uncle(X,Z) And that we know:

Can we derive uncle(doug,scott)?

Deduction and Abduction

Suppose that we have the relationship: ∀ X, Y, Z. brother(X,Y) ^ son(Z,Y) => uncle(X,Z) And that we know:

Can we derive son(pat,dennis)?

Deduction and Abduction

But, if we have the relationship: ∀ X, Y, Z. brother(X,Y) ^ son(Z,Y) => uncle(X,Z) And we are trying to show uncle(doug,scott), then if we can find (or derive):

Deduction and Abduction

brother(doug,dennis) and son(scott,dennis)

we have proven that uncle(doug,scott) is true since these facts support the given implication!

Small Example

  1. ∀ X, Y, Z. brother(X,Y) ^ son(Z,Y) => uncle(X,Z)
  2. ∀ X, Y. brother(X,Y) => brother(Y,X)
  3. T => brother(dennis,doug)
  4. T=>son(scott,dennis)

Is the following true: 5. uncle(doug,scott)?

  1. Eliminate =>
  2. Use DeMorgan’s Law (move negations in)
  3. Distribute v and ^
  4. Split the resulting conjunctions
  5. Combine the negative terms
  6. Reintroduce =>

For resolution to work, we must have all statements in Normal Form:

A 1 ^ A 2 ^ ... ^ An => B 1 v B 2 v ... v Bm

The translation algorithm involves the following steps (Algorithm 7.5.2 in book):

Simple Example

A ^ B => C ^ D

The More Complete Algorithm (8.6.3)

  1. Eliminate =>
  2. Use DeMorgan’s Law (move negations in)
  3. Separate any standardized variables
  4. Eliminate Existential Quantifiers using Skolemization
  5. Move the quantifiers to the left
  6. Drop the quantifiers
  7. Distribute v and ^
  8. Split the resulting conjunctions
  9. Combine the negative terms
  10. Reintroduce =>
  11. Separate any standardized variables again

Another Example

“All Romans who know Marcus either hate Caesar or think that anyone who hates anyone is crazy”

becomes:

  1. Move all quantifiers to the left of the statement:
  2. Drop all quantifications since everything is univerally quantified:
  3. Create a conjunction of disjunctions:
  4. Split the resulting conjunctions
  5. Combine the negative terms
  6. Reintroduce =>
  1. Separate any standardized variables again

What we are finally left with is:

if we have ( ∀ X. p(X) ^ q(X)) create ( ∀ X. p(X)) ^ ( ∀ Y. q(Y))

If we want to show Q is true, we try to prove that ~Q is true. If this proof results in a contradiction, then Q is true.

  1. a
  2. a => b
  3. b => c
  4. d
  5. d ^ c => e
  6. e ^ d => g Is g true?

Proof by Refutation