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

nsatz no longer unfolds TwoF #18872

Open
Boutry opened this issue Mar 30, 2024 · 5 comments
Open

nsatz no longer unfolds TwoF #18872

Boutry opened this issue Mar 30, 2024 · 5 comments
Labels
kind: regression Problems that were not present in previous versions. part: nsatz The nsatz tactic

Comments

@Boutry
Copy link

Boutry commented Mar 30, 2024

Description of the problem

I recently had to change our script to get our library to compile with Coq 8.19.0.

Small Coq file to reproduce the bug

Require Import Nsatz.

Require Import Rbase.

Definition TwoF : R := 1 + 1.

Goal forall x y:R,  x = y -> (x+1+1)%R = (y+TwoF)%R.
nsatz.
Qed.

Version of Coq where this bug occurs

8.19.0

Last version of Coq where the bug did not occur

8.18.0

@Boutry Boutry added kind: bug An error, flaw, fault or unintended behaviour. needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Mar 30, 2024
@Boutry
Copy link
Author

Boutry commented Mar 30, 2024

Thank you @thery for spotting the problem :)

@JasonGross JasonGross changed the title Regression with nasty? Regression with nsatz? Mar 30, 2024
@JasonGross JasonGross added kind: regression Problems that were not present in previous versions. part: nsatz The nsatz tactic labels Mar 30, 2024
@SkySkimmer SkySkimmer removed the needs: triage The validity of this issue needs to be checked, or the issue itself updated. label Mar 30, 2024
@andres-erbsen
Copy link
Contributor

I'd guess it's #18325 -- previously nsatz interpreted goals using typeclass search, which I believe would have unfolded TwoF.

IMO the nsatz change itself here is likely desirable as it makes it easier to predict whether nsatz will solve a goal and makes nsatz less slow on pathological cases, but breaking scripts that relied on the heuristic unfolding is unfortunately direct consequence. Currently, the main way we offer for handling changes of this kind is to participate in the Coq CI. There have been a number discussions about how strict and conservative we should be about avoiding coq changes that require backwards-compatible changes to downstream code, and input is welcome in that regard.

@andres-erbsen andres-erbsen changed the title Regression with nsatz? nsatz no longer unfolds TwoF Mar 31, 2024
@andres-erbsen andres-erbsen removed the kind: bug An error, flaw, fault or unintended behaviour. label Mar 31, 2024
@Boutry
Copy link
Author

Boutry commented Apr 1, 2024

So is 2 a notation instead of a definition then? I am asking as the following does not present the problem.

Goal forall x y:R,  x = y -> (x+1+1)%R = (y+2)%R.
nsatz.
Qed.

@andres-erbsen
Copy link
Contributor

Yes, 2 is a Number Notation for IZR as defined in theories/Reals/Rdefinitions.v, and nsatz understands IZR. Set Printing All is helpful for figuring out these differences.

@thery
Copy link
Contributor

thery commented Apr 18, 2024

maybe something should be added in the change log if it is not already done explaining this issue and the possible change of behavior of nsatz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: regression Problems that were not present in previous versions. part: nsatz The nsatz tactic
Projects
None yet
Development

No branches or pull requests

5 participants