[Agda] rewriting before defining

Thorsten Altenkirch Thorsten.Altenkirch at nottingham.ac.uk
Mon Mar 5 17:32:29 CET 2018


Hi Jesper,

Yes, Paolo Capritti already pointed this out to me (I was going to write an update). Basically I should not be able to use the rewriting rule on the right hand side of a recursive definition but this certainly goes beyond the abilities of Agda’s rewrite mechanism (or only for structurally smaller indices).

Cheers,
Thorsten

From: Agda <agda-bounces at lists.chalmers.se> on behalf of Jesper Cockx <Jesper at sikanda.be>
Date: Monday, 5 March 2018 at 14:04
To: Thorsten Altenkirch <psztxa at exmail.nottingham.ac.uk>
Cc: "andreas.abel at gu.se" <andreas.abel at gu.se>, Agda mailing list <agda at lists.chalmers.se>, Nicolai Kraus <nicolai.kraus at gmail.com>
Subject: Re: [Agda] rewriting before defining

The problem is that if we allow a rewrite rule to be added before its definition, then you could just prove it using refl (since it is now reflexive, by virtue of adding the rewrite rule). So this doesn't actually give you any more guarantees than just postulating the rewrite rule outright. So I don't think it makes sense to allow this. If you can come up with a way to use a rewrite rule for other definitions but not for defining the rule itself, let us know (or even better: implement it and send us a pull request ;) ).
-- Jesper

On Thu, Mar 1, 2018 at 11:02 AM, Thorsten Altenkirch <Thorsten.Altenkirch at nottingham.ac.uk<mailto:Thorsten.Altenkirch at nottingham.ac.uk>> wrote:
On 01/03/2018, 09:30, "Agda on behalf of Andreas Abel" <agda-bounces at lists.chalmers.se<mailto:agda-bounces at lists.chalmers.se> on behalf of abela at chalmers.se<mailto:abela at chalmers.se>> wrote:


>Well, the doctor could perform some surgery on Agda, take out the
>cancerous error message and see what happens. ;-)

I was hoping that a surgeon who is better versed with the Agda source would do this for me. :-) In particular I don’t really want to use a non-standard version of Agda.

>I wash my hands in innocence.  For me, the intended use of REWRITE was
>to add a proven propositional equality to definitional equality; if you
>go beyond it, you have to worry about the semantics yourself.

You are right. Basically REWRITE is a limited form of equality reflection. I do prove this equality only I am proving it mutually with its use. This you can certainly do when you have full equality reflection. I shouldn’t need to introduce postulates here.

This particular instance enables me to define semisimplicial types without using a 2-level theory (the 2-level approach was described in our CSL 2016 paper http://www.cs.nott.ac.uk/~psztxa/publ/csl16.pdf). The rewrite version is both better from a pragmatic view (easier to use - I think) and from a semantic point (there are interpretations or type theory that model semisimplical types but not a (strong) 2-level theory where Nat is fibrant - at least that is what Mike Shulman told me).

In this setting we certainly do not want to have full equality reflection because it would destroy proof relevance and hence it is in this form incompatible with univalence. However, I claim that this instance of equality reflection is harmless (this is a conjecture).

We know that REWRITE can destroy soundness - so no difference here.

Thorsten

>
>Cheers,
>Andreas
>
>On 28.02.2018 19:07, Thorsten Altenkirch wrote:
>> Hi,
>>
>> I am mutually defining an equality and some other things. To be able to
>> type check the other things I need the equality as a rewriting rule but
>> agda doesn't let me.
>>
>> That is I get the error
>> Rewrite rule from function  Skm-∘  cannot be added before the function
>> definition
>> when checking the pragma REWRITE Skm-∘
>> when checking the attached file.
>>
>> I know that I am cheating but I want to do it. Can I tell it that I am a
>> doctor and I know what I am doing. Otherwise I shouldn't be allowed to
>> use Rewrite anyway.
>>
>> Yes, I can replace it by a postulate but that misses the point.
>>
>> Cheers,
>> Thorsten
>>
>>
>> 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 contact the sender and delete the email and
>> attachment.
>>
>> Any views or opinions expressed by the author of this email do not
>> necessarily reflect the views of the University of Nottingham. Email
>> communications with the University of Nottingham may be monitored
>> where permitted by law.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Agda mailing list
>> Agda at lists.chalmers.se<mailto:Agda at lists.chalmers.se>
>> https://lists.chalmers.se/mailman/listinfo/agda
>>
>
>
>--
>Andreas Abel  <><      Du bist der geliebte Mensch.
>
>Department of Computer Science and Engineering
>Chalmers and Gothenburg University, Sweden
>
>andreas.abel at gu.se<mailto:andreas.abel at gu.se>
>http://www.cse.chalmers.se/~abela/
>_______________________________________________
>Agda mailing list
>Agda at lists.chalmers.se<mailto:Agda at lists.chalmers.se>
>https://lists.chalmers.se/mailman/listinfo/agda



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 contact the sender and delete the email and
attachment.

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored
where permitted by law.




_______________________________________________
Agda mailing list
Agda at lists.chalmers.se<mailto:Agda at lists.chalmers.se>
https://lists.chalmers.se/mailman/listinfo/agda




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 contact the sender and delete the email and
attachment. 

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored 
where permitted by law.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/agda/attachments/20180305/28f93ed8/attachment-0001.html>


More information about the Agda mailing list