Merged
Conversation
7a964cd to
45cc970
Compare
2dcfc8a to
8f767a0
Compare
7800bb8 to
f059715
Compare
8241607 to
8a0d3f9
Compare
W95Psp
reviewed
Jul 2, 2025
W95Psp
reviewed
Jul 2, 2025
W95Psp
reviewed
Jul 2, 2025
W95Psp
reviewed
Jul 2, 2025
W95Psp
reviewed
Jul 2, 2025
W95Psp
approved these changes
Jul 2, 2025
Contributor
W95Psp
left a comment
There was a problem hiding this comment.
LGTM, I only have a few comments :)
Base automatically changed from
rengine-pretty-multibackends
to
rengine-add-resguaring-nodes
July 2, 2025 09:35
Base automatically changed from
rengine-add-resguaring-nodes
to
rengine-conform-engine-interface
July 2, 2025 09:35
franziskuskiefer
approved these changes
Jul 2, 2025
Member
franziskuskiefer
left a comment
There was a problem hiding this comment.
Looks like we should get this in.
Just two nits/questions.
Contributor
|
Let's merge! |
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.
Lean Backend [Part 1/3] (experimental)
This PR provides the first step towards a fully functional Lean backend. It contains the infrastructure for exporting rust programs to Lean, with support for a starting subset of Rust expressions. It should be considered as experimental: unsupported features might not be documented and the actual Lean encoding is susceptible to change in the future.
Dependencies
This PR is based on #1525 (for printing infrastructure) and on #1508 (for reusing OCaml engine phases).
Context
In the current infrastructure, the Rust Engine is able to use the OCaml one (through the bridge of #1508) to apply the engine phases, and get back the output ast (as defined in ast.rs). Therefore, we can implement backends directly in Rust. Some generic infrastructure has been introduced in #1525 (support multiple backends) and #1528 (support for resugaring). This PR introduces a first instance of this infrastructure applied to Lean.
Details
Doc, which can be seen as an extended string type that supports annotations. ThePrettytrait is implemented for each part of the AST in lean.rs.cargo hax into leanExamples
Example rust code
Lean extract
Note that, without a Lean prelude, all the identifiers introduced by Hax are undefined: the code is syntactically valid but does not typecheck.
Goals
This PR does not provide support more advanced features (enums, traits, structures, generic arguments, etc).