Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Encoding a mixed recursive-corecursive function

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Encoding a mixed recursive-corecursive function


Chronological Thread 
  • From: Jannis Limperg <jannis AT limperg.de>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] Encoding a mixed recursive-corecursive function
  • Date: Sat, 19 Mar 2016 07:15:59 +0100 (CET)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jannis AT limperg.de; spf=None smtp.mailfrom=jannis AT limperg.de; spf=None smtp.helo=postmaster AT mail.limperg.de
  • Ironport-phdr: 9a23:vhySpRcMWVuSdg9S4L3ChA/jlGMj4u6mDksu8pMizoh2WeGdxc65YR7h7PlgxGXEQZ/co6odzbGG4+a4BidRsd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDivcWMKFQYzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEzSqUdBzA7OUg04tfqvF/NV1ih/HwZB0cflBxJGEDh7RTiU43++n/4v+x72TKyOczzVb0uVnKu4vE4G1fTlC4bOmthoynsgctqgfcDrQ==

Dear Coq-Club,

I'm having rather a lot of difficulty encoding a mixed
recursive-corecursive function which is not trivially productive, and
would be very grateful for any pointers to resources in that area.

More specifically, the function has approximately the following
structure when specified informally:

CoFixpoint f (a : A) (b : IN) : CIN :=
match b with
| IN_constr1 b' => f a b'
| IN_constr2 b1 b2 => gfp (fun a' => f (g a' b1) b2)
end.

where IN is an inductive type with constructors IN_constr{1,2}; CIN a
coinductive type; gfp the greatest fixed point combinator; g and A
should not matter for the question at hand (I think). Hence, the first
branch of f recurses on b while the second branch recurses and produces
a value by corecursion.

To complicate matters further, f is productive only if b satisfies a
certain predicate, say P.

I have already attempted an encoding using Arthur Charguéraud's
excellent TLC library, but struggle with (a) proving the COFE for CIN (a
kind of potentially-infinite binary tree) complete and (b) even then,
proving f productive wrt the COFE.

At this point, I don't care too much about staying constructive, and
elegance is very much a secondary goal.

Thank you for your time,
Jannis


Archive powered by MHonArc 2.6.18.

Top of Page