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 additional assertion to UInt_sqrt #1587

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Gungy2
Copy link
Contributor

@Gungy2 Gungy2 commented Jun 6, 2023

Summary

This PR fixes issue #1586 by adding an assertion for the UInt_sqrt function.

@jeapostrophe
Copy link
Collaborator

Were you able to test this? Does it make your code work?

@Gungy2
Copy link
Contributor Author

Gungy2 commented Jun 7, 2023

Yes, it makes my code work. The assertion should only work for the right integer square root, if I am not mistaken.

@Gungy2
Copy link
Contributor Author

Gungy2 commented Jun 7, 2023

The only issue with this assertion is that, while it is perfect (meaning that it passes just for the exact number) it tends to overwhelm the SMT solver (for my program, which is relatively complex, it times out multiple times). So I am not sure what is the right approach here to strike the balance between correctness (usability) and performance. Alternatively, to get around this, enforce can be used, as pointed out in #1586. If it is decided to not add the assertion, maybe add to the documentation of the functions not covered by the SMT solver that some enforces might be required

@jeapostrophe
Copy link
Collaborator

Yea, that matches my priors too. One of the reasons Reach verification can be so fast is that we never use quantification so the theory is really small.

@Gungy2 Gungy2 marked this pull request as draft June 15, 2023 22:44
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.

2 participants