• review of first-order logic...faster(bob,pat) --f4 (全称除去) apply r(1) to f3 and f4 | 6....

31
1 • Review of first-order logic (一階述語論理の復習 ) • Apply first-order logic to a proof (一階述語論理の応用) Apple to the Wumpus world (追加例)

Upload: others

Post on 07-Feb-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

  • 1

    • Review of first-order logic (一階述語論理の復習 )

    • Apply first-order logic to a proof

    (一階述語論理の応用)

    Apple to the Wumpus world (追加例)

  • 2

    FOL(First-Order-Logic)の基本要素 • 記号 定数記号: 同じ解釈において同じ個体を参照する

    e.g. Mike Jason, 4, A, B, …

    述語記号: モデルにおいて特別な関係を参照する

    e.g., Brother, >,

    関数記号: 名前を使わずに特定の個体を参照する.

    関係が関数的(1対1の関係)の場合もある e.g., FatherOf,

    • 変数 個体の名前を置き換える. e.g., x, y, a, b,… ∀x, Cat(x) ⇒ Mammal(x)

    if x is a cat then x is a mammal.

    • 結合記号 ¬ (not), ∧ (and), ∨ (or), ⇒ (implies), and ⇔ (equivalent)

    • 量子記号: ∀ (全称限定子), ∃ (存在限定子) ∀x, for any x, … ∃x, there is a x, …

    • 等号: = e.g. Father(John) = Henry

  • Syntax 構文論

    3

    原子式:それ以上分解すると命題ではなくなる命題 FATHER(John, Mike) 論理式:原子式を論理結合記号(¬ , ∧ , ∨ , → , ↔)および 量化記号( ∀, ∃ )と組合せて作る命題

    ∃ x At(x, CIS) ∧ Smart(x)

    ∀x At(x, CIS) Smart(x)

  • 推論

    4

    事実 知識 (原子式 + 論理式) 推理ルール (命題論理用の推理ルール + ? )

  • 5

    命題論理のための7つの推論規則

    • (R1) Modus Ponens モーダスポネンス( modus ponens, MP) • (R2) And-Elimination 論理積の消去 • (R3) And-Introduction 論理積の導入 • (R4) Or-Introduction 論理和の導入 • (R5) Double-Negation Elimination 二重否定の除去

    • (R6, R7) Unit Resolution 融合

    β α ⇒ β, α

    αi

    α1 ∧ α2 ∧…∧ αn

    α1 ∧ α2 ∧…∧ αn α1, α2, …, αn

    α1 ∨ α2 ∨ … ∨ αn αi

    ¬ ¬ α

    α α ∨ β, ¬ β

    α ∨ γ

    α ∨ β, ¬ β ∨ γ

    α

    (α または β , not β ) → α

    (α または β , not β または γ ) → α または γ である

  • The three new inference rules added to FOL • R(8) 全称除去(Universal-Elimination):任意の命題 α, 変数 v, 基底項 gについて:

    e. g., ∀ x Likes(x, IceCream)から、代入 {x/Rose} が使えるなら Like(Rose, IceCream)と推論できる.

    • R(9) 存在除去(Existential-Elimination): 任意の命題 α, 変数 v, 知識ベースのどこにも出現していない定数記号 k に対して:

    e. g., ∃ x Is(x, King)から、William が知識ベースのどこにも出現しないなら Is(William, King)を、推論できる

    SUBST({v/g}, α) ∀ v α

    基底項は変数を含まない項

    SUBST({v/k}, α) ∃ v α

    v/g α

    k (定数記号) α

    Like (Rose, IceCream), x/Rose

    ∀ x likes(x, IceCream)

    Is (William, King), x/william

    ∃ x Is (x, King)

  • 7

    The three new inference rules added to FOL

    • R(10) (存在導入) Existential-Introduction: 任意の命題αとαに出現しない変数v 及びα に出現する基礎項g に対して

    e. g., Likes(Rose, IceCream) から∃ x Likes(x, IceCream)と推論できる

    ∃ x Likes(x, IceCream), Rose/x

    Likes(Rose, IceCream)

    ∃ v SUBST({g/v}, α)

    α

  • 8

    知識ベース(KB) 事実と規則

    推論機構

    更新

    質問 答え

    知識ベースのアーキテクチャ

  • 9

    一階述語論理の証明の例 Bob is a buffalo | 1. Buffalo(Bob) --f1 (事実)

    Pat is a pig | 2. Pig(Pat) --f2 (事実)

    Buffaloes run faster than pigs | 3. ∀ x, y Buffalo(x) ∧ Pig(y) ⇒ Faster(x,y) --r1 (知識ルール) ----------------------------------------------------------------------------------------------------

    証明:

    Bob runs faster than Pat Faster(Bob, Pat) is True

    ---------------------------------------------------------------------------------------------------

    Apply R(3) to f1 And f2 | 4. Buffalo(Bob) ∧ Pig(Pat) --f3

    (論理積の導入)

    Apply R(8) to r1 {x/Bob, y/Pat} | 5. Buffalo(Bob) ∧ Pig(Pat) ⇒ Faster(Bob,Pat) --f4

    (全称除去)

    Apply R(1) to f3 And f4 | 6. Faster(Bob,Pat) --f5

    (モーダスポネンス)

  • 10

    原始的な推論規則による探索

    演算子は推論規則である

    状態は命題の集合である

    ゴールテストでは質問の命題が含まれているかをチェックする

    R(1) ~ R(10) は一般的な推論のパターンである

    1 2 3

    1 2 3 4

    Apply R(3) to 1 & 2

    1 2 3 4 5

    Apply R(8) to 3

    1 2 3 4 5 6

    Apply R(1) to 4 & 5

    知識が増える

  • 11

    ルールベース ワーキングメモリー

    相互作用

    ルールの着火 ルールの選択

    照合

    行動

    推論エンジン

    推論システム (common knowledge + known fact+ inference rules )

    making decision (increasing known facts)

  • 12

    照合と統合

    統合とは2つの原子文 p と q があった時に p と q が同じものであるような代替を返します.

    つまり、原子文 p と q に対しp λ =q λであるなら代替 λは2つを統合します

    例,

    p q λ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Knows(John, x) | Knows(John, Jane) | {x/Jane} Knows(John, x) | Knows(y, OJ) | {y/John, x/OJ} Knows(John, x) | Knows(y, Mother(y)) | {y/John, x/Mother(John)} Premise 前提

  • 13

    文字列の照合: string1 = string2 e.g. “rose” = “rose” if string1.equals(string2)

    “I am Rose” = “I am Rose”

    “I am ?x” = “I am Rose”

    “I am ?x” = “?y am Rose”

    I = ?y

    am = am

    ?x = Rose

    ?

    e.g. ?x is ?y and ?x Rose is rose and ?y

    ?x = Rose

    ?y = rose

    ?x = ?y

    e.g. husband(father(?x), Mike) husband(father(John), Mike)

    ?x = John

  • 14

    Example of proof (証明) Bob is a buffalo | 1. Buffalo(Bob) --f1

    Pat is a pig | 2. Pig(Pat) --f2

    Buffaloes run faster than pigs | 3. ∀ x, y Buffalo(x) ∧ Pig(y) ⇒ Faster(x,y) --r1 ----------------------------------------------------------------------------------------------------

    To proof:

    Bob runs faster than Pat

    ---------------------------------------------------------------------------------------------------

    Apply R(3) to f1 And f2 | 4. Buffalo(Bob) ∧ Pig(Pat) --f3

    (And-Introduction)

    Apply R(8) to r1 {x/Bob, y/Pat} | 5. Buffalo(Bob) ∧ Pig(Pat) ⇒ Faster(Bob,Pat) --f4

    (Universal-Elimination)

    Apply R(1) to f3 And f4 | 6. Faster(Bob,Pat) --f5

    (Inplication-Elimination )

    Apply Forward chaining algorithm!

  • 15

    Forward chaining algorithm(前向き推論)

    知識ベースの命題から推論を始め、新たに生成された結論も推論に利用していけば、より多くの結論を得ることができます。 これを前向き推論という

    when a new fact p is added (told) to the KB

    for each rule such that p unifies with a premise

    if the other premises are known

    then add the conclusion to the KB and continue chaining.

    • 前向き推論では結論を得るために、たいていデータベースに追加された新しい事実を利用します

    • 推論が連鎖していくのでデータ駆動型とも言われます。

    TELL

    ・新しい事実が観測されたときに、事実に最も合う推論を求める ・事実からスタートして、ルールによって推論結果を得る ・新たに得られた推論結果は、事実と同じように次の推論に利用できる ・ 「AはBである」という事実と、「BならばC」という規則から、「AはCである」と いう結論を導く推論方式

  • 16

    前向き推論の例

    知識ベースに以下のルールr1, r2, r3と事実f1, f2, f3がある時

    r1. Buffalo(x) ∧ Pig(y) ⇒ Faster(x,y)

    r2. Pig(y) ∧ Slug(z) ⇒ Faster(y,z)

    r3. Faster(x,y) ∧Faster(y,z) ⇒ Faster(x,z)

    f1. Buffalo(Bob) [r1-c1, Bob/x, yes]

    f2. Pig(Pat) [r1-c2, Pat/y, yes] f4 ?

    f3. Slug(Steve) [r2-c2, Steve/z, yes]

    [r2, f2, f3, Pat/y, Steve/z, yes] f5?

    [r3, f4, f5, Bob/x, Pat/y, Steve/z, yes] f6?

    ∀ x, y, z

    講義中の課題

  • 17

    前向き推論の例

    知識ベースに以下のルールr1, r2, r3と事実f1, f2, f3がある時

    r1. Buffalo(x) ∧ Pig(y) ⇒ Faster(x,y)

    r2. Pig(y) ∧ Slug(z) ⇒ Faster(y,z)

    r3. Faster(x,y) ∧Faster(y,z) ⇒ Faster(x,z)

    f1. Buffalo(Bob) [r1-c1, Bob/x, yes]

    f2. Pig(Pat) [r1-c2, Pat/y, yes] f4. Faster(Bob, Pat)

    f3. Slug(Steve) [r2-c2, Steve/z, yes]

    [r2, f2, f3, Pat/y, Steve/z, yes] f5. Faster(Pat, Steve)

    [r3, f4, f5, Bob/x, Pat/y, Steve/z, yes] f6. Faster(Bob, Steve)

    ∀ x, y, z

  • rule "CarRule1" if "?x is inexpensive" then "?x is made in Japan" rule "CarRule2" if "?x is small" then "?x is made in Japan" rule "CarRule3" if "?x is expensive" then "?x is a foreign car" rule "CarRule4" if "?x is big" "?x needs a lot of gas" then "?x is a foreign car" rule "CarRule5" if "?x is made in Japan"

    "?x has Toyota's logo" then "?x is a Toyota" rule "CarRule6" if "?x is made in Japan" "?x is a popular car" then "?x is a Toyota"

    rule "CarRule7" if "?x is made in Japan" "?x has Honda's logo" then "?x is a Honda" rule "CarRule8" if "?x is made in Japan" "?x has a VTEC engine" then "?x is a Honda" rule "CarRule9“ if "?x is a Toyota" "?x has several seats" "?x is a wagon" then "?x is a Carolla Wagon" rule "CarRule10" if "?x is a Toyota" "?x has several seats" "?x is a hybrid car" then "?x is a Prius" rule "CarRule11" if "?x is a Honda" "?x is stylish" "?x has several color models" "?x has several seats" "?x is a wagon" then "?x is an Accord Wagon"

    rule "CarRule12" if "?x is a Honda" "?x has an aluminium body" "?x has only 2 seats" then "?x is a NSX" rule "CarRule13" if "?x is a foreign car" "?x is a sports car" "?x is stylish" "?x has several color models" "?x has a big engine" then "?x is a Lamborghini Countach" rule "CarRule14" if "?x is a foreign car" "?x is a sports car" "?x is red" "?x has a big engine" then "?x is a Ferrari F50" rule "CarRule15" if "?x is a foreign car" "?x is a good face" then "?x is a Jaguar XJ8"

    ルールベース内で定義されたルール: CarShop.txt

  • 19

    Forward Chaining-他の例

  • 20

    前向き推論の過程 講義中の課題: CarShopの前向き推論の過程をダイアグラムで描いてみましょう わかっていること: ルール (in CarShop.txt) + 事実

  • 21

    % java RuleBaseSystem % java RuleBaseSystem ADD:my-car is inexpensive ADD:my-car has a VTEC engine ADD:my-car is stylish ADD:my-car has several color models ADD:my-car has several seats ADD:my-car is a wagon CarRule1 [?x is inexpensive]->?x is made in Japan CarRule2 [?x is small]->?x is made in Japan CarRule3 [?x is expensive]->?x is a foreign car CarRule4 [?x is big, ?x needs a lot of gas]->?x is a foreign car CarRule5 [?x is made in Japan, ?x has Toyota's logo]->?x is a Toyota CarRule6 [?x is made in Japan, ?x is a popular car]->?x is a Toyota CarRule7 [?x is made in Japan, ?x has Honda's logo]->?x is a Honda CarRule8 [?x is made in Japan, ?x has a VTEC engine]->?x is a Honda CarRule9 [?x is a Toyota, ?x has several seats, ?x is a wagon]->?x is a Carolla Wagon CarRule10 [?x is a Toyota, ?x has several seats, ?x is a hybrid car]->?x is a Prius CarRule11 [?x is a Honda, ?x is stylish, ?x has several color models, ?x has several seats, ?x is a wagon]->?x is an Accord Wagon CarRule12 [?x is a Honda, ?x has an aluminium body, ?x has only 2 seats]->?x is a NSX CarRule13 [?x is a foreign car, ?x is a sports car, ?x is stylish, ?x has several color models, ?x has a big engine]->?x is a Lamborghini Countach CarRule14 [?x is a foreign car, ?x is a sports car, ?x is red, ?x has a big engine]->?x is a Ferrari F50 CarRule15 [?x is a foreign car, ?x is a good face]->?x is a Jaguar XJ8 apply rule:CarRule1 Success: my-car is made in Japan ADD:my-car is made in Japan apply rule:CarRule2 apply rule:CarRule3 apply rule:CarRule4 apply rule:CarRule5 apply rule:CarRule6 apply rule:CarRule7

    Output:

    my-car is inexpensive

    rule "CarRule1" if "?x is inexpensive" then "?x is made in Japan"

    my-car is made in Japan

    ワーキングメモリの初期状態

    新たな事実をワーキングメモリに追加

  • 22

    apply rule:CarRule8 Success: my-car is a Honda ADD:my-car is a Honda apply rule:CarRule9 apply rule:CarRule10 apply rule:CarRule11 Success: my-car is an Accord Wagon ADD:my-car is an Accord Wagon apply rule:CarRule12 apply rule:CarRule13 apply rule:CarRule14 apply rule:CarRule15 Working Memory[my-car is inexpensive, my-car has a VTEC engine, my-car is stylish, my-car has several color models, my-car has several seats, my-car is a wagon, my-car is made in Japan, my-car is a Honda, my-car is an Accord Wagon] apply rule:CarRule1 apply rule:CarRule2 apply rule:CarRule3 apply rule:CarRule4 apply rule:CarRule5 apply rule:CarRule6 apply rule:CarRule7 apply rule:CarRule8 apply rule:CarRule9 apply rule:CarRule10 apply rule:CarRule11 apply rule:CarRule12 apply rule:CarRule13 apply rule:CarRule14 apply rule:CarRule15 Working Memory[my-car is inexpensive, my-car has a VTEC engine, my-car is stylish, my-car has several color models, my-car has several seats, my-car is a wagon, my-car is made in Japan, my-car is a Honda, my-car is an Accord Wagon] No rule produces a new assertion

    my-car has a VTEC engine

    rule "CarRule8" if "?x is made in Japan" "?x has a VTEC engine" then "?x is a Honda"

    my-car is made in Japan

    my-car is a Honda

    rule “CarRule11" if "?x is a Honda" "?x is stylish“ "?x has several color models" "?x has several seats" "?x is a wagon" then "?x is an Accord Wagon"

    my-car is stylish my-car has several color models my-car has several seats my-car is wagon

    my-car is an Accord Wagon

    新たな事実をワーキングメモリに追加

    新たな事実をワーキングメモリに追加

  • 宿題

    23

    2. p16 と p20の講義中の課題を終わらせる. (答えはスライド内にありますが、見ないで自分の力で解くこと) 提出は必要ありません

    1. 前向き推論について理解し、例を考える 提出日: 来週

  • 24

    Appendix (追加)

    鬼の世界の推論をするために一階述語論理を適用する

    (時間があったら読んでください.)

    鬼の世界で金を見つけるエージェント

  • 25

    • 述語と規則 At(p, l, S) はエージェント p が状況 S で l にいることを意味する

    Percept([Smell, b, g, u, v], l, S, t)はエージェントが状況 S で l にいるときにsmell を感じたことを意味する

    • 知覚の規則

    R1: ∀ b, g, u, v, l, s, t Percept([Smell, b, g, u, v], s, t) ⇒ Smell(t)

    R2: ∀sm, g, u, v, l, s, t Percept([sm, Breeze, g, u, v], s, t) ⇒ Breeze(t)

    R3: ∀sm, b, u, v, l, s, t Percept([sm, b, Glitter, u, v], s, t) ⇒ AtGoldRoom(t)

    R4: ∀sm, b, u, v, l, s, t Percept([sm, b, g, Wall, v], s, t) ⇒ Wall(t)

    R6: ∀sm, b, g, u, v, l, s, t Percept([sm, b, g, u, v], s, t) ⇒

    ¬ Smell(t) ∧¬ Breeze(t) ∧¬ AtGoldRoom(t) ∧¬ Wall(t) • 行動の規則

    R7: ∃ i, j Result(Forward, li) = lj i ≠ j ∃ i, j Result(Turn, Sm) = Sn m ≠ n 向きの規則

    R8: ∀ s (Orientation(p, s ) =0 ⇒ Face(p, east) ) ∨ (Orientation(p, s) = 90 ⇒ Face(p, north ) ∨ (Orientation(p, s) = 180 ⇒ Face(p, west) ∨ (Orientation(p, s) = 270 ⇒ Face(p, south) ) R9: ∀ a, d, p, s Orientation(p, Result(a, s)) =d ⇔ [(a=Turn(Right) ∧d=Mod(Orientation(p,s) – 90, 360))

    ∨ (a=Turn(Left) ∧d=Mod(Orientation(p,s) + 90, 360) ) ∨ (Orientation(p,s)=d∧ ¬(a=Turn(Right) ∨ a=Turn(Left)))]

  • 26

    • 位置の規則 R10: ∀ l, l ⇔ ∃ x, y [x, y]

    R11: (a) ∀ x, y LocationToward([x, y], 0) = [x+1, y] (b) ∀ x, y LocationToward([x, y], 90) = [x, y+1]

    R12: (a) ∀ x, y LocationToward([x, y], 180) = [x-1, y] (b) ∀ x, y LocationToward([x, y], 270) = [x+1, y-1]

    R13: ∀ p, l, s At(p, l, s) ⇒ LocationAhead(p,S) = LocationToward(l, Orientation(p,s))

    R14: ∀ l1, l2 Adjacent(l1, l2) ⇔ ∃ d l1=LocationToward(l2, d)

    R15: ∀ x, y Wall([x, y]) ⇔ (x=0 ∨ x=5 ∨ y=0 ∨ y=5)

    R16: ∀ a, d, p, s At(p, l, Result(a, s)) ⇔ [(a=Forward ∧ l = LocationAhead(p,s) ∧ ¬Wall(l)) ∨ (At(p,l,s) ∧ a ≠ Forward)]

    • 隠された設定 (規則)

    R17: ∀l, s At(Agent, l, s) ∧ Smell(s) ⇒ Smell(l)

    R18: ∀l, s At(Agent, l, s) ∧ Breeze(s) ⇒ Breeze(l)

    R19: ∀l1, s Breeze(l1) ⇒ ∃ l2 At(Pit, l2,s) ∧ (l2, = l1 ∨ Adjacent(,l1, l2))

    R20: ∀l1, l2, s At(Pit, l1) ∧ Adjacent(,l1, l2) ⇒ Breeze(l2)

    R21: ∃ l1, s ¬Breeze(l1) ⇒ ∀ l2 ¬At(Pit, l2, s ) ∧ (l2, = l1 ∨ Adjacent(,l1, l2))

  • 27

    •隠された設定 (規則)

    R22: ∀l1, s Smell(l1) ⇒ ∃ l2 At(Wumpus, l2,s) ∧ (l2, = l1 ∨ Adjacent(,l1, l2))

    R23: ∀l1, l2, s At(Wumpus, l1) ∧ Adjacent(,l1, l2) ⇒ Smell(l2)

    R24: ∃ l1, s ¬Smell(l1) ⇒ ∀ l2 ¬At(Wumpus, l2, s ) ∧ (l2, = l1 ∨ Adjacent(,l1, l2)) R25: ∀x, y, g, u, v, s, t Percept([None, None, g, u, v], t) ∧ At(Agent, x, s) ∧ Adjacent(,x, y) ⇒ OK(y)

    R26: ∀x, t (¬ At(Wumpus, x, t) ∧ ¬At(Pit, x, t)) ⇔ OK(x)

    • 金を入手した時

    R27: ∀ x, s AtGoldRoom( x, s) ⇒ Present(Gold, x, s)

    R28: ∀ x, s Present( x, s) ∧ Portable(x)⇒ Holding(x, Result(Grab, s))

    R29: ∀ x, s ¬Holding(x, Result(Release, s))

    R30: ∀ a, x, s Holding(x, s) ∧ (a≠Release) ⇒ Holding(x, Result(a, s)) R31: ∀ a, x, s ¬Holding(x, s) ∧ (a≠Grab ∨ ¬ (Present(x, s) ∧ Portable(x)) ⇒ ¬Holding(x, Result(a, s))

    P true afterwards ⇔ [an action made P true ∨ P true already and no action made P false]

    R32: ∀ a, x, s Holding(x, Result(a, s)) ⇔ [(a=Grab ∧ (Present(x, s) ∧ Portable(x)) ∨ (Holding(x, s) ∧ a≠Release) ]

  • 28

    世界は変化しないので、推論では時間の項を取り入れる

    初期状態 At(Agent, [1,1])

    Apply And-Elimination rule to R6, we obtain

    C1 ¬Smell([1,1]) , ¬Breeze([1,1]) , ¬AtGoldRoom([1,1]) , ¬Wall([1,1])

    Apply And-Elimination rule to R21 and apply R15, we obtain

    C2 ¬At(Pit, [1,1]), ¬At(Pit, [2,1]), ¬At(Pit, [2,1]), Wall([1,0]), Wall([0,1])

    Apply And-Elimination rule to R24, we obtain

    C3 ¬At(Wumpus, [1,1]), ¬At(Wumpus, [2,1]), ¬At(Wumpus, [1,2])

    Apply R26 to C2 and C3, we obtain

    C4 OK([1,1]), OK([2,1]), OK([1,2])

    Apply R11(a) and R16, we obtain

    At(Agent, [2,1])

    Apply And-Elimination rule to R2, we obtain

    C5 ¬Smell([2,1]) , Breeze([2,1]) , ¬AtGoldRoom([2,1]) , ¬Wall([2,1])

    Apply R19 to Breeze([2,1]), we obtain

    C6 At(Pit, [1,1]) ∨ At(Pit, [2,1]) ∨ At(Pit, [2,2]) ∨ At(Pit, [3,1])

  • 29

    Apply unit resolution twice to C6, we obtain

    C7 At(Pit, [2,2]) ∨ At(Pit, [3,1])

    Use C4 and C7, (保守的なエージェントなので確実でないところには行かない), and apply R9, R12(a) and R16, we obtain

    At(Agent, [1,1]), Orientation(Agent, [1,1])=180

    Use C4 and apply R9, R11(b) and R16, we obtain

    At(Agent, [1,2]), Orientation(Agent, [1,2])=90

    Apply R22 to Smell([1,2]), we obtain

    C8 At(Wumpus, [1,1]) ∨ At(Wumpus, [1,3]) ∨ At(Wumpus, [1,2]) ∨ At(Wumpus, [2,2])

    Apply unit resolution twice to C8, we obtain

    C9 At(Wumpus, [2,2]) ∨ At(Wumpus, [1,3])

    Apply R24 and And-Elimination rule to ¬Smell([2,1]), we obtain

    C10 ¬At(Wumpus, [1,1]), ¬At(Wumpus, [1,2]), ¬At(Wumpus, [2,2]), ¬At(Wumpus, [2,1])

    Apply unit resolution to C9, we obtain

    C11 At(Wumpus, [1,3])

    Apply R21 and And-Eleimination rule to ¬Breeze([1,2]), we obtain

    C12 ¬At(Pit, [1,1]), ¬At(Pit, [2,1]), ¬At(Pit, [2,2]), ¬At(Pit, [3,1])

  • 30

    Apply R26 to C10 and C12, we obtain

    C13 OK([2,2]),

    Use C13 and apply R9, R11(a) and R16, we obtain

    At(Agent, [2,2]), Orientation(Agent, [2,2])=0

    Use C4 and apply R9, R11(b) and R16, we obtain

    At(Agent, [1,2]), Orientation(Agent, [1,2])=90

    Apply R21 and And-Elimination rule to ¬Breeze([2,2]), and

    apply R24 and And-Elimination rule to ¬Smell([2,2]), we obtain

    C14 ¬At(Pit, [2,1]), ¬At(Pit, [1,2]), ¬At(Pit, [2,2]), ¬At(Pit, [2, 3], ¬At(Pit, [2, 3])

    C15 ¬At(Wumpus, [2,1]), ¬At(Wumpus, [1,2]), ¬At(Wumpus, [2,2]), ¬At(Wumpus, [2,3], ¬At(Wumpus, [3,2])

    Apply R26 to C14 and C15, we obtain

    C16 OK([2,3]), OK([3,2])

    Apply R11(a) and R16, we obtain

    At(Agent, [3,2])

    Apply R19 to Breeze([3,2]), we obtain

    C17 At(Pit, [2,2]) ∨ At(Pit, [2,3]) ∨ At(Pit, [3,2]) ∨ At(Pit, [3,1]) ∨ At(Pit, [4,2])

    Apply twice unit resolution to C9, we obtain

    C18 At(Pit, [3,2]) ∨ At(Pit, [3,1]) ∨ At(Pit, [4,2])

  • 31

    For safe, agent goes back to [2, 2]

    Use C13 and apply R9, R12(a) and R16, we obtain

    At(Agent, [2,2]), Orientation(Agent, [2,2])=180

    Use C16 and apply R9, R11(b) and R16, we obtain

    At(Agent, [2,3]), Orientation(Agent, [2,3])=90

    Apply R3, we obtain

    C19 AtGoldRoom( [2,3])

    Apply R32, we obtain

    C20 Holding([2,3], Result(Grab))

    残りの問題は、どうやって安全に戻るか?

    スライド番号 1FOL(First-Order-Logic)の基本要素Syntax 構文論推論命題論理のための7つの推論規則The three new inference rules added to FOLThe three new inference rules added to FOLスライド番号 8一階述語論理の証明の例原始的な推論規則による探索スライド番号 11照合と統合スライド番号 13Example of proof (証明)Forward chaining algorithm(前向き推論)前向き推論の例前向き推論の例スライド番号 18Forward Chaining-他の例前向き推論の過程 �講義中の課題: �CarShopの前向き推論の過程をダイアグラムで描いてみましょう��わかっていること: ルール (in CarShop.txt) + 事実 � スライド番号 21スライド番号 22宿題Appendix (追加) スライド番号 25スライド番号 26スライド番号 27スライド番号 28スライド番号 29スライド番号 30スライド番号 31