typing environment
   HOME

TheInfoList



OR:

In
type theory In mathematics and theoretical computer science, a type theory is the formal presentation of a specific type system. Type theory is the academic study of type systems. Some type theories serve as alternatives to set theory as a foundation of ...
, a typing environment (or typing context) represents the association between variable names and
data type In computer science and computer programming, a data type (or simply type) is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these ...
s. 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 Judgement (or judgment) is the evaluation of given circumstances to make a decision. Judgement is also the ability to make considered decisions. In an informal context, a judgement is opinion expressed as fact. In the context of a legal tria ...
: \Gamma \vdash e:\tau is read as "e has type \tau in context \Gamma ". For each function body type checks: :\Gamma = \ Typing Rules Example: \begin \Gamma\vdash b:Bool, \Gamma\vdash t_1:\tau, \Gamma\vdash t_2:\tau\\ \hline \Gamma \vdash (\text(b) t_1 \text t_2): \tau \\ \end In
statically typed In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usu ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s, these environments are used and maintained by
typing rule In type theory, a typing rule is an inference rule that describes how a type system assigns a type to a syntactic construction. These rules may be applied by the type system to determine if a program is well-typed and what type expressions ha ...
s to type check a given program or expression.


See also

*
Type system In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usu ...


References

Data types Program analysis Type theory {{type-theory-stub