Type system
Builds on Type theoryBinary relation
Definition
Let be the set of terms of a programming language, with a set of variables. A type system for the language consists of these data.
- A set of types.
- Contexts: finite lists of distinct variables with types .
- A set of typing rules, each of the form "from the judgments infer ".
The typing relation is the least relation between contexts, terms and types that is closed under the typing rules. A term is well-typed in if for some type .
Remarks
Example: in the simply typed lambda calculus over a base type , the types are and . The rules are when is in , the abstraction rule and the application rule. So , by the abstraction rule from .
Non-example: in the same system the term is not well-typed. The application rule would need to have a type , but the context gives the base type .
A type system is sound for an operational semantics if well-typed closed terms never reach a stuck state. This is usually proved from progress (a well-typed closed term is a value or can take a step) and preservation (a step keeps the type).
Reading path
To understand this page from the ground up, read these 26 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Element definition
- Proposition concept
- Set concept
- Set definition
- Conjunction definition
- Disjunction definition
- Implication definition
- Negation definition
- Predicate definition
- Ordered pair definition
- Biconditional definition
- Truth table concept
- Modus ponens concept
- Universal quantifier definition
- Cartesian product definition
- Subset definition
- Propositional logic concept
- Mathematical proof concept
- Binary relation definition
- Tautology definition
- Logical equivalence definition
- Double negation law statement
- Proof by contradiction concept
- Russell's paradox statement
- Type theory concept
- Type system definition
Further reading
About this page
| Tag | 353ZZVZW4K |
|---|---|
| URI | m2://353ZZVZW4K |
| Kind | definition |
| Writing | W0 stub |
| MSC | 68N15, 03B38, 68Q55 |
| Defines | Type system |
| Uses | Type theory, Binary relation |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- 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.