1 / 28

Notes 7: Knowledge Representation, The Propositional Calculus

Notes 7: Knowledge Representation, The Propositional Calculus. ICS 270A Winter 2003. Outline. Representing knowledge using logic Agent that reason logically A knowledge based agent Using constraints on feature values A rich and implicit representation of the world state.

ulfah
Download Presentation

Notes 7: Knowledge Representation, The Propositional Calculus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Notes 7: Knowledge Representation, The Propositional Calculus ICS 270A Winter 2003

  2. Outline • Representing knowledge using logic • Agent that reason logically • A knowledge based agent • Using constraints on feature values • A rich and implicit representation of the world state. • Representing and reasoning with logic • Propositional logic • Syntax • Semantic • validity and models • Rules of inference for propositional logic • Resolution • Complexity of propositional inference. • Reading: Nillson Chapters 13,14, Russel and Norvig, Chapter 7

  3. Why knowledge-base • The state of the world • may require lots of information.. • The agent knowledge of the state of the world: • If s is world state K(s) is what the agent knows. • For economy: • Not everything explicitly specified. Some facts can be inferred. • Agent may infer whatever he does not know explicitly. • Nillson: Constraints on feature values • Block A is not on the floor • Issues: • In what language to express what the agent knows about the world. How explicit to make this knowledge. How to infer. Agent knowledge of state Description of the world Agent explicit specification of what he knows

  4. Knowledge RepresentationDefined by: syntax, semantix Computer Inference Assertions Conclusions (knowledge base) Facts Facts Semantics Imply Real-World Reasoning: in the syntactic level Example:

  5. Constraints on the world • World so far were described by feature values: • On(block,floor) On(A,B) Clear(C) • But some information is more complex • Law: all human are mortal, all blue box are pushable • Negative information: block a is not on the floor • Either A or B are pushable • Examples: A lifting robot: features: • Bat_ok, liftable, moves • Constraints on the worlds can be written in logic: • Bat_ok and liftable  moves • If moves is false and Bat_ok is true, we infer liftable is false. • Logical languages involve • Syntax, the grammar • Semantics: the meaning of words and sentences • Inference rules: deriving new information that is correct.

  6. The party example • If Alex goes, then Beki goes: A  B • If Chris goes, then Alex goes: C  A • Beki does not go: not B • Chris goes: C • Query: Is it possible to satisfy all these conditions? • Should I go to the party?

  7. Example of Languages for Representation • Programming languages: • Formal languages, not ambiguous, but cannot express partial information. Not expressive enough. • Natural languages: • very expressive but ambiguous: ex: small dogs and cats. • Good representation language: • Both formal and can express partial information, can accommodate inference • Main approach used in AI: Logic-based languages.

  8. Propositional Logic • Syntax : • Alphabet: {true,false,P,Q} • Connectives: • Well-Formed formulas: (wffs or sentences): w1, w2 • If Alex_goes  Beki_goes • Semantics: • True means true • False means false • Symbols means objects in the world and they are true or false relative to a scenario, or a world, we refer to. • Meaning of a sentence is derived from its parts as defined by truth-tables.

  9. Truth tables for the logical connectives

  10. A grammer for sentences in propositional logic

  11. Truth Tables • Truth tables can be used to compute the truth value of any wff. • Can be used to find the truth of • Given n features there are 2n different worlds, different interpretations. • Interpretation: any assignment of true and false to atoms • An interpretation satisfies a wff if the wff is assigned true under the interpretation • A model: An interpretation is a model of a wff if the wff is satisfied in that interpretation. • Satisfiability of a wff can be determined by the truth-table • Bat_on and turns-key_on  Engine-starts • Wff is unsatisfiable or inconsistent it has no models

  12. Validity

  13. Validity, Equivalence • Validity: A wff is Valid if it is true in all interpretations • P  P • Equivalence: two wffs are equivalent iff they have the same models. • DeMorgan laws, law of contrapositive • If w1 is equivalent to w2 then: w1 w2 and w2  w1 • Associative • Distributive • DeMorgan’s

  14. Logical Entailment:truth in the world • KB ( ) entails a sentence, iff all the models of KB are models of alpha (in other words, any interpretation that satisfies KB satisfies alpha.) • If some sentences are true in the world it implies that some other sentences are true. • statement P is true whenever some other set KB of statements is true, then “KB entails P”. • Whenever means: • In any possible world (model) in which every sentence of KB is true.

  15. Rules of Inference • Producing an additional wffs from a set of wffs • From alpha infer beta • Sound inference rule: • The conclusion is true whenever the premises are true. • Examples • Modus ponens: { A and A  B |-- B} is sound, resolution is sound. • Proof: • A sequence of inference rules generating the desired conclusion from the KB. • Example: KB = • From • From • KB

  16. Rules of inference

  17. Resolution in Propositional Calculus • Using clauses as wffs • Literal, clauses, conjunction of clauses (cnfs) • Resolution rule: • Resolving (P V Q) and (P V  Q) P • Generalize modus ponens, chaining . • Resolving a literal with its negation yields empty clause. • Resolution is sound • Resolution is NOT complete: • P and R entails P V R but you cannot infer P V R • From (P and R) by resolution • Resolution is complete for refutation: adding (P) and (R) to (P and R) we can infer the empty clause. • Decidability of propositional calculus by resolution refutation: if a wff w is not entailed by KB then resolution refutation will terminate without generating the empty clause.

  18. Soundness of resolution

  19. The party example • If Alex goes, then Beki goes: A  B • If Chris goes, then Alex goes: C  A • Beki does not go: not B • Chris goes: C • Query: Is it possible to satisfy all these conditions? • Should I go to the party?

  20. Example of proof by Refutation • Assume the claim is false and prove inconsistency: • Example: can we prove that Chris will not come to the party? • Prove by generating the desired goal. • Prove by refutation: add the negation of the goal and prove no model • Proof: • Refutation:

  21. The moving robot examplebat_ok,liftable moves~moves, bat_ok

  22. Converting wffs to Conjunctive clauses • 1. Eliminate implications: ~(PQ) or (R  P) • 2. Reduce the scope of negation sign • 3. Convert to cnfs using the associative and distributive laws

  23. Converting wffs to Conjunctive clauses • 1. Eliminate implications • 2. Reduce the scope of negation sign • 3. Convert to cnfs using the associative and distributive laws

  24. Proof by refutation • Given a database in clausal normal form KB • Find a sequence of resolution steps from KB to the empty clauses • Use the search space paradigm: • States: current cnf KB + new clauses • Operators: resolution • Initial state: KB + negated goal • Goal State: a database containing the empty clause • Search using any search method

  25. Proof by refutation (contd.) • Or: • Prove that KB has no model - PSAT • A cnf theory is a constraint satisfaction problem: • variables: the propositions • domains: true, false • constraints: clauses (or their truth tables) • Find a solution to the csp. If no solution no model. • This is the satisfiability question • Methods: Backtracking arc-consistency  unit resolution, local search

  26. Resolution refutation search strategies • Ordering strategies • Breadth-first, depth-first • I-level resolvents are generated from level-(I-1) or less resolvents • Unit-preference: prefer resolutions with a literal • Set of support: • Allows reslutions in which one of the resolvents is in the set of support • The set of support: those clauses coming from negation of the theorem or their decendents. • The set of support strategy is refutation complete • Linear input • Restricted to resolutions when one member is in the input clauses • Linear input is not refutation complete • Example: (PVQ) (P V not Q) (not P V Q) (not P V not Q) have no model

  27. Complexity of propositional inference • Checking truth tables is exponential • Satisfiability is NP-complete • However, frequently generating proofs is easy. • Propositional logic is monotonic • If you can entail alpha from knowledge base KB and if you add sentences to KB, you can infer alpha from the extended knowledge-base as well. • Inference is local • Tractable Classes: Horn, 2-SAT • Horn theories: • Q <-- P1,P2,...Pn • Pi is an atom in the language, Q can be false. • Solved by modus ponens or “unit resolution”.

  28. Summary • Representing knowledge using logic • Using logic to represent and reason about knowledge • Logic, syntax, semantics and proof theory • Representing and reasoning with logic • Propositional logic • Syntax • Semantic • validity and models • Rules of inference for propositional logic • Complexity of propositional inference. • Reading: Nillson Chaters 13, 14 Russel and Norvig Chapter 7.

More Related