1 / 69

Chapter 7 METHODS OF INFERENCE 知識推論法

Chapter 7 METHODS OF INFERENCE 知識推論法. 7.1 演繹與歸納( Deductive and Induction ). 演繹 ( Deduction): 藉由前提假設而推論出結論 歸納 (Induction): 一葉知秋 , 見微知柱 ; 從小處歸納出一個大觀 . 直觀 (Intuition): 尚未被證實的理論 . 啟發 (Heuristics): 從既有經驗所獲得的規則 . Generate and test: 不斷的嘗試 , 從錯誤中學習. Abduction: 從已成立的結論往回推論 , 以得導致此結論的前提 .

axel-chen
Download Presentation

Chapter 7 METHODS OF INFERENCE 知識推論法

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. Chapter 7 METHODS OF INFERENCE 知識推論法 Expert Systems sstseng

  2. 7.1演繹與歸納( Deductive and Induction ) • 演繹( Deduction):藉由前提假設而推論出結論 • 歸納(Induction):一葉知秋,見微知柱; 從小處歸納出一個大觀. • 直觀(Intuition):尚未被證實的理論. • 啟發(Heuristics):從既有經驗所獲得的規則. • Generate and test:不斷的嘗試, 從錯誤中學習. Expert Systems sstseng

  3. Abduction:從已成立的結論往回推論, 以得導致此結論的前提. • Autoepitemic: Self-knowledge • Nonmonotonic:舊有的知識可能被新的知識更新,取代 • 類比(Analogy):藉由比較方式, 類似的前提會導致相同的結論(ex:醫療診斷) Expert Systems sstseng

  4. 三段論( Syllogism ) • 三段論( Syllogism )是一種邏輯論證, 容易理解且已被為整證明過. • 前提(Premise):會寫程式的人都很聰明 • 前提(Premise):John會寫程式 • 結論(Conclusion):因此, John很聰明. • 一般而言,三段論根據演繹的論證包含了兩個前提和一個結論. Expert Systems sstseng

  5. 定言三段論(Categorical Syllogism) 定言命題的型態 Expert Systems sstseng

  6. 三段論的標準形態(Standard form) 大前提:所有M為P 小前提:所有S為M 結論:所有S為P - P代表結論的「謂詞」(Predicate),又稱為「大詞」(Major term) - S代表結論的「主詞」(Subject),又稱作「小詞」(Minor term)。 - 含有大詞的前提稱為「大前提」(Major premise); - 含有小詞的前提稱為「小前提」(Minor premise)。 - M稱為「中詞」(Middle term) Expert Systems sstseng

  7. 模式 (Mood) • Patterns of Categorical Statement • 4種AAA模式 Expert Systems sstseng

  8. ex: AAA-1 • 所有M為P 所有S為M ∴所有S為P • 我們利用 決策程序(decision procedure)來證明論證是否有效 • 三段論運用維思圖(Venn Diagrams)來驗證 Expert Systems sstseng

  9. S P S P S P M M M (b)大前提後 (a)維思圖 (c)小前提後 ex: AAA-1的決策程序 所有M為P 所有S為M ∴所有S為P Expert Systems sstseng

  10. ex: AEE-1的決策程序 所有M為P 沒有S為M ∴沒有S為P Expert Systems sstseng

  11. “某些”的表示規則 • 1.如果該類別是空的,則填上較暗色彩. • 2.完全肯定或否定的陳述句(Universal statement): A 和 E, 會先畫 • 3.若該類別至少有一個物件,則以 *標示. • 4.若兩個相鄰的類別沒有一個物件存在,則用*標在線上. • 5.已經塗上暗色的的部分不需要標上*. Expert Systems sstseng

  12. ex: IAI-1的決策程序 某些P為M 所有M為S ∴某些P為S Expert Systems sstseng

  13. 7.2 狀態與問題空間(State and problem spaces) • 樹狀結構( Tree ): 點(nodes), 線(edges) • 有向性(Directed)/無向性(Indirected) • 雙向圖(Digraph): 圖中所有的線都是有方向性的 • 晶格(Lattice): 有方向性但沒有循環性的圖 Expert Systems sstseng

  14. 藉由描述物件在圖中的行為來定義該圖,此方法我們稱做“問題狀態空間” • 初始狀態(Initial state) • 可用的運算元(Operator) • 狀態空間(State space) • 路徑(Path) • 目標測試(Goal test) • 路徑成本(Path cost) Expert Systems sstseng

  15. 有限狀態機器 ( Finite State Machine ) • 用以辨識 WHILE和WRITE的有限狀態機器 Expert Systems sstseng

  16. 在問題空間中尋解(Finding solution in problem space) • 狀態空間( State space )可以視為一個問題空間( problem space ). • 在問題空間裡求解需要找出一條有效的路徑(開始->答案). • “猴子與香蕉問題”的問題空間 • 旅行推銷員問題(Traveling salesman problem) • 圖形演算法, AND-OR Trees…等等. Expert Systems sstseng

  17. Ex: 猴子與香蕉 問題 • 假設: • 房子裡有一懸掛的香蕉 • 房子裡只有一張躺椅跟一把梯子 • 猴子無法直接拿到香蕉 • 指示: • 跳下躺椅 • 移動梯子 • 把梯子移到香蕉下的位置 • 爬上梯子 • 摘下香蕉 • 初始狀態: • 猴子在躺椅上 Expert Systems sstseng

  18. Ex:旅行推銷員問題( Travel Salesman Problem ) Expert Systems sstseng

  19. 非結構化問題(Ill-structured problem) • 非結構化問題( Ill-structured problems ) 是指很多不確定因素的結合. • 目標不明顯 • 問題空間範圍尚未被介定 • 問題狀態空間非離散的 • 中間狀態的不易實行 • 可用運算元未知 • 時間限制 Expert Systems sstseng

  20. Ex:旅遊代理人 Expert Systems sstseng

  21. 7.3 規則式推論(Rules of Inference) • 三段論( Syllogism ) 只是邏輯陳述的其中一種方式. • 命題邏輯(Propositional logic) p  q p______ q 這種命題邏輯的推論型態有很多種名子:direct reasoning(直接推論), modus ponens(離斷率), law of detachment(分離律), and assuming the antecedent(假設前提). Expert Systems sstseng

  22. 離斷率的真值表( Truth table for Modus Ponense) pqp→q(p→q)p(p→q)  p→q TTTTT TFFFT FTTFT FFTFT Expert Systems sstseng

  23. p→q p ∴q Law of Inference Schemata 1.Law of Detachment 2.Law of the Contrapositive 3. Law of Modus Tollens 4.Chain Rules(Law of the Syllogism) 5.Law of Disjunctive Inference 6.Law of the Double Negation p→q ∴~q→~p p→q ~q ∴~p p→q q→r ∴p→r pq ~p ∴q pq ~q ∴p ~(~p) ∴p Expert Systems sstseng

  24. 7.De Morgan’s Law 8.Law of Simplification 9.Law of Conjunction 10.Law of Disjunctive Addition 11. Law of Conjunctive Argument ~(pq) ∴~p  ~q ~(pq) ∴~p ~q ~(pq) ∴~q pq ∴p p q ∴pq p ∴pq ~(pq) q ∴~p ~(pq) p ∴~q Table 3.8 Some Rules of Inference for Propositional Logic Expert Systems sstseng

  25. 命題邏輯分解( Resolution in propositional Logic) 1. 將命題(proposition)轉換成clause form形式. 2. 重複以下動作直到產生矛盾或是無法再繼續 (1) 選擇兩個clauses, 我們稱之為parent clauses (2) 將parent clauses作disjunction,產生出來的clause稱為resolvent, 再把有L和~L這樣形式的元素移除 (3) 若最後resolvent是空的(empty),則矛盾產生;若否則再加入另一個clause作disjunction,同(2) Expert Systems sstseng

  26. Given AxiomsConverted to Clause Form p p (p q) r   ~p   ~q r (s t) q ~s q ~t q t t Figure. 命題邏輯的facts (A Few Facts in Propositional Logic) 1. 2. 3. 4. 5. Expert Systems sstseng

  27. ~pˇ~qˇr ~r p ~p ˇ~q ~q ~t ˇq t ~t Figure. 命題邏輯之解 (Resolution in Propositional Logic) Expert Systems sstseng

  28. 加入量詞的推論(Resolution with quantifiers) EX(form Nilsson): 任何會閱讀(Read)的皆具有讀寫能力(Literate). 海豚(Dolphin)沒有讀寫能力 一些海豚很聰明(Intelligent). 試證明:存在一些很聰明但沒有閱讀能力的海豚. Expert Systems sstseng

  29. 轉換: x [ R ( x ) -→  L ( x ) ] x [ D ( x ) -→ -L ( x ) ] x [ D ( x ) &  I ( x ) ] To prove: x [ I ( x ) & - R ( x ) ] Expert Systems sstseng

  30. (1) - (4): x [- R ( x ) OR L ( x ) ] & y [ - D ( y ) OR - L ( y ) ] & D ( A ) & I ( A ) & z [- I ( z ) OR R ( z ) ] (5) - (9): C1=-R(x)ORL(x) C2=-D(y)OR -L(y) C3=D(A) C4=I(A) C5=-I(z)ORR(z) Expert Systems sstseng

  31. 第二敘述邏輯 (The second order logic) 的量詞 (quantifiers)範圍含括函數符號(function symbols)與敘述符號( predicate symbols) • 如果P是一文件中的任一敘述(predicate • 則 • x =y = (for every P [P(x)  P(y) ] Expert Systems sstseng

  32. 7.4 推斷鏈 D3 A2 D2 A1 B C D1 E Solution inference + inference +… + inference Chain Initial facts backward Chaining(向後鏈結) forward Chaining(向前鏈結) 從事實來推論結果 假設可能的解答是成立的,再 尋求相關的證據證明之 Expert Systems sstseng

  33. 前向鏈結( Forward Chaining ): rule1:   大象(x)   哺乳類(x) rule2:   哺乳類(x) 動物(x) face:John 是一知大象.   大象(John) 成立  X=John (變數替代-Unification)   大象(x) 哺乳類(x) X’=X=John   哺乳類(x) 動物(x’) 哺乳類(John) 成立 動物(John) 成立 Expert Systems sstseng

  34. 變數替代( Unification ) 將變數(variable)用事實(fact)取代,反覆的進行變數替代最後即可得出結論. rule1:A1 and B1C1 rule2:A2 and C1 D2 rule3: A3 and B2 D3 rule4:C1 and D3 G facts:A1 is true B1 is true A2 is true A3 is true B2 is true Expert Systems sstseng

  35. match match C1 match D2 D3 G GOAL • 前向推論( Forward reasoning ): {A1, A2, A3, B1, B2, B3} {r1, r3} fire r1 {A1, A2, A3, B1, B2, B3,} {r1, r2, r3} fire r2 {A1, A2, A3, B1, B2, B3, C1,} {r1, r2, r3} fire r3 {A1, A2, A3, B1, B2, B3, C1 D2,} {r1, r2, r3, r4} fire r4 {A1, A2, A3, B1, B2, B3, C1 D2, D3,} Expert Systems sstseng

  36. rule1:A1 and B1 C1 rule2:A2 and C1 D2 rule3: A3 and B2 D3 rule4:C1 and D3 D4 rule5: C1 and D4 G’ facts: A1, A2, B1, B2, A3 Expert Systems sstseng

  37. 後向推論( Backward reasoning ): 1. 假設 G’ 成立 R5 Verify C1 and D4 訊問使用者D4之值, 若為 False則G’不成立 R1 Verify A1 and B1 OK OK 2. 假設 G 成立 R4 Verify C1 and D3 R3 Verify A3 and B2 OK OK Verify A1 and B1 OK OK Expert Systems sstseng

  38. A1 B1 A2 A3 B2 C1 D2 D3 ? G GOAL Expert Systems sstseng

  39. 前向鏈結( Good application of forward chaining ) Goal Facts Broad and Not Deep or too many possible goals Expert Systems sstseng

  40. 後向鏈結( Good application of backward chaining) Narrow and Deep GOALS Facts Expert Systems sstseng

  41. 前向鏈結( Forward Chaining ) • Planning • Monitoring • Control • Data-driven • Explanation not facilitated • 後向鏈結( Backward chaining ) • Diagnosis • Goal-driven • Explanation facilitated Expert Systems sstseng

  42. 類比 (Analogy) • 將舊有相關的情境作為推論的參考 • Consider tic-tac-toe with values as a magic square (15 game) • 6 1 8 • 7 5 3 • 2 9 4 • 18 game from set {2,3,4,5,6,7,8,9,10} • 21 game from set {3,4,5,6,7,8,9,10,11} Expert Systems sstseng

  43. Nonmonotonic reasoning • 在nonmonotonic system中,隨著元素的增加,並不一定會增加定理的數量. • 以一個簡單的例子來說,假設某一事實是和時間相關的,若今時間改變了,則該事實就不再是有效(令人信服)的了. Expert Systems sstseng

  44. 7.5Reasoning Under Uncertainty(不確定性推論) • 不確定性 (Uncertainty)是指在作決策時缺少足夠的資訊. • 處理不確定性的理論有:Classical probability, Bayescian probability, Dempster-Shafer theory, and Zadeh’s fuzzy theory. • 在 MYCIN 和 PROSPECTOR的系統中,即使所有前提確實證明了結論是未知的,也會產生很多結論. Expert Systems sstseng

  45. Example Turn the value off Turn value-1 Turn value-1 off Value is stuck Value is not stuck Turn value-1 to 5 Turn value-1 to 5.4 Turn value-1 to 5.4 or 6 or 0 Value-1 setting is 5.4 or 5.5 or 5.1 Value-1 setting is 7.5 Value-1 is not stuck because it’s never been stuck before Output is normal and so value-1 is in good condition Error Ambiguous Incomplete Incorrect False positive False negative Imprecise Inaccurate Unreliable Random error Systematic error Invalid induction Invalid deduction Reason What value? Which way? Correct is on Value is not stuck Value is stuck Correct is 5.4 Correct is 9.2 Equipment error Statistical fluctuation Miscalibration Value is stuck Value is stuck in open position 導致不確定的錯誤 • 假說是需被驗證的. • Type 1 error (false positive) 是指接受了一個不會成立(F)的假設. • Type 2 error (false negative) 是指否決了一個會被成立(T)的假設. Expert Systems sstseng

  46. 度量的誤差(Error of measurement) • 精確度(Precision) • 公釐量尺的精確度比公分量尺高. • 正確性(accuracy) Expert Systems sstseng

  47. 錯誤與歸納(Error & Induction) “歸納”的過程和“演繹”是相反的  火警警報聲響起 ∴ 有火災發生了. 加入一個更強烈的參數:  火警警報聲響起 & 聞道煙味 ∴有火災發生了. Expert Systems sstseng

  48. 雖然加入了一個強烈的參數, 但依然無法證明確實發生火災. 衣服著火了 Expert Systems sstseng

  49. 演繹錯誤(Deductive errors) p→q q  ∴ p If the value is in good condition, than the output is normal The output is normal ∴ The value is in good condition. Expert Systems sstseng

  50. Baye’s Theorem (貝氏定理) • Conditional probability(條件機率), P(A | B) , 是指在B事件成立的情況之下A事件發生的機率. Crash= Brand X(0.6)+ Not X(0.1)=0.7 • P( X|C) = P( C | X) P(X) = (0.75)(0.8) = 6 P(C) 0.7 7 • 假設你擁有某不知名廠牌的硬碟壞掉了,那麼此硬碟是X牌和其他非X牌的機率各是多少? Expert Systems sstseng

More Related