Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Error: "Only structural decreasing is supported for a non-Program Fixpoint"

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Error: "Only structural decreasing is supported for a non-Program Fixpoint"


Chronological Thread 
  • From: Christian Doczkal <christian.doczkal AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Error: "Only structural decreasing is supported for a non-Program Fixpoint"
  • Date: Fri, 12 Jul 2019 00:08:11 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=christian.doczkal AT ens-lyon.fr; spf=Pass smtp.mailfrom=christian.doczkal AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Autocrypt: addr=christian.doczkal AT ens-lyon.fr; prefer-encrypt=mutual; keydata= mQINBFIuNbYBEADAiZlQsnkRrXHOkaZ2mZIVNxzcBha3+HhZ8IhtxF4t5QXRNWFLtdwBuE8u D0GMB/Lacm/LujwcI756cPM/7PhrUFAyn1IrYHYsK4/O5gBEgbSBRjD0X8mJ0V3oIm/PtjMC YiXBJwzOMNXOeWp+HcyCR0eh2sQD94gbF9SUOKDoamNB3DbLEHKjYPJ9O3zQw/Xai624OXB0 Wk5yIW77I1mGWhwbWxeHOJ/NmhHEU38YfbxXSzCLeMv98bNTej4oA+cPtMZ94AZOSy/oroMh rsr6wA9PL7NS+B1kRbgv6a5KL9latAI7zPeXcVsYw076rL850PLez/SXDuIr9mud4v8Zvcp9 65vTK4lTAD4C4vneNRGt4iwCOIgGsAN6BgqEgr7EwLX8dAX57OXPKZj0/0TdCbu+qsoSrQ3u +Ul6k374jFeIndqg/e9NiJbHjYAuug3cZZ6mH24SXWtTd4hGWi6f26tQQcRyGiduZkw5Wn26 g0UVgps7o2zHwlp9LJVjL3pCw7a9tKOfZaH+h7dV5JsA/Oq+7F3PhTbyNagi4A9igw+0qU+n Ws/nZDVMRiUv+1HY4PG8q6iEGSfHHjwW8In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poSsUPDHinslEX4lq+abkQk+u625OT7erjqu5CRO5Nuhgz8MKkigNGzDOU6PwQUQWSX5/qw2KXm/ULjQbVKivM2krPesJDfPckUuq65AxVU0oY49xa/Di2p0NICkXYaK1JKZBOGj4vzNFHKO/33E/G/g0+1nDdvx/HGObvhDo/DLnjZiLvhZ6py61ZAyAovytBS/45bCrYYIP7qRkDxsMHYAQQiPgyvw+fnDc192ZkEVWKOBK+ZKqLSvkWS6uIhOenfLLMS7T36Mr0u4+PkpX4/g14UO6ezjrUNb3XtNfR8Il6FYHPqyvsGGnUJtw52GOfqklyZTT9aYTC+WKku5Tg/II+gFsLHV4erxrKbinToVqZKb3xLXwjfWUzjcJ+JDq9VNHCiZ/R5mzlBboCPDpc73Ej15gL80P9jP+3SvCMC58q6iYpFotbLnBR3zgRaSsSQ12bUHjNwl2kCSnk72rs6pV16zBGNy/og2q0KJZlo//pMFzwCG9vZxu1+Bcr1X1uaLNqPUxOiU9KgRz8rHIs8
  • Openpgp: preference=signencrypt

Hi,

The "non-Program Fixpoint" refers the to distinction between the normal
"Fixpoint" command (which is mostly a nice syntactic wrapper around the "fix"
construct in the term language of Coq) and the "Program Fixpoint" command,
which is quite different and described here:

https://coq.inria.fr/refman/addendum/program.html?highlight=program%20fixpoint#program-fixpoint

In particular, "Fixpoint" only handles structural recursion, i.e., recursive
calls only on proper subterms of the decreasing argument.

Unless I'm missing something, in your example the termination of F depends on
F being non-increasing with respect to some measure also satisfying [measure
P < measure cons n P]. The second condition is required for the inner call,
and the first for the subsequent outer call. If you can define such a
measure, maybe you can use Program Fixpoint or the Equations plugin to define
your functions. I'm not sure how well they handle nested recursion though.

Best,
Christian

On 7/11/19 11:46 PM, Morgan Sinclaire wrote:
> Summary: I've received the error message "Only structural decreasing is
> supported for a non-Program Fixpoint", I have little clue what it means,
> and googling this message turned up no actual results. In particular I
> don't get what it means exactly by "structural decreasing" and
> "non-Program".
>
> ~~~
>
> I have defined a Type called "ptree", which is an infinitary tree with a
> certain complicated structure, and I'm defining a function (which I'll just
> call F) that takes in a (P : ptree) as well as some simpler inputs, and
> returns a ptree. Abstracting away some other details, the definitions look
> roughly like this:
>
> Inductive ptree : Type :=
> | node : nat -> ptree
> | cons : nat -> ptree -> ptree
> [...]
> .
>
>  
>
> Fixpoint F (P : ptree) [...] : ptree :=
> match P with
> | node n => P
> | cons n P' => cons n (F (F P'))
> [...]
> end.
>
>
> Now, when I define F like this, I get the familiar "Cannot guess decreasing
> argument of fix" because of the double application of F. If I change "F (F
> P')" to "F P'" then the issue goes away, so on some level Coq recognizes
> that P gets simpler at each stage. However, when I try to tell Coq this by
> changing the first line to:
>
> Fixpoint F (P : ptree) [...] {measure P} : ptree :=
>
>
> Then I instead get the error message:
>
> Only structural decreasing is supported for a non-Program Fixpoint
>
>
> And I don't understand what this means, or how to tell Coq to recognize
> that P is simplifying, just like in the case where we have the single
> application F P' instead.
>
> (I believe I know of a way to avoid this double application of F in my
> situation, but that workaround is tedious, and besides I'm quite interested
> in understanding what's going on here).


Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.18.

Top of Page