coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Abhishek Anand <abhishek.anand.iitg AT gmail.com>
- To: coq-club <coq-club AT inria.fr>
- Subject: [Coq-Club] nested inductive termination check
- Date: Mon, 26 Oct 2020 16:19:00 -0700
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abhishek.anand.iitg AT gmail.com; spf=Pass smtp.mailfrom=abhishek.anand.iitg AT gmail.com; spf=None smtp.helo=postmaster AT mail-il1-f175.google.com
- Ironport-phdr: 9a23:ZMcZuxaXOY4andvhcGFBxQT/LSx+4OfEezUN459isYplN5qZr8W+bnLW6fgltlLVR4KTs6sC17OJ9fCwEjRcqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5wIRmsrgjctcYajZdtJ60s1hbHv3xEdvhMy2h1P1yThRH85smx/J5n7Stdvu8q+tBDX6vnYak2VKRUAzs6PW874s3rrgTDQhCU5nQASGUWkwFHDBbD4RrnQ5r+qCr6tu562CmHIc37SK0/VDq+46t3ThLjlSEKPCM7/m7KkMx9lK1UrhKvqRJ83oDafp2aOeFkca/BZ94XX3ZNUtpTWiFHH4iyb5EPD+0EPetAs4TyvFsOrRqlBQmsGuzvySJDi2Pw3aIg1eQuDBzN0Qs6EN0VsHTUrc71NKcMXuC21qXH1zPDYOlQ2Tjg8oTIcxEhoe2DXb9rfsrRzFMgFwLBjlmKtYPlODaV2/0LvmOG4OVuSfihhHQ7qwFtvDev3MEsh5HXi4wV1F3J6Cp0zokoKNGmRkN3f92pHYdeui+aKYd7TccvTmN1tCs417ALuZ61cSoJxZkl2xLTdeKLfouL7x/tUuuaPDl2hHVgeL2lhhay91CtxfH7Vsmu1lZFsC5Fkt3Wun8TyhPT986KQeZ+8Ee5wTuDyRzf5+VeLU03lafXMYMtz78xm5YJrEjOHC/7lUPrh6GMbEok4PKn6+H/b7XmuJCcM4h0hxn7Mqs0m8y/Bf00MgkKX2SG4Oi82qDv8E/5TblQgf02la7ZsJ/eJcsFvKK2HwhV0oM75xa+CTepzsgYkGEZIF5ZfB+LlYvkNlHULPzlDPqygk6gnCppyv3GJrHhB4/CLnnHkLfvZ7Z97EtcxRIpwt9E55JUC6oBIPLtVU/yrtDXFBk5PBayw+n6Etl914IeWX6AAqKCP6PStEWH5uMrI+WWeIAVvzP9J+A/5/HylX85hUMdfa6x0JQLb3C4B+1qLFmdYXrxmdgMCnwKvwo7TOzyklKOSz9TZ3CoX6I9/D43EoymDZ2QDryq1beGxWKwGoBcLjRNDUnJGnP1fa2FXe0NYWScOJkyvCYDUO2IQY8gzhGjt0fTzbNhIqKA8ycYtInj2dsz7uvakx109D1oAOyS1miMSyd/mWZeFGx+57x2vUEokgTL6qN/mfENTYUOtcMMaR8zMNvn98I/C932XVifLNKASVLjQ9H/RD9oEY93zNgJbEJwXd6li0Kbhnb4M/ouj7WOQacM3OfExXGofpRyzn/H0O8qiFx0GpIeZ13jvbZ28k3oP6CMlkyYk6iwcqFFhXzC8W6CySyFu0QKCQM=
It is surprising to me that in the fixpoint below, Coq cannot figure out that `children` is
a subterm of nodes. Theoretically, it seems that as long as a term is produced by peeling off one or more constructors (and doing nothing else), it should be considered a subterm. Are there some soundness or practicality issues in supporting such fixpoints?
Meanwhile, is there a way to write the fixpoint below without complicating the definition too much?
Require Import Coq.Lists.List.
Import ListNotations.
Inductive tree :=
| node (data: bool) (children: list tree).
Fixpoint nodesWithCont (nodes: list tree): list (tree* list tree) :=
match nodes with
| [] => []
| (node d children)::tl => [(node d children, tl)] ++ (nodesWithCont children)++
nodesWithCont tl
end.
Import ListNotations.
Inductive tree :=
| node (data: bool) (children: list tree).
Fixpoint nodesWithCont (nodes: list tree): list (tree* list tree) :=
match nodes with
| [] => []
| (node d children)::tl => [(node d children, tl)] ++ (nodesWithCont children)++
nodesWithCont tl
end.
Error: Recursive call to nodesWithCont has principal argument equal to "children" instead of
"tl".Thanks,
-- Abhishek
http://www.cs.cornell.edu/~aa755/- [Coq-Club] nested inductive termination check, Abhishek Anand, 10/27/2020
- Re: [Coq-Club] nested inductive termination check, Jason Gross, 10/27/2020
- Re: [Coq-Club] nested inductive termination check, Jason Gross, 10/27/2020
- Re: [Coq-Club] nested inductive termination check, Jason Gross, 10/27/2020
Archive powered by MHonArc 2.6.19+.