Skip to main content

foundations · Essay 9 · 22 min

Modal Logic

Modal logic extends propositional logic with operators for necessity and possibility, interpreted on Kripke frames of possible worlds with an accessibility relation. The page covers the four readings (alethic, epistemic, deontic, temporal), the Kripke semantics, the standard systems K through S5, the correspondence between accessibility properties and axioms, and three worked exercises with answers.

What Modal Logic Adds

Propositional logic and predicate logic say what is true. Modal logic says what is necessarily or possibly true.

The two new operators:

  • φ\Box \varphi: "necessarily φ\varphi." Read in different application domains as: it must be that φ\varphi, it is known that φ\varphi, it is obligatory that φ\varphi, φ\varphi holds at every future time.
  • φ\Diamond \varphi: "possibly φ\varphi." Read as: it might be that φ\varphi, it is consistent with what is known that φ\varphi, φ\varphi is permissible, φ\varphi holds at some future time.

The two are interdefinable: φ¬¬φ\Diamond \varphi \equiv \neg \Box \neg \varphi, and φ¬¬φ\Box \varphi \equiv \neg \Diamond \neg \varphi. So the language with one of them as primitive can express the other.

Once \Box and \Diamond are in the language, modal logic becomes the natural framework for several distinct philosophical and technical tasks: metaphysics of modality, epistemic and deontic reasoning, temporal logic in formal verification, dynamic logic for program semantics. Kripke's possible-worlds semantics (1959, 1963) made all of this technically tractable in one common framework.1

This page assumes What Is Logic?, Validity vs Soundness, Syntax vs Semantics in Formal Systems, Propositional Logic, and What Is a Symbolic System?.

Four Readings of the Same Operators

The same modal operators are reused across very different application domains. Choosing which reading to apply commits the user to different formal axioms.

Readingφ\Box \varphi meansφ\Diamond \varphi meansStandard system
AlethicNecessarily φ\varphi (true in all possible worlds)Possibly φ\varphiS5 (typical)
EpistemicThe agent knows φ\varphiφ\varphi is consistent with what the agent knowsS5 (idealized), S4 (more realistic), KD45 (belief)
Deonticφ\varphi is obligatoryφ\varphi is permittedKD (typical)
Temporalφ\varphi holds at every future time (or always)φ\varphi holds at some future timeS4 (linear future)

The pluralism is structural, not philosophical confusion. Different domains have different formal commitments about how \Box behaves, captured in different axiom systems below.

Kripke Semantics: Frames and Models

The conceptual move that made modal logic technically tractable is Kripke's possible-worlds semantics.

A Kripke frame is a pair W,R\langle W, R \rangle:

  • WW is a non-empty set of worlds.
  • RW×WR \subseteq W \times W is the accessibility relation. wRww R w' means "world ww' is accessible from world ww."

A Kripke model is a triple M=W,R,V\mathcal{M} = \langle W, R, V \rangle where W,R\langle W, R \rangle is a frame and V:atomsP(W)V: \text{atoms} \to \mathcal{P}(W) is a valuation: V(p)V(p) is the set of worlds where pp is true.

The recursive truth definition:

  • M,wp\mathcal{M}, w \models p iff wV(p)w \in V(p), for atomic pp.
  • M,w¬φ\mathcal{M}, w \models \neg \varphi iff M,w⊭φ\mathcal{M}, w \not\models \varphi.
  • M,wφψ\mathcal{M}, w \models \varphi \land \psi iff M,wφ\mathcal{M}, w \models \varphi and M,wψ\mathcal{M}, w \models \psi.
  • (likewise for the other propositional connectives)
  • M,wφ\mathcal{M}, w \models \Box \varphi iff for every ww' with wRww R w', M,wφ\mathcal{M}, w' \models \varphi.
  • M,wφ\mathcal{M}, w \models \Diamond \varphi iff for some ww' with wRww R w', M,wφ\mathcal{M}, w' \models \varphi.

The clauses for \Box and \Diamond are the heart of Kripke semantics. φ\Box \varphi at ww says φ\varphi holds at every world accessible from ww. The accessibility relation RR encodes which worlds are "reachable" from a given world, and the modality is interpreted relative to the worlds reachable.

Different readings of the modal operators correspond to different intuitive readings of accessibility:

  • Alethic: wRww R w' means ww' is a way the world might have been, given ww.
  • Epistemic: wRww R w' means ww' is consistent with what the agent at ww knows.
  • Deontic: wRww R w' means ww' is one of the deontic alternatives to ww, the worlds where everything obligatory is the case.
  • Temporal: wRww R w' means ww' is a moment after ww (with various refinements for branching versus linear time).

A Worked Kripke Model

Take a small Kripke model with three worlds.

W={w1,w2,w3}W = \{w_1, w_2, w_3\}, with accessibility relation

R={(w1,w2),(w1,w3),(w2,w3),(w3,w3)}.R = \{(w_1, w_2),\, (w_1, w_3),\, (w_2, w_3),\, (w_3, w_3)\}.

Visualization: w1w_1 accesses w2w_2 and w3w_3; w2w_2 accesses w3w_3; w3w_3 accesses itself.

Atomic valuations: V(p)={w2,w3}V(p) = \{w_2, w_3\} (so pp is true at w2w_2 and w3w_3, false at w1w_1). V(q)={w3}V(q) = \{w_3\} (qq is true only at w3w_3).

Evaluate p\Box p at each world:

  • w1w_1: accesses w2w_2 and w3w_3. pp is true at both. So M,w1p\mathcal{M}, w_1 \models \Box p.
  • w2w_2: accesses w3w_3. pp is true at w3w_3. So M,w2p\mathcal{M}, w_2 \models \Box p.
  • w3w_3: accesses w3w_3. pp is true at w3w_3. So M,w3p\mathcal{M}, w_3 \models \Box p.

So p\Box p is true at every world.

Evaluate q\Box q at each world:

  • w1w_1: accesses w2w_2 and w3w_3. qq is true at w3w_3 but false at w2w_2. So M,w1⊭q\mathcal{M}, w_1 \not\models \Box q (one accessible world fails).
  • w2w_2: accesses w3w_3. qq is true at w3w_3. So M,w2q\mathcal{M}, w_2 \models \Box q.
  • w3w_3: accesses w3w_3. qq is true at w3w_3. So M,w3q\mathcal{M}, w_3 \models \Box q.

So q\Box q is true at w2w_2 and w3w_3, false at w1w_1.

Evaluate q\Diamond q at each world:

  • w1w_1: accesses w2w_2 and w3w_3. qq is true at w3w_3. So M,w1q\mathcal{M}, w_1 \models \Diamond q.
  • w2w_2: accesses w3w_3. qq is true at w3w_3. So M,w2q\mathcal{M}, w_2 \models \Diamond q.
  • w3w_3: accesses w3w_3. qq is true at w3w_3. So M,w3q\mathcal{M}, w_3 \models \Diamond q.

So q\Diamond q is true everywhere.

The general procedure: to evaluate a modal formula at a world, look at all worlds accessible from it and recursively evaluate the formula's interior.

The Standard Systems: K, T, S4, S5

Different axiom systems correspond to different classes of Kripke frames. The classical hierarchy:

SystemAxioms (added to propositional logic + modus ponens + necessitation)Frame condition
K(φψ)(φψ)\Box(\varphi \to \psi) \to (\Box \varphi \to \Box \psi)None (any frame)
TK + φφ\Box \varphi \to \varphiReflexive: wwRw\forall w\, w R w
S4T + φφ\Box \varphi \to \Box \Box \varphiReflexive and transitive
S5S4 + φφ\Diamond \varphi \to \Box \Diamond \varphiEquivalence relation (reflexive, transitive, symmetric)

The two inference rules of any normal modal system:

  • Modus ponens: from φ\varphi and φψ\varphi \to \psi, infer ψ\psi.
  • Necessitation: from φ\vdash \varphi (i.e., φ\varphi is a theorem), infer φ\vdash \Box \varphi.

Necessitation says: anything provable in pure logic must hold in every world (since the proof goes through regardless of which world we are at).

The axiom labeled K above (sometimes called the distribution axiom) is the modal analog of modus ponens: necessity distributes over conditional. Every normal modal logic includes K. The other axioms add stronger commitments.

Correspondence Between Frame Properties and Axioms

The most striking technical fact about modal logic: each standard modal axiom corresponds to a specific algebraic property of the accessibility relation.2

