Modal Logic

Intuition

Modes of Truth: 命题逻辑和谓词逻辑不允许真/假之外的可能性,然而自然语言允许。例如“永远为真”“知道为真”“相信为真”。LTL 和 CTL 就是这样的,它们是 Modal Logic 的特例。又例如对于交互式的 agent 来说,模态逻辑是一种帮助我们形式化的方法。

Our main case study will be the logic of knowledge in a multi-agent system.

Syntax

简单将谓词逻辑(即 First-Order Logic)的存在/任意,替换成 box \Box 和 diamond \Diamond

Semantics

模态逻辑的模型为一个 4-tuple M=(W,R,AP,L)\mathcal{M}=(W,R,AP,L)

这里 RR 只是一个普通的子集,因此只能看作有向图,如果 R(x,y)R(x,y) 那么称 yy 为一个可达世界.

可满足性的定义:M=(W,R,L)\mathcal{M}=(W,R,L), xWx\in W

一些边界情况

如果 xx 没有可达世界,那么 ϕ,  xϕ\forall\phi,\; x\vdash\Box\phix⊬ϕx\not\vdash\Diamond\phi. 这里的 ϕ\phi 也包括 \top\bot.

因此有一些反直觉:例如对于没有可达世界的 xx, xx\vdash\Box\bot. 但是仔细想还是能理解,因为任意 yy 都满足 ¬R(x,y)\neg R(x,y).

Equivalence

要求对任何模型中的任何世界 xx, 如果 (ϕΓ,  xϕ)    xψ(\forall\phi\in\Gamma,\;x\vdash\phi)\implies x\vdash\psi, 那么定义Γψ\Gamma\vdash\psi.

等价的意思是 {ϕ}ψ\{\phi\}\vdash\psi{ψ}ϕ\{\psi\}\vdash\phi. {}\{\} 可以去掉.

考虑分配律和 De Moegan 律,\Box\Diamond\forall\exists 很相像,这里省略.

回到上面说的边界情况,我们得到 ϕ≢ϕ\Box\phi\not\equiv\Diamond\phi. 然而我们有 \Box\top\equiv\top\Diamond\bot\equiv\bot. 前者很显然,而后者有点费解,稍微证明一下.

Pf. of \Diamond\bot\equiv\bot:

首先没有 xx 满足 \bot, 有 \bot\vdash\Diamond\bot. 反过来如果 xx\vdash\Diamond\bot, 那么存在一个 xx 的可达世界 yy\vdash\bot, 没有这样的 xx, 就算 xx 没有后继也不存在. 双向奔赴了属于是. \blacksquare

还有一个有趣的等价 ϕϕ\Diamond\top\equiv\Box\phi\to\Diamond\phi, 证明显然,对任意 ϕ\phi 成立.

类似一阶逻辑,模态逻辑也有 validity,定义为对任意模型、任意世界都成立,记作 ϕ\vdash\phi.

¬ϕ¬ϕ\vdash\neg\Box\phi\leftrightarrow\Diamond\neg\phi ¬ϕ¬ϕ\vdash\neg\Diamond\phi\leftrightarrow\Box\neg\phi

还有一个有趣的有效公式 K:(ϕψ)(ϕψ)K:\Box(\phi\to\psi)\to(\Box\phi\to\Box\psi).

Logic engineering

逻辑工程的部分工作是确定什么样的公式模式一共有效,并且勾勒出恰好使这些公式为有效的逻辑.

Validity

上面我们全部的表述都是基本模态逻辑的框架,为了适应之前所说的复杂情况,需要 re-engineer 这些基本模态逻辑. 书上的表述为

As modal logic automatically gives us the connective \Diamond ,which is equivalent to ¬¬\neg\Box\neg, we can find out what the corresponding readings of in our system will be.

说实话,我不知道怎么就 automatically 了;不如接受这个约定,带入自然语言:

“未来总是真”对应右边“并非未来总是假”,也就是“未来存在真”;“理应为真”其实是“不允许为假”,那么就对应右边“允许为真”(这里反着绕了一下);“相信ϕ\phi为真”对应右边“不相信ϕ\phi为假”,假设 Q 有一个“信念”的集合,那么 ¬ϕ\neg\phi 不在这个集合中,也就是说,ϕ\phi 不和 Q 的信念矛盾,即 consistent;“知道为真”对应“不知道为假”,也就是说,ϕ\phi 不和 Q 的知识矛盾,但是 Q 可能知道 ϕ\phi, 也可能知道 ¬ϕ\neg\phi.

