In modal logic, the concept of **possible worlds** is used to provide a semantics for the modal states of possibility and necessity.

Semantics for modal logic using possible worlds are generally referred to as *possible world semantics* or *Kripke semantics* after Saul Kripke, who devised the system. The concept may have originated with Rudolf Carnap. Jaakko Hintikka independently developed a system very similar to Kripke’s for his epistemic logic, which referred to ‘alternative states of affairs’ rather than ‘possible worlds&lsqo;.

Hintikka’s name, ‘alternative states of affairs’, highlights an important aspect of the possible world semantics. Kripke and others using the system do not mean for the term ‘possible world’ to have any metaphysical import; possible worlds are not real entities, but simply a way of referring to a model which allows truth values to be assigned to modal formulae in the system.

Possible worlds are generally named either by uppercase Greek letters, beginning with Γ, or by the letter W with a subscript numeral to indicate the specific world (W_{0}, W_{1}, W_{2}, … W_{n}).

In modal logic, a formula (φ) is considered to be necessary (□φ) when it is true in all possible worlds. A formula is considered to be possible true (◊φ) when it is true in at least one possible world.

In modal logic, possible worlds are connected by an **accessibility relation**, *R*. In the system S5, all worlds are accessible to all other worlds, so the above definitions of neccessity and possibility hold. In some systems, however, where worlds can only access certain other worlds, the concepts of necessity and possibility become limited to specific worlds.

As a result, a formula is now considered necessary *in some possible world* when it is true in all other possible worlds *accessible from* that world. A formula is considered possible *in some possible world* when it is true in at least one possible world *accessible from* that world.

For example, suppose that some possible world, Δ is accessible from the world Γ (Γ*R*Δ). In Δ, suppose that the proposition P is true. (We indicate this using the forces [⊩] relation, by Δ ⊩ P). Because Γ*R*Δ, we know that in Δ, P is possible (◊), because P is true in at least one world accessible from Γ. We write, Γ⊩◊P.

Suppose that Δ is the only world accessible to Γ. Then, P is true in every world accessible to Γ, so P is neccessary in Γ and we write Γ ⊩ □P.

Suppose, however, that there is a third possible world, Θ, which has access to other possible worlds but no access to Δ. In this world, neither ◊P nor □P are true, because Θ does not have access to the world in which P is true.

The above diagram illustrates this example. We have three possible worlds, Γ, Δ and Θ. Γ has access to Δ (Γ*R*Δ) but not to any other world. Θ has access to Γ (Θ*R*Γ) but not to any other world. As a result, we can see that if Δ⊩P, then Γ⊩◊P and Γ⊩□P, but neither ◊P nor □P is true in Θ, because Θ does not have access to any world in which P is true.