<div dir="ltr"><div>One development for such meta-theory is available for CoqMT.<br></div><div><a href="https://hal.archives-ouvertes.fr/hal-01664457">https://hal.archives-ouvertes.fr/hal-01664457</a></div><div>I wonder about the relation with the rewriting technology in Jesper's blog post.</div><div><br></div><div>Bas<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 21, 2019 at 9:36 PM Jon Sterling <<a href="mailto:jon@jonmsterling.com">jon@jonmsterling.com</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">Hi Jesper,<br>
<br>
I'm very pleased to hear that the confluence checker is coming along! Once it is in place, what kind of syntactic guarantees (relative to "pure Agda") can we expect to be available in the presence of custom rewrite rules? <br>
<br>
The main one I'm asking about is transitivity: if judgmental equality is transitive in plain Agda, then does one expect it to be transitive in Agda mod T, for T a set of rewrite rules that would accepted by the completed checker? If so, the rewriting facility sounds totally amazing and really useful.<br>
<br>
Maybe in the future we can just use Agda to prototype most new extensions to type theory, rather than writing our own implementations right away. <br>
<br>
<br>
Best,<br>
Jon<br>
<br>
<br>
<br>
On Mon, Oct 21, 2019, at 12:14 PM, Jesper Cockx wrote:<br>
> Hi Apostolis,<br>
> <br>
> Excellent question! Unfortunately, the answer is not an unqualified <br>
> 'yes'. It is true that using such rewrite rules always preserves <br>
> soundness of the theory, since rewrite rules are in a sense a limited <br>
> form of equality reflection, and equality reflection is known to be <br>
> consistent.<br>
> <br>
> However, other more syntactic properties such as confluence, <br>
> termination, and subject reduction (aka type preservation) can still be <br>
> broken. In our 2014 paper, I give one such example: the rewrite rules <br>
> `(suc x) * y == (x * y) + y` and `x * (suc y) == x + (x * y)` are not <br>
> confluent unless you also have associativity of + as a rewrite rule. <br>
> It's not very straightforward, but by tricking Agda's constraint solver <br>
> to solve equations in a particular order, you can exploit a <br>
> non-confluence like this to break subject reduction. This manifests as <br>
> a type error complaining two things should be equal even though they <br>
> are according to the rules.<br>
> <br>
> I have actually been working on implementing a confluence checker for <br>
> rewrite rules (which I'm planning to talk about in an upcoming post). <br>
> If you want, you can try it out by installing the current master branch <br>
> of Agda and enabling the --confluence-check flag.<br>
> <br>
> Cheers,<br>
> Jesper<br>
> <br>
> On Mon, Oct 21, 2019 at 4:21 PM Apostolis Xekoukoulotakis <br>
> <<a href="mailto:apostolis.xekoukoulotakis@gmail.com" target="_blank">apostolis.xekoukoulotakis@gmail.com</a>> wrote:<br>
> > If you have proved the equality as in your 2nd example, is there any reason not to use REWRITE? <br>
> > My impression is that I should use REWRITE everywhere where I have proven a propositional equality so as to make it definitional.<br>
> > <br>
> > Nice blog post, and a good reference to a book on type theory. I was looking into a good introductory book that would help me understand agda a bit better.<br>
> > <br>
> > On Mon, Oct 21, 2019 at 4:22 PM Jesper Cockx <<a href="mailto:Jesper@sikanda.be" target="_blank">Jesper@sikanda.be</a>> wrote:<br>
> >> Hi Agda folks,<br>
> >> <br>
> >> I have another blog post for you on extending Agda with rewrite rules, with no less than six examples of how they can be used. You can read it at <a href="https://jesper.sikanda.be/posts/hack-your-type-theory.html" rel="noreferrer" target="_blank">https://jesper.sikanda.be/posts/hack-your-type-theory.html</a>. Any comments are welcome here on the mailing list as usual.<br>
> >> <br>
> >> Cheers,<br>
> >> Jesper<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>
> _______________________________________________<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>
><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>