Skip to content

Conversation

@namasikanam
Copy link
Collaborator

@namasikanam namasikanam commented Jan 20, 2026

The second goal generated from byehoare is unsound, in which the procedure arguments are bound in a free memory.

This is a small bug introduced in #789 . We need to bind the precondition to the memory in probability expression.

Thank @lyonel2017 for helping fix this bug.

@namasikanam namasikanam requested a review from oskgo January 20, 2026 17:19
@oskgo
Copy link
Contributor

oskgo commented Jan 20, 2026

Nice catch.

There's still a bug though:

require import Real Xreal.

module M = {
  proc main(x : bool) = {
    return x; 
  }
}.

lemma L1 (&m: {arg: bool}): !arg{m} =>
  Pr [ M.main(true) @ &m : true] <= 0%r.
proof.
move => arg_eq.
byehoare (_: (!arg{m})%xr ==> _) => //.
proc; auto. by rewrite arg_eq.
qed.

Copy link
Member

@strub strub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a better commit message.

(explain what you actually fix. It is OK to have the commit message be the PR message. But "fix ehoare" is useless when you look at the history)

@namasikanam namasikanam requested a review from strub January 22, 2026 10:15
@strub strub force-pushed the byehoare-mem-rebind branch 2 times, most recently from c796444 to d121ca4 Compare January 22, 2026 15:00
@strub strub enabled auto-merge (rebase) January 22, 2026 15:00
The second goal generated from byehoare is unsound, in
which the procedure arguments are bound in a free memory.

This is a small bug introduced in #789 . We need to bind
the precondition to the memory in probability expression.
@strub strub force-pushed the byehoare-mem-rebind branch from d121ca4 to f4a7005 Compare January 22, 2026 15:48
@strub
Copy link
Member

strub commented Jan 22, 2026

@oskgo I incorporated your example, but it is not working. Is qed should be a abort?

@namasikanam
Copy link
Collaborator Author

@oskgo I incorporated your example, but it is not working. Is qed should be a abort?

@strub This is a counterexample, which should not be working. I'm not sure what's the best way to incorporate this example. Do we have other negative examples in tests?

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.

4 participants