Math 2.0

Computer science Definition

Type system

Builds on Type theoryBinary relation

Definition

Let TT be the set of terms of a programming language, with a set of variables. A type system for the language consists of these data.

  1. A set 𝒯\mathcal T of types.
  2. Contexts: finite lists Γ=x1:τ1,…,xn:τn\Gamma = x_1{:}\tau_1, \ldots, x_n{:}\tau_n of distinct variables with types τi∈𝒯\tau_i \in \mathcal T.
  3. A set of typing rules, each of the form "from the judgments Γ1⊢t1:τ1,…,Γk⊢tk:τk\Gamma_1 \vdash t_1 : \tau_1, \ldots, \Gamma_k \vdash t_k : \tau_k infer Γ⊢t:τ\Gamma \vdash t : \tau".

The typing relation is the least relation Γ⊢t:τ\Gamma \vdash t : \tau between contexts, terms and types that is closed under the typing rules. A term tt is well-typed in Γ\Gamma if Γ⊢t:τ\Gamma \vdash t : \tau for some type τ\tau.

Remarks

Example: in the simply typed lambda calculus over a base type ι\iota, the types are ι\iota and σ→τ\sigma \to \tau. The rules are Γ⊢x:τ\Gamma \vdash x : \tau when x:τx{:}\tau is in Γ\Gamma, the abstraction rule and the application rule. So ⊢λx:ι. x:ι→ι\vdash \lambda x{:}\iota.\, x : \iota \to \iota, by the abstraction rule from x:ι⊢x:ιx{:}\iota \vdash x : \iota.

Non-example: in the same system the term λx:ι. x x\lambda x{:}\iota.\, x\, x is not well-typed. The application rule would need xx to have a type σ→τ\sigma \to \tau, but the context gives xx the base type ι\iota.

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
Element, definition, no evidence levelElementdefinitionProposition, concept, no evidence levelPropositionconceptSet, concept, no evidence levelSetconceptSet, definition, no evidence levelSetdefinitionConjunction, definition, no evidence levelConjunctiondefinitionDisjunction, definition, no evidence levelDisjunctiondefinitionImplication, definition, no evidence levelImplicationdefinitionNegation, definition, no evidence levelNegationdefinitionPredicate, definition, no evidence levelPredicatedefinitionOrdered pair, definition, no evidence levelOrdered pairdefinitionBiconditional, definition, no evidence levelBiconditionaldefinitionTruth table, concept, no evidence levelTruth tableconceptModus ponens, concept, no evidence levelModus ponensconceptUniversal quantifier, definition, no evidence levelUniversal quantifierdefinitionCartesian product, definition, no evidence levelCartesian productdefinitionSubset, definition, no evidence levelSubsetdefinitionPropositional logic, concept, no evidence levelPropositional logicconceptMathematical proof, concept, no evidence levelMathematical proofconceptBinary relation, definition, no evidence levelBinary relationdefinitionTautology, definition, no evidence levelTautologydefinitionLogical equivalence, definition, no evidence levelLogical equivalencedefinitionDouble negation law, statement, no evidence levelDouble negation lawstatementProof by contradiction, concept, no evidence levelProof by contradictionconceptRussell's paradox, statement, no evidence levelRussell's paradoxstatementType theory, concept, no evidence levelType theoryconceptType system, definition, no evidence levelType systemdefinition
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Element definition
  2. Proposition concept
  3. Set concept
  4. Set definition
  5. Conjunction definition
  6. Disjunction definition
  7. Implication definition
  8. Negation definition
  9. Predicate definition
  10. Ordered pair definition
  11. Biconditional definition
  12. Truth table concept
  13. Modus ponens concept
  14. Universal quantifier definition
  15. Cartesian product definition
  16. Subset definition
  17. Propositional logic concept
  18. Mathematical proof concept
  19. Binary relation definition
  20. Tautology definition
  21. Logical equivalence definition
  22. Double negation law statement
  23. Proof by contradiction concept
  24. Russell's paradox statement
  25. Type theory concept
  26. Type system definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Type_system
About this page
Tag353ZZVZW4K
URIm2://353ZZVZW4K
Kinddefinition
WritingW0 stub
MSC68N15, 03B38, 68Q55
DefinesType system
UsesType theory, Binary relation
Changed3 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.