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

Program Fixpoint's measure conflicts with notations in where clause. #14841

Closed
h0nzZik opened this issue Sep 2, 2021 · 1 comment · Fixed by #18834
Closed

Program Fixpoint's measure conflicts with notations in where clause. #14841

h0nzZik opened this issue Sep 2, 2021 · 1 comment · Fixed by #18834
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: inductives Inductive types, fixpoints, etc. part: notations The notation system.
Milestone

Comments

@h0nzZik
Copy link

h0nzZik commented Sep 2, 2021

Description of the problem

Coq does not accept a Program Fixpoint with measure and notation in where clause.

From Coq Require Import Program.

Reserved Notation "'bar' x" (at level 60).

(* works *)
(*
Fixpoint foo (n : nat) :=
  match n with
  | 0 => 0
  | S n' => S (bar n')
  end
where "'bar' x" := (foo x).
 *)

(* works *)
(*
Program Fixpoint goo (n : nat) :=
  match n with
  | 0 => 0
  | S n' => S (bar n')
  end
where "'bar' x" := (goo x).
*)

(* Works *)
(*
Program Fixpoint goo (n : nat) {struct n} :=
  match n with
  | 0 => 0
  | S n' => S (bar n')
  end
where "'bar' x" := (goo x).
*)


(* Does not work. `Error: Unknown interpretation for notation "bar _".`
 *)
Program Fixpoint goo (n : nat) {measure n} :=
  match n with
  | 0 => 0
  | S n' => S (bar n')
  end
where "'bar' x" := (goo x).

Coq Version

tested on version 8.13.2 and current master branch (bdb72aa)

@Alizter Alizter added kind: bug An error, flaw, fault or unintended behaviour. part: inductives Inductive types, fixpoints, etc. part: notations The notation system. labels Sep 29, 2021
@herbelin
Copy link
Member

herbelin commented Apr 1, 2024

Will be fixed by #18834. Thanks for the report.

@coqbot-app coqbot-app bot added this to the 8.20+rc1 milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: inductives Inductive types, fixpoints, etc. part: notations The notation system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants