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

Assertion failed with funelim #372

Closed
Tuplanolla opened this issue Apr 24, 2021 · 1 comment
Closed

Assertion failed with funelim #372

Tuplanolla opened this issue Apr 24, 2021 · 1 comment

Comments

@Tuplanolla
Copy link

Version

Coq 8.13.2

Operating system

Red Hat Enterprise Linux Workstation 7.4

Description of the problem

The following program causes an anomaly.

From Coq Require Import Lia NArith.NArith Program.Basics ssr.ssreflect.
From Equations Require Export Equations.

Obligation Tactic := idtac.

Section Context.

Import N.

Local Open Scope N_scope.

Context (f : N -> N) (mono : forall (a b : N) (l : a < b), f a < f b).

Equations f_bogus (n : N) : positive :=
  f_bogus n :=
    let m := f (succ n) - f n in
    match m with
    | N0 => _
    | Npos p => p
    end.
Next Obligation. intros n m. apply xH. Qed.

Equations f_inspect (n : N) : positive :=
  f_inspect n :=
    let m := f (succ n) - f n in
    match exist _ m (eq_refl m) with
    | exist _ N0 e => @const _ (m = N0) _ e
    | exist _ (Npos p) e => @const _ (m = Npos p) p e
    end.
Next Obligation. intros n m _ _ e. pose proof mono n (succ n) as l. lia. Qed.

Lemma eq_f (n : N) : f_bogus n = f_inspect n.
Proof.
  funelim (f_bogus _). funelim (f_inspect _).
  set (m := f (succ n) - f n). generalize (eq_refl m). case : {2 3 4} m.
  - intros e. subst m. pose proof mono n (succ n) as l. lia.
  - intros p e. reflexivity. Restart.
  funelim f_bogus.

End Context.
Anomaly "File "src/sigma_types.ml", line 118, characters 10-16: Assertion failed."
Please report at http://coq.inria.fr/bugs/.

Notes

This is probably a duplicate of #194,
although the reproduction of this bug does not involve
implicit arguments or Greek letters.

mattam82 added a commit that referenced this issue May 4, 2021
mattam82 added a commit that referenced this issue May 4, 2021
This was referenced May 4, 2021
@mattam82
Copy link
Owner

mattam82 commented May 4, 2021

Indeed it was the same problem funelim should be called with a fully applied term. I turned this into an error for now.

@mattam82 mattam82 closed this as completed May 4, 2021
mattam82 added a commit that referenced this issue May 5, 2021
mattam82 added a commit that referenced this issue May 5, 2021
mattam82 added a commit that referenced this issue May 5, 2021
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

No branches or pull requests

2 participants