Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] strange behaviour while defining inductive types.

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] strange behaviour while defining inductive types.


chronological Thread 
  • From: Hugo Herbelin <Hugo.Herbelin AT inria.fr>
  • To: AUGER Cedric <Cedric.Auger AT lri.fr>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] strange behaviour while defining inductive types.
  • Date: Thu, 26 May 2011 17:47:26 +0200

Hi Cedric,

> Hi all, I don't understand why the first definition is accepted and not
> the second one.
> 
> Inductive bool_comp (b: bool): bool -> Prop :=
> | Opp: forall q, (if b
>                  then match q with true => False | false => True end
>                  else match q with true => True | false => False end)
>                  -> bool_comp b q.
> 
> Print bool_comp.
> Inductive bool_comp2 (b: bool): bool -> Prop :=
> | Opp2: forall q, (match b return Prop with
>                  | true => match q return Prop with true => False |
> false => True end | false => match q return Prop with true => True |
> false => False end end) -> bool_comp2 b q.

It is a bug ("match" used the matched variable name as internal binder
name in the internal form of the return clause what was not treated by
the test protected against binding hidden implicit arguments of
inductive types as "b" is here).

This can be bypassed by using "match b as b' return ..." instead.

Hugo



Archive powered by MhonArc 2.6.16.

Top of Page