File: stlc.sos
[Reduce File] [Raw File]
Module stlc:host
term ::= app(term, term)
| abs(string, type, term)
| var(string)
type ::= arrow(type, type)
| base
Judgment typeOf : [(string, type)] term* type
Projection term : [(string, type)]
Projection type :
typeOf G T1 arrow(Ty1, Ty2)
typeOf G T2 Ty1
--------------------------- [T-App]
typeOf G app(T1, T2) Ty2
typeOf (X, Ty1)::G Body Ty2
------------------------------------------ [T-Abs]
typeOf G abs(X, Ty1, Body) arrow(Ty1, Ty2)
lookup G X Ty
------------------ [T-Var]
typeOf G var(X) Ty