Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] type error - perhaps bug in coq?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] type error - perhaps bug in coq?


chronological Thread 
  • From: Virgile Prevosto <virgile.prevosto AT m4x.org>
  • To: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] type error - perhaps bug in coq?
  • Date: Wed, 13 Apr 2005 15:02:11 +0200
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hello,

Le 04/12/2005, à 02:40:02 PM, Dan Synek a écrit:
> Below is a simple definition of a function "test" which works. However
> 
> if the comment around
> the type specification is uncommented then coq outputs the error
> below.  Since this is the type that coq outputs anyway when asked
> using Check,  it is quiet confusing:

> Inductive Test:bool-> Set := ta:Test true | tb : Test false.
> 
> Definition test (c:bool)(t:Test c)  (* : if c then bool else nat*) :=
>    match t in Test b1 return (if b1 then bool else nat) with
>      ta => true
>    | tb => 1
>    end.

You can obtain a term accepted by Coq (version 8.0pl1) by naming your
return type:
-------------
Inductive Test:bool-> Set := ta:Test true | tb : Test false.

Definition foo:= fun (c:bool) => (if c then bool else nat).

Definition test : forall (c:bool) (t: Test c), foo c :=
fun c => fun t => 
  match t in Test c return foo c with
     ta => true
   | tb => 1
   end.
-------------
[Of course, test has now the type forall c : bool, Test c -> foo c]

I don't know why the expanded version triggers an error, but given that
this one is OK, it might well be a bug.
HTH, 
-- 
E tutto per oggi, a la prossima volta
Virgile




Archive powered by MhonArc 2.6.16.

Top of Page