Skip to content

Chore: Update Chamelean with the updated handler for deriving Arbitrary instances#35

Merged
ngernest merged 83 commits intometaprogrammingfrom
merge_plausible_pr
Aug 12, 2025
Merged

Chore: Update Chamelean with the updated handler for deriving Arbitrary instances#35
ngernest merged 83 commits intometaprogrammingfrom
merge_plausible_pr

Conversation

@ngernest
Copy link
Copy Markdown
Owner

@ngernest ngernest commented Aug 12, 2025

This PR propagates the changes to the handler for deriving Arbitrary instances from leanprover-community#35 to Chamelean.

For documentation purposes, we summarize the changes to the handler here:

  • We now support deriving Arbitrary instances for supports parameterized types / mutually recursive types. See ParameterizedTypeTest.lean and MutuallyRecursiveTypeTest.lean.
  • The Arbitrary deriving handler has been re-implemented following the idioms for the deriving Repr / BEq handlers
  • We now use Core.mkFreshUserName (instead of LocalContext.getUsedName) to produce fresh names. As a result, the derived Arbitrary instance is meant to be opaque.
  • Every deriving Arbitrary snapshot test now comes with an example of how the derived generator produces a counter-example that refutes some (erroneous) property
  • Instead of a command elaborator #derive_generator, we have a trace class trace.plausible.deriving.arbitrary that prints the code for the derived generator if the user enables the option.

Note: Some imports & definitions (e.g. for the STLC snapshot tests) have been moved around so that everything compiles.

kim-em and others added 30 commits May 1, 2025 13:17
* patches for nightly-2025-01-04, and drop Batteries dependency

* fix adaptation note

* merge main

* fixes for leanprover/lean4#7516

* merge lean-pr-testing-7516

* deprecations

* chore: bump toolchain to v4.21.0-rc1

---------

Co-authored-by: Kim Morrison <kim@tqft.net>
* patches for nightly-2025-01-04, and drop Batteries dependency

* fix adaptation note

* merge main

* fixes for leanprover/lean4#7516

* merge lean-pr-testing-7516

* deprecations

* chore: bump toolchain to v4.22.0-rc1
* patches for nightly-2025-01-04, and drop Batteries dependency

* fix adaptation note

* merge main

* fixes for leanprover/lean4#7516

* merge lean-pr-testing-7516

* deprecations

* chore: bump toolchain to v4.22.0-rc2
* patches for nightly-2025-01-04, and drop Batteries dependency

* fix adaptation note

* merge main

* fixes for leanprover/lean4#7516

* merge lean-pr-testing-7516

* deprecations

* chore: bump toolchain to v4.22.0-rc3
* patches for nightly-2025-01-04, and drop Batteries dependency

* fix adaptation note

* merge main

* fixes for leanprover/lean4#7516

* merge lean-pr-testing-7516

* deprecations

* chore: bump toolchain to v4.22.0-rc4
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
ngernest added 24 commits July 31, 2025 12:05
WIP: Handle parameterized + mutually recursive types when deriving `Arbitrary` instances
@ngernest ngernest changed the title Update Chamelean with the updated deriving handler for Arbitrary from the Plausible PR Update Chamelean with the updated handler for deriving Arbitrary instances Aug 12, 2025
@ngernest ngernest changed the title Update Chamelean with the updated handler for deriving Arbitrary instances Chore: Update Chamelean with the updated handler for deriving Arbitrary instances Aug 12, 2025
@ngernest ngernest marked this pull request as ready for review August 12, 2025 16:12
@ngernest ngernest merged commit bf16b43 into metaprogramming Aug 12, 2025
2 checks passed
@ngernest ngernest deleted the merge_plausible_pr branch August 12, 2025 16:12
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.

3 participants