Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Is Coq SN ?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Is Coq SN ?


Chronological Thread 
  • From: Abhishek Anand <abhishek.anand.iitg AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Is Coq SN ?
  • Date: Sun, 28 Feb 2016 13:43:45 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abhishek.anand.iitg AT gmail.com; spf=Pass smtp.mailfrom=abhishek.anand.iitg AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f173.google.com
  • Ironport-phdr: 9a23:+dFubRKhFCtdhY2gqNmcpTZWNBhigK39O0sv0rFitYgULPzxwZ3uMQTl6Ol3ixeRBMOAu60C1bSd6vm8EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxib75osSPKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxeL19RrhFBnxyOGcsocbvqBPrTA2V53JaXH9AwTRSBA2QxRv6X4zxvyiyn+x03iXSacT8TbEvWTmhqa5tQRnkziYGKzER/2Tei8g2h6Ve9kHy7ydjypLZNdnGfMF1ebnQKIsX


However, Coq's implementation (if no bugs) should be weakly normalizing,
which is usually enough for consistency.

I thought that for consistency we also need type preservation (along with strong/weak normalization). 
Coq seems to not have type preservation, as shown in the last 2 slides (25 and 26) of 

I just reproduced the above described problem using Coq 8.5:

Set Implicit Arguments.


CoInductive Inf :=
S : Inf -> Inf.

CoFixpoint infinity : Inf :=S ( infinity).


(** This innocuous looking function 
    actually causes an unfolding of cofix *)
Definition unfold (x : Inf) : Inf :=
match x with
| S y => S y
end.


Definition unfoldEq (x:Inf) : x = unfold x.
Proof.
  intros.
  destruct x as [x'].
  simpl. exact eq_refl.
Defined.


(** We make a dummy goal to use the "type of" function *)

Goal False.

(** [unfoldEq infinity] is of type [infinity = S infinity] *)

match type of (unfoldEq infinity) with
| ?T => let T' := eval simpl in T in idtac T "," T'
end.

(**
    when we compute on [eqq infinity] as shown above, we
    get [eq_refl] which cannot be of the type
    [infinity = S infinity] because [S infinity] is not definitionally equal to [infinity]. *)

Eval compute in (unfoldEq infinity).

(** This is  a voilation of type preservation*)






Archive powered by MHonArc 2.6.18.

Top of Page