coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Randy Pollack <rpollack AT inf.ed.ac.uk>
- To: Coq-Club Club <coq-club AT inria.fr>
- Subject: [Coq-Club] "Program"
- Date: Fri, 29 Aug 2014 13:35:49 -0400
Here is a very cut down example that checks in version 8.4pl3:
===============
Inductive Ty := NAT | A.
Inductive Exp : Ty -> Type :=
| CONST: nat -> Exp NAT
| IFZ : forall t, Exp NAT -> Exp t -> Exp t -> Exp t.
Definition step (t:Ty) (M:Exp t) : Exp t :=
match M in Exp s return Exp s with
| CONST c => CONST c
| IFZ t0 e1 e2 e3 =>
match e1 with
| CONST 0 => e2
| _ => e3
end
end.
=================
I want to replace the first match case of [step] with
| CONST c => M
so I tried
========================
Program Definition step (t:Ty) (M:Exp t) : Exp t :=
match M in Exp s return Exp s with
| CONST c => M
| IFZ t0 e1 e2 e3 =>
match e1 with
| CONST 0 => e2
| _ => e3
end
end.
========================
which fails with:
Error: The variable anonymous' was not found in the current environment.
Thanks for any help with making my Definition work.
--Randy
- [Coq-Club] "Program", Randy Pollack, 08/29/2014
- Re: [Coq-Club] "Program", Cédric, 08/30/2014
- Re: [Coq-Club] "Program", Jonathan, 08/30/2014
- <Possible follow-up(s)>
- Re: [Coq-Club] "Program", J. Ian Johnson, 08/29/2014
- Re: [Coq-Club] "Program", Jonathan, 08/29/2014
- Re: [Coq-Club] "Program", Cédric, 08/30/2014
Archive powered by MHonArc 2.6.18.