Intrinsic vs. extrinsic interpretations Broadly speaking, there are two different ways of assigning meaning to the simply typed lambda calculus, as to typed languages more generally, variously called intrinsic vs. extrinsic, ontological vs. semantical, or Church-style vs. Curry-style. An intrinsic semantics only assigns meaning to well-typed terms, or more precisely, assigns meaning directly to typing derivations. This has the effect that terms differing only by type annotations can nonetheless be assigned different meanings. For example, the identity term \lambda x\mathbin{:}\mathtt{int}.~x on
integers and the identity term \lambda x\mathbin{:}\mathtt{bool}.~x on
Booleans may mean different things. (The classic intended interpretations are the identity function on integers and the identity function on Boolean values.) In contrast, an extrinsic semantics assigns meaning to terms regardless of typing, as they would be interpreted in an untyped language. In this view, \lambda x\mathbin{:}\mathtt{int}.~x and \lambda x\mathbin{:}\mathtt{bool}.~x mean the same thing (i.e., the same thing as ). The distinction between intrinsic and extrinsic semantics is sometimes associated with the presence or absence of annotations on lambda abstractions, but strictly speaking this usage is imprecise. It is possible to define an extrinsic semantics on annotated terms simply by ignoring the types (i.e., through
type erasure), as it is possible to give an intrinsic semantics on unannotated terms when the types can be deduced from context (i.e., through
type inference). The essential difference between intrinsic and extrinsic approaches is just whether the typing rules are viewed as defining the language, or as a formalism for verifying properties of a more primitive underlying language. Most of the different semantic interpretations discussed below can be seen through either an intrinsic or extrinsic perspective.
Equational theory The simply typed lambda calculus (STLC) has the same
equational theory of βη-equivalence as
untyped lambda calculus, but subject to type restrictions. The equation for
beta reduction{{efn|The '{{tmath|1= =_{\beta} }}' denotes the process of producing the substitution of expression u for x, in the form t.}} : (\lambda x\mathbin{:}\sigma.~t)\,u =_{\beta} t[x:=u] holds in context \Gamma whenever \Gamma,x\mathbin{:}\sigma \vdash t\mathbin{:}\tau and {{tmath|1= \Gamma\vdash u\mathbin{:}\sigma }}, while the equation for
eta reduction{{efn|The '{{tmath|1= =_{\eta} }}' denotes the process of producing the expansion of form t applied to x.}} : \lambda x\mathbin{:}\sigma.~t\,x =_\eta t holds whenever \Gamma\vdash t{:}\sigma \to \tau and x does not appear free in . The advantage of typed lambda calculus is that STLC allows potentially nonterminating computations to be cut short (that is,
reduced).
Operational semantics Likewise, the
operational semantics of simply typed lambda calculus can be fixed as for the untyped lambda calculus, using
call by name,
call by value, or other
evaluation strategies. As for any typed language,
type safety is a fundamental property of all of these evaluation strategies. Additionally, the
strong normalization property
described below implies that any evaluation strategy will terminate on all simply typed terms.
Categorical semantics The simply typed lambda calculus enriched with product types, pairing and projection operators (with \beta\eta-equivalence) is the
internal language of
Cartesian closed categories (CCCs), as was first observed by
Joachim Lambek. Given any CCC, the basic types of the corresponding lambda calculus are the
objects, and the terms are the
morphisms. Conversely, the simply typed lambda calculus with product types and pairing operators over a collection of base types and given terms forms a CCC whose objects are the types, and morphisms are equivalence classes of terms. There are
typing rules for
pairing,
projection, and a
unit term. Given two terms s\mathbin{:}\sigma and {{tmath|1= t\mathbin{:}\tau }}, the term (s,t) has type . Likewise, if one has a term {{tmath|1= u\mathbin{:}\tau_1\times\tau_2 }}, then there are terms \pi_1(u)\mathbin{:}\tau_1 and \pi_2(u)\mathbin{:}\tau_2 where the \pi_i correspond to the projections of the Cartesian product. The
unit term, of type 1, written as () and vocalized as 'nil', is the
final object. The equational theory is extended likewise, so that one has : \pi_1(s\mathbin{:}\sigma,t\mathbin{:}\tau) = s\mathbin{:}\sigma : \pi_2(s\mathbin{:}\sigma,t\mathbin{:}\tau) = t\mathbin{:}\tau : (\pi_1(u\mathbin{:}\sigma\times\tau) , \pi_2(u\mathbin{:}\sigma\times\tau)) =u\mathbin{:}\sigma\times\tau : t\mathbin{:}1 = () This last is read as "
if t has type 1, then it reduces to nil". The above can then be turned into a category by taking the types as the
objects. The
morphisms \sigma\to\tau are
equivalence classes of pairs (x\mathbin{:}\sigma, t\mathbin{:}\tau) where
x is a variable (of type ) and
t is a term (of type ), having no free variables in it, except for (optionally)
x. The set of terms in the language is the closure of this set of terms under the operations of abstraction and
application. This correspondence can be extended to include "language homomorphisms" and
functors between the category of Cartesian closed categories, and the category of simply typed lambda theories. Part of this correspondence can be extended to
closed symmetric monoidal categories by using a
linear type system.
Proof-theoretic semantics The simply typed lambda calculus is closely related to the implicational fragment of propositional
intuitionistic logic, i.e., the
implicational propositional calculus, via the
Curry–Howard isomorphism: terms correspond precisely to proofs in
natural deduction, and
inhabited types are exactly the
tautologies of this logic. From his logistic method Church 1940 p.58 laid out an
axiom schema, p. 60, which Henkin 1949 filled in with type domains (e.g. the natural numbers, the real numbers, etc.). Henkin 1996 p. 146 described how Church's logistic method could seek to provide a foundation for mathematics (Peano arithmetic and real analysis), via
model theory. == Alternative syntaxes ==