Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate projectors for recursive structs during Lean extraction #185

Closed
R1kM opened this issue May 15, 2024 · 1 comment · Fixed by #194
Closed

Generate projectors for recursive structs during Lean extraction #185

R1kM opened this issue May 15, 2024 · 1 comment · Fixed by #194
Assignees

Comments

@R1kM
Copy link
Collaborator

R1kM commented May 15, 2024

As described in #178, recursive Rust structs are extracted to Lean inductives due to Lean not supporting recursion in structures.
However, to retrieve similar functionalities, it would be useful to always extract projectors in this specific case, which is already done for the Coq backend.

@sonmarcho
Copy link
Member

This solution actually also works for this issue (the problem is the same: Lean doesn't natively support recursive structures): #176

Also, we will have to find a way of automatically reducing projections (e.g., (Pair.mk 0 1).fst ~~> 0). I'm not sure what the best way to do that is: we could generate simplification lemmas and mark them as @simp but I think simp has a special attribute for projections. See this: https://github.com/leanprover-community/lean/blob/cce7990ea86a78bdb383e38ed7f9b5ba93c60ce0/library/init/meta/simp_tactic.lean#L276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants