Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Redundant clause

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Redundant clause


chronological Thread 
  • From: Adam Chlipala <adamc AT cs.berkeley.edu>
  • To: Marko Malikovi� <marko AT ffri.hr>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Redundant clause
  • Date: Sat, 20 Oct 2007 17:10:08 -0400
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Marko Malikoviæ wrote:
Coq < Definition funkcija (x y : nat) : Prop :=
Coq <   match x<y with
Coq <       True => z=5
Coq <     | _    => z=10
Coq <   end.
Warning: pattern True is understood as a pattern variable
Toplevel input, characters 84-96

The warning is very helpful in this case. [True] is interpreted as a pattern variable, just like you had typed, e.g., [x] instead. [True] is a type, not a constructor, so it isn't treated like, e.g., [true], which is a constructor of [bool]. You probably meant to use [bool] to start with and just miscapitalized the identifier, but [true] would also be a bug. [x < y] is a logical proposition, not a value of an inductive type, so you will never be able to pattern match over it effectively in Gallina. If you could figure out how to get Coq to decide the truth of arbitrary propositions like this, then you'd have solved the halting problem and more! :-)





Archive powered by MhonArc 2.6.16.

Top of Page