190 likes | 410 Views
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
E N D
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 • Semantic Networks • Concept Description Languages • Nonmonotonic Logic
Propositional Logic • Syntax • Atomic sentences: P, Q, … • Connectives: , , , • Semantics • Truth Tables • Inference • Modus Ponens • Resolution • Soundness and completeness • Complexity issues.
Inference Sentences Sentences Representation Semantics Semantics World Facts Facts Semantics • Syntax: a description of the legal arrangements of symbols (Def “sentences”) • Semantics: what the arrangement of symbols means in the world
Propsitional Logic: Syntax • Atoms • Literals • Sentences • Any literal is a sentence • If S1 and S2 are sentences, then • Then (S1 S2) is a sentence • Then (S1 S2) is a sentence • Then (S1 S2) is a sentence • Then S1 is a sentence
Q Q T T F F T T T F T T P P F F F F T F Propositional Logic: SEMANTICS • An 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. Q T T F P F F T P Q P Q P
Example Knowledge Base • (Smoke fire) <=> Alarm • Alarm
More Definitions • valid = tautology = always true • satisfiable = sometimes true • unsatisfiable = never true 1) smoke fire 2) smoke smoke 3) smoke fire fire 4) (smoke fire) (smoke fire)
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 ?
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.
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).
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.
Normal Forms • CNF = Conjunctive Normal Form • Conjunction of disjuncts (each disjunct = “clause”) (P Q) R (P Q) R (P Q) R P Q R (P Q) R (P R) (Q R)
A B C, C D E A B D E Resolution • 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!
Resolution Example prove P (A B C) (B) (B D) (C A D) (D P Q) (Q)
Computational Complexity • Determining satisfiability is NP-complete. • Even when all clauses have at most 3 literals. • Hence, also validity and entailment testing are NP-complete • If 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?
Horn Clauses • If every sentence in KB is of the form: At most one positive literal A B C ... F Z equivalently A B C ... F Z • Then Modus Ponens is • Polynomial time, and • Complete! Clause means a big disjunction