Skip to content

Generalize DeclareScheme to use GlobRef instead of inductive#21811

Open
thomas-lamiaux wants to merge 1 commit intorocq-prover:masterfrom
thomas-lamiaux:genScheme
Open

Generalize DeclareScheme to use GlobRef instead of inductive#21811
thomas-lamiaux wants to merge 1 commit intorocq-prover:masterfrom
thomas-lamiaux:genScheme

Conversation

@thomas-lamiaux
Copy link
Copy Markdown
Contributor

@thomas-lamiaux thomas-lamiaux commented Mar 23, 2026

First step to support #21801

  • Added / updated test-suite.
  • Added changelog.
  • Added / updated documentation.
    • Documented any new / changed user messages.
    • Updated documented syntax by running make doc_gram_rsts.
  • Opened overlay pull requests.

LPCIC/coq-elpi#986

@thomas-lamiaux thomas-lamiaux requested review from a team as code owners March 23, 2026 16:20
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 23, 2026
thomas-lamiaux added a commit to thomas-lamiaux/coq-elpi that referenced this pull request Mar 23, 2026
@thomas-lamiaux
Copy link
Copy Markdown
Contributor Author

@coqbot run full-ci

@thomas-lamiaux
Copy link
Copy Markdown
Contributor Author

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 23, 2026
@ppedrot ppedrot self-assigned this Mar 25, 2026
declare_object @@ object_with_locality "SCHEME"
~cache:cache_scheme
~subst:(Some subst_scheme)
~discharge:(fun x -> x)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should do something special for VarRef as they may vanish from the environment at section closure time depending on the segment they're defined in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I asked how to generalize it, I was told put GlobRef everywhere.
If you prefer another change, I need to be told exactly what you want.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is unrelated to my point. Putting GlobRef.t is the way to go but it doesn't preclude having to fix some bits. Here, the discharge function must be fixed.

@ppedrot ppedrot added this to the 9.3+rc1 milestone Mar 25, 2026
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 25, 2026
@thomas-lamiaux
Copy link
Copy Markdown
Contributor Author

After getting roasted I implemented this fix, it is satisfactory @ppedrot ? Do I need to modify the refman ?

@ppedrot
Copy link
Copy Markdown
Member

ppedrot commented Mar 27, 2026

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 27, 2026
@ppedrot ppedrot added the kind: internal API, ML documentation... label Mar 27, 2026
| RegisterInline
| RegisterCoqlib of qualid
| RegisterScheme of { inductive : qualid; scheme_kind : qualid }
| RegisterScheme of { key_ref : qualid; scheme_kind : qualid }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a very weird field name, I'd rather have globref or just ref to keep within the style of the rest of the code. (Also, you're not the one to have introduced it but I find that the nested record is not very useful here.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have fixed it. What don't you like about the record ? It seems to me like a better practice than having RegisterScheme of qualid * qualid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You're not wrong, but in a not so old past, having non-unique field names was a recipe for disaster so I guess I'm just overreacting to inline records.

@thomas-lamiaux
Copy link
Copy Markdown
Contributor Author

Probably need rebase since #20987 was merged

@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 27, 2026
prevent registering scheme for section variables without the local attribute
@thomas-lamiaux
Copy link
Copy Markdown
Contributor Author

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: internal API, ML documentation...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants