Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Hints needed for two SF exercises

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Hints needed for two SF exercises


Chronological Thread 
  • From: "John Wiegley" <johnw AT newartisans.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Hints needed for two SF exercises
  • Date: Wed, 20 Aug 2014 15:55:32 -0500
  • Organization: New Artisans LLC

>>>>> Soegtrop, Michael
>>>>> <michael.soegtrop AT intel.com>
>>>>> writes:

> Fixpoint rev_pal' X (l : list X) (h : l = rev l) : pal X l.
> Proof.
> ...
> Use rev_pal' in the proof
> ...
> Qed.

> It is still quite tricky, though. To convince Coq that this terminates, I
> had to add the list length as parameter.

Using Function instead of Fixpoint, you should be able to supply a "measure"
to prove termination, for example:

Function rev_pal' X (l : list X) (h : l = rev l) {measure length l} : pal X
l.

Thanks for all the hints, I now have several interesting avenues to pursue!

John



Archive powered by MHonArc 2.6.18.

Top of Page