Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.

Similar presentations


Presentation on theme: "1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of."— Presentation transcript:

1 1 Knowledge Representation

2 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of facts about the world. Each representation is a sentence. Each representation is a sentence. Knowledge Representation Knowledge Representation Expressing knowledge in a form that can be manipulated by a computer. Expressing knowledge in a form that can be manipulated by a computer. Inference Mechanism Inference Mechanism Generates new sentences that are necessarily true given that the old sentences are true. Generates new sentences that are necessarily true given that the old sentences are true.

3 3 Two aspects of the Knowledge Representation language: Two aspects of the Knowledge Representation language: 1.Formal system of defining the world Syntax Syntax What constitutes a sentence What constitutes a sentence Semantics Semantics Meaning. Connects sentences to facts. Meaning. Connects sentences to facts. KB entails a (KB |= a) means when all sentences in KB are true, a is true. (|= means entailment) (|= means entailment) 2.A proof theory Rules for determining all entailments. Rules for determining all entailments. (KB |-- a) (KB |-- a)

4 4 KR Languages Logic Logic Propositional Logic Propositional Logic First Order Logic First Order Logic Production rules Production rules Structured Objects Structured Objects Semantic Nets Semantic Nets Frames Frames Script Script

5 5 Logic Logic is reasoning technique. It is the study of rules of inference and the principles of sound argument. Logic is reasoning technique. It is the study of rules of inference and the principles of sound argument. Much of the basis of Expert systems reasoning comes from logic

6 6 Reasoning(inferencing) Strategies Deduction Deduction Induction Induction Abduction Abduction

7 7Deduction This process takes general principles and applies the specific instances to infer a conclusion This process takes general principles and applies the specific instances to infer a conclusion All dogs have hair All dogs have hair Lassie is a dog Lassie is a dog We can deduce that Lassie has hair. We can deduce that Lassie has hair.

8 8 Deduction (cont…) Deduction uses major and minor premises Deduction uses major and minor premises A major premise can have many minor premises A major premise can have many minor premises All minor premises must be true for a deduction to be made. All minor premises must be true for a deduction to be made. This is a limitation of deduction This is a limitation of deduction

9 9Induction This process uses a number of established facts or premises to draw some general conclusion. This process uses a number of established facts or premises to draw some general conclusion. 1994 Cat show all Siamese cats had blue eyes. 1994 Cat show all Siamese cats had blue eyes. 1995 Cat show all Siamese cats had blue eyes. 1995 Cat show all Siamese cats had blue eyes. 1996 Cat show all Siamese cats had blue eyes. 1996 Cat show all Siamese cats had blue eyes. Conclusion all Siamese cats have blue eyes Conclusion all Siamese cats have blue eyes

10 10 Induction (cont…) Induction conclusions may not be entirely accurate Induction conclusions may not be entirely accurate only Siamese cats in Australia have blue eyes only Siamese cats in Australia have blue eyes Inferred conclusions may change as more facts are known Inferred conclusions may change as more facts are known

11 11Abduction A form of deductive inference which uses probability to determine most probable conclusion. A form of deductive inference which uses probability to determine most probable conclusion.

12 12 Abduction Example Major Premise Major Premise I do not jog when the temperature exceeds 38 degrees I do not jog when the temperature exceeds 38 degrees Minor Premise Minor Premise I did not jog today I did not jog today Conclusion Conclusion The temperature today is greater than 40 degrees The temperature today is greater than 40 degrees

13 13 Propositional Logic: Syntax A BNF (Backus-Naur Form) grammar of sentences in propositional logic. A BNF (Backus-Naur Form) grammar of sentences in propositional logic. Sentence  Atomic Sentence  Complex Sentence Atomic Sentence  True  False Atomic Sentence  True  False  P  Q  R  …  P  Q  R  … Complex Sentence  (Sentence)  Sentence Connective Sentence  Sentence Connective Sentence   Sentence   Sentence Connective         Connective        

14 14 Propositional Logic: Semantics Truth tables for the five logical connectives. Truth tables for the five logical connectives.

15 15 Propositional Logic: Rules of Inference Modus Ponens/Implication- Elimination: Modus Ponens/Implication- Elimination: From an implication and the premise of the implication, you can infer the conclusion From an implication and the premise of the implication, you can infer the conclusion   ,    ,   And-Elimination: And-Elimination: From a conjunction you can infer any of the conjuncts. From a conjunction you can infer any of the conjuncts.  1   2 ...   n  1   2 ...   n  i  i And-Introduction: And-Introduction: From a list you can infer their conjunction. From a list you can infer their conjunction.  1,  2,...,  n  1,  2,...,  n  1   2 ...   n  1   2 ...   n

