coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: David Monniaux <David.Monniaux AT imag.fr>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] positivity check
- Date: Fri, 27 Sep 2013 10:03:11 +0200
- Mailscanner-null-check: 1380875320.22707@GCARl/Vy8lKq8to2iDDI4w
- Organization: CNRS / VERIMAG
It is well-known that a function nat -> X can be also seen as an
infinite sequence, that is, the element of a coinductive type
Variable X : Type.
CoInductive infinite_seq :=
| Step : X -> infinite_seq -> infinite_seq.
The idea is as follows: since nat ~ (unit + nat), then (nat -> X) ~ (X *
(nat -> X)).
Now if we model nat -> X by infinite_seq X, this yields
(infinite_seq X) ~ X * infinite_seq
Let us now try to generalize this to binary constructors, like with a
datatype Bin with A as leaf and C as binary constructor.
Bin ~ (unit + Bin*Bin), then (Bin -> X) ~ (unit * ((Bin*Bin)->X)) ~
(unit * (Bin->(Bin->X))) by currying.
This yields
(foo X) ~ X * (foo (foo X))
Thus the declaration:
CoInductive foo (X : Type) :=
| Moo : X -> (foo (foo X)) -> foo X.
But then I get:
Error: Non strictly positive occurrence of "foo" in
"X -> foo (foo X) -> foo X".
Isn't this check a bit too strict? My remembrances on the positivity
check in (co)inductive datatypes is hazy, but I don't see how this
construction could create inconsistencies.
-- David Monniaux Directeur de recherche au CNRS, laboratoire VERIMAG
http://www-verimag.imag.fr/~monniaux/
- [Coq-Club] positivity check, David Monniaux, 09/27/2013
- Re: [Coq-Club] positivity check, Pierre-Marie Pédrot, 09/27/2013
Archive powered by MHonArc 2.6.18.