Skip to content

Lean tutorial first version.#1626

Merged
W95Psp merged 16 commits intomainfrom
lean-tutorial
Sep 9, 2025
Merged

Lean tutorial first version.#1626
W95Psp merged 16 commits intomainfrom
lean-tutorial

Conversation

@maximebuyse
Copy link
Copy Markdown
Contributor

@maximebuyse maximebuyse commented Aug 26, 2025

This PR adds documentation about the Lean backend in the hax tutorial. It covers:

  • How to setup a lakefile.toml to verify a Rust crate using hax and Lean.
  • Basic description of the Lean backend, and its specificity, in particular the difference with respect to panic-freedom.
  • The example of the square function, how to specify panic-freedom, prove it using a pre-condition, and prove a simple post-condition.

@maximebuyse maximebuyse requested a review from a team as a code owner August 26, 2025 08:53
@maximebuyse
Copy link
Copy Markdown
Contributor Author

I added the playground integration for lean! I took the opportunity to make small fixes in the playground integration like fixing the "extract + type-check" button which was missing. For now the code snippets that are expected to type-check don't, that's because of the missing lib stuff that are part of this PR (so everything should work once the PR gets merged). @W95Psp I have a small problem: in the result of the playground queries Done.success is set to true for lean, event when type-checking fails.

@W95Psp
Copy link
Copy Markdown
Contributor

W95Psp commented Aug 27, 2025

@maximebuyse and I discussed in some other places about that bug, I fixed it in the playground.
(the captured and returned exit code was wrong)

Copy link
Copy Markdown
Contributor

@karthikbhargavan karthikbhargavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's merge and improve.

@karthikbhargavan
Copy link
Copy Markdown
Contributor

Unless there is something left here, please merge.

@W95Psp
Copy link
Copy Markdown
Contributor

W95Psp commented Sep 8, 2025

After some discussion we decided to split the tutorial in two: one for F*, one for Lean, and probably one for other backends in the future.

@maximebuyse
Copy link
Copy Markdown
Contributor Author

@W95Psp @clementblaudeau This is ready for re-review.

@W95Psp
Copy link
Copy Markdown
Contributor

W95Psp commented Sep 8, 2025

Looking at it now

Copy link
Copy Markdown
Contributor

@clementblaudeau clementblaudeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice addition ! I've added a few suggestions.

maximebuyse and others added 3 commits September 8, 2025 14:57
Co-authored-by: Clément Blaudeau <40171892+clementblaudeau@users.noreply.github.com>
To rename a title without renaming the folder itself, create a `.nav.yml` with:
```
title: whatever
```
@maximebuyse maximebuyse requested a review from W95Psp September 8, 2025 13:56
@maximebuyse
Copy link
Copy Markdown
Contributor Author

The CI fails because of missing space. I wonder if the addition of mkdocs-awesome-nav to the nix inputs could be the reason. But this should affect only docs and the failing jobs are unrelated. I don't really know how to debug that.

@W95Psp
Copy link
Copy Markdown
Contributor

W95Psp commented Sep 8, 2025

Seems like some of our CI runs on the self hosted runners?
anyway, it seems the disk is full, I'm running some garbage collection for nix (with the playground, we can end up with a big number of hax in the same time that eats up quickly the disk)

@maximebuyse
Copy link
Copy Markdown
Contributor Author

Seems like some of our CI runs on the self hosted runners? anyway, it seems the disk is full, I'm running some garbage collection for nix (with the playground, we can end up with a big number of hax in the same time that eats up quickly the disk)

Yes, I also noticed it was an issue on self hosted runners only. I don't think there is a good reason to do so and it was probably by mistake, so I pushed a change to run all jobs on github hosted runners.

@W95Psp W95Psp enabled auto-merge September 9, 2025 05:28
@W95Psp W95Psp added this pull request to the merge queue Sep 9, 2025
Merged via the queue into main with commit ee62a7d Sep 9, 2025
18 checks passed
@W95Psp W95Psp deleted the lean-tutorial branch September 9, 2025 06:38
@W95Psp W95Psp mentioned this pull request Sep 16, 2025
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 this pull request may close these issues.

4 participants