Normalization
One way of deciding an equational theory is through normalizing its terms.
Take any equational theory with judgments of the form
\Gamma \vdash M = N : \tau
This judgment states that the terms
- simply-typed
\lambda -calculus with\beta\eta -convertibility for the equational theory - System T
- System F
- Martin-Löf type theory
and so on.
Given terms
We can capture this axiomatically. Let
\mathsf{Tm}_\tau(\Gamma) = \{ M \mid \Gamma \vdash M : \tau \}
be the set of terms of type
\{\textsf{nf}_{\Gamma, \tau} : \mathsf{Tm}_\tau(\Gamma) \to \mathsf{Nf}_\tau(\Gamma)\}_{\Gamma, \tau}
which map each term
\Gamma \vdash M = N : \tau\ \Longleftrightarrow \textsf{nf}_{\Gamma, \tau}(M) \equiv \textsf{nf}_{\Gamma, \tau}(N)
\tag{*}
where
That is: to decide whether two terms are equal, it suffices to compute their normal forms, and check if they are syntactically identical. This is computable precisely when (a) computing the normal forms, and (b) deciding their equality is.
If the normal forms are a subset of terms, i.e. if
- Preservation of equational theory.
\Gamma \vdash M = N : \tau\ \Longrightarrow \textsf{nf}_{\Gamma, \tau}(M) \equiv \textsf{nf}_{\Gamma, \tau}(N) - Equality with normal form. If
\Gamma \vdash M : \tau then\Gamma \vdash M = \textsf{nf}_{\Gamma, \tau}(M) : A . - Idempotence. If
M \in \mathfrak{N}_\tau(\Gamma) thenM \equiv\textsf{nf}_{\Gamma, \tau}(M) .
We have used
Note, however, that normal forms need not be a subset of terms: complicated type theories may require mathematically complicated notions of normal form.
Canonicity
A type theory satisfies the canonicity property exactly when there are normalization functions at closed terms of ground type.
In terms of the previous definition, we only need a collection of functions
\{\textsf{nf}_b : \mathsf{Tm}_b \to \mathsf{Nf}_b\}_{b}
satisfying (*), where
b ranges over the ground types of the system, e.g.\textsf{Nat} ,\textsf{Bool} , etc.\mathsf{Tm}_b = \{ M \mid \cdot\vdash M : b \} is the set of closed terms of ground typeb \mathsf{Nf}_b usually consists of the normal forms of ground typeb
Normalization by Rewriting
Normalization is a property of an abstract rewriting system that every term will eventually be rewritten as an irreducible term, called a normal form.
Strong normalization, or termination requires for all sequences of rewriting will leads to a normal form, and weak normalization only requires one such sequence to exist.
Normalization by Evaluation
Normalization by evaluation refers to a 'semantic' technique for normalizing terms. In short, terms are interpreted in some sort of semantic structure. This structure is chosen cleverly so as to enable the extraction of normal forms from its elements. See the main article for more.
See also
References
- The normalization axioms given above come from
@inproceedings{fiore_semantic_2002,
address = {Pittsburgh, PA, USA},
title = {Semantic analysis of normalisation by evaluation for typed lambda calculus},
isbn = {978-1-58113-528-2},
doi = {10.1145/571157.571161},
language = {en},
booktitle = {Proceedings of the 4th {ACM} {SIGPLAN} international conference on {Principles} and {Practice} of {Declarative} {Programming} - {PPDP} '02},
publisher = {ACM Press},
author = {Fiore, Marcelo},
year = {2002},
pages = {26--37}