<div dir="ltr"><div><div><div>By &quot;expose aggsy&quot;, I guess I mean that there would be a new function, agsy : Term → TC ⊤. Or maybe Term → TC Term. I&#39;d rather not pursue this, however, as I think a much stronger case could be made for exposing &quot;rewrite&quot; than for agsy.<br><br></div>I&#39;ve taken a look at checkRHS, as Jesper suggested and I see now that there&#39;s a more fundamental problem than exposing &quot;rewrite&quot;: there is no way to define a function without explicitly-stated patterns. E.g., in the Agda language, one can define:<br><br>  foo : ∀ {X : Set} → {a b : X} → (a≡b : a ≡ b) → Set<br>  foo refl = {!!}<br><br></div>and Agda fills-in the implicit patterns as<br><br></div>  foo {X} {a} {.a} refl = {!!}<br><div><div><br></div><div>Using reflection&#39;s defineFun, one must specify all of the implicit patterns, as in the second form. I believe that checkRHS uses the ability of the typechecker to fill-in these implicit patterns. I suppose this could also be done via reflection, simply by trying every combination of dot and (var &quot;_&quot;) patterns. Without recreating typechecking in Agda, is there a more straightforward way to do this?<br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">--<br>Martin Stone Davis<br><div><br>Postal/Residential:<br></div><div style="margin-left:40px"><span>1223 Ferry St</span><span><span><br></span></span></div><div style="margin-left:40px"><span><span>Apt 5<br></span></span></div><div style="margin-left:40px"><span>Eugene, OR 97401</span><br></div>Talk / <span></span>Text / Voicemail: <a href="tel:3106993578" value="+13106993578" target="_blank">(310) 699-3578</a><br>Electronic Mail: <a href="mailto:martin.stone.davis@gmail.com" target="_blank">martin.stone.davis@gmail.com</a><div><div><div><span></span></div></div></div></div></div><div dir="ltr"><span style="font-size:small">Website: </span><a href="http://martinstonedavis.com/" style="color:rgb(17,85,204);font-size:small" target="_blank">martinstonedavis.com</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Feb 2, 2016 at 7:31 AM, Thorsten Altenkirch <span dir="ltr">&lt;<a href="mailto:Thorsten.Altenkirch@nottingham.ac.uk" target="_blank">Thorsten.Altenkirch@nottingham.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>I am not sure what you mean by “expose agsy”? Wouldn’t it make more sense to rewrite agsy in Agda?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Thorsten</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Martin Stone Davis &lt;<a href="mailto:martin.stone.davis@gmail.com" target="_blank">martin.stone.davis@gmail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Sunday, 31 January 2016 19:53<br>
<span style="font-weight:bold">To: </span>agda &lt;<a href="mailto:agda@lists.chalmers.se" target="_blank">agda@lists.chalmers.se</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[Agda] Expose more of Agda to reflection?<br>
</div><div><div class="h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>Via reflection, it currently isn&#39;t straightforward to construct an agda function that invokes a rewrite. Exposing Agda&#39;s rewriting machinery to reflection would make this much easier. (Another neat idea is to expose agsy!) On the other hand, the exact
 same algorithms could be reproduced in the Agda language and it might be advisable to keep the reflection interface clean, especially considering that work done by &quot;rewrite&quot; or agsy might change in the future.<br>
<br>
Am I correct that Agda.TypeChecking.Rewriting can now be exactly reproduced in Agda? I&#39;m studying the algorithm and would love to know that the path ahead of me is clear.<br>
--<br>
</div>
<div>
<div>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">Martin Stone Davis<br>
<div><br>
Postal/Residential:<br>
</div>
<div style="margin-left:40px"><span>1223 Ferry St</span><span><span><br>
</span></span></div>
<div style="margin-left:40px"><span><span>Apt 5<br>
</span></span></div>
<div style="margin-left:40px"><span>Eugene, OR 97401</span><br>
</div>
Talk / <span></span>Text / Voicemail: <a href="tel:3106993578" value="+13106993578" target="_blank">
(310) 699-3578</a><br>
Electronic Mail: <a href="mailto:martin.stone.davis@gmail.com" target="_blank">martin.stone.davis@gmail.com</a>
<div>
<div>
<div><span></span></div>
</div>
</div>
</div>
</div>
<div dir="ltr"><span style="font-size:small">Website: </span><a href="http://martinstonedavis.com/" style="color:rgb(17,85,204);font-size:small" target="_blank">martinstonedavis.com</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></span>
<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 send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
</pre></div>

</blockquote></div><br></div>