Skip to content
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

lsimp projection sees through let bindings #20

Open
lecopivo opened this issue Sep 6, 2023 · 1 comment
Open

lsimp projection sees through let bindings #20

lecopivo opened this issue Sep 6, 2023 · 1 comment

Comments

@lecopivo
Copy link
Owner

lecopivo commented Sep 6, 2023

In some cases projections can destroy let bindings in lsimp

#check 
   (fun i : Nat =>
      let j := 42
      let foo := ((i * j, i+j), (i ^ j, i / j))
      foo.fst.snd)
   rewrite_by
     lsimp (config := {zeta:=false}) only

returns

(fun i : Nat =>
      let j := 42
      i + j)

which is undesirable. We want to split foo intor four let bindings

   (fun i : Nat =>
      let j := 42
      let foo := ((i * j, i+j), (i ^ j, i / j))
      foo.fst.snd)
==>
   (fun i : Nat =>
      let j := 42
      let foo_fst_fst := (i * j)
      let foo_fst_snd:= (i+j)
      let foo_snd_fst := (i ^ j)
      let foo_snd_snd := (i / j)
      ((foo_fst_fst, foo_fst_snd),(foo_snd_fst,foo_snd_snd)).fst.snd)
==>
   (fun i : Nat =>
      let j := 42
      let foo_fst_snd:= (i+j)
      foo_fst_snd)

Such transformation is currently part of let_normalize but should be an integral part of lsimp

lecopivo added a commit that referenced this issue Sep 6, 2023
should improve state of #20 but still not solved
@lecopivo lecopivo reopened this Apr 22, 2024
@lecopivo
Copy link
Owner Author

This is problem again but with how Tactic.lift_lets_simproc works now.

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

No branches or pull requests

1 participant