Docsity

Logic and Automated Reasoning: Propositional Logic and First-Order Predicate Calculus - Pr, Study notes of Computer Science

Partial preview of the text

Download Logic and Automated Reasoning: Propositional Logic and First-Order Predicate Calculus - Pr and more Study notes Computer Science in PDF only on Docsity!

  • The appeal of logic as knowledge representation
  • Logic as "applied AI"
  • Styles of working with logic

Automated theorem proving Automated proof checking Logic programming

Propositional Logic

  • Only "atomic" propositions (P, Q, etc.) with binary truth values
  • Connectives AND, OR, NOT, IMPLIES
  • Values of sentences are determined as functions of the truth values of individual propositions.
  • Rules of inference: modus ponens, commutativity, etc.
  • Standard issues in propositional logic: satisfiability, contradiction, tautology, implication, equivalence.

First-Order Predicate Calculus

  • We introduce objects and properties :

Beau [object] Furry [property]

  • Predicates (or relations ) are true/false statements about objects:

Furry(Beau) Four-footed(Beau)

  • Functions are applied to objects to produce other objects:

Nose-of(Beau) Collar-of(Beau)

  • Atoms (or atomic sentences) are just predicates applied to object arguments:

Four-footed(Beau)

  • Sentences may be combined into more complex "compound forms" via connectives like AND, OR, NOT, IMPLIES:

Four-footed(Beau) AND Furry(Beau)

Furry(Beau) IMPLIES Mammal(Beau)

Furry (Beau) IMPLIES NOT(Reptile(Mother-of(Beau)))

  • Quantifiers FOR-ALL and THERE-EXISTS can be used to make statements about large (possibly infinite) sets

FOR-ALL (x) [Man(x) IMPLIES Mortal (x)]

FOR-ALL (x) [THERE-EXISTS (y) [Greater-than (y x)]]

To determine the truth or falsehood of logical sentences we have to place an interpretation on the objects and relations of a given logical system. The sentence above, for instance is true when x, y are taken from the set of real numbers but not true if they are taken from the set of non-negative integers. A model for a given set of sentences is an interpretation for which the sentences are true statements. (Sometimes the model is formally identified with the set of sentences alone.)

  • Issues in thinking about logical systems and rules of inference Entailment Soundness Completeness Decidability "Difficulty"

S1. Beau is a retriever. S2. Retrievers are dogs. S3. Dogs have sensitive noses. S4. Sensitive noses are useful for hunting.

P1. Retriever (Beau)

P2. FOR-ALL(x) [Retriever (x) --> Dog (x)]

P3. FOR-ALL (x, y) [Dog (x) AND Nose (y, x) --> Sensitive (y)]

P4. FOR-ALL (y) [(Sensitive (y) AND THERE-EXISTS (x) [Nose (y, x)]) ---> Useful-for-hunting (y)]

P5. FOR-ALL (x) [Nose(Nose-of(x), x)]

Backward Chaining

  • Propose the negation of what you want to prove:

[R1] Useful-for-hunting(Nose-of(Beau)) --> F

English: It is not the case that the object Nose-of(Beau) is useful for hunting.

  • Resolve [R1] and [5]:

[R2] Sensitive(Nose-of(Beau)) AND Nose (Nose-of(Beau), Beau) --> F

English: It is not the case that the object Nose-of(Beau) is sensitive and is a nose that belongs to Beau.

  • Resolve [R2] and [3]: Note that [3] can be written T--> Nose(Nose-of(Beau), Beau)

[R3] Sensitive (Nose-of(Beau)) --> F

English: It is not the case that the object Nose-of(Beau) is sensitive.

  • Resolve [R3] and [4]

[R4] Nose(Nose-of(Beau), Beau) AND Dog(Beau) --> F

English: It is not the case that the object Nose-of(Beau) is a nose belonging to Beau and that Beau is a dog.

  • Resolve [R4] and [3]

[R5] Dog (Beau) --> F

English: It is not the case that Beau is a dog.

  • Resolve [R5] and [2]

[R6] Retriever (Beau) --> F

English: It is not the case that Beau is a retriever.

  • Resolve [R7] and [1]

T --> F [Contradiction]

Step 5. We now have a bunch of disjunctions of terms, some of which have a negation sign in front of them. Move the negation terms to the left:

(NOT C) OR (NOT D) OR E OR F

Then use DeMorgan's laws to get the sentence in the equivalent IMPLIES form:

NOT (C AND D) OR E OR F

Step 6. Rewrite using IMPLIES to put the sentence back into normal form:

NOT (C AND D) OR E OR F

becomes

(C AND D) IMPLIES (E OR F)

Redoing the Previous Algorithm for First-Order Predicate Logic:

  1. Eliminate occurrences of IMPLIES
  2. Bring negation inside parentheses.

Note that NOT (FOR-ALL(x) P(x)) becomes THERE-EXISTS (x) [NOT P(x)]

NOT (THERE-EXISTS(x) Q(x)) becomes FOR-ALL (x) [NOT Q (x)]

  1. For every occurrence of a quantifier, provide the bound variable with its own unique name. (This prevents name conflicts when quantifiers are eventually "moved to the front.")
  2. Use Skolemization to replace existential quantifiers. The idea here is that an existential quantifier specifies a "choosing function" (that may depend on other variables):

FOR-ALL (x) [THERE-EXISTS [y] Successor (y x)]

becomes

FOR-ALL (x) [Successor (Successor-of(x), x)]

  • Resolution is, at heart, a search problem Different sorts of strategies for searching: "set-of-support" strategy, "unit-preference" strategy
  • Interactive systems
  • More elaborate types of logic