Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Apply argument to fix-expression

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Apply argument to fix-expression


chronological Thread 
  • From: Andreas Lundblad <landreas AT kth.se>
  • To: coq-club AT pauillac.inria.fr
  • Subject: [Coq-Club] Apply argument to fix-expression
  • Date: Sat, 19 Sep 2009 14:13:16 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=hoH9QoTyYRYPXfG+EsXqNQFMiccu1g/VOZXLcm2cy+cazhE0sqS4xKj3DuiqxWsWgN upJJm1y2J6UqYzxoNswLN5LNL2TV4BgEpTv0OnLtXMGRhoffah1kxeT/hlybbpegX+td /iONiMfR2YMuBxW/+3MP7wk577KIWU/YslYrA=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi everybody,

I've run into a situation, similar to the situation below. Basically,
I would like to tell Coq to apply the argument l to the
fix-expression. The match-expression would then become

match nth 2 l 7 with ...

which could be rewritten using H and then simplified. What to do?

best regards
Andreas Lundblad


------ Coq Script: -----------------

Require Import List.

Theorem test :
  forall l,
    nth 2 l 7 = 0 ->
    0 = ((fix func (l0: list nat) :=
      match nth 2 l0 7 with
        | 0 => 0
        | _ => 1
      end) l).
Proof.
intros.


------ RESULTING STATE: ------------

1 subgoal

  l : list nat
  H : nth 2 l 7 = 0
  ============================
   0 =
   (fix func (l0 : list nat) : nat :=
      match nth 2 l0 7 with
      | 0 => 0
      | S _ => 1
      end) l

------------------------------------





Archive powered by MhonArc 2.6.16.

Top of Page