Skip to content

Keep track of which variables are section variables and use this info to fix bugs#21987

Open
SkySkimmer wants to merge 12 commits into
rocq-prover:masterfrom
SkySkimmer:context-secvar
Open

Keep track of which variables are section variables and use this info to fix bugs#21987
SkySkimmer wants to merge 12 commits into
rocq-prover:masterfrom
SkySkimmer:context-secvar

Conversation

@SkySkimmer
Copy link
Copy Markdown
Contributor

@SkySkimmer SkySkimmer commented Apr 30, 2026

@SkySkimmer SkySkimmer requested review from a team as code owners April 30, 2026 15:17
@SkySkimmer SkySkimmer added the needs: merge of dependency This PR depends on another PR being merged first. label Apr 30, 2026
@SkySkimmer SkySkimmer requested review from a team as code owners April 30, 2026 15:17
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@SkySkimmer SkySkimmer requested review from a team as code owners April 30, 2026 15:17
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@SkySkimmer SkySkimmer requested a review from a team as a code owner April 30, 2026 15:49
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 30, 2026
@SkySkimmer
Copy link
Copy Markdown
Contributor Author

hott failure is because they workaround #18858 by explcitly clearing

@SkySkimmer
Copy link
Copy Markdown
Contributor Author

@coqbot ci minimize ci-stdlib

Alizter added a commit to HoTT/Coq-HoTT that referenced this pull request May 19, 2026
Adapt to rocq-prover/rocq#21987 (destruct clears non section variable even when reusing a section variable's name)
@silene
Copy link
Copy Markdown
Contributor

silene commented May 19, 2026

Section variables have almost nothing in common with variable do they?

  • clear maybe although should probably be done via using

Note that there are proofs where you want to do using H (because you need H in the proof) but also clear H (because you want to temporarily hide H to prevent some disaster, e.g., clear H ; nia). So, their roles are somewhat orthogonal. The case where they overlap is when the call to clear is the very first step of a proof (in which case using is a much better choice, indeed).

@SkySkimmer SkySkimmer added request: full CI Use this label when you want your next push to trigger a full CI. and removed needs: changelog entry This should be documented in doc/changelog. labels May 19, 2026
@SkySkimmer SkySkimmer requested review from a team as code owners May 19, 2026 15:52
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label May 19, 2026
SkySkimmer added a commit to SkySkimmer/Equations that referenced this pull request May 20, 2026
SkySkimmer added a commit to SkySkimmer/Equations that referenced this pull request May 20, 2026
SkySkimmer added a commit to SkySkimmer/coq-elpi that referenced this pull request May 20, 2026
SkySkimmer added 12 commits May 20, 2026 16:58
This lets us detect if a variable is some unrelated variable which got
renamed to the name of a previously cleared section variable.

It's also cheaper than conversion but that's not really the point of
this patch.

Fix rocq-prover#11487
This is accessible through Ltac2 Std.clear which doesn't check the ids
before sending to Tactics.clear, and through ltac1 by abusing bound
values eg `Ltac foo := match goal with H : _ |- _ => clear H; clear H end`
Termops.is_section_variable is deprecated and a new API
Termops.is_section_variable' is added because their types are the same
but they need different env arguments so changing in place would be too footgunny.

ssr still uses the old "is it in global env" because IDK what it is
doing.

Fix rocq-prover#18858
when this invariant is broken secvar checking produces another assert
failure later
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label May 20, 2026
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label May 20, 2026
@SkySkimmer
Copy link
Copy Markdown
Contributor Author

@coqbot bench

@SkySkimmer
Copy link
Copy Markdown
Contributor Author

bug_4095 is failing because we push an already used name in

let env_rhs' = push_named (NamedDecl.LocalAssum (id,idty)) env_rhs in

IDK WTF is going on here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: fix This fixes a bug or incorrect documentation. kind: redesign The same functionality is being re-implemented in a different way. needs: overlay This is breaking external developments we track in CI. part: sections The section mechanism of Coq.

Projects

None yet

6 participants