Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Type Casting

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Type Casting


Chronological Thread 
  • From: Randy Pollack <rpollack AT inf.ed.ac.uk>
  • To: Coq-Club Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Type Casting
  • Date: Tue, 28 Apr 2015 12:46:04 +0100

I am unclear about Coq's type casting.

Consider

Check (cons: forall (A:Set), A -> list A -> list A).
(fun A : Set => cons (A:=A)):forall A : Set, A -> list A -> list A
: forall A : Set, A -> list A -> list A

It looks like the cast [ (cons: forall (A:Set), A -> list A -> list A).] is
a meta-notation for the eta-expansion. Then why is the cast still in the
term?

Now consider

Goal (cons: forall (A:Set), A -> list A -> list A) =
(cons: forall (A:Set), A -> list A -> list A).
cbv beta.

Goal is:

(fun A : Set => cons (A:=A)) = (fun A : Set => cons (A:=A))

The cast was removed even though no beta steps were taken. What is
the official story about when casts are removed in Coq?

Finally consider

Goal (cons: forall (A:Set), A -> list A -> list A) = cons.

The Goal is

((fun A : Set => cons (A:=A)):forall A : Set, A -> list A -> list A) =
(fun A : Set => cons (A:=A))

Why was the RHS eta expanded in this way? This is not the goal I
entered; this goal is true (solved by reflexivity), but the tactic

constr_eq (cons: forall (A:Set), A -> list A -> list A) cons.

fails.

Best,
Randy
--



Archive powered by MHonArc 2.6.18.

Top of Page