Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Fixpoint definition

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Fixpoint definition


Chronological Thread 
  • From: Jacques-Henri Jourdan <jacques-henri.jourdan AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] Fixpoint definition
  • Date: Mon, 15 Jul 2013 17:13:49 +0200

Hi coqclub,

If I define a list this way (I have some reasonnably good reason not to currify the constructor here):

Inductive lst :=
| Nil | Cons : nat*lst -> lst.

I can do some fixpoint computation this way :

Fixpoint test l :=
match l with
| Nil => 0
| Cons (t, q) =>
test q
end.

However, the termination checker fails on this similar test case:

Fixpoint test2 p :=
match p with
| (_, Nil) => 0
| (_, Cons l) =>
test l
end.

Do you have any idea why ? Is there a common workaround (other than using the other formulation above, that would lead to a lot of code duplication in my case) ?

Thanks,
--
Jacques-Henri Jourdan



Archive powered by MHonArc 2.6.18.

Top of Page