| 1 |
(* Supporting imp. params. in inductive or fixpoints mutually defined with a notation *) |
| 2 |
|
| 3 |
Reserved Notation "* a" (at level 70). |
| 4 |
Inductive P {n : nat} : nat -> Prop := |
| 5 |
| c m : *m |
| 6 |
where "* m" := (P m). |
| 7 |
|
| 8 |
Reserved Notation "##". |
| 9 |
Inductive I {A:Type} := C : ## where "##" := I. |
| 10 |
|
| 11 |
(* The following was working in 8.6 *) |
| 12 |
|
| 13 |
Require Import TestSuite.vector. |
| 14 |
|
| 15 |
Reserved Notation "# a" (at level 70). |
| 16 |
Fixpoint f {n : nat} (v:Vector.t nat n) : nat := |
| 17 |
match v with |
| 18 |
| Vector.nil _ => 0 |
| 19 |
| Vector.cons _ _ _ v => S (#v) |
| 20 |
end |
| 21 |
where "# v" := (f v). |
| 22 |
|
| 23 |
(* The following was working in 8.6 *) |
| 24 |
|
| 25 |
Reserved Notation "%% a" (at level 69). |
| 26 |
Record R := |
| 27 |
{g : forall {A} (a:A), a=a where "%% x" := (g x); |
| 28 |
k : %% 0 = eq_refl}. |
| 29 |
|
| 30 |
(* An extra example *) |
| 31 |
|
| 32 |
Module A. |
| 33 |
Inductive I {A:Type} := C : # 0 -> I where "# I" := (I = I) : I_scope. |
| 34 |
End A. |