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

cbv on undefined evars under binders when the substitution involves cases produces unbound rel #18194

Closed
yannl35133 opened this issue Oct 22, 2023 · 0 comments · Fixed by #18195
Milestone

Comments

@yannl35133
Copy link
Contributor

Description of the problem

Eval cbv zeta in (fun (a : True) => (?[T] : True),
  let r :=
    let b := I in
    match tt with tt => b end
  in
  ?T@{a := r}).
= (fun a : True => ?T, ?T@{a:=match tt with
                              | tt => _UNBOUND_REL_1
                              end})
: (True -> True) * True
where
?T : [a : True |- True]

this can be turned into something which fails because of it, although the instance I found is contrived.

Require Import Coq.Program.Tactics.

Program Definition a := Eval cbv zeta in (fun (a : True) => (?[A] : nat),
  let r :=
    let b := I in match tt with tt => b end
  in
  ?A@{a := r},
  fun (a : True) => (eq_refl : ?A = _)).

Next Obligation.
  destruct a; exact 0.
Defined.
File "/tmp/foo.v", line 12, characters 0-8:
Error:
Unbound reference: In environment
anonymous' : unit
The reference 3 is free.

Coq Version

8.18.0, master

Fix

(mkCase (ci, u, pms, ty, iv, t,br))

-        (mkCase (ci, u, pms, ty, iv, t,br))
+        (apply_env @@ mkCase (ci, u, pms, ty, iv, t,br))

PR #18195

yannl35133 pushed a commit to Yann-Leray/coq that referenced this issue Oct 23, 2023
@coqbot-app coqbot-app bot added this to the 8.19+rc1 milestone Oct 30, 2023
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 a pull request may close this issue.

1 participant