16 16 Or-Introduction: Or-Introduction: From a sentence, you can infer its disjunction with anything else at all. From a sentence, you can infer its disjunction with anything else at all.  i  i  1   2 ...   n  1   2 ...   n Double-Negation Elimination: Double-Negation Elimination: From a doubly negated sentence, you can infer a positive sentence From a doubly negated sentence, you can infer a positive sentence    Unit Resolution: Unit Resolution: From a disjunction, if one of the disjuncts is false, then you can infer the other one is true. From a disjunction, if one of the disjuncts is false, then you can infer the other one is true.   ,     ,    Resolution: Resolution: This is the most difficult. Because  cannot be both true and false, one of the other disjuncts must be true in one of the premises. Or equivalently, implication is transitive. This is the most difficult. Because  cannot be both true and false, one of the other disjuncts must be true in one of the premises. Or equivalently, implication is transitive.   ,         ,               

17 17 Propositional Logic: Inference Resolution refutation theorem prover Resolution refutation theorem prover Inference mechanism for propositional logic Inference mechanism for propositional logic Refutation: Refutation: Recall that S |=  is defined as: Recall that S |=  is defined as: Whenever all sentences in S are true, than  is true as well. Whenever all sentences in S are true, than  is true as well. This is equivalent to saying that: This is equivalent to saying that: It impossible for S to be true and  to be false. It impossible for S to be true and  to be false.Or It is impossible for S and  to be true at the same time. It is impossible for S and  to be true at the same time. In a refutation theorem prover, in order to prove  from S, add  to S and try to derive a contradiction. In a refutation theorem prover, in order to prove  from S, add  to S and try to derive a contradiction.

18 18 Algorithm to prove S |=  : Algorithm to prove S |=  : 1.Rewrite S in clausal form. 2.Rewrite  in clausal form. 3.Using the various inference rules, derive the empty clause from the results of 1. and 2.

19 19 Clausal Form or CNF Conjunctive Normal Form (CNF). Conjunctive Normal Form (CNF). Representing a sentence as a conjunction of disjunctions. Representing a sentence as a conjunction of disjunctions. To do this: To do this: 1.Eliminate Implications Remember a  b   a  b Remember a  b   a  b 2.Push negation inwards  (a  b)   a   b  (a  b)   a   b  (a  b)   a   b  (a  b)   a   b (De Morgan’s Laws) 3.Eliminate double negations 4.Push disjunctions into conjunctions a  (b  c)  (a  b)  (a  c) a  (b  c)  (a  b)  (a  c)

20 20 Example: Converting to CNF Converting the following sentence to CNF: Converting the following sentence to CNF: (a   b)  (c  d) Steps: Steps: 1.Remove Implication  (a   b)  (c  d)  (a   b)  (c  d) 2.Push Negations Inwards  a    b  (c  d) 3.Eliminate Double Negations  a  b  (c  d) 4.Push Disjunctions into Conjunctions (  a  b  c)  (  a  b  d) CNF Represented in KB as the 2 clauses: Represented in KB as the 2 clauses: {  a  b  c} and {  a  b  d}

21 21 Example: Resolution Prove that r follows from: Prove that r follows from: (p  q)  (r  s) - (1) p   s - (2) p   s - (2) p  q - (3) p  q - (3) Solution: Solution: 1.Clause (1) in CNF  (p  q)  (r  s)  (p  q)  (r  s)  {  p   q  r  s} - (1) Clause (2) {  p   s} - (2) {  p   s} - (2) Clause (3) Clause (3) {p} - (3) {q} - (4)

22 22 Example (con’t) 2.Clause of r is {  r} - (5) 3.Using inference rules: {  p   q  s} - (6) {  p   q  s} - (6) from unit resolution rule of (1) and (5) {  q  s} - (7) from unit resolution of (3) and (6) {s} - (8) from (4) and (7) from (4) and (7) {  p} - (9) from (2) and (8) from (2) and (8) {} - (10) from (3) and (9) from (3) and (9) Therefore r follows from the original clauses Therefore r follows from the original clauses


Download ppt "1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of."

Similar presentations


Ads by Google