coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- 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
- [Coq-Club] Software foundation ( Palindrome List ), mukesh tiwari, 10/31/2014
- Re: [Coq-Club] Software foundation ( Palindrome List ), Jakob Vidmar, 10/31/2014
- Re: [Coq-Club] Software foundation ( Palindrome List ), mukesh tiwari, 10/31/2014
- Re: [Coq-Club] Software foundation ( Palindrome List ), Laurent Théry, 10/31/2014
- Re: [Coq-Club] Software foundation ( Palindrome List ), mukesh tiwari, 10/31/2014
- Re: [Coq-Club] Software foundation ( Palindrome List ), Jakob Vidmar, 10/31/2014
Archive powered by MHonArc 2.6.18.