AxiomRead asCorresponds toReason
φφ\Box \varphi \to \varphi (T)If necessarily φ\varphi, then φ\varphiRR is reflexiveIf ww accesses itself, anything true at all accessible worlds is true at ww
φφ\Box \varphi \to \Box \Box \varphi (4)If necessarily φ\varphi, then necessarily necessarily φ\varphiRR is transitiveIf wRww R w' and wRww' R w'', then wRww R w''
φφ\Diamond \varphi \to \Box \Diamond \varphi (5)If possibly φ\varphi, then necessarily possibly φ\varphiRR is Euclidean: wRwwRw    wRww R w' \land w R w'' \implies w' R w''Combined with reflexivity, this gives equivalence
φφ\varphi \to \Box \Diamond \varphi (B)If φ\varphi, then necessarily possibly φ\varphiRR is symmetric: wRw    wRww R w' \implies w' R wφ\varphi at ww should be possible from any ww' accessing back
φφ\Box \varphi \to \Diamond \varphi (D)If obligatory, then permittedRR is serial: wwwRw\forall w\, \exists w'\, w R w'At least one obligatory alternative must exist

The correspondence theorem makes the choice of modal system non-arbitrary. If the application domain demands that \Box behaves factively (φφ\Box \varphi \to \varphi, "what is known is true"), the accessibility relation must be reflexive. If it demands positive introspection (φφ\Box \varphi \to \Box \Box \varphi, "if you know it, you know that you know it"), the relation must be transitive. The axioms and the relation are not two independent choices.

Worked Application: Epistemic Logic for AI Agents

Modal logic is the standard substrate for epistemic logic: reasoning about what agents know.3 In a multi-agent system with nn agents, we use nn modal operators K1,,KnK_1, \ldots, K_n, where KiφK_i \varphi reads "agent ii knows that φ\varphi."

The standard epistemic axioms:

  • KiφφK_i \varphi \to \varphi (T): knowledge is factive. Agents know only true things.
  • KiφKiKiφK_i \varphi \to K_i K_i \varphi (4): positive introspection. Agents know what they know.
  • ¬KiφKi¬Kiφ\neg K_i \varphi \to K_i \neg K_i \varphi (5): negative introspection. Agents know what they do not know.

A logically idealized agent satisfies S5 epistemic logic. Real human agents do not: humans regularly believe false things (failure of T), are mistaken about the contents of their knowledge (failure of 4), and lack awareness of their ignorance (failure of 5). Whether an AI agent's representations satisfy these axioms depends on the architecture, the training, and the deployment regime.

Common variants:

  • Belief logic drops the factivity axiom T (agents can believe false things). The standard system is KD45: Kφ¬K¬φK \varphi \to \neg K \neg \varphi (consistency), positive introspection, negative introspection.
  • Common knowledge uses an additional operator CφC \varphi: "everyone knows that everyone knows that ... φ\varphi, ad infinitum." Common knowledge is needed for coordinated action and is famously hard to establish via finite communication (Fagin, Halpern, Moses, Vardi 1995).

This is one of the cleanest places where modal logic is not a philosophy detour but a working tool for reasoning about distributed AI systems.

Common Confusions

Confusion 1: \Box as logical truth. φ\Box \varphi does not mean "φ\varphi is logically valid." It means "φ\varphi holds at every world accessible from the current one." Whether the modality coincides with logical validity depends on the accessibility relation. In S5 with a single equivalence class of worlds, the two notions can collapse; in K with arbitrary accessibility, they cannot.

Confusion 2: φφ\Box \varphi \to \Box \Box \varphi is "obvious." Positive introspection is intuitive in some readings but not always true. For factive knowledge, S4 (positive introspection) is plausible. For objective necessity, the axiom is much more contestable. For belief, agents often believe propositions without higher-order beliefs about those beliefs. The choice is empirical and varies by application.

Confusion 3: alethic and epistemic readings are interchangeable. They share notation but make different commitments. Alethic necessity ("must be") and epistemic necessity ("known") are different modalities. A statement can be epistemically possible (consistent with what is known) but alethically impossible (false in every metaphysically possible world), or vice versa.

