Subject reduction
{{No footnotes|date=January 2025}}
In type theory, a type system has the property of subject reduction (also subject evaluation, type preservation or simply preservation) if evaluation of expressions does not cause their type to change. Formally, if ⊢ e1 : τ and e1 → e2 then ⊢ e2 : τ. Intuitively, this means one would not like to write a expression, in say Haskell, of type Int, and have it evaluate to a value v, only to find out that v is a string.
Together with progress, it is an important meta-theoretical property for establishing type soundness of a type system.
The opposite property, if Γ ⊢ e2 : τ and e1 → e2 then Γ ⊢ e1 : τ, is called subject expansion. It often does not hold as evaluation can erase ill-typed sub-terms of an expression, resulting in a well-typed one.
References
- {{cite journal |first1=Andrew K. |last1=Wright |first2=Matthias |last2=Felleisen |authorlink2=Matthias Felleisen |year=1994 |title=A Syntactic Approach to Type Soundness |journal=Information and Computation |volume=115 |issue=1 |pages=38–94 |doi=10.1006/inco.1994.1093 |doi-access=free |s2cid=31415217}}
- {{cite book |first=Benjamin C. |last=Pierce |authorlink=Benjamin C. Pierce |year=2002 |title=Types and Programming Languages |publisher=MIT Press |isbn=0262162091 |lccn=2001044428 |chapter=8.3 Safety=Progress + Preservation |pages=95–98}}
Category:Management cybernetics
{{type-theory-stub}}