Zulip Chat Archive

Stream: general

Topic: Duper on v4.4.0-rc1


Utensil Song (Dec 19 2023 at 04:31):

Anyone successfully added Duper to an existing project? The demo project and the live editor are on v4.3.0-rc1 and my v4.4.0-rc1 project added Duper by

require «Duper» from git "https://github.com/leanprover-community/duper.git" @ "v0.0.4"

then import Duper gives error

Error output

and more.

Utensil Song (Dec 19 2023 at 04:48):

These errors can be easily fixed by (not exhaustive but all are similar)

respectively, but I wonder if these are known regression or needed migrations.

Josh Clune (Dec 19 2023 at 04:54):

It looks like some of the proofs in lean-auto are breaking due to various changes from v4.3.0-rc1 and v4.4.0-rc1. At first glance, I'm pretty sure that most of the spots that are breaking pertain to other lean-auto functionalities, rather than the functionalities Duper actually depends on. So I think this should be relatively easy to fix. I'll take a look and try to push a version of Duper that builds on v4.4.0-rc1 as soon as I can. Sorry for the inconvenience, and thanks for letting me know of the issue.

Utensil Song (Dec 19 2023 at 04:59):

Thanks, also these breaking changes are brittle and I wonder if they are discussed before, the fixes are easy, but I don't know the new idiomatic way to write them as they look idiomatic to me as how they were. Changing dsimp to unfold or even simp_all, adding rfl after simp don't seem desired.

Utensil Song (Dec 19 2023 at 05:09):

There are 10 errors in .lake/packages/auto/Auto/Embedding/LamBitVec.lean including rfl type mismatch, rw pattern mismatch and apply fails to unify etc. , they are less easy to fix, e.g.

  theorem toNat_shiftLeft {a : Std.BitVec n} (i : Nat) : (a <<< i).toNat = (a.toNat * (2 ^ i)) % (2 ^ n) := by
    rw [shiftLeft_def]; rcases a with ⟨⟨a, isLt⟩⟩
    dsimp [Std.BitVec.shiftLeft, Std.BitVec.toNat, Std.BitVec.ofNat, Fin.ofNat']
    rw [Nat.shiftLeft_eq]

becomes

  theorem toNat_shiftLeft {a : Std.BitVec n} (i : Nat) : (a <<< i).toNat = (a.toNat * (2 ^ i)) % (2 ^ n) := by
    rw [shiftLeft_def]; rcases a with ⟨⟨a, isLt⟩⟩
    unfold Std.BitVec.shiftLeft
    unfold Std.BitVec.toNat
    unfold Std.BitVec.ofNat
    simp only [Nat.shiftLeft_eq, Nat.and_pow_two_is_mod]

(UPDATE: moved my messages to a new topic to focus on Duper discussions in the Duper topic)

Notification Bot (Dec 19 2023 at 05:17):

5 messages were moved here from #general > Duper by Utensil Song.

Jon Eugster (Dec 19 2023 at 09:54):

I also had a look at this a few days ago and it looked to me that the definition of Std.BitVec.ofNat changed in Std recently in a commit here which seems to be the main obstactle to bump LamBitVec.lean, which seems to be the biggest task to bump lean-auto to v4.4.0-rc1

In particular toNat_ofNat is no longer rfl, and that seems to be the main issue that needs fixing there. If thats done, the rest seems to follow rather easily

Josh Clune (Dec 19 2023 at 18:48):

Duper v0.0.5 now builds on Lean v4.4.0-rc1. For now, I've simply sidestepped the issue of proving toNat_ofNat in lean-auto because that portion of the codebase isn't really relevant to Duper itself. I'll plan to properly address that later, but for now, I think this should work. Feel free to let me know if you run into any additional issues.


Last updated: Dec 20 2023 at 11:08 UTC