<div dir="ltr">Hi David,<div> I asked a <b>very</b> similar question in a <a href="https://github.com/agda/agda/issues/3842">recent issue</a> on the Agda Github. You might be interested in Andreas's reply.</div><div>Best,</div><div>Matthew</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2019 at 7:03 PM Andrew Pitts <<a href="mailto:andrew.pitts@cl.cam.ac.uk">andrew.pitts@cl.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> On 12 Jun 2019, at 10:09, <a href="mailto:david.janin@labri.fr" target="_blank">david.janin@labri.fr</a> wrote:<br>
> <br>
> Dear Andrew,<br>
> <br>
> To your question, what shall be the best sizing for (inductive) lists, <br>
> experiment seems to show that the answer is none !!!<br>
> <br>
> I describe below the arguments with examples piled one on top of the other, the <br>
> correct code being enclosed. <br>
> <br>
> The experiment consists in trying all discussed definitions of sized (inductive)<br>
> list, dropping the pack/unpack aspects that is now irrelevant, and trying to prove<br>
> some expected (easy) list’s properties.<br>
> <br>
> The possibilities discussed so far (given in incorrect « piled » Agda code) are:<br>
> ...<br>
> Or this suggests that sized type are bound to be used with co-induction so that<br>
> escape towards infinity is possible.<br>
<br>
I don’t think so. The way I see it is as follows. <br>
<br>
Sized types can be useful with inductive data when one has a recursive definition of a function on the data that is semantically well-defined, but which Agda’s termination check can't see as such. Some sized version of the data type (there may be several different ones!) may allow a definition of the recursive function to pass the checker and do the right thing “at infinity”. But especially for functions of several arguments there could be many different ways (or none!) of introducing size information in the arguments and results that does the job at infinity. So in your experiments I would say it’s not so much a question of which of the data declarations (SList1, SList2 or SList3) is better, as to how to introduce sizes in your select/unchanged/append function definitions — and that delicately depends upon their intended meaning — there won’t be one fixed pattern of what to do (and in some cases it may be impossible). <br>
<br>
Here endeth my 2p worth.<br>
<br>
Andy<br>
<br>
_______________________________________________<br>
Agda mailing list<br>
<a href="mailto:Agda@lists.chalmers.se" target="_blank">Agda@lists.chalmers.se</a><br>
<a href="https://lists.chalmers.se/mailman/listinfo/agda" rel="noreferrer" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
</blockquote></div>