Repository navigation
fix: circuit simplify and extens must not prove false judgements - #1203
Merged
Merged
Conversation
Two circuit tactics proved false hoare judgements.
`circuit simplify` replaced each bitstring / array equality of the
postcondition by `true` when the circuits prove it valid, and by
`false` otherwise. An equality that is not valid may still hold in
some states, so this is unsound under a negation. With
proc f(x : W8) = { return x; }
it proved
hoare[M.f : true ==> !(res = of_int 0)]
An equality that the circuits do not prove valid is now kept as is.
`extens [x]` replaces `x` by each of its values in the program, the
precondition and the postcondition, but the postcondition reads `x` in
the final memory. With
proc f(x : W8) = { x <- of_int 0; return x; }
it proved
hoare[M.f : x = of_int 1 ==> res = of_int 1]
It now fails when the program writes `x`.
Fixes #1201.
Fixes #1202.
Origin: e07ffa0 (2026-06-24), first released in r2026.07.
Test: tests/circuits/circuit_soundness.ec (the previous build accepts
the two `fail` lines). tests/circuits, unit (125 files) and stdlib
(128) pass.
strub
force-pushed
the
fix/circuit-simplify-extens
branch
from
October 9, 2026 15:26
7016531 to
ae557db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two circuit tactics proved false hoare judgements.
circuit simplifyreplaced each bitstring / array equality of thepostcondition by
truewhen the circuits prove it valid, and byfalseotherwise. An equality that is not valid may still hold insome states, so this is unsound under a negation. With
it proved
An equality that the circuits do not prove valid is now kept as is.
extens [x]replacesxby each of its values in the program, theprecondition and the postcondition, but the postcondition reads
xinthe final memory. With
it proved
It now fails when the program writes
x.Fixes #1201.
Fixes #1202.
Origin: e07ffa0 (2026-06-24), first released in r2026.07.
Test: tests/circuits/circuit_soundness.ec (the previous build accepts
the two
faillines). tests/circuits, unit (125 files) and stdlib(128) pass.