Download presentation

Presentation is loading. Please wait.

Published byHadley Endicott Modified over 2 years ago

1
20110248 CSE 김형준 5 월 30 일 무은재 기념관 308 호

2
Remind Γ▷e : U Given untyped expression e can have type U ㆍ ▷ λx.x : int → int ㆍ ▷ λx.x : bool → bool ㆍ ▷ λx.x : ∀α. α→α All these typings make sense.

3

4
e Untyped expressions set Types set

5
λx.x Untyped expressions set Types set int → int bool → bool …

6
Bottom up Top down

7
Why we need to check whether a is fresh or not? If we reuse type variable which is not fresh under gamma, there may occur unintended link between unrelated variable actually.

8
Why we need Spec rule? To instantiate polytype variable x to monotype so that we can use x polymorphically.

9
W(Γ,e) = (S,A) type Substitution S ::= id | {A/α} | S о S mapping from type variables to monotypes why not polytypes? In my opinion, we may introduce type variable when typing lambda abstraction, and the lambda binder must be monotype in let polymorphism which is base of implicit polymorphism.

10

11
When we talk about Most General type, by its definition, λx.x can have another most general type which is ∀β.∀α. α→α. This type also can be instantiated to all types that ∀α. α→α can be. So we need more constraint to define most general type strictly. In my opinion, this constraint may work. This kind of unrealistic situation happens because we can create a type variables which is not used actually, so every introduced type variables must be used at least once in body. Otherwise it is not most general type because it has meaningless part(not optimization).

Similar presentations

OK

Kathleen Fisher cs242 Reading: “A history of Haskell: Being lazy with class”,A history of Haskell: Being lazy with class Section 6.4 and Section 7 “Monads.

Kathleen Fisher cs242 Reading: “A history of Haskell: Being lazy with class”,A history of Haskell: Being lazy with class Section 6.4 and Section 7 “Monads.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on public speaking Ppt on any topic of maths for class 9 Ppt on environment and sustainable development class 11 Ppt on various types of rocks Ppt on misinterpretation of data Ppt on cse related topics about psychology Ppt on australia continent map Ppt on domestic robots 2020 Ppt on matter in our surroundings Download ppt on height and distance for class 10