UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 22 forks source link

Failure to assign distinct internal names to variables #390

Open rappatoni opened 6 years ago

rappatoni commented 6 years ago

In the following, A2 causes an error while A1 is fine error.txt

import mitm http://mathhub.info/MitM/Foundation ❚

theory test : mitm:?Logic =
    testdomain : type ❘ #T  ❙
    A1: ⊦ ∃[m:T] (m ≐ m) ∨ ∃[n:T] (n ≐ n) ❙
    A2: ⊦ ∃[n:T] (n ≐ n) ∨ ∃[n:T] (n ≐ n) ❙
❚

It appears that mmt fails to assign fresh internal variables n/r within the scope of each existential quantifier?

florian-rabe commented 6 years ago

@kohlhase @Jazzpirate

This was due to a so far unspecified aspect of the behavior: Can an unknown term depend on a shadowed variable? I've now pushed a version (to devel branch) that answers this question negatively.

In the above example, the unknown type of the second equality can now depend on

However, there are reasonable cases, where the unknown does depend on a shadowed variable. Example: the unknown argument of equality in [x: type, c: x, x: type] c = c. These did not work correctly before and do not now either.

Can you check your example again?

florian-rabe commented 6 years ago

To avoid confusion, note that MMT parses the second quantifier to be in the scope of the first.

rappatoni commented 6 years ago

I tried. I am now getting invalid unit errors for both A1 and A2: error2.txt.

Dennis thinks this is probably an unrelated issue stemming from recent changes to the solver?

florian-rabe commented 6 years ago

At that time, a lot was changing.

I've ironed out must bugs by now. So maybe try again.