Knowledge and reasoning
導入済み
6:33
人工知能と機械学習
This course covers the classical core of artificial intelligence, honestly measured. The first three units are the spine: search, logical reasoning and…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| Inference/ˈɪnfərəns/ | deriving new facts from known facts and rules |
| knowledge base/ˈnɒlɪdʒ beɪs/ | a store of facts and rules that a program can reason with |
| Propositional logic/ˌprɒpəˈzɪʃənl ˈlɒdʒɪk/ | logic with true-or-false statements joined by and, or, not and if-then |
| modus ponens/ˈməʊdəs ˈpəʊnənz/ | the rule: from P and "if P then Q", conclude Q |
| Forward chaining/ˈfɔːwəd ˈtʃeɪnɪŋ/ | reasoning from the known facts, applying rules until nothing new can be derived |
| backward chaining/ˈbækwəd ˈtʃeɪnɪŋ/ | reasoning back from a goal to the facts that would prove it |
| sound/saʊnd/ | (of an inference method) never derives a false conclusion from true facts |
| complete/kəmˈpliːt/ | (of an inference method) can derive every conclusion that really follows |
| resolution/ˌrezəˈluːʃn/ | an inference step that combines two clauses containing a literal and its negation |
| clauses/ˈklɔːzɪz/ | disjunctions of literals, such as not-Storm or Delayed, the form resolution works on |
| refutation/rɪfjuːˈteɪʃn/ | proving a statement by showing that its negation leads to a contradiction |
| First-order logic/fɜːst ˈɔːdə ˈlɒdʒɪk/ | logic with variables and quantifiers such as "for all x" |
| unification/ˌjuːnɪfɪˈkeɪʃn/ | finding values for variables that make two logical expressions identical |
| Horn clauses/hɔːn ˈklɔːzɪz/ | rules of the form "these facts together imply one fact" |
事実、規則、そして1つの推論ステップ
- 知識ベースには、事実(「週末である」)と規則(「嵐が起きたら、便は遅延する」)を保存する。命題論理では、規則を$P \to Q$と書く。これは、$P$が真ならば、$Q$も真であるという意味である。
- 推論の基本的なステップは肯定式である。$P$と$P \to Q$から、$Q$を結論する。この講座の知識ベースには、事実F1 Storm、F2 Weekendと、規則R1 Storm → Delayed、R2 Weekend → HeavyTraffic、R3 HeavyTraffic → Delayed、R4 Delayed → RefundRiskがある。

