ai=knowledge representation & reasoning

17
1 AI=Knowledge Representation & Reasoning Syntax Semantics Inference Procedure Algorithm Sound? Complete? Complexity

Upload: nathaniel-glenn

Post on 31-Dec-2015

29 views

Category:

Documents


2 download

DESCRIPTION

AI=Knowledge Representation & Reasoning. Syntax Semantics Inference Procedure Algorithm Sound? Complete? Complexity. Some KR Languages. Propositional Logic Predicate Calculus Frame Systems Rules with Certainty Factors Bayesian Belief Networks Influence Diagrams - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: AI=Knowledge Representation       & Reasoning

1

AI=Knowledge Representation & Reasoning

SyntaxSemanticsInference Procedure

Algorithm Sound? Complete? Complexity

Page 2: AI=Knowledge Representation       & Reasoning

2

Some KR LanguagesPropositional LogicPredicate CalculusFrame SystemsRules with Certainty FactorsBayesian Belief NetworksInfluence DiagramsSemantic NetworksConcept Description LanguagesNonmonotonic Logic

Page 3: AI=Knowledge Representation       & Reasoning

3

Propositional LogicSyntax

Atomic sentences: P, Q, … Connectives: , , ,

Semantics Truth Tables

Inference Modus Ponens Resolution Soundness and completeness

Complexity issues.

Page 4: AI=Knowledge Representation       & Reasoning

4

SemanticsSyntax: a description of the legal

arrangements of symbols (Def “sentences”)Semantics: what the arrangement of

symbols means in the world

Sentences

FactsFacts

Sentences

Representation

World

Semantics

Semantics

Inference

Page 5: AI=Knowledge Representation       & Reasoning

5

Propsitional Logic: Syntax

AtomsLiteralsSentences

Any literal is a sentence If S1 and S2 are sentences, then

Then (S1 S2) is a sentenceThen (S1 S2) is a sentenceThen (S1 S2) is a sentenceThen S1 is a sentence

Page 6: AI=Knowledge Representation       & Reasoning

6

Propositional Logic: SEMANTICSAn interpretation is an assignment to each variable either True or False.Assignments to compound sentences are defined by the standard truth tables:

A propositional knowledge base says which sentences must be true in the world.

PT

T

F

F

Q

PT

T

F

F

Q

P Q P Q P

T

F F

F

F

T T

T T

F

Q

PT

F

T

F

Page 7: AI=Knowledge Representation       & Reasoning

7

Example Knowledge Base

(Smoke fire) <=> AlarmAlarm

Page 8: AI=Knowledge Representation       & Reasoning

8

More Definitionsvalid = tautology = always truesatisfiable = sometimes trueunsatisfiable = never true

1) smoke fire

2) smoke smoke

3) smoke fire fire

4) (smoke fire) (smoke fire)

Page 9: AI=Knowledge Representation       & Reasoning

9

Making Inferences

A knowledge base gives us partial information about the world: it constrains the world to a set of possible truth assignments.

By inference, we decide what else holds in all of the truth assignments allowed by the knowledge base.

Inference question: does KB = S ?

Page 10: AI=Knowledge Representation       & Reasoning

10

Proof Procedures

To decide whether KB = S, we can try to look for a proof of S from KB.

A proof procedure is some algorithm that we apply to a KB to produce its logical consequences.

A proof uses: the knowledge base, axiom schemas inference rules.

Page 11: AI=Knowledge Representation       & Reasoning

11

Soundness and Completeness

KB |- S: S is provable from KB.A proof procedure is sound if:

If KB |- S, then KB |= S. That is, the procedure produces only correct

consequences.A proof procedure is complete if:

If KB |= S, then KB |- S. That is, the procedure produces all the consequences.

Ideally, the procedure should be sound and complete. (Ideals are nice in theory).

Page 12: AI=Knowledge Representation       & Reasoning

12

Modus Ponens

From A and A B, infer B.Modus ponens with a few axiom schemas

is sound and complete: A (B A) A (B C) ((A B) (A C)) ( A B) (B A) More in the book.

Page 13: AI=Knowledge Representation       & Reasoning

13

Normal Forms

CNF = Conjunctive Normal FormConjunction of disjuncts (each disjunct =

“clause”)

(P Q) R

(P Q) R

(P Q) R P Q R

(P Q) R

(P R) (Q R)

Page 14: AI=Knowledge Representation       & Reasoning

14

Resolution

A B C, C D E A B D E

Refutation Complete Given an unsatisfiable KB in CNF, Resolution will eventually deduce the empty clause

Proof by Contradiction To show = Q Show {Q} is unsatisfiable!

Page 15: AI=Knowledge Representation       & Reasoning

15

Resolution Example prove P(A B C) (B) (B D) (C A D) (D P Q) (Q)

Page 16: AI=Knowledge Representation       & Reasoning

16

Computational Complexity

Determining satisfiability is NP-complete. Even when all clauses have at most 3 literals.Hence, also validity and entailment testing are

NP-completeIf all clauses have at most 2 literals, it is

polynomial.But if the KB is in DNF, satisfiability is polynomial.

What does this tell us about transforming a CNF into a DNF knowledge base?

Page 17: AI=Knowledge Representation       & Reasoning

17

Horn Clauses

If every sentence in KB is of the form:

• Then Modus Ponens is– Polynomial time, and– Complete!

A B C ... F Z

equivalently A B C ... F Z

Clause mean

s a

big disjuncti

on

At most one

positive literal