coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Nicolas Osborne <nicolas.osborne.etu AT univ-lille.fr>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Use a map in an inductive type
- Date: Wed, 10 Apr 2019 11:23:59 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=nicolas.osborne.etu AT univ-lille.fr; spf=Pass smtp.mailfrom=nicolas.osborne.etu AT univ-lille.fr; spf=None smtp.helo=postmaster AT mx1.univ-lille.fr
- Ironport-phdr: 9a23:4oXbhxatWtoP4JQFfU5wqNP/LSx+4OfEezUN459isYplN5qZr8y4bnLW6fgltlLVR4KTs6sC17OP9fm/EjVbqdbZ6TZeKcQKD0dEwewt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEtfre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZ/Jqor1xfEoHREd/lYyGh1IV6fgwvw6t2/8ZJ+7yhcoe4t+9JFXa7nY6k2ULtUASg8PWso/sPrrx7DTQWO5nsYTGoblwdDDhbG4h/nQJr/qzP2ueVh1iaUO832Vq00Vi+576h3Uh/oiTwIOCA//WrKl8F/lqNboBampxxi347ZZZyeOfRicq/Be94RWGxMVdtTWSNcGIOxd4sBAPYOMuhFrIfzqUUAoxylCAa2GO/vzyVFhn/q0aA41ekqDAHI3BYnH9ILqHnatNT1O7sVUeCx1qbI1ijIYepN2Tjm74jIaBYhru+RVr93d8rRyFUgFwTBjlqKsozpJTSV1v8WvGic9epgU/ygh3Q5pAFtvzii3dosio/IhoIL01zE8SR5wIIxJdKmUkJ7b8SkHYJWuiqHNIV2WtsvT3xstSs10LEKp562cScQxJg62RLSb+aLfoaG7x/lSe2fOy13hGh/d7K6nxuy8Vavyun7VsSs1VZLoTdJnsPRtnAL1hzT9NGLSv98/kel3TaAyRrf6u9eIUwslKrbLYAuwqIom5YOtUnOETX6lFv2gaKZbEko5/ak5uD9brjoqJKQL4p0hRv/MqQqlMy/G+M4Mg0WUmid+OSzyLrj/UnjT7VRlPE2lbLZv4vdJcQBoK62HRVZ3Zg/6xaiFDqmzdIYnXgZLF5cfBKHjozpO1XQL/ziA/e/mUygkC13yPDeIr3hHpLNI2Dfn7fmZLZx8lJTyA4uzd9E/J9UEbEAIPfrWkDrrtDYDxk5Mxa1w+n9Etl92JkeCiqzBfqSN7qXuluV7MouJfONbckbomXTMf8gstjvhng9kERVWrKj2oERZTjsGPVtJEGQejzrmd0GC2EH+AciUcT3jlycFDpSY3K/GawmsGJoQLm6BJvOE9j+yIeK2z22S8UPOzJ2T2uUGHKtTL2qHvcBbCXLc51kgmVCSL6gVcol1BWquUn00eg/d7aGymgjrZvmkeNNyajLjxhrqG5pCcWDlmWMS2V52G0SFWdvjfJP5Hdlw1LG6pBWxvlRFNhd/fRMC1poKJjd0al+CtT2V0TPZIXQRQ==
Dear Coq-Club,
I need to define a rose tree with a map instead of a list. As I don’t have any reason to care about efficiency in this context, I use FMapWeakList from the Standard Library and declare the following:
Require Import Coq.Structures.DecidableTypeEx.Require Import Coq.FSets.FMapWeakList.Variable T:Type.Module M := FMapWeakList.Make(Nat_as_DT).Inductive tree: Type := mkTree: T -> M.t tree -> tree.
Then, Coq greets me with the following error message:
Error: Non strictly positive occurrence of "tree" in "nat -> M.t tree -> tree".
As I understand it, this means that "tree" occurs at the left of an arrow in one of the argument of the constructor (namely "M.t tree"), which is forbidden for consistency reasons.
Is there any way around ?
My first guess would be to use a list of products in the tree:
Inductive tree’: Type := mkTree’: T -> list (nat * tree’) -> tree’.
and then make sure that this list behaves like a map when writing the functions handling the modifications of the tree.
But if there is a way to use directly a map in the tree, that would be a relief.
Thanks,
Nicolas Osborne
- [Coq-Club] Use a map in an inductive type, Nicolas Osborne, 04/10/2019
- Re: [Coq-Club] Use a map in an inductive type, Sylvain Boulmé, 04/10/2019
- Re: [Coq-Club] Use a map in an inductive type, Nicolas Osborne, 04/11/2019
- Re: [Coq-Club] Use a map in an inductive type, Sylvain Boulmé, 04/10/2019
Archive powered by MHonArc 2.6.18.