fbpx
Wikipedia

Typing environment

In type theory a typing environment (or typing context) represents the association between variable names and data types.

More formally an environment is a set or ordered list of pairs , usually written as , where is a variable and its type.

The judgement

is read as " has type in context ".[1]

For each function body type checks:

Typing Rules Example:

In statically typed programming languages these environments are used and maintained by typing rules to type check a given program or expression.

See also edit

References edit

  1. ^ "Simply Typed λ-calculus" (PDF).

typing, environment, type, theory, typing, environment, typing, context, represents, association, between, variable, names, data, types, more, formally, environment, displaystyle, gamma, ordered, list, pairs, displaystyle, langle, rangle, usually, written, dis. In type theory a typing environment or typing context represents the association between variable names and data types More formally an environment G displaystyle Gamma is a set or ordered list of pairs x t displaystyle langle x tau rangle usually written as x t displaystyle x tau where x displaystyle x is a variable and t displaystyle tau its type The judgement G e t displaystyle Gamma vdash e tau is read as e displaystyle e has type t displaystyle tau in context G displaystyle Gamma 1 For each function body type checks G f t 1 t n t 0 f x s t 1 t n t f t 0 e displaystyle 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 G b B o o l G t 1 t G t 2 t G if b t 1 else t 2 t displaystyle 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 editType systemReferences edit Simply Typed l calculus PDF G displaystyle Gamma vdash nbsp This programming language theory or type theory related article is a stub You can help Wikipedia by expanding it vte Retrieved from https en wikipedia org w index php title Typing environment amp oldid 1148108355, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.