p.s. 写这一段的时候想到了情态动词(modal verb);看看标题!

除了最后三列都和基本模态逻辑相同,其他都需要讨论一下(另外发现 \Box\Diamond 在45°排版中互换)。不过有些很费解就是了。

Accessibility Relation and Correspondence

这一部分,我们从 \Box\Diamond 的自然语言语义出发,重新回顾 xψ    for all yW,  ¬R(x,y) or yψx\vdash \Box\psi\iff\text{for all } y\in W,\;\neg R(x,y)\text{ or } y\vdash\psi xψ    there exists yW,  R(x,y) and yψx\vdash \Diamond\psi\iff\text{there exists } y\in W,\;R(x,y)\text{ and } y\vdash\psi 这两个形式化定义。

首先重新为 RR 建模.

我们发现上面两个形式化定义与 RR 的性质非常相关。例如,如果 \Box 表示“未来总是真”,根据 Table5.7 我们有一个合理的建模,其中 ϕϕ\Box\phi\to\Box\Box\phi. 注意到这个逻辑仅仅添加了一条 valid 公式模式(ϕϕ\Box\phi\to\Box\Box\phi). 同时观察到根据 Table 5.8, 这时候的 RR 具有了传递性.

一个直觉:对 \Box 的不同解读, 有不同的 validity 公式模式,RR 也有不同的性质(我们最开始认为 RR 是一个普通的二元关系).

这里我们为了考察 RR 的性质,定义标架 F=(W,R,AP)\mathcal{F}=(W,R,AP)(注意之前我们定义“有效”的时候,用的是“任意模型的任何世界”,这里我们将自由度减少,固定了模型中的前两个参数 W,RW,R), 称 Fϕ\mathcal{F}\vdash\phi 当且仅当 wW,L:WP(AP)\forall w\in W, L:W\mapsto\mathcal{P}(AP), M=(W,R,AP,L),wϕ\mathcal{M}=(W,R,AP,L),w\vdash\phi 成立.

定理. 给定 F=(W,R,AP)\mathcal{F}=(W,R,AP), RR 是自反的当且仅当 F\mathcal{F} 使 ϕϕ\Box\phi\to\phi 有效.

证明. 如果对任意 wWw\in W, R(w,w)R(w,w), 假设 xϕx\vdash\Box\phi, 那么对任意可达世界 yy, yϕy\vdash\phi, 其中也包括 ww; 如果 Fϕϕ\vdash_{\mathcal{F}}\Box\phi\to\phi, 反设存在 xWx\in W such that ¬R(x,x)\neg R(x,x). 那么存在一个标识函数 LL 使得 ϕ∉L(x)\phi\not\in L(x),且对任意其他的 yy, ϕL(y)\phi\in L(y). 由于除了 xx 其他都满足 ϕ\phi, 因此 xϕx\vdash\Box\phi; 矛盾. \blacksquare

name formula scheme property of R definition
K ϕ(ϕψ)\Box\phi\land\Box(\phi\to\psi)
ψ\to\Box\psi
none
T ϕϕ\Box \phi \rightarrow \phi reflexive xW,\forall x \in W,
  R(x,x)\;R(x,x)
B ϕϕ\phi \rightarrow \Box \Diamond \phi symmetric x,yW,\forall x, y \in W,
  R(x,y)    R(y,x)\;R(x,y)\implies R(y,x)
D ϕϕ\Diamond\top\equiv\Box \phi \rightarrow \Diamond \phi serial x,  y\forall x,\;\exists y
  s.t. R(x,y)\;\text{s.t. }R(x,y)
4 ϕϕ\Box \phi \rightarrow \Box \Box \phi transitive x,y,zW\forall x, y, z \in W, R(x,y)R(y,z)R(x,y)\land R(y,z)
    R(x,z)\implies R(x,z)
5 ϕϕ\Diamond \phi \rightarrow \Box \Diamond \phi Euclidean x,y,zW,\forall x, y, z \in W,
  R(x,y)R(x,z)\;R(x,y)\land R(x,z)
    R(y,z)\implies R(y,z)
ϕϕ\Box \phi \leftrightarrow \Box \phi functional x,  !y  R(x,y)\forall x,\;\exists! y\;R(x,y)
(ϕϕψ)\Box(\phi \land \Box \phi \rightarrow \psi) \lor
(ψψϕ)\Box(\psi \land \Box \psi \rightarrow \phi)
linear x,y,zW\forall x, y, z \in W, R(x,y)R(y,z)    R(x,y)\land R(y,z)\implies
R(y,z)y=zR(z,y)R(y,z)\lor y=z\lor R(z,y)

p.s. 以上 scheme 和 property 都是当且仅当关系,而且有 Euclidean \to linear

KT45 logic: L={\mathbb{L}=\{ T,4,5 }\}

最开始我们介绍的就是 K logic: L=\mathbb{L}=\varnothing

KT45 逻辑经常用来建模知识推理,这与 Table 5.7 相呼应;这里 4 代表如果 Q 知道某为真,那么知道自己知道它为真;5 代表如果 Q 不知道某为假,那么知道自己不知道它为假. 称为正反省负反省(实际上没人能做到,理想化建模;后面我们可以看到这种建模对应的是逻辑游戏中“所有人都拥有足够智慧”的假设).

然而注意到,“knows”这一行其实除了 T,4,5 还有 D. 事实上 DD 可以直接由 TT 推出:前提是 ϕ\Box\phi, 反设 ¬ϕ\Box\neg\phi, 根据 T,直接推出 ϕ\phi¬ϕ\neg\phi, 矛盾. 因此有 ¬¬ϕ=ϕ\neg\Box\neg\phi=\Diamond\phi.

如果放在二元关系这里,更简单:如果 R(x,x)R(x,x), 那么每个 xx 一定存在自己的可达世界,就是自己.

注意到从 KT45 也可以推出 B, 直观上说,如果 ϕ\phi 为真,那么我可以知道我不知道 ¬ϕ\neg\phi. 反设 ¬ϕ\Box\neg\phi, 由 T 得 ¬ϕ\neg \phi, 矛盾. 因此 ϕ\Diamond\phi. 由 5 得 ϕ\Box\Diamond\phi.

因此 KT45 对应的二元关系应该也是对称的,因为 R(x,y)R(x,x)R(x,y)\land R(x,x) 可以推出 R(y,x)R(y,x).

总之 KT45 对应的二元关系就变成等价关系了. 书上说(待证明,而且我感觉很奇怪,比如一长串 \Box 怎么等价?)

KT4 Logic: L={\mathbb{L}=\{ T,4 }\}

这个逻辑和程序语义、直觉主义逻辑有一些联系,不细说了.

Natural Deduction

Going into a dashed box means reasoning in an arbitrary accessible world.

Wherever ϕ\phi occurs in a proof, ϕ\phi may be put into a subsequent dashed box. Wherever ψ\psi occurs at the end of a dashed box, ψ\psi may be put after that dashed box.

KT45$^n$

对 KT45 做推广,扔掉 \Diamond, 改写 \Box, 得到 KT45$^n$. 其中 KiϕK_i\phi 表示 agent QiQ_i 知道 ϕ\phi.

KT45$^n$ 的一个模型是一个四元组 M=(W,(Ri)iA,AP,L)\mathcal{M}=(W,(R_i)_{i\in\mathcal{A}},AP,L)

根据 KiK_i 可以扩展定义.

后面大概率用不到 DD, 因此略过.

Some valid formulas

modus ponens

redefinition of relations

注意为什么 REGR_{E_G} 用 for some 定义?因为这个 relation 适用于 xEGϕ    i,  y s.t. Ri(x,y),  yϕ    y s.t. REG(x,y),  yϕx\vdash E_G\phi\iff \forall i,\;\forall y\text{ s.t. }R_i(x,y),\;y\vdash\phi\iff\forall y\text{ s.t. }R_{E_G}(x,y),\;y\vdash\phi. 这样 REGR_{E_G} 的确要包括所有的 ii. RDGR_{D_G} 同理.

反省规则

自然演绎规则

MULTI-AGENT !

直接抄书

书上另一个例子是孤岛上的红蓝眼睛问题,高二第一次看的时候吓哭了. 现在再也找不到原视频了(我记得视频一直用 emoji 代表岛民). 无非是旅行者引入了高阶的知识,让所有人知道所有人知道.


参考资料