CS344 : Introduction to Artificial Intelligence

1 / 20

CS344 : Introduction to Artificial Intelligence - PowerPoint PPT Presentation

CS344 : Introduction to Artificial Intelligence

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

1. CS344 : Introduction to Artificial Intelligence Pushpak BhattacharyyaCSE Dept., IIT Bombay Lecture 9- Completeness proof; introducing knowledge representation

2. Soundness, Completeness &Consistency Soundness Semantic World ---------- Valuation, Tautology Syntactic World ---------- Theorems, Proofs Completeness * *

3. An example to illustrate the completeness proof

4. Running the completeness proof For every row of the truth table set up a proof: • p, ~q |- p(p V q) • p, q |- p(p V q) • ~p, q |- p(p V q) • ~p, ~q |- p(p V q)

5. Completeness Proof

6. Completeness of Propositional Calculus Statement If V(A) = T for all V, then |--A i.e. A is a theorem. Lemma: If A consists of propositions P1, P2, …, Pn then P’1, P’2, …, P’n |-- A’, where A’ = A if V(A) = true = ~A otherwise Similarly for each P’i

7. Proof for Lemma Proof by induction on the number of ‘→’ symbols in A Basis: Number of ‘→’ symbols is zero. A is ℱ or P. This is true as, |-- (A → A) i.e. A → A is a theorem. Hypothesis: Let the lemma be true for number of ‘→’ symbols ≤ n. Induction: Let A which is B → C contain n+1‘→’

8. Proof of Lemma (contd.) • Induction: By hypothesis, P’1, P’2, …, P’n |-- B’ P’1, P’2, …, P’n |-- C’ If we show that B’, C’ |-- A’ (A is B → C), then the proof is complete. For this we have to show: • B, C |-- B → C True as B, C, B |-- C • B, ~C |-- ~(B → C) True since B, ~C, B → C |-- ℱ • ~B, C |-- B → C True since ~B, C, B |-- C • ~B, ~C |-- B → C True since ~B, ~C, B, C → ℱ|-- ℱ • Hence the lemma is proved.

9. Proof of Theorem A is a tautology. There are 2n models corresponding to P1, P2, …, Pn propositions. Consider, P1, P2, …, Pn |-- A and P1, P2, …, ~Pn |-- A P1, P2, …, Pn-1 |-- Pn→ A and P1, P2, …, Pn-1 |-- ~Pn→ A RHS can be written as: |-- ((Pn → A) → ((~Pn → A) → A)) |-- (~Pn → A) → A |-- A Thus dropping the propositions progressively we show |-- A

10. Assignment-2 • Create a system to prove syntactically the theoremhood of any propositional calculus expression. This will be an automatic theorem prover for propositional calculus. The input to the system will be any propositional calculus expression and the output a yes/no answer depending on whether the expression is a theorem or not.

11. Detour • Reasoning • two types: • Monotonic: Adding inferred knowledge monotonically to the system but not retracting from the knowledge base. • Nonmonotonic: Retracts knowledge which becomes false in the face of new evidence • Types of Sentences in English: 3 kinds of sentences important from Natural Language Processing point of view. Useful to remember in knowledgeextraction. • Simple Sentence: Single verb, e.g., Ram plays cricket • Compound Sentence: Two independent clauses joined by coordinator. Two verbs are present. e.g.Ram went to school and Shyam played cricket • Complex Sentence: Independent clauses joined by one or more dependent clauses. More than one verb e.g.Ram who sings well is performing in the festival today

12. Predicate Calculus • Introduction through an example (Zohar Manna, 1974): • Problem: A, B and C belong to the Himalayan club. Every member in the club is either a mountain climber or a skier or both. A likes whatever B dislikes and dislikes whatever B likes. A likes rain and snow. No mountain climber likes rain. Every skier likes snow. Is there a member who is a mountain climber and not a skier? • Given knowledge has: • Facts • Rules

13. Predicate Calculus: Example contd. • Let mc denote mountain climber and sk denotes skier. Knowledge representation in the given problem is as follows: • member(A) • member(B) • member(C) • ∀x[member(x) → (mc(x) ∨ sk(x))] • ∀x[mc(x) → ~like(x,rain)] • ∀x[sk(x) → like(x, snow)] • ∀x[like(B, x) → ~like(A, x)] • ∀x[~like(B, x) → like(A, x)] • like(A, rain) • like(A, snow) • Question: ∃x[member(x) ∧ mc(x) ∧ ~sk(x)] • We have to infer the 11th expression from the given 10. • Done through Resolution Refutation.

14. Interpretation in Logic Logical expressions or formulae are “FORMS” (placeholders) for whom contents are created through interpretation. Example: This is a Second Order Predicate Calculus formula. Quantification on ‘F’ which is a function.

15. Examples Interpretation – 1 a and b∈ N In particular, a = 0 and b = 1 x ∈ N P(x) stands for x > 0 g(m,n) stands for (m x n) h(x) stands for (x – 1) Above interpretation defines Factorial

16. Examples (contd.) Interpretation – 2 a = b = λ P(x) stands for “x is a non empty string” g(m, n) stands for “append head of m to n” h(x) stands for tail(x) Above interpretation defines “reversing a string”

17. More Examples • ∀x [ P(x) → Q(x)] • Following interpretations conform to above expression: man(x) → mortal(x) dog(x) → mammal(x) prime(x) → 2_or_odd(x) CS(x) → bad_hand_writing(x)

18. Structure of Interpretation All interpretations begin with a domain ‘D’, constants (0-order functions) and functions pick values from there. With respect to - ∀x [ P(x) → Q(x)] D = {living beings} P: D → {T, F} Q: D → {T, F} P can be looked upon as a table shown here:

19. Factorial: interpretation of the structure D = {0, 1, 2, …, ∞} a = 0, b = 1 g(m, n) = m x n and g: D x D → D h(x) = (x – 1) and h(0) = 0, h: D →D P(x) is x > 0 and P: D → {T, F}

20. Steps in Interpretation Fix Domain D Assign values to constants Define functions Define predicates An expression which is true for all interpretations is called valid or tautology. Interpretations and their validity in “Herbrand’s Universe” is sufficient for proving validity in Predicate Calculus. Note:- Possible seminar topic – “Herbrand’s Interpretation and Validity”