1. Trang chủ
  2. » Cao đẳng - Đại học

Slide trí tuệ nhân tạo chapter7 1 using logic

63 7 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 63
Dung lượng 238,39 KB

Nội dung

Using Logic Chapter CuuDuongThanCong.com https://fb.com/tailieudientucntt Using Propositional Logic Representing simple facts It is raining RAINING It is sunny SUNNY It is windy WINDY If it is raining, then it is not sunny RAINING  SUNNY Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com April, 2012 https://fb.com/tailieudientucntt Propositional Logic Syntax • Logical constants: true, false • Propositional symbols: P, Q, … • Logical connectives: , , , ,  • Sentences (formulas): – – – – Logical constants Proposition symbols If  is a sentence, then so are  and () If  and  are sentences, then so are   ,   ,   , and    Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Interpretation: propositional symbol  true/false • The truth value of a sentence is defined by the truth table P Q P PQ PQ PQ PQ false false true false false true true false true true false true true false true false false false true false false true true false true true true true Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 4 April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Satisfiable: true under an interpretation • Valid: true under all interpretations P Q P  P (P  Q)  Q ((P  Q)  Q)  P false false false false true false true false false true true false false true true true true false false true satisfiable valid unsatisfiable Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Model: an interpretation under which the sentence is true PQ PQ  PQ P PQ  P CuuDuongThanCong.com Q PQ  Cao Hoang Tru CSE Faculty - HCMUT  Q  PQ April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Entailment: KB =  iff every model of KB is a model of   is a logical consequence of KB P Q PQ P  Q, P false false true false false true true false true false false false true true true true Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com {P  Q, P} = Q April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Equivalence:    iff  =  and  =  P Q PQ P  Q false false true true false true true true true false false false true true true true Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com P  Q  P  Q April, 2012 https://fb.com/tailieudientucntt Propositional Logic Semantics • Theorems: –  =  iff    is valid KB =  can be proved by validity of KB   –  =  iff    is unsatisfiable KB =  can be proved by refutation of KB   Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com April, 2012 https://fb.com/tailieudientucntt Using Propositional Logic • Theorem proving is decidable • Cannot represent objects and quantification Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 10 April, 2012 https://fb.com/tailieudientucntt Resolution in Predicate Logic Convert all the propositions of KB to clause form (S) Negate  and convert it to clause form Add it to S Repeat until a contradiction is found: a Select two clauses (   p(t1, t2, …, tn)) and (  p(t’1, t’2, …, t’n)) b  = mgu(p(t1, t2, …, tn), p(t’1, t’2, …, t’n)) c Add the resolvent (  ) to S Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 49 April, 2012 https://fb.com/tailieudientucntt Resolution in Predicate Logic Example: KB = {P(a), "x: (P(x)  Q(x))  R(x), "y: (S(y)  T(y))  Q(y), T(a)}  = R(a) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 50 April, 2012 https://fb.com/tailieudientucntt Example Marcus was a man Marcus was a Pompeian All Pompeians were Romans Caesar was a ruler All Pompeians were either loyal to Caesar or hated him Every one is loyal to someone People only try to assassinate rulers they are not loyal to Marcus tried to assassinate Caesar Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 51 April, 2012 https://fb.com/tailieudientucntt Example Man(Marcus) Pompeian(Marcus) "x: Pompeian(x)  Roman(x) ruler(Caesar) "x: Roman(x)  loyalto(x, Caesar)  hate(x, Caesar) "x: $y: loyalto(x, y) "x: "y: person(x)  ruler(y)  tryassassinate(x, y)  loyalto(x, y) tryassassinate(Marcus, Caesar) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 52 April, 2012 https://fb.com/tailieudientucntt Example Prove: hate(Marcus, Caesar) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 53 April, 2012 https://fb.com/tailieudientucntt Question Answering When did Marcus die? Whom did Marcus hate? Who tried to assassinate a ruler? What happen in 79 A.D.? Did Marcus hate everyone? Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 54 April, 2012 https://fb.com/tailieudientucntt Soundness and Completeness • Soundness of a reasoning algorithm/system R: if KB derives  using R, then KB =  Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 55 April, 2012 https://fb.com/tailieudientucntt Soundness and Completeness • Completeness of a reasoning algorithm/system R: if KB = , then KB derives  using R Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 56 April, 2012 https://fb.com/tailieudientucntt Soundness and Completeness Resolution algorithm is sound and complete Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 57 April, 2012 https://fb.com/tailieudientucntt Soundness and Completeness • In general: – Soundness: any returned answer is a correct answer – Completeness: all correct answers are returned Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 58 April, 2012 https://fb.com/tailieudientucntt Programming in Logic PROLOG: • Only Horn sentences are acceptable A  B1, B2, …, Bm  A  B1  B2  …  Bm A, Bi: atoms Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 59 April, 2012 https://fb.com/tailieudientucntt Programming in Logic PROLOG: • The occur-check is omitted from the unification: unsound test  P(x, x) P(x, f(x)) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 60 April, 2012 https://fb.com/tailieudientucntt Programming in Logic PROLOG: • Backward chaining with depth-first search: incomplete P(x, y)  Q(x, y) P(x, x) Q(x, y)  Q(y, x) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 61 April, 2012 https://fb.com/tailieudientucntt Programming in Logic PROLOG: • Unsafe cut: incomplete A  B, C A B  D, !, E D  B, C  D, !, E, C  !, E, C Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 62 April, 2012 https://fb.com/tailieudientucntt Programming in Logic PROLOG: • Negation as failure: P if fails to prove P Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 63 April, 2012 https://fb.com/tailieudientucntt ... CuuDuongThanCong.com 16 April, 2 012 https://fb.com/tailieudientucntt Using Predicate Logic Marcus was a man man(Marcus) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 17 April, 2 012 https://fb.com/tailieudientucntt... https://fb.com/tailieudientucntt Using Predicate Logic Marcus was a Pompeian Pompeian(Marcus) Cao Hoang Tru CSE Faculty - HCMUT CuuDuongThanCong.com 18 April, 2 012 https://fb.com/tailieudientucntt Using Predicate Logic. .. CuuDuongThanCong.com 32 April, 2 012 https://fb.com/tailieudientucntt Resolution Robinson, J.A 19 65 A machine-oriented logic based on the resolution principle Journal of ACM 12 (1) : 23- 41 Cao Hoang Tru CSE

Ngày đăng: 15/12/2021, 14:02

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN