In modal logic, the modal depth of a formula is the deepest nesting of modal operators (commonly
\Box
\Diamond
Modal depth can be defined as follows.[1] Let
MD(\phi)
\phi
MD(p)=0
p
MD(\top)=0
MD(\bot)=0
MD(\neg\varphi)=MD(\varphi)
MD(\varphi\wedge\psi)=max(MD(\varphi),MD(\psi))
MD(\varphi\vee\psi)=max(MD(\varphi),MD(\psi))
MD(\varphi → \psi)=max(MD(\varphi),MD(\psi))
MD(\Box\varphi)=1+MD(\varphi)
MD(\Diamond\varphi)=1+MD(\varphi)
The following computation gives the modal depth of
\Box(\Boxp → p)
MD(\Box(\Boxp → p))=
1+MD(\Boxp → p)=
1+max(MD(\Boxp),MD(p))=
1+max(1+MD(p),0)=
1+max(1+0,0)=
1+1=:2
The modal depth of a formula indicates 'how far' one needs to look in a Kripke model when checking the validity of the formula. For each modal operator, one needs to transition from a world in the model to a world that is accessible through the accessibility relation. The modal depth indicates the longest 'chain' of transitions from a world to the next that is needed to verify the validity of a formula.
For example, to check whether
M,w\models\Diamond\Diamond\varphi
v
M,v\models\Diamond\varphi
u
M,u\models\varphi
u
v
w
w
v
v
u
The modal depth is an upper bound (inclusive) on the number of transitions as for boxes, a modal formula is also true whenever a world has no accessible worlds (i.e.,
\Box\varphi
\varphi
w
\forallv\inW (w,v)\not\inR
W
R
M,w\models\Box\Box\varphi
w