<div class="gmail_quote">2012/4/2 Altenkirch Thorsten <span dir="ltr"><<a href="mailto:psztxa@exmail.nottingham.ac.uk">psztxa@exmail.nottingham.ac.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Wojciech,<br>
<br>
you are correct this was one of the motivating examples but as far as I<br>
know nobody has yet implemented such an interface. Thank you very much!<br></blockquote><div><br>There is in fact another implementation for comparison here:<br><a href="https://github.com/xplat/agda-tactics/blob/master/Tactics/Nat/Semiring.agda">https://github.com/xplat/agda-tactics/blob/master/Tactics/Nat/Semiring.agda</a><br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thorsten<br>
<div><div class="h5"><br>
On 01/04/2012 23:46, "Wojciech Jedynak" <<a href="mailto:wjedynak@gmail.com">wjedynak@gmail.com</a>> wrote:<br>
<br>
>Hello everybody,<br>
><br>
>last week my sanity has been saved by the stdlib's semiring solver. To<br>
>make it more convenient to use, and as an exercise in Agda's<br>
>reflection API, I wrote a simple front-end for the solver today.<br>
>I guess that this was one of motivating examples for introducing the<br>
>API to Agda in the first place, so others must have created similar<br>
>modules before - it might be interesting to compare different<br>
>approaches, so please share if you can.<br>
><br>
>The code is available at<br>
><a href="https://github.com/wjzz/Agda-reflection-for-semiring-solver" target="_blank">https://github.com/wjzz/Agda-reflection-for-semiring-solver</a><br>
>It has been checked with the latest darcs version of Agda & stdlib.<br>
><br>
>Long story short, instead of<br>
><br>
>stdlib : ∀ m n → suc (m + n + (m + n)) ≡ m + m + suc (n + n)<br>
>stdlib = solve 2 (λ m n → con 1 :+ (m :+ n :+ (m :+ n)) := m :+ m :+<br>
>(con 1 :+ (n :+ n))) refl<br>
><br>
>one can simply say<br>
><br>
>notbad : ∀ m n → suc (m + n + (m + n)) ≡ m + m + suc (n + n)<br>
>notbad = quoteGoal e in ring e refl refl refl refl<br>
><br>
>The right hand side is the same regardless of the goal, so we can use<br>
>it like the ring tactic in Coq.<br>
>It would be nice to replace it with a one-word notation, but I don't<br>
>know how to do it, so it's either<br>
>snippets or copy&paste for now.<br>
><br>
>The code should be simlifiable, so I would appreciate any comments.<br>
><br>
>Greetings,<br>
>Wojciech<br>
><br>
>PS. Pattern-matching lambdas in Agda 2.3 are awesome - it's very neat<br>
>to use them for trivial inversion properties instead of writing many<br>
>one-liners.<br>
>_______________________________________________<br>
>Agda mailing list<br>
><a href="mailto:Agda@lists.chalmers.se">Agda@lists.chalmers.se</a><br>
><a href="https://lists.chalmers.se/mailman/listinfo/agda" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
<br>
</div></div>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.<br>
<br>
This message has been checked for viruses but the contents of an attachment<br>
may still contain software viruses which could damage your computer system:<br>
you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation._______________________________________________<br>
<div class="HOEnZb"><div class="h5">Agda mailing list<br>
<a href="mailto:Agda@lists.chalmers.se">Agda@lists.chalmers.se</a><br>
<a href="https://lists.chalmers.se/mailman/listinfo/agda" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
</div></div></blockquote></div><br>