Download presentation

Presentation is loading. Please wait.

Published byHadley Endicott Modified over 3 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

COMP 412, FALL 2000 1 Type Systems II C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.

COMP 412, FALL 2000 1 Type Systems II C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To ensure the functioning of the site, we use **cookies**. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy & Terms.
Your consent to our cookies if you continue to use this website.

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