Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename mlg grammar nonterminals to make documented and mlg grammars more consistent #13219

Merged
merged 5 commits into from
Oct 27, 2020

Conversation

jfehrle
Copy link
Member

@jfehrle jfehrle commented Oct 18, 2020

While updating the syntax in the documentation, we (primarily me and @Zimmi48) found that many of the mlg nonterminal names were not good enough for use in the documentation, so we chose better names. This PR updates the mlgs so that they use most of these names. This will make it less confusing for developers to relate the grammar in the manual to the mlg files. (I frequently got confused by the different names even though I'm acutely aware that there are differences in the names.)

There is no functional change here other than that the Print Grammar command output may show some of the changed names. Global variables for nonterminals defined in mli files that were renamed were made equal to the new variables and deprecated to avoid breaking external plugins that may rely on those variables.

Perhaps @herbelin is willing to do the review?

"A rose by any other name would smell as sweet"

@coqbot-app coqbot-app bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 18, 2020
@jfehrle jfehrle force-pushed the rename_nts2 branch 2 times, most recently from 2de10a1 to c1d0472 Compare October 18, 2020 05:07
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 18, 2020
@github-actions github-actions bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 19, 2020
@SkySkimmer

This comment has been minimized.

@jfehrle jfehrle force-pushed the rename_nts2 branch 2 times, most recently from f477ac7 to 6850f7c Compare October 20, 2020 04:42
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 20, 2020
@jfehrle jfehrle changed the title Testing... Rename grammar terminals to make documented grammar and mlg grammar more consistent Oct 20, 2020
@jfehrle jfehrle added the kind: cleanup Code removal, deprecation, refactorings, etc. label Oct 20, 2020
@jfehrle jfehrle added this to the 8.13+beta1 milestone Oct 20, 2020
@jfehrle jfehrle requested a review from herbelin October 20, 2020 07:20
@jfehrle jfehrle changed the title Rename grammar terminals to make documented grammar and mlg grammar more consistent Rename mlg grammar nonterminals to make documented and mlg grammars more consistent Oct 20, 2020
@jfehrle jfehrle marked this pull request as ready for review October 20, 2020 07:27
@jfehrle jfehrle requested review from a team as code owners October 20, 2020 07:27
@jfehrle jfehrle removed request for a team October 20, 2020 07:27
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 25, 2020
@jfehrle
Copy link
Member Author

jfehrle commented Oct 25, 2020

Rebased. Do we need any others to review this?

@herbelin
Copy link
Member

Do we need any others to review this?

I believe we can go. Merging tomorrow (if no comments by then and if I don't forget).

@herbelin herbelin self-assigned this Oct 26, 2020
Comment on lines 46 to 50
| #[ locality = Attributes.locality; ] [ "Numeral" "Notation" reference(ty) reference(f) reference(g) ":"
ident(sc) numnotoption(o) ] ->

{ warn_deprecated_numeral_notation ();
vernac_numeral_notation (Locality.make_module_locality locality) ty f g (Id.to_string sc) o }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a minute. This PR removes the deprecated Numeral Notation command but this command was only deprecated in 8.13, which is not released yet.

Copy link
Member

@herbelin herbelin Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, waiting.

By the way, won't it be too much of a burden for users to change from Numeral to Number? (Or maybe the changes are already clearly accepted upstreams?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, won't it be too much of a burden for users to change from Numeral to Number? (Or maybe the changes are already clearly accepted upstreams?)

That's a fair question. There has been a bit of a debate after the PR changing this was merged. See #12979 (comment). IMHO for this kind of cosmetic change, the solution is to make the deprecation period sufficiently long (a bit like the Ocaml vs OCaml value for Extraction Language which was changed and deprecated in 8.8 but only removed in 8.13).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is somehow the question. Is the added value of the change worth the burden (but again, if the change is already validated by the users, it does not matter)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake during rebasing, now fixed.

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 26, 2020

The PR otherwise looks good to me (I reviewed the changes to the refman in particular).

@jfehrle
Copy link
Member Author

jfehrle commented Oct 26, 2020

Ah, I realize that changing numnotoption to numeral_modifier will be visible in the Tactic Notation command. Any use of numnotoption will be broken. (All of the 141 nonterminals with an ARGUMENT EXTEND are accessible in Tactic Notation.) I can handle this 3 ways, in order of my preference:

  1. Do nothing. This aspect of Tactic Notation has been undocumented and probably the symbol hasn't been used.
  2. Drop the old symbol, but print an error message giving the new name (as done recently for dropping var)
  3. Add a true deprecation warning and keep both symbols around for a while.

@herbelin
Copy link
Member

I believe that the probability that this undocumented symbol was used is close to 0. So, option 1 seems reasonable to me.

@jfehrle
Copy link
Member Author

jfehrle commented Oct 26, 2020

OK. I'm making one more small fix, should be done shortly.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Oct 27, 2020

The job library:ci-fiat_crypto_legacy has failed in allow failure mode
ping @JasonGross

@JasonGross
Copy link
Member

It seems like the f-c-l job should have been restarted automatically?

Fetching changes with git depth set to 10...
fatal: remote origin already exists.
From https://gitlab.com/coq/coq
 * [new ref]                   refs/pipelines/207965281 -> refs/pipelines/207965281
 + 7b73021ea2a1...916454000687 pr-13219                 -> origin/pr-13219  (forced update)
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
fatal: Unable to create '/builds/coq/coq/.git/gc.pid.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
Checking out 91645400 as pr-13219...
Skipping Git submodules setup
Downloading artifacts for build:edge+flambda (813372045)...
04:14
ERROR: Downloading artifacts from coordinator... error couldn't execute GET against https://gitlab.com/api/v4/jobs/813372045/artifacts: Get https://gitlab.com/api/v4/jobs/813372045/artifacts: dial tcp [2606:4700:90:0:f22e:fbec:5bed:a9b9]:443: connect: cannot assign requested address  id=813372045 token=B1UC8-6q
WARNING: Retrying...                               
ERROR: Downloading artifacts from coordinator... error  error=read tcp 172.17.0.2:33698->172.65.251.78:443: read: connection reset by peer id=813372045 responseStatus=200 OK token=B1UC8-6q
WARNING: Retrying...                               
ERROR: Downloading artifacts from coordinator... error couldn't execute GET against https://gitlab.com/api/v4/jobs/813372045/artifacts: Get https://gitlab.com/api/v4/jobs/813372045/artifacts: dial tcp [2606:4700:90:0:f22e:fbec:5bed:a9b9]:443: connect: cannot assign requested address  id=813372045 token=B1UC8-6q
FATAL: invalid argument                            
Uploading artifacts...
00:11
WARNING: _build_ci: no matching files              
ERROR: No files to upload                          
ERROR: Job failed: exit code 1

cc @Zimmi48 ?

@jfehrle
Copy link
Member Author

jfehrle commented Oct 27, 2020

OK, made my little fix (using ARGUMENT EXTEND ltac2_expr instead of ARGUMENT EXTEND tac2expr. I think the library:ci-fiat_crypto_legacy failure is unrelated--just that uploading artifacts failed at the end of the job. 3 other jobs still pending. Unless one of those breaks in an important way., I think this is ready to go.

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 27, 2020

Indeed, like @JasonGross said (thanks for reporting BTW), this is an unrelated failure that should have been restarted automatically (I have identified the issue). Just to be sure, I'm manually restarted the job.

@github-actions github-actions bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 27, 2020
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Oct 27, 2020
@jfehrle
Copy link
Member Author

jfehrle commented Oct 27, 2020

Rebased.

@herbelin
Copy link
Member

dpdgraph error related to pending overlay merge for #13073

@coqbot: merge now

@coqbot-app coqbot-app bot merged commit c8110e1 into coq:master Oct 27, 2020
@jfehrle
Copy link
Member Author

jfehrle commented Oct 27, 2020

Thank you, sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: cleanup Code removal, deprecation, refactorings, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants