coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5.
Chronological Thread
- From: Frédéric Blanqui <frederic.blanqui AT inria.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5.
- Date: Tue, 24 Feb 2015 08:35:09 +0100
You can also use:
Set Implicit Arguments.
and remove the argument X:
Fixpoint length X (l:list X) :=
match l with
|nil => 0
|cons _ t => S (length t)
end.
Le 24/02/2015 07:31, Guillaume Melquiond a écrit :
On 24/02/2015 07:20, Sriram Srinivasan wrote:
Can someone explain why the following doesn't work in 8.5beta1?
Inductive list (X:Type) : Type :=
| nil : list X
| cons : X -> list X -> list X.
Fixpoint length (X:Type) (l:list X) : nat :=
match l with
|nil => 0
|cons h t => S (length X t)
end.
Error: The constructor nil (in type list) expects 1 argument.
Constructors and destructors are no longer separate in 8.5. Since the constructor nil takes an argument, the destructor nil also takes an argument. Since this argument is noninformative, it has to be "_".
Fixpoint length (X:Type) (l:list X) : nat :=
match l with
| nil _ => 0
| cons _ h t => S (length X t)
end.
You can recover the old behavior by using
Set Asymmetric Patterns.
Best regards,
Guillaume
- [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Sriram Srinivasan, 02/24/2015
- Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Jason Gross, 02/24/2015
- Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Sriram Srinivasan, 02/24/2015
- Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Guillaume Melquiond, 02/24/2015
- Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Frédéric Blanqui, 02/24/2015
- Re: [Coq-Club] Pierce Software Foundations. Runs fine in Coq 8.4, but error in 8.5., Jason Gross, 02/24/2015
Archive powered by MHonArc 2.6.18.