<html 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="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">Thanks for doing this Yong Kiam.  I had fixed the problems without pushing, so I’m sorry I caused duplicate work. 
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">I think I will just change the WordT token to take a num: the value can never be negative (curiously, it seem as if SML requires ~0w3 to not parse/lex properly),
 and if we wanted to, we’d just lex it into two tokens rather than one.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">Michael<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Yong Kiam <tanyongkiam@gmail.com><br>
<b>Date: </b>Friday, 2 December 2016 at 03:55<br>
<b>To: </b>Ramana Kumar <Ramana.Kumar@cl.cam.ac.uk><br>
<b>Cc: </b>"Norrish, Michael (Data61, Canberra City)" <Michael.Norrish@data61.csiro.au>, "developers@cakeml.org" <developers@cakeml.org><br>
<b>Subject: </b>Re: [CakeML-dev] translating i2w<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Changing it to use n2w should work. I don't think I have ran into i2w in translation before though.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Presumably, this is at a fixed word width so you will want to simplify word_2comp away.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">BTW, are you fixing / have you fixed lexerProg? I could do it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">It's probably failing because of ARBs in toNum and num_from_hex_string, see:
<a href="https://github.com/CakeML/cakeml/commit/4347e06c12533161d9311e761e4dbcdb1bd93810">
https://github.com/CakeML/cakeml/commit/4347e06c12533161d9311e761e4dbcdb1bd93810</a><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Dec 1, 2016 at 6:34 AM, Ramana Kumar <<a href="mailto:Ramana.Kumar@cl.cam.ac.uk" target="_blank">Ramana.Kumar@cl.cam.ac.uk</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">I don't think you should translate i2w - can you make your code use<br>
n2w instead? The translator should be able to handle n2w.<br>
(I say this because looking at the translator's hol2deep function I<br>
see it has a case for n2w but not for i2w.)<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
On 1 December 2016 at 21:44,  <<a href="mailto:Michael.Norrish@data61.csiro.au">Michael.Norrish@data61.csiro.au</a>> wrote:<br>
> I’m breaking the build on my branch because the parser wants to turn word token integers into word64 values.  I used the i2w constant to do this, but the translator isn’t happy with word_2comp, which is used in this definition. Is there something obvious
 I should do to fix this?<br>
><br>
> Or can I use n2w instead by altering the Word token constructor to take a num instead of an int?<br>
><br>
> Michael<br>
><br>
> _______________________________________________<br>
> Developers mailing list<br>
> <a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
> <a href="https://lists.cakeml.org/listinfo/developers" target="_blank">https://lists.cakeml.org/listinfo/developers</a><br>
<br>
_______________________________________________<br>
Developers mailing list<br>
<a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
<a href="https://lists.cakeml.org/listinfo/developers" target="_blank">https://lists.cakeml.org/listinfo/developers</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>