OpenMath / OMSTD

The OpenMath Standard (starting with OpenMath 2)
9 stars 5 forks source link

Clarifying and partially fixing alpha-conversion and bound variables in OM2 #50

Closed kohlhase closed 6 years ago

kohlhase commented 6 years ago

This pull request contains the fixes for #30 and #40. As this is a complex topic, this will require multiple commits.

It is still under development, so do not merge it yet, but possibly give early feedback as the commits flow in.

kohlhase commented 6 years ago

I have updated this PR to the trunk and think it is ready to go. @davidcarlisle could you please have a look and merge if you like it?

kohlhase commented 6 years ago

BTW, the change is so large, since I had to (manually) format the MathML to make sense of it while editing.

florian-rabe commented 6 years ago

I'm commenting on #53:

Using my definitions in #64, #53 can be resolved easily. However, as described in #64, we have to choose between two options. Depending on the choice, the resolution to #53 varies:

florian-rabe commented 6 years ago

Michael asked about variants of parallel binding that do not forbid duplicate variables. Here's one option:

In a binding object, essentially all variable bindings govern each other. The precise definition is more technical because it has to cover the case where the same variable name is bound multiple times in the same binding object: In a binding object with variable bindings b_1, ..., b_n, the variable reference bi governs the list of variable bindings that results from cutting off b{i+1}, ..., b_n, b_1, ..., b_i after the first binding with the same name as b_i.

This somewhat convoluted definition has the effect that the following examples work:

However, it has the serious drawback that it does not work if the same variable name is used in nested binding objects, e.g., in let x = 1 in let x = x+1 in x the second binding of x would falsely be interpreted as a recursion.