Skip to content

Lean core-lib tests#5

Open
maximebuyse wants to merge 1 commit into
mainfrom
lean-tests
Open

Lean core-lib tests#5
maximebuyse wants to merge 1 commit into
mainfrom
lean-tests

Conversation

@maximebuyse
Copy link
Copy Markdown
Collaborator

This PR adds a new test framework allowing to check that the lean core library behaves like it is supposed to.

The tests are defined in rust, checking that a call to a core function's result with concrete params gives the expected concrete value. The rust is tested to validate that the expected values correspond to the behaviour of rust core. The tests are also translated to lean with aeneas, and checked in lean.

This should validate:

  • That the core models defined in Rust are correctly translated by Aeneas
  • That the manual lean definitions are correct (for primitives or temporary workarounds when aeneas can't extract some rust models)

@maximebuyse maximebuyse force-pushed the lean-tests branch 2 times, most recently from 1649cdb to eb69cd3 Compare May 20, 2026 09:03
@maximebuyse maximebuyse requested a review from abentkamp May 20, 2026 11:42
Comment on lines +10 to +12
//! - Several methods (`remove`, `clear`, `swap_remove`, `truncate`,
//! `resize`, `drain`) are `#[hax_lib::opaque]` in the model, so the Lean
//! side cannot observe their effect. Those are commented out.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The hax_lib::opaque are ignored by Aeneas. The definitions are present in Lean, e.g., https://github.com/cryspen/rust-core-models/blob/main/lean/CoreModels/Alloc/Funs.lean#L244-L253

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.

2 participants