First-Order Logic: Knowledge Representation in Predicate Logic, Slides of Introduction to Computing

Knowledge Representation techniques

Typology: Slides

2017/2018

Uploaded on 12/26/2018

mmelsherbiny1
mmelsherbiny1 🇪🇬

5

(2)

25 documents

1 / 128

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS613 INTRODUCTION TO
ARTIFICIAL INTELLIGENCE
Lecture 10
Knowledge Representation
First-Order Logic
Dr. Kamel A. El Hadad
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download First-Order Logic: Knowledge Representation in Predicate Logic and more Slides Introduction to Computing in PDF only on Docsity!

CS613 INTRODUCTION TO

ARTIFICIAL INTELLIGENCE

Lecture 10

Knowledge Representation

First-Order Logic

Knowledge Representation

A number of knowledge-representation techniques have been devised:

  • Rules
  • First-Order Logic
  • Semantic nets
  • Frames
  • etc

Logic: a classic example

  1. All men are mortal
  2. Socrates is a man

therefore

  1. Socrates is mortal
  • Statements (1) and (2) are called axioms. They are assumed to be correct.
  • Statement (3) is called a theorem that logically follows from the axioms
  • This is an example of deductive inference , which means obtaining specific facts from general rules
  • Deductive inference is truth-preserving
  • Obtaining general rules from specific facts is called inductive inference.
  • Inductive inference is NOT truth preserving
  • Example (very simple) :
    1. Robins are birds and they can fly
    2. Parrots are birds and they can fly
    3. Finches are birds and they can fly
    4. Eagles are birds and they can fly 5.... 6....

therefore

  1. All birds can fly

Note: people are often very good at generalizing

  • In predicate calculus notation...
    1. x [ is_a_man(x)is_mortal(x) ] 2. is_a_man(Socrates) 3. is_mortal(Socrates)
  • predicates :
    • is_a_man(x) "x is a man "
    • is_mortal(x) "x is mortal "
  • new symbols:
    • x universal quantification "for all values of variable x ...
    •  implication
    • AB "A implies B" if A, then B“

Modus ponens

  • Consider E1E

E1 therefore E

  • modus ponens is the inference operation

(or rule) that produces E2 from E1 and EE

  • x [ is_a_man(x)is_mortal(x) ]
  • is_a_man(Socrates)is_mortal(Socrates)
  • is_a_man(Socrates)
  • is_mortal(Socrates)

Predicate calculus

fundamentals

  • terms
    • constants
    • variables
    • functions
  • predicates
  • atomic formulas
  • literals
  • Well-Formed Formulas (wff)

Terms

  • constant symbols (also called objects), Eg., Socrates, NOMAD, box
  • variable symbols, Eg., x, y, person
  • functions (with arguments), Eg., hair_color(John)

(returns brown, blond , etc.)

  • Terms serve as arguments to predicates

Atomic formulas

  • An atomic formula is one predicate with its arguments
  • is_a_man(Socrates)

"Socrates is a man"

  • are_friends(Calvin, Hobbes)

"Calvin and Hobbes are friends"

  • on(B, A)

"Block B is on top of block A"

  • is_dentist(sister(John))

"John's sister is a dentist“

  • In Prolog

friends(calvin, bobbes).

Literals

  • A literal is an atomic formula or a negated

atomic formula

  • "Joan is at home"

is_at_home(Joan)

  • "Simmons is not at home"

¬ is_at_home(Simmons)

  • Negation: ¬ (not)
    • Truth table: (let F1 be any atomic formula)

F1 ¬ F

T F

F T

  • Disjunction : V | + "or"
    • "Jack plays guitar or Jill sings (or both)" plays_guitar (Jack) V sings (Jill)
    • Truth table:

F1 F2 F1 V F

F F F

F T T

T F T

T T T

  • Implication :  "implies"
    • "If the groundhog sees its shadow, then there will be 6 more weeks of winter" see_shadow (ghog)duration (winter, 6)
    • Truth table:

F1 F2 F1  F

F F T

F T T

T F F

T T T

  • Notice that ( F1F2) has the same truth table as ( ¬ F1 V F2)
  • Either expression can be replaced by the other at

any time

  • Represent such equivalence as

( F1F2 )( ¬ F1 V F2 )

F1 F2 F1  F

F F T

F T T

T F F

T T T

¬ F1 F2^ ¬ F1^ VF

T F T

T T T

F F F

F T T

Equivalence laws

F1 Λ F 2  F 2 Λ F 1

F1 V F2  F2 V F

F1 Λ (F 2 Λ F 3 )  (F 1 Λ F 2 ) Λ F 3

F1 V (F2 V F3)  (F1 V F2) V F

F1 Λ (F 2 V F 3 )  (F 1 Λ F 2 ) V (F 1 Λ F 3 )

F1 V (F2 Λ F 3 )  (F 1 V F 2 ) Λ (F 1 V F 3 )

¬ (¬ F1)  F

¬(F1 V F2)  ¬ F1 Λ ¬ F 2