Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Prove inductive type implies false in cycle

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Prove inductive type implies false in cycle


chronological Thread 
  • From: Jean-Francois Monin <jean-francois.monin AT imag.fr>
  • To: S3 <scubed2 AT gmail.com>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Prove inductive type implies false in cycle
  • Date: Wed, 3 Aug 2011 16:37:20 +0800

On Tue, Aug 02, 2011 at 11:04:43PM -0700, S3 wrote:
> 
> To illustrate that it enforces the constraint:
> Inductive constant3 (a: nat): list nat -> Prop :=
> | Cnil3: constant3 a nil
> | Ccons3: forall l, constant3 a l -> constant3 (S a) (a::l).
> 
> Error: Last occurrence of "constant3" must have "a" as 1st argument in
>  "forall l : list nat, constant3 a l -> constant3 (S a) (a :: l)".

The parameter a should be used as is in all conclusions of
you constructors. I.e. you can write:

Inductive constant3 (a: nat): list nat -> Prop :=
| Cnil3: constant3 a nil
| Ccons3: forall l, constant3 (S a) l -> constant3 a (a::l).

But you probably want the following one:

Inductive constant3: nat -> list nat -> Prop :=
| Cnil3: forall a, constant3 a nil
| Ccons3: forall a l, constant3 a l -> constant3 (S a) (a::l).


Hope this helps
Jean-Francois



Archive powered by MhonArc 2.6.16.

Top of Page