Repository navigation
CBMC: Use constant quantifier ranges in some loop invariants - #1495
Draft
mkannwischer wants to merge 3 commits into
Draft
mkannwischer wants to merge 3 commits into
mkannwischer wants to merge 3 commits into
Conversation
Add a cadical solver profile that uses CBMC's propositional backend with CaDiCaL instead of an SMT solver. Use it as a second solver for 10 proofs that discharge in about 150s or less locally for ML-DSA-87, for which the SMT alternatives timed out, returned unknown or were too slow. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Add a second solver for 8 proofs that discharge in about 175s or less locally for ML-DSA-87: - bitwuzla: nttunpack_native_x86_64, poly_invntt_tomont_c, poly_pointwise_montgomery_c, poly_uniform, poly_uniform_eta - cvc5_mbqi_enum: polyvecl_pointwise_acc_montgomery_native - z3_smt_only: invntt_layer (bitwuzla default) - z3_no_bv_extract: ntt_butterfly_block (bitwuzla default) Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
CBMC's propositional backend only expands a quantifier whose range
bounds simplify to constants. Otherwise it replaces the quantifier
by an unconstrained literal ("warning: ignoring forall"), which can
lead to spurious failures. Loop invariants of the form
forall(k, 0, i, P) or forall(k, i, N, P), with i the loop counter,
therefore cannot be checked with cadical.
Rewrite these invariants as forall(k, 0, N, k < i ==> P) and
forall(k, 0, N, k >= i ==> P), respectively. This is equivalent
given the existing invariant i <= N.
With this, add cadical as a second solver for 8 proofs: poly_add,
polyveck_caddq, polyveck_decompose_pack_w1, polyveck_invntt_tomont,
polyveck_ntt, polyveck_reduce, polyvecl_ntt and unpack_sk_t0hat.
Most of these are slow with cadical, locally between about 250s and
600s for ML-DSA-87.
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Contributor
CBMC Results (ML-DSA-44, REDUCE-RAM)
Full Results (423 configurations)
|
Contributor
CBMC Results (ML-DSA-44)
Full Results (423 configurations)
|
Contributor
CBMC Results (ML-DSA-65)
Full Results (423 configurations)
|
Contributor
CBMC Results (ML-DSA-65, REDUCE-RAM)
Full Results (423 configurations)
|
Contributor
CBMC Results (ML-DSA-87, REDUCE-RAM)
Full Results (423 configurations)
|
Contributor
CBMC Results (ML-DSA-87)
Full Results (423 configurations)
|
This branch has not been deployed
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.
CBMC's propositional backend only expands a quantifier whose range
bounds simplify to constants. Otherwise it replaces the quantifier
by an unconstrained literal ("warning: ignoring forall"), which can
lead to spurious failures. Loop invariants of the form
forall(k, 0, i, P) or forall(k, i, N, P), with i the loop counter,
therefore cannot be checked with cadical.
Rewrite these invariants as forall(k, 0, N, k < i ==> P) and
forall(k, 0, N, k >= i ==> P), respectively. This is equivalent
given the existing invariant i <= N.
With this, add cadical as a second solver for 8 proofs: poly_add,
polyveck_caddq, polyveck_decompose_pack_w1, polyveck_invntt_tomont,
polyveck_ntt, polyveck_reduce, polyvecl_ntt and unpack_sk_t0hat.
Most of these are slow with cadical, locally between about 250s and
600s for ML-DSA-87.