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

Adapt to coq PR #17991 which lets "simpl" refolds partial applications of fixpoints #975

Conversation

herbelin
Copy link
Contributor

The simpl reduction used to not refold the partially applied recursive calls of reducible fixpoints as this was requiring eta-conversion. Thanks to eta-conversion support, this is not anymore needed and Coq PR coq/coq#17991 implements refolding of partial applications.

This has an impact on metacoq, in the file Typing.v of template-coq, namely, the expression

typing_size (type_App Σ Γ t l t_ty t' H e n t0)

reduces with the Coq PR to

S (Nat.max (typing_size H) (typing_spine_size (@typing_size cf) Σ Γ t_ty l t' t0))

while it reduced before to

S (Nat.max (typing_size H)
             (typing_spine_size
                (fun (x : global_env_ext) (x0 : context) 
                   (x1 x2 : term) (x3 : x;;; x0 |- x1 : x2) => 
                 typing_size x3) Σ Γ t_ty l t' t0

Assuming that the new behavior is "better" (more intelligible, more intuitive), this metacoq PR ensures that Typing.v compiles both with and without the change of behavior of simpl (the change is not very smart but works).

If ok for you, the PR can then be merged as soon as now.

…impl.

Done by modifying the code so that it is insensitive to the behavior
of simpl before and after the Coq PR.
Copy link
Member

@tabareau tabareau left a comment

Choose a reason for hiding this comment

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

the new behavior looks indeed better

@tabareau tabareau merged commit 657eb6a into MetaCoq:main Aug 31, 2023
10 checks passed
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