-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor: cleanup popcount proof #168
Conversation
Specifically, it's the root cause of the `Decidable.rec` we've been seeing. MWE at: https://live.lean-lang.org/#project=lean-nightly&codez=KYDwhgtgDgNsAEAKA1vAXPACgJwPZQEp4kALdeZIgbQGkARAUQGEM7gBjASwBMwAjOBQC65AFDFicAC7xAF+RgANPD6BL8nQBeeJwBmFeFJLAAdkgCMSgAxFgMAM4JEFpaYLiJYeJtMblATze2nNDwVCRCQA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened an issue upstream for the pattern-matching beheviour: leanprover/lean4#5388
To be rebased on top of #171 |
### Issues: This works around leanprover/lean4#5388, and removes uses of `simp (config := { ground := true }) ..`. This makes our proof states cleaner, since we no longer see proof states involving `Decidable.rec ...`. Peeled from #168 ### Testing: What tests have been run? Did `make all` succeed for your changes? Was conformance testing successful on an Aarch64 machine? `make all` succeeded, conformance succeeded. ### License: By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Shilpi Goel <[email protected]>
@alexkeizer after rebasing, for whatever reason, proofs in I tried debugging this for a bit, then gave up:
|
@alexkeizer I think we should add an option into |
Aha, let me try and just disable all linters... |
Apparently setting it to 0 does not disable the check, it just makes the limit 0
Description:
We've cleaned up the popcount proof by:
sym_aggregate
to also search for memory effect hypotheses to simplify, andadd_sub_immediate
to avoid pattern-matching. It turns out that pattern-matching on the result of anif
(e.g.,let (a, b) := if x = 0 then (foo, bar) else (bar, foo)
) get's reduced to aDecidable.rec
bysimp only
, which then gets stuck. By rephrasing it in terms of projections, we avoid this, and get clean simplified semantics.AddWithCarry
to thebitvec_rules
simpsetTesting:
make all
succeeds.License:
By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.