<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI Symbol";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
{mso-style-name:x_msochpdefault;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.xmsohyperlink
{mso-style-name:x_msohyperlink;
color:#0563C1;
text-decoration:underline;}
span.xmsohyperlinkfollowed
{mso-style-name:x_msohyperlinkfollowed;
color:#954F72;
text-decoration:underline;}
span.xemailstyle17
{mso-style-name:x_emailstyle17;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle26
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Just a reminder: please do not post solutions to connatural multiplication! I know how to do it but my students may read this mailing list.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thorsten<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">"Setzer A.G." <a.g.setzer@swansea.ac.uk><br>
<b>Date: </b>Sunday, 3 March 2019 at 13:58<br>
<b>To: </b>Thorsten Altenkirch <psztxa@exmail.nottingham.ac.uk>, "agda@lists.chalmers.se" <agda@lists.chalmers.se><br>
<b>Subject: </b>Re: Strangeness with corecursion<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div id="divtagdefaultwrapper">
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">Hi,<o:p></o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">what Thorsten reported is clearly a bug.<o:p></o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">I have the feeling it has a lot to do with the with construct.<o:p></o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">My definition of + is as follows, using a for me more intuitive notation (I borrowed some of the musical notation;<o:p></o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">at the end of my paper with Ulrich Berger on undecidability of codata types I discuss how the musical notation can be regarded with minor modifications as a nice abbreviation mechanism
- the following definition would with such a mechanism only consist of the definition of co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> and +∞)<o:p></o:p></span></p>
<p style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"> record co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞ : Set where<br>
coinductive<br>
field<br>
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><br>
<br>
<br>
data co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> : Set where<br>
zero : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><br>
suc : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞ → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"> _+∞'_ : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞ → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞<br>
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> (m +∞' n) =
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> m +∞ n<br>
<br>
_+∞_ : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><br>
zero +∞ n = n<br>
suc m +∞ n = suc (m +∞' n)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">The definition of * is not guarded recursive since in guarded recursion one cannot apply functions to the corecursive call. One can solve this by using sized types, or
by unfolding the guarded recursive definition. Here one needs a function plustimes n m k which computes n + m * k<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">Again the suggested abbreviation mechanism would avoid the need for ∞₁' and
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"> _*∞₁'_ : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞ → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞<br>
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> (m *∞₁' n) =
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> m *∞ n<br>
<br>
_*∞₁_ : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><br>
zero *∞₁ n = zero<br>
suc m *∞₁ n = plustimes n m n<br>
<br>
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"> plustimes' : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞ → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞<br>
</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> (plustimes' n m k) = plustimes (</span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black">
n) m k<br>
<br>
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"> plustimes : co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black">∞
→ co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"> → co</span><span style="font-size:12.0pt;font-family:"Cambria Math",serif;color:black">ℕ</span><span style="font-size:12.0pt;color:black"><br>
plustimes zero m k = </span><span style="font-size:12.0pt;font-family:"Segoe UI Symbol",sans-serif;color:black">♭</span><span style="font-size:12.0pt;color:black"> (m *∞₁' k)<br>
plustimes (suc n) m k = suc (plustimes' n m k)<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<div id="Signature">
<div id="divtagdefaultwrapper">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black">Anton<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="margin-left:36.0pt;text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="color:black">From:</span></b><span style="color:black"> Agda <agda-bounces@lists.chalmers.se> on behalf of Thorsten Altenkirch <Thorsten.Altenkirch@nottingham.ac.uk><br>
<b>Sent:</b> 03 March 2019 12:16:10<br>
<b>To:</b> agda@lists.chalmers.se<br>
<b>Subject:</b> [Agda] Strangeness with corecursion</span> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Hi,</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">I just set the exercise to define multiplication for conats for my course on type theory. So please don’t blurt put the solution – see the attached code. The following is not a
solution because agda doesn’t see that the definition is productive (even though it is):</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) with prd∞ m </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) | (just pm) = prd∞ (n +∞ (pm *∞ n))</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) | nothing = nothing</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">but after the following change</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) with prd∞ m
</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) | (just pm) with (pm *∞ n)</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) | (just pm) | x = prd∞ (n +∞ x)</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">prd∞ (m *∞ n) | nothing = nothing</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">agda seems to accept is. Actually even if +∞ is not contractive.</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Is this a known bug? Otherwise can somebody remind e how to report this?</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Cheers,</span><o:p></o:p></p>
<p class="xmsonormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Thorsten</span><o:p></o:p></p>
</div>
<pre style="margin-left:36.0pt"><o:p> </o:p></pre>
<pre style="margin-left:36.0pt">This message and any attachment are intended solely for the addressee<o:p></o:p></pre>
<pre style="margin-left:36.0pt">and may contain confidential information. If you have received this<o:p></o:p></pre>
<pre style="margin-left:36.0pt">message in error, please contact the sender and delete the email and<o:p></o:p></pre>
<pre style="margin-left:36.0pt">attachment. <o:p></o:p></pre>
<pre style="margin-left:36.0pt"><o:p> </o:p></pre>
<pre style="margin-left:36.0pt">Any views or opinions expressed by the author of this email do not<o:p></o:p></pre>
<pre style="margin-left:36.0pt">necessarily reflect the views of the University of Nottingham. Email<o:p></o:p></pre>
<pre style="margin-left:36.0pt">communications with the University of Nottingham may be monitored <o:p></o:p></pre>
<pre style="margin-left:36.0pt">where permitted by law.<o:p></o:p></pre>
<pre style="margin-left:36.0pt"><o:p> </o:p></pre>
<pre style="margin-left:36.0pt"><o:p> </o:p></pre>
<pre style="margin-left:36.0pt"><o:p> </o:p></pre>
</div>
</div>
<PRE>
This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment.
Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored
where permitted by law.
</PRE></body>
</html>