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

Simplification is not equivalent, but it should be #664

Open
msooseth opened this issue Feb 17, 2025 · 1 comment
Open

Simplification is not equivalent, but it should be #664

msooseth opened this issue Feb 17, 2025 · 1 comment

Comments

@msooseth
Copy link
Collaborator

      let e = PEq (BufLength (AbstractBuf "esc_buf_CugleWOwEWXP")) (Lit 0)
      let simp = Expr.simplifyProp e
      let simpExpected = PEq (AbstractBuf "esc_buf_CugleWOwEWXP") (ConcreteBuf "")
      assertEqualM "buflen-to-empty" simp simpExpected
      ret <- checkEquivPropAndLHS e simpExpected
      assertBoolM "Must be equivalent" ret

Somehow we get a CEX, even though this simplification is good. I'll look into this. Triggered at: https://github.com/ethereum/hevm/actions/runs/13362022051/job/37313197906?pr=663 in PR #663 by @elopez

@msooseth
Copy link
Collaborator Author

Oh wow, so this somehow is SAT:

   1   │ ;(PNeg
   2   │ ;  (PAnd
   3   │ ;    (PImpl
   4   │ ;      (PEq
   5   │ ;        (BufLength
   6   │ ;          (AbstractBuf "mybuf")
   7   │ ;        )
   8   │ ;        0
   9   │ ;      )
  10   │ ;      (PEq
  11   │ ;        (AbstractBuf "mybuf")
  12   │ ;        (ConcreteBuf "")
  13   │ ;      )
  14   │ ;    )
  15   │ ;    (PImpl
  16   │ ;      (PEq
  17   │ ;        (AbstractBuf "mybuf")
  18   │ ;        (ConcreteBuf "")
  19   │ ;      )
  20   │ ;      (PEq
  21   │ ;        (BufLength
  22   │ ;          (AbstractBuf "mybuf")
  23   │ ;        )
  24   │ ;        0
  25   │ ;      )
  26   │ ;    )
  27   │ ;  )
  28   │ ;)

which sounds wrong. buflength=0 should imply and empty buf, and an empty buf should emply buflength=0.

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