{
  "id": "enwiki-001372487194",
  "slug": "typing-environment",
  "title": "Typing environment",
  "qid": "",
  "lead": "In type theory, a typing environment (or typing context) represents the association between variable names and data types. More formally, an environment \\Gamma is a set or ordered list of pairs \\langle x,\\tau \\rangle , usually written as x:\\tau , where x is a variable and \\tau its type. The judgement : \\Gamma \\vdash e:\\tau is read as \" e has type \\tau in context \\Gamma \". For each function body type checks: : \\Gamma = \\{(f,\\tau_1\\times...\\times\\tau_n \\to \\tau_0)|(f,xs,(\\tau_1,...,\\tau_n),t_f,\\tau_0)\\in e\\} Typing Rules Example: \\begin{array}{c} \\Gamma\\vdash b:Bool, \\Gamma\\vdash t_1:\\tau, \\Gamma\\vdash t_2:\\tau\\\\ \\hline \\Gamma \\vdash (\\text{if}(b) t_1 \\text{else} t_2): \\tau \\\\ \\end{array} In statically typed programming languages, these environments are used and maintained by typing rules to type check a given program or expression.",
  "body": "In type theory, a typing environment (or typing context) represents the association between variable names and data types. More formally, an environment \\Gamma is a set or ordered list of pairs \\langle x,\\tau \\rangle , usually written as x:\\tau , where x is a variable and \\tau its type. The judgement \\Gamma \\vdash e:\\tau is read as \" e has type \\tau in context \\Gamma \". For each function body type checks: \\Gamma = \\{(f,\\tau_1\\times...\\times\\tau_n \\to \\tau_0)|(f,xs,(\\tau_1,...,\\tau_n),t_f,\\tau_0)\\in e\\} Typing Rules Example: \\begin{array}{c} \\Gamma\\vdash b:Bool, \\Gamma\\vdash t_1:\\tau, \\Gamma\\vdash t_2:\\tau\\\\ \\hline \\Gamma \\vdash (\\text{if}(b) t_1 \\text{else} t_2): \\tau \\\\ \\end{array} In statically typed programming languages, these environments are used and maintained by typing rules to type check a given program or expression. ==See also== Type system ==References==",
  "categories": [
    "20282650",
    "23379929",
    "23468805",
    "23603337",
    "23617853",
    "28699008",
    "29176688"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1372487194",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1788214345.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001372487194",
    "type": "webpage",
    "title": "Typing environment",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/typing-environment",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          21
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          21
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001372487194",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1372487194",
    "note": "Immutable snapshot enwiki-001372487194"
  }
}