Math 2.0

Computer science Definition

Denotational semantics

Builds on Directed-complete partial orderScott continuityLeast fixed pointKleene fixed-point theorem

Definition

Let LL be a language whose phrases are generated by a grammar from a finite set of constructs, each taking some subphrases as arguments. A denotational semantics of LL assigns to each syntactic category a semantic domain, usually a directed-complete partial order with a least element. To each phrase pp it assigns an element [ ⁣[p] ⁣][\![p]\!] of the domain of its category, subject to this condition.

  1. Compositionality: for each construct cc with subphrases p1,…,pnp_1, \dots, p_n, there is a function FcF_c, Scott-continuous in each argument, with [ ⁣[c(p1,…,pn)] ⁣]=Fc([ ⁣[p1] ⁣],…,[ ⁣[pn] ⁣])[\![c(p_1, \dots, p_n)]\!] = F_c([\![p_1]\!], \dots, [\![p_n]\!]).

Recursive constructs are interpreted as least fixed points of continuous maps, which exist by the Kleene fixed-point theorem.

Remarks

Example: for a language of commands acting on states Σ\Sigma, take as domain the partial functions Σ⇀Σ\Sigma \rightharpoonup \Sigma, ordered by extension of graphs. Set [ ⁣[C1;C2] ⁣]=[ ⁣[C2] ⁣]∘[ ⁣[C1] ⁣][\![C_1; C_2]\!] = [\![C_2]\!] \circ [\![C_1]\!]. For a loop, [ ⁣[𝗐𝗁𝗂𝗅𝖾 b 𝖽𝗈 C] ⁣][\![\mathsf{while}\ b\ \mathsf{do}\ C]\!] is the least fixed point of a map Φ\Phi on partial functions. The map Φ\Phi sends ww to the partial function equal to w∘[ ⁣[C] ⁣]w \circ [\![C]\!] on states where bb holds and to the identity where bb fails. The approximations Φk(⊥)\Phi^k(\bot) describe the runs that exit the loop after fewer than kk iterations, and their union is the meaning of the loop. The loop 𝗐𝗁𝗂𝗅𝖾 𝗍𝗋𝗎𝖾 𝖽𝗈 𝗌𝗄𝗂𝗉\mathsf{while}\ \mathsf{true}\ \mathsf{do}\ \mathsf{skip} gets the empty partial function, since every Φk(⊥)\Phi^k(\bot) is empty.

Non-example: let the meaning of a command be the truth value "the command terminates from every state". Clause 1 fails for sequencing. The commands x:=0x := 0 and x:=1x := 1 both get the value true, and W=𝗐𝗁𝗂𝗅𝖾 x≠0 𝖽𝗈 𝗌𝗄𝗂𝗉W = \mathsf{while}\ x \ne 0\ \mathsf{do}\ \mathsf{skip} gets false. Yet x:=0;Wx := 0; W always terminates and x:=1;Wx := 1; W never does, so no function FF computes the meaning of C1;C2C_1; C_2 from the meanings of C1C_1 and C2C_2.

A denotational semantics is adequate for an operational semantics if equal denotations imply equal observable behaviour, and fully abstract if the converse also holds.

Reading path

To understand this page from the ground up, read these 8 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Directed-complete partial order concept
  2. Least element concept
  3. Least fixed point concept
  4. Omega-complete partial order concept
  5. Scott continuity concept
  6. Supremum concept
  7. Kleene fixed-point theorem statement
  8. Denotational semantics definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Denotational_semantics
About this page
TagXZRKJ5R5SF
URIm2://XZRKJ5R5SF
Kinddefinition
WritingW0 stub
MSC68Q55, 06B35
DefinesDenotational semantics
UsesDirected-complete partial order, Scott continuity, Least fixed point, Kleene fixed-point theorem
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.