<div dir="ltr">Hi Jeremy,<div> As the error message says, the `--
<span style="font-variant-ligatures:no-common-ligatures">rewriting</span>` flag is not <a href="https://agda.readthedocs.io/en/v2.6.1/language/safe-agda.html#safe-agda">compatible </a>with the `--safe` flag, and (as one would hope!) the standard library uses `--safe` flag extensively.</div><div><br></div><div>As you say, passing the flag via the command line applies it to all files, and therefore setting `--rewriting` in such a manner is not compatible with the standard library. In contrast, as the `--
<span style="font-variant-ligatures:no-common-ligatures">rewriting</span>` flag is neither <a href="https://agda.readthedocs.io/en/v2.6.1/tools/command-line-options.html?highlight=infective#consistency-checking-of-options-used">infective nor co-infective</a>, adding it via an OPTIONS pragma only applies it to that file.<br></div><div>Cheers,</div><div>Matthew</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 24, 2020 at 4:48 AM Siek, Jeremy <<a href="mailto:jsiek@indiana.edu">jsiek@indiana.edu</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">
<div style="overflow-wrap: break-word;">
Hi Jesper,
<div><br>
</div>
<div>I ran agda with the --rewriting flag, as in</div>
<div><br>
</div>
<div>agda --rewriting Lambda.agda</div>
<div><br>
</div>
<div>and got the following error:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">Checking examples.Lambda (/Users/jsiek/abstract-binding-trees/src/examples/Lambda.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Checking Syntax (/Users/jsiek/abstract-binding-trees/src/Syntax.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Checking Data.List (/usr/local/Cellar/agda/2.6.0.1_1/lib/agda/src/Data/List.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Checking Data.List.Base (/usr/local/Cellar/agda/2.6.0.1_1/lib/agda/src/Data/List/Base.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Checking Data.Bool.Base (/usr/local/Cellar/agda/2.6.0.1_1/lib/agda/src/Data/Bool/Base.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Checking Data.Unit.Base (/usr/local/Cellar/agda/2.6.0.1_1/lib/agda/src/Data/Unit/Base.agda).</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">/usr/local/Cellar/agda/2.6.0.1_1/lib/agda/src/Data/Bool/Base.agda:11,1-37</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">Cannot set OPTIONS pragma --rewriting with safe flag.</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">when scope checking the declaration</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> open import Data.Unit.Base using (⊤)</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures">But now I’m thinking I don't need to add the --rewriting flag at the command line.</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures">I can instead add</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures">
<div>{-# OPTIONS --rewriting #-}</div>
<div><br>
</div>
<div>at the top of Lambda.agda and things seem to work.</div>
<div><br>
</div>
<div>I originally thought I had to do both… I’m not sure what the distinction is between</div>
<div>using the command line flag versus the # OPTIONS… does the command line</div>
<div>flag apply --rewriting to all the files, whereas # OPTIONS only applies</div>
<div>the - -rewriting flag to one file?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Jeremy</div>
</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div><br>
<blockquote type="cite">
<div>On Apr 23, 2020, at 2:35 PM, Jesper Cockx <<a href="mailto:Jesper@sikanda.be" target="_blank">Jesper@sikanda.be</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>Hi Jeremy,</div>
<div><br>
</div>
<div>How exactly is --rewriting incompatible with the standard library? It's true that it does not use --rewriting, but you can always import a file that does not use --rewriting from one that does (the other way around is more problematic).</div>
<div><br>
</div>
<div>-- Jesper<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Apr 23, 2020 at 10:11 PM Siek, Jeremy <<a href="mailto:jsiek@indiana.edu" target="_blank">jsiek@indiana.edu</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">
<div>
<div><br>
</div>
>From a quick test run, it seems that --rewriting is incompatible with most if not
<div>all of the standard library. Is that correct? I was hoping to use --rewriting,</div>
<div>but using the standard library is rather more important.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Jeremy<br>
<div><br>
<div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div><span style="font-family:Menlo;font-size:inherit">__________________________________________</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Jeremy G. Siek <<a href="mailto:jsiek@indiana.edu" target="_blank">jsiek@indiana.edu</a>></span><br style="font-family:Menlo">
<span style="font-family:Menlo">Professor</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Luddy School of Informatics, Computing, and Engineering</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Indiana University Bloomington</span><br style="font-family:Menlo">
<span style="font-family:Menlo"><a href="http://homes.soic.indiana.edu/jsiek/" target="_blank">http://homes.soic.indiana.edu/jsiek/</a></span><br>
</div>
<div><span style="font-family:Menlo"><br>
</span></div>
</div>
</div>
<br>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<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>
</div>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div><span style="font-family:Menlo;font-size:medium">__________________________________________</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Jeremy G. Siek <<a href="mailto:jsiek@indiana.edu" target="_blank">jsiek@indiana.edu</a>></span><br style="font-family:Menlo">
<span style="font-family:Menlo">Professor</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Luddy School of Informatics, Computing, and Engineering</span><br style="font-family:Menlo">
<span style="font-family:Menlo">Indiana University Bloomington</span><br style="font-family:Menlo">
<span style="font-family:Menlo"><a href="http://homes.soic.indiana.edu/jsiek/" target="_blank">http://homes.soic.indiana.edu/jsiek/</a></span><br>
</div>
<div><span style="font-family:Menlo"><br>
</span></div>
</div>
</div>
<br>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</div>
</div>
_______________________________________________<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>