disadvantage of TSub rule

Moderator: Type Systems of Programming Languages

AlexanderF
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 140
Registriert: 2. Mai 2010 17:55

disadvantage of TSub rule

Beitrag von AlexanderF »

hello,

I have a question to Dr. Erdweg:

In the lecture you said that there is a disadvantage of the TSub rule
and you fixed it by removing this rule and modifing the typing rule for apllication.

I did not understand very well what the problem with the TSub rule was,
could you perhaps explain it in a few sentences?

regards,
Alexander

erdweg
Moderator
Moderator
Beiträge: 60
Registriert: 28. Mär 2013 10:08

Re: disadvantage of TSub rule

Beitrag von erdweg »

T-Sub is problematic because it is not syntax-directed. If you look at the conclusion of T-Sub, you see that it is applicable to any kind of expression. If we would implement T-Sub in our type checker directly, for any expression we can choose to use T-Sub or "regular" type rule (T-App, T-Abs, etc.). Thus, the type checker would need backtracking and might even diverge. Therefore, we say that T-Sub does give rise to an algorithmic type checking.

Cheers,
Sebastian

AlexanderF
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 140
Registriert: 2. Mai 2010 17:55

Re: disadvantage of TSub rule

Beitrag von AlexanderF »

Thanks, so far.

Antworten

Zurück zu „Type Systems of Programming Languages“