Professional Documents
Culture Documents
Problem 1 (5pts)
Problem 1 (5pts)
Problem 1 (5pts)
f : B o o l →Bool ⊢ f ( i f f a l s e t h e n f(t r u e ) e l s e
f(f a l s e ) ) : Bool
Problem 2 (5pts)
t ::= terms
x variable
Let x : T = t i n t Let
v ::= values
T ::= types
Bool type of booleans
Typing rules
Γ ⊢t r u e : Bool (T-T r u e )
Γ ⊢f a l s e : Bool (T-Fa l se )
Γ ⊢t 1 : Bool Γ ⊢t 2 : T Γ ⊢t 3 : T
(T-If )
Γ ⊢i f t 1 t h e n t 2 e l s e t 3 : T
Γ, x:T 1 ⊢ t 2 : T2
(T-Abs)
Γ ⊢ let x:T1 in t 2 : T2
x:T ∈ Γ
(T-Va r )
Γ ⊢x : T