Confusion 4: \Box and \forall are the same. They are related (both are universal-style operators) but they quantify over different things. xP(x)\forall x\, P(x) quantifies over objects in the domain. φ\Box \varphi quantifies over accessible worlds. Combining them gives quantified modal logic (QML), which has additional technical complications: should constants denote the same object across worlds (rigid designation, Kripke 1972)? what is the domain at each world? QML is well-developed but more involved than either propositional modal logic or standard first-order logic alone.

Three Exercises

Exercise 1. Consider the Kripke model from "A Worked Kripke Model" above. Evaluate each formula at each world:

(a) (pq)\Box (p \to q). (b) (p¬q)\Diamond (p \land \neg q). (c) q\Box \Diamond q.

Exercise 2. Decide whether each formula is valid in K (true at every world of every Kripke model), and separately whether it is valid in S5 (true at every world of every Kripke model whose accessibility is an equivalence relation):

(a) (φψ)(φψ)\Box (\varphi \to \psi) \to (\Box \varphi \to \Box \psi). (b) φφ\Box \varphi \to \varphi. (c) φφ\Diamond \Box \varphi \to \varphi.

Exercise 3. Construct a Kripke model with at least two worlds where the K axiom (pq)(pq)\Box (p \to q) \to (\Box p \to \Box q) holds at every world but pp\Box p \to \Box \Box p fails at some world. (Such a model demonstrates that 4 is strictly stronger than K.)

Answers

Answer 1:

(a) (pq)\Box (p \to q):

  • w1w_1: accesses w2,w3w_2, w_3. At w2w_2: pp is true, qq is false, so pqp \to q is false. Therefore (pq)\Box (p \to q) is false at w1w_1.
  • w2w_2: accesses w3w_3. At w3w_3: pp is true, qq is true, so pqp \to q is true. Therefore (pq)\Box (p \to q) is true at w2w_2.
  • w3w_3: accesses w3w_3. Same check, true. Therefore (pq)\Box (p \to q) is true at w3w_3.

(b) (p¬q)\Diamond (p \land \neg q):

  • w1w_1: accesses w2,w3w_2, w_3. At w2w_2: pp is true, ¬q\neg q is true (since qq is false at w2w_2). So p¬qp \land \neg q is true at w2w_2. Therefore (p¬q)\Diamond (p \land \neg q) is true at w1w_1.
  • w2w_2: accesses w3w_3. At w3w_3: pp is true, ¬q\neg q is false. So p¬qp \land \neg q is false. Therefore (p¬q)\Diamond (p \land \neg q) is false at w2w_2.
  • w3w_3: accesses w3w_3. Same as above, false. Therefore (p¬q)\Diamond (p \land \neg q) is false at w3w_3.

(c) q\Box \Diamond q:

  • We computed earlier that q\Diamond q is true at every world. So q\Box \Diamond q holds at every world (regardless of where the world accesses).

Answer 2:

(a) (φψ)(φψ)\Box (\varphi \to \psi) \to (\Box \varphi \to \Box \psi). Valid in K, valid in S5. This is the K axiom itself, valid in every normal modal logic.

(b) φφ\Box \varphi \to \varphi. Not valid in K (counterexample: a frame where ww does not access itself; let V(p)=V(p) = \emptyset at ww, then p\Box p holds vacuously at ww but pp does not hold at ww). Valid in S5 (since S5 includes T as an axiom; reflexivity guarantees the formula).

(c) φφ\Diamond \Box \varphi \to \varphi. Not valid in K. Valid in S5. Reasoning for S5: in an equivalence-relation frame, if φ\Diamond \Box \varphi holds at ww, there is some accessible ww' with φ\Box \varphi at ww'. Since RR is symmetric, wRww' R w, so ww is among the worlds accessible from ww' at which φ\Box \varphi guarantees φ\varphi. Hence φ\varphi at ww. The argument fails without symmetry.

Answer 3. Take three worlds W={u,v,w}W = \{u, v, w\} with accessibility R={(u,v),(v,w)}R = \{(u, v), (v, w)\}. The relation is not transitive (we have uRvu R v and vRwv R w but not uRwu R w).

Set V(p)={v}V(p) = \{v\} (so pp is true at vv, false at uu and ww).

Check the K axiom holds at uu for arbitrary φ,ψ\varphi, \psi: K is valid in every Kripke model regardless of frame conditions, so we can move on.

