<p>No, you cannot strictly distinguish syntactic from semantic methods, but the distinction still ends up making sense.</p>
<ul>
<li><p>Structural operational semantics is not denotational, because it is not a compositional method of giving semantics to a programming language.</p>
</li>
<li><p>However, you can build denotational models out of a structural operational semantics by using a realizability or logical relations method. As an example, see Robert Harper's <a href="http://www.cs.uoregon.edu/research/summerschool/summer10/lectures/Harper-JSC92.pdf" rel="noreferrer"><em>Constructing Type Systems over Operational Semantics</em></a>.</p>
</li>
<li><p>Term models are denotational, but generally semanticists are not satisfied with them. What they usually want is a category of models in which the term model is initial, which can be used to prove soundness and completeness results.  (The soundness and completeness of the typed lambda calculus for cartesian closed categories is the paradigmatic example; see Alex Simpson's <a href="http://homepages.inf.ed.ac.uk/als/Research/completeness.ps.gz" rel="noreferrer"><em>Categorical Completeness Results for the Simply-Typed <span class="math-container">$\lambda$</span>-calculus</em></a> for some details.)</p>
</li>
<li><p>In the other direction, if you have a denotational semantics, you might want to figure out what the syntax for it is. Then you want to go and find a syntax and abstract machine whose term model can serve as an intitial object in a suitable category of models.</p>
<p>For instance, game semantics began its life as a purely semantic construction, and eventually led to work on operational game semantics --- a recent example of which is Alexis Goyet's <a href="http://goyet.info/goyet_2013_llbc.pdf" rel="noreferrer"><em>The lambda lambda-bar calculus: A dual calculus for unconstrained strategies</em></a>.</p>
</li>
<li><p>Overall, you can think of structural operational semantics as a way of specifying abstract machines, which we hope are easy to implement. A denotational semantics gives a compositional model of a language, which we hope is easy to reason about. If we have both, then we can both implement and reason about the language.</p>
</li>
<li><p>Normalization theorems are an interesting ambiguous case. Usually, to prove normalization, you need a semantic model (typically a logical relation). However, once you know that normalization holds, many properties can now be proved by induction on normal forms, which is a purely syntactic argument.</p>
<p>For weak logics (anything up to first-order logic without induction, roughly), you can prove normalization syntactically, using the technique of <em>hereditary substitution</em>. In these logics, the subformula property holds, and so you can prove normalization by induction on types. See Frank Pfenning's paper <a href="http://www-cgi.cs.cmu.edu/%7Efp/papers/lics95.pdf" rel="noreferrer"><em>Structural Cut Elimination</em></a> for an explanation of how this works.</p>
</li>
</ul>

CC BY-SA 3.0
2014-03-14T11:55:34.117Z
Wow, thanks for the quick and thorough answer!
Blaisorblade
CC BY-SA 3.0
2014-04-09T13:37:25.513Z
I disagree on the reason you gave for operational semantics being not denotational.  Operational semantics is not denotational because no denotation is assigned to programs.  There exists work that makes operational semantics compositional.
day
CC BY-SA 3.0
2014-03-14T11:27:16.637Z
2014-03-14T17:46:22.333Z
2020-06-17T09:38:08.363Z
Neel Krishnaswami
<p>While discussion strong normalization proofs, <a href="https://cstheory.stackexchange.com/questions/14105/how-to-show-that-a-type-in-a-system-with-dependent-types-is-not-inhabited-i-e/14113?noredirect=1#comment57022_14113">this comment</a> contrasts the "normal forms model" with "purely syntactic methods".</p>

<p>This brings me back to a more basic question: can we still distinguish syntactic and semantic constructions strictly, in the face of syntax-based models? What about term models for algebras, Henkin models for first-order logics? What about structural operational semantics? Since term models can be isomorphic to syntax, it seems hard to make a firm distinction.</p>

<p>Until I studied the difference between proof theory and model theory in logic, I was even baffled by the idea that "static type systems are a syntactic method". After all, a type system reasons about types, which are an abstraction of program behavior (and with dependent types, an arbitrarily precise one).</p>

<lo.logic><pl.programming-languages><operational-semantics>
Can we distinguish strictly syntactic and semantic methods in programming language?
Blaisorblade
# Can we distinguish strictly syntactic and semantic methods in programming language?

(Asked by: username_0 on 2014-03-13)

While discussion strong normalization proofs, [this comment](https://cstheory.stackexchange.com/questions/14105/how-to-show-that-a-type-in-a-system-with-dependent-types-is-not-inhabited-i-e/14113?noredirect=1#comment57022_14113) contrasts the "normal forms model" with "purely syntactic methods".

This brings me back to a more basic question: can we still distinguish syntactic and semantic constructions strictly, in the face of syntax-based models? What about term models for algebras, Henkin models for first-order logics? What about structural operational semantics? Since term models can be isomorphic to syntax, it seems hard to make a firm distinction.

Until I studied the difference between proof theory and model theory in logic, I was even baffled by the idea that "static type systems are a syntactic method". After all, a type system reasons about types, which are an abstraction of program behavior (and with dependent types, an arbitrarily precise one).

**Tags:** lo.logic, pl.programming-languages, operational-semantics


---

## 1 answers

### Answer by username_1 on 2014-03-14. Score: 14 | Accepted answer

No, you cannot strictly distinguish syntactic from semantic methods, but the distinction still ends up making sense.

* Structural operational semantics is not denotational, because it is not a compositional method of giving semantics to a programming language.
* However, you can build denotational models out of a structural operational semantics by using a realizability or logical relations method. As an example, see Robert Harper's [*Constructing Type Systems over Operational Semantics*](http://www.cs.uoregon.edu/research/summerschool/summer10/lectures/Harper-JSC92.pdf).
* Term models are denotational, but generally semanticists are not satisfied with them. What they usually want is a category of models in which the term model is initial, which can be used to prove soundness and completeness results. (The soundness and completeness of the typed lambda calculus for cartesian closed categories is the paradigmatic example; see Alex Simpson's [*Categorical Completeness Results for the Simply-Typed $\lambda$-calculus*](http://homepages.inf.ed.ac.uk/als/Research/completeness.ps.gz) for some details.)
* In the other direction, if you have a denotational semantics, you might want to figure out what the syntax for it is. Then you want to go and find a syntax and abstract machine whose term model can serve as an intitial object in a suitable category of models.

  For instance, game semantics began its life as a purely semantic construction, and eventually led to work on operational game semantics --- a recent example of which is Alexis Goyet's [*The lambda lambda-bar calculus: A dual calculus for unconstrained strategies*](http://goyet.info/goyet_2013_llbc.pdf).
* Overall, you can think of structural operational semantics as a way of specifying abstract machines, which we hope are easy to implement. A denotational semantics gives a compositional model of a language, which we hope is easy to reason about. If we have both, then we can both implement and reason about the language.
* Normalization theorems are an interesting ambiguous case. Usually, to prove normalization, you need a semantic model (typically a logical relation). However, once you know that normalization holds, many properties can now be proved by induction on normal forms, which is a purely syntactic argument.

  For weak logics (anything up to first-order logic without induction, roughly), you can prove normalization syntactically, using the technique of *hereditary substitution*. In these logics, the subformula property holds, and so you can prove normalization by induction on types. See Frank Pfenning's paper [*Structural Cut Elimination*](http://www-cgi.cs.cmu.edu/%7Efp/papers/lics95.pdf) for an explanation of how this works.

> **Comments:**
> **username_0**: Wow, thanks for the quick and thorough answer!  
> **username_2**: I disagree on the reason you gave for operational semantics being not denotational.  Operational semantics is not denotational because no denotation is assigned to programs.  There exists work that makes operational semantics compositional.  

---

