feat(lean): preliminary core model extraction#1849
Merged
Conversation
7ecb79a to
780dd06
Compare
780dd06 to
41dbe1a
Compare
maximebuyse
reviewed
Jan 13, 2026
41dbe1a to
4fb2492
Compare
maximebuyse
approved these changes
Jan 13, 2026
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.
This PR adds an option to
core-models/hax.shto extract Lean code from Core models. It is able to generate a Lean file that compiles.To make the extraction work, I currently must exclude some functions and do some text replacements using
sed(seehax.sh). This is due to the following issues:self_vsself#1852GlobalIdsuffixes #1646Moreover, the following points should be improved in future PRs:
i128andu128should get a proper implementation ([Lean] Create u128 and i128 types #1854)hax_lib::opaque#1847)==should be rendered==([Lean] Render Rust's == as == in Lean #1845)This PR lets us produce a compiling Lean file, but the file is not part of this PR. This is because the generated items are all in the namespace
Core_models, whereas extracted Code referencesCore. So we cannot use the file just yet. In a future PR, I plan to make extraction generate references to theCore_modelsnamespace whenever extracting something that is not Core models itself. (#1855)[skip changelog]