Add proof reconstruction for Admitted/Section-local theorems#15
Open
spitters wants to merge 2 commits intoLLM4Rocq:mainfrom
Open
Add proof reconstruction for Admitted/Section-local theorems#15spitters wants to merge 2 commits intoLLM4Rocq:mainfrom
spitters wants to merge 2 commits intoLLM4Rocq:mainfrom
Conversation
When rocq_start in position mode detects proof_finished=True inside an Admitted proof body, reconstruct the open proof state by: 1. Search backwards for the enclosing Lemma/Theorem declaration 2. Try pet.start(thm_name) for top-level theorems 3. Fall back to replaying Section preamble for Section-local theorems 4. Replay tactics from Proof. to cursor position This enables the common workflow of interactively proving Admitted theorems without having to remove Admitted from the file first. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Member
|
I cannot reproduce this issue locally. With a simple file a.v: Theorem foo n m: n + m = m + n.
Proof. Admitted.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_reconstruct_proof_state()function tointeractive.pythat reconstructs an open proof state whenrocq_startin position mode returnsproof_finished=Trueinside an Admitted proofrun_start: when position mode detectsproof_finished=True, attempt reconstruction before returningpet.start(thm_name)for top-level theoremsProof.to cursor position (block first, sentence-by-sentence fallback)Motivation
The most common use case for
rocq_startin position mode is inspecting and provingAdmittedtheorems. Without this patch,get_state_at_posreturnsproof_finished=Truefor any position inside an Admitted proof body, making interactive proving impossible. Users must manually removeAdmittedfrom the file before they can work on the proof.This is especially painful for Section-local theorems where
pet.start(thm_name)also fails — the only way to get an open proof state is to replay the entire Section preamble.Test plan
run_startposition mode: trigger, skip, failure preservation🤖 Generated with Claude Code