coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "William J. Bowman" <wjb AT williamjbowman.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Strict positivity description in CIC spec
- Date: Tue, 13 Aug 2019 10:37:36 -0700
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=wjb AT williamjbowman.com; spf=None smtp.mailfrom=wjb AT williamjbowman.com; spf=None smtp.helo=postmaster AT williamjbowman.com
- Ironport-phdr: 9a23:R71nRRIV9Ebhyv8F69mcpTZWNBhigK39O0sv0rFitYgRI/XxwZ3uMQTl6Ol3ixeRBMOHsqgC0rCI+Pm5ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oRvQu8UZnIduN7o9wQbVr3VVfOhb2XlmLk+JkRbm4cew8p9j8yBOtP8k6sVNT6b0cbkmQLJBFDgpPHw768PttRnYUAuA/WAcXXkMkhpJGAfK8hf3VYrsvyTgt+p93C6aPdDqTb0xRD+v4btnRAPuhSwaMTMy7WPZhdFqjK9DrhyvpwJxzZPXboGbO/VxYr7SctEUSmdaQsZdSzZMDp+gY4YVEeYMO/tToYnnp1sJqBuzHQegC+Puyj9Mgn/23Lc10+E8Gg/CxgArAs8DsHPardXwLqgSV+65x7TPwDTNbfNZwizw6YbJchAlpfGMXKh/cc/TyUY0EAPEgFCQppbjPz+PyusNtG2b4vNmWOmyhWAnrARxrSKuxscqkoTJh4QVykrF9Spj2oo1K8e4RUhmatCnCJtdrzyWOo9oTs84Xm1luCY3xqcFtJO4ZiQG1Ykryh/HZ/Cad4WF4QjvWPuQLDtmnn5oeLKyiwyx/EWgzOD3S9O630xQriVfl9nBrnAN2ALX6siAUvZ88Eah2TKL1wDS8O5EJEI0mrHcK58vx74/jJwTvV7fES/xnUX6lK6WdkM69ei08+nrf7HrqoGGO4NpigzzMr4il8+8DOgiLwQCQmmW9fy51LL5/E35RLtKjucxkqncqJ3bK8YbqbWiDg5b04Yj7xK/Dza839Qdn3kIN1VFeRyCj4fzPVHCOuz3DfC6g1i0ijdk2+jGPqH9ApXKNnXMjLDhfa9k50FAzAoz0MtQ6olPCrABJfLzQlX+uMbZDh8/KQy0wvzoBM9z1oMECiqzBfqSN7qXuluV7MouJfONbckbomXTMf8gsrTRjHs9mFYYNYvvlbEQd3WxGL4ud1qba1Lzg9MFEG4PvAA5U+njjhuJVjsFNCX6ZL41+jxuUNHuNozEXI342OXcjhf+JYVfYyV9Mn7JEXrscN/cCegNbCaTK8pjmDsbULGnDYQm0EP27V6o+/9cNuPRvxYgm9fm3dlx6ffUkEtqpyN1C8Cc2mSPRWZrm2oOATQx2fIn+BAv+hK4yaF9xsdgO5lL/foTClUlNJrYzuV/Cdr1RQfIeJGCT1P0Gtg=
This is a understandable enough solution, and thanks for the pointer to CPDT;
I'll take a look.
Thanks!
--
William J. Bowman
On Wed, Aug 07, 2019 at 12:02:12PM -0400, Hans Jacob Fehrmann Rojas wrote:
> Hi William,
>
> I'm not an expert but a very sutil interpretation of the rules seems that
> the nested positive condition should be applied only considering the arity
> of the inductives without the parameters as if the `List (Rose A)` would be
> a new inductive.
>
> So for your example:
>
> Inductive Rose (A : Set) : Set :=
> | rose : (List (Rose A)) -> Rose A.
>
> Should check the positivity condition with respect to (assuming is a valid
> declaration)
>
> Inductive ListRose : Set :=
> | nil : ListRose
> | cons : Rose A -> ListRose -> ListRose.
>
> This is the argument in Certified Programming with Dependent Types (3.8
> Nested Inductive Types)
>
> Also, it seems that the check of the positive condition for an inductive
> definition is done in coq sources in checker/indtype.ml, specifically the
> function `check_positivity` and it seems that the parameters are not taking
> in consideration when checking the positivity condition, so the arguments
> of Chlipala seems right
>
> Hope these helps
>
> Best,
> Hans.
>
> On Tue, Aug 6, 2019 at 11:00 PM William J. Bowman
> <wjb AT williamjbowman.com>
> wrote:
>
> > I just finished implementing the CIC positivity checker as specified in
> > the Coq
> > docs, but the docs seem under specified about how the strict positivity
> > algorithm should work.
> >
> > https://coq.inria.fr/doc/language/cic.html#positivity-condition
> >
> > If I try to implement the rules as specified, I get stuck in an infinite
> > loop
> > when checking nested inductive types.
> >
> > Consider rose trees:
> >
> > Inductive List (A : Set) : Set :=
> > | nil : List A
> > | cons : A -> List A -> List A.
> >
> > Inductive Rose (A : Set) : Set :=
> > | rose : (List (Rose A)) -> Rose A.
> >
> > I must show `Rose` occurs strictly positively in `(List (Rose A))`, from
> > the
> > type of the constructor `rose`.
> >
> > Loop:
> > To show that `Rose` occurs strictly positively in `List (Rose A)`,
> > since `List (Rose A)` is of the form `(I p_0 ... p_m u ...)` and `List` is
> > not
> > mutually inductive, we must show the nested positivity condition for each
> > constructor of `List` after instantiating the types of the constructors
> > with the
> > parameter `(Rose A)`.
> >
> > There are two cases:
> > - nil : `(List (Rose A))` satisfies nested positivity w.r.t. `Rose`
> > trivially.
> >
> > - cons : `Rose A -> List (Rose A) -> List (Rose A)`
> > To show this satisfies nested positivity w.r.t. `Rose`, we must show that
> > `Rose`
> > occurs strictly positively in `List (Rose A)`.
> > goto Loop
> >
> >
> > For now, I've "fixed" this by allowing myself to assume strict positivity
> > holds
> > for `List (Rose A)` while checking nested positivity.
> > This seems okay, in a vague, intuitive, "something something greatest
> > fixpoints?" kind of way, but I'd like to be a little more formal than
> > that.
> >
> > Does anyone know what's missing from the Coq docs or what reference I
> > should
> > look at?
> >
> > I usually start from the Coq docs as they have the most readable and
> > complete
> > CIC spec in one place.
> > I tried reading the Coq kernel code but.. failed.
> > I also tried Paulin-Mohring's "Inductive Definitions in the system Coq
> > Rules and
> > Properties", but can't find anything about nested inductive types.
> >
> > --
> > William J. Bowman
> >
- [Coq-Club] Strict positivity description in CIC spec, William J. Bowman, 08/07/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, roux cody, 08/07/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Hans Jacob Fehrmann Rojas, 08/07/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, William J. Bowman, 08/13/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Valentin Robert, 08/13/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Stefan Monnier, 08/26/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Gaëtan Gilbert, 08/26/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Stefan Monnier, 08/26/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, Gaëtan Gilbert, 08/26/2019
- Re: [Coq-Club] Strict positivity description in CIC spec, William J. Bowman, 08/13/2019
Archive powered by MHonArc 2.6.18.