In type theory, a typing rule is an inference rule that describes how a type system assigns a type to a syntactic construction.[1]: 94 These rules may be applied by the type system to determine if a program is well-typed and what type expressions have. A prototypical example of the use of typing rules is in defining type inference in the simply typed lambda calculus, which is the internal language of Cartesian closed categories.[2]