Skip to content

Formal Verification - Lean4 Integration#7549

Open
ivan-randjelovic-cp wants to merge 27 commits into
XRPLF:developfrom
commonprefix:lean4-initial-setup
Open

Formal Verification - Lean4 Integration#7549
ivan-randjelovic-cp wants to merge 27 commits into
XRPLF:developfrom
commonprefix:lean4-initial-setup

Conversation

@ivan-randjelovic-cp

Copy link
Copy Markdown

This PR involves integration of Lean4 into xrpld. Please look at docs/formal-verification/README.md.

The README covers the Lean4 to C++ integration end to end: the motivation, terminology, an architecture overview, the build/integration flow (Conan toolchain -> CMake -> tests), how the Lean4 model is written, and how the FFI bridge lets C++ call it.

The PR adds an example Lean4 model (Number), properties/theorems proved about it, and an example C++ unit test that cross-validates the Lean4 model against the real C++.

I apologize for not using the usual PR description, as this is an out-of-ordinary type of a pull request.

@github-actions

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign them. ⚠️

If only the most recent commit is unsigned, you can run:

  1. Amend the commit: git commit --amend --no-edit -n -S
  2. Overwrite the commit: git push --force-with-lease

If multiple commits are unsigned, you can run:

  1. Go into interactive rebase mode: git rebase --interactive HEAD~<NUM_OF_COMMITS>, where NUM_OF_COMMITS is the number of most recent commits that will be available to edit.
  2. Change "pick" to "edit" for the commits you need to sign, and then save and exit.
  3. For each commit, run: git commit --amend --no-edit -n -S
  4. Continue the rebase: git rebase --continue
  5. Overwrite the commit(s): git push --force-with-lease

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.
See use 1Password to sign your commits.

ivan-randjelovic-cp and others added 19 commits June 17, 2026 02:08
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Comment thread external/lean4/conanfile.py Outdated
Comment thread external/lean4/conanfile.py Outdated
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
Signed-off-by: Ivan Randjelovic <ivan@commonprefix.com>
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants