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

Add Blog for safety-of-methods-for-numeric-primitive-types - 2024-12-02 #51

Merged
merged 33 commits into from
Dec 19, 2024

Conversation

rajathkotyal
Copy link
Contributor

@rajathkotyal rajathkotyal commented Dec 3, 2024

Towards : model-checking/verify-rust-std#59

Description : This blog post talks about verifying the safety of unsafe methods which use Rust's numeric primitive data types.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Member

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Thank you!

@Yenyun035
Copy link
Contributor

Yenyun035 commented Dec 3, 2024

@tautschnig @celinval @zhassan-aws @feliperodri We have finished the draft. Appreciate any feedback :)

@celinval celinval self-assigned this Dec 4, 2024
Copy link

@celinval celinval left a comment

Choose a reason for hiding this comment

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

I really liked the blog post. My main suggestion is to improve a little bit the explanation about the need for range partitioning into the checks that involved multiplication.

I think it's good to clarify that the problem here is the complexity of the SAT formula generated for multiplications. For example, the input space for addition and multiplication are the same, but only the multiplication requires partitioning.

@tautschnig do you know any good reference that we can use so we don't have to give too much details on why multiplications are hard for sat solvers?

@tautschnig
Copy link
Member

I really liked the blog post. My main suggestion is to improve a little bit the explanation about the need for range partitioning into the checks that involved multiplication.

I think it's good to clarify that the problem here is the complexity of the SAT formula generated for multiplications. For example, the input space for addition and multiplication are the same, but only the multiplication requires partitioning.

@tautschnig do you know any good reference that we can use so we don't have to give too much details on why multiplications are hard for sat solvers?

From Randy E Bryant's "Graph-Based Algorithms for Boolean Function Manipulation" (1986) we know that the Boolean function representing all outputs of a multiplier as a BDD is exponential in the size of the operands. We can do a more compact representation in CNF, but it will still be quadratic in the size of the operands. And those turn out to be hard to solve for SAT solvers, which in some ways is good news, as otherwise we could rather efficiently do factorisation of numbers (and thereby, in practice, break some of today's cryptographic algorithms).

Copy link
Member

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

This is a great post! Awesome job. My main comments are about some technical points in section 2--request my re-review once addressed and I'll approve.

@carolynzech carolynzech assigned Yenyun035 and unassigned celinval Dec 18, 2024
Copy link
Contributor

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

Thanks!

@carolynzech carolynzech merged commit b13c605 into model-checking:main Dec 19, 2024
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.

7 participants