Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Software foundation ( Palindrome List )

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Software foundation ( Palindrome List )


Chronological Thread 
  • From: Laurent Théry <Laurent.Thery AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Software foundation ( Palindrome List )
  • Date: Fri, 31 Oct 2014 12:49:36 +0100


> Inductive data type for palindrome.
>
> Inductive pal { X : Type } : list X -> Prop :=
> | emptyC : pal nil
> | consC : forall ( a : X ) ( l : list X ) , pal l -> pal ( a :: l ++ [a]).
>

With this definition you capture only palindromes with a length that is even
>
> Theorem reverseonlist : forall { X : Type } ( l : list X ), pal ( l >
> ++ rev
> l).> Proof.
> intros X l. induction l as [ | v' l'].
> simpl. apply emptyC.
> simpl.


With assert you can see that both term does not match there is an
associativity problem

Try

rewrite app_assoc.


--
Laurent




Archive powered by MHonArc 2.6.18.

Top of Page