Forward chaining starts from —
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Forward chaining starts from what is known; backward chaining starts from the goal.
前向き連鎖:事実から先へ
- 前向き連鎖では、条件がすでに分かっている規則をすべて適用し、新しい事実を追加する。新しい事実が現れなくなるまで、これを繰り返す。
- この講座の知識ベースでは、各段階で、その時点で条件が分かっている規則をすべて適用する。
| 段階 | 適用する規則 | 新しい事実 |
|---|---|---|
| 1 | R1、R2 | Delayed、HeavyTraffic |
| 2 | R3、R4 | RefundRisk(R3によるDelayedはすでに分かっている) |
| 3 | — | なし、よって終了 |
- 前向き連鎖は、すべての帰結を見つける。すべての帰結を知りたいときには便利だが、問いが1つだけのときには無駄が多い。
The course KB derives RefundRisk in — waves
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Wave one: Delayed, HeavyTraffic; wave two: RefundRisk.
後ろ向き連鎖:問いからさかのぼる
- 後ろ向き連鎖は、目標から始める。RefundRiskを証明するには、それを結論とする規則R4を見つけ、Delayedを証明する。Delayedを結論とする規則の1つはR1なので、Stormを証明する。Stormは事実なので、3ステップで完了する。探索は目標に沿って進むため、R2とR3は使われない。
- 規則は順方向にしか使えない。R1と事実Delayedから、Stormを結論してはならない。交通渋滞で便が遅れることもあるからである。$P \to Q$を$Q \to P$と読み取るのは、典型的な論理の誤りである。
From the rule Storm → Delayed and the fact Delayed, we may conclude Storm.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
That is the converse error. Delayed also follows from HeavyTraffic, so Delayed does not prove Storm; modus ponens runs only from $P$ から $Q$.
From Storm → Delayed and Delayed, Storm follows.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
That is affirming the consequent; the delay may have another cause.
健全性と完全性
- 真の事実から偽の結論を決して導かない方法は、健全である。肯定式は健全であり、各ステップの結論は規則から直接導かれる。
- 真である帰結をすべて導ける方法は、完全である。肯定式だけでは、あらゆる論理に対して完全ではない(たとえば「AまたはB」という事実を扱えない)。次に学ぶ導出原理は、節の集合が矛盾していることを証明するための、標準的な完全な方法である。
Modus ponens makes inference —
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Each step is a valid implication on assumed rules - no falsehood invented.
規則を節で表す、そして導出原理
- 導出原理は、ORで結ばれたリテラルの並びである節に対して使う。各規則を$P \to Q \equiv \neg P \lor Q$を使って書き換える。すると、R1は節$\{\neg\text{Storm}, \text{Delayed}\}$(「Stormではない、またはDelayed」)になる。
- 導出原理の1ステップでは、あるリテラルとその否定をそれぞれ含む2つの節を取り、残りを結びつける。$\{\neg\text{Storm}, \text{Delayed}\}$と$\{\text{Storm}\}$から$\{\text{Delayed}\}$が得られる。これは肯定式を節で表したものである。
$P \to Q$ is equivalent to:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
It is false only when $P$ is true and $Q$ false.
例題:反駁による証明
- Delayedを証明するには、その反対を仮定し、矛盾が生じることを示す(反駁)。節$\{\text{Storm}\}$と$\{\neg\text{Storm}, \text{Delayed}\}$に$\{\neg\text{Delayed}\}$を追加する。
- ステップ1:$\{\neg\text{Storm}, \text{Delayed}\}$と$\{\neg\text{Delayed}\}$から$\{\neg\text{Storm}\}$が得られる。
- ステップ2:$\{\neg\text{Storm}\}$と$\{\text{Storm}\}$から空節が得られる。これは矛盾を表す。したがって「Delayedではない」はありえず、Delayedが導かれる。SATソルバーはこの考え方に基づいて作られている。
Clauses {Storm}, {¬Storm, Delayed}, {¬Delayed}: resolution steps to reach the empty clause?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Cancel Delayed, then Storm.
一階述語論理:変数を使った規則
- 命題論理の規則では、各便について1つずつ規則が必要になる。一階述語論理では変数を加える。$\forall x\; \text{Storm}(x) \to \text{Delayed}(x)$は「すべての区間$x$について、$x$で嵐が起きると$x$が遅延する」という意味である。
- この規則を事実$\text{Storm}(\text{Leg7})$に使うには、単一化によって、両者を一致させる代入$x = \text{Leg7}$を見つける。次に肯定式によって$\text{Delayed}(\text{Leg7})$が得られる。これで、1つの規則ですべての区間を扱える。
Unify $\text{Delayed}(x)$ with $\text{Delayed}(\text{Leg7})$. The substitution is —
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Replacing x by Leg7 makes the two terms identical.
推論にかかる計算量
- 真理値表で結論を確かめるには、真と偽のすべての組み合わせを並べる。記号が$n$個なら、$2^n$行が必要になる。記号が20個ですでに約1百万行、30個では10億行を超える。
- 「これらの事実から1つの事実が導かれる」という形の命題論理の規則は、ホーン節として書ける。命題論理のホーン節において、ある結論が論理的に導かれるかどうかは、適切な連鎖アルゴリズムを使えば、知識ベースの大きさに比例する時間で判定できる。
How many rows does a truth table over 6 propositional symbols have?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Each symbol doubles the rows: 2^6 = 64.
点を落としやすいところ
- $P \to Q$を逆向きに読む。 DelayedからStormは証明できない。
- 1つの問いに前向き連鎖を使う。 前向き連鎖はすべての帰結を導くが、後ろ向き連鎖は目標に沿って進む。
- 健全性を完全性と混同する。 偽の結論を決して導かないことと、真の帰結をすべて導くことは同じではない。
まとめ
- 肯定式:$P$と$P \to Q$から、$Q$を結論する。前向き連鎖は事実から、後ろ向き連鎖は目標から始める。
- 節には$P \to Q \equiv \neg P \lor Q$を使う。反駁では、目標を否定したものを追加し、導出原理を使って空節を導く。
- 真理値表には$2^n$行が必要になる。命題論理のホーン節において、ある結論が論理的に導かれるかどうかは、線形時間で判定できる。
何が問題でしたか?この内容はサイトの運営チームだけが確認します。