Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Ascii module

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Ascii module


chronological Thread 
  • From: Brandon Moore <brandon_m_moore AT yahoo.com>
  • To: St�phane Lescuyer <stephane.lescuyer AT inria.fr>, AUGER Cedric <Cedric.Auger AT lri.fr>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Ascii module
  • Date: Wed, 2 Mar 2011 14:55:15 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5POuWcnLyvM22eGUUaIf2Dx4UfcYqw5vep+w+Oh1+lsixy15S9g28uF2HgqTopzEXGrZaixpmOgm1s8y0N68YWJT57ph56Mm/KPIkYy4M0/p/B0aIyqc44l2l8PGJEjnbW+WeXbfpeJrmRIXL3oe8rtyvnHz751gnfbKXgV2ay4=;



> From: Stéphane Lescuyer 
> <stephane.lescuyer AT inria.fr>

> 
> ...
> 
> The other thing I would be worried about is '_' patterns,  where
> writing something like:
> 
> match c1, c2 with
> | TAB, CR =>  true
> | _, _ => false
> end
> 
> would look harmless while actually  expanding to a 256*256 matching tree.

A minor point, but I think that expands to a 256+256 matching tree.
I would expect all but the TAB branch of the outer match to not
decompose the second argument. It seems that's how it actually
works, at least with a smaller example. Perhaps something with dependent
types might see the pathological case.

Example:

Inductive foo : Set := A | B | C | D | E .

Definition bar : foo -> foo -> bool := fun x y =>
  match x, y with
  | A, B => true
  | _, _ => false
  end.

Print bar.

produces

bar = 
fun x y : foo =>
match x with
| A =>
    match y with
    | A => false
    | B => true
    | C => false
    | D => false
    | E => false
    end
| B => false
| C => false
| D => false
| E => false
end
     : foo -> foo -> bool



      




Archive powered by MhonArc 2.6.16.

Top of Page