<div dir="ltr">Oh oops sorry, I must have been confused. I guess we might have been talking about the stuff at the bottom of lexer_impl, e.g. lex_impl_all<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 6:19 PM,  <span dir="ltr"><<a href="mailto:Michael.Norrish@data61.csiro.au" target="_blank">Michael.Norrish@data61.csiro.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div bgcolor="white" link="blue" vlink="purple" lang="EN-GB">
<div class="m_-6181394631175456549WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Really?  I don’t understand quite how the lexerProg assembles the lexer implementation, but it looks as if it translates lexer_fun, which calls next_token, and
 next_token calls next_sym.  It’s next_sym that has problems with sideconditions, and if you look at how next_token is translated, you can see how the call to next_sym is replaced by a call to next_sym_alt (by rewriting with the equivalence theorem).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">And git history disagrees with you about having touched lexer_impl btw
</span><span style="font-size:11.0pt;font-family:Wingdings">J</span><span style="font-size:11.0pt;font-family:Calibri"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Michael<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></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 <<a href="mailto:tanyongkiam@gmail.com" target="_blank">tanyongkiam@gmail.com</a>><br>
<b>Date: </b>Friday, 2 December 2016 at 10:00<br>
<b>To: </b>"Norrish, Michael (Data61, Canberra City)" <<a href="mailto:Michael.Norrish@data61.csiro.au" target="_blank">Michael.Norrish@data61.csiro.<wbr>au</a>><br>
<b>Cc: </b>"<a href="mailto:developers@cakeml.org" target="_blank">developers@cakeml.org</a>" <<a href="mailto:developers@cakeml.org" target="_blank">developers@cakeml.org</a>></span></p><div><div class="h5"><br>
<b>Subject: </b>Re: [CakeML-dev] translating i2w<u></u><u></u></div></div><p></p>
</div><div><div class="h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Michael,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">One thing that came up when a few of us were looking through the bootstrap just now was the difference between lexer_fun and lexer_impl. The translation currently just translates lexer_fun and doesn't seem to
 be touching lexer_impl at all. Is it still needed or is it meant to be faster/nicer?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Also, I didn't update lexer_impl when I fixed the translation.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, Dec 1, 2016 at 5:49 PM, <<a href="mailto:Michael.Norrish@data61.csiro.au" target="_blank">Michael.Norrish@data61.csiro.<wbr>au</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Thanks for doing this Yong Kiam.  I had fixed the problems without pushing, so I’m sorry I caused duplicate work. 
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">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.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Michael</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"> </span><u></u><u></u></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 <<a href="mailto:tanyongkiam@gmail.com" target="_blank">tanyongkiam@gmail.com</a>><br>
<b>Date: </b>Friday, 2 December 2016 at 03:55<br>
<b>To: </b>Ramana Kumar <<a href="mailto:Ramana.Kumar@cl.cam.ac.uk" target="_blank">Ramana.Kumar@cl.cam.ac.uk</a>><br>
<b>Cc: </b>"Norrish, Michael (Data61, Canberra City)" <<a href="mailto:Michael.Norrish@data61.csiro.au" target="_blank">Michael.Norrish@data61.csiro.<wbr>au</a>>, "<a href="mailto:developers@cakeml.org" target="_blank">developers@cakeml.org</a>" <<a href="mailto:developers@cakeml.org" target="_blank">developers@cakeml.org</a>><br>
<b>Subject: </b>Re: [CakeML-dev] translating i2w</span><u></u><u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></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.<u></u><u></u></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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">BTW, are you fixing / have you fixed lexerProg? I could do it.<u></u><u></u></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" target="_blank">
https://github.com/CakeML/<wbr>cakeml/commit/<wbr>4347e06c12533161d9311e761e4dbc<wbr>db1bd93810</a><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></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:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<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.)<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
On 1 December 2016 at 21:44,  <<a href="mailto:Michael.Norrish@data61.csiro.au" target="_blank">Michael.Norrish@data61.csiro.<wbr>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>
> ______________________________<wbr>_________________<br>
> Developers mailing list<br>
> <a href="mailto:Developers@cakeml.org" target="_blank">Developers@cakeml.org</a><br>
> <a href="https://lists.cakeml.org/listinfo/developers" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><br>
<br>
______________________________<wbr>_________________<br>
Developers mailing list<br>
<a href="mailto:Developers@cakeml.org" target="_blank">Developers@cakeml.org</a><br>
<a href="https://lists.cakeml.org/listinfo/developers" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
Developers mailing list<br>
<a href="mailto:Developers@cakeml.org" target="_blank">Developers@cakeml.org</a><br>
<a href="https://lists.cakeml.org/listinfo/developers" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
Developers mailing list<br>
<a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
<a href="https://lists.cakeml.org/listinfo/developers" rel="noreferrer" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><br>
<br></blockquote></div><br></div>