Check pp\Box p \to \Box \Box p at uu:

  • p\Box p at uu: accesses vv only. pp is true at vv. So p\Box p holds at uu.
  • p\Box \Box p at uu: p\Box p should hold at every world accessible from uu. The only accessible world is vv. p\Box p at vv: accesses ww only. pp is false at ww. So p\Box p does not hold at vv. Therefore p\Box \Box p does not hold at uu.

So at uu, p\Box p holds but p\Box \Box p does not. The implication pp\Box p \to \Box \Box p fails at uu. The frame is non-transitive, which is why the 4-axiom does not hold.

The model demonstrates that 4 is a strictly stronger axiom than K alone: there are K-models in which 4 fails.

Where Modal Logic Lives in Practice

Three concrete uses.

Formal verification of programs and protocols. Linear temporal logic (LTL) and computation tree logic (CTL) are temporal modal logics used to specify properties of concurrent and reactive systems. Statements like "every request is eventually granted" or "on every branch, the system never deadlocks" are formal-modal sentences over a transition system. Model checkers (SPIN, NuSMV, TLA+) verify them automatically. Modal logic is the substrate of working software-correctness verification.

Knowledge representation in multi-agent AI. Multi-agent epistemic logic (the Fagin-Halpern-Moses-Vardi framework) is the theoretical foundation of game-theoretic AI and distributed-systems verification. Common-knowledge reasoning is essential for analyzing protocols where coordination is required but communication channels can fail.

Metaphysics and counterfactuals. David Lewis's Counterfactuals (1973) develops a possible-worlds semantics for counterfactual conditionals that has shaped Anglophone metaphysics for fifty years. The modal logic of necessity, possibility, and actuality is the formal toolkit for these debates. The pages in PhilosophyPath that touch on possibility and counterfactual reasoning trace back here.

The general lesson: modal logic is one of the few formal systems that crosses cleanly from technical computer science to working metaphysics, and the bridge runs through Kripke's 1959-63 papers.

Prerequisites and Next Pages

References

Primary texts:

  • Kripke, Saul A. "A Completeness Theorem in Modal Logic." Journal of Symbolic Logic 24 (1959): 1-14.
  • Kripke, Saul A. "Semantical Considerations on Modal Logic." Acta Philosophica Fennica 16 (1963): 83-94. The two papers that introduced possible-worlds semantics.
  • Lewis, C. I., and C. H. Langford. Symbolic Logic. New York: Dover, 1932. The early modern source for modal axiomatizations.
  • Lewis, David. Counterfactuals. Harvard University Press, 1973. The standard possible-worlds semantics for counterfactual conditionals.

Modern reference:

  • Hughes, G. E., and M. J. Cresswell. A New Introduction to Modal Logic. Routledge, 1996. The standard textbook covering all of K, T, S4, S5 and the correspondence theory.
  • Blackburn, Patrick, Maarten de Rijke, and Yde Venema. Modal Logic. Cambridge, 2001. The advanced reference; full mathematical depth on Kripke semantics.
  • Fagin, Ronald, Joseph Y. Halpern, Yoram Moses, and Moshe Y. Vardi. Reasoning About Knowledge. MIT Press, 1995. Multi-agent epistemic logic for AI and distributed systems.
  • van Benthem, Johan. Modal Logic for Open Minds. CSLI Publications, 2010. The contemporary view of modal logic across applications.

Stanford Encyclopedia entries (link, do not paraphrase):

Footnotes

  1. Kripke, Saul A. "A Completeness Theorem in Modal Logic." Journal of Symbolic Logic 24 (1959): 1-14. Kripke 1963: "Semantical Considerations on Modal Logic," Acta Philosophica Fennica 16: 83-94. The two papers establish what is now called Kripke semantics.

  2. This correspondence theory was systematized by Johan van Benthem, Modal Logic and Classical Logic, Bibliopolis, 1985, and by Henrik Sahlqvist's earlier theorem on a wide class of modal axioms. The basic correspondences below are due to Kripke 1963 and the Lemmon-Scott school.

  3. Fagin, Ronald, Joseph Y. Halpern, Yoram Moses, and Moshe Y. Vardi. Reasoning About Knowledge. MIT Press, 1995. The standard textbook treatment of epistemic logic for multi-agent systems.