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

Error: Anomaly "Not an unfoldable reference." #18239

Closed
JasonGross opened this issue Nov 1, 2023 · 7 comments · Fixed by #18243
Closed

Error: Anomaly "Not an unfoldable reference." #18239

JasonGross opened this issue Nov 1, 2023 · 7 comments · Fixed by #18243
Labels
kind: anomaly An uncaught exception has been raised. kind: regression Problems that were not present in previous versions.
Milestone

Comments

@JasonGross
Copy link
Member

Within the past four days or so (since the merging of #18014), it seems there's been a regression that introduced an anomaly into fiat-crypto-legacy:

File "./src/Experiments/SimplyTypedArithmetic.v", line 7059, characters 4-350:
Error: Anomaly "Not an unfoldable reference."
Please report at http://coq.inria.fr/bugs/.
@JasonGross JasonGross added kind: regression Problems that were not present in previous versions. kind: anomaly An uncaught exception has been raised. labels Nov 1, 2023
@JasonGross
Copy link
Member Author

@coqbot minimize coq.dev

git clone --recurse-submodules https://github.com/mit-plv/fiat-crypto.git --branch=sp2019latest
cd fiat-crypto
make TIMED=1 some-early util

Copy link
Contributor

coqbot-app bot commented Nov 1, 2023

Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.

This comment was marked as outdated.

@SkySkimmer
Copy link
Contributor

Seems to be from #17993

@SkySkimmer
Copy link
Contributor

Reduced

Fixpoint even n := match n with 0 => true | S n => negb (odd n) end
with odd n := match n with 0 => false | S n => negb (even n) end.

Definition boo n (x:unit) := even n.

Eval simpl in boo 2. (* anomaly *)

The problem appears with a partially applied definition whose body is a mutual fixpoint (PartialEvaluate is the partially applied definition in fcl).

cc @herbelin

@herbelin
Copy link
Member

herbelin commented Nov 1, 2023

Interestingly, the following fails similarly even before #17993:

Fixpoint even n := match n with 0 => fun _ : unit => true | S n => odd n end
with odd n := match n with 0 => fun _ => false | S n => even n end.

Definition boo n (x:unit) := even n x.

Fail Eval simpl in boo 2.
(* Not an unfoldable reference. *)

@herbelin
Copy link
Member

herbelin commented Nov 1, 2023

Another interesting example (before #17993):

Fixpoint f_fix_fun n := match n with 0 => fun _ : unit => true | S n => fun _ => true end.
Definition boo_fix_fun n := f_fix_fun n.
Eval simpl in boo_fix_fun 2. (* fun _ : unit => true *)

Fixpoint f_fix n := match n with 0 => fun _ : unit => true | S n => fun _ => true end.
Definition boo_fix n := f_fix n tt.
Eval simpl in boo_fix 2. (* boo_fix 2 *)

Definition f_case n := match n with 0 => fun _ : unit => true | S n => fun _ => true end.
Definition boo_case n := f_case n tt.
Eval simpl in boo_case 2. (* true *)

Shouldn't it be consistent, typically by reducing also boo_fix 2 to true? [Added: actually, in the general case, we would not know how to refold such boo_fix, so maybe it is ok.]

herbelin added a commit to herbelin/github-coq that referenced this issue Nov 1, 2023
…ons for simpl.

We ensure that there are enough arguments in the original applied
constant, in addition to ensuring enough arguments in the constant
that immediately surrounds a global mutual fixpoint.

This incidentally fixes a pre-coq#17993 bug.
herbelin added a commit to herbelin/github-coq that referenced this issue Nov 2, 2023
…ons for simpl.

We ensure that there are enough arguments in the original applied
constant, in addition to ensuring enough arguments in the constant
that immediately surrounds a global mutual fixpoint.

This incidentally fixes a pre-coq#17993 bug.
@coqbot-app coqbot-app bot added this to the 8.19+rc1 milestone Nov 4, 2023
coqbot-app bot added a commit that referenced this issue Nov 4, 2023
…ing conditions for simpl on encapsulated mutual fixpoints

Reviewed-by: SkySkimmer
Co-authored-by: SkySkimmer <SkySkimmer@users.noreply.github.com>
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Jan 10, 2024
… conditions for simpl."

This reverts commit b789f40.
JasonGross added a commit to JasonGross/coq that referenced this issue Mar 12, 2024
The [original
justification](https://github.com/coq/coq/wiki/Coq-Call-2020-06-24#adding-back-fiat-crypto-legacy)
was:
> Jason is willing to put in the time to maintain it, and help
> understanding failures in the proof automation part.
>
> Maxime suggests adding it to the allow_failure pipeline, but Théo
> mentions it does not report back this information very well. A coqbot
> change can allow that, pinging Jason in case of failure. Théo is on it.
> Emilio raises the point that we still need to investigate regressions in
> developments. We agree but see the cost/benefit for f-c-l to have been
> too high in the past (partly due to our inability to quickly debug the
> Ltac code there). Hence we compromise on this tradeoff of putting it in
> allow-failure for now.

However, there hasn't been an issue with the Ltac code in
fiat-crypto-legacy in a long time, the brief stint of time when f-c-l
was failing on master resulted in a bug in Coq being missed (see
coq#18239), and there is no longer any
backwards compatibility that we are trying to maintain with f-c-l,
insofar as we are moving towards Ltac2 and away from Ltac1, I expect
that there shouldn't be too many semantics changes in Ltac1, and so I
think it may be time to remove the allow_failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: anomaly An uncaught exception has been raised. kind: regression Problems that were not present in previous versions.
Projects
None yet
3 participants