Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] is matching bool slower than sum?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] is matching bool slower than sum?


chronological Thread 
  • From: Thomas Braibant <thomas.braibant AT gmail.com>
  • To: Jianzhou Zhao <jianzhou AT seas.upenn.edu>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] is matching bool slower than sum?
  • Date: Mon, 19 Jul 2010 10:23:40 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=vVbOOXOIhpCRXfOyl0yIZbf9aqD1geeNmn2J49MIDpTEcWEWdRQGqYtY0el8vLLum7 zfL1Yg8zPjvkPvFrJG8kls/5gK1kgvhgKNoqYXupr9UxiSoZOw3ui8E1AY2du3oEYVSs csMujW2gJDZMDpNHjK86spLB4QTJtEfbasYtA=

Hi,

I tried your exemple, but I had to add some context to fil the holes
(variables for insn, insnEq, and so). Using my version of Coq,
everything works fine. (Version 8.3 r 13244)

Could you check your version of Coq and report this version ? BTW, I
assumed that by 'compile' you meant type-check (making the blue line
going on your definition in CoqIDE), if it is not the case please let
me know.

thomas



On Sun, Jul 18, 2010 at 6:57 PM, Jianzhou Zhao 
<jianzhou AT seas.upenn.edu>
 wrote:
>
> Fixpoint InInsns (i:insn) (li:list insn) {struct li} : bool :=
> match li with
> | nil => false
> | i' :: li' => insnEq i i' || InInsns i li'
> end.
>
> Definition block := list insn.
>
> Fixpoint foo(i:insn) (lb:list block) {struct lb} : option block :=
> match lb with
> | nil => None
> | b::lb' =>
>  match (InInsns i b) with
>  | true => Some b
>  | false => foo i lb'
>  end
> end.
>
> The compilation of foo is very slow, it takes around 2-3 mins. But, if
> I proved this decidability lemma first,
>
> Lemma InInsns_dec : forall i b,
>  {InInsns i b = true} + {InInsns  i b = false}.
> Proof.
>  intros. destruct (InInsns i b); auto.
> Qed.
>
> and then let foo match InInsns_dec,
>
> Fixpoint foo2(i:insn) (lb:list block)) {struct lb} : option block :=
> match lb with
> | nil => None
> | b::lb' =>
>  match (InInsns_dec i b) with
>  | left => Some b
>  | right => foo2 i lb'
>  end
> end.




Archive powered by MhonArc 2.6.16.

Top of Page