Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting to Coq PR #7257 which fixes a sensitivity of unification wrt alphabetic order #23

Conversation

herbelin
Copy link
Contributor

Dear maintainers of FCF,

We realized that Coq unification had a sensitivity on the ASCII order of variable names (!!) and a fix has been prepared coq/coq#7257.

FCF is one of the developments which we track (via cross-crypto) and which exposes the case of a unification problem solved by ordering variable names alphabetically. Indeed, there is in DistRules.v a unification problem ?s'@{a:=a; s':=s'; x:=a; x0:=s'} == s' for which the solution ?s':=s' is chosen because s' comes before x0 in ASCII order. [To clarify all risk of confusion, the fact that there are 3 distinct uses of the name s' in the problem does not matter: one, ?s' is the name of the evar, one is the name of the variable s' in the context of the evar ?s', and the third is the name of an eponymous variable in the context of the current goal; otherwise said, the problem could have equivalently be reformulated ?e@{a:=a; s':=S; x:=a; x0:=S} == S and expose the same two possible solutions ?e:=s' or ?e:=x0 for ?e.]

Coq PR coq/coq#7257 makes the solution to this problem independent of the exact names of variables by systematically chosing the most recent name, so, here, x0. This breaks the compilation of DistRules.v. This PR against FCF provides a backward-compatible fix so that FCF can continue to compile after coq/coq#7257 is merged.

Please tell me if you have any question.

…ic order).

In two occurrences of `econstructor` in this file, the unification
performed was dependent on the name of the variables involved in the
unification problem.

The unification problem was about solving

  ?s'@{a:=a; s':=s'; x:=a; x0:=s'} =? s'

and the variable coming first in ASCII order was chosen, namely
s'. Otherwise said, if x0 had be named, say l, then l would have been
chosen instead.

With PR #7257, the most recent name is chosen, independently of its
alphabetic value. Here, it means that x0 is now chosen.

We make the file compatible with Coq PR #7257 by changing the sequence
of tactics "econstructor. trivial" into "2:eassumption. constructor",
so that the expected instantiation of ?s' is done by "eassumption"
rather than by "econstructor". This is a backward compatible fix.
Copy link
Owner

@adampetcher adampetcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@adampetcher adampetcher merged commit eac71c4 into adampetcher:master Sep 14, 2018
@herbelin
Copy link
Contributor Author

Thanks also!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants