Open htzh opened 2 years ago
Hate to say it, but that's a known problem. See this paper for a more detailed discussion and examples with worse consequences. Typing, in particular, is a common source of unexpected results. See the bottom of this post for relevant comments and the same copied code here to help you inspect the types of variables in your terms (at the cost of significant verbosity). Hope this helps!
For example:
The last term is semantically (and type-wise) okay but will not be accepted by the parser (even with explicit type annotations). The reason is that the two
x
s have different types so the bound variable is not renamed. On the other hand the following sequence produces the correct renaming: