1 / 27

CSNB234 ARTIFICIAL INTELLIGENCE

CSNB234 ARTIFICIAL INTELLIGENCE. Chapter 2 Logic. Instructor: Alicia Tang Y. C. LOGIC. A formalization of some aspect of language. a language formalization = syntax, semantic and deduction. A representation of knowledge. A structure at the symbol level. First Order Predicate Logic

jaser
Télécharger la présentation

CSNB234 ARTIFICIAL INTELLIGENCE

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. CSNB234ARTIFICIAL INTELLIGENCE Chapter 2 Logic Instructor: Alicia Tang Y. C. COIT, UNITEN

  2. LOGIC • A formalization of some aspect of language. • a language formalization = syntax, semantic and deduction. • A representation of knowledge. • A structure at the symbol level. • First Order Predicate Logic • language suitable for representing qualitative/symbolic information. COIT, UNITEN

  3. TRADITIONAL LOGIC • Identity • A is A • Contradiction • A is not not-A • Excluded Middle • A is not both A and not-A • Each of the above is associated with a truth value, true or false. COIT, UNITEN

  4. Four Statement Forms • All S is P • No S is P • Some S is P • Some S is not P • The Syllogism: • is a set of rules governing what conclusion can be reached from a set of statements written in the four-statement form COIT, UNITEN

  5. Reasoning by Pattern All x are y . All y are z . Therefore,all x are z . All Accord are Hondas. All Hondas are Japanese. Therefore, all Accord are Japanese. All Wajas are Protons. All Protons are made in Malaysia. Therefore, all Wajas are made in Malaysia COIT, UNITEN

  6. Unsound Patterns • All x are y . • Some y are z . • Therefore,some x are z . • Good: • All Hondas are Japanese cars. • Some Japanese cars are made in America. • Therefore,some Hondas are made in America. COIT, UNITEN

  7. Cont.. • Not so good: • All Toyotas are cars. • Some cars are Ferrari. • Therefore,some Toyotas are Ferrari. --- but this is a wrong conclusion! COIT, UNITEN

  8. The Syllogism (I) • The syllogism is a set of rules governing what conclusions can be reached from a set of statements written in the four statement forms. • For example, it indicates that given the following premises (i.e. statements that are assumed to be true): • All Malaysians are car-drivers (1) • All people in KL are Malaysians (2) COIT, UNITEN

  9. The Syllogism (II) • Then the following conclusion is valid: • All people in KL are car drivers (3) • The process of reaching a conclusion from premises is termed as ‘inferencing’, i.e. making an inference or drawing a conclusion. COIT, UNITEN

  10. Syllogism (III) • ALL or NO are known as universal quantifiers that refers to every element of the subject class. • “SOME” is known as an existential quantifier.   COIT, UNITEN

  11. Example of Fragments of Information(Symbolic description) • The red block is ON the green block. • The green block is somewhere ABOVE the blue block. • The green block is NOT on the blue block. • The yellow block is on the green OR the blue. • The blue block is on SOME other block. COIT, UNITEN

  12. We will obtain these “Premises” • (from previous slide): • The red block is on the green block. • The green block is somewhere ABOVE the blue block. • The green block is NOT on the blue block. • The yellow block is on the green OR the blue. • The blue block is on SOME other block. COIT, UNITEN

  13. Conclusions • The red block is on the green block. • The green block is on the yellow block. • The yellow block is on the blue block. • The blue block is on the black block. • Main conclusion • The black block is on the table. COIT, UNITEN

  14. Rules of Inference • A rule of inferenceis a pattern of reasoning consisting of one set of sentence schemas, calledpremises, and a second set of sentence schemas, called conclusions. • P  Q • P • ----------- • Q COIT, UNITEN

  15. Rule Instances • An instanceof a rule of inference is a rule in which all meta variables have been consistently replaced by expressions in such a way that all premises and conclusions are syntactically legal sentences. COIT, UNITEN

  16. Sound Rules of Inference • A rule of inference is sound if and only if the premises in any instance of the rule logically entail the conclusions. • Modus Ponens • P  Q • P • -------- • Q • Modus Tollens • P  Q • Q • -------- •  P COIT, UNITEN

  17. Sound Rules of Inference • Equivalence Elimination (EE) • P  Q • P  Q • -------- • Q  P • Double Negation (DN) •  P • ------- • P COIT, UNITEN

  18. Proof • A proof of a conclusion from a set of premises is a sequence of sentences terminating in the conclusion in which each item is either: • 1. A premise • 2. An instance of an axiom schema • 3. The result of applying a rule of inference to earlier items in sequence. COIT, UNITEN

  19. Example I • When it is raining, the ground is wet. When the ground is wet, it is slippery. It is raining. Prove that it is slippery. • 1. raining  wet Premise • 2. wet  slippery Premise • 3. raining Premise • 4. wet MP: 1,3 • 5. slippery MP: 2,4 The Question given AI reasoning COIT, UNITEN (Proven!)

  20. Example II: Sample Proof • Whenever p is true, q is true. Whenever q is true, r is true. Prove that, whenever p is true, r is true. • 1. pq Premise • 2. q  r Premise • 3. (q  r)  ( p(q  r)) ..given • 4. p  (q r) MP: 3,2 • 5. ( p  (q r))  (( p  q)  (p  r)) ..given • 6. ( p  q) ( p r) MP: 5, 4 • 7. p r (proven) MP: 6,1 Refer next slide COIT, UNITEN

  21. Implication Introduction: s => (t => s) • Implication Distribution: (r => (s => t)) => ((r => s) => (r => t)) Hint: look at the implicit “Patterns”, not “Symbols” COIT, UNITEN

  22. Inference Rules (I) • Modus Ponendo Ponens • If P implies Q, and P is true, then Q is true. • Modus Tollendo Tollens • If P implies Q, and Q is false, then P is false. COIT, UNITEN

  23. Inference Rules (II) • Modus Ponendo Tollens • If P and Q are not both true, and P is true, then Q is false. • Modus Tollendo Ponens • If either P or Q is true, and P is not true, then Q is true. COIT, UNITEN

  24. Well-Formed Formula (wff) • A complex formula that includes logical connectives. The truth value of a wff is known as its semantics or meaning. • TAUTOLOGY • A  ¬A is always true no matter what the truth value of A is. • CONTRADICTION • B  ¬ B is false, no matter what the truth value of B. COIT, UNITEN

  25. Theories and Axioms A set of well-formed formulas (wffs) constructed for any field of knowledge is said to be the theory of that field. While each individual wff is an axiom. COIT, UNITEN

  26. Some other terms • Proposition • any statement that can be assigned a value of true or false. • Clausal form • using only connectives such as: and , orand not. • Horn clause • contains only one positive literal. • Literal • is an atomic formula or the negation of an atomic formula. COIT, UNITEN

  27. Class Exercise #1 Head I win. Tails you lose. Suppose the coin comes up tails. Show that I win. (Use h = head, t = tail, m = I win, y = you win) Start with: h  m (1) t  ¬y (2) h  ¬t (3) m  ¬y (4) t (5) ¬y M.P: 2, 5 (6) m  ¬y EE: 4 (7) ¬y  m EE: 4 (8) m M.P: 8, 6 -- proven! COIT, UNITEN

More Related