coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jim Fehrle <jim.fehrle AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] moving a definition to a different file
- Date: Wed, 11 Oct 2023 16:33:17 -0700
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jim.fehrle AT gmail.com; spf=Pass smtp.mailfrom=jim.fehrle AT gmail.com; spf=None smtp.helo=postmaster AT mail-ed1-f45.google.com
- Ironport-data: A9a23:mjGVTamkg3TryPtuUDk1U9vo5gxOIkRdPkR7XQ2eYbSJt1+Wr1Gzt xIfC26OOK2DNGH0KoxwPYjn9UwC68DWmoNmG1Brq3syFltH+JHPbTi7BhepbnnKdqUvb2o+s p5AMoGYRCwQZiWBzvt4GuG59RGQ7YnRGvymTrSs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws LsemeWGULOe82Ayajl8B56r8ks1562q4WpA5TTSWNgS1LPgvylNZH4gDfrpR5fIatE8NvK3Q e/F0Ia48gvxl/v6Io7Nfh7TKyXmc5aKVeS8oiI+t5uK3nCukhcPPpMTb5LwX6v4ZwKhxLidw P0V3XC5pJxA0qfkwIzxWDEAe81y0DEvFBYq7hFTvOTKp3AqfUcAzN0+UkwNBt0j199HAD5Qz PMUeGAIXD6M0rfeLLKTEoGAh+wmJcjveY4T4zRukWyfAvEhTpTOBa7N4Le03h9q3pEITauYP ZJJL2YyBPjDS0Un1lM/CpM72umlhmP7fhVXrVuUoew85G27IAlZjuixbYaLIYPiqcN9nh2ht iHe02rCDy4GZc3Y8WGA8SqIv7qa9c/8cNtKSOfQGuRRqFaU3ykYDAAcfUCqpOGwzE+4QdNWb UIOkhfCtoA3/U2vC9TxBli2/CPCsRkbVN5dVeY97Wlh15Y4/S7JWGU/dW56ReUWtZAofDMmh g+Mrf3mUGkHXKKudVqR8bKdrDWXMCcTLHMfaSJscefjy4mzyG3UpkKfJuuPAJJZnfWuRm6tm 2HiQDwWwuRM3ZRShs1X6Hie22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dnZIW S8Tzouf/l3+wEM6ZCHspcqxRjCHz8BmfdX/fm4Gxnd38ZVREKnNpL1cwXku/xzh/FqXO6Qi2 G9ak6dm6WZG0b9V/lB2lWPEXOhURQ4BbEmO31yJ94zs8vsRPT71N+D2jA0kxZigFO3Q/F8aA iqoPMd6W3c3tJ03MUqQgiKprNi4PoCBN5RL8UTE9nWIx+lNdMBuyrxT33chYSSl+iR7g+8j0 U43hcH85dfYbTUrpOXjW1ZZLmGnPpxIvGi80eAG2J7Rht7KfN0pGy1XDsGwHLT4TXRL76Shb 0HXT3U9sivJQ+OBW1LPrh439TSXVMn6f3CPeCtDlIskHkLMYhcFxlhTBWRf/NZxAAmuwIaJn F5RwDcX6xa4rxJNzrktLBzjSiLEox/ubD4oSZ+ZJR4Q7wdY5k6TP9bMpuR0VzpV+JGstmnvY iSSehhIAGcVW0eFG0GrP7+g4sPF+vSZAez2JuXHYLGHo+hTH/mSwpfn3oxj9jeKfsKBWxsqR +U8wVZGVGtlFt7xnjwOT2kam3uIYZLG4hi7/SJzo4a09/GqEAPj6I2TCqdDZNVi/xfl5MXLf +WUhSt/NXNZzsZWnS6OmOVZhgZCzX0zJFzPWfwauCXATbzdgPpSBh8fMGZoMddQqrk7xk9LM NLajdX80vh5iOQ0AhFLTw+E+InhaMoULmW6LF6CClyMMeHMJzzOhc/6Ybm4RJVfiexVs1u7v jPRQCqBdnyT0iLkURyiK7QGlCaAIBlXo52waD5oAGnnCd/qM1i1bIIxgjoxzrk5wHjNMCRPV Fo0O1MIpbqW4yRCh/x5EGEU9XtpI96PnCOB5vXZIJIb2ROEKitxnuNepn89zukMhMmlbPl8m S+Xo9I35l/6z6+AzT1oVBcIoTFO1trjVaBKNqDQ950GUnHBrkpl0A==
- Ironport-sdr: 652730da_VFMdxbVwnSnyR2HyskUMBa8pfdhYYD4NWttGDmbrF92r4ys fqvLL6AAlsCgy1mzR+M4ZB5hUY2KqdvsOTumRhA==
>
I suggested a file because I think the output would be huge. In case someone wants to use this feature without an IDE, manually copying and pasting may be an unnecessary burden. with IDE support, stdout would be fine too.
Yeah. In an IDE it may be possible to put it directly into the clipboard. FWIW, we no longer consider coqtop as a realistic development environment for Coq. But no plans for it to go away, either.
> I am not asking any change what gets stored in .vo files. this tool does not need any change in coqc.
It's certainly simpler if that's not necessary.
> .glob file/coqdoc hyperlinks all notations to their definitions, right? what would we miss?
I think you'd want to filter the universe of all notations rather than add every single one to your output. I don't recall whether redefining an existing notation gives an error message or not. In either case, it leaves a good bit of cleanup work for the user. Identifying all the notations used in D from its string is not trivial. I'm pretty sure the notation use info is not preserved in the .vo file. You may also need to include notation scopes which can turn notations on and off. OTOH, users may want to import more than just the items that are referenced by D. If they're going to edit D, they may prefer all the relevant items that are in scope where D was defined.
On Wed, Oct 11, 2023 at 3:54 PM Abhishek Anand <abhishek.anand.iitg AT gmail.com> wrote:
If the definition exists, why can't you refer directly to the existing definition? That would be simpler for users (no cleanup) but if it requires changes to Coq then it's probably more complex to implement than the tool you suggest.Because it may take 10 minutes to rebuild Y.v and all the deps between X.v and Y.v . .vok builds may help a bit but the context switch overhead may still be large.A few specific thoughts:- You may be able to do a lot of what you want by writing a Coq plugin with commands. But some of it may mean enhancing Coq itself to make info accessible. Perhaps you can write the needed commands to stdout rather than creating a file and an import command.I suggested a file because I think the output would be huge. In case someone wants to use this feature without an IDE, manually copying and pasting may be an unnecessary burden. with IDE support, stdout would be fine too.- ExportContextInfoRelevantToLastSentence works on X.v as you say above, or perhaps you meant on Y.v? It may be easier to implement (and harder to use) if it's inserted after D in Y.v. There should be internal data structures that tell what notations, sections, imports, etc. are available at that point. If it's in X.v, all that information probably has to be saved in Y.vo--more complex.No, I meant X.v, where the (new) definition of D is already known to type-check correctly. if we want the context in Y.v to match that point in X.v, we need to know what the (relevant) context was just before (or just after) D in X.v. The Export is to be done at the source of the definition, the Import at the destination. I am not asking any change what gets stored in .vo files. this tool does not need any change in coqc.- There's probably no code that will tell you exactly which notations are used for D. A more brute force approach is just knowing and exporting all the available notations at that point..glob file/coqdoc hyperlinks all notations to their definitions, right? what would we miss?- Wouldn't you potentially need to handle recursive definitions, e.g. D depends on E and so forth? That makes it even trickier to get all the right data automatically. But you could leave it to the user to add E in a separate step. Or a variable V may depend on another variable W.This is a great point I had not thought about but it does show up in practice: I move D from X.v to Y.v and then realize that D also depends on F in X.v so that has to be moved as well. Perhaps the ExportContextInfoRelevantToLastSentence command should warn/fail if D depends on some definition, say F, in the same file. The user or IDE will then first move F- The user may need to edit the generated output, e.g. to remove notations and imports that already exist in X.v.a goal is to not add redundant imports. the Import command is supposed to look at the existing context in Y.v at the insertion spot and match with the export from X.v and only add the missing bits
- [Coq-Club] moving a definition to a different file, Abhishek Anand, 10/10/2023
- Re: [Coq-Club] moving a definition to a different file, Jim Fehrle, 10/11/2023
- Re: [Coq-Club] moving a definition to a different file, Abhishek Anand, 10/11/2023
- Re: [Coq-Club] moving a definition to a different file, Jim Fehrle, 10/11/2023
- Re: [Coq-Club] moving a definition to a different file, Abhishek Anand, 10/12/2023
- Re: [Coq-Club] moving a definition to a different file, Jim Fehrle, 10/12/2023
- Re: [Coq-Club] moving a definition to a different file, Abhishek Anand, 10/12/2023
- Re: [Coq-Club] moving a definition to a different file, Meven Lennon-Bertrand, 10/12/2023
- Re: [Coq-Club] moving a definition to a different file, Jim Fehrle, 10/11/2023
- Re: [Coq-Club] moving a definition to a different file, Abhishek Anand, 10/11/2023
- Re: [Coq-Club] moving a definition to a different file, Jim Fehrle, 10/11/2023
Archive powered by MHonArc 2